tenjin-cli 0.1.0-alpha.28 → 0.1.0-alpha.29

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 (127) hide show
  1. package/README.md +13 -10
  2. package/dist/{chunk-ZG6ZZLO7.js → chunk-25GGN553.js} +9 -11
  3. package/dist/{chunk-ZG6ZZLO7.js.map → chunk-25GGN553.js.map} +1 -1
  4. package/dist/{chunk-B2L53TMK.js → chunk-2SNUOHAT.js} +28 -23
  5. package/dist/chunk-2SNUOHAT.js.map +1 -0
  6. package/dist/{chunk-UEOWNDQG.js → chunk-3FY5HG7R.js} +82 -13
  7. package/dist/chunk-3FY5HG7R.js.map +1 -0
  8. package/dist/{chunk-DJYAPACT.js → chunk-4FYMDRD3.js} +32 -24
  9. package/dist/chunk-4FYMDRD3.js.map +1 -0
  10. package/dist/{chunk-ZP7AHN7Z.js → chunk-AMEUXNJT.js} +3 -5
  11. package/dist/{chunk-ZP7AHN7Z.js.map → chunk-AMEUXNJT.js.map} +1 -1
  12. package/dist/chunk-EWLU46J6.js +100 -0
  13. package/dist/chunk-EWLU46J6.js.map +1 -0
  14. package/dist/{chunk-RLPLYUME.js → chunk-LRCJ2IZ5.js} +3 -3
  15. package/dist/{chunk-RLPLYUME.js.map → chunk-LRCJ2IZ5.js.map} +1 -1
  16. package/dist/{chunk-YFJJYHVG.js → chunk-LX5OT4TQ.js} +3 -3
  17. package/dist/{chunk-YFJJYHVG.js.map → chunk-LX5OT4TQ.js.map} +1 -1
  18. package/dist/{chunk-ZO3X5NPG.js → chunk-MG3G644T.js} +4 -4
  19. package/dist/{chunk-6KA4HFX5.js → chunk-MOG7PB3A.js} +3 -3
  20. package/dist/{chunk-DYSDQE7S.js → chunk-MRUPDSUM.js} +14 -93
  21. package/dist/chunk-MRUPDSUM.js.map +1 -0
  22. package/dist/{chunk-KAMRYUK2.js → chunk-OOSRB3OF.js} +2 -2
  23. package/dist/{chunk-PZ5N6BAL.js → chunk-ORWL5BSN.js} +5 -4
  24. package/dist/chunk-ORWL5BSN.js.map +1 -0
  25. package/dist/chunk-P4LVLFO4.js +29 -0
  26. package/dist/chunk-P4LVLFO4.js.map +1 -0
  27. package/dist/{chunk-ZP5PV3JB.js → chunk-QTGUDCIR.js} +5 -5
  28. package/dist/{chunk-FQ6DHINU.js → chunk-R4AO7GC2.js} +437 -78
  29. package/dist/chunk-R4AO7GC2.js.map +1 -0
  30. package/dist/{chunk-UOW5JXYY.js → chunk-RJEPZMYY.js} +10 -4
  31. package/dist/chunk-RJEPZMYY.js.map +1 -0
  32. package/dist/{chunk-VSUHGRVB.js → chunk-SBL4THYT.js} +712 -93
  33. package/dist/chunk-SBL4THYT.js.map +1 -0
  34. package/dist/{chunk-BRHREK7E.js → chunk-SFEQGENI.js} +2 -2
  35. package/dist/{chunk-K6AXXYCG.js → chunk-SJLTEINJ.js} +10 -2
  36. package/dist/{chunk-K6AXXYCG.js.map → chunk-SJLTEINJ.js.map} +1 -1
  37. package/dist/{chunk-XVTD7UWR.js → chunk-TROZ6HL4.js} +2 -2
  38. package/dist/{chunk-3QJREVMX.js → chunk-USOLCBKC.js} +5 -5
  39. package/dist/{chunk-W6JX4LYF.js → chunk-VKQXVCZR.js} +46 -5
  40. package/dist/chunk-VKQXVCZR.js.map +1 -0
  41. package/dist/{chunk-QTND6XWJ.js → chunk-VVAHFCX2.js} +51 -3
  42. package/dist/chunk-VVAHFCX2.js.map +1 -0
  43. package/dist/{chunk-7H3RN4WJ.js → chunk-WM7TJEBP.js} +5 -5
  44. package/dist/{chunk-MNTQMZJB.js → chunk-XDYKZRLN.js} +22 -13
  45. package/dist/chunk-XDYKZRLN.js.map +1 -0
  46. package/dist/{chunk-A5H3E5QA.js → chunk-XJQ6CH7X.js} +3 -2
  47. package/dist/{chunk-7R37M6WV.js → chunk-ZQNGTLOC.js} +5 -5
  48. package/dist/{cli-234DNHN6.js → cli-JPTDHGRX.js} +38 -33
  49. package/dist/{cli-234DNHN6.js.map → cli-JPTDHGRX.js.map} +1 -1
  50. package/dist/{config-IY2OJCAK.js → config-YYKDH2TH.js} +11 -11
  51. package/dist/{doctor-2UZZF44A.js → doctor-SSTXGCHX.js} +60 -56
  52. package/dist/doctor-SSTXGCHX.js.map +1 -0
  53. package/dist/{fund-RZ2QFULK.js → fund-QWVWRVDK.js} +14 -16
  54. package/dist/{fund-RZ2QFULK.js.map → fund-QWVWRVDK.js.map} +1 -1
  55. package/dist/hook-command-VWJXRT7H.js +31 -0
  56. package/dist/hosts/claude/.claude-plugin/marketplace.json +2 -2
  57. package/dist/hosts/claude/tenjin/.claude-plugin/plugin.json +2 -2
  58. package/dist/hosts/claude/tenjin/.mcp.json +2 -1
  59. package/dist/hosts/claude/tenjin/hooks/hooks.json +18 -3
  60. package/dist/index.js +6 -6
  61. package/dist/{install-O5FJ5EP3.js → install-2GXXD4DK.js} +19 -16
  62. package/dist/{install-identity-QM44IQ6Z.js → install-identity-FK3YF227.js} +7 -8
  63. package/dist/{install-wallet-Z52EDLPB.js → install-wallet-TC22U52X.js} +17 -12
  64. package/dist/{install-wallet-Z52EDLPB.js.map → install-wallet-TC22U52X.js.map} +1 -1
  65. package/dist/{mcp-33HAADDF.js → mcp-42H2F4NY.js} +2091 -348
  66. package/dist/mcp-42H2F4NY.js.map +1 -0
  67. package/dist/{package-RT24HTTP.js → package-6DJA3Y2O.js} +2 -2
  68. package/dist/{paths-MUXHUOCM.js → paths-POPTXJO6.js} +6 -2
  69. package/dist/{pay-IR2V76FX.js → pay-LSDJBIAZ.js} +18 -15
  70. package/dist/payments-SPECLBRQ.js +105 -0
  71. package/dist/payments-SPECLBRQ.js.map +1 -0
  72. package/dist/{send-PI4NUA7I.js → send-MHAOLPK3.js} +12 -14
  73. package/dist/{send-PI4NUA7I.js.map → send-MHAOLPK3.js.map} +1 -1
  74. package/dist/status-O2RWLPS5.js +114 -0
  75. package/dist/status-O2RWLPS5.js.map +1 -0
  76. package/dist/{status-line-2G5JPQAE.js → status-line-45TVCRM3.js} +7 -8
  77. package/dist/{status-line-2G5JPQAE.js.map → status-line-45TVCRM3.js.map} +1 -1
  78. package/dist/{uninstall-THKUH5ZT.js → uninstall-VOK2Z5M4.js} +27 -17
  79. package/dist/uninstall-VOK2Z5M4.js.map +1 -0
  80. package/dist/update-FGP3HNLD.js +33 -0
  81. package/dist/{wallet-53EFH4M5.js → wallet-DA7OFNEW.js} +17 -12
  82. package/docs/agent-permissions.md +11 -8
  83. package/docs/safety-model.md +3 -1
  84. package/package.json +2 -2
  85. package/dist/chunk-AO54FM4H.js +0 -563
  86. package/dist/chunk-AO54FM4H.js.map +0 -1
  87. package/dist/chunk-B2L53TMK.js.map +0 -1
  88. package/dist/chunk-DJYAPACT.js.map +0 -1
  89. package/dist/chunk-DYSDQE7S.js.map +0 -1
  90. package/dist/chunk-FQ6DHINU.js.map +0 -1
  91. package/dist/chunk-FZTSGQVK.js +0 -52
  92. package/dist/chunk-FZTSGQVK.js.map +0 -1
  93. package/dist/chunk-MNTQMZJB.js.map +0 -1
  94. package/dist/chunk-PZ5N6BAL.js.map +0 -1
  95. package/dist/chunk-QTND6XWJ.js.map +0 -1
  96. package/dist/chunk-UEOWNDQG.js.map +0 -1
  97. package/dist/chunk-UOW5JXYY.js.map +0 -1
  98. package/dist/chunk-VSUHGRVB.js.map +0 -1
  99. package/dist/chunk-W6JX4LYF.js.map +0 -1
  100. package/dist/doctor-2UZZF44A.js.map +0 -1
  101. package/dist/hook-command-PZHKS7ES.js +0 -31
  102. package/dist/mcp-33HAADDF.js.map +0 -1
  103. package/dist/payments-GFV4HU5R.js +0 -47
  104. package/dist/payments-GFV4HU5R.js.map +0 -1
  105. package/dist/status-ZUHTJK46.js +0 -71
  106. package/dist/status-ZUHTJK46.js.map +0 -1
  107. package/dist/uninstall-THKUH5ZT.js.map +0 -1
  108. package/dist/update-NPZDP24E.js +0 -18
  109. /package/dist/{chunk-ZO3X5NPG.js.map → chunk-MG3G644T.js.map} +0 -0
  110. /package/dist/{chunk-6KA4HFX5.js.map → chunk-MOG7PB3A.js.map} +0 -0
  111. /package/dist/{chunk-KAMRYUK2.js.map → chunk-OOSRB3OF.js.map} +0 -0
  112. /package/dist/{chunk-ZP5PV3JB.js.map → chunk-QTGUDCIR.js.map} +0 -0
  113. /package/dist/{chunk-BRHREK7E.js.map → chunk-SFEQGENI.js.map} +0 -0
  114. /package/dist/{chunk-XVTD7UWR.js.map → chunk-TROZ6HL4.js.map} +0 -0
  115. /package/dist/{chunk-3QJREVMX.js.map → chunk-USOLCBKC.js.map} +0 -0
  116. /package/dist/{chunk-7H3RN4WJ.js.map → chunk-WM7TJEBP.js.map} +0 -0
  117. /package/dist/{chunk-A5H3E5QA.js.map → chunk-XJQ6CH7X.js.map} +0 -0
  118. /package/dist/{chunk-7R37M6WV.js.map → chunk-ZQNGTLOC.js.map} +0 -0
  119. /package/dist/{config-IY2OJCAK.js.map → config-YYKDH2TH.js.map} +0 -0
  120. /package/dist/{hook-command-PZHKS7ES.js.map → hook-command-VWJXRT7H.js.map} +0 -0
  121. /package/dist/{install-O5FJ5EP3.js.map → install-2GXXD4DK.js.map} +0 -0
  122. /package/dist/{install-identity-QM44IQ6Z.js.map → install-identity-FK3YF227.js.map} +0 -0
  123. /package/dist/{package-RT24HTTP.js.map → package-6DJA3Y2O.js.map} +0 -0
  124. /package/dist/{paths-MUXHUOCM.js.map → paths-POPTXJO6.js.map} +0 -0
  125. /package/dist/{pay-IR2V76FX.js.map → pay-LSDJBIAZ.js.map} +0 -0
  126. /package/dist/{update-NPZDP24E.js.map → update-FGP3HNLD.js.map} +0 -0
  127. /package/dist/{wallet-53EFH4M5.js.map → wallet-DA7OFNEW.js.map} +0 -0
