A2UI.Plug.JSONRPC (A2UI v0.3.0)

Copy Markdown View Source

JSON-RPC 2.0 handler for A2UI.

Routes client actions and errors to the agent via the SSE handler process. Called by A2UI.Plug when a client sends POST /rpc.

Methods

  • a2ui.action — send a user action to the agent
  • a2ui.error — send a validation error to the agent

Request Format

{"jsonrpc":"2.0","method":"a2ui.action","params":{"connectionId":"abc123","action":{...}},"id":1}

Response Format

{"jsonrpc":"2.0","result":{"status":"ok"},"id":1}

Summary

Functions

handle(conn, agent, registry \\ ConnectionRegistry)

@spec handle(Plug.Conn.t(), GenServer.server(), atom()) :: Plug.Conn.t()

Handles a JSON-RPC POST request.