Module acp

Module acp 

Source
Expand description

AcpController: manages agent CLIs that speak the Agent Client Protocol (ACP).

ACP is a JSON-RPC 2.0 protocol over stdin/stdout — the “LSP for AI agents.” Instead of custom per-provider output parsing, ACP provides a standardized protocol for session management, prompting, and streaming events.

Lifecycle:

  1. Spawn the ACP agent process (e.g., gemini --acp, openclaw acp)
  2. Send initialize request, receive capabilities
  3. Send initialized notification
  4. Create a session via session/create
  5. For each user turn: send session/prompt, stream session/update notifications
  6. On close: send shutdown + exit

I/O model (similar to PersistentSubprocessController):

  • stdin_writer: sends JSON-RPC requests/notifications to agent
  • stdout_reader: reads JSON-RPC responses/notifications, persists + broadcasts
  • process_waiter: monitors process lifecycle

See: https://github.com/agentclientprotocol/agent-client-protocol

Structs§

AcpController
AcpController manages an ACP-speaking agent process.
AcpInner 🔒
Inner state protected by mutex.

Constants§

ACP_OUTPUT_SUBJECT
WPS file subject name for ACP output.
BLOCK_CONTROLLER_ACP
Controller type constant.