Skip to content

angee.agents_runtime_pydantic.acp

Map pydantic-ai stream events into the ACP updates consumed by agents/web.

The persisted vocabulary is deliberately the exact subset reduced by agents/web/src/acp-log.ts and acp-session.ts:

  • text/thought chunks: {sessionUpdate, content: {type: "text", text}};
  • tool calls: {sessionUpdate: "tool_call", toolCallId, title, status, rawInput};
  • tool results: {sessionUpdate: "tool_call_update", toolCallId, status, rawOutput}.

Keeping the mapping in this runtime addon lets a future container recorder emit the same runtime-neutral transcript without teaching the agents models about pydantic-ai event classes.

updates_for_event

python
def updates_for_event(event: Any) -> Iterable[dict[str, Any]]

Yield zero or more reducer-compatible ACP update payloads.

approval_requests

python
def approval_requests(requests: Any) -> list[dict[str, Any]]

Return neutral decision payloads for pydantic-ai approval requests.

Released under the AGPL-3.0 License.