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

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 (110) hide show
  1. package/README.md +7 -5
  2. package/dist/{chunk-25GGN553.js → chunk-3O2BQIF6.js} +86 -22
  3. package/dist/chunk-3O2BQIF6.js.map +1 -0
  4. package/dist/{chunk-R4AO7GC2.js → chunk-5LJCEMFD.js} +14 -12
  5. package/dist/{chunk-R4AO7GC2.js.map → chunk-5LJCEMFD.js.map} +1 -1
  6. package/dist/{chunk-QTGUDCIR.js → chunk-AEG2PXBP.js} +3 -3
  7. package/dist/{chunk-AMEUXNJT.js → chunk-AWFUPKTM.js} +2 -2
  8. package/dist/{chunk-XJQ6CH7X.js → chunk-EBVIKMCH.js} +2 -2
  9. package/dist/{chunk-XDYKZRLN.js → chunk-HE2MS4QO.js} +6 -6
  10. package/dist/{chunk-RJEPZMYY.js → chunk-IOODYAXL.js} +3 -3
  11. package/dist/{chunk-SBL4THYT.js → chunk-JMM6YE7J.js} +190 -90
  12. package/dist/chunk-JMM6YE7J.js.map +1 -0
  13. package/dist/{chunk-VKQXVCZR.js → chunk-KHE6L6TD.js} +3 -3
  14. package/dist/chunk-KOGZDMHO.js +21 -0
  15. package/dist/chunk-KOGZDMHO.js.map +1 -0
  16. package/dist/{chunk-TROZ6HL4.js → chunk-KYFZTGMC.js} +2 -2
  17. package/dist/{chunk-LX5OT4TQ.js → chunk-NZIP4PA2.js} +2 -2
  18. package/dist/chunk-O2FRQ2L2.js +168 -0
  19. package/dist/chunk-O2FRQ2L2.js.map +1 -0
  20. package/dist/{chunk-3FY5HG7R.js → chunk-OK2TDZQU.js} +4 -4
  21. package/dist/{chunk-ZQNGTLOC.js → chunk-OSYTBCUC.js} +7 -5
  22. package/dist/{chunk-ZQNGTLOC.js.map → chunk-OSYTBCUC.js.map} +1 -1
  23. package/dist/{chunk-MRUPDSUM.js → chunk-PAYV4XUA.js} +3 -5
  24. package/dist/chunk-PAYV4XUA.js.map +1 -0
  25. package/dist/{chunk-USOLCBKC.js → chunk-QUVVWYJW.js} +7 -5
  26. package/dist/{chunk-USOLCBKC.js.map → chunk-QUVVWYJW.js.map} +1 -1
  27. package/dist/{chunk-MOG7PB3A.js → chunk-RAULEAZ6.js} +3 -3
  28. package/dist/{chunk-MG3G644T.js → chunk-SPAVAYSW.js} +3 -3
  29. package/dist/{chunk-4FYMDRD3.js → chunk-TTBKWWTV.js} +22 -20
  30. package/dist/chunk-TTBKWWTV.js.map +1 -0
  31. package/dist/{chunk-OOSRB3OF.js → chunk-U6YQ6FRI.js} +2 -2
  32. package/dist/{chunk-P4LVLFO4.js → chunk-VFMQTSXG.js} +2 -2
  33. package/dist/{chunk-LRCJ2IZ5.js → chunk-VUFAK2LW.js} +2 -2
  34. package/dist/{chunk-LRCJ2IZ5.js.map → chunk-VUFAK2LW.js.map} +1 -1
  35. package/dist/{chunk-WM7TJEBP.js → chunk-VZGAONSJ.js} +7 -5
  36. package/dist/{chunk-WM7TJEBP.js.map → chunk-VZGAONSJ.js.map} +1 -1
  37. package/dist/{chunk-VVAHFCX2.js → chunk-WO5BJNIB.js} +45 -194
  38. package/dist/chunk-WO5BJNIB.js.map +1 -0
  39. package/dist/chunk-WVUSXNIE.js +39 -0
  40. package/dist/chunk-WVUSXNIE.js.map +1 -0
  41. package/dist/chunk-XKESD27X.js +10 -0
  42. package/dist/chunk-XKESD27X.js.map +1 -0
  43. package/dist/{chunk-SFEQGENI.js → chunk-YFQOA5AU.js} +7 -2
  44. package/dist/{chunk-SFEQGENI.js.map → chunk-YFQOA5AU.js.map} +1 -1
  45. package/dist/{cli-JPTDHGRX.js → cli-O5SN7ZJ4.js} +38 -30
  46. package/dist/{cli-JPTDHGRX.js.map → cli-O5SN7ZJ4.js.map} +1 -1
  47. package/dist/{config-YYKDH2TH.js → config-OJQI27LT.js} +13 -12
  48. package/dist/{doctor-SSTXGCHX.js → doctor-IQQJHGGM.js} +36 -62
  49. package/dist/doctor-IQQJHGGM.js.map +1 -0
  50. package/dist/{fund-QWVWRVDK.js → fund-WEV6DMTD.js} +17 -12
  51. package/dist/{fund-QWVWRVDK.js.map → fund-WEV6DMTD.js.map} +1 -1
  52. package/dist/hook-command-D2P3ILRV.js +32 -0
  53. package/dist/hosts/claude/.claude-plugin/marketplace.json +2 -2
  54. package/dist/hosts/claude/tenjin/.claude-plugin/plugin.json +2 -2
  55. package/dist/index.js +4 -4
  56. package/dist/{install-2GXXD4DK.js → install-TUCRF32I.js} +23 -14
  57. package/dist/{install-identity-FK3YF227.js → install-identity-WHPNMNMQ.js} +7 -6
  58. package/dist/{install-wallet-TC22U52X.js → install-wallet-MA27FTQ5.js} +11 -10
  59. package/dist/{install-wallet-TC22U52X.js.map → install-wallet-MA27FTQ5.js.map} +1 -1
  60. package/dist/{mcp-42H2F4NY.js → mcp-QML7ZMPH.js} +33 -40
  61. package/dist/mcp-QML7ZMPH.js.map +1 -0
  62. package/dist/{package-6DJA3Y2O.js → package-LGKYOEPV.js} +2 -2
  63. package/dist/{pay-LSDJBIAZ.js → pay-2C2UBBXJ.js} +14 -13
  64. package/dist/{payments-SPECLBRQ.js → payments-C44QUFXU.js} +10 -9
  65. package/dist/{payments-SPECLBRQ.js.map → payments-C44QUFXU.js.map} +1 -1
  66. package/dist/{send-MHAOLPK3.js → send-KVJX4XIR.js} +9 -8
  67. package/dist/{send-MHAOLPK3.js.map → send-KVJX4XIR.js.map} +1 -1
  68. package/dist/{status-O2RWLPS5.js → status-S7C3WMSH.js} +10 -9
  69. package/dist/{status-O2RWLPS5.js.map → status-S7C3WMSH.js.map} +1 -1
  70. package/dist/{status-line-45TVCRM3.js → status-line-YR2T5HC4.js} +6 -5
  71. package/dist/{status-line-45TVCRM3.js.map → status-line-YR2T5HC4.js.map} +1 -1
  72. package/dist/{uninstall-VOK2Z5M4.js → uninstall-HY6LKIIT.js} +17 -14
  73. package/dist/{uninstall-VOK2Z5M4.js.map → uninstall-HY6LKIIT.js.map} +1 -1
  74. package/dist/{update-FGP3HNLD.js → update-OJV22LR3.js} +17 -14
  75. package/dist/usdc-JK4RRFFQ.js +39 -0
  76. package/dist/{wallet-DA7OFNEW.js → wallet-PD2IMZDU.js} +11 -10
  77. package/dist/wallet-PD2IMZDU.js.map +1 -0
  78. package/docs/agent-permissions.md +16 -4
  79. package/package.json +1 -1
  80. package/dist/chunk-25GGN553.js.map +0 -1
  81. package/dist/chunk-4FYMDRD3.js.map +0 -1
  82. package/dist/chunk-EWLU46J6.js +0 -100
  83. package/dist/chunk-EWLU46J6.js.map +0 -1
  84. package/dist/chunk-MRUPDSUM.js.map +0 -1
  85. package/dist/chunk-SBL4THYT.js.map +0 -1
  86. package/dist/chunk-VVAHFCX2.js.map +0 -1
  87. package/dist/doctor-SSTXGCHX.js.map +0 -1
  88. package/dist/hook-command-VWJXRT7H.js +0 -31
  89. package/dist/mcp-42H2F4NY.js.map +0 -1
  90. /package/dist/{chunk-QTGUDCIR.js.map → chunk-AEG2PXBP.js.map} +0 -0
  91. /package/dist/{chunk-AMEUXNJT.js.map → chunk-AWFUPKTM.js.map} +0 -0
  92. /package/dist/{chunk-XJQ6CH7X.js.map → chunk-EBVIKMCH.js.map} +0 -0
  93. /package/dist/{chunk-XDYKZRLN.js.map → chunk-HE2MS4QO.js.map} +0 -0
  94. /package/dist/{chunk-RJEPZMYY.js.map → chunk-IOODYAXL.js.map} +0 -0
  95. /package/dist/{chunk-VKQXVCZR.js.map → chunk-KHE6L6TD.js.map} +0 -0
  96. /package/dist/{chunk-TROZ6HL4.js.map → chunk-KYFZTGMC.js.map} +0 -0
  97. /package/dist/{chunk-LX5OT4TQ.js.map → chunk-NZIP4PA2.js.map} +0 -0
  98. /package/dist/{chunk-3FY5HG7R.js.map → chunk-OK2TDZQU.js.map} +0 -0
  99. /package/dist/{chunk-MOG7PB3A.js.map → chunk-RAULEAZ6.js.map} +0 -0
  100. /package/dist/{chunk-MG3G644T.js.map → chunk-SPAVAYSW.js.map} +0 -0
  101. /package/dist/{chunk-OOSRB3OF.js.map → chunk-U6YQ6FRI.js.map} +0 -0
  102. /package/dist/{chunk-P4LVLFO4.js.map → chunk-VFMQTSXG.js.map} +0 -0
  103. /package/dist/{config-YYKDH2TH.js.map → config-OJQI27LT.js.map} +0 -0
  104. /package/dist/{hook-command-VWJXRT7H.js.map → hook-command-D2P3ILRV.js.map} +0 -0
  105. /package/dist/{install-2GXXD4DK.js.map → install-TUCRF32I.js.map} +0 -0
  106. /package/dist/{install-identity-FK3YF227.js.map → install-identity-WHPNMNMQ.js.map} +0 -0
  107. /package/dist/{package-6DJA3Y2O.js.map → package-LGKYOEPV.js.map} +0 -0
  108. /package/dist/{pay-LSDJBIAZ.js.map → pay-2C2UBBXJ.js.map} +0 -0
  109. /package/dist/{update-FGP3HNLD.js.map → update-OJV22LR3.js.map} +0 -0
  110. /package/dist/{wallet-DA7OFNEW.js.map → usdc-JK4RRFFQ.js.map} +0 -0
