Documentation
¶
Overview ¶
Host-side scaffolding for the team-agent-workflow showcase: the temporary task fixture, the workspace stage audit, the terminal renderer, and the protocol text handed to the leader.
None of this touches the SDK on purpose. It is here to keep main.go about the three SDK constructions that matter (Agent, delegation.Service, team.Option) and to make the point that everything below is host business the SDK deliberately does not model.
Command team-agent-workflow is the v1 team-collaboration showcase (design doc §9.7 / §9.8): one leader Agent drives three delegated roles — plan (read-only) -> impl (workspace-write) -> review (read-only) — through the host-injected delegate_to_agent MCP tool, and the whole team's progress arrives on the leader's single event stream.
What the SDK contributes here, in three lines of construction:
- delegation.NewService(...) is the entire delegation runtime: registry, event bus, delegator, per-run MCP sidecar (loopback listener, random bearer token, http.Server lifecycle) and result recording. The pre-v1 version of this showcase hand-wrote 323 lines for exactly this.
- delegation.Local(key, runner, policy) registers an in-process Runner as a delegatable role, so each role is one *adaptor.Agent value wrapped in an ordinary host decorator — no per-role SDK instance, no A2A server, no port to manage.
- team.Option() attaches the service to the leader in one option: the sidecar is declared as a runtime service with a typed MCP endpoint, its lifecycle is bound to the run, and every delegation event is folded into the leader's own Events() channel as adaptor.SubagentUpdate.
Everything else — the temporary workspace fixture, the terminal renderer, the workspace stage audit, and the protocol text handed to the leader — is plain host logic and lives in host.go.
LIVE ONLY, and it costs real money: one leader run plus three role runs against the selected local CLIs. There is therefore no default agent (-leader is required), no fallback that picks one for you, and no test ever invokes main or a local CLI. It is not part of examples/run_examples.ps1.
Usage:
./examples/showcases/team-agent-workflow/start-all.sh claude go run ./examples/showcases/team-agent-workflow -leader=claude go run ./examples/showcases/team-agent-workflow -leader=claude -plan=codex -review=codex go run ./examples/showcases/team-agent-workflow -leader=claude -keep-workspace go run ./examples/showcases/team-agent-workflow -leader=claude -web-mode go run ./examples/showcases/team-agent-workflow -leader=claude -web-mode -web-addr=0.0.0.0:8080 -web-cors=https://chat.example.com