Documentation
¶
Overview ¶
Package acp exposes the Coding Runtime through Agent Client Protocol v1.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalid means ACP input is malformed or unsupported. ErrInvalid = errors.New("coding acp: invalid input") // ErrSessionNotFound means no active ACP session owns the supplied ID. ErrSessionNotFound = errors.New("coding acp: session not found") // ErrSessionBusy means a prompt is already active for the session. ErrSessionBusy = errors.New("coding acp: session busy") // ErrClosed means the ACP server or session has been closed. ErrClosed = errors.New("coding acp: closed") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Factory SessionFactory
AgentInfo Implementation
Limits Limits
Logger *slog.Logger
}
Config supplies process-level ACP dependencies.
type Controller ¶
type Controller interface {
Prompt(context.Context, ...ai.Message) iter.Seq2[coding.Event, error]
Continue(context.Context) iter.Seq2[coding.Event, error]
Resolve(context.Context, approval.Resolution) iter.Seq2[coding.Event, error]
ResolveQuestion(context.Context, question.Resolution) iter.Seq2[coding.Event, error]
ResolvePlanReview(context.Context, planreview.Resolution) iter.Seq2[coding.Event, error]
RejectQuestion(context.Context, string, string) iter.Seq2[coding.Event, error]
Cancel() error
Snapshot() coding.State
SetMode(context.Context, coding.OperatingMode) error
Models() []modelcatalog.Entry
SwitchSessionModel(context.Context, modelcatalog.Selection) error
Close(context.Context) error
}
Controller is the narrow Runtime surface consumed by ACP sessions.
type Implementation ¶
Implementation is the protocol-neutral identity advertised by the ACP adapter. The SDK representation stays private to this package.
type Limits ¶
type Limits struct {
MaxSessions int
MaxMCPServers int
MaxPromptBlocks int
MaxPromptBytes int
MaxBinaryBytes int
ListPageSize int
}
Limits bound one ACP process and its untrusted protocol input.
func DefaultLimits ¶
func DefaultLimits() Limits
DefaultLimits returns conservative process and request bounds.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server owns one ACP connection and its active Runtime sessions.
type SessionFactory ¶
type SessionFactory interface {
Open(context.Context, SessionSpec) (Controller, error)
List(context.Context) ([]SessionMetadata, error)
Delete(context.Context, string) error
}
SessionFactory owns Runtime construction and durable metadata discovery.
type SessionMetadata ¶
SessionMetadata is the durable subset returned by session/list.
type SessionSpec ¶
type SessionSpec struct {
ID string
CWD string
MCPDefinitions mcp.Definitions
}
SessionSpec identifies one Runtime to create or reopen.