@@ -23,10 +23,10 @@ import {
23
23
  } from "./chunk-LHHMV4GU.js";
24
24
  import {
25
25
  assertPublicDestination
26
- } from "./chunk-A5H3E5QA.js";
26
+ } from "./chunk-XJQ6CH7X.js";
27
27
  import {
28
28
  USDC_ADDRESS
29
- } from "./chunk-BRHREK7E.js";
29
+ } from "./chunk-SFEQGENI.js";
30
30
  import {
31
31
  BATCH_SETTLEMENT_ADDRESS,
32
32
  BATCH_SETTLEMENT_SCHEME,
@@ -56,7 +56,11 @@ import {
56
56
  describeWallet,
57
57
  resolveSpendAuthorizer,
58
58
  resolveWalletProvider
59
- } from "./chunk-7R37M6WV.js";
59
+ } from "./chunk-ZQNGTLOC.js";
60
+ import {
61
+ readSpendSummary,
62
+ spentOf
63
+ } from "./chunk-LX5OT4TQ.js";
60
64
  import {
61
65
  encodeAbiParameters,
62
66
  encodeFunctionData,
@@ -65,9 +69,15 @@ import {
65
69
  maxUint256,
66
70
  toBytes
67
71
  } from "./chunk-TTNESUPQ.js";
72
+ import {
73
+ withFileLock
74
+ } from "./chunk-MEFB5KHA.js";
75
+ import {
76
+ evaluatePlan
77
+ } from "./chunk-2SNUOHAT.js";
68
78
  import {
69
79
  sanitizeForTerminal
70
- } from "./chunk-XVTD7UWR.js";
80
+ } from "./chunk-TROZ6HL4.js";
71
81
  import {
72
82
  getAddress
73
83
  } from "./chunk-EGELTSPU.js";
