Demonstrates ARCP v1.1's chunked-result streaming. The agent calls
ctx.streamResult() to obtain a ResultStream, writes ~30 text
chunks, and finalize()s — which emits the terminating
job.result with result_id and result_size. The client's
handle.collectChunks() reassembles the payload.
In one terminal:
pnpm tsx examples/result-chunk/server.tsIn a second terminal:
pnpm tsx examples/result-chunk/client.ts- §8.4
result_chunkevent kind andmore: falseterminator. - §8.4
job.resultcarryingresult_id+result_sizeinstead of inlineresult. - Client helper
JobHandle.collectChunks()reassembles into a string/Buffer.
| Env var | Default | Used by |
|---|---|---|
ARCP_DEMO_PORT |
7893 |
server |
ARCP_DEMO_URL |
ws://127.0.0.1:7893/arcp |
client |
ARCP_DEMO_TOKEN |
demo-token |
both |