@agenticprimitives/a2a 0.0.0-alpha.1
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.
- package/CLAUDE.md +67 -0
- package/LICENSE +21 -0
- package/README.md +50 -0
- package/dist/agent.d.ts +114 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +191 -0
- package/dist/agent.js.map +1 -0
- package/dist/auth.d.ts +55 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +116 -0
- package/dist/auth.js.map +1 -0
- package/dist/client.d.ts +41 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +43 -0
- package/dist/client.js.map +1 -0
- package/dist/cloudflare/index.d.ts +7 -0
- package/dist/cloudflare/index.d.ts.map +1 -0
- package/dist/cloudflare/index.js +39 -0
- package/dist/cloudflare/index.js.map +1 -0
- package/dist/discovery.d.ts +29 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +22 -0
- package/dist/discovery.js.map +1 -0
- package/dist/grant.d.ts +29 -0
- package/dist/grant.d.ts.map +1 -0
- package/dist/grant.js +29 -0
- package/dist/grant.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/jsonrpc.d.ts +25 -0
- package/dist/jsonrpc.d.ts.map +1 -0
- package/dist/jsonrpc.js +52 -0
- package/dist/jsonrpc.js.map +1 -0
- package/dist/push.d.ts +28 -0
- package/dist/push.d.ts.map +1 -0
- package/dist/push.js +39 -0
- package/dist/push.js.map +1 -0
- package/dist/runtime.d.ts +53 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +154 -0
- package/dist/runtime.js.map +1 -0
- package/dist/skill-handler.d.ts +88 -0
- package/dist/skill-handler.d.ts.map +1 -0
- package/dist/skill-handler.js +32 -0
- package/dist/skill-handler.js.map +1 -0
- package/dist/sse.d.ts +9 -0
- package/dist/sse.d.ts.map +1 -0
- package/dist/sse.js +18 -0
- package/dist/sse.js.map +1 -0
- package/dist/task-store.d.ts +16 -0
- package/dist/task-store.d.ts.map +1 -0
- package/dist/task-store.js +34 -0
- package/dist/task-store.js.map +1 -0
- package/dist/types.d.ts +80 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +11 -0
- package/dist/types.js.map +1 -0
- package/package.json +65 -0
- package/spec.md +4 -0
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# @agenticprimitives/a2a — Claude guide
|
|
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.
|
|
37
|
+
|
|
38
|
+
## 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).
|
|
43
|
+
|
|
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).
|
|
47
|
+
|
|
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/`).**
|
|
53
|
+
|
|
54
|
+
## 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).
|
|
62
|
+
|
|
63
|
+
## Validate
|
|
64
|
+
```bash
|
|
65
|
+
pnpm --filter @agenticprimitives/a2a typecheck
|
|
66
|
+
pnpm --filter @agenticprimitives/a2a test
|
|
67
|
+
```
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Agentic Trust Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# @agenticprimitives/a2a
|
|
2
|
+
|
|
3
|
+
**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
|
+
|
|
5
|
+
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.
|
|
6
|
+
|
|
7
|
+
Concretely: an async, delegation-authorized **Agent-to-Agent task transport**. Any claimed agent sends any other an asynchronous, delegation-scoped task and collects the result by poll, push, or stream. Built on the `@agenticprimitives/fulfillment` Task substrate; specified in [spec 269](../../specs/269-async-delegation-authorized-a2a.md).
|
|
8
|
+
|
|
9
|
+
## What ships
|
|
10
|
+
|
|
11
|
+
All five implementation waves have landed:
|
|
12
|
+
|
|
13
|
+
- **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`.
|
|
15
|
+
- **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
|
+
- **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
|
+
- **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`.
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { newTaskRecord, dispatchTask, buildSkillRegistry, createInMemoryTaskStore } from '@agenticprimitives/a2a';
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Boundary
|
|
24
|
+
|
|
25
|
+
The core is **transport-agnostic** — no Cloudflare coupling in `src/`. The Durable Object-backed `TaskStore` adapter (`createDurableObjectTaskStore`) ships as the `./cloudflare` subpath. See [ADR-0034](../../docs/architecture/decisions/0034-a2a-transport-is-its-own-package-with-cloudflare-adapter.md). `mcp-runtime` is a consumer of this package, not the owner — no back-edges.
|
|
26
|
+
|
|
27
|
+
## How it's different
|
|
28
|
+
|
|
29
|
+
The competing pattern is **A2A protocol SDKs and agent-framework messaging** — transports that move tasks but treat authorization as someone else's problem (a bearer token, a shared secret, an allow-list). Three things this package does that they structurally cannot:
|
|
30
|
+
|
|
31
|
+
- **No task without a verifiable grant.** A task record is only created when the delegation gate verifies the grant; `task.permissionGrantRef` pins the delegation hash, and an on-chain revocation fails the task in flight, closed.
|
|
32
|
+
- **Authorization is not identity.** The caveats and assignee decide *what* may happen; the signed token proves *who* asked. A delegator never reaches another principal's namespace, and no claimed agent holds a long-lived signing key — KMS/session signers only.
|
|
33
|
+
- **Bodies stay in the vault.** Task state carries hashes and refs; payloads live in the assignee's vault with its own access control. The transport never becomes the data store.
|
|
34
|
+
|
|
35
|
+
Because the gate is the same delegation primitive used across the substrate, "this agent may invoke that agent's `summarize` skill until Friday, revocable instantly" is one grant — verifiable on chain, auditable end to end.
|
|
36
|
+
|
|
37
|
+
## Validation
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pnpm --filter @agenticprimitives/a2a typecheck
|
|
41
|
+
pnpm --filter @agenticprimitives/a2a test
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Status
|
|
45
|
+
|
|
46
|
+
Testnet/pilot-ready. Production launch is gated on the public checklist in the root [`README.md`](../../README.md#status--honest-version) — including third-party contract audit and governance key rotation. Track every security finding live in [`docs/audits/findings.yaml`](../../docs/audits/findings.yaml). The runtime runs end to end in the demo apps against Base Sepolia (ERC-1271 + `isRevoked` checks bound to chain).
|
|
47
|
+
|
|
48
|
+
## License
|
|
49
|
+
|
|
50
|
+
UNLICENSED (internal monorepo, not published).
|
package/dist/agent.d.ts
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { HandoffPolicy } from '@agenticprimitives/fulfillment';
|
|
2
|
+
import type { Address, Hex } from '@agenticprimitives/types';
|
|
3
|
+
import type { Delegation } from '@agenticprimitives/delegation';
|
|
4
|
+
import type { Task, TaskEvent, A2aMessage, VaultRef } from './types.js';
|
|
5
|
+
import type { TaskStore } from './task-store.js';
|
|
6
|
+
import { type SkillHandler, type VaultClient, type McpClient } from './skill-handler.js';
|
|
7
|
+
import { type OnChainChecks } from './auth.js';
|
|
8
|
+
import type { A2aEnforcers } from './grant.js';
|
|
9
|
+
import { type TerminalSigner, type PushSender } from './push.js';
|
|
10
|
+
export interface A2aAgentConfig {
|
|
11
|
+
/** This agent's Smart Account — the assignee + the allowedTargets the gate requires. */
|
|
12
|
+
agentSA: Address;
|
|
13
|
+
/** Network identifiers used to derive `permissionGrantRef = hashDelegation(...)`. */
|
|
14
|
+
chainId: number;
|
|
15
|
+
delegationManager: Address;
|
|
16
|
+
enforcers: A2aEnforcers;
|
|
17
|
+
taskStore: TaskStore;
|
|
18
|
+
checks: OnChainChecks;
|
|
19
|
+
handlers: SkillHandler[];
|
|
20
|
+
vault: VaultClient;
|
|
21
|
+
mcp: McpClient;
|
|
22
|
+
/** Clock + id generators — injected for determinism in tests. */
|
|
23
|
+
now?: () => number;
|
|
24
|
+
newTaskId?: () => Hex;
|
|
25
|
+
newArtifactId?: () => Hex;
|
|
26
|
+
/** Hash of an arbitrary body (default keccak256 via the consumer; here a required injection). */
|
|
27
|
+
hashBody: (data: unknown) => Hex;
|
|
28
|
+
/** Terminal push delivery (FR-5.2) — both required to enable push; omit to disable. The signer MUST
|
|
29
|
+
* be a KMS/session signer for the assignee SA (SR-8). */
|
|
30
|
+
signTerminal?: TerminalSigner;
|
|
31
|
+
pushSender?: PushSender;
|
|
32
|
+
/** FR-3.6 — the policy gating skill-handler hand-offs (`requestHandoff`). Omit ⇒ hand-offs are
|
|
33
|
+
* rejected (fail-closed). */
|
|
34
|
+
handoffPolicy?: HandoffPolicy;
|
|
35
|
+
}
|
|
36
|
+
export type RpcOk<T> = {
|
|
37
|
+
ok: true;
|
|
38
|
+
result: T;
|
|
39
|
+
};
|
|
40
|
+
export type RpcErr = {
|
|
41
|
+
ok: false;
|
|
42
|
+
code: number;
|
|
43
|
+
message: string;
|
|
44
|
+
};
|
|
45
|
+
export type RpcResult<T> = RpcOk<T> | RpcErr;
|
|
46
|
+
export interface MessageSendParams {
|
|
47
|
+
delegation: Delegation;
|
|
48
|
+
requester: Address;
|
|
49
|
+
message: A2aMessage;
|
|
50
|
+
/** The input body (persisted to the assignee's vault → bodyRef; FR-2.2). */
|
|
51
|
+
input: unknown;
|
|
52
|
+
pushConfig?: {
|
|
53
|
+
url: string;
|
|
54
|
+
token?: string;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/** Resubmit an auth-required task with a fresh grant (FR-3.5). Carries a NEW signed message (new
|
|
58
|
+
* messageId → no replay) + the input the suspended handler asked for. Only the original sender may. */
|
|
59
|
+
export interface ResubmitParams extends MessageSendParams {
|
|
60
|
+
taskId: Hex;
|
|
61
|
+
}
|
|
62
|
+
export interface A2aAgent {
|
|
63
|
+
messageSend(params: MessageSendParams): Promise<RpcResult<{
|
|
64
|
+
taskId: Hex;
|
|
65
|
+
state: Task['state'];
|
|
66
|
+
}>>;
|
|
67
|
+
/** Resume an auth-required task (auth-required → submitted) with a fresh grant + message (FR-3.5). */
|
|
68
|
+
resubmit(params: ResubmitParams): Promise<RpcResult<{
|
|
69
|
+
taskId: Hex;
|
|
70
|
+
state: Task['state'];
|
|
71
|
+
}>>;
|
|
72
|
+
tasksGet(params: {
|
|
73
|
+
taskId: Hex;
|
|
74
|
+
caller: Address;
|
|
75
|
+
}): Promise<RpcResult<Task & {
|
|
76
|
+
error?: string;
|
|
77
|
+
artifactRefs: VaultRef[];
|
|
78
|
+
}>>;
|
|
79
|
+
tasksCancel(params: {
|
|
80
|
+
taskId: Hex;
|
|
81
|
+
caller: Address;
|
|
82
|
+
}): Promise<RpcResult<{
|
|
83
|
+
taskId: Hex;
|
|
84
|
+
state: Task['state'];
|
|
85
|
+
}>>;
|
|
86
|
+
/** Register the push webhook for a task (FR-5.2). Party-authed. */
|
|
87
|
+
pushConfigSet(params: {
|
|
88
|
+
taskId: Hex;
|
|
89
|
+
caller: Address;
|
|
90
|
+
url: string;
|
|
91
|
+
token?: string;
|
|
92
|
+
}): Promise<RpcResult<{
|
|
93
|
+
taskId: Hex;
|
|
94
|
+
registered: true;
|
|
95
|
+
}>>;
|
|
96
|
+
/** The alarm() body — process every due task to a next state. Returns the events to fan out (W4 delivery). */
|
|
97
|
+
processDue(): Promise<TaskEvent[]>;
|
|
98
|
+
agentCard(): AgentCard;
|
|
99
|
+
}
|
|
100
|
+
export interface AgentCard {
|
|
101
|
+
name: string;
|
|
102
|
+
url: string;
|
|
103
|
+
version: string;
|
|
104
|
+
capabilities: {
|
|
105
|
+
streaming: boolean;
|
|
106
|
+
pushNotifications: boolean;
|
|
107
|
+
stateTransitionHistory: boolean;
|
|
108
|
+
};
|
|
109
|
+
skills: {
|
|
110
|
+
id: string;
|
|
111
|
+
}[];
|
|
112
|
+
}
|
|
113
|
+
export declare function createA2aAgent(config: A2aAgentConfig): A2aAgent;
|
|
114
|
+
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -0,0 +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,EAA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AAC,CAAC,CAAC;IACjH,mEAAmE;IACnE,aAAa,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,GAAG,CAAC;QAAC,MAAM,EAAE,OAAO,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,SAAS,CAAC;QAAE,MAAM,EAAE,GAAG,CAAC;QAAC,UAAU,EAAE,IAAI,CAAA;KAAE,CAAC,CAAC,CAAC;IAC5I,8GAA8G;IAC9G,UAAU,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IACnC,SAAS,IAAI,SAAS,CAAC;CACxB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,iBAAiB,EAAE,OAAO,CAAC;QAAC,sBAAsB,EAAE,OAAO,CAAA;KAAE,CAAC;IAClG,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC1B;AAOD,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,QAAQ,CAiL/D"}
|
package/dist/agent.js
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
// The embeddable agent (spec 269 §8) — wires the W1 runtime + the W2 auth gate into the method handlers
|
|
2
|
+
// an agent worker exposes at /api/a2a, plus the alarm() body (`processDue`) and the agent-card. Storage,
|
|
3
|
+
// HTTP, and the DurableObject are the caller's (the JSON-RPC layer + the ./cloudflare adapter); this stays
|
|
4
|
+
// transport-agnostic. message/send NEVER runs the skill inline (FR-2.3) — it persists + returns submitted;
|
|
5
|
+
// processDue does the work.
|
|
6
|
+
import { hashDelegation } from '@agenticprimitives/delegation';
|
|
7
|
+
import { isTerminal } from './types.js';
|
|
8
|
+
import { newTaskRecord, applyTransition, dispatchTask } from './runtime.js';
|
|
9
|
+
import { buildSkillRegistry } from './skill-handler.js';
|
|
10
|
+
import { authorizeA2aMessage } from './auth.js';
|
|
11
|
+
import { deliverPush } from './push.js';
|
|
12
|
+
const RPC_INVALID_REQUEST = -32600;
|
|
13
|
+
const RPC_UNAUTHORIZED = -32001;
|
|
14
|
+
const RPC_NOT_FOUND = -32004;
|
|
15
|
+
const eq = (a, b) => a.toLowerCase() === b.toLowerCase();
|
|
16
|
+
export function createA2aAgent(config) {
|
|
17
|
+
const registry = buildSkillRegistry(config.handlers);
|
|
18
|
+
const now = () => (config.now ? config.now() : Date.now());
|
|
19
|
+
let artCounter = 0;
|
|
20
|
+
const newArtifactId = () => config.newArtifactId ? config.newArtifactId() : (`0x${(++artCounter).toString(16).padStart(64, '0')}`);
|
|
21
|
+
return {
|
|
22
|
+
async messageSend(params) {
|
|
23
|
+
const auth = await authorizeA2aMessage({
|
|
24
|
+
delegation: params.delegation,
|
|
25
|
+
requester: params.requester,
|
|
26
|
+
message: params.message,
|
|
27
|
+
thisAgentSA: config.agentSA,
|
|
28
|
+
skill: params.message.skill,
|
|
29
|
+
enforcers: config.enforcers,
|
|
30
|
+
checks: config.checks,
|
|
31
|
+
store: config.taskStore,
|
|
32
|
+
now: now(),
|
|
33
|
+
});
|
|
34
|
+
if (!auth.ok)
|
|
35
|
+
return { ok: false, code: RPC_UNAUTHORIZED, message: auth.reason };
|
|
36
|
+
// FR-2.2 — body integrity + vault residency: the signed bodyHash must match the input; persist the
|
|
37
|
+
// input to THIS agent's vault namespace; the message keeps only the ref + hash.
|
|
38
|
+
if (!eq(config.hashBody(params.input), params.message.bodyHash)) {
|
|
39
|
+
return { ok: false, code: RPC_INVALID_REQUEST, message: 'input does not match signed bodyHash' };
|
|
40
|
+
}
|
|
41
|
+
const bodyRef = await config.vault.write({
|
|
42
|
+
owner: config.agentSA,
|
|
43
|
+
recordType: `a2a:msg:${params.message.messageId}`,
|
|
44
|
+
data: params.input,
|
|
45
|
+
});
|
|
46
|
+
const message = { ...params.message, bodyRef };
|
|
47
|
+
const taskId = config.newTaskId ? config.newTaskId() : (`0x${'00'.repeat(31)}01`);
|
|
48
|
+
const record = newTaskRecord({
|
|
49
|
+
taskId,
|
|
50
|
+
principal: auth.principal,
|
|
51
|
+
assignee: config.agentSA,
|
|
52
|
+
sender: params.requester,
|
|
53
|
+
skill: message.skill,
|
|
54
|
+
delegation: params.delegation,
|
|
55
|
+
inbound: message,
|
|
56
|
+
permissionGrantRef: hashDelegation(params.delegation, config.chainId, config.delegationManager),
|
|
57
|
+
inputHash: message.bodyHash,
|
|
58
|
+
now: now(),
|
|
59
|
+
});
|
|
60
|
+
const withPush = params.pushConfig ? { ...record, pushConfig: params.pushConfig } : record;
|
|
61
|
+
await config.taskStore.put(withPush); // FR-2.4 — schedule processing (listDue → alarm)
|
|
62
|
+
return { ok: true, result: { taskId, state: 'submitted' } }; // FR-2.3 — return immediately
|
|
63
|
+
},
|
|
64
|
+
async resubmit(params) {
|
|
65
|
+
const rec = await config.taskStore.get(params.taskId);
|
|
66
|
+
if (!rec)
|
|
67
|
+
return { ok: false, code: RPC_NOT_FOUND, message: 'unknown task' };
|
|
68
|
+
// FR-3.5 — only a task the agent itself parked in auth-required may be resumed, by its sender.
|
|
69
|
+
if (rec.task.state !== 'auth-required')
|
|
70
|
+
return { ok: false, code: RPC_INVALID_REQUEST, message: 'task is not awaiting auth' };
|
|
71
|
+
if (!eq(params.requester, rec.sender))
|
|
72
|
+
return { ok: false, code: RPC_UNAUTHORIZED, message: 'only the original sender may resubmit' };
|
|
73
|
+
if (!eq(params.message.skill, rec.skill))
|
|
74
|
+
return { ok: false, code: RPC_INVALID_REQUEST, message: 'skill mismatch on resubmit' };
|
|
75
|
+
// Re-run the full auth gate on the fresh grant + new message (single-use messageId → no replay).
|
|
76
|
+
const auth = await authorizeA2aMessage({
|
|
77
|
+
delegation: params.delegation, requester: params.requester, message: params.message,
|
|
78
|
+
thisAgentSA: config.agentSA, skill: rec.skill, enforcers: config.enforcers,
|
|
79
|
+
checks: config.checks, store: config.taskStore, now: now(),
|
|
80
|
+
});
|
|
81
|
+
if (!auth.ok)
|
|
82
|
+
return { ok: false, code: RPC_UNAUTHORIZED, message: auth.reason };
|
|
83
|
+
if (!eq(config.hashBody(params.input), params.message.bodyHash)) {
|
|
84
|
+
return { ok: false, code: RPC_INVALID_REQUEST, message: 'input does not match signed bodyHash' };
|
|
85
|
+
}
|
|
86
|
+
const bodyRef = await config.vault.write({
|
|
87
|
+
owner: config.agentSA, recordType: `a2a:msg:${params.message.messageId}`, data: params.input,
|
|
88
|
+
});
|
|
89
|
+
const t = applyTransition(rec, 'submitted', { now: now() });
|
|
90
|
+
if (!t.ok)
|
|
91
|
+
return { ok: false, code: RPC_INVALID_REQUEST, message: t.reason };
|
|
92
|
+
// Replace the grant + append the fresh message (processDue reads the LATEST inbound body).
|
|
93
|
+
const updated = {
|
|
94
|
+
...t.record, delegation: params.delegation,
|
|
95
|
+
task: { ...t.record.task, inputHash: params.message.bodyHash },
|
|
96
|
+
inbound: [...t.record.inbound, { ...params.message, bodyRef }],
|
|
97
|
+
};
|
|
98
|
+
await config.taskStore.put(updated);
|
|
99
|
+
return { ok: true, result: { taskId: params.taskId, state: 'submitted' } };
|
|
100
|
+
},
|
|
101
|
+
async tasksGet({ taskId, caller }) {
|
|
102
|
+
const rec = await config.taskStore.get(taskId);
|
|
103
|
+
if (!rec)
|
|
104
|
+
return { ok: false, code: RPC_NOT_FOUND, message: 'unknown task' };
|
|
105
|
+
// Caller must be the sender or the assignee (FR-2 tasks/get auth).
|
|
106
|
+
if (!eq(caller, rec.sender) && !eq(caller, rec.task.assignee)) {
|
|
107
|
+
return { ok: false, code: RPC_UNAUTHORIZED, message: 'not a party to this task' };
|
|
108
|
+
}
|
|
109
|
+
return { ok: true, result: { ...rec.task, error: rec.error, artifactRefs: rec.artifacts.map((a) => a.bodyRef) } };
|
|
110
|
+
},
|
|
111
|
+
async tasksCancel({ taskId, caller }) {
|
|
112
|
+
const rec = await config.taskStore.get(taskId);
|
|
113
|
+
if (!rec)
|
|
114
|
+
return { ok: false, code: RPC_NOT_FOUND, message: 'unknown task' };
|
|
115
|
+
if (!eq(caller, rec.sender) && !eq(caller, rec.task.assignee)) {
|
|
116
|
+
return { ok: false, code: RPC_UNAUTHORIZED, message: 'not a party to this task' };
|
|
117
|
+
}
|
|
118
|
+
const t = applyTransition(rec, 'canceled', { now: now() });
|
|
119
|
+
if (!t.ok)
|
|
120
|
+
return { ok: false, code: RPC_INVALID_REQUEST, message: t.reason };
|
|
121
|
+
await config.taskStore.put(t.record);
|
|
122
|
+
return { ok: true, result: { taskId, state: 'canceled' } };
|
|
123
|
+
},
|
|
124
|
+
async pushConfigSet({ taskId, caller, url, token }) {
|
|
125
|
+
const rec = await config.taskStore.get(taskId);
|
|
126
|
+
if (!rec)
|
|
127
|
+
return { ok: false, code: RPC_NOT_FOUND, message: 'unknown task' };
|
|
128
|
+
if (!eq(caller, rec.sender) && !eq(caller, rec.task.assignee)) {
|
|
129
|
+
return { ok: false, code: RPC_UNAUTHORIZED, message: 'not a party to this task' };
|
|
130
|
+
}
|
|
131
|
+
const pushConfig = token ? { url, token } : { url };
|
|
132
|
+
await config.taskStore.put({ ...rec, pushConfig });
|
|
133
|
+
return { ok: true, result: { taskId, registered: true } };
|
|
134
|
+
},
|
|
135
|
+
async processDue() {
|
|
136
|
+
const events = [];
|
|
137
|
+
const due = await config.taskStore.listDue(now());
|
|
138
|
+
for (const taskId of due) {
|
|
139
|
+
const rec = await config.taskStore.get(taskId);
|
|
140
|
+
if (!rec || rec.task.state !== 'submitted')
|
|
141
|
+
continue;
|
|
142
|
+
// Per-task context: read the input from the vault, persist emitted artifact bodies to the
|
|
143
|
+
// assignee's vault (A2A-INV-04), expose vault/mcp.
|
|
144
|
+
const captured = [];
|
|
145
|
+
const makeContext = (r) => ({
|
|
146
|
+
input: undefined, // filled below (async read) before dispatch
|
|
147
|
+
delegation: r.delegation,
|
|
148
|
+
vault: config.vault,
|
|
149
|
+
mcp: config.mcp,
|
|
150
|
+
emitArtifact: async (a) => {
|
|
151
|
+
const artifactId = newArtifactId();
|
|
152
|
+
const bodyRef = await config.vault.write({ owner: config.agentSA, recordType: `a2a:artifact:${artifactId}`, data: a.body });
|
|
153
|
+
captured.push({
|
|
154
|
+
artifactId,
|
|
155
|
+
caseId: a.caseId ?? (`0x${'00'.repeat(32)}`),
|
|
156
|
+
producer: config.agentSA,
|
|
157
|
+
artifactKind: a.artifactKind,
|
|
158
|
+
bodyHash: config.hashBody(a.body),
|
|
159
|
+
bodyContentType: a.bodyContentType ?? 'application/json',
|
|
160
|
+
disclosurePolicy: a.disclosurePolicy ?? 'private',
|
|
161
|
+
bodyRef,
|
|
162
|
+
createdAt: now(),
|
|
163
|
+
});
|
|
164
|
+
return artifactId;
|
|
165
|
+
},
|
|
166
|
+
});
|
|
167
|
+
const input = await config.vault.read(rec.inbound[rec.inbound.length - 1].bodyRef);
|
|
168
|
+
const ctxBase = makeContext(rec);
|
|
169
|
+
const { record: processed, events: evs } = await dispatchTask(rec, registry, () => ({ ...ctxBase, input }), now(), config.handoffPolicy ? { handoffPolicy: config.handoffPolicy } : undefined);
|
|
170
|
+
const merged = { ...processed, artifacts: [...processed.artifacts, ...captured] };
|
|
171
|
+
await config.taskStore.put(merged);
|
|
172
|
+
events.push(...evs);
|
|
173
|
+
// FR-5.2 — on a terminal state, deliver a signed push to the registered webhook (best-effort).
|
|
174
|
+
if (isTerminal(merged.task.state) && merged.pushConfig && config.pushSender && config.signTerminal) {
|
|
175
|
+
await deliverPush(merged, config.signTerminal, config.pushSender, now());
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return events;
|
|
179
|
+
},
|
|
180
|
+
agentCard() {
|
|
181
|
+
return {
|
|
182
|
+
name: config.agentSA,
|
|
183
|
+
url: `/api/a2a`,
|
|
184
|
+
version: '0.1.0',
|
|
185
|
+
capabilities: { streaming: true, pushNotifications: true, stateTransitionHistory: true },
|
|
186
|
+
skills: config.handlers.map((h) => ({ id: h.skill })),
|
|
187
|
+
};
|
|
188
|
+
},
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,yGAAyG;AACzG,2GAA2G;AAC3G,2GAA2G;AAC3G,4BAA4B;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAK/D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAuD,MAAM,oBAAoB,CAAC;AAC7G,OAAO,EAAE,mBAAmB,EAAsB,MAAM,WAAW,CAAC;AAEpE,OAAO,EAAE,WAAW,EAAwC,MAAM,WAAW,CAAC;AAqE9E,MAAM,mBAAmB,GAAG,CAAC,KAAK,CAAC;AACnC,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC;AAChC,MAAM,aAAa,GAAG,CAAC,KAAK,CAAC;AAC7B,MAAM,EAAE,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;AAEzE,MAAM,UAAU,cAAc,CAAC,MAAsB;IACnD,MAAM,QAAQ,GAAG,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACrD,MAAM,GAAG,GAAG,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC3D,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,MAAM,aAAa,GAAG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GAAG,QAAQ,CAAC,EAAE,CAAC;gBAC9F,MAAM,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gBACnC,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC;gBAEpB,+FAA+F;gBAC/F,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;oBACnG,MAAM,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC;gBAC3E,CAAC;YACH,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,SAAS;YACP,OAAO;gBACL,IAAI,EAAE,MAAM,CAAC,OAAO;gBACpB,GAAG,EAAE,UAAU;gBACf,OAAO,EAAE,OAAO;gBAChB,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,sBAAsB,EAAE,IAAI,EAAE;gBACxF,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;aACtD,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/auth.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type Address, type Hex } from 'viem';
|
|
2
|
+
import type { Delegation } from '@agenticprimitives/delegation';
|
|
3
|
+
import type { A2aMessage } from './types.js';
|
|
4
|
+
import { type A2aEnforcers } from './grant.js';
|
|
5
|
+
/** Decode the deployed enforcers' term formats (must mirror delegation's encoders byte-for-byte). */
|
|
6
|
+
export declare function decodeTimestampTerms(terms: Hex): {
|
|
7
|
+
validAfter: bigint;
|
|
8
|
+
validUntil: bigint;
|
|
9
|
+
};
|
|
10
|
+
export declare function decodeAllowedTargetsTerms(terms: Hex): readonly Address[];
|
|
11
|
+
export declare function decodeAllowedMethodsTerms(terms: Hex): readonly Hex[];
|
|
12
|
+
/** Canonical hash the SENDER signs for an inbound message (A2A-INV-01). Binds id + sender + skill + body. */
|
|
13
|
+
export declare function hashA2aMessage(m: Pick<A2aMessage, 'messageId' | 'sender' | 'skill' | 'bodyHash' | 'createdAt'>): Hex;
|
|
14
|
+
/** On-chain + crypto verdicts injected by the consumer (viem-backed). All fail-closed. */
|
|
15
|
+
export interface OnChainChecks {
|
|
16
|
+
/** DelegationManager.isRevoked(hashDelegation(d)) — MUST throw or return true to deny. */
|
|
17
|
+
isRevoked(delegation: Delegation): Promise<boolean>;
|
|
18
|
+
/** ERC-1271: the delegator SA signed this delegation. */
|
|
19
|
+
verifyDelegationSignature(delegation: Delegation): Promise<boolean>;
|
|
20
|
+
/** ERC-1271: the sender SA signed `hashA2aMessage(message)`. */
|
|
21
|
+
verifyMessageSignature(message: A2aMessage, digest: Hex): Promise<boolean>;
|
|
22
|
+
}
|
|
23
|
+
/** Single-use reservation seam (the TaskStore provides this; FR-4.3). */
|
|
24
|
+
export interface MessageIdReserver {
|
|
25
|
+
reserveMessageId(messageId: Hex, ttlSec: number): Promise<boolean>;
|
|
26
|
+
}
|
|
27
|
+
export type AuthorizeResult = {
|
|
28
|
+
ok: true;
|
|
29
|
+
principal: Address;
|
|
30
|
+
} | {
|
|
31
|
+
ok: false;
|
|
32
|
+
reason: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Authorize an inbound A2A message. Returns the principal (delegation.delegator) the sender acts for, or
|
|
36
|
+
* a rejection reason. Fail-closed throughout; no task is created on `ok: false`. The message-id is
|
|
37
|
+
* reserved LAST so a rejected message never burns a nonce, while a replay of a valid message hits the
|
|
38
|
+
* already-reserved id.
|
|
39
|
+
*/
|
|
40
|
+
export declare function authorizeA2aMessage(args: {
|
|
41
|
+
delegation: Delegation;
|
|
42
|
+
requester: Address;
|
|
43
|
+
message: A2aMessage;
|
|
44
|
+
/** This receiving agent's SA — the grant's allowedTargets MUST name it. */
|
|
45
|
+
thisAgentSA: Address;
|
|
46
|
+
/** The requested skill — the grant's allowedMethods MUST name its selector (or `*`). */
|
|
47
|
+
skill: string;
|
|
48
|
+
enforcers: A2aEnforcers;
|
|
49
|
+
checks: OnChainChecks;
|
|
50
|
+
store: MessageIdReserver;
|
|
51
|
+
now: number;
|
|
52
|
+
/** Message-id reservation TTL (seconds). Default 600. */
|
|
53
|
+
replayTtlSec?: number;
|
|
54
|
+
}): Promise<AuthorizeResult>;
|
|
55
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAQA,OAAO,EAAgE,KAAK,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAC5G,OAAO,KAAK,EAAE,UAAU,EAAU,MAAM,+BAA+B,CAAC;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAgC,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE7E,qGAAqG;AACrG,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,GAAG,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAG3F;AACD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,OAAO,EAAE,CAGxE;AACD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,GAAG,EAAE,CAGpE;AAED,6GAA6G;AAC7G,wBAAgB,cAAc,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,WAAW,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,WAAW,CAAC,GAAG,GAAG,CAOpH;AA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