@agenticprimitives/a2a 0.0.0-alpha.5 → 0.0.0-alpha.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/CLAUDE.md +40 -55
  2. package/README.md +44 -1
  3. package/bin/a2a-conform.mjs +17 -0
  4. package/dist/agent.d.ts +211 -7
  5. package/dist/agent.d.ts.map +1 -1
  6. package/dist/agent.js +615 -76
  7. package/dist/agent.js.map +1 -1
  8. package/dist/auth.d.ts +108 -11
  9. package/dist/auth.d.ts.map +1 -1
  10. package/dist/auth.js +169 -56
  11. package/dist/auth.js.map +1 -1
  12. package/dist/authority-extension.d.ts +58 -0
  13. package/dist/authority-extension.d.ts.map +1 -0
  14. package/dist/authority-extension.js +70 -0
  15. package/dist/authority-extension.js.map +1 -0
  16. package/dist/card-audience.d.ts +87 -0
  17. package/dist/card-audience.d.ts.map +1 -0
  18. package/dist/card-audience.js +135 -0
  19. package/dist/card-audience.js.map +1 -0
  20. package/dist/client.d.ts +23 -8
  21. package/dist/client.d.ts.map +1 -1
  22. package/dist/client.js +76 -13
  23. package/dist/client.js.map +1 -1
  24. package/dist/cloudflare/index.d.ts.map +1 -1
  25. package/dist/cloudflare/index.js +10 -2
  26. package/dist/cloudflare/index.js.map +1 -1
  27. package/dist/conform/index.d.ts +36 -0
  28. package/dist/conform/index.d.ts.map +1 -0
  29. package/dist/conform/index.js +247 -0
  30. package/dist/conform/index.js.map +1 -0
  31. package/dist/discovery.d.ts +4 -0
  32. package/dist/discovery.d.ts.map +1 -1
  33. package/dist/discovery.js +6 -2
  34. package/dist/discovery.js.map +1 -1
  35. package/dist/engagement.d.ts +37 -0
  36. package/dist/engagement.d.ts.map +1 -0
  37. package/dist/engagement.js +83 -0
  38. package/dist/engagement.js.map +1 -0
  39. package/dist/grant.d.ts +4 -2
  40. package/dist/grant.d.ts.map +1 -1
  41. package/dist/grant.js +21 -13
  42. package/dist/grant.js.map +1 -1
  43. package/dist/handoff.d.ts +42 -0
  44. package/dist/handoff.d.ts.map +1 -0
  45. package/dist/handoff.js +28 -0
  46. package/dist/handoff.js.map +1 -0
  47. package/dist/index.d.ts +30 -10
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +29 -5
  50. package/dist/index.js.map +1 -1
  51. package/dist/payment-gate.d.ts +69 -3
  52. package/dist/payment-gate.d.ts.map +1 -1
  53. package/dist/payment-gate.js +36 -5
  54. package/dist/payment-gate.js.map +1 -1
  55. package/dist/placeholder.d.ts +5 -0
  56. package/dist/placeholder.d.ts.map +1 -0
  57. package/dist/placeholder.js +10 -0
  58. package/dist/placeholder.js.map +1 -0
  59. package/dist/run-provenance-extension.d.ts +22 -0
  60. package/dist/run-provenance-extension.d.ts.map +1 -0
  61. package/dist/run-provenance-extension.js +23 -0
  62. package/dist/run-provenance-extension.js.map +1 -0
  63. package/dist/runtime.d.ts +13 -1
  64. package/dist/runtime.d.ts.map +1 -1
  65. package/dist/runtime.js +62 -16
  66. package/dist/runtime.js.map +1 -1
  67. package/dist/session-wire.d.ts +114 -0
  68. package/dist/session-wire.d.ts.map +1 -0
  69. package/dist/session-wire.js +292 -0
  70. package/dist/session-wire.js.map +1 -0
  71. package/dist/skill-handler.d.ts +21 -1
  72. package/dist/skill-handler.d.ts.map +1 -1
  73. package/dist/skill-handler.js.map +1 -1
  74. package/dist/standard/app-delegation.d.ts +60 -0
  75. package/dist/standard/app-delegation.d.ts.map +1 -0
  76. package/dist/standard/app-delegation.js +43 -0
  77. package/dist/standard/app-delegation.js.map +1 -0
  78. package/dist/standard/caller.d.ts +115 -0
  79. package/dist/standard/caller.d.ts.map +1 -0
  80. package/dist/standard/caller.js +186 -0
  81. package/dist/standard/caller.js.map +1 -0
  82. package/dist/standard/client.d.ts +64 -0
  83. package/dist/standard/client.d.ts.map +1 -0
  84. package/dist/standard/client.js +109 -0
  85. package/dist/standard/client.js.map +1 -0
  86. package/dist/standard/delegated.d.ts +127 -0
  87. package/dist/standard/delegated.d.ts.map +1 -0
  88. package/dist/standard/delegated.js +179 -0
  89. package/dist/standard/delegated.js.map +1 -0
  90. package/dist/standard/errors.d.ts +31 -0
  91. package/dist/standard/errors.d.ts.map +1 -0
  92. package/dist/standard/errors.js +75 -0
  93. package/dist/standard/errors.js.map +1 -0
  94. package/dist/standard/from-agent.d.ts +43 -0
  95. package/dist/standard/from-agent.d.ts.map +1 -0
  96. package/dist/standard/from-agent.js +149 -0
  97. package/dist/standard/from-agent.js.map +1 -0
  98. package/dist/standard/index.d.ts +12 -0
  99. package/dist/standard/index.d.ts.map +1 -0
  100. package/dist/standard/index.js +18 -0
  101. package/dist/standard/index.js.map +1 -0
  102. package/dist/standard/mount.d.ts +101 -0
  103. package/dist/standard/mount.d.ts.map +1 -0
  104. package/dist/standard/mount.js +186 -0
  105. package/dist/standard/mount.js.map +1 -0
  106. package/dist/standard/outbound-fetch.d.ts +51 -0
  107. package/dist/standard/outbound-fetch.d.ts.map +1 -0
  108. package/dist/standard/outbound-fetch.js +152 -0
  109. package/dist/standard/outbound-fetch.js.map +1 -0
  110. package/dist/standard/push-url-policy.d.ts +34 -0
  111. package/dist/standard/push-url-policy.d.ts.map +1 -0
  112. package/dist/standard/push-url-policy.js +218 -0
  113. package/dist/standard/push-url-policy.js.map +1 -0
  114. package/dist/standard/server.d.ts +150 -0
  115. package/dist/standard/server.d.ts.map +1 -0
  116. package/dist/standard/server.js +575 -0
  117. package/dist/standard/server.js.map +1 -0
  118. package/dist/standard/types.d.ts +186 -0
  119. package/dist/standard/types.d.ts.map +1 -0
  120. package/dist/standard/types.js +14 -0
  121. package/dist/standard/types.js.map +1 -0
  122. package/dist/subject-ask.d.ts +142 -0
  123. package/dist/subject-ask.d.ts.map +1 -0
  124. package/dist/subject-ask.js +137 -0
  125. package/dist/subject-ask.js.map +1 -0
  126. package/dist/subject-hop.d.ts +156 -0
  127. package/dist/subject-hop.d.ts.map +1 -0
  128. package/dist/subject-hop.js +276 -0
  129. package/dist/subject-hop.js.map +1 -0
  130. package/dist/task-store.d.ts +9 -3
  131. package/dist/task-store.d.ts.map +1 -1
  132. package/dist/task-store.js +12 -6
  133. package/dist/task-store.js.map +1 -1
  134. package/dist/types.d.ts +27 -2
  135. package/dist/types.d.ts.map +1 -1
  136. package/dist/types.js.map +1 -1
  137. package/dist/wire-verify.d.ts +35 -0
  138. package/dist/wire-verify.d.ts.map +1 -0
  139. package/dist/wire-verify.js +55 -0
  140. package/dist/wire-verify.js.map +1 -0
  141. package/package.json +35 -12
  142. package/dist/jsonrpc.d.ts +0 -25
  143. package/dist/jsonrpc.d.ts.map +0 -1
  144. package/dist/jsonrpc.js +0 -52
  145. package/dist/jsonrpc.js.map +0 -1
