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:
- Spawn the ACP agent process (e.g.,
gemini --acp,openclaw acp) - Send
initializerequest, receive capabilities - Send
initializednotification - Create a session via
session/create - For each user turn: send
session/prompt, streamsession/updatenotifications - 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.