tenjin-cli 0.1.0-alpha.31 → 0.1.0-alpha.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/{_esm-MEXZI5DL.js → _esm-RLLC72MS.js} +128 -132
- package/dist/{alive-J64H46HI.js → alive-MROUMFH3.js} +13 -6
- package/dist/auto-update-OPWMRZLS.js +22 -0
- package/dist/{ccip-7RMRLAGV.js → ccip-DHDFKTQV.js} +2 -2
- package/dist/chunk-2GNOFONN.js +560 -0
- package/dist/chunk-2GNOFONN.js.map +1 -0
- package/dist/{chunk-TTNESUPQ.js → chunk-2GP3HRYK.js} +2120 -193
- package/dist/chunk-2GP3HRYK.js.map +1 -0
- package/dist/chunk-3AIHRXKO.js +72 -0
- package/dist/chunk-3AIHRXKO.js.map +1 -0
- package/dist/{chunk-LEFIX6RS.js → chunk-3DIL66VX.js} +31 -11
- package/dist/chunk-3DIL66VX.js.map +1 -0
- package/dist/{chunk-S4SAZ7OD.js → chunk-3FMZGI7I.js} +12 -2
- package/dist/{chunk-S4SAZ7OD.js.map → chunk-3FMZGI7I.js.map} +1 -1
- package/dist/{chunk-7Q5FDF65.js → chunk-445VQTVM.js} +3 -3
- package/dist/{chunk-A36LQPHV.js → chunk-4LMUQMBH.js} +1 -1
- package/dist/{chunk-A36LQPHV.js.map → chunk-4LMUQMBH.js.map} +1 -1
- package/dist/{chunk-KXQ4UIP7.js → chunk-4USCZ2NI.js} +2 -2
- package/dist/chunk-62KNUYWD.js +111 -0
- package/dist/chunk-62KNUYWD.js.map +1 -0
- package/dist/{chunk-POUWHWID.js → chunk-6CMM6YCB.js} +3 -3
- package/dist/{chunk-POUWHWID.js.map → chunk-6CMM6YCB.js.map} +1 -1
- package/dist/{chunk-5MARFNSB.js → chunk-AD226HDR.js} +49 -30
- package/dist/chunk-AD226HDR.js.map +1 -0
- package/dist/chunk-ADV4LDTB.js +106 -0
- package/dist/chunk-ADV4LDTB.js.map +1 -0
- package/dist/{chunk-7WU4OPLP.js → chunk-AV5NZMYO.js} +5 -3
- package/dist/{chunk-7WU4OPLP.js.map → chunk-AV5NZMYO.js.map} +1 -1
- package/dist/chunk-B7EM4GGF.js +198 -0
- package/dist/chunk-B7EM4GGF.js.map +1 -0
- package/dist/chunk-BFDQ4WNW.js +119 -0
- package/dist/chunk-BFDQ4WNW.js.map +1 -0
- package/dist/{chunk-2XLC3AEX.js → chunk-BI673VEJ.js} +536 -510
- package/dist/chunk-BI673VEJ.js.map +1 -0
- package/dist/chunk-CEXSOI5R.js +808 -0
- package/dist/chunk-CEXSOI5R.js.map +1 -0
- package/dist/{chunk-FW75G2W4.js → chunk-CISYM4EO.js} +5 -5
- package/dist/{chunk-B7HUUJOK.js → chunk-D3ZURCG7.js} +3 -3
- package/dist/chunk-D5TOQSO4.js +474 -0
- package/dist/chunk-D5TOQSO4.js.map +1 -0
- package/dist/{chunk-UQUOVWBG.js → chunk-DRDUIZIA.js} +7 -7
- package/dist/{chunk-27EPWVOY.js → chunk-DW4YTVR3.js} +2 -2
- package/dist/chunk-E7LGOMH6.js +449 -0
- package/dist/chunk-E7LGOMH6.js.map +1 -0
- package/dist/{chunk-QSCPK4F5.js → chunk-E7SW44LM.js} +4 -11
- package/dist/chunk-E7SW44LM.js.map +1 -0
- package/dist/chunk-EDJWHDDL.js +33 -0
- package/dist/chunk-EDJWHDDL.js.map +1 -0
- package/dist/chunk-F3ED5WTR.js +13 -0
- package/dist/chunk-F3ED5WTR.js.map +1 -0
- package/dist/chunk-G75OPGAK.js +111 -0
- package/dist/chunk-G75OPGAK.js.map +1 -0
- package/dist/{chunk-R5LCN54M.js → chunk-GAKUQHKA.js} +13 -17
- package/dist/{chunk-R5LCN54M.js.map → chunk-GAKUQHKA.js.map} +1 -1
- package/dist/{chunk-4ZZO6ULA.js → chunk-HDPUXS3Z.js} +19 -48
- package/dist/chunk-HDPUXS3Z.js.map +1 -0
- package/dist/{chunk-ORWL5BSN.js → chunk-HGZEPQUT.js} +2 -2
- package/dist/{chunk-6E5R45ZO.js → chunk-HREHWL32.js} +4 -4
- package/dist/{chunk-6E5R45ZO.js.map → chunk-HREHWL32.js.map} +1 -1
- package/dist/{chunk-KXVP2VKA.js → chunk-I5TDIUKM.js} +15 -34
- package/dist/chunk-I5TDIUKM.js.map +1 -0
- package/dist/{chunk-7QKHZQKW.js → chunk-IADZOXKN.js} +39 -6
- package/dist/chunk-IADZOXKN.js.map +1 -0
- package/dist/{chunk-P4NH7OUK.js → chunk-IDTRSAHE.js} +2 -2
- package/dist/{chunk-YFPY4ONH.js → chunk-JEVQ5LKO.js} +4 -4
- package/dist/chunk-JNJWBTU2.js +3497 -0
- package/dist/chunk-JNJWBTU2.js.map +1 -0
- package/dist/{chunk-MNXS2U45.js → chunk-JRZBBPO6.js} +167 -86
- package/dist/chunk-JRZBBPO6.js.map +1 -0
- package/dist/{chunk-WJXLQXJY.js → chunk-MPZUYCAP.js} +4 -1
- package/dist/{chunk-WJXLQXJY.js.map → chunk-MPZUYCAP.js.map} +1 -1
- package/dist/{chunk-SJLTEINJ.js → chunk-OJNTCYQQ.js} +17 -1
- package/dist/chunk-OJNTCYQQ.js.map +1 -0
- package/dist/{chunk-AGZ7PJKY.js → chunk-OTWLERSW.js} +22 -5
- package/dist/chunk-OTWLERSW.js.map +1 -0
- package/dist/{chunk-NEFNKLBE.js → chunk-PJNENX2A.js} +1535 -422
- package/dist/chunk-PJNENX2A.js.map +1 -0
- package/dist/{chunk-UKY4CHNC.js → chunk-PKHI276N.js} +8 -4
- package/dist/chunk-PKHI276N.js.map +1 -0
- package/dist/{chunk-5K5W4S66.js → chunk-QF3LSMGS.js} +2 -2
- package/dist/{chunk-XZKD7DIF.js → chunk-RL5UUDT4.js} +3 -3
- package/dist/{chunk-XZKD7DIF.js.map → chunk-RL5UUDT4.js.map} +1 -1
- package/dist/{chunk-OHRR5OYM.js → chunk-SFASB5FL.js} +10 -4
- package/dist/chunk-SFASB5FL.js.map +1 -0
- package/dist/{chunk-YVFXE7RR.js → chunk-SNNSAGMT.js} +7279 -2627
- package/dist/chunk-SNNSAGMT.js.map +1 -0
- package/dist/{chunk-WK7F3B2E.js → chunk-SO3XRZPX.js} +3 -3
- package/dist/chunk-SYOS5CAC.js +176 -0
- package/dist/chunk-SYOS5CAC.js.map +1 -0
- package/dist/chunk-TAW4UFFF.js +293 -0
- package/dist/chunk-TAW4UFFF.js.map +1 -0
- package/dist/{hosts-FWZOV26H.js → chunk-TF5HCP33.js} +79 -24
- package/dist/chunk-TF5HCP33.js.map +1 -0
- package/dist/{chunk-AKWGE6JQ.js → chunk-UUGOUOVT.js} +37 -2
- package/dist/chunk-UUGOUOVT.js.map +1 -0
- package/dist/{chunk-7ZRL2LBQ.js → chunk-V2LQLN5H.js} +6 -6
- package/dist/{chunk-K72RURN3.js → chunk-VJUVFZ2D.js} +2 -2
- package/dist/{chunk-77TCKDEC.js → chunk-VOZA6O7K.js} +663 -477
- package/dist/chunk-VOZA6O7K.js.map +1 -0
- package/dist/{chunk-D65GNPS3.js → chunk-VUGQTZ2L.js} +208 -84
- package/dist/chunk-VUGQTZ2L.js.map +1 -0
- package/dist/chunk-WOM257PW.js +393 -0
- package/dist/chunk-WOM257PW.js.map +1 -0
- package/dist/chunk-WYXUQGOL.js +191 -0
- package/dist/chunk-WYXUQGOL.js.map +1 -0
- package/dist/chunk-X5ZBP3IY.js +97 -0
- package/dist/chunk-X5ZBP3IY.js.map +1 -0
- package/dist/{chunk-5C32RLTA.js → chunk-YUY4SAGM.js} +17 -2
- package/dist/chunk-YUY4SAGM.js.map +1 -0
- package/dist/{cli-D5OE3URZ.js → cli-FB4LOA5A.js} +144 -63
- package/dist/{cli-D5OE3URZ.js.map → cli-FB4LOA5A.js.map} +1 -1
- package/dist/{codex-event-PPNVRRDH.js → codex-event-TYVES3UX.js} +2 -2
- package/dist/{codex-host-2RJOJW2B.js → codex-host-WW4H2SKT.js} +7 -6
- package/dist/codex-install-2C623HPW.js +393 -0
- package/dist/codex-install-2C623HPW.js.map +1 -0
- package/dist/{config-ZD4OB2DO.js → config-HOVJFEKD.js} +21 -17
- package/dist/doctor-NKU4V5OV.js +1312 -0
- package/dist/doctor-NKU4V5OV.js.map +1 -0
- package/dist/{env-proxy-XL4P73MZ.js → env-proxy-R6ZMLQTT.js} +6 -2
- package/dist/{ethersCompat-Df4a6QIZ-THAVUGIJ.js → ethersCompat-Df4a6QIZ-X6YZWAML.js} +3 -3
- package/dist/{fund-5ITKQGYF.js → fund-WEBHTZGN.js} +37 -36
- package/dist/{fund-5ITKQGYF.js.map → fund-WEBHTZGN.js.map} +1 -1
- package/dist/hook-command-ZA2PNKS6.js +44 -0
- package/dist/hosts/claude/.claude-plugin/marketplace.json +2 -2
- package/dist/hosts/claude/tenjin/.claude-plugin/plugin.json +2 -2
- package/dist/hosts/claude/tenjin/skills/tenjin-pay/SKILL.md +82 -0
- package/dist/hosts/codex/tenjin/.mcp.json +3 -0
- package/dist/hosts/codex/tenjin/hooks/hooks.json +51 -5
- package/dist/hosts-AV5MHBAU.js +38 -0
- package/dist/index.js +28 -8
- package/dist/index.js.map +1 -1
- package/dist/{install-XWGE4Q7L.js → install-PT4EZS4R.js} +53 -30
- package/dist/{install-identity-K7EJIQFP.js → install-identity-5A4OE6YC.js} +11 -10
- package/dist/install-wallet-SAAPKB73.js +281 -0
- package/dist/install-wallet-SAAPKB73.js.map +1 -0
- package/dist/{mcp-3LIJSSJB.js → mcp-HAWKCTPQ.js} +785 -210
- package/dist/mcp-HAWKCTPQ.js.map +1 -0
- package/dist/{mine.wasm-6PIT3DK6.js → mine.wasm-QFAHIFPY.js} +2 -2
- package/dist/{mine.wasm-6PIT3DK6.js.map → mine.wasm-QFAHIFPY.js.map} +1 -1
- package/dist/{package-ZKQFDWLE.js → package-SR2WB6MK.js} +4 -2
- package/dist/passphrase-IFTDS3CU.js +44 -0
- package/dist/{paths-POPTXJO6.js → paths-XCSAKISU.js} +10 -2
- package/dist/{pay-WHBERZ3W.js → pay-OXC3WKYV.js} +29 -29
- package/dist/{payments-KVICEKD2.js → payments-3KHMP2MG.js} +15 -14
- package/dist/{payments-KVICEKD2.js.map → payments-3KHMP2MG.js.map} +1 -1
- package/dist/plugin-registration-N3GRIZVM.js +67 -0
- package/dist/{redact-6W23GGJC.js → redact-D7ASVWKL.js} +2 -2
- package/dist/runtime-UVNUA3AS.js +1203 -0
- package/dist/runtime-UVNUA3AS.js.map +1 -0
- package/dist/runtime-fetch-EKFRNR6Z.js +20 -0
- package/dist/runtime-layout-BDWZG2TQ.js +25 -0
- package/dist/{send-7G7Y7DLN.js → send-HMKJLT34.js} +24 -22
- package/dist/{send-7G7Y7DLN.js.map → send-HMKJLT34.js.map} +1 -1
- package/dist/{status-OF7RH5HM.js → status-RWXIIWYS.js} +55 -25
- package/dist/status-RWXIIWYS.js.map +1 -0
- package/dist/{status-line-XOUE6MPL.js → status-line-77XYZP7E.js} +10 -9
- package/dist/{status-line-XOUE6MPL.js.map → status-line-77XYZP7E.js.map} +1 -1
- package/dist/uninstall-D5G67UJH.js +480 -0
- package/dist/uninstall-D5G67UJH.js.map +1 -0
- package/dist/update-LRNOEGSB.js +53 -0
- package/dist/update-LRNOEGSB.js.map +1 -0
- package/dist/{usdc-OGOGEHV2.js → usdc-D6X7EIQ2.js} +6 -8
- package/dist/usdc-D6X7EIQ2.js.map +1 -0
- package/dist/{viemAdapter-By13KInL-S3DA7DFW.js → viemAdapter-By13KInL-RL742ETX.js} +3 -3
- package/dist/viemAdapter-By13KInL-RL742ETX.js.map +1 -0
- package/dist/wallet-XFYC27BR.js +55 -0
- package/dist/wallet-XFYC27BR.js.map +1 -0
- package/dist/wallet-kdf-worker.mjs +8 -8
- package/docs/agent-permissions.md +40 -22
- package/docs/safety-model.md +1 -1
- package/docs/troubleshooting.md +72 -1
- package/package.json +14 -1
- package/dist/ccip-NLCSCHKI.js +0 -19
- package/dist/chunk-2XLC3AEX.js.map +0 -1
- package/dist/chunk-4ZZO6ULA.js.map +0 -1
- package/dist/chunk-5C32RLTA.js.map +0 -1
- package/dist/chunk-5IEP5EGE.js +0 -5332
- package/dist/chunk-5IEP5EGE.js.map +0 -1
- package/dist/chunk-5MARFNSB.js.map +0 -1
- package/dist/chunk-77TCKDEC.js.map +0 -1
- package/dist/chunk-7EKYXMUO.js +0 -7536
- package/dist/chunk-7EKYXMUO.js.map +0 -1
- package/dist/chunk-7QKHZQKW.js.map +0 -1
- package/dist/chunk-AGZ7PJKY.js.map +0 -1
- package/dist/chunk-AKWGE6JQ.js.map +0 -1
- package/dist/chunk-BL3332HQ.js +0 -7611
- package/dist/chunk-BL3332HQ.js.map +0 -1
- package/dist/chunk-D65GNPS3.js.map +0 -1
- package/dist/chunk-EGELTSPU.js +0 -2865
- package/dist/chunk-EGELTSPU.js.map +0 -1
- package/dist/chunk-GA7JETVM.js +0 -150
- package/dist/chunk-GA7JETVM.js.map +0 -1
- package/dist/chunk-I3EQFHCD.js +0 -175
- package/dist/chunk-I3EQFHCD.js.map +0 -1
- package/dist/chunk-K3I7C2MO.js +0 -1185
- package/dist/chunk-K3I7C2MO.js.map +0 -1
- package/dist/chunk-KXVP2VKA.js.map +0 -1
- package/dist/chunk-LEFIX6RS.js.map +0 -1
- package/dist/chunk-MNXS2U45.js.map +0 -1
- package/dist/chunk-NEFNKLBE.js.map +0 -1
- package/dist/chunk-OHRR5OYM.js.map +0 -1
- package/dist/chunk-QSCPK4F5.js.map +0 -1
- package/dist/chunk-SJLTEINJ.js.map +0 -1
- package/dist/chunk-TTNESUPQ.js.map +0 -1
- package/dist/chunk-UKY4CHNC.js.map +0 -1
- package/dist/chunk-V6BSF6OC.js +0 -260
- package/dist/chunk-V6BSF6OC.js.map +0 -1
- package/dist/chunk-YVFXE7RR.js.map +0 -1
- package/dist/codex-install-UUZ6QMBQ.js +0 -221
- package/dist/codex-install-UUZ6QMBQ.js.map +0 -1
- package/dist/doctor-KBR34Q4B.js +0 -601
- package/dist/doctor-KBR34Q4B.js.map +0 -1
- package/dist/hook-command-4TYCHHRL.js +0 -39
- package/dist/hosts-FWZOV26H.js.map +0 -1
- package/dist/install-wallet-XQ6XFZV4.js +0 -117
- package/dist/install-wallet-XQ6XFZV4.js.map +0 -1
- package/dist/mcp-3LIJSSJB.js.map +0 -1
- package/dist/plugin-registration-5TIA564H.js +0 -54
- package/dist/status-OF7RH5HM.js.map +0 -1
- package/dist/uninstall-JXUAFNDB.js +0 -158
- package/dist/uninstall-JXUAFNDB.js.map +0 -1
- package/dist/update-ZKUERSO2.js +0 -44
- package/dist/wallet-2HA6W4R4.js +0 -43
- /package/dist/{_esm-MEXZI5DL.js.map → _esm-RLLC72MS.js.map} +0 -0
- /package/dist/{alive-J64H46HI.js.map → alive-MROUMFH3.js.map} +0 -0
- /package/dist/{ccip-7RMRLAGV.js.map → auto-update-OPWMRZLS.js.map} +0 -0
- /package/dist/{ccip-NLCSCHKI.js.map → ccip-DHDFKTQV.js.map} +0 -0
- /package/dist/{chunk-7Q5FDF65.js.map → chunk-445VQTVM.js.map} +0 -0
- /package/dist/{chunk-KXQ4UIP7.js.map → chunk-4USCZ2NI.js.map} +0 -0
- /package/dist/{chunk-FW75G2W4.js.map → chunk-CISYM4EO.js.map} +0 -0
- /package/dist/{chunk-B7HUUJOK.js.map → chunk-D3ZURCG7.js.map} +0 -0
- /package/dist/{chunk-UQUOVWBG.js.map → chunk-DRDUIZIA.js.map} +0 -0
- /package/dist/{chunk-27EPWVOY.js.map → chunk-DW4YTVR3.js.map} +0 -0
- /package/dist/{chunk-ORWL5BSN.js.map → chunk-HGZEPQUT.js.map} +0 -0
- /package/dist/{chunk-P4NH7OUK.js.map → chunk-IDTRSAHE.js.map} +0 -0
- /package/dist/{chunk-YFPY4ONH.js.map → chunk-JEVQ5LKO.js.map} +0 -0
- /package/dist/{chunk-5K5W4S66.js.map → chunk-QF3LSMGS.js.map} +0 -0
- /package/dist/{chunk-WK7F3B2E.js.map → chunk-SO3XRZPX.js.map} +0 -0
- /package/dist/{chunk-7ZRL2LBQ.js.map → chunk-V2LQLN5H.js.map} +0 -0
- /package/dist/{chunk-K72RURN3.js.map → chunk-VJUVFZ2D.js.map} +0 -0
- /package/dist/{codex-event-PPNVRRDH.js.map → codex-event-TYVES3UX.js.map} +0 -0
- /package/dist/{codex-host-2RJOJW2B.js.map → codex-host-WW4H2SKT.js.map} +0 -0
- /package/dist/{config-ZD4OB2DO.js.map → config-HOVJFEKD.js.map} +0 -0
- /package/dist/{env-proxy-XL4P73MZ.js.map → env-proxy-R6ZMLQTT.js.map} +0 -0
- /package/dist/{ethersCompat-Df4a6QIZ-THAVUGIJ.js.map → ethersCompat-Df4a6QIZ-X6YZWAML.js.map} +0 -0
- /package/dist/{hook-command-4TYCHHRL.js.map → hook-command-ZA2PNKS6.js.map} +0 -0
- /package/dist/{install-XWGE4Q7L.js.map → hosts-AV5MHBAU.js.map} +0 -0
- /package/dist/{install-identity-K7EJIQFP.js.map → install-PT4EZS4R.js.map} +0 -0
- /package/dist/{package-ZKQFDWLE.js.map → install-identity-5A4OE6YC.js.map} +0 -0
- /package/dist/{paths-POPTXJO6.js.map → package-SR2WB6MK.js.map} +0 -0
- /package/dist/{pay-WHBERZ3W.js.map → passphrase-IFTDS3CU.js.map} +0 -0
- /package/dist/{plugin-registration-5TIA564H.js.map → paths-XCSAKISU.js.map} +0 -0
- /package/dist/{redact-6W23GGJC.js.map → pay-OXC3WKYV.js.map} +0 -0
- /package/dist/{update-ZKUERSO2.js.map → plugin-registration-N3GRIZVM.js.map} +0 -0
- /package/dist/{usdc-OGOGEHV2.js.map → redact-D7ASVWKL.js.map} +0 -0
- /package/dist/{viemAdapter-By13KInL-S3DA7DFW.js.map → runtime-fetch-EKFRNR6Z.js.map} +0 -0
- /package/dist/{wallet-2HA6W4R4.js.map → runtime-layout-BDWZG2TQ.js.map} +0 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
KEYCHAIN_LOCKED_FIX,
|
|
4
|
+
REPAIR_CLAUSE,
|
|
5
|
+
REPAIR_IN_TERMINAL,
|
|
6
|
+
unlockReasonOf
|
|
7
|
+
} from "./chunk-X5ZBP3IY.js";
|
|
8
|
+
|
|
9
|
+
// src/router/wallet-reasons.ts
|
|
10
|
+
var ASK_FOR_REPAIR = "Ask the person to run `tenjin wallet repair` in their own terminal, then start a new Claude Code session. Never ask for the passphrase.";
|
|
11
|
+
var WALLET_REASONS = {
|
|
12
|
+
no_wallet: {
|
|
13
|
+
reason: "this machine has no wallet",
|
|
14
|
+
fix: "Run `tenjin doctor`.",
|
|
15
|
+
agentFix: "Run `tenjin doctor`."
|
|
16
|
+
},
|
|
17
|
+
wallet_corrupt: {
|
|
18
|
+
// Both causes: a wallet.json nothing can parse, and a keystore that
|
|
19
|
+
// decrypts to a key that does not match its stored address. Doctor and
|
|
20
|
+
// install show this fix themselves, so it must not send the person there.
|
|
21
|
+
reason: "the wallet file cannot be read or does not match its key",
|
|
22
|
+
fix: "Move the wallet file aside, then run `tenjin wallet create` for a fresh key or set TENJIN_WALLET_KEY to use the intended one.",
|
|
23
|
+
agentFix: "Ask the person to move the wallet file aside and run `tenjin wallet create` for a fresh key, or to set TENJIN_WALLET_KEY to the intended one. Never ask for the key."
|
|
24
|
+
},
|
|
25
|
+
env_key_invalid: {
|
|
26
|
+
reason: "TENJIN_WALLET_KEY is not a valid private key",
|
|
27
|
+
fix: "Fix or unset TENJIN_WALLET_KEY in the environment Claude Code starts from, then quit Claude Code fully and start a new session.",
|
|
28
|
+
agentFix: "Ask the person to fix or unset TENJIN_WALLET_KEY in the environment Claude Code starts from, then quit Claude Code fully and start a new session. Never ask for the key."
|
|
29
|
+
},
|
|
30
|
+
passphrase_missing: {
|
|
31
|
+
reason: "no saved wallet passphrase can be reached",
|
|
32
|
+
fix: `${REPAIR_IN_TERMINAL} Then start a new Claude Code session.`,
|
|
33
|
+
agentFix: ASK_FOR_REPAIR
|
|
34
|
+
},
|
|
35
|
+
passphrase_wrong: {
|
|
36
|
+
reason: "the saved wallet passphrase does not open the wallet",
|
|
37
|
+
fix: `${REPAIR_IN_TERMINAL} Then start a new Claude Code session.`,
|
|
38
|
+
agentFix: ASK_FOR_REPAIR
|
|
39
|
+
},
|
|
40
|
+
env_passphrase_wrong: {
|
|
41
|
+
reason: "TENJIN_WALLET_PASSPHRASE is set but does not open the wallet",
|
|
42
|
+
// Shown only when no saved passphrase opens the wallet either, so removing
|
|
43
|
+
// the variable alone never unlocks it: repair first, then remove it.
|
|
44
|
+
fix: `Run \`tenjin wallet repair\` yourself ${REPAIR_CLAUSE}, then remove TENJIN_WALLET_PASSPHRASE from the environment Claude Code starts from, then quit Claude Code fully and start a new session.`,
|
|
45
|
+
agentFix: "Ask the person to run `tenjin wallet repair` in their own terminal, then to remove TENJIN_WALLET_PASSPHRASE from the environment Claude Code starts from, then quit Claude Code fully and start a new session. Never ask for the passphrase."
|
|
46
|
+
},
|
|
47
|
+
keychain_locked: {
|
|
48
|
+
reason: "the keychain holding the wallet passphrase is locked or did not answer",
|
|
49
|
+
fix: KEYCHAIN_LOCKED_FIX,
|
|
50
|
+
agentFix: "Ask the person to unlock their keychain (or log in to the desktop session) and retry."
|
|
51
|
+
},
|
|
52
|
+
wallet_locked: {
|
|
53
|
+
reason: "`tenjin mcp` cannot unlock the wallet",
|
|
54
|
+
fix: "Run `tenjin doctor`.",
|
|
55
|
+
agentFix: "Run `tenjin doctor`."
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
var UNKNOWN_DETAIL = {
|
|
59
|
+
keychain_locked: "the keychain holding the passphrase did not answer",
|
|
60
|
+
unlock_timeout: "the unlock did not finish in time",
|
|
61
|
+
wallet_locked: "the unlock failed for a reason Tenjin could not classify",
|
|
62
|
+
balance_unreadable: "the wallet balance could not be read",
|
|
63
|
+
check_failed: "the check itself failed",
|
|
64
|
+
not_checked: "no unlock has been tried yet"
|
|
65
|
+
};
|
|
66
|
+
var WALLET_CLASS = /* @__PURE__ */ new Set([
|
|
67
|
+
"no_wallet",
|
|
68
|
+
"wallet_corrupt",
|
|
69
|
+
"env_key_invalid",
|
|
70
|
+
"passphrase_missing",
|
|
71
|
+
"passphrase_wrong",
|
|
72
|
+
"env_passphrase_wrong",
|
|
73
|
+
"keychain_locked",
|
|
74
|
+
"unlock_timeout",
|
|
75
|
+
"wallet_locked",
|
|
76
|
+
"wallet_low"
|
|
77
|
+
]);
|
|
78
|
+
var WALLET_UNLOCKED = "Tenjin wallet unlocked.";
|
|
79
|
+
var WALLET_FUNDED = "Tenjin wallet funded.";
|
|
80
|
+
var NO_SESSION_CHECKED = "this shell passes; no running Claude session checked";
|
|
81
|
+
function entryFor(reason) {
|
|
82
|
+
return reason === "unlock_timeout" ? WALLET_REASONS.wallet_locked : WALLET_REASONS[reason];
|
|
83
|
+
}
|
|
84
|
+
function sessionStartMessage(reason) {
|
|
85
|
+
const r = entryFor(reason);
|
|
86
|
+
return {
|
|
87
|
+
systemMessage: `Tenjin can't use its wallet in this session: ${r.reason}. ${r.fix}`,
|
|
88
|
+
additionalContext: `Tenjin's wallet cannot sign in this session (${r.reason}), so Tenjin is not routing lookups and paid lookups will not run. ${r.agentFix}`
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function stillLockedSentence(reason) {
|
|
92
|
+
const r = entryFor(reason);
|
|
93
|
+
return `Tenjin wallet is still locked: ${r.reason}. ${r.fix}`;
|
|
94
|
+
}
|
|
95
|
+
function agentFixFor(reason, fallback) {
|
|
96
|
+
return Object.prototype.hasOwnProperty.call(WALLET_REASONS, reason) ? WALLET_REASONS[reason].agentFix : fallback;
|
|
97
|
+
}
|
|
98
|
+
function agentFixOf(err) {
|
|
99
|
+
const why = unlockReasonOf(err);
|
|
100
|
+
return why === null ? err.fix ?? "" : agentFixFor(why, err.fix ?? "");
|
|
101
|
+
}
|
|
102
|
+
function walletClearedSentence(previousWhy) {
|
|
103
|
+
if (previousWhy === "wallet_low") return WALLET_FUNDED;
|
|
104
|
+
return WALLET_CLASS.has(previousWhy) ? WALLET_UNLOCKED : null;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export {
|
|
108
|
+
WALLET_REASONS,
|
|
109
|
+
UNKNOWN_DETAIL,
|
|
110
|
+
WALLET_CLASS,
|
|
111
|
+
WALLET_UNLOCKED,
|
|
112
|
+
NO_SESSION_CHECKED,
|
|
113
|
+
sessionStartMessage,
|
|
114
|
+
stillLockedSentence,
|
|
115
|
+
agentFixFor,
|
|
116
|
+
agentFixOf,
|
|
117
|
+
walletClearedSentence
|
|
118
|
+
};
|
|
119
|
+
//# sourceMappingURL=chunk-BFDQ4WNW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/router/wallet-reasons.ts"],"sourcesContent":["import {\n KEYCHAIN_LOCKED_FIX,\n REPAIR_CLAUSE,\n REPAIR_IN_TERMINAL,\n unlockReasonOf,\n type UnlockReason,\n} from '../lib/wallet-unlock';\n\nexport {\n ENV_PASSPHRASE_WRONG,\n KEYCHAIN_LOCKED_FIX,\n REPAIR_CLAUSE,\n REPAIR_IN_TERMINAL,\n} from '../lib/wallet-unlock';\n\n/** The model-facing fix for a saved passphrase that is gone or wrong. */\nexport const ASK_FOR_REPAIR =\n 'Ask the person to run `tenjin wallet repair` in their own terminal, then start a new Claude Code session. Never ask for the passphrase.';\n\n/**\n * EVERY WORD TENJIN SAYS ABOUT A WALLET THAT CANNOT SIGN, in one place. Pure\n * strings, importing only `../lib/wallet-unlock`, so `alive` and the hooks can\n * carry them without pulling anything else into their chunks.\n *\n * Each reason has TWO fixes, because two different readers see them (B1):\n * - `fix` is for the PERSON: doctor, install at a terminal, repair, wallet\n * errors, SessionStart's `systemMessage`, and hook notices (the harness shows\n * those in `systemMessage` too). Any `fix` that names `tenjin wallet repair`\n * carries {@link REPAIR_CLAUSE}, so the person hears that it asks in their own\n * terminal and that the passphrase never goes into chat.\n * - `agentFix` is for the MODEL only: SessionStart's `additionalContext`, offer\n * notes, the `request` tool's text and MCP tool errors. It tells the model to\n * ask the person to act, and never to ask for the passphrase or key, so a\n * helpful agent never solicits a secret into the transcript.\n *\n * `reason` is a fragment that slots into a sentence (\"... (reason), so ...\").\n * `no_wallet` keeps fee.ts's `UNPAID.no_wallet` wording byte for byte, and\n * `wallet_low` is not here at all: funding copy is out of scope (S5, S6).\n */\nexport const WALLET_REASONS: Record<\n Exclude<UnlockReason, 'unlock_timeout'> | 'wallet_locked',\n { reason: string; fix: string; agentFix: string }\n> = {\n no_wallet: {\n reason: 'this machine has no wallet',\n fix: 'Run `tenjin doctor`.',\n agentFix: 'Run `tenjin doctor`.',\n },\n wallet_corrupt: {\n // Both causes: a wallet.json nothing can parse, and a keystore that\n // decrypts to a key that does not match its stored address. Doctor and\n // install show this fix themselves, so it must not send the person there.\n reason: 'the wallet file cannot be read or does not match its key',\n fix: 'Move the wallet file aside, then run `tenjin wallet create` for a fresh key or set TENJIN_WALLET_KEY to use the intended one.',\n agentFix:\n 'Ask the person to move the wallet file aside and run `tenjin wallet create` for a fresh key, or to set TENJIN_WALLET_KEY to the intended one. Never ask for the key.',\n },\n env_key_invalid: {\n reason: 'TENJIN_WALLET_KEY is not a valid private key',\n fix: 'Fix or unset TENJIN_WALLET_KEY in the environment Claude Code starts from, then quit Claude Code fully and start a new session.',\n agentFix:\n 'Ask the person to fix or unset TENJIN_WALLET_KEY in the environment Claude Code starts from, then quit Claude Code fully and start a new session. Never ask for the key.',\n },\n passphrase_missing: {\n reason: 'no saved wallet passphrase can be reached',\n fix: `${REPAIR_IN_TERMINAL} Then start a new Claude Code session.`,\n agentFix: ASK_FOR_REPAIR,\n },\n passphrase_wrong: {\n reason: 'the saved wallet passphrase does not open the wallet',\n fix: `${REPAIR_IN_TERMINAL} Then start a new Claude Code session.`,\n agentFix: ASK_FOR_REPAIR,\n },\n env_passphrase_wrong: {\n reason: 'TENJIN_WALLET_PASSPHRASE is set but does not open the wallet',\n // Shown only when no saved passphrase opens the wallet either, so removing\n // the variable alone never unlocks it: repair first, then remove it.\n fix: `Run \\`tenjin wallet repair\\` yourself ${REPAIR_CLAUSE}, then remove TENJIN_WALLET_PASSPHRASE from the environment Claude Code starts from, then quit Claude Code fully and start a new session.`,\n agentFix:\n 'Ask the person to run `tenjin wallet repair` in their own terminal, then to remove TENJIN_WALLET_PASSPHRASE from the environment Claude Code starts from, then quit Claude Code fully and start a new session. Never ask for the passphrase.',\n },\n keychain_locked: {\n reason: 'the keychain holding the wallet passphrase is locked or did not answer',\n fix: KEYCHAIN_LOCKED_FIX,\n agentFix:\n 'Ask the person to unlock their keychain (or log in to the desktop session) and retry.',\n },\n wallet_locked: {\n reason: '`tenjin mcp` cannot unlock the wallet',\n fix: 'Run `tenjin doctor`.',\n agentFix: 'Run `tenjin doctor`.',\n },\n};\n\n/**\n * Why a verdict is unknown, by its reason: the store or the clock did not\n * answer, or nothing was tried. Said as \"could not check: <detail>\", never as\n * a fault the person must fix.\n */\nexport const UNKNOWN_DETAIL: Readonly<Record<string, string>> = {\n keychain_locked: 'the keychain holding the passphrase did not answer',\n unlock_timeout: 'the unlock did not finish in time',\n wallet_locked: 'the unlock failed for a reason Tenjin could not classify',\n balance_unreadable: 'the wallet balance could not be read',\n check_failed: 'the check itself failed',\n not_checked: 'no unlock has been tried yet',\n};\n\n/** Every reason a notice treats as \"the wallet\": the unlock reasons, the\n * unclassified fallback, and a balance below the routing deposit. */\nexport const WALLET_CLASS: ReadonlySet<string> = new Set<string>([\n 'no_wallet',\n 'wallet_corrupt',\n 'env_key_invalid',\n 'passphrase_missing',\n 'passphrase_wrong',\n 'env_passphrase_wrong',\n 'keychain_locked',\n 'unlock_timeout',\n 'wallet_locked',\n 'wallet_low',\n]);\n\n/** One-time line once a paid call succeeds after an unlock reason was told. */\nexport const WALLET_UNLOCKED = 'Tenjin wallet unlocked.';\n\n/** One-time line once a paid call succeeds after `wallet_low` was told. */\nexport const WALLET_FUNDED = 'Tenjin wallet funded.';\n\n/** Doctor's session-row detail when this shell signs and no served router was seen. */\nexport const NO_SESSION_CHECKED = 'this shell passes; no running Claude session checked';\n\n/**\n * The entry for a reason. `unlock_timeout` has none of its own (it is no-fault\n * and normally says nothing); a caller that still asks gets the unclassified\n * fallback's wording rather than a crash.\n */\nfunction entryFor(reason: UnlockReason | 'wallet_locked') {\n return reason === 'unlock_timeout' ? WALLET_REASONS.wallet_locked : WALLET_REASONS[reason];\n}\n\n/**\n * SessionStart's two fields for a wallet that cannot sign: `systemMessage` is\n * the person's (person `fix`), `additionalContext` the model's (`agentFix`).\n */\nexport function sessionStartMessage(reason: UnlockReason | 'wallet_locked'): {\n systemMessage: string;\n additionalContext: string;\n} {\n const r = entryFor(reason);\n return {\n systemMessage: `Tenjin can't use its wallet in this session: ${r.reason}. ${r.fix}`,\n additionalContext: `Tenjin's wallet cannot sign in this session (${r.reason}), so Tenjin is not routing lookups and paid lookups will not run. ${r.agentFix}`,\n };\n}\n\n/** A wallet-news line in `systemMessage`. Its reader is the person, so the person `fix`. */\nexport function stillLockedSentence(reason: UnlockReason | 'wallet_locked'): string {\n const r = entryFor(reason);\n return `Tenjin wallet is still locked: ${r.reason}. ${r.fix}`;\n}\n\n/**\n * `WALLET_REASONS[reason].agentFix` for a wallet reason; `fallback` otherwise.\n * For model-facing text only (B1). Pass it a reason from `details.unlock`\n * (`unlockReasonOf`) or from a verdict, never from `classifyUnlockError`'s\n * `wallet_locked` fallback for an undetailed error, which would swap a\n * non-wallet error's own fix for wallet advice.\n */\nexport function agentFixFor(reason: string, fallback: string): string {\n return Object.prototype.hasOwnProperty.call(WALLET_REASONS, reason)\n ? WALLET_REASONS[reason as keyof typeof WALLET_REASONS].agentFix\n : fallback;\n}\n\n/**\n * An error's fix, as the MODEL reads it in the `request` tool's text (B1). An\n * error carrying `details.unlock` gets its reason's `agentFix`, which asks the\n * person to act and never asks for the passphrase or key; every other error\n * keeps its own fix byte for byte. Gated on `unlockReasonOf`, never on\n * `classifyUnlockError`: that one calls every undetailed error `wallet_locked`,\n * and the request tool carries `REGISTRY_MISMATCH`, HTTP failures and the\n * rest, whose own fixes must survive.\n */\nexport function agentFixOf(err: { fix?: string | undefined }): string {\n const why = unlockReasonOf(err);\n return why === null ? (err.fix ?? '') : agentFixFor(why, err.fix ?? '');\n}\n\n/**\n * The line that clears a wallet notice told earlier in the session, once a\n * paid call succeeds: funded for `wallet_low`, unlocked for any unlock reason\n * or the unclassified fallback, null for anything else (no wallet news).\n */\nexport function walletClearedSentence(previousWhy: string): string | null {\n if (previousWhy === 'wallet_low') return WALLET_FUNDED;\n return WALLET_CLASS.has(previousWhy) ? WALLET_UNLOCKED : null;\n}\n"],"mappings":";;;;;;;;;AAgBO,IAAM,iBACX;AAsBK,IAAM,iBAGT;AAAA,EACF,WAAW;AAAA,IACT,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,UAAU;AAAA,EACZ;AAAA,EACA,gBAAgB;AAAA;AAAA;AAAA;AAAA,IAId,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,UACE;AAAA,EACJ;AAAA,EACA,iBAAiB;AAAA,IACf,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,UACE;AAAA,EACJ;AAAA,EACA,oBAAoB;AAAA,IAClB,QAAQ;AAAA,IACR,KAAK,GAAG,kBAAkB;AAAA,IAC1B,UAAU;AAAA,EACZ;AAAA,EACA,kBAAkB;AAAA,IAChB,QAAQ;AAAA,IACR,KAAK,GAAG,kBAAkB;AAAA,IAC1B,UAAU;AAAA,EACZ;AAAA,EACA,sBAAsB;AAAA,IACpB,QAAQ;AAAA;AAAA;AAAA,IAGR,KAAK,yCAAyC,aAAa;AAAA,IAC3D,UACE;AAAA,EACJ;AAAA,EACA,iBAAiB;AAAA,IACf,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,UACE;AAAA,EACJ;AAAA,EACA,eAAe;AAAA,IACb,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,UAAU;AAAA,EACZ;AACF;AAOO,IAAM,iBAAmD;AAAA,EAC9D,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,oBAAoB;AAAA,EACpB,cAAc;AAAA,EACd,aAAa;AACf;AAIO,IAAM,eAAoC,oBAAI,IAAY;AAAA,EAC/D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGM,IAAM,kBAAkB;AAGxB,IAAM,gBAAgB;AAGtB,IAAM,qBAAqB;AAOlC,SAAS,SAAS,QAAwC;AACxD,SAAO,WAAW,mBAAmB,eAAe,gBAAgB,eAAe,MAAM;AAC3F;AAMO,SAAS,oBAAoB,QAGlC;AACA,QAAM,IAAI,SAAS,MAAM;AACzB,SAAO;AAAA,IACL,eAAe,gDAAgD,EAAE,MAAM,KAAK,EAAE,GAAG;AAAA,IACjF,mBAAmB,gDAAgD,EAAE,MAAM,sEAAsE,EAAE,QAAQ;AAAA,EAC7J;AACF;AAGO,SAAS,oBAAoB,QAAgD;AAClF,QAAM,IAAI,SAAS,MAAM;AACzB,SAAO,kCAAkC,EAAE,MAAM,KAAK,EAAE,GAAG;AAC7D;AASO,SAAS,YAAY,QAAgB,UAA0B;AACpE,SAAO,OAAO,UAAU,eAAe,KAAK,gBAAgB,MAAM,IAC9D,eAAe,MAAqC,EAAE,WACtD;AACN;AAWO,SAAS,WAAW,KAA2C;AACpE,QAAM,MAAM,eAAe,GAAG;AAC9B,SAAO,QAAQ,OAAQ,IAAI,OAAO,KAAM,YAAY,KAAK,IAAI,OAAO,EAAE;AACxE;AAOO,SAAS,sBAAsB,aAAoC;AACxE,MAAI,gBAAgB,aAAc,QAAO;AACzC,SAAO,aAAa,IAAI,WAAW,IAAI,kBAAkB;AAC3D;","names":[]}
|