package/CLAUDE.md CHANGED
@@ -1,67 +1,52 @@
1
1
  # @agenticprimitives/a2a — Claude guide
2
2
 
3
- ## What this is
4
- Async, delegation-authorized **Agent-to-Agent task transport** (spec 269). Any claimed agent sends any
5
- other claimed agent an asynchronous task and collects the result by poll / push / stream. Built on the
6
- `@agenticprimitives/fulfillment` Task substrate; the delegation primitive is the auth.
7
-
8
- ## The boundary (ADR-0034 — READ FIRST)
9
- This package is the **transport-agnostic core**: the Task runtime over a `TaskStore` PORT, the
10
- `SkillHandler` contract + dispatcher, the JSON-RPC handlers, the `A2aWireAdapter` client, the
11
- delegation-auth gate, and the scoped-grant caveat builders. **No Cloudflare coupling here.** The
12
- Cloudflare `TaskStoreDO` (DurableObject-backed `TaskStore` + `alarm()`) ships as the `./cloudflare`
13
- subpath. We DIVERGE from spec 245's `mcp-runtime/a2a` placement on purpose — `mcp-runtime` becomes a
14
- consumer (the receiving `withDelegation` gate + the a2a→mcp delivery leg), not the owner.
15
-
16
- ## Wave status
17
- - **W1 (done):** Task runtime core — `newTaskRecord`, `applyTransition` (fail-closed via
18
- `canTaskTransition`), `dispatchTask` (skill dispatch; unknown→rejected; AuthRequired→auth-required;
19
- throw→failed), the `TaskStore` port + in-memory impl, the `SkillHandler` contract.
20
- - **W2 (done):** delegation-auth gate `authorizeA2aMessage` (FR-4: delegate===requester, timestamp
21
- window, allowedTargets=this-agent + allowedMethods=skill scoping, on-chain `isRevoked` + ERC-1271
22
- injected fail-closed, signed message, single-use message-id) + `buildA2aGrantCaveats` + `hashA2aMessage`.
23
- - **W3 (done):** `createA2aAgent` (message/send → authorize + persist + return submitted; tasks/get +
24
- tasks/cancel with party auth; `processDue` alarm body running `dispatchTask`; agent-card) +
25
- `dispatchA2aRpc`/`handleA2aRpcBody` (JSON-RPC 2.0) + `A2aWireAdapter` (over an injected transport) +
26
- the `./cloudflare` `createDurableObjectTaskStore` adapter.
27
- - **W4 (done):** vault body residency (`emitArtifact` writes the body to the assignee vault; only
28
- hashes/refs in state) + signed push (`deliverPush`/`verifyPushEnvelope` — assignee signs the terminal
29
- envelope, receiver verifies, bounded retry; wired into `processDue`) + `tasks/pushNotificationConfig/set`
30
- + SSE framing (`formatSseEvent`/`isStreamEnd`). Poll is `tasks/get` (W3).
31
- - **W5 (done):** two-agent acceptance harness (`test/harness.test.ts`, AC-1..AC-4 — happy path, the
32
- delegation-gate denials at the agent surface, a cross-vault entitlement deposit, the auth-required
33
- round-trip via `resubmit`) + the demo-a2a relayer adoption (`apps/demo-a2a/src/a2a-task-do.ts`: a
34
- per-agent `A2aTaskDO` running the real runtime over DO storage, ERC-1271 + isRevoked checks bound to
35
- Base Sepolia, `alarm()`-driven `processDue`; `/api/a2a` forwards to it — the stub "received" is gone).
36
- Added `resubmit` (auth-required → submitted) + `tasks/resubmit` routing this wave.
3
+ Async, delegation-authorized **Agent-to-Agent task transport** on the A2A 1.0 wire (specs 269, 372). Any agent sends
4
+ another an asynchronous task and collects the result by poll, push or stream; the delegation primitive is the auth.
5
+ The boundary, the wire, the promoted runtime pieces and card audiences are in the README's **Reference**.
6
+
7
+ ## Agentic role (ADR-0044)
8
+ First-party web expresses INTENTS to an a2a agent, which decides which MCP tools to compose; web never builds MCP calls.
9
+ This package stays pure transport + delegation-auth: it carries tasks, enforces authority and runs the orchestration core
10
+ through the injected `SkillHandler`. It never embeds an LLM SDK ([ADR-0044](../../docs/architecture/decisions/0044-a2a-is-the-agentic-orchestration-layer.md)).
11
+
12
+ ## What this package owns
13
+ - The task runtime over a `TaskStore` PORT; `SkillHandler` + dispatcher; `A2aWireAdapter`; the delegation-auth gate;
14
+ scoped-grant caveat builders. Cloudflare only under `./cloudflare` ([ADR-0034](../../docs/architecture/decisions/0034-a2a-transport-is-its-own-package-with-cloudflare-adapter.md)).
15
+ - **The A2A 1.0 wire** (`src/standard/`): `createStandardA2aServer`; authority rides as `AP_DELEGATED_TASK_EXTENSION`.
16
+ - **The routed hop** (`subject-hop.ts`, spec 366/397): `sendSubjectAskOverWire`. **The card decides the asker's form**
17
+ (spec 442 §4.1): a card declaring `AP_PAIRWISE_ASKER_EXTENSION_URI` gets a pairwise asker (`{ pairwise, audience }`, no
18
+ credential, no session, via `pairwiseSubjectFor`); a card declaring nothing gets the credentialed form. A declaring card
19
+ with no port is refused — never the credentialed form instead.
20
+ - `wire-verify.ts` (`verifyDelegationWire`), agent-card audience projection, `./conform`.
37
21
 
