Documentation
¶
Index ¶
- func LookupBinary(name string, path string) (string, error)
- type Attachment
- type AttachmentStore
- type Availability
- type BinaryProbe
- type Descriptor
- type Event
- type EventKind
- type ExternalSession
- type ImageGenerator
- type ImageRequest
- type Input
- type Permissions
- type Registry
- type RuntimeAgent
- type SessionAttachment
- type StartSessionRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Attachment ¶ added in v0.2.4
type Attachment struct {
Path string
Name string
MIMEType string
// Image marks a picture the agent can be shown.
Image bool
}
Attachment is a file on this machine the agent can open.
type AttachmentStore ¶
type AttachmentStore interface {
SaveExternalAgentSession(ctx context.Context, attachment SessionAttachment) error
GetExternalAgentSession(ctx context.Context, sessionID string) (SessionAttachment, error)
// ListExternalAgentSessions returns the attachments of those sessions
// that have one.
ListExternalAgentSessions(ctx context.Context, sessionIDs []string) ([]SessionAttachment, error)
DeleteExternalAgentSession(ctx context.Context, sessionID string) error
}
type Availability ¶
type BinaryProbe ¶ added in v0.2.0
type BinaryProbe struct {
// contains filtered or unexported fields
}
BinaryProbe remembers where an agent CLI was found and its version, so listing agents spawns `--version` once rather than on every prompt build.
func NewBinaryProbe ¶ added in v0.2.0
func NewBinaryProbe(name string, path string) *BinaryProbe
type Descriptor ¶
type Event ¶
type Event struct {
Kind EventKind `json:"kind"`
AgentID string `json:"agent_id"`
ExternalThreadID string `json:"external_thread_id,omitempty"`
ExternalSessionID string `json:"external_session_id,omitempty"`
ExternalTurnID string `json:"external_turn_id,omitempty"`
ItemID string `json:"item_id,omitempty"`
ToolName string `json:"tool_name,omitempty"`
ToolInput string `json:"tool_input,omitempty"`
Text string `json:"text,omitempty"`
Error string `json:"error,omitempty"`
At time.Time `json:"at"`
}
type EventKind ¶
type EventKind string
const ( EventTurnStarted EventKind = "turn.started" EventHeartbeat EventKind = "turn.heartbeat" EventMessageDelta EventKind = "message.delta" EventReasoningDelta EventKind = "reasoning.delta" EventToolStarted EventKind = "tool.started" EventToolOutputDelta EventKind = "tool.output.delta" EventToolCompleted EventKind = "tool.completed" EventDiffUpdated EventKind = "diff.updated" EventTurnCompleted EventKind = "turn.completed" EventTurnFailed EventKind = "turn.failed" )
type ExternalSession ¶
type ImageGenerator ¶ added in v0.2.4
type ImageGenerator interface {
GenerateImage(ctx context.Context, req ImageRequest) ([]byte, error)
}
ImageGenerator is an agent that draws images with its own tools: Codex does, Claude Code does not.
type ImageRequest ¶ added in v0.2.4
type Input ¶
type Input struct {
Text string
// Attachments are the files sent with the message; Text lists them too.
Attachments []Attachment
}
type Permissions ¶ added in v0.2.1
type Permissions struct {
// Mode is a permission mode (permission.ModeDefault, ...).
Mode string
// Readonly refuses every change without asking, whatever the mode.
Readonly bool
}
Permissions are what the agent may do unasked; each adapter maps them to its own terms.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry(agents ...RuntimeAgent) (*Registry, error)
func (*Registry) CanonicalID ¶ added in v0.1.9
type RuntimeAgent ¶
type RuntimeAgent interface {
ID() string
DisplayName() string
// Models are the models the agent suggests to pick from, default first.
Models(ctx context.Context) []string
Available(ctx context.Context) Availability
StartSession(ctx context.Context, req StartSessionRequest) (ExternalSession, error)
ResumeSession(ctx context.Context, session ExternalSession) (ExternalSession, error)
Send(ctx context.Context, session ExternalSession, input Input) (<-chan Event, error)
Interrupt(ctx context.Context, session ExternalSession) error
Close() error
}
type SessionAttachment ¶
type SessionAttachment struct {
SessionID string
AgentID string
ExternalThreadID string
ExternalSessionID string
CWD string
Model string
MetadataJSON string
CreatedAt time.Time
UpdatedAt time.Time
}
func (SessionAttachment) ExternalSession ¶ added in v0.1.5
func (a SessionAttachment) ExternalSession() ExternalSession
type StartSessionRequest ¶
type StartSessionRequest struct {
CWD string
Model string
Permissions Permissions
}
Directories
¶
| Path | Synopsis |
|---|---|
|
Package reply builds the transcript reply of an external agent's turn from its events, with bounded tool input, output and reasoning.
|
Package reply builds the transcript reply of an external agent's turn from its events, with bounded tool input, output and reasoning. |