internal/domain/workflow imported internal/agentexec for its protocol types, pulling the AI runtime into every binary that touches workflow types. The request, result and runner contract now live in internal/domain/agentrun; agentexec keeps the runtime. The model catalog cache moves from servicekit into modelcatalog and WaitForPeer into staterpc, so archie-state-store and archie-messaging no longer link the AI runtime.
24 lines
738 B
Go
24 lines
738 B
Go
package agentrun
|
|
|
|
import "context"
|
|
|
|
// Runner executes one autonomous stage against an already prepared workspace.
|
|
type Runner interface {
|
|
// report, when non-nil, is notified once per completed tool call.
|
|
Run(ctx context.Context, workspace string, req Request, report ToolCallReporter) (Result, error)
|
|
}
|
|
|
|
// ToolCallReport is one completed tool invocation, reported through a
|
|
// ToolCallReporter.
|
|
type ToolCallReport struct {
|
|
Tool string
|
|
// Detail is a clipped one-line summary: the tool's result, or
|
|
// "error: <message>" if it failed.
|
|
Detail string
|
|
Failed bool
|
|
}
|
|
|
|
// ToolCallReporter receives one ToolCallReport per completed tool call. A nil
|
|
// reporter is valid and reports nothing.
|
|
type ToolCallReporter func(ToolCallReport)
|