@agenticprimitives/a2a 0.0.0-alpha.4 → 0.0.0-alpha.40

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 (130) hide show
  1. package/CLAUDE.md +60 -21
  2. package/README.md +2 -0
  3. package/bin/a2a-conform.mjs +17 -0
  4. package/dist/agent.d.ts +170 -3
  5. package/dist/agent.d.ts.map +1 -1
  6. package/dist/agent.js +358 -66
  7. package/dist/agent.js.map +1 -1
  8. package/dist/auth.d.ts +72 -9
  9. package/dist/auth.d.ts.map +1 -1
  10. package/dist/auth.js +62 -19
  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 +74 -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 +232 -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 +25 -8
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +23 -3
  50. package/dist/index.js.map +1 -1
  51. package/dist/payment-gate.d.ts +17 -2
  52. package/dist/payment-gate.d.ts.map +1 -1
  53. package/dist/payment-gate.js +4 -2
  54. package/dist/payment-gate.js.map +1 -1
  55. package/dist/run-provenance-extension.d.ts +22 -0
  56. package/dist/run-provenance-extension.d.ts.map +1 -0
  57. package/dist/run-provenance-extension.js +23 -0
  58. package/dist/run-provenance-extension.js.map +1 -0
  59. package/dist/runtime.d.ts +13 -1
  60. package/dist/runtime.d.ts.map +1 -1
  61. package/dist/runtime.js +35 -10
  62. package/dist/runtime.js.map +1 -1
  63. package/dist/session-wire.d.ts +90 -0
  64. package/dist/session-wire.d.ts.map +1 -0
  65. package/dist/session-wire.js +226 -0
  66. package/dist/session-wire.js.map +1 -0
  67. package/dist/skill-handler.d.ts +21 -1
  68. package/dist/skill-handler.d.ts.map +1 -1
  69. package/dist/skill-handler.js.map +1 -1
  70. package/dist/standard/app-delegation.d.ts +60 -0
  71. package/dist/standard/app-delegation.d.ts.map +1 -0
  72. package/dist/standard/app-delegation.js +43 -0
  73. package/dist/standard/app-delegation.js.map +1 -0
  74. package/dist/standard/caller.d.ts +107 -0
  75. package/dist/standard/caller.d.ts.map +1 -0
  76. package/dist/standard/caller.js +176 -0
  77. package/dist/standard/caller.js.map +1 -0
  78. package/dist/standard/client.d.ts +53 -0
  79. package/dist/standard/client.d.ts.map +1 -0
  80. package/dist/standard/client.js +88 -0
  81. package/dist/standard/client.js.map +1 -0
  82. package/dist/standard/delegated.d.ts +121 -0
  83. package/dist/standard/delegated.d.ts.map +1 -0
  84. package/dist/standard/delegated.js +170 -0
  85. package/dist/standard/delegated.js.map +1 -0
  86. package/dist/standard/errors.d.ts +31 -0
  87. package/dist/standard/errors.d.ts.map +1 -0
  88. package/dist/standard/errors.js +75 -0
  89. package/dist/standard/errors.js.map +1 -0
  90. package/dist/standard/from-agent.d.ts +41 -0
  91. package/dist/standard/from-agent.d.ts.map +1 -0
  92. package/dist/standard/from-agent.js +133 -0
  93. package/dist/standard/from-agent.js.map +1 -0
  94. package/dist/standard/index.d.ts +10 -0
  95. package/dist/standard/index.d.ts.map +1 -0
  96. package/dist/standard/index.js +14 -0
  97. package/dist/standard/index.js.map +1 -0
  98. package/dist/standard/mount.d.ts +94 -0
  99. package/dist/standard/mount.d.ts.map +1 -0
  100. package/dist/standard/mount.js +186 -0
  101. package/dist/standard/mount.js.map +1 -0
  102. package/dist/standard/server.d.ts +130 -0
  103. package/dist/standard/server.d.ts.map +1 -0
  104. package/dist/standard/server.js +497 -0
  105. package/dist/standard/server.js.map +1 -0
  106. package/dist/standard/types.d.ts +186 -0
  107. package/dist/standard/types.d.ts.map +1 -0
  108. package/dist/standard/types.js +14 -0
  109. package/dist/standard/types.js.map +1 -0
  110. package/dist/subject-ask.d.ts +96 -0
  111. package/dist/subject-ask.d.ts.map +1 -0
  112. package/dist/subject-ask.js +45 -0
  113. package/dist/subject-ask.js.map +1 -0
  114. package/dist/subject-hop.d.ts +117 -0
  115. package/dist/subject-hop.d.ts.map +1 -0
  116. package/dist/subject-hop.js +187 -0
  117. package/dist/subject-hop.js.map +1 -0
  118. package/dist/task-store.d.ts +9 -3
  119. package/dist/task-store.d.ts.map +1 -1
  120. package/dist/task-store.js +12 -6
  121. package/dist/task-store.js.map +1 -1
  122. package/dist/wire-verify.d.ts +35 -0
  123. package/dist/wire-verify.d.ts.map +1 -0
  124. package/dist/wire-verify.js +51 -0
  125. package/dist/wire-verify.js.map +1 -0
  126. package/package.json +35 -12
  127. package/dist/jsonrpc.d.ts +0 -25
  128. package/dist/jsonrpc.d.ts.map +0 -1
  129. package/dist/jsonrpc.js +0 -52
  130. package/dist/jsonrpc.js.map +0 -1
