@absol-labs/agent 0.11.0 → 0.12.0-rc.2

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 (366) hide show
  1. package/README.md +43 -51
  2. package/dist/capability/invocation-capability.d.ts +2 -2
  3. package/dist/capability/probe-capability.d.ts +225 -0
  4. package/dist/capability/probe-capability.d.ts.map +1 -0
  5. package/dist/capability/probe-capability.js +248 -0
  6. package/dist/capability/probe-capability.js.map +1 -0
  7. package/dist/cli/args.d.ts +11 -0
  8. package/dist/cli/args.d.ts.map +1 -1
  9. package/dist/cli/args.js +23 -0
  10. package/dist/cli/args.js.map +1 -1
  11. package/dist/cli/commands/claim.d.ts +32 -0
  12. package/dist/cli/commands/claim.d.ts.map +1 -1
  13. package/dist/cli/commands/claim.js +116 -28
  14. package/dist/cli/commands/claim.js.map +1 -1
  15. package/dist/cli/commands/close.d.ts.map +1 -1
  16. package/dist/cli/commands/close.js +35 -3
  17. package/dist/cli/commands/close.js.map +1 -1
  18. package/dist/cli/commands/invoke.d.ts +2 -0
  19. package/dist/cli/commands/invoke.d.ts.map +1 -1
  20. package/dist/cli/commands/invoke.js +2 -2
  21. package/dist/cli/commands/invoke.js.map +1 -1
  22. package/dist/cli/commands/mcp.d.ts.map +1 -1
  23. package/dist/cli/commands/mcp.js +15 -2
  24. package/dist/cli/commands/mcp.js.map +1 -1
  25. package/dist/cli/commands/open.d.ts.map +1 -1
  26. package/dist/cli/commands/open.js +58 -4
  27. package/dist/cli/commands/open.js.map +1 -1
  28. package/dist/cli/commands/pay.d.ts +34 -0
  29. package/dist/cli/commands/pay.d.ts.map +1 -0
  30. package/dist/cli/commands/pay.js +479 -0
  31. package/dist/cli/commands/pay.js.map +1 -0
  32. package/dist/cli/commands/reclaim-unverified.d.ts.map +1 -1
  33. package/dist/cli/commands/reclaim-unverified.js +3 -2
  34. package/dist/cli/commands/reclaim-unverified.js.map +1 -1
  35. package/dist/cli/commands/reclaim.d.ts +23 -2
  36. package/dist/cli/commands/reclaim.d.ts.map +1 -1
  37. package/dist/cli/commands/reclaim.js +204 -20
  38. package/dist/cli/commands/reclaim.js.map +1 -1
  39. package/dist/cli/commands/refund.d.ts +31 -0
  40. package/dist/cli/commands/refund.d.ts.map +1 -0
  41. package/dist/cli/commands/refund.js +397 -0
  42. package/dist/cli/commands/refund.js.map +1 -0
  43. package/dist/cli/commands/status.d.ts.map +1 -1
  44. package/dist/cli/commands/status.js +21 -2
  45. package/dist/cli/commands/status.js.map +1 -1
  46. package/dist/cli/commands/streams.js +8 -12
  47. package/dist/cli/commands/streams.js.map +1 -1
  48. package/dist/cli/commands/watch.d.ts.map +1 -1
  49. package/dist/cli/commands/watch.js +4 -1
  50. package/dist/cli/commands/watch.js.map +1 -1
  51. package/dist/cli/config.d.ts +44 -26
  52. package/dist/cli/config.d.ts.map +1 -1
  53. package/dist/cli/config.js +88 -38
  54. package/dist/cli/config.js.map +1 -1
  55. package/dist/cli/context.d.ts +19 -0
  56. package/dist/cli/context.d.ts.map +1 -1
  57. package/dist/cli/deps.d.ts +53 -0
  58. package/dist/cli/deps.d.ts.map +1 -1
  59. package/dist/cli/deps.js +51 -1
  60. package/dist/cli/deps.js.map +1 -1
  61. package/dist/cli/errors.d.ts.map +1 -1
  62. package/dist/cli/errors.js +21 -1
  63. package/dist/cli/errors.js.map +1 -1
  64. package/dist/cli/escape-hatch.d.ts +6 -4
  65. package/dist/cli/escape-hatch.d.ts.map +1 -1
  66. package/dist/cli/escape-hatch.js +6 -2
  67. package/dist/cli/escape-hatch.js.map +1 -1
  68. package/dist/cli/listings.d.ts +18 -0
  69. package/dist/cli/listings.d.ts.map +1 -1
  70. package/dist/cli/listings.js +22 -12
  71. package/dist/cli/listings.js.map +1 -1
  72. package/dist/cli/preflight.d.ts +20 -14
  73. package/dist/cli/preflight.d.ts.map +1 -1
  74. package/dist/cli/preflight.js +34 -20
  75. package/dist/cli/preflight.js.map +1 -1
  76. package/dist/cli/privy.d.ts.map +1 -1
  77. package/dist/cli/privy.js +4 -2
  78. package/dist/cli/privy.js.map +1 -1
  79. package/dist/cli/progress.d.ts +13 -1
  80. package/dist/cli/progress.d.ts.map +1 -1
  81. package/dist/cli/progress.js +7 -1
  82. package/dist/cli/progress.js.map +1 -1
  83. package/dist/cli/reclaimability.d.ts +82 -0
  84. package/dist/cli/reclaimability.d.ts.map +1 -0
  85. package/dist/cli/reclaimability.js +80 -0
  86. package/dist/cli/reclaimability.js.map +1 -0
  87. package/dist/cli/run.d.ts +2 -1
  88. package/dist/cli/run.d.ts.map +1 -1
  89. package/dist/cli/run.js +62 -21
  90. package/dist/cli/run.js.map +1 -1
  91. package/dist/cli/scan-range.d.ts +2 -2
  92. package/dist/cli/scan-range.js +2 -2
  93. package/dist/cli/status.d.ts +106 -1
  94. package/dist/cli/status.d.ts.map +1 -1
  95. package/dist/cli/status.js +325 -44
  96. package/dist/cli/status.js.map +1 -1
  97. package/dist/cli/wallet.d.ts +2 -2
  98. package/dist/cli/wallet.d.ts.map +1 -1
  99. package/dist/cli/wallet.js +29 -5
  100. package/dist/cli/wallet.js.map +1 -1
  101. package/dist/discovery/rate-band.d.ts +74 -0
  102. package/dist/discovery/rate-band.d.ts.map +1 -0
  103. package/dist/discovery/rate-band.js +114 -0
  104. package/dist/discovery/rate-band.js.map +1 -0
  105. package/dist/escrow-generation.d.ts +81 -0
  106. package/dist/escrow-generation.d.ts.map +1 -0
  107. package/dist/escrow-generation.js +76 -0
  108. package/dist/escrow-generation.js.map +1 -0
  109. package/dist/frameworks/agentkit.d.ts +8 -4
  110. package/dist/frameworks/agentkit.d.ts.map +1 -1
  111. package/dist/frameworks/agentkit.js +27 -10
  112. package/dist/frameworks/agentkit.js.map +1 -1
  113. package/dist/frameworks/eliza.d.ts +3 -3
  114. package/dist/frameworks/eliza.d.ts.map +1 -1
  115. package/dist/frameworks/eliza.js +15 -6
  116. package/dist/frameworks/eliza.js.map +1 -1
  117. package/dist/frameworks/langchain.d.ts.map +1 -1
  118. package/dist/frameworks/langchain.js +8 -0
  119. package/dist/frameworks/langchain.js.map +1 -1
  120. package/dist/gateway/caller-auth-gateway.d.ts +83 -31
  121. package/dist/gateway/caller-auth-gateway.d.ts.map +1 -1
  122. package/dist/gateway/caller-auth-gateway.js +180 -27
  123. package/dist/gateway/caller-auth-gateway.js.map +1 -1
  124. package/dist/gateway/http-server.d.ts +128 -44
  125. package/dist/gateway/http-server.d.ts.map +1 -1
  126. package/dist/gateway/http-server.js +506 -155
  127. package/dist/gateway/http-server.js.map +1 -1
  128. package/dist/gateway/probe-auth.d.ts +112 -0
  129. package/dist/gateway/probe-auth.d.ts.map +1 -0
  130. package/dist/gateway/probe-auth.js +127 -0
  131. package/dist/gateway/probe-auth.js.map +1 -0
  132. package/dist/gateway/signed-rate-bounds.d.ts +51 -0
  133. package/dist/gateway/signed-rate-bounds.d.ts.map +1 -0
  134. package/dist/gateway/signed-rate-bounds.js +94 -0
  135. package/dist/gateway/signed-rate-bounds.js.map +1 -0
  136. package/dist/gateway/x402-opener-mode.d.ts +252 -0
  137. package/dist/gateway/x402-opener-mode.d.ts.map +1 -0
  138. package/dist/gateway/x402-opener-mode.js +772 -0
  139. package/dist/gateway/x402-opener-mode.js.map +1 -0
  140. package/dist/index.d.ts +6 -2
  141. package/dist/index.d.ts.map +1 -1
  142. package/dist/index.js +10 -5
  143. package/dist/index.js.map +1 -1
  144. package/dist/mcp/server.d.ts +64 -1
  145. package/dist/mcp/server.d.ts.map +1 -1
  146. package/dist/mcp/server.js +247 -37
  147. package/dist/mcp/server.js.map +1 -1
  148. package/dist/mcp/x402-tools.d.ts +109 -0
  149. package/dist/mcp/x402-tools.d.ts.map +1 -0
  150. package/dist/mcp/x402-tools.js +554 -0
  151. package/dist/mcp/x402-tools.js.map +1 -0
  152. package/dist/network.d.ts +119 -0
  153. package/dist/network.d.ts.map +1 -0
  154. package/dist/network.js +199 -0
  155. package/dist/network.js.map +1 -0
  156. package/dist/sdk/client.d.ts +13 -0
  157. package/dist/sdk/client.d.ts.map +1 -1
  158. package/dist/sdk/client.js +15 -0
  159. package/dist/sdk/client.js.map +1 -1
  160. package/dist/sdk/invoke.d.ts +4 -0
  161. package/dist/sdk/invoke.d.ts.map +1 -1
  162. package/dist/sdk/invoke.js +2 -5
  163. package/dist/sdk/invoke.js.map +1 -1
  164. package/dist/wallet/autonomous-wallet-broker.d.ts +3 -0
  165. package/dist/wallet/autonomous-wallet-broker.d.ts.map +1 -1
  166. package/dist/wallet/autonomous-wallet-broker.js +27 -23
  167. package/dist/wallet/autonomous-wallet-broker.js.map +1 -1
  168. package/dist/wallet/autonomous-wallet-protocol.d.ts +8 -2
  169. package/dist/wallet/autonomous-wallet-protocol.d.ts.map +1 -1
  170. package/dist/wallet/autonomous-wallet-protocol.js +9 -2
  171. package/dist/wallet/autonomous-wallet-protocol.js.map +1 -1
  172. package/dist/wallet/autonomous-wallet.d.ts.map +1 -1
  173. package/dist/wallet/autonomous-wallet.js +3 -2
  174. package/dist/wallet/autonomous-wallet.js.map +1 -1
  175. package/dist/wallet/broker-escrows.d.ts +222 -0
  176. package/dist/wallet/broker-escrows.d.ts.map +1 -0
  177. package/dist/wallet/broker-escrows.js +36 -0
  178. package/dist/wallet/broker-escrows.js.map +1 -0
  179. package/dist/wallet/lifecycle.d.ts +21 -5
  180. package/dist/wallet/lifecycle.d.ts.map +1 -1
  181. package/dist/wallet/lifecycle.js +32 -12
  182. package/dist/wallet/lifecycle.js.map +1 -1
  183. package/dist/wallet/privy-broker-server.d.ts.map +1 -1
  184. package/dist/wallet/privy-broker-server.js +31 -26
  185. package/dist/wallet/privy-broker-server.js.map +1 -1
  186. package/dist/wallet/privy-session-broker.d.ts +14 -5
  187. package/dist/wallet/privy-session-broker.d.ts.map +1 -1
  188. package/dist/wallet/privy-session-broker.js +29 -17
  189. package/dist/wallet/privy-session-broker.js.map +1 -1
  190. package/dist/wallet/privy-session-provider.d.ts +3 -1
  191. package/dist/wallet/privy-session-provider.d.ts.map +1 -1
  192. package/dist/wallet/privy-session-provider.js +5 -3
  193. package/dist/wallet/privy-session-provider.js.map +1 -1
  194. package/dist/wallet/provider.d.ts.map +1 -1
  195. package/dist/wallet/provider.js +15 -8
  196. package/dist/wallet/provider.js.map +1 -1
  197. package/dist/x402/facilitator.d.ts +3 -30
  198. package/dist/x402/facilitator.d.ts.map +1 -1
  199. package/dist/x402/facilitator.js +0 -27
  200. package/dist/x402/facilitator.js.map +1 -1
  201. package/dist/x402-buyer/guarded-fetch.d.ts +51 -0
  202. package/dist/x402-buyer/guarded-fetch.d.ts.map +1 -0
  203. package/dist/x402-buyer/guarded-fetch.js +147 -0
  204. package/dist/x402-buyer/guarded-fetch.js.map +1 -0
  205. package/dist/x402-buyer/index.d.ts +10 -0
  206. package/dist/x402-buyer/index.d.ts.map +1 -0
  207. package/dist/x402-buyer/index.js +10 -0
  208. package/dist/x402-buyer/index.js.map +1 -0
  209. package/dist/x402-buyer/pay.d.ts +157 -0
  210. package/dist/x402-buyer/pay.d.ts.map +1 -0
  211. package/dist/x402-buyer/pay.js +366 -0
  212. package/dist/x402-buyer/pay.js.map +1 -0
  213. package/dist/x402-opener/abi.d.ts +684 -0
  214. package/dist/x402-opener/abi.d.ts.map +1 -0
  215. package/dist/x402-opener/abi.js +880 -0
  216. package/dist/x402-opener/abi.js.map +1 -0
  217. package/dist/x402-opener/facilitator-entry.d.ts +3 -0
  218. package/dist/x402-opener/facilitator-entry.d.ts.map +1 -0
  219. package/dist/x402-opener/facilitator-entry.js +40 -0
  220. package/dist/x402-opener/facilitator-entry.js.map +1 -0
  221. package/dist/x402-opener/facilitator-server.d.ts +209 -0
  222. package/dist/x402-opener/facilitator-server.d.ts.map +1 -0
  223. package/dist/x402-opener/facilitator-server.js +762 -0
  224. package/dist/x402-opener/facilitator-server.js.map +1 -0
  225. package/dist/x402-opener/index.d.ts +14 -0
  226. package/dist/x402-opener/index.d.ts.map +1 -0
  227. package/dist/x402-opener/index.js +14 -0
  228. package/dist/x402-opener/index.js.map +1 -0
  229. package/dist/x402-opener/listing-resolver.d.ts +55 -0
  230. package/dist/x402-opener/listing-resolver.d.ts.map +1 -0
  231. package/dist/x402-opener/listing-resolver.js +125 -0
  232. package/dist/x402-opener/listing-resolver.js.map +1 -0
  233. package/dist/x402-opener/refund-relay.d.ts +266 -0
  234. package/dist/x402-opener/refund-relay.d.ts.map +1 -0
  235. package/dist/x402-opener/refund-relay.js +1341 -0
  236. package/dist/x402-opener/refund-relay.js.map +1 -0
  237. package/dist/x402-opener/relayer-queue.d.ts +14 -0
  238. package/dist/x402-opener/relayer-queue.d.ts.map +1 -0
  239. package/dist/x402-opener/relayer-queue.js +18 -0
  240. package/dist/x402-opener/relayer-queue.js.map +1 -0
  241. package/dist/x402-opener/scheme.d.ts +296 -0
  242. package/dist/x402-opener/scheme.d.ts.map +1 -0
  243. package/dist/x402-opener/scheme.js +1035 -0
  244. package/dist/x402-opener/scheme.js.map +1 -0
  245. package/dist/x402-opener/terms.d.ts +165 -0
  246. package/dist/x402-opener/terms.d.ts.map +1 -0
  247. package/dist/x402-opener/terms.js +304 -0
  248. package/dist/x402-opener/terms.js.map +1 -0
  249. package/dist/zktls/reclaim.d.ts +2 -2
  250. package/dist/zktls/t2-delivery-proof.d.ts +6 -6
  251. package/docs/agent-layer.md +3 -2
  252. package/docs/autonomous-privy-wallet.md +188 -0
  253. package/docs/cli.md +265 -34
  254. package/docs/langchain.md +5 -0
  255. package/docs/mcp-reference.md +91 -5
  256. package/docs/probe-capability.md +191 -0
  257. package/docs/quickstart.md +39 -4
  258. package/docs/threat-model.md +20 -0
  259. package/docs/x402.md +766 -593
  260. package/package.json +19 -17
  261. package/src/capability/probe-capability.ts +355 -0
  262. package/src/cli/args.ts +29 -0
  263. package/src/cli/commands/claim.ts +168 -33
  264. package/src/cli/commands/close.ts +36 -3
  265. package/src/cli/commands/invoke.ts +5 -2
  266. package/src/cli/commands/mcp.ts +18 -2
  267. package/src/cli/commands/open.ts +75 -4
  268. package/src/cli/commands/pay.ts +584 -0
  269. package/src/cli/commands/reclaim-unverified.ts +8 -2
  270. package/src/cli/commands/reclaim.ts +277 -19
  271. package/src/cli/commands/refund.ts +475 -0
  272. package/src/cli/commands/status.ts +28 -2
  273. package/src/cli/commands/streams.ts +10 -14
  274. package/src/cli/commands/watch.ts +11 -1
  275. package/src/cli/config.ts +139 -52
  276. package/src/cli/context.ts +16 -0
  277. package/src/cli/deps.ts +111 -1
  278. package/src/cli/errors.ts +24 -1
  279. package/src/cli/escape-hatch.ts +19 -5
  280. package/src/cli/listings.ts +43 -10
  281. package/src/cli/preflight.ts +36 -21
  282. package/src/cli/privy.ts +4 -2
  283. package/src/cli/progress.ts +21 -2
  284. package/src/cli/reclaimability.ts +154 -0
  285. package/src/cli/run.ts +77 -21
  286. package/src/cli/scan-range.ts +2 -2
  287. package/src/cli/status.ts +454 -44
  288. package/src/cli/wallet.ts +45 -8
  289. package/src/discovery/rate-band.ts +172 -0
  290. package/src/escrow-generation.ts +135 -0
  291. package/src/frameworks/agentkit.ts +45 -11
  292. package/src/frameworks/eliza.ts +27 -5
  293. package/src/frameworks/langchain.ts +14 -0
  294. package/src/gateway/caller-auth-gateway.ts +320 -68
  295. package/src/gateway/http-server.ts +717 -220
  296. package/src/gateway/probe-auth.ts +191 -0
  297. package/src/gateway/signed-rate-bounds.ts +164 -0
  298. package/src/gateway/x402-opener-mode.ts +1171 -0
  299. package/src/index.ts +82 -19
  300. package/src/mcp/server.ts +351 -42
  301. package/src/mcp/x402-tools.ts +785 -0
  302. package/src/network.ts +302 -0
  303. package/src/sdk/client.ts +25 -0
  304. package/src/sdk/invoke.ts +6 -5
  305. package/src/wallet/autonomous-wallet-broker.ts +46 -20
  306. package/src/wallet/autonomous-wallet-protocol.ts +11 -2
  307. package/src/wallet/autonomous-wallet.ts +4 -2
  308. package/src/wallet/broker-escrows.ts +66 -0
  309. package/src/wallet/lifecycle.ts +53 -18
  310. package/src/wallet/privy-broker-server.ts +35 -25
  311. package/src/wallet/privy-session-broker.ts +58 -25
  312. package/src/wallet/privy-session-provider.ts +7 -3
  313. package/src/wallet/provider.ts +20 -15
  314. package/src/x402/facilitator.ts +3 -43
  315. package/src/x402-buyer/guarded-fetch.ts +213 -0
  316. package/src/x402-buyer/index.ts +9 -0
  317. package/src/x402-buyer/pay.ts +555 -0
  318. package/src/x402-opener/abi.ts +881 -0
  319. package/src/x402-opener/facilitator-entry.ts +48 -0
  320. package/src/x402-opener/facilitator-server.ts +1114 -0
  321. package/src/x402-opener/index.ts +13 -0
  322. package/src/x402-opener/listing-resolver.ts +202 -0
  323. package/src/x402-opener/refund-relay.ts +1873 -0
  324. package/src/x402-opener/relayer-queue.ts +18 -0
  325. package/src/x402-opener/scheme.ts +1551 -0
  326. package/src/x402-opener/terms.ts +453 -0
  327. package/dist/gateway/x402-mode.d.ts +0 -123
  328. package/dist/gateway/x402-mode.d.ts.map +0 -1
  329. package/dist/gateway/x402-mode.js +0 -212
  330. package/dist/gateway/x402-mode.js.map +0 -1
  331. package/dist/x402/delivery-oracle.d.ts +0 -108
  332. package/dist/x402/delivery-oracle.d.ts.map +0 -1
  333. package/dist/x402/delivery-oracle.js +0 -174
  334. package/dist/x402/delivery-oracle.js.map +0 -1
  335. package/dist/x402/facilitator-server-entry.d.ts +0 -3
  336. package/dist/x402/facilitator-server-entry.d.ts.map +0 -1
  337. package/dist/x402/facilitator-server-entry.js +0 -27
  338. package/dist/x402/facilitator-server-entry.js.map +0 -1
  339. package/dist/x402/facilitator-server.d.ts +0 -73
  340. package/dist/x402/facilitator-server.d.ts.map +0 -1
  341. package/dist/x402/facilitator-server.js +0 -305
  342. package/dist/x402/facilitator-server.js.map +0 -1
  343. package/dist/x402/payment-requirements.d.ts +0 -106
  344. package/dist/x402/payment-requirements.d.ts.map +0 -1
  345. package/dist/x402/payment-requirements.js +0 -138
  346. package/dist/x402/payment-requirements.js.map +0 -1
  347. package/dist/x402/relayer.d.ts +0 -41
  348. package/dist/x402/relayer.d.ts.map +0 -1
  349. package/dist/x402/relayer.js +0 -64
  350. package/dist/x402/relayer.js.map +0 -1
  351. package/dist/x402/resource-index.d.ts +0 -75
  352. package/dist/x402/resource-index.d.ts.map +0 -1
  353. package/dist/x402/resource-index.js +0 -126
  354. package/dist/x402/resource-index.js.map +0 -1
  355. package/dist/x402/verified-delivery-facilitator.d.ts +0 -285
  356. package/dist/x402/verified-delivery-facilitator.d.ts.map +0 -1
  357. package/dist/x402/verified-delivery-facilitator.js +0 -423
  358. package/dist/x402/verified-delivery-facilitator.js.map +0 -1
  359. package/src/gateway/x402-mode.ts +0 -350
  360. package/src/x402/delivery-oracle.ts +0 -285
  361. package/src/x402/facilitator-server-entry.ts +0 -35
  362. package/src/x402/facilitator-server.ts +0 -445
  363. package/src/x402/payment-requirements.ts +0 -231
  364. package/src/x402/relayer.ts +0 -122
  365. package/src/x402/resource-index.ts +0 -228
  366. package/src/x402/verified-delivery-facilitator.ts +0 -744
