SuperPi.Event.Renderer.ACP (super_pi v0.1.0)

Copy Markdown View Source

Renders events as Agent Client Protocol session/update payloads, for SuperPi.ACP.Server.

Output items:

  • {:update, map} - the update of a session/update notification.
  • {:permission, params, request_id} - params of a session/request_permission request. The server sends it and answers SuperPi.UI.Broker.respond(request_id, option_id).
EventACP
text_deltaagent_message_chunk
thinking_deltaagent_thought_chunk
tool_startedtool_call, status pending
permission_requestsession/request_permission for that tool call
ui_resolved of a permissiontool_call_update, status in_progress (on approval)
tool_completedtool_call_update, status completed or failed
tool_blockedtool_call_update, status failed
subagent_started, subagent_finisheda tool_call of kind other and its update
plan_updatedplan
mode_changedcurrent_mode_update
turn_*nothing. The server answers session/prompt with a stop reason.

A tool call is pending from tool_started until it is approved, or until it completes when no approval was needed. The permission option kinds are already ACP's (allow_once, allow_always, reject_once, reject_always), so the mapping is a rename of fields.

Running commands are shown as a tool_call of kind execute, never through the editor's terminal/* methods. SandboxRunner gives process-group kill, output spill and the sandbox, and an editor terminal gives none of that and bypasses permissions.deny.

Options: :session_id.

Summary

Functions

ACP kind of a tool: read, edit, search, execute, fetch or other.

Functions

kind(name)

@spec kind(String.t()) :: String.t()

ACP kind of a tool: read, edit, search, execute, fetch or other.