Documentation
¶
Overview ¶
Package acpupdate parses ACP session/update notifications into a small set of neutral events the runtime driver forwards to the gateway north side. The sessionUpdate variant names and content shapes match the ACP v1 schema (agentclientprotocol/agent-client-protocol, schema/v1/schema.json).
Index ¶
Constants ¶
const ( TranscriptRoleUser = "user" TranscriptRoleAssistant = "assistant" TranscriptRoleReasoning = "reasoning" )
Transcript roles for replayed session/load message chunks.
Variables ¶
This section is empty.
Functions ¶
func ParseReplayChunk ¶
func ParseReplayChunk(params json.RawMessage) (role, text string, ok bool)
ParseReplayChunk extracts one replayed message chunk from a session/update delivered during session/load. Unlike Parse, it includes user_message_chunk (replayed user turns) and maps each chunk to a transcript role. Non-text content blocks and non-message updates report ok=false.
Types ¶
type Event ¶
type Event struct {
Kind Kind
Text string
Data json.RawMessage
}
Event is one neutral update. Text carries streamed text for KindText and KindReasoning; Data carries the raw ACP update object for structured kinds.
func Parse ¶
func Parse(params json.RawMessage) []Event
Parse converts one session/update params payload into zero or more events. user_message_chunk (replayed only on session/load) and unknown variants produce no events.
type Kind ¶
type Kind string
const ( KindText Kind = "delta" // agent_message_chunk (text) KindReasoning Kind = "reasoning" // agent_thought_chunk KindContent Kind = "content" // agent_message_chunk (non-text) KindPlan Kind = "plan" // plan KindToolCall Kind = "tool_call" // tool_call / tool_call_update KindUsage Kind = "usage" // usage_update KindCommands Kind = "available_commands" // available_commands_update KindSessionInfo Kind = "session_info" // session_info_update KindMode Kind = "mode" // current_mode_update KindConfigOptions Kind = "config_options" // config_option_update )