@@ -24,7 +24,74 @@ export function settlementCoverage(stream, latestCheckpointCheckedAt, nowSeconds
24
24
  pending: stopAt !== null && (coveredUpTo === null || coveredUpTo < stopAt),
25
25
  };
26
26
  }
27
- export async function readStreamReport(read, streamId, nowSeconds) {
27
+ /**
28
+ * The exposure for a stream that has NOT been reclaimed and has a verified
29
+ * proof. Pure, so the per-generation rule is testable without an RPC. Returns
30
+ * `null` when there is nothing to reason about (no proof, or already reclaimed:
31
+ * a reclaimed stream has no hatch left to open).
32
+ */
33
+ export function operatorHatchExposure(stream, verifiedCumulative, generation, provenCumulative) {
34
+ if (stream.reclaimed || verifiedCumulative === null)
35
+ return null;
36
+ const verified = verifiedCumulative > stream.deposit ? stream.deposit : verifiedCumulative;
37
+ let protectedCumulative = stream.claimedCumulative;
38
+ let provenCumulativeKnown = true;
39
+ if (generation === "v3") {
40
+ if (provenCumulative === null) {
41
+ provenCumulativeKnown = false;
42
+ }
43
+ else if (provenCumulative > protectedCumulative) {
44
+ protectedCumulative = provenCumulative;
45
+ }
46
+ }
47
+ const atRiskCumulative = verified > protectedCumulative ? verified - protectedCumulative : 0n;
48
+ return {
49
+ verifiedCumulative: verified,
50
+ protectedCumulative,
51
+ atRiskCumulative,
52
+ provenCumulativeKnown,
53
+ };
54
+ }
55
+ /**
56
+ * Whether the buyer side of a stream is finished, and what the operator holds.
57
+ * Pure, so the rule is testable without an RPC.
58
+ *
59
+ * `stopped` is the escrow's own reclaim gate (closed, or `now >= expiresAt`).
60
+ * `provenCumulative` counts only on V3, and only when it was READ: an
61
+ * unreadable high-water is treated as zero, so it can never make a stream look
62
+ * finished that is not.
63
+ */
64
+ export function finalSettlement(stream, exhaustion) {
65
+ if (stream.reclaimed) {
66
+ return settled("reclaimed", stream.settledCumulative, stream);
67
+ }
68
+ if (exhaustion === undefined || !exhaustion.stopped)
69
+ return null;
70
+ if (stream.deposit <= 0n)
71
+ return null;
72
+ let operatorFloor = stream.claimedCumulative;
73
+ if (exhaustion.generation === "v3" &&
74
+ exhaustion.provenCumulative !== null &&
75
+ exhaustion.provenCumulative > operatorFloor) {
76
+ operatorFloor = exhaustion.provenCumulative;
77
+ }
78
+ if (operatorFloor < stream.deposit)
79
+ return null;
80
+ return settled("deposit-exhausted", stream.deposit, stream);
81
+ }
82
+ function settled(finishedBy, settledToOperator, stream) {
83
+ return {
84
+ finishedBy,
85
+ settledToOperator,
86
+ operatorClaimed: stream.claimedCumulative,
87
+ operatorUnclaimed: settledToOperator > stream.claimedCumulative
88
+ ? settledToOperator - stream.claimedCumulative
89
+ : 0n,
90
+ };
91
+ }
92
+ export async function readStreamReport(read, streamId, nowSeconds,
93
+ /** The escrow's generation (decides the escape-hatch rule). Default `v2`. */
94
+ escrowGeneration = "v2") {
28
95
  const stream = await read.getStreamV2(streamId);
29
96
  // Timing is answered against the chain, because every deadline on this screen
30
97
  // — expiry, and the escape hatch in particular — is compared against
@@ -38,13 +105,38 @@ export async function readStreamReport(read, streamId, nowSeconds) {
38
105
  catch (error) {
39
106
  proofUnavailable = describeError(error);
40
107
  }
108
+ let provenCumulative = null;
109
+ let provenUnavailable = null;
110
+ if (escrowGeneration === "v3") {
111
+ if (read.provenCumulativeOf === undefined) {
112
+ provenUnavailable = "this read client cannot read provenCumulativeOf";
113
+ }
114
+ else {
115
+ try {
116
+ provenCumulative = await read.provenCumulativeOf(streamId);
117
+ }
118
+ catch (error) {
119
+ provenUnavailable = describeError(error);
120
+ }
121
+ }
122
+ }
41
123
  let claimable = null;
124
+ let claimableSource = null;
42
125
  let reclaimable = null;
43
126
  if (proof !== null) {
44
127
  [claimable, reclaimable] = await Promise.all([
45
128
  read.claimableForV2(streamId, proof.cumulativeAmount),
46
129
  read.reclaimableForV2(streamId, proof.cumulativeAmount),
47
130
  ]);
131
+ claimableSource = "checkpoint-proof";
132
+ }
133
+ else if (provenCumulative !== null &&
134
+ provenCumulative > stream.claimedCumulative) {
135
+ // The latest checkpoint no longer lists the stream, but a value proven
136
+ // against a signed root is recorded on-chain. `claimableFor` at that value
137
+ // is exactly what `claimProven` pays (same `_payableCumulative` and fee).
138
+ claimable = await read.claimableForV2(streamId, provenCumulative);
139
+ claimableSource = "proven-on-chain";
48
140
  }
49
141
  let protocolFeeBps = null;
50
142
  try {
@@ -55,7 +147,7 @@ export async function readStreamReport(read, streamId, nowSeconds) {
55
147
  }
56
148
  let escapeHatch = null;
57
149
  try {
58
- escapeHatch = escapeHatchWindow(stream, await read.escapeGraceSeconds(), now.seconds);
150
+ escapeHatch = escapeHatchWindow(stream, await read.escapeGraceSeconds(), now.seconds, escrowGeneration);
59
151
  }
60
152
  catch {
61
153
  escapeHatch = null;
@@ -67,7 +159,14 @@ export async function readStreamReport(read, streamId, nowSeconds) {
67
159
  catch {
68
160
  latestCheckpointCheckedAt = null;
69
161
  }
70
- const settlement = settlementCoverage(stream, latestCheckpointCheckedAt, now.seconds);
162
+ const coverage = settlementCoverage(stream, latestCheckpointCheckedAt, now.seconds);
163
+ const final = finalSettlement(stream, {
164
+ stopped: coverage.stopAt !== null,
165
+ generation: escrowGeneration,
166
+ provenCumulative,
167
+ });
168
+ // A finished stream is settled: there is no checkpoint left to wait for.
169
+ const settlement = final !== null ? { ...coverage, pending: false } : coverage;
71
170
  const attesters = await readAttesterSet(read);
72
171
  return {
73
172
  streamId,
@@ -75,6 +174,7 @@ export async function readStreamReport(read, streamId, nowSeconds) {
75
174
  proof,
76
175
  proofUnavailable,
77
176
  claimable,
177
+ claimableSource,
78
178
  reclaimable,
79
179
  protocolFeeBps,
80
180
  escapeHatch,
@@ -83,6 +183,14 @@ export async function readStreamReport(read, streamId, nowSeconds) {
83
183
  clockSource: now.source,
84
184
  settlement,
85
185
  attesters,
186
+ escrowGeneration,
187
+ provenCumulative,
188
+ provenUnavailable,
189
+ // A finished stream has no hatch left that could take anything.
190
+ operatorExposure: final !== null
191
+ ? null
192
+ : operatorHatchExposure(stream, proof === null ? null : proof.cumulativeAmount, escrowGeneration, provenCumulative),
193
+ finalSettlement: final,
86
194
  };
87
195
  }
88
196
  export function streamReportJson(report) {
@@ -93,6 +201,11 @@ export function streamReportJson(report) {
93
201
  status: stream.status,
94
202
  reclaimed: stream.reclaimed,
95
203
  buyer: stream.buyer,
204
+ // An x402 stream's `buyer` is the X402StreamOpener contract, not the
205
+ // person who paid; `payer` is who any refund goes to.
206
+ opener: stream.opener ?? null,
207
+ payer: stream.payer ?? stream.buyer,
208
+ boughtVia: (stream.opener ?? null) === null ? "wallet" : "x402-opener",
96
209
  operator: stream.operator,
97
210
  serviceRef: stream.serviceRef,
98
211
  deposit: stream.deposit,
@@ -118,8 +231,19 @@ export function streamReportJson(report) {
118
231
  // settled-looking number derived from a checkpoint that predates the
119
232
  // stream's stop time. The superseded figure is still available, explicitly
120
233
  // labelled, under `settlement.provisionalReclaimable`.
121
- claimable: report.claimable,
122
- reclaimable: report.settlement.pending ? null : report.reclaimable,
234
+ // A finished stream with nothing left for the operator has nothing
235
+ // claimable, even when no proof was fetched.
236
+ claimable: report.claimable ??
237
+ (report.finalSettlement?.operatorUnclaimed === 0n ? 0n : null),
238
+ // `checkpoint-proof`, `proven-on-chain` (V3: what `claimProven` pays), or
239
+ // `null` when `claimable` is.
240
+ claimableSource: report.claimableSource,
241
+ // Nothing is reclaimable from a stream whose buyer side is finished.
242
+ reclaimable: report.finalSettlement !== null
243
+ ? 0n
244
+ : report.settlement.pending
245
+ ? null
246
+ : report.reclaimable,
123
247
  settlement: {
124
248
  pending: report.settlement.pending,
125
249
  stopAt: report.settlement.stopAt,
@@ -143,19 +267,59 @@ export function streamReportJson(report) {
143
267
  ready: report.escapeHatch.ready,
144
268
  secondsUntilReady: report.escapeHatch.secondsRemaining,
145
269
  },
270
+ escrowGeneration: report.escrowGeneration,
271
+ // V3 only; `null` on V2 or when unreadable (`provenCumulativeUnavailable`).
272
+ provenCumulative: report.provenCumulative,
273
+ provenCumulativeUnavailable: report.provenUnavailable,
274
+ // True once nothing more is owed to, or can be reclaimed by, the buyer —
275
+ // reclaimed, or stopped with the whole deposit already the operator's —
276
+ // and the escape hatch no longer applies.
277
+ buyerSideFinished: report.finalSettlement !== null,
278
+ // Non-null exactly when `buyerSideFinished`. Gross base units. The buyer's
279
+ // refund is not included: see `FinalSettlement`.
280
+ finalSettlement: report.finalSettlement === null
281
+ ? null
282
+ : {
283
+ finishedBy: report.finalSettlement.finishedBy,
284
+ settledToOperator: report.finalSettlement.settledToOperator,
285
+ operatorClaimed: report.finalSettlement.operatorClaimed,
286
+ operatorUnclaimed: report.finalSettlement.operatorUnclaimed,
287
+ },
288
+ // What the buyer's no-proof escape hatch could take from the operator.
289
+ // `null` once reclaimed or before any proof. Gross base units.
290
+ operatorHatchExposure: report.operatorExposure === null
291
+ ? null
292
+ : {
293
+ units: "gross",
294
+ verifiedCumulative: report.operatorExposure.verifiedCumulative,
295
+ protectedCumulative: report.operatorExposure.protectedCumulative,
296
+ atRiskCumulative: report.operatorExposure.atRiskCumulative,
297
+ protectedOnChain: report.operatorExposure.atRiskCumulative === 0n,
298
+ provenCumulativeKnown: report.operatorExposure.provenCumulativeKnown,
299
+ },
146
300
  };
147
301
  }
148
302
  export function streamReportRows(report) {
149
303
  const { stream, proof } = report;
150
304
  const rows = [
151
- [
152
- "status",
153
- stream.reclaimed ? `${stream.status} (reclaimed)` : stream.status,
154
- ],
155
- ["buyer", stream.buyer],
305
+ ["status", describeStatus(report)],
306
+ ...(stream.opener === null || stream.opener === undefined
307
+ ? [["buyer", stream.buyer]]
308
+ : [
309
+ ["buyer", `${stream.buyer} (x402 opener contract)`],
310
+ ["payer", `${stream.payer} (refunds go here)`],
311
+ ]),
156
312
  ["operator", stream.operator],
157
313
  ["serviceRef", stream.serviceRef],
158
- ["deposit", formatUsdc(stream.deposit)],
314
+ // Reclaim OVERWRITES `deposit` with the operator's entitlement, so after a
315
+ // reclaim the field is what is still escrowed for the operator — not what
316
+ // the buyer put in. Printing it bare would read as "the buyer deposited 0".
317
+ [
318
+ "deposit",
319
+ stream.reclaimed
320
+ ? `${formatUsdc(stream.deposit)} still escrowed for the operator (reclaim replaces the original deposit with the operator's entitlement)`
321
+ : formatUsdc(stream.deposit),
322
+ ],
159
323
  ["rate", `${formatUsdc(stream.ratePerSecond)} / second`],
160
324
  ["opened", formatTimestamp(stream.openedAt)],
161
325
  ["expires", describeDeadline(stream.expiresAt, report.nowSeconds)],
@@ -163,12 +327,12 @@ export function streamReportRows(report) {
163
327
  if (stream.closedAt > 0) {
164
328
  rows.push(["closed", formatTimestamp(stream.closedAt)]);
165
329
  }
166
- rows.push([
167
- "verified accrual",
168
- proof === null
169
- ? `not checkpointed yet (${report.proofUnavailable ?? "no proof"})`
170
- : `${formatUsdc(proof.cumulativeAmount)} @ checkpoint ${proof.checkpointId} (${formatTimestamp(Number(proof.checkedAt))})`,
171
- ]);
330
+ if (report.finalSettlement !== null) {
331
+ rows.push(...finalSettlementRows(report, report.finalSettlement));
332
+ pushTrailingRows(rows, report);
333
+ return rows;
334
+ }
335
+ rows.push(["verified accrual", describeVerifiedAccrual(report)]);
172
336
  // `claim` accepts ANY retained root, so the operator's balance is obtainable
173
337
  // now — it is merely not FINAL until the covering checkpoint lands, and it
174
338
  // can only grow. `reclaim` requires the LATEST root to reach the stop time,
@@ -178,9 +342,11 @@ export function streamReportRows(report) {
178
342
  "operator claimable",
179
343
  report.claimable === null
180
344
  ? "-"
181
- : report.settlement.pending
182
- ? `${formatUsdc(report.claimable)} so far — not final until the checkpoint covering the stop time lands`
183
- : formatUsdc(report.claimable),
345
+ : report.claimableSource === "proven-on-chain"
346
+ ? `${formatUsdc(report.claimable)} (net of the protocol fee) — from the on-chain proven high-water; \`metrik claim\` redeems it with claimProven, no fresh proof needed`
347
+ : report.settlement.pending
348
+ ? `${formatUsdc(report.claimable)} so far (net of the protocol fee) — not final until the checkpoint covering the stop time lands`
349
+ : `${formatUsdc(report.claimable)} (net of the protocol fee)`,
184
350
  ]);
185
351
  rows.push([
186
352
  "buyer reclaimable",
@@ -190,46 +356,161 @@ export function streamReportRows(report) {
190
356
  ? "-"
191
357
  : formatUsdc(report.reclaimable),
192
358
  ]);
359
+ if (report.escrowGeneration === "v3") {
360
+ rows.push([
361
+ "proven on-chain",
362
+ report.provenCumulative === null
363
+ ? `unknown (${report.provenUnavailable ?? "not read"})`
364
+ : `${formatUsdc(report.provenCumulative)} gross (the escrow's proven high-water; the escape hatch cannot take it)`,
365
+ ]);
366
+ }
193
367
  rows.push(["fees paid", formatUsdc(stream.feesPaid)]);
194
- rows.push([
195
- "oracle checkpoint",
196
- report.latestCheckpointCheckedAt === null
197
- ? "-"
198
- : report.latestCheckpointCheckedAt <= 0
199
- ? "none posted yet"
200
- : `latest covers up to ${formatTimestamp(report.latestCheckpointCheckedAt)}`,
201
- ]);
202
- // The no-proof path. Printed for every stream, not only blocked ones: a buyer
203
- // should learn that this exists before they need it.
368
+ rows.push(oracleCheckpointRow(report));
369
+ // The no-proof path. Printed for every live stream, not only blocked ones: a
370
+ // buyer should learn that this exists before they need it.
204
371
  rows.push([
205
372
  "escape hatch",
206
373
  report.escapeHatch === null
207
374
  ? "-"
208
- : `${describeEscapeHatch(report.escapeHatch)} — no-proof reclaim, forfeits the operator's unclaimed earnings`,
375
+ : `${describeEscapeHatch(report.escapeHatch)} — ${report.escrowGeneration === "v3"
376
+ ? "no-proof reclaim, refunds only value not proven on-chain; the operator keeps max(claimed, proven high-water)"
377
+ : "no-proof reclaim, forfeits the operator's unclaimed earnings"}`,
209
378
  ]);
210
- // The same row, read from the seller's side. `reclaimUnverified` pays the
211
- // buyer the WHOLE remaining deposit with no proof, so an operator who has
212
- // earned but not claimed loses it the moment that window opens. The window is
213
- // `expiresAt + escapeGraceSeconds` and the grace is immutable on the live
214
- // escrow, so the only thing an operator can do about it is claim in time —
215
- // which they cannot do if nothing tells them the deadline exists.
216
- if (report.escapeHatch !== null &&
217
- report.claimable !== null &&
218
- report.claimable > 0n) {
219
- rows.push([
379
+ const operatorRow = operatorExposureRow(report);
380
+ if (operatorRow !== null)
381
+ rows.push(operatorRow);
382
+ pushTrailingRows(rows, report);
383
+ return rows;
384
+ }
385
+ /**
386
+ * The same escape-hatch row, read from the seller's side.
387
+ *
388
+ * V2: `reclaimUnverified` settles the operator at `claimedCumulative`, so an
389
+ * operator who has earned but not claimed loses all of it the moment the
390
+ * window opens. The window is fixed and the grace immutable, so the only thing
391
+ * an operator can do about it is claim in time — which they cannot do if
392
+ * nothing tells them the deadline exists.
393
+ *
394
+ * V3: the hatch settles the operator at `max(claimed, provenCumulative)`, so
395
+ * only verified value nobody proved on-chain is exposed. Warning about the
396
+ * WHOLE unclaimed balance there would be false — and would push an operator to
397
+ * spend gas racing a deadline that cannot hurt them.
398
+ */
399
+ function operatorExposureRow(report) {
400
+ const hatch = report.escapeHatch;
401
+ if (hatch === null || report.claimable === null || report.claimable <= 0n) {
402
+ return null;
403
+ }
404
+ if (report.escrowGeneration !== "v3") {
405
+ return [
220
406
  "operator deadline",
221
- report.escapeHatch.ready
407
+ hatch.ready
222
408
  ? `${formatUsdc(report.claimable)} is unclaimed and the buyer's no-proof reclaim is ALREADY open — it would take this amount from the operator`
223
- : `${formatUsdc(report.claimable)} is unclaimed; \`metrik claim\` it before ${formatTimestamp(report.escapeHatch.readyAt)}, after which a buyer's no-proof reclaim can take it`,
409
+ : `${formatUsdc(report.claimable)} is unclaimed; \`metrik claim\` it before ${formatTimestamp(hatch.readyAt)}, after which a buyer's no-proof reclaim can take it`,
410
+ ];
411
+ }
412
+ const exposure = report.operatorExposure;
413
+ if (exposure === null)
414
+ return null;
415
+ const units = `(gross: before the protocol fee; \`metrik claim\` pays the operator net of it — ${formatUsdc(report.claimable)} net unclaimed)`;
416
+ if (exposure.atRiskCumulative === 0n) {
417
+ return [
418
+ "operator earnings",
419
+ `${formatUsdc(exposure.verifiedCumulative)} gross verified, all protected on-chain by the proven high-water — a buyer's no-proof reclaim cannot take it, so it can be claimed at any time with \`metrik claim\` ${units}`,
420
+ ];
421
+ }
422
+ const protectedPart = exposure.provenCumulativeKnown
423
+ ? `${formatUsdc(exposure.protectedCumulative)} gross is protected on-chain (claimed or proven high-water)`
424
+ : "the on-chain proven high-water could not be read, so this assumes none of the unclaimed balance is protected";
425
+ return [
426
+ "operator deadline",
427
+ hatch.ready
428
+ ? `${formatUsdc(exposure.atRiskCumulative)} gross of verified accrual is not proven on-chain and the buyer's no-proof reclaim is ALREADY open — it would refund that part to the buyer. ${protectedPart}. ${units}`
429
+ : `${formatUsdc(exposure.atRiskCumulative)} gross of verified accrual is not proven on-chain; \`metrik claim\` it before ${formatTimestamp(hatch.readyAt)}, after which a buyer's no-proof reclaim refunds that part to the buyer. ${protectedPart}. ${units}`,
430
+ ];
431
+ }
432
+ /**
433
+ * A reclaimed stream, from the state reclaim WROTE. The buyer side is over:
434
+ * no checkpoint to wait for, nothing reclaimable, and no escape hatch left to
435
+ * open (`reclaimUnverified` reverts `AlreadyReclaimed`). So none of those are
436
+ * printed as live items — only what the operator is still owed.
437
+ */
438
+ function finalSettlementRows(report, settlement) {
439
+ const refundTo = report.stream.payer ?? report.stream.buyer;
440
+ const exhausted = settlement.finishedBy === "deposit-exhausted";
441
+ const rows = [
442
+ [
443
+ "buyer side",
444
+ exhausted
445
+ ? `finished — the operator's claimed${report.escrowGeneration === "v3" ? " or proven" : ""} amount already covers the whole deposit, so there is nothing to reclaim (the escrow would revert NothingToReclaim) and the buyer never reclaimed. Nothing more is owed to, or reclaimable by, the buyer.`
446
+ : `finished — the buyer has reclaimed, and the refund was paid to ${refundTo}. Nothing more is owed to, or reclaimable by, the buyer.`,
447
+ ],
448
+ [
449
+ "settled to operator",
450
+ `${formatUsdc(settlement.settledToOperator)} gross (${exhausted ? "the whole deposit" : "fixed at reclaim"})`,
451
+ ],
452
+ ["operator claimed", `${formatUsdc(settlement.operatorClaimed)} gross`],
453
+ [
454
+ "operator unclaimed",
455
+ settlement.operatorUnclaimed === 0n
456
+ ? "none — fully settled"
457
+ : `${formatUsdc(settlement.operatorUnclaimed)} gross, reserved for the operator — the buyer side is finished, so nothing can take it; \`metrik claim\` it at any time (paid net of the protocol fee)`,
458
+ ],
459
+ ];
460
+ if (exhausted && report.provenCumulative !== null) {
461
+ rows.push([
462
+ "proven on-chain",
463
+ `${formatUsdc(report.provenCumulative)} gross (the escrow's proven high-water)`,
224
464
  ]);
225
465
  }
466
+ rows.push(["fees paid", formatUsdc(report.stream.feesPaid)]);
467
+ return rows;
468
+ }
469
+ function describeStatus(report) {
470
+ const { stream } = report;
471
+ const final = report.finalSettlement;
472
+ if (final === null)
473
+ return stream.status;
474
+ if (final.finishedBy === "reclaimed")
475
+ return `${stream.status} (reclaimed)`;
476
+ const stop = stream.closedAt > 0 ? "closed" : "expired";
477
+ return final.operatorUnclaimed === 0n
478
+ ? `${stream.status} (${stop}, fully settled)`
479
+ : `${stream.status} (${stop}, buyer side finished)`;
480
+ }
481
+ /**
482
+ * The verified-accrual row. With no current proof on V3, a non-zero proven
483
+ * high-water IS verified accrual — proven against a signed checkpoint root and
484
+ * recorded on-chain — so it is stated rather than "not checkpointed yet", which
485
+ * reads as "nothing verified".
486
+ */
487
+ function describeVerifiedAccrual(report) {
488
+ const { proof } = report;
489
+ if (proof !== null) {
490
+ return `${formatUsdc(proof.cumulativeAmount)} gross @ checkpoint ${proof.checkpointId} (${formatTimestamp(Number(proof.checkedAt))})`;
491
+ }
492
+ if (report.provenCumulative !== null && report.provenCumulative > 0n) {
493
+ return `${formatUsdc(report.provenCumulative)} gross proven on-chain (provenCumulativeOf) — the latest checkpoint does not contain this stream (${report.proofUnavailable ?? "no proof"}), so this is read from the escrow`;
494
+ }
495
+ return `not checkpointed yet (${report.proofUnavailable ?? "no proof"})`;
496
+ }
497
+ function oracleCheckpointRow(report) {
498
+ return [
499
+ "oracle checkpoint",
500
+ report.latestCheckpointCheckedAt === null
501
+ ? "-"
502
+ : report.latestCheckpointCheckedAt <= 0
503
+ ? "none posted yet"
504
+ : `latest covers up to ${formatTimestamp(report.latestCheckpointCheckedAt)}`,
505
+ ];
506
+ }
507
+ function pushTrailingRows(rows, report) {
226
508
  if (report.protocolFeeBps !== null) {
227
509
  rows.push([
228
510
  "protocol fee",
229
511
  `${report.protocolFeeBps} bps (read from the escrow)`,
230
512
  ]);
231
513
  }
232
- return rows;
233
514
  }
234
515
  /**
235
516
  * What is being waited for, in the place a number used to be. Names the two
@@ -1 +1 @@
1
- {"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/cli/status.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAEL,0BAA0B,EAC1B,eAAe,GAEhB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,YAAY,GAEb,MAAM,mBAAmB,CAAC;AAgC3B;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAAgD,EAChD,yBAAwC,EACxC,UAAkB;IAElB,MAAM,MAAM,GACV,MAAM,CA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cAAc;YACd,GAAG,MAAM,CAAC,cAAc,6BAA6B;SACtD,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,yBAAyB,CAAC,UAA8B;IAC/D,MAAM,MAAM,GACV,UAAU,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IAC9E,MAAM,OAAO,GACX,UAAU,CAAC,WAAW,KAAK,IAAI;QAC7B,CAAC,CAAC,uCAAuC;QACzC,CAAC,CAAC,eAAe,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAC9C,OAAO,oDAAoD,MAAM,sCAAsC,OAAO,6EAA6E,CAAC;AAC9L,CAAC;AAED,SAAS,gBAAgB,CAAC,SAAiB,EAAE,UAAkB;IAC7D,MAAM,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;IACzC,MAAM,MAAM,GACV,SAAS,GAAG,CAAC;QACX,CAAC,CAAC,MAAM,cAAc,CAAC,SAAS,CAAC,EAAE;QACnC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC;IAC1C,OAAO,GAAG,eAAe,CAAC,SAAS,CAAC,MAAM,MAAM,EAAE,CAAC;AACrD,CAAC"}
@@ -12,7 +12,7 @@ import { type PrivyCliWalletSource, type PrivySpendPolicy } from "./privy.js";
12
12
  *
13
13
  * ## Resolution order (first match wins, checked in this order)
14
14
  *
15
- * 1. `METRIK_AGENT_PRIVATE_KEY` — a raw Base Sepolia test key.
15
+ * 1. `METRIK_AGENT_PRIVATE_KEY` — a raw testnet key.
16
16
  * 2. The `CDP_*` / `METRIK_AGENT_CDP_*` quartet — a Coinbase CDP Server Wallet
17
17
  * v2 account, resolved through this package's own `resolveAgentWallet()`.
18
18
  * 3. The `METRIK_AGENT_PRIVY_*` variables — a Privy wallet reached through a
@@ -52,7 +52,7 @@ export { PRIVY_ENV_VARS, PRIVY_SESSION_ENV_VARS, PRIVY_WALLET_KEY_ENV, } from ".
52
52
  * signs an EIP-712 invocation capability and broadcasts NOTHING; telling its
53
53
  * caller "this command signs a transaction" was simply false.
54
54
  */
55
- export type KeyPurpose = "transaction" | "capability";
55
+ export type KeyPurpose = "transaction" | "capability" | "payer-close" | "x402-payment";
56
56
  /** Which environment configured the signer, for output and for error text. */
57
57
  export type CliWalletSource = "private-key" | "cdp" | PrivyCliWalletSource;
58
58
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/cli/wallet.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAE7D,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AAGtF,OAAO,EAKL,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACtB,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,eAAO,MAAM,eAAe,6BAA6B,CAAC;AAE1D,qFAAqF;AACrF,eAAO,MAAM,YAAY,uGAKf,CAAC;AAEX,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG,YAAY,CAAC;AAQtD,8EAA8E;AAC9E,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,KAAK,GAAG,oBAAoB,CAAC;AAE3E;;;;;;;;GAQG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,IAAI,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;AAE7E,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACnC;;;;OAIG;IACH,QAAQ,CAAC,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,CAclB"}
@@ -13,7 +13,7 @@ import { PRIVY_ENV_VARS, PRIVY_SESSION_ENV_VARS, PRIVY_WALLET_KEY_ENV, resolvePr
13
13
  *
14
14
  * ## Resolution order (first match wins, checked in this order)
15
15
  *
16
- * 1. `METRIK_AGENT_PRIVATE_KEY` — a raw Base Sepolia test key.
16
+ * 1. `METRIK_AGENT_PRIVATE_KEY` — a raw testnet key.
17
17
  * 2. The `CDP_*` / `METRIK_AGENT_CDP_*` quartet — a Coinbase CDP Server Wallet
18
18
  * v2 account, resolved through this package's own `resolveAgentWallet()`.
19
19
  * 3. The `METRIK_AGENT_PRIVY_*` variables — a Privy wallet reached through a
@@ -56,10 +56,33 @@ export { PRIVY_ENV_VARS, PRIVY_SESSION_ENV_VARS, PRIVY_WALLET_KEY_ENV, } from ".
56
56
  const PURPOSE_TEXT = {
57
57
  transaction: "signs a transaction",
58
58
  capability: "signs an off-chain EIP-712 invocation capability (no transaction is broadcast)",
59
+ // `metrik refund --close`: the x402 payer signs the opener's EIP-712 `Close`
60
+ // message and the relay broadcasts it, paying the gas. It is NOT an
61
+ // invocation capability, and the key needs no funds at all.
62
+ "payer-close": "signs the payer's off-chain EIP-712 Close message (the refund relay broadcasts it and pays the gas)",
63
+ // `metrik pay`: the payer signs an EIP-3009 TransferWithAuthorization and the
64
+ // seller's facilitator settles it. The payer broadcasts nothing.
65
+ "x402-payment": "signs an EIP-3009 USDC authorization that the seller's facilitator settles (the payer broadcasts no transaction and needs no gas)",
59
66
  };
60
- const WALLET_HINT = `export ${PRIVATE_KEY_ENV}=0x… (a funded Base Sepolia test key), configure a Coinbase CDP wallet with ` +
61
- `${CDP_ENV_VARS.join(", ")}, or configure a Privy wallet with ${PRIVY_WALLET_KEY_ENV} (agent-owned) or ` +
62
- `${PRIVY_SESSION_ENV_VARS.join(", ")} (broker session). All are read from the environment only — never pass a credential as a command-line flag.`;
67
+ const ENV_ONLY = "All are read from the environment only — never pass a credential as a command-line flag.";
68
+ /**
69
+ * How to configure the wallet a purpose needs. "Funded" is said only where a
70
+ * transaction is broadcast: an off-chain signature costs nothing, and telling
71
+ * someone to fund a key for one sends them to a faucet for no reason.
72
+ */
73
+ function walletHint(purpose) {
74
+ if (purpose === "x402-payment") {
75
+ return (`export ${PRIVATE_KEY_ENV}=0x… (a testnet key holding USDC; no ETH needed), or configure a Coinbase CDP wallet with ` +
76
+ `${CDP_ENV_VARS.join(", ")}. A Privy wallet cannot pay x402: its broker does not sign EIP-3009. ${ENV_ONLY}`);
77
+ }
78
+ if (purpose === "payer-close") {
79
+ return (`export ${PRIVATE_KEY_ENV}=0x… (the key that paid; it needs no ETH or USDC), or configure the paying Coinbase CDP wallet with ` +
80
+ `${CDP_ENV_VARS.join(", ")}. A Privy wallet cannot sign the Close. ${ENV_ONLY}`);
81
+ }
82
+ return (`export ${PRIVATE_KEY_ENV}=0x… (${purpose === "transaction" ? "a funded testnet key" : "a testnet key; it needs no funds for this"}), configure a Coinbase CDP wallet with ` +
83
+ `${CDP_ENV_VARS.join(", ")}, or configure a Privy wallet with ${PRIVY_WALLET_KEY_ENV} (agent-owned) or ` +
84
+ `${PRIVY_SESSION_ENV_VARS.join(", ")} (broker session). ${ENV_ONLY}`);
85
+ }
63
86
  /**
64
87
  * Resolves the signing wallet, or throws an actionable configuration error.
65
88
  *
@@ -70,7 +93,8 @@ const WALLET_HINT = `export ${PRIVATE_KEY_ENV}=0x… (a funded Base Sepolia test
70
93
  export async function resolveCliWallet(env, options = {}) {
71
94
  const wallet = await optionalCliWallet(env, options);
72
95
  if (wallet === null) {
73
- throw configError(`this command ${PURPOSE_TEXT[options.purpose ?? "transaction"]} and needs a wallet: none of ${PRIVATE_KEY_ENV}, the CDP variables or the Privy variables are set`, WALLET_HINT);
96
+ const purpose = options.purpose ?? "transaction";
97
+ throw configError(`this command ${PURPOSE_TEXT[purpose]} and needs a wallet: none of ${PRIVATE_KEY_ENV}, the CDP variables or the Privy variables are set`, walletHint(purpose));
74
98
  }
75
99
  return wallet;
76
100
  }