@antseed/cli 0.1.149 → 0.1.151

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 (71) hide show
  1. package/README.md +38 -19
  2. package/dist/cli/commands/buyer/activity.d.ts +3 -0
  3. package/dist/cli/commands/buyer/activity.d.ts.map +1 -0
  4. package/dist/cli/commands/buyer/activity.js +555 -0
  5. package/dist/cli/commands/buyer/activity.js.map +1 -0
  6. package/dist/cli/commands/buyer/daemon.d.ts +13 -0
  7. package/dist/cli/commands/buyer/daemon.d.ts.map +1 -0
  8. package/dist/cli/commands/buyer/daemon.js +39 -0
  9. package/dist/cli/commands/buyer/daemon.js.map +1 -0
  10. package/dist/cli/commands/buyer/deposit.d.ts +8 -0
  11. package/dist/cli/commands/buyer/deposit.d.ts.map +1 -1
  12. package/dist/cli/commands/buyer/deposit.js +338 -25
  13. package/dist/cli/commands/buyer/deposit.js.map +1 -1
  14. package/dist/cli/commands/buyer/index.d.ts.map +1 -1
  15. package/dist/cli/commands/buyer/index.js +2 -0
  16. package/dist/cli/commands/buyer/index.js.map +1 -1
  17. package/dist/cli/commands/buyer/start.d.ts.map +1 -1
  18. package/dist/cli/commands/buyer/start.js +44 -2
  19. package/dist/cli/commands/buyer/start.js.map +1 -1
  20. package/dist/cli/commands/buyer/sweep.d.ts.map +1 -1
  21. package/dist/cli/commands/buyer/sweep.js +17 -17
  22. package/dist/cli/commands/buyer/sweep.js.map +1 -1
  23. package/dist/cli/commands/payments.d.ts.map +1 -1
  24. package/dist/cli/commands/payments.js +29 -34
  25. package/dist/cli/commands/payments.js.map +1 -1
  26. package/dist/cli/commands/seller/start.d.ts.map +1 -1
  27. package/dist/cli/commands/seller/start.js +4 -1
  28. package/dist/cli/commands/seller/start.js.map +1 -1
  29. package/dist/cli/commands/seller/start.test.js +15 -0
  30. package/dist/cli/commands/seller/start.test.js.map +1 -1
  31. package/dist/cli/index.js +2 -0
  32. package/dist/cli/index.js.map +1 -1
  33. package/dist/config/defaults.d.ts.map +1 -1
  34. package/dist/config/defaults.js +1 -0
  35. package/dist/config/defaults.js.map +1 -1
  36. package/dist/config/loader.d.ts.map +1 -1
  37. package/dist/config/loader.js +2 -0
  38. package/dist/config/loader.js.map +1 -1
  39. package/dist/config/loader.test.js +18 -0
  40. package/dist/config/loader.test.js.map +1 -1
  41. package/dist/config/types.d.ts +7 -0
  42. package/dist/config/types.d.ts.map +1 -1
  43. package/dist/generated/baked-defaults.d.ts +15 -0
  44. package/dist/generated/baked-defaults.d.ts.map +1 -0
  45. package/dist/generated/baked-defaults.js +15 -0
  46. package/dist/generated/baked-defaults.js.map +1 -0
  47. package/dist/plugins/manager.d.ts +1 -0
  48. package/dist/plugins/manager.d.ts.map +1 -1
  49. package/dist/plugins/manager.js +15 -4
  50. package/dist/plugins/manager.js.map +1 -1
  51. package/dist/plugins/manager.test.d.ts +2 -0
  52. package/dist/plugins/manager.test.d.ts.map +1 -0
  53. package/dist/plugins/manager.test.js +15 -0
  54. package/dist/plugins/manager.test.js.map +1 -0
  55. package/dist/proxy/buyer-proxy.d.ts +12 -1
  56. package/dist/proxy/buyer-proxy.d.ts.map +1 -1
  57. package/dist/proxy/buyer-proxy.js +75 -2
  58. package/dist/proxy/buyer-proxy.js.map +1 -1
  59. package/dist/proxy/buyer-proxy.test.js +96 -7
  60. package/dist/proxy/buyer-proxy.test.js.map +1 -1
  61. package/dist/proxy/deposit-watcher.d.ts +125 -0
  62. package/dist/proxy/deposit-watcher.d.ts.map +1 -0
  63. package/dist/proxy/deposit-watcher.js +306 -0
  64. package/dist/proxy/deposit-watcher.js.map +1 -0
  65. package/dist/proxy/deposit-watcher.test.d.ts +2 -0
  66. package/dist/proxy/deposit-watcher.test.d.ts.map +1 -0
  67. package/dist/proxy/deposit-watcher.test.js +173 -0
  68. package/dist/proxy/deposit-watcher.test.js.map +1 -0
  69. package/dist/proxy/request-utils.js +4 -3
  70. package/dist/proxy/request-utils.js.map +1 -1
  71. package/package.json +6 -5