package/README.md CHANGED
@@ -45,7 +45,7 @@ In Claude Code or Claude Desktop, paste:
45
45
  Install Tenjin from tenjin.sh
46
46
  ```
47
47
 
48
- Your agent installs it, asks you about spend limits in the session, and helps you fund the wallet. Then type `/reload-plugins`, or start a new session, and Tenjin is on (when upgrading from an earlier release, start a new session). It needs Claude Code 2.1.287 or newer.
48
+ Your agent asks you about spend limits, installs it, then asks whether to add funds now; you never type a command. Then type `/reload-plugins`, or start a new session, and Tenjin is on (when upgrading from an earlier release, start a new session). It needs Claude Code 2.1.287 or newer.
49
49
 
50
50
  Or in a terminal (Node.js 22 or newer):
51
51
 
@@ -115,14 +115,16 @@ Tenjin pays for tools with [x402](https://www.x402.org), an open standard that b
115
115
 
116
116
  | Limit | Default | Change it |
117
117
  | -------- | ------- | ------------------------------------- |
118
- | Per call | $0.25 | `tenjin config set maxAutoSpend 0.10` |
119
118
  | Per day | $5 | `tenjin config set sessionBudget 2` |
119
+ | Per call | $0.25 | `tenjin config set maxAutoSpend 0.50` |
120
120
 
121
- `tenjin install` asks you to approve these limits, or tells your agent to ask you when the agent runs it. A call that would pay more (all its payments together, such as five takes of a video) pays nothing on its own: your assistant tells you what it costs, and in Claude Code it asks you through Claude Code's own permission prompt and runs it once you say yes. [How the limits work →](./docs/agent-permissions.md#what-bounds-a-payment)
121
+ The daily budget is the control, the per-call limit is the runaway guard, and your wallet balance is the hard stop. Both defaults hold from the moment you install. `tenjin install` asks once, or tells your agent to ask you when the agent runs it: use the defaults, or set your own limits. The per-call limit cannot go below $0.25, the routing deposit. To turn the router off, run `tenjin config set router.enabled false`.
122
+
123
+ A call that would pay more than the per-call limit (all its payments together, such as five takes of a video; today two video models at $0.42 and $0.45, hosting at $0.50 and research at $0.60 are priced above it) pays nothing on its own: your assistant tells you what it costs, and in Claude Code it asks you through Claude Code's own permission prompt and runs it once you say yes. [How the limits work →](./docs/agent-permissions.md#what-bounds-a-payment)
122
124
 
123
125
  ### Routing fee
124
126
 
125
- Each routing call costs a flat $0.003, paid over x402 `batch-settlement` by `tenjin mcp` from a channel deposit of up to $0.25 (less when your per-call limit is lower). A deposit is an automatic payment: it counts against the limits above, and approving them at install approves the fee. The fees come out of the deposit and are not counted again. When a deposit is taken, Claude Code says so once; `tenjin status` shows it as prepaid routing credit, apart from what lookups cost, and `tenjin wallet balance` adds the credit still left. When a call cannot be paid, it takes the free path, and Claude Code tells you once per session why and what fixes it; `tenjin doctor` says the same. Details are in [docs/agent-permissions.md](docs/agent-permissions.md#what-bounds-a-router-payment-on-top-of-that).
127
+ Each routing call costs a flat $0.003, paid over x402 `batch-settlement` by `tenjin mcp` from a channel deposit of up to $0.25. A deposit is an automatic payment: it counts against the limits above, and approving them at install approves the fee. The fees come out of the deposit and are not counted again. When a deposit is taken, Claude Code says so once; `tenjin status` shows it as prepaid routing credit, apart from what lookups cost, and `tenjin wallet balance` adds the credit still left. When a call cannot be paid, it takes the free path, and Claude Code tells you once per session why and what fixes it; `tenjin doctor` says the same. Details are in [docs/agent-permissions.md](docs/agent-permissions.md#what-bounds-a-router-payment-on-top-of-that).
126
128
 
127
129
  ### Funding
128
130
 
@@ -157,7 +159,7 @@ Every paid lookup is recorded on your machine, with the files and full results i
157
159
  <details>
158
160
  <summary>Spending limits: the fine print</summary>
159
161
 
160
- Limits are set only where no setting exists yet, so an update never overwrites yours. The daily budget is a rolling 24-hour window. Setting either limit to `0` blocks automatic payments; `tenjin config set sessionBudget none` removes the daily ceiling only.
162
+ Limits are set only where no setting exists yet, so an update never overwrites yours. The daily budget is a rolling 24-hour window. Setting the daily limit to `0` blocks automatic payments; `tenjin config set sessionBudget none` removes the daily ceiling only.
161
163
 
162
164
  `tenjin pay <url>` pays any x402 endpoint you name. It ignores the automatic limits and always asks for your consent to the quoted price, interactively or with `--yes`. It is never used as a workaround when the router refuses. See the [safety model](./docs/safety-model.md).
163
165
 
@@ -1,43 +1,54 @@
1
1
  import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
+ import {
3
+ modeGatedPointer
4
+ } from "./chunk-A36LQPHV.js";
5
+ import {
6
+ AGENT_ID_RE
7
+ } from "./chunk-XKESD27X.js";
2
8
  import {
3
9
  HOOK_TOOL
4
10
  } from "./chunk-AKWGE6JQ.js";
5
11
  import {
6
- LEGACY_MCP_SERVER_NAME,
7
- ROUTER_DEFAULTS
8
- } from "./chunk-EWLU46J6.js";
9
- import {
10
- modeGatedPointer
11
- } from "./chunk-A36LQPHV.js";
12
+ LEGACY_MCP_SERVER_NAME
13
+ } from "./chunk-WVUSXNIE.js";
12
14
  import {
13
15
  confirmChoice
14
16
  } from "./chunk-P7LABKCW.js";
17
+ import {
18
+ CHANNEL_DEPOSIT_ATOMIC,
19
+ ROUTING_FEE_ATOMIC,
20
+ usd
21
+ } from "./chunk-PAYV4XUA.js";
15
22
  import {
16
23
  LockTimeoutError,
17
24
  withFileLock
18
25
  } from "./chunk-MEFB5KHA.js";
19
26
  import {
20
27
  style
21
- } from "./chunk-TROZ6HL4.js";
28
+ } from "./chunk-KYFZTGMC.js";
22
29
  import {
23
30
  projectRouterPath,
24
31
  readProjectRouterFile,
25
32
  routerSettings
26
- } from "./chunk-MG3G644T.js";
33
+ } from "./chunk-SPAVAYSW.js";
27
34
  import {
28
35
  hasCode
29
36
  } from "./chunk-2I4QTOLB.js";
30
37
  import {
31
38
  isTeamShelfOrigin,
32
39
  loadProjectConfig
33
- } from "./chunk-AMEUXNJT.js";
40
+ } from "./chunk-AWFUPKTM.js";
34
41
  import {
35
42
  CONFIG_KEYS,
36
43
  CliError,
44
+ DEFAULT_MAX_AUTO_SPEND,
45
+ DEFAULT_SESSION_BUDGET,
37
46
  EXPERIMENTAL_CONFIG_KEYS,
38
47
  HARNESSES,
39
48
  HOOKS_CONFIG_KEYS,
40
49
  LOOP_CONFIG_KEYS,
50
+ MAX_AUTO_SPEND_FLOOR_ATOMIC,
51
+ MAX_AUTO_SPEND_FLOOR_WHY,
41
52
  PRODUCTION_ORIGIN,
42
53
  PUBLISH_CONFIG_KEYS,
43
54
  PublishModeSchema,
@@ -57,9 +68,11 @@ import {
57
68
  parseUsdToAtomic,
58
69
  resolveSettings,
59
70
  retiredPaymentKeys,
60
- toMoney,
71
+ toMoney
72
+ } from "./chunk-WO5BJNIB.js";
73
+ import {
61
74
  writeFileAtomic
62
- } from "./chunk-VVAHFCX2.js";
75
+ } from "./chunk-O2FRQ2L2.js";
63
76
  import {
64
77
  configPath,
65
78
  hooksDir
@@ -82,10 +95,6 @@ import { join as join3 } from "node:path";
82
95
  // src/adapters/codex.ts
83
96
  import { join as join2 } from "node:path";
84
97
 
85
- // src/lib/grade.ts
86
- var ENDED_AFTER_MS = 30 * 6e4;
87
- var AGENT_ID_RE = /^[A-Za-z0-9_-]{1,128}$/;
88
-
89
98
  // src/hooks/constants.ts
90
99
  var HARNESS_MS = 5e3;
91
100
  var MAX_BODY_BYTES = 4 * 1024 * 1024;
@@ -1420,6 +1429,46 @@ async function installedHarnessInPlay(adapter, home, dataDir2, options = {}) {
1420
1429
  return (await registeredHooks(adapter, home, dataDir2, env)).entries > 0;
1421
1430
  }
1422
1431
 
1432
+ // src/router/spend-question.ts
1433
+ var ROUTER_DEFAULTS = {
1434
+ maxAutoSpend: DEFAULT_MAX_AUTO_SPEND,
1435
+ sessionBudget: DEFAULT_SESSION_BUDGET
1436
+ };
1437
+ function shownLimits(config) {
1438
+ return {
1439
+ maxAutoSpend: config.maxAutoSpend ?? ROUTER_DEFAULTS.maxAutoSpend,
1440
+ sessionBudget: config.sessionBudget ?? ROUTER_DEFAULTS.sessionBudget
1441
+ };
1442
+ }
1443
+ function limitsUsd(limits) {
1444
+ return {
1445
+ maxAutoSpend: toMoney(limits.maxAutoSpend).usd,
1446
+ sessionBudget: limits.sessionBudget === "none" ? "none" : toMoney(limits.sessionBudget).usd
1447
+ };
1448
+ }
1449
+ var ROUTING_FEE_TERMS = `Routing costs $${usd(ROUTING_FEE_ATOMIC)} a call, paid from channel deposits of up to $${usd(CHANNEL_DEPOSIT_ATOMIC)} that stay yours until spent; each deposit counts against these limits.`;
1450
+ var FEE_APPROVAL = "Either answer also approves the routing fee.";
1451
+ var DEFAULTS_USD = limitsUsd(ROUTER_DEFAULTS);
1452
+ var SPEND_QUESTION = `Use the defaults ($${DEFAULTS_USD.sessionBudget} a day, $${DEFAULTS_USD.maxAutoSpend} a call) or set your own limits.`;
1453
+ function spendChoiceQuestion() {
1454
+ return `${SPEND_QUESTION} ${ROUTING_FEE_TERMS} ${FEE_APPROVAL}`;
1455
+ }
1456
+ function spendOptions(install) {
1457
+ return [
1458
+ { id: "default", label: "Use the defaults", recommended: true, command: `${install} --yes` },
1459
+ {
1460
+ id: "custom",
1461
+ label: "Set my own limits",
1462
+ recommended: false,
1463
+ ask: [
1464
+ "The most Tenjin may pay in a day, in USD, or none for no daily limit",
1465
+ "The most it may pay for one call, in USD, at least 0.25"
1466
+ ],
1467
+ command: `${install} --max-auto-spend <usd> --session-budget <usd|none>`
1468
+ }
1469
+ ];
1470
+ }
1471
+
1423
1472
  // src/commands/config.ts
1424
1473
  var SHELF_KEYS = /* @__PURE__ */ new Set([
1425
1474
  "allowlistCreators",
@@ -1435,8 +1484,8 @@ var KEY_WIDTH = Math.max(
1435
1484
  ...[...CONFIG_KEYS, ...UPDATE_CONFIG_KEYS, ...ROUTER_CONFIG_KEYS, ...EXPERIMENTAL_CONFIG_KEYS].filter((key) => !SHELF_KEYS.has(key)).map((key) => key.length)
1436
1485
  );
1437
1486
  var KEY_DESCRIPTIONS = {
1438
- maxAutoSpend: "automatic router limit per call",
1439
- sessionBudget: "automatic router daily limit: 0 blocks automatic spend, none removes the ceiling",
1487
+ maxAutoSpend: "automatic router limit per call, the runaway guard: at least 0.25 (the default); router.enabled false turns the router off",
1488
+ sessionBudget: "automatic router daily limit, the main control (5 by default): 0 blocks automatic spend, none removes the ceiling",
1440
1489
  sendMaxAmount: "hard cap per tenjin wallet send; unset = send refuses until set, 0 disables send, none = uncapped; never bypassed by --yes",
1441
1490
  allowlistCreators: "only auto-pay these creators (empty = any)",
1442
1491
  baseUrl: "Tenjin API base URL the router asks",
@@ -1943,7 +1992,7 @@ async function persistRouterProject(dir, projectDir, present = true) {
1943
1992
  return { ...existing, install: { ...existing.install, routerProjects: [...known].sort() } };
1944
1993
  });
1945
1994
  }
1946
- async function persistRouterDefaults(dir, refresh = false, limits = ROUTER_DEFAULTS) {
1995
+ async function persistRouterDefaults(dir, refresh = false, limits = ROUTER_DEFAULTS, chosen = []) {
1947
1996
  const result = { set: [], kept: [], removed: [] };
1948
1997
  if (refresh && retiredPaymentKeys(await loadRawConfig(dir)).length === 0) return result;
1949
1998
  await persist(dir, (existing) => {
@@ -1953,7 +2002,7 @@ async function persistRouterDefaults(dir, refresh = false, limits = ROUTER_DEFAU
1953
2002
  if (refresh) return next;
1954
2003
  for (const key of Object.keys(ROUTER_DEFAULTS)) {
1955
2004
  const value = limits[key];
1956
- if (existing[key] !== void 0) result.kept.push(key);
2005
+ if (existing[key] !== void 0 && !chosen.includes(key)) result.kept.push(key);
1957
2006
  else if (value !== void 0) {
1958
2007
  next[key] = value;
1959
2008
  result.set.push(key);
@@ -2033,8 +2082,7 @@ function parseValue(key, value) {
2033
2082
  case "sessionBudget":
2034
2083
  return value === "none" ? "none" : parseUsdToAtomic(value);
2035
2084
  case "maxAutoSpend":
2036
- return parseUsdToAtomic(value);
2037
- // throws USAGE on a bad amount
2085
+ return parseAutoSpend(value);
2038
2086
  case "sendMaxAmount":
2039
2087
  return value === "none" ? "none" : parseUsdToAtomic(value);
2040
2088
  case "allowlistCreators":
@@ -2051,6 +2099,15 @@ function parseValue(key, value) {
2051
2099
  return parseRegistryList(value);
2052
2100
  }
2053
2101
  }
2102
+ function parseAutoSpend(value) {
2103
+ const atomic = parseUsdToAtomic(value);
2104
+ if (BigInt(atomic) < MAX_AUTO_SPEND_FLOOR_ATOMIC) {
2105
+ throw new CliError("USAGE", `maxAutoSpend ${value} is below the 0.25 USD minimum.`, {
2106
+ fix: MAX_AUTO_SPEND_FLOOR_WHY
2107
+ });
2108
+ }
2109
+ return atomic;
2110
+ }
2054
2111
  function parseRegistryList(value) {
2055
2112
  return value.split(",").map((entry) => entry.trim()).filter((entry) => entry.length > 0).map((entry) => parseHttpUrl(entry));
2056
2113
  }
@@ -2149,6 +2206,13 @@ export {
2149
2206
  readSkillFile,
2150
2207
  skillFrontmatterName,
2151
2208
  inspectHooksFile,
2209
+ ROUTER_DEFAULTS,
2210
+ shownLimits,
2211
+ ROUTING_FEE_TERMS,
2212
+ FEE_APPROVAL,
2213
+ SPEND_QUESTION,
2214
+ spendChoiceQuestion,
2215
+ spendOptions,
2152
2216
  EXPERIMENTAL_BAZAAR_WARNING,
2153
2217
  runConfigList,
2154
2218
  runConfigGet,
@@ -2160,4 +2224,4 @@ export {
2160
2224
  persistInstallHarness,
2161
2225
  persistGrantDeclined
2162
2226
  };
2163
- //# sourceMappingURL=chunk-25GGN553.js.map
2227
+ //# sourceMappingURL=chunk-3O2BQIF6.js.map