tenjin-cli 0.1.0-alpha.31 → 0.1.0-alpha.33
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 +45 -26
- package/dist/{_esm-MEXZI5DL.js → _esm-BIN7VY2L.js} +128 -132
- package/dist/{alive-J64H46HI.js → alive-GSOWKUOY.js} +13 -6
- package/dist/auto-update-Y24UL56V.js +24 -0
- package/dist/{ccip-7RMRLAGV.js → ccip-DHDFKTQV.js} +2 -2
- package/dist/{chunk-TTNESUPQ.js → chunk-2GP3HRYK.js} +2120 -193
- package/dist/chunk-2GP3HRYK.js.map +1 -0
- package/dist/chunk-2M2VPI2E.js +560 -0
- package/dist/chunk-2M2VPI2E.js.map +1 -0
- package/dist/{chunk-D65GNPS3.js → chunk-2RWB7RKE.js} +288 -108
- package/dist/chunk-2RWB7RKE.js.map +1 -0
- package/dist/{chunk-AGZ7PJKY.js → chunk-36RVGZNY.js} +22 -5
- package/dist/chunk-36RVGZNY.js.map +1 -0
- package/dist/chunk-3AIHRXKO.js +72 -0
- package/dist/chunk-3AIHRXKO.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-3GNJXKIT.js +198 -0
- package/dist/chunk-3GNJXKIT.js.map +1 -0
- package/dist/{chunk-UQUOVWBG.js → chunk-4K7TQHNP.js} +7 -7
- 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-4YOZGGTZ.js +247 -0
- package/dist/chunk-4YOZGGTZ.js.map +1 -0
- 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-A5GKIG5O.js} +49 -30
- package/dist/chunk-A5GKIG5O.js.map +1 -0
- package/dist/{chunk-YFPY4ONH.js → chunk-AGMVASXZ.js} +4 -4
- package/dist/chunk-BF4XHEQK.js +116 -0
- package/dist/chunk-BF4XHEQK.js.map +1 -0
- package/dist/chunk-BFDQ4WNW.js +119 -0
- package/dist/chunk-BFDQ4WNW.js.map +1 -0
- package/dist/{chunk-P4NH7OUK.js → chunk-C2Q76BVM.js} +49 -50
- package/dist/chunk-C2Q76BVM.js.map +1 -0
- package/dist/chunk-CEXSOI5R.js +808 -0
- package/dist/chunk-CEXSOI5R.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-K72RURN3.js → chunk-FVIGCDSV.js} +2 -2
- package/dist/chunk-FVIGCDSV.js.map +1 -0
- package/dist/{chunk-5K5W4S66.js → chunk-GTTUCOPD.js} +2 -2
- package/dist/{chunk-4ZZO6ULA.js → chunk-HDPUXS3Z.js} +19 -48
- package/dist/chunk-HDPUXS3Z.js.map +1 -0
- package/dist/{chunk-LEFIX6RS.js → chunk-HGGWCP7W.js} +31 -11
- package/dist/chunk-HGGWCP7W.js.map +1 -0
- package/dist/{chunk-ORWL5BSN.js → chunk-HGZEPQUT.js} +2 -2
- package/dist/chunk-HMWYAUA6.js +478 -0
- package/dist/chunk-HMWYAUA6.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-7Q5FDF65.js → chunk-IE7P2BZE.js} +3 -3
- package/dist/{chunk-77TCKDEC.js → chunk-ILNIZ5I2.js} +788 -508
- package/dist/chunk-ILNIZ5I2.js.map +1 -0
- package/dist/{hosts-FWZOV26H.js → chunk-INTFHMU4.js} +79 -24
- package/dist/chunk-INTFHMU4.js.map +1 -0
- package/dist/{chunk-6E5R45ZO.js → chunk-J57UC3DD.js} +4 -4
- package/dist/{chunk-6E5R45ZO.js.map → chunk-J57UC3DD.js.map} +1 -1
- package/dist/chunk-JNJWBTU2.js +3497 -0
- package/dist/chunk-JNJWBTU2.js.map +1 -0
- package/dist/{chunk-7WU4OPLP.js → chunk-KM7RY2ZS.js} +5 -3
- package/dist/{chunk-7WU4OPLP.js.map → chunk-KM7RY2ZS.js.map} +1 -1
- package/dist/chunk-L6JEXB3E.js +293 -0
- package/dist/chunk-L6JEXB3E.js.map +1 -0
- package/dist/chunk-LRW6S53P.js +450 -0
- package/dist/chunk-LRW6S53P.js.map +1 -0
- package/dist/{chunk-UKY4CHNC.js → chunk-LXAYUOXI.js} +24 -11
- package/dist/chunk-LXAYUOXI.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-NDGZDTSJ.js +393 -0
- package/dist/chunk-NDGZDTSJ.js.map +1 -0
- package/dist/{chunk-SJLTEINJ.js → chunk-OJNTCYQQ.js} +17 -1
- package/dist/chunk-OJNTCYQQ.js.map +1 -0
- package/dist/{chunk-OHRR5OYM.js → chunk-P3LFTKE7.js} +5 -10
- package/dist/chunk-P3LFTKE7.js.map +1 -0
- 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-5C32RLTA.js → chunk-RVPYTUP4.js} +20 -5
- package/dist/chunk-RVPYTUP4.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-R5LCN54M.js → chunk-TC2WZLSC.js} +13 -17
- package/dist/{chunk-R5LCN54M.js.map → chunk-TC2WZLSC.js.map} +1 -1
- package/dist/{chunk-B7HUUJOK.js → chunk-TKPF35W6.js} +3 -3
- package/dist/{chunk-KXVP2VKA.js → chunk-U3IKUGRP.js} +32 -33
- package/dist/chunk-U3IKUGRP.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-2XLC3AEX.js → chunk-UXZONNEQ.js} +536 -510
- package/dist/chunk-UXZONNEQ.js.map +1 -0
- package/dist/{chunk-7ZRL2LBQ.js → chunk-V2LQLN5H.js} +6 -6
- package/dist/{chunk-NEFNKLBE.js → chunk-WFSPCCVW.js} +1536 -423
- package/dist/chunk-WFSPCCVW.js.map +1 -0
- package/dist/{chunk-27EPWVOY.js → chunk-WXA2BWTE.js} +7 -3
- package/dist/chunk-WXA2BWTE.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-MNXS2U45.js → chunk-ZDZERB6L.js} +206 -297
- package/dist/chunk-ZDZERB6L.js.map +1 -0
- package/dist/chunk-ZNNXRNFD.js +113 -0
- package/dist/chunk-ZNNXRNFD.js.map +1 -0
- package/dist/{chunk-FW75G2W4.js → chunk-ZURZHELF.js} +5 -5
- package/dist/{cli-D5OE3URZ.js → cli-E36SPKBW.js} +145 -64
- package/dist/{cli-D5OE3URZ.js.map → cli-E36SPKBW.js.map} +1 -1
- package/dist/{codex-event-PPNVRRDH.js → codex-event-ZO2GEFE6.js} +2 -2
- package/dist/{codex-host-2RJOJW2B.js → codex-host-KECJVTA2.js} +7 -6
- package/dist/codex-install-HQZDGFXW.js +436 -0
- package/dist/codex-install-HQZDGFXW.js.map +1 -0
- package/dist/{config-ZD4OB2DO.js → config-HY2E4GGW.js} +21 -17
- package/dist/doctor-I6XQEKWD.js +1323 -0
- package/dist/doctor-I6XQEKWD.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-2QRO7OJL.js} +43 -37
- package/dist/{fund-5ITKQGYF.js.map → fund-2QRO7OJL.js.map} +1 -1
- package/dist/hook-command-2UBCSZG6.js +43 -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/hooks/register.tsx +51 -11
- package/dist/hosts/claude/tenjin/skills/tenjin-pay/SKILL.md +82 -0
- package/dist/hosts/claude/tenjin/types/index.d.ts +2 -1
- package/dist/hosts/codex/tenjin/.mcp.json +3 -0
- package/dist/hosts/codex/tenjin/hooks/hooks.json +51 -5
- package/dist/hosts-DVQJ32QC.js +38 -0
- package/dist/index.js +32 -11
- package/dist/index.js.map +1 -1
- package/dist/install-ILUX5C4A.js +107 -0
- package/dist/{install-identity-K7EJIQFP.js → install-identity-TZKGY6LQ.js} +11 -10
- package/dist/install-wallet-5M4OTYLX.js +281 -0
- package/dist/install-wallet-5M4OTYLX.js.map +1 -0
- package/dist/isows-native-Q2UDIVPT.js +9 -0
- package/dist/isows-native-Q2UDIVPT.js.map +1 -0
- package/dist/{mcp-3LIJSSJB.js → mcp-LE4DUS22.js} +785 -211
- package/dist/mcp-LE4DUS22.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-IJFGMWEV.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-WCG3IH4R.js} +29 -29
- package/dist/{payments-KVICEKD2.js → payments-HFPPWHTV.js} +15 -14
- package/dist/{payments-KVICEKD2.js.map → payments-HFPPWHTV.js.map} +1 -1
- package/dist/plugin-registration-PZFI5GZW.js +68 -0
- package/dist/{redact-6W23GGJC.js → redact-D7ASVWKL.js} +2 -2
- package/dist/runtime-UZOKSUZX.js +1321 -0
- package/dist/runtime-UZOKSUZX.js.map +1 -0
- package/dist/runtime-fetch-ZSSSK72Y.js +23 -0
- package/dist/runtime-layout-WIDILZ6K.js +25 -0
- package/dist/{send-7G7Y7DLN.js → send-GCVEAQKL.js} +24 -22
- package/dist/{send-7G7Y7DLN.js.map → send-GCVEAQKL.js.map} +1 -1
- package/dist/{status-OF7RH5HM.js → status-HCVAOCN7.js} +55 -25
- package/dist/status-HCVAOCN7.js.map +1 -0
- package/dist/{status-line-XOUE6MPL.js → status-line-OPCXDHL2.js} +10 -9
- package/dist/{status-line-XOUE6MPL.js.map → status-line-OPCXDHL2.js.map} +1 -1
- package/dist/uninstall-BAWRBXXQ.js +481 -0
- package/dist/uninstall-BAWRBXXQ.js.map +1 -0
- package/dist/update-CACXLQLR.js +56 -0
- package/dist/update-CACXLQLR.js.map +1 -0
- package/dist/{usdc-OGOGEHV2.js → usdc-VG4CIOUK.js} +6 -8
- package/dist/usdc-VG4CIOUK.js.map +1 -0
- package/dist/{viemAdapter-By13KInL-S3DA7DFW.js → viemAdapter-By13KInL-DOFTEIJV.js} +3 -3
- package/dist/viemAdapter-By13KInL-DOFTEIJV.js.map +1 -0
- package/dist/wallet-QL4UUXEZ.js +55 -0
- package/dist/wallet-QL4UUXEZ.js.map +1 -0
- package/dist/wallet-kdf-worker.mjs +8 -8
- package/docs/agent-permissions.md +50 -28
- package/docs/safety-model.md +1 -1
- package/docs/troubleshooting.md +72 -1
- package/package.json +17 -4
- package/scripts/installers/install.ps1 +67 -0
- package/scripts/installers/install.sh +68 -0
- package/dist/_esm-C5CRWCYU.js +0 -3737
- package/dist/_esm-C5CRWCYU.js.map +0 -1
- package/dist/ccip-NLCSCHKI.js +0 -19
- package/dist/chunk-27EPWVOY.js.map +0 -1
- 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-K72RURN3.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-P4NH7OUK.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-XWGE4Q7L.js +0 -77
- 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-BIN7VY2L.js.map} +0 -0
- /package/dist/{alive-J64H46HI.js.map → alive-GSOWKUOY.js.map} +0 -0
- /package/dist/{ccip-7RMRLAGV.js.map → auto-update-Y24UL56V.js.map} +0 -0
- /package/dist/{ccip-NLCSCHKI.js.map → ccip-DHDFKTQV.js.map} +0 -0
- /package/dist/{chunk-UQUOVWBG.js.map → chunk-4K7TQHNP.js.map} +0 -0
- /package/dist/{chunk-KXQ4UIP7.js.map → chunk-4USCZ2NI.js.map} +0 -0
- /package/dist/{chunk-YFPY4ONH.js.map → chunk-AGMVASXZ.js.map} +0 -0
- /package/dist/{chunk-5K5W4S66.js.map → chunk-GTTUCOPD.js.map} +0 -0
- /package/dist/{chunk-ORWL5BSN.js.map → chunk-HGZEPQUT.js.map} +0 -0
- /package/dist/{chunk-7Q5FDF65.js.map → chunk-IE7P2BZE.js.map} +0 -0
- /package/dist/{chunk-WK7F3B2E.js.map → chunk-SO3XRZPX.js.map} +0 -0
- /package/dist/{chunk-B7HUUJOK.js.map → chunk-TKPF35W6.js.map} +0 -0
- /package/dist/{chunk-7ZRL2LBQ.js.map → chunk-V2LQLN5H.js.map} +0 -0
- /package/dist/{chunk-FW75G2W4.js.map → chunk-ZURZHELF.js.map} +0 -0
- /package/dist/{codex-event-PPNVRRDH.js.map → codex-event-ZO2GEFE6.js.map} +0 -0
- /package/dist/{codex-host-2RJOJW2B.js.map → codex-host-KECJVTA2.js.map} +0 -0
- /package/dist/{config-ZD4OB2DO.js.map → config-HY2E4GGW.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-2UBCSZG6.js.map} +0 -0
- /package/dist/{install-XWGE4Q7L.js.map → hosts-DVQJ32QC.js.map} +0 -0
- /package/dist/{install-identity-K7EJIQFP.js.map → install-ILUX5C4A.js.map} +0 -0
- /package/dist/{package-ZKQFDWLE.js.map → install-identity-TZKGY6LQ.js.map} +0 -0
- /package/dist/{paths-POPTXJO6.js.map → package-IJFGMWEV.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-WCG3IH4R.js.map} +0 -0
- /package/dist/{update-ZKUERSO2.js.map → plugin-registration-PZFI5GZW.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-ZSSSK72Y.js.map} +0 -0
- /package/dist/{wallet-2HA6W4R4.js.map → runtime-layout-WIDILZ6K.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/router/uninstall.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { realpath, stat } from 'node:fs/promises';\nimport { homedir } from 'node:os';\nimport { isAbsolute, resolve, sep } from 'node:path';\nimport { persistRouterProject } from '../commands/config';\nimport type { CommandContext, CommandResult } from '../context';\nimport { loadRawConfig } from '../lib/config';\nimport { CliError } from '../lib/errors';\nimport { defaultDataDir, runtimeDir } from '../lib/paths';\nimport { runtimeStatePath } from '../lib/runtime-layout';\nimport { readWalletFacts } from '../lib/wallet-facts';\nimport { removeAliveState } from './alive';\nimport { findClaudeBinary, jsonList, jsonResult, runClaude, type ClaudeBinary } from './claude-cli';\nimport { projectInstallAt, settingsInstallPaths } from './install';\nimport { inspectLegacyInstall, removeLegacyInstall, type LegacyRemoval } from './legacy-install';\nimport { MARKETPLACE_NAME, PLUGIN_ID } from './names';\nimport { removePluginFolder, type FolderRemoval } from './plugin-folder';\nimport {\n folderFor,\n folderState,\n ownMarketplace,\n recordedInstalls,\n type InstallRecord,\n} from './plugin-registration';\n\n/**\n * `tenjin uninstall`: take out the install for where you are, and the shared\n * parts once no install is left anywhere.\n *\n * WHICH INSTALL. Claude Code records every `tenjin@tenjin` install, in any\n * scope or project, in its own `installed_plugins.json`; `install.routerProjects`\n * adds the projects `install --project` wired. A bare run takes the project\n * install whose folder is the cwd or the nearest one above it, else the user\n * install; `--project <path>` takes that project's, and `--all` every one. Each\n * goes through `claude plugin uninstall` run in exactly its own folder, the\n * only cwd Claude Code accepts for a local install.\n *\n * ALL OR NOTHING FOR THE SHARED PARTS. The marketplace (and, through `finish`\n * in `hosts.ts`, Tenjin's runtime and its launcher) go only when no install is\n * left anywhere and every removal this run asked for succeeded. A removal that\n * fails refuses, naming what was removed and what is left; so does a\n * marketplace Claude Code would not remove, which keeps the runtime its folder\n * lives in, and the launcher that retries.\n *\n * THE WALLET AND `spend.json` STAY. Removing an integration is not a reason to\n * destroy a key that holds funds or a ledger that records what was spent; both\n * are the user's, and the receipt says where they are.\n */\n\nexport type UninstallTarget =\n { kind: 'all' } | { kind: 'user' } | { kind: 'project'; path: string };\n\nexport interface RouterUninstallDeps {\n homeDir?: string;\n cwd?: string;\n env?: NodeJS.ProcessEnv;\n findClaude?: (env: NodeJS.ProcessEnv) => ClaudeBinary | null;\n /** Runs one `claude` command; tests inject one that records its cwd. */\n runClaude?: typeof runClaude;\n}\n\n/** One install this run went after, and what became of it. */\nexport interface Removal {\n scope: InstallRecord['scope'];\n projectPath: string | null;\n /** `skipped`: the project folder is gone, so `claude` cannot be run there. */\n state: 'removed' | 'absent' | 'skipped' | 'failed';\n reason?: string;\n}\n\n/** `remaining`'s name for the user install; a project is its folder. */\nconst USER = 'user';\n\nconst real = (path: string): Promise<string> => realpath(path).catch(() => resolve(path));\nconst isDir = async (path: string): Promise<boolean> =>\n (await stat(path).catch(() => null))?.isDirectory() === true;\n\n/** Is `dir` the folder `parent`, or inside it? */\nfunction within(dir: string, parent: string): boolean {\n return dir === parent || dir.startsWith(parent.endsWith(sep) ? parent : `${parent}${sep}`);\n}\n\nfunction uncheckable(): CliError {\n return new CliError('REFUSED', \"Tenjin's plugin could not be checked, so nothing was removed\", {\n fix: `Run \\`tenjin uninstall\\` from a terminal where \\`claude\\` runs, or type /plugin uninstall ${PLUGIN_ID} in Claude Code.`,\n });\n}\n\n/**\n * EVERY INSTALL ON THIS MACHINE: Claude Code's record, plus each project in\n * `install.routerProjects` that still holds an install of ours, by realpath.\n * A project only that list names, and that holds nothing any more, is stale\n * and does not keep the shared parts. Throws when Claude Code's record is\n * there and cannot be read: what it holds is unknown, so nothing may go.\n * `recorded` counts the installs Claude Code itself records: only those need\n * `claude` to remove; a project only the list names is a folder install.\n */\nasync function installRecords(\n dataDir: string,\n env: NodeJS.ProcessEnv,\n home: string,\n): Promise<InstallRecord[] & { recorded: number }> {\n const claude = await recordedInstalls(env, home);\n if (claude === null) throw uncheckable();\n const listed = (await loadRawConfig(dataDir).catch(() => null))?.install?.routerProjects ?? [];\n const records: InstallRecord[] = [];\n const seen = new Set<string>();\n for (const r of claude) {\n const key = r.projectPath === null ? USER : await real(r.projectPath);\n if (seen.has(key)) continue;\n seen.add(key);\n records.push(r.projectPath === null ? r : { scope: 'local', projectPath: key });\n }\n const recorded = records.length;\n for (const dir of listed) {\n const key = await real(dir);\n if (seen.has(key) || !(await projectInstallAt(key, home, env))) continue;\n seen.add(key);\n records.push({ scope: 'local', projectPath: key });\n }\n return Object.assign(records, { recorded });\n}\n\n/**\n * The project install for `dir`: the record whose folder is `dir` or the\n * nearest one above it. One at home counts only from home itself, or every\n * folder under home would read as inside that project.\n */\nasync function nearestProject(\n records: InstallRecord[],\n dir: string,\n home: string,\n): Promise<(InstallRecord & { projectPath: string }) | undefined> {\n const homeReal = await real(home);\n return records\n .filter(\n (r): r is InstallRecord & { projectPath: string } =>\n r.projectPath !== null &&\n within(dir, r.projectPath) &&\n (r.projectPath !== homeReal || dir === homeReal),\n )\n .sort((a, b) => b.projectPath.length - a.projectPath.length)[0];\n}\n\n/**\n * Which install a run removes, decided before the hosts are picked: `--all`,\n * the project `--project` names (this folder's when it names none), or for a\n * bare run the project install here, else the user install.\n */\nexport async function resolveUninstallTarget(\n o: { all?: boolean; project?: string | true },\n ctx: CommandContext,\n deps: RouterUninstallDeps = {},\n): Promise<UninstallTarget> {\n if (o.all === true) return { kind: 'all' };\n const env = deps.env ?? process.env;\n const home = deps.homeDir ?? homedir();\n const cwd = deps.cwd ?? process.cwd();\n const records = await installRecords(ctx.dataDir, env, home);\n if (o.project !== undefined) {\n const dir = await real(o.project === true ? cwd : resolve(cwd, o.project));\n return {\n kind: 'project',\n path: (await nearestProject(records, dir, home))?.projectPath ?? dir,\n };\n }\n const here = await nearestProject(records, await real(cwd), home);\n return here !== undefined ? { kind: 'project', path: here.projectPath } : { kind: 'user' };\n}\n\nexport async function runRouterUninstall(\n o: { target: UninstallTarget },\n ctx: CommandContext,\n deps: RouterUninstallDeps = {},\n): Promise<CommandResult> {\n const env = deps.env ?? process.env;\n const home = deps.homeDir ?? homedir();\n if (!isAbsolute(home)) throw new Error('The home directory is not an absolute path.');\n const cwd = deps.cwd ?? process.cwd();\n const binary = (deps.findClaude ?? findClaudeBinary)(env);\n const run = (args: string[], at: string) =>\n (deps.runClaude ?? runClaude)(binary!, args, { env, cwd: at });\n\n const records = await installRecords(ctx.dataDir, env, home);\n // Only what Claude Code records needs `claude` to remove. A project only\n // `routerProjects` names is the folder a run with no `claude` wrote: it is\n // `absent` below, and its folder goes in cleanUp.\n if (binary === null && records.recorded > 0) throw uncheckable();\n const { target } = o;\n let targets = records.filter((r) =>\n target.kind === 'all'\n ? true\n : target.kind === 'user'\n ? r.projectPath === null\n : r.projectPath === target.path,\n );\n // A USER INSTALL CLAUDE CODE DOES NOT RECORD (the folder a run with no\n // `claude` wrote, which starts the runtime's own Node and entry) is one\n // `--all` removes too, and one any other run leaves in use.\n const userUnrecorded =\n !records.some((r) => r.projectPath === null) &&\n (await leftHere({ scope: 'user', projectPath: null }, env, home));\n if (target.kind === 'all' && userUnrecorded && targets.length > 0) {\n targets = [{ scope: 'user', projectPath: null }, ...targets];\n }\n const others = records.filter((r) => !targets.includes(r));\n if (targets.length === 0) {\n // NOTHING CLAUDE CODE RECORDS FOR THE TARGET. A folder or settings install\n // of ours is still one; with other installs left and neither, there is\n // nothing here to remove. With nothing left anywhere, the run goes on, so\n // a marketplace or runtime that outlived its plugin is cleared.\n const fallback: InstallRecord =\n target.kind === 'project'\n ? { scope: 'local', projectPath: target.path }\n : { scope: 'user', projectPath: null };\n const live = await liveOthers(others);\n if (live.length > 0 && !(await leftHere(fallback, env, home))) {\n return nothingHere(target, await real(cwd), live.map(labelOf), ctx.dataDir, env, home);\n }\n targets = [fallback];\n }\n\n const removals: Removal[] = [];\n for (const r of targets) {\n if (r.projectPath !== null && !(await isDir(r.projectPath))) {\n removals.push({ ...r, state: 'skipped', reason: `${r.projectPath} no longer exists` });\n continue;\n }\n // No binary and no record: Claude Code holds no install to remove.\n if (binary === null) {\n removals.push({ ...r, state: 'absent' });\n continue;\n }\n const out = await run(\n ['plugin', 'uninstall', PLUGIN_ID, '--scope', r.scope, '--json'],\n r.projectPath ?? home,\n );\n const result = jsonResult(out.stdout);\n if (out.code === 0) removals.push({ ...r, state: 'removed' });\n else if (result?.failureCode === 'not_installed') removals.push({ ...r, state: 'absent' });\n else {\n const message =\n typeof result?.message === 'string' ? result.message : out.stderr.trim().slice(0, 200);\n removals.push({ ...r, state: 'failed', reason: `claude plugin uninstall: ${message}` });\n }\n }\n\n // WHAT CLAUDE CODE STILL RECORDS decides, not the exit codes alone.\n const after = (await recordedInstalls(env, home)) ?? [];\n const afterKeys = new Set(\n await Promise.all(after.map((r) => (r.projectPath === null ? USER : real(r.projectPath)))),\n );\n const left = removals.filter(\n (r) =>\n r.state === 'failed' ||\n (r.state !== 'skipped' && afterKeys.has(r.projectPath === null ? USER : r.projectPath)),\n );\n const gone = removals.filter((r) => !left.includes(r) && r.state !== 'skipped');\n const userKept = userUnrecorded && !targets.some((r) => r.projectPath === null);\n const remaining =\n left.length > 0 ? [] : [...(userKept ? [USER] : []), ...(await liveOthers(others)).map(keyOf)];\n\n // THE INSTALLS THAT WENT leave their plugin folders and settings installs\n // too, and are forgotten, so a later `tenjin update` does not go looking for\n // a project this machine no longer wires. Done before a refusal as well.\n const folders: FolderRemoval[] = [];\n const settings: { path: string; found: boolean; removed: LegacyRemoval | null }[] = [];\n const cleanUp = async (): Promise<void> => {\n for (const r of gone) {\n const at = r.projectPath ?? home;\n folders.push(await removePluginFolder(folderFor(r.scope, env, home, at)));\n const paths = settingsInstallPaths(r.projectPath !== null, env, home, at);\n const legacy = await inspectLegacyInstall(paths.settingsPath, paths.mcpFile);\n settings.push({\n path: paths.settingsPath,\n found: legacy.present,\n removed: legacy.present\n ? await removeLegacyInstall(legacy, { binary, env, cwd: at, mcpScope: paths.mcpScope })\n : null,\n });\n }\n for (const r of removals) {\n if (r.projectPath !== null && !left.includes(r)) {\n await persistRouterProject(ctx.dataDir, r.projectPath, false).catch(() => undefined);\n }\n }\n };\n\n const named = (list: Removal[]) => list.map(labelOf).join(', ') || 'nothing';\n if (left.length > 0) {\n await cleanUp();\n throw new CliError(\n 'REFUSED',\n `${left.length} Tenjin install${left.length === 1 ? '' : 's'} could not be removed: ${left.map((r) => `${labelOf(r)}${r.reason !== undefined ? ` (${r.reason})` : ''}`).join(', ')}. Removed: ${named(gone)}. Kept ${sharedParts(ctx.dataDir, home)}.`,\n {\n details: { removed: gone.map(keyOf), left: left.map(keyOf), removals },\n fix: retryFix(target, left),\n },\n );\n }\n\n let marketplace: 'removed' | 'absent' | 'kept' = 'kept';\n let marketplaceWhy: string | undefined;\n if (remaining.length > 0) {\n marketplaceWhy = `Kept ${sharedParts(ctx.dataDir, home)}: still used by ${remaining.map(nameOf).join(', ')}.`;\n } else if (binary === null) {\n marketplaceWhy = `the ${MARKETPLACE_NAME} marketplace was not checked: no claude binary on PATH or in CLAUDE_CODE_EXECPATH`;\n } else {\n // THE MARKETPLACE GOES ONLY WHEN IT IS THE ONE `install` ADDED, and\n // unscoped from home: that clears every scope's record of it.\n const listing = await run(['plugin', 'marketplace', 'list', '--json'], home);\n const listed = jsonList(listing.stdout);\n if (listed === null) {\n // A LIST THAT DID NOT ANSWER IS NOT AN ABSENT MARKETPLACE: it may still be\n // registered on the runtime's folder, so the shared parts stay with it.\n await cleanUp();\n const again = againCommand(target);\n throw new CliError(\n 'REFUSED',\n `The ${MARKETPLACE_NAME} marketplace could not be checked (claude plugin marketplace list${listing.stderr.trim() !== '' ? `: ${listing.stderr.trim().slice(0, 200)}` : ''}). Removed: ${named(gone)}. Kept ${sharedParts(ctx.dataDir, home)}.`,\n {\n details: {\n removed: gone.map(keyOf),\n left: [`${MARKETPLACE_NAME} marketplace`],\n removals,\n },\n fix: `Run \\`${again}\\` again.`,\n },\n );\n }\n const row = listed.find((m) => m.name === MARKETPLACE_NAME);\n if (row === undefined) marketplace = 'absent';\n else if (!(await ownMarketplace(row))) {\n marketplaceWhy = `kept the ${MARKETPLACE_NAME} marketplace: it is not one \\`tenjin install\\` added`;\n } else {\n const removed = await run(\n ['plugin', 'marketplace', 'remove', MARKETPLACE_NAME, '--json'],\n home,\n );\n if (removed.code !== 0) {\n // A MARKETPLACE STILL REGISTERED KEEPS ITS FOLDER: it is the runtime's\n // `claude` folder, so the runtime and the launcher a retry runs must\n // stay with it. A refusal keeps `uninstallEach` from removing them.\n await cleanUp();\n const result = jsonResult(removed.stdout);\n const why =\n typeof result?.message === 'string'\n ? result.message\n : removed.stderr.trim().slice(0, 200);\n const again = againCommand(target);\n throw new CliError(\n 'REFUSED',\n `The ${MARKETPLACE_NAME} marketplace could not be removed (claude plugin marketplace remove${why !== '' ? `: ${why}` : ''}). Removed: ${named(gone)}. Kept ${sharedParts(ctx.dataDir, home)}.`,\n {\n details: {\n removed: gone.map(keyOf),\n left: [`${MARKETPLACE_NAME} marketplace`],\n removals,\n },\n fix: `Run \\`${again}\\` again; if it still fails, run \\`claude plugin marketplace remove ${MARKETPLACE_NAME}\\`, then \\`${again}\\`.`,\n },\n );\n }\n marketplace = 'removed';\n }\n }\n await cleanUp();\n const aliveRemoved = remaining.length === 0 ? await removeAliveState(ctx.dataDir) : false;\n const kept = await keptBlock(ctx.dataDir, env, home);\n\n const data = {\n target,\n removals,\n remaining,\n marketplace,\n ...(remaining.length > 0 ? { marketplaceKeptFor: remaining } : {}),\n folders,\n settings,\n aliveRemoved,\n kept: kept.data,\n };\n const lines = [\n ...removals.map(removalLine),\n ...(marketplace === 'removed' ? [`removed the ${MARKETPLACE_NAME} marketplace`] : []),\n ...(marketplaceWhy !== undefined ? [marketplaceWhy] : []),\n ...folders.flatMap(folderLines),\n ...settings.flatMap((s) => settingsLines(s.path, s.removed)),\n ...kept.lines,\n ];\n return { data, humanLines: lines };\n}\n\n/**\n * The way back after a removal that failed: this run's own target again (a\n * bare run here finds the same install; from elsewhere it would not), then\n * Claude Code's own command, in each project's folder where one is left.\n */\nfunction retryFix(target: UninstallTarget, left: Removal[]): string {\n const again = againCommand(target);\n const projects = left.flatMap((r) => (r.projectPath !== null ? [r.projectPath] : []));\n const where =\n projects.length === 0\n ? 'a Claude Code session'\n : `a Claude Code session started in ${projects.join(', ')}${projects.length < left.length ? ' (any session for your user install)' : ''}`;\n return `Run \\`${again}\\` again; if it still fails, type /plugin uninstall ${PLUGIN_ID} in ${where}.`;\n}\n\n/** This run's own target as a command: a bare run here finds the same install; from elsewhere it would not. */\nfunction againCommand(target: UninstallTarget): string {\n return target.kind === 'all'\n ? 'tenjin uninstall --all'\n : target.kind === 'project'\n ? `tenjin uninstall --project ${shellWord(target.path)}`\n : 'tenjin uninstall';\n}\n\n/** `path` as one shell word: quoted only when it needs to be. */\nfunction shellWord(path: string): string {\n return /^[\\w@%+=:,./~-]+$/.test(path) ? path : `'${path.replace(/'/g, \"'\\\\''\")}'`;\n}\n\n/** The other installs that can still be used: the user's, and projects still on disk. */\nasync function liveOthers(others: InstallRecord[]): Promise<InstallRecord[]> {\n const live: InstallRecord[] = [];\n for (const r of others) if (r.projectPath === null || (await isDir(r.projectPath))) live.push(r);\n return live;\n}\n\n/** An install of ours Claude Code does not record: a plugin folder, or a settings install. */\nasync function leftHere(r: InstallRecord, env: NodeJS.ProcessEnv, home: string): Promise<boolean> {\n if (r.projectPath !== null) return projectInstallAt(r.projectPath, home, env);\n if ((await folderState('user', env, home, home)).state === 'ours') return true;\n const paths = settingsInstallPaths(false, env, home, home);\n return (await inspectLegacyInstall(paths.settingsPath, paths.mcpFile)).present;\n}\n\nconst keyOf = (r: Pick<InstallRecord, 'projectPath'>): string => r.projectPath ?? USER;\nconst nameOf = (key: string): string => (key === USER ? 'your user install' : key);\nconst labelOf = (r: Pick<InstallRecord, 'projectPath'>): string => nameOf(keyOf(r));\n\n/**\n * Does Claude Code hold any Tenjin install still, in any scope or project?\n * Asked by an uninstall Claude Code was not part of (Codex removed last), so\n * the runtime goes only once nothing at all can use it. A record that cannot\n * be read counts as one.\n */\nexport async function claudeInstallsLeft(\n ctx: CommandContext,\n deps: RouterUninstallDeps = {},\n): Promise<boolean> {\n const env = deps.env ?? process.env;\n const home = deps.homeDir ?? homedir();\n try {\n const records = await installRecords(ctx.dataDir, env, home);\n if ((await liveOthers(records)).length > 0) return true;\n return await leftHere({ scope: 'user', projectPath: null }, env, home);\n } catch {\n return true;\n }\n}\n\n/** The line for a runtime kept because another recorded host still runs it; none where there is no runtime. */\nexport function runtimeKeptFor(dataDir: string, home: string, users: string[]): string | null {\n if (!hasRuntime(dataDir, home)) return null;\n return `Kept Tenjin's runtime and its launcher: still used by ${users.join(', ')}.`;\n}\n\n/** The parts every install shares, as the \"kept\" lines name them: the runtime only where there is one. */\nfunction sharedParts(dataDir: string, home: string): string {\n return hasRuntime(dataDir, home)\n ? `the ${MARKETPLACE_NAME} marketplace, Tenjin's runtime and its launcher`\n : `the ${MARKETPLACE_NAME} marketplace`;\n}\n\n/**\n * Is there a runtime to keep? Only the default data dir has one, and only once\n * an install set it up: a platform Tenjin pins no Node for, or an install that\n * fell back, has none.\n */\nfunction hasRuntime(dataDir: string, home: string): boolean {\n return isDefaultDataDir(dataDir, home) && existsSync(runtimeStatePath(runtimeDir(dataDir)));\n}\n\nfunction isDefaultDataDir(dataDir: string, home: string): boolean {\n return resolve(dataDir) === resolve(defaultDataDir(home));\n}\n\nasync function nothingHere(\n target: UninstallTarget,\n cwd: string,\n installed: string[],\n dataDir: string,\n env: NodeJS.ProcessEnv,\n home: string,\n): Promise<CommandResult> {\n const whose =\n target.kind !== 'project'\n ? 'your user'\n : target.path === cwd\n ? \"this folder's project\"\n : target.path;\n const kept = await keptBlock(dataDir, env, home);\n return {\n data: {\n target,\n removals: [],\n remaining: installed,\n marketplace: 'kept',\n marketplaceKeptFor: installed,\n folders: [],\n settings: [],\n aliveRemoved: false,\n kept: kept.data,\n },\n humanLines: [\n `No Tenjin install for ${whose}, so nothing was removed. Still installed: ${installed.join(', ')}. Run \\`tenjin uninstall --project <path>\\` for one of them, or \\`tenjin uninstall --all\\`.`,\n ],\n };\n}\n\nfunction removalLine(r: Removal): string {\n const which = r.projectPath === null ? 'your user install' : `the install for ${r.projectPath}`;\n switch (r.state) {\n case 'removed':\n return `removed the ${PLUGIN_ID} plugin (${which})`;\n case 'absent':\n return `plugin: ${PLUGIN_ID} was not installed (${which})`;\n case 'skipped':\n return `skipped ${which}: ${r.reason ?? 'its folder no longer exists'}`;\n case 'failed':\n return `plugin: ${r.reason ?? 'left in place'} (${which})`;\n }\n}\n\nfunction folderLines(folder: FolderRemoval): string[] {\n if (folder.removed) {\n return [\n folder.left.length === 0\n ? `removed the plugin folder ${folder.path}`\n : `removed the plugin's files from ${folder.path}; kept what is not Tenjin's: ${folder.left.join(', ')}`,\n ];\n }\n return folder.reason !== undefined ? [`folder: ${folder.reason}`] : [];\n}\n\nfunction settingsLines(settingsPath: string, settings: LegacyRemoval | null): string[] {\n if (settings === null) return [];\n const lines: string[] = [];\n const parts = [\n ...(settings.events.length > 0 ? [`hook entries (${settings.events.join(', ')})`] : []),\n ...(settings.allowRule || settings.denyRule ? ['the permission rules'] : []),\n ...(settings.statusLine !== 'kept' ? ['the status line'] : []),\n ...(settings.mcp === 'removed' ? ['the x402 MCP server'] : []),\n ];\n if (parts.length > 0) {\n lines.push(`removed the settings install's ${parts.join(', ')} from ${settingsPath}`);\n }\n lines.push(...settings.warnings.map((w) => `settings: ${w}`));\n return lines;\n}\n\n/** `path` with the home folder written as `~`. */\nfunction tilde(path: string, home: string): string {\n return path === home || path.startsWith(`${home}${sep}`) ? `~${path.slice(home.length)}` : path;\n}\n\n/**\n * WHAT STAYS, said last: the data dir with the wallet (named, since it may\n * hold funds), and where its passphrase is kept. Read through the hook-safe\n * facts: nothing is unlocked to name them.\n */\nasync function keptBlock(\n dataDir: string,\n env: NodeJS.ProcessEnv,\n home: string,\n): Promise<{\n data: { dataDir: string; wallet: string | null; passphraseStore: string | null };\n lines: string[];\n}> {\n const facts = await readWalletFacts(dataDir, env);\n const wallet = facts.address;\n let store: string | null = null;\n if (wallet !== null && facts.passphraseStore !== null) {\n const { describeStoreLocation } = await import('../lib/wallet/passphrase');\n store = describeStoreLocation(facts.passphraseStore, wallet.toLowerCase(), dataDir);\n }\n const lines = [\n wallet !== null\n ? `Kept ${tilde(dataDir, home)}: your wallet ${wallet} (it may hold funds; move them with \\`tenjin wallet send\\` before you delete it), the spend ledger and the config.`\n : `Kept ${tilde(dataDir, home)}: the spend ledger and the config.`,\n ...(store !== null ? [`The wallet passphrase stays in ${store}.`] : []),\n ...(facts.envPassphraseSet\n ? [\n 'TENJIN_WALLET_PASSPHRASE is set in this shell; remove its export line from your shell startup file if you added one.',\n ]\n : []),\n ];\n return { data: { dataDir, wallet, passphraseStore: store }, lines };\n}\n\nexport interface RuntimeRemovalDeps {\n platform?: NodeJS.Platform;\n /** Tests inject these; the defaults are `runtime.ts`'s own. */\n removeLaunchers?: (\n home: string,\n platform?: NodeJS.Platform,\n ) => Promise<{ removed: string[]; left: string[] }>;\n removeRuntime?: (root: string) => Promise<{ removed: boolean; left: string[] }>;\n}\n\n/**\n * UNINSTALL'S LAST STEP, run by `hosts.uninstallEach` only once no install is\n * left anywhere: the launchers, then Tenjin's runtime. Nothing under a\n * non-default data dir, whose installs never had either.\n *\n * NOTHING IS IMPORTED AFTER THE REMOVAL. When this build runs from the\n * runtime, its own files are gone once it returns, so `runtime.ts` is loaded\n * first and every line after is plain string work. On Windows a running\n * `node.exe` keeps its folder; it is named, to delete once this exits.\n */\nexport async function removeRuntimeAndLaunchers(\n dataDir: string,\n home: string,\n deps: RuntimeRemovalDeps = {},\n): Promise<CommandResult> {\n if (!isDefaultDataDir(dataDir, home)) {\n return { data: { runtime: null, launcher: null }, humanLines: [] };\n }\n const lib =\n deps.removeLaunchers !== undefined && deps.removeRuntime !== undefined\n ? null\n : await import('../lib/runtime');\n const removeLaunchers = deps.removeLaunchers ?? lib!.removeLaunchers;\n const removeRuntime = deps.removeRuntime ?? lib!.removeRuntime;\n const root = runtimeDir(dataDir);\n const launcher = await removeLaunchers(home, deps.platform ?? process.platform).catch(() => ({\n removed: [] as string[],\n left: [] as string[],\n }));\n const runtime = await removeRuntime(root).then(\n (r) => ({ ...r, error: null as string | null }),\n (err: unknown) => ({\n removed: false,\n left: [] as string[],\n error: err instanceof Error ? err.message : String(err),\n }),\n );\n const lines = [\n ...launcher.removed.map((p) => `removed the launcher ${tilde(p, home)}`),\n ...launcher.left.map((p) => `left ${tilde(p, home)}: it is not a launcher Tenjin wrote`),\n ];\n if (runtime.error !== null) {\n lines.push(`kept Tenjin's runtime ${tilde(root, home)}: ${runtime.error}`);\n } else if (runtime.removed || runtime.left.length > 0) {\n lines.push(\n runtime.left.length === 0\n ? `removed Tenjin's runtime ${tilde(root, home)}`\n : `removed Tenjin's runtime ${tilde(root, home)}, except what is still running:`,\n ...runtime.left.map((p) => ` delete ${p} after this exits`),\n 'To remove the CLI too, run `npm uninstall -g tenjin-cli` now: always after `tenjin uninstall`, never before.',\n );\n }\n return {\n data: {\n runtime: { root, removed: runtime.removed, left: runtime.left },\n launcher: { removed: launcher.removed, left: launcher.left },\n },\n humanLines: lines,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,kBAAkB;AAC3B,SAAS,UAAU,YAAY;AAC/B,SAAS,eAAe;AACxB,SAAS,YAAY,SAAS,WAAW;AAoEzC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MAAM,IAAI,CAAC;AAAA,MACjD,GAAG,QAAQ,KAAK,IAAI,CAAC,MAAM,YAAY,CAAC,mBAAmB;AAAA,MAC3D;AAAA,IACF;AAAA,EACF;AACA,SAAO;AAAA,IACL,MAAM;AAAA,MACJ,SAAS,EAAE,MAAM,SAAS,QAAQ,SAAS,MAAM,QAAQ,KAAK;AAAA,MAC9D,UAAU,EAAE,SAAS,SAAS,SAAS,MAAM,SAAS,KAAK;AAAA,IAC7D;AAAA,IACA,YAAY;AAAA,EACd;AACF;","names":[]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
BACKGROUND_COOLDOWN_MS,
|
|
4
|
+
runUpdate,
|
|
5
|
+
spawnCapture,
|
|
6
|
+
versionFreeEntry
|
|
7
|
+
} from "./chunk-ILNIZ5I2.js";
|
|
8
|
+
import "./chunk-U3IKUGRP.js";
|
|
9
|
+
import "./chunk-KOGZDMHO.js";
|
|
10
|
+
import "./chunk-LXAYUOXI.js";
|
|
11
|
+
import "./chunk-3GNJXKIT.js";
|
|
12
|
+
import "./chunk-A5GKIG5O.js";
|
|
13
|
+
import "./chunk-4LMUQMBH.js";
|
|
14
|
+
import "./chunk-3623BLPV.js";
|
|
15
|
+
import "./chunk-XKESD27X.js";
|
|
16
|
+
import "./chunk-FVIGCDSV.js";
|
|
17
|
+
import "./chunk-HDPUXS3Z.js";
|
|
18
|
+
import "./chunk-2SNUOHAT.js";
|
|
19
|
+
import "./chunk-E7SW44LM.js";
|
|
20
|
+
import "./chunk-F3ED5WTR.js";
|
|
21
|
+
import "./chunk-DOQGNFHM.js";
|
|
22
|
+
import "./chunk-L6JEXB3E.js";
|
|
23
|
+
import "./chunk-LRW6S53P.js";
|
|
24
|
+
import "./chunk-MEFB5KHA.js";
|
|
25
|
+
import "./chunk-UUGOUOVT.js";
|
|
26
|
+
import "./chunk-MPZUYCAP.js";
|
|
27
|
+
import "./chunk-4YOZGGTZ.js";
|
|
28
|
+
import "./chunk-3FMZGI7I.js";
|
|
29
|
+
import "./chunk-36RVGZNY.js";
|
|
30
|
+
import "./chunk-QXP3Z3JN.js";
|
|
31
|
+
import "./chunk-RVPYTUP4.js";
|
|
32
|
+
import "./chunk-AGMVASXZ.js";
|
|
33
|
+
import "./chunk-KM7RY2ZS.js";
|
|
34
|
+
import "./chunk-Y527D4TV.js";
|
|
35
|
+
import "./chunk-NDGZDTSJ.js";
|
|
36
|
+
import "./chunk-BFDQ4WNW.js";
|
|
37
|
+
import "./chunk-3AIHRXKO.js";
|
|
38
|
+
import "./chunk-X5ZBP3IY.js";
|
|
39
|
+
import "./chunk-2I4QTOLB.js";
|
|
40
|
+
import "./chunk-2M2VPI2E.js";
|
|
41
|
+
import "./chunk-WXA2BWTE.js";
|
|
42
|
+
import "./chunk-XQJXNMSB.js";
|
|
43
|
+
import "./chunk-SNNSAGMT.js";
|
|
44
|
+
import "./chunk-7WEQQJLG.js";
|
|
45
|
+
import "./chunk-3UCIG4TG.js";
|
|
46
|
+
import "./chunk-ZNNXRNFD.js";
|
|
47
|
+
import "./chunk-EDJWHDDL.js";
|
|
48
|
+
import "./chunk-OJNTCYQQ.js";
|
|
49
|
+
import "./chunk-ZXTAQYNA.js";
|
|
50
|
+
export {
|
|
51
|
+
BACKGROUND_COOLDOWN_MS,
|
|
52
|
+
runUpdate,
|
|
53
|
+
spawnCapture,
|
|
54
|
+
versionFreeEntry
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=update-CACXLQLR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -11,18 +11,16 @@ import {
|
|
|
11
11
|
broadcastUsdcSend,
|
|
12
12
|
getUsdcBalance,
|
|
13
13
|
prepareUsdcSend
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-K3I7C2MO.js";
|
|
17
|
-
import "./chunk-5IEP5EGE.js";
|
|
18
|
-
import "./chunk-EGELTSPU.js";
|
|
14
|
+
} from "./chunk-TC2WZLSC.js";
|
|
15
|
+
import "./chunk-WFSPCCVW.js";
|
|
19
16
|
import "./chunk-JRGFKVAZ.js";
|
|
17
|
+
import "./chunk-2GP3HRYK.js";
|
|
20
18
|
import "./chunk-KG3D7FIF.js";
|
|
21
19
|
import "./chunk-RBJPAZFI.js";
|
|
22
20
|
import "./chunk-BPMWXTFX.js";
|
|
23
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-WXA2BWTE.js";
|
|
24
22
|
import "./chunk-7WEQQJLG.js";
|
|
25
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-OJNTCYQQ.js";
|
|
26
24
|
import "./chunk-ZXTAQYNA.js";
|
|
27
25
|
export {
|
|
28
26
|
FeeCapExceededError,
|
|
@@ -37,4 +35,4 @@ export {
|
|
|
37
35
|
getUsdcBalance,
|
|
38
36
|
prepareUsdcSend
|
|
39
37
|
};
|
|
40
|
-
//# sourceMappingURL=usdc-
|
|
38
|
+
//# sourceMappingURL=usdc-VG4CIOUK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -2,8 +2,8 @@ import { createRequire as __tenjinCreateRequire } from 'node:module'; const requ
|
|
|
2
2
|
import {
|
|
3
3
|
a,
|
|
4
4
|
s
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-J57UC3DD.js";
|
|
6
|
+
import "./chunk-RL5UUDT4.js";
|
|
7
7
|
import "./chunk-KG3D7FIF.js";
|
|
8
8
|
import "./chunk-BPMWXTFX.js";
|
|
9
9
|
import "./chunk-ZXTAQYNA.js";
|
|
@@ -11,4 +11,4 @@ export {
|
|
|
11
11
|
a as n,
|
|
12
12
|
s as t
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=viemAdapter-By13KInL-
|
|
14
|
+
//# sourceMappingURL=viemAdapter-By13KInL-DOFTEIJV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
REPAIR_DONE_LINE,
|
|
4
|
+
findPassphraseExports,
|
|
5
|
+
passphraseNote,
|
|
6
|
+
runWalletBalance,
|
|
7
|
+
runWalletCreate,
|
|
8
|
+
runWalletRepair,
|
|
9
|
+
runWalletShow,
|
|
10
|
+
withWalletLock
|
|
11
|
+
} from "./chunk-HMWYAUA6.js";
|
|
12
|
+
import "./chunk-HGZEPQUT.js";
|
|
13
|
+
import "./chunk-TC2WZLSC.js";
|
|
14
|
+
import "./chunk-WYXUQGOL.js";
|
|
15
|
+
import "./chunk-TKPF35W6.js";
|
|
16
|
+
import "./chunk-GTTUCOPD.js";
|
|
17
|
+
import "./chunk-IE7P2BZE.js";
|
|
18
|
+
import "./chunk-UXZONNEQ.js";
|
|
19
|
+
import "./chunk-V2LQLN5H.js";
|
|
20
|
+
import "./chunk-SO3XRZPX.js";
|
|
21
|
+
import "./chunk-FVIGCDSV.js";
|
|
22
|
+
import "./chunk-HDPUXS3Z.js";
|
|
23
|
+
import "./chunk-2SNUOHAT.js";
|
|
24
|
+
import "./chunk-MEFB5KHA.js";
|
|
25
|
+
import "./chunk-CEXSOI5R.js";
|
|
26
|
+
import "./chunk-WFSPCCVW.js";
|
|
27
|
+
import "./chunk-JRGFKVAZ.js";
|
|
28
|
+
import "./chunk-2GP3HRYK.js";
|
|
29
|
+
import "./chunk-KG3D7FIF.js";
|
|
30
|
+
import "./chunk-RBJPAZFI.js";
|
|
31
|
+
import "./chunk-BPMWXTFX.js";
|
|
32
|
+
import "./chunk-Y527D4TV.js";
|
|
33
|
+
import "./chunk-BFDQ4WNW.js";
|
|
34
|
+
import "./chunk-3AIHRXKO.js";
|
|
35
|
+
import "./chunk-X5ZBP3IY.js";
|
|
36
|
+
import "./chunk-2I4QTOLB.js";
|
|
37
|
+
import "./chunk-2M2VPI2E.js";
|
|
38
|
+
import "./chunk-WXA2BWTE.js";
|
|
39
|
+
import "./chunk-XQJXNMSB.js";
|
|
40
|
+
import "./chunk-SNNSAGMT.js";
|
|
41
|
+
import "./chunk-7WEQQJLG.js";
|
|
42
|
+
import "./chunk-3UCIG4TG.js";
|
|
43
|
+
import "./chunk-OJNTCYQQ.js";
|
|
44
|
+
import "./chunk-ZXTAQYNA.js";
|
|
45
|
+
export {
|
|
46
|
+
REPAIR_DONE_LINE,
|
|
47
|
+
findPassphraseExports,
|
|
48
|
+
passphraseNote,
|
|
49
|
+
runWalletBalance,
|
|
50
|
+
runWalletCreate,
|
|
51
|
+
runWalletRepair,
|
|
52
|
+
runWalletShow,
|
|
53
|
+
withWalletLock
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=wallet-QL4UUXEZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -636,15 +636,15 @@ async function scryptAsync(password, salt, opts) {
|
|
|
636
636
|
return scryptOutput(password, dkLen, B, V, tmp);
|
|
637
637
|
}
|
|
638
638
|
|
|
639
|
-
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.
|
|
639
|
+
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.6.7/node_modules/ox/_esm/core/version.js
|
|
640
640
|
var version = "0.1.1";
|
|
641
641
|
|
|
642
|
-
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.
|
|
642
|
+
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.6.7/node_modules/ox/_esm/core/internal/errors.js
|
|
643
643
|
function getVersion() {
|
|
644
644
|
return version;
|
|
645
645
|
}
|
|
646
646
|
|
|
647
|
-
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.
|
|
647
|
+
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.6.7/node_modules/ox/_esm/core/Errors.js
|
|
648
648
|
var BaseError = class _BaseError extends Error {
|
|
649
649
|
static setStaticOptions(options) {
|
|
650
650
|
_BaseError.prototype.docsOrigin = options.docsOrigin;
|
|
@@ -773,7 +773,7 @@ function walk(err, fn) {
|
|
|
773
773
|
return fn ? null : err;
|
|
774
774
|
}
|
|
775
775
|
|
|
776
|
-
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.
|
|
776
|
+
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.6.7/node_modules/ox/_esm/core/internal/bytes.js
|
|
777
777
|
var charCodeMap = {
|
|
778
778
|
zero: 48,
|
|
779
779
|
nine: 57,
|
|
@@ -792,7 +792,7 @@ function charCodeToBase16(char) {
|
|
|
792
792
|
return void 0;
|
|
793
793
|
}
|
|
794
794
|
|
|
795
|
-
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.
|
|
795
|
+
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.6.7/node_modules/ox/_esm/core/internal/hex.js
|
|
796
796
|
function assertSize(hex, size_) {
|
|
797
797
|
if (size(hex) > size_)
|
|
798
798
|
throw new SizeOverflowError({
|
|
@@ -814,7 +814,7 @@ function pad(hex_, options = {}) {
|
|
|
814
814
|
return `0x${hex[dir === "right" ? "padEnd" : "padStart"](size2 * 2, "0")}`;
|
|
815
815
|
}
|
|
816
816
|
|
|
817
|
-
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.
|
|
817
|
+
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.6.7/node_modules/ox/_esm/core/Hex.js
|
|
818
818
|
var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
|
|
819
819
|
function fromBytes(value, options = {}) {
|
|
820
820
|
let string = "";
|
|
@@ -856,7 +856,7 @@ var SizeExceedsPaddingSizeError = class extends BaseError {
|
|
|
856
856
|
}
|
|
857
857
|
};
|
|
858
858
|
|
|
859
|
-
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.
|
|
859
|
+
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.6.7/node_modules/ox/_esm/core/Bytes.js
|
|
860
860
|
function from(value) {
|
|
861
861
|
if (value instanceof Uint8Array)
|
|
862
862
|
return value;
|
|
@@ -896,7 +896,7 @@ function toHex(value, options = {}) {
|
|
|
896
896
|
return fromBytes(value, options);
|
|
897
897
|
}
|
|
898
898
|
|
|
899
|
-
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.
|
|
899
|
+
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.6.7/node_modules/ox/_esm/core/Keystore.js
|
|
900
900
|
function pbkdf22(options) {
|
|
901
901
|
const { iv, iterations = 262144, password } = options;
|
|
902
902
|
const salt = options.salt ? from(options.salt) : random(32);
|
|
@@ -21,7 +21,7 @@ The allow is a tool grant, not a spending grant. Every payment the tool makes st
|
|
|
21
21
|
|
|
22
22
|
Router on/off controls automatic routing. The spending controls and ledger are local; the router cannot read or raise them:
|
|
23
23
|
|
|
24
|
-
- **`sessionBudget`**, the daily budget, is the control. It caps automatic spending
|
|
24
|
+
- **`sessionBudget`**, the daily budget, is the control. It caps automatic spending within a 24-hour budget window across agent sessions, $5 by default. Zero blocks automatic spending; `none` removes the daily ceiling.
|
|
25
25
|
- **`maxAutoSpend`**, the per-call ceiling, is the runaway guard. It caps what one router call pays on its own: all its payments together, so several takes of one call or every option of a compare count as one total. It is $0.25 by default, and it cannot be set below $0.25, the routing deposit, because below that routing cannot pay at all: `tenjin install` and `tenjin config set` refuse a lower amount and say why, and `tenjin doctor` flags one an earlier release left. A service priced above it (today two video models at $0.42 and $0.45, hosting at $0.50 and research at $0.60) is approved once, for that call (below).
|
|
26
26
|
- **The wallet balance** is the hard stop. Nothing pays past it.
|
|
27
27
|
- **`spend.json`** records all payments, with separate automatic exposure and reservation modes. Only automatic exposure and pending automatic reservations consume the daily budget. Manual payments remain in total reporting. Older records without a mode/counter conservatively count as automatic until their window expires. Both modes retain the keyed duplicate guard, including under `none`.
|
|
@@ -43,7 +43,7 @@ tenjin config set sessionBudget 2.00
|
|
|
43
43
|
The routing decision comes from a server, and each call costs a flat $0.003 from the wallet's channel, paid from deposits of up to $0.25 that count against the limits (the deposit is counted when it leaves the wallet, the fees from it are not counted again): it proposes, it never authorizes. These checks are what keep a wrong or hostile one from being worth anything:
|
|
44
44
|
|
|
45
45
|
- The routing fee is paid only by `tenjin mcp`, with the stock x402 client, and only at exactly $0.003 in USDC on Base over `batch-settlement`. The wallet has one routing channel. When it cannot cover the next fee, the call carries a deposit of $0.25. A deposit is an automatic payment: it is reserved in `spend.json` before it is signed, so it must fit `maxAutoSpend`, the day's `sessionBudget` and `allowlistCreators` (the router's host is the creator), and it is counted from the moment it is sent, so a lost answer or a killed process leaves it counted; only an answered 4xx or 5xx, on which the server settles nothing, gives it back. The deposit is the spend: the fees come out of it and are not counted again, so the day's running total never refuses one. Each fee still gets the per-payment checks: it has to fit `maxAutoSpend` (a 0 an earlier release let you set refuses it) and pass `allowlistCreators`, and a `sessionBudget` of 0 refuses it. A fee that fails one is not paid, even from a channel that is already funded, and the call takes the free path. Approving the limits at install, where the question names the fee, is what approves it.
|
|
46
|
-
- A routing call that cannot be paid takes the free path: the wallet holds less than the deposit, `tenjin mcp` cannot unlock the wallet
|
|
46
|
+
- A routing call that cannot be paid takes the free path, which routes nothing now that the router charges the fee: the wallet holds less than the deposit, `tenjin mcp` cannot unlock the wallet (no saved passphrase it can reach, a wrong one, or a locked keychain), a limit refuses the deposit, the payment fails, or the channel is carrying another session's call at that moment. Such a call tells you, in Claude Code's own message line, the reason and the fix (`tenjin wallet fund 5`, `tenjin wallet repair`, or `tenjin doctor`), once for each reason; the line changes when the reason does, and a funded or unlocked wallet is said once; a busy channel says nothing, and while the router charges no fee the wallet is not touched and nothing is said. The native tools are never blocked for it, and `tenjin doctor` names the same reasons, as the router Claude Code is running saw them when one is live. While the wallet definitely cannot sign (no wallet, or a wallet it cannot unlock), paid lookups are not offered, not even ones you could approve. While its balance is below the price, a curated lookup is not offered, and a discovered one is shown with a note to fund the wallet, so you are asked first; a subagent, which cannot ask you, is not offered either. When Tenjin cannot tell (a balance or keychain read fails), they are offered as before, and the spend checks still decide what is paid.
|
|
47
47
|
- A routing call that cannot reach the router (DNS, TLS, a refused connection, a proxy refusing the tunnel) makes every hook leg skip the router for the next 60 seconds, so the native tools run at once instead of each waiting out the gate. A call that runs out of its few seconds, a dropped socket (a paid call's is retried once on the free path) or an answer of any status does not start the pause. The pause is a timestamp under `~/.tenjin/router-memo/` that every session on the machine reads, beside the one-hour note that the router charges no fee, which ends as soon as the router says the fee is on. The pause ends after its 60 seconds, or at once when `tenjin doctor` reaches the router; while doctor cannot reach it either, it names the pause with the seconds left.
|
|
48
48
|
|
|
49
49
|
- The call's payments, together, have to fit `maxAutoSpend` and the day's `sessionBudget` unless you approved that call's quote, and each one is signed only against that plan, never above its planned amount. A live price above the one the decision quoted is refused before anything is signed, so a provider or a stale catalog cannot charge more than it advertised; a hostile server sets that quote itself, so against one the bound stays `maxAutoSpend`.
|
|
@@ -73,6 +73,15 @@ Review the live endpoint, recipient, network, asset and amount. `--ignore-warnin
|
|
|
73
73
|
tenjin pay https://api.example.com/quote --json --max-price 0.05
|
|
74
74
|
# After reviewing a registry warning and the live quote:
|
|
75
75
|
tenjin pay https://api.example.com/quote --json --max-price 0.05 --ignore-warnings --yes
|
|
76
|
+
# The 402 terms and the endpoint's advertised request shape, free; opens no wallet.
|
|
77
|
+
# Only a USDC option carries `usd`, and `payable: true` marks the one this wallet pays:
|
|
78
|
+
tenjin pay https://api.example.com/search -d '{"q":"x"}' --quote --json
|
|
79
|
+
# A header the endpoint asks for (a beta opt-in, an API version); never a payment or sign-in header:
|
|
80
|
+
tenjin pay https://api.example.com/search -d '{"q":"x"}' -H 'X-Api-Beta: 2026-08-28' --max-price 0.05 --yes
|
|
81
|
+
# -X takes GET, POST, PUT, PATCH or DELETE; a body needs POST, PUT or PATCH:
|
|
82
|
+
tenjin pay https://api.example.com/items/7 -X PATCH -d '{"name":"y"}' --max-price 0.05 --yes
|
|
83
|
+
# A body that is not JSON goes byte for byte, under the Content-Type you pass with it:
|
|
84
|
+
tenjin pay https://api.example.com/form --data-raw 'a=1' -H 'Content-Type: application/x-www-form-urlencoded' --max-price 0.05 --yes
|
|
76
85
|
```
|
|
77
86
|
|
|
78
87
|
Both flags still obey the optional explicit `--max-price` cap, destination and supported-challenge checks, and the authoritative wallet balance check. Warnings and acknowledgement status remain in JSON output. Each paid invocation can spend again; nothing deduplicates repeat payments. Free or SIWX-entitled delivery needs neither warning acknowledgement nor a payment balance read.
|
|
@@ -85,14 +94,15 @@ Immediately before signing a positive payment, the CLI reads the actual signer's
|
|
|
85
94
|
|
|
86
95
|
Each of these is a decision a person makes, so none is in the rule set and none should be added without meaning it:
|
|
87
96
|
|
|
88
|
-
| Verb | Why it stays a human decision
|
|
89
|
-
| ---------------------- |
|
|
90
|
-
| `tenjin wallet send` | Moves USDC out of the wallet and is not bounded by the spend policy.
|
|
91
|
-
| `tenjin wallet create` | Creates the payment credential.
|
|
92
|
-
| `tenjin
|
|
93
|
-
| `tenjin
|
|
94
|
-
| `tenjin
|
|
95
|
-
| `tenjin
|
|
97
|
+
| Verb | Why it stays a human decision |
|
|
98
|
+
| ---------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
|
99
|
+
| `tenjin wallet send` | Moves USDC out of the wallet and is not bounded by the spend policy. |
|
|
100
|
+
| `tenjin wallet create` | Creates the payment credential. |
|
|
101
|
+
| `tenjin wallet repair` | Saves the passphrase that unlocks the payment credential; a person types it, and it can replace what the store held. |
|
|
102
|
+
| `tenjin config set` | It can widen the agent's own spend policy. |
|
|
103
|
+
| `tenjin install` | Writes into harness config. |
|
|
104
|
+
| `tenjin uninstall` | Removes the wiring the harness is running on. |
|
|
105
|
+
| `tenjin update` | Replaces the binary the agent then runs. |
|
|
96
106
|
|
|
97
107
|
Prefer the narrow rules on this page to a broad `Bash(tenjin:*)`, `Bash(tenjin wallet:*)` or `Bash(tenjin config:*)`, each of which swallows the table above.
|
|
98
108
|
|
|
@@ -101,34 +111,42 @@ Prefer the narrow rules on this page to a broad `Bash(tenjin:*)`, `Bash(tenjin w
|
|
|
101
111
|
Under an agent harness (Claude Code, Claude Desktop, Codex), `tenjin install` opens nothing and pays nothing. Each question comes at the point where its answer is needed, in `nextSteps`, with the one command every answer names:
|
|
102
112
|
|
|
103
113
|
1. The spend question comes first, while the config file names neither limit, because the answer picks the install command: Use the defaults (`tenjin install --yes`) or Set my own limits (`--max-auto-spend <usd> --session-budget <usd|none>`), as above. The defaults already hold while the question waits.
|
|
104
|
-
2. The funding question comes from the output of that install command, when the wallet is new or
|
|
114
|
+
2. The funding question comes from the output of that install command, when the wallet is new or its balance confirms it is empty: "Add $5 to Tenjin now?" "Add $5" runs `tenjin wallet fund 5`, which opens checkout in your default browser with $5 filled in. "Not now" runs nothing: the agent says you can ask it to add funds later. Your usual tools keep working; paid tools need funds. When an existing balance cannot be checked, install reports that without suggesting another payment; ask the agent to check funds later. The address remains available if you choose a direct transfer. Install mints no link and does not unlock the wallet; a later yes runs `tenjin wallet fund 5`.
|
|
105
115
|
|
|
106
|
-
So the agent asks the spend question, runs the one install command your answer names, asks the funding question from that command's output, and runs `tenjin wallet fund 5` alone only after your yes. It never runs it without that yes. It shows you
|
|
116
|
+
So the agent asks the spend question, runs the one install command your answer names, asks the funding question from that command's output, and runs `tenjin wallet fund 5` alone only after your yes. It never runs it without that yes. It shows a transfer address only when you choose that option, and never asks you to run a command. A person running `tenjin install` in a terminal answers the spend question there and gets no question handed over.
|
|
107
117
|
|
|
108
118
|
## What `tenjin install` writes, in full
|
|
109
119
|
|
|
110
120
|
Claude Code 2.1.287 or later is required. `tenjin install` and `tenjin doctor` read `claude --version`, and on an older one say to run `claude update` in the session.
|
|
111
121
|
|
|
112
|
-
1. A wallet, when this machine has none (`--no-wallet` skips it).
|
|
122
|
+
1. A wallet, when this machine has none (`--no-wallet` skips it). Install says in one line where it saved the passphrase. It never marks with a ✓ a wallet Claude Code could not unlock (it names `tenjin wallet repair` instead), or one that signs only through `TENJIN_WALLET_KEY` or `TENJIN_WALLET_PASSPHRASE` in the shell you ran install from (it says Claude Code needs the same variable).
|
|
113
123
|
2. The two automatic spend limits above, only where your config file is silent, and only after you answer the question in a terminal. When your agent runs the install, it writes neither and the defaults hold: your agent asks you the same question and runs the one install command your answer names (see [When your agent runs the install](#when-your-agent-runs-the-install)). Explicit zero, unlimited, custom registry lists and router opt-outs are preserved. Ignored `bazaarPay` and `confirm` keys are removed and reported; refresh removes retired keys without filling absent settings.
|
|
114
|
-
3.
|
|
124
|
+
3. Tenjin's own runtime, in `~/.tenjin/runtime`, so that switching or removing Node, or `npm rm -g tenjin-cli`, does not stop it: a copy of this build in `versions/<version>`, and a pinned Node 24 in `node/<version>`, downloaded from nodejs.org and checked against the SHA-256 this build carries. Install runs the copy on that Node to check it before anything points at it. It also puts a `tenjin` command in `~/.local/bin` (and `tenjin.cmd` on Windows): a short launcher that runs the copy on that Node, and says how to reinstall when the runtime is gone. A file there that is not Tenjin's launcher, or npm's own link, is left as it is. Install edits no shell file; when `~/.local/bin` is not on your PATH it prints the line to add. Plugin installation requires the default data directory and a supported platform: macOS 13.5+, Windows or glibc Linux 2.28+ on x64/arm64. A custom `TENJIN_DATA_DIR` or unsupported platform is refused before registration changes. A runtime setup failure stops the install and keeps any working runtime and plugin registration; fix the reported cause, then retry.
|
|
125
|
+
4. The Claude Code plugin `tenjin`, registered with Claude Code's own commands, which leave no step to you: `claude plugin marketplace add ~/.tenjin/runtime/claude` and then `claude plugin install tenjin@tenjin` (with `--scope local` under `--project`, so only this project loads it), and `claude plugin update tenjin@tenjin` when Claude Code holds an older version. The marketplace is the runtime's `claude` folder, read in place, so the plugin is the build you installed, and an update only rewrites that folder. Claude Code keeps one `tenjin` marketplace for the whole machine, so this one `add` also moves a project install made by an earlier release. Claude Code writes `extraKnownMarketplaces` and `enabledPlugins` into its settings; this CLI writes nothing into `settings.json` or `~/.claude.json` itself. The binary is `claude` on PATH, else the one Claude Code names in `CLAUDE_CODE_EXECPATH`; with neither, or when a `claude plugin` command fails, the same plugin is written as a folder, `skills/tenjin-router/` under Claude Code's config directory (`$CLAUDE_CONFIG_DIR` when set, else `~/.claude`), which Claude Code loads as `tenjin@skills-dir` with no command at all. `skills/tenjin`, where tenjin.sh suggests dropping its hosted skill, is never touched, and in the folder only the plugin's own five files are ever written or removed. The plugin carries:
|
|
115
126
|
- Seven hook legs, each a Claude Code `mcp_tool` hook that calls the `hook` tool of the plugin's `router` server with the event's fields: `UserPromptSubmit`, `PreToolUse` on `WebSearch|WebFetch`, `PreToolUse` on `Agent|Task`, `PostToolUse` and `PostToolUseFailure` on `WebSearch|WebFetch`, and `PreToolUse` and `PostToolUse` on `AskUserQuestion`. So each routing step runs inside the session's own `tenjin mcp`, the one process that holds the wallet. That tool reads history only from a file whose real path, symlinks resolved, lies under Claude Code's projects directory (`$CLAUDE_CONFIG_DIR/projects` when that variable is set, else `~/.claude/projects/`) and that is named for the calling session or one of its subagents; a session's first prompt, which fires before that transcript is written, routes on the prompt alone, and any other call reads, sends and pays nothing. Each has a 5 second timeout, so a stuck server never holds a prompt longer, and the two after-call entries on `WebSearch|WebFetch` 15 seconds so a search can wait for the free docs described below. A call that carries a routing channel's deposit waits 4.5 of those seconds instead of 3.5, and a routing payment still out when its time ends says nothing: that prompt runs on the native tools while `tenjin mcp` lets the request finish, for 15 seconds at most, so the channel records it; a deposit in it was counted in the spend ledger when it was sent. A session where the `router` server is not running routes nothing, and its native tools run. No daemon, no generated script; the one background process is that docs fetch, a single `node` process per such search that exits within 12 seconds. `tenjin hook <prompt|native|shortfall|agent|ask|answer>` still exists for a host with no MCP server, and always takes the free path.
|
|
116
|
-
- The two permission answers above. No hook approves any other call, so WebSearch and WebFetch stay under your own permission rules. Before each one, when a paid lookup fits it, the hook redirects your assistant to `mcp__plugin_tenjin_router__request` in its place; a subagent is redirected only when it is known to have that tool and your spend policy would pay without asking, and otherwise its call simply runs. For library documentation, which is a free lookup, it never redirects, in the main agent or a subagent:
|
|
117
|
-
- One `SessionStart` command, `tenjin hook alive`, run
|
|
127
|
+
- The two permission answers above. No hook approves any other call, so WebSearch and WebFetch stay under your own permission rules. Before each one, when a paid lookup fits it, the hook redirects your assistant to `mcp__plugin_tenjin_router__request` in its place; a subagent is redirected only when it is known to have that tool and your spend policy would pay without asking, and otherwise its call simply runs. For library documentation, which is a free lookup, it never redirects, in the main agent or a subagent: the search runs as your assistant wrote it, and when Tenjin's server sends the lookup as a note, after it the hook adds one optional line naming the free Context7 docs lookup for the same query, which your assistant calls or ignores, once in five minutes for one agent's identical search. A WebFetch with a free lookup simply runs. It never redirects the same call twice: once a search or URL has been redirected, your assistant's own retry of that same search or URL runs as it is, whether the redirected lookup succeeded, failed or was never called, and however many other calls ran in between, for ten minutes and separately for each agent, while every other search or URL is routed as usual. After a call that came back short (a failed call, a page that answers 401, 402, 403, 429 or 5xx, an empty page, a search with no results; never a 404 or 410, since a missing page is missing for a paid reader too), the router may offer a paid lookup.
|
|
128
|
+
- One `SessionStart` command, `tenjin hook alive`, run by the runtime's Node with the runtime's `dist/index.js`, which writes two small files under `~/.tenjin/alive/`: a marker for the session (a hash of its id) and a stamp saying the plugin has loaded on this machine. When `wallet.json` cannot be read, or the passphrase file Tenjin saved is gone, it prints one message for you with the reason and the fix, and one line for your assistant. Otherwise, while the wallet holds less than the per-call limit, it shows you one line, `Tenjin balance: $0.00. Ask your agent to add funds to Tenjin.`, with no wallet address; to know, it reads the balance once from your configured Base RPC (the public ones when you set none), at most two seconds, and adds nothing to your assistant's context. Anything else about the wallet, and the "Tenjin wallet unlocked" confirmation after a repair, comes from the router on the session's first prompt.
|
|
118
129
|
- A mod (`hooks/register.tsx`, with its state contract in `types/index.d.ts`), which Claude Code runs in the terminal, the desktop app and VS Code. It reads three kinds of file the CLI already keeps under `~/.tenjin`: a kept spec's label, price and the one input a row may show; a choice set's option names; and the offer record of a redirected call, plus the request tool's own result, and writes nothing there. It draws each lookup the way Claude Code draws an MCP call: `⏺ Calling Exa search… · $0.007` with the query under it while it runs, then the dim `Called Exa search · $0.007 (ctrl+o to expand)`. In the ctrl+o transcript, under `--verbose`, or in a run Claude Code expands, every call to the router, the ones the normal view hides included, is Claude Code's own row with its input and result. A lookup over a spend limit draws no row of its own; the `approve` call that runs it once you say yes draws as that lookup (`Calling Exa search… · $0.775`, then `Called Exa search · $0.775`). A call that failed after paying shows the error dot, the amount and the state. A call the router sends back for a missing field, and the router's own free calls, draw nothing. It shows an input only when it names what was looked up (a query, a URL, a name, at most 80 characters), never a media prompt, so an image call reads `Called Ideogram V4 · $0.03`. A run that mixes a lookup with other calls is drawn unfolded, each call its own row. A WebSearch or WebFetch held for a Tenjin offer shows as its native row struck through, `⏺ ~~Web Search~~("query") · Tenjin offered Exa search`, then becomes, in place, the lookup drawn as a built-in row would be, `⏺ Exa search("query") · $0.007`, or disappears if your assistant runs the same search itself. It answers no permission question, rewrites no prompt, denies nothing, writes no config and answers no tool call. The request tool stays in the prompt's tool list through the server's own `anthropic/alwaysLoad`, and the permission answer above allows it.
|
|
119
|
-
- The `router` MCP server, `tenjin mcp --plugin`, run
|
|
130
|
+
- The `router` MCP server, `tenjin mcp --plugin`, run the same way, never by the `node` on your PATH.
|
|
131
|
+
- `bin/tenjin`, the same launcher as `~/.local/bin/tenjin`. Claude Code puts the plugin's `bin/` at the end of the Bash tool's PATH, so your assistant's `tenjin` is this one when nothing earlier on PATH is named `tenjin`.
|
|
120
132
|
|
|
121
|
-
Every command the plugin carries is a Claude Code exec-form command:
|
|
133
|
+
Every command the plugin carries is a Claude Code exec-form command: the absolute path of the runtime's Node and the absolute path of its `dist/index.js`, started with no shell and never through the `tenjin` npm shim or a launcher, so Windows runs the same files macOS and Linux run. The `skills/tenjin-router/` folder uses the same verified runtime; a failed runtime setup never registers npm-folder commands.
|
|
122
134
|
|
|
123
|
-
|
|
135
|
+
5. Nothing else. The status line is no longer set up: `tenjin status-line` still exists, and you can set it as your status line command yourself.
|
|
124
136
|
|
|
125
137
|
**An install from an earlier release** wrote seven hook entries, the `mcp__x402__request` allow rule, the `mcp__x402__hook` deny rule and possibly a `statusLine` into your settings, and registered an `x402` MCP server. On a Claude Code older than 2.1.287, install and `tenjin update` do not register the plugin at all while that install is there, and say so: the old install keeps routing until `claude update` and the next `tenjin install`. Otherwise it keeps working until the plugin has proven to load on this machine: Claude Code at 2.1.287 or later lists the plugin enabled, and its `SessionStart` leg has run in a real session. Until then both stay, and in any session the plugin serves, the old entries say nothing, so nothing is offered twice. The next `tenjin install` or `tenjin update` after that removes the old install, and only in the exact shapes it wrote: a hook handler that calls the `x402` server's `hook` tool or is exactly `tenjin hook <leg>`, the two rules (only when the `x402` server is Tenjin's or gone), a status line that runs `tenjin status-line` (a composition is put back to your own command; install and `tenjin update` both name the status line they removed, and you can set `tenjin status-line` again yourself), and the `x402` server, through `claude mcp remove x402`, only after this CLI read that entry and found it launching `tenjin mcp`. A command that only mentions `tenjin hook`, a handler of yours in the same group, your own rules and your own `x402` server stay, and doctor names what it left alone. This migration is removed on or after 2026-12-01; doctor keeps naming an unmigrated machine after that.
|
|
126
138
|
|
|
127
|
-
Install then sends the router one empty, unsigned request to check that this machine can reach it. When it cannot, install still succeeds, and it names the layer that refused (a proxy, DNS, TLS, or the connection) with the fix. `tenjin doctor` runs the same check. Both also look for running `tenjin mcp` processes that started before this install: Claude Code keeps an MCP server for the whole session, so one of those still runs the old build, and the new hooks can fail there with "Tool hook not found". They name the count and the fix (
|
|
139
|
+
Install then sends the router one empty, unsigned request to check that this machine can reach it. When it cannot, install still succeeds, and it names the layer that refused (a proxy, DNS, TLS, or the connection) with the fix. `tenjin doctor` runs the same check. Both also look for running `tenjin mcp` processes that started before this install: Claude Code keeps an MCP server for the whole session, so one of those still runs the old build, and the new hooks can fail there with "Tool hook not found". They name the count and the fix (start a new Claude Code session) and stop nothing.
|
|
128
140
|
|
|
129
|
-
The
|
|
141
|
+
The plugin carries one skill, `tenjin-pay`. It teaches an agent to quote an endpoint for free first, cap the price at the option this wallet would pay, and pay only with your consent to that quote, using this machine's wallet rather than another tool's, with any of the five methods and a JSON or raw body. Install and refresh still remove only an owned obsolete `tenjin-pay` skill file an earlier release wrote under your Claude config folder, preserving adjacent user files and foreign skills.
|
|
130
142
|
|
|
131
|
-
|
|
143
|
+
When an agent opens checkout, the funding command returns promptly with a `nextStep`: finish checkout and return to the same conversation. The agent runs `tenjin wallet balance` to confirm funds and continues the task when sufficient. An unconfirmed balance or failed balance read does not establish a failed payment or trigger another checkout. A confirmed balance check clears the hook balance cache, so eligible offers can resume without restarting.
|
|
144
|
+
|
|
145
|
+
Follow the activation instruction from install. A fresh terminal installation offers `/reload-plugins` in the same conversation, then you continue your task. In Claude Desktop's Code tab, choose **New session** in the same folder: Desktop connects the plugin's MCP server in a new session. Before switching, your agent gives you a short, ready-to-paste prompt containing your task, progress and next action, with a Tenjin doctor check before continuing. The next prompt hook records that the plugin serves this session; doctor uses that live observation, so a standalone MCP probe cannot contradict it. Reload does not run `SessionStart`; future sessions still do. Upgrades from the earlier settings-based installation need a new session to leave the old server behind. Codex also needs a new session; ask your agent for a short task handoff before switching.
|
|
146
|
+
|
|
147
|
+
`tenjin update` needs no npm. It downloads the newest `tenjin-cli` from the npm registry, installs it only when npm's provenance shows Tenjin's own release workflow (`release.yml` on `main` of BackTrackCo/tenjin-agent) built it, checks it against the registry's SHA-512, fetches the Node that version pins, and has the new build check itself on that Node before it switches anything; a version that fails the check is not used, and the current one keeps running. The version it replaces stays in the runtime, and an older version is removed only once nothing runs from it. An older build never replaces a newer one; to go back, run `tenjin uninstall`, then install the older version.
|
|
148
|
+
|
|
149
|
+
`tenjin uninstall` removes the install for where you are, from any folder: the project install made in the folder you are in or the nearest folder above it, or else the user install. `tenjin uninstall --project <path>` removes another project's install, and `tenjin uninstall --all` removes every one. For each, it runs `claude plugin uninstall tenjin@tenjin` in that install's scope, unlinks the plugin folder's own files, and removes an earlier release's settings install under the rules above. The `tenjin` marketplace, the runtime and the launchers go only when no install is left anywhere, and a run is all or nothing: when one removal fails, those stay, and uninstall names what it removed and what is left. It ends by saying what it kept: your wallet, with its address, the spend ledger, the config, and where the passphrase is saved. Run it before `npm uninstall -g tenjin-cli`, never after; if npm went first, `~/.local/bin/tenjin uninstall --all` still works.
|
|
132
150
|
|
|
133
151
|
To stop the router without removing anything, `tenjin config set router.enabled false` stops it on this machine, and `tenjin config set --project router.enabled false` stops it in this repository. Off means no router hook reads or sends anything and the `request` tool refuses without paying. The project value lives in `<project>/.tenjin/config.json`, which you commit; `--project --local` writes `.tenjin/config.local.json` beside it instead, which is yours alone and belongs in `.gitignore`. Every such file from where the session runs up to the git root applies, and in a git worktree so do the main checkout's; a key a file leaves out is inherited from the files around it. A project file can only turn the router off or narrow what it sends; it cannot enable anything or change a spend setting. From a git worktree, `config set --project` writes at the worktree's own root, never the main checkout's file, though the router reads both.
|
|
134
152
|
|
|
@@ -136,7 +154,7 @@ To stop the router without removing anything, `tenjin config set router.enabled
|
|
|
136
154
|
|
|
137
155
|
1. You type a turn. The hook sends the bounded packet to Tenjin, which answers whether a paid capability fits and, if it does, keeps that packet under a short-lived id.
|
|
138
156
|
2. When one fits, your assistant sees one line, opening with `Tenjin router (installed by the user):`, that starts at the service's name and its price (`Exa search, $0.007: …`) and ends with the call to make: `mcp__plugin_tenjin_router__request({id, input})` with the required fields as placeholders, or already filled in when the hook holds them (the search a native call was about to run, or the page it was about to fetch). The hook keeps the service's spec on this machine under the id.
|
|
139
|
-
3. Your assistant fills the fields and calls `request({id, input})` once. This CLI validates the input against the spec, builds the request, pays that provider once under your limits, hands back the result, and tells Tenjin only how the call ended.
|
|
157
|
+
3. Your assistant fills the fields and calls `request({id, input})` once. This CLI validates the input against the spec, builds the request, pays that provider once under your limits, hands back the result, and tells Tenjin only how the call ended. Any paid routing call costs $0.003 separately, including when no tool is suggested. Where the spec names the fields its result promises, the result holds only those, and the provider's whole response is saved under `~/.tenjin/results/` (readable by you alone, kept a day) at the path the result names in `fullResultPath`.
|
|
140
158
|
4. An input that does not fit the spec is refused before anything is sent to the provider: your assistant gets every problem and the whole spec (each input with its description and allowed values, the required fields inside a nested object, an example and what comes back), locally and with nothing paid, and calls again. `request({id})` alone shows the same spec. A spec whose input schema this CLI cannot compile is refused outright, with nothing sent to the provider or paid.
|
|
141
159
|
5. Your assistant can also see what is available without a lookup: `request({browse: "<a need>"})`, or `browse: ""` for every tool, returns the tool list (each tool's id, name, what it does and its price), and `request({tool: "<id>"})` returns one tool's spec under a fresh id, which `request({id, input})` then runs as in step 3. Both are free: no routing decision, no routing fee and no payment. A browse sends only the words of the need; a `tool` call sends only the id. The hooks still route each lookup as above.
|
|
142
160
|
6. Some lines offer a choice of services for the same step, such as several image models. Your assistant uses the one you named or asked to compare, asks you when you have not said and you are there to answer, and otherwise uses the line's default, then calls `request({id, choice, input})`. One choice runs exactly as that service's own offer. `all` runs every choice side by side, each paid once to its own provider, but only after each is quoted at its live price and the whole set's total fits your limits: within `maxAutoSpend`, which is per call, and inside the day's `sessionBudget`. A set that does not fit returns `needs_approval` with nothing paid, and in Claude Code runs once you approve it. The result lists each choice with its cost and the file it saved under `~/.tenjin/downloads/`.
|
|
@@ -156,7 +174,7 @@ To stop the router without removing anything, `tenjin config set router.enabled
|
|
|
156
174
|
- When your assistant hands a task to a subagent: that task, as the current message, with the same bounded turn before it.
|
|
157
175
|
- When your assistant asks you a question (`AskUserQuestion`): the questions and their options, attached to the same bounded turn, before you see them; and after you answer, your answers as the current message. Before the question, a fitting lookup redirects it once, under the same rules as a native call, and only when your spend limits and wallet would pay it without asking you; after it, a fitting lookup is offered beside your answers.
|
|
158
176
|
- Every hook request carries this session's id, so one session is not offered the same pay-per-call service twice.
|
|
159
|
-
- Every request also lists what this CLI can parse and run (`accepts`): `catalog`, `spec`, `label` and `
|
|
177
|
+
- Every request also lists what this CLI can parse and run (`accepts`): `catalog`, `spec`, `label`, `fields`, `jobs` and `note`, plus `bazaar` while the open Bazaar is on. The server sends a field only to a CLI that lists it: `label` brings each tool's display name and the line that starts at it, and `fields` brings which input takes a pending search or URL, what kind of result a tool returns (files are saved only when it says `media`), and how the free docs lookup is delivered, and `note` brings the free docs line after a search in place of docs added to it. A server change to a tool then reaches an installed CLI without a new release.
|
|
160
178
|
- With `router.context turn`, no prior messages are sent: the prompt on a prompt, your latest message on a native call, and the task on a delegation. `tenjin config set router.context turn` sets it for this machine, and `--project` for this repository.
|
|
161
179
|
- Slash commands and one-word acknowledgements are never sent at all.
|
|
162
180
|
- With `tenjin config set experimental.bazaar on` (off by default), short snippets of your prompts also go to Coinbase's public x402 Bazaar search, so the router can suggest unreviewed sellers listed there.
|
|
@@ -168,7 +186,9 @@ The answer can put one line into your session, or into a task your assistant del
|
|
|
168
186
|
|
|
169
187
|
## Wallet passphrase storage
|
|
170
188
|
|
|
171
|
-
The private key is generated on your machine and stored encrypted in `~/.tenjin/wallet.json`. Its passphrase is `TENJIN_WALLET_PASSPHRASE` when you set one,
|
|
189
|
+
The private key is generated on your machine and stored encrypted in `~/.tenjin/wallet.json`. Its passphrase is the first of these that opens it: `TENJIN_WALLET_PASSPHRASE` when you set one, else the passphrase Tenjin saved. Tenjin saves it the way the GitHub CLI saves its token: in the platform's own credential store where there is one (Keychain on macOS, Secret Service on Linux, DPAPI on Windows), and otherwise in a file only you can read (`~/.tenjin/passphrase.<address>.plain`, mode 0600). `tenjin wallet create --insecure-storage` picks the file even where a keychain exists; it is a choice you make, never the fix for a locked keychain. A passphrase you give in `TENJIN_WALLET_PASSPHRASE` when the wallet is created is saved the same way, so Claude Code does not need the variable afterwards. `tenjin wallet create` and `tenjin install` say in one line where it went. That choice is recorded in `~/.tenjin/passphrase-store.json`, beside the wallet. `wallet.json` itself is never rewritten, so an older CLI still reads it, and with no such record Tenjin behaves as it did before. The file is the trade-off: anyone who can read your home folder as you can open this wallet, which is one more reason to keep it a pocket-money wallet. A keychain that does not answer never stalls Claude Code: a lookup stops waiting within its time budget and takes the free path, while the keychain request stays open so you can answer an unlock prompt. Saving a passphrase waits up to 10 seconds, or up to a minute at a terminal, where it says it is waiting. A locked keychain is fixed by unlocking it (or logging in to the desktop session) and retrying; Tenjin never quietly switches to the file or to another passphrase. A `TENJIN_WALLET_PASSPHRASE` that does not open the wallet no longer blocks it: the saved passphrase is tried next, and Claude Code tells you once that the variable is set but wrong and to remove it. A correct variable still wins.
|
|
190
|
+
|
|
191
|
+
A wallet whose passphrase was never saved is fixed with `tenjin wallet repair`, which is never pre-approved for an agent: you run it. (Before 0.1.0-alpha.31, a passphrase given in the variable when the wallet was created was never saved, and one typed at the create prompt was not saved either, since create prompted only when no keychain answered.) Run it yourself in a terminal: it asks for the passphrase there (or uses `TENJIN_WALLET_PASSPHRASE` when that opens the wallet). Never paste the passphrase into chat, and never put it on a command line. It checks that the passphrase opens the wallet (the address does not change), saves it as above, and names a `TENJIN_WALLET_PASSPHRASE` in that shell that conflicts with it. Then it tells you to start a new Claude Code session. Saving is not the proof: the next session says "Tenjin wallet unlocked", or why not, and `tenjin doctor` shows what that session's router saw. See [Troubleshooting](./troubleshooting.md).
|
|
172
192
|
|
|
173
193
|
Decryption happens in this CLI, in a disposable worker thread, and the key never leaves the process. `tenjin mcp` decrypts once at start so a lookup does not wait for it, holds the signer for the session, and exits with the session.
|
|
174
194
|
|
|
@@ -186,11 +206,13 @@ A subagent is only redirected or offered a lookup when it is known to have `mcp_
|
|
|
186
206
|
|
|
187
207
|
## Codex
|
|
188
208
|
|
|
189
|
-
|
|
209
|
+
Codex support is experimental.
|
|
210
|
+
|
|
211
|
+
`tenjin install` sets up Codex when Codex's agent runs it, or in a terminal when this machine has Codex (`codex --version` must answer; a name on PATH is not enough). With both Claude Code and Codex there, a terminal install asks which, both selected; `--yes`, `--json` or no terminal takes both. `--harness claude|codex` picks one instead. An agent's install that also finds the other agent ends with one line, in `notices`, telling the agent to ask whether to set up Tenjin there too and, on yes, to run `tenjin install --harness <other>`. Install records the agents it set up in `installed-hosts.json` in your Tenjin data dir, and `tenjin doctor` and `tenjin uninstall` check or remove each one recorded (Claude Code on a machine set up before the record). For Codex, install writes the wallet, the spend limits and the Codex plugin through `codex plugin add`, and no Codex config. The plugin is added from `~/.tenjin/runtime/codex`, and its server runs the `tenjin` launcher in that folder by absolute path, so a Node upgrade or `npm rm -g tenjin-cli` does not stop it and an update changes nothing Codex has trusted; its hooks name no path at all. If the runtime cannot be set up, installation stops and preserves the previous registration. Moving an existing Codex plugin to the runtime moves its hooks file, and install turns those hooks on again as below. Its spend limits follow the same defaults as Claude Code: `--yes` takes them, `--max-auto-spend <usd>` (at least 0.25) and `--session-budget <usd|none>` set your own, and a terminal asks once while the config file names neither limit. With no answer it writes neither, the defaults ($0.25 a call, $5 a day) hold, and the spend question comes back in `nextSteps` with `tenjin install` as its command. The plugin carries five hooks. Three are routing legs: the prompt, and one web call (a search, a page open, or a batch of them) before it runs and after, where a batch is blocked at most once and the block names the rest of the call to run as written. Each leg is an `mcp_tool` hook that Codex sends to the plugin's `router` server, the same `tenjin mcp` that carries the request tool, so the leg pays the $0.003 routing fee from your wallet under your spend limits, as a request does; these need Codex 0.149.0 or later, and on an older Codex install and update leave its plugin copy as it is. The fourth is a `PreToolUse` hook that denies `mcp__router__hook` to your assistant, since only the hooks call that tool. The fifth is a `PermissionRequest` hook on `mcp__router__request` that answers allow. That last hook is how the request tool runs without a prompt, `approval_policy = "never"` included: Codex runs hooks before its approval policy. It covers the request tool alone, and your spend limits still bound every payment. Install turns the five hooks on, as installing a Claude Code plugin does: it reads Tenjin's own rows and the hash Codex computed for each from Codex's app server, writes them as trusted through the same `config/batchWrite` call `/hooks` makes, and reads them back to confirm. It never computes a hash, never touches another tool's hook, and leaves a hook you turned off in `/hooks` off. If that step fails, install says to approve Tenjin's hooks in `/hooks`.
|
|
190
212
|
|
|
191
|
-
The trade-off: the allow hook also overrides your own `approval_mode = "prompt"` for the request tool. To be asked before each call, turn that one hook off in `/hooks`; `tenjin doctor` then reports that the tool asks first, and under `approval_policy = "never"` that Codex refuses it. With that hook off, the router still blocks a web search once to point at the request tool. Where Codex then asks or refuses, a retry of that search runs: each search is blocked once at most, so the cost is one extra step. `tenjin uninstall` removes the plugin and its marketplace.
|
|
213
|
+
The trade-off: the allow hook also overrides your own `approval_mode = "prompt"` for the request tool. To be asked before each call, turn that one hook off in `/hooks`; `tenjin doctor` then reports that the tool asks first, and under `approval_policy = "never"` that Codex refuses it. With that hook off, the router still blocks a web search once to point at the request tool. Where Codex then asks or refuses, a retry of that search runs: each search is blocked once at most, so the cost is one extra step. `tenjin doctor` also checks, with nothing paid or sent, that the routing legs reach the `router` server and that your Codex can run them. A plugin copy from an earlier release runs its legs as commands, which cannot pay the routing fee and so route nothing, and the first prompt of each session says so. `tenjin update` replaces such a copy, only where Codex already has the plugin, and turns its new hooks on the same way; when it cannot, it prints one line saying to approve Tenjin's hooks in `/hooks`, and the update itself still succeeds. `tenjin uninstall` removes the plugin and its marketplace.
|
|
192
214
|
|
|
193
215
|
## Other settings
|
|
194
216
|
|
|
195
217
|
- `tenjin wallet send <amount> USDC <address>` moves funds out. It needs a per-send cap (`tenjin config set sendMaxAmount <usd>`) and a little ETH on Base for gas.
|
|
196
|
-
-
|
|
218
|
+
- Where Tenjin's runtime is set up, Tenjin updates itself at most once a day, the way `tenjin update` does, but only to a release published at least 24 hours earlier: at the start of a Claude Code or Codex session, it starts that update in the background on the runtime's own Node, which checks the new version before switching to it, keeps the previous one, never moves to an older one and never runs npm. Both Claude Code and Codex run the new version from their next session. `tenjin doctor` shows the last result. `tenjin config set update.mode nudge` only reports a newer version, and `off` stops the check. Without a runtime, the CLI checks npm at most once a day and reports a newer version.
|