tenjin-cli 0.1.0-alpha.31 → 0.1.0-alpha.32

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 (258) hide show
  1. package/README.md +5 -5
  2. package/dist/{_esm-MEXZI5DL.js → _esm-RLLC72MS.js} +128 -132
  3. package/dist/{alive-J64H46HI.js → alive-MROUMFH3.js} +13 -6
  4. package/dist/auto-update-OPWMRZLS.js +22 -0
  5. package/dist/{ccip-7RMRLAGV.js → ccip-DHDFKTQV.js} +2 -2
  6. package/dist/chunk-2GNOFONN.js +560 -0
  7. package/dist/chunk-2GNOFONN.js.map +1 -0
  8. package/dist/{chunk-TTNESUPQ.js → chunk-2GP3HRYK.js} +2120 -193
  9. package/dist/chunk-2GP3HRYK.js.map +1 -0
  10. package/dist/chunk-3AIHRXKO.js +72 -0
  11. package/dist/chunk-3AIHRXKO.js.map +1 -0
  12. package/dist/{chunk-LEFIX6RS.js → chunk-3DIL66VX.js} +31 -11
  13. package/dist/chunk-3DIL66VX.js.map +1 -0
  14. package/dist/{chunk-S4SAZ7OD.js → chunk-3FMZGI7I.js} +12 -2
  15. package/dist/{chunk-S4SAZ7OD.js.map → chunk-3FMZGI7I.js.map} +1 -1
  16. package/dist/{chunk-7Q5FDF65.js → chunk-445VQTVM.js} +3 -3
  17. package/dist/{chunk-A36LQPHV.js → chunk-4LMUQMBH.js} +1 -1
  18. package/dist/{chunk-A36LQPHV.js.map → chunk-4LMUQMBH.js.map} +1 -1
  19. package/dist/{chunk-KXQ4UIP7.js → chunk-4USCZ2NI.js} +2 -2
  20. package/dist/chunk-62KNUYWD.js +111 -0
  21. package/dist/chunk-62KNUYWD.js.map +1 -0
  22. package/dist/{chunk-POUWHWID.js → chunk-6CMM6YCB.js} +3 -3
  23. package/dist/{chunk-POUWHWID.js.map → chunk-6CMM6YCB.js.map} +1 -1
  24. package/dist/{chunk-5MARFNSB.js → chunk-AD226HDR.js} +49 -30
  25. package/dist/chunk-AD226HDR.js.map +1 -0
  26. package/dist/chunk-ADV4LDTB.js +106 -0
  27. package/dist/chunk-ADV4LDTB.js.map +1 -0
  28. package/dist/{chunk-7WU4OPLP.js → chunk-AV5NZMYO.js} +5 -3
  29. package/dist/{chunk-7WU4OPLP.js.map → chunk-AV5NZMYO.js.map} +1 -1
  30. package/dist/chunk-B7EM4GGF.js +198 -0
  31. package/dist/chunk-B7EM4GGF.js.map +1 -0
  32. package/dist/chunk-BFDQ4WNW.js +119 -0
  33. package/dist/chunk-BFDQ4WNW.js.map +1 -0
  34. package/dist/{chunk-2XLC3AEX.js → chunk-BI673VEJ.js} +536 -510
  35. package/dist/chunk-BI673VEJ.js.map +1 -0
  36. package/dist/chunk-CEXSOI5R.js +808 -0
  37. package/dist/chunk-CEXSOI5R.js.map +1 -0
  38. package/dist/{chunk-FW75G2W4.js → chunk-CISYM4EO.js} +5 -5
  39. package/dist/{chunk-B7HUUJOK.js → chunk-D3ZURCG7.js} +3 -3
  40. package/dist/chunk-D5TOQSO4.js +474 -0
  41. package/dist/chunk-D5TOQSO4.js.map +1 -0
  42. package/dist/{chunk-UQUOVWBG.js → chunk-DRDUIZIA.js} +7 -7
  43. package/dist/{chunk-27EPWVOY.js → chunk-DW4YTVR3.js} +2 -2
  44. package/dist/chunk-E7LGOMH6.js +449 -0
  45. package/dist/chunk-E7LGOMH6.js.map +1 -0
  46. package/dist/{chunk-QSCPK4F5.js → chunk-E7SW44LM.js} +4 -11
  47. package/dist/chunk-E7SW44LM.js.map +1 -0
  48. package/dist/chunk-EDJWHDDL.js +33 -0
  49. package/dist/chunk-EDJWHDDL.js.map +1 -0
  50. package/dist/chunk-F3ED5WTR.js +13 -0
  51. package/dist/chunk-F3ED5WTR.js.map +1 -0
  52. package/dist/chunk-G75OPGAK.js +111 -0
  53. package/dist/chunk-G75OPGAK.js.map +1 -0
  54. package/dist/{chunk-R5LCN54M.js → chunk-GAKUQHKA.js} +13 -17
  55. package/dist/{chunk-R5LCN54M.js.map → chunk-GAKUQHKA.js.map} +1 -1
  56. package/dist/{chunk-4ZZO6ULA.js → chunk-HDPUXS3Z.js} +19 -48
  57. package/dist/chunk-HDPUXS3Z.js.map +1 -0
  58. package/dist/{chunk-ORWL5BSN.js → chunk-HGZEPQUT.js} +2 -2
  59. package/dist/{chunk-6E5R45ZO.js → chunk-HREHWL32.js} +4 -4
  60. package/dist/{chunk-6E5R45ZO.js.map → chunk-HREHWL32.js.map} +1 -1
  61. package/dist/{chunk-KXVP2VKA.js → chunk-I5TDIUKM.js} +15 -34
  62. package/dist/chunk-I5TDIUKM.js.map +1 -0
  63. package/dist/{chunk-7QKHZQKW.js → chunk-IADZOXKN.js} +39 -6
  64. package/dist/chunk-IADZOXKN.js.map +1 -0
  65. package/dist/{chunk-P4NH7OUK.js → chunk-IDTRSAHE.js} +2 -2
  66. package/dist/{chunk-YFPY4ONH.js → chunk-JEVQ5LKO.js} +4 -4
  67. package/dist/chunk-JNJWBTU2.js +3497 -0
  68. package/dist/chunk-JNJWBTU2.js.map +1 -0
  69. package/dist/{chunk-MNXS2U45.js → chunk-JRZBBPO6.js} +167 -86
  70. package/dist/chunk-JRZBBPO6.js.map +1 -0
  71. package/dist/{chunk-WJXLQXJY.js → chunk-MPZUYCAP.js} +4 -1
  72. package/dist/{chunk-WJXLQXJY.js.map → chunk-MPZUYCAP.js.map} +1 -1
  73. package/dist/{chunk-SJLTEINJ.js → chunk-OJNTCYQQ.js} +17 -1
  74. package/dist/chunk-OJNTCYQQ.js.map +1 -0
  75. package/dist/{chunk-AGZ7PJKY.js → chunk-OTWLERSW.js} +22 -5
  76. package/dist/chunk-OTWLERSW.js.map +1 -0
  77. package/dist/{chunk-NEFNKLBE.js → chunk-PJNENX2A.js} +1535 -422
  78. package/dist/chunk-PJNENX2A.js.map +1 -0
  79. package/dist/{chunk-UKY4CHNC.js → chunk-PKHI276N.js} +8 -4
  80. package/dist/chunk-PKHI276N.js.map +1 -0
  81. package/dist/{chunk-5K5W4S66.js → chunk-QF3LSMGS.js} +2 -2
  82. package/dist/{chunk-XZKD7DIF.js → chunk-RL5UUDT4.js} +3 -3
  83. package/dist/{chunk-XZKD7DIF.js.map → chunk-RL5UUDT4.js.map} +1 -1
  84. package/dist/{chunk-OHRR5OYM.js → chunk-SFASB5FL.js} +10 -4
  85. package/dist/chunk-SFASB5FL.js.map +1 -0
  86. package/dist/{chunk-YVFXE7RR.js → chunk-SNNSAGMT.js} +7279 -2627
  87. package/dist/chunk-SNNSAGMT.js.map +1 -0
  88. package/dist/{chunk-WK7F3B2E.js → chunk-SO3XRZPX.js} +3 -3
  89. package/dist/chunk-SYOS5CAC.js +176 -0
  90. package/dist/chunk-SYOS5CAC.js.map +1 -0
  91. package/dist/chunk-TAW4UFFF.js +293 -0
  92. package/dist/chunk-TAW4UFFF.js.map +1 -0
  93. package/dist/{hosts-FWZOV26H.js → chunk-TF5HCP33.js} +79 -24
  94. package/dist/chunk-TF5HCP33.js.map +1 -0
  95. package/dist/{chunk-AKWGE6JQ.js → chunk-UUGOUOVT.js} +37 -2
  96. package/dist/chunk-UUGOUOVT.js.map +1 -0
  97. package/dist/{chunk-7ZRL2LBQ.js → chunk-V2LQLN5H.js} +6 -6
  98. package/dist/{chunk-K72RURN3.js → chunk-VJUVFZ2D.js} +2 -2
  99. package/dist/{chunk-77TCKDEC.js → chunk-VOZA6O7K.js} +663 -477
  100. package/dist/chunk-VOZA6O7K.js.map +1 -0
  101. package/dist/{chunk-D65GNPS3.js → chunk-VUGQTZ2L.js} +208 -84
  102. package/dist/chunk-VUGQTZ2L.js.map +1 -0
  103. package/dist/chunk-WOM257PW.js +393 -0
  104. package/dist/chunk-WOM257PW.js.map +1 -0
  105. package/dist/chunk-WYXUQGOL.js +191 -0
  106. package/dist/chunk-WYXUQGOL.js.map +1 -0
  107. package/dist/chunk-X5ZBP3IY.js +97 -0
  108. package/dist/chunk-X5ZBP3IY.js.map +1 -0
  109. package/dist/{chunk-5C32RLTA.js → chunk-YUY4SAGM.js} +17 -2
  110. package/dist/chunk-YUY4SAGM.js.map +1 -0
  111. package/dist/{cli-D5OE3URZ.js → cli-FB4LOA5A.js} +144 -63
  112. package/dist/{cli-D5OE3URZ.js.map → cli-FB4LOA5A.js.map} +1 -1
  113. package/dist/{codex-event-PPNVRRDH.js → codex-event-TYVES3UX.js} +2 -2
  114. package/dist/{codex-host-2RJOJW2B.js → codex-host-WW4H2SKT.js} +7 -6
  115. package/dist/codex-install-2C623HPW.js +393 -0
  116. package/dist/codex-install-2C623HPW.js.map +1 -0
  117. package/dist/{config-ZD4OB2DO.js → config-HOVJFEKD.js} +21 -17
  118. package/dist/doctor-NKU4V5OV.js +1312 -0
  119. package/dist/doctor-NKU4V5OV.js.map +1 -0
  120. package/dist/{env-proxy-XL4P73MZ.js → env-proxy-R6ZMLQTT.js} +6 -2
  121. package/dist/{ethersCompat-Df4a6QIZ-THAVUGIJ.js → ethersCompat-Df4a6QIZ-X6YZWAML.js} +3 -3
  122. package/dist/{fund-5ITKQGYF.js → fund-WEBHTZGN.js} +37 -36
  123. package/dist/{fund-5ITKQGYF.js.map → fund-WEBHTZGN.js.map} +1 -1
  124. package/dist/hook-command-ZA2PNKS6.js +44 -0
  125. package/dist/hosts/claude/.claude-plugin/marketplace.json +2 -2
  126. package/dist/hosts/claude/tenjin/.claude-plugin/plugin.json +2 -2
  127. package/dist/hosts/claude/tenjin/skills/tenjin-pay/SKILL.md +82 -0
  128. package/dist/hosts/codex/tenjin/.mcp.json +3 -0
  129. package/dist/hosts/codex/tenjin/hooks/hooks.json +51 -5
  130. package/dist/hosts-AV5MHBAU.js +38 -0
  131. package/dist/index.js +28 -8
  132. package/dist/index.js.map +1 -1
  133. package/dist/{install-XWGE4Q7L.js → install-PT4EZS4R.js} +53 -30
  134. package/dist/{install-identity-K7EJIQFP.js → install-identity-5A4OE6YC.js} +11 -10
  135. package/dist/install-wallet-SAAPKB73.js +281 -0
  136. package/dist/install-wallet-SAAPKB73.js.map +1 -0
  137. package/dist/{mcp-3LIJSSJB.js → mcp-HAWKCTPQ.js} +785 -210
  138. package/dist/mcp-HAWKCTPQ.js.map +1 -0
  139. package/dist/{mine.wasm-6PIT3DK6.js → mine.wasm-QFAHIFPY.js} +2 -2
  140. package/dist/{mine.wasm-6PIT3DK6.js.map → mine.wasm-QFAHIFPY.js.map} +1 -1
  141. package/dist/{package-ZKQFDWLE.js → package-SR2WB6MK.js} +4 -2
  142. package/dist/passphrase-IFTDS3CU.js +44 -0
  143. package/dist/{paths-POPTXJO6.js → paths-XCSAKISU.js} +10 -2
  144. package/dist/{pay-WHBERZ3W.js → pay-OXC3WKYV.js} +29 -29
  145. package/dist/{payments-KVICEKD2.js → payments-3KHMP2MG.js} +15 -14
  146. package/dist/{payments-KVICEKD2.js.map → payments-3KHMP2MG.js.map} +1 -1
  147. package/dist/plugin-registration-N3GRIZVM.js +67 -0
  148. package/dist/{redact-6W23GGJC.js → redact-D7ASVWKL.js} +2 -2
  149. package/dist/runtime-UVNUA3AS.js +1203 -0
  150. package/dist/runtime-UVNUA3AS.js.map +1 -0
  151. package/dist/runtime-fetch-EKFRNR6Z.js +20 -0
  152. package/dist/runtime-layout-BDWZG2TQ.js +25 -0
  153. package/dist/{send-7G7Y7DLN.js → send-HMKJLT34.js} +24 -22
  154. package/dist/{send-7G7Y7DLN.js.map → send-HMKJLT34.js.map} +1 -1
  155. package/dist/{status-OF7RH5HM.js → status-RWXIIWYS.js} +55 -25
  156. package/dist/status-RWXIIWYS.js.map +1 -0
  157. package/dist/{status-line-XOUE6MPL.js → status-line-77XYZP7E.js} +10 -9
  158. package/dist/{status-line-XOUE6MPL.js.map → status-line-77XYZP7E.js.map} +1 -1
  159. package/dist/uninstall-D5G67UJH.js +480 -0
  160. package/dist/uninstall-D5G67UJH.js.map +1 -0
  161. package/dist/update-LRNOEGSB.js +53 -0
  162. package/dist/update-LRNOEGSB.js.map +1 -0
  163. package/dist/{usdc-OGOGEHV2.js → usdc-D6X7EIQ2.js} +6 -8
  164. package/dist/usdc-D6X7EIQ2.js.map +1 -0
  165. package/dist/{viemAdapter-By13KInL-S3DA7DFW.js → viemAdapter-By13KInL-RL742ETX.js} +3 -3
  166. package/dist/viemAdapter-By13KInL-RL742ETX.js.map +1 -0
  167. package/dist/wallet-XFYC27BR.js +55 -0
  168. package/dist/wallet-XFYC27BR.js.map +1 -0
  169. package/dist/wallet-kdf-worker.mjs +8 -8
  170. package/docs/agent-permissions.md +40 -22
  171. package/docs/safety-model.md +1 -1
  172. package/docs/troubleshooting.md +72 -1
  173. package/package.json +14 -1
  174. package/dist/ccip-NLCSCHKI.js +0 -19
  175. package/dist/chunk-2XLC3AEX.js.map +0 -1
  176. package/dist/chunk-4ZZO6ULA.js.map +0 -1
  177. package/dist/chunk-5C32RLTA.js.map +0 -1
  178. package/dist/chunk-5IEP5EGE.js +0 -5332
  179. package/dist/chunk-5IEP5EGE.js.map +0 -1
  180. package/dist/chunk-5MARFNSB.js.map +0 -1
  181. package/dist/chunk-77TCKDEC.js.map +0 -1
  182. package/dist/chunk-7EKYXMUO.js +0 -7536
  183. package/dist/chunk-7EKYXMUO.js.map +0 -1
  184. package/dist/chunk-7QKHZQKW.js.map +0 -1
  185. package/dist/chunk-AGZ7PJKY.js.map +0 -1
  186. package/dist/chunk-AKWGE6JQ.js.map +0 -1
  187. package/dist/chunk-BL3332HQ.js +0 -7611
  188. package/dist/chunk-BL3332HQ.js.map +0 -1
  189. package/dist/chunk-D65GNPS3.js.map +0 -1
  190. package/dist/chunk-EGELTSPU.js +0 -2865
  191. package/dist/chunk-EGELTSPU.js.map +0 -1
  192. package/dist/chunk-GA7JETVM.js +0 -150
  193. package/dist/chunk-GA7JETVM.js.map +0 -1
  194. package/dist/chunk-I3EQFHCD.js +0 -175
  195. package/dist/chunk-I3EQFHCD.js.map +0 -1
  196. package/dist/chunk-K3I7C2MO.js +0 -1185
  197. package/dist/chunk-K3I7C2MO.js.map +0 -1
  198. package/dist/chunk-KXVP2VKA.js.map +0 -1
  199. package/dist/chunk-LEFIX6RS.js.map +0 -1
  200. package/dist/chunk-MNXS2U45.js.map +0 -1
  201. package/dist/chunk-NEFNKLBE.js.map +0 -1
  202. package/dist/chunk-OHRR5OYM.js.map +0 -1
  203. package/dist/chunk-QSCPK4F5.js.map +0 -1
  204. package/dist/chunk-SJLTEINJ.js.map +0 -1
  205. package/dist/chunk-TTNESUPQ.js.map +0 -1
  206. package/dist/chunk-UKY4CHNC.js.map +0 -1
  207. package/dist/chunk-V6BSF6OC.js +0 -260
  208. package/dist/chunk-V6BSF6OC.js.map +0 -1
  209. package/dist/chunk-YVFXE7RR.js.map +0 -1
  210. package/dist/codex-install-UUZ6QMBQ.js +0 -221
  211. package/dist/codex-install-UUZ6QMBQ.js.map +0 -1
  212. package/dist/doctor-KBR34Q4B.js +0 -601
  213. package/dist/doctor-KBR34Q4B.js.map +0 -1
  214. package/dist/hook-command-4TYCHHRL.js +0 -39
  215. package/dist/hosts-FWZOV26H.js.map +0 -1
  216. package/dist/install-wallet-XQ6XFZV4.js +0 -117
  217. package/dist/install-wallet-XQ6XFZV4.js.map +0 -1
  218. package/dist/mcp-3LIJSSJB.js.map +0 -1
  219. package/dist/plugin-registration-5TIA564H.js +0 -54
  220. package/dist/status-OF7RH5HM.js.map +0 -1
  221. package/dist/uninstall-JXUAFNDB.js +0 -158
  222. package/dist/uninstall-JXUAFNDB.js.map +0 -1
  223. package/dist/update-ZKUERSO2.js +0 -44
  224. package/dist/wallet-2HA6W4R4.js +0 -43
  225. /package/dist/{_esm-MEXZI5DL.js.map → _esm-RLLC72MS.js.map} +0 -0
  226. /package/dist/{alive-J64H46HI.js.map → alive-MROUMFH3.js.map} +0 -0
  227. /package/dist/{ccip-7RMRLAGV.js.map → auto-update-OPWMRZLS.js.map} +0 -0
  228. /package/dist/{ccip-NLCSCHKI.js.map → ccip-DHDFKTQV.js.map} +0 -0
  229. /package/dist/{chunk-7Q5FDF65.js.map → chunk-445VQTVM.js.map} +0 -0
  230. /package/dist/{chunk-KXQ4UIP7.js.map → chunk-4USCZ2NI.js.map} +0 -0
  231. /package/dist/{chunk-FW75G2W4.js.map → chunk-CISYM4EO.js.map} +0 -0
  232. /package/dist/{chunk-B7HUUJOK.js.map → chunk-D3ZURCG7.js.map} +0 -0
  233. /package/dist/{chunk-UQUOVWBG.js.map → chunk-DRDUIZIA.js.map} +0 -0
  234. /package/dist/{chunk-27EPWVOY.js.map → chunk-DW4YTVR3.js.map} +0 -0
  235. /package/dist/{chunk-ORWL5BSN.js.map → chunk-HGZEPQUT.js.map} +0 -0
  236. /package/dist/{chunk-P4NH7OUK.js.map → chunk-IDTRSAHE.js.map} +0 -0
  237. /package/dist/{chunk-YFPY4ONH.js.map → chunk-JEVQ5LKO.js.map} +0 -0
  238. /package/dist/{chunk-5K5W4S66.js.map → chunk-QF3LSMGS.js.map} +0 -0
  239. /package/dist/{chunk-WK7F3B2E.js.map → chunk-SO3XRZPX.js.map} +0 -0
  240. /package/dist/{chunk-7ZRL2LBQ.js.map → chunk-V2LQLN5H.js.map} +0 -0
  241. /package/dist/{chunk-K72RURN3.js.map → chunk-VJUVFZ2D.js.map} +0 -0
  242. /package/dist/{codex-event-PPNVRRDH.js.map → codex-event-TYVES3UX.js.map} +0 -0
  243. /package/dist/{codex-host-2RJOJW2B.js.map → codex-host-WW4H2SKT.js.map} +0 -0
  244. /package/dist/{config-ZD4OB2DO.js.map → config-HOVJFEKD.js.map} +0 -0
  245. /package/dist/{env-proxy-XL4P73MZ.js.map → env-proxy-R6ZMLQTT.js.map} +0 -0
  246. /package/dist/{ethersCompat-Df4a6QIZ-THAVUGIJ.js.map → ethersCompat-Df4a6QIZ-X6YZWAML.js.map} +0 -0
  247. /package/dist/{hook-command-4TYCHHRL.js.map → hook-command-ZA2PNKS6.js.map} +0 -0
  248. /package/dist/{install-XWGE4Q7L.js.map → hosts-AV5MHBAU.js.map} +0 -0
  249. /package/dist/{install-identity-K7EJIQFP.js.map → install-PT4EZS4R.js.map} +0 -0
  250. /package/dist/{package-ZKQFDWLE.js.map → install-identity-5A4OE6YC.js.map} +0 -0
  251. /package/dist/{paths-POPTXJO6.js.map → package-SR2WB6MK.js.map} +0 -0
  252. /package/dist/{pay-WHBERZ3W.js.map → passphrase-IFTDS3CU.js.map} +0 -0
  253. /package/dist/{plugin-registration-5TIA564H.js.map → paths-XCSAKISU.js.map} +0 -0
  254. /package/dist/{redact-6W23GGJC.js.map → pay-OXC3WKYV.js.map} +0 -0
  255. /package/dist/{update-ZKUERSO2.js.map → plugin-registration-N3GRIZVM.js.map} +0 -0
  256. /package/dist/{usdc-OGOGEHV2.js.map → redact-D7ASVWKL.js.map} +0 -0
  257. /package/dist/{viemAdapter-By13KInL-S3DA7DFW.js.map → runtime-fetch-EKFRNR6Z.js.map} +0 -0
  258. /package/dist/{wallet-2HA6W4R4.js.map → runtime-layout-BDWZG2TQ.js.map} +0 -0
