Lab: Web, CLI, ACP, SDK, and Host
Surfaces adapt protocols, Host owns runtime, and clients project SessionEvents—there is no second agent core
surface input → ctx.agents → session/event → projectionHow does a Web UI button become agent behavior without making the browser own business state?
Clients are service windows speaking different languages; Host is the shared back office. Windows translate requests and present records, while rules and authoritative state stay behind them.
Mechanism
ctx.apiProxy provides a transport-neutral Host gateway and each Host stream owns its event subscriptions. Web client modules compose through dsh.client scanning and update through HMR.
ACP, CLI, Headless, and SDK create, resume, or drive agents through ctx.agents and render from session/event. Human commands may bypass model turns through ctx.commands while preserving service boundaries.
Adapt input
Browser RPC, ACP request, or CLI command becomes a Host call.
What extensions must preserve
- Client surfaces do not own a second authoritative agent state
- Durable transcripts consume session/event, not agent/*
- Each Host stream owns its subscriptions and disposal
The tempting wrong turns
- ×Letting optimistic browser state overwrite authoritative results
- ×Writing agent/status into durable transcripts
- ×Sharing one global broadcaster and leaking events across connections
Do not trust the conclusion—verify it
These anchors are pinned to official deepseek-harness@47f9438; account for later breaking changes when reading current upstream.
Pause for ten seconds before revealing
Why should an SDK consume session/event instead of only assistant text?
The final chapter packages tools, providers, and surfaces into profiles and bundles with versioning, tests, and upstream alignment.