The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
Publish the Autonomous Harness provider protocol
0xken15ad562d08e03c
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlnew file mode 100644index 000000000..4036e381a--- /dev/null+++ b/.github/workflows/ci.yml@@ -0,0 +1,70 @@+name: CI++on:+ push:+ branches: [main]+ pull_request:++jobs:+ build:+ name: build (${{ matrix.package }})+ runs-on: ubuntu-latest+ strategy:+ fail-fast: false+ matrix:+ # example-provider is included for typecheck + unit tests ONLY. Its end-to-end path spawns a+ # real `claude` and calls a live model, which would make CI depend on a model being reachable+ # and on what it happens to say. Those tests replay a recorded turn instead.+ package: [reference-provider, example-provider]+ defaults:+ run:+ working-directory: ${{ matrix.package }}+ steps:+ - uses: actions/checkout@v4+ - uses: actions/setup-node@v4+ with:+ node-version: 20+ cache: npm+ cache-dependency-path: ${{ matrix.package }}/package-lock.json+ - run: npm ci+ - run: npm run typecheck+ - run: npm test++ conformance:+ # The point of this job: it proves on every change that the runner and the reference+ # implementation still agree — the same thing every partner is asked to prove about their own+ # endpoint. If the runner drifts from the spec, this is where it shows.+ name: conformance+ runs-on: ubuntu-latest+ steps:+ - uses: actions/checkout@v4+ - uses: actions/setup-node@v4+ with:+ node-version: 20+ cache: npm+ cache-dependency-path: reference-provider/package-lock.json++ - run: npm ci+ working-directory: reference-provider++ - name: Start the reference provider+ working-directory: reference-provider+ run: |+ STEP_DELAY_MS=0 npx tsx src/server.ts &+ for _ in $(seq 1 60); do+ curl -sf http://127.0.0.1:4501/.well-known/agent-card.json >/dev/null && exit 0+ sleep 1+ done+ echo "reference provider did not come up"; exit 1++ - name: Run the conformance suite+ working-directory: reference-provider+ # The runner exits non-zero on any failure. The two flags unlock the three clauses that need+ # provider-specific knowledge; without them those report SKIP with a reason, which is correct+ # but weaker cover than we want on our own reference.+ run: |+ npx tsx src/conformance.ts \+ --url http://127.0.0.1:4501 \+ --key ci \+ --bad-key bad-key \+ --ask-phrase "ask me something"diff --git a/.gitignore b/.gitignorenew file mode 100644index 000000000..595db8798--- /dev/null+++ b/.gitignore@@ -0,0 +1,10 @@+node_modules/+dist/+.tsbuildinfo+.DS_Store++# Per-deployment state, never source:+# agents.json names real directories on the machine it runs on+# sessions.json maps A2A contextIds to Claude session ids+example-provider/agents.json+example-provider/sessions.jsondiff --git a/CHANGELOG.md b/CHANGELOG.mdnew file mode 100644index 000000000..60afcbef8--- /dev/null+++ b/CHANGELOG.md@@ -0,0 +1,18 @@+# Changelog++The spec is a compatibility contract (see §12 of `spec/README.md`), so every change here says whether+it is additive or breaking. Additive changes are safe for a deployed integration; breaking ones are+not, and get a new revision served alongside the old.++## [0.1.0] — 2026-08-04++First public release.++- **Spec**: the provider profile of A2A v1.0.1 — 40 numbered clauses, six JSON Schemas, a worked+ example of a complete turn, and a coverage audit of the full client surface.+- **`reference-provider`**: scripted and deterministic, including the hostile scenarios (a stream cut+ with no terminal state, failure after partial output, a provider emitting no metadata at all), plus+ the conformance runner.+- **`example-provider`**: a real provider backed by the Claude Code CLI.++Nothing is deprecated, because nothing has shipped before this.diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdnew file mode 100644index 000000000..58b8c2245--- /dev/null+++ b/CONTRIBUTING.md@@ -0,0 +1,44 @@+# Contributing++The most useful contributions here are not code.++## Found a gap in the spec?++Say so. The profile is written against one product's needs, and the first partners to implement it+will find things it does not answer. An operation that is neither Tier 0, nor a named extension, nor+explicitly out of scope is a **gap**, not an implicit "no" — Appendix C of `spec/README.md` is the+audit that is supposed to catch those, and it is not infallible.++Open an issue quoting the clause id (`HP-xxx`), or the absence of one.++## Found a clause the runner cannot actually check?++Even more useful. A conformance suite that reports PASS for something it never tested is worse than+one that admits it cannot. If a check is green for the wrong reason, that is a bug in the runner.++## Changing the spec++It is a compatibility contract, and the rules in §12 are binding:++- Optional fields **may** be added to a published revision.+- A published field **must not** be renamed, removed, retyped, or reinterpreted.+- Anything else needs a new revision, served alongside its predecessor for a deprecation window.++Every normative statement gets a stable `HP-xxx` id, and a new one needs a matching check in+`reference-provider/src/conformance.ts` — or an explicit SKIP saying why it cannot be verified from+outside. Silence is not an option; that rule is the reason the suite is trustworthy.++## Code++```bash+cd reference-provider && npm install && npm run typecheck && npm test+```++Both packages have **no runtime dependencies** and that is a constraint, not an accident: a partner+should be able to read the reference implementation end to end without installing anything to+understand it. A pull request that adds one needs to argue for it.++`example-provider` needs a real `claude` CLI and a live model, so CI runs its typecheck and unit+tests only — never its end-to-end path. Its unit tests replay a **recorded** turn; do not replace+those fixtures with hand-written JSON. Two real bugs in that mapper were invisible to invented+fixtures and obvious the moment a real turn was replayed.diff --git a/LICENSE b/LICENSEnew file mode 100644index 000000000..d64569567--- /dev/null+++ b/LICENSE@@ -0,0 +1,202 @@++ Apache License+ Version 2.0, January 2004+ http://www.apache.org/licenses/++ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION++ 1. Definitions.++ "License" shall mean the terms and conditions for use, reproduction,+ and distribution as defined by Sections 1 through 9 of this document.++ "Licensor" shall mean the copyright owner or entity authorized by+ the copyright owner that is granting the License.++ "Legal Entity" shall mean the union of the acting entity and all+ other entities that control, are controlled by, or are under common+ control with that entity. For the purposes of this definition,+ "control" means (i) the power, direct or indirect, to cause the+ direction or management of such entity, whether by contract or+ otherwise, or (ii) ownership of fifty percent (50%) or more of the+ outstanding shares, or (iii) beneficial ownership of such entity.++ "You" (or "Your") shall mean an individual or Legal Entity+ exercising permissions granted by this License.++ "Source" form shall mean the preferred form for making modifications,+ including but not limited to software source code, documentation+ source, and configuration files.++ "Object" form shall mean any form resulting from mechanical+ transformation or translation of a Source form, including but+ not limited to compiled object code, generated documentation,+ and conversions to other media types.++ "Work" shall mean the work of authorship, whether in Source or+ Object form, made available under the License, as indicated by a+ copyright notice that is included in or attached to the work+ (an example is provided in the Appendix below).++ "Derivative Works" shall mean any work, whether in Source or Object+ form, that is based on (or derived from) the Work and for which the+ editorial revisions, annotations, elaborations, or other modifications+ represent, as a whole, an original work of authorship. For the purposes+ of this License, Derivative Works shall not include works that remain+ separable from, or merely link (or bind by name) to the interfaces of,+ the Work and Derivative Works thereof.++ "Contribution" shall mean any work of authorship, including+ the original version of the Work and any modifications or additions+ to that Work or Derivative Works thereof, that is intentionally+ submitted to Licensor for inclusion in the Work by the copyright owner+ or by an individual or Legal Entity authorized to submit on behalf of+ the copyright owner. For the purposes of this definition, "submitted"+ means any form of electronic, verbal, or written communication sent+ to the Licensor or its representatives, including but not limited to+ communication on electronic mailing lists, source code control systems,+ and issue tracking systems that are managed by, or on behalf of, the+ Licensor for the purpose of discussing and improving the Work, but+ excluding communication that is conspicuously marked or otherwise+ designated in writing by the copyright owner as "Not a Contribution."++ "Contributor" shall mean Licensor and any individual or Legal Entity+ on behalf of whom a Contribution has been received by Licensor and+ subsequently incorporated within the Work.++ 2. Grant of Copyright License. Subject to the terms and conditions of+ this License, each Contributor hereby grants to You a perpetual,+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable+ copyright license to reproduce, prepare Derivative Works of,+ publicly display, publicly perform, sublicense, and distribute the+ Work and such Derivative Works in Source or Object form.++ 3. Grant of Patent License. Subject to the terms and conditions of+ this License, each Contributor hereby grants to You a perpetual,+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable+ (except as stated in this section) patent license to make, have made,+ use, offer to sell, sell, import, and otherwise transfer the Work,+ where such license applies only to those patent claims licensable+ by such Contributor that are necessarily infringed by their+ Contribution(s) alone or by combination of their Contribution(s)+ with the Work to which such Contribution(s) was submitted. If You+ institute patent litigation against any entity (including a+ cross-claim or counterclaim in a lawsuit) alleging that the Work+ or a Contribution incorporated within the Work constitutes direct+ or contributory patent infringement, then any patent licenses+ granted to You under this License for that Work shall terminate+ as of the date such litigation is filed.++ 4. Redistribution. You may reproduce and distribute copies of the+ Work or Derivative Works thereof in any medium, with or without+ modifications, and in Source or Object form, provided that You+ meet the following conditions:++ (a) You must give any other recipients of the Work or+ Derivative Works a copy of this License; and++ (b) You must cause any modified files to carry prominent notices+ stating that You changed the files; and++ (c) You must retain, in the Source form of any Derivative Works+ that You distribute, all copyright, patent, trademark, and+ attribution notices from the Source form of the Work,+ excluding those notices that do not pertain to any part of+ the Derivative Works; and++ (d) If the Work includes a "NOTICE" text file as part of its+ distribution, then any Derivative Works that You distribute must+ include a readable copy of the attribution notices contained+ within such NOTICE file, excluding those notices that do not+ pertain to any part of the Derivative Works, in at least one+ of the following places: within a NOTICE text file distributed+ as part of the Derivative Works; within the Source form or+ documentation, if provided along with the Derivative Works; or,+ within a display generated by the Derivative Works, if and+ wherever such third-party notices normally appear. The contents+ of the NOTICE file are for informational purposes only and+ do not modify the License. You may add Your own attribution+ notices within Derivative Works that You distribute, alongside+ or as an addendum to the NOTICE text from the Work, provided+ that such additional attribution notices cannot be construed+ as modifying the License.++ You may add Your own copyright statement to Your modifications and+ may provide additional or different license terms and conditions+ for use, reproduction, or distribution of Your modifications, or+ for any such Derivative Works as a whole, provided Your use,+ reproduction, and distribution of the Work otherwise complies with+ the conditions stated in this License.++ 5. Submission of Contributions. Unless You explicitly state otherwise,+ any Contribution intentionally submitted for inclusion in the Work+ by You to the Licensor shall be under the terms and conditions of+ this License, without any additional terms or conditions.+ Notwithstanding the above, nothing herein shall supersede or modify+ the terms of any separate license agreement you may have executed+ with Licensor regarding such Contributions.++ 6. Trademarks. This License does not grant permission to use the trade+ names, trademarks, service marks, or product names of the Licensor,+ except as required for reasonable and customary use in describing the+ origin of the Work and reproducing the content of the NOTICE file.++ 7. Disclaimer of Warranty. Unless required by applicable law or+ agreed to in writing, Licensor provides the Work (and each+ Contributor provides its Contributions) on an "AS IS" BASIS,+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or+ implied, including, without limitation, any warranties or conditions+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A+ PARTICULAR PURPOSE. You are solely responsible for determining the+ appropriateness of using or redistributing the Work and assume any+ risks associated with Your exercise of permissions under this License.++ 8. Limitation of Liability. In no event and under no legal theory,+ whether in tort (including negligence), contract, or otherwise,+ unless required by applicable law (such as deliberate and grossly+ negligent acts) or agreed to in writing, shall any Contributor be+ liable to You for damages, including any direct, indirect, special,+ incidental, or consequential damages of any character arising as a+ result of this License or out of the use or inability to use the+ Work (including but not limited to damages for loss of goodwill,+ work stoppage, computer failure or malfunction, or any and all+ other commercial damages or losses), even if such Contributor+ has been advised of the possibility of such damages.++ 9. Accepting Warranty or Additional Liability. While redistributing+ the Work or Derivative Works thereof, You may choose to offer,+ and charge a fee for, acceptance of support, warranty, indemnity,+ or other liability obligations and/or rights consistent with this+ License. However, in accepting such obligations, You may act only+ on Your own behalf and on Your sole responsibility, not on behalf+ of any other Contributor, and only if You agree to indemnify,+ defend, and hold each Contributor harmless for any liability+ incurred by, or claims asserted against, such Contributor by reason+ of your accepting any such warranty or additional liability.++ END OF TERMS AND CONDITIONS++ APPENDIX: How to apply the Apache License to your work.++ To apply the Apache License to your work, attach the following+ boilerplate notice, with the fields enclosed by brackets "[]"+ replaced with your own identifying information. (Don't include+ the brackets!) The text should be enclosed in the appropriate+ comment syntax for the file format. We also recommend that a+ file or class name and description of purpose be included on the+ same "printed page" as the copyright notice for easier+ identification within third-party archives.++ Copyright [yyyy] [name of copyright owner]++ Licensed under the Apache License, Version 2.0 (the "License");+ you may not use this file except in compliance with the License.+ You may obtain a copy of the License at++ http://www.apache.org/licenses/LICENSE-2.0++ Unless required by applicable law or agreed to in writing, software+ distributed under the License is distributed on an "AS IS" BASIS,+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ See the License for the specific language governing permissions and+ limitations under the License.diff --git a/NOTICE b/NOTICEnew file mode 100644index 000000000..066409586--- /dev/null+++ b/NOTICE@@ -0,0 +1,15 @@+Autonomous Harness — Provider Protocol+Copyright 2026 Autonomous, Inc.++This product includes software developed at Autonomous, Inc.++Licensed under the Apache License, Version 2.0 (the "License");+you may not use this file except in compliance with the License.+You may obtain a copy of the License at++ http://www.apache.org/licenses/LICENSE-2.0++This repository is a *profile* of the Agent2Agent (A2A) protocol+(https://github.com/a2aproject/A2A), which is itself licensed under+Apache-2.0. It defines no competing protocol; everything specific to+Autonomous is expressed as a declared A2A extension.diff --git a/README.md b/README.mdnew file mode 100644index 000000000..4ff8952ad--- /dev/null+++ b/README.md@@ -0,0 +1,79 @@+# Autonomous Harness — Provider Protocol++Make your agent platform available on the [Autonomous Harness](https://www.autonomous.ai/harness).+A user connects it with a **URL and a credential**, then drives it from the web app or from the+hardware device on their desk.++**This is a profile of [A2A](https://github.com/a2aproject/A2A) v1.0.1, not a new protocol.** If you+already run a conformant A2A agent, most of it is done. Everything specific to Autonomous is either+standard A2A used as intended, or a declared A2A extension — nothing here forks the standard.++| | |+|---|---|+| [`spec/`](spec/README.md) | The contract. 40 numbered clauses (`HP-xxx`) |+| [`spec/onboarding.md`](spec/onboarding.md) | What to do once you conform, and what to expect from us |+| [`reference-provider/`](reference-provider/) | Scripted and deterministic — **and it ships the conformance runner** |+| [`example-provider/`](example-provider/) | A real one, backed by the Claude Code CLI |++## Quick start++See it work before reading the spec:++```bash+cd reference-provider && npm install && npm run dev # http://127.0.0.1:4501+curl localhost:4501/.well-known/agent-card.json+```++Then point the runner at your own endpoint. **Zero failures is the bar:**++```bash+npm run conformance -- --url https://your-endpoint --key <credential>+```++It names the clause on every line, so a red result points at a section of the spec rather than at a+symptom:++```+✔ HP-021 capabilities.streaming is true+✖ HP-200 ListTasks filters by contextId+ 3 task(s) from another context leaked into the filter+```++## What you actually have to implement++**Tier 0 is all A2A core.** There is no Autonomous-specific work in it at all:++| | Backs |+|---|---|+| Agent Card at `/.well-known/agent-card.json` | capability discovery, and your project list |+| `SendStreamingMessage` → SSE | a turn |+| `CancelTask` | stopping one |+| `ListTasks` · `GetTask` | history |++History is required, not optional: **Autonomous stores no transcript for a provider harness.** Without+those two, a page refresh loses the conversation.++**Everything else is an optional, declared extension** — file browsing, workspace writes, per-turn+recaps, voice routing. An extension you do not declare is simply absent, and the product hides the+feature rather than offering a control that fails.++Two things are deliberately **not** in the profile: model selection (you own your model configuration)+and end-to-end encryption (the plaintext originates on your side; users are told this in our UI).++## Repository++```+spec/ the contract + JSON Schemas+reference-provider/ zero runtime dependencies — readable end to end+example-provider/ a real agent; runs Claude with permissions skipped ⚠ read its README first+```++Both packages are plain TypeScript on Node ≥ 20 with **no runtime dependencies**. That is on purpose:+you should be able to read `reference-provider/src/server.ts` and know exactly what your own endpoint+has to do.++## Contributing, security, licence++- Found a gap in the spec, or a clause the runner cannot actually check? [Open an issue](https://github.com/autonomous-ai/harness-provider/issues) — see [CONTRIBUTING.md](CONTRIBUTING.md).+- Security reports: **not the issue tracker** — see [SECURITY.md](SECURITY.md).+- Licensed under [Apache-2.0](LICENSE).diff --git a/SECURITY.md b/SECURITY.mdnew file mode 100644index 000000000..c4bd2e723--- /dev/null+++ b/SECURITY.md@@ -0,0 +1,32 @@+# Security++## Reporting a vulnerability++**Do not open a GitHub issue.** Issues are public, and a report filed there is disclosure.++Email **[email protected]** with enough detail to reproduce. We will acknowledge within three+working days and keep you updated until it is resolved. If you would like credit in the fix, say so.++## In scope++The spec and both packages in this repository — in particular anything that lets a provider's output+reach a client it should not, or a credential appear where it should not.++## Not a vulnerability++**`example-provider` runs `claude` with `--dangerously-skip-permissions`.** It executes tools without+asking, inside the directory it is configured with. That is deliberate and documented at the top of+its README: it exists to demonstrate a real agent, not to be deployed. Point it at a scratch+directory.++## For implementers++Two obligations in the profile are security-relevant, and both are easy to get subtly wrong:++- **HP-012** — a credential identifies **one** tenant. It must not reach another tenant's data through+ any method, including the extensions.+- **HP-903** — do not log or forward the credential beyond authenticating the request.++On our side, everything a provider sends is treated as untrusted input: validated, allowlisted, and+dropped if it is neither. Do not rely on being able to inject arbitrary client-side structures — you+cannot, and a stream that keeps trying is closed.diff --git a/example-provider/.gitignore b/example-provider/.gitignorenew file mode 100644index 000000000..31fb53f78--- /dev/null+++ b/example-provider/.gitignore@@ -0,0 +1,9 @@+node_modules/+dist/+.tsbuildinfo++# Per-deployment state, not source:+# agents.json points at real directories on this machine+# sessions.json is the contextId ↔ claudeSessionId map+agents.json+sessions.jsondiff --git a/example-provider/README.md b/example-provider/README.mdnew file mode 100644index 000000000..f1124a10d--- /dev/null+++ b/example-provider/README.md@@ -0,0 +1,134 @@+# example-provider++> ## ⚠ This runs Claude with `--dangerously-skip-permissions`+>+> Claude executes tools **without asking** — it can read, write and delete anything under the+> directory you configure, and run commands there. Point `agents.json` at a scratch directory, not at+> a real repository. `agents.example.json` ships pointing at `/tmp/example-provider-scratch` on+> purpose.++A **real** A2A provider for the Autonomous harness provider profile+(`../spec/README.md`), backed by the local `claude` CLI.++Where `apps/reference-provider` is scripted and deterministic, this one runs an actual agent. That is+the point: it answers the question a scripted provider cannot — **does the profile survive a real+agent?** Real agents stream partial tokens, call tools, resume sessions, and keep history in their own+format.++| | `reference-provider` | `example-provider` |+|---|---|---|+| Replies | scripted | a real Claude turn |+| Job | conformance target, hostile scenarios, CI | prove the profile survives a real agent |+| Determinism | total | none — **keep it out of CI** |++## Run it++```bash+npm install+cp agents.example.json agents.json # then edit cwd+mkdir -p /tmp/example-provider-scratch+npm run dev # http://127.0.0.1:4502+```++```bash+curl -N localhost:4502 \+ -H 'content-type: application/json' -H 'x-api-key: demo' \+ -d '{"jsonrpc":"2.0","id":1,"method":"SendStreamingMessage",+ "params":{"message":{"role":"ROLE_USER","messageId":"m1",+ "parts":[{"text":"what files are here?"}]}}}'+```++| Env | Default |+|---|---|+| `AGENTS_FILE` | `./agents.json` |+| `CLAUDE_PATH` | resolved via `which claude`, then the usual install locations |+| `CLAUDE_MODEL` | `claude-sonnet-5`. Pinned, not left to the CLI default: a provider owns its model choice, and Autonomous never sends one (spec §9) |+| `PORT` | `4502` |+| `STATE_FILE` | `./sessions.json` |+| `WORKSPACE_ROOT` | `/tmp/example-provider-scratch` — where `autonomous.CreateProject` puts a new agent's directory |+| `CLAUDE_PROJECTS_DIR` | `~/.claude/projects` |++## How it works++**Agents come from `agents.json`** — `[{ id, name, description, cwd }]`. Each becomes an+`AgentCard.skills[]` entry; `cwd` is where `claude` is spawned.++**One turn = one `claude` process**, invoked the way `apps/agent-node/brain` does it:++```+claude --print --verbose --output-format stream-json --input-format stream-json+ --include-partial-messages --dangerously-skip-permissions [--resume <sessionId>]+```++The user's message is passed **verbatim** — no wrapper text, no prepended hints.++**History comes from Claude's own transcripts** at+`~/.claude/projects/<mangled-cwd>/<sessionId>.jsonl`, so `GetTask` and `ListTasks` cost this provider+nothing. A pleasant side effect: **a turn typed straight into a terminal shows up in the session list+too** — it just does not stream live, since this app implements no `SubscribeToTask`.++**One mapper, two callers.** `src/mapper.ts` is the only place Claude's shape becomes A2A. Stdout+events and JSONL lines carry the same Anthropic message shape, so writing two parsers is the reliable+way to make the live view and the post-refresh view disagree.++## What it does not do++- **No `INPUT_REQUIRED`.** With permissions skipped, Claude never asks, so HP-104 stays demonstrated+ only by `reference-provider`'s scripted path.+- **No `SubscribeToTask`** — deliberately out of scope.+- **No session writes.** `workspace-write` is declared with `params: { projects: true, sessions: false }`:+ creating an agent is ours to do, but retitling or deleting a session would mean editing the user's+ own Claude transcripts under `~/.claude`.+- **No images.** Refused loudly rather than dropped silently (HP-106).++## Verification++```bash+npm test # 31 tests, deterministic — replays a RECORDED real turn+npm run typecheck+```++Conformance, against a running instance:++```bash+cd ../reference-provider+npx tsx src/conformance.ts --url http://127.0.0.1:4502 --key demo --bad-key bad-key+# 21 passed · 0 failed · 2 manual · 10 not verifiable from outside+```++**That result is the headline.** The conformance runner was written against a scripted provider; a+real Claude-backed one passing it is what validates the profile, the runner, and this app at once.++## Two real bugs the fixtures caught++`src/__fixtures__/real-turn.jsonl` is a **recorded** Claude turn, not hand-written JSON. Both of these+were invisible to invented fixtures and obvious the moment a real turn was replayed:++1. **Nearly every stdout line carries `session_id`.** An early `if (line.session_id) return …` in the+ mapper swallowed *every* event — the turn produced zero parts and no terminal state. Session+ capture is now a separate function (`sessionIdOf`), which removes the whole class of bug.+2. **`tool_use` is announced twice** — once by `content_block_start` (with empty arguments, since+ they stream in later) and again in the complete `assistant` message. Taking both rendered every+ tool twice: 2 `tool_start` against 1 `tool_end`. The complete message is now the single source.++And one the **conformance suite** caught against the live agent:++3. **macOS `/tmp` is a symlink to `/private/tmp`**, and Claude records the resolved path. A configured+ `/tmp/x` made this provider look in `-tmp-x` while Claude had written `-private-tmp-x`, so every+ history read came back empty and HP-201 failed. `agents.json` paths are now `realpath`-resolved at+ load.++All three are pinned by tests, and all three tests were mutation-checked.++## Layout++| File | Role |+|---|---|+| `src/types.ts` | the A2A subset, copied from `reference-provider` — apps do not import each other |+| `src/config.ts` | `agents.json` loading and validation; resolves the `claude` binary |+| `src/agentCard.ts` | the card, built **from** the agent list |+| `src/claude.ts` | spawn, stdin frame, stdout lines, process-group kill |+| `src/mapper.ts` | **the** Claude → A2A mapping, shared by the live and history paths |+| `src/jsonl.ts` | transcript discovery, reading and time-slicing |+| `src/sessions.ts` | `contextId ↔ claudeSessionId`, and task windows |+| `src/server.ts` | JSON-RPC + SSE, with HP-xxx clause references inline |diff --git a/example-provider/agents.example.json b/example-provider/agents.example.jsonnew file mode 100644index 000000000..81a8573ee--- /dev/null+++ b/example-provider/agents.example.json@@ -0,0 +1,8 @@+[+ {+ "id": "scratch",+ "name": "Scratch",+ "description": "A throwaway directory. Claude runs here with permissions skipped — point this somewhere you are happy to hand over.",+ "cwd": "/tmp/example-provider-scratch"+ }+]diff --git a/example-provider/package-lock.json b/example-provider/package-lock.jsonnew file mode 100644index 000000000..a32427d7b--- /dev/null+++ b/example-provider/package-lock.json@@ -0,0 +1,1709 @@+{+ "name": "example-provider",+ "version": "0.1.0",+ "lockfileVersion": 3,+ "requires": true,+ "packages": {+ "": {+ "name": "example-provider",+ "version": "0.1.0",+ "devDependencies": {+ "@types/node": "^20.14.10",+ "tsx": "^4.16.2",+ "typescript": "^5.5.3",+ "vitest": "^4.1.10"+ }+ },+ "node_modules/@esbuild/aix-ppc64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz",+ "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "aix"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/android-arm": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz",+ "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/android-arm64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz",+ "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/android-x64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz",+ "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/darwin-arm64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz",+ "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/darwin-x64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz",+ "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/freebsd-arm64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz",+ "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/freebsd-x64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz",+ "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-arm": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz",+ "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-arm64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz",+ "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-ia32": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz",+ "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-loong64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz",+ "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==",+ "cpu": [+ "loong64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-mips64el": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz",+ "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==",+ "cpu": [+ "mips64el"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-ppc64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz",+ "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-riscv64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz",+ "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-s390x": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz",+ "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-x64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz",+ "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/netbsd-arm64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz",+ "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "netbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/netbsd-x64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz",+ "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "netbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/openbsd-arm64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz",+ "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/openbsd-x64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz",+ "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/openharmony-arm64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz",+ "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openharmony"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/sunos-x64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz",+ "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "sunos"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/win32-arm64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz",+ "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/win32-ia32": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz",+ "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/win32-x64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz",+ "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@jridgewell/sourcemap-codec": {+ "version": "1.5.5",+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",+ "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@oxc-project/types": {+ "version": "0.142.0",+ "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.142.0.tgz",+ "integrity": "sha512-7W+2q5AKQVU36fkaryontrHn3YDt1RyUYXatw9i5H8ocYe2sPKSFB6eS8WNPeRKiN1qAWWZUPm7gwFzJGrccqQ==",+ "dev": true,+ "license": "MIT",+ "funding": {+ "url": "https://github.com/sponsors/Boshen"+ }+ },+ "node_modules/@rolldown/binding-android-arm64": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.2.tgz",+ "integrity": "sha512-l7x215OGvo1s52JWmR8U/DAVzEDWBCIbTm28aeJV/WDTSHgcKXaZTuBT0hJMs5NggilfJTW3clZVvd24yfKJxA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-darwin-arm64": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.2.tgz",+ "integrity": "sha512-9u9Xv6c1AJZT0FfwH5vrMG5Jjcwhc1MlyrPu0XfTqkzsmqfks2M6W/o5XwAJgVVN/jHpqqngC1WevHKKTIUtIA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-darwin-x64": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.2.tgz",+ "integrity": "sha512-9W1mbGZAfW3oqd85bhBkmpyHCCzL1TeG/zFFP3vg7b0rlly8cxOcre5nXwz+LHazCwac2MNWgPdPCHndABjpWQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-freebsd-x64": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.2.tgz",+ "integrity": "sha512-0p1lhiCSCyaerFwtrdZQUx7NqGk6LQnaRKWX7tFQqwQgvX0rjM15cIkm3pax1UpEakK14C4mOxx/jSqCBdBRqQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-arm-gnueabihf": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.2.tgz",+ "integrity": "sha512-e+cOJXrJ2L3zx6YzqPg+f6Wbk3V1cKB8bOhbaYdVYN3DdquzNdRAmrbETz1qnt5yp/c7JNlNjmITiA2cVneQ7w==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-arm64-gnu": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.2.tgz",+ "integrity": "sha512-JsSMsj6sNat/MuhG5fnBD7QgbtpHKVe30x5/bAVirDHdhoQRXJkF6xc0Jqk8O4fiCUQAzMOoH9wZi3m60c8wtg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-arm64-musl": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.2.tgz",+ "integrity": "sha512-B5G/zJdHaoJn9vD50eGHWkiWfmq8Uhi3IiLPJTzmZTrAalk1bztUikSXo0qga18ibE0IXboyeMUnhPjhAJ45wQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-ppc64-gnu": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.2.tgz",+ "integrity": "sha512-6mC/awzKka8W6EoekjegpfGkjz8jXWDX63pqu/HYVpyKtZfu65Jsh4QAH3Kej3CAv/c1oGX7psTmFEbr0mDxLA==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-s390x-gnu": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.2.tgz",+ "integrity": "sha512-412MX9fJLdA1IK28EZnc8jYv2HRTleOZgfLQumJ5zy7OeJLZlg/CETwFaXjNmGVxG51cFHpKLqb5LKvBC+HsHA==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-x64-gnu": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.2.tgz",+ "integrity": "sha512-Q/+HI/ToJafZ1iCqGgVQXUEkIjufHCTF0gBQ2a5o3cg7GJ2h0qyq3nvvSmU+bGda2/7ygXpTY4TM6gO9OhQ0ZA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-x64-musl": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.2.tgz",+ "integrity": "sha512-ZKp/w41n6wCvxzxQHtQSbuphfX3Y4cCvbjkKHusrLx4lh+JWLTU7StSltO/DKARISzbj368d+qUaCjI8K2wzXw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-openharmony-arm64": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.2.tgz",+ "integrity": "sha512-pxE6xD4KS3eAROkKK5yrhB9/3+vhlhVGMvlQLbdpzrBGDbKrnzx3RLwPaHvasLo6jgaiBLn7e04Df9C4tYhjmA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openharmony"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-win32-arm64-msvc": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.2.tgz",+ "integrity": "sha512-4MqEue5re+xIZzAWsB8sj0P1kqZySWqIuN4t6QaIO/YA6SFwySOLruvWQFzfmqk8LBK2P30KCSJwf6mJCZZ5/A==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-win32-x64-msvc": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.2.tgz",+ "integrity": "sha512-NweNxxD0Nf9t8v7kodun45Ijp3EIwYY+uydPP6qBEYvfBqhIjN6dZMzlQja3tqX/aLs3F3Uz+AxDpKgRhpOZQg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/pluginutils": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz",+ "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@standard-schema/spec": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz",+ "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@types/chai": {+ "version": "5.2.3",+ "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz",+ "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/deep-eql": "*",+ "assertion-error": "^2.0.1"+ }+ },+ "node_modules/@types/deep-eql": {+ "version": "4.0.2",+ "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz",+ "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@types/estree": {+ "version": "1.0.9",+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz",+ "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@types/node": {+ "version": "20.19.43",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz",+ "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "undici-types": "~6.21.0"+ }+ },+ "node_modules/@vitest/expect": {+ "version": "4.1.10",+ "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.10.tgz",+ "integrity": "sha512-YsCn+qAk1GWjQOWFEsEcL2gNQ0zmVmQu3T03qP6UyjhtmdtwtbuI+DASn/7iQB3HGTXkdBwGddzxPlmiql5vlA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@standard-schema/spec": "^1.1.0",+ "@types/chai": "^5.2.2",+ "@vitest/spy": "4.1.10",+ "@vitest/utils": "4.1.10",+ "chai": "^6.2.2",+ "tinyrainbow": "^3.1.0"+ },+ "funding": {+ "url": "https://opencollective.com/vitest"+ }+ },+ "node_modules/@vitest/mocker": {+ "version": "4.1.10",+ "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.10.tgz",+ "integrity": "sha512-v0xaezt+DKEmKfaxg133ldzADrwLGd7Ze1MfQQTYfvs8OqZIwbxyxaYURivwV7sWy5fqn3rH5uOrSp07bp44Ow==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@vitest/spy": "4.1.10",+ "estree-walker": "^3.0.3",+ "magic-string": "^0.30.21"+ },+ "funding": {+ "url": "https://opencollective.com/vitest"+ },+ "peerDependencies": {+ "msw": "^2.4.9",+ "vite": "^6.0.0 || ^7.0.0 || ^8.0.0"+ },+ "peerDependenciesMeta": {+ "msw": {+ "optional": true+ },+ "vite": {+ "optional": true+ }+ }+ },+ "node_modules/@vitest/pretty-format": {+ "version": "4.1.10",+ "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.10.tgz",+ "integrity": "sha512-W1HsjSH4MXQ9YfmmhLAoIYf1HRfekQCGngeIgcei6MP5QQGWUe0gkopdZQaVCFO+JDJMrAJGwa5pRpNpvy4P8Q==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "tinyrainbow": "^3.1.0"+ },+ "funding": {+ "url": "https://opencollective.com/vitest"+ }+ },+ "node_modules/@vitest/runner": {+ "version": "4.1.10",+ "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.1.10.tgz",+ "integrity": "sha512-IKI6kpIH+LmpROplyLwBBaCfMgOZOMsygVa6BARD6ahA04VRuJSa6OaVG7kRvSEMD870Vd91rSSw0eegtWyLGg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@vitest/utils": "4.1.10",+ "pathe": "^2.0.3"+ },+ "funding": {+ "url": "https://opencollective.com/vitest"+ }+ },+ "node_modules/@vitest/snapshot": {+ "version": "4.1.10",+ "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.1.10.tgz",+ "integrity": "sha512-xRkfOT1qpTAi/Ti4Y1LtfRc3kEuqxGw59eN2jN9pRWMtS/XDevekhcFSqvQqjUNGksfjMJu3Y+oJ+4Ypn2OaJw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@vitest/pretty-format": "4.1.10",+ "@vitest/utils": "4.1.10",+ "magic-string": "^0.30.21",+ "pathe": "^2.0.3"+ },+ "funding": {+ "url": "https://opencollective.com/vitest"+ }+ },+ "node_modules/@vitest/spy": {+ "version": "4.1.10",+ "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.10.tgz",+ "integrity": "sha512-PLf/Ugvoq5wO/b4rwYCR1h2PSIdXz7wnkQFMiUpLdtM7l6pqVFcQIBEHyT1+l+cj7mNwAfZHzqXqDyjvOuwbDw==",+ "dev": true,+ "license": "MIT",+ "funding": {+ "url": "https://opencollective.com/vitest"+ }+ },+ "node_modules/@vitest/utils": {+ "version": "4.1.10",+ "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.10.tgz",+ "integrity": "sha512-fy9am/HWxbaGt/Sawrp90vt6Y6jQwf1RX77cz3uwoJwJVMli/e1IEwRPnMNJ7vKfPTwo0diXifkpPvwH9v7nGA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@vitest/pretty-format": "4.1.10",+ "convert-source-map": "^2.0.0",+ "tinyrainbow": "^3.1.0"+ },+ "funding": {+ "url": "https://opencollective.com/vitest"+ }+ },+ "node_modules/assertion-error": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz",+ "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/chai": {+ "version": "6.2.2",+ "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz",+ "integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/convert-source-map": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",+ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/detect-libc": {+ "version": "2.1.2",+ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",+ "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/es-module-lexer": {+ "version": "2.3.1",+ "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.1.tgz",+ "integrity": "sha512-shc1dbU90Yl/xq1QrC7QRtfcwURZuVRfPhZbDoldJ1cn1gzDvBaBWlv0eFolj5+0znnPJz5TXLxsN77X/12KTA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/esbuild": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz",+ "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==",+ "dev": true,+ "hasInstallScript": true,+ "license": "MIT",+ "bin": {+ "esbuild": "bin/esbuild"+ },+ "engines": {+ "node": ">=18"+ },+ "optionalDependencies": {+ "@esbuild/aix-ppc64": "0.28.1",+ "@esbuild/android-arm": "0.28.1",+ "@esbuild/android-arm64": "0.28.1",+ "@esbuild/android-x64": "0.28.1",+ "@esbuild/darwin-arm64": "0.28.1",+ "@esbuild/darwin-x64": "0.28.1",+ "@esbuild/freebsd-arm64": "0.28.1",+ "@esbuild/freebsd-x64": "0.28.1",+ "@esbuild/linux-arm": "0.28.1",+ "@esbuild/linux-arm64": "0.28.1",+ "@esbuild/linux-ia32": "0.28.1",+ "@esbuild/linux-loong64": "0.28.1",+ "@esbuild/linux-mips64el": "0.28.1",+ "@esbuild/linux-ppc64": "0.28.1",+ "@esbuild/linux-riscv64": "0.28.1",+ "@esbuild/linux-s390x": "0.28.1",+ "@esbuild/linux-x64": "0.28.1",+ "@esbuild/netbsd-arm64": "0.28.1",+ "@esbuild/netbsd-x64": "0.28.1",+ "@esbuild/openbsd-arm64": "0.28.1",+ "@esbuild/openbsd-x64": "0.28.1",+ "@esbuild/openharmony-arm64": "0.28.1",+ "@esbuild/sunos-x64": "0.28.1",+ "@esbuild/win32-arm64": "0.28.1",+ "@esbuild/win32-ia32": "0.28.1",+ "@esbuild/win32-x64": "0.28.1"+ }+ },+ "node_modules/estree-walker": {+ "version": "3.0.3",+ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",+ "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/estree": "^1.0.0"+ }+ },+ "node_modules/expect-type": {+ "version": "1.4.0",+ "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.4.0.tgz",+ "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": ">=12.0.0"+ }+ },+ "node_modules/fdir": {+ "version": "6.5.0",+ "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",+ "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12.0.0"+ },+ "peerDependencies": {+ "picomatch": "^3 || ^4"+ },+ "peerDependenciesMeta": {+ "picomatch": {+ "optional": true+ }+ }+ },+ "node_modules/fsevents": {+ "version": "2.3.3",+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",+ "dev": true,+ "hasInstallScript": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"+ }+ },+ "node_modules/lightningcss": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz",+ "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==",+ "dev": true,+ "license": "MPL-2.0",+ "dependencies": {+ "detect-libc": "^2.0.3"+ },+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ },+ "optionalDependencies": {+ "lightningcss-android-arm64": "1.33.0",+ "lightningcss-darwin-arm64": "1.33.0",+ "lightningcss-darwin-x64": "1.33.0",+ "lightningcss-freebsd-x64": "1.33.0",+ "lightningcss-linux-arm-gnueabihf": "1.33.0",+ "lightningcss-linux-arm64-gnu": "1.33.0",+ "lightningcss-linux-arm64-musl": "1.33.0",+ "lightningcss-linux-x64-gnu": "1.33.0",+ "lightningcss-linux-x64-musl": "1.33.0",+ "lightningcss-win32-arm64-msvc": "1.33.0",+ "lightningcss-win32-x64-msvc": "1.33.0"+ }+ },+ "node_modules/lightningcss-android-arm64": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz",+ "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-darwin-arm64": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz",+ "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-darwin-x64": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz",+ "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-freebsd-x64": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz",+ "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-arm-gnueabihf": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz",+ "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-arm64-gnu": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz",+ "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-arm64-musl": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz",+ "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-x64-gnu": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz",+ "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-x64-musl": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz",+ "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-win32-arm64-msvc": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz",+ "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-win32-x64-msvc": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz",+ "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/magic-string": {+ "version": "0.30.21",+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz",+ "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/sourcemap-codec": "^1.5.5"+ }+ },+ "node_modules/nanoid": {+ "version": "3.3.17",+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.17.tgz",+ "integrity": "sha512-xQLf0A3HOMlgHq0n247/LRuAOYmB7dXJ/DvAxGvsSBij45XtBSmQycu+F8ODbHwns/XyFZagyL1+J0Offw1E0g==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "bin": {+ "nanoid": "bin/nanoid.cjs"+ },+ "engines": {+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"+ }+ },+ "node_modules/obug": {+ "version": "2.1.4",+ "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.4.tgz",+ "integrity": "sha512-4a+OsYv9UktOJKE+l1A4OufDgdRF9PifWj+tJnHURo/P+WOxpG4GzUFL9qCalmWauao6ogiG+QvnCovwPoyAWA==",+ "dev": true,+ "funding": [+ "https://github.com/sponsors/sxzz",+ "https://opencollective.com/debug"+ ],+ "license": "MIT",+ "engines": {+ "node": ">=12.20.0"+ }+ },+ "node_modules/pathe": {+ "version": "2.0.3",+ "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz",+ "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/picocolors": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",+ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/picomatch": {+ "version": "4.0.5",+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz",+ "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/sponsors/jonschlinkert"+ }+ },+ "node_modules/postcss": {+ "version": "8.5.25",+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.25.tgz",+ "integrity": "sha512-DTPx3RWSSnWyzLxQnlH0rJP+EW5ekl16ZU4/psbIhA0e53kJfdgaN5vKM+xP7yJtXVu+nfdVFmlgFDEKAe4Pyw==",+ "dev": true,+ "funding": [+ {+ "type": "opencollective",+ "url": "https://opencollective.com/postcss/"+ },+ {+ "type": "tidelift",+ "url": "https://tidelift.com/funding/github/npm/postcss"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "nanoid": "^3.3.16",+ "picocolors": "^1.1.1",+ "source-map-js": "^1.2.1"+ },+ "engines": {+ "node": "^10 || ^12 || >=14"+ }+ },+ "node_modules/rolldown": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.2.tgz",+ "integrity": "sha512-opwpo1tQBAcpSUJDt94B7hhLNGOKjCdE//XXjeLrnx9b83bjnw45tXdg1b09yEw/VLFBJGZpwRULMmOZo7ol+A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@oxc-project/types": "=0.142.0",+ "@rolldown/pluginutils": "^1.0.0"+ },+ "bin": {+ "rolldown": "bin/cli.mjs"+ },+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ },+ "optionalDependencies": {+ "@rolldown/binding-android-arm64": "1.2.2",+ "@rolldown/binding-darwin-arm64": "1.2.2",+ "@rolldown/binding-darwin-x64": "1.2.2",+ "@rolldown/binding-freebsd-x64": "1.2.2",+ "@rolldown/binding-linux-arm-gnueabihf": "1.2.2",+ "@rolldown/binding-linux-arm64-gnu": "1.2.2",+ "@rolldown/binding-linux-arm64-musl": "1.2.2",+ "@rolldown/binding-linux-ppc64-gnu": "1.2.2",+ "@rolldown/binding-linux-s390x-gnu": "1.2.2",+ "@rolldown/binding-linux-x64-gnu": "1.2.2",+ "@rolldown/binding-linux-x64-musl": "1.2.2",+ "@rolldown/binding-openharmony-arm64": "1.2.2",+ "@rolldown/binding-win32-arm64-msvc": "1.2.2",+ "@rolldown/binding-win32-x64-msvc": "1.2.2"+ }+ },+ "node_modules/siginfo": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz",+ "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/source-map-js": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",+ "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",+ "dev": true,+ "license": "BSD-3-Clause",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/stackback": {+ "version": "0.0.2",+ "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz",+ "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/std-env": {+ "version": "4.2.0",+ "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.2.0.tgz",+ "integrity": "sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/tinybench": {+ "version": "2.9.0",+ "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz",+ "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/tinyexec": {+ "version": "1.3.0",+ "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.0.tgz",+ "integrity": "sha512-QKAl9m8gWWGHV8jZcPeym6j+XULi6tOf1mT83WYJ4Lk2ytW/uwAWkrP0uFsdoYMdueVJ0qs26wZ+23xeB4ibNQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/tinyglobby": {+ "version": "0.2.17",+ "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz",+ "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "fdir": "^6.5.0",+ "picomatch": "^4.0.4"+ },+ "engines": {+ "node": ">=12.0.0"+ },+ "funding": {+ "url": "https://github.com/sponsors/SuperchupuDev"+ }+ },+ "node_modules/tinyrainbow": {+ "version": "3.1.1",+ "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.1.1.tgz",+ "integrity": "sha512-yau8yJdTt989Mm0Bd/236QnzEiPf2xLLTqUZRUJOo/3CB078LSwzei343DgtJVmfJKJE3TMINY1u42SQsP6mXw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=14.0.0"+ }+ },+ "node_modules/tsx": {+ "version": "4.23.5",+ "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.23.5.tgz",+ "integrity": "sha512-rw55FUaqOoI7RvlQwLbhO4nSDApnQ4/CykPuiQ/EPvtrX3WA9Ig55jIt9VvbBJbzJuj12ueRu4PMZ2SxPVbihg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "esbuild": "~0.28.0"+ },+ "bin": {+ "tsx": "dist/cli.mjs"+ },+ "engines": {+ "node": ">=18.0.0"+ },+ "optionalDependencies": {+ "fsevents": "~2.3.3"+ }+ },+ "node_modules/typescript": {+ "version": "5.9.3",+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",+ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",+ "dev": true,+ "license": "Apache-2.0",+ "bin": {+ "tsc": "bin/tsc",+ "tsserver": "bin/tsserver"+ },+ "engines": {+ "node": ">=14.17"+ }+ },+ "node_modules/undici-types": {+ "version": "6.21.0",+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",+ "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/vite": {+ "version": "8.2.0",+ "resolved": "https://registry.npmjs.org/vite/-/vite-8.2.0.tgz",+ "integrity": "sha512-pn+CFpM0lwDeKwmOq1ZaBK/9sjorZcgqxki6MbY/jPEVd9vichIlmlD4HmQ5wdP5EgqQCFRaACBxMC7uEGc6lQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "lightningcss": "^1.33.0",+ "picomatch": "^4.0.5",+ "postcss": "^8.5.23",+ "rolldown": "~1.2.0",+ "tinyglobby": "^0.2.17"+ },+ "bin": {+ "vite": "bin/vite.js"+ },+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ },+ "funding": {+ "url": "https://github.com/vitejs/vite?sponsor=1"+ },+ "optionalDependencies": {+ "fsevents": "~2.3.3"+ },+ "peerDependencies": {+ "@types/node": "^20.19.0 || >=22.12.0",+ "@vitejs/devtools": "^0.4.0",+ "esbuild": "^0.27.0 || ^0.28.0",+ "jiti": ">=1.21.0",+ "less": "^4.0.0",+ "sass": "^1.70.0",+ "sass-embedded": "^1.70.0",+ "stylus": ">=0.54.8",+ "sugarss": "^5.0.0",+ "terser": "^5.16.0",+ "tsx": "^4.8.1",+ "yaml": "^2.4.2"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ },+ "@vitejs/devtools": {+ "optional": true+ },+ "esbuild": {+ "optional": true+ },+ "jiti": {+ "optional": true+ },+ "less": {+ "optional": true+ },+ "sass": {+ "optional": true+ },+ "sass-embedded": {+ "optional": true+ },+ "stylus": {+ "optional": true+ },+ "sugarss": {+ "optional": true+ },+ "terser": {+ "optional": true+ },+ "tsx": {+ "optional": true+ },+ "yaml": {+ "optional": true+ }+ }+ },+ "node_modules/vitest": {+ "version": "4.1.10",+ "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.10.tgz",+ "integrity": "sha512-R9jUTe5S4Qb0HCd4TNqpC7oGcrMssMRGXLW80ubjWsW9VH5GF8y1Y0SFLY9AbqSk6nt0PnOx4H4WNJYZ13GUPw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@vitest/expect": "4.1.10",+ "@vitest/mocker": "4.1.10",+ "@vitest/pretty-format": "4.1.10",+ "@vitest/runner": "4.1.10",+ "@vitest/snapshot": "4.1.10",+ "@vitest/spy": "4.1.10",+ "@vitest/utils": "4.1.10",+ "es-module-lexer": "^2.0.0",+ "expect-type": "^1.3.0",+ "magic-string": "^0.30.21",+ "obug": "^2.1.1",+ "pathe": "^2.0.3",+ "picomatch": "^4.0.3",+ "std-env": "^4.0.0-rc.1",+ "tinybench": "^2.9.0",+ "tinyexec": "^1.0.2",+ "tinyglobby": "^0.2.15",+ "tinyrainbow": "^3.1.0",+ "vite": "^6.0.0 || ^7.0.0 || ^8.0.0",+ "why-is-node-running": "^2.3.0"+ },+ "bin": {+ "vitest": "vitest.mjs"+ },+ "engines": {+ "node": "^20.0.0 || ^22.0.0 || >=24.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/vitest"+ },+ "peerDependencies": {+ "@edge-runtime/vm": "*",+ "@opentelemetry/api": "^1.9.0",+ "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0",+ "@vitest/browser-playwright": "4.1.10",+ "@vitest/browser-preview": "4.1.10",+ "@vitest/browser-webdriverio": "4.1.10",+ "@vitest/coverage-istanbul": "4.1.10",+ "@vitest/coverage-v8": "4.1.10",+ "@vitest/ui": "4.1.10",+ "happy-dom": "*",+ "jsdom": "*",+ "vite": "^6.0.0 || ^7.0.0 || ^8.0.0"+ },+ "peerDependenciesMeta": {+ "@edge-runtime/vm": {+ "optional": true+ },+ "@opentelemetry/api": {+ "optional": true+ },+ "@types/node": {+ "optional": true+ },+ "@vitest/browser-playwright": {+ "optional": true+ },+ "@vitest/browser-preview": {+ "optional": true+ },+ "@vitest/browser-webdriverio": {+ "optional": true+ },+ "@vitest/coverage-istanbul": {+ "optional": true+ },+ "@vitest/coverage-v8": {+ "optional": true+ },+ "@vitest/ui": {+ "optional": true+ },+ "happy-dom": {+ "optional": true+ },+ "jsdom": {+ "optional": true+ },+ "vite": {+ "optional": false+ }+ }+ },+ "node_modules/why-is-node-running": {+ "version": "2.3.0",+ "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz",+ "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "siginfo": "^2.0.0",+ "stackback": "0.0.2"+ },+ "bin": {+ "why-is-node-running": "cli.js"+ },+ "engines": {+ "node": ">=8"+ }+ }+ }+}diff --git a/example-provider/package.json b/example-provider/package.jsonnew file mode 100644index 000000000..6a9ef8959--- /dev/null+++ b/example-provider/package.json@@ -0,0 +1,27 @@+{+ "name": "@autonomous/example-provider",+ "version": "0.1.0",+ "description": "A real Autonomous harness provider backed by the local Claude Code CLI. Not deterministic — keep it out of CI.",+ "license": "Apache-2.0",+ "repository": {+ "type": "git",+ "url": "git+https://github.com/autonomous-ai/harness-provider.git",+ "directory": "example-provider"+ },+ "homepage": "https://github.com/autonomous-ai/harness-provider#readme",+ "bugs": "https://github.com/autonomous-ai/harness-provider/issues",+ "type": "module",+ "scripts": {+ "dev": "tsx src/server.ts",+ "start": "node dist/server.js",+ "build": "tsc",+ "typecheck": "tsc --noEmit",+ "test": "vitest run"+ },+ "devDependencies": {+ "@types/node": "^20.14.10",+ "tsx": "^4.16.2",+ "typescript": "^5.5.3",+ "vitest": "^4.1.10"+ }+}diff --git a/example-provider/src/__fixtures__/real-turn.jsonl b/example-provider/src/__fixtures__/real-turn.jsonlnew file mode 100644index 000000000..6cbd4d4ee--- /dev/null+++ b/example-provider/src/__fixtures__/real-turn.jsonl@@ -0,0 +1,31 @@+{"type":"system","subtype":"hook_started","hook_id":"43d0dc09-110f-40e7-8ee5-e40313e1197c","hook_name":"SessionStart:startup","hook_event":"SessionStart","uuid":"1c70389c-c673-4897-8f5f-e917c8b7e74c","session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b"}+{"type":"system","subtype":"hook_response","hook_id":"43d0dc09-110f-40e7-8ee5-e40313e1197c","hook_name":"SessionStart:startup","hook_event":"SessionStart","output":"","stdout":"","stderr":"","exit_code":0,"outcome":"success","uuid":"b9da5d45-acd0-4b43-9f25-a7477bd28894","session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b"}+{"type":"system","subtype":"init","cwd":"/private/tmp/example-provider-scratch","session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","tools":["Task","Bash","CronCreate","CronDelete","CronList","DesignSync","Edit","EnterWorktree","ExitWorktree","ListMcpResourcesTool","Monitor","NotebookEdit","PushNotification","Read","ReadMcpResourceDirTool","ReadMcpResourceTool","RemoteTrigger","ReportFindings","ScheduleWakeup","SendMessage","Skill","TaskCreate","TaskGet","TaskList","TaskOutput","TaskStop","TaskUpdate","ToolSearch","WebFetch","WebSearch","Workflow","Write","mcp__codegraph__codegraph_callees","mcp__codegraph__codegraph_callers","mcp__codegraph__codegraph_explore","mcp__codegraph__codegraph_files","mcp__codegraph__codegraph_impact","mcp__codegraph__codegraph_node","mcp__codegraph__codegraph_search","mcp__codegraph__codegraph_status","mcp__context7__query-docs","mcp__context7__resolve-library-id"],"mcp_servers":[{"name":"context7","status":"connected"},{"name":"codegraph","status":"connected"},{"name":"claude.ai Google Drive","status":"needs-auth"},{"name":"claude.ai Google Calendar","status":"needs-auth"},{"name":"claude.ai Gmail","status":"needs-auth"}],"model":"claude-opus-5[1m]","permissionMode":"bypassPermissions","slash_commands":["skill-creator","architect","brainstorm","debug","plan","refactor","research","review","security-audit","sql-optimize","deep-research","design-sync","dataviz","update-config","verify","code-review","simplify","batch","fewer-permission-prompts","doctor","loop","schedule","claude-api","run","run-skill-generator","agents","autocompact","clear","color","compact","config","context","effort","fast","heapdump","init","mcp","model","__remote-workflow","workflow-launch-exec","reload-skills","rename","ultrareview","security-review","usage-credits","extra-usage","usage","insights","recap","goal","design","design-consent","design-revoke","team-onboarding"],"apiKeySource":"none","claude_code_version":"2.1.221","output_style":"default","agents":["claude","Explore","general-purpose","Plan","statusline-setup"],"skills":["skill-creator","deep-research","design-sync","dataviz","update-config","verify","debug","code-review","simplify","batch","fewer-permission-prompts","doctor","loop","schedule","claude-api","run","run-skill-generator"],"plugins":[],"capabilities":["interrupt_receipt_v1","interrupt_cancel_queued_v1","msg_lifecycle_v1"],"analytics_disabled":false,"product_feedback_disabled":false,"uuid":"3e8744b6-5beb-4f29-a21e-18df1640c1f7","memory_paths":{"auto":"/Users/nqhieu84/.claude/projects/-private-tmp-example-provider-scratch/memory/"},"fast_mode_state":"off","fast_mode_disabled_reason":"sdk_opt_in_required"}+{"type":"system","subtype":"status","status":"requesting","uuid":"6bb2ba31-4adb-446e-9eb9-4ae1e5862911","session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b"}+{"type":"stream_event","event":{"type":"message_start","message":{"model":"claude-opus-5","id":"msg_011CdgxJ2yGdWwTbZToa2wsu","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":7409,"cache_read_input_tokens":15273,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":7409},"output_tokens":1,"service_tier":"standard","inference_geo":"not_available"},"diagnostics":null}},"session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","parent_tool_use_id":null,"uuid":"3dbf0727-2653-4c46-a337-0099e1d42a9a","ttft_ms":1750}+{"type":"stream_event","event":{"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}},"session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","parent_tool_use_id":null,"uuid":"79afe0b1-dac7-4994-b622-4ccea2ec6ecb"}+{"type":"stream_event","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"I"}},"session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","parent_tool_use_id":null,"uuid":"7d1f4b7b-f213-4339-af71-7ed4940d5d73"}+{"type":"stream_event","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"'ll read the file."}},"session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","parent_tool_use_id":null,"uuid":"260fbf27-4b9e-4f9b-85b0-dbb441708759"}+{"type":"assistant","message":{"model":"claude-opus-5","id":"msg_011CdgxJ2yGdWwTbZToa2wsu","type":"message","role":"assistant","content":[{"type":"text","text":"I'll read the file."}],"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":7409,"cache_read_input_tokens":15273,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":7409},"output_tokens":1,"service_tier":"standard","inference_geo":"not_available"},"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","uuid":"820eaad3-d63c-48a2-a436-d637d8d9ceb0","timestamp":"2026-08-04T02:54:47.846Z","request_id":"req_011CdgxHzfN2niQZUySfWLwF"}+{"type":"stream_event","event":{"type":"content_block_stop","index":0},"session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","parent_tool_use_id":null,"uuid":"5fab70bd-c662-40ab-b76c-05eb4f9acc95"}+{"type":"stream_event","event":{"type":"content_block_start","index":1,"content_block":{"type":"tool_use","id":"toolu_01TXRr6MFzWekpzdmiNoqmjs","name":"Read","input":{},"caller":{"type":"direct"}}},"session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","parent_tool_use_id":null,"uuid":"460e1066-a8da-4f56-b640-bf6217d288e1"}+{"type":"stream_event","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":""}},"session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","parent_tool_use_id":null,"uuid":"14b70d53-7597-4f1e-b1dd-ecd7bb1de069"}+{"type":"stream_event","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"{\"file_path\": \"/private/tmp/example-prov"}},"session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","parent_tool_use_id":null,"uuid":"bb33a736-71cd-4954-8df2-57d49a1d9be1"}+{"type":"stream_event","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ider-scratch/note.txt"}},"session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","parent_tool_use_id":null,"uuid":"de7fd5e8-5b19-48dc-8e4d-c2610d9ca396"}+{"type":"stream_event","event":{"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"\"}"}},"session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","parent_tool_use_id":null,"uuid":"6ffb1eff-3a7a-4e80-9373-57f882beb1ac"}+{"type":"assistant","message":{"model":"claude-opus-5","id":"msg_011CdgxJ2yGdWwTbZToa2wsu","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_01TXRr6MFzWekpzdmiNoqmjs","name":"Read","input":{"file_path":"/private/tmp/example-provider-scratch/note.txt"},"caller":{"type":"direct"}}],"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":7409,"cache_read_input_tokens":15273,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":7409},"output_tokens":1,"service_tier":"standard","inference_geo":"not_available"},"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","uuid":"0ff4878f-2a62-42bd-a4f8-21649ef5b9b2","timestamp":"2026-08-04T02:54:48.290Z","request_id":"req_011CdgxHzfN2niQZUySfWLwF"}+{"type":"stream_event","event":{"type":"content_block_stop","index":1},"session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","parent_tool_use_id":null,"uuid":"fa95d998-bfd6-42a5-b4b3-c58770871ac9"}+{"type":"stream_event","event":{"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null,"stop_details":null},"usage":{"input_tokens":2,"cache_creation_input_tokens":7409,"cache_read_input_tokens":15273,"output_tokens":75,"output_tokens_details":{"thinking_tokens":0},"iterations":[{"input_tokens":2,"output_tokens":75,"cache_read_input_tokens":15273,"cache_creation_input_tokens":7409,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":7409},"type":"message"}]},"context_management":{"applied_edits":[]}},"session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","parent_tool_use_id":null,"uuid":"ab191e10-3103-4779-bee8-ab43c0f42060"}+{"type":"stream_event","event":{"type":"message_stop"},"session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","parent_tool_use_id":null,"uuid":"dcc10ab0-452e-4fc8-a4b2-8fc8c13e1472"}+{"type":"rate_limit_event","rate_limit_info":{"status":"allowed","resetsAt":1785823200,"rateLimitType":"five_hour","overageStatus":"rejected","overageDisabledReason":"org_level_disabled","isUsingOverage":false},"uuid":"db77c41a-5019-40ed-95c3-517241572453","session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b"}+{"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_01TXRr6MFzWekpzdmiNoqmjs","type":"tool_result","content":"1\thello from the scratch dir\n2\t"}]},"parent_tool_use_id":null,"session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","uuid":"2ce8d4aa-615f-4dec-b66d-16362ebfe498","timestamp":"2026-08-04T02:54:48.299Z","tool_use_result":{"type":"text","file":{"filePath":"/private/tmp/example-provider-scratch/note.txt","content":"hello from the scratch dir\n","numLines":2,"startLine":1,"totalLines":2}}}+{"type":"system","subtype":"status","status":"requesting","uuid":"23cc7c90-7f11-4764-99bd-f770e0c47ab9","session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b"}+{"type":"stream_event","event":{"type":"message_start","message":{"model":"claude-opus-5","id":"msg_011CdgxJC1FFsxUuDPwi4Cpw","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":94,"cache_read_input_tokens":22682,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":94},"output_tokens":1,"service_tier":"standard","inference_geo":"not_available"},"diagnostics":null}},"session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","parent_tool_use_id":null,"uuid":"76adb84d-332d-439b-a4e4-59be7fbca4fc","ttft_ms":1280}+{"type":"stream_event","event":{"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}},"session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","parent_tool_use_id":null,"uuid":"fd85afd0-7cb1-45f7-b9a0-b36319cd761b"}+{"type":"stream_event","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"note"}},"session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","parent_tool_use_id":null,"uuid":"74f58736-5da6-4a01-aea7-db9a0941d3bc"}+{"type":"stream_event","event":{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":".txt contains a single line: \"hello from the scratch dir\"."}},"session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","parent_tool_use_id":null,"uuid":"8ca6582d-daa1-499a-92e2-c60bc2adac78"}+{"type":"assistant","message":{"model":"claude-opus-5","id":"msg_011CdgxJC1FFsxUuDPwi4Cpw","type":"message","role":"assistant","content":[{"type":"text","text":"note.txt contains a single line: \"hello from the scratch dir\"."}],"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":94,"cache_read_input_tokens":22682,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":94},"output_tokens":1,"service_tier":"standard","inference_geo":"not_available"},"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","uuid":"600f56dc-d4ed-4f11-90c9-ee6e8f408f16","timestamp":"2026-08-04T02:54:49.689Z","request_id":"req_011CdgxJAuWoqRSjtcA6rJzc"}+{"type":"stream_event","event":{"type":"content_block_stop","index":0},"session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","parent_tool_use_id":null,"uuid":"5c7fef1b-3068-4e98-8a9b-e73127086fd3"}+{"type":"stream_event","event":{"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null,"stop_details":null},"usage":{"input_tokens":2,"cache_creation_input_tokens":94,"cache_read_input_tokens":22682,"output_tokens":23,"output_tokens_details":{"thinking_tokens":0},"iterations":[{"input_tokens":2,"output_tokens":23,"cache_read_input_tokens":22682,"cache_creation_input_tokens":94,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":94},"type":"message"}]},"context_management":{"applied_edits":[]}},"session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","parent_tool_use_id":null,"uuid":"776f45cd-5d97-4067-92d3-df2ef42f6edc"}+{"type":"stream_event","event":{"type":"message_stop"},"session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","parent_tool_use_id":null,"uuid":"c0c60e8a-b4cc-43bb-82d4-f1aab747292e"}+{"is_error":false,"duration_api_ms":4136,"num_turns":2,"stop_reason":"end_turn","session_id":"745aa98e-c79e-4f3e-a1cb-af19f3e14b9b","total_cost_usd":0.09647750000000001,"usage":{"input_tokens":4,"cache_creation_input_tokens":7503,"cache_read_input_tokens":37955,"output_tokens":98,"server_tool_use":{"web_search_requests":0,"web_fetch_requests":0},"service_tier":"standard","cache_creation":{"ephemeral_1h_input_tokens":7503,"ephemeral_5m_input_tokens":0},"inference_geo":"not_available","iterations":[{"input_tokens":2,"output_tokens":23,"cache_read_input_tokens":22682,"cache_creation_input_tokens":94,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":94},"type":"message"}],"speed":"standard"},"modelUsage":{"claude-opus-5[1m]":{"inputTokens":4,"outputTokens":98,"cacheReadInputTokens":37955,"cacheCreationInputTokens":7503,"webSearchRequests":0,"costUSD":0.09647750000000001,"contextWindow":1000000,"maxOutputTokens":64000,"canonicalModel":"claude-opus-5","provider":"firstParty"}},"permission_denials":[],"terminal_reason":"completed","fast_mode_state":"off","fast_mode_disabled_reason":"sdk_opt_in_required","subtype":"success","api_error_status":null,"result":"note.txt contains a single line: \"hello from the scratch dir\".","ttft_ms":2407,"ttft_stream_ms":1899,"time_to_request_ms":149,"type":"result","duration_ms":4434,"uuid":"06e2cbd9-e3a7-42bf-8684-cb85b9ff3076"}diff --git a/example-provider/src/agentCard.ts b/example-provider/src/agentCard.tsnew file mode 100644index 000000000..2023c235f--- /dev/null+++ b/example-provider/src/agentCard.ts@@ -0,0 +1,62 @@+/**+ * The Agent Card — HP-020 … HP-023.+ *+ * Unlike the reference provider's static card, this one is built FROM `agents.json`: the skills are+ * whatever directories the operator configured. The card is the whole capability negotiation, so+ * everything this provider can do has to be visible here (HP-001).+ */+import type { AgentEntry } from './config.js'++export const EXT = {+ WORKSPACE_FILES: 'https://harness.autonomous.ai/api/a2a/ext/workspace-files',+ WORKSPACE_WRITE: 'https://harness.autonomous.ai/api/a2a/ext/workspace-write',+ SESSION_RECAP: 'https://harness.autonomous.ai/api/a2a/ext/session-recap',+ VOICE: 'https://harness.autonomous.ai/api/a2a/ext/voice',+} as const++/**+ * Declared here:+ * - `workspace-files` — the agent has a real working directory, so a file tree is meaningful.+ * - `session-recap` — Claude's transcripts give us recent turns for free.+ *+ * - `workspace-write` — projects only. A new agent is a new directory under WORKSPACE_ROOT, which+ * is why that root is separate from the agent directories themselves: creating one must never+ * be able to write outside it.+ *+ * NOT declared:+ * - `voice` — Autonomous routes from skills[] by default; overriding buys nothing here.+ */+export function buildAgentCard(agents: AgentEntry[]): Record<string, unknown> {+ return {+ name: 'Claude (example provider)',+ description:+ 'A real A2A provider backed by the local Claude Code CLI. Each skill is a configured working directory.',+ version: '0.1.0',++ // HP-021 — non-negotiable. Claude streams tokens and so does this provider.+ capabilities: { streaming: true, pushNotifications: false },++ // HP-011 — APIKey in a header is one of the two schemes Autonomous supports.+ securitySchemes: { apiKey: { type: 'apiKey', in: 'header', name: 'x-api-key' } },++ defaultInputModes: ['text/plain'],+ defaultOutputModes: ['text/plain'],++ // HP-023 — the project list the user sees. `cwd` stays server-side: it is a filesystem path and+ // nothing the client needs.+ skills: agents.map((a) => ({ id: a.id, name: a.name, description: a.description })),++ // HP-022 — implemented-but-undeclared must read as absent, so this list is the contract.+ extensions: [+ { uri: EXT.WORKSPACE_FILES, description: 'Browse and read files in the agent working directory.' },+ { uri: EXT.SESSION_RECAP, description: 'Recent turn summaries, from Claude transcripts.' },+ {+ uri: EXT.WORKSPACE_WRITE,+ description: 'Create and remove agents. Each one is a directory under the workspace root.',+ // `sessions: false` — deleting or retitling a Claude transcript would mean writing into+ // ~/.claude, which is the user's own history and not ours to edit.+ params: { projects: true, sessions: false },+ },+ ],+ }+}diff --git a/example-provider/src/claude.ts b/example-provider/src/claude.tsnew file mode 100644index 000000000..51ade789d--- /dev/null+++ b/example-provider/src/claude.ts@@ -0,0 +1,116 @@+/**+ * Spawning the `claude` CLI for one turn.+ *+ * The invocation mirrors `apps/agent-node/brain/src/prefrontal/process.ts:444-463` — the flags are+ * infrastructural, and the user's message is passed VERBATIM. No wrapper text, no prepended hints.+ *+ * ⚠ This runs with `--dangerously-skip-permissions`: Claude executes tools without asking. That is a+ * deliberate choice for this example (it matches the product's `auto` autonomy) and it means the+ * agent can modify anything under its `cwd`. Point `agents.json` at a directory you are happy to+ * hand over. See README.md.+ */+import { spawn, type ChildProcess } from 'node:child_process'+import { createInterface } from 'node:readline'+import type { StreamLine } from './mapper.js'++export interface TurnOptions {+ claudeBin: string+ cwd: string+ /** The user's text, passed through untouched. */+ text: string+ /** Present on every turn after the first in a session. */+ resumeSessionId?: string+ model?: string+ signal?: AbortSignal+}++export interface TurnHandle {+ /** Resolves when the process exits. Never rejects — a failure is reported through `onLine`. */+ done: Promise<{ code: number | null; killed: boolean }>+ kill: () => void+}++/**+ * Start a turn. `onLine` receives each parsed stdout line in order.+ *+ * Unparsable stdout is skipped rather than thrown on: the CLI is free to print things that are not+ * our JSON, and a stray line must not kill a turn.+ */+export function runTurn(opts: TurnOptions, onLine: (line: StreamLine) => void, onStderr?: (chunk: string) => void): TurnHandle {+ const args = [+ ...(opts.model ? ['--model', opts.model] : []),+ '--print',+ '--verbose',+ '--output-format', 'stream-json',+ '--input-format', 'stream-json',+ '--include-partial-messages',+ '--dangerously-skip-permissions',+ ...(opts.resumeSessionId ? ['--resume', opts.resumeSessionId] : []),+ ]++ const child = spawn(opts.claudeBin, args, {+ cwd: opts.cwd,+ // Its own process group, so cancelling kills the tools it started too. A bare child.kill()+ // leaves those orphaned — the same reason brain uses kill(-pid) in oneshot.ts.+ detached: true,+ stdio: ['pipe', 'pipe', 'pipe'],+ env: { ...process.env },+ })++ let killed = false+ const kill = (): void => {+ if (killed || child.exitCode !== null) return+ killed = true+ killGroup(child)+ }+ opts.signal?.addEventListener('abort', kill, { once: true })++ if (child.stdout) {+ const rl = createInterface({ input: child.stdout, crlfDelay: Infinity })+ rl.on('line', (raw) => {+ const trimmed = raw.trim()+ if (!trimmed) return+ let parsed: StreamLine+ try {+ parsed = JSON.parse(trimmed) as StreamLine+ } catch {+ return // not our JSON — ignore rather than fail the turn+ }+ onLine(parsed)+ })+ }+ if (child.stderr && onStderr) {+ child.stderr.on('data', (chunk: Buffer) => onStderr(chunk.toString()))+ }++ // The user's message, verbatim, in the input-format stream-json envelope (brain: process.ts:809).+ try {+ child.stdin?.write(`${JSON.stringify({ type: 'user', message: { role: 'user', content: [{ type: 'text', text: opts.text }] } })}\n`)+ child.stdin?.end()+ } catch {+ kill()+ }++ const done = new Promise<{ code: number | null; killed: boolean }>((resolve) => {+ let settled = false+ const finish = (code: number | null): void => {+ if (settled) return+ settled = true+ opts.signal?.removeEventListener('abort', kill)+ resolve({ code, killed })+ }+ child.on('close', finish)+ child.on('error', () => finish(null))+ })++ return { done, kill }+}++function killGroup(child: ChildProcess, signal: NodeJS.Signals = 'SIGKILL'): void {+ if (child.pid == null || child.exitCode !== null) return+ try {+ process.kill(-child.pid, signal) // negative pid = the whole group+ } catch {+ try { child.kill(signal) } catch { /* already gone */ }+ }+}diff --git a/example-provider/src/config.ts b/example-provider/src/config.tsnew file mode 100644index 000000000..648d7fba9--- /dev/null+++ b/example-provider/src/config.ts@@ -0,0 +1,131 @@+/**+ * Configuration: the agent list, and how to reach the `claude` binary.+ *+ * The agent list is the ONLY per-deployment state. Each entry becomes an `AgentCard.skills[]` entry+ * (HP-023) and carries the working directory `claude` is spawned in.+ */+import { execFileSync } from 'node:child_process'+import { existsSync, readFileSync, realpathSync, statSync } from 'node:fs'+import { homedir } from 'node:os'+import { isAbsolute, resolve } from 'node:path'++export interface AgentEntry {+ id: string+ name: string+ description: string+ /** Absolute directory `claude` runs in. Also the key to this agent's transcripts on disk. */+ cwd: string+}++export interface Config {+ agents: AgentEntry[]+ /**+ * Where `autonomous.CreateProject` puts a new agent's directory.+ *+ * Deliberately its own setting rather than "the parent of the first agent": creating an agent is a+ * write, and a write needs a root it cannot escape. Everything created lands under here.+ */+ workspaceRoot: string+ /** Path to agents.json, so a created agent survives a restart. */+ agentsFile: string+ claudeBin: string+ /** Passed to `--model`. Never taken from the wire: model selection is out of scope (spec §9). */+ model: string+ port: number+ /** Where sessions.json lives. */+ stateFile: string+ claudeProjectsDir: string+}++/**+ * The model this example runs on.+ *+ * Pinned rather than left to the CLI default, because the whole point of the profile is that a+ * PROVIDER owns its model choice — Autonomous never sends one (spec §9), so if this were unset the+ * example would silently inherit whatever the local CLI happened to be configured with, and two+ * machines would behave differently for reasons nobody could see. Override with CLAUDE_MODEL.+ */+export const DEFAULT_MODEL = 'claude-sonnet-5'++/** Agent ids are interpolated into paths and compared against wire input — keep them boring. */+const ID_RE = /^[a-z0-9][a-z0-9-]{0,63}$/++export function loadAgents(file: string): AgentEntry[] {+ if (!existsSync(file)) {+ throw new Error(+ `agents file not found: ${file}\n` ++ `Copy agents.example.json to agents.json and point it at a directory you are happy for an ` ++ `agent to modify — see the warning in README.md.`,+ )+ }+ let raw: unknown+ try {+ raw = JSON.parse(readFileSync(file, 'utf8'))+ } catch (err) {+ throw new Error(`${file} is not valid JSON: ${err instanceof Error ? err.message : String(err)}`)+ }+ if (!Array.isArray(raw) || raw.length === 0) {+ throw new Error(`${file} must be a non-empty array of agents`)+ }++ const seen = new Set<string>()+ return raw.map((entry, i) => {+ const e = entry as Partial<AgentEntry>+ const where = `${file}[${i}]`+ if (!e.id || !ID_RE.test(e.id)) throw new Error(`${where}: id must match ${ID_RE} (got ${JSON.stringify(e.id)})`)+ if (seen.has(e.id)) throw new Error(`${where}: duplicate id "${e.id}"`)+ seen.add(e.id)+ if (!e.name?.trim()) throw new Error(`${where}: name is required — it is shown to the user`)+ if (!e.cwd || !isAbsolute(e.cwd)) throw new Error(`${where}: cwd must be an absolute path`)+ // Fail at load, not at the first turn: a bad cwd would otherwise surface as a mysterious agent+ // failure minutes later, which is exactly the failure mode this provider exists to avoid.+ if (!existsSync(e.cwd) || !statSync(e.cwd).isDirectory()) {+ throw new Error(`${where}: cwd does not exist or is not a directory: ${e.cwd}`)+ }+ // RESOLVE SYMLINKS. Claude records the fully-resolved path, and the transcript directory name is+ // derived from it — on macOS `/tmp` is a symlink to `/private/tmp`, so a configured `/tmp/x`+ // would look for `-tmp-x` while Claude wrote `-private-tmp-x`, and every history read would come+ // back empty. The conformance suite caught exactly this (HP-201).+ return { id: e.id, name: e.name.trim(), description: e.description?.trim() ?? '', cwd: realpathSync(resolve(e.cwd)) }+ })+}++/**+ * Resolve the `claude` binary. `which` first, then the usual install locations — the same problem+ * `brain` solves with `resolveClaudeExecutablePath`, kept deliberately simpler here.+ */+export function resolveClaudeBin(explicit?: string): string {+ if (explicit) {+ if (!existsSync(explicit)) throw new Error(`CLAUDE_PATH points at a file that does not exist: ${explicit}`)+ return explicit+ }+ try {+ const found = execFileSync('which', ['claude'], { encoding: 'utf8' }).trim().split('\n')[0]+ if (found && existsSync(found)) return found+ } catch { /* fall through to the well-known locations */ }++ for (const candidate of [+ `${homedir()}/.local/bin/claude`,+ `${homedir()}/.claude/local/claude`,+ '/usr/local/bin/claude',+ '/opt/homebrew/bin/claude',+ ]) {+ if (existsSync(candidate)) return candidate+ }+ throw new Error('could not find the `claude` binary — install it, or set CLAUDE_PATH')+}++export function loadConfig(): Config {+ const agentsFile = process.env.AGENTS_FILE ?? resolve(process.cwd(), 'agents.json')+ const workspaceRoot = realpathSync(resolve(process.env.WORKSPACE_ROOT ?? '/tmp/example-provider-scratch'))+ return {+ agents: loadAgents(agentsFile),+ workspaceRoot,+ agentsFile,+ claudeBin: resolveClaudeBin(process.env.CLAUDE_PATH),+ model: process.env.CLAUDE_MODEL || DEFAULT_MODEL,+ port: Number(process.env.PORT ?? 4502),+ stateFile: process.env.STATE_FILE ?? resolve(process.cwd(), 'sessions.json'),+ claudeProjectsDir: process.env.CLAUDE_PROJECTS_DIR ?? `${homedir()}/.claude/projects`,+ }+}diff --git a/example-provider/src/jsonl.spec.ts b/example-provider/src/jsonl.spec.tsnew file mode 100644index 000000000..8caf6f519--- /dev/null+++ b/example-provider/src/jsonl.spec.ts@@ -0,0 +1,156 @@+// Transcript discovery, plus a regression on the bug that made every history read come back empty.+import { mkdirSync, mkdtempSync, realpathSync, rmSync, symlinkSync, writeFileSync } from 'node:fs'+import { tmpdir } from 'node:os'+import { join } from 'node:path'+import { afterAll, describe, expect, it } from 'vitest'+import { loadAgents } from './config.js'+import { isSessionFile, listSessions, mangleCwd, readTranscript, sessionIdFromFile, sliceByTime } from './jsonl.js'++const root = mkdtempSync(join(tmpdir(), 'example-provider-test-'))+afterAll(() => rmSync(root, { recursive: true, force: true }))++function transcript(projectsDir: string, cwd: string, sessionId: string, lines: unknown[]): void {+ const dir = join(projectsDir, mangleCwd(cwd))+ mkdirSync(dir, { recursive: true })+ writeFileSync(join(dir, `${sessionId}.jsonl`), lines.map((l) => JSON.stringify(l)).join('\n'))+}++const userLine = (text: string, timestamp: string) => ({+ type: 'user', timestamp, cwd: '/w', sessionId: 's1',+ message: { role: 'user', content: [{ type: 'text', text }] },+})+const assistantLine = (text: string, timestamp: string) => ({+ type: 'assistant', timestamp, cwd: '/w', sessionId: 's1',+ message: { role: 'assistant', content: [{ type: 'text', text }] },+})++describe('mangleCwd', () => {+ it('replaces every non-alphanumeric character with a dash', () => {+ expect(mangleCwd('/Users/me/go/src/x.y')).toBe('-Users-me-go-src-x-y')+ })+ it('is lossy — two different paths can collide, which is why cwd is read off the lines', () => {+ expect(mangleCwd('/a/b')).toBe(mangleCwd('/a-b'))+ })+})++describe('session files', () => {+ it('accepts a session and rejects a subagent mirror', () => {+ expect(isSessionFile('abc.jsonl')).toBe(true)+ expect(isSessionFile('agent-abc.jsonl')).toBe(false)+ expect(isSessionFile('notes.txt')).toBe(false)+ })+ it('takes the session id from the filename', () => {+ expect(sessionIdFromFile('/x/y/abc-123.jsonl')).toBe('abc-123')+ })+})++describe('readTranscript', () => {+ const projectsDir = join(root, 'projects')++ it('keeps only conversation lines and drops the rest', () => {+ transcript(projectsDir, '/w1', 's1', [+ { type: 'last-prompt' }, { type: 'mode' }, { type: 'permission-mode' },+ userLine('hello', '2026-08-04T09:00:00Z'),+ { type: 'ai-title', title: 'x' },+ assistantLine('hi', '2026-08-04T09:00:01Z'),+ { type: 'file-history-snapshot' }, { type: 'system' },+ ])+ const lines = readTranscript(projectsDir, '/w1', 's1')+ expect(lines).toHaveLength(2)+ expect(lines.map((l) => l.type)).toEqual(['user', 'assistant'])+ })++ it('drops sidechain lines, which belong to subagents', () => {+ transcript(projectsDir, '/w2', 's1', [+ userLine('main', '2026-08-04T09:00:00Z'),+ { ...assistantLine('sub', '2026-08-04T09:00:01Z'), isSidechain: true },+ ])+ expect(readTranscript(projectsDir, '/w2', 's1')).toHaveLength(1)+ })++ it('survives a half-written trailing line while claude is mid-turn', () => {+ const dir = join(projectsDir, mangleCwd('/w3'))+ mkdirSync(dir, { recursive: true })+ writeFileSync(join(dir, 's1.jsonl'), `${JSON.stringify(userLine('ok', '2026-08-04T09:00:00Z'))}\n{"type":"assist`)+ expect(readTranscript(projectsDir, '/w3', 's1')).toHaveLength(1)+ })++ it('returns empty rather than throwing for an unknown session', () => {+ expect(readTranscript(projectsDir, '/nope', 'missing')).toEqual([])+ })+})++describe('listSessions', () => {+ it('orders newest first and titles from the first user message', () => {+ const projectsDir = join(root, 'projects-list')+ transcript(projectsDir, '/w', 'old', [userLine('the older question', '2026-08-04T08:00:00Z')])+ transcript(projectsDir, '/w', 'new', [userLine('the newer question', '2026-08-04T10:00:00Z')])+ const sessions = listSessions(projectsDir, '/w')+ expect(sessions.map((s) => s.sessionId)).toEqual(['new', 'old'])+ expect(sessions[0]!.title).toBe('the newer question')+ })++ it('ignores subagent mirrors', () => {+ const projectsDir = join(root, 'projects-mirror')+ transcript(projectsDir, '/w', 's1', [userLine('real', '2026-08-04T08:00:00Z')])+ const dir = join(projectsDir, mangleCwd('/w'))+ writeFileSync(join(dir, 'agent-sub.jsonl'), JSON.stringify(userLine('sub', '2026-08-04T09:00:00Z')))+ expect(listSessions(projectsDir, '/w').map((s) => s.sessionId)).toEqual(['s1'])+ })+})++describe('sliceByTime — one A2A task out of a whole Claude session', () => {+ const lines = [+ userLine('turn one', '2026-08-04T09:00:00Z'),+ assistantLine('reply one', '2026-08-04T09:00:05Z'),+ userLine('turn two', '2026-08-04T09:10:00Z'),+ assistantLine('reply two', '2026-08-04T09:10:05Z'),+ ]+ it('selects only the requested window', () => {+ const first = sliceByTime(lines, Date.parse('2026-08-04T08:59:00Z'), Date.parse('2026-08-04T09:01:00Z'))+ expect(first).toHaveLength(2)+ })+ it('leaves the list untouched when unbounded', () => {+ expect(sliceByTime(lines)).toHaveLength(4)+ })+ it('treats a still-running task as open-ended', () => {+ expect(sliceByTime(lines, Date.parse('2026-08-04T09:09:00Z'))).toHaveLength(2)+ })+})++describe('agent cwd resolution', () => {+ it('resolves symlinks, because Claude records the resolved path', () => {+ // REGRESSION: on macOS `/tmp` is a symlink to `/private/tmp`. Configuring `/tmp/x` made this+ // provider look in `-tmp-x` while Claude wrote `-private-tmp-x`, so every history read came back+ // empty and HP-201 failed against a live agent.+ const real = join(root, 'real-dir')+ const link = join(root, 'link-dir')+ mkdirSync(real, { recursive: true })+ symlinkSync(real, link)++ const agentsFile = join(root, 'agents.json')+ writeFileSync(agentsFile, JSON.stringify([{ id: 'a', name: 'A', description: '', cwd: link }]))+ const resolved = loadAgents(agentsFile)[0]!.cwd++ // Compare against realpath(real), not `real` itself: the temp root is already under a symlink on+ // macOS (`/var` → `/private/var`), which is the very hazard this test exists for.+ expect(resolved).toBe(realpathSync(real))+ expect(resolved).not.toBe(link)+ })++ it('rejects a cwd that does not exist, at load rather than at the first turn', () => {+ const agentsFile = join(root, 'agents-bad.json')+ writeFileSync(agentsFile, JSON.stringify([{ id: 'a', name: 'A', cwd: '/definitely/not/here' }]))+ expect(() => loadAgents(agentsFile)).toThrow(/does not exist/)+ })++ it('rejects duplicate ids and bad id shapes', () => {+ const dup = join(root, 'agents-dup.json')+ writeFileSync(dup, JSON.stringify([{ id: 'a', name: 'A', cwd: root }, { id: 'a', name: 'B', cwd: root }]))+ expect(() => loadAgents(dup)).toThrow(/duplicate/)++ const bad = join(root, 'agents-badid.json')+ writeFileSync(bad, JSON.stringify([{ id: '../escape', name: 'A', cwd: root }]))+ expect(() => loadAgents(bad)).toThrow(/id must match/)+ })+})diff --git a/example-provider/src/jsonl.ts b/example-provider/src/jsonl.tsnew file mode 100644index 000000000..1c20a71c9--- /dev/null+++ b/example-provider/src/jsonl.ts@@ -0,0 +1,144 @@+/**+ * Reading Claude Code's own session transcripts.+ *+ * Layout written by the local `claude` CLI:+ *+ * {CLAUDE_PROJECTS_DIR}/<mangled-cwd>/<sessionId>.jsonl+ *+ * `<mangled-cwd>` is the absolute working directory with every non-alphanumeric character replaced+ * by `-`. **It is lossy and not reversible** — never try to un-mangle it; the real working directory+ * is carried on the `cwd` field of the lines themselves.+ *+ * This is why `GetTask`/`ListTasks` are Tier 0 in the profile and cost this provider nothing: the+ * history already exists on disk. A turn typed straight into a terminal lands here too, so it shows+ * up in the session list — it just does not stream live (this app implements no SubscribeToTask).+ *+ * A real transcript carries TWELVE line types; only `user` and `assistant` hold conversation.+ * Ignoring the rest is the common case, not defensive padding.+ */+import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs'+import { basename, join } from 'node:path'++/** Every non-alphanumeric character becomes `-`. Lossy by design. */+export function mangleCwd(cwd: string): string {+ return cwd.replace(/[^a-zA-Z0-9]/g, '-')+}++/** `agent-*.jsonl` are subagent mirrors, not sessions. */+export function isSessionFile(fileName: string): boolean {+ return fileName.endsWith('.jsonl') && !fileName.startsWith('agent-')+}++export function sessionIdFromFile(filePath: string): string {+ return basename(filePath).replace(/\.jsonl$/, '')+}++export interface TranscriptLine {+ type?: string+ message?: { role?: string; content?: unknown; stop_reason?: string | null }+ toolUseResult?: unknown+ timestamp?: string+ cwd?: string+ sessionId?: string+ uuid?: string+ isSidechain?: boolean+}++export interface SessionSummary {+ sessionId: string+ /** Epoch ms of the newest line, for ordering the session list. */+ updatedAt: number+ /** First user text, for a title — the profile's §10.4 projection. */+ title: string+ messageCount: number+}++export function projectDir(projectsDir: string, cwd: string): string {+ return join(projectsDir, mangleCwd(cwd))+}++/** Conversation lines only, in file order, with sidechain (subagent) lines dropped. */+export function readTranscript(projectsDir: string, cwd: string, sessionId: string): TranscriptLine[] {+ const file = join(projectDir(projectsDir, cwd), `${sessionId}.jsonl`)+ if (!existsSync(file)) return []+ const lines: TranscriptLine[] = []+ for (const raw of readFileSync(file, 'utf8').split('\n')) {+ if (!raw.trim()) continue+ let parsed: TranscriptLine+ try {+ parsed = JSON.parse(raw) as TranscriptLine+ } catch {+ continue // a partially-written trailing line while claude is mid-turn+ }+ if (parsed.type !== 'user' && parsed.type !== 'assistant') continue+ if (parsed.isSidechain) continue+ lines.push(parsed)+ }+ return lines+}++/** Sessions for one agent, newest first. */+export function listSessions(projectsDir: string, cwd: string): SessionSummary[] {+ const dir = projectDir(projectsDir, cwd)+ if (!existsSync(dir)) return []+ const out: SessionSummary[] = []+ for (const name of readdirSync(dir)) {+ if (!isSessionFile(name)) continue+ const sessionId = sessionIdFromFile(name)+ const lines = readTranscript(projectsDir, cwd, sessionId)+ if (!lines.length) continue+ out.push({+ sessionId,+ updatedAt: epoch(lines[lines.length - 1]?.timestamp) || fileMtime(join(dir, name)),+ title: titleOf(lines),+ messageCount: lines.length,+ })+ }+ return out.sort((a, b) => b.updatedAt - a.updatedAt)+}++/** Lines whose timestamp falls inside `[from, to]`. Used to slice one turn out of a session. */+export function sliceByTime(lines: TranscriptLine[], from?: number, to?: number): TranscriptLine[] {+ if (from == null && to == null) return lines+ return lines.filter((l) => {+ const t = epoch(l.timestamp)+ if (!t) return false+ if (from != null && t < from) return false+ if (to != null && t > to) return false+ return true+ })+}++export function epoch(timestamp?: string): number {+ if (!timestamp) return 0+ const t = Date.parse(timestamp)+ return Number.isNaN(t) ? 0 : t+}++function fileMtime(path: string): number {+ try {+ return statSync(path).mtimeMs+ } catch {+ return 0+ }+}++/** First user text in the session, truncated. Profile §10.4. */+function titleOf(lines: TranscriptLine[]): string {+ for (const line of lines) {+ if (line.type !== 'user') continue+ const text = textOf(line.message?.content)+ if (text) return text.length > 80 ? `${text.slice(0, 77)}…` : text+ }+ return 'Untitled'+}++function textOf(content: unknown): string {+ if (typeof content === 'string') return content.trim()+ if (!Array.isArray(content)) return ''+ return content+ .filter((b): b is { type: string; text?: string } => !!b && typeof b === 'object' && (b as { type?: string }).type === 'text')+ .map((b) => b.text ?? '')+ .join(' ')+ .trim()+}diff --git a/example-provider/src/mapper.spec.ts b/example-provider/src/mapper.spec.tsnew file mode 100644index 000000000..db1dec3d4--- /dev/null+++ b/example-provider/src/mapper.spec.ts@@ -0,0 +1,136 @@+// These run against a REAL recorded Claude turn (`__fixtures__/real-turn.jsonl`), not hand-written+// JSON. That matters: two genuine bugs in this mapper were invisible to invented fixtures and+// obvious the moment a real turn was replayed —+//+// 1. nearly EVERY stdout line carries `session_id`, so an early `if (line.session_id) return …`+// swallowed every event and the turn produced nothing at all;+// 2. `tool_use` is announced twice (once by `content_block_start` with empty input, once by the+// complete `assistant` message), so every tool rendered twice.+//+// Both are pinned below. Do not replace these fixtures with synthetic ones.+import { readFileSync } from 'node:fs'+import { join } from 'node:path'+import { describe, expect, it } from 'vitest'+import { messageToParts, pairToolNames, sessionIdOf, streamLineToOutcome, toolResultText, type StreamLine } from './mapper.js'+import type { Part } from './types.js'++const FIXTURE = join(import.meta.dirname, '__fixtures__', 'real-turn.jsonl')++function replay(): { parts: Part[]; sessionId?: string; done?: { failed: boolean; detail?: string } } {+ const lines = readFileSync(FIXTURE, 'utf8').split('\n').filter(Boolean).map((l) => JSON.parse(l) as StreamLine)+ const parts: Part[] = []+ let sessionId: string | undefined+ let done: { failed: boolean; detail?: string } | undefined+ for (const line of lines) {+ sessionId ??= sessionIdOf(line)+ const outcome = streamLineToOutcome(line)+ if (outcome.kind === 'parts') parts.push(...outcome.parts)+ if (outcome.kind === 'done') done = { failed: outcome.failed, detail: outcome.detail }+ }+ return { parts: pairToolNames(parts), sessionId, done }+}++const kindsOf = (parts: Part[]): Record<string, number> =>+ parts.reduce<Record<string, number>>((acc, p) => {+ const k = p.metadata?.['autonomous.ai/kind'] ?? '(none)'+ acc[k] = (acc[k] ?? 0) + 1+ return acc+ }, {})++describe('replaying a real recorded turn', () => {+ it('captures the Claude session id, which every later turn resumes from', () => {+ expect(replay().sessionId).toMatch(/^[0-9a-f-]{36}$/)+ })++ it('produces a terminal outcome, so HP-102 can be satisfied', () => {+ const { done } = replay()+ expect(done).toBeDefined()+ expect(done!.failed).toBe(false)+ })++ it('emits assistant text', () => {+ const text = replay().parts.filter((p) => p.metadata?.['autonomous.ai/kind'] === 'text_delta').map((p) => p.text).join('')+ expect(text).toContain('note.txt')+ })++ it('does NOT swallow every event — regression on the session_id early-return', () => {+ // The bug produced exactly zero parts. Any non-trivial count proves the line is still reachable.+ expect(replay().parts.length).toBeGreaterThan(3)+ })++ it('emits each tool exactly once — regression on the double tool_use', () => {+ const kinds = kindsOf(replay().parts)+ expect(kinds.tool_start).toBe(1)+ expect(kinds.tool_end).toBe(1)+ })++ it('carries the tool arguments, not the empty ones from content_block_start', () => {+ const start = replay().parts.find((p) => p.metadata?.['autonomous.ai/kind'] === 'tool_start')+ expect(start?.metadata?.['autonomous.ai/tool']).toBe('Read')+ expect(JSON.stringify(start?.metadata?.['autonomous.ai/toolInput'])).toContain('note.txt')+ })++ it('pairs a tool_end back to its tool name, which the result block does not carry', () => {+ const end = replay().parts.find((p) => p.metadata?.['autonomous.ai/kind'] === 'tool_end')+ expect(end?.metadata?.['autonomous.ai/tool']).toBe('Read')+ expect(end?.metadata?.['autonomous.ai/toolCallId']).toBeTruthy()+ })++ it('ignores the line types that carry no conversation', () => {+ // system, rate_limit_event, message_start/stop, content_block_stop … all present in the fixture.+ const lines = readFileSync(FIXTURE, 'utf8').split('\n').filter(Boolean).map((l) => JSON.parse(l) as StreamLine)+ const ignored = lines.filter((l) => streamLineToOutcome(l).kind === 'ignore')+ expect(ignored.length).toBeGreaterThan(lines.length / 2)+ })+})++describe('messageToParts — the shape shared by stdout and JSONL', () => {+ it('maps thinking, text, tool_use and tool_result', () => {+ const parts = messageToParts({+ role: 'assistant',+ content: [+ { type: 'thinking', thinking: 'weighing it up' },+ { type: 'text', text: 'here you go' },+ { type: 'tool_use', id: 'c1', name: 'Bash', input: { command: 'ls' } },+ ],+ })+ expect(kindsOf(parts)).toEqual({ thinking_delta: 1, text_delta: 1, tool_start: 1 })+ })++ it('marks a failed tool result and keeps its id', () => {+ const parts = messageToParts({+ role: 'user',+ content: [{ type: 'tool_result', tool_use_id: 'c1', is_error: true, content: 'boom' }],+ })+ expect(parts[0]!.metadata?.['autonomous.ai/isError']).toBe(true)+ expect(parts[0]!.metadata?.['autonomous.ai/toolCallId']).toBe('c1')+ })++ it('skips unknown block types instead of throwing', () => {+ // Claude's format is internal and can gain block types; a new one must degrade to "not+ // rendered", never to a broken turn.+ expect(() => messageToParts({ role: 'assistant', content: [{ type: 'something_new_in_2027' }] })).not.toThrow()+ expect(messageToParts({ role: 'assistant', content: [{ type: 'something_new_in_2027' }] })).toEqual([])+ })++ it('tolerates a missing or non-array content', () => {+ expect(messageToParts(undefined)).toEqual([])+ expect(messageToParts({ role: 'assistant' })).toEqual([])+ })++ it('normalises tool result content given as blocks or as a string', () => {+ expect(toolResultText('plain')).toBe('plain')+ expect(toolResultText([{ type: 'text', text: 'a' }, { type: 'text', text: 'b' }])).toBe('ab')+ expect(toolResultText(null)).toBe('')+ })+})++describe('sessionIdOf', () => {+ it('reads the id off any line that carries it', () => {+ expect(sessionIdOf({ type: 'system', session_id: 'abc' })).toBe('abc')+ })+ it('returns undefined rather than an empty string', () => {+ expect(sessionIdOf({ type: 'system', session_id: '' })).toBeUndefined()+ expect(sessionIdOf({ type: 'system' })).toBeUndefined()+ })+})diff --git a/example-provider/src/mapper.ts b/example-provider/src/mapper.tsnew file mode 100644index 000000000..f91210267--- /dev/null+++ b/example-provider/src/mapper.ts@@ -0,0 +1,239 @@+/**+ * Claude → A2A. **The single place** Claude's shape becomes the wire format.+ *+ * Two callers, one mapper:+ * - the LIVE path, reading `--output-format stream-json` off the spawned process's stdout, and+ * - the HISTORY path, reading Claude's own `.jsonl` transcripts.+ *+ * Both carry the same Anthropic message shape (content blocks). Writing two parsers is the reliable+ * way to make the live view and the post-refresh view disagree, so there is exactly one here; only+ * the live path adds partial-token deltas on top.+ *+ * Metadata keys are defined by `../spec/README.md` §7 and validated by+ * `docs/specs/schema/part-metadata.json`.+ */+import type { Part, PartMetadata } from './types.js'++/** An Anthropic content block as it appears in both stdout events and JSONL lines. */+export interface ContentBlock {+ type?: string+ text?: string+ thinking?: string+ id?: string+ name?: string+ input?: unknown+ tool_use_id?: string+ content?: unknown+ is_error?: boolean+}++export interface AnthropicMessage {+ role?: string+ content?: unknown+}++const meta = (kind: NonNullable<PartMetadata['autonomous.ai/kind']>, extra: PartMetadata = {}): PartMetadata => ({+ 'autonomous.ai/kind': kind,+ ...extra,+})++/** Tool results arrive as a string or as an array of text blocks; normalise to one string. */+export function toolResultText(content: unknown): string {+ if (typeof content === 'string') return content+ if (!Array.isArray(content)) return ''+ return content+ .filter((b): b is { type?: string; text?: string } => !!b && typeof b === 'object')+ .map((b) => b.text ?? '')+ .join('')+}++const MAX_OUTPUT = 2000++/** One line for the client's collapsed tool row. */+function summarise(tool: string, output: string, isError: boolean): string {+ if (isError) return `${tool} failed`+ const firstLine = output.split('\n').find((l) => l.trim()) ?? ''+ if (!firstLine) return `${tool} returned nothing`+ return firstLine.length > 120 ? `${firstLine.slice(0, 117)}…` : firstLine+}++/**+ * Map one Anthropic message to Parts.+ *+ * Unknown block types are SKIPPED, never thrown on: Claude's internal format is not a contract we+ * control, and a new block type must degrade to "not rendered", not to a broken turn.+ */+export function messageToParts(message: AnthropicMessage | undefined): Part[] {+ const blocks = message?.content+ if (typeof blocks === 'string') {+ return blocks.trim() ? [{ text: blocks, metadata: meta(message?.role === 'user' ? 'user_message' : 'text_delta') }] : []+ }+ if (!Array.isArray(blocks)) return []++ const parts: Part[] = []+ for (const raw of blocks) {+ const block = raw as ContentBlock+ switch (block.type) {+ case 'text':+ if (block.text?.trim()) {+ parts.push({ text: block.text, metadata: meta(message?.role === 'user' ? 'user_message' : 'text_delta') })+ }+ break++ case 'thinking':+ if (block.thinking?.trim()) {+ parts.push({ text: block.thinking, metadata: meta('thinking_delta') })+ }+ break++ case 'tool_use':+ parts.push({+ text: '',+ metadata: meta('tool_start', {+ 'autonomous.ai/toolCallId': block.id ?? '',+ 'autonomous.ai/tool': block.name ?? 'tool',+ 'autonomous.ai/toolInput': block.input,+ }),+ })+ break++ case 'tool_result': {+ const output = toolResultText(block.content)+ const isError = block.is_error === true+ parts.push({+ text: output.length > MAX_OUTPUT ? `${output.slice(0, MAX_OUTPUT)}…` : output,+ metadata: meta('tool_end', {+ 'autonomous.ai/toolCallId': block.tool_use_id ?? '',+ // The tool NAME lives on the matching tool_use block, not here. Callers that have the+ // pairing fill it in; on its own the result only knows the id.+ 'autonomous.ai/tool': '',+ 'autonomous.ai/isError': isError,+ 'autonomous.ai/summary': summarise('tool', output, isError),+ }),+ })+ break+ }++ // 'image' and anything else: deliberately not rendered. See the doc comment.+ default:+ break+ }+ }+ return parts+}++/**+ * Fill in tool names on `tool_end` parts by pairing them with earlier `tool_start` parts.+ *+ * Necessary because a `tool_result` block carries only `tool_use_id`. Run this over a whole+ * transcript, or over the accumulated parts of a live turn.+ */+export function pairToolNames(parts: Part[]): Part[] {+ const names = new Map<string, string>()+ for (const p of parts) {+ const m = p.metadata+ if (m?.['autonomous.ai/kind'] === 'tool_start' && m['autonomous.ai/toolCallId']) {+ names.set(m['autonomous.ai/toolCallId'], m['autonomous.ai/tool'] ?? 'tool')+ }+ }+ return parts.map((p) => {+ const m = p.metadata+ if (m?.['autonomous.ai/kind'] !== 'tool_end') return p+ const id = m['autonomous.ai/toolCallId'] ?? ''+ const tool = names.get(id)+ if (!tool) return p+ return {+ ...p,+ metadata: {+ ...m,+ 'autonomous.ai/tool': tool,+ 'autonomous.ai/summary': summarise(tool, p.text ?? '', m['autonomous.ai/isError'] === true),+ },+ }+ })+}++// ── The live path: `--output-format stream-json` ─────────────────────────────────────────────────++/** One line of Claude's stdout. Only the fields this provider reads. */+export interface StreamLine {+ type?: string+ subtype?: string+ session_id?: string+ message?: AnthropicMessage+ event?: {+ type?: string+ content_block?: ContentBlock+ delta?: { type?: string; text?: string; thinking?: string }+ }+ is_error?: boolean+ result?: string+}++export type StreamOutcome =+ | { kind: 'parts'; parts: Part[] }+ | { kind: 'done'; failed: boolean; detail?: string }+ | { kind: 'ignore' }++/**+ * The Claude session id, for `--resume` on the next turn.+ *+ * Deliberately SEPARATE from `streamLineToOutcome`: **nearly every line carries `session_id`**, so+ * folding this into the mapper as an early return silently swallows every event. (It did, until a+ * recorded real turn caught it — a hand-written fixture would not have carried the field.)+ */+export function sessionIdOf(line: StreamLine): string | undefined {+ return typeof line.session_id === 'string' && line.session_id ? line.session_id : undefined+}++/**+ * Map one stdout line.+ *+ * `--include-partial-messages` means text and thinking arrive twice: once as deltas, and again in+ * the complete `assistant` message. This emits the DELTAS for smooth streaming and takes only+ * `tool_use` from the complete message — otherwise every sentence renders twice.+ */+export function streamLineToOutcome(line: StreamLine): StreamOutcome {+ switch (line.type) {+ case 'stream_event': {+ const event = line.event+ if (event?.type === 'content_block_delta') {+ const delta = event.delta+ if (delta?.type === 'text_delta' && delta.text) {+ return { kind: 'parts', parts: [{ text: delta.text, metadata: meta('text_delta') }] }+ }+ if (delta?.type === 'thinking_delta' && delta.thinking) {+ return { kind: 'parts', parts: [{ text: delta.thinking, metadata: meta('thinking_delta') }] }+ }+ return { kind: 'ignore' }+ }+ // NOTE: `content_block_start` also announces tool_use, but its `input` is still empty at that+ // point (arguments stream in as input_json_delta). Taking it here AND from the complete+ // `assistant` message renders every tool twice — a recorded turn showed 2 tool_start against+ // 1 tool_end. The complete message is the single source for tools.+ return { kind: 'ignore' }+ }++ case 'assistant': {+ // Deltas already covered text and thinking; take only the tool calls.+ const blocks = Array.isArray(line.message?.content) ? (line.message?.content as ContentBlock[]) : []+ const tools = blocks.filter((b) => b.type === 'tool_use')+ return tools.length ? { kind: 'parts', parts: messageToParts({ role: 'assistant', content: tools }) } : { kind: 'ignore' }+ }++ case 'user': {+ const blocks = Array.isArray(line.message?.content) ? (line.message?.content as ContentBlock[]) : []+ const results = blocks.filter((b) => b.type === 'tool_result')+ return results.length ? { kind: 'parts', parts: messageToParts({ role: 'user', content: results }) } : { kind: 'ignore' }+ }++ case 'result':+ return { kind: 'done', failed: line.is_error === true || line.subtype === 'error', detail: line.result }++ case 'error':+ return { kind: 'done', failed: true, detail: line.result ?? 'claude reported an error' }++ default:+ return { kind: 'ignore' }+ }+}diff --git a/example-provider/src/server.ts b/example-provider/src/server.tsnew file mode 100644index 000000000..ef49607ef--- /dev/null+++ b/example-provider/src/server.ts@@ -0,0 +1,532 @@+/**+ * A real A2A provider backed by the local `claude` CLI.+ *+ * Conforms to `../spec/README.md`; clause IDs (HP-xxx) appear inline. The shape+ * deliberately mirrors `apps/reference-provider/src/server.ts` so the two can be read side by side —+ * that one is scripted, this one is real.+ *+ * ⚠ Runs Claude with `--dangerously-skip-permissions`. See README.md before pointing it anywhere.+ */+import { createServer, type IncomingMessage, type Server, type ServerResponse } from 'node:http'+import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs'+import { join, normalize, relative, resolve as resolvePath } from 'node:path'+import { buildAgentCard, EXT } from './agentCard.js'+import { runTurn } from './claude.js'+import { loadConfig, type AgentEntry, type Config } from './config.js'+import { createProject, deleteProject, renameProject, WorkspaceError } from './workspace.js'+import { epoch, listSessions, readTranscript, sliceByTime } from './jsonl.js'+import { messageToParts, pairToolNames, sessionIdOf, streamLineToOutcome } from './mapper.js'+import { SessionStore, type TaskRecord } from './sessions.js'+import {+ isTerminal,+ RpcErrors,+ TaskState,+ type JsonRpcError,+ type JsonRpcRequest,+ type Message,+ type Part,+ type TaskStateValue,+ type TaskStatusUpdateEvent,+} from './types.js'++interface Deps {+ config: Config+ store: SessionStore+ /** Rebuilt whenever the agent list changes — the card IS the capability surface (HP-001). */+ card: Record<string, unknown>+ /** taskId → abort, so CancelTask can stop a running claude (HP-103). */+ running: Map<string, AbortController>+}++export function createProviderServer(config: Config): { server: Server; deps: Deps } {+ const deps: Deps = {+ config,+ store: new SessionStore(config.stateFile),+ card: buildAgentCard(config.agents),+ running: new Map(),+ }+ const server = createServer((req, res) => {+ void handle(req, res, deps).catch((err) => {+ console.error('[example-provider] unhandled', err)+ if (!res.headersSent) sendJson(res, 500, { error: 'internal' })+ else res.end()+ })+ })+ return { server, deps }+}++async function handle(req: IncomingMessage, res: ServerResponse, deps: Deps): Promise<void> {+ const url = new URL(req.url ?? '/', 'http://localhost')++ // HP-020 — unauthenticated: a client must be able to read the security scheme before satisfying it.+ if (req.method === 'GET' && url.pathname === '/.well-known/agent-card.json') {+ sendJson(res, 200, deps.card)+ return+ }+ if (req.method !== 'POST' || url.pathname !== '/') {+ sendJson(res, 404, { error: 'not found' })+ return+ }++ let rpc: JsonRpcRequest+ try {+ rpc = JSON.parse(await readBody(req)) as JsonRpcRequest+ } catch {+ sendRpcError(res, null, RpcErrors.PARSE_ERROR)+ return+ }+ if (!rpc || typeof rpc.method !== 'string') {+ sendRpcError(res, rpc?.id ?? null, RpcErrors.INVALID_REQUEST)+ return+ }++ // HP-011 / HP-013. This example has no user database: any non-empty key is a tenant, except the+ // literal `bad-key`, which exists so the conformance runner's --bad-key probe has something to hit.+ const credential = header(req, 'x-api-key')+ if (!credential || credential === 'bad-key') {+ sendRpcError(res, rpc.id ?? null, RpcErrors.UNAUTHENTICATED)+ return+ }++ const params = rpc.params ?? {}+ const id = rpc.id ?? null++ switch (rpc.method) {+ case 'SendStreamingMessage': return sendStreamingMessage(res, deps, params)+ case 'GetTask': return getTask(res, deps, params, id)+ case 'ListTasks': return listTasks(res, deps, params, id)+ case 'CancelTask': return cancelTask(res, deps, params, id)++ // ── Extensions (HP-310: always `autonomous.<Verb>`) ────────────────────────────────────────+ case 'autonomous.ListFiles': return listFiles(res, deps, params, id)+ case 'autonomous.ReadFile': return readFile(res, deps, params, id)+ case 'autonomous.GetRecap': return getRecap(res, deps, params, id)++ // `workspace-write` — projects only; the card declares params.sessions: false.+ case 'autonomous.CreateProject':+ case 'autonomous.RenameProject':+ case 'autonomous.DeleteProject':+ return workspaceWrite(res, deps, rpc.method, params, id)++ // HP-311 — undeclared extension methods MUST be rejected, or the Agent Card means nothing.+ // Session writes would mean editing the user's own Claude transcripts under ~/.claude.+ case 'autonomous.SetSessionTitle':+ case 'autonomous.DeleteSession':+ case 'autonomous.RouteVoice':+ sendRpcError(res, id, RpcErrors.METHOD_NOT_FOUND)+ return++ default:+ sendRpcError(res, id, RpcErrors.METHOD_NOT_FOUND)+ }+}++// ── Agent selection ──────────────────────────────────────────────────────────────────────────────++/**+ * Which configured agent a message targets.+ *+ * NOTE — spec gap: A2A carries no "which skill" selector on a Message, and the profile never says how+ * a client picks one. This reads `message.metadata['autonomous.ai/projectId']` and otherwise falls+ * back to the first configured agent, which keeps plain A2A clients (including the conformance+ * runner) working. Worth a clause in the spec.+ */+function pickAgent(deps: Deps, message: Message | undefined): AgentEntry {+ const requested = (message as { metadata?: Record<string, unknown> } | undefined)?.metadata?.['autonomous.ai/projectId']+ if (typeof requested === 'string') {+ const found = deps.config.agents.find((a) => a.id === requested)+ if (found) return found+ }+ return deps.config.agents[0]!+}++function agentById(deps: Deps, id: string): AgentEntry | undefined {+ return deps.config.agents.find((a) => a.id === id)+}++// ── SendStreamingMessage (HP-100 … HP-106) ───────────────────────────────────────────────────────++async function sendStreamingMessage(res: ServerResponse, deps: Deps, params: Record<string, unknown>): Promise<void> {+ const incoming = params.message as Message | undefined+ if (!incoming || !Array.isArray(incoming.parts)) {+ sendRpcError(res, null, RpcErrors.INVALID_PARAMS)+ return+ }++ // HP-106 — images travel as standard Parts. Claude Code's stream-json input does accept image+ // blocks, but wiring that is beyond this example, so refuse LOUDLY rather than drop them silently.+ if (incoming.parts.some((p) => p.raw && p.mediaType?.startsWith('image/'))) {+ openSse(res)+ const taskId = deps.store.nextTaskId()+ writeSse(res, {+ taskId,+ contextId: incoming.contextId ?? 'ctx-image-refused',+ status: {+ state: TaskState.FAILED,+ message: agentMessage(taskId, incoming.contextId ?? '', [{ text: 'This example provider cannot process image attachments.' }]),+ },+ final: true,+ })+ res.end()+ return+ }++ const text = incoming.parts.map((p) => p.text ?? '').join('').trim()+ if (!text) {+ sendRpcError(res, null, RpcErrors.INVALID_PARAMS)+ return+ }++ // HP-101 — a follow-up carries the existing taskId; a new chat carries only a contextId.+ const resuming = typeof incoming.taskId === 'string' ? deps.store.task(incoming.taskId) : undefined+ if (incoming.taskId && !resuming) {+ sendRpcError(res, null, RpcErrors.TASK_NOT_FOUND)+ return+ }+ if (resuming && isTerminal(resuming.state)) {+ sendRpcError(res, null, { code: -32004, message: 'Task is in a terminal state' })+ return+ }++ const contextId = resuming?.contextId ?? (typeof incoming.contextId === 'string' && incoming.contextId ? incoming.contextId : `ctx-${Date.now()}`)+ const agent = resuming ? agentById(deps, resuming.agentId) ?? pickAgent(deps, incoming) : pickAgent(deps, incoming)+ const context = deps.store.ensureContext(contextId, agent.id)++ const taskId = deps.store.nextTaskId()+ const startedAt = Date.now()+ deps.store.createTask({+ taskId,+ contextId,+ agentId: agent.id,+ state: TaskState.WORKING,+ startedAt,+ title: text.length > 80 ? `${text.slice(0, 77)}…` : text,+ })++ const controller = new AbortController()+ deps.running.set(taskId, controller)++ openSse(res)+ writeSse(res, { taskId, contextId, status: { state: TaskState.WORKING } })++ const collected: Part[] = []+ let sawResult = false+ let failed = false+ let failDetail: string | undefined+ let stderr = ''++ const handle = runTurn(+ {+ claudeBin: deps.config.claudeBin,+ cwd: agent.cwd,+ text,+ resumeSessionId: context.claudeSessionId,+ model: deps.config.model,+ signal: controller.signal,+ },+ (line) => {+ const sid = sessionIdOf(line)+ if (sid) deps.store.setClaudeSession(contextId, sid)+ const outcome = streamLineToOutcome(line)+ if (outcome.kind === 'parts') {+ // Pair tool names across everything seen so far, so a tool_end is not left anonymous.+ const paired = pairToolNames([...collected, ...outcome.parts]).slice(collected.length)+ collected.push(...outcome.parts)+ writeSse(res, { taskId, contextId, status: { state: TaskState.WORKING, message: agentMessage(taskId, contextId, paired) } })+ return+ }+ if (outcome.kind === 'done') {+ sawResult = true+ failed = outcome.failed+ failDetail = outcome.detail+ }+ },+ (chunk) => { stderr += chunk },+ )++ const { killed } = await handle.done+ deps.running.delete(taskId)++ // HP-102 — a terminal state on EVERY stream. A process that dies without emitting `result` is+ // still a finished turn from the client's point of view, and must be reported as failed rather+ // than leaving the stream hanging.+ let finalState: TaskStateValue = TaskState.COMPLETED+ let finalText: string | undefined+ if (killed) {+ finalState = TaskState.CANCELED+ } else if (failed) {+ finalState = TaskState.FAILED+ finalText = failDetail ?? 'claude reported an error'+ } else if (!sawResult) {+ finalState = TaskState.FAILED+ finalText = `claude exited without a result${stderr.trim() ? `: ${stderr.trim().slice(0, 500)}` : ''}`+ }++ deps.store.finishTask(taskId, finalState)+ writeSse(res, {+ taskId,+ contextId,+ status: { state: finalState, ...(finalText ? { message: agentMessage(taskId, contextId, [{ text: finalText }]) } : {}) },+ final: true,+ })+ if (!res.destroyed) res.end()+}++// ── History (HP-200 … HP-202) ────────────────────────────────────────────────────────────────────++/**+ * HP-201 — the turn's messages, read back out of Claude's own transcript.+ *+ * Note the slice: the JSONL holds the whole SESSION, while an A2A task is one TURN, so the task's+ * timestamp window selects its share. A task still running has no end bound yet.+ */+function getTask(res: ServerResponse, deps: Deps, params: Record<string, unknown>, id: string | number | null): void {+ const taskId = typeof params.taskId === 'string' ? params.taskId : ''+ const record = deps.store.task(taskId)+ if (!record) {+ sendRpcError(res, id, RpcErrors.TASK_NOT_FOUND)+ return+ }+ sendRpcResult(res, id, taskToWire(deps, record))+}++/** HP-200 — grouping by contextId is what backs the session list. */+function listTasks(res: ServerResponse, deps: Deps, params: Record<string, unknown>, id: string | number | null): void {+ const contextId = typeof params.contextId === 'string' ? params.contextId : undefined+ const tasks = deps.store.tasks(contextId).map((t) => taskToWire(deps, t, { history: false }))+ sendRpcResult(res, id, { tasks })+}++function taskToWire(deps: Deps, record: TaskRecord, opts: { history?: boolean } = {}): Record<string, unknown> {+ const withHistory = opts.history !== false+ let history: unknown[] = []+ if (withHistory) {+ const context = deps.store.context(record.contextId)+ const agent = agentById(deps, record.agentId)+ if (context?.claudeSessionId && agent) {+ const lines = sliceByTime(+ readTranscript(deps.config.claudeProjectsDir, agent.cwd, context.claudeSessionId),+ record.startedAt - 5_000, // Claude timestamps the line slightly before we record the task+ record.endedAt ? record.endedAt + 5_000 : undefined,+ )+ history = lines.map((line) => ({+ role: line.type === 'user' ? 'ROLE_USER' : 'ROLE_AGENT',+ messageId: line.uuid ?? '',+ taskId: record.taskId,+ contextId: record.contextId,+ parts: pairToolNames(messageToParts(line.message)),+ })).filter((m) => (m.parts as Part[]).length > 0)+ }+ }+ return {+ id: record.taskId,+ contextId: record.contextId,+ status: { state: record.state },+ history,+ metadata: { title: record.title, projectId: record.agentId },+ }+}++/** HP-103 — cancelling stops the process AND its tool subprocesses; the stream then terminates. */+function cancelTask(res: ServerResponse, deps: Deps, params: Record<string, unknown>, id: string | number | null): void {+ const taskId = typeof params.taskId === 'string' ? params.taskId : ''+ const record = deps.store.task(taskId)+ if (!record) {+ sendRpcError(res, id, RpcErrors.TASK_NOT_FOUND)+ return+ }+ if (isTerminal(record.state)) {+ sendRpcError(res, id, RpcErrors.TASK_NOT_CANCELABLE)+ return+ }+ deps.running.get(taskId)?.abort()+ deps.running.delete(taskId)+ deps.store.finishTask(taskId, TaskState.CANCELED)+ sendRpcResult(res, id, taskToWire(deps, deps.store.task(taskId)!, { history: false }))+}++// ── Extension: workspace-files (HP-300) ──────────────────────────────────────────────────────────++/** Resolve a wire path inside the agent's cwd, or throw. Path traversal is the obvious attack here. */+function safeJoin(root: string, rel: string): string {+ const target = resolvePath(root, normalize(rel))+ const inside = relative(root, target)+ if (inside.startsWith('..') || resolvePath(root, inside) !== target) throw new Error('path escapes the agent directory')+ return target+}++function listFiles(res: ServerResponse, deps: Deps, params: Record<string, unknown>, id: string | number | null): void {+ const agent = agentById(deps, String(params.projectId ?? ''))+ if (!agent) { sendRpcError(res, id, RpcErrors.INVALID_PARAMS); return }+ let dir: string+ try {+ dir = params.path ? safeJoin(agent.cwd, String(params.path)) : agent.cwd+ } catch {+ sendRpcError(res, id, RpcErrors.INVALID_PARAMS)+ return+ }+ if (!existsSync(dir) || !statSync(dir).isDirectory()) { sendRpcError(res, id, RpcErrors.INVALID_PARAMS); return }+ const files = readdirSync(dir, { withFileTypes: true })+ .filter((e) => !e.name.startsWith('.'))+ .slice(0, 500)+ .map((e) => {+ const node: Record<string, unknown> = { name: e.name, type: e.isDirectory() ? 'dir' : 'file' }+ if (!e.isDirectory()) { try { node.size = statSync(join(dir, e.name)).size } catch { /* ignore */ } }+ return node+ })+ sendRpcResult(res, id, { files })+}++const MAX_FILE_BYTES = 512 * 1024++function readFile(res: ServerResponse, deps: Deps, params: Record<string, unknown>, id: string | number | null): void {+ const agent = agentById(deps, String(params.projectId ?? ''))+ const path = typeof params.path === 'string' ? params.path : ''+ if (!agent || !path) { sendRpcError(res, id, RpcErrors.INVALID_PARAMS); return }+ let file: string+ try {+ file = safeJoin(agent.cwd, path)+ } catch {+ sendRpcError(res, id, RpcErrors.INVALID_PARAMS)+ return+ }+ if (!existsSync(file) || !statSync(file).isFile()) { sendRpcError(res, id, RpcErrors.INVALID_PARAMS); return }+ const raw = readFileSync(file, 'utf8')+ const truncated = raw.length > MAX_FILE_BYTES+ // Truncation is REPORTED, never silent — the same rule HP-203 sets for transcripts.+ sendRpcResult(res, id, { path, content: truncated ? raw.slice(0, MAX_FILE_BYTES) : raw, ...(truncated ? { truncated: true } : {}) })+}++/** HP-301 — project create / rename / delete, all contained under the workspace root. */+function workspaceWrite(+ res: ServerResponse,+ deps: Deps,+ method: string,+ params: Record<string, unknown>,+ id: string | number | null,+): void {+ try {+ if (method === 'autonomous.CreateProject') {+ const entry = createProject(deps.config, String(params.name ?? ''), String(params.description ?? ''))+ // The card is BUILT from the agent list, so it has to be rebuilt for the new agent to be+ // discoverable at all — the card is the capability surface (HP-001).+ deps.card = buildAgentCard(deps.config.agents)+ sendRpcResult(res, id, { id: entry.id, name: entry.name, description: entry.description })+ return+ }+ if (method === 'autonomous.RenameProject') {+ const entry = renameProject(deps.config, String(params.projectId ?? ''), String(params.name ?? ''))+ deps.card = buildAgentCard(deps.config.agents)+ sendRpcResult(res, id, { id: entry.id, name: entry.name, description: entry.description })+ return+ }+ deleteProject(deps.config, String(params.projectId ?? ''))+ deps.card = buildAgentCard(deps.config.agents)+ sendRpcResult(res, id, { ok: true })+ } catch (err) {+ if (err instanceof WorkspaceError) { sendRpcError(res, id, { code: -32602, message: err.message }); return }+ throw err+ }+}++// ── Extension: session-recap (HP-302) ────────────────────────────────────────────────────────────++/**+ * Recent turns for the device's tiles, straight out of Claude's transcripts.+ *+ * This is where reading the JSONL pays off twice: sessions started in a terminal show up here too,+ * even though this provider streams nothing live for them.+ */+function getRecap(res: ServerResponse, deps: Deps, params: Record<string, unknown>, id: string | number | null): void {+ const agent = agentById(deps, String(params.projectId ?? ''))+ if (!agent) { sendRpcError(res, id, RpcErrors.INVALID_PARAMS); return }+ const n = Math.max(1, Math.min(5, Number(params.n) || 2))+ const entries = listSessions(deps.config.claudeProjectsDir, agent.cwd)+ .slice(0, n)+ .map((s) => ({+ recap: s.title.slice(0, 200), // the device renders under a 200-char ceiling+ contextId: s.sessionId,+ timestamp: new Date(s.updatedAt).toISOString(),+ }))+ sendRpcResult(res, id, { projectId: agent.id, entries })+}++// ── Wire helpers ─────────────────────────────────────────────────────────────────────────────────++function agentMessage(taskId: string, contextId: string, parts: Part[]): Message {+ return { role: 'ROLE_AGENT', messageId: `m-${Date.now()}-${Math.round(epoch(undefined))}`, taskId, contextId, parts }+}++function openSse(res: ServerResponse): void {+ res.writeHead(200, { 'content-type': 'text/event-stream', 'cache-control': 'no-cache', connection: 'keep-alive' })+}++function writeSse(res: ServerResponse, event: TaskStatusUpdateEvent): void {+ if (res.destroyed) return+ res.write(`event: status-update\ndata: ${JSON.stringify(event)}\n\n`)+}++function sendJson(res: ServerResponse, status: number, body: unknown): void {+ const payload = JSON.stringify(body)+ res.writeHead(status, { 'content-type': 'application/json', 'content-length': Buffer.byteLength(payload) })+ res.end(payload)+}++function sendRpcResult(res: ServerResponse, id: string | number | null, result: unknown): void {+ sendJson(res, 200, { jsonrpc: '2.0', id, result })+}++function sendRpcError(res: ServerResponse, id: string | number | null, error: JsonRpcError): void {+ sendJson(res, error.code === RpcErrors.UNAUTHENTICATED.code ? 401 : 200, { jsonrpc: '2.0', id, error })+}++function header(req: IncomingMessage, name: string): string | undefined {+ const v = req.headers[name.toLowerCase()]+ return Array.isArray(v) ? v[0] : v+}++async function readBody(req: IncomingMessage): Promise<string> {+ const chunks: Buffer[] = []+ let size = 0+ for await (const chunk of req) {+ size += (chunk as Buffer).length+ if (size > 5 * 1024 * 1024) throw new Error('body too large')+ chunks.push(chunk as Buffer)+ }+ return Buffer.concat(chunks).toString('utf8')+}++// ── Entry point ──────────────────────────────────────────────────────────────────────────────────++export function start(config = loadConfig(), port = config.port): Promise<{ url: string; close: () => Promise<void> }> {+ const { server, deps } = createProviderServer(config)+ return new Promise((resolve) => {+ server.listen(port, () => {+ const address = server.address()+ const actual = typeof address === 'object' && address ? address.port : port+ resolve({+ url: `http://127.0.0.1:${actual}`,+ close: () =>+ new Promise<void>((done) => {+ for (const c of deps.running.values()) c.abort()+ server.close(() => done())+ }),+ })+ })+ })+}++if (process.argv[1] && import.meta.url === `file://${process.argv[1]}`) {+ try {+ const config = loadConfig()+ void start(config).then(({ url }) => {+ console.log(`[example-provider] listening on ${url}`)+ console.log(`[example-provider] claude: ${config.claudeBin}`)+ console.log(`[example-provider] agents: ${config.agents.map((a) => `${a.id} → ${a.cwd}`).join(', ')}`)+ console.log('[example-provider] ⚠ running with --dangerously-skip-permissions')+ })+ } catch (err) {+ console.error(`[example-provider] ${err instanceof Error ? err.message : String(err)}`)+ process.exit(1)+ }+}diff --git a/example-provider/src/sessions.ts b/example-provider/src/sessions.tsnew file mode 100644index 000000000..abc8e5e77--- /dev/null+++ b/example-provider/src/sessions.ts@@ -0,0 +1,122 @@+/**+ * The identity bridge, persisted to `sessions.json`.+ *+ * The client mints `contextId` (HP-101); Claude assigns its own session id on the first turn. One+ * map bridges them so `--resume` works across turns and across restarts of this process.+ *+ * Task records exist because A2A's `taskId` is one TURN while Claude's transcript is a whole+ * SESSION. The timestamp window is what lets `GetTask` slice one turn back out of the JSONL.+ */+import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs'+import { dirname } from 'node:path'+import type { TaskStateValue } from './types.js'++export interface TaskRecord {+ taskId: string+ contextId: string+ agentId: string+ state: TaskStateValue+ startedAt: number+ endedAt?: number+ /** First user text of the turn — the session title projection (spec §10.4). */+ title: string+}++export interface ContextRecord {+ contextId: string+ agentId: string+ /** Absent until Claude reports one on the first turn. */+ claudeSessionId?: string+}++interface StateFile {+ contexts: Record<string, ContextRecord>+ tasks: Record<string, TaskRecord>+}++export class SessionStore {+ private state: StateFile = { contexts: {}, tasks: {} }+ private seq = 0++ constructor(private readonly file: string) {+ this.load()+ }++ private load(): void {+ if (!existsSync(this.file)) return+ try {+ const parsed = JSON.parse(readFileSync(this.file, 'utf8')) as Partial<StateFile>+ this.state = { contexts: parsed.contexts ?? {}, tasks: parsed.tasks ?? {} }+ // Continue the id sequence past anything already on disk, so a restart cannot reuse an id.+ for (const id of Object.keys(this.state.tasks)) {+ const n = Number(id.replace(/^task-/, ''))+ if (Number.isFinite(n)) this.seq = Math.max(this.seq, n)+ }+ } catch {+ // A corrupt state file must not stop the provider from serving new turns; history for the+ // affected contexts is lost, which is visible, whereas refusing to boot is not.+ this.state = { contexts: {}, tasks: {} }+ }+ }++ private save(): void {+ mkdirSync(dirname(this.file), { recursive: true })+ // Write-then-rename: a crash mid-write must not leave a truncated state file behind.+ const tmp = `${this.file}.tmp`+ writeFileSync(tmp, JSON.stringify(this.state, null, 2))+ renameSync(tmp, this.file)+ }++ nextTaskId(): string {+ return `task-${++this.seq}`+ }++ context(contextId: string): ContextRecord | undefined {+ return this.state.contexts[contextId]+ }++ ensureContext(contextId: string, agentId: string): ContextRecord {+ const existing = this.state.contexts[contextId]+ if (existing) return existing+ const created: ContextRecord = { contextId, agentId }+ this.state.contexts[contextId] = created+ this.save()+ return created+ }++ setClaudeSession(contextId: string, claudeSessionId: string): void {+ const ctx = this.state.contexts[contextId]+ if (!ctx || ctx.claudeSessionId === claudeSessionId) return+ ctx.claudeSessionId = claudeSessionId+ this.save()+ }++ createTask(task: TaskRecord): void {+ this.state.tasks[task.taskId] = task+ this.save()+ }++ finishTask(taskId: string, state: TaskStateValue): void {+ const task = this.state.tasks[taskId]+ if (!task) return+ task.state = state+ task.endedAt = Date.now()+ this.save()+ }++ task(taskId: string): TaskRecord | undefined {+ return this.state.tasks[taskId]+ }++ /** Newest first. Filtered by context when given one. */+ tasks(contextId?: string): TaskRecord[] {+ return Object.values(this.state.tasks)+ .filter((t) => !contextId || t.contextId === contextId)+ .sort((a, b) => b.startedAt - a.startedAt)+ }++ /** Contexts belonging to one agent, used to answer ListTasks scoped to a project. */+ contextsForAgent(agentId: string): ContextRecord[] {+ return Object.values(this.state.contexts).filter((c) => c.agentId === agentId)+ }+}diff --git a/example-provider/src/types.ts b/example-provider/src/types.tsnew file mode 100644index 000000000..26e8f6ff9--- /dev/null+++ b/example-provider/src/types.ts@@ -0,0 +1,137 @@+/**+ * The subset of A2A this reference implementation uses, plus the `autonomous.ai/*` metadata defined by+ * `../spec/README.md`.+ *+ * Deliberately hand-written rather than generated: a partner reading this file should be able to see+ * the entire wire surface without installing anything.+ */++export const TaskState = {+ SUBMITTED: 'TASK_STATE_SUBMITTED',+ WORKING: 'TASK_STATE_WORKING',+ COMPLETED: 'TASK_STATE_COMPLETED',+ FAILED: 'TASK_STATE_FAILED',+ CANCELED: 'TASK_STATE_CANCELED',+ REJECTED: 'TASK_STATE_REJECTED',+ INPUT_REQUIRED: 'TASK_STATE_INPUT_REQUIRED',+ AUTH_REQUIRED: 'TASK_STATE_AUTH_REQUIRED',+} as const++export type TaskStateValue = (typeof TaskState)[keyof typeof TaskState]++/** States after which a task accepts no further messages (A2A: "terminal"). */+export const TERMINAL_STATES: readonly TaskStateValue[] = [+ TaskState.COMPLETED,+ TaskState.FAILED,+ TaskState.CANCELED,+ TaskState.REJECTED,+]++export const isTerminal = (s: TaskStateValue): boolean => TERMINAL_STATES.includes(s)++/** HP-210: every Autonomous-specific key is namespaced. Unknown keys in the namespace are ignored. */+export interface PartMetadata {+ 'autonomous.ai/kind'?:+ | 'user_message'+ | 'thinking_delta'+ | 'thinking_title'+ | 'text_delta'+ | 'tool_start'+ | 'tool_end'+ | 'context_compact'+ | 'done'+ 'autonomous.ai/thinkingId'?: string+ 'autonomous.ai/toolCallId'?: string+ 'autonomous.ai/parentToolCallId'?: string+ 'autonomous.ai/tool'?: string+ 'autonomous.ai/toolInput'?: unknown+ 'autonomous.ai/isError'?: boolean+ 'autonomous.ai/summary'?: string+ 'autonomous.ai/durationSeconds'?: number+ 'autonomous.ai/title'?: string+ 'autonomous.ai/compacted'?: {+ userMessages?: number+ assistantMessages?: number+ toolUses?: number+ contexts?: number+ }+}++export interface Part {+ text?: string+ /** base64 — HP-106 carries image attachments here with `mediaType`. */+ raw?: string+ filename?: string+ mediaType?: string+ url?: string+ metadata?: PartMetadata+}++export type Role = 'ROLE_USER' | 'ROLE_AGENT'++export interface Message {+ role: Role+ messageId: string+ parts: Part[]+ taskId?: string+ contextId?: string+}++export interface Artifact {+ artifactId: string+ name?: string+ parts: Part[]+}++export interface TaskStatus {+ state: TaskStateValue+ message?: Message+}++export interface Task {+ id: string+ contextId: string+ status: TaskStatus+ history: Message[]+ artifacts?: Artifact[]+ /** Not A2A core — used to derive a session title (spec §10.4). */+ metadata?: { title?: string }+}++export interface TaskStatusUpdateEvent {+ taskId: string+ contextId: string+ status: TaskStatus+ final?: boolean+}++export interface TaskArtifactUpdateEvent {+ taskId: string+ contextId: string+ artifact: Artifact+}++export interface JsonRpcRequest {+ jsonrpc: '2.0'+ id?: string | number | null+ method: string+ params?: Record<string, unknown>+}++export interface JsonRpcError {+ code: number+ message: string+ data?: unknown+}++/** JSON-RPC reserved codes plus the A2A-flavoured ones this implementation raises. */+export const RpcErrors = {+ PARSE_ERROR: { code: -32700, message: 'Parse error' },+ INVALID_REQUEST: { code: -32600, message: 'Invalid request' },+ METHOD_NOT_FOUND: { code: -32601, message: 'Method not found' },+ INVALID_PARAMS: { code: -32602, message: 'Invalid params' },+ INTERNAL: { code: -32603, message: 'Internal error' },+ UNAUTHENTICATED: { code: -32001, message: 'Unauthenticated' },+ TASK_NOT_FOUND: { code: -32002, message: 'Task not found' },+ TASK_NOT_CANCELABLE: { code: -32003, message: 'Task not cancelable' },+} as constdiff --git a/example-provider/src/workspace.ts b/example-provider/src/workspace.tsnew file mode 100644index 000000000..b3f95d128--- /dev/null+++ b/example-provider/src/workspace.ts@@ -0,0 +1,79 @@+/**+ * `workspace-write` — creating and removing agents (HP-301).+ *+ * An agent here IS a directory. Creating one therefore means writing to disk, so the only rule that+ * really matters is the containment check: everything lands under `workspaceRoot` and nothing may+ * escape it, however the name is spelled.+ */+import { existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs'+import { relative, resolve } from 'node:path'+import type { AgentEntry, Config } from './config.js'++export class WorkspaceError extends Error {}++/** Names arrive off the wire, so the id is derived rather than trusted. */+export function slugify(name: string): string {+ const slug = name.trim().toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 48)+ if (!slug) throw new WorkspaceError('name must contain at least one letter or digit')+ return slug+}++/** Resolve a new agent directory inside the root, or refuse. */+function containedDir(root: string, slug: string): string {+ const target = resolve(root, slug)+ const inside = relative(root, target)+ if (!inside || inside.startsWith('..') || resolve(root, inside) !== target) {+ throw new WorkspaceError('that name resolves outside the workspace root')+ }+ return target+}++export function createProject(config: Config, name: string, description = ''): AgentEntry {+ const trimmed = name.trim()+ if (!trimmed) throw new WorkspaceError('name is required')+ const id = slugify(trimmed)+ if (config.agents.some((a) => a.id === id)) throw new WorkspaceError(`an agent named "${trimmed}" already exists`)++ const cwd = containedDir(config.workspaceRoot, id)+ mkdirSync(cwd, { recursive: true })++ const entry: AgentEntry = { id, name: trimmed, description: description.trim(), cwd }+ config.agents.push(entry)+ persist(config)+ return entry+}++export function deleteProject(config: Config, id: string): void {+ const index = config.agents.findIndex((a) => a.id === id)+ if (index === -1) throw new WorkspaceError('unknown agent')+ const [removed] = config.agents.splice(index, 1)+ persist(config)+ // The DIRECTORY is left alone on purpose. Removing an agent from the list is reversible; deleting+ // whatever work it produced is not, and an example provider is the last place to be destructive.+ void removed+}++export function renameProject(config: Config, id: string, name: string): AgentEntry {+ const entry = config.agents.find((a) => a.id === id)+ if (!entry) throw new WorkspaceError('unknown agent')+ const trimmed = name.trim()+ if (!trimmed) throw new WorkspaceError('name is required')+ entry.name = trimmed+ persist(config)+ return entry+}++/** Write-then-rename: a crash mid-write must not leave a truncated agents.json. */+function persist(config: Config): void {+ const rows = config.agents.map(({ id, name, description, cwd }) => ({ id, name, description, cwd }))+ const tmp = `${config.agentsFile}.tmp`+ writeFileSync(tmp, `${JSON.stringify(rows, null, 2)}\n`)+ renameSync(tmp, config.agentsFile)+}++/** Used by the tests to read back what was persisted. */+export function readAgentsFile(config: Config): unknown {+ return existsSync(config.agentsFile) ? JSON.parse(readFileSync(config.agentsFile, 'utf8')) : null+}++export const __testing = { containedDir, rmSync }diff --git a/example-provider/tsconfig.json b/example-provider/tsconfig.jsonnew file mode 100644index 000000000..37aefca41--- /dev/null+++ b/example-provider/tsconfig.json@@ -0,0 +1,18 @@+{+ "compilerOptions": {+ "target": "ES2023",+ "lib": ["ES2023"],+ "module": "NodeNext",+ "moduleResolution": "NodeNext",+ "esModuleInterop": true,+ "strict": true,+ "skipLibCheck": true,+ "outDir": "dist",+ "rootDir": "src",+ "declaration": false,+ "incremental": true,+ "tsBuildInfoFile": ".tsbuildinfo"+ },+ "include": ["src/**/*"],+ "exclude": ["node_modules", "dist", ".tsbuildinfo"]+}diff --git a/reference-provider/README.md b/reference-provider/README.mdnew file mode 100644index 000000000..20592fbb9--- /dev/null+++ b/reference-provider/README.md@@ -0,0 +1,119 @@+# reference-provider++A minimal, deterministic implementation of the **Autonomous harness provider profile**+(`../spec/README.md`) — an A2A agent that Autonomous can attach to as a `provider`+harness.++It runs no model. Every reply is scripted, which is the point: it exists to prove the spec is+implementable, to give the backend client something real to talk to, and to be the target the+conformance suite runs against.++**Zero runtime dependencies**, `node:http` and nothing else. A partner should be able to read+`src/server.ts` end to end and know exactly what their own endpoint has to do.++## Run it++```bash+npm install+npm run dev # http://127.0.0.1:4501+curl localhost:4501/.well-known/agent-card.json+```++Send a turn (any non-empty `x-api-key` is accepted except the literal `bad-key`):++```bash+curl -N localhost:4501 \+ -H 'content-type: application/json' -H 'x-api-key: demo' \+ -d '{"jsonrpc":"2.0","id":1,"method":"SendStreamingMessage",+ "params":{"message":{"role":"ROLE_USER","messageId":"m1",+ "parts":[{"text":"did acme blow through budget?"}]}}}'+```++`STEP_DELAY_MS` (default 20) controls the pause between streamed steps; the tests set it to 0.++## Scenarios++Selected by what the user's message contains — see `src/scenarios.ts`. **The hostile ones are the+reason this app exists**; a reference that only demonstrates success teaches a partner nothing about+the failure modes their integration will actually hit.++| Say this | What happens | Why it's here |+|---|---|---|+| *(anything else)* | thinking → tool call → text → `COMPLETED` | the full-fidelity turn |+| `plain` | one text part, **no metadata at all** | HP-211 — a bare provider is conformant |+| `ask me` | parks in `INPUT_REQUIRED` | HP-104 — answer arrives on the same `taskId` |+| `fail` | emits output, then `FAILED` | failure after partial output |+| `die` | stream cut with **no terminal state** | deliberately violates HP-102, so the client can be hardened |+| `compact` | reports `context_compact` | the provider compacted its own context (spec §9) |+| *(image attachment)* | `FAILED` with a clear message | HP-106 — silent discarding is a violation |++Credential `bad-key` fails every call with HTTP 401 + `-32001`, for exercising HP-013.++## What it deliberately does NOT declare++`workspace-files` and `workspace-write` are absent from the agent card. That is not an oversight — it+exercises the degradation path, where the client must hide those features rather than offer controls+that fail (HP-022).++## Conformance suite++Point it at **any** provider endpoint — yours, or someone else's:++```bash+npm run conformance -- --url https://agent.example.com --key <credential>++# two optional flags unlock three more clauses:+# --bad-key <invalid credential> → HP-013 (a rejection must be distinguishable from an outage)+# --ask-phrase "<prompt>" → HP-103, HP-104 (cancel, and the INPUT_REQUIRED round trip)+```++Against this reference provider: **22 passed · 0 failed · 2 need manual review · 9 not verifiable from outside**.++Two rules it follows, both deliberate:++- **Nothing is skipped silently.** A clause that genuinely cannot be checked from outside — tenant+ isolation, the 5 MB transcript ceiling, whether the credential gets logged — is reported as SKIP+ **with the reason printed**. A suite that claims to check everything while quietly checking half of+ it is worse than no suite at all.+- **An undeclared extension is a SKIP, not a failure.** Absence is a legitimate answer (HP-022).++Output names the clause, so a red line points at a section of the spec rather than at a symptom:++```+✖ HP-200 ListTasks filters by contextId+ 3 task(s) from another context leaked into the filter+```++Extension checks are **real calls**, not stubs: `autonomous.GetRecap` is invoked and its response+validated (including the 200-character ceiling the device renders under). `workspace-write` is probed+**non-destructively** — empty params must yield `-32602` (invalid params) rather than `-32601` (method+not found), which proves the method exists without a conformance runner mutating someone's live+workspace.++The suite itself has been mutation-tested. Six deliberate breaks, each turning exactly one clause red:+`streaming: false` → HP-021 · a mistyped extension URI → HP-003 · ignoring the `contextId` filter →+HP-200 · an unrecognised metadata kind → HP-210 · answering an **undeclared** extension method →+HP-311 · a recap longer than 200 characters → HP-302.++## Tests++```bash+npm test # 30 tests — provider + the conformance runner itself+npm run typecheck+```++Each test names the clause it pins. When the spec changes, these should be the first thing to go red.+The suite has been mutation-tested: dropping `final` on terminal states, silently discarding images,+and allowing a finished task to be cancelled each turn it red.++## Layout++| File | Role |+|---|---|+| `src/types.ts` | the A2A subset used here, plus the `autonomous.ai/*` metadata — hand-written so the whole wire surface is readable in one file |+| `src/agentCard.ts` | the entire capability negotiation (HP-020 … HP-023) |+| `src/scenarios.ts` | the scripted turns, happy and hostile |+| `src/store.ts` | in-memory tasks — note that **history lives here**, which is why `GetTask`/`ListTasks` are Tier 0 |+| `src/server.ts` | JSON-RPC dispatch and SSE, with HP-xxx clause references inline |+| `src/conformance.ts` | the runner partners point at their own endpoint |+| `src/conformance.spec.ts` | regression cover for the runner — including that it **reports** an unreachable endpoint instead of throwing, and never reports PASS for a clause it did not actually check |diff --git a/reference-provider/package-lock.json b/reference-provider/package-lock.jsonnew file mode 100644index 000000000..ac86ce450--- /dev/null+++ b/reference-provider/package-lock.json@@ -0,0 +1,1801 @@+{+ "name": "reference-provider",+ "version": "0.1.0",+ "lockfileVersion": 3,+ "requires": true,+ "packages": {+ "": {+ "name": "reference-provider",+ "version": "0.1.0",+ "devDependencies": {+ "@types/node": "^20.14.10",+ "tsx": "^4.16.2",+ "typescript": "^5.5.3",+ "vitest": "^4.1.10"+ }+ },+ "node_modules/@emnapi/core": {+ "version": "2.0.0-alpha.3",+ "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-2.0.0-alpha.3.tgz",+ "integrity": "sha512-AZypUeJ/yByuxyS7BlSNRDOMLMlROYtjYdIAuBmJssVz1UJDSeYxLrdizhXCFYhedC5bqd/ASy8EuNXbVVXp9g==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "@emnapi/wasi-threads": "2.0.1",+ "tslib": "^2.4.0"+ }+ },+ "node_modules/@emnapi/runtime": {+ "version": "2.0.0-alpha.3",+ "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-2.0.0-alpha.3.tgz",+ "integrity": "sha512-hFPAhMUjJD9BSyCANEISPOogeXC9Zo9ZQl7L6vKnaVsMkCtzznaW/naYypeyl0Gv5rYfWYsZbpixTMpjDJzQeA==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "tslib": "^2.4.0"+ }+ },+ "node_modules/@emnapi/wasi-threads": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-2.0.1.tgz",+ "integrity": "sha512-9DsSk+o5NBX0CCJT8s0EROGSGxjR/tKu6aBTaVyq+SjAEQH4XcdcRxPBRzsBLizTTJ49MJjF+jgu3qnO9GLQcQ==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "tslib": "^2.4.0"+ }+ },+ "node_modules/@esbuild/aix-ppc64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz",+ "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "aix"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/android-arm": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz",+ "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/android-arm64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz",+ "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/android-x64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz",+ "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/darwin-arm64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz",+ "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/darwin-x64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz",+ "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/freebsd-arm64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz",+ "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/freebsd-x64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz",+ "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-arm": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz",+ "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-arm64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz",+ "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-ia32": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz",+ "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-loong64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz",+ "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==",+ "cpu": [+ "loong64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-mips64el": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz",+ "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==",+ "cpu": [+ "mips64el"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-ppc64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz",+ "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-riscv64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz",+ "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-s390x": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz",+ "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-x64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz",+ "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/netbsd-arm64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz",+ "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "netbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/netbsd-x64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz",+ "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "netbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/openbsd-arm64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz",+ "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/openbsd-x64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz",+ "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/openharmony-arm64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz",+ "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openharmony"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/sunos-x64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz",+ "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "sunos"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/win32-arm64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz",+ "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/win32-ia32": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz",+ "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/win32-x64": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz",+ "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@jridgewell/sourcemap-codec": {+ "version": "1.5.5",+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",+ "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@napi-rs/wasm-runtime": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.2.tgz",+ "integrity": "sha512-JfB4kuJQjaoHuCTseIINHtHWeJnvgEcxjwA5t/Y00ZgaOO1Crz3fjT/p8kT28zA/Caz7oiUMn3d6H2yOVCVwuw==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "@tybys/wasm-util": "^0.10.3"+ },+ "engines": {+ "node": "^20.19.0 || ^22.13.0 || >=23.5.0"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/Brooooooklyn"+ },+ "peerDependencies": {+ "@emnapi/core": "^1.7.1 || ^2.0.0-alpha.3",+ "@emnapi/runtime": "^1.7.1 || ^2.0.0-alpha.3"+ }+ },+ "node_modules/@oxc-project/types": {+ "version": "0.142.0",+ "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.142.0.tgz",+ "integrity": "sha512-7W+2q5AKQVU36fkaryontrHn3YDt1RyUYXatw9i5H8ocYe2sPKSFB6eS8WNPeRKiN1qAWWZUPm7gwFzJGrccqQ==",+ "dev": true,+ "license": "MIT",+ "funding": {+ "url": "https://github.com/sponsors/Boshen"+ }+ },+ "node_modules/@rolldown/binding-android-arm64": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.1.tgz",+ "integrity": "sha512-02hOeOSryYxVrOIphmLAsqnCJWxwlzFk+pEt/N/i6OgT3lShHO7xGCU5cpgchRDHboAEbSjzgGh+O/u1GswQmA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-darwin-arm64": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.1.tgz",+ "integrity": "sha512-fMsTOnN0OjFm3CyppWPitKnc8UlliVARUULW6cfU6AIqjdtgmSFWSk9vecHzZduv/yMWIHDlRhM1e8Iff9uAfA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-darwin-x64": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.1.tgz",+ "integrity": "sha512-1wjKdz/XLGKHaTNHjQveQ/B23TKx4ItAqm1JbyVuvNPc4Ze0Fb48s49TAd/2zcplPl8okE/UbTgmlVfwT7eFeQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-freebsd-x64": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.1.tgz",+ "integrity": "sha512-Fa0jHR07E7YBN4vOEsbVf2briYNsuOowfLJaXULZM0ldMlaCaj2LJgLMbMe4iacRyZmvR8efFhgR9wKuGclQUg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-arm-gnueabihf": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.1.tgz",+ "integrity": "sha512-pzkgu1SSHGgRRyRZ4fbmSgmajbVt+epaLP99NDjFft69v/ypfTi6swBMiVdh2EkQ0OSnHE1lZDM7DRGkyAzUpA==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-arm64-gnu": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.1.tgz",+ "integrity": "sha512-QI5SEDY8cbiYWHx0VO4vIc3UlS6a32vXHjU8Qy/17adEmZIPuByJg13UEvo9c/UCiUkdcVWY83C+b+JrwnNyUg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-arm64-musl": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.1.tgz",+ "integrity": "sha512-Sm41FyCeXqmYcERoYOCbGIL5hNfd8w9LQ7Y61Bev48HkcjaJqV/iiVOaiDxjVTRMS+QKrZmD8cfPt4uMVnvM+A==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-ppc64-gnu": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.1.tgz",+ "integrity": "sha512-2x+WhXTGl9yJYPbltW/BSEPTVz9OIWQyER4N+gJEDWkkn904eRcBzELqh/Hf7K0w/ubGbKNMv0ZC+94QK/IFEg==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-s390x-gnu": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.1.tgz",+ "integrity": "sha512-eEjmQpuRQayHPWWnywaWHkFT3ToPbP3RYy42VVd/B9aBGDA+Ol25EIWHxKQST3IiWJjikCWUF7KtbfqwZrzVwQ==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-x64-gnu": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.1.tgz",+ "integrity": "sha512-/Orga1fZYkLc/56jBICcHrKchl8Z2UKdDSr3LG9ToWO1lQ6a4Livk9Xz+9WN91zsz5QR3XQz2NNoSDEvP6qadw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-x64-musl": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.1.tgz",+ "integrity": "sha512-xxBJRL+0q0Kce7orznGWLuylHDY65vuARXZRpX+hPdv+DqK2c3NlCsVA98tlWzWNEE7yPqA/1NQ5nnCrj49Y5A==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-openharmony-arm64": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.1.tgz",+ "integrity": "sha512-M6AdXIXw3s+/8XpKMzdGDEXGS1S7kwUsy+rcTIUIOx5Ge4nXKCtAFHFV9YKkXvGcC5WMoTjAteLzlsQROVI0Yw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openharmony"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-wasm32-wasi": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.2.1.tgz",+ "integrity": "sha512-/TX0SoRGojHzSAHpfVBbavRVSazg5U3h3Y3VXfcc0cdugq6kxdqw8LPGFiPr+/7gE/60zRcsOY2Vi9b9eT0jww==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "@emnapi/core": "2.0.0-alpha.3",+ "@emnapi/runtime": "2.0.0-alpha.3",+ "@napi-rs/wasm-runtime": "^1.2.0"+ },+ "engines": {+ "node": "^20.19.0 || ^22.13.0 || >=23.5.0"+ }+ },+ "node_modules/@rolldown/binding-win32-arm64-msvc": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.1.tgz",+ "integrity": "sha512-EvRrivJieyHG+AO9lleZWgq+g0+S7oV2C51yuqlcyU/R9net+sI4Pj0F+lUoP2bEr6TWX3SqFaaS0SzfLxSzkw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-win32-x64-msvc": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.1.tgz",+ "integrity": "sha512-Z4eCmn5QJ/5+azF9knpLWKfVd9aidn0mAe9TpJgvBLId9Ax3t0+JVxBmT25Bv7NBbVW1TZyKjQjQReouMeH5UQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/pluginutils": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz",+ "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@standard-schema/spec": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz",+ "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@tybys/wasm-util": {+ "version": "0.10.3",+ "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.3.tgz",+ "integrity": "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "tslib": "^2.4.0"+ }+ },+ "node_modules/@types/chai": {+ "version": "5.2.3",+ "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz",+ "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/deep-eql": "*",+ "assertion-error": "^2.0.1"+ }+ },+ "node_modules/@types/deep-eql": {+ "version": "4.0.2",+ "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz",+ "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@types/estree": {+ "version": "1.0.9",+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz",+ "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@types/node": {+ "version": "20.19.43",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz",+ "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "undici-types": "~6.21.0"+ }+ },+ "node_modules/@vitest/expect": {+ "version": "4.1.10",+ "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.10.tgz",+ "integrity": "sha512-YsCn+qAk1GWjQOWFEsEcL2gNQ0zmVmQu3T03qP6UyjhtmdtwtbuI+DASn/7iQB3HGTXkdBwGddzxPlmiql5vlA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@standard-schema/spec": "^1.1.0",+ "@types/chai": "^5.2.2",+ "@vitest/spy": "4.1.10",+ "@vitest/utils": "4.1.10",+ "chai": "^6.2.2",+ "tinyrainbow": "^3.1.0"+ },+ "funding": {+ "url": "https://opencollective.com/vitest"+ }+ },+ "node_modules/@vitest/mocker": {+ "version": "4.1.10",+ "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.10.tgz",+ "integrity": "sha512-v0xaezt+DKEmKfaxg133ldzADrwLGd7Ze1MfQQTYfvs8OqZIwbxyxaYURivwV7sWy5fqn3rH5uOrSp07bp44Ow==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@vitest/spy": "4.1.10",+ "estree-walker": "^3.0.3",+ "magic-string": "^0.30.21"+ },+ "funding": {+ "url": "https://opencollective.com/vitest"+ },+ "peerDependencies": {+ "msw": "^2.4.9",+ "vite": "^6.0.0 || ^7.0.0 || ^8.0.0"+ },+ "peerDependenciesMeta": {+ "msw": {+ "optional": true+ },+ "vite": {+ "optional": true+ }+ }+ },+ "node_modules/@vitest/pretty-format": {+ "version": "4.1.10",+ "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.10.tgz",+ "integrity": "sha512-W1HsjSH4MXQ9YfmmhLAoIYf1HRfekQCGngeIgcei6MP5QQGWUe0gkopdZQaVCFO+JDJMrAJGwa5pRpNpvy4P8Q==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "tinyrainbow": "^3.1.0"+ },+ "funding": {+ "url": "https://opencollective.com/vitest"+ }+ },+ "node_modules/@vitest/runner": {+ "version": "4.1.10",+ "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.1.10.tgz",+ "integrity": "sha512-IKI6kpIH+LmpROplyLwBBaCfMgOZOMsygVa6BARD6ahA04VRuJSa6OaVG7kRvSEMD870Vd91rSSw0eegtWyLGg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@vitest/utils": "4.1.10",+ "pathe": "^2.0.3"+ },+ "funding": {+ "url": "https://opencollective.com/vitest"+ }+ },+ "node_modules/@vitest/snapshot": {+ "version": "4.1.10",+ "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.1.10.tgz",+ "integrity": "sha512-xRkfOT1qpTAi/Ti4Y1LtfRc3kEuqxGw59eN2jN9pRWMtS/XDevekhcFSqvQqjUNGksfjMJu3Y+oJ+4Ypn2OaJw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@vitest/pretty-format": "4.1.10",+ "@vitest/utils": "4.1.10",+ "magic-string": "^0.30.21",+ "pathe": "^2.0.3"+ },+ "funding": {+ "url": "https://opencollective.com/vitest"+ }+ },+ "node_modules/@vitest/spy": {+ "version": "4.1.10",+ "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.10.tgz",+ "integrity": "sha512-PLf/Ugvoq5wO/b4rwYCR1h2PSIdXz7wnkQFMiUpLdtM7l6pqVFcQIBEHyT1+l+cj7mNwAfZHzqXqDyjvOuwbDw==",+ "dev": true,+ "license": "MIT",+ "funding": {+ "url": "https://opencollective.com/vitest"+ }+ },+ "node_modules/@vitest/utils": {+ "version": "4.1.10",+ "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.10.tgz",+ "integrity": "sha512-fy9am/HWxbaGt/Sawrp90vt6Y6jQwf1RX77cz3uwoJwJVMli/e1IEwRPnMNJ7vKfPTwo0diXifkpPvwH9v7nGA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@vitest/pretty-format": "4.1.10",+ "convert-source-map": "^2.0.0",+ "tinyrainbow": "^3.1.0"+ },+ "funding": {+ "url": "https://opencollective.com/vitest"+ }+ },+ "node_modules/assertion-error": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz",+ "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/chai": {+ "version": "6.2.2",+ "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz",+ "integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/convert-source-map": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",+ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/detect-libc": {+ "version": "2.1.2",+ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",+ "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/es-module-lexer": {+ "version": "2.3.1",+ "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.1.tgz",+ "integrity": "sha512-shc1dbU90Yl/xq1QrC7QRtfcwURZuVRfPhZbDoldJ1cn1gzDvBaBWlv0eFolj5+0znnPJz5TXLxsN77X/12KTA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/esbuild": {+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz",+ "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==",+ "dev": true,+ "hasInstallScript": true,+ "license": "MIT",+ "bin": {+ "esbuild": "bin/esbuild"+ },+ "engines": {+ "node": ">=18"+ },+ "optionalDependencies": {+ "@esbuild/aix-ppc64": "0.28.1",+ "@esbuild/android-arm": "0.28.1",+ "@esbuild/android-arm64": "0.28.1",+ "@esbuild/android-x64": "0.28.1",+ "@esbuild/darwin-arm64": "0.28.1",+ "@esbuild/darwin-x64": "0.28.1",+ "@esbuild/freebsd-arm64": "0.28.1",+ "@esbuild/freebsd-x64": "0.28.1",+ "@esbuild/linux-arm": "0.28.1",+ "@esbuild/linux-arm64": "0.28.1",+ "@esbuild/linux-ia32": "0.28.1",+ "@esbuild/linux-loong64": "0.28.1",+ "@esbuild/linux-mips64el": "0.28.1",+ "@esbuild/linux-ppc64": "0.28.1",+ "@esbuild/linux-riscv64": "0.28.1",+ "@esbuild/linux-s390x": "0.28.1",+ "@esbuild/linux-x64": "0.28.1",+ "@esbuild/netbsd-arm64": "0.28.1",+ "@esbuild/netbsd-x64": "0.28.1",+ "@esbuild/openbsd-arm64": "0.28.1",+ "@esbuild/openbsd-x64": "0.28.1",+ "@esbuild/openharmony-arm64": "0.28.1",+ "@esbuild/sunos-x64": "0.28.1",+ "@esbuild/win32-arm64": "0.28.1",+ "@esbuild/win32-ia32": "0.28.1",+ "@esbuild/win32-x64": "0.28.1"+ }+ },+ "node_modules/estree-walker": {+ "version": "3.0.3",+ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",+ "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/estree": "^1.0.0"+ }+ },+ "node_modules/expect-type": {+ "version": "1.4.0",+ "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.4.0.tgz",+ "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": ">=12.0.0"+ }+ },+ "node_modules/fdir": {+ "version": "6.5.0",+ "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",+ "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12.0.0"+ },+ "peerDependencies": {+ "picomatch": "^3 || ^4"+ },+ "peerDependenciesMeta": {+ "picomatch": {+ "optional": true+ }+ }+ },+ "node_modules/fsevents": {+ "version": "2.3.3",+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",+ "dev": true,+ "hasInstallScript": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"+ }+ },+ "node_modules/lightningcss": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz",+ "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==",+ "dev": true,+ "license": "MPL-2.0",+ "dependencies": {+ "detect-libc": "^2.0.3"+ },+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ },+ "optionalDependencies": {+ "lightningcss-android-arm64": "1.33.0",+ "lightningcss-darwin-arm64": "1.33.0",+ "lightningcss-darwin-x64": "1.33.0",+ "lightningcss-freebsd-x64": "1.33.0",+ "lightningcss-linux-arm-gnueabihf": "1.33.0",+ "lightningcss-linux-arm64-gnu": "1.33.0",+ "lightningcss-linux-arm64-musl": "1.33.0",+ "lightningcss-linux-x64-gnu": "1.33.0",+ "lightningcss-linux-x64-musl": "1.33.0",+ "lightningcss-win32-arm64-msvc": "1.33.0",+ "lightningcss-win32-x64-msvc": "1.33.0"+ }+ },+ "node_modules/lightningcss-android-arm64": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz",+ "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-darwin-arm64": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz",+ "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-darwin-x64": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz",+ "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-freebsd-x64": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz",+ "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-arm-gnueabihf": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz",+ "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-arm64-gnu": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz",+ "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-arm64-musl": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz",+ "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-x64-gnu": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz",+ "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-x64-musl": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz",+ "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-win32-arm64-msvc": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz",+ "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-win32-x64-msvc": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz",+ "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/magic-string": {+ "version": "0.30.21",+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz",+ "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/sourcemap-codec": "^1.5.5"+ }+ },+ "node_modules/nanoid": {+ "version": "3.3.16",+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.16.tgz",+ "integrity": "sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "bin": {+ "nanoid": "bin/nanoid.cjs"+ },+ "engines": {+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"+ }+ },+ "node_modules/obug": {+ "version": "2.1.4",+ "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.4.tgz",+ "integrity": "sha512-4a+OsYv9UktOJKE+l1A4OufDgdRF9PifWj+tJnHURo/P+WOxpG4GzUFL9qCalmWauao6ogiG+QvnCovwPoyAWA==",+ "dev": true,+ "funding": [+ "https://github.com/sponsors/sxzz",+ "https://opencollective.com/debug"+ ],+ "license": "MIT",+ "engines": {+ "node": ">=12.20.0"+ }+ },+ "node_modules/pathe": {+ "version": "2.0.3",+ "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz",+ "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/picocolors": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",+ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/picomatch": {+ "version": "4.0.5",+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz",+ "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/sponsors/jonschlinkert"+ }+ },+ "node_modules/postcss": {+ "version": "8.5.25",+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.25.tgz",+ "integrity": "sha512-DTPx3RWSSnWyzLxQnlH0rJP+EW5ekl16ZU4/psbIhA0e53kJfdgaN5vKM+xP7yJtXVu+nfdVFmlgFDEKAe4Pyw==",+ "dev": true,+ "funding": [+ {+ "type": "opencollective",+ "url": "https://opencollective.com/postcss/"+ },+ {+ "type": "tidelift",+ "url": "https://tidelift.com/funding/github/npm/postcss"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "nanoid": "^3.3.16",+ "picocolors": "^1.1.1",+ "source-map-js": "^1.2.1"+ },+ "engines": {+ "node": "^10 || ^12 || >=14"+ }+ },+ "node_modules/rolldown": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.1.tgz",+ "integrity": "sha512-4FKJhg8d3OiyQOA6Q1Q0hoFFpW9/OoX+VsHzpECsdsIZoOArrAK90gl59YK/Z+gnDel45bgJZK03ozH/9bCqEw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@oxc-project/types": "=0.142.0",+ "@rolldown/pluginutils": "^1.0.0"+ },+ "bin": {+ "rolldown": "bin/cli.mjs"+ },+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ },+ "optionalDependencies": {+ "@rolldown/binding-android-arm64": "1.2.1",+ "@rolldown/binding-darwin-arm64": "1.2.1",+ "@rolldown/binding-darwin-x64": "1.2.1",+ "@rolldown/binding-freebsd-x64": "1.2.1",+ "@rolldown/binding-linux-arm-gnueabihf": "1.2.1",+ "@rolldown/binding-linux-arm64-gnu": "1.2.1",+ "@rolldown/binding-linux-arm64-musl": "1.2.1",+ "@rolldown/binding-linux-ppc64-gnu": "1.2.1",+ "@rolldown/binding-linux-s390x-gnu": "1.2.1",+ "@rolldown/binding-linux-x64-gnu": "1.2.1",+ "@rolldown/binding-linux-x64-musl": "1.2.1",+ "@rolldown/binding-openharmony-arm64": "1.2.1",+ "@rolldown/binding-wasm32-wasi": "1.2.1",+ "@rolldown/binding-win32-arm64-msvc": "1.2.1",+ "@rolldown/binding-win32-x64-msvc": "1.2.1"+ }+ },+ "node_modules/siginfo": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz",+ "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/source-map-js": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",+ "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",+ "dev": true,+ "license": "BSD-3-Clause",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/stackback": {+ "version": "0.0.2",+ "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz",+ "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/std-env": {+ "version": "4.2.0",+ "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.2.0.tgz",+ "integrity": "sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/tinybench": {+ "version": "2.9.0",+ "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz",+ "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/tinyexec": {+ "version": "1.3.0",+ "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.0.tgz",+ "integrity": "sha512-QKAl9m8gWWGHV8jZcPeym6j+XULi6tOf1mT83WYJ4Lk2ytW/uwAWkrP0uFsdoYMdueVJ0qs26wZ+23xeB4ibNQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/tinyglobby": {+ "version": "0.2.17",+ "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz",+ "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "fdir": "^6.5.0",+ "picomatch": "^4.0.4"+ },+ "engines": {+ "node": ">=12.0.0"+ },+ "funding": {+ "url": "https://github.com/sponsors/SuperchupuDev"+ }+ },+ "node_modules/tinyrainbow": {+ "version": "3.1.1",+ "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.1.1.tgz",+ "integrity": "sha512-yau8yJdTt989Mm0Bd/236QnzEiPf2xLLTqUZRUJOo/3CB078LSwzei343DgtJVmfJKJE3TMINY1u42SQsP6mXw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=14.0.0"+ }+ },+ "node_modules/tslib": {+ "version": "2.8.1",+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",+ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",+ "dev": true,+ "license": "0BSD",+ "optional": true+ },+ "node_modules/tsx": {+ "version": "4.23.5",+ "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.23.5.tgz",+ "integrity": "sha512-rw55FUaqOoI7RvlQwLbhO4nSDApnQ4/CykPuiQ/EPvtrX3WA9Ig55jIt9VvbBJbzJuj12ueRu4PMZ2SxPVbihg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "esbuild": "~0.28.0"+ },+ "bin": {+ "tsx": "dist/cli.mjs"+ },+ "engines": {+ "node": ">=18.0.0"+ },+ "optionalDependencies": {+ "fsevents": "~2.3.3"+ }+ },+ "node_modules/typescript": {+ "version": "5.9.3",+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",+ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",+ "dev": true,+ "license": "Apache-2.0",+ "bin": {+ "tsc": "bin/tsc",+ "tsserver": "bin/tsserver"+ },+ "engines": {+ "node": ">=14.17"+ }+ },+ "node_modules/undici-types": {+ "version": "6.21.0",+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",+ "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/vite": {+ "version": "8.2.0",+ "resolved": "https://registry.npmjs.org/vite/-/vite-8.2.0.tgz",+ "integrity": "sha512-pn+CFpM0lwDeKwmOq1ZaBK/9sjorZcgqxki6MbY/jPEVd9vichIlmlD4HmQ5wdP5EgqQCFRaACBxMC7uEGc6lQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "lightningcss": "^1.33.0",+ "picomatch": "^4.0.5",+ "postcss": "^8.5.23",+ "rolldown": "~1.2.0",+ "tinyglobby": "^0.2.17"+ },+ "bin": {+ "vite": "bin/vite.js"+ },+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ },+ "funding": {+ "url": "https://github.com/vitejs/vite?sponsor=1"+ },+ "optionalDependencies": {+ "fsevents": "~2.3.3"+ },+ "peerDependencies": {+ "@types/node": "^20.19.0 || >=22.12.0",+ "@vitejs/devtools": "^0.4.0",+ "esbuild": "^0.27.0 || ^0.28.0",+ "jiti": ">=1.21.0",+ "less": "^4.0.0",+ "sass": "^1.70.0",+ "sass-embedded": "^1.70.0",+ "stylus": ">=0.54.8",+ "sugarss": "^5.0.0",+ "terser": "^5.16.0",+ "tsx": "^4.8.1",+ "yaml": "^2.4.2"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ },+ "@vitejs/devtools": {+ "optional": true+ },+ "esbuild": {+ "optional": true+ },+ "jiti": {+ "optional": true+ },+ "less": {+ "optional": true+ },+ "sass": {+ "optional": true+ },+ "sass-embedded": {+ "optional": true+ },+ "stylus": {+ "optional": true+ },+ "sugarss": {+ "optional": true+ },+ "terser": {+ "optional": true+ },+ "tsx": {+ "optional": true+ },+ "yaml": {+ "optional": true+ }+ }+ },+ "node_modules/vitest": {+ "version": "4.1.10",+ "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.10.tgz",+ "integrity": "sha512-R9jUTe5S4Qb0HCd4TNqpC7oGcrMssMRGXLW80ubjWsW9VH5GF8y1Y0SFLY9AbqSk6nt0PnOx4H4WNJYZ13GUPw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@vitest/expect": "4.1.10",+ "@vitest/mocker": "4.1.10",+ "@vitest/pretty-format": "4.1.10",+ "@vitest/runner": "4.1.10",+ "@vitest/snapshot": "4.1.10",+ "@vitest/spy": "4.1.10",+ "@vitest/utils": "4.1.10",+ "es-module-lexer": "^2.0.0",+ "expect-type": "^1.3.0",+ "magic-string": "^0.30.21",+ "obug": "^2.1.1",+ "pathe": "^2.0.3",+ "picomatch": "^4.0.3",+ "std-env": "^4.0.0-rc.1",+ "tinybench": "^2.9.0",+ "tinyexec": "^1.0.2",+ "tinyglobby": "^0.2.15",+ "tinyrainbow": "^3.1.0",+ "vite": "^6.0.0 || ^7.0.0 || ^8.0.0",+ "why-is-node-running": "^2.3.0"+ },+ "bin": {+ "vitest": "vitest.mjs"+ },+ "engines": {+ "node": "^20.0.0 || ^22.0.0 || >=24.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/vitest"+ },+ "peerDependencies": {+ "@edge-runtime/vm": "*",+ "@opentelemetry/api": "^1.9.0",+ "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0",+ "@vitest/browser-playwright": "4.1.10",+ "@vitest/browser-preview": "4.1.10",+ "@vitest/browser-webdriverio": "4.1.10",+ "@vitest/coverage-istanbul": "4.1.10",+ "@vitest/coverage-v8": "4.1.10",+ "@vitest/ui": "4.1.10",+ "happy-dom": "*",+ "jsdom": "*",+ "vite": "^6.0.0 || ^7.0.0 || ^8.0.0"+ },+ "peerDependenciesMeta": {+ "@edge-runtime/vm": {+ "optional": true+ },+ "@opentelemetry/api": {+ "optional": true+ },+ "@types/node": {+ "optional": true+ },+ "@vitest/browser-playwright": {+ "optional": true+ },+ "@vitest/browser-preview": {+ "optional": true+ },+ "@vitest/browser-webdriverio": {+ "optional": true+ },+ "@vitest/coverage-istanbul": {+ "optional": true+ },+ "@vitest/coverage-v8": {+ "optional": true+ },+ "@vitest/ui": {+ "optional": true+ },+ "happy-dom": {+ "optional": true+ },+ "jsdom": {+ "optional": true+ },+ "vite": {+ "optional": false+ }+ }+ },+ "node_modules/why-is-node-running": {+ "version": "2.3.0",+ "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz",+ "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "siginfo": "^2.0.0",+ "stackback": "0.0.2"+ },+ "bin": {+ "why-is-node-running": "cli.js"+ },+ "engines": {+ "node": ">=8"+ }+ }+ }+}diff --git a/reference-provider/package.json b/reference-provider/package.jsonnew file mode 100644index 000000000..771909ee1--- /dev/null+++ b/reference-provider/package.json@@ -0,0 +1,28 @@+{+ "name": "@autonomous/reference-provider",+ "version": "0.1.0",+ "description": "Scripted, deterministic reference implementation of the Autonomous harness provider profile, plus the conformance runner partners point at their own endpoint.",+ "license": "Apache-2.0",+ "repository": {+ "type": "git",+ "url": "git+https://github.com/autonomous-ai/harness-provider.git",+ "directory": "reference-provider"+ },+ "homepage": "https://github.com/autonomous-ai/harness-provider#readme",+ "bugs": "https://github.com/autonomous-ai/harness-provider/issues",+ "type": "module",+ "scripts": {+ "dev": "tsx src/server.ts",+ "start": "node dist/server.js",+ "build": "tsc",+ "typecheck": "tsc --noEmit",+ "test": "vitest run",+ "conformance": "tsx src/conformance.ts"+ },+ "devDependencies": {+ "@types/node": "^20.14.10",+ "tsx": "^4.16.2",+ "typescript": "^5.5.3",+ "vitest": "^4.1.10"+ }+}diff --git a/reference-provider/src/agentCard.ts b/reference-provider/src/agentCard.tsnew file mode 100644index 000000000..2c90342ab--- /dev/null+++ b/reference-provider/src/agentCard.ts@@ -0,0 +1,53 @@+/**+ * The Agent Card — HP-020 through HP-023.+ *+ * This is the whole capability negotiation. A client reads this and knows what the provider can do;+ * nothing else in the protocol advertises capability (HP-001).+ */++export const AGENT_CARD = {+ name: 'Autonomous Reference Provider',+ description:+ 'A minimal, deterministic provider used to validate the harness provider profile. It runs no model — every reply is scripted.',+ version: '0.1.0',++ // HP-021: non-negotiable. The product renders assistant output token by token.+ capabilities: { streaming: true, pushNotifications: false },++ // HP-011: APIKey and HTTPAuth bearer are the schemes Autonomous supports today.+ securitySchemes: {+ apiKey: { type: 'apiKey', in: 'header', name: 'x-api-key' },+ },++ defaultInputModes: ['text/plain', 'image/png', 'image/jpeg'],+ defaultOutputModes: ['text/plain'],++ // HP-023: skills are the project list shown to the user.+ skills: [+ {+ id: 'acme-reporting',+ name: 'Acme reporting',+ description: "Acme's ad accounts — spend, pacing, and alerting.",+ },+ {+ id: 'globex-q3',+ name: 'Globex Q3',+ description: 'Quarterly rollup for Globex.',+ },+ ],++ // HP-022: implemented-but-undeclared MUST be treated as absent, so this list is the contract.+ // `workspace-files` and `workspace-write` are deliberately NOT declared — the reference provider+ // exercises the degradation path as well as the happy path.+ extensions: [+ {+ uri: 'https://harness.autonomous.ai/api/a2a/ext/session-recap',+ description: 'Short per-turn summaries for device tile restore.',+ },+ ],+} as const++export type AgentCard = typeof AGENT_CARD++/** Skill ids, for validating a project reference without trusting the caller. */+export const SKILL_IDS: readonly string[] = AGENT_CARD.skills.map((s) => s.id)diff --git a/reference-provider/src/conformance.spec.ts b/reference-provider/src/conformance.spec.tsnew file mode 100644index 000000000..4a8597ad5--- /dev/null+++ b/reference-provider/src/conformance.spec.ts@@ -0,0 +1,82 @@+// The conformance runner is the artifact partners are told to trust, so it needs the same regression+// cover as the provider itself. Without this it only ran when somebody remembered to run it by hand.+//+// These tests boot the reference provider in-process and run the real suite against it.+import { afterAll, beforeAll, describe, expect, it } from 'vitest'++process.env.STEP_DELAY_MS = '0'+const { start } = await import('./server.js')+const { runConformance, CHECKS } = await import('./conformance.js')++let base: string+let stop: () => Promise<void>++beforeAll(async () => {+ const s = await start(0)+ base = s.url+ stop = s.close+}, 30_000)+afterAll(async () => { await stop() })++const FULL = { key: 'conformance', badKey: 'bad-key', askPhrase: 'ask me something' }++describe('the runner against a conformant provider', () => {+ it('reports zero failures', async () => {+ const summary = await runConformance({ url: base, ...FULL })+ const failures = summary.results.filter((r) => r.outcome === 'FAIL')+ expect(failures.map((f) => `${f.id}: ${f.detail}`)).toEqual([])+ expect(summary.pass).toBeGreaterThan(20)+ }, 30_000)++ it('gives every skipped clause a reason — nothing is dropped silently', async () => {+ const summary = await runConformance({ url: base, ...FULL })+ const mute = summary.results.filter((r) => (r.outcome === 'SKIP' || r.outcome === 'WARN') && !r.detail?.trim())+ expect(mute.map((m) => m.id)).toEqual([])+ }, 30_000)++ it('treats an undeclared extension as SKIP, never as FAIL', async () => {+ // The reference provider declares session-recap only, so workspace-files/-write/voice are absent.+ const summary = await runConformance({ url: base, ...FULL })+ const byId = new Map(summary.results.map((r) => [r.id, r]))+ for (const id of ['HP-300', 'HP-301', 'HP-303']) {+ expect(byId.get(id)?.outcome, `${id} should skip when undeclared`).toBe('SKIP')+ }+ // …and the one that IS declared must be genuinely exercised, not waved through.+ expect(byId.get('HP-302')?.outcome).toBe('PASS')+ }, 30_000)++ it('has a unique, non-empty id and title for every check', () => {+ const ids = CHECKS.map((c) => c.id)+ expect(new Set(ids).size).toBe(ids.length)+ expect(CHECKS.filter((c) => !c.title.trim())).toEqual([])+ })+})++describe('the runner degrades honestly when it is given less', () => {+ it('skips the credential clause instead of guessing when --bad-key is absent', async () => {+ const summary = await runConformance({ url: base, key: 'conformance', askPhrase: FULL.askPhrase })+ const hp013 = summary.results.find((r) => r.id === 'HP-013')+ expect(hp013?.outcome).toBe('SKIP')+ expect(hp013?.detail).toMatch(/--bad-key/)+ expect(summary.fail).toBe(0)+ }, 30_000)++ it('skips the cancel and input-required clauses when --ask-phrase is absent', async () => {+ const summary = await runConformance({ url: base, key: 'conformance', badKey: FULL.badKey })+ for (const id of ['HP-103', 'HP-104']) {+ const r = summary.results.find((x) => x.id === id)+ expect(r?.outcome, id).toBe('SKIP')+ expect(r?.detail, id).toMatch(/--ask-phrase/)+ }+ expect(summary.fail).toBe(0)+ }, 30_000)+})++describe('the runner fails loudly against a provider that is not there', () => {+ it('does not report success when the endpoint is unreachable', async () => {+ // A conformance suite that goes green against a dead URL is worse than no suite.+ const summary = await runConformance({ url: 'http://127.0.0.1:1', ...FULL })+ expect(summary.fail).toBeGreaterThan(0)+ expect(summary.results.find((r) => r.id === 'HP-020')?.outcome).toBe('FAIL')+ }, 30_000)+})diff --git a/reference-provider/src/conformance.ts b/reference-provider/src/conformance.tsnew file mode 100644index 000000000..180bca191--- /dev/null+++ b/reference-provider/src/conformance.ts@@ -0,0 +1,595 @@+/**+ * Conformance runner for the harness provider profile (`../spec/README.md`).+ *+ * Point it at ANY provider endpoint. It asserts one check per normative clause and names the clause in+ * its output, so a red line points at a section of the spec rather than at a symptom:+ *+ * npm run conformance -- --url https://agent.example.com --key <credential>+ *+ * Two design rules, both load-bearing:+ *+ * 1. **Nothing is silently skipped.** A clause that cannot be verified from outside (tenant isolation,+ * the 5 MB transcript ceiling, rate limiting) is reported as SKIP *with the reason*. A suite that+ * claims to check everything while quietly checking half of it is worse than no suite.+ * 2. **Extension checks are conditional on the Agent Card.** An undeclared extension is not a failure+ * (HP-022) — it is a SKIP, because absence is a legitimate answer.+ *+ * Zero dependencies, like the rest of this package.+ */+import { AGENT_CARD } from './agentCard.js'++type Outcome = 'PASS' | 'FAIL' | 'SKIP' | 'WARN'++interface Result {+ outcome: Outcome+ detail?: string+}++interface Ctx {+ url: string+ /** Set when the agent card could not be fetched at all — every check reports rather than throwing. */+ cardError?: string+ key: string+ badKey?: string+ /** Phrase that makes the provider enter INPUT_REQUIRED, if it has one. */+ askPhrase?: string+ card: Record<string, unknown>+}++interface Check {+ id: string+ title: string+ run: (ctx: Ctx) => Promise<Result> | Result+}++const pass = (detail?: string): Result => ({ outcome: 'PASS', detail })+const fail = (detail: string): Result => ({ outcome: 'FAIL', detail })+const skip = (detail: string): Result => ({ outcome: 'SKIP', detail })+const warn = (detail: string): Result => ({ outcome: 'WARN', detail })++const EXT = {+ FILES: 'https://harness.autonomous.ai/api/a2a/ext/workspace-files',+ WRITE: 'https://harness.autonomous.ai/api/a2a/ext/workspace-write',+ RECAP: 'https://harness.autonomous.ai/api/a2a/ext/session-recap',+ VOICE: 'https://harness.autonomous.ai/api/a2a/ext/voice',+} as const++const KNOWN_EXTENSIONS: string[] = Object.values(EXT)++/** Scope an extension probe to a real project without guessing an id. */+const firstSkillId = (ctx: Ctx): string | undefined =>+ ((ctx.card.skills ?? []) as Array<{ id?: string }>)[0]?.id++const KNOWN_KINDS = [+ 'user_message', 'thinking_delta', 'thinking_title', 'text_delta',+ 'tool_start', 'tool_end', 'context_compact', 'done',+]++const TERMINAL = ['TASK_STATE_COMPLETED', 'TASK_STATE_FAILED', 'TASK_STATE_CANCELED', 'TASK_STATE_REJECTED']++// ── wire helpers ─────────────────────────────────────────────────────────────────────────────────++interface SseEvent {+ taskId?: string+ contextId?: string+ status?: { state?: string; message?: { parts?: Array<{ text?: string; metadata?: Record<string, unknown> }> } }+ final?: boolean+}++async function rpc(ctx: Ctx, method: string, params: unknown, key = ctx.key): Promise<Response> {+ return fetch(ctx.url, {+ method: 'POST',+ headers: { 'content-type': 'application/json', [authHeader(ctx)]: key },+ body: JSON.stringify({ jsonrpc: '2.0', id: 1, method, params }),+ })+}++/** The card declares where the credential goes; do not assume a header name (HP-011). */+function authHeader(ctx: Ctx): string {+ const schemes = (ctx.card.securitySchemes ?? {}) as Record<string, { type?: string; in?: string; name?: string }>+ for (const s of Object.values(schemes)) {+ if (s.type === 'apiKey' && s.in === 'header' && s.name) return s.name+ }+ return 'authorization'+}++async function stream(ctx: Ctx, text: string, extra: Record<string, unknown> = {}): Promise<{ res: Response; events: SseEvent[] }> {+ const res = await rpc(ctx, 'SendStreamingMessage', {+ message: { role: 'ROLE_USER', messageId: `conf-${Date.now()}`, parts: [{ text }], ...extra },+ })+ return { res, events: await drain(res) }+}++async function drain(res: Response): Promise<SseEvent[]> {+ const events: SseEvent[] = []+ if (!res.body) return events+ const reader = res.body.getReader()+ const decoder = new TextDecoder()+ let buffer = ''+ try {+ for (;;) {+ const { done, value } = await reader.read()+ if (done) break+ buffer += decoder.decode(value, { stream: true })+ const frames = buffer.split('\n\n')+ buffer = frames.pop() ?? ''+ for (const frame of frames) {+ const line = frame.split('\n').find((l) => l.startsWith('data: '))+ if (line) { try { events.push(JSON.parse(line.slice(6)) as SseEvent) } catch { /* skip unparsable */ } }+ }+ }+ } catch { /* an aborted stream is itself a finding — HP-102 reports it */ }+ return events+}++const declares = (ctx: Ctx, uri: string): boolean =>+ ((ctx.card.extensions ?? []) as Array<{ uri?: string }>).some((e) => e.uri === uri)++const body = async (res: Response): Promise<Record<string, unknown>> => {+ try { return (await res.json()) as Record<string, unknown> } catch { return {} }+}++// ── checks ───────────────────────────────────────────────────────────────────────────────────────++export const CHECKS: Check[] = [+ {+ id: 'HP-003',+ title: 'Declared extension URIs are byte-exact',+ run: (ctx) => {+ const declared = ((ctx.card.extensions ?? []) as Array<{ uri?: string }>).map((e) => e.uri ?? '')+ const ours = declared.filter((u) => u.includes('autonomous.ai'))+ const wrong = ours.filter((u) => !KNOWN_EXTENSIONS.includes(u))+ if (!ours.length) return skip('no Autonomous extensions declared — nothing to compare')+ return wrong.length+ ? fail(`not byte-exact: ${wrong.join(', ')}`)+ : pass(`${ours.length} declared, all exact`)+ },+ },+ {+ id: 'HP-010',+ title: 'Endpoint is reachable over HTTPS',+ run: (ctx) =>+ ctx.url.startsWith('https://')+ ? pass()+ : warn('endpoint is not HTTPS — acceptable for local testing, a violation in production'),+ },+ {+ id: 'HP-011',+ title: 'Agent Card declares a supported security scheme',+ run: (ctx) => {+ const schemes = Object.values((ctx.card.securitySchemes ?? {}) as Record<string, { type?: string }>)+ if (!schemes.length) return fail('no securitySchemes declared')+ const supported = schemes.filter((s) => s.type === 'apiKey' || s.type === 'http')+ return supported.length+ ? pass(schemes.map((s) => s.type).join(', '))+ : fail(`only unsupported schemes declared (${schemes.map((s) => s.type).join(', ')}); Autonomous supports APIKey and HTTPAuth today`)+ },+ },+ {+ id: 'HP-012',+ title: 'Credential is scoped to one tenant',+ run: () => skip('not verifiable from outside — needs two tenants\' credentials and knowledge of provider internals'),+ },+ {+ id: 'HP-013',+ title: 'A rejected credential is distinguishable from an outage',+ run: async (ctx) => {+ if (!ctx.badKey) return skip('pass --bad-key <value> with a credential known to be invalid to run this')+ const res = await rpc(ctx, 'ListTasks', {}, ctx.badKey)+ const b = await body(res)+ const err = b.error as { code?: number } | undefined+ if (res.status === 401 || err) return pass(`status ${res.status}${err?.code ? `, code ${err.code}` : ''}`)+ return fail('an invalid credential was accepted, or failed indistinguishably from a generic error')+ },+ },+ {+ id: 'HP-020',+ title: 'Agent Card served at /.well-known/agent-card.json',+ run: (ctx) => {+ if (ctx.cardError) return fail(ctx.cardError)+ return ctx.card.name ? pass(String(ctx.card.name)) : fail('card missing or unparsable')+ },+ },+ {+ id: 'HP-021',+ title: 'capabilities.streaming is true',+ run: (ctx) => {+ const caps = (ctx.card.capabilities ?? {}) as { streaming?: boolean }+ return caps.streaming === true ? pass() : fail('a non-streaming provider cannot be used; output is rendered token by token')+ },+ },+ {+ id: 'HP-022',+ title: 'Extensions are declared by URI, unknown ones tolerated',+ run: (ctx) => {+ const declared = (ctx.card.extensions ?? []) as Array<{ uri?: string }>+ if (!Array.isArray(declared)) return fail('extensions is not an array')+ const missingUri = declared.filter((e) => typeof e.uri !== 'string')+ return missingUri.length ? fail(`${missingUri.length} extension entr(ies) without a uri`) : pass(`${declared.length} declared`)+ },+ },+ {+ id: 'HP-023',+ title: 'skills[] is a non-empty project list',+ run: (ctx) => {+ const skills = (ctx.card.skills ?? []) as Array<{ id?: string; name?: string }>+ if (!skills.length) return fail('no skills — the client would show no projects at all')+ const unnamed = skills.filter((s) => !s.id || !s.name)+ return unnamed.length ? fail(`${unnamed.length} skill(s) missing id or name`) : pass(`${skills.length} skill(s)`)+ },+ },+ {+ id: 'HP-100',+ title: 'SendStreamingMessage returns Server-Sent Events',+ run: async (ctx) => {+ const { res } = await stream(ctx, 'conformance: hello')+ const ct = res.headers.get('content-type') ?? ''+ return ct.includes('text/event-stream') ? pass(ct) : fail(`content-type was "${ct}", expected text/event-stream`)+ },+ },+ {+ id: 'HP-101',+ title: 'A new chat opens on a fresh contextId',+ run: async (ctx) => {+ const { events } = await stream(ctx, 'conformance: new chat', { contextId: `conf-ctx-${Date.now()}` })+ if (!events.length) return fail('no events received')+ const ids = new Set(events.map((e) => e.contextId).filter(Boolean))+ return ids.size === 1 ? pass([...ids][0]) : fail(`stream spanned ${ids.size} contextIds; expected exactly one`)+ },+ },+ {+ id: 'HP-102',+ title: 'Every stream ends with a terminal task state',+ run: async (ctx) => {+ const { events } = await stream(ctx, 'conformance: terminal state')+ if (!events.length) return fail('no events received')+ const last = events[events.length - 1]!+ return TERMINAL.includes(last.status?.state ?? '')+ ? pass(last.status?.state)+ : fail(`stream ended on "${last.status?.state}" — a client cannot tell a finished turn from a dropped one`)+ },+ },+ {+ id: 'HP-103',+ title: 'CancelTask stops a task and reports CANCELED',+ run: async (ctx) => {+ if (!ctx.askPhrase) return skip('pass --ask-phrase <text> with a prompt that parks the agent, so there is something to cancel')+ const { events } = await stream(ctx, ctx.askPhrase)+ const taskId = events[0]?.taskId+ if (!taskId) return fail('no taskId observed, so cancellation cannot be tested')+ const res = await rpc(ctx, 'CancelTask', { taskId })+ const b = await body(res)+ const state = ((b.result ?? {}) as { status?: { state?: string } }).status?.state+ return state === 'TASK_STATE_CANCELED' ? pass() : fail(`CancelTask returned state "${state}"`)+ },+ },+ {+ id: 'HP-104',+ title: 'INPUT_REQUIRED pauses the task and accepts an answer on the same taskId',+ run: async (ctx) => {+ if (!ctx.askPhrase) return skip('pass --ask-phrase <text> with a prompt that makes the agent ask a question')+ const { events } = await stream(ctx, ctx.askPhrase)+ const last = events[events.length - 1]+ if (last?.status?.state !== 'TASK_STATE_INPUT_REQUIRED') {+ return fail(`--ask-phrase did not produce INPUT_REQUIRED (ended on "${last?.status?.state}")`)+ }+ if (last.final) return fail('INPUT_REQUIRED was marked final; it is not a terminal state')+ const resumed = await drain(+ await rpc(ctx, 'SendStreamingMessage', {+ message: { role: 'ROLE_USER', messageId: `conf-answer-${Date.now()}`, taskId: last.taskId, parts: [{ text: 'yes' }] },+ }),+ )+ const end = resumed[resumed.length - 1]+ return TERMINAL.includes(end?.status?.state ?? '')+ ? pass('paused, answered, completed')+ : fail(`answering on the same taskId did not resume the task (ended on "${end?.status?.state}")`)+ },+ },+ {+ id: 'HP-105',+ title: 'Assistant output arrives as Parts on status updates',+ run: async (ctx) => {+ const { events } = await stream(ctx, 'conformance: say something')+ const parts = events.flatMap((e) => e.status?.message?.parts ?? [])+ return parts.length ? pass(`${parts.length} part(s)`) : fail('the turn produced no Parts at all')+ },+ },+ {+ id: 'HP-106',+ title: 'Image attachments are accepted or refused loudly',+ run: async (ctx) => {+ const png = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=='+ const { events } = await stream(ctx, 'conformance: describe this image', {+ parts: [{ text: 'conformance: describe this image' }, { raw: png, mediaType: 'image/png' }],+ })+ const last = events[events.length - 1]+ const state = last?.status?.state ?? ''+ if (state === 'TASK_STATE_FAILED') return pass('refused explicitly')+ if (TERMINAL.includes(state)) {+ return warn('the turn completed — verify by hand that the image was actually used; silently discarding it violates HP-106 and cannot be detected from outside')+ }+ return fail(`ended on "${state}"`)+ },+ },+ {+ id: 'HP-200',+ title: 'ListTasks filters by contextId',+ run: async (ctx) => {+ const ctxId = `conf-list-${Date.now()}`+ await stream(ctx, 'conformance: first', { contextId: ctxId })+ await stream(ctx, 'conformance: second', { contextId: ctxId })+ const b = await body(await rpc(ctx, 'ListTasks', { contextId: ctxId }))+ const tasks = ((b.result ?? {}) as { tasks?: Array<{ contextId?: string }> }).tasks+ if (!Array.isArray(tasks)) return fail('ListTasks did not return a tasks array')+ if (tasks.length < 2) return fail(`expected at least 2 tasks in the context, saw ${tasks.length}`)+ const foreign = tasks.filter((t) => t.contextId !== ctxId)+ return foreign.length ? fail(`${foreign.length} task(s) from another context leaked into the filter`) : pass(`${tasks.length} task(s)`)+ },+ },+ {+ id: 'HP-201',+ title: 'GetTask returns the task with its history',+ run: async (ctx) => {+ const { events } = await stream(ctx, 'conformance: history please')+ const taskId = events[0]?.taskId+ if (!taskId) return fail('no taskId observed')+ const b = await body(await rpc(ctx, 'GetTask', { taskId }))+ const task = b.result as { history?: unknown[]; status?: { state?: string } } | undefined+ if (!task) return fail('GetTask returned no task')+ return Array.isArray(task.history) && task.history.length+ ? pass(`${task.history.length} message(s)`)+ : fail('GetTask returned no history — a page refresh would lose the conversation')+ },+ },+ {+ id: 'HP-202',+ title: 'GetTask returns the whole transcript in one response',+ run: async (ctx) => {+ const { events } = await stream(ctx, 'conformance: whole transcript')+ const taskId = events[0]?.taskId+ if (!taskId) return fail('no taskId observed')+ const b = await body(await rpc(ctx, 'GetTask', { taskId }))+ const task = (b.result ?? {}) as Record<string, unknown>+ const paging = ['nextPageToken', 'hasMore', 'cursor'].filter((k) => k in task)+ return paging.length+ ? fail(`response carries paging field(s) ${paging.join(', ')}; pagination is not part of this revision`)+ : pass()+ },+ },+ {+ id: 'HP-203',+ title: 'Oversized transcripts are marked, never silently truncated',+ run: () => skip('not verifiable without a session large enough to cross the 5 MB ceiling'),+ },+ {+ id: 'HP-210',+ title: 'Part metadata uses recognised autonomous.ai/* keys',+ run: async (ctx) => {+ const { events } = await stream(ctx, 'conformance: metadata check')+ const metas = events.flatMap((e) => e.status?.message?.parts ?? []).map((p) => p.metadata).filter(Boolean) as Record<string, unknown>[]+ if (!metas.length) return skip('this provider emits no metadata — conformant under HP-211, nothing to validate')+ const kinds = metas.map((m) => m['autonomous.ai/kind']).filter(Boolean) as string[]+ const bad = kinds.filter((k) => !KNOWN_KINDS.includes(k))+ return bad.length ? fail(`unrecognised kind(s): ${[...new Set(bad)].join(', ')}`) : pass(`${kinds.length} kind(s), all recognised`)+ },+ },+ {+ id: 'HP-211',+ title: 'A provider emitting no metadata is still conformant',+ run: () => skip('a property of the client, not of the provider — asserted by the client test suite'),+ },+ {+ id: 'HP-220',+ title: 'Statistics are omitted rather than fabricated',+ run: () => skip('not verifiable from outside — a wrong count is indistinguishable from a right one'),+ },+ {+ id: 'HP-300',+ title: 'workspace-files: autonomous.ListFiles and autonomous.ReadFile',+ run: async (ctx) => {+ if (!declares(ctx, EXT.FILES)) return skip('not declared — absence is a legitimate answer (HP-022)')+ const projectId = firstSkillId(ctx)+ if (!projectId) return fail('extension declared but the card exposes no skill to scope a call to')+ const b = await body(await rpc(ctx, 'autonomous.ListFiles', { projectId }))+ const err = b.error as { code?: number } | undefined+ if (err?.code === -32601) return fail('declared in the Agent Card but autonomous.ListFiles is not implemented')+ if (err) return fail(`autonomous.ListFiles returned error ${err.code}`)+ const files = ((b.result ?? {}) as { files?: unknown }).files+ return Array.isArray(files) ? pass(`${files.length} entr(ies)`) : fail('response has no `files` array')+ },+ },+ {+ id: 'HP-301',+ title: 'workspace-write: mutation methods exist',+ run: async (ctx) => {+ if (!declares(ctx, EXT.WRITE)) return skip('not declared — absence is a legitimate answer (HP-022)')+ // Probe WITHOUT mutating: call with deliberately missing params and require "invalid params"+ // rather than "method not found". Running a real create/delete against someone's live workspace+ // is not something a conformance runner gets to do.+ const b = await body(await rpc(ctx, 'autonomous.RenameProject', {}))+ const err = b.error as { code?: number } | undefined+ if (err?.code === -32601) return fail('declared in the Agent Card but autonomous.RenameProject is not implemented')+ if (err?.code === -32602) return pass('method present (probed non-destructively with empty params)')+ return warn(`probe returned ${err ? `error ${err.code}` : 'a result'} — verify the mutation methods by hand; the runner will not mutate a live workspace`)+ },+ },+ {+ id: 'HP-302',+ title: 'session-recap: autonomous.GetRecap',+ run: async (ctx) => {+ if (!declares(ctx, EXT.RECAP)) return skip('not declared — absence is a legitimate answer (HP-022)')+ const projectId = firstSkillId(ctx)+ if (!projectId) return fail('extension declared but the card exposes no skill to scope a call to')+ const b = await body(await rpc(ctx, 'autonomous.GetRecap', { projectId, n: 2 }))+ const err = b.error as { code?: number } | undefined+ if (err?.code === -32601) return fail('declared in the Agent Card but autonomous.GetRecap is not implemented')+ if (err) return fail(`autonomous.GetRecap returned error ${err.code}`)+ const result = (b.result ?? {}) as { entries?: unknown }+ if (!Array.isArray(result.entries)) return fail('response has no `entries` array')+ const overlong = (result.entries as Array<{ recap?: string }>).filter((e) => (e.recap?.length ?? 0) > 200)+ return overlong.length+ ? fail(`${overlong.length} recap(s) exceed the 200-character ceiling the device renders`)+ : pass(`${result.entries.length} entr(ies)`)+ },+ },+ {+ id: 'HP-303',+ title: 'voice: autonomous.RouteVoice',+ run: async (ctx) => {+ if (!declares(ctx, EXT.VOICE)) return skip('not declared — Autonomous routes from skills[] by default')+ const b = await body(await rpc(ctx, 'autonomous.RouteVoice', { transcript: 'conformance probe' }))+ const err = b.error as { code?: number } | undefined+ if (err?.code === -32601) return fail('declared in the Agent Card but autonomous.RouteVoice is not implemented')+ if (err) return fail(`autonomous.RouteVoice returned error ${err.code}`)+ const result = (b.result ?? {}) as { projectId?: unknown }+ return 'projectId' in result+ ? pass(result.projectId === null ? 'declined, routing handed back' : String(result.projectId))+ : fail('response has no `projectId` (use null to decline)')+ },+ },+ {+ id: 'HP-310',+ title: 'Extension methods are namespaced autonomous.<Verb>',+ run: (ctx) => {+ const declared = ((ctx.card.extensions ?? []) as Array<{ uri?: string }>).map((e) => e.uri ?? '')+ const ours = declared.filter((u) => KNOWN_EXTENSIONS.includes(u))+ return ours.length+ ? pass('verified indirectly — every extension probe above uses the autonomous.* namespace')+ : skip('no Autonomous extensions declared')+ },+ },+ {+ id: 'HP-311',+ title: 'An UNDECLARED extension method is rejected with -32601',+ run: async (ctx) => {+ const undeclared = ([+ [EXT.FILES, 'autonomous.ListFiles'],+ [EXT.WRITE, 'autonomous.CreateProject'],+ [EXT.RECAP, 'autonomous.GetRecap'],+ [EXT.VOICE, 'autonomous.RouteVoice'],+ ] as const).filter(([uri]) => !declares(ctx, uri))+ if (!undeclared.length) return skip('this provider declares every extension — nothing undeclared to probe')+ const answered: string[] = []+ for (const [, method] of undeclared) {+ const b = await body(await rpc(ctx, method, {}))+ const err = b.error as { code?: number } | undefined+ if (err?.code !== -32601) answered.push(method)+ }+ return answered.length+ ? fail(`answered undeclared method(s): ${answered.join(', ')} — the Agent Card becomes untrustworthy`)+ : pass(`${undeclared.length} undeclared method(s) correctly rejected`)+ },+ },+ {+ id: 'HP-400',+ title: 'An unknown method is rejected without breaking the connection',+ run: async (ctx) => {+ const res = await rpc(ctx, 'ConformanceNoSuchMethod', {})+ const b = await body(res)+ const err = b.error as { code?: number } | undefined+ if (!err) return fail('an unknown method was not rejected')+ // Prove the endpoint still works afterwards.+ const after = await rpc(ctx, 'ListTasks', {})+ return after.ok ? pass(`code ${err.code}, endpoint still healthy`) : fail('the endpoint stopped responding after an unknown method')+ },+ },+ {+ id: 'HP-900',+ title: 'All traffic over TLS',+ run: (ctx) => (ctx.url.startsWith('https://') ? pass() : warn('plain HTTP — acceptable locally, a violation in production')),+ },+ {+ id: 'HP-902',+ title: 'Rate limiting',+ run: () => skip('enforced by Autonomous on its side, not a provider obligation to demonstrate'),+ },+ {+ id: 'HP-903',+ title: 'The credential is not logged or forwarded',+ run: () => skip('not verifiable from outside — covered by the onboarding review, not by this runner'),+ },+]++// ── runner ───────────────────────────────────────────────────────────────────────────────────────++export interface RunSummary {+ results: Array<{ id: string; title: string } & Result>+ pass: number+ fail: number+ skip: number+ warn: number+}++export async function runConformance(opts: { url: string; key: string; badKey?: string; askPhrase?: string }): Promise<RunSummary> {+ const base = opts.url.replace(/\/+$/, '')+ // An unreachable or malformed endpoint must be REPORTED, not thrown. A conformance runner that+ // crashes when the provider is down is useless at exactly the moment it is most needed.+ let card: Record<string, unknown> = {}+ let cardError: string | undefined+ try {+ const cardRes = await fetch(`${base}/.well-known/agent-card.json`)+ if (cardRes.ok) card = (await cardRes.json()) as Record<string, unknown>+ else cardError = `agent card responded ${cardRes.status}`+ } catch (err) {+ cardError = `could not reach ${base} — ${err instanceof Error ? err.message : String(err)}`+ }+ const ctx: Ctx = { url: base, key: opts.key, badKey: opts.badKey, askPhrase: opts.askPhrase, card, cardError }++ const results: RunSummary['results'] = []+ for (const check of CHECKS) {+ let result: Result+ try {+ result = await check.run(ctx)+ } catch (err) {+ result = fail(`check threw: ${err instanceof Error ? err.message : String(err)}`)+ }+ results.push({ id: check.id, title: check.title, ...result })+ }++ return {+ results,+ pass: results.filter((r) => r.outcome === 'PASS').length,+ fail: results.filter((r) => r.outcome === 'FAIL').length,+ skip: results.filter((r) => r.outcome === 'SKIP').length,+ warn: results.filter((r) => r.outcome === 'WARN').length,+ }+}++const MARK: Record<Outcome, string> = { PASS: '✔', FAIL: '✖', SKIP: '–', WARN: '!' }++export function format(summary: RunSummary): string {+ const lines = summary.results.map((r) => {+ const head = `${MARK[r.outcome]} ${r.id.padEnd(7)} ${r.title}`+ return r.detail ? `${head}\n ${r.detail}` : head+ })+ lines.push('')+ lines.push(`${summary.pass} passed · ${summary.fail} failed · ${summary.warn} need manual review · ${summary.skip} not verifiable from outside`)+ if (summary.skip || summary.warn) {+ lines.push('Every skipped and manual clause states its reason above — nothing was checked silently.')+ }+ return lines.join('\n')+}++function arg(name: string): string | undefined {+ const i = process.argv.indexOf(`--${name}`)+ return i >= 0 ? process.argv[i + 1] : undefined+}++if (process.argv[1] && import.meta.url === `file://${process.argv[1]}`) {+ const url = arg('url') ?? 'http://127.0.0.1:4501'+ const key = arg('key') ?? 'conformance'+ const badKey = arg('bad-key')+ const askPhrase = arg('ask-phrase')++ console.log(`Harness provider conformance — ${url}`)+ console.log(`Spec: spec/README.md · ${CHECKS.length} clauses\n`)+ const summary = await runConformance({ url, key, badKey, askPhrase })+ console.log(format(summary))+ if (!badKey || !askPhrase) {+ console.log('\nTip: --bad-key <invalid credential> and --ask-phrase <prompt that makes the agent ask> unlock 3 more clauses.')+ }+ process.exit(summary.fail ? 1 : 0)+}++/** Re-exported so the reference provider's own agent card can be diffed against expectations in tests. */+export { AGENT_CARD }diff --git a/reference-provider/src/scenarios.ts b/reference-provider/src/scenarios.tsnew file mode 100644index 000000000..8310e28d6--- /dev/null+++ b/reference-provider/src/scenarios.ts@@ -0,0 +1,140 @@+/**+ * Deterministic scenarios, selected by what the user says.+ *+ * The point of this file is the HOSTILE cases, not the happy one. A reference implementation that only+ * demonstrates success teaches a partner nothing about the failure modes their integration will+ * actually hit, and gives the backend client (phase 5) nothing to harden against.+ */+import { TaskState, type Part, type TaskStateValue } from './types.js'++export type Step =+ | { kind: 'parts'; parts: Part[] }+ /** Terminal or intermediate state transition. */+ | { kind: 'state'; state: TaskStateValue; text?: string }+ /** Abort the HTTP response mid-frame, without a terminal state. Violates HP-102 on purpose. */+ | { kind: 'die' }++export interface Scenario {+ id: string+ /** Matched against the lowercased user text; first match wins. `null` = the default. */+ trigger: string | null+ description: string+ steps: Step[]+}++const meta = (kind: NonNullable<Part['metadata']>['autonomous.ai/kind'], extra: Part['metadata'] = {}): Part['metadata'] => ({+ 'autonomous.ai/kind': kind,+ ...extra,+})++/** The full-fidelity turn: thinking, a tool call, assistant text, completion. */+const RICH: Step[] = [+ { kind: 'parts', parts: [{ text: 'Checking pacing…', metadata: meta('thinking_delta', { 'autonomous.ai/thinkingId': 't1' }) }] },+ { kind: 'parts', parts: [{ text: '', metadata: meta('thinking_title', { 'autonomous.ai/thinkingId': 't1', 'autonomous.ai/title': 'Checking the budget data' }) }] },+ {+ kind: 'parts',+ parts: [+ {+ text: '',+ metadata: meta('tool_start', {+ 'autonomous.ai/toolCallId': 'c7',+ 'autonomous.ai/tool': 'query_spend',+ 'autonomous.ai/toolInput': { account: 'acme', window: '7d' },+ }),+ },+ ],+ },+ {+ kind: 'parts',+ parts: [+ {+ text: '7 rows',+ metadata: meta('tool_end', {+ 'autonomous.ai/toolCallId': 'c7',+ 'autonomous.ai/tool': 'query_spend',+ 'autonomous.ai/isError': false,+ 'autonomous.ai/summary': 'Returned 7 rows',+ 'autonomous.ai/durationSeconds': 1.4,+ }),+ },+ ],+ },+ { kind: 'parts', parts: [{ text: 'Acme is at 118% of pacing this week.', metadata: meta('text_delta') }] },+ { kind: 'state', state: TaskState.COMPLETED },+]++export const SCENARIOS: Scenario[] = [+ {+ id: 'plain',+ trigger: 'plain',+ description: 'HP-211 — a provider that emits NO autonomous.ai/* metadata is conformant. Renders as plain text.',+ steps: [+ { kind: 'parts', parts: [{ text: 'Plain text reply, no metadata at all.' }] },+ { kind: 'state', state: TaskState.COMPLETED },+ ],+ },+ {+ id: 'ask',+ trigger: 'ask me',+ description: 'HP-104 — the agent needs an answer. Enters INPUT_REQUIRED and waits for a message on the same taskId.',+ steps: [+ { kind: 'parts', parts: [{ text: 'Which account did you mean?', metadata: meta('text_delta') }] },+ { kind: 'state', state: TaskState.INPUT_REQUIRED, text: 'Which account did you mean?' },+ ],+ },+ {+ id: 'fail',+ trigger: 'fail',+ description: 'A turn that fails partway through, after already emitting output.',+ steps: [+ { kind: 'parts', parts: [{ text: 'Starting the query…', metadata: meta('text_delta') }] },+ { kind: 'state', state: TaskState.FAILED, text: 'Upstream data warehouse refused the connection.' },+ ],+ },+ {+ id: 'die',+ trigger: 'die',+ description: 'The stream is cut without a terminal state — an HP-102 violation, present so the client can be hardened against it.',+ steps: [+ { kind: 'parts', parts: [{ text: 'Working on it…', metadata: meta('text_delta') }] },+ { kind: 'die' },+ ],+ },+ {+ id: 'compact',+ trigger: 'compact',+ description: 'The provider compacted its own context and reports it. Autonomous never asks for this (spec §9).',+ steps: [+ {+ kind: 'parts',+ parts: [+ {+ text: 'Compacted earlier turns to stay within context.',+ metadata: meta('context_compact', { 'autonomous.ai/compacted': { userMessages: 12, assistantMessages: 12, toolUses: 41 } }),+ },+ ],+ },+ { kind: 'parts', parts: [{ text: 'Where were we?', metadata: meta('text_delta') }] },+ { kind: 'state', state: TaskState.COMPLETED },+ ],+ },+ {+ id: 'rich',+ trigger: null,+ description: 'Default: thinking, a tool call, assistant text, completion.',+ steps: RICH,+ },+]++export function pickScenario(userText: string): Scenario {+ const t = userText.toLowerCase()+ return SCENARIOS.find((s) => s.trigger !== null && t.includes(s.trigger)) ?? SCENARIOS[SCENARIOS.length - 1]!+}++/** Credential that makes every call fail authentication, for exercising HP-013. */+export const REJECTED_CREDENTIAL = 'bad-key'++/** Any other non-empty credential is accepted — this provider has no real user database. */+export function credentialAccepted(key: string | undefined): boolean {+ return !!key && key !== REJECTED_CREDENTIAL+}diff --git a/reference-provider/src/server.spec.ts b/reference-provider/src/server.spec.tsnew file mode 100644index 000000000..38e63b0f5--- /dev/null+++ b/reference-provider/src/server.spec.ts@@ -0,0 +1,265 @@+// The reference provider IS the executable reading of the spec, so these tests are written as clause+// checks: each name states the HP-xxx it pins. When the spec changes, these are the first thing that+// should go red.+import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'++// Read at module load in server.ts — must be set before the import below.+process.env.STEP_DELAY_MS = '0'+const { start } = await import('./server.js')+const { resetIds } = await import('./store.js')+const { TaskState } = await import('./types.js')++let base: string+let stop: () => Promise<void>++beforeAll(async () => {+ const s = await start(0)+ base = s.url+ stop = s.close+})+afterAll(async () => { await stop() })+beforeEach(() => { resetIds() })++const KEY = 'test-key'++interface SseEvent { taskId: string; contextId: string; status: { state: string; message?: { parts: Array<{ text?: string; metadata?: Record<string, unknown> }> } }; final?: boolean }++async function rpc(method: string, params: unknown, key: string = KEY): Promise<Response> {+ return fetch(base, {+ method: 'POST',+ headers: { 'content-type': 'application/json', 'x-api-key': key },+ body: JSON.stringify({ jsonrpc: '2.0', id: 1, method, params }),+ })+}++/** `Response.json()` is typed `unknown` under strict mode; these are test fixtures, so assert once here. */+// eslint-disable-next-line @typescript-eslint/no-explicit-any+const json = async (res: Response): Promise<any> => res.json()++/** Drains an SSE response into parsed events. Returns whatever arrived, even on an aborted stream. */+async function drain(res: Response): Promise<SseEvent[]> {+ const events: SseEvent[] = []+ if (!res.body) return events+ const reader = res.body.getReader()+ const decoder = new TextDecoder()+ let buffer = ''+ try {+ for (;;) {+ const { done, value } = await reader.read()+ if (done) break+ buffer += decoder.decode(value, { stream: true })+ const frames = buffer.split('\n\n')+ buffer = frames.pop() ?? ''+ for (const frame of frames) {+ const line = frame.split('\n').find((l) => l.startsWith('data: '))+ if (line) events.push(JSON.parse(line.slice(6)) as SseEvent)+ }+ }+ } catch { /* an aborted stream is a valid outcome here — see the `die` test */ }+ return events+}++const userMessage = (text: string, extra: Record<string, unknown> = {}): unknown => ({+ message: { role: 'ROLE_USER', messageId: 'm-user', parts: [{ text }], ...extra },+})++const send = async (text: string, extra: Record<string, unknown> = {}): Promise<SseEvent[]> =>+ drain(await rpc('SendStreamingMessage', userMessage(text, extra)))++const kinds = (events: SseEvent[]): string[] =>+ events.flatMap((e) => e.status.message?.parts.map((p) => p.metadata?.['autonomous.ai/kind'] as string) ?? []).filter(Boolean)++describe('agent card (HP-020 … HP-023)', () => {+ it('is served unauthenticated at the well-known path', async () => {+ const res = await fetch(`${base}/.well-known/agent-card.json`)+ expect(res.status).toBe(200)+ const card = await json(res)+ expect(card.name).toBeTruthy()+ expect(card.securitySchemes.apiKey).toBeTruthy()+ })++ it('declares streaming, which HP-021 makes mandatory', async () => {+ const card = await json(await fetch(`${base}/.well-known/agent-card.json`))+ expect(card.capabilities.streaming).toBe(true)+ })++ it('exposes skills as the project list and declares its extensions by exact URI', async () => {+ const card = await json(await fetch(`${base}/.well-known/agent-card.json`))+ expect(card.skills.length).toBeGreaterThan(0)+ expect(card.extensions.map((e: { uri: string }) => e.uri)).toContain('https://harness.autonomous.ai/api/a2a/ext/session-recap')+ // Undeclared extensions must read as absent — the reference provider leaves these out on purpose.+ expect(card.extensions.map((e: { uri: string }) => e.uri)).not.toContain('https://harness.autonomous.ai/api/a2a/ext/workspace-files')+ })+})++describe('authentication (HP-011 … HP-013)', () => {+ it('rejects a missing credential with 401, not a generic failure', async () => {+ const res = await fetch(base, {+ method: 'POST',+ headers: { 'content-type': 'application/json' },+ body: JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'ListTasks', params: {} }),+ })+ expect(res.status).toBe(401)+ expect((await json(res)).error.code).toBe(-32001)+ })++ it('rejects the known-bad credential distinguishably from an outage', async () => {+ const res = await rpc('ListTasks', {}, 'bad-key')+ expect(res.status).toBe(401)+ })+})++describe('streaming a turn (HP-100 … HP-105)', () => {+ it('opens with WORKING and closes with a terminal state marked final', async () => {+ const events = await send('did acme blow through budget?')+ expect(events[0]!.status.state).toBe(TaskState.WORKING)+ const last = events[events.length - 1]!+ expect(last.status.state).toBe(TaskState.COMPLETED)+ expect(last.final).toBe(true)+ })++ it('carries thinking, tool and text kinds in Part.metadata', async () => {+ const seen = kinds(await send('check pacing'))+ expect(seen).toContain('thinking_delta')+ expect(seen).toContain('thinking_title')+ expect(seen).toContain('tool_start')+ expect(seen).toContain('tool_end')+ expect(seen).toContain('text_delta')+ })++ it('correlates tool_start and tool_end by the same toolCallId', async () => {+ const events = await send('check pacing')+ const ids = events+ .flatMap((e) => e.status.message?.parts ?? [])+ .filter((p) => ['tool_start', 'tool_end'].includes(p.metadata?.['autonomous.ai/kind'] as string))+ .map((p) => p.metadata?.['autonomous.ai/toolCallId'])+ expect(ids).toHaveLength(2)+ expect(ids[0]).toBe(ids[1])+ })++ it('a provider emitting NO metadata is still conformant (HP-211)', async () => {+ const events = await send('plain please')+ expect(kinds(events)).toHaveLength(0)+ expect(events[events.length - 1]!.status.state).toBe(TaskState.COMPLETED)+ const text = events.flatMap((e) => e.status.message?.parts.map((p) => p.text) ?? []).join('')+ expect(text).toContain('Plain text')+ })++ it('reports FAILED after already emitting output, rather than going silent', async () => {+ const events = await send('make this fail')+ expect(kinds(events)).toContain('text_delta')+ expect(events[events.length - 1]!.status.state).toBe(TaskState.FAILED)+ })++ it('refuses image attachments loudly instead of discarding them (HP-106)', async () => {+ const events = await send('look at this', {+ parts: [{ text: 'look at this' }, { raw: 'aGk=', mediaType: 'image/png' }],+ })+ const last = events[events.length - 1]!+ expect(last.status.state).toBe(TaskState.FAILED)+ expect(last.status.message?.parts[0]?.text).toMatch(/image/i)+ })+})++describe('input required (HP-104)', () => {+ it('pauses in INPUT_REQUIRED and resumes when answered on the same taskId', async () => {+ const first = await send('ask me something')+ const pause = first[first.length - 1]!+ expect(pause.status.state).toBe(TaskState.INPUT_REQUIRED)+ expect(pause.final).toBeFalsy() // INPUT_REQUIRED is not terminal++ const resumed = await drain(+ await rpc('SendStreamingMessage', {+ message: { role: 'ROLE_USER', messageId: 'm-answer', taskId: pause.taskId, parts: [{ text: 'the acme one' }] },+ }),+ )+ expect(resumed[resumed.length - 1]!.status.state).toBe(TaskState.COMPLETED)+ expect(resumed[0]!.taskId).toBe(pause.taskId)+ })++ it('refuses a message aimed at an already-terminal task', async () => {+ const done = await send('plain')+ const res = await rpc('SendStreamingMessage', {+ message: { role: 'ROLE_USER', messageId: 'm-late', taskId: done[0]!.taskId, parts: [{ text: 'more' }] },+ })+ expect((await json(res)).error.message).toMatch(/terminal/i)+ })+})++describe('cancellation (HP-103)', () => {+ it('cancels an in-flight task and reports CANCELED', async () => {+ const started = await send('ask me something') // parks in INPUT_REQUIRED, so still cancelable+ const taskId = started[0]!.taskId+ const res = await rpc('CancelTask', { taskId })+ expect((await json(res)).result.status.state).toBe(TaskState.CANCELED)+ })++ it('refuses to cancel a task that already finished', async () => {+ const done = await send('plain')+ const res = await rpc('CancelTask', { taskId: done[0]!.taskId })+ expect((await json(res)).error.code).toBe(-32003)+ })++ it('reports an unknown task as not found, not as not-cancelable', async () => {+ const res = await rpc('CancelTask', { taskId: 'task-does-not-exist' })+ expect((await json(res)).error.code).toBe(-32002)+ })+})++describe('history (HP-200 … HP-202)', () => {+ it('GetTask returns the whole transcript in one response', async () => {+ const events = await send('check pacing')+ const res = await rpc('GetTask', { taskId: events[0]!.taskId })+ const task = (await json(res)).result+ expect(task.history.length).toBeGreaterThan(1)+ expect(task.status.state).toBe(TaskState.COMPLETED)+ })++ it('derives a session title from the first user message', async () => {+ const events = await send('did acme blow through budget?')+ const task = (await json(await rpc('GetTask', { taskId: events[0]!.taskId }))).result+ expect(task.metadata.title).toContain('acme')+ })++ it('ListTasks groups several turns under one contextId', async () => {+ const a = await send('first question', { contextId: 'ctx-shared' })+ await send('second question', { contextId: 'ctx-shared' })+ await send('unrelated', { contextId: 'ctx-other' })++ const listed = (await json(await rpc('ListTasks', { contextId: 'ctx-shared' }))).result.tasks+ expect(listed).toHaveLength(2)+ expect(listed.every((t: { contextId: string }) => t.contextId === 'ctx-shared')).toBe(true)+ expect(listed.map((t: { id: string }) => t.id)).toContain(a[0]!.taskId)+ })++ it('reports an unknown task rather than an empty one', async () => {+ const res = await rpc('GetTask', { taskId: 'nope' })+ expect((await json(res)).error.code).toBe(-32002)+ })+})++describe('hostile: a stream that dies without a terminal state', () => {+ it('violates HP-102 on purpose, so the client can be hardened against it', async () => {+ const events = await send('die now')+ expect(events.length).toBeGreaterThan(0)+ const last = events[events.length - 1]!+ expect(last.final).toBeFalsy()+ expect([TaskState.COMPLETED, TaskState.FAILED, TaskState.CANCELED]).not.toContain(last.status.state)+ })+})++describe('protocol errors', () => {+ it('rejects an unknown method', async () => {+ const res = await rpc('NoSuchMethod', {})+ expect((await json(res)).error.code).toBe(-32601)+ })++ it('rejects a malformed body', async () => {+ const res = await fetch(base, {+ method: 'POST',+ headers: { 'content-type': 'application/json', 'x-api-key': KEY },+ body: '{ not json',+ })+ expect((await json(res)).error.code).toBe(-32700)+ })+})diff --git a/reference-provider/src/server.ts b/reference-provider/src/server.tsnew file mode 100644index 000000000..035406ba3--- /dev/null+++ b/reference-provider/src/server.ts@@ -0,0 +1,390 @@+/**+ * Reference provider for the Autonomous harness provider profile.+ *+ * See `../spec/README.md`. Clause IDs (HP-xxx) in the comments below point at the+ * requirement each block satisfies, so this file doubles as a worked reading of the spec.+ *+ * Zero runtime dependencies on purpose: node:http and nothing else. A partner should be able to read+ * this end to end and know exactly what their own endpoint has to do.+ */+import { createServer, type IncomingMessage, type Server, type ServerResponse } from 'node:http'+import { AGENT_CARD, SKILL_IDS } from './agentCard.js'+import { credentialAccepted, pickScenario, type Step } from './scenarios.js'+import { nextId, TaskStore } from './store.js'+import {+ isTerminal,+ RpcErrors,+ TaskState,+ type JsonRpcError,+ type JsonRpcRequest,+ type Message,+ type Task,+ type TaskStatusUpdateEvent,+} from './types.js'++/** Pause between streamed steps. 0 in tests; a small value locally so streaming is visible. */+const STEP_DELAY_MS = Number(process.env.STEP_DELAY_MS ?? 20)++const sleep = (ms: number): Promise<void> => new Promise((r) => setTimeout(r, ms))++export interface ProviderServer {+ server: Server+ store: TaskStore+ url: string+ close: () => Promise<void>+}++export function createProviderServer(store = new TaskStore()): Server {+ return createServer((req, res) => {+ void handle(req, res, store).catch((err) => {+ // Never leak a stack to the wire; a provider's internal errors are its own business.+ console.error('[reference-provider] unhandled', err)+ if (!res.headersSent) sendJson(res, 500, { error: 'internal' })+ else res.end()+ })+ })+}++async function handle(req: IncomingMessage, res: ServerResponse, store: TaskStore): Promise<void> {+ const url = new URL(req.url ?? '/', 'http://localhost')++ // HP-020 — the agent card is unauthenticated: a client must be able to discover the security+ // scheme before it can possibly satisfy it.+ if (req.method === 'GET' && url.pathname === '/.well-known/agent-card.json') {+ sendJson(res, 200, AGENT_CARD)+ return+ }++ if (req.method !== 'POST' || url.pathname !== '/') {+ sendJson(res, 404, { error: 'not found' })+ return+ }++ let rpc: JsonRpcRequest+ try {+ rpc = JSON.parse(await readBody(req)) as JsonRpcRequest+ } catch {+ sendRpcError(res, null, RpcErrors.PARSE_ERROR)+ return+ }+ if (!rpc || typeof rpc.method !== 'string') {+ sendRpcError(res, rpc?.id ?? null, RpcErrors.INVALID_REQUEST)+ return+ }++ // HP-011/HP-012 — the credential arrives in the header the agent card declared, and identifies one+ // tenant. HP-013: a rejection is its own signal, never a generic failure.+ const credential = header(req, AGENT_CARD.securitySchemes.apiKey.name)+ if (!credentialAccepted(credential)) {+ sendRpcError(res, rpc.id ?? null, RpcErrors.UNAUTHENTICATED)+ return+ }++ const params = rpc.params ?? {}+ switch (rpc.method) {+ case 'SendStreamingMessage':+ await sendStreamingMessage(res, store, params)+ return+ case 'SendMessage':+ sendMessageSync(res, store, params, rpc.id ?? null)+ return+ case 'GetTask':+ getTask(res, store, params, rpc.id ?? null)+ return+ case 'ListTasks':+ listTasks(res, store, params, rpc.id ?? null)+ return+ case 'CancelTask':+ cancelTask(res, store, params, rpc.id ?? null)+ return++ // ── Extension methods (HP-310: always `autonomous.<Verb>`) ─────────────────────────────────+ // HP-311: an extension method whose URI is not in AgentCard.extensions MUST be rejected with+ // -32601. Answering an undeclared method would make the card untrustworthy.+ case 'autonomous.GetRecap':+ if (!declaresExtension(EXT.SESSION_RECAP)) { sendRpcError(res, rpc.id ?? null, RpcErrors.METHOD_NOT_FOUND); return }+ getRecap(res, store, params, rpc.id ?? null)+ return+ case 'autonomous.ListFiles':+ case 'autonomous.ReadFile':+ // `workspace-files` is deliberately NOT declared by this provider — see agentCard.ts.+ sendRpcError(res, rpc.id ?? null, RpcErrors.METHOD_NOT_FOUND)+ return+ case 'autonomous.CreateProject':+ case 'autonomous.RenameProject':+ case 'autonomous.DeleteProject':+ case 'autonomous.SetSessionTitle':+ case 'autonomous.DeleteSession':+ // `workspace-write` is deliberately NOT declared either.+ sendRpcError(res, rpc.id ?? null, RpcErrors.METHOD_NOT_FOUND)+ return+ case 'autonomous.RouteVoice':+ sendRpcError(res, rpc.id ?? null, RpcErrors.METHOD_NOT_FOUND)+ return++ default:+ sendRpcError(res, rpc.id ?? null, RpcErrors.METHOD_NOT_FOUND)+ }+}++const EXT = {+ WORKSPACE_FILES: 'https://harness.autonomous.ai/api/a2a/ext/workspace-files',+ WORKSPACE_WRITE: 'https://harness.autonomous.ai/api/a2a/ext/workspace-write',+ SESSION_RECAP: 'https://harness.autonomous.ai/api/a2a/ext/session-recap',+ VOICE: 'https://harness.autonomous.ai/api/a2a/ext/voice',+} as const++const declaresExtension = (uri: string): boolean =>+ (AGENT_CARD.extensions as ReadonlyArray<{ uri: string }>).some((e) => e.uri === uri)++/**+ * HP-302 — `autonomous.GetRecap`. Headline-style summaries of recent turns, for the device's tiles.+ *+ * An empty array is the correct answer before anything has been summarised: the device shows nothing+ * rather than resurrecting stale text.+ */+function getRecap(res: ServerResponse, store: TaskStore, params: Record<string, unknown>, id: string | number | null): void {+ const projectId = typeof params.projectId === 'string' ? params.projectId : ''+ if (!SKILL_IDS.includes(projectId)) {+ sendRpcError(res, id, RpcErrors.INVALID_PARAMS)+ return+ }+ const n = Math.max(1, Math.min(5, Number(params.n) || 2))+ const entries = store+ .list()+ .filter((t) => isTerminal(t.status.state))+ .slice(0, n)+ .map((t) => ({+ recap: (t.metadata?.title ?? 'Untitled').slice(0, 200),+ contextId: t.contextId,+ taskId: t.id,+ }))+ sendRpcResult(res, id, { projectId, entries })+}++// ── SendStreamingMessage (HP-100 … HP-106) ───────────────────────────────────────────────────────++async function sendStreamingMessage(res: ServerResponse, store: TaskStore, params: Record<string, unknown>): Promise<void> {+ const incoming = params.message as Message | undefined+ if (!incoming || !Array.isArray(incoming.parts)) {+ sendRpcError(res, null, RpcErrors.INVALID_PARAMS)+ return+ }++ // HP-106 — images ride as standard Parts. This provider cannot process them, so it says so rather+ // than silently discarding, which would read to the user as the agent ignoring what they sent.+ const images = incoming.parts.filter((p) => p.raw && p.mediaType?.startsWith('image/'))++ // HP-101 — a follow-up carries the existing taskId; a new chat carries only a fresh contextId.+ const resuming = typeof incoming.taskId === 'string' ? store.get(incoming.taskId) : undefined+ if (incoming.taskId && !resuming) {+ sendRpcError(res, null, RpcErrors.TASK_NOT_FOUND)+ return+ }+ if (resuming && isTerminal(resuming.status.state)) {+ // A2A: terminal tasks accept no further messages.+ sendRpcError(res, null, { code: -32004, message: 'Task is in a terminal state' })+ return+ }++ const contextId = resuming?.contextId ?? (typeof incoming.contextId === 'string' ? incoming.contextId : nextId('ctx'))+ const task = resuming ?? store.create(contextId, incoming)+ if (resuming) store.append(task.id, incoming)++ const controller = new AbortController()+ store.register(task.id, controller)++ openSse(res)+ const userText = incoming.parts.map((p) => p.text ?? '').join(' ')++ // HP-102 — every stream ends with a terminal state. The one exception is the `die` scenario, which+ // exists precisely so a client can be hardened against providers that get this wrong.+ const steps: Step[] = images.length+ ? [{ kind: 'state', state: TaskState.FAILED, text: 'This provider cannot process image attachments.' }]+ : pickScenario(userText).steps++ try {+ store.setState(task.id, TaskState.WORKING)+ writeSse(res, statusEvent(task, TaskState.WORKING))++ for (const step of steps) {+ if (controller.signal.aborted) break+ await sleep(STEP_DELAY_MS)+ if (controller.signal.aborted) break++ if (step.kind === 'die') {+ res.destroy() // no terminal state, mid-stream — deliberately non-conformant+ return+ }+ if (step.kind === 'parts') {+ writeSse(res, {+ taskId: task.id,+ contextId: task.contextId,+ status: {+ state: TaskState.WORKING,+ message: { role: 'ROLE_AGENT', messageId: nextId('m'), taskId: task.id, contextId: task.contextId, parts: step.parts },+ },+ })+ store.append(task.id, { role: 'ROLE_AGENT', messageId: nextId('m'), taskId: task.id, contextId: task.contextId, parts: step.parts })+ continue+ }+ // step.kind === 'state'+ const message: Message | undefined = step.text+ ? { role: 'ROLE_AGENT', messageId: nextId('m'), taskId: task.id, contextId: task.contextId, parts: [{ text: step.text }] }+ : undefined+ store.setState(task.id, step.state, message)+ writeSse(res, {+ taskId: task.id,+ contextId: task.contextId,+ status: { state: step.state, ...(message ? { message } : {}) },+ final: isTerminal(step.state),+ })+ // INPUT_REQUIRED is not terminal, but it does end this stream: the answer arrives as a new+ // request carrying the same taskId (HP-104).+ break+ }++ if (controller.signal.aborted) {+ writeSse(res, { taskId: task.id, contextId: task.contextId, status: { state: TaskState.CANCELED }, final: true })+ }+ } finally {+ store.release(task.id)+ if (!res.destroyed) res.end()+ }+}++// ── Non-streaming and read methods ───────────────────────────────────────────────────────────────++function sendMessageSync(res: ServerResponse, store: TaskStore, params: Record<string, unknown>, id: string | number | null): void {+ const incoming = params.message as Message | undefined+ if (!incoming || !Array.isArray(incoming.parts)) {+ sendRpcError(res, id, RpcErrors.INVALID_PARAMS)+ return+ }+ const contextId = typeof incoming.contextId === 'string' ? incoming.contextId : nextId('ctx')+ const task = store.create(contextId, incoming)+ store.setState(task.id, TaskState.COMPLETED, {+ role: 'ROLE_AGENT',+ messageId: nextId('m'),+ taskId: task.id,+ contextId,+ parts: [{ text: 'Non-streaming reply.' }],+ })+ sendRpcResult(res, id, store.get(task.id))+}++/** HP-201 — the full transcript in one response. Pagination is not part of this revision (HP-202). */+function getTask(res: ServerResponse, store: TaskStore, params: Record<string, unknown>, id: string | number | null): void {+ const taskId = typeof params.taskId === 'string' ? params.taskId : ''+ const task = store.get(taskId)+ if (!task) {+ sendRpcError(res, id, RpcErrors.TASK_NOT_FOUND)+ return+ }+ sendRpcResult(res, id, task)+}++/** HP-200 — grouping by contextId is what backs the session list. */+function listTasks(res: ServerResponse, store: TaskStore, params: Record<string, unknown>, id: string | number | null): void {+ const contextId = typeof params.contextId === 'string' ? params.contextId : undefined+ sendRpcResult(res, id, { tasks: store.list(contextId) })+}++/** HP-103 — after a successful cancel the stream terminates and the task reports CANCELED. */+function cancelTask(res: ServerResponse, store: TaskStore, params: Record<string, unknown>, id: string | number | null): void {+ const taskId = typeof params.taskId === 'string' ? params.taskId : ''+ const task = store.get(taskId)+ if (!task) {+ sendRpcError(res, id, RpcErrors.TASK_NOT_FOUND)+ return+ }+ if (!store.cancel(taskId)) {+ sendRpcError(res, id, RpcErrors.TASK_NOT_CANCELABLE)+ return+ }+ sendRpcResult(res, id, store.get(taskId))+}++// ── Wire helpers ─────────────────────────────────────────────────────────────────────────────────++function statusEvent(task: Task, state: TaskStatusUpdateEvent['status']['state']): TaskStatusUpdateEvent {+ return { taskId: task.id, contextId: task.contextId, status: { state } }+}++function openSse(res: ServerResponse): void {+ res.writeHead(200, {+ 'content-type': 'text/event-stream',+ 'cache-control': 'no-cache',+ connection: 'keep-alive',+ })+}++function writeSse(res: ServerResponse, event: TaskStatusUpdateEvent): void {+ if (res.destroyed) return+ res.write(`event: status-update\ndata: ${JSON.stringify(event)}\n\n`)+}++function sendJson(res: ServerResponse, status: number, body: unknown): void {+ const payload = JSON.stringify(body)+ res.writeHead(status, { 'content-type': 'application/json', 'content-length': Buffer.byteLength(payload) })+ res.end(payload)+}++function sendRpcResult(res: ServerResponse, id: string | number | null, result: unknown): void {+ sendJson(res, 200, { jsonrpc: '2.0', id, result })+}++function sendRpcError(res: ServerResponse, id: string | number | null, error: JsonRpcError): void {+ // JSON-RPC transports errors in the body with HTTP 200; an authentication failure additionally+ // deserves a real 401 so ordinary HTTP tooling sees it.+ const status = error.code === RpcErrors.UNAUTHENTICATED.code ? 401 : 200+ sendJson(res, status, { jsonrpc: '2.0', id, error })+}++function header(req: IncomingMessage, name: string): string | undefined {+ const v = req.headers[name.toLowerCase()]+ return Array.isArray(v) ? v[0] : v+}++async function readBody(req: IncomingMessage): Promise<string> {+ const chunks: Buffer[] = []+ let size = 0+ for await (const chunk of req) {+ size += (chunk as Buffer).length+ if (size > 5 * 1024 * 1024) throw new Error('body too large')+ chunks.push(chunk as Buffer)+ }+ return Buffer.concat(chunks).toString('utf8')+}++// ── Entry point ──────────────────────────────────────────────────────────────────────────────────++/** Starts on an ephemeral port when `port` is 0 — how the tests use it. */+export function start(port = Number(process.env.PORT ?? 4501)): Promise<ProviderServer> {+ const store = new TaskStore()+ const server = createProviderServer(store)+ return new Promise((resolve) => {+ server.listen(port, () => {+ const address = server.address()+ const actual = typeof address === 'object' && address ? address.port : port+ resolve({+ server,+ store,+ url: `http://127.0.0.1:${actual}`,+ close: () =>+ new Promise<void>((done) => {+ store.clear()+ server.close(() => done())+ }),+ })+ })+ })+}++// Only auto-start when run directly, so importing this module in a test does not bind a port.+if (process.argv[1] && import.meta.url === `file://${process.argv[1]}`) {+ void start().then(({ url }) => {+ console.log(`[reference-provider] listening on ${url}`)+ console.log(`[reference-provider] agent card: ${url}/.well-known/agent-card.json`)+ })+}diff --git a/reference-provider/src/store.ts b/reference-provider/src/store.tsnew file mode 100644index 000000000..d074edf49--- /dev/null+++ b/reference-provider/src/store.ts@@ -0,0 +1,86 @@+/**+ * In-memory task store.+ *+ * A real provider would persist this; the shape is what matters. Note that HISTORY LIVES HERE — the+ * Autonomous backend keeps no transcript for a provider harness, which is why `GetTask` and `ListTasks`+ * are Tier 0 rather than optional (HP-200, HP-201).+ */+import { isTerminal, TaskState, type Message, type Task, type TaskStateValue } from './types.js'++/** Deterministic ids: tests must not depend on a clock or a random source. */+let seq = 0+export const nextId = (prefix: string): string => `${prefix}-${++seq}`+export const resetIds = (): void => { seq = 0 }++export class TaskStore {+ private tasks = new Map<string, Task>()+ /** taskId → abort for an in-flight stream, so CancelTask can actually stop one (HP-103). */+ private inFlight = new Map<string, AbortController>()++ create(contextId: string, first: Message): Task {+ const task: Task = {+ id: nextId('task'),+ contextId,+ status: { state: TaskState.SUBMITTED },+ history: [first],+ metadata: { title: titleFrom(first) },+ }+ this.tasks.set(task.id, task)+ return task+ }++ get(taskId: string): Task | undefined {+ return this.tasks.get(taskId)+ }++ /** Newest first. `contextId` filters to one session (HP-200). */+ list(contextId?: string): Task[] {+ const all = [...this.tasks.values()]+ const filtered = contextId ? all.filter((t) => t.contextId === contextId) : all+ return filtered.reverse()+ }++ append(taskId: string, message: Message): void {+ this.tasks.get(taskId)?.history.push(message)+ }++ setState(taskId: string, state: TaskStateValue, message?: Message): void {+ const task = this.tasks.get(taskId)+ if (!task) return+ task.status = { state, ...(message ? { message } : {}) }+ }++ register(taskId: string, controller: AbortController): void {+ this.inFlight.set(taskId, controller)+ }++ release(taskId: string): void {+ this.inFlight.delete(taskId)+ }++ /**+ * Returns false when the task cannot be cancelled — already terminal, or unknown. The caller maps+ * that onto TASK_NOT_CANCELABLE / TASK_NOT_FOUND rather than pretending it worked.+ */+ cancel(taskId: string): boolean {+ const task = this.tasks.get(taskId)+ if (!task || isTerminal(task.status.state)) return false+ this.inFlight.get(taskId)?.abort()+ this.inFlight.delete(taskId)+ task.status = { state: TaskState.CANCELED }+ return true+ }++ clear(): void {+ for (const c of this.inFlight.values()) c.abort()+ this.inFlight.clear()+ this.tasks.clear()+ }+}++/** Session title = the first user message, truncated (spec §10.4). */+function titleFrom(message: Message): string {+ const text = message.parts.map((p) => p.text ?? '').join(' ').trim()+ if (!text) return 'Untitled'+ return text.length > 80 ? `${text.slice(0, 77)}…` : text+}diff --git a/reference-provider/src/types.ts b/reference-provider/src/types.tsnew file mode 100644index 000000000..26e8f6ff9--- /dev/null+++ b/reference-provider/src/types.ts@@ -0,0 +1,137 @@+/**+ * The subset of A2A this reference implementation uses, plus the `autonomous.ai/*` metadata defined by+ * `../spec/README.md`.+ *+ * Deliberately hand-written rather than generated: a partner reading this file should be able to see+ * the entire wire surface without installing anything.+ */++export const TaskState = {+ SUBMITTED: 'TASK_STATE_SUBMITTED',+ WORKING: 'TASK_STATE_WORKING',+ COMPLETED: 'TASK_STATE_COMPLETED',+ FAILED: 'TASK_STATE_FAILED',+ CANCELED: 'TASK_STATE_CANCELED',+ REJECTED: 'TASK_STATE_REJECTED',+ INPUT_REQUIRED: 'TASK_STATE_INPUT_REQUIRED',+ AUTH_REQUIRED: 'TASK_STATE_AUTH_REQUIRED',+} as const++export type TaskStateValue = (typeof TaskState)[keyof typeof TaskState]++/** States after which a task accepts no further messages (A2A: "terminal"). */+export const TERMINAL_STATES: readonly TaskStateValue[] = [+ TaskState.COMPLETED,+ TaskState.FAILED,+ TaskState.CANCELED,+ TaskState.REJECTED,+]++export const isTerminal = (s: TaskStateValue): boolean => TERMINAL_STATES.includes(s)++/** HP-210: every Autonomous-specific key is namespaced. Unknown keys in the namespace are ignored. */+export interface PartMetadata {+ 'autonomous.ai/kind'?:+ | 'user_message'+ | 'thinking_delta'+ | 'thinking_title'+ | 'text_delta'+ | 'tool_start'+ | 'tool_end'+ | 'context_compact'+ | 'done'+ 'autonomous.ai/thinkingId'?: string+ 'autonomous.ai/toolCallId'?: string+ 'autonomous.ai/parentToolCallId'?: string+ 'autonomous.ai/tool'?: string+ 'autonomous.ai/toolInput'?: unknown+ 'autonomous.ai/isError'?: boolean+ 'autonomous.ai/summary'?: string+ 'autonomous.ai/durationSeconds'?: number+ 'autonomous.ai/title'?: string+ 'autonomous.ai/compacted'?: {+ userMessages?: number+ assistantMessages?: number+ toolUses?: number+ contexts?: number+ }+}++export interface Part {+ text?: string+ /** base64 — HP-106 carries image attachments here with `mediaType`. */+ raw?: string+ filename?: string+ mediaType?: string+ url?: string+ metadata?: PartMetadata+}++export type Role = 'ROLE_USER' | 'ROLE_AGENT'++export interface Message {+ role: Role+ messageId: string+ parts: Part[]+ taskId?: string+ contextId?: string+}++export interface Artifact {+ artifactId: string+ name?: string+ parts: Part[]+}++export interface TaskStatus {+ state: TaskStateValue+ message?: Message+}++export interface Task {+ id: string+ contextId: string+ status: TaskStatus+ history: Message[]+ artifacts?: Artifact[]+ /** Not A2A core — used to derive a session title (spec §10.4). */+ metadata?: { title?: string }+}++export interface TaskStatusUpdateEvent {+ taskId: string+ contextId: string+ status: TaskStatus+ final?: boolean+}++export interface TaskArtifactUpdateEvent {+ taskId: string+ contextId: string+ artifact: Artifact+}++export interface JsonRpcRequest {+ jsonrpc: '2.0'+ id?: string | number | null+ method: string+ params?: Record<string, unknown>+}++export interface JsonRpcError {+ code: number+ message: string+ data?: unknown+}++/** JSON-RPC reserved codes plus the A2A-flavoured ones this implementation raises. */+export const RpcErrors = {+ PARSE_ERROR: { code: -32700, message: 'Parse error' },+ INVALID_REQUEST: { code: -32600, message: 'Invalid request' },+ METHOD_NOT_FOUND: { code: -32601, message: 'Method not found' },+ INVALID_PARAMS: { code: -32602, message: 'Invalid params' },+ INTERNAL: { code: -32603, message: 'Internal error' },+ UNAUTHENTICATED: { code: -32001, message: 'Unauthenticated' },+ TASK_NOT_FOUND: { code: -32002, message: 'Task not found' },+ TASK_NOT_CANCELABLE: { code: -32003, message: 'Task not cancelable' },+} as constdiff --git a/reference-provider/tsconfig.json b/reference-provider/tsconfig.jsonnew file mode 100644index 000000000..37aefca41--- /dev/null+++ b/reference-provider/tsconfig.json@@ -0,0 +1,18 @@+{+ "compilerOptions": {+ "target": "ES2023",+ "lib": ["ES2023"],+ "module": "NodeNext",+ "moduleResolution": "NodeNext",+ "esModuleInterop": true,+ "strict": true,+ "skipLibCheck": true,+ "outDir": "dist",+ "rootDir": "src",+ "declaration": false,+ "incremental": true,+ "tsBuildInfoFile": ".tsbuildinfo"+ },+ "include": ["src/**/*"],+ "exclude": ["node_modules", "dist", ".tsbuildinfo"]+}diff --git a/spec/README.md b/spec/README.mdnew file mode 100644index 000000000..5bdf99c19--- /dev/null+++ b/spec/README.md@@ -0,0 +1,512 @@+# Harness Provider Protocol (A2A profile)++**Status:** DRAFT. Not published. Expect edits once the reference provider (P2) and the backend client+(P5) exercise it.++**Audience:** a third party who wants their agent platform to appear as a `provider` harness in the+Autonomous product — reachable from the web app and from the Harness device.++**What this document is:** a *profile* of the Agent2Agent (A2A) protocol, not a new protocol. If you+already run a conformant A2A agent, most of Tier 0 is already done. Everything Autonomous-specific is+expressed as declared A2A extensions or as metadata on standard objects — nothing here forks A2A.++**Related:** `onboarding.md` in this folder — what to do once your endpoint conforms.+The `reference-provider/` and `example-provider/` packages in this repository are working+implementations of everything below.++---++## 1. Target revision++This profile targets **A2A v1.0.1** (`github.com/a2aproject/A2A`, released 2026-05-28), the current+stable release under Linux Foundation governance.++A2A v1.0 ships official SDKs in **Python, JavaScript, Java, Go and .NET**. Autonomous therefore+publishes **no SDK of its own** — use the one for your stack. What Autonomous publishes instead is+this profile, a reference implementation, and a conformance runner you can point at your own endpoint.++> **HP-001** An implementation MUST declare its A2A protocol support through its Agent Card. Clients+> MUST NOT infer capability from anything else — the card is the single source of truth.++> **HP-002** A provider MUST implement A2A v1.0 or later. Autonomous pins to v1.0.1 and will state a+> new pin, with a deprecation window, before requiring anything newer.++> **HP-004** A provider SHOULD serve a **signed Agent Card** (A2A v1.0), so Autonomous can verify the+> card was issued by the domain owner rather than merely served from it. Because the card is this+> profile's single source of truth for capability (HP-001), signing it is the one control that makes+> that trust verifiable. Expect this to become a MUST in a future revision; providers onboarding now+> should plan for it.++### Canonical base++Everything this profile publishes lives under **`https://harness.autonomous.ai/api/a2a/`**:++| Path | What |+|---|---|+| `ext/<name>` | extension identifier URIs, used verbatim in `AgentCard.extensions` |+| `schema/<name>.json` | the JSON Schemas accompanying this document |++> **HP-003** Extension URIs are opaque identifiers and MUST be sent byte-for-byte as written in §8.+> A provider MUST NOT normalise, shorten, or re-host them; a mismatched URI means the extension is+> undeclared (HP-022).++Note that the `Part.metadata` key prefix is `autonomous.ai/` — a short reverse-DNS **key namespace**,+deliberately not a URL. It appears on every part of every streamed event, and the Harness device+renders under a tight frame budget, so the prefix is kept short on purpose.++---++## 2. Object mapping++| Autonomous concept | A2A concept | Notes |+|---|---|---|+| **harness** | one A2A agent endpoint | The credential the user supplies selects *which* workspace/tenant on the provider side |+| **project** (web calls it a project; the wire calls it an agent) | `AgentCard.skills[]` entry | Read-only in Tier 0 |+| **session** (a chat thread) | `contextId` | Starting a new chat mints a new `contextId`; no call is required |+| **turn** (one user message until the agent stops) | `taskId` | Task lifecycle *is* turn lifecycle |+| **turn start / end** | `TASK_STATE_WORKING` → `COMPLETED` / `FAILED` / `CANCELED` | |+| **permission prompt / question to the user** | `TASK_STATE_INPUT_REQUIRED` | Native A2A. No extension |+| **credential rejected** | `TASK_STATE_AUTH_REQUIRED` | Distinguishable from an outage, so the UI can say "re-enter credential" |++---++## 3. Transport and authentication++> **HP-010** The endpoint MUST be reachable over HTTPS at a stable, publicly resolvable URL. The URL+> is registered by Autonomous, not supplied by end users.++> **HP-011** The provider MUST declare its authentication requirement using standard A2A+> `securitySchemes`. `APIKey` and `HTTPAuth` (bearer) are the schemes Autonomous supports today.+> OAuth2 and OpenIdConnect are reserved for a later revision and MUST NOT be relied on.++> **HP-012** The credential is supplied by the end user in the Autonomous web app and presented by the+> Autonomous backend on every request. The provider MUST treat it as identifying **one tenant/user**+> on its side and MUST NOT grant it access beyond that tenant.++> **HP-013** A rejected credential MUST surface as `TASK_STATE_AUTH_REQUIRED` on a task, or as the+> A2A-standard authentication error on a non-task call — never as a generic failure. The product+> distinguishes "your credential is wrong" from "the provider is down", and cannot do so without this.++---++## 4. Agent Card (HP-0xx)++> **HP-020** The provider MUST serve an Agent Card at `/.well-known/agent-card.json`.++> **HP-021** `capabilities.streaming` MUST be `true`. A non-streaming provider is not usable: the+> product renders assistant output token by token.++> **HP-022** Every Autonomous extension the provider implements MUST be listed in+> `AgentCard.extensions` by its exact URI (§8). An extension that is implemented but undeclared MUST+> be treated by clients as absent.++> **HP-023** `skills[]` is the project list. Each skill's `name` and `description` are shown to the+> user. A provider with no meaningful project concept SHOULD expose exactly one skill representing the+> whole workspace.++Schema for the extension entries: `schema/agent-card.ext.json`.++---++## 5. Messaging (HP-1xx)++> **HP-100** The provider MUST implement `SendStreamingMessage` and return Server-Sent Events.++> **HP-101** A message that begins a new chat carries a fresh `contextId` and no `taskId`. A follow-up+> within the same chat carries the existing `contextId`.++> **HP-102** The provider MUST emit a terminal task state on every stream. A stream that ends without+> one is a protocol violation; clients will treat the turn as failed.++> **HP-103** The provider MUST implement `CancelTask`. After a successful cancel, the corresponding+> SSE stream MUST terminate and the task MUST report `TASK_STATE_CANCELED`.++> **HP-104** When the agent needs an answer from the user (a permission prompt, a clarifying+> question), the provider MUST enter `TASK_STATE_INPUT_REQUIRED` and MUST accept a subsequent Message+> carrying the same `taskId` as the answer.++> **HP-105** Assistant output MUST be delivered as `TaskStatusUpdateEvent` messages containing `Part`+> objects. Files produced by the turn SHOULD be delivered as `Artifact` via+> `TaskArtifactUpdateEvent`.++> **HP-106** A user message MAY carry image attachments. These travel as standard A2A `Part` objects+> using `raw` (base64) with `mediaType`, alongside the text part — no Autonomous extension is+> involved. A provider that cannot accept images MUST fail the task with a clear message rather than+> silently discarding them; silent loss reads to the user as the agent ignoring what they sent.++---++## 6. History (HP-2xx)++Chat history lives **entirely on the provider side**. Autonomous stores no transcript for a `provider`+harness — there is no database to fall back on. This is why the two methods below are required rather+than recommended: without them, a page refresh loses the conversation.++> **HP-200** The provider MUST implement `ListTasks`, and MUST support grouping/filtering by+> `contextId`. This backs the session list.++> **HP-201** The provider MUST implement `GetTask`, returning the full message history of the task.+> This backs the transcript view.++> **HP-202** For v1 the provider MUST return the complete transcript in a single `GetTask` response.+> Pagination is **not** part of this revision — see §10.1.++> **HP-203** A transcript exceeding **5 MB** serialized MAY be truncated by the provider, which MUST+> then mark the response so the client can tell the user the view is partial. Silent truncation is a+> violation.++---++## 7. Event vocabulary on `Part.metadata`++A2A core has no representation for thinking, tool calls, or the fine structure the product renders.+This profile defines a namespace on `Part.metadata`.++> **HP-210** Autonomous-specific metadata MUST be namespaced under keys beginning `autonomous.ai/`.+> Clients MUST ignore unknown keys in that namespace rather than failing.++> **HP-211** A provider that emits no `autonomous.ai/*` metadata is conformant. Its output renders as+> plain assistant text. Richness is opt-in.++The recognised event kinds — declared here **independently** of any Autonomous internal type, so that+this contract does not inherit an internal shape:++| `autonomous.ai/kind` | Meaning |+|---|---|+| `user_message` | the user's own turn, replayed in history |+| `thinking_delta` | a chunk of reasoning text |+| `thinking_title` | a short label for a reasoning block |+| `text_delta` | a chunk of assistant output |+| `tool_start` | a tool invocation began |+| `tool_end` | a tool invocation finished (with output, error flag, summary) |+| `context_compact` | the provider compacted its own context |+| `done` | the turn's final result text |++Turn lifecycle (`turn_started` / `turn_ended`) is **not** metadata — it is derived from A2A task+states, per HP-102.++Schema: `schema/part-metadata.json`.++---++## 8. Extensions (HP-3xx)++Each extension is optional and MUST be declared per HP-022. A client hides the corresponding feature+entirely when an extension is absent, rather than offering a control that fails.++| URI | Adds |+|---|---|+| `https://harness.autonomous.ai/api/a2a/ext/workspace-files` | browse and read files in a project |+| `https://harness.autonomous.ai/api/a2a/ext/workspace-write` | create / rename / delete projects and sessions |+| `https://harness.autonomous.ai/api/a2a/ext/session-recap` | short persisted per-turn summaries (used by the device) |+| `https://harness.autonomous.ai/api/a2a/ext/voice` | provider-side routing of a spoken task to a project |++### 8.1 Method naming++Extension methods travel on the **same JSON-RPC endpoint** as A2A core — there is no second URL.++> **HP-310** Extension methods MUST be named `autonomous.<Verb>`. The prefix keeps them from ever+> colliding with a current or future A2A core method name, and makes it obvious in a log which calls+> are profile extensions rather than standard A2A.++> **HP-311** A provider MUST reject a call to an extension method it has not declared, with JSON-RPC+> `-32601` (method not found). Answering a method the Agent Card does not advertise contradicts+> HP-022 and leaves the client unable to trust the card.++### 8.2 The extensions++> **HP-300** `workspace-files` — read-only file access, scoped to a project.+> Methods: **`autonomous.ListFiles`** (`{ projectId, path? }` → `{ files }`) and+> **`autonomous.ReadFile`** (`{ projectId, path }` → `{ path, content, truncated? }`).+> Schema: `schema/ext-workspace-files.json`.++> **HP-301** `workspace-write` — mutations on projects and sessions. Methods:+> **`autonomous.CreateProject`**, **`autonomous.RenameProject`**, **`autonomous.DeleteProject`**,+> **`autonomous.SetSessionTitle`**, **`autonomous.DeleteSession`**.+> `AgentCard.extensions[].params` declares which halves are supported: `{ projects: bool, sessions: bool }`.+> A provider declaring this extension MUST enforce that every operation stays inside the tenant+> identified by the credential. Schema: `schema/ext-workspace-write.json`.++> **HP-302** `session-recap` — short persisted per-turn summaries.+> Method: **`autonomous.GetRecap`** (`{ projectId, n? }` → `{ projectId, entries }`).+> Used to restore the device's tiles after a reboot; the device shows nothing rather than stale text+> when this is absent. An empty `entries` array is correct before any turn has been summarised.+> Schema: `schema/ext-session-recap.json`.++> **HP-303** `voice` — the provider chooses which project a transcribed spoken task belongs to.+> Method: **`autonomous.RouteVoice`** (`{ transcript, candidateProjectIds? }` → `{ projectId, confidence?, reason? }`).+> **Optional and rarely needed**: Autonomous can route from `skills[]` names and descriptions without+> provider help, and does so by default. Declare this only to override that routing with your own.+> A `projectId` of `null` declines and hands routing back to Autonomous.+> Schema: `schema/ext-voice.json`.++---++## 9. Out of scope++Deliberate omissions. Listed so their absence is a decision on record and not a gap:++| Not in this profile | Why |+|---|---|+| Model / effort selection | The provider owns its own model configuration. Reaching into it from the Autonomous UI would fight the provider's own surface and expose a control we cannot honour consistently. No model picker is shown for `provider` harnesses |+| Agent login flows | The provider owns authentication. The credential field in the Autonomous UI is the entire story |+| Explicit context compaction | The provider manages its own context window. Autonomous never asks a provider to compact; the `context_compact` event kind (§7) exists only so a provider can *report* that it did |+| End-to-end encryption | `provider` harnesses are **not** end-to-end encrypted. Plaintext already originates at the provider, so E2EE between the user and the provider would hide content from Autonomous, not from the provider. Users are shown this explicitly. Providers are onboarded under a data-processing agreement, which is the control that replaces the cryptographic one |++Additionally, a set of frames exists on the Autonomous data plane that **never crosses this boundary**:+live speaking-presence indicators, client-count bookkeeping, harness metadata and revocation, and+device pairing. These are handled entirely inside Autonomous. A provider neither sends nor receives+them, and MUST NOT attempt to.++> **HP-400** A provider MUST ignore any frame it does not recognise rather than failing the stream.+> Autonomous replies `UNSUPPORTED` on behalf of a provider for any capability the Agent Card does not+> declare, so an undeclared feature never reaches the provider at all.++---++## 10. Field projections and resolved gaps++The Autonomous client requires fields A2A does not carry. Each is resolved here so implementers do not+have to guess. **Most are synthesised by the Autonomous backend — the provider burden is small.**++### 10.1 Transcript pagination++The Autonomous client can request a windowed transcript (a limit plus a cursor). A2A `GetTask` has no+equivalent.++**Resolution for v1:** the provider returns the full transcript (HP-202); the backend serves windowed+requests from that response and reports no further pages. A paging extension is deferred until a real+provider hits the 5 MB ceiling of HP-203. Recorded as a known limitation, not an oversight.++### 10.2 `engine`++The client models an engine as one of eight local CLIs. A provider harness is none of them.++**Resolution:** the field is **omitted** for provider-backed projects. The client treats an absent+engine as provider-backed and skips every engine-specific branch. Providers MUST NOT invent a value.++### 10.3 Skill → project projection++| Client field | Source |+|---|---|+| `id` | the skill's id |+| `name`, `description` | the skill's `name`, `description` |+| `userId` | **synthesised** by the backend — the Autonomous owner of the harness |+| `status` | **synthesised** — constant `active` |+| `createdAt`, `updatedAt` | **synthesised** — the harness's own timestamps unless the skill carries better |+| `engine` | omitted (§10.2) |++### 10.4 Task → session-list item projection++| Client field | Source |+|---|---|+| `id` | `contextId` |+| `title` | task metadata title, else the first user message truncated |+| `timestamp`, `lastActivity` | task timestamps |+| `messageCount` | best-effort; **omitted when unknown**, and the client hides the count rather than showing zero |+| `participants` | not modelled by A2A; the client omits it |++> **HP-220** A provider MUST NOT fabricate `messageCount` or similar statistics. Omission is correct;+> a wrong number is worse than a missing one.++---++## 11. Security (HP-9xx)++> **HP-900** All traffic MUST be over TLS.++> **HP-901** Everything a provider sends is **untrusted input** to the Autonomous web UI and to the+> physical device screen. The Autonomous backend validates and allowlists every frame crossing this+> boundary; a provider MUST NOT rely on being able to inject arbitrary client-side structures.+> Non-conforming frames are dropped and logged, and a stream that repeats the violation is closed.++> **HP-902** Providers are rate limited per harness. Sustained excess closes the stream.++> **HP-903** A provider MUST NOT log or transmit the supplied credential beyond what is required to+> authenticate the request.++---++## 12. Versioning++This document is a **compatibility contract, not ordinary prose.** The same discipline the Autonomous+codebase applies to its own launcher/daemon contract applies here.++> **HP-910** Optional fields MAY be added to a published revision.++> **HP-911** A published field MUST NOT be renamed, removed, retyped, or reinterpreted. Any of those+> requires a new revision.++> **HP-912** When a new revision exists, providers and clients MUST be able to negotiate through the+> Agent Card. A revision MUST be served alongside its predecessor for a deprecation window; removing+> support without one breaks deployed integrations.++---++## Appendix A — Clause index++| Range | Area |+|---|---|+| HP-001 … HP-004 | Target revision and canonical base |+| HP-010 … HP-013 | Transport and authentication |+| HP-020 … HP-023 | Agent Card |+| HP-100 … HP-106 | Messaging |+| HP-200 … HP-203 | History |+| HP-210 … HP-220 | Event vocabulary and projections |+| HP-300 … HP-311 | Extensions |+| HP-400 | Unknown frames |+| HP-900 … HP-903 | Security |+| HP-910 … HP-912 | Versioning |++Tier 0 (required for any provider) is: HP-003, HP-010–013, HP-020–023, HP-100–105, HP-200–203, HP-900–903,+HP-910–912. Everything in HP-3xx is optional.++## Appendix B — Conformance++The conformance suite asserts one check per clause ID and names the failing ID in its output, so a red+result points at a section of this document rather than at a symptom. See phase 6 of the+implementation plan.++## Appendix C — Coverage of the Autonomous client surface++Every operation the Autonomous client can issue, and where it lands in this profile. This table is the+audit artifact: **an entry that is neither Tier 0, nor an extension, nor explicitly out of scope is a+gap in the spec.** Re-run this audit whenever the client gains an operation.++| Client operation | Disposition |+|---|---|+| `message` | Tier 0 — HP-100 |+| `cancel` | Tier 0 — HP-103 |+| `permission_response` | Tier 0 — HP-104 (answer to `INPUT_REQUIRED`) |+| `question_response` | Tier 0 — HP-104 |+| `new_chat` | Tier 0 — no call; mint a fresh `contextId` (§2) |+| `agents_list` | Tier 0 — `AgentCard.skills` (HP-023) |+| `sessions_list` | Tier 0 — `ListTasks` (HP-200) |+| `session_get` | Tier 0 — `GetTask` (HP-201) |+| `agent_files` | Extension — `workspace-files` (HP-300) |+| `agent_read_file` | Extension — `workspace-files` (HP-300) |+| `agent_create` | Extension — `workspace-write` (HP-301) |+| `agent_update` (rename) | Extension — `workspace-write` (HP-301) |+| `agent_delete` | Extension — `workspace-write` (HP-301) |+| `session_update_title` | Extension — `workspace-write` (HP-301) |+| `session_delete` | Extension — `workspace-write` (HP-301) |+| `agent_recent` | Extension — `session-recap` (HP-302) |+| `voice_route` | Extension — `voice` (HP-303); Autonomous routes from `skills[]` by default |+| `agent_update` (model) | **Out of scope** — §9, provider owns model configuration |+| `models_list` | **Out of scope** — §9 |+| `compact` | **Out of scope** — §9, provider owns its context window |+| `claude_login_start` / `_submit` / `_status` | **Out of scope** — §9, provider owns authentication |+| `e2ee_pairings_list` / `_pairing_unpair` / `_pairings_unpair_all` / `e2ee_browser_link_create` | **Out of scope** — §9, no E2EE for `provider` |+| `speaking` | **Never crosses this boundary** — ephemeral presence, fanned out inside Autonomous |+| `__clients`, `harness_meta`, `harness_revoked`, `device_e2ee_pair` | **Never crosses this boundary** — Autonomous-internal control frames |++### Client-operation coverage — how to re-run this audit++Autonomous re-runs this audit whenever its client gains an operation: every one must appear above as+Tier 0, as a named extension, or as explicitly out of scope. An operation absent from this table is an+unresolved gap, not an implicit "no" — if you find one, say so rather than guessing.++### Event-kind coverage++The eight kinds in §7 (`user_message`, `thinking_delta`, `thinking_title`, `text_delta`, `tool_start`,+`tool_end`, `context_compact`, `done`) cover the client's full render vocabulary. Turn lifecycle+(`turn_started` / `turn_ended`) is carried by A2A task states per HP-102 and is deliberately not a+metadata kind. Nothing in the client's vocabulary is unrepresented.++---++## Appendix D — Worked example++One complete turn, end to end. Every field the Autonomous client needs is derivable from what appears+here; this example exists to prove that, and doubles as the shortest path to understanding the+profile.++**1. Discovery.** `GET https://agent.example.com/.well-known/agent-card.json`++```json+{+ "name": "Example Marketing Agent",+ "description": "Answers questions about ad spend and builds reporting queries.",+ "version": "1.0.0",+ "capabilities": { "streaming": true },+ "securitySchemes": { "apiKey": { "type": "apiKey", "in": "header", "name": "x-api-key" } },+ "skills": [+ { "id": "acme-reporting", "name": "Acme reporting", "description": "Acme's ad accounts" }+ ],+ "extensions": [+ { "uri": "https://harness.autonomous.ai/api/a2a/ext/session-recap" }+ ]+}+```++The client now shows one project ("Acme reporting"). No file browser, no rename — those extensions+are absent. No model picker either; that is out of scope for every provider (§9).++**2. The user types a message.** Autonomous calls `SendStreamingMessage` with the user's credential in+the declared header, a fresh `contextId`, and no `taskId` (a new chat):++```json+{+ "message": {+ "role": "ROLE_USER",+ "messageId": "m-1",+ "contextId": "ctx-91af",+ "parts": [{ "text": "did acme blow through budget this week?" }]+ }+}+```++**3. The provider streams SSE.** Abridged to one event per kind:++```+event: status-update+data: {"taskId":"task-77","contextId":"ctx-91af","status":{"state":"TASK_STATE_WORKING"}}++event: status-update+data: {"taskId":"task-77","status":{"state":"TASK_STATE_WORKING","message":{"role":"ROLE_AGENT",+ "parts":[{"text":"Checking pacing…","metadata":{"autonomous.ai/kind":"thinking_delta",+ "autonomous.ai/thinkingId":"t1"}}]}}}++event: status-update+data: {"taskId":"task-77","status":{"state":"TASK_STATE_WORKING","message":{"role":"ROLE_AGENT",+ "parts":[{"text":"","metadata":{"autonomous.ai/kind":"tool_start",+ "autonomous.ai/toolCallId":"c7","autonomous.ai/tool":"query_spend",+ "autonomous.ai/toolInput":{"account":"acme","window":"7d"}}}]}}}++event: status-update+data: {"taskId":"task-77","status":{"state":"TASK_STATE_WORKING","message":{"role":"ROLE_AGENT",+ "parts":[{"text":"7 rows","metadata":{"autonomous.ai/kind":"tool_end",+ "autonomous.ai/toolCallId":"c7","autonomous.ai/tool":"query_spend",+ "autonomous.ai/isError":false,"autonomous.ai/summary":"Returned 7 rows",+ "autonomous.ai/durationSeconds":1.4}}]}}}++event: status-update+data: {"taskId":"task-77","status":{"state":"TASK_STATE_WORKING","message":{"role":"ROLE_AGENT",+ "parts":[{"text":"Acme is at 118% of pacing.","metadata":{"autonomous.ai/kind":"text_delta"}}]}}}++event: status-update+data: {"taskId":"task-77","status":{"state":"TASK_STATE_COMPLETED"},"final":true}+```++A provider that emitted only the two `text_delta`-shaped parts with **no** metadata at all would also+be conformant (HP-211) — the turn would simply render as plain text.++**4. What the client reconstructs.** `TASK_STATE_WORKING` opens the turn and the terminal state closes+it (HP-102); no metadata kind is involved. Reloading the page calls `GetTask("task-77")`, and the+same parts rebuild the transcript:++| Client field | Derived from |+|---|---|+| session id | `contextId` = `ctx-91af` |+| title | task metadata title, else the first user message truncated (§10.4) |+| timestamp | task timestamps |+| events | the `Part` sequence above, keyed by `autonomous.ai/kind` |+| status | terminal task state → `idle`; `TASK_STATE_FAILED` → `error` |+| engine | omitted (§10.2) |+| messageCount | not sent; the client hides the count rather than showing zero (HP-220) |+| hasMore / cursors | absent — v1 returns the whole transcript (HP-202) |++**5. If the agent needs an answer.** Instead of completing, the provider emits+`TASK_STATE_INPUT_REQUIRED` with a question in the message. Autonomous renders it, and the user's+answer returns as a new Message carrying **the same `taskId`** (HP-104). The task then resumes and+completes as above.diff --git a/spec/onboarding.md b/spec/onboarding.mdnew file mode 100644index 000000000..5009d08e7--- /dev/null+++ b/spec/onboarding.md@@ -0,0 +1,93 @@+# Getting listed++What to do once your endpoint implements the profile in `README.md`, and what to expect from us.++---++## 1. What you need first++| | |+|---|---|+| A public HTTPS endpoint | HP-010. Not an IP address, not a tunnel, not "we'll expose it later" |+| An Agent Card at `/.well-known/agent-card.json` | HP-020 |+| A test credential | So the checks below run against a real tenant rather than a stub |+| A named technical contact | Your endpoint backs every harness connected to it; when it goes down, they all go down at once |++**You do not need an SDK from us.** A2A v1.0 ships official SDKs for Python, JavaScript, Java, Go and+.NET — use the one for your stack. What this repository gives you instead is the contract, a working+reference implementation, and a runner that tells you when you are done.++---++## 2. Prove it yourself++```bash+cd reference-provider && npm install+npm run conformance -- --url https://your-endpoint --key <test credential> \+ --bad-key <deliberately invalid> --ask-phrase "<a prompt that makes it ask>"+```++**Zero failures is the bar.** Warnings and skips are expected, and each prints its reason.++The two extra flags unlock three more clauses that need knowledge only you have: a credential you know+to be invalid (HP-013), and a prompt that reliably makes your agent ask the user something+(HP-103, HP-104).++If you are debugging your implementation by emailing us, something has gone wrong — the runner is+meant to answer that question without us.++### Read the skips, do not just count them++Four clauses cannot be verified from outside and become a written question instead:++| Clause | What we will ask you |+|---|---|+| **HP-012** | How a credential is scoped — one credential must not reach another tenant's data |+| **HP-203** | What happens to a transcript over the size ceiling: marked, or silently truncated |+| **HP-220** | Whether any statistic is estimated rather than measured — omission is correct, a wrong number is not |+| **HP-903** | Whether the credential we send is written to logs or forwarded anywhere |++---++## 3. Send us++- Your endpoint URL and the conformance output.+- Written answers to the four questions above.+- Your technical contact and an escalation path.++We review the endpoint's TLS configuration, its declared `securitySchemes`, and how it handles the+credential. Expect a conversation about data handling before anything is switched on: a provider+harness is **not end-to-end encrypted** — the plaintext originates on your side, and users are told+so plainly in our UI.++We will also ask you to plan for a **signed Agent Card** (HP-004). The card is this profile's single+source of truth for capability, so signing it is what makes that trust verifiable.++---++## 4. What happens next++1. We add your endpoint to our provider registry, initially in staging.+2. We soak it against real traffic on a small number of harnesses — a full turn, cancellation, an+ `INPUT_REQUIRED` round trip, a page refresh rebuilding the transcript, your endpoint going away and+ coming back, and a revoked credential reporting as *re-enter credential* rather than an outage.+3. It becomes selectable in the product.++"It worked once" is not a soak. One outage on your side takes down every harness behind it+simultaneously, and that blast radius is why this step exists.++---++## 5. If you stop++Tell us and we will stop offering your endpoint to new harnesses while existing ones keep working,+notify their owners with a date, and delete the stored credentials at the end of it. Existing+harnesses are then marked with a specific reason — never a generic failure.++---++## Questions++Open an issue at <https://github.com/autonomous-ai/harness-provider/issues>. Anything touching+credentials or a vulnerability goes to the address in `SECURITY.md` instead — not to the issue+tracker.diff --git a/spec/schema/agent-card.ext.json b/spec/schema/agent-card.ext.jsonnew file mode 100644index 000000000..9aa7b9e38--- /dev/null+++ b/spec/schema/agent-card.ext.json@@ -0,0 +1,78 @@+{+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "$id": "https://harness.autonomous.ai/api/a2a/schema/agent-card.ext.json",+ "title": "Autonomous extension entries in an A2A Agent Card",+ "description": "Constrains the `extensions` array of a standard A2A AgentCard to the URIs this profile recognises. Entries with other URIs are permitted and ignored. See HP-022 in harness-provider-a2a.md.",+ "type": "object",+ "properties": {+ "extensions": {+ "type": "array",+ "items": { "$ref": "#/$defs/extensionEntry" }+ }+ },+ "$defs": {+ "extensionEntry": {+ "type": "object",+ "required": ["uri"],+ "properties": {+ "uri": { "type": "string", "format": "uri" },+ "description": { "type": "string" },+ "required": {+ "type": "boolean",+ "description": "A2A-standard field. Autonomous extensions are never required of the client; a provider MUST NOT set this to true for a https://harness.autonomous.ai/api/a2a/ext/* URI."+ },+ "params": { "type": "object" }+ },+ "allOf": [+ {+ "if": {+ "properties": {+ "uri": { "enum": ["https://harness.autonomous.ai/api/a2a/ext/workspace-write"] }+ },+ "required": ["uri"]+ },+ "then": {+ "properties": {+ "params": {+ "type": "object",+ "properties": {+ "projects": {+ "type": "boolean",+ "description": "Provider accepts project create/rename/delete. Default false."+ },+ "sessions": {+ "type": "boolean",+ "description": "Provider accepts session title-change/delete. Default false."+ }+ }+ }+ }+ }+ }+ ]+ },+ "recognisedUris": {+ "enum": [+ "https://harness.autonomous.ai/api/a2a/ext/workspace-files",+ "https://harness.autonomous.ai/api/a2a/ext/workspace-write",+ "https://harness.autonomous.ai/api/a2a/ext/session-recap",+ "https://harness.autonomous.ai/api/a2a/ext/voice"+ ]+ }+ },+ "examples": [+ {+ "extensions": [+ {+ "uri": "https://harness.autonomous.ai/api/a2a/ext/workspace-files",+ "description": "Browse and read files in a project."+ },+ {+ "uri": "https://harness.autonomous.ai/api/a2a/ext/workspace-write",+ "params": { "projects": false, "sessions": true }+ }+ ]+ },+ { "extensions": [] }+ ]+}diff --git a/spec/schema/ext-session-recap.json b/spec/schema/ext-session-recap.jsonnew file mode 100644index 000000000..df9ac8708--- /dev/null+++ b/spec/schema/ext-session-recap.json@@ -0,0 +1,68 @@+{+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "$id": "https://harness.autonomous.ai/api/a2a/ext/session-recap",+ "title": "Extension: session-recap",+ "description": "Short persisted per-turn summaries for a project. The Harness device restores its tiles from these after a reboot; without the extension the device shows nothing rather than stale text (HP-302). Each $defs entry carries its own examples.",+ "type": "object",+ "$defs": {+ "recapRequest": {+ "type": "object",+ "required": ["projectId"],+ "properties": {+ "projectId": { "type": "string" },+ "n": {+ "type": "integer",+ "minimum": 1,+ "maximum": 5,+ "default": 2,+ "description": "How many recent turns to return, most recent first."+ }+ },+ "examples": [+ { "projectId": "acme-reporting", "n": 2 },+ { "projectId": "acme-reporting" }+ ]+ },+ "recapEntry": {+ "type": "object",+ "required": ["recap"],+ "properties": {+ "recap": {+ "type": "string",+ "maxLength": 200,+ "description": "Headline-style summary of what the turn accomplished. Kept short because it renders on a small round display readable across a room."+ },+ "body": { "type": "string", "maxLength": 2000 },+ "contextId": { "type": "string" },+ "taskId": { "type": "string" },+ "timestamp": { "type": "string", "format": "date-time" }+ },+ "examples": [+ { "recap": "Flagged Acme overspend at 118% of pacing", "contextId": "ctx-91af", "timestamp": "2026-08-03T09:14:00Z" },+ { "recap": "Built weekly budget alert query" }+ ]+ },+ "recapResponse": {+ "type": "object",+ "required": ["projectId", "entries"],+ "properties": {+ "projectId": { "type": "string" },+ "entries": {+ "type": "array",+ "items": { "$ref": "#/$defs/recapEntry" },+ "description": "Empty until at least one turn has been summarised. An empty array is correct; fabricated or full-text entries are not."+ }+ },+ "examples": [+ {+ "projectId": "acme-reporting",+ "entries": [+ { "recap": "Flagged Acme overspend at 118% of pacing", "contextId": "ctx-91af", "timestamp": "2026-08-03T09:14:00Z" },+ { "recap": "Built weekly budget alert query", "contextId": "ctx-77bc" }+ ]+ },+ { "projectId": "acme-reporting", "entries": [] }+ ]+ }+ }+}diff --git a/spec/schema/ext-voice.json b/spec/schema/ext-voice.jsonnew file mode 100644index 000000000..83123dc3a--- /dev/null+++ b/spec/schema/ext-voice.json@@ -0,0 +1,45 @@+{+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "$id": "https://harness.autonomous.ai/api/a2a/ext/voice",+ "title": "Extension: voice",+ "description": "Provider-side routing of a transcribed spoken task to one of its projects. RARELY NEEDED (HP-303): Autonomous routes from AgentCard skills[] names and descriptions by default. Declare this only to override that routing with provider-side knowledge the card cannot express. Each $defs entry carries its own examples.",+ "type": "object",+ "$defs": {+ "routeRequest": {+ "type": "object",+ "required": ["transcript"],+ "properties": {+ "transcript": {+ "type": "string",+ "minLength": 1,+ "description": "What the user said, already transcribed by Autonomous."+ },+ "candidateProjectIds": {+ "type": "array",+ "items": { "type": "string" },+ "description": "Optional shortlist. When present the provider MUST choose from it or decline."+ }+ },+ "examples": [+ { "transcript": "check whether acme blew through budget this week" },+ { "transcript": "pull the weekly numbers", "candidateProjectIds": ["acme-reporting", "globex-reporting"] }+ ]+ },+ "routeResponse": {+ "type": "object",+ "required": ["projectId"],+ "properties": {+ "projectId": {+ "type": ["string", "null"],+ "description": "The chosen project, or null to decline and let Autonomous fall back to its own routing."+ },+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 },+ "reason": { "type": "string", "maxLength": 500 }+ },+ "examples": [+ { "projectId": "acme-reporting", "confidence": 0.86, "reason": "Names the Acme account and asks about pacing." },+ { "projectId": null, "reason": "No project clearly matches." }+ ]+ }+ }+}diff --git a/spec/schema/ext-workspace-files.json b/spec/schema/ext-workspace-files.jsonnew file mode 100644index 000000000..4241fe5cd--- /dev/null+++ b/spec/schema/ext-workspace-files.json@@ -0,0 +1,77 @@+{+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "$id": "https://harness.autonomous.ai/api/a2a/ext/workspace-files",+ "title": "Extension: workspace-files",+ "description": "Read-only file browsing for a project. Declared in AgentCard.extensions (HP-300). Absent means the client hides the file browser entirely. Each $defs entry carries its own examples so they validate against the shape they illustrate, not against a permissive root.",+ "type": "object",+ "$defs": {+ "fileNode": {+ "type": "object",+ "required": ["name", "type"],+ "properties": {+ "name": { "type": "string" },+ "type": { "enum": ["file", "dir"] },+ "size": { "type": "integer", "minimum": 0 },+ "children": {+ "type": "array",+ "items": { "$ref": "#/$defs/fileNode" },+ "description": "Present on directories. A provider MAY return a shallow tree and populate children lazily on a subsequent listFiles call scoped to a path."+ }+ },+ "examples": [+ { "name": "README.md", "type": "file", "size": 240 },+ { "name": "reports", "type": "dir", "children": [{ "name": "weekly.sql", "type": "file", "size": 812 }] }+ ]+ },+ "listFilesRequest": {+ "type": "object",+ "required": ["projectId"],+ "properties": {+ "projectId": { "type": "string" },+ "path": { "type": "string", "description": "Omit for the project root." }+ },+ "examples": [+ { "projectId": "acme-reporting" },+ { "projectId": "acme-reporting", "path": "reports" }+ ]+ },+ "listFilesResponse": {+ "type": "object",+ "required": ["files"],+ "properties": {+ "files": { "type": "array", "items": { "$ref": "#/$defs/fileNode" } }+ },+ "examples": [+ {+ "files": [+ { "name": "reports", "type": "dir", "children": [{ "name": "weekly.sql", "type": "file", "size": 812 }] },+ { "name": "README.md", "type": "file", "size": 240 }+ ]+ },+ { "files": [] }+ ]+ },+ "readFileRequest": {+ "type": "object",+ "required": ["projectId", "path"],+ "properties": {+ "projectId": { "type": "string" },+ "path": { "type": "string" }+ },+ "examples": [{ "projectId": "acme-reporting", "path": "README.md" }]+ },+ "readFileResponse": {+ "type": "object",+ "required": ["path", "content"],+ "properties": {+ "path": { "type": "string" },+ "content": { "type": "string", "description": "UTF-8 text. Binary files SHOULD be refused rather than returned base64 in this revision." },+ "truncated": { "type": "boolean", "description": "Set when the provider capped the response. Silent truncation is a violation (mirrors HP-203)." }+ },+ "examples": [+ { "path": "README.md", "content": "# Acme reporting\n" },+ { "path": "reports/weekly.sql", "content": "SELECT 1", "truncated": true }+ ]+ }+ }+}diff --git a/spec/schema/ext-workspace-write.json b/spec/schema/ext-workspace-write.jsonnew file mode 100644index 000000000..5965a66dd--- /dev/null+++ b/spec/schema/ext-workspace-write.json@@ -0,0 +1,74 @@+{+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "$id": "https://harness.autonomous.ai/api/a2a/ext/workspace-write",+ "title": "Extension: workspace-write",+ "description": "Create, rename and delete projects and sessions. Declared in AgentCard.extensions with params.projects / params.sessions indicating which halves are supported (HP-301). A provider MUST enforce that every operation stays inside the tenant identified by the credential. Each $defs entry carries its own examples.",+ "type": "object",+ "$defs": {+ "projectCreateRequest": {+ "type": "object",+ "required": ["name"],+ "properties": {+ "name": { "type": "string", "minLength": 1, "maxLength": 200 },+ "description": { "type": "string", "maxLength": 2000 }+ },+ "examples": [+ { "name": "Acme weekly reporting", "description": "Budget pacing alerts" },+ { "name": "Globex Q3" }+ ]+ },+ "projectRenameRequest": {+ "type": "object",+ "required": ["projectId", "name"],+ "properties": {+ "projectId": { "type": "string" },+ "name": { "type": "string", "minLength": 1, "maxLength": 200 }+ },+ "examples": [{ "projectId": "acme-reporting", "name": "Acme reporting (2026)" }]+ },+ "projectDeleteRequest": {+ "type": "object",+ "required": ["projectId"],+ "properties": { "projectId": { "type": "string" } },+ "examples": [{ "projectId": "acme-reporting" }]+ },+ "projectResponse": {+ "type": "object",+ "required": ["id", "name"],+ "properties": {+ "id": { "type": "string" },+ "name": { "type": "string" },+ "description": { "type": "string" }+ },+ "description": "The remaining client-side project fields (userId, status, timestamps) are synthesised by the Autonomous backend — see §10.3 of the spec. A provider MUST NOT invent them, and MUST NOT report an `engine`.",+ "examples": [+ { "id": "acme-reporting", "name": "Acme weekly reporting" },+ { "id": "globex-q3", "name": "Globex Q3", "description": "Quarterly rollup" }+ ]+ },+ "sessionUpdateTitleRequest": {+ "type": "object",+ "required": ["contextId", "title"],+ "properties": {+ "contextId": { "type": "string" },+ "title": { "type": "string", "minLength": 1, "maxLength": 500 }+ },+ "examples": [{ "contextId": "ctx-91af", "title": "Budget overrun investigation" }]+ },+ "sessionDeleteRequest": {+ "type": "object",+ "required": ["contextId"],+ "properties": { "contextId": { "type": "string" } },+ "examples": [{ "contextId": "ctx-91af" }]+ },+ "ackResponse": {+ "type": "object",+ "required": ["ok"],+ "properties": {+ "ok": { "type": "boolean" },+ "message": { "type": "string" }+ },+ "examples": [{ "ok": true }, { "ok": false, "message": "Project not found" }]+ }+ }+}diff --git a/spec/schema/part-metadata.json b/spec/schema/part-metadata.jsonnew file mode 100644index 000000000..c3e799936--- /dev/null+++ b/spec/schema/part-metadata.json@@ -0,0 +1,117 @@+{+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "$id": "https://harness.autonomous.ai/api/a2a/schema/part-metadata.json",+ "title": "autonomous.ai/* metadata on an A2A Part",+ "description": "Optional enrichment carried on the `metadata` object of a standard A2A Part. A provider that emits none of this is conformant — its output renders as plain assistant text (HP-211). Unknown autonomous.ai/* keys MUST be ignored, not rejected (HP-210).",+ "type": "object",+ "properties": {+ "autonomous.ai/kind": {+ "enum": [+ "user_message",+ "thinking_delta",+ "thinking_title",+ "text_delta",+ "tool_start",+ "tool_end",+ "context_compact",+ "done"+ ]+ },+ "autonomous.ai/thinkingId": {+ "type": "string",+ "description": "Groups thinking_delta chunks and their thinking_title."+ },+ "autonomous.ai/toolCallId": {+ "type": "string",+ "description": "Correlates a tool_start with its tool_end."+ },+ "autonomous.ai/parentToolCallId": {+ "type": "string",+ "description": "Set when this part belongs to a nested/sub-agent call, so the client can render a tree."+ },+ "autonomous.ai/tool": {+ "type": "string",+ "description": "Tool name, for tool_start and tool_end."+ },+ "autonomous.ai/toolInput": {+ "description": "Arbitrary JSON arguments for tool_start."+ },+ "autonomous.ai/isError": {+ "type": "boolean",+ "description": "tool_end only: the tool call failed."+ },+ "autonomous.ai/summary": {+ "type": "string",+ "description": "tool_end only: one-line human summary of the result."+ },+ "autonomous.ai/durationSeconds": {+ "type": "number",+ "minimum": 0,+ "description": "tool_end only."+ },+ "autonomous.ai/title": {+ "type": "string",+ "description": "thinking_title only."+ },+ "autonomous.ai/compacted": {+ "type": "object",+ "description": "context_compact only. All counts optional — omit rather than guess (HP-220). The human-readable explanation travels as the Part's own text.",+ "properties": {+ "userMessages": { "type": "integer", "minimum": 0 },+ "assistantMessages": { "type": "integer", "minimum": 0 },+ "toolUses": { "type": "integer", "minimum": 0 },+ "contexts": { "type": "integer", "minimum": 0 }+ }+ }+ },+ "allOf": [+ {+ "if": {+ "properties": { "autonomous.ai/kind": { "const": "tool_start" } },+ "required": ["autonomous.ai/kind"]+ },+ "then": { "required": ["autonomous.ai/toolCallId", "autonomous.ai/tool"] }+ },+ {+ "if": {+ "properties": { "autonomous.ai/kind": { "const": "tool_end" } },+ "required": ["autonomous.ai/kind"]+ },+ "then": { "required": ["autonomous.ai/toolCallId", "autonomous.ai/tool"] }+ },+ {+ "if": {+ "properties": { "autonomous.ai/kind": { "const": "thinking_title" } },+ "required": ["autonomous.ai/kind"]+ },+ "then": { "required": ["autonomous.ai/title"] }+ }+ ],+ "examples": [+ { "autonomous.ai/kind": "text_delta" },+ { "autonomous.ai/kind": "thinking_delta", "autonomous.ai/thinkingId": "t1" },+ { "autonomous.ai/kind": "thinking_title", "autonomous.ai/thinkingId": "t1", "autonomous.ai/title": "Checking the budget data" },+ {+ "autonomous.ai/kind": "tool_start",+ "autonomous.ai/toolCallId": "c7",+ "autonomous.ai/tool": "query_spend",+ "autonomous.ai/toolInput": { "account": "acme", "window": "7d" }+ },+ {+ "autonomous.ai/kind": "tool_end",+ "autonomous.ai/toolCallId": "c7",+ "autonomous.ai/tool": "query_spend",+ "autonomous.ai/isError": false,+ "autonomous.ai/summary": "Returned 7 rows",+ "autonomous.ai/durationSeconds": 1.4+ },+ { "autonomous.ai/kind": "done" },+ {+ "autonomous.ai/kind": "context_compact",+ "autonomous.ai/compacted": { "userMessages": 12, "assistantMessages": 12, "toolUses": 41 }+ },+ { "autonomous.ai/kind": "context_compact" },+ { "autonomous.ai/kind": "user_message" },+ {}+ ]+}