package/CLAUDE.md CHANGED
@@ -5,6 +5,17 @@ Async, delegation-authorized **Agent-to-Agent task transport** (spec 269). Any c
5
5
  other claimed agent an asynchronous task and collects the result by poll / push / stream. Built on the
6
6
  `@agenticprimitives/fulfillment` Task substrate; the delegation primitive is the auth.
7
7
 
8
+ ## Agentic role (ADR-0044)
9
+ A2A is the **agentic orchestration, intelligence, and discovery layer**: first-party web apps express
10
+ INTENTS to an a2a agent, which decides *which MCP tools to compose* as primitives. Web NEVER constructs
11
+ MCP tool calls directly. **Orchestration is a Ring-0 primitive** — the agentic loop, planner port, and tool
12
+ model live in a pure `packages/*` orchestration core; ONLY the concrete LLM-framework binding (LangChain/
13
+ OpenAI/Anthropic SDK) sits in a dedicated in-repo adapter behind the port (the `chain-state`+`chain-state-viem`
14
+ pattern). This `a2a` package itself stays pure transport + delegation-auth: it carries tasks, enforces
15
+ authority, and *runs* the orchestration core via the injected `SkillHandler` — it does not embed the LLM SDK.
16
+ See [ADR-0044](../../docs/architecture/decisions/0044-a2a-is-the-agentic-orchestration-layer.md)
17
+ + `docs/architecture/principles.md` §1.
18
+
8
19
  ## The boundary (ADR-0034 — READ FIRST)
9
20
  This package is the **transport-agnostic core**: the Task runtime over a `TaskStore` PORT, the
10
21
  `SkillHandler` contract + dispatcher, the JSON-RPC handlers, the `A2aWireAdapter` client, the
@@ -14,26 +25,45 @@ subpath. We DIVERGE from spec 245's `mcp-runtime/a2a` placement on purpose — `
14
25
  consumer (the receiving `withDelegation` gate + the a2a→mcp delivery leg), not the owner.
15
26
 
16
27
  ## 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.
