agent402-client 0.6.5 → 0.6.7

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 (2) hide show
  1. package/README.md +22 -5
  2. package/package.json +8 -3
package/README.md CHANGED
@@ -29,13 +29,30 @@ const out = await a.call("hash", { text: "hello world", algo: "sha256" });
29
29
  console.log(out.hex);
30
30
  ```
31
31
 
32
- > The hosted catalog is dual-stack: every paid route also accepts MPP (Machine Payments Protocol) credentials from an [`mppx`](https://www.npmjs.com/package/mppx) client, settling USDC on Base/Celo or PathUSD natively on Tempo. This SDK's own payment path is x402 (plus proof-of-work for free tools); see [Paying with MPP](https://github.com/MikeyPetrillo/Agent402/wiki/Paying-with-MPP) to pay over MPP directly.
32
+ ## Paid tools: x402 or MPP, your choice of wire
33
33
 
34
- ## Paid tools (USDC via x402)
34
+ Wallet-only tools settle in USDC. The SDK never touches your key: pass a
35
+ payment-aware `fetch` and it pays 402s for you. Two wires work out of the box,
36
+ because every paid route on Agent402 carries both offers on the same 402:
35
37
 
36
- Wallet-only tools (live search, headless browser, PDFs, durable memory) settle
37
- in USDC. Pass an [`@x402/fetch`](https://www.npmjs.com/package/@x402/fetch)-wrapped
38
- fetch — your wallet signs, the client never touches your key:
38
+ **Over MPP** (Machine Payments Protocol) with the [`mppx`](https://www.npmjs.com/package/mppx) client - USDC on Base/Celo (`evm`), or natively on Tempo (`tempo`):
39
+
40
+ ```js
41
+ import { Fetch, evm, tempo } from "mppx/client";
42
+ import { privateKeyToAccount } from "viem/accounts";
43
+
44
+ const account = privateKeyToAccount(process.env.AGENT_KEY);
45
+ const mppFetch = Fetch.from({ methods: [tempo.charge({ account }), evm.charge({ account })] });
46
+
47
+ const a = new Agent402({ fetch: mppFetch, maxPerCallUsd: 0.05 });
48
+ const verdict = await a.call("sql-guard", { sql: "UPDATE users SET plan = 'pro' WHERE id = 42" });
49
+ ```
50
+
51
+ The SDK's spending caps, reservations and caching apply identically on the MPP
52
+ path (pinned by `scripts/test-client-mpp.js` in the parent repo, which buys
53
+ through the SDK with a real mppx client).
54
+
55
+ **Over x402** with [`@x402/fetch`](https://www.npmjs.com/package/@x402/fetch) - USDC on any of the 12 x402 chains:
39
56
 
40
57
  ```js
41
58
  import { wrapFetchWithPayment } from "@x402/fetch";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agent402-client",
3
- "version": "0.6.5",
4
- "description": "Buyer-side SDK for Agent402.Tools (x402): resolve a task to a tool across a catalog of 500+ pay-per-call endpoints (400+ tools + 100+ skill packs) and call it with payment handled for you - free tools settle via built-in proof-of-work (no wallet), wallet-only tools via your x402 fetch - with a withNetworkPreference helper to pick the settlement chain (USDC on Base/Solana/Polygon/Arbitrum/Monad/Celo/Avalanche/Sei/Optimism/Stellar/Algorand or USDG on Robinhood Chain - 12 chains). Caching, idempotent retries, cross-seller Smart Order Router. The hosted catalog also accepts MPP (Machine Payments Protocol) clients on the same 402 (Base/Celo USDC or native Tempo).",
3
+ "version": "0.6.7",
4
+ "description": "Agentic Finance (AIFI) buyer SDK: buyer-side SDK for Agent402.Tools (x402): resolve a task to a tool across a catalog of 500+ pay-per-call endpoints (400+ tools + 100+ skill packs) and call it with payment handled for you - free tools settle via built-in proof-of-work (no wallet), wallet-only tools via your x402 fetch - with a withNetworkPreference helper to pick the settlement chain (USDC on Base/Solana/Polygon/Arbitrum/Monad/Celo/Avalanche/Sei/Optimism/Stellar/Algorand or USDG on Robinhood Chain - 12 chains). Caching, idempotent retries, cross-seller Smart Order Router. Pays over x402 (@x402/fetch) or MPP (mppx: Base/Celo USDC or native Tempo) - hand it either payment-aware fetch.",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "exports": {
@@ -41,7 +41,12 @@
41
41
  "smart-order-router",
42
42
  "robinhood-chain",
43
43
  "usdg",
44
- "multi-chain"
44
+ "multi-chain",
45
+ "agentic-finance",
46
+ "aifi",
47
+ "agentic-payments",
48
+ "mpp",
49
+ "machine-payments-protocol"
45
50
  ],
46
51
  "author": "Havok Holdings LLC <mike@agent402.tools> (https://agent402.tools)",
47
52
  "license": "MIT",