@@ -77,20 +87,22 @@ import {
77
87
  import {
78
88
  fetchFailureToCliError,
79
89
  httpRequest
80
- } from "./chunk-UOW5JXYY.js";
90
+ } from "./chunk-RJEPZMYY.js";
81
91
  import {
82
92
  resolveContextSettings
83
- } from "./chunk-ZP7AHN7Z.js";
84
- import {
85
- parseUsdToAtomic,
86
- toMoney
87
- } from "./chunk-FZTSGQVK.js";
93
+ } from "./chunk-AMEUXNJT.js";
88
94
  import {
89
95
  CliError,
90
96
  external_exports,
91
97
  isSameDeployment,
92
- readUsdcBalanceWithFallback
93
- } from "./chunk-QTND6XWJ.js";
98
+ parseUsdToAtomic,
99
+ readUsdcBalanceWithFallback,
100
+ toMoney,
101
+ writeFileAtomic
102
+ } from "./chunk-VVAHFCX2.js";
103
+ import {
104
+ quotesDir
105
+ } from "./chunk-SJLTEINJ.js";
94
106
  import {
95
107
  __commonJS,
96
108
  __toESM
@@ -473,11 +485,11 @@ var require_codegen = __commonJS({
473
485
  const rhs = this.rhs === void 0 ? "" : ` = ${this.rhs}`;
474
486
  return `${varKind} ${this.name}${rhs};` + _n;
475
487
  }
476
- optimizeNames(names, constants) {
488
+ optimizeNames(names, constants2) {
477
489
  if (!names[this.name.str])
478
490
  return;
479
491
  if (this.rhs)
480
- this.rhs = optimizeExpr(this.rhs, names, constants);
492
+ this.rhs = optimizeExpr(this.rhs, names, constants2);
481
493
  return this;
482
494
  }
483
495
  get names() {
@@ -494,10 +506,10 @@ var require_codegen = __commonJS({
494
506
  render({ _n }) {
495
507
  return `${this.lhs} = ${this.rhs};` + _n;
496
508
  }
497
- optimizeNames(names, constants) {
509
+ optimizeNames(names, constants2) {
498
510
  if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects)
499
511
  return;
500
- this.rhs = optimizeExpr(this.rhs, names, constants);
512
+ this.rhs = optimizeExpr(this.rhs, names, constants2);
501
513
  return this;
502
514
  }
503
515
  get names() {
@@ -558,8 +570,8 @@ var require_codegen = __commonJS({
558
570
  optimizeNodes() {
559
571
  return `${this.code}` ? this : void 0;
560
572
  }
561
- optimizeNames(names, constants) {
562
- this.code = optimizeExpr(this.code, names, constants);
573
+ optimizeNames(names, constants2) {
574
+ this.code = optimizeExpr(this.code, names, constants2);
563
575
  return this;
564
576
  }
565
577
  get names() {
@@ -588,12 +600,12 @@ var require_codegen = __commonJS({
588
600
  }
589
601
  return nodes.length > 0 ? this : void 0;
590
602
  }
591
- optimizeNames(names, constants) {
603
+ optimizeNames(names, constants2) {
592
604
  const { nodes } = this;
593
605
  let i = nodes.length;
594
606
  while (i--) {
595
607
  const n = nodes[i];
596
- if (n.optimizeNames(names, constants))
608
+ if (n.optimizeNames(names, constants2))
597
609
  continue;
598
610
  subtractNames(names, n.names);
599
611
  nodes.splice(i, 1);
@@ -646,12 +658,12 @@ var require_codegen = __commonJS({
646
658
  return void 0;
647
659
  return this;
648
660
  }
649
- optimizeNames(names, constants) {
661
+ optimizeNames(names, constants2) {
650
662
  var _a;
651
- this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);
652
- if (!(super.optimizeNames(names, constants) || this.else))
663
+ this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants2);
664
+ if (!(super.optimizeNames(names, constants2) || this.else))
653
665
  return;
654
- this.condition = optimizeExpr(this.condition, names, constants);
666
+ this.condition = optimizeExpr(this.condition, names, constants2);
655
667
  return this;
656
668
  }
657
669
  get names() {
@@ -674,10 +686,10 @@ var require_codegen = __commonJS({
674
686
  render(opts) {
675
687
  return `for(${this.iteration})` + super.render(opts);
676
688
  }
677
- optimizeNames(names, constants) {
678
- if (!super.optimizeNames(names, constants))
689
+ optimizeNames(names, constants2) {
690
+ if (!super.optimizeNames(names, constants2))
679
691
  return;
680
- this.iteration = optimizeExpr(this.iteration, names, constants);
692
+ this.iteration = optimizeExpr(this.iteration, names, constants2);
681
693
  return this;
682
694
  }
683
695
  get names() {
@@ -713,10 +725,10 @@ var require_codegen = __commonJS({
713
725
  render(opts) {
714
726
  return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts);
715
727
  }
716
- optimizeNames(names, constants) {
717
- if (!super.optimizeNames(names, constants))
728
+ optimizeNames(names, constants2) {
729
+ if (!super.optimizeNames(names, constants2))
718
730
  return;
719
- this.iterable = optimizeExpr(this.iterable, names, constants);
731
+ this.iterable = optimizeExpr(this.iterable, names, constants2);
720
732
  return this;
721
733
  }
722
734
  get names() {
@@ -758,11 +770,11 @@ var require_codegen = __commonJS({
758
770
  (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes();
759
771
  return this;
760
772
  }
761
- optimizeNames(names, constants) {
773
+ optimizeNames(names, constants2) {
762
774
  var _a, _b;
763
- super.optimizeNames(names, constants);
764
- (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);
765
- (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants);
775
+ super.optimizeNames(names, constants2);
776
+ (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants2);
777
+ (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants2);
766
778
  return this;
767
779
  }
768
780
  get names() {
@@ -1063,7 +1075,7 @@ var require_codegen = __commonJS({
1063
1075
  function addExprNames(names, from) {
1064
1076
  return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;
1065
1077
  }
1066
- function optimizeExpr(expr, names, constants) {
1078
+ function optimizeExpr(expr, names, constants2) {
1067
1079
  if (expr instanceof code_1.Name)
1068
1080
  return replaceName(expr);
1069
1081
  if (!canOptimize(expr))
@@ -1078,14 +1090,14 @@ var require_codegen = __commonJS({
1078
1090
  return items;
1079
1091
  }, []));
1080
1092
  function replaceName(n) {
1081
- const c = constants[n.str];
1093
+ const c = constants2[n.str];
1082
1094
  if (c === void 0 || names[n.str] !== 1)
1083
1095
  return n;
1084
1096
  delete names[n.str];
1085
1097
  return c;
1086
1098
  }
1087
1099
  function canOptimize(e) {
1088
- return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== void 0);
1100
+ return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants2[c.str] !== void 0);
1089
1101
  }
1090
1102
  }
1091
1103
  function subtractNames(names, from) {
@@ -8857,11 +8869,11 @@ function policyFix(reason, allowlistSubject) {
8857
8869
  case "not_allowlisted":
8858
8870
  return `Add ${allowlistSubject} to allowlistCreators, or clear the allowlist.`;
8859
8871
  case "session_budget_exceeded":
8860
- return "Raise sessionBudget with `tenjin config set sessionBudget <usd>`, or wait for the window to roll over.";
8872
+ return "Today's automatic budget is spent; it comes back as the rolling 24 hours pass. Nothing more is paid without the user's yes.";
8861
8873
  case "duplicate_in_flight":
8862
8874
  return "Let the in-flight request finish and read its result; retrying the same request does not renew authorization.";
8863
8875
  default:
8864
- return "Adjust your spend policy with `tenjin config set`.";
8876
+ return "This is over what this machine pays without asking, so it is not paid without the user's yes.";
8865
8877
  }
8866
8878
  }
8867
8879
  async function confirmSpend(input) {
@@ -8873,6 +8885,193 @@ async function confirmSpend(input) {
8873
8885
  return promptYesNo(prompt);
8874
8886
  }
8875
8887
 
8888
+ // src/lib/spend-quotes.ts
8889
+ import { randomBytes } from "node:crypto";
8890
+ import { constants } from "node:fs";
8891
+ import { open, opendir, rm } from "node:fs/promises";
8892
+ import { join as join2 } from "node:path";
8893
+ var QUOTE_TTL_MS = 10 * 6e4;
8894
+ var MAX_QUOTE_BYTES = 512 * 1024;
8895
+ var QUOTE_ID = /^q_[A-Za-z0-9_-]{12}$/;
8896
+ var Iso = external_exports.string().max(40);
8897
+ var Digits = external_exports.string().regex(/^\d+$/);
8898
+ var QuoteSchema = external_exports.strictObject({
8899
+ version: external_exports.literal(1),
8900
+ id: external_exports.string().regex(QUOTE_ID),
8901
+ createdAt: Iso,
8902
+ expiresAt: Iso,
8903
+ /** What the payments buy, as the user is asked about it. */
8904
+ what: external_exports.string().min(1).max(400),
8905
+ /** The one sentence the agent repeats and the user answers. */
8906
+ sentence: external_exports.string().min(1).max(800),
8907
+ totalAtomic: Digits,
8908
+ payments: external_exports.array(external_exports.strictObject({ amountAtomic: Digits, creator: external_exports.string().min(1).max(300) })).min(1).max(8),
8909
+ /** The call this quote runs, exactly: the router's own shape. */
8910
+ call: external_exports.unknown(),
8911
+ /** It ran: nothing more is paid on it. */
8912
+ usedAt: Iso.optional()
8913
+ });
8914
+ function isQuoteId(id) {
8915
+ return QUOTE_ID.test(id);
8916
+ }
8917
+ function quotePath(dataDir, id) {
8918
+ return join2(quotesDir(dataDir), `${id}.json`);
8919
+ }
8920
+ async function createQuote(dataDir, plan, now = Date.now) {
8921
+ const at = now();
8922
+ const quote = {
8923
+ version: 1,
8924
+ id: `q_${randomBytes(9).toString("base64url")}`,
8925
+ createdAt: new Date(at).toISOString(),
8926
+ expiresAt: new Date(at + QUOTE_TTL_MS).toISOString(),
8927
+ what: plan.what.slice(0, 400),
8928
+ sentence: plan.sentence.slice(0, 800),
8929
+ totalAtomic: plan.payments.reduce((sum, payment) => sum + payment.amountAtomic, 0n).toString(),
8930
+ payments: plan.payments.map((payment) => ({
8931
+ amountAtomic: payment.amountAtomic.toString(),
8932
+ creator: payment.creator
8933
+ })),
8934
+ call: plan.call
8935
+ };
8936
+ await writeQuote(dataDir, quote);
8937
+ void pruneQuotes(dataDir, at);
8938
+ return quote;
8939
+ }
8940
+ async function writeQuote(dataDir, quote) {
8941
+ await writeFileAtomic(quotePath(dataDir, quote.id), JSON.stringify(quote), {
8942
+ mode: 384,
8943
+ dirMode: 448
8944
+ });
8945
+ }
8946
+ async function readQuote(dataDir, id) {
8947
+ if (!isQuoteId(id)) return null;
8948
+ const file = await open(quotePath(dataDir, id), constants.O_RDONLY | constants.O_NOFOLLOW).catch(
8949
+ () => void 0
8950
+ );
8951
+ if (file === void 0) return null;
8952
+ try {
8953
+ const stat = await file.stat();
8954
+ if (!stat.isFile() || stat.size > MAX_QUOTE_BYTES) return null;
8955
+ const parsed = QuoteSchema.safeParse(JSON.parse(await file.readFile("utf8")));
8956
+ return parsed.success && parsed.data.id === id ? parsed.data : null;
8957
+ } catch {
8958
+ return null;
8959
+ } finally {
8960
+ await file.close().catch(() => void 0);
8961
+ }
8962
+ }
8963
+ function quoteClosed(quote, now) {
8964
+ if (quote.usedAt !== void 0) return "used";
8965
+ return Date.parse(quote.expiresAt) <= now ? "expired" : null;
8966
+ }
8967
+ async function changeQuote(dataDir, id, change) {
8968
+ if (!isQuoteId(id)) return { refused: "missing" };
8969
+ return withFileLock(
8970
+ `${quotePath(dataDir, id)}.lock`,
8971
+ async () => {
8972
+ const current = await readQuote(dataDir, id);
8973
+ if (current === null) return { refused: "missing" };
8974
+ const next = change(current);
8975
+ if (typeof next === "string") return { refused: next };
8976
+ await writeQuote(dataDir, next);
8977
+ return { quote: next };
8978
+ },
8979
+ { timeoutMs: 3e4 }
8980
+ );
8981
+ }
8982
+ function useQuote(dataDir, id, now = Date.now) {
8983
+ return changeQuote(dataDir, id, (quote) => {
8984
+ const at = now();
8985
+ return quoteClosed(quote, at) ?? { ...quote, usedAt: new Date(at).toISOString() };
8986
+ });
8987
+ }
8988
+ async function pruneQuotes(dataDir, now) {
8989
+ try {
8990
+ const dir = quotesDir(dataDir);
8991
+ for await (const entry of await opendir(dir)) {
8992
+ const id = entry.name.replace(/\.json$/, "");
8993
+ if (!entry.isFile() || !entry.name.endsWith(".json") || !isQuoteId(id)) continue;
8994
+ const quote = await readQuote(dataDir, id);
8995
+ const stale = quote !== null ? Date.parse(quote.expiresAt) < now : await open(join2(dir, entry.name), constants.O_RDONLY | constants.O_NOFOLLOW).then(async (file) => {
8996
+ try {
8997
+ return now - (await file.stat()).mtimeMs > 24 * 60 * 6e4;
8998
+ } finally {
8999
+ await file.close().catch(() => void 0);
9000
+ }
9001
+ }).catch(() => false);
9002
+ if (stale) await rm(join2(dir, entry.name), { force: true }).catch(() => void 0);
9003
+ }
9004
+ } catch {
9005
+ }
9006
+ }
9007
+
9008
+ // src/lib/spend-plan.ts
9009
+ var minted = /* @__PURE__ */ new WeakSet();
9010
+ var spent = /* @__PURE__ */ new WeakSet();
9011
+ function mint(amountAtomic, approved) {
9012
+ const slot = Object.freeze({ amountAtomic, approved });
9013
+ minted.add(slot);
9014
+ return slot;
9015
+ }
9016
+ function spendSlot(slot, amountAtomic) {
9017
+ if (typeof slot !== "object" || slot === null || !minted.has(slot)) {
9018
+ return "unplanned";
9019
+ }
9020
+ const held = slot;
9021
+ if (spent.has(held)) return "spent";
9022
+ if (amountAtomic > held.amountAtomic) return "above_plan";
9023
+ spent.add(held);
9024
+ return null;
9025
+ }
9026
+ async function admitPlan(payments, opts) {
9027
+ const totalAtomic = payments.reduce((sum, payment) => sum + payment.amountAtomic, 0n);
9028
+ const ledger = await readSpendSummary(opts.dataDir, {
9029
+ ...opts.now !== void 0 ? { now: opts.now } : {}
9030
+ });
9031
+ const spentAtomic = ledger === null ? 0n : spentOf(ledger);
9032
+ const evaluation = evaluatePlan(opts.policy, payments, spentAtomic);
9033
+ if (evaluation.reason === "not_allowlisted") return { refused: { message: evaluation.message } };
9034
+ const over = evaluation.decision !== "allow";
9035
+ if ((payments.length > 1 || over) && totalAtomic > 0n) {
9036
+ const balanceAtomic = await opts.balance();
9037
+ if (balanceAtomic !== null && balanceAtomic < totalAtomic) {
9038
+ return { short: { balanceAtomic, totalAtomic } };
9039
+ }
9040
+ }
9041
+ if (over) {
9042
+ const budget = opts.policy.sessionBudgetAtomic;
9043
+ return {
9044
+ over: {
9045
+ reason: evaluation.reason === "session_budget_exceeded" ? "session_budget_exceeded" : "above_auto_spend",
9046
+ totalAtomic,
9047
+ maxAutoSpendAtomic: opts.policy.maxAutoSpendAtomic,
9048
+ budgetLeftAtomic: budget === null ? null : budget > spentAtomic ? budget - spentAtomic : 0n
9049
+ }
9050
+ };
9051
+ }
9052
+ return { admitted: payments.map((payment) => mint(payment.amountAtomic, false)) };
9053
+ }
9054
+ async function admitQuote(dataDir, id, opts) {
9055
+ const now = opts.now ?? Date.now;
9056
+ const kept = await readQuote(dataDir, id);
9057
+ if (kept === null) return { refused: "missing" };
9058
+ const closed = quoteClosed(kept, now());
9059
+ if (closed !== null) return { refused: closed };
9060
+ const totalAtomic = BigInt(kept.totalAtomic);
9061
+ if (totalAtomic > 0n) {
9062
+ const balanceAtomic = await opts.balance();
9063
+ if (balanceAtomic !== null && balanceAtomic < totalAtomic) {
9064
+ return { short: { balanceAtomic, totalAtomic } };
9065
+ }
9066
+ }
9067
+ const used = await useQuote(dataDir, id, now);
9068
+ if ("refused" in used) return used;
9069
+ return {
9070
+ quote: used.quote,
9071
+ admitted: used.quote.payments.map((payment) => mint(BigInt(payment.amountAtomic), true))
9072
+ };
9073
+ }
9074
+
8876
9075
  // node_modules/.pnpm/@x402+core@2.28.0/node_modules/@x402/core/dist/esm/client/index.mjs
8877
9076
  var DEFAULT_MAX_AMOUNT_PER_PAYMENT = "$1";
8878
9077
  function isAtomicAmount(amount) {
@@ -11746,6 +11945,13 @@ async function executePay(args, ctx, deps, warnings) {
11746
11945
  { details: { reason: "invalid_router_terms" } }
11747
11946
  );
11748
11947
  }
11948
+ if (args.admit === void 0) {
11949
+ throw new CliError(
11950
+ "REFUSED",
11951
+ "A router payment is signed only against its call's spend plan, and this one has none; nothing was sent.",
11952
+ { details: { reason: "unplanned" } }
11953
+ );
11954
+ }
11749
11955
  }
11750
11956
  const settings = await resolveContextSettings(ctx);
11751
11957
  const maxPriceAtomic = args.maxPrice !== void 0 ? BigInt(parseUsdToAtomic(args.maxPrice)) : void 0;
@@ -11779,6 +11985,7 @@ async function executePay(args, ctx, deps, warnings) {
11779
11985
  }
11780
11986
  if (probe.status >= 200 && probe.status < 300) {
11781
11987
  const caveat = assertUsableResult(args.resultSchema, probe.text, probe.status, "free");
11988
+ args.onPaidLeg?.({ status: probe.status, header: probe.header });
11782
11989
  return deliver(url, lane, probe, {
11783
11990
  paid: false,
11784
11991
  ...caveat !== void 0 ? { caveat } : {},
@@ -11817,6 +12024,8 @@ async function executePay(args, ctx, deps, warnings) {
11817
12024
  warnings
11818
12025
  );
11819
12026
  }
12027
+ const entitlement = paymentRequired.extensions?.[SIGN_IN_WITH_X] !== void 0;
12028
+ let slot = router && !entitlement ? await args.admit(firstSeenAmount) : void 0;
11820
12029
  const provider = resolveWalletProvider(
11821
12030
  ctx,
11822
12031
  deps.provider !== void 0 ? { provider: deps.provider } : {}
@@ -11825,7 +12034,7 @@ async function executePay(args, ctx, deps, warnings) {
11825
12034
  openedSigner.current = signer;
11826
12035
  let effectiveChallenge = paymentRequired;
11827
12036
  let effectiveRequirement = requirement;
11828
- if (paymentRequired.extensions?.[SIGN_IN_WITH_X] !== void 0) {
12037
+ if (entitlement) {
11829
12038
  const siwxHeader = await buildSiwxHeader(signer, {
11830
12039
  baseUrl: new URL(url).origin,
11831
12040
  chainId: requirement.network
@@ -11842,6 +12051,7 @@ async function executePay(args, ctx, deps, warnings) {
11842
12051
  recheck.status,
11843
12052
  "entitled"
11844
12053
  );
12054
+ args.onPaidLeg?.({ status: recheck.status, header: recheck.header });
11845
12055
  return deliver(url, lane, recheck, {
11846
12056
  paid: false,
11847
12057
  entitled: true,
@@ -11894,6 +12104,32 @@ async function executePay(args, ctx, deps, warnings) {
11894
12104
  }
11895
12105
  }
11896
12106
  const amountAtomic = BigInt(effectiveRequirement.amount);
12107
+ if (router && entitlement) slot = await args.admit(amountAtomic);
12108
+ if (router) {
12109
+ const refusal2 = spendSlot(slot, amountAtomic);
12110
+ if (refusal2 === "above_plan") {
12111
+ throw new CliError(
12112
+ "PAYMENT_FAILED",
12113
+ `The live price ($${toMoney(amountAtomic.toString()).usd}) is above the $${toMoney(slot.amountAtomic.toString()).usd} this call planned for it, so nothing was signed.`,
12114
+ {
12115
+ fix: "Call again for a fresh plan at the new price.",
12116
+ details: {
12117
+ reason: "above_plan",
12118
+ plannedAtomic: slot.amountAtomic.toString(),
12119
+ live: { amount: amountAtomic.toString() }
12120
+ }
12121
+ }
12122
+ );
12123
+ }
12124
+ if (refusal2 !== null) {
12125
+ throw new CliError(
12126
+ "REFUSED",
12127
+ "A router payment is signed only against an unspent slot of its call's spend plan; nothing was signed.",
12128
+ { details: { reason: refusal2 } }
12129
+ );
12130
+ }
12131
+ }
12132
+ const approved = slot?.approved === true;
11897
12133
  const authorizer = resolveSpendAuthorizer(
11898
12134
  ctx,
11899
12135
  settings.policy,
@@ -11901,7 +12137,7 @@ async function executePay(args, ctx, deps, warnings) {
11901
12137
  );
11902
12138
  const verifiedVia = registry ?? termsLabel;
11903
12139
  const via = verifiedVia !== void 0 ? ` (${sanitizeForTerminal(verifiedVia)})` : "";
11904
- const mode = router ? "automatic" : "manual";
12140
+ const mode = router && !approved ? "automatic" : "manual";
11905
12141
  const reservationId = await gateSpend({
11906
12142
  mode,
11907
12143
  ctx,
@@ -11910,7 +12146,7 @@ async function executePay(args, ctx, deps, warnings) {
11910
12146
  creator: host,
11911
12147
  ...maxPriceAtomic !== void 0 ? { maxPriceAtomic } : {},
11912
12148
  ...args.requestKey !== void 0 ? { requestKey: args.requestKey } : {},
11913
- yes: args.yes === true,
12149
+ yes: args.yes === true || approved,
11914
12150
  ...deps.confirm !== void 0 ? { confirm: deps.confirm } : {},
11915
12151
  payeeLabel: `${sanitizeForTerminal(url)}${via}; recipient ${sanitizeForTerminal(effectiveRequirement.payTo)}, ${sanitizeForTerminal(effectiveRequirement.network)} / ${sanitizeForTerminal(effectiveRequirement.asset)}`,
11916
12152
  allowlistSubject: "this host",
@@ -11918,55 +12154,45 @@ async function executePay(args, ctx, deps, warnings) {
11918
12154
  });
11919
12155
  let payment;
11920
12156
  try {
11921
- if (amountAtomic > 0n) {
11922
- const deadline = Date.now() + ctx.flags.timeout;
11923
- const readBalance = deps.readBalance ?? readUsdcBalanceWithFallback;
11924
- let balance = await readBalance(signer.address, settings.rpcUrl, {
11925
- timeoutMs: Math.max(1, Math.floor(ctx.flags.timeout / 2))
11926
- });
11927
- if (balance === null && Date.now() < deadline) {
11928
- await delay(Math.min(1100, Math.floor((deadline - Date.now()) / 2)));
11929
- const remaining = deadline - Date.now();
11930
- if (remaining > 0)
11931
- balance = await readBalance(signer.address, settings.rpcUrl, { timeoutMs: remaining });
11932
- }
11933
- if (balance === null) {
11934
- throw new CliError(
11935
- "REFUSED",
11936
- "The wallet balance could not be read; no payment was signed.",
11937
- {
11938
- fix: "Check the configured Base rpcUrl and retry when it is available.",
11939
- details: { reason: "balance_unavailable", address: signer.address }
11940
- }
11941
- );
11942
- }
11943
- if (balance < amountAtomic) {
11944
- throw new CliError("REFUSED", "The wallet has insufficient USDC; no payment was signed.", {
11945
- fix: "Fund this wallet on Base with `tenjin wallet fund` before paying.",
11946
- details: {
11947
- reason: "insufficient_funds",
11948
- address: signer.address,
11949
- balanceAtomic: balance.toString(),
11950
- requiredAtomic: amountAtomic.toString()
11951
- }
11952
- });
11953
- }
11954
- }
12157
+ await assertBalanceCovers(signer.address, amountAtomic, settings.rpcUrl, ctx, deps);
11955
12158
  payment = await buildExactPayment(effectiveChallenge, signer, effectiveRequirement);
11956
12159
  } catch (err) {
11957
12160
  await authorizer.release(reservationId);
11958
12161
  throw err;
11959
12162
  }
12163
+ const paidTimeoutMs = paidLegTimeoutMs(effectiveRequirement, ctx.flags.timeout);
11960
12164
  const paid = await httpRequest(url, {
11961
12165
  ...fetchOpts,
11962
- timeoutMs: paidLegTimeoutMs(effectiveRequirement, ctx.flags.timeout),
12166
+ timeoutMs: paidTimeoutMs,
11963
12167
  headers: { ...headers, ...payment.headers }
11964
12168
  });
11965
12169
  await authorizer.commit(reservationId, payment.amountAtomic, {
11966
12170
  mode,
11967
12171
  ...payment.authorization !== void 0 ? { nonce: payment.authorization.nonce } : {}
11968
12172
  });
12173
+ if (paid.ok || paid.header !== void 0) {
12174
+ args.onPaidLeg?.({
12175
+ ...paid.status !== void 0 ? { status: paid.status } : {},
12176
+ ...paid.header !== void 0 ? { header: paid.header } : {}
12177
+ });
12178
+ }
11969
12179
  if (!paid.ok) {
12180
+ const statusUrl = paid.kind === "timeout" ? statusUrlOf(paid, url) : null;
12181
+ if (statusUrl !== null) {
12182
+ throw new CliError(
12183
+ "NETWORK_ERROR",
12184
+ `The seller is still working on this: no result within ${Math.round(paidTimeoutMs / 1e3)} s, and it named a status URL to check: ${statusUrl}`,
12185
+ {
12186
+ fix: "The authorization was transmitted and settlement is unknown until the job ends; it is recorded as transmitted exposure. Do not pay again: check the status URL for the result.",
12187
+ details: {
12188
+ statusUrl,
12189
+ amountAtomic: payment.amountAtomic.toString(),
12190
+ settlement: "unknown",
12191
+ ...payment.authorization !== void 0 ? { authorization: payment.authorization } : {}
12192
+ }
12193
+ }
12194
+ );
12195
+ }
11970
12196
  throw fetchFailureToCliError(paid, {
11971
12197
  fix: `The authorization was transmitted and settlement is unknown; it is recorded as transmitted exposure. Do not simply retry: each attempt signs a fresh authorization. ${legFix(paid)}`,
11972
12198
  details: {
@@ -12022,6 +12248,116 @@ function paidLegTimeoutMs(requirement, cliTimeoutMs) {
12022
12248
  }
12023
12249
  return Math.max(cliTimeoutMs, Math.min(advertised * 1e3, MAX_PAID_LEG_TIMEOUT_MS));
12024
12250
  }
12251
+ async function assertBalanceCovers(address, amountAtomic, rpcUrl, ctx, deps) {
12252
+ if (amountAtomic <= 0n) return;
12253
+ const deadline = Date.now() + ctx.flags.timeout;
12254
+ const readBalance = deps.readBalance ?? readUsdcBalanceWithFallback;
12255
+ let balance = await readBalance(address, rpcUrl, {
12256
+ timeoutMs: Math.max(1, Math.floor(ctx.flags.timeout / 2))
12257
+ });
12258
+ if (balance === null && Date.now() < deadline) {
12259
+ await delay(Math.min(1100, Math.floor((deadline - Date.now()) / 2)));
12260
+ const remaining = deadline - Date.now();
12261
+ if (remaining > 0) balance = await readBalance(address, rpcUrl, { timeoutMs: remaining });
12262
+ }
12263
+ if (balance === null) {
12264
+ throw new CliError("REFUSED", "The wallet balance could not be read; no payment was signed.", {
12265
+ fix: "Check the configured Base rpcUrl and retry when it is available.",
12266
+ details: { reason: "balance_unavailable", address }
12267
+ });
12268
+ }
12269
+ if (balance < amountAtomic) {
12270
+ const short = toMoney((amountAtomic - balance).toString()).usd;
12271
+ throw new CliError(
12272
+ "REFUSED",
12273
+ `The wallet has insufficient USDC; no payment was signed. It holds ${toMoney(balance.toString()).usd} USD and this costs ${toMoney(amountAtomic.toString()).usd} USD: ${short} USD short.`,
12274
+ {
12275
+ fix: `Fund this wallet on Base with \`tenjin wallet fund\` (at least ${short} USD more) before paying.`,
12276
+ details: {
12277
+ reason: "insufficient_funds",
12278
+ address,
12279
+ balanceAtomic: balance.toString(),
12280
+ requiredAtomic: amountAtomic.toString()
12281
+ }
12282
+ }
12283
+ );
12284
+ }
12285
+ }
12286
+ async function quoteRouterCall(args, ctx, deps = {}) {
12287
+ const settings = await resolveContextSettings(ctx);
12288
+ const url = args.url.trim();
12289
+ if (resolveLane(url, settings) === "bazaar") {
12290
+ await assertPublicDestination(url, deps.destination ?? {});
12291
+ }
12292
+ const headers = callerHeaders(args.headers);
12293
+ const probe = await httpRequest(url, {
12294
+ timeoutMs: ctx.flags.timeout,
12295
+ blockRedirects: true,
12296
+ binaryBody: true,
12297
+ method: resolveMethod(args),
12298
+ ...deps.fetchImpl !== void 0 ? { fetchImpl: deps.fetchImpl } : {},
12299
+ ...args.rawBody !== void 0 ? { rawBody: args.rawBody } : {},
12300
+ ...Object.keys(headers).length > 0 ? { headers } : {}
12301
+ });
12302
+ if (!probe.ok) {
12303
+ throw fetchFailureToCliError(probe, {
12304
+ fix: `Nothing was sent and nothing was paid. ${legFix(probe)}`
12305
+ });
12306
+ }
12307
+ if (probe.status >= 200 && probe.status < 300) return 0n;
12308
+ if (probe.status !== 402) {
12309
+ const said = providerMessage(probe.json);
12310
+ throw new CliError(
12311
+ "API_UNREACHABLE",
12312
+ `${url} answered ${probe.status}${said === null ? "." : `: ${said}`}`,
12313
+ {
12314
+ fix: "Nothing was paid.",
12315
+ details: { status: probe.status, body: probe.json, ...providerError(probe.text) }
12316
+ }
12317
+ );
12318
+ }
12319
+ const challenge = decodeChallenge(probe, url);
12320
+ const payer = createPayerClient(() => signerOrThrow({}));
12321
+ const requirement = selectRequirement(payer.core, challenge, args.terms);
12322
+ if (requirement === void 0) throw noMatchingEntry(challenge, args.terms);
12323
+ assertWithinTerms(args.terms, requirement);
12324
+ if (challenge.extensions?.[SIGN_IN_WITH_X] === void 0) return BigInt(requirement.amount);
12325
+ const signer = await openWallet(
12326
+ resolveWalletProvider(ctx, deps.provider !== void 0 ? { provider: deps.provider } : {})
12327
+ );
12328
+ const recheck = await httpRequest(url, {
12329
+ timeoutMs: ctx.flags.timeout,
12330
+ blockRedirects: true,
12331
+ binaryBody: true,
12332
+ method: resolveMethod(args),
12333
+ ...deps.fetchImpl !== void 0 ? { fetchImpl: deps.fetchImpl } : {},
12334
+ ...args.rawBody !== void 0 ? { rawBody: args.rawBody } : {},
12335
+ headers: {
12336
+ ...headers,
12337
+ [SIWX_HEADER]: await buildSiwxHeader(signer, {
12338
+ baseUrl: new URL(url).origin,
12339
+ chainId: requirement.network
12340
+ })
12341
+ }
12342
+ });
12343
+ if (!recheck.ok) throw fetchFailureToCliError(recheck);
12344
+ if (recheck.status >= 200 && recheck.status < 300) return 0n;
12345
+ if (recheck.status !== 402) {
12346
+ throw new CliError(
12347
+ "API_UNREACHABLE",
12348
+ `${url} answered ${recheck.status} on the entitlement re-check.`,
12349
+ {
12350
+ fix: "Nothing was paid.",
12351
+ details: { status: recheck.status, body: recheck.json, ...providerError(recheck.text) }
12352
+ }
12353
+ );
12354
+ }
12355
+ const fresh = decodeChallenge(recheck, url);
12356
+ const owed = selectRequirement(payer.core, fresh, args.terms);
12357
+ if (owed === void 0) throw noMatchingEntry(fresh, args.terms);
12358
+ assertWithinTerms(args.terms, owed);
12359
+ return BigInt(owed.amount);
12360
+ }
12025
12361
  function resolveLane(url, settings) {
12026
12362
  let target;
12027
12363
  try {
@@ -12127,6 +12463,21 @@ function unvalidatedCaveat(check) {
12127
12463
  function failedRuleCaveat(check) {
12128
12464
  return `${check.reason ?? "The result does not satisfy its success schema."} The payment settled, so the body is delivered as received, unverified: treat it as possibly not the answer that was paid for.`;
12129
12465
  }
12466
+ var STATUS_URL_HEADERS = ["x-status-url"];
12467
+ function statusUrlOf(failure, requestUrl) {
12468
+ for (const name of STATUS_URL_HEADERS) {
12469
+ const value = failure.header?.(name)?.trim();
12470
+ if (value === void 0 || value.length === 0 || value.length > 2048) continue;
12471
+ try {
12472
+ const status = new URL(value, requestUrl);
12473
+ if (status.protocol === "https:" && status.host === new URL(requestUrl).host) {
12474
+ return status.toString();
12475
+ }
12476
+ } catch {
12477
+ }
12478
+ }
12479
+ return null;
12480
+ }
12130
12481
  function legFix(failure) {
12131
12482
  return failure.kind === "oversized-header" ? "Raising `--max-http-header-size` on the node process that runs this CLI would let the header be read; that is an operator decision, not a default this build changes." : "";
12132
12483
  }
@@ -12325,8 +12676,14 @@ export {
12325
12676
  canonicalHash,
12326
12677
  inputProblems,
12327
12678
  assertResultSchema,
12679
+ validateResultBody,
12328
12680
  projectBody,
12329
12681
  policyFix,
12682
+ createQuote,
12683
+ readQuote,
12684
+ quoteClosed,
12685
+ admitPlan,
12686
+ admitQuote,
12330
12687
  x402Client,
12331
12688
  BatchSettlementEvmScheme,
12332
12689
  toClientEvmSigner,
@@ -12334,6 +12691,8 @@ export {
12334
12691
  runPay,
12335
12692
  MAX_PAID_LEG_TIMEOUT_MS,
12336
12693
  paidLegTimeoutMs,
12694
+ quoteRouterCall,
12695
+ sellerLine,
12337
12696
  settlementTx
12338
12697
  };
12339
- //# sourceMappingURL=chunk-FQ6DHINU.js.map
12698
+ //# sourceMappingURL=chunk-R4AO7GC2.js.map