28
+ W1–W5 of spec 269 are DONE (runtime, delegation-auth gate, `createA2aAgent` + JSON-RPC + client + the `./cloudflare`
29
+ store, vault body residency + signed push + SSE, the two-agent acceptance harness + demo-a2a adoption). The spec's
30
+ §9 decisions and `test/harness.test.ts` (AC-1..AC-4) are the record; this file says what the package IS now.
31
+
32
+ ## THE WIRE — A2A 1.0, and only that (spec 372, folded at S4)
33
+ `src/standard/` IS the wire: A2A **1.0** as the official TCK tests it (PascalCase methods, proto-JSON
34
+ shapes, `A2A-Version`, ErrorInfo on every A2A error, SSE, push). There is no second set of method names —
35
+ `message/send` / `tasks/get` and `jsonrpc.ts` are DELETED, not deprecated.
36
+
37
+ - `createStandardA2aServer({card, executor, principal?, canSeeTask?, beforeSend?, onCancel?})` — fetch-shaped;
38
+ the executor emits events through `ctx` and knows no transport.
39
+ - **Authority rides as an extension.** `standard/delegated.ts`: a `SendMessage` carrying
40
+ `AP_DELEGATED_TASK_EXTENSION` in `message.metadata` is a delegation-authorized task — the grant, the
41
+ requester, and the ENVELOPE the sender signed. `createAgentBackedServer` (`standard/from-agent.ts`) puts
42
+ the `createA2aAgent` runtime behind it; every gate (`authorizeA2aMessage`, `hashA2aMessage`, revocation)
43
+ is the one that was always there, and the runtime keeps its own task ids.
44
+ - **Two facts, kept apart.** The `Authorization` header says who is CALLING (`caller.ts`: a Home session
45
+ bearer, or an agent's session wire). The envelope's signature says who AUTHORED the message. A relay may
46
+ carry a message it did not write, so collapsing them would delete a gate.
47
+ - A **door, never a grant**: `principal` is admission (ADR-0057); authority is the extension + the gates.
48
+ - `canSeeTask` is not optional in a deployment that holds other people's tasks: a non-party is answered
49
+ TaskNotFound, because saying "forbidden" confirms it exists.
50
+ - `tck/sut.mjs` + `scripts/run-a2a-tck.sh` = the TCK in CI (`a2a-tck.yml`), green at MUST/SHOULD/MAY.
51
+ - `./conform` = `ap conform a2a <url>` (spec 399 §2.3): `conformA2a` probes a LIVE agent's card + binding
52
+ (MUSTs flip `ok`; a door without a bearer stops, and says so). Bin `a2a-conform`.
53
+
54
+ ## Promoted from the runtime app (spec 399 §4, W0) — protocol, not product
55
+ - `standard/mount.ts` — mounting this surface in front of a harness: `withStandardCardFields` (the 1.0 card
56
+ fields), `isRuntimeTaskId`, `runtimeBackedTaskStore` (ONE view over the runtime's tasks + this server's),
57
+ `principalBySchemes` (`Bearer` = person, `A2A-Session` = agent — never each other's fallback, ADR-0013),
58
+ `delegatedDispatch` (delegated task → the runtime; engagement probe → a message), `settlementForReplyKind`
59
+ (spec 372 S4's reply-kind → task-state table) + `settleTask`.
60
+ - `subject-hop.ts` — the routed hop over the one wire (spec 366 R4 / 374 §4 / 376): `sendSubjectAskOverWire`
61
+ resolves through the card (`a2aEndpointOf`, digest pin), `subjectAskOf` / `subjectAnswerOf` / `handoffOf`
62
+ read the profiles, `SUBJECT_ANSWER_ARTIFACT` carries the receiver's envelope verbatim.
63
+ - **spec 433** — `subjectAnswerEnvelope`/`subjectAnswerArtifact` (skill result → the asker's envelope);
64
+ `standard/app-delegation.ts` (`appDelegationAsk`: ask-as-me wire + question + service → signed `/harness/ask`).
65
+ - `wire-verify.ts` — `verifyDelegationWire`: the delegate-key tail every A2A service repeats (identity,
66
+ caveats, revocation, signature — one boolean, fail-closed). Caveat SHAPE policy stays with the product.
37
67
 
38
68
  ## Read first
39
69
  1. `capability.manifest.json` — boundary.
@@ -43,7 +73,9 @@ consumer (the receiving `withDelegation` gate + the a2a→mcp delivery leg), not
43
73
 
44
74
  ## Allowed imports
45
75
  `@agenticprimitives/types`, `@agenticprimitives/fulfillment` (Task/Artifact types), `@agenticprimitives/delegation`
46
- (verify + caveats), `viem`. The `./cloudflare` subpath additionally uses `@cloudflare/workers-types` (dev).
76
+ (verify + caveats), `@agenticprimitives/verification-receipts` (spec 303 W3 — the message/send + resubmit
77
+ mint point behind `config.receipts`), `viem`. The `./cloudflare` subpath additionally uses
78
+ `@cloudflare/workers-types` (dev).
47
79
 
48
80
  ## Forbidden imports
49
81
  - `apps/*`
@@ -60,6 +92,13 @@ consumer (the receiving `withDelegation` gate + the a2a→mcp delivery leg), not
60
92
  never reaches another principal's namespace.
61
93
  - No long-lived signing key for a claimed agent — KMS/session signer only (ties to spec-235 §10).
62
94
 
95
+ ## Agent-card audiences (spec 338 §8)
96
+ `agentCard(forAudience?)` projects by `SkillHandler.exposure` (`public` | `authenticated` | `private` | `service-only`;
97
+ omitted ⇒ **public**, so an existing well-known route cannot start leaking). **Passing an audience is not
98
+ authenticating one**: `createCardAudienceResolver` verifies a signed challenge (nonce consumed BEFORE the signature
99
+ read; `x-ap-*` HEADERS, never the query string) and **degrades to `public` on every failure**; `privateViewPolicy` is a
100
+ SEPARATE injected decision (omit ⇒ capped at `authenticated`). Visibility is DISCLOSURE, not authorization.
101
+
63
102
  ## Validate
64
103
  ```bash
65
104
  pnpm --filter @agenticprimitives/a2a typecheck
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.
@@ -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,62 @@ 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 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';
11
+ import { type ApAuthorityExtensionParams } from './authority-extension.js';
10
12
  import { type PaymentGate, 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). */
43
+ verifier: string;
44
+ policyVersion: string;
45
+ onReceipt: (minted: Awaited<ReturnType<typeof mintVerificationReceipt>>, ctx: {
46
+ outcome: 'allow' | 'deny';
47
+ messageId: Hex;
48
+ skill: string;
49
+ taskId?: Hex;
50
+ }) => Promise<void>;
51
+ /** Injected signer over the canonical receiptHash. Omit ⇒ unsigned (integrity-only). */
52
+ sign?: (receiptHash: Sha256) => Promise<ReceiptProof>;
53
+ /** Duty-3 evidence provider (latest block); omit ⇒ blockNumber '0' + zero hash. */
54
+ statusEvidence?: () => Promise<{
55
+ blockNumber: string;
56
+ blockHash: Hex;
57
+ }>;
58
+ /** Per-relationship receipt key; omit ⇒ fresh key per receipt. */
59
+ receiptKey?: Hex;
60
+ /** `true` ⇒ a failed mint/onReceipt aborts the call (spec 291 §5 posture). Default fail-soft. */
61
+ failClosed?: boolean;
62
+ }
11
63
  export interface A2aAgentConfig {
12
64
  /** This agent's Smart Account — the assignee + the allowedTargets the gate requires. */
13
65
  agentSA: Address;
@@ -17,7 +69,25 @@ export interface A2aAgentConfig {
17
69
  enforcers: A2aEnforcers;
18
70
  taskStore: TaskStore;
19
71
  checks: OnChainChecks;
72
+ /** FR-4.2 scope classes for `allowedTargets` — see `ScopeCovers` in auth.ts. Omit ⇒ exact match only. */
73
+ scopeCovers?: ScopeCovers;
20
74
  handlers: SkillHandler[];
75
+ /**
76
+ * Resolve a method the static `handlers` list does not contain — the METHOD-FAMILY seam.
77
+ *
78
+ * (`skill` is this protocol's name for the string a message addresses; the authorization layer
79
+ * calls the same value a METHOD — `skillSelector` reduces it to a `bytes4` the ALLOWED_METHODS
80
+ * enforcer checks. Family members are methods, not necessarily distinct implementations.)
81
+ *
82
+ * Consulted only on a registry miss, so it can never shadow a registered handler. It exists for
83
+ * agents whose method set is DATA rather than code: one hosting a set of archetypes defined in
84
+ * its own library answers `archetype.<slug>` for whatever that library declares, and adding a role
85
+ * is a library write instead of a redeploy. Returning undefined leaves the task rejected as
86
+ * `unknown skill`, exactly as before.
87
+ */
88
+ resolveHandler?: (skill: string) => SkillHandler | undefined;
89
+ /** Extra methods to advertise on the agent card for a family the handlers array cannot list. */
90
+ dynamicSkills?: () => string[];
21
91
  vault: VaultClient;
22
92
  mcp: McpClient;
23
93
  /** Clock + id generators — injected for determinism in tests. */
@@ -30,6 +100,29 @@ export interface A2aAgentConfig {
30
100
  * be a KMS/session signer for the assignee SA (SR-8). */
31
101
  signTerminal?: TerminalSigner;
32
102
  pushSender?: PushSender;
103
+ /**
104
+ * What this deployment actually MOUNTED, for the Agent Card's capability block (ADR-0059).
105
+ *
106
+ * `streaming` is not knowable from here: `message/stream` is served by the SSE transport, which the
107
+ * embedding worker mounts (`dispatchA2aRpc` explicitly rejects it). So the deployment declares it,
108
+ * and the default is FALSE — an agent that has not said it streams is assumed not to, because the
109
+ * cost of over-claiming is a peer that opens a stream which never arrives.
110
+ *
111
+ * `pushNotifications` is NOT taken from here: it is DERIVED from whether push is actually wired
112
+ * (`signTerminal` + `pushSender`), because that is knowable and a config flag could contradict it.
113
+ */
114
+ declaredCapabilities?: {
115
+ streaming?: boolean;
116
+ stateTransitionHistory?: boolean;
117
+ };
118
+ /**
119
+ * The authority model this agent's Card declares (ADR-0059 / spec 341 §2.1).
120
+ *
121
+ * Omit and the Card says nothing about how to authenticate — which is the state that made "an
122
+ * external agent can use the same skills the Home uses" unreachable. It is optional only so the
123
+ * bump is non-breaking; a deployment serving peer-callable skills SHOULD set it.
124
+ */
125
+ authority?: ApAuthorityExtensionParams;
33
126
  /** FR-3.6 — the policy gating skill-handler hand-offs (`requestHandoff`). Omit ⇒ hand-offs are
34
127
  * rejected (fail-closed). */
35
128
  handoffPolicy?: HandoffPolicy;
@@ -37,6 +130,15 @@ export interface A2aAgentConfig {
37
130
  * invoked, the gate decides paid/unpaid (the app wires the payments x402 rail). Omit ⇒ priced skills
38
131
  * behave as free (dev / unpriced deployment). */
39
132
  paymentGate?: PaymentGate;
133
+ /** Spec 290 §6 Stage-3 — the per-Smart-Agent hard-budget port (post-authority, keyed by the verified
134
+ * principal). Omit ⇒ no Stage-3 budget (authority + single-use message-id still apply). */
135
+ budget?: A2aBudgetPort;
136
+ /** N-2 (seam audit): when set, read/control caller signatures (tasks/get, tasks/cancel,
137
+ * pushNotificationConfig/set) MUST carry a recent `issuedAt` (within this many seconds) — bounding
138
+ * replay of a captured signature to the window. Omit ⇒ no freshness requirement (legacy behavior). */
139
+ callerSigMaxAgeSec?: number;
140
+ /** Spec 303 W3 — verification receipts at the message/send + resubmit terminals. Omit ⇒ none. */
141
+ receipts?: A2aReceiptsConfig;
40
142
  }
41
143
  export type RpcOk<T> = {
42
144
  ok: true;
@@ -65,42 +167,95 @@ export interface ResubmitParams extends MessageSendParams {
65
167
  taskId: Hex;
66
168
  }
67
169
  export interface A2aAgent {
170
+ /** `receipt` (spec 303 W3): the PUBLIC verification receipt for the accept — commitment-only,
171
+ * retained by the SENDER independently of this agent. Present only when `config.receipts` is set. */
68
172
  messageSend(params: MessageSendParams): Promise<RpcResult<{
69
173
  taskId: Hex;
70
174
  state: Task['state'];
175
+ receipt?: VerificationReceiptV1;
71
176
  }>>;
72
177
  /** Resume an auth-required task (auth-required → submitted) with a fresh grant + message (FR-3.5). */
73
178
  resubmit(params: ResubmitParams): Promise<RpcResult<{
74
179
  taskId: Hex;
75
180
  state: Task['state'];
181
+ receipt?: VerificationReceiptV1;
76
182
  }>>;
77
183
  tasksGet(params: {
78
184
  taskId: Hex;
79
185
  caller: Address;
186
+ signature: Hex;
187
+ issuedAt?: number;
80
188
  }): Promise<RpcResult<Task & {
81
189
  error?: string;
82
190
  artifactRefs: VaultRef[];
83
191
  }>>;
192
+ /** Read ONE artifact's BODY. `tasks/get` returns refs only, and an artifact body lives in the
193
+ * ASSIGNEE's vault — so without this a party to a task can see that a result exists and never
194
+ * read it, which makes every A2A skill that produces a document unusable to its own requester.
195
+ * Adds NO authority: same signed-digest proof and same sender-or-assignee test as `tasks/get`,
196
+ * returning the body that party is already entitled to. The artifactId is bound into the
197
+ * signature (N-1) so a captured one cannot be replayed for a different artifact. */
198
+ tasksArtifact(params: {
199
+ taskId: Hex;
200
+ artifactId: Hex;
201
+ caller: Address;
202
+ signature: Hex;
203
+ issuedAt?: number;
204
+ }): Promise<RpcResult<{
205
+ artifactId: Hex;
206
+ artifactKind?: string;
207
+ bodyRef: VaultRef;
208
+ body: unknown;
209
+ }>>;
84
210
  tasksCancel(params: {
85
211
  taskId: Hex;
86
212
  caller: Address;
213
+ signature: Hex;
214
+ issuedAt?: number;
215
+ }): Promise<RpcResult<{
216
+ taskId: Hex;
217
+ state: Task['state'];
218
+ }>>;
219
+ /** Cancel for a caller the TRANSPORT authenticated (spec 372 S4) — same party test, no per-request
220
+ * signature, and callable only from a surface that has already proved who is asking. */
221
+ tasksCancelAs(params: {
222
+ taskId: Hex;
223
+ caller: Address;
87
224
  }): Promise<RpcResult<{
88
225
  taskId: Hex;
89
226
  state: Task['state'];
90
227
  }>>;
91
- /** Register the push webhook for a task (FR-5.2). Party-authed. */
228
+ /** Read an artifact body for a caller the TRANSPORT already authenticated (spec 372 S4, the `GetTaskArtifact`
229
+ * extension method): the same party test as `tasksArtifact`, without the per-request signature it made at the door. */
230
+ tasksArtifactAs(params: {
231
+ taskId: Hex;
232
+ artifactId: Hex;
233
+ caller: Address;
234
+ }): Promise<RpcResult<{
235
+ artifactId: Hex;
236
+ artifactKind?: string;
237
+ bodyRef: VaultRef;
238
+ body: unknown;
239
+ }>>;
240
+ /** Register the push webhook for a task (FR-5.2). Signed-caller + party-authed (NEW-A2A-2). */
92
241
  pushConfigSet(params: {
93
242
  taskId: Hex;
94
243
  caller: Address;
244
+ signature: Hex;
95
245
  url: string;
96
246
  token?: string;
247
+ issuedAt?: number;
97
248
  }): Promise<RpcResult<{
98
249
  taskId: Hex;
99
250
  registered: true;
100
251
  }>>;
101
252
  /** The alarm() body — process every due task to a next state. Returns the events to fan out (W4 delivery). */
102
253
  processDue(): Promise<TaskEvent[]>;
103
- agentCard(): AgentCard;
254
+ /**
255
+ * Build the agent card for an audience. Omitted ⇒ `public` — so an existing caller that serves
256
+ * `/.well-known/agent-card.json` keeps serving a PUBLIC card, never an extended one by accident.
257
+ */
258
+ agentCard(forAudience?: AgentCardAudience): AgentCard;
104
259
  }
105
260
  export interface AgentCard {
106
261
  name: string;
@@ -123,5 +278,17 @@ export interface AgentCard {
123
278
  payment?: SkillPayment;
124
279
  }[];
125
280
  }
281
+ /**
282
+ * Who is asking for the card (spec 338 §8).
283
+ *
284
+ * `authenticated` and `private` MUST only be passed once the caller has been genuinely
285
+ * authenticated — this type does not verify anything, it records a verdict the caller already
286
+ * reached. Passing `'private'` for an unauthenticated request is how an extended card leaks.
287
+ */
288
+ export interface AgentCardAudience {
289
+ audience: 'public' | 'authenticated' | 'private';
290
+ /** The VERIFIED requester. Required for `private`; absent ⇒ no private skill matches. */
291
+ requester?: string;
292
+ }
126
293
  export declare function createA2aAgent(config: A2aAgentConfig): A2aAgent;
127
294
  //# 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,EA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