package/README.md CHANGED
@@ -19,11 +19,13 @@ Command-line interface and web dashboard for the AntSeed Network — a P2P netwo
19
19
  | **Buying** | |
20
20
  | `antseed buyer start` | Start the buyer proxy and connect to sellers |
21
21
  | `antseed buyer start --router <name>` | Start the buyer proxy with a non-default router |
22
- | `antseed buyer deposit <amount>` | Deposit USDC for payments |
22
+ | `antseed buyer deposit` | Show your funding address + QR; incoming USDC deposits automatically (gasless) |
23
+ | `antseed buyer sweep` | Manually sweep hot-wallet USDC into deposits (gasless) |
24
+ | `antseed buyer activity` | Activity summary: tokens, spend history, savings, channels, claimable ANTS |
25
+ | `antseed buyer deposit --onchain <usdc>` | Direct on-chain deposit from the hot wallet (requires ETH for gas) |
23
26
  | `antseed buyer withdraw <amount>` | Withdraw USDC from deposits |
24
27
  | `antseed buyer balance` | Check wallet and deposit balance |
25
28
  | `antseed network browse` | Browse peers, models, and pricing (same catalog as `/v1/models`) |
26
- | `antseed payments` | Launch the payments portal |
27
29
  | **Session** | |
28
30
  | `antseed buyer connection get` | Show current session state (pinned service, peer) |
29
31
  | `antseed buyer connection set` | Update service/peer overrides on a running proxy |
@@ -251,6 +253,8 @@ antseed config seller set maxUploadBodyBytes 134217728
251
253
  antseed config buyer set maxPricing.defaults.inputUsdPerMillion 25
252
254
  antseed config buyer set maxPricing.defaults.cachedInputUsdPerMillion 12
253
255
  antseed config buyer set maxPricing.defaults.outputUsdPerMillion 75
256
+ antseed config buyer set routingPreferences.minTrustScore 60
257
+ antseed config buyer set routingPreferences.maxInputUsdPerMillion 25
254
258
  antseed config buyer set peerRefreshIntervalMs 300000
255
259
  antseed config buyer set metadataFetchTimeoutMs 1500
256
260
  antseed config buyer set disableMetadataV2Services true
@@ -274,19 +278,34 @@ This release announces metadata v12. Buyers supporting only older metadata versi
274
278
 
275
279
  ### Model-only routing and peer pinning
276
280
 
277
- Pinning a peer is optional. A request that names only a model auto-selects the
278
- highest-reputation compatible peer allowed by your buyer policy, and fails over
279
- to the next-ranked peer on peer-attributed errors. Discover what the network
280
- serves without any pin:
281
+ Pinning a peer is optional. A request that names only a model uses the shared
282
+ Price + Trust ranking configured under `buyer.routingPreferences`. The default
283
+ `minTrustScore` is `60` and acts as a hard eligibility gate; eligible offers are
284
+ ordered using trust, token or image price, cached-input pricing coverage, recent
285
+ failures, cooldowns, free-peer preference, and seller access rules. Model-only
286
+ requests can fail over on peer-attributed retryable errors.
287
+
288
+ Discover what the network serves without any pin:
281
289
 
282
290
  ```bash
283
291
  # Every model on the network, aggregated across sellers (answered locally)
284
292
  curl -s http://localhost:8377/v1/models | jq '.data[].id'
285
293
 
286
- # Peers, pricing, and reputation
294
+ # Filter the list by modality, or inspect one unified model and its ranked offers
295
+ curl -s 'http://localhost:8377/v1/models?type=text'
296
+ curl -s 'http://localhost:8377/v1/models?type=images'
297
+ curl -s http://localhost:8377/v1/models/<model-id>
298
+
299
+ # Peers, pricing, protocols, capabilities, and reputation
287
300
  antseed network browse
288
301
  ```
289
302
 
303
+ `GET /v1/models` is network-wide and groups compatible aliases. Duplicate
304
+ offers from one seller collapse to its cheapest matching service. For recognized
305
+ conversations, the first successful automatic route becomes a soft affinity:
306
+ later turns prefer the same seller and service while they remain healthy and
307
+ policy-eligible, but can still fail over. Explicit pins remain hard.
308
+
290
309
  When you do want to force a specific seller, pin it. After `antseed buyer
291
310
  start` is running, you can pin all subsequent requests to a peer without
292
311
  restarting:
@@ -302,7 +321,7 @@ antseed buyer connection get
302
321
  antseed buyer connection clear