@@ -1,10 +1,4 @@
1
1
  import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
- import {
3
- promptYesNo
4
- } from "./chunk-LHHMV4GU.js";
5
- import {
6
- assertPublicDestination
7
- } from "./chunk-JKKAIPTU.js";
8
2
  import {
9
3
  ADDITIVE_ARRAY_INFO_FIELDS,
10
4
  HTTPFacilitatorClient,
@@ -23,7 +17,16 @@ import {
23
17
  toComparableArray,
24
18
  x402HTTPClient,
25
19
  x402Version
26
- } from "./chunk-7EKYXMUO.js";
20
+ } from "./chunk-JNJWBTU2.js";
21
+ import {
22
+ promptYesNo
23
+ } from "./chunk-LHHMV4GU.js";
24
+ import {
25
+ assertPublicDestination
26
+ } from "./chunk-JKKAIPTU.js";
27
+ import {
28
+ USDC_ADDRESS
29
+ } from "./chunk-GAKUQHKA.js";
27
30
  import {
28
31
  BATCH_SETTLEMENT_ADDRESS,
29
32
  BATCH_SETTLEMENT_SCHEME,
@@ -43,76 +46,71 @@ import {
43
46
  normalizeChannelId,
44
47
  receiveAuthorizationTypes,
45
48
  voucherTypes
46
- } from "./chunk-7Q5FDF65.js";
47
- import {
48
- createPublicClient,
49
- http,
50
- recoverTypedDataAddress
51
- } from "./chunk-BL3332HQ.js";
49
+ } from "./chunk-445VQTVM.js";
52
50
  import {
53
51
  describeWallet,
54
52
  resolveSpendAuthorizer,
55
53
  resolveWalletProvider
56
- } from "./chunk-2XLC3AEX.js";
54
+ } from "./chunk-BI673VEJ.js";
57
55
  import {
58
56
  readSpendSummary,
59
57
  spentOf
60
- } from "./chunk-WK7F3B2E.js";
58
+ } from "./chunk-SO3XRZPX.js";
61
59
  import {
62
- USDC_ADDRESS
63
- } from "./chunk-R5LCN54M.js";
60
+ sanitizeForTerminal
61
+ } from "./chunk-VJUVFZ2D.js";
64
62
  import {
65
- getAddress
66
- } from "./chunk-EGELTSPU.js";
63
+ evaluatePlan
64
+ } from "./chunk-2SNUOHAT.js";
65
+ import {
66
+ withFileLock
67
+ } from "./chunk-MEFB5KHA.js";
68
+ import {
69
+ fetchFailureToCliError,
70
+ httpRequest,
71
+ requestHeaderProblem
72
+ } from "./chunk-OTWLERSW.js";
73
+ import {
74
+ createPublicClient,
75
+ http,
76
+ recoverTypedDataAddress
77
+ } from "./chunk-PJNENX2A.js";
67
78
  import {
68
79
  encodeAbiParameters,
69
80
  encodeFunctionData,
70
- getAddress as getAddress2,
81
+ getAddress,
71
82
  keccak256,
72
83
  maxUint256,
73
84
  toBytes
74
- } from "./chunk-TTNESUPQ.js";
75
- import {
76
- withFileLock
77
- } from "./chunk-MEFB5KHA.js";
78
- import {
79
- evaluatePlan
80
- } from "./chunk-2SNUOHAT.js";
81
- import {
82
- sanitizeForTerminal
83
- } from "./chunk-K72RURN3.js";
85
+ } from "./chunk-2GP3HRYK.js";
84
86
  import {
85
87
  mask
86
- } from "./chunk-7QKHZQKW.js";
87
- import {
88
- fetchFailureToCliError,
89
- httpRequest
90
- } from "./chunk-AGZ7PJKY.js";
88
+ } from "./chunk-IADZOXKN.js";
91
89
  import {
92
90
  resolveContextSettings
93
- } from "./chunk-7WU4OPLP.js";
91
+ } from "./chunk-AV5NZMYO.js";
94
92
  import {
95
93
  parseUsdToAtomic,
96
94
  toMoney
97
95
  } from "./chunk-Y527D4TV.js";
