@ashlar-blue/x402-trust 0.5.4 → 0.5.6

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/README.md CHANGED
@@ -2,21 +2,23 @@
2
2
 
3
3
  **Find an x402 facilitator, and decide whether to trust it before you pay.**
4
4
 
5
- Reference implementation of two proposed x402 extensions:
5
+ Reference implementation of four proposed x402 and agent extensions:
6
6
 
7
7
  - **`discovery`** ([x402-foundation/x402 #2979](https://github.com/x402-foundation/x402/pull/2979)) — find a facilitator from a domain name via DNS `TXT` + `/.well-known/x402`. No central directory, no list, no gatekeeper.
8
8
  - **`attestations`** ([#3000](https://github.com/x402-foundation/x402/pull/3000)) — verify what a service claims about itself *before* paying it: TEE attestation blocks and soulbound, revocable, evidence-linked reputation records.
9
+ - **`switchboard & directory`** ([Spec #04](https://ashlar.blue/comms.html)) — discover autonomous agents, inspect Intel TDX / AMD SEV hardware quotes, and route encrypted payloads gated by x402 micro-tolls.
10
+ - **`isda-cdm`** ([IETF draft](https://ashlar.blue/conductor.html)) — parse ISDA Common Domain Model derivatives/securities events and execute atomic DvP clearing across EVM and XRPL rails.
9
11
 
10
- Discovery finds a service. Attestations tell you whether to trust it.
12
+ Discovery finds a service. Attestations tell you whether to trust it. The Switchboard lets agents discover and transact with each other.
11
13
 
12
- ## Three verbs
14
+ ## Four verbs
13
15
 
14
- An agent that spends money has to do three things. This library does each in a
16
+ An agent that spends money and trades has to do four things. This library does each in a
15
17
  handful of lines, with **zero dependencies** and — for the two verification
16
18
  verbs — **zero network and zero trust in us**.
17
19
 
18
20
  ```ts
19
- import { checkService, Transcript, verifyReceipt } from '@ashlar-blue/x402-trust';
21
+ import { checkService, Transcript, verifyReceipt, AshlarSwitchboard } from '@ashlar-blue/x402-trust';
20
22
 
21
23
  // 1. BEFORE YOU PAY — resolve a service and get a plain decision + reasons.
22
24
  const t = await checkService('facilitator.example');
@@ -30,6 +32,18 @@ const receipt = work.prove(0); // hand a counterparty a proof of just their l
30
32
 
31
33
  // 3. WHAT YOU'RE HANDED — verify a receipt offline, trusting no one.
32
34
  verifyReceipt(receipt); // true iff the work was in the committed set
35
+
36
+ // 4. WHO YOU TRANSACT WITH — discover attested agents and route encrypted messages.
37
+ const switchboard = new AshlarSwitchboard();
38
+ const oracles = switchboard.searchDirectory({ capability: 'market-oracle' });
39
+ const message = switchboard.routeMessage({
40
+ from: 'did:x402:my-agent',
41
+ to: oracles[0].did,
42
+ topic: 'quote-request',
43
+ ciphertext: '...',
44
+ nonce: '12345',
45
+ signature: '...',
46
+ });
33
47
  ```
34
48
 
35
49
  `checkService` composes the hardened resolver (same-origin enforcement,
@@ -240,9 +254,44 @@ const verdict = verifyIsdaSettlement(statement, onchainReceipt);
240
254
  if (!verdict.valid) throw new Error(verdict.error);
241
255
  ```
242
256
 
257
+ ## Attested Agent Switchboard & Capability Directory
258
+
259
+ Discover autonomous agents, inspect hardware attestation quotes (Intel TDX / AMD SEV), and route end-to-end encrypted payloads with anti-replay protection and x402 micro-tolls:
260
+
261
+ ```ts
262
+ import { AshlarSwitchboard } from '@ashlar-blue/x402-trust';
263
+
264
+ const switchboard = new AshlarSwitchboard();
265
+
266
+ // 1. Query directory by capability, model, or hardware attestation
267
+ const agents = switchboard.searchDirectory({ capability: 'llm-inference' });
268
+
269
+ // 2. Route an E2E encrypted message to an agent's mailbox
270
+ const envelope = switchboard.routeMessage({
271
+ from: 'did:x402:client-agent',
272
+ to: agents[0].did,
273
+ topic: 'task-request',
274
+ ciphertext: 'encrypted_payload_hex...',
275
+ nonce: 'unique_nonce_123',
276
+ signature: 'sender_ed25519_signature...',
277
+ x402Voucher: {
278
+ amountUSD: '0.001',
279
+ rail: 'eip155:8453',
280
+ payer: '0x1111111111111111111111111111111111111111',
281
+ signature: 'voucher_signature...',
282
+ },
283
+ });
284
+
285
+ // 3. Recipient drains pending envelopes from their FIFO inbox
286
+ const inbox = switchboard.fetchInbox(agents[0].did);
287
+
288
+ // 4. Acknowledge and purge processed messages
289
+ switchboard.acknowledgeMessages(agents[0].did, [envelope.id]);
290
+ ```
291
+
243
292
  ## Status
244
293
 
245
- `0.5.2`. Zero-dependency institutional trust and discovery layer for autonomous AI agents and institutional clearing. Published on npm as `@ashlar-blue/x402-trust`. Requires Node ≥20.
294
+ `0.5.5`. Zero-dependency institutional trust, discovery, and A2A switchboard layer for autonomous AI agents and institutional clearing. Published on npm as `@ashlar-blue/x402-trust`. Requires Node ≥20.
246
295
 
247
296
  MIT.
248
297
 
@@ -1,7 +1,7 @@
1
1
  export declare const MCP_SERVER_INFO: {
2
2
  readonly name: "@ashlar-blue/x402-trust";
3
3
  readonly title: "Ashlar Blue x402 Trust Layer MCP Server";
4
- readonly version: "0.5.4";
4
+ readonly version: "0.5.5";
5
5
  };
6
6
  export declare const X402_MCP_TOOLS: readonly [{
7
7
  readonly name: "x402_check_service";
@@ -18,7 +18,7 @@ import { getAshlarSwitchboard } from './agent-switchboard.js';
18
18
  export const MCP_SERVER_INFO = {
19
19
  name: '@ashlar-blue/x402-trust',
20
20
  title: 'Ashlar Blue x402 Trust Layer MCP Server',
21
- version: '0.5.4',
21
+ version: '0.5.5',
22
22
  };
23
23
  export const X402_MCP_TOOLS = [
24
24
  {
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@ashlar-blue/x402-trust",
3
- "version": "0.5.4",
4
- "description": "The institutional trust layer for autonomous AI agents: discover payment endpoints via DNS, verify TEE hardware quotes, generate SCITT receipts, parse ISDA CDM securities lifecycle events, and run Model Context Protocol (MCP) toolchains. Zero dependencies.",
3
+ "version": "0.5.6",
4
+ "description": "The institutional trust and communications layer for autonomous AI agents: capability directory, asynchronous encrypted relay, discover payment endpoints via DNS, verify TEE hardware quotes, generate SCITT receipts, parse ISDA CDM securities lifecycle events, and run Model Context Protocol (MCP) toolchains. Zero dependencies.",
5
5
  "keywords": [
6
6
  "x402",
7
+ "switchboard",
8
+ "agent-directory",
9
+ "relay",
7
10
  "mcp",
8
11
  "model-context-protocol",
9
12
  "agents",