tenjin-cli 0.1.0-alpha.14 → 0.1.0-alpha.16
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/NOTICE.md +54 -7
- package/README.md +41 -295
- package/dist/{_esm-N4KAVXQR.js → _esm-CE7KNONL.js} +9 -10
- package/dist/{ccip-ZGGWQN4X.js → ccip-7RMRLAGV.js} +4 -4
- package/dist/{ccip-RPPPKTJR.js → ccip-NLCSCHKI.js} +5 -5
- package/dist/chunk-25TJPVBF.js +353 -0
- package/dist/chunk-25TJPVBF.js.map +1 -0
- package/dist/chunk-2BKS2FVE.js +93 -0
- package/dist/chunk-2BKS2FVE.js.map +1 -0
- package/dist/chunk-2QYORQBF.js +55 -0
- package/dist/chunk-2QYORQBF.js.map +1 -0
- package/dist/{chunk-ACBEHJAH.js → chunk-2U5ZVEV3.js} +14 -16
- package/dist/chunk-2U5ZVEV3.js.map +1 -0
- package/dist/{chunk-MJSXP4LW.js → chunk-3AJS6LLN.js} +11 -8
- package/dist/chunk-3AJS6LLN.js.map +1 -0
- package/dist/{chunk-OWVVI4VQ.js → chunk-3AUDA53C.js} +7650 -7361
- package/dist/chunk-3AUDA53C.js.map +1 -0
- package/dist/{chunk-MJZZTKCC.js → chunk-56MOAIP5.js} +5 -10
- package/dist/chunk-56MOAIP5.js.map +1 -0
- package/dist/{chunk-U5S527PP.js → chunk-5IEP5EGE.js} +3 -3
- package/dist/chunk-5X4SZ5BF.js +227 -0
- package/dist/chunk-5X4SZ5BF.js.map +1 -0
- package/dist/chunk-7WEQQJLG.js +68 -0
- package/dist/chunk-7WEQQJLG.js.map +1 -0
- package/dist/{chunk-7FK2UN2T.js → chunk-AWQPGIR6.js} +65 -67
- package/dist/{chunk-7FK2UN2T.js.map → chunk-AWQPGIR6.js.map} +1 -1
- package/dist/{chunk-PAOVPSP6.js → chunk-BBVUVBUO.js} +517 -138
- package/dist/chunk-BBVUVBUO.js.map +1 -0
- package/dist/{chunk-ETKZWJ4B.js → chunk-BFFM2WFK.js} +8 -8
- package/dist/chunk-BFFM2WFK.js.map +1 -0
- package/dist/{chunk-KYQVEKP5.js → chunk-BPMWXTFX.js} +8 -8
- package/dist/chunk-DMZZLPZN.js +205 -0
- package/dist/chunk-DMZZLPZN.js.map +1 -0
- package/dist/{chunk-47PP7TAG.js → chunk-EGELTSPU.js} +1356 -1356
- package/dist/chunk-EGELTSPU.js.map +1 -0
- package/dist/chunk-GULLJQXA.js +698 -0
- package/dist/chunk-GULLJQXA.js.map +1 -0
- package/dist/{chunk-S5RYMCV6.js → chunk-HPWO4O6S.js} +3 -3
- package/dist/chunk-HVRC33OL.js +174 -0
- package/dist/chunk-HVRC33OL.js.map +1 -0
- package/dist/{chunk-W6R3HAAG.js → chunk-JRGFKVAZ.js} +2 -2
- package/dist/{chunk-XJN5WUKL.js → chunk-KG3D7FIF.js} +2 -2
- package/dist/chunk-L3PVMIYQ.js +10328 -0
- package/dist/chunk-L3PVMIYQ.js.map +1 -0
- package/dist/{chunk-QW2Q2KAH.js → chunk-LHHMV4GU.js} +2 -2
- package/dist/{chunk-ZOBNS7CX.js → chunk-MEFB5KHA.js} +4 -18
- package/dist/chunk-MEFB5KHA.js.map +1 -0
- package/dist/{chunk-M2O56UK7.js → chunk-N35E6CM2.js} +293 -163
- package/dist/chunk-N35E6CM2.js.map +1 -0
- package/dist/chunk-OCBHUHWB.js +69 -0
- package/dist/chunk-OCBHUHWB.js.map +1 -0
- package/dist/chunk-OIM4HLN6.js +1405 -0
- package/dist/chunk-OIM4HLN6.js.map +1 -0
- package/dist/{chunk-PKW3H26Z.js → chunk-OJLYNM4Z.js} +56 -33
- package/dist/chunk-OJLYNM4Z.js.map +1 -0
- package/dist/{chunk-POJRB2AE.js → chunk-POUWHWID.js} +2 -2
- package/dist/chunk-PZEN5PHN.js +285 -0
- package/dist/chunk-PZEN5PHN.js.map +1 -0
- package/dist/chunk-SKAHDQH7.js +1785 -0
- package/dist/chunk-SKAHDQH7.js.map +1 -0
- package/dist/{chunk-KZAAWQNP.js → chunk-TTNESUPQ.js} +3 -3
- package/dist/{chunk-QWBUKIP2.js → chunk-U5DXNFJC.js} +23 -94
- package/dist/chunk-U5DXNFJC.js.map +1 -0
- package/dist/chunk-USS336NF.js +165 -0
- package/dist/chunk-USS336NF.js.map +1 -0
- package/dist/{chunk-UO22YNY4.js → chunk-WH7OWT6G.js} +49 -1
- package/dist/chunk-WH7OWT6G.js.map +1 -0
- package/dist/chunk-WXC57XGG.js +29 -0
- package/dist/chunk-WXC57XGG.js.map +1 -0
- package/dist/{chunk-YLYINX2H.js → chunk-XZKD7DIF.js} +3 -3
- package/dist/{chunk-7GJQ5RGA.js → chunk-YEETV6IW.js} +1077 -1039
- package/dist/chunk-YEETV6IW.js.map +1 -0
- package/dist/{chunk-B676GPS2.js → chunk-YJHHCWM3.js} +39 -16
- package/dist/chunk-YJHHCWM3.js.map +1 -0
- package/dist/{cli-U2BEUA55.js → cli-M3XCSOU6.js} +295 -349
- package/dist/cli-M3XCSOU6.js.map +1 -0
- package/dist/config-MXOX7XDR.js +41 -0
- package/dist/{dist-U4M6QCKE.js → dist-3LOO6M4U.js} +10 -10
- package/dist/doctor-LU4YIZWM.js +349 -0
- package/dist/doctor-LU4YIZWM.js.map +1 -0
- package/dist/{ethersCompat-Df4a6QIZ-WHYKB6HA.js → ethersCompat-Df4a6QIZ-THAVUGIJ.js} +5 -5
- package/dist/{chunk-3ZW7HPY5.js → fund-A54P2QFK.js} +81 -22
- package/dist/fund-A54P2QFK.js.map +1 -0
- package/dist/hook-command-U6KWPEDQ.js +377 -0
- package/dist/hook-command-U6KWPEDQ.js.map +1 -0
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/dist/install-XUM2XSHW.js +53 -0
- package/dist/install-wallet-QIOFORTX.js +105 -0
- package/dist/install-wallet-QIOFORTX.js.map +1 -0
- package/dist/{run-CJWPGMIQ.js → mcp-HJC2PLRV.js} +3725 -10661
- package/dist/mcp-HJC2PLRV.js.map +1 -0
- package/dist/paths-P2N4JTDZ.js +49 -0
- package/dist/pay-SBXZEPEP.js +37 -0
- package/dist/redact-46ZHF2NH.js +17 -0
- package/dist/{secp256k1-XRPVBC6V.js → secp256k1-ZZZT2CAX.js} +3 -3
- package/dist/{send-C5EOKXOU.js → send-ASD2ZXJD.js} +28 -30
- package/dist/send-ASD2ZXJD.js.map +1 -0
- package/dist/{chunk-NAAMHWSI.js → skill-placement-NFVHY6A3.js} +159 -12
- package/dist/skill-placement-NFVHY6A3.js.map +1 -0
- package/dist/status-T2SDB57A.js +63 -0
- package/dist/status-T2SDB57A.js.map +1 -0
- package/dist/status-line-CGPUSDMC.js +71 -0
- package/dist/status-line-CGPUSDMC.js.map +1 -0
- package/dist/status-line-wiring-BYPHTYZE.js +30 -0
- package/dist/tenjin-daemon.mjs +20060 -0
- package/dist/tenjin-shim.mjs +251 -0
- package/dist/tenjin-vitest-reporter.mjs +49 -0
- package/dist/uninstall-FKYZHAM3.js +144 -0
- package/dist/uninstall-FKYZHAM3.js.map +1 -0
- package/dist/{update-24Y2CQTT.js → update-ANJ2AOTN.js} +133 -17
- package/dist/update-ANJ2AOTN.js.map +1 -0
- package/dist/{viemAdapter-By13KInL-TUQJBMHM.js → viemAdapter-By13KInL-X2VY6CY3.js} +5 -5
- package/dist/wallet-PWAHVKWW.js +31 -0
- package/dist/wallet-kdf-worker.mjs +980 -0
- package/docs/agent-permissions.md +68 -342
- package/docs/safety-model.md +25 -6
- package/package.json +8 -7
- package/LICENSE +0 -21
- package/dist/buy-2JBYPHAI.js +0 -46
- package/dist/chunk-3P3ES4XU.js +0 -144
- package/dist/chunk-3P3ES4XU.js.map +0 -1
- package/dist/chunk-3ZW7HPY5.js.map +0 -1
- package/dist/chunk-47PP7TAG.js.map +0 -1
- package/dist/chunk-4UHNXY6B.js +0 -786
- package/dist/chunk-4UHNXY6B.js.map +0 -1
- package/dist/chunk-4Y53PDH6.js +0 -213
- package/dist/chunk-4Y53PDH6.js.map +0 -1
- package/dist/chunk-54AJIO3E.js +0 -198
- package/dist/chunk-54AJIO3E.js.map +0 -1
- package/dist/chunk-736DW4V3.js +0 -65
- package/dist/chunk-736DW4V3.js.map +0 -1
- package/dist/chunk-7GJQ5RGA.js.map +0 -1
- package/dist/chunk-7NADDA2V.js +0 -161
- package/dist/chunk-7NADDA2V.js.map +0 -1
- package/dist/chunk-ACBEHJAH.js.map +0 -1
- package/dist/chunk-B676GPS2.js.map +0 -1
- package/dist/chunk-DAZAXFSF.js +0 -1357
- package/dist/chunk-DAZAXFSF.js.map +0 -1
- package/dist/chunk-DTCXO7HS.js +0 -791
- package/dist/chunk-DTCXO7HS.js.map +0 -1
- package/dist/chunk-ETKZWJ4B.js.map +0 -1
- package/dist/chunk-FDUD3W5V.js +0 -317
- package/dist/chunk-FDUD3W5V.js.map +0 -1
- package/dist/chunk-GEHL43VE.js +0 -711
- package/dist/chunk-GEHL43VE.js.map +0 -1
- package/dist/chunk-IU2HVT3Y.js +0 -313
- package/dist/chunk-IU2HVT3Y.js.map +0 -1
- package/dist/chunk-IUQZ4Z7M.js +0 -162
- package/dist/chunk-IUQZ4Z7M.js.map +0 -1
- package/dist/chunk-IXZJ3JOO.js +0 -614
- package/dist/chunk-IXZJ3JOO.js.map +0 -1
- package/dist/chunk-J6FUAIRR.js +0 -205
- package/dist/chunk-J6FUAIRR.js.map +0 -1
- package/dist/chunk-L6G35FU5.js +0 -105
- package/dist/chunk-L6G35FU5.js.map +0 -1
- package/dist/chunk-LSWP7MU2.js +0 -290
- package/dist/chunk-LSWP7MU2.js.map +0 -1
- package/dist/chunk-M2O56UK7.js.map +0 -1
- package/dist/chunk-MJSXP4LW.js.map +0 -1
- package/dist/chunk-MJZZTKCC.js.map +0 -1
- package/dist/chunk-NAAMHWSI.js.map +0 -1
- package/dist/chunk-O75FOHXS.js +0 -372
- package/dist/chunk-O75FOHXS.js.map +0 -1
- package/dist/chunk-OWVVI4VQ.js.map +0 -1
- package/dist/chunk-PAOVPSP6.js.map +0 -1
- package/dist/chunk-PCX2JQ2J.js +0 -233
- package/dist/chunk-PCX2JQ2J.js.map +0 -1
- package/dist/chunk-PKW3H26Z.js.map +0 -1
- package/dist/chunk-PQZVDCCA.js +0 -125
- package/dist/chunk-PQZVDCCA.js.map +0 -1
- package/dist/chunk-QWBUKIP2.js.map +0 -1
- package/dist/chunk-SGK2B724.js +0 -67
- package/dist/chunk-SGK2B724.js.map +0 -1
- package/dist/chunk-UHTVXQ2O.js +0 -140
- package/dist/chunk-UHTVXQ2O.js.map +0 -1
- package/dist/chunk-UO22YNY4.js.map +0 -1
- package/dist/chunk-VEAERJVJ.js +0 -43
- package/dist/chunk-VEAERJVJ.js.map +0 -1
- package/dist/chunk-VRPLZERE.js +0 -1421
- package/dist/chunk-VRPLZERE.js.map +0 -1
- package/dist/chunk-W4VW5XYB.js +0 -149
- package/dist/chunk-W4VW5XYB.js.map +0 -1
- package/dist/chunk-WU5CZPLD.js +0 -145
- package/dist/chunk-WU5CZPLD.js.map +0 -1
- package/dist/chunk-WYLMJQVH.js +0 -240
- package/dist/chunk-WYLMJQVH.js.map +0 -1
- package/dist/chunk-XGZ5EVMB.js +0 -35
- package/dist/chunk-XGZ5EVMB.js.map +0 -1
- package/dist/chunk-XVPQGCH4.js +0 -176
- package/dist/chunk-XVPQGCH4.js.map +0 -1
- package/dist/chunk-ZOBNS7CX.js.map +0 -1
- package/dist/chunk-ZQIQ55KK.js +0 -51
- package/dist/chunk-ZQIQ55KK.js.map +0 -1
- package/dist/cli-U2BEUA55.js.map +0 -1
- package/dist/config-CNUIX23Q.js +0 -32
- package/dist/doctor-QJJXRWTO.js +0 -31
- package/dist/edit-HJ44P44P.js +0 -40
- package/dist/fund-Y5IAHZ5D.js +0 -40
- package/dist/inspect-NFQ6SQQQ.js +0 -37
- package/dist/install-DXX7PVUP.js +0 -854
- package/dist/install-DXX7PVUP.js.map +0 -1
- package/dist/outcome-ANV4QIED.js +0 -24
- package/dist/publish-PCBTCXCZ.js +0 -42
- package/dist/read-W7QVRBVD.js +0 -160
- package/dist/read-W7QVRBVD.js.map +0 -1
- package/dist/run-CJWPGMIQ.js.map +0 -1
- package/dist/search-JGAVKTYJ.js +0 -25
- package/dist/secp256k1-XRPVBC6V.js.map +0 -1
- package/dist/send-C5EOKXOU.js.map +0 -1
- package/dist/session-OBCUUIFX.js +0 -89
- package/dist/session-OBCUUIFX.js.map +0 -1
- package/dist/skill-heal-D6EPLPS6.js +0 -84
- package/dist/skill-heal-D6EPLPS6.js.map +0 -1
- package/dist/uninstall-OWJNJ5LI.js +0 -73
- package/dist/uninstall-OWJNJ5LI.js.map +0 -1
- package/dist/update-24Y2CQTT.js.map +0 -1
- package/dist/usdc-4VCDHFWX.js +0 -38
- package/dist/usdc-4VCDHFWX.js.map +0 -1
- package/dist/viemAdapter-By13KInL-TUQJBMHM.js.map +0 -1
- package/dist/wallet-OFXDIIGP.js +0 -33
- package/dist/wallet-OFXDIIGP.js.map +0 -1
- package/dist/wallet-SLRIYJ2U.js +0 -42
- package/dist/wallet-SLRIYJ2U.js.map +0 -1
- package/docs/command-reference.md +0 -261
- package/skills/tenjin/SKILL.md +0 -364
- package/skills/tenjin-publish/SKILL.md +0 -224
- package/skills/tenjin-publish/references/maintain.md +0 -39
- package/skills/tenjin-search/SKILL.md +0 -149
- package/skills/tenjin-search/references/permissions.md +0 -106
- /package/dist/{_esm-N4KAVXQR.js.map → _esm-CE7KNONL.js.map} +0 -0
- /package/dist/{buy-2JBYPHAI.js.map → ccip-7RMRLAGV.js.map} +0 -0
- /package/dist/{ccip-RPPPKTJR.js.map → ccip-NLCSCHKI.js.map} +0 -0
- /package/dist/{chunk-U5S527PP.js.map → chunk-5IEP5EGE.js.map} +0 -0
- /package/dist/{chunk-KYQVEKP5.js.map → chunk-BPMWXTFX.js.map} +0 -0
- /package/dist/{chunk-S5RYMCV6.js.map → chunk-HPWO4O6S.js.map} +0 -0
- /package/dist/{chunk-W6R3HAAG.js.map → chunk-JRGFKVAZ.js.map} +0 -0
- /package/dist/{chunk-XJN5WUKL.js.map → chunk-KG3D7FIF.js.map} +0 -0
- /package/dist/{chunk-QW2Q2KAH.js.map → chunk-LHHMV4GU.js.map} +0 -0
- /package/dist/{chunk-POJRB2AE.js.map → chunk-POUWHWID.js.map} +0 -0
- /package/dist/{chunk-KZAAWQNP.js.map → chunk-TTNESUPQ.js.map} +0 -0
- /package/dist/{chunk-YLYINX2H.js.map → chunk-XZKD7DIF.js.map} +0 -0
- /package/dist/{ccip-ZGGWQN4X.js.map → config-MXOX7XDR.js.map} +0 -0
- /package/dist/{dist-U4M6QCKE.js.map → dist-3LOO6M4U.js.map} +0 -0
- /package/dist/{config-CNUIX23Q.js.map → ethersCompat-Df4a6QIZ-THAVUGIJ.js.map} +0 -0
- /package/dist/{doctor-QJJXRWTO.js.map → install-XUM2XSHW.js.map} +0 -0
- /package/dist/{edit-HJ44P44P.js.map → paths-P2N4JTDZ.js.map} +0 -0
- /package/dist/{ethersCompat-Df4a6QIZ-WHYKB6HA.js.map → pay-SBXZEPEP.js.map} +0 -0
- /package/dist/{fund-Y5IAHZ5D.js.map → redact-46ZHF2NH.js.map} +0 -0
- /package/dist/{inspect-NFQ6SQQQ.js.map → secp256k1-ZZZT2CAX.js.map} +0 -0
- /package/dist/{outcome-ANV4QIED.js.map → status-line-wiring-BYPHTYZE.js.map} +0 -0
- /package/dist/{publish-PCBTCXCZ.js.map → viemAdapter-By13KInL-X2VY6CY3.js.map} +0 -0
- /package/dist/{search-JGAVKTYJ.js.map → wallet-PWAHVKWW.js.map} +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
ROUTER_DEFAULTS,
|
|
4
|
+
persistBazaarPay,
|
|
5
|
+
persistGrantDeclined,
|
|
6
|
+
persistHookArm,
|
|
7
|
+
persistInstallHarness,
|
|
8
|
+
persistPublishMode,
|
|
9
|
+
persistRouterDefaults,
|
|
10
|
+
persistRouterProject,
|
|
11
|
+
runConfigGet,
|
|
12
|
+
runConfigList,
|
|
13
|
+
runConfigSet
|
|
14
|
+
} from "./chunk-GULLJQXA.js";
|
|
15
|
+
import "./chunk-WXC57XGG.js";
|
|
16
|
+
import "./chunk-2QYORQBF.js";
|
|
17
|
+
import "./chunk-MEFB5KHA.js";
|
|
18
|
+
import "./chunk-U5DXNFJC.js";
|
|
19
|
+
import "./chunk-OJLYNM4Z.js";
|
|
20
|
+
import "./chunk-WH7OWT6G.js";
|
|
21
|
+
import "./chunk-BBVUVBUO.js";
|
|
22
|
+
import "./chunk-SKAHDQH7.js";
|
|
23
|
+
import "./chunk-BFFM2WFK.js";
|
|
24
|
+
import "./chunk-OCBHUHWB.js";
|
|
25
|
+
import "./chunk-2BKS2FVE.js";
|
|
26
|
+
import "./chunk-7WEQQJLG.js";
|
|
27
|
+
import "./chunk-ZXTAQYNA.js";
|
|
28
|
+
export {
|
|
29
|
+
ROUTER_DEFAULTS,
|
|
30
|
+
persistBazaarPay,
|
|
31
|
+
persistGrantDeclined,
|
|
32
|
+
persistHookArm,
|
|
33
|
+
persistInstallHarness,
|
|
34
|
+
persistPublishMode,
|
|
35
|
+
persistRouterDefaults,
|
|
36
|
+
persistRouterProject,
|
|
37
|
+
runConfigGet,
|
|
38
|
+
runConfigList,
|
|
39
|
+
runConfigSet
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=config-MXOX7XDR.js.map
|
|
@@ -61,10 +61,10 @@ var require_src = __commonJS({
|
|
|
61
61
|
});
|
|
62
62
|
|
|
63
63
|
// node_modules/.pnpm/@clack+core@1.4.3/node_modules/@clack/core/dist/index.mjs
|
|
64
|
-
import { styleText } from "util";
|
|
65
|
-
import { stdout, stdin } from "process";
|
|
66
|
-
import * as l from "readline";
|
|
67
|
-
import l__default from "readline";
|
|
64
|
+
import { styleText } from "node:util";
|
|
65
|
+
import { stdout, stdin } from "node:process";
|
|
66
|
+
import * as l from "node:readline";
|
|
67
|
+
import l__default from "node:readline";
|
|
68
68
|
|
|
69
69
|
// node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
|
|
70
70
|
var getCodePointsLength = /* @__PURE__ */ (() => {
|
|
@@ -404,7 +404,7 @@ function wrapAnsi(string, columns, options) {
|
|
|
404
404
|
|
|
405
405
|
// node_modules/.pnpm/@clack+core@1.4.3/node_modules/@clack/core/dist/index.mjs
|
|
406
406
|
var import_sisteransi = __toESM(require_src(), 1);
|
|
407
|
-
import { ReadStream } from "tty";
|
|
407
|
+
import { ReadStream } from "node:tty";
|
|
408
408
|
function findCursor(s, o2, l2) {
|
|
409
409
|
if (!l2.some((r2) => !r2.disabled))
|
|
410
410
|
return s;
|
|
@@ -1367,11 +1367,11 @@ var n2 = class extends V {
|
|
|
1367
1367
|
};
|
|
1368
1368
|
|
|
1369
1369
|
// node_modules/.pnpm/@clack+prompts@1.7.0/node_modules/@clack/prompts/dist/index.mjs
|
|
1370
|
-
import { styleText as styleText2, stripVTControlCharacters } from "util";
|
|
1371
|
-
import process$1 from "process";
|
|
1370
|
+
import { styleText as styleText2, stripVTControlCharacters } from "node:util";
|
|
1371
|
+
import process$1 from "node:process";
|
|
1372
1372
|
var import_sisteransi2 = __toESM(require_src(), 1);
|
|
1373
|
-
import { existsSync, lstatSync, readdirSync } from "fs";
|
|
1374
|
-
import { dirname, join } from "path";
|
|
1373
|
+
import { existsSync, lstatSync, readdirSync } from "node:fs";
|
|
1374
|
+
import { dirname, join } from "node:path";
|
|
1375
1375
|
function isUnicodeSupported() {
|
|
1376
1376
|
if (process$1.platform !== "win32") {
|
|
1377
1377
|
return process$1.env.TERM !== "linux";
|
|
@@ -2839,4 +2839,4 @@ export {
|
|
|
2839
2839
|
unicodeOr,
|
|
2840
2840
|
updateSettings
|
|
2841
2841
|
};
|
|
2842
|
-
//# sourceMappingURL=dist-
|
|
2842
|
+
//# sourceMappingURL=dist-3LOO6M4U.js.map
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
ROUTER_PATH
|
|
4
|
+
} from "./chunk-USS336NF.js";
|
|
5
|
+
import {
|
|
6
|
+
httpRequest
|
|
7
|
+
} from "./chunk-5X4SZ5BF.js";
|
|
8
|
+
import {
|
|
9
|
+
describeWallet,
|
|
10
|
+
resolveWalletProvider,
|
|
11
|
+
walletFileExists
|
|
12
|
+
} from "./chunk-YEETV6IW.js";
|
|
13
|
+
import "./chunk-DMZZLPZN.js";
|
|
14
|
+
import "./chunk-N35E6CM2.js";
|
|
15
|
+
import "./chunk-JRGFKVAZ.js";
|
|
16
|
+
import "./chunk-EGELTSPU.js";
|
|
17
|
+
import "./chunk-KG3D7FIF.js";
|
|
18
|
+
import "./chunk-RBJPAZFI.js";
|
|
19
|
+
import "./chunk-BPMWXTFX.js";
|
|
20
|
+
import {
|
|
21
|
+
ALLOW_RULE,
|
|
22
|
+
MCP_SERVER_NAME,
|
|
23
|
+
mcpAddCommand,
|
|
24
|
+
mcpScope,
|
|
25
|
+
readMcpEntry,
|
|
26
|
+
routerSettingsPath
|
|
27
|
+
} from "./chunk-25TJPVBF.js";
|
|
28
|
+
import "./chunk-YJHHCWM3.js";
|
|
29
|
+
import "./chunk-GULLJQXA.js";
|
|
30
|
+
import "./chunk-WXC57XGG.js";
|
|
31
|
+
import "./chunk-2QYORQBF.js";
|
|
32
|
+
import "./chunk-MEFB5KHA.js";
|
|
33
|
+
import {
|
|
34
|
+
onPath
|
|
35
|
+
} from "./chunk-U5DXNFJC.js";
|
|
36
|
+
import {
|
|
37
|
+
resolveContextSettings
|
|
38
|
+
} from "./chunk-OJLYNM4Z.js";
|
|
39
|
+
import {
|
|
40
|
+
toMoney
|
|
41
|
+
} from "./chunk-WH7OWT6G.js";
|
|
42
|
+
import {
|
|
43
|
+
PRODUCTION_ORIGIN
|
|
44
|
+
} from "./chunk-BBVUVBUO.js";
|
|
45
|
+
import {
|
|
46
|
+
STATUS_LINE_COMMAND,
|
|
47
|
+
inspectStatusLine
|
|
48
|
+
} from "./chunk-HVRC33OL.js";
|
|
49
|
+
import {
|
|
50
|
+
inspectHooksFile,
|
|
51
|
+
ownsHookEntry
|
|
52
|
+
} from "./chunk-SKAHDQH7.js";
|
|
53
|
+
import "./chunk-BFFM2WFK.js";
|
|
54
|
+
import {
|
|
55
|
+
CliError
|
|
56
|
+
} from "./chunk-OCBHUHWB.js";
|
|
57
|
+
import "./chunk-2BKS2FVE.js";
|
|
58
|
+
import "./chunk-7WEQQJLG.js";
|
|
59
|
+
import "./chunk-ZXTAQYNA.js";
|
|
60
|
+
|
|
61
|
+
// src/router/doctor.ts
|
|
62
|
+
import { execFile } from "node:child_process";
|
|
63
|
+
import { homedir } from "node:os";
|
|
64
|
+
import { promisify } from "node:util";
|
|
65
|
+
var exec = promisify(execFile);
|
|
66
|
+
var NODE_FLOOR = 24;
|
|
67
|
+
async function runRouterDoctor(ctx, deps = {}) {
|
|
68
|
+
const env = deps.env ?? process.env;
|
|
69
|
+
const settings = await resolveContextSettings(ctx);
|
|
70
|
+
const settingsPath = routerSettingsPath({
|
|
71
|
+
...deps.project === true ? { project: true } : {},
|
|
72
|
+
...deps.homeDir !== void 0 ? { homeDir: deps.homeDir } : {},
|
|
73
|
+
...deps.cwd !== void 0 ? { cwd: deps.cwd } : {}
|
|
74
|
+
});
|
|
75
|
+
const checks = [nodeCheck(deps.nodeVersion ?? process.version)];
|
|
76
|
+
checks.push(await hooksCheck(settingsPath, ctx.dataDir));
|
|
77
|
+
checks.push(await statusLineCheck(settingsPath));
|
|
78
|
+
checks.push(
|
|
79
|
+
await mcpCheck(
|
|
80
|
+
deps,
|
|
81
|
+
env,
|
|
82
|
+
deps.project === true,
|
|
83
|
+
deps.cwd ?? process.cwd(),
|
|
84
|
+
deps.homeDir ?? homedir()
|
|
85
|
+
)
|
|
86
|
+
);
|
|
87
|
+
checks.push(spendCheck(settings.policy.maxAutoSpendAtomic, settings.policy.sessionBudgetAtomic));
|
|
88
|
+
checks.push(...await walletCheck(ctx));
|
|
89
|
+
checks.push(await routerCheck(settings.baseUrl, ctx.flags.timeout, deps.fetchImpl));
|
|
90
|
+
const failure = checks.find((c) => c.status === "fail" && c.required);
|
|
91
|
+
const data = { checks, dataDir: ctx.dataDir, baseUrl: settings.baseUrl, settingsPath };
|
|
92
|
+
if (failure !== void 0) {
|
|
93
|
+
throw new CliError("REFUSED", failure.detail, {
|
|
94
|
+
...failure.fix !== void 0 ? { fix: failure.fix } : {},
|
|
95
|
+
details: data
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
const bad = checks.filter((c) => c.status !== "ok").length;
|
|
99
|
+
return {
|
|
100
|
+
data,
|
|
101
|
+
humanLines: [
|
|
102
|
+
...checks.map(
|
|
103
|
+
(c) => `${c.status === "ok" ? "ok " : c.status === "warn" ? "warn" : "fail"} ${c.name}: ${c.detail}`
|
|
104
|
+
),
|
|
105
|
+
bad === 0 ? `${checks.length} checks, all pass.` : `${checks.length} checks, ${bad} to look at.`
|
|
106
|
+
]
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function nodeCheck(version) {
|
|
110
|
+
const major = Number(/^v(\d+)/.exec(version)?.[1] ?? "0");
|
|
111
|
+
return major >= NODE_FLOOR ? { name: "node", status: "ok", required: true, detail: version } : {
|
|
112
|
+
name: "node",
|
|
113
|
+
status: "fail",
|
|
114
|
+
required: true,
|
|
115
|
+
detail: `${version} is below the Node ${NODE_FLOOR} floor.`,
|
|
116
|
+
fix: `Install Node ${NODE_FLOOR} or newer, then re-run \`tenjin doctor\`.`
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
async function statusLineCheck(path) {
|
|
120
|
+
const found = await inspectStatusLine(path);
|
|
121
|
+
const name = "status line";
|
|
122
|
+
if (found.warning !== void 0) {
|
|
123
|
+
return { name, status: "warn", required: false, detail: found.warning };
|
|
124
|
+
}
|
|
125
|
+
switch (found.state) {
|
|
126
|
+
case "ours":
|
|
127
|
+
return { name, status: "ok", required: false, detail: `\`${STATUS_LINE_COMMAND}\`` };
|
|
128
|
+
case "composed":
|
|
129
|
+
return {
|
|
130
|
+
name,
|
|
131
|
+
status: "ok",
|
|
132
|
+
required: false,
|
|
133
|
+
detail: "yours, with the x402 footer appended"
|
|
134
|
+
};
|
|
135
|
+
case "foreign":
|
|
136
|
+
return {
|
|
137
|
+
name,
|
|
138
|
+
status: "warn",
|
|
139
|
+
required: false,
|
|
140
|
+
detail: "yours is registered and was left alone, so there is no live x402 footer",
|
|
141
|
+
fix: "Run `tenjin install --status-line compose` to show both."
|
|
142
|
+
};
|
|
143
|
+
default:
|
|
144
|
+
return {
|
|
145
|
+
name,
|
|
146
|
+
status: "warn",
|
|
147
|
+
required: false,
|
|
148
|
+
detail: "not registered, so lookups run without the live footer",
|
|
149
|
+
fix: "Run `tenjin install` to register it."
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
async function hooksCheck(path, dataDir) {
|
|
154
|
+
const found = await inspectHooksFile(path);
|
|
155
|
+
if ("refusal" in found) {
|
|
156
|
+
return {
|
|
157
|
+
name: "hooks",
|
|
158
|
+
status: "fail",
|
|
159
|
+
required: true,
|
|
160
|
+
detail: found.refusal.message,
|
|
161
|
+
fix: "Fix the reported file, then run `tenjin install`."
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
const events = Object.entries(found.hooks).filter(([, list]) => list.some((entry) => ownsHookEntry(entry, dataDir))).map(([event]) => event);
|
|
165
|
+
const allow = allowRules(found.settings);
|
|
166
|
+
if (events.length === 0) {
|
|
167
|
+
return {
|
|
168
|
+
name: "hooks",
|
|
169
|
+
status: "fail",
|
|
170
|
+
required: true,
|
|
171
|
+
detail: `no Tenjin hook entries in ${path}`,
|
|
172
|
+
fix: "Run `tenjin install`, then restart Claude Code."
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
if (!allow.includes(ALLOW_RULE)) {
|
|
176
|
+
return {
|
|
177
|
+
name: "hooks",
|
|
178
|
+
status: "warn",
|
|
179
|
+
required: false,
|
|
180
|
+
detail: `${events.join(" and ")} registered, but ${ALLOW_RULE} is not allowed, so every lookup asks`,
|
|
181
|
+
fix: "Run `tenjin install` to write the permission rule."
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
return {
|
|
185
|
+
name: "hooks",
|
|
186
|
+
status: "ok",
|
|
187
|
+
required: true,
|
|
188
|
+
detail: `${events.join(" and ")} registered, ${ALLOW_RULE} allowed`
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
function allowRules(settings) {
|
|
192
|
+
const permissions = settings.permissions;
|
|
193
|
+
if (permissions === null || typeof permissions !== "object" || Array.isArray(permissions)) {
|
|
194
|
+
return [];
|
|
195
|
+
}
|
|
196
|
+
const allow = permissions.allow;
|
|
197
|
+
return Array.isArray(allow) ? allow.filter((r) => typeof r === "string") : [];
|
|
198
|
+
}
|
|
199
|
+
async function mcpCheck(deps, env, project, cwd, home) {
|
|
200
|
+
const scope = mcpScope(project);
|
|
201
|
+
const add = mcpAddCommand(project);
|
|
202
|
+
const where = scope === "project" ? "this project's .mcp.json" : "~/.claude.json";
|
|
203
|
+
const { found, state } = await (deps.readMcpEntry ?? readMcpEntry)(scope, cwd, home);
|
|
204
|
+
if (state === "ok") {
|
|
205
|
+
return {
|
|
206
|
+
name: "mcp",
|
|
207
|
+
status: "ok",
|
|
208
|
+
required: true,
|
|
209
|
+
detail: `${MCP_SERVER_NAME} registered (${scope} scope), running \`tenjin mcp\``
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
if (state === "wrong-command") {
|
|
213
|
+
return {
|
|
214
|
+
name: "mcp",
|
|
215
|
+
status: "fail",
|
|
216
|
+
required: true,
|
|
217
|
+
detail: `${MCP_SERVER_NAME} registered but not \`tenjin mcp\`: the entry in ${where} launches something else, so the request tool is not there`,
|
|
218
|
+
fix: `Remove it and re-run \`tenjin install\`${project ? " --project" : ""}, or: ${add}`
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
if (state === "unreadable") {
|
|
222
|
+
return {
|
|
223
|
+
name: "mcp",
|
|
224
|
+
status: "fail",
|
|
225
|
+
required: true,
|
|
226
|
+
detail: `${where} could not be read, so whether ${MCP_SERVER_NAME} is registered is unknown`,
|
|
227
|
+
fix: `Fix the JSON in ${where}, then re-run \`tenjin install\`${project ? " --project" : ""}.`
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
if (scope === "user") {
|
|
231
|
+
const which = deps.which ?? ((bin) => onPath(bin, env));
|
|
232
|
+
if (which("claude")) {
|
|
233
|
+
const seen = await (deps.readMcp ?? claudeHasServer)({ scope, cwd }).catch(() => false);
|
|
234
|
+
if (seen) {
|
|
235
|
+
return {
|
|
236
|
+
name: "mcp",
|
|
237
|
+
status: "warn",
|
|
238
|
+
required: false,
|
|
239
|
+
detail: `${MCP_SERVER_NAME} is registered somewhere this check cannot read, so what it launches was not verified`,
|
|
240
|
+
fix: `Re-run \`tenjin install\` to write a registration this build can check, or: ${add}`
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return {
|
|
246
|
+
name: "mcp",
|
|
247
|
+
status: "fail",
|
|
248
|
+
required: true,
|
|
249
|
+
detail: found ? `${MCP_SERVER_NAME} is not in ${where}, so there is no request tool` : `${where} does not exist, so ${MCP_SERVER_NAME} is not registered`,
|
|
250
|
+
fix: `Run \`tenjin install\`${project ? " --project" : ""}, or: ${add}`
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
async function claudeHasServer(opts) {
|
|
254
|
+
const { stdout } = await exec("claude", ["mcp", "get", MCP_SERVER_NAME], {
|
|
255
|
+
timeout: 15e3,
|
|
256
|
+
cwd: opts.cwd
|
|
257
|
+
});
|
|
258
|
+
return stdout.includes(MCP_SERVER_NAME) && !/no mcp server/i.test(stdout);
|
|
259
|
+
}
|
|
260
|
+
function spendCheck(maxAutoSpendAtomic, sessionBudgetAtomic) {
|
|
261
|
+
if (maxAutoSpendAtomic === 0n) {
|
|
262
|
+
return {
|
|
263
|
+
name: "spend",
|
|
264
|
+
status: "fail",
|
|
265
|
+
required: true,
|
|
266
|
+
detail: "maxAutoSpend is 0, so every lookup needs approval and none can pay",
|
|
267
|
+
fix: "Run `tenjin install`, or `tenjin config set maxAutoSpend 0.10`."
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
const budget = sessionBudgetAtomic === 0n ? "no daily ceiling" : `${toMoney(sessionBudgetAtomic.toString()).usd} USD a day`;
|
|
271
|
+
return {
|
|
272
|
+
name: "spend",
|
|
273
|
+
status: sessionBudgetAtomic === 0n ? "warn" : "ok",
|
|
274
|
+
required: false,
|
|
275
|
+
detail: `at most ${toMoney(maxAutoSpendAtomic.toString()).usd} USD a call, ${budget}`,
|
|
276
|
+
...sessionBudgetAtomic === 0n ? { fix: "Set one with `tenjin config set sessionBudget 1.00`." } : {}
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
async function walletCheck(ctx) {
|
|
280
|
+
if (!await walletFileExists(ctx.dataDir)) {
|
|
281
|
+
return [
|
|
282
|
+
{
|
|
283
|
+
name: "wallet",
|
|
284
|
+
status: "fail",
|
|
285
|
+
required: true,
|
|
286
|
+
detail: "no wallet on this machine, so nothing can pay",
|
|
287
|
+
fix: "Run `tenjin wallet create`, then `tenjin wallet fund`."
|
|
288
|
+
}
|
|
289
|
+
];
|
|
290
|
+
}
|
|
291
|
+
try {
|
|
292
|
+
const described = await describeWallet(resolveWalletProvider(ctx));
|
|
293
|
+
return [{ name: "wallet", status: "ok", required: true, detail: described.address }];
|
|
294
|
+
} catch (err) {
|
|
295
|
+
return [
|
|
296
|
+
{
|
|
297
|
+
name: "wallet",
|
|
298
|
+
status: "fail",
|
|
299
|
+
required: true,
|
|
300
|
+
detail: err instanceof CliError ? err.message : String(err),
|
|
301
|
+
...err instanceof CliError && err.fix !== void 0 ? { fix: err.fix } : {}
|
|
302
|
+
}
|
|
303
|
+
];
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
async function routerCheck(baseUrl, timeoutMs, fetchImpl) {
|
|
307
|
+
const url = new URL(ROUTER_PATH, baseUrl).toString();
|
|
308
|
+
const probe = await httpRequest(url, {
|
|
309
|
+
method: "POST",
|
|
310
|
+
timeoutMs,
|
|
311
|
+
blockRedirects: true,
|
|
312
|
+
jsonBody: {},
|
|
313
|
+
...fetchImpl !== void 0 ? { fetchImpl } : {}
|
|
314
|
+
});
|
|
315
|
+
const fail = (detail, fix) => ({
|
|
316
|
+
name: "router",
|
|
317
|
+
status: "fail",
|
|
318
|
+
required: true,
|
|
319
|
+
detail,
|
|
320
|
+
fix
|
|
321
|
+
});
|
|
322
|
+
const checkBase = "Check that the configured base URL names the Tenjin router (`tenjin config get baseUrl`), then try again later.";
|
|
323
|
+
if (!probe.ok) {
|
|
324
|
+
return fail(`the router at ${url} is unreachable or erroring (${probe.message})`, checkBase);
|
|
325
|
+
}
|
|
326
|
+
if (probe.status === 200 || probe.status === 400 || probe.status === 429) {
|
|
327
|
+
return { name: "router", status: "ok", required: true, detail: `${url} is live` };
|
|
328
|
+
}
|
|
329
|
+
if (probe.status === 404) {
|
|
330
|
+
return fail(`the router is not enabled at ${url}`, checkBase);
|
|
331
|
+
}
|
|
332
|
+
if (probe.status === 401 || probe.status === 403) {
|
|
333
|
+
return fail(
|
|
334
|
+
`${url} is not a Tenjin router (it asked for credentials)`,
|
|
335
|
+
`Set the router URL with \`tenjin config set baseUrl ${PRODUCTION_ORIGIN}\`.`
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
if (probe.status >= 500) {
|
|
339
|
+
return fail(`the router at ${url} is unreachable or erroring (${probe.status})`, checkBase);
|
|
340
|
+
}
|
|
341
|
+
return fail(
|
|
342
|
+
`${url} answered ${probe.status}, which a Tenjin router does not`,
|
|
343
|
+
"Check that the configured base URL names a Tenjin deployment (`tenjin config get baseUrl`)."
|
|
344
|
+
);
|
|
345
|
+
}
|
|
346
|
+
export {
|
|
347
|
+
runRouterDoctor
|
|
348
|
+
};
|
|
349
|
+
//# sourceMappingURL=doctor-LU4YIZWM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/router/doctor.ts"],"sourcesContent":["import { execFile } from 'node:child_process';\nimport { homedir } from 'node:os';\nimport { promisify } from 'node:util';\nimport { CliError } from '../lib/errors';\nimport { inspectHooksFile, ownsHookEntry } from '../lib/harness-hooks';\nimport { httpRequest } from '../lib/http';\nimport { toMoney } from '../lib/money';\nimport { PRODUCTION_ORIGIN } from '../lib/production-origin';\nimport { resolveContextSettings } from '../lib/settings';\nimport { onPath } from '../lib/skill-wiring';\nimport { describeWallet, resolveWalletProvider } from '../lib/wallet';\nimport { walletFileExists } from '../lib/wallet/store';\nimport type { CommandContext, CommandResult } from '../context';\nimport { ROUTER_PATH } from './decision';\nimport {\n ALLOW_RULE,\n MCP_SERVER_NAME,\n mcpAddCommand,\n mcpScope,\n readMcpEntry,\n routerSettingsPath,\n type McpEntryState,\n} from './install';\nimport { inspectStatusLine, STATUS_LINE_COMMAND } from './status-line-wiring';\n\n/**\n * `tenjin doctor` for the router product: the six things that decide whether a\n * lookup can happen at all.\n *\n * THE SHELF'S DOCTOR IS NOT THIS ONE. It checks a loop daemon, a skills tree\n * and a marketplace contract, and prescribes `tenjin daemon start`, a command\n * this release does not register: on a router install every one of those lines\n * was a failure about a product that is not installed. That doctor stays with\n * the product it belongs to (`src/commands/doctor.ts`, unregistered), and this\n * one reports the router's own wiring.\n */\n\nconst exec = promisify(execFile);\n\nexport interface RouterCheck {\n name: string;\n status: 'ok' | 'warn' | 'fail';\n required: boolean;\n detail: string;\n fix?: string;\n}\n\nexport interface RouterDoctorDeps {\n homeDir?: string;\n cwd?: string;\n /** Look at this project's `.claude/settings.json`, as `--project` installed it. */\n project?: boolean;\n env?: NodeJS.ProcessEnv;\n which?: (bin: string) => boolean;\n fetchImpl?: typeof fetch;\n /** The harness's own read-back, for a user-scope registration this build\n * cannot find on disk; tests inject it so nothing is spawned. */\n readMcp?: (opts: { scope: 'user' | 'project'; cwd: string }) => Promise<boolean>;\n /** Reads the registration entry from the file the scope writes. */\n readMcpEntry?: (\n scope: 'user' | 'project',\n cwd: string,\n home: string,\n ) => Promise<{ found: boolean; state: McpEntryState }>;\n /** Node's own version, for the floor check. */\n nodeVersion?: string;\n}\n\nconst NODE_FLOOR = 24;\n\nexport async function runRouterDoctor(\n ctx: CommandContext,\n deps: RouterDoctorDeps = {},\n): Promise<CommandResult> {\n const env = deps.env ?? process.env;\n const settings = await resolveContextSettings(ctx);\n // The SAME resolution `install` and `uninstall` use. Reading the home file\n // only made a correctly wired `--project` install, which the README tells\n // people to do, fail a required check and exit 3.\n const settingsPath = routerSettingsPath({\n ...(deps.project === true ? { project: true } : {}),\n ...(deps.homeDir !== undefined ? { homeDir: deps.homeDir } : {}),\n ...(deps.cwd !== undefined ? { cwd: deps.cwd } : {}),\n });\n const checks: RouterCheck[] = [nodeCheck(deps.nodeVersion ?? process.version)];\n checks.push(await hooksCheck(settingsPath, ctx.dataDir));\n checks.push(await statusLineCheck(settingsPath));\n checks.push(\n await mcpCheck(\n deps,\n env,\n deps.project === true,\n deps.cwd ?? process.cwd(),\n deps.homeDir ?? homedir(),\n ),\n );\n checks.push(spendCheck(settings.policy.maxAutoSpendAtomic, settings.policy.sessionBudgetAtomic));\n checks.push(...(await walletCheck(ctx)));\n checks.push(await routerCheck(settings.baseUrl, ctx.flags.timeout, deps.fetchImpl));\n\n const failure = checks.find((c) => c.status === 'fail' && c.required);\n const data = { checks, dataDir: ctx.dataDir, baseUrl: settings.baseUrl, settingsPath };\n if (failure !== undefined) {\n // REFUSED, the exit-3 class: a machine this command found unready is\n // understood and refused, not a runtime failure of the command itself.\n throw new CliError('REFUSED', failure.detail, {\n ...(failure.fix !== undefined ? { fix: failure.fix } : {}),\n details: data,\n });\n }\n const bad = checks.filter((c) => c.status !== 'ok').length;\n return {\n data,\n humanLines: [\n ...checks.map(\n (c) =>\n `${c.status === 'ok' ? 'ok ' : c.status === 'warn' ? 'warn' : 'fail'} ${c.name}: ${c.detail}`,\n ),\n bad === 0\n ? `${checks.length} checks, all pass.`\n : `${checks.length} checks, ${bad} to look at.`,\n ],\n };\n}\n\nfunction nodeCheck(version: string): RouterCheck {\n const major = Number(/^v(\\d+)/.exec(version)?.[1] ?? '0');\n return major >= NODE_FLOOR\n ? { name: 'node', status: 'ok', required: true, detail: version }\n : {\n name: 'node',\n status: 'fail',\n required: true,\n detail: `${version} is below the Node ${NODE_FLOOR} floor.`,\n fix: `Install Node ${NODE_FLOOR} or newer, then re-run \\`tenjin doctor\\`.`,\n };\n}\n\n/**\n * The live footer, which is the one check here that is never required: a lookup\n * runs exactly the same without it. It reports what is in the file, including a\n * status line of the user's that this CLI deliberately did not touch.\n */\nasync function statusLineCheck(path: string): Promise<RouterCheck> {\n const found = await inspectStatusLine(path);\n const name = 'status line';\n if (found.warning !== undefined) {\n return { name, status: 'warn', required: false, detail: found.warning };\n }\n switch (found.state) {\n case 'ours':\n return { name, status: 'ok', required: false, detail: `\\`${STATUS_LINE_COMMAND}\\`` };\n case 'composed':\n return {\n name,\n status: 'ok',\n required: false,\n detail: 'yours, with the x402 footer appended',\n };\n case 'foreign':\n return {\n name,\n status: 'warn',\n required: false,\n detail: 'yours is registered and was left alone, so there is no live x402 footer',\n fix: 'Run `tenjin install --status-line compose` to show both.',\n };\n default:\n return {\n name,\n status: 'warn',\n required: false,\n detail: 'not registered, so lookups run without the live footer',\n fix: 'Run `tenjin install` to register it.',\n };\n }\n}\n\nasync function hooksCheck(path: string, dataDir: string): Promise<RouterCheck> {\n const found = await inspectHooksFile(path);\n if ('refusal' in found) {\n return {\n name: 'hooks',\n status: 'fail',\n required: true,\n detail: found.refusal.message,\n fix: 'Fix the reported file, then run `tenjin install`.',\n };\n }\n const events = Object.entries(found.hooks)\n .filter(([, list]) => list.some((entry) => ownsHookEntry(entry, dataDir)))\n .map(([event]) => event);\n const allow = allowRules(found.settings);\n if (events.length === 0) {\n return {\n name: 'hooks',\n status: 'fail',\n required: true,\n detail: `no Tenjin hook entries in ${path}`,\n fix: 'Run `tenjin install`, then restart Claude Code.',\n };\n }\n if (!allow.includes(ALLOW_RULE)) {\n return {\n name: 'hooks',\n status: 'warn',\n required: false,\n detail: `${events.join(' and ')} registered, but ${ALLOW_RULE} is not allowed, so every lookup asks`,\n fix: 'Run `tenjin install` to write the permission rule.',\n };\n }\n return {\n name: 'hooks',\n status: 'ok',\n required: true,\n detail: `${events.join(' and ')} registered, ${ALLOW_RULE} allowed`,\n };\n}\n\nfunction allowRules(settings: Record<string, unknown>): string[] {\n const permissions = settings.permissions;\n if (permissions === null || typeof permissions !== 'object' || Array.isArray(permissions)) {\n return [];\n }\n const allow = (permissions as { allow?: unknown }).allow;\n return Array.isArray(allow) ? allow.filter((r): r is string => typeof r === 'string') : [];\n}\n\nasync function mcpCheck(\n deps: RouterDoctorDeps,\n env: NodeJS.ProcessEnv,\n project: boolean,\n cwd: string,\n home: string,\n): Promise<RouterCheck> {\n const scope = mcpScope(project);\n const add = mcpAddCommand(project);\n const where = scope === 'project' ? \"this project's .mcp.json\" : '~/.claude.json';\n const { found, state } = await (deps.readMcpEntry ?? readMcpEntry)(scope, cwd, home);\n\n if (state === 'ok') {\n return {\n name: 'mcp',\n status: 'ok',\n required: true,\n detail: `${MCP_SERVER_NAME} registered (${scope} scope), running \\`tenjin mcp\\``,\n };\n }\n if (state === 'wrong-command') {\n return {\n name: 'mcp',\n status: 'fail',\n required: true,\n detail: `${MCP_SERVER_NAME} registered but not \\`tenjin mcp\\`: the entry in ${where} launches something else, so the request tool is not there`,\n fix: `Remove it and re-run \\`tenjin install\\`${project ? ' --project' : ''}, or: ${add}`,\n };\n }\n // A file that is there and unreadable is not an absence: \"run install\" would\n // be the wrong instruction, since `install` refuses to write over it too.\n if (state === 'unreadable') {\n return {\n name: 'mcp',\n status: 'fail',\n required: true,\n detail: `${where} could not be read, so whether ${MCP_SERVER_NAME} is registered is unknown`,\n fix: `Fix the JSON in ${where}, then re-run \\`tenjin install\\`${project ? ' --project' : ''}.`,\n };\n }\n // Absent. On USER scope the file may simply not be where this build looks,\n // so the harness's own answer is worth asking before calling it missing.\n if (scope === 'user') {\n const which = deps.which ?? ((bin: string) => onPath(bin, env));\n if (which('claude')) {\n const seen = await (deps.readMcp ?? claudeHasServer)({ scope, cwd }).catch(() => false);\n if (seen) {\n return {\n name: 'mcp',\n status: 'warn',\n required: false,\n detail: `${MCP_SERVER_NAME} is registered somewhere this check cannot read, so what it launches was not verified`,\n fix: `Re-run \\`tenjin install\\` to write a registration this build can check, or: ${add}`,\n };\n }\n }\n }\n return {\n name: 'mcp',\n status: 'fail',\n required: true,\n detail: found\n ? `${MCP_SERVER_NAME} is not in ${where}, so there is no request tool`\n : `${where} does not exist, so ${MCP_SERVER_NAME} is not registered`,\n fix: `Run \\`tenjin install\\`${project ? ' --project' : ''}, or: ${add}`,\n };\n}\n\n/** The harness's own answer, for a user-scope registration this build cannot\n * find on disk. It resolves across scopes, which is why it is a last resort\n * and only ever downgrades the verdict to a warn. */\nasync function claudeHasServer(opts: { scope: 'user' | 'project'; cwd: string }): Promise<boolean> {\n const { stdout } = await exec('claude', ['mcp', 'get', MCP_SERVER_NAME], {\n timeout: 15_000,\n cwd: opts.cwd,\n });\n return stdout.includes(MCP_SERVER_NAME) && !/no mcp server/i.test(stdout);\n}\n\nfunction spendCheck(maxAutoSpendAtomic: bigint, sessionBudgetAtomic: bigint): RouterCheck {\n if (maxAutoSpendAtomic === 0n) {\n return {\n name: 'spend',\n status: 'fail',\n required: true,\n detail: 'maxAutoSpend is 0, so every lookup needs approval and none can pay',\n fix: 'Run `tenjin install`, or `tenjin config set maxAutoSpend 0.10`.',\n };\n }\n const budget =\n sessionBudgetAtomic === 0n\n ? 'no daily ceiling'\n : `${toMoney(sessionBudgetAtomic.toString()).usd} USD a day`;\n return {\n name: 'spend',\n status: sessionBudgetAtomic === 0n ? 'warn' : 'ok',\n required: false,\n detail: `at most ${toMoney(maxAutoSpendAtomic.toString()).usd} USD a call, ${budget}`,\n ...(sessionBudgetAtomic === 0n\n ? { fix: 'Set one with `tenjin config set sessionBudget 1.00`.' }\n : {}),\n };\n}\n\nasync function walletCheck(ctx: CommandContext): Promise<RouterCheck[]> {\n if (!(await walletFileExists(ctx.dataDir))) {\n return [\n {\n name: 'wallet',\n status: 'fail',\n required: true,\n detail: 'no wallet on this machine, so nothing can pay',\n fix: 'Run `tenjin wallet create`, then `tenjin wallet fund`.',\n },\n ];\n }\n try {\n const described = await describeWallet(resolveWalletProvider(ctx));\n return [{ name: 'wallet', status: 'ok', required: true, detail: described.address }];\n } catch (err) {\n return [\n {\n name: 'wallet',\n status: 'fail',\n required: true,\n detail: err instanceof CliError ? err.message : String(err),\n ...(err instanceof CliError && err.fix !== undefined ? { fix: err.fix } : {}),\n },\n ];\n }\n}\n\n/**\n * One cheap request to the free decision route with an empty body. It checks\n * the route is reachable and enabled, not that it routes: a 400 is the route\n * refusing that body, and a 404 is the route switched off. Nothing is signed\n * and no Jev request is spent.\n */\nasync function routerCheck(\n baseUrl: string,\n timeoutMs: number,\n fetchImpl: typeof fetch | undefined,\n): Promise<RouterCheck> {\n const url = new URL(ROUTER_PATH, baseUrl).toString();\n const probe = await httpRequest(url, {\n method: 'POST',\n timeoutMs,\n blockRedirects: true,\n jsonBody: {},\n ...(fetchImpl !== undefined ? { fetchImpl } : {}),\n });\n const fail = (detail: string, fix: string): RouterCheck => ({\n name: 'router',\n status: 'fail',\n required: true,\n detail,\n fix,\n });\n const checkBase =\n 'Check that the configured base URL names the Tenjin router (`tenjin config get baseUrl`), then try again later.';\n if (!probe.ok) {\n return fail(`the router at ${url} is unreachable or erroring (${probe.message})`, checkBase);\n }\n // 429 is the route's own rate limit: proof the router is there.\n if (probe.status === 200 || probe.status === 400 || probe.status === 429) {\n return { name: 'router', status: 'ok', required: true, detail: `${url} is live` };\n }\n if (probe.status === 404) {\n return fail(`the router is not enabled at ${url}`, checkBase);\n }\n if (probe.status === 401 || probe.status === 403) {\n return fail(\n `${url} is not a Tenjin router (it asked for credentials)`,\n `Set the router URL with \\`tenjin config set baseUrl ${PRODUCTION_ORIGIN}\\`.`,\n );\n }\n if (probe.status >= 500) {\n return fail(`the router at ${url} is unreachable or erroring (${probe.status})`, checkBase);\n }\n return fail(\n `${url} answered ${probe.status}, which a Tenjin router does not`,\n 'Check that the configured base URL names a Tenjin deployment (`tenjin config get baseUrl`).',\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAmC1B,IAAM,OAAO,UAAU,QAAQ;AA+B/B,IAAM,aAAa;AAEnB,eAAsB,gBACpB,KACA,OAAyB,CAAC,GACF;AACxB,QAAM,MAAM,KAAK,OAAO,QAAQ;AAChC,QAAM,WAAW,MAAM,uBAAuB,GAAG;AAIjD,QAAM,eAAe,mBAAmB;AAAA,IACtC,GAAI,KAAK,YAAY,OAAO,EAAE,SAAS,KAAK,IAAI,CAAC;AAAA,IACjD,GAAI,KAAK,YAAY,SAAY,EAAE,SAAS,KAAK,QAAQ,IAAI,CAAC;AAAA,IAC9D,GAAI,KAAK,QAAQ,SAAY,EAAE,KAAK,KAAK,IAAI,IAAI,CAAC;AAAA,EACpD,CAAC;AACD,QAAM,SAAwB,CAAC,UAAU,KAAK,eAAe,QAAQ,OAAO,CAAC;AAC7E,SAAO,KAAK,MAAM,WAAW,cAAc,IAAI,OAAO,CAAC;AACvD,SAAO,KAAK,MAAM,gBAAgB,YAAY,CAAC;AAC/C,SAAO;AAAA,IACL,MAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA,KAAK,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
|
|
9
|
+
import "./chunk-KG3D7FIF.js";
|
|
10
|
+
import "./chunk-BPMWXTFX.js";
|
|
11
11
|
import "./chunk-ZXTAQYNA.js";
|
|
12
12
|
export {
|
|
13
13
|
s as i,
|
|
@@ -15,4 +15,4 @@ export {
|
|
|
15
15
|
a as r,
|
|
16
16
|
f as t
|
|
17
17
|
};
|
|
18
|
-
//# sourceMappingURL=ethersCompat-Df4a6QIZ-
|
|
18
|
+
//# sourceMappingURL=ethersCompat-Df4a6QIZ-THAVUGIJ.js.map
|
|
@@ -1,43 +1,103 @@
|
|
|
1
1
|
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
SESSION_CHAIN_ID
|
|
4
|
-
} from "./chunk-WU5CZPLD.js";
|
|
5
2
|
import {
|
|
6
3
|
SIWX_HEADER,
|
|
7
4
|
buildSiwxHeader
|
|
8
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-3AUDA53C.js";
|
|
6
|
+
import {
|
|
7
|
+
fetchFailureToCliError,
|
|
8
|
+
httpRequest
|
|
9
|
+
} from "./chunk-5X4SZ5BF.js";
|
|
10
|
+
import "./chunk-TTNESUPQ.js";
|
|
11
|
+
import "./chunk-HPWO4O6S.js";
|
|
12
|
+
import "./chunk-POUWHWID.js";
|
|
13
|
+
import "./chunk-XZKD7DIF.js";
|
|
9
14
|
import {
|
|
10
15
|
getUsdcBalance
|
|
11
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-56MOAIP5.js";
|
|
12
17
|
import {
|
|
13
18
|
describeWallet,
|
|
14
19
|
resolveWalletProvider
|
|
15
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-YEETV6IW.js";
|
|
21
|
+
import "./chunk-DMZZLPZN.js";
|
|
22
|
+
import "./chunk-AWQPGIR6.js";
|
|
23
|
+
import "./chunk-N35E6CM2.js";
|
|
24
|
+
import "./chunk-JRGFKVAZ.js";
|
|
25
|
+
import "./chunk-5IEP5EGE.js";
|
|
16
26
|
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} from "./chunk-
|
|
27
|
+
getAddress,
|
|
28
|
+
isAddress
|
|
29
|
+
} from "./chunk-EGELTSPU.js";
|
|
30
|
+
import "./chunk-KG3D7FIF.js";
|
|
31
|
+
import "./chunk-RBJPAZFI.js";
|
|
32
|
+
import "./chunk-BPMWXTFX.js";
|
|
20
33
|
import {
|
|
21
34
|
emitNotice,
|
|
22
35
|
emitWriteNotice
|
|
23
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-YJHHCWM3.js";
|
|
37
|
+
import "./chunk-MEFB5KHA.js";
|
|
24
38
|
import {
|
|
25
39
|
toMoney
|
|
26
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-WH7OWT6G.js";
|
|
27
41
|
import {
|
|
42
|
+
PRODUCTION_ORIGIN,
|
|
43
|
+
external_exports,
|
|
28
44
|
loadRawConfig,
|
|
29
45
|
resolveSettings
|
|
30
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-BBVUVBUO.js";
|
|
47
|
+
import "./chunk-BFFM2WFK.js";
|
|
31
48
|
import {
|
|
32
49
|
CliError
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
50
|
+
} from "./chunk-OCBHUHWB.js";
|
|
51
|
+
import "./chunk-2BKS2FVE.js";
|
|
52
|
+
import "./chunk-7WEQQJLG.js";
|
|
53
|
+
import "./chunk-ZXTAQYNA.js";
|
|
54
|
+
|
|
55
|
+
// src/lib/session-key.ts
|
|
56
|
+
import { webcrypto as webcrypto2 } from "node:crypto";
|
|
57
|
+
|
|
58
|
+
// src/lib/session-present.ts
|
|
59
|
+
import { createHash, randomBytes, webcrypto } from "node:crypto";
|
|
60
|
+
var P256JwkSchema = external_exports.object({
|
|
61
|
+
kty: external_exports.literal("EC"),
|
|
62
|
+
crv: external_exports.literal("P-256"),
|
|
63
|
+
d: external_exports.string().min(1),
|
|
64
|
+
x: external_exports.string().min(1),
|
|
65
|
+
y: external_exports.string().min(1)
|
|
66
|
+
}).passthrough();
|
|
67
|
+
var SessionFileSchema = external_exports.object({
|
|
68
|
+
/** Lowercased wallet address this delegation is bound to. */
|
|
69
|
+
address: external_exports.string(),
|
|
70
|
+
/**
|
|
71
|
+
* The `scheme://host[:port]` this delegation was minted against.
|
|
72
|
+
*
|
|
73
|
+
* Load-bearing, not bookkeeping. The delegation is a wallet-derived credential
|
|
74
|
+
* and `--base-url` rides every leaf command, including the always-safe `read`.
|
|
75
|
+
* Without this field one auto-allowed `tenjin read <url> --base-url <attacker>`
|
|
76
|
+
* hands the credential to a host the agent chose, with the origin guard
|
|
77
|
+
* satisfied because the same flag set both sides of it. Binding the file to its
|
|
78
|
+
* origin closes that however the base URL arrived — flag, environment, or a
|
|
79
|
+
* rewritten config. It also makes a stale file after a prod/localhost/preview
|
|
80
|
+
* switch fail closed rather than present a delegation that cannot verify.
|
|
81
|
+
*/
|
|
82
|
+
origin: external_exports.string(),
|
|
83
|
+
/** The constant base64 SIWX `Tenjin-Session-Delegation` header value. */
|
|
84
|
+
delegation: external_exports.string(),
|
|
85
|
+
/** Delegation expiry (ISO 8601); a request is never signed at/after this. */
|
|
86
|
+
exp: external_exports.string(),
|
|
87
|
+
scope: external_exports.string(),
|
|
88
|
+
/** base64url raw 65-byte uncompressed P-256 point (0x04||X||Y). */
|
|
89
|
+
publicKeyRaw: external_exports.string(),
|
|
90
|
+
privateKeyJwk: P256JwkSchema
|
|
91
|
+
});
|
|
92
|
+
var subtle = webcrypto.subtle;
|
|
93
|
+
|
|
94
|
+
// src/lib/session-key.ts
|
|
95
|
+
var SESSION_CHAIN_ID = "eip155:8453";
|
|
96
|
+
var SESSION_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
97
|
+
var subtle2 = webcrypto2.subtle;
|
|
38
98
|
|
|
39
99
|
// src/lib/open-url.ts
|
|
40
|
-
import { execFile } from "child_process";
|
|
100
|
+
import { execFile } from "node:child_process";
|
|
41
101
|
var OPEN_TIMEOUT_MS = 5e3;
|
|
42
102
|
function openerFor(platform) {
|
|
43
103
|
if (platform === "darwin") return { cmd: "open", args: [] };
|
|
@@ -59,7 +119,7 @@ async function openInBrowser(url, opts = {}) {
|
|
|
59
119
|
|
|
60
120
|
// src/commands/fund.ts
|
|
61
121
|
var CHECKOUT_HOST = "pay.coinbase.com";
|
|
62
|
-
var FUND_ORIGIN =
|
|
122
|
+
var FUND_ORIGIN = PRODUCTION_ORIGIN;
|
|
63
123
|
var MAX_PRESET_USD = 1e5;
|
|
64
124
|
var POLL_INTERVAL_MS = 5e3;
|
|
65
125
|
var POLL_TIMEOUT_MS = 6e5;
|
|
@@ -149,7 +209,7 @@ function parsePreset(raw) {
|
|
|
149
209
|
const n = Number(raw);
|
|
150
210
|
if (!Number.isFinite(n) || n <= 0 || n > MAX_PRESET_USD) {
|
|
151
211
|
throw new CliError("USAGE", `Amount must be a positive USD number up to ${MAX_PRESET_USD}.`, {
|
|
152
|
-
fix: "Example: tenjin fund 5"
|
|
212
|
+
fix: "Example: tenjin wallet fund 5"
|
|
153
213
|
});
|
|
154
214
|
}
|
|
155
215
|
return n;
|
|
@@ -230,8 +290,7 @@ async function pollForFunds(ctx, desc, rpcUrl, startBalance, opts) {
|
|
|
230
290
|
}
|
|
231
291
|
return void 0;
|
|
232
292
|
}
|
|
233
|
-
|
|
234
293
|
export {
|
|
235
294
|
runFund
|
|
236
295
|
};
|
|
237
|
-
//# sourceMappingURL=
|
|
296
|
+
//# sourceMappingURL=fund-A54P2QFK.js.map
|