refactor(agent): move worker runtime into application layer
cmd/archie-agent used to own worker construction, NATS lifecycle, task execution, MCP setup, and workflow wiring. It now owns process input only and invokes internal/app/agentworker, while transport-specific NATS, boot-brief, and git-safety mechanics live under infrastructure.
This commit is contained in:
1 parent
0243c13d37
commit
45345cdfb6
35 files changed
+2901
-689
No files matched your search
@@ -0,0 +1,19 @@
|
||||
package agentexec
|
||||
|
||||
import "context"
|
||||
|
||||
// StageMessage is one decoded single-stage request together with the transport
|
||||
// operations that complete its delivery. Infrastructure owns the wire payload,
|
||||
// reply inbox, and acknowledgement mechanism; the worker only sees typed data.
|
||||
type StageMessage interface {
|
||||
Request() (AgentRequestMessage, error)
|
||||
Respond(context.Context, *AgentResponseEnvelope) error
|
||||
Ack() error
|
||||
Nak() error
|
||||
LogAttributes() []any
|
||||
}
|
||||
|
||||
// StageConsumer receives decoded single-stage requests.
|
||||
type StageConsumer interface {
|
||||
FetchStage(context.Context) (StageMessage, error)
|
||||
}
|
||||
@@ -37,7 +37,7 @@ func (f *fakePublisher) calls() int {
|
||||
}
|
||||
|
||||
// capturingHandler is a minimal slog.Handler that records every record it
|
||||
// receives, standing in for cmd/archie-agent's real stderr handler.
|
||||
// receives, standing in for the agentworker's wrapped process stderr handler.
|
||||
type capturingHandler struct {
|
||||
mu sync.Mutex
|
||||
records []slog.Record
|
||||
|
||||
Reference in new issue
Block a user