agent

package
v0.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

func NewClient

func NewClient(t transport.Config) Client

NewClient returns a Client backed by the shared transport.

type DeployResult

type DeployResult struct {
	AgentName       string
	RequiredWorkers []string
}

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

type EventSink interface {
	OnEvent(SSEEvent) error
}

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 Execution

type Execution struct {
	ID        string
	AgentName string
	Status    string
}

Execution identifies a started or running agent execution.

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

type HumanResponse struct {
	Approved bool
	Reason   string
	Message  string
}

HumanResponse answers a human-in-the-loop task.

type PruneRequest

type PruneRequest struct {
	OlderThanDays int
	Archive       bool
}

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

func (e SSEEvent) ResolvedType() EventType

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

func NewService(c Client) Service

NewService returns a Service backed by the given Client.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL