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.
- package/README.md +7 -5
- package/dist/{chunk-25GGN553.js → chunk-3O2BQIF6.js} +86 -22
- package/dist/chunk-3O2BQIF6.js.map +1 -0
- package/dist/{chunk-R4AO7GC2.js → chunk-5LJCEMFD.js} +14 -12
- package/dist/{chunk-R4AO7GC2.js.map → chunk-5LJCEMFD.js.map} +1 -1
- package/dist/{chunk-QTGUDCIR.js → chunk-AEG2PXBP.js} +3 -3
- package/dist/{chunk-AMEUXNJT.js → chunk-AWFUPKTM.js} +2 -2
- package/dist/{chunk-XJQ6CH7X.js → chunk-EBVIKMCH.js} +2 -2
- package/dist/{chunk-XDYKZRLN.js → chunk-HE2MS4QO.js} +6 -6
- package/dist/{chunk-RJEPZMYY.js → chunk-IOODYAXL.js} +3 -3
- package/dist/{chunk-SBL4THYT.js → chunk-JMM6YE7J.js} +190 -90
- package/dist/chunk-JMM6YE7J.js.map +1 -0
- package/dist/{chunk-VKQXVCZR.js → chunk-KHE6L6TD.js} +3 -3
- package/dist/chunk-KOGZDMHO.js +21 -0
- package/dist/chunk-KOGZDMHO.js.map +1 -0
- package/dist/{chunk-TROZ6HL4.js → chunk-KYFZTGMC.js} +2 -2
- package/dist/{chunk-LX5OT4TQ.js → chunk-NZIP4PA2.js} +2 -2
- package/dist/chunk-O2FRQ2L2.js +168 -0
- package/dist/chunk-O2FRQ2L2.js.map +1 -0
- package/dist/{chunk-3FY5HG7R.js → chunk-OK2TDZQU.js} +4 -4
- package/dist/{chunk-ZQNGTLOC.js → chunk-OSYTBCUC.js} +7 -5
- package/dist/{chunk-ZQNGTLOC.js.map → chunk-OSYTBCUC.js.map} +1 -1
- package/dist/{chunk-MRUPDSUM.js → chunk-PAYV4XUA.js} +3 -5
- package/dist/chunk-PAYV4XUA.js.map +1 -0
- package/dist/{chunk-USOLCBKC.js → chunk-QUVVWYJW.js} +7 -5
- package/dist/{chunk-USOLCBKC.js.map → chunk-QUVVWYJW.js.map} +1 -1
- package/dist/{chunk-MOG7PB3A.js → chunk-RAULEAZ6.js} +3 -3
- package/dist/{chunk-MG3G644T.js → chunk-SPAVAYSW.js} +3 -3
- package/dist/{chunk-4FYMDRD3.js → chunk-TTBKWWTV.js} +22 -20
- package/dist/chunk-TTBKWWTV.js.map +1 -0
- package/dist/{chunk-OOSRB3OF.js → chunk-U6YQ6FRI.js} +2 -2
- package/dist/{chunk-P4LVLFO4.js → chunk-VFMQTSXG.js} +2 -2
- package/dist/{chunk-LRCJ2IZ5.js → chunk-VUFAK2LW.js} +2 -2
- package/dist/{chunk-LRCJ2IZ5.js.map → chunk-VUFAK2LW.js.map} +1 -1
- package/dist/{chunk-WM7TJEBP.js → chunk-VZGAONSJ.js} +7 -5
- package/dist/{chunk-WM7TJEBP.js.map → chunk-VZGAONSJ.js.map} +1 -1
- package/dist/{chunk-VVAHFCX2.js → chunk-WO5BJNIB.js} +45 -194
- package/dist/chunk-WO5BJNIB.js.map +1 -0
- package/dist/chunk-WVUSXNIE.js +39 -0
- package/dist/chunk-WVUSXNIE.js.map +1 -0
- package/dist/chunk-XKESD27X.js +10 -0
- package/dist/chunk-XKESD27X.js.map +1 -0
- package/dist/{chunk-SFEQGENI.js → chunk-YFQOA5AU.js} +7 -2
- package/dist/{chunk-SFEQGENI.js.map → chunk-YFQOA5AU.js.map} +1 -1
- package/dist/{cli-JPTDHGRX.js → cli-O5SN7ZJ4.js} +38 -30
- package/dist/{cli-JPTDHGRX.js.map → cli-O5SN7ZJ4.js.map} +1 -1
- package/dist/{config-YYKDH2TH.js → config-OJQI27LT.js} +13 -12
- package/dist/{doctor-SSTXGCHX.js → doctor-IQQJHGGM.js} +36 -62
- package/dist/doctor-IQQJHGGM.js.map +1 -0
- package/dist/{fund-QWVWRVDK.js → fund-WEV6DMTD.js} +17 -12
- package/dist/{fund-QWVWRVDK.js.map → fund-WEV6DMTD.js.map} +1 -1
- package/dist/hook-command-D2P3ILRV.js +32 -0
- package/dist/hosts/claude/.claude-plugin/marketplace.json +2 -2
- package/dist/hosts/claude/tenjin/.claude-plugin/plugin.json +2 -2
- package/dist/index.js +4 -4
- package/dist/{install-2GXXD4DK.js → install-TUCRF32I.js} +23 -14
- package/dist/{install-identity-FK3YF227.js → install-identity-WHPNMNMQ.js} +7 -6
- package/dist/{install-wallet-TC22U52X.js → install-wallet-MA27FTQ5.js} +11 -10
- package/dist/{install-wallet-TC22U52X.js.map → install-wallet-MA27FTQ5.js.map} +1 -1
- package/dist/{mcp-42H2F4NY.js → mcp-QML7ZMPH.js} +33 -40
- package/dist/mcp-QML7ZMPH.js.map +1 -0
- package/dist/{package-6DJA3Y2O.js → package-LGKYOEPV.js} +2 -2
- package/dist/{pay-LSDJBIAZ.js → pay-2C2UBBXJ.js} +14 -13
- package/dist/{payments-SPECLBRQ.js → payments-C44QUFXU.js} +10 -9
- package/dist/{payments-SPECLBRQ.js.map → payments-C44QUFXU.js.map} +1 -1
- package/dist/{send-MHAOLPK3.js → send-KVJX4XIR.js} +9 -8
- package/dist/{send-MHAOLPK3.js.map → send-KVJX4XIR.js.map} +1 -1
- package/dist/{status-O2RWLPS5.js → status-S7C3WMSH.js} +10 -9
- package/dist/{status-O2RWLPS5.js.map → status-S7C3WMSH.js.map} +1 -1
- package/dist/{status-line-45TVCRM3.js → status-line-YR2T5HC4.js} +6 -5
- package/dist/{status-line-45TVCRM3.js.map → status-line-YR2T5HC4.js.map} +1 -1
- package/dist/{uninstall-VOK2Z5M4.js → uninstall-HY6LKIIT.js} +17 -14
- package/dist/{uninstall-VOK2Z5M4.js.map → uninstall-HY6LKIIT.js.map} +1 -1
- package/dist/{update-FGP3HNLD.js → update-OJV22LR3.js} +17 -14
- package/dist/usdc-JK4RRFFQ.js +39 -0
- package/dist/{wallet-DA7OFNEW.js → wallet-PD2IMZDU.js} +11 -10
- package/dist/wallet-PD2IMZDU.js.map +1 -0
- package/docs/agent-permissions.md +16 -4
- package/package.json +1 -1
- package/dist/chunk-25GGN553.js.map +0 -1
- package/dist/chunk-4FYMDRD3.js.map +0 -1
- package/dist/chunk-EWLU46J6.js +0 -100
- package/dist/chunk-EWLU46J6.js.map +0 -1
- package/dist/chunk-MRUPDSUM.js.map +0 -1
- package/dist/chunk-SBL4THYT.js.map +0 -1
- package/dist/chunk-VVAHFCX2.js.map +0 -1
- package/dist/doctor-SSTXGCHX.js.map +0 -1
- package/dist/hook-command-VWJXRT7H.js +0 -31
- package/dist/mcp-42H2F4NY.js.map +0 -1
- /package/dist/{chunk-QTGUDCIR.js.map → chunk-AEG2PXBP.js.map} +0 -0
- /package/dist/{chunk-AMEUXNJT.js.map → chunk-AWFUPKTM.js.map} +0 -0
- /package/dist/{chunk-XJQ6CH7X.js.map → chunk-EBVIKMCH.js.map} +0 -0
- /package/dist/{chunk-XDYKZRLN.js.map → chunk-HE2MS4QO.js.map} +0 -0
- /package/dist/{chunk-RJEPZMYY.js.map → chunk-IOODYAXL.js.map} +0 -0
- /package/dist/{chunk-VKQXVCZR.js.map → chunk-KHE6L6TD.js.map} +0 -0
- /package/dist/{chunk-TROZ6HL4.js.map → chunk-KYFZTGMC.js.map} +0 -0
- /package/dist/{chunk-LX5OT4TQ.js.map → chunk-NZIP4PA2.js.map} +0 -0
- /package/dist/{chunk-3FY5HG7R.js.map → chunk-OK2TDZQU.js.map} +0 -0
- /package/dist/{chunk-MOG7PB3A.js.map → chunk-RAULEAZ6.js.map} +0 -0
- /package/dist/{chunk-MG3G644T.js.map → chunk-SPAVAYSW.js.map} +0 -0
- /package/dist/{chunk-OOSRB3OF.js.map → chunk-U6YQ6FRI.js.map} +0 -0
- /package/dist/{chunk-P4LVLFO4.js.map → chunk-VFMQTSXG.js.map} +0 -0
- /package/dist/{config-YYKDH2TH.js.map → config-OJQI27LT.js.map} +0 -0
- /package/dist/{hook-command-VWJXRT7H.js.map → hook-command-D2P3ILRV.js.map} +0 -0
- /package/dist/{install-2GXXD4DK.js.map → install-TUCRF32I.js.map} +0 -0
- /package/dist/{install-identity-FK3YF227.js.map → install-identity-WHPNMNMQ.js.map} +0 -0
- /package/dist/{package-6DJA3Y2O.js.map → package-LGKYOEPV.js.map} +0 -0
- /package/dist/{pay-LSDJBIAZ.js.map → pay-2C2UBBXJ.js.map} +0 -0
- /package/dist/{update-FGP3HNLD.js.map → update-OJV22LR3.js.map} +0 -0
- /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
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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-
|
|
28
|
+
} from "./chunk-KYFZTGMC.js";
|
|
22
29
|
import {
|
|
23
30
|
projectRouterPath,
|
|
24
31
|
readProjectRouterFile,
|
|
25
32
|
routerSettings
|
|
26
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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
|
|
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-
|
|
2227
|
+
//# sourceMappingURL=chunk-3O2BQIF6.js.map
|