Documentation
¶
Overview ¶
Package acp implements a preview Agent Client Protocol (ACP) version 1 companion. It speaks ACP over stdio and turns each prompt into an ordinary AMQ message. It never opens a socket, never executes tools, and never advertises ACP version 2.
Index ¶
Constants ¶
const ( EnvRoot = "AM_ROOT" EnvMe = "AM_ME" EnvTo = "AMQ_ACP_TO" EnvBaseRoot = "AM_BASE_ROOT" EnvSession = "AM_SESSION" EnvRootID = "AM_ROOT_ID" EnvBaseRootID = "AM_BASE_ROOT_ID" )
Environment variables that select the routing context. The pin variables are the same ones amq itself honors. This companion authenticates them and refuses on a mismatch instead of restating the CLI's routing policy.
const DeliveryStateQueued = "queued_to_inbox"
DeliveryStateQueued is the honest post-delivery state. The message sits in the recipient's inbox/new; consumption is a separate, unproven event.
const PromptSubject = "ACP prompt"
PromptSubject labels prompts arriving over the ACP companion so an operator reading a mailbox can tell where the message came from.
const ProtocolVersion = 1
ProtocolVersion is the only ACP version this companion speaks. It is never negotiated upward: a client asking for a newer version still receives 1 and decides for itself whether to disconnect.
const StopReasonEndTurn = "end_turn"
StopReasonEndTurn ends a prompt turn once the message is queued. The turn is genuinely over because this companion runs no model and requests no tools.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config is the resolved routing context for one amq-acp process.
func LoadConfig ¶
LoadConfig resolves the routing context from the environment. An absent root, an unusable handle, or a session pin that cannot be authenticated all refuse; there is no fallback to a guessed root.
type ContextError ¶
type ContextError struct {
Message string
}
ContextError marks a fail-closed routing refusal so the caller can report the repository's context-mismatch exit code.
func (*ContextError) Error ¶
func (e *ContextError) Error() string
type Delivery ¶
Delivery is the durable outcome of one prompt turn. The message is queued in the recipient's inbox; nothing here proves the recipient consumed it.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a single-connection ACP v1 agent. Requests are handled one at a time in arrival order, so the session table needs no locking.