98
96
  import {
99
- external_exports
100
- } from "./chunk-YVFXE7RR.js";
97
+ readUsdcBalanceWithFallback
98
+ } from "./chunk-DW4YTVR3.js";
101
99
  import {
102
100
  isSameDeployment
103
101
  } from "./chunk-XQJXNMSB.js";
104
102
  import {
105
- CliError
106
- } from "./chunk-3UCIG4TG.js";
107
- import {
108
- readUsdcBalanceWithFallback
109
- } from "./chunk-27EPWVOY.js";
103
+ external_exports
104
+ } from "./chunk-SNNSAGMT.js";
110
105
  import {
111
106
  writeFileAtomic
112
107
  } from "./chunk-7WEQQJLG.js";
108
+ import {
109
+ CliError
110
+ } from "./chunk-3UCIG4TG.js";
113
111
  import {
114
112
  quotesDir
115
- } from "./chunk-SJLTEINJ.js";
113
+ } from "./chunk-OJNTCYQQ.js";
116
114
  import {
117
115
  __commonJS,
118
116
  __toESM
@@ -8443,6 +8441,8 @@ async function ultravioletListings(registry, timeoutMs, query) {
8443
8441
  function client(registry) {
8444
8442
  return withBazaar(new HTTPFacilitatorClient({ url: registry }));
8445
8443
  }
8444
+ var DeadlineError = class extends Error {
8445
+ };
8446
8446
  async function withTimeout(work, timeoutMs, what) {
8447
8447
  let timer;
8448
8448
  try {
@@ -8450,7 +8450,7 @@ async function withTimeout(work, timeoutMs, what) {
8450
8450
  work,
8451
8451
  new Promise((_, reject) => {
8452
8452
  timer = setTimeout(
8453
- () => reject(new Error(`${what} timed out after ${timeoutMs}ms`)),
8453
+ () => reject(new DeadlineError(`${what} timed out after ${timeoutMs}ms`)),
8454
8454
  timeoutMs
8455
8455
  );
8456
8456
  })
@@ -8577,6 +8577,9 @@ async function verifyAgainstRegistries(registries, url, live, timeoutMs, opts =
8577
8577
  }
8578
8578
  } catch (err) {
8579
8579
  errors.push({ registry, message: err instanceof Error ? err.message : String(err) });
8580
+ if (err instanceof DeadlineError || err instanceof Error && err.name === "TimeoutError") {
8581
+ break;
8582
+ }
8580
8583
  }
8581
8584
  }
8582
8585
  if (mismatch !== void 0) return { outcome: "mismatch", ...mismatch };
@@ -10445,7 +10448,7 @@ var ERC20_APPROVAL_GAS_SPONSORING_KEY = "erc20ApprovalGasSponsoring";
10445
10448
  var ERC20_APPROVAL_GAS_SPONSORING_VERSION = "1";
10446
10449
  async function signEip2612Permit(signer, tokenAddress, tokenName, tokenVersion, chainId, deadline, permittedAmount) {
10447
10450
  const owner = signer.address;
10448
- const spender = getAddress2(PERMIT2_ADDRESS);
10451
+ const spender = getAddress(PERMIT2_ADDRESS);
10449
10452
  const nonce = await signer.readContract({
10450
10453
  address: tokenAddress,
10451
10454
  abi: eip2612NoncesAbi,
@@ -10485,7 +10488,7 @@ async function signEip2612Permit(signer, tokenAddress, tokenName, tokenVersion,
10485
10488
  }
10486
10489
  async function signErc20ApprovalTransaction(signer, tokenAddress, chainId) {
10487
10490
  const from = signer.address;
10488
- const spender = getAddress2(PERMIT2_ADDRESS);
10491
+ const spender = getAddress(PERMIT2_ADDRESS);
10489
10492
  const data = encodeFunctionData({
10490
10493
  abi: erc20ApproveAbi,
10491
10494
  functionName: "approve",
@@ -10591,7 +10594,7 @@ async function trySignEip2612PermitExtension(signer, options, requirements, resu
10591
10594
  return void 0;
10592
10595
  }
10593
10596
  const chainId = getEvmChainId(requirements.network);
10594
- const tokenAddress = getAddress2(requirements.asset);
10597
+ const tokenAddress = getAddress(requirements.asset);
10595
10598
  const requiredAllowance = approvalAmount ?? requirements.amount;
10596
10599
  try {
10597
10600
  const allowance = await capabilities.readContract({
@@ -10636,7 +10639,7 @@ async function trySignErc20ApprovalExtension(signer, options, requirements, cont
10636
10639
  return void 0;
10637
10640
  }
10638
10641
  const chainId = getEvmChainId(requirements.network);
10639
- const tokenAddress = getAddress2(requirements.asset);
10642
+ const tokenAddress = getAddress(requirements.asset);
10640
10643
  const requiredAllowance = approvalAmount ?? requirements.amount;
10641
10644
  try {
10642
10645
  const allowance = await capabilities.readContract({
@@ -10700,13 +10703,13 @@ async function createBatchSettlementEIP3009DepositPayload(signer, x402Version2,
10700
10703
  name,
10701
10704
  version,
10702
10705
  chainId,
10703
- verifyingContract: getAddress2(paymentRequirements.asset)
10706
+ verifyingContract: getAddress(paymentRequirements.asset)
10704
10707
  },
10705
10708
  types: receiveAuthorizationTypes,
10706
10709
  primaryType: "ReceiveWithAuthorization",
10707
10710
  message: {
10708
- from: getAddress2(signer.address),
10709
- to: getAddress2(ERC3009_DEPOSIT_COLLECTOR_ADDRESS),
10711
+ from: getAddress(signer.address),
10712
+ to: getAddress(ERC3009_DEPOSIT_COLLECTOR_ADDRESS),
10710
10713
  value: BigInt(depositAmount),
10711
10714
  validAfter: BigInt(0),
10712
10715
  validBefore: BigInt(now + paymentRequirements.maxTimeoutSeconds),
@@ -10843,16 +10846,16 @@ function depositAmountForRequest(policy, requestAmount, needed, extra, maxDeposi
10843
10846
  function buildChannelConfig(deps, paymentRequirements) {
10844
10847
  const extra = paymentRequirements.extra;
10845
10848
  const receiverAuthorizer = extra?.receiverAuthorizer;
10846
- if (!receiverAuthorizer || getAddress2(receiverAuthorizer) === "0x0000000000000000000000000000000000000000") {
10849
+ if (!receiverAuthorizer || getAddress(receiverAuthorizer) === "0x0000000000000000000000000000000000000000") {
10847
10850
  throw new Error("Payment requirements must include a non-zero extra.receiverAuthorizer");
10848
10851
  }
10849
10852
  return {
10850
10853
  payer: deps.signer.address,
10851
- payerAuthorizer: getAddress2(
10854
+ payerAuthorizer: getAddress(
10852
10855
  deps.payerAuthorizer ?? deps.voucherSigner?.address ?? deps.signer.address
10853
10856
  ),
10854
10857
  receiver: paymentRequirements.payTo,
10855
- receiverAuthorizer: getAddress2(receiverAuthorizer),
10858
+ receiverAuthorizer: getAddress(receiverAuthorizer),
10856
10859
  token: paymentRequirements.asset,
10857
10860
  withdrawDelay: typeof extra?.withdrawDelay === "number" ? extra.withdrawDelay : MIN_WITHDRAW_DELAY,
10858
10861
  salt: deps.salt
@@ -10985,7 +10988,7 @@ async function recoverFromSignature(deps, accept, channelState, voucherState) {
10985
10988
  },
10986
10989
  signature: sig
10987
10990
  });
10988
- const expectedSigner = getAddress2(
10991
+ const expectedSigner = getAddress(
10989
10992
  deps.payerAuthorizer ?? deps.voucherSigner?.address ?? deps.signer.address
10990
10993
  );
10991
10994
  if (recovered.toLowerCase() !== expectedSigner.toLowerCase()) {
@@ -11223,10 +11226,10 @@ async function createBatchSettlementPermit2DepositPayload(signer, x402Version2,
11223
11226
  const permit2Authorization = {
11224
11227
  from: signer.address,
11225
11228
  permitted: {
11226
- token: getAddress2(paymentRequirements.asset),
11229
+ token: getAddress(paymentRequirements.asset),
11227
11230
  amount: depositAmount
11228
11231
  },
11229
- spender: getAddress2(PERMIT2_DEPOSIT_COLLECTOR_ADDRESS),
11232
+ spender: getAddress(PERMIT2_DEPOSIT_COLLECTOR_ADDRESS),
11230
11233
  nonce,
11231
11234
  deadline,
11232
11235
  witness: {
@@ -11299,7 +11302,7 @@ var BatchSettlementEvmScheme = class {
11299
11302
  this.payerAuthorizer = payerAuthorizer;
11300
11303
  this.voucherSigner = voucherSigner;
11301
11304
  this.extensionRpcOptions = extensionRpcOptions;
11302
- if (payerAuthorizer !== void 0 && voucherSigner !== void 0 && getAddress2(payerAuthorizer) !== getAddress2(voucherSigner.address)) {
11305
+ if (payerAuthorizer !== void 0 && voucherSigner !== void 0 && getAddress(payerAuthorizer) !== getAddress(voucherSigner.address)) {
11303
11306
  throw new Error("payerAuthorizer address must match voucherSigner.address");
11304
11307
  }
11305
11308
  validateDepositPolicy(depositPolicy);
@@ -11540,14 +11543,14 @@ async function createPermit2PayloadForProxy(proxyAddress, signer, x402Version2,
11540
11543
  const permit2Authorization = {
11541
11544
  from: signer.address,
11542
11545
  permitted: {
11543
- token: getAddress2(paymentRequirements.asset),
11546
+ token: getAddress(paymentRequirements.asset),
11544
11547
  amount: paymentRequirements.amount
11545
11548
  },
11546
11549
  spender: proxyAddress,
11547
11550
  nonce,
11548
11551
  deadline,
11549
11552
  witness: {
11550
- to: getAddress2(paymentRequirements.payTo),
11553
+ to: getAddress(paymentRequirements.payTo),
11551
11554
  validAfter
11552
11555
  }
11553
11556
  };
@@ -11569,14 +11572,14 @@ async function signPermit2Authorization(signer, permit2Authorization, requiremen
11569
11572
  primaryType: "PermitWitnessTransferFrom",
11570
11573
  message: {
11571
11574
  permitted: {
11572
- token: getAddress2(permit2Authorization.permitted.token),
11575
+ token: getAddress(permit2Authorization.permitted.token),
11573
11576
  amount: BigInt(permit2Authorization.permitted.amount)
11574
11577
  },
11575
- spender: getAddress2(permit2Authorization.spender),
11578
+ spender: getAddress(permit2Authorization.spender),
11576
11579
  nonce: BigInt(permit2Authorization.nonce),
11577
11580
  deadline: BigInt(permit2Authorization.deadline),
11578
11581
  witness: {
11579
- to: getAddress2(permit2Authorization.witness.to),
11582
+ to: getAddress(permit2Authorization.witness.to),
11580
11583
  validAfter: BigInt(permit2Authorization.witness.validAfter)
11581
11584
  }
11582
11585
  }
@@ -11600,7 +11603,7 @@ async function createEIP3009Payload(signer, x402Version2, paymentRequirements) {
11600
11603
  const now = Math.floor(Date.now() / 1e3);
11601
11604
  const authorization = {
11602
11605
  from: signer.address,
11603
- to: getAddress2(paymentRequirements.payTo),
11606
+ to: getAddress(paymentRequirements.payTo),
11604
11607
  value: paymentRequirements.amount,
11605
11608
  validAfter: "0",
11606
11609
  validBefore: (now + paymentRequirements.maxTimeoutSeconds).toString(),
@@ -11628,11 +11631,11 @@ async function signEIP3009Authorization(signer, authorization, requirements) {
11628
11631
  name,
11629
11632
  version,
11630
11633
  chainId,
11631
- verifyingContract: getAddress2(requirements.asset)
11634
+ verifyingContract: getAddress(requirements.asset)
11632
11635
  };
11633
11636
  const message = {
11634
- from: getAddress2(authorization.from),
11635
- to: getAddress2(authorization.to),
11637
+ from: getAddress(authorization.from),
11638
+ to: getAddress(authorization.to),
11636
11639
  value: BigInt(authorization.value),
11637
11640
  validAfter: BigInt(authorization.validAfter),
11638
11641
  validBefore: BigInt(authorization.validBefore),
@@ -11833,15 +11836,16 @@ function createPayerClient(getSigner) {
11833
11836
  core.registerExtension(builderCode);
11834
11837
  return { core, http: new x402HTTPClient(core), builderCodeKey: builderCode.key };
11835
11838
  }
11836
- var canonicalUsdcOnly = (_version, requirements) => requirements.filter((requirement) => {
11837
- const allowed = ALLOWED_USDC_BY_NETWORK[requirement.network];
11839
+ var canonicalUsdcOnly = (_version, requirements) => requirements.filter(isCanonicalUsdc);
11840
+ function isCanonicalUsdc(entry) {
11841
+ const allowed = ALLOWED_USDC_BY_NETWORK[entry.network];
11838
11842
  if (allowed === void 0) return false;
11839
11843
  try {
11840
- return getAddress(requirement.asset) === getAddress(allowed);
11844
+ return getAddress(entry.asset) === getAddress(allowed);
11841
11845
  } catch {
11842
11846
  return false;
11843
11847
  }
11844
- });
11848
+ }
11845
11849
  function selectPayableRequirement(core, paymentRequired, want) {
11846
11850
  const approved = supportedEntries(paymentRequired);
11847
11851
  if (want === void 0) return sdkSelect(core, paymentRequired) ?? approved[0];
@@ -11970,8 +11974,13 @@ async function executePay(args, ctx, deps, warnings) {
11970
11974
  const lane = resolveLane(url, settings);
11971
11975
  if (lane === "bazaar") await assertPublicDestination(url, deps.destination ?? {});
11972
11976
  const method = resolveMethod(args);
11973
- const jsonBody = parseBody(args.data);
11974
- const headers = callerHeaders(args.headers);
11977
+ const operator = operatorHeaders(args.header, args.dataRaw !== void 0);
11978
+ const body = resolveBody(args, operator);
11979
+ const headers = {
11980
+ ...operator,
11981
+ ...specHeaders(args.specHeaders),
11982
+ ...callerHeaders(args.headers)
11983
+ };
11975
11984
  const fetchOpts = {
11976
11985
  timeoutMs: ctx.flags.timeout,
11977
11986
  // Both legs: the probe's 402 is money-path input, and the paid retry
@@ -11979,8 +11988,7 @@ async function executePay(args, ctx, deps, warnings) {
11979
11988
  // probe too, so the challenge always comes from the URL that was gated).
11980
11989
  blockRedirects: true,
11981
11990
  ...deps.fetchImpl !== void 0 ? { fetchImpl: deps.fetchImpl } : {},
11982
- ...jsonBody !== void 0 ? { jsonBody } : {},
11983
- ...jsonBody === void 0 && args.rawBody !== void 0 ? { rawBody: args.rawBody } : {},
11991
+ ...body,
11984
11992
  ...Object.keys(headers).length > 0 ? { headers } : {},
11985
11993
  // A router lookup can buy a file (a sound, an image): its bytes are kept
11986
11994
  // whole for the tool to save, never decoded as text.
@@ -12016,6 +12024,9 @@ async function executePay(args, ctx, deps, warnings) {
12016
12024
  const paymentRequired = decodeChallenge(probe, url);
12017
12025
  const payer = createPayerClient(() => signerOrThrow(openedSigner));
12018
12026
  const requirement = selectRequirement(payer.core, paymentRequired, args.terms);
12027
+ if (args.quote === true) {
12028
+ return deliverQuote(url, lane, probe, paymentRequired, requirement, args.printBody === true);
12029
+ }
12019
12030
  if (requirement === void 0) {
12020
12031
  throw noMatchingEntry(paymentRequired, args.terms);
12021
12032
  }
@@ -12299,7 +12310,7 @@ async function quoteRouterCall(args, ctx, deps = {}) {
12299
12310
  if (resolveLane(url, settings) === "bazaar") {
12300
12311
  await assertPublicDestination(url, deps.destination ?? {});
12301
12312
  }
12302
- const headers = callerHeaders(args.headers);
12313
+ const headers = { ...specHeaders(args.specHeaders), ...callerHeaders(args.headers) };
12303
12314
  const probe = await httpRequest(url, {
12304
12315
  timeoutMs: ctx.flags.timeout,
12305
12316
  blockRedirects: true,
@@ -12390,20 +12401,80 @@ function resolveLane(url, settings) {
12390
12401
  }
12391
12402
  return "bazaar";
12392
12403
  }
12404
+ var METHODS = /* @__PURE__ */ new Set(["GET", "POST", "PUT", "PATCH", "DELETE"]);
12405
+ var BODY_METHODS = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH"]);
12406
+ function hasBody(args) {
12407
+ return args.data !== void 0 || args.dataRaw !== void 0 || args.rawBody !== void 0;
12408
+ }
12393
12409
  function resolveMethod(args) {
12394
- const method = args.method?.toUpperCase() ?? (args.data !== void 0 ? "POST" : "GET");
12395
- if (method !== "GET" && method !== "POST") {
12410
+ const method = args.method?.toUpperCase() ?? (hasBody(args) ? "POST" : "GET");
12411
+ if (!METHODS.has(method)) {
12396
12412
  throw new CliError("USAGE", `Unsupported method ${JSON.stringify(args.method)}`, {
12397
- fix: "Use -X GET or -X POST."
12413
+ fix: "Use -X GET, POST, PUT, PATCH or DELETE."
12398
12414
  });
12399
12415
  }
12400
- if (method === "GET" && (args.data !== void 0 || args.rawBody !== void 0)) {
12401
- throw new CliError("USAGE", "A request body needs -X POST.", {
12402
- fix: "Drop --data, or pass -X POST."
12416
+ if (hasBody(args) && !BODY_METHODS.has(method)) {
12417
+ throw new CliError("USAGE", "A request body needs -X POST, PUT or PATCH.", {
12418
+ fix: "Drop the body, or pass -X POST, PUT or PATCH."
12403
12419
  });
12404
12420
  }
12405
12421
  return method;
12406
12422
  }
12423
+ function resolveBody(args, operator) {
12424
+ const given = [args.data, args.dataRaw, args.rawBody].filter((b) => b !== void 0);
12425
+ if (given.length > 1) {
12426
+ throw new CliError("USAGE", "Pass one request body: --data or --data-raw, not both.", {
12427
+ fix: "Use --data for a JSON body, or --data-raw with its own Content-Type."
12428
+ });
12429
+ }
12430
+ if (args.data !== void 0) return { jsonBody: parseBody(args.data) };
12431
+ if (args.dataRaw !== void 0) {
12432
+ if (operator["content-type"] === void 0) {
12433
+ throw new CliError("USAGE", "A --data-raw body needs its content type.", {
12434
+ fix: "Pass -H 'Content-Type: <type>' with --data-raw."
12435
+ });
12436
+ }
12437
+ return { rawBody: args.dataRaw };
12438
+ }
12439
+ return args.rawBody !== void 0 ? { rawBody: args.rawBody } : {};
12440
+ }
12441
+ function operatorHeaders(lines, rawBody) {
12442
+ if (lines === void 0) return {};
12443
+ const out = {};
12444
+ for (const line of lines) {
12445
+ const at = line.indexOf(":");
12446
+ const name = at > 0 ? line.slice(0, at).trim() : "";
12447
+ const value = at > 0 ? line.slice(at + 1).trim() : "";
12448
+ const problem = requestHeaderProblem(name, value, rawBody);
12449
+ if (problem === "name") {
12450
+ throw new CliError("USAGE", `Not a request header: ${JSON.stringify(line)}`, {
12451
+ fix: "Pass -H 'Name: value'."
12452
+ });
12453
+ }
12454
+ if (problem === "reserved") {
12455
+ throw new CliError("USAGE", `This command sets the header ${JSON.stringify(name)} itself.`, {
12456
+ fix: "Payment, sign-in, bypass and transport headers are never taken from -H. --data is always application/json; only --data-raw takes a Content-Type from -H."
12457
+ });
12458
+ }
12459
+ if (problem === "value") {
12460
+ throw new CliError(
12461
+ "USAGE",
12462
+ `The value of ${JSON.stringify(name)} is too long or spans lines.`,
12463
+ {
12464
+ fix: "Keep each -H value on one line, under 1,024 characters."
12465
+ }
12466
+ );
12467
+ }
12468
+ const lowered = name.toLowerCase();
12469
+ if (lowered in out) {
12470
+ throw new CliError("USAGE", `The header ${JSON.stringify(name)} was given twice.`, {
12471
+ fix: "Pass each header name once."
12472
+ });
12473
+ }
12474
+ out[lowered] = value;
12475
+ }
12476
+ return out;
12477
+ }
12407
12478
  function callerHeaders(headers) {
12408
12479
  if (headers === void 0) return {};
12409
12480
  const allowed = /* @__PURE__ */ new Set(["accept", "content-type"]);
@@ -12423,6 +12494,23 @@ function callerHeaders(headers) {
12423
12494
  }
12424
12495
  return out;
12425
12496
  }
12497
+ function specHeaders(headers) {
12498
+ if (headers === void 0) return {};
12499
+ const out = {};
12500
+ for (const [name, value] of Object.entries(headers)) {
12501
+ if (requestHeaderProblem(name, value) !== null) {
12502
+ throw new CliError(
12503
+ "USAGE",
12504
+ `This command will not send the header ${JSON.stringify(name)}.`,
12505
+ {
12506
+ fix: "A spec header is a bounded, single-line value, and never a payment, sign-in, bypass or transport header."
12507
+ }
12508
+ );
12509
+ }
12510
+ out[name.toLowerCase()] = value;
12511
+ }
12512
+ return out;
12513
+ }
12426
12514
  function parseBody(data) {
12427
12515
  if (data === void 0) return void 0;
12428
12516
  try {
@@ -12589,6 +12677,42 @@ function warningMessage(warning) {
12589
12677
  return `Registry warning: the live terms differ from ${warning.registry} (${warning.detail}).`;
12590
12678
  }
12591
12679
  }
12680
+ function deliverQuote(url, lane, res, challenge, chosen, printBody) {
12681
+ const chosenAt = chosen === void 0 ? -1 : challenge.accepts.findIndex((a) => sameDeal(a, chosen));
12682
+ const accepts = challenge.accepts.map((a, i) => ({
12683
+ scheme: a.scheme,
12684
+ network: a.network,
12685
+ asset: a.asset,
12686
+ amount: a.amount,
12687
+ ...isCanonicalUsdc(a) ? { usd: toMoney(a.amount).usd } : {},
12688
+ ...i === chosenAt ? { payable: true } : {},
12689
+ payTo: a.payTo,
12690
+ maxTimeoutSeconds: a.maxTimeoutSeconds,
12691
+ ...a.extra !== void 0 ? { extra: a.extra } : {}
12692
+ }));
12693
+ const data = {
12694
+ url,
12695
+ lane,
12696
+ status: res.status,
12697
+ paid: false,
12698
+ quote: true,
12699
+ resource: challenge.resource,
12700
+ accepts,
12701
+ ...challenge.extensions !== void 0 ? { extensions: challenge.extensions } : {},
12702
+ ...res.json !== void 0 ? { body: res.json } : {},
12703
+ bodyText: res.text
12704
+ };
12705
+ const host = sanitizeForTerminal(new URL(url).host);
12706
+ const payable = accepts[chosenAt];
12707
+ const headline = payable?.usd !== void 0 ? `quote: ${payable.usd} USD to ${host} on ${sanitizeForTerminal(payable.network)} (nothing paid)` : accepts.length === 0 ? `quote: ${host} answered 402 with no payment option (nothing paid)` : `quote: ${host} lists no option this wallet can pay, only USDC on Base is supported (nothing paid)`;
12708
+ const body = sanitizeForTerminal(res.text);
12709
+ const preview2 = printBody || body.length <= BODY_PREVIEW_CHARS ? body : `${body.slice(0, BODY_PREVIEW_CHARS)}
12710
+ \u2026 truncated; run with --print-body or --json for the full body`;
12711
+ return { data, humanLines: [headline, ...preview2.length > 0 ? [preview2] : []] };
12712
+ }
12713
+ function sameDeal(a, b) {
12714
+ return a === b || a.scheme === b.scheme && a.network === b.network && a.asset.toLowerCase() === b.asset.toLowerCase() && a.amount === b.amount && a.payTo.toLowerCase() === b.payTo.toLowerCase();
12715
+ }
12592
12716
  function deliver(url, lane, res, opts) {
12593
12717
  const settlementTxHash = opts.paid ? settlementTx(res) : void 0;
12594
12718
  const data = {
@@ -12705,4 +12829,4 @@ export {
12705
12829
  sellerLine,
12706
12830
  settlementTx
12707
12831
  };
12708
- //# sourceMappingURL=chunk-D65GNPS3.js.map
12832
+ //# sourceMappingURL=chunk-VUGQTZ2L.js.map