38
22
  ## Read first
39
- 1. `capability.manifest.json` — boundary.
40
- 2. `../../specs/269-async-delegation-authorized-a2a.md` — the contract + the §9 decisions.
41
- 3. `../../docs/architecture/decisions/0034-a2a-transport-is-its-own-package-with-cloudflare-adapter.md`.
42
- 4. `src/runtime.ts` (lifecycle) → `src/skill-handler.ts` (the plug-in) → `src/task-store.ts` (the port).
23
+ `capability.manifest.json` → `../../specs/269-async-delegation-authorized-a2a.md` → ADR-0034 → `src/runtime.ts` →
24
+ `src/skill-handler.ts` → `src/task-store.ts` → `src/standard/`.
43
25
 
44
- ## Allowed imports
45
- `@agenticprimitives/types`, `@agenticprimitives/fulfillment` (Task/Artifact types), `@agenticprimitives/delegation`
46
- (verify + caveats), `viem`. The `./cloudflare` subpath additionally uses `@cloudflare/workers-types` (dev).
26
+ ## Imports
27
+ Allowed: `types`, `fulfillment` (Task/Artifact types), `delegation`, `verification-receipts` (the message/send mint point),
28
+ `viem`; `./cloudflare` adds `@cloudflare/workers-types` (dev). Forbidden: `apps/*`, `mcp-runtime`, `tool-policy` (they consume
29
+ us), `@modelcontextprotocol/sdk`, and any Cloudflare type in core `src/` outside `src/cloudflare/`.
47
30
 
48
- ## Forbidden imports
49
- - `apps/*`
50
- - `@agenticprimitives/mcp-runtime` / `tool-policy` (they consume us — no back-edges).
51
- - `@modelcontextprotocol/sdk` (MCP transport is not A2A transport).
52
- - **No Cloudflare types in the core `src/` (only in `src/cloudflare/`).**
31
+ ## Drift triggers — STOP
32
+ - A second set of method names (`message/send`, `tasks/get`) → **STOP.** They are deleted; 1.0 is the only wire.
33
+ - Collapsing the caller (`Authorization`) into the author (the envelope's signature) → **STOP.** A relay carries what it did not write.
34
+ - Sending a credential or a session to a card that declared the pairwise asker → **HARD STOP.**
35
+ - Answering a non-party "forbidden" instead of TaskNotFound → **STOP.** It confirms the task exists.
53
36
 
54
37
  ## Security invariants (DO NOT BREAK)
55
- - Every transition fail-closed via `canTaskTransition`; unknown skill → `rejected`.
56
- - No task created for an unverifiable grant (W2). `task.permissionGrantRef = hashDelegation(grant)`;
57
- on-chain `isRevoked` fails in-flight closed.
58
- - Message/artifact bodies live in the vault (`VaultRef`) — only hashes/refs in task state (A2A-INV-04).
59
- - Authorization ≠ identity: the caveats + assignee decide *what*; the token proves *who*. A delegator
60
- never reaches another principal's namespace.
61
- - No long-lived signing key for a claimed agent — KMS/session signer only (ties to spec-235 §10).
38
+ - Every transition fail-closed via `canTaskTransition`; an unknown skill → `rejected`.
39
+ - No task for an unverifiable grant; `task.permissionGrantRef = hashDelegation(grant)` — also after `resubmit`, which takes only a grant from the task's own principal (RUNB-3).
40
+ - An artifact is its task's: random id, stored under (task, artifact), written once, hash-checked on read (RUNB-2). A session wire verifies only against THIS host's `target` (RUN-9).
41
+ - A task runs under this agent's OWN grant unless `acceptDelegator` names another delegator (address/list/`'any'`); rechecked at dispatch (spec 448 §0, T3-8).
42
+ - Every message binds recipient + chain (no unbound form); a `0x…01`/zero delegate, an unknown session-wire caveat and a stale caller signature are refused; a payment park resumes once, via `settlePayment` (spec 445 decision 8, AUDIT §8).
43
+ - Bodies live in the vault (`VaultRef`); task state holds hashes and refs only (A2A-INV-04).
44
+ - Authorization ≠ identity: caveats + assignee decide *what*; the token proves *who*.
45
+ - A credential leaves only to the card's own origin (or a pinned card's endpoint); outbound fetches are public-https, bounded, no redirects (RUNB-9/RUN-16).
46
+ - No long-lived signing key for a claimed agent — KMS/session signer only.
47
+ - A card audience is degraded to `public` on any verification failure; visibility is disclosure, not authorization.
62
48
 
