Copy-paste solutions for complete, real-world ARCP patterns. Each recipe wires
together multiple protocol features around an actual LLM workload; unlike the
samples/ programs — which isolate a single concept — recipes
are end-to-end shapes you can adapt directly to production use cases.
Kotlin recipe source lives in recipes/.
multi-agent-budget — OpenAI
A planner decomposes a question into sub-questions and delegates each to a worker that carries a budget slice carved from the planner's remaining cap.
Features demonstrated
CostBudget/BudgetAmountsubset enforcementLeaseGranted/LeaseRevokeddelegation handshakeBUDGET_EXHAUSTEDhandling — sub-questions that no longer fit are skipped before theagent.delegaterather than failing mid-flightStandardMetrics.COST_USDemitted after each delegate so the runtime's subset check sees an honest remaining balance
Key types: BudgetRegistry, BudgetCounter, ARCPException.BudgetExhausted
See guides/leases.md and guides/delegation.md.
email-vendor-leases — Claude
A triage agent drives Claude through a tool-use loop with three tools, but the
lease grants only the two read-only ones. When the model proposes send_reply
the agent's lease validator throws PERMISSION_DENIED and feeds the denial
back to Claude, which observes the deny and returns a drafted-but-unsent reply.
Features demonstrated
PermissionRequest/PermissionGrant/PermissionDenyflowLeaseGrantedwithoperationconstraints on individual tool namesEventEmitwitharcpx.acme.email.v1.parsedvendor event type — dashboards recognising the namespace can render parsed metadata speciallyExtensionRegistry.advertise("arcpx.acme.email.v1")capability negotiation
Key types: PermissionRequest, PermissionDeny, EventEmit, ExtensionRegistry
See guides/leases.md and guides/vendor-extensions.md.
stream-resume — GLM-5
A writer pipes GLM-5's streaming deltas into StreamChunk envelopes
(~200 chars each). The client deliberately drops the transport mid-stream,
opens a fresh connection with Resume, and the runtime replays every envelope
past the cutoff from the EventLog so reassembly completes seamlessly across
the gap.
Features demonstrated
StreamOpen/StreamChunk/StreamClosewithResultChunkEncoding.UTF8EventLog.openFile(path)— every envelope lands in a SQLite log under a monotonicevent_seqResume(afterMessageId, includeOpenStreams = true)— client reconnects and receives only the envelopes it missedJobCheckpointbefore the gap so resume can skip already-processed stepsBackpressuresignalling when the consumer falls behind
Key types: EventLog, Resume, StreamChunk, JobCheckpoint
See guides/resume.md and guides/job-events.md.
mcp-skill — MCP bridge
An MCP server fronts the multi-agent-budget planner so any MCP host
(Claude Code, Cursor, Desktop) can invoke it as a single research tool.
The bridge keeps one long-lived ARCP session; each MCP tool call submits a
fresh planner job and returns the terminal result as the tool's text response.
Features demonstrated
- Long-lived
ARCPClientsession shared across many short MCP calls JobSubmitwithidempotencyKeyso duplicate MCP retries don't re-executeJobResult/JobCompletedterminal-event collectionPing/Pongkeepalive loop on the shared session
Key types: ARCPClient, JobSubmit, JobCompleted, Ping
See guides/jobs.md and transports.md.
| Topic | Guide |
|---|---|
| Lease delegation and budget subsets | guides/leases.md |
Vendor extension naming and EventEmit |
guides/vendor-extensions.md |
EventLog append and replay |
guides/resume.md |
Job lifecycle and JobSubmit fields |
guides/jobs.md |
Streaming chunks and Backpressure |
guides/job-events.md |
Ping/Pong, Ack/Nack, Cancel |
guides/delegation.md |