Managoat.ACP (managoat_acp v0.1.1)

Copy Markdown View Source

The client side of the Agent Client Protocol, as a session that outlives the turn.

ACP is JSON-RPC 2.0 over newline-delimited JSON between a client (an editor, or a platform such as Fountain) and an agent (claude-agent-acp, codex-acp, gemini, opencode). This package is the client. It is not a schema library: messages are maps, the protocol's wire names are used as they are, and what the package adds is the part of a client that the spec leaves to you and that a real deployment cannot do without.

ModuleRole
Managoat.ACP.PeerOne connection, for as many turns as its owner sends it. Drives initializesession/new / session/resume / session/loadsession/prompt, answers the agent's requests, and reports to its owner as {:acp, ref, payload}. Reattaches to a turn already in flight, discards a session/load replay, and keeps a permission request open for a human.
Managoat.ACP.TransportThe seam: a writer function for outbound frames. Inbound bytes reach the peer through Peer.stdout/2.
Managoat.ACP.ProtocolFraming and JSON-RPC encoding. Pure.
Managoat.ACP.PermissionsWhat answers session/request_permission: a policy map matched most-specific-first, a narrow-never-widen merge, and the fail-closed rules for answering from the options the agent offered.
Managoat.ACP.Blockssession/update notifications and permission requests as the block maps a transcript renders.
Managoat.ACP.UsageThe end-of-turn token figure, normalised from the session/prompt result.
Managoat.ACP.Tracertool_call / tool_call_update as OpenTelemetry spans, for every runtime.
Managoat.ACP.Testing.ScriptedAgentAn agent inside the BEAM that answers the handshake and streams scripted updates, for a host's tests.

The README carries the owner message contract and the comparison against the two ACP packages on hex.