63
49
  ## Validate
64
50
  ```bash
65
- pnpm --filter @agenticprimitives/a2a typecheck
66
- pnpm --filter @agenticprimitives/a2a test
51
+ pnpm --filter @agenticprimitives/a2a typecheck && pnpm --filter @agenticprimitives/a2a test
67
52
  ```
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @agenticprimitives/a2a
2
2
 
3
+ > Part of **[Agentic Primitives](https://agenticprimitives.dev)** — the open-source trust substrate for agentic applications: identity that can sign, authority checked at act time, evidence the owner carries. [Developer kit](https://github.com/agentictrustlabs/agentic-primitives) · [All packages](https://agenticprimitives.dev/developers)
4
+
3
5
  **Agent-to-agent calls gated by the same delegations as everything else.** Agent discovery and identity are being settled right now — ERC-8004 went to mainnet, agent naming services launched, agent cards are becoming the lingua franca of discovery. What none of that settles is authority: when agent A sends agent B a task, what proves A was allowed to ask, for exactly that skill, within exactly those limits? This package answers with the agenticprimitives delegation primitive — the same EIP-712, caveat-constrained, on-chain-revocable grant that authorizes a web session, an MCP tool, and an on-chain spend. One delegation model, everywhere; A2A is not the exception.
4
6
 
5
7
  Part of [agenticprimitives](../../README.md) — the trust substrate for the agent economy: one canonical Smart Agent identity with custody, delegation, naming, credentials, and audit evidence designed as one system.
@@ -11,7 +13,7 @@ Concretely: an async, delegation-authorized **Agent-to-Agent task transport**. A
11
13
  All five implementation waves have landed:
12
14
 
13
15
  - **Task runtime core** — `newTaskRecord`, `applyTransition` (fail-closed via `canTaskTransition`), `dispatchTask`, the `TaskStore` port + an in-memory reference implementation, and the `SkillHandler` contract. Unknown skill → `rejected`, never silently dropped.
14
- - **Delegation-auth gate** — `authorizeA2aMessage`: delegate === requester, timestamp window, target + skill scoping via caveats, on-chain `isRevoked` + ERC-1271 injected fail-closed, signed message, single-use message-id. Plus `buildA2aGrantCaveats` and `hashA2aMessage`.
16
+ - **Delegation-auth gate** — `authorizeA2aMessage`: delegate === requester, a fresh signed `createdAt`, the message's own `recipient` + `chainId` (mandatory on every message — spec 445 decision 8), timestamp window, target + skill scoping via caveats (every caveat of each kind must admit), the grant's delegator (default: this agent's own grants only; another delegator only when named — an address, a list, or `'any'`, per skill via `acceptDelegator`, rechecked at dispatch — spec 448 §0), on-chain `isRevoked` + ERC-1271 injected fail-closed, signed message, single-use message-id. Plus `buildA2aGrantCaveats` and `hashA2aMessage`.
15
17
  - **Agent surface** — `createA2aAgent` (message/send → authorize + persist; tasks/get + tasks/cancel with party auth; alarm-driven `processDue`; agent card) + JSON-RPC 2.0 handlers (`dispatchA2aRpc` / `handleA2aRpcBody`) + the `A2aWireAdapter` client over an injected transport.
16
18
  - **Vault body residency + signed push** — message and artifact bodies live in the assignee's vault; only hashes/refs appear in task state. Terminal results are delivered as signed push envelopes (`deliverPush` / `verifyPushEnvelope`) with bounded retry, or streamed via SSE framing, or polled via `tasks/get`.
17
19
  - **Two-agent acceptance harness** — the happy path, delegation-gate denials at the agent surface, a cross-vault entitlement deposit, and the auth-required round-trip via `resubmit`, all exercised in `test/harness.test.ts`.
@@ -48,3 +50,44 @@ Testnet/pilot-ready. Production launch is gated on the public checklist in the r
48
50
  ## License
49
51
 
50
52
  UNLICENSED (internal monorepo, not published).
53
+
54
+ ## The pairwise asker
55
+
56
+ A service that wants to know a returning person without learning who she is declares the card extension
57
+ `AP_PAIRWISE_ASKER_EXTENSION_URI` (`pairwiseAskerCardExtension(audience)`). The card decides the asker's form: when
58
+ `sendSubjectAskOverWire` finds the extension it sends `{ pairwise, audience }` — a per-service pseudonym from the
59
+ `pairwiseSubjectFor` port — and no credential, no session, no address. A card that declares the extension and a sender
60
+ with no pseudonym to give is refused, never answered with the credentialed form. `validatePairwiseSubjectAsk` refuses
61
+ an asker that carries anything beyond its subject and audience; `routedAskOf` reads either form.
62
+
63
+ ## Reference
64
+
65
+ **Boundary (ADR-0034).** This package is the transport-agnostic core: the task runtime over a `TaskStore` port, the
66
+ `SkillHandler` contract and dispatcher, the `A2aWireAdapter` client, the delegation-auth gate and the scoped-grant caveat
67
+ builders. The Cloudflare `TaskStoreDO` (a Durable Object `TaskStore` with `alarm()`) ships as the `./cloudflare` subpath. It
68
+ diverges from spec 245's placement under `mcp-runtime` on purpose: `mcp-runtime` is a consumer (the receiving gate and the
69
+ a2a→mcp delivery leg), not the owner. Spec 269 W1–W5 are the record (runtime, gate, `createA2aAgent`, the Cloudflare store,
70
+ vault body residency, signed push and SSE, the two-agent acceptance harness `test/harness.test.ts`).
71
+
72
+ **The wire (spec 372).** `src/standard/` (imported as `@agenticprimitives/a2a/standard`) is A2A 1.0 as the official TCK tests it: PascalCase methods, proto-JSON shapes,
73
+ `A2A-Version`, ErrorInfo on every A2A error, SSE, push. There is no second set of method names.
74
+ `createStandardA2aServer({card, executor, principal?, canSeeTask?, beforeSend?, onCancel?})` is fetch-shaped; the executor
75
+ emits events through `ctx`. Authority rides as an extension: a `SendMessage` carrying `AP_DELEGATED_TASK_EXTENSION` is a
76
+ delegation-authorized task (`standard/delegated.ts`), and `createAgentBackedServer` puts the runtime behind it with every
77
+ gate it always had. The `Authorization` header says who is CALLING (`caller.ts`); the envelope's signature says who
78
+ AUTHORED the message; a relay may carry a message it did not write, so the two are never collapsed. `canSeeTask` answers a
79
+ non-party TaskNotFound. `tck/sut.mjs` + `scripts/run-a2a-tck.sh` run the TCK in CI; `./conform` (`ap conform a2a <url>`)
80
+ probes a live agent's card and binding.
81
+
82
+ **Promoted from the runtime (spec 399 §4).** `standard/mount.ts`: `withStandardCardFields`, `isRuntimeTaskId`,
83
+ `runtimeBackedTaskStore`, `principalBySchemes` (`Bearer` = person, `A2A-Session` = agent, never each other's fallback),
84
+ `delegatedDispatch`, `settlementForReplyKind`, `settleTask`. `subject-hop.ts`: `sendSubjectAskOverWire` (resolves through the
85
+ card, digest pin), `subjectAskOf`, `subjectAnswerOf`, `handoffOf`, `SUBJECT_ANSWER_ARTIFACT`; spec 433's
86
+ `subjectAnswerEnvelope` / `subjectAnswerArtifact`; `standard/app-delegation.ts` (`appDelegationAsk`). `wire-verify.ts`:
87
+ `verifyDelegationWire`, the delegate-key tail every A2A service repeats (identity, caveats, revocation, signature).
88
+
89
+ **Agent-card audiences (spec 338 §8).** `agentCard(forAudience?)` projects by `SkillHandler.exposure` (`public`,
90
+ `authenticated`, `private`, `service-only`; omitted means public). Passing an audience is not authenticating one:
91
+ `createCardAudienceResolver` verifies a signed challenge (nonce consumed before the signature is read, `x-ap-*` headers) and
92
+ degrades to `public` on any failure; `privateViewPolicy` is a separate injected decision. Visibility is disclosure, not
93
+ authorization.
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ // a2a-conform — `ap conform a2a <url>` (spec 399 §2.3): probe an A2A 1.0 agent on the JSON-RPC binding.
3
+ //
4
+ // a2a-conform https://agent.example (the card at /.well-known/agent-card.json)
5
+ // a2a-conform <url> --bearer <token> (the bearer the surface admits — a Home session, a session wire)
6
+ // a2a-conform <url> --json (the report as JSON, for a CI step)
7
+ //
8
+ // Exit 1 when a MUST failed; SHOULD and MAY are reported, never gating.
9
+ import { conformA2a, formatConformanceReport } from '../dist/conform/index.js';
10
+
11
+ const argv = process.argv.slice(2);
12
+ const url = argv.find((a) => !a.startsWith('--'));
13
+ const opt = (name) => { const eq = argv.find((a) => a.startsWith(`--${name}=`)); if (eq) return eq.slice(name.length + 3); const i = argv.indexOf(`--${name}`); return i >= 0 ? argv[i + 1] : undefined; };
14
+ if (!url) { console.error('usage: a2a-conform <agent-origin-or-card-url> [--bearer <token>] [--timeout <ms>] [--json]'); process.exit(2); }
15
+ const report = await conformA2a(url, { bearer: opt('bearer') ?? process.env.A2A_BEARER, timeoutMs: opt('timeout') ? Number(opt('timeout')) : undefined });
16
+ console.log(argv.includes('--json') ? JSON.stringify(report, null, 2) : formatConformanceReport(report));
17
+ process.exit(report.ok ? 0 : 1);
package/dist/agent.d.ts CHANGED
@@ -4,10 +4,65 @@ import type { Delegation } from '@agenticprimitives/delegation';
4
4
  import type { Task, TaskEvent, A2aMessage, VaultRef } from './types.js';
5
5
  import type { TaskStore } from './task-store.js';
6
6
  import { type SkillHandler, type VaultClient, type McpClient } from './skill-handler.js';
7
- import { type OnChainChecks } from './auth.js';
7
+ import { type DelegatorPolicy, type OnChainChecks, type ScopeCovers } from './auth.js';
8
+ import { mintVerificationReceipt, type ReceiptProof, type Sha256, type VerificationReceiptV1 } from '@agenticprimitives/verification-receipts';
8
9
  import type { A2aEnforcers } from './grant.js';
9
10
  import { type TerminalSigner, type PushSender } from './push.js';
10
- import { type PaymentGate, type SkillPayment } from './payment-gate.js';
11
+ import { type ApAuthorityExtensionParams } from './authority-extension.js';
12
+ import { type PaymentGate, type PaymentSettlementV1, type SkillPayment } from './payment-gate.js';
13
+ /**
14
+ * Spec 290 §6 Stage-3 — an injected per-Smart-Agent HARD budget. STRUCTURAL (no `rate-control` import —
15
+ * ADR-0034 keeps this package transport/vendor-agnostic); the app wires a `rate-control` HardBudgetStore
16
+ * adapter. The runtime reserves AFTER authority (keyed by the verified principal), COMMITS only once the
17
+ * task is durably created, and RELEASES on any pre-creation failure (the spec §3 A2A pattern). Additive to
18
+ * the on-chain enforcers, never the authority for value movement (ADR-0041). Omit ⇒ no Stage-3 budget.
19
+ */
20
+ export interface A2aBudgetPort {
21
+ reserve(input: {
22
+ sponsorAgent: Address;
23
+ capabilityId: string;
24
+ idempotencyKey: string;
25
+ }): Promise<{
26
+ allowed: boolean;
27
+ reservationId?: string;
28
+ }>;
29
+ commit(reservationId: string): Promise<void>;
30
+ release(reservationId: string): Promise<void>;
31
+ }
32
+ /**
33
+ * Spec 303 W3 — verification receipts on the A2A ingress. Mirrors mcp-runtime's
34
+ * `ReceiptsConfig`: the agent mints a commitment-split `VerificationReceiptV1`
35
+ * at message/send + resubmit terminal decisions (allow after durable accept;
36
+ * deny with the PUBLIC rpc message as the coarse reason — the raw auth reason
37
+ * is already suppressed, NEW-A2A-1) and hands the pair to `onReceipt`. The
38
+ * public receipt also rides the accept result so the SENDER retains it.
39
+ * Absent ⇒ no receipts, byte-identical behavior (INV-303-5).
40
+ */
41
+ export interface A2aReceiptsConfig {
42
+ /** The verifying agent identity stamped into receipts (this agent's SA — Mode-1 public). It is the signer a reader
43
+ * EXPECTS: `sign`'s proof must verify against it (ERC-1271 for an SA, ECDSA for a key address). */
44
+ verifier: string;
45
+ policyVersion: string;
46
+ onReceipt: (minted: Awaited<ReturnType<typeof mintVerificationReceipt>>, ctx: {
47
+ outcome: 'allow' | 'deny';
48
+ messageId: Hex;
49
+ skill: string;
50
+ taskId?: Hex;
51
+ }) => Promise<void>;
52
+ /** Injected signer over the canonical receiptHash; the proof must resolve to `verifier`. REQUIRED for a receipt
53
+ * anyone else is to rely on: since DATA-8 (spec 445) `verifyVerificationReceipt` never returns `valid` for an
54
+ * unsigned receipt — omit ⇒ the receipt is a local log line (`inspectUnverifiedReceipt`), not evidence. */
55
+ sign?: (receiptHash: Sha256) => Promise<ReceiptProof>;
56
+ /** Duty-3 evidence provider (latest block); omit ⇒ blockNumber '0' + zero hash. */
57
+ statusEvidence?: () => Promise<{
58
+ blockNumber: string;
59
+ blockHash: Hex;
60
+ }>;
61
+ /** Per-relationship receipt key; omit ⇒ fresh key per receipt. */
62
+ receiptKey?: Hex;
63
+ /** `true` ⇒ a failed mint/onReceipt aborts the call (spec 291 §5 posture). Default fail-soft. */
64
+ failClosed?: boolean;
65
+ }
11
66
  export interface A2aAgentConfig {
12
67
  /** This agent's Smart Account — the assignee + the allowedTargets the gate requires. */
13
68
  agentSA: Address;
@@ -17,12 +72,39 @@ export interface A2aAgentConfig {
17
72
  enforcers: A2aEnforcers;
18
73
  taskStore: TaskStore;
19
74
  checks: OnChainChecks;
75
+ /** FR-4.2 scope classes for `allowedTargets` — see `ScopeCovers` in auth.ts. Omit ⇒ exact match only. */
76
+ scopeCovers?: ScopeCovers;
77
+ /** Spec 448 §0 (audit T3-8) — whose grant a task may run under, per skill. Omitted (the function, or `undefined`
78
+ * from it) ⇒ THIS AGENT'S OWN grants only (delegator === `agentSA`). Accepting another delegator is the NAMED option:
79
+ * an address or a list names who; `'any'` says in words that any delegator's grant is accepted for that skill (a
80
+ * stranger's grant to itself then opens a task whose handler holds this agent's own vault/MCP clients — name it only
81
+ * for a skill that acts on the sender's own records, e.g. inbox delivery). Passed to `authorizeA2aMessage` as
82
+ * `expectedDelegator` on messageSend and resubmit, and applied again at dispatch: a queued task whose delegator the
83
+ * CURRENT policy refuses is `rejected`, never run. */
84
+ acceptDelegator?: (skill: string) => DelegatorPolicy | undefined;
20
85
  handlers: SkillHandler[];
86
+ /**
87
+ * Resolve a method the static `handlers` list does not contain — the METHOD-FAMILY seam.
88
+ *
89
+ * (`skill` is this protocol's name for the string a message addresses; the authorization layer
90
+ * calls the same value a METHOD — `skillSelector` reduces it to a `bytes4` the ALLOWED_METHODS
91
+ * enforcer checks. Family members are methods, not necessarily distinct implementations.)
92
+ *
93
+ * Consulted only on a registry miss, so it can never shadow a registered handler. It exists for
94
+ * agents whose method set is DATA rather than code: one hosting a set of archetypes defined in
95
+ * its own library answers `archetype.<slug>` for whatever that library declares, and adding a role
96
+ * is a library write instead of a redeploy. Returning undefined leaves the task rejected as
97
+ * `unknown skill`, exactly as before.
98
+ */
99
+ resolveHandler?: (skill: string) => SkillHandler | undefined;
100
+ /** Extra methods to advertise on the agent card for a family the handlers array cannot list. */
101
+ dynamicSkills?: () => string[];
21
102
  vault: VaultClient;
22
103
  mcp: McpClient;
23
104
  /** Clock + id generators — injected for determinism in tests. */
24
105
  now?: () => number;
25
106
  newTaskId?: () => Hex;
107
+ /** Default: 32 random bytes (RUNB-2). An injected generator is still held to insert-only per task. */
26
108
  newArtifactId?: () => Hex;
27
109
  /** Hash of an arbitrary body (default keccak256 via the consumer; here a required injection). */
28
110
  hashBody: (data: unknown) => Hex;
@@ -30,13 +112,55 @@ export interface A2aAgentConfig {
30
112
  * be a KMS/session signer for the assignee SA (SR-8). */
31
113
  signTerminal?: TerminalSigner;
32
114
  pushSender?: PushSender;
115
+ /**
116
+ * What this deployment actually MOUNTED, for the Agent Card's capability block (ADR-0059).
117
+ *
118
+ * `streaming` is not knowable from here: `message/stream` is served by the SSE transport, which the
119
+ * embedding worker mounts (`dispatchA2aRpc` explicitly rejects it). So the deployment declares it,
120
+ * and the default is FALSE — an agent that has not said it streams is assumed not to, because the
121
+ * cost of over-claiming is a peer that opens a stream which never arrives.
122
+ *
123
+ * `pushNotifications` is NOT taken from here: it is DERIVED from whether push is actually wired
124
+ * (`signTerminal` + `pushSender`), because that is knowable and a config flag could contradict it.
125
+ */
126
+ declaredCapabilities?: {
127
+ streaming?: boolean;
128
+ stateTransitionHistory?: boolean;
129
+ };
130
+ /**
131
+ * The authority model this agent's Card declares (ADR-0059 / spec 341 §2.1).
132
+ *
133
+ * Omit and the Card says nothing about how to authenticate — which is the state that made "an
134
+ * external agent can use the same skills the Home uses" unreachable. It is optional only so the
135
+ * bump is non-breaking; a deployment serving peer-callable skills SHOULD set it.
136
+ */
137
+ authority?: ApAuthorityExtensionParams;
33
138
  /** FR-3.6 — the policy gating skill-handler hand-offs (`requestHandoff`). Omit ⇒ hand-offs are
34
139
  * rejected (fail-closed). */
35
140
  handoffPolicy?: HandoffPolicy;
36
141
  /** Spec 272 PAY-A2A — the injected x402 payment gate. When a priced skill (handler.payment) is
37
- * invoked, the gate decides paid/unpaid (the app wires the payments x402 rail). Omit ⇒ priced skills
38
- * behave as free (dev / unpriced deployment). */
142
+ * invoked, the gate decides paid/unpaid (the app wires the payments x402 rail). Omit ⇒ a priced skill
143
+ * NEVER runs: a static one refuses construction (A2A-5), a resolved one parks `input-required` (RUNB-6). */
39
144
  paymentGate?: PaymentGate;
145
+ /** Spec 290 §6 Stage-3 — the per-Smart-Agent hard-budget port (post-authority, keyed by the verified
146
+ * principal). Omit ⇒ no Stage-3 budget (authority + single-use message-id still apply). */
147
+ budget?: A2aBudgetPort;
148
+ /** N-2 (seam audit) — read/control caller signatures (tasks/get, tasks/cancel, tasks/artifact,
149
+ * pushNotificationConfig/set) MUST carry a recent `issuedAt` within this many seconds, bounding replay of a
150
+ * captured signature to the window. ON BY DEFAULT since spec 445 §9 decision 8: omit ⇒
151
+ * `A2A_CALLER_SIG_MAX_AGE_SEC` (300 s). The only way off is the named opt-out below. */
152
+ callerSigMaxAgeSec?: number;
153
+ /** The explicit, named opt-out of caller-signature freshness (spec 445 decision 8): `true` ⇒ a read/control
154
+ * signature with no `issuedAt` (the legacy unbounded digest) is accepted for the life of the task. For a
155
+ * deployment that must still serve legacy callers; never the default. */
156
+ unsafeAllowUnboundedCallerSignatures?: true;
157
+ /** Spec 303 W3 — verification receipts at the message/send + resubmit terminals. Omit ⇒ none. */
158
+ receipts?: A2aReceiptsConfig;
159
+ /** RUNB-4 — how old a message's signed `createdAt` may be (seconds; default 600). */
160
+ messageMaxAgeSec?: number;
161
+ /** RUNB-8 — how many dispatch passes may fail before a task's handler runs, before the task is rejected
162
+ * (default 3). */
163
+ maxDispatchAttempts?: number;
40
164
  }
41
165
  export type RpcOk<T> = {
42
166
  ok: true;
@@ -60,47 +184,113 @@ export interface MessageSendParams {
60
184
  };
61
185
  }
62
186
  /** Resubmit an auth-required task with a fresh grant (FR-3.5). Carries a NEW signed message (new
63
- * messageId → no replay) + the input the suspended handler asked for. Only the original sender may. */
187
+ * messageId → no replay) + the input the suspended handler asked for. Only the original sender may, and
188
+ * only with a grant from the task's OWN principal (RUNB-3) — a grant from any other delegator is refused. */
64
189
  export interface ResubmitParams extends MessageSendParams {
65
190
  taskId: Hex;
66
191
  }
67
192
  export interface A2aAgent {
193
+ /** `receipt` (spec 303 W3): the PUBLIC verification receipt for the accept — commitment-only,
194
+ * retained by the SENDER independently of this agent. Present only when `config.receipts` is set. */
68
195
  messageSend(params: MessageSendParams): Promise<RpcResult<{
69
196
  taskId: Hex;
70
197
  state: Task['state'];
198
+ receipt?: VerificationReceiptV1;
71
199
  }>>;
72
200
  /** Resume an auth-required task (auth-required → submitted) with a fresh grant + message (FR-3.5). */
73
201
  resubmit(params: ResubmitParams): Promise<RpcResult<{
74
202
  taskId: Hex;
75
203
  state: Task['state'];
204
+ receipt?: VerificationReceiptV1;
76
205
  }>>;
77
206
  tasksGet(params: {
78
207
  taskId: Hex;
79
208
  caller: Address;
209
+ signature: Hex;
210
+ issuedAt?: number;
80
211
  }): Promise<RpcResult<Task & {
81
212
  error?: string;
82
213
  artifactRefs: VaultRef[];
83
214
  }>>;
215
+ /** Read ONE artifact's BODY. `tasks/get` returns refs only, and an artifact body lives in the
216
+ * ASSIGNEE's vault — so without this a party to a task can see that a result exists and never
217
+ * read it, which makes every A2A skill that produces a document unusable to its own requester.
218
+ * Adds NO authority: same signed-digest proof and same sender-or-assignee test as `tasks/get`,
219
+ * returning the body that party is already entitled to. The artifactId is bound into the
220
+ * signature (N-1) so a captured one cannot be replayed for a different artifact. */
221
+ tasksArtifact(params: {
222
+ taskId: Hex;
223
+ artifactId: Hex;
224
+ caller: Address;
225
+ signature: Hex;
226
+ issuedAt?: number;
227
+ }): Promise<RpcResult<{
228
+ artifactId: Hex;
229
+ artifactKind?: string;
230
+ bodyRef: VaultRef;
231
+ body: unknown;
232
+ }>>;
84
233
  tasksCancel(params: {
85
234
  taskId: Hex;
86
235
  caller: Address;
236
+ signature: Hex;
237
+ issuedAt?: number;
87
238
  }): Promise<RpcResult<{
88
239
  taskId: Hex;
89
240
  state: Task['state'];
90
241
  }>>;
91
- /** Register the push webhook for a task (FR-5.2). Party-authed. */
242
+ /** Cancel for a caller the TRANSPORT authenticated (spec 372 S4) — same party test, no per-request
243
+ * signature, and callable only from a surface that has already proved who is asking. */
244
+ tasksCancelAs(params: {
245
+ taskId: Hex;
246
+ caller: Address;
247
+ }): Promise<RpcResult<{
248
+ taskId: Hex;
249
+ state: Task['state'];
250
+ }>>;
251
+ /** Read an artifact body for a caller the TRANSPORT already authenticated (spec 372 S4, the `GetTaskArtifact`
252
+ * extension method): the same party test as `tasksArtifact`, without the per-request signature it made at the door. */
253
+ tasksArtifactAs(params: {
254
+ taskId: Hex;
255
+ artifactId: Hex;
256
+ caller: Address;
257
+ }): Promise<RpcResult<{
258
+ artifactId: Hex;
259
+ artifactKind?: string;
260
+ bodyRef: VaultRef;
261
+ body: unknown;
262
+ }>>;
263
+ /** Register the push webhook for a task (FR-5.2). Signed-caller + party-authed (NEW-A2A-2). */
92
264
  pushConfigSet(params: {
93
265
  taskId: Hex;
94
266
  caller: Address;
267
+ signature: Hex;
95
268
  url: string;
96
269
  token?: string;
270
+ issuedAt?: number;
97
271
  }): Promise<RpcResult<{
98
272
  taskId: Hex;
99
273
  registered: true;
100
274
  }>>;
275
+ /** Spec 445 §9 decision 8 — RESUME a payment-parked task once its payment settles. The settlement must name exactly
276
+ * what the task awaits (amount, asset, payee, the park's reference) and the gate's `verifySettlement` must show the
277
+ * proof paid exactly that; the rail's settlement id and the park are each consumed once. On success the task moves
278
+ * input-required → working and the next `processDue` runs it with its ORIGINAL arguments (the inbound body is not
279
+ * replaced). A mismatched, unverifiable, replayed or second settlement leaves the task as it is. */
280
+ settlePayment(params: {
281
+ taskId: Hex;
282
+ settlement: PaymentSettlementV1;
283
+ }): Promise<RpcResult<{
284
+ taskId: Hex;
285
+ state: Task['state'];
286
+ }>>;
101
287
  /** The alarm() body — process every due task to a next state. Returns the events to fan out (W4 delivery). */
102
288
  processDue(): Promise<TaskEvent[]>;
103
- agentCard(): AgentCard;
289
+ /**
290
+ * Build the agent card for an audience. Omitted ⇒ `public` — so an existing caller that serves
291
+ * `/.well-known/agent-card.json` keeps serving a PUBLIC card, never an extended one by accident.
292
+ */
293
+ agentCard(forAudience?: AgentCardAudience): AgentCard;
104
294
  }
105
295
  export interface AgentCard {
106
296
  name: string;
@@ -123,5 +313,19 @@ export interface AgentCard {
123
313
  payment?: SkillPayment;
124
314
  }[];
125
315
  }
316
+ /**
317
+ * Who is asking for the card (spec 338 §8).
318
+ *
319
+ * `authenticated` and `private` MUST only be passed once the caller has been genuinely
320
+ * authenticated — this type does not verify anything, it records a verdict the caller already
321
+ * reached. Passing `'private'` for an unauthenticated request is how an extended card leaks.
322
+ */
323
+ export interface AgentCardAudience {
324
+ audience: 'public' | 'authenticated' | 'private';
325
+ /** The VERIFIED requester. Required for `private`; absent ⇒ no private skill matches. */
326
+ requester?: string;
327
+ }
328
+ /** Spec 445 §9 decision 8 — the default maximum age of a read/control caller signature (seconds). */
329
+ export declare const A2A_CALLER_SIG_MAX_AGE_SEC = 300;
126
330
  export declare function createA2aAgent(config: A2aAgentConfig): A2aAgent;
127
331
  //# sourceMappingURL=agent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,IAAI,EAAc,SAAS,EAAE,UAAU,EAAe,QAAQ,EAAc,MAAM,YAAY,CAAC;AAE7G,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAsB,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC7G,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,WAA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