303
322
  ```
304
323
 
305
- Session peer pins are stored in `~/.antseed/buyer.state.json` and picked up by the running proxy immediately via file-watching. The desktop app reads and writes the same file to expose peer selection in its UI.
324
+ Session peer pins are stored in `~/.antseed/buyer.state.json`, survive proxy restarts, and are picked up by the running proxy immediately via file-watching. The desktop app reads and writes the same file to expose explicit peer selection in its UI.
306
325
 
307
326
  For tools that can only set a model name, use `<peerId>@<model>` as the model. The proxy strips the peer prefix before provider matching and forwards only `<model>` to the seller. If both this model prefix and `x-antseed-pin-peer` are sent, the header selects the peer and the model prefix is still stripped.
308
327
 
@@ -334,24 +353,23 @@ antseed seller start
334
353
  # 1. Set your identity (secp256k1 private key)
335
354
  export ANTSEED_IDENTITY_HEX=<your-private-key-hex>
336
355
 
337
- # 2. Launch the payments portal to deposit USDC
338
- antseed payments
339
- # Payments portal running at http://127.0.0.1:3118
340
-
341
- # 3. In the portal, connect a funded wallet (e.g. MetaMask) and deposit USDC
342
- # for your node. The contract's deposit(buyer, amount) pulls USDC from the
343
- # connected wallet and credits your node — the identity key never holds funds.
344
-
345
- # 4. Connect to the network
356
+ # 2. Connect to the network
346
357
  antseed buyer start
347
358
  # Proxy listening on http://localhost:8377
359
+
360
+ # 3. Fund your node: shows your address + a QR code, then deposits incoming
361
+ # USDC into your credits automatically (gasless — a relayer submits the
362
+ # transaction for a fixed ~$0.05 USDC fee)
363
+ antseed buyer deposit
348
364
  ```
349
365
 
350
366
  Point your AI tools (Claude Code, Codex, etc.) at `http://localhost:8377` as the API base URL. The router handles peer selection and failover transparently.
351
367
 
352
- ### Payments Portal
368
+ ### Depositing USDC
369
+
370
+ `antseed buyer deposit` prints your node's funding address and a QR code (an EIP-681 payment request any mobile wallet can scan). Send USDC on Base to that address from anywhere — an exchange withdrawal, another wallet, a card on-ramp. Incoming funds are swept into your deposits balance gaslessly: your node signs an EIP-3009 authorization and a permissionless relayer submits the transaction for a fixed ~$0.05 USDC fee, so the hot wallet never needs ETH. While watching, the command also serves the connected-wallet checkout page and prints its link (`http://127.0.0.1:3118?token=…`) for depositing from a browser-extension wallet instead.
353
371
 
354
- The payments portal is a local web UI for depositing USDC and viewing payment activity. Run `antseed payments` to start it at `http://localhost:3118`. Connect any funded wallet (MetaMask, Coinbase Wallet, etc.) the contract's `deposit(buyer, amount)` pulls USDC from your connected wallet and credits your node's address. Your node's identity key never needs to hold USDC or ETH.
372
+ While `antseed buyer start` is running, this sweeping happens automatically in the background (disable with `buyer.autoSweep: false` in your config). `antseed buyer sweep` triggers the same gasless sweep manually, and `antseed buyer deposit --onchain <usdc>` remains for direct on-chain deposits from a hot wallet that holds ETH. (The `antseed payments` web portal is retired.)
355
373
 
356
374
  ### Configuration
357
375
 
@@ -371,6 +389,7 @@ Use `base-sepolia` for testing with MockUSDC.
371
389
  ### Runtime Controls
372
390
 
373
391
  - `ANTSEED_BASE_RPC_URL=<url>` — custom Base JSON-RPC endpoint for seller on-chain operations (recommended for production)
392
+ - `ANTSEED_COMPARABLE_PRICES_URL=<url>` — retail-prices models API for the `antseed buyer activity` Saved tile (OpenRouter-compatible schema, e.g. `https://openrouter.ai/api/v1/models`). Release builds ship with a baked-in default; set the variable to override it, or set it to an empty string to disable the savings baseline. Builds from source have no default
374
393
  - `ANTSEED_BUYER_METADATA_FETCH_TIMEOUT_MS=<ms>` — runtime override for buyer peer-discovery metadata fetch timeout
375
394
  - `ANTSEED_BUYER_DISABLE_METADATA_V2_SERVICES=true` — suppress buyer per-service metadata v2 attribution while keeping aggregate usage totals
376
395
  - `ANTSEED_SETTLEMENT_IDLE_MS=600000` — idle time before settling a session (default: 10 minutes)
@@ -0,0 +1,3 @@
1
+ import type { Command } from 'commander';
2
+ export declare function registerBuyerActivityCommand(buyerCmd: Command): void;
3
+ //# sourceMappingURL=activity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/buyer/activity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAqbxC,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAmMpE"}