Documentation
¶
Overview ¶
Package agent is the CLI-owned client and service for the Conductor agent endpoints (/api/agent/*), which are served by the merged server but are not part of the conductor-go SDK. The package is layered: domain types here, the transport boundary in client.go, and use-case orchestration in service.go. No file paths or transport types cross into this package — callers pass parsed bytes and structs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentSummary ¶
type AgentSummary struct {
Name string `json:"name"`
Version int `json:"version"`
Type string `json:"type"`
Description string `json:"description"`
Tags []string `json:"tags"`
}
AgentSummary is the list view of a registered agent.
type Client ¶
type Client interface {
CheckSupported(ctx context.Context) error
Run(ctx context.Context, req RunRequest) (Execution, error)
Deploy(ctx context.Context, framework string, rawConfig json.RawMessage) (DeployResult, error)
Stream(ctx context.Context, executionID, lastEventID string) (<-chan SSEEvent, <-chan error)
List(ctx context.Context) ([]AgentSummary, error)
Get(ctx context.Context, name string, version *int) (json.RawMessage, error)
Delete(ctx context.Context, name string, version *int) error
Compile(ctx context.Context, def json.RawMessage) (json.RawMessage, error)
SearchExecutions(ctx context.Context, filter ExecutionFilter) (ExecutionPage, error)
GetExecution(ctx context.Context, id string) (json.RawMessage, error)
Status(ctx context.Context, id string) (json.RawMessage, error)
Respond(ctx context.Context, id string, resp HumanResponse) error
Prune(ctx context.Context, req PruneRequest) (PruneResult, error)
}
Client is the transport boundary for agent endpoints. It returns domain types or raw JSON for free-form payloads — never *http.Response or transport types.
type DeployResult ¶
DeployResult reports the outcome of publishing (deploying) an agent definition without starting an execution. RequiredWorkers lists the tool task types the caller must serve for the deployed agent to run (empty for a native agent).
type EventSink ¶
EventSink receives streamed events. It decouples streaming from rendering: the cmd layer supplies a terminal sink, the TUI a sink that posts UI messages, tests a recorder. Returning an error stops the stream.
type EventType ¶
type EventType string
EventType enumerates the streamed agent event kinds. Defining them as named constants keeps event handling free of magic strings — the SSE parser tags each event and the renderers switch on these.
const ( EventThinking EventType = "thinking" EventToolCall EventType = "tool_call" EventToolResult EventType = "tool_result" EventHandoff EventType = "handoff" EventMessage EventType = "message" EventWaiting EventType = "waiting" EventGuardrailPass EventType = "guardrail_pass" EventGuardrailFail EventType = "guardrail_fail" EventError EventType = "error" EventDone EventType = "done" )
type ExecutionFilter ¶
type ExecutionFilter struct {
AgentName string
Status string
StartTimeFrom int64
StartTimeTo int64
Start int
Size int
}
ExecutionFilter narrows an execution search. Start/Size paginate. StartTimeFrom/StartTimeTo are epoch milliseconds; zero means unbounded.
type ExecutionPage ¶
type ExecutionPage struct {
TotalHits int64 `json:"totalHits"`
Results []ExecutionSummary `json:"results"`
}
ExecutionPage is one page of execution-search results.
type ExecutionSummary ¶
type ExecutionSummary struct {
ExecutionID string `json:"executionId"`
AgentName string `json:"agentName"`
Version int `json:"version"`
Status string `json:"status"`
StartTime string `json:"startTime"`
EndTime string `json:"endTime"`
ExecutionTime int64 `json:"executionTime"`
}
ExecutionSummary is the list view of a single execution.
type HumanResponse ¶
HumanResponse answers a human-in-the-loop task.
type PruneRequest ¶
PruneRequest selects terminal executions to delete (or archive) by age.
type PruneResult ¶
type PruneResult struct {
Removed int
}
PruneResult reports how many execution records were removed.
type RunRequest ¶
type RunRequest struct {
Name string
Prompt string
Definition json.RawMessage
Framework string
SessionID string
}
RunRequest starts an agent execution. Definition is an already-parsed inline agent config (the cmd layer read it from disk and marshaled it to JSON); it is opaque here. When Framework is non-empty the execution starts through the framework envelope (skill/openai/… agents) instead of the native agent-config envelope.
type SSEEvent ¶
type SSEEvent struct {
ID string
Type EventType
Data json.RawMessage
}
SSEEvent is one decoded Server-Sent Event. Data stays raw so the transport layer never needs to know each event's payload schema — the presentation layer decodes it.
func (SSEEvent) ResolvedType ¶
ResolvedType returns the event's type, preferring the SSE event field and falling back to a "type" field inside the data payload (some events carry the kind there).
type Service ¶
type Service interface {
CheckSupported(ctx context.Context) error
Run(ctx context.Context, req RunRequest) (Execution, error)
Deploy(ctx context.Context, framework string, rawConfig json.RawMessage) (DeployResult, error)
StreamExecution(ctx context.Context, executionID, lastEventID string, sink EventSink) error
List(ctx context.Context) ([]AgentSummary, error)
Get(ctx context.Context, name string, version *int) (json.RawMessage, error)
Delete(ctx context.Context, name string, version *int) error
Compile(ctx context.Context, def json.RawMessage) (json.RawMessage, error)
SearchExecutions(ctx context.Context, filter ExecutionFilter) (ExecutionPage, error)
GetExecution(ctx context.Context, id string) (json.RawMessage, error)
Status(ctx context.Context, id string) (json.RawMessage, error)
Respond(ctx context.Context, id string, resp HumanResponse) error
Prune(ctx context.Context, req PruneRequest) (PruneResult, error)
}
Service is the agent use-case layer. It depends only on Client and is free of presentation and transport concerns.
func NewService ¶
NewService returns a Service backed by the given Client.