Documentation
¶
Index ¶
- func MergeEnv(overrides map[string]string) []string
- func Register(name string, factory Factory)
- type Agent
- type ConfigOption
- type Factory
- type OpenRequest
- type ReasoningUpdateFilter
- type SessionLister
- type SessionLoadResolver
- type SessionModelSelector
- type StableSessionResolver
- type TerminalUpdateDetector
- type TranscriptEntry
- type TranscriptLoader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MergeEnv ¶
MergeEnv returns the current process environment with the given overrides applied on top: keys present in overrides replace any inherited value, and new keys are appended. The result is sorted for deterministic output. An empty overrides map returns nil so the transport falls back to os.Environ() unchanged.
Types ¶
type Agent ¶
type Agent interface {
Name() string
Open(ctx context.Context, h transport.Handlers) (transport.Transport, error)
InitializeParams() map[string]any
SessionNewParams(modelID string) map[string]any
SessionLoadParams(sessionID string) map[string]any
PromptParams(sessionID, input, modelID string) map[string]any
Cancel(ctx context.Context, t transport.Transport, sessionID string)
}
type ConfigOption ¶
type Factory ¶
type Factory func(OpenRequest) (Agent, error)
type OpenRequest ¶
type OpenRequest struct {
Service acpservice.ServiceConfig
CWD string
}
type ReasoningUpdateFilter ¶
type ReasoningUpdateFilter interface {
AcceptReasoningUpdate(params json.RawMessage) bool
}
type SessionLister ¶
type SessionLoadResolver ¶
type SessionLoadResolver interface {
ResolveLoadSessionID(ctx context.Context, t transport.Transport, cwd, requestedSessionID string) (loadSessionID, boundSessionID string, err error)
}
SessionLoadResolver maps a host-visible session id to the backend id that session/load accepts, plus the host-bound id the loaded session should be known by (empty means the requested id).
type SessionModelSelector ¶
type SessionModelSelector interface {
SelectSessionModel(ctx context.Context, t transport.Transport, sessionID, modelID string, opts []ConfigOption) ([]ConfigOption, error)
}
type StableSessionResolver ¶
type StableSessionResolver interface {
ResolveBoundSessionID(ctx context.Context, t transport.Transport, cwd, rawSessionID string) (string, error)
}
StableSessionResolver maps the raw session/new protocol id to the agent's stable, host-visible session id (e.g. a thick codex bridge resolving the persisted thread id). Returning "" without an error means the stable id is not resolvable yet (typically before the first prompt persists the session); the driver then re-resolves after each prompt and emits a late session event once the stable id settles. The raw protocol id keeps being used on the wire either way. Verified live: the thin codex-acp adapter does NOT need this — its raw session ids are already stable (listable and loadable from a fresh process after the first turn).
type TerminalUpdateDetector ¶
type TerminalUpdateDetector interface {
IsTerminalUpdate(params json.RawMessage) bool
}
type TranscriptEntry ¶
type TranscriptEntry struct {
Role string `json:"role"` // user | assistant | reasoning
Text string `json:"text"`
}
TranscriptEntry is one coalesced transcript message returned by a TranscriptLoader.
type TranscriptLoader ¶
type TranscriptLoader interface {
LoadSessionTranscript(ctx context.Context, sessionID string) ([]TranscriptEntry, error)
}
TranscriptLoader replaces the runtime's generic session/load transcript replay with an agent-specific implementation (e.g. a thick codex bridge reading its own backend). Agents without it get the generic path: a transient connection that replays the session via session/load and collects the message chunks.