Agent SDK v2 packages and conformance
Child of epic 7191 "Converge every runner on one agent contract: ACP-native". Settled inputs: PRD (task 7189), architecture (task 7190). Architecture boundary C9. Depends on the rename child (the spec file `packages/agent-sdk/spec/jaah-extension.json`).
## Original requirements (PRD, verbatim)
**R7 — Jaah Agent SDK v2, rewritten (A6).** Python and TypeScript packages implementing the ACP agent side plus the Jaah extension: writing an agent = implementing `session/prompt` and emitting `session/update`; identity, settle, questions, credentials are the library's. Not compatible with v1. The node accepts SDK v2 agents (ADR-0159's bundle/snapshot/supervisor model carries over, manifest updated).
**R8 — Adoption package, public-shaped but private (D2).** Licence Apache-2.0; venues shaped for public release (GitHub `jaah-ai/agent-sdk`, npm `@jaah/agent-sdk`, PyPI, spec page in the reader docs), but **kept private** until the operator decides to publish: repo private, packages not pushed to public registries, spec docs not on the public docs site. Deliverables: extension specification, conformance test suite runnable against any ACP agent without reading Jaah source, one reference agent per language, README/docs.
## Approach (architecture, verbatim)
**C9: SDK v2 library + conformance + reference agents + mirror.** Python `jaah-agent-sdk` (import `jaah_agent`) and TS `@jaah/agent-sdk`, both built on the official ACP SDKs (`agent-client-protocol` on PyPI, `@agentclientprotocol/sdk`). Authors implement `prompt()` and emit updates, and the library owns `initialize`, the extension negotiation, `task/complete`, `input/request` and credentials. The conformance runner (an ACP client + mock Jaah extension, profiles `acp-core` and `jaah-extension`) runs from `packages/agent-sdk` alone. Reference agents `examples/python`, `examples/typescript`. Apache-2.0 `LICENSE` + metadata. The mirror workflow pushes to private `jaah-ai/agent-sdk`. Nothing is published.
Layout: `packages/agent-sdk/` (`spec/`, `python/`, `typescript/`, `conformance/`, `examples/`, `LICENSE` Apache-2.0). Mirror: `.github/workflows/agent-sdk-mirror.yml` (subtree push to private `jaah-ai/agent-sdk` on every develop merge; decisions A4, A7). `tools/sync_agent_sdk.py` and the vendor copy are left dormant. Extension surface (§3.5): verb `a.b_c` ↔ ACP method `_jaah.ai/a/b_c`; capability `clientCapabilities._meta["jaah.ai"] = {"version": 1, "methods": [...]}`; an agent that never calls `_jaah.ai/*` still runs (profile `acp-core`). Key delivery for SDK agents: `config_file` via the library's `credential.get` — never an env var. Spec text uses ACP extension conventions (capability negotiation in `initialize`, `_meta`, underscore-prefixed methods) and lists every extension method with its daemon verb; spec page stays out of the public docs site.
Credentials & reach: AC-12, mirror | `users/roman@gmind.tech/github_admin` (repo admin on `jaah-ai/agent-sdk`) | verified (forge read shows it private) — configure the mirror's secret by name only, never write its value. AC-12 "nothing published" | public npm / PyPI read | needs nothing (anonymous read). AC-10/AC-11 build legs | worktree only.
Out of scope: Do NOT wire SDK v2 agents into node dispatch (the "SDK v2 agents on the node" child), and do NOT run the conformance suite against Gemini in CI (that leg is verified by the acceptance child). PRD §5 verbatim:
- MUST NOT delete the legacy paths (v1 SDK `apps/jaahd/vendor/agent-sdk`, `tools/jaah_agent_run.py` v1 mode, …). MUST NOT file that task (D5).
- MUST NOT publish: no public repo visibility flip, no `npm publish`/PyPI upload of v2, no spec on the public docs site (D2).
- MUST NOT change runner permission posture (D6). MUST NOT drop or regress any current Claude Code capability (R10). MUST NOT remove the console terminal/TUI view (D3). MUST NOT submit an upstream ACP RFD (D8). MUST NOT integrate with T3 Code's RPC or MCP API.
- MUST NOT change the task lifecycle states or the merge lane. MUST NOT change billing. MUST NOT add vendors. MUST NOT touch `apps/mobile`.
- MUST NOT put a token in the agent's environment or weaken process-ancestry identity (ADR-0083); MUST NOT add a second verb table.
Done means:
- AC-10 (R6, R8) Extension spec + conformance. → verify: run the conformance suite against (a) both reference agents: pass; (b) an unmodified third-party ACP agent (e.g. Gemini CLI native ACP): passes the "plain ACP agent runs" profile (deferred — verified by the acceptance child on a dev node with Gemini at the pin); (c) the suite is runnable from the SDK repo alone with no Jaah source checkout (run it from a copy of `packages/agent-sdk` outside the monorepo). Spec text uses ACP extension conventions and lists every extension method with its daemon verb.
- AC-11 (R7) SDK v2 (build half). → verify: from the SDK repo, build the Python and TS packages; the TS and Python reference agents each implement only `session/prompt` + `session/update` handlers plus at most one settle call.
- AC-12 (R8) Private but publish-ready. → verify: `jaah-ai/agent-sdk` has an Apache-2.0 `LICENSE` and package metadata `license: Apache-2.0`; repo visibility private; `npm view @jaah/agent-sdk` and PyPI lookup show no new public v2 release; the spec page is not reachable on the public docs site. The mirror workflow ran on the merge and the private repo shows the mirrored tree.
Outcome
SDK v2 shipped in packages/agent-sdk: Python + TS libraries, conformance suite (acp-core, jaah-extension), reference agents (25/25), spec page, Apache-2.0. Merged #5947; private mirror ran and the tree is live. Gemini leg deferred to the acceptance child; hardening draft #7351.
Artifacts
Activity
- Draft
- Ready
- Runner started
- Runner ended (done)