tenjin-cli 0.1.0-alpha.34 → 0.1.0-alpha.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE.md +30 -0
- package/README.md +20 -18
- package/dist/{_esm-MMYV66AX.js → _esm-2KST7HQ7.js} +4 -4
- package/dist/{alive-VOIL5W3I.js → alive-5TV22PNF.js} +13 -13
- package/dist/{auth-UHD3QFX4.js → auth-XI7BJFLW.js} +4 -4
- package/dist/balance-DFHC6XEU.js +71 -0
- package/dist/{ccip-CS7K5QRQ.js → ccip-HOW3DZYF.js} +3 -3
- package/dist/{chunk-RJ5HRPAZ.js → chunk-24XKUN2S.js} +68 -10
- package/dist/chunk-24XKUN2S.js.map +1 -0
- package/dist/chunk-2L7TDGLV.js +56 -0
- package/dist/chunk-2L7TDGLV.js.map +1 -0
- package/dist/{chunk-PZHBPGDE.js → chunk-34SAECKZ.js} +34 -10
- package/dist/chunk-34SAECKZ.js.map +1 -0
- package/dist/{chunk-EQZ2CCWC.js → chunk-3Y2EHT4F.js} +5 -2
- package/dist/chunk-3Y2EHT4F.js.map +1 -0
- package/dist/{chunk-FSYH7J75.js → chunk-3Y6BHIN6.js} +3 -3
- package/dist/{chunk-FZZWTDWP.js → chunk-3YPL6T3P.js} +6 -6
- package/dist/{chunk-JEZMWJEF.js → chunk-44MVIRZH.js} +4 -4
- package/dist/{chunk-27FIHFXF.js → chunk-45MMSBHA.js} +5 -5
- package/dist/{chunk-QXP3Z3JN.js → chunk-4MBCJFY4.js} +35 -3
- package/dist/chunk-4MBCJFY4.js.map +1 -0
- package/dist/chunk-4TPL54KW.js +227 -0
- package/dist/chunk-4TPL54KW.js.map +1 -0
- package/dist/{chunk-7JB6SYJX.js → chunk-54ELBTKE.js} +2 -2
- package/dist/{chunk-6J64MQFD.js → chunk-5F4OB5B3.js} +21 -15
- package/dist/chunk-5F4OB5B3.js.map +1 -0
- package/dist/{chunk-PYVQ74D5.js → chunk-5HN4KVQU.js} +189 -117
- package/dist/chunk-5HN4KVQU.js.map +1 -0
- package/dist/{chunk-VFKPIIV2.js → chunk-5J4E5GYI.js} +35 -32
- package/dist/chunk-5J4E5GYI.js.map +1 -0
- package/dist/chunk-5USBZ2MU.js +58 -0
- package/dist/chunk-5USBZ2MU.js.map +1 -0
- package/dist/chunk-64WOMNYR.js +183 -0
- package/dist/chunk-64WOMNYR.js.map +1 -0
- package/dist/{chunk-APWELUI7.js → chunk-65RS4LQS.js} +57 -43
- package/dist/chunk-65RS4LQS.js.map +1 -0
- package/dist/{chunk-HWZO6HYZ.js → chunk-6QMDUDF2.js} +3 -3
- package/dist/{chunk-FNBGRKS6.js → chunk-7V25UAQO.js} +2 -2
- package/dist/chunk-BGA4DO5M.js +719 -0
- package/dist/chunk-BGA4DO5M.js.map +1 -0
- package/dist/chunk-BVP7YK2J.js +706 -0
- package/dist/chunk-BVP7YK2J.js.map +1 -0
- package/dist/chunk-C265QIMJ.js +83 -0
- package/dist/chunk-C265QIMJ.js.map +1 -0
- package/dist/{chunk-MXN2ZEUB.js → chunk-D6M3ZK66.js} +2 -2
- package/dist/chunk-D6M3ZK66.js.map +1 -0
- package/dist/chunk-DJ36BM62.js +78 -0
- package/dist/chunk-DJ36BM62.js.map +1 -0
- package/dist/{chunk-JOKPBYXP.js → chunk-DTEWAVNE.js} +2 -2
- package/dist/chunk-F2KJAJ7T.js +13 -0
- package/dist/chunk-F2KJAJ7T.js.map +1 -0
- package/dist/{chunk-KAILF7QA.js → chunk-F43CV6UC.js} +2 -2
- package/dist/{chunk-ACO7ZCR2.js → chunk-FKVJKLPI.js} +2 -2
- package/dist/{chunk-43HLS2HM.js → chunk-FYFHH7V5.js} +54 -3
- package/dist/{chunk-43HLS2HM.js.map → chunk-FYFHH7V5.js.map} +1 -1
- package/dist/{chunk-2F5JUAHZ.js → chunk-GAJC4BQZ.js} +3 -3
- package/dist/{chunk-L7N73ZAW.js → chunk-HAZAN4UM.js} +2 -2
- package/dist/{chunk-6QJZA6EX.js → chunk-HI5XQOX2.js} +2 -2
- package/dist/{chunk-BOENA6XR.js → chunk-HKGUKAQW.js} +6 -6
- package/dist/{chunk-LJSCGIYH.js → chunk-HPRVFJPM.js} +2 -2
- package/dist/{chunk-OO6FIBL7.js → chunk-HZKANST2.js} +3 -6
- package/dist/chunk-HZKANST2.js.map +1 -0
- package/dist/{chunk-UVDJ5SSQ.js → chunk-I557SAOM.js} +8 -2
- package/dist/chunk-I557SAOM.js.map +1 -0
- package/dist/{chunk-SDUOJRSV.js → chunk-IGLWLH73.js} +3 -3
- package/dist/{chunk-3AKH7ODX.js → chunk-INSIW65E.js} +5 -5
- package/dist/{chunk-PNHNXUSL.js → chunk-IULCDMVG.js} +12 -1
- package/dist/chunk-IULCDMVG.js.map +1 -0
- package/dist/{chunk-JF4T4HCQ.js → chunk-IVNSUAVC.js} +10 -5
- package/dist/chunk-IVNSUAVC.js.map +1 -0
- package/dist/chunk-JDQZCREI.js +87 -0
- package/dist/chunk-JDQZCREI.js.map +1 -0
- package/dist/{chunk-2P3NJTHE.js → chunk-JHFFUVON.js} +23 -23
- package/dist/{chunk-7JVARP5R.js → chunk-JTILUN4W.js} +55 -29
- package/dist/{chunk-7JVARP5R.js.map → chunk-JTILUN4W.js.map} +1 -1
- package/dist/{chunk-2TO5F6CT.js → chunk-K5KNGC4I.js} +8 -8
- package/dist/{chunk-HUWTFKEM.js → chunk-KAQ4Q3TO.js} +3 -3
- package/dist/{chunk-E6VP6MQM.js → chunk-KGUE5AVX.js} +4 -4
- package/dist/chunk-KGUE5AVX.js.map +1 -0
- package/dist/{chunk-GS5RZF7U.js → chunk-KLDMLWXT.js} +2 -2
- package/dist/{chunk-HN2EN6P4.js → chunk-KNKDMTHU.js} +5 -5
- package/dist/chunk-LDA6TAYQ.js +95 -0
- package/dist/chunk-LDA6TAYQ.js.map +1 -0
- package/dist/chunk-LWSSIZOY.js +347 -0
- package/dist/chunk-LWSSIZOY.js.map +1 -0
- package/dist/{chunk-5VWQSCDO.js → chunk-MAHNZA6C.js} +89 -9
- package/dist/chunk-MAHNZA6C.js.map +1 -0
- package/dist/{chunk-46HAB26L.js → chunk-MEWZCIA6.js} +56 -9
- package/dist/chunk-MEWZCIA6.js.map +1 -0
- package/dist/{chunk-R2KMLONN.js → chunk-MJDO4EXD.js} +4 -4
- package/dist/{chunk-IHVUE3XF.js → chunk-NJA6NT3A.js} +3 -3
- package/dist/{chunk-TSIID2LV.js → chunk-ODRPASFP.js} +375 -1166
- package/dist/chunk-ODRPASFP.js.map +1 -0
- package/dist/{chunk-S3JKF3IK.js → chunk-OJJFANO6.js} +3 -3
- package/dist/{chunk-56SOPRM2.js → chunk-OQWPRFAC.js} +344 -4
- package/dist/chunk-OQWPRFAC.js.map +1 -0
- package/dist/{chunk-QEZZDIQT.js → chunk-P6YQWIT2.js} +4053 -4039
- package/dist/chunk-P6YQWIT2.js.map +1 -0
- package/dist/{chunk-GGGEGMWC.js → chunk-Q6RSJCXB.js} +9 -9
- package/dist/{chunk-OTIUEUIS.js → chunk-QKEUKBRK.js} +7 -7
- package/dist/{chunk-X52BVGCJ.js → chunk-QQDPRTLP.js} +5 -5
- package/dist/chunk-QQYCYAKI.js +79 -0
- package/dist/chunk-QQYCYAKI.js.map +1 -0
- package/dist/chunk-R4KDH477.js +1064 -0
- package/dist/chunk-R4KDH477.js.map +1 -0
- package/dist/{chunk-6AQSUBNR.js → chunk-RGCPELQN.js} +2 -2
- package/dist/{chunk-AXODGQ23.js → chunk-RGVCOG2S.js} +9 -2
- package/dist/{chunk-AXODGQ23.js.map → chunk-RGVCOG2S.js.map} +1 -1
- package/dist/chunk-SOLNJ3AZ.js +209 -0
- package/dist/chunk-SOLNJ3AZ.js.map +1 -0
- package/dist/{chunk-LQ33RLHL.js → chunk-TFT2X7SH.js} +3 -3
- package/dist/chunk-TVWCLUBI.js +293 -0
- package/dist/chunk-TVWCLUBI.js.map +1 -0
- package/dist/{chunk-VH7JMLTG.js → chunk-UIB33QQP.js} +25 -16
- package/dist/chunk-UIB33QQP.js.map +1 -0
- package/dist/chunk-V6GIVALQ.js +1889 -0
- package/dist/chunk-V6GIVALQ.js.map +1 -0
- package/dist/{chunk-IVHGQNIN.js → chunk-VHXCPXUS.js} +8 -8
- package/dist/{chunk-7DW7GAM6.js → chunk-VU6GMWF6.js} +2 -2
- package/dist/chunk-VWZYE3NC.js +8415 -0
- package/dist/chunk-VWZYE3NC.js.map +1 -0
- package/dist/{chunk-3X4GOMXT.js → chunk-W2GXIARJ.js} +12 -7
- package/dist/chunk-W2GXIARJ.js.map +1 -0
- package/dist/chunk-W4G3K3V7.js +288 -0
- package/dist/chunk-W4G3K3V7.js.map +1 -0
- package/dist/{chunk-FHXTEVO7.js → chunk-W74LJ5OT.js} +21 -28
- package/dist/chunk-W74LJ5OT.js.map +1 -0
- package/dist/{chunk-FOEPH67T.js → chunk-W7ELYLYK.js} +1 -74
- package/dist/chunk-W7ELYLYK.js.map +1 -0
- package/dist/{chunk-YU3DLVSQ.js → chunk-XSCGUO2U.js} +5 -5
- package/dist/{chunk-EPCIJLLU.js → chunk-XWROSMI5.js} +9 -9
- package/dist/{chunk-HMT6L65V.js → chunk-YJGEVBKZ.js} +4 -4
- package/dist/{chunk-7U3P4PB7.js → chunk-ZEYA2WWX.js} +4 -4
- package/dist/chunk-ZEYA2WWX.js.map +1 -0
- package/dist/chunk-ZRC7Z5X3.js +82 -0
- package/dist/chunk-ZRC7Z5X3.js.map +1 -0
- package/dist/{chunk-I47ARU5G.js → chunk-ZS7JIUJ3.js} +2 -2
- package/dist/{claude-cli-2YKABJJZ.js → claude-cli-GIIHOBGT.js} +4 -2
- package/dist/claude-install-BAUSJMW3.js +64 -0
- package/dist/{cli-BFDKEX53.js → cli-QY4KKA3D.js} +116 -49
- package/dist/cli-QY4KKA3D.js.map +1 -0
- package/dist/{client-XMWEKXX7.js → client-3YQKORVK.js} +4 -4
- package/dist/{codex-host-B6NAUWL6.js → codex-host-ZON3S6HU.js} +5 -5
- package/dist/{codex-install-GTGO5FYN.js → codex-install-HZV2DOAB.js} +62 -47
- package/dist/codex-install-HZV2DOAB.js.map +1 -0
- package/dist/{config-THJANIU5.js → config-QZOBMTEL.js} +18 -18
- package/dist/{config-names-JU54HYWY.js → config-names-Z5NZD5R2.js} +18 -18
- package/dist/{config-rules-VNU23RL4.js → config-rules-YOYHS6YL.js} +19 -19
- package/dist/config-subagents-WQV2ZAD5.js +362 -0
- package/dist/config-subagents-WQV2ZAD5.js.map +1 -0
- package/dist/{connect-HPWS7U63.js → connect-YDWTYU4B.js} +28 -27
- package/dist/{connect-HPWS7U63.js.map → connect-YDWTYU4B.js.map} +1 -1
- package/dist/core-0a66n3e7-TTP554XV.js +127 -0
- package/dist/core-0a66n3e7-TTP554XV.js.map +1 -0
- package/dist/core-0bmnpbz2-C2JIRVZO.js +10790 -0
- package/dist/core-0bmnpbz2-C2JIRVZO.js.map +1 -0
- package/dist/core-9je8ee1j-74DGHWPV.js +30 -0
- package/dist/core-9je8ee1j-74DGHWPV.js.map +1 -0
- package/dist/core-wadgcjfh-TSZFQZGH.js +666 -0
- package/dist/core-wadgcjfh-TSZFQZGH.js.map +1 -0
- package/dist/core-zg882d22-LKV5DZYW.js +37 -0
- package/dist/core-zg882d22-LKV5DZYW.js.map +1 -0
- package/dist/{decision-JIIHDTOF.js → decision-QSKHOGCO.js} +6 -6
- package/dist/{doctor-4MMHBRDU.js → doctor-ZWJXRD75.js} +67 -66
- package/dist/doctor-ZWJXRD75.js.map +1 -0
- package/dist/{explicit-AGENAX6E.js → explicit-ME2NRADQ.js} +45 -42
- package/dist/{explicit-AGENAX6E.js.map → explicit-ME2NRADQ.js.map} +1 -1
- package/dist/flush-stdio-NYIJ3QXT.js +18 -0
- package/dist/{fund-MLXUH24Q.js → fund-VF7TLDJH.js} +110 -34
- package/dist/fund-VF7TLDJH.js.map +1 -0
- package/dist/{hook-command-UB7FOEUL.js → hook-command-VZ27MGWO.js} +21 -20
- 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/hook-data.ts +152 -0
- package/dist/hosts/claude/tenjin/hooks/hooks.json +7 -0
- package/dist/hosts/claude/tenjin/hooks/model-viewer.tsx +2987 -0
- package/dist/hosts/claude/tenjin/hooks/register.tsx +265 -30
- package/dist/hosts/claude/tenjin/skills/tenjin-pay/SKILL.md +14 -4
- package/dist/hosts/claude/tenjin/types/index.d.ts +133 -0
- package/dist/{hosts-WNQKYKP2.js → hosts-3EMTVM4H.js} +5 -3
- package/dist/index.js +16 -13
- package/dist/index.js.map +1 -1
- package/dist/{install-Q5SHHEDH.js → install-ZA7L2UF3.js} +34 -30
- package/dist/{install-funding-EGSW2KEP.js → install-funding-JDGYTF72.js} +9 -13
- package/dist/{install-identity-OID43B4D.js → install-identity-FFAYEFLX.js} +8 -8
- package/dist/{install-wallet-TZFWY5GK.js → install-wallet-2SFOVE3Q.js} +48 -33
- package/dist/{install-wallet-TZFWY5GK.js.map → install-wallet-2SFOVE3Q.js.map} +1 -1
- package/dist/mcp-36S6MK3C.js +67642 -0
- package/dist/mcp-36S6MK3C.js.map +1 -0
- package/dist/new-install-5L4GY3LN.js +51 -0
- package/dist/{package-NRHU7HBR.js → package-BONDXSV3.js} +2 -2
- package/dist/{passphrase-3JEVW5XG.js → passphrase-T4ULBN4M.js} +4 -4
- package/dist/{pay-I47AIUQR.js → pay-CMV5KL74.js} +37 -30
- package/dist/{payments-A5FNI5GN.js → payments-Z6UBZL4Z.js} +10 -10
- package/dist/reclaim-subagent-credit-ABSF67SJ.js +105 -0
- package/dist/reclaim-subagent-credit-ABSF67SJ.js.map +1 -0
- package/dist/{routing-quote-QQW2I5MH.js → routing-quote-AHLAREXR.js} +16 -18
- package/dist/{run-4SHEOBIU.js → run-JH7ELYAM.js} +41 -38
- package/dist/{runtime-BABJMHY7.js → runtime-2GX4ALJP.js} +12 -12
- package/dist/{runtime-activate-N6VLQI2C.js → runtime-activate-IDQ2NCSP.js} +9 -9
- package/dist/{runtime-launchers-GMAUICRW.js → runtime-launchers-YAPKCBHV.js} +7 -7
- package/dist/{runtime-place-DOEWFTF3.js → runtime-place-4POL4KK4.js} +3 -3
- package/dist/{send-ECXS6JEO.js → send-ELXFKEKY.js} +17 -17
- package/dist/{status-AHE5HSR7.js → status-FXUFWJDM.js} +89 -36
- package/dist/status-FXUFWJDM.js.map +1 -0
- package/dist/{status-line-63XFJAXR.js → status-line-IH5JBWBC.js} +11 -11
- package/dist/{streamableHttp-Z3YF6LTQ.js → streamableHttp-CP2ZQBIK.js} +4 -4
- package/dist/{uninstall-YGQPRCVY.js → uninstall-LJZUKM4D.js} +42 -38
- package/dist/{uninstall-YGQPRCVY.js.map → uninstall-LJZUKM4D.js.map} +1 -1
- package/dist/{update-GTLMLFA3.js → update-EUIX72IX.js} +34 -30
- package/dist/{usage-FCWP2CHO.js → usage-EKDC7LUC.js} +13 -13
- package/dist/{usdc-25RNBYYR.js → usdc-YIHK2OMC.js} +5 -5
- package/dist/{viemAdapter-By13KInL-3CG63XDX.js → viemAdapter-By13KInL-PRLSIESK.js} +2 -2
- package/dist/viemAdapter-By13KInL-PRLSIESK.js.map +1 -0
- package/dist/wallet-HSW757W6.js +80 -0
- package/dist/wallet-HSW757W6.js.map +1 -0
- package/docs/agent-permissions.md +19 -11
- package/docs/router-reference.md +21 -12
- package/docs/safety-model.md +4 -2
- package/docs/subagents-internals.md +97 -0
- package/docs/subagents.md +348 -0
- package/package.json +4 -1
- package/dist/balance-RQW5T5FB.js +0 -55
- package/dist/chunk-3X4GOMXT.js.map +0 -1
- package/dist/chunk-46HAB26L.js.map +0 -1
- package/dist/chunk-56SOPRM2.js.map +0 -1
- package/dist/chunk-5VWQSCDO.js.map +0 -1
- package/dist/chunk-6J64MQFD.js.map +0 -1
- package/dist/chunk-7U3P4PB7.js.map +0 -1
- package/dist/chunk-APWELUI7.js.map +0 -1
- package/dist/chunk-E6VP6MQM.js.map +0 -1
- package/dist/chunk-EQZ2CCWC.js.map +0 -1
- package/dist/chunk-FHXTEVO7.js.map +0 -1
- package/dist/chunk-FOEPH67T.js.map +0 -1
- package/dist/chunk-IVXPIIZJ.js +0 -91
- package/dist/chunk-IVXPIIZJ.js.map +0 -1
- package/dist/chunk-JF4T4HCQ.js.map +0 -1
- package/dist/chunk-LPQNZKSG.js +0 -269
- package/dist/chunk-LPQNZKSG.js.map +0 -1
- package/dist/chunk-MXN2ZEUB.js.map +0 -1
- package/dist/chunk-OO6FIBL7.js.map +0 -1
- package/dist/chunk-PNHNXUSL.js.map +0 -1
- package/dist/chunk-PYVQ74D5.js.map +0 -1
- package/dist/chunk-PZHBPGDE.js.map +0 -1
- package/dist/chunk-QEZZDIQT.js.map +0 -1
- package/dist/chunk-QXP3Z3JN.js.map +0 -1
- package/dist/chunk-RJ5HRPAZ.js.map +0 -1
- package/dist/chunk-TSIID2LV.js.map +0 -1
- package/dist/chunk-UVDJ5SSQ.js.map +0 -1
- package/dist/chunk-VFKPIIV2.js.map +0 -1
- package/dist/chunk-VH7JMLTG.js.map +0 -1
- package/dist/claude-install-7CVYQ73E.js +0 -60
- package/dist/cli-BFDKEX53.js.map +0 -1
- package/dist/codex-install-GTGO5FYN.js.map +0 -1
- package/dist/doctor-4MMHBRDU.js.map +0 -1
- package/dist/fund-MLXUH24Q.js.map +0 -1
- package/dist/mcp-CC3H7LFO.js +0 -3655
- package/dist/mcp-CC3H7LFO.js.map +0 -1
- package/dist/status-AHE5HSR7.js.map +0 -1
- package/dist/wallet-CJGEHP2Q.js +0 -64
- /package/dist/{_esm-MMYV66AX.js.map → _esm-2KST7HQ7.js.map} +0 -0
- /package/dist/{alive-VOIL5W3I.js.map → alive-5TV22PNF.js.map} +0 -0
- /package/dist/{auth-UHD3QFX4.js.map → auth-XI7BJFLW.js.map} +0 -0
- /package/dist/{balance-RQW5T5FB.js.map → balance-DFHC6XEU.js.map} +0 -0
- /package/dist/{ccip-CS7K5QRQ.js.map → ccip-HOW3DZYF.js.map} +0 -0
- /package/dist/{chunk-FSYH7J75.js.map → chunk-3Y6BHIN6.js.map} +0 -0
- /package/dist/{chunk-FZZWTDWP.js.map → chunk-3YPL6T3P.js.map} +0 -0
- /package/dist/{chunk-JEZMWJEF.js.map → chunk-44MVIRZH.js.map} +0 -0
- /package/dist/{chunk-27FIHFXF.js.map → chunk-45MMSBHA.js.map} +0 -0
- /package/dist/{chunk-7JB6SYJX.js.map → chunk-54ELBTKE.js.map} +0 -0
- /package/dist/{chunk-HWZO6HYZ.js.map → chunk-6QMDUDF2.js.map} +0 -0
- /package/dist/{chunk-FNBGRKS6.js.map → chunk-7V25UAQO.js.map} +0 -0
- /package/dist/{chunk-JOKPBYXP.js.map → chunk-DTEWAVNE.js.map} +0 -0
- /package/dist/{chunk-KAILF7QA.js.map → chunk-F43CV6UC.js.map} +0 -0
- /package/dist/{chunk-ACO7ZCR2.js.map → chunk-FKVJKLPI.js.map} +0 -0
- /package/dist/{chunk-2F5JUAHZ.js.map → chunk-GAJC4BQZ.js.map} +0 -0
- /package/dist/{chunk-L7N73ZAW.js.map → chunk-HAZAN4UM.js.map} +0 -0
- /package/dist/{chunk-6QJZA6EX.js.map → chunk-HI5XQOX2.js.map} +0 -0
- /package/dist/{chunk-BOENA6XR.js.map → chunk-HKGUKAQW.js.map} +0 -0
- /package/dist/{chunk-LJSCGIYH.js.map → chunk-HPRVFJPM.js.map} +0 -0
- /package/dist/{chunk-SDUOJRSV.js.map → chunk-IGLWLH73.js.map} +0 -0
- /package/dist/{chunk-3AKH7ODX.js.map → chunk-INSIW65E.js.map} +0 -0
- /package/dist/{chunk-2P3NJTHE.js.map → chunk-JHFFUVON.js.map} +0 -0
- /package/dist/{chunk-2TO5F6CT.js.map → chunk-K5KNGC4I.js.map} +0 -0
- /package/dist/{chunk-HUWTFKEM.js.map → chunk-KAQ4Q3TO.js.map} +0 -0
- /package/dist/{chunk-GS5RZF7U.js.map → chunk-KLDMLWXT.js.map} +0 -0
- /package/dist/{chunk-HN2EN6P4.js.map → chunk-KNKDMTHU.js.map} +0 -0
- /package/dist/{chunk-R2KMLONN.js.map → chunk-MJDO4EXD.js.map} +0 -0
- /package/dist/{chunk-IHVUE3XF.js.map → chunk-NJA6NT3A.js.map} +0 -0
- /package/dist/{chunk-S3JKF3IK.js.map → chunk-OJJFANO6.js.map} +0 -0
- /package/dist/{chunk-GGGEGMWC.js.map → chunk-Q6RSJCXB.js.map} +0 -0
- /package/dist/{chunk-OTIUEUIS.js.map → chunk-QKEUKBRK.js.map} +0 -0
- /package/dist/{chunk-X52BVGCJ.js.map → chunk-QQDPRTLP.js.map} +0 -0
- /package/dist/{chunk-6AQSUBNR.js.map → chunk-RGCPELQN.js.map} +0 -0
- /package/dist/{chunk-LQ33RLHL.js.map → chunk-TFT2X7SH.js.map} +0 -0
- /package/dist/{chunk-IVHGQNIN.js.map → chunk-VHXCPXUS.js.map} +0 -0
- /package/dist/{chunk-7DW7GAM6.js.map → chunk-VU6GMWF6.js.map} +0 -0
- /package/dist/{chunk-YU3DLVSQ.js.map → chunk-XSCGUO2U.js.map} +0 -0
- /package/dist/{chunk-EPCIJLLU.js.map → chunk-XWROSMI5.js.map} +0 -0
- /package/dist/{chunk-HMT6L65V.js.map → chunk-YJGEVBKZ.js.map} +0 -0
- /package/dist/{chunk-I47ARU5G.js.map → chunk-ZS7JIUJ3.js.map} +0 -0
- /package/dist/{claude-cli-2YKABJJZ.js.map → claude-cli-GIIHOBGT.js.map} +0 -0
- /package/dist/{claude-install-7CVYQ73E.js.map → claude-install-BAUSJMW3.js.map} +0 -0
- /package/dist/{client-XMWEKXX7.js.map → client-3YQKORVK.js.map} +0 -0
- /package/dist/{codex-host-B6NAUWL6.js.map → codex-host-ZON3S6HU.js.map} +0 -0
- /package/dist/{config-THJANIU5.js.map → config-QZOBMTEL.js.map} +0 -0
- /package/dist/{config-names-JU54HYWY.js.map → config-names-Z5NZD5R2.js.map} +0 -0
- /package/dist/{config-rules-VNU23RL4.js.map → config-rules-YOYHS6YL.js.map} +0 -0
- /package/dist/{decision-JIIHDTOF.js.map → decision-QSKHOGCO.js.map} +0 -0
- /package/dist/{hook-command-UB7FOEUL.js.map → flush-stdio-NYIJ3QXT.js.map} +0 -0
- /package/dist/{hosts-WNQKYKP2.js.map → hook-command-VZ27MGWO.js.map} +0 -0
- /package/dist/{install-Q5SHHEDH.js.map → hosts-3EMTVM4H.js.map} +0 -0
- /package/dist/{install-funding-EGSW2KEP.js.map → install-ZA7L2UF3.js.map} +0 -0
- /package/dist/{install-identity-OID43B4D.js.map → install-funding-JDGYTF72.js.map} +0 -0
- /package/dist/{package-NRHU7HBR.js.map → install-identity-FFAYEFLX.js.map} +0 -0
- /package/dist/{passphrase-3JEVW5XG.js.map → new-install-5L4GY3LN.js.map} +0 -0
- /package/dist/{pay-I47AIUQR.js.map → package-BONDXSV3.js.map} +0 -0
- /package/dist/{routing-quote-QQW2I5MH.js.map → passphrase-T4ULBN4M.js.map} +0 -0
- /package/dist/{run-4SHEOBIU.js.map → pay-CMV5KL74.js.map} +0 -0
- /package/dist/{payments-A5FNI5GN.js.map → payments-Z6UBZL4Z.js.map} +0 -0
- /package/dist/{runtime-activate-N6VLQI2C.js.map → routing-quote-AHLAREXR.js.map} +0 -0
- /package/dist/{runtime-launchers-GMAUICRW.js.map → run-JH7ELYAM.js.map} +0 -0
- /package/dist/{runtime-BABJMHY7.js.map → runtime-2GX4ALJP.js.map} +0 -0
- /package/dist/{runtime-place-DOEWFTF3.js.map → runtime-activate-IDQ2NCSP.js.map} +0 -0
- /package/dist/{update-GTLMLFA3.js.map → runtime-launchers-YAPKCBHV.js.map} +0 -0
- /package/dist/{usdc-25RNBYYR.js.map → runtime-place-4POL4KK4.js.map} +0 -0
- /package/dist/{send-ECXS6JEO.js.map → send-ELXFKEKY.js.map} +0 -0
- /package/dist/{status-line-63XFJAXR.js.map → status-line-IH5JBWBC.js.map} +0 -0
- /package/dist/{streamableHttp-Z3YF6LTQ.js.map → streamableHttp-CP2ZQBIK.js.map} +0 -0
- /package/dist/{viemAdapter-By13KInL-3CG63XDX.js.map → update-EUIX72IX.js.map} +0 -0
- /package/dist/{usage-FCWP2CHO.js.map → usage-EKDC7LUC.js.map} +0 -0
- /package/dist/{wallet-CJGEHP2Q.js.map → usdc-YIHK2OMC.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/router/uninstall.ts"],"sourcesContent":["import { 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 { isDefaultDataDir, realOr, runtimeDir, tilde } from '../lib/paths';\nimport { hasRuntime } 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 { claudeInstallAt, settingsInstallPaths } from './claude-install';\nimport { projectInstallAt } 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 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 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 realOr(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 realOr(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 realOr(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 realOr(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 realOr(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 realOr(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 : realOr(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 return claudeInstallAt('user', env, home, home, ['folder', 'settings']);\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\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/**\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-launchers.ts`'s and `runtime-activate.ts`'s. */\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 both runtime modules are\n * loaded 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 removeLaunchers =\n deps.removeLaunchers ?? (await import('../lib/runtime-launchers')).removeLaunchers;\n const removeRuntime =\n deps.removeRuntime ?? (await import('../lib/runtime-activate')).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,YAAY;AACrB,SAAS,eAAe;AACxB,SAAS,YAAY,SAAS,WAAW;AAoEzC,IAAM,OAAO;AAEb,IAAM,QAAQ,OAAO,UAClB,MAAM,KAAK,IAAI,EAAE,MAAM,MAAM,IAAI,IAAI,YAAY,MAAM;AAG1D,SAAS,OAAO,KAAa,QAAyB;AACpD,SAAO,QAAQ,UAAU,IAAI,WAAW,OAAO,SAAS,GAAG,IAAI,SAAS,GAAG,MAAM,GAAG,GAAG,EAAE;AAC3F;AAEA,SAAS,cAAwB;AAC/B,SAAO,IAAI,SAAS,WAAW,gEAAgE;AAAA,IAC7F,KAAK,6FAA6F,SAAS;AAAA,EAC7G,CAAC;AACH;AAWA,eAAe,eACb,SACA,KACA,MACiD;AACjD,QAAM,SAAS,MAAM,iBAAiB,KAAK,IAAI;AAC/C,MAAI,WAAW,KAAM,OAAM,YAAY;AACvC,QAAM,UAAU,MAAM,cAAc,OAAO,EAAE,MAAM,MAAM,IAAI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AA,MACJ,QAAQ,KAAK,WAAW,IACpB,4BAA4B,MAAM,MAAM,IAAI,CAAC,KAC7C,4BAA4B,MAAM,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":[]}
|
|
1
|
+
{"version":3,"sources":["../src/router/uninstall.ts"],"sourcesContent":["import { 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 { isDefaultDataDir, realOr, runtimeDir, tilde } from '../lib/paths';\nimport { hasRuntime } 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 { claudeInstallAt, settingsInstallPaths } from './claude-install';\nimport { projectInstallAt } 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 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 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 realOr(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 realOr(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 realOr(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 realOr(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 realOr(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 realOr(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 : realOr(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 return claudeInstallAt('user', env, home, home, ['folder', 'settings']);\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\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/**\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-launchers.ts`'s and `runtime-activate.ts`'s. */\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 both runtime modules are\n * loaded 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 removeLaunchers =\n deps.removeLaunchers ?? (await import('../lib/runtime-launchers')).removeLaunchers;\n const removeRuntime =\n deps.removeRuntime ?? (await import('../lib/runtime-activate')).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,YAAY;AACrB,SAAS,eAAe;AACxB,SAAS,YAAY,SAAS,WAAW;AAoEzC,IAAM,OAAO;AAEb,IAAM,QAAQ,OAAO,UAClB,MAAM,KAAK,IAAI,EAAE,MAAM,MAAM,IAAI,IAAI,YAAY,MAAM;AAG1D,SAAS,OAAO,KAAa,QAAyB;AACpD,SAAO,QAAQ,UAAU,IAAI,WAAW,OAAO,SAAS,GAAG,IAAI,SAAS,GAAG,MAAM,GAAG,GAAG,EAAE;AAC3F;AAEA,SAAS,cAAwB;AAC/B,SAAO,IAAI,SAAS,WAAW,gEAAgE;AAAA,IAC7F,KAAK,6FAA6F,SAAS;AAAA,EAC7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,EACzF;AACA,MAAI,QAAQ,UAAU,MAAM;AAC1B,UAAM,KAAK,yBAAyB,MAAM,MAAM,IAAI,CAAC,KAAK,QAAQ,KAAK,EAAE;AAAA,EAC3E,WAAW,QAAQ,WAAW,QAAQ,KAAK,SAAS,GAAG;AACrD,UAAM;AAAA,MACJ,QAAQ,KAAK,WAAW,IACpB,4BAA4B,MAAM,MAAM,IAAI,CAAC,KAC7C,4BAA4B,MAAM,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":[]}
|
|
@@ -4,55 +4,59 @@ import {
|
|
|
4
4
|
runUpdate,
|
|
5
5
|
spawnCapture,
|
|
6
6
|
versionFreeEntry
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-65RS4LQS.js";
|
|
8
|
+
import "./chunk-QKEUKBRK.js";
|
|
9
9
|
import "./chunk-Y2EXZ47H.js";
|
|
10
|
+
import "./chunk-F43CV6UC.js";
|
|
10
11
|
import "./chunk-HQR4BWKX.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-OJJFANO6.js";
|
|
13
|
+
import "./chunk-34SAECKZ.js";
|
|
14
|
+
import "./chunk-I557SAOM.js";
|
|
15
|
+
import "./chunk-IULCDMVG.js";
|
|
15
16
|
import "./chunk-WXA3WTPF.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-KAILF7QA.js";
|
|
17
|
+
import "./chunk-QQDPRTLP.js";
|
|
18
18
|
import "./chunk-P4I7BFNJ.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-4MBCJFY4.js";
|
|
20
|
+
import "./chunk-OC7K2DVZ.js";
|
|
21
|
+
import "./chunk-5F4OB5B3.js";
|
|
22
|
+
import "./chunk-ZS7JIUJ3.js";
|
|
21
23
|
import "./chunk-JWAK7JQB.js";
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-4TPL54KW.js";
|
|
25
|
+
import "./chunk-ZRC7Z5X3.js";
|
|
26
|
+
import "./chunk-QQYCYAKI.js";
|
|
27
|
+
import "./chunk-LDA6TAYQ.js";
|
|
28
|
+
import "./chunk-W74LJ5OT.js";
|
|
29
|
+
import "./chunk-KNKDMTHU.js";
|
|
30
|
+
import "./chunk-3Y6BHIN6.js";
|
|
26
31
|
import "./chunk-R62PKTAG.js";
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-HAZAN4UM.js";
|
|
33
|
+
import "./chunk-KGUE5AVX.js";
|
|
29
34
|
import "./chunk-2W4DQQUU.js";
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-KLDMLWXT.js";
|
|
36
|
+
import "./chunk-HZKANST2.js";
|
|
32
37
|
import "./chunk-MEZJ3I63.js";
|
|
33
38
|
import "./chunk-ILWCKCOI.js";
|
|
34
39
|
import "./chunk-RFZA7PSM.js";
|
|
35
40
|
import "./chunk-JUUBBBY5.js";
|
|
36
41
|
import "./chunk-GH5UKMZD.js";
|
|
37
|
-
import "./chunk-OC7K2DVZ.js";
|
|
38
42
|
import "./chunk-5N4GGUBN.js";
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-
|
|
43
|
+
import "./chunk-W2GXIARJ.js";
|
|
44
|
+
import "./chunk-TFT2X7SH.js";
|
|
45
|
+
import "./chunk-DTEWAVNE.js";
|
|
46
|
+
import "./chunk-UIB33QQP.js";
|
|
42
47
|
import "./chunk-7WEQQJLG.js";
|
|
43
|
-
import "./chunk-VH7JMLTG.js";
|
|
44
|
-
import "./chunk-3MZ7DYRO.js";
|
|
45
48
|
import "./chunk-ZCT5DJ3G.js";
|
|
49
|
+
import "./chunk-3MZ7DYRO.js";
|
|
46
50
|
import "./chunk-JTX3BUDK.js";
|
|
47
|
-
import "./chunk-
|
|
51
|
+
import "./chunk-ZEYA2WWX.js";
|
|
48
52
|
import "./chunk-DIH2G3YG.js";
|
|
49
|
-
import "./chunk-
|
|
50
|
-
import "./chunk-
|
|
53
|
+
import "./chunk-D6M3ZK66.js";
|
|
54
|
+
import "./chunk-RGCPELQN.js";
|
|
51
55
|
import "./chunk-CRG54LEB.js";
|
|
52
56
|
import "./chunk-TUCKEEXE.js";
|
|
53
|
-
import "./chunk-
|
|
57
|
+
import "./chunk-P6YQWIT2.js";
|
|
54
58
|
import "./chunk-DI4QAGRZ.js";
|
|
55
|
-
import "./chunk-
|
|
59
|
+
import "./chunk-3Y2EHT4F.js";
|
|
56
60
|
import "./chunk-4CE6TMI5.js";
|
|
57
61
|
import "./chunk-ZXTAQYNA.js";
|
|
58
62
|
export {
|
|
@@ -61,4 +65,4 @@ export {
|
|
|
61
65
|
spawnCapture,
|
|
62
66
|
versionFreeEntry
|
|
63
67
|
};
|
|
64
|
-
//# sourceMappingURL=update-
|
|
68
|
+
//# sourceMappingURL=update-EUIX72IX.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
readPaidRecords
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-MAHNZA6C.js";
|
|
5
|
+
import "./chunk-FYFHH7V5.js";
|
|
6
|
+
import "./chunk-HPRVFJPM.js";
|
|
7
7
|
import {
|
|
8
8
|
ATOMIC_RE
|
|
9
9
|
} from "./chunk-JWAK7JQB.js";
|
|
@@ -11,34 +11,34 @@ import "./chunk-2W4DQQUU.js";
|
|
|
11
11
|
import {
|
|
12
12
|
paint,
|
|
13
13
|
sanitizeForTerminal
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-KLDMLWXT.js";
|
|
15
15
|
import {
|
|
16
16
|
toMoney
|
|
17
17
|
} from "./chunk-MEZJ3I63.js";
|
|
18
18
|
import "./chunk-7SLOTLO7.js";
|
|
19
19
|
import {
|
|
20
20
|
savedAccounts
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-TFT2X7SH.js";
|
|
22
|
+
import "./chunk-UIB33QQP.js";
|
|
22
23
|
import "./chunk-7WEQQJLG.js";
|
|
23
|
-
import "./chunk-VH7JMLTG.js";
|
|
24
|
-
import "./chunk-3MZ7DYRO.js";
|
|
25
24
|
import "./chunk-ZCT5DJ3G.js";
|
|
25
|
+
import "./chunk-3MZ7DYRO.js";
|
|
26
26
|
import {
|
|
27
27
|
paidLedgerPath
|
|
28
28
|
} from "./chunk-JTX3BUDK.js";
|
|
29
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-ZEYA2WWX.js";
|
|
30
30
|
import "./chunk-DIH2G3YG.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-D6M3ZK66.js";
|
|
32
32
|
import {
|
|
33
33
|
BUILT_IN_SOURCE
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-RGCPELQN.js";
|
|
35
35
|
import "./chunk-CRG54LEB.js";
|
|
36
36
|
import "./chunk-TUCKEEXE.js";
|
|
37
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-P6YQWIT2.js";
|
|
38
38
|
import {
|
|
39
39
|
CliError
|
|
40
40
|
} from "./chunk-DI4QAGRZ.js";
|
|
41
|
-
import "./chunk-
|
|
41
|
+
import "./chunk-3Y2EHT4F.js";
|
|
42
42
|
import "./chunk-ZXTAQYNA.js";
|
|
43
43
|
|
|
44
44
|
// src/router/usage.ts
|
|
@@ -177,4 +177,4 @@ export {
|
|
|
177
177
|
runRouterUsage,
|
|
178
178
|
sinceWindow
|
|
179
179
|
};
|
|
180
|
-
//# sourceMappingURL=usage-
|
|
180
|
+
//# sourceMappingURL=usage-EKDC7LUC.js.map
|
|
@@ -10,12 +10,12 @@ import {
|
|
|
10
10
|
broadcastUsdcSend,
|
|
11
11
|
getUsdcBalance,
|
|
12
12
|
prepareUsdcSend
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-IGLWLH73.js";
|
|
14
|
+
import "./chunk-7V25UAQO.js";
|
|
15
15
|
import "./chunk-PETQ5WEA.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-RBJPAZFI.js";
|
|
16
|
+
import "./chunk-INSIW65E.js";
|
|
18
17
|
import "./chunk-CZJOMUBP.js";
|
|
18
|
+
import "./chunk-RBJPAZFI.js";
|
|
19
19
|
import "./chunk-WFZX352D.js";
|
|
20
20
|
import "./chunk-ZCT5DJ3G.js";
|
|
21
21
|
import "./chunk-ZXTAQYNA.js";
|
|
@@ -31,4 +31,4 @@ export {
|
|
|
31
31
|
getUsdcBalance,
|
|
32
32
|
prepareUsdcSend
|
|
33
33
|
};
|
|
34
|
-
//# sourceMappingURL=usdc-
|
|
34
|
+
//# sourceMappingURL=usdc-YIHK2OMC.js.map
|
|
@@ -2,7 +2,7 @@ import { createRequire as __tenjinCreateRequire } from 'node:module'; const requ
|
|
|
2
2
|
import {
|
|
3
3
|
a,
|
|
4
4
|
s
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FKVJKLPI.js";
|
|
6
6
|
import "./chunk-JNUKLSMZ.js";
|
|
7
7
|
import "./chunk-CZJOMUBP.js";
|
|
8
8
|
import "./chunk-WFZX352D.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-PRLSIESK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,80 @@
|
|
|
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-Q6RSJCXB.js";
|
|
12
|
+
import "./chunk-VU6GMWF6.js";
|
|
13
|
+
import "./chunk-MEWZCIA6.js";
|
|
14
|
+
import "./chunk-V6GIVALQ.js";
|
|
15
|
+
import "./chunk-5USBZ2MU.js";
|
|
16
|
+
import "./chunk-F2KJAJ7T.js";
|
|
17
|
+
import "./chunk-24XKUN2S.js";
|
|
18
|
+
import "./chunk-64WOMNYR.js";
|
|
19
|
+
import "./chunk-TVWCLUBI.js";
|
|
20
|
+
import "./chunk-YJGEVBKZ.js";
|
|
21
|
+
import "./chunk-JTILUN4W.js";
|
|
22
|
+
import "./chunk-6QMDUDF2.js";
|
|
23
|
+
import "./chunk-P4I7BFNJ.js";
|
|
24
|
+
import "./chunk-DJ36BM62.js";
|
|
25
|
+
import "./chunk-W7ELYLYK.js";
|
|
26
|
+
import "./chunk-OQWPRFAC.js";
|
|
27
|
+
import "./chunk-K5KNGC4I.js";
|
|
28
|
+
import "./chunk-FYFHH7V5.js";
|
|
29
|
+
import "./chunk-HPRVFJPM.js";
|
|
30
|
+
import "./chunk-RGVCOG2S.js";
|
|
31
|
+
import "./chunk-FKVJKLPI.js";
|
|
32
|
+
import "./chunk-YWWMISDY.js";
|
|
33
|
+
import "./chunk-JNUKLSMZ.js";
|
|
34
|
+
import "./chunk-HI5XQOX2.js";
|
|
35
|
+
import "./chunk-XRGFH7FI.js";
|
|
36
|
+
import "./chunk-IGLWLH73.js";
|
|
37
|
+
import "./chunk-7V25UAQO.js";
|
|
38
|
+
import "./chunk-PETQ5WEA.js";
|
|
39
|
+
import "./chunk-INSIW65E.js";
|
|
40
|
+
import "./chunk-CZJOMUBP.js";
|
|
41
|
+
import "./chunk-RBJPAZFI.js";
|
|
42
|
+
import "./chunk-WFZX352D.js";
|
|
43
|
+
import "./chunk-ZS7JIUJ3.js";
|
|
44
|
+
import "./chunk-JWAK7JQB.js";
|
|
45
|
+
import "./chunk-HAZAN4UM.js";
|
|
46
|
+
import "./chunk-KGUE5AVX.js";
|
|
47
|
+
import "./chunk-2W4DQQUU.js";
|
|
48
|
+
import "./chunk-KLDMLWXT.js";
|
|
49
|
+
import "./chunk-HZKANST2.js";
|
|
50
|
+
import "./chunk-MEZJ3I63.js";
|
|
51
|
+
import "./chunk-ILWCKCOI.js";
|
|
52
|
+
import "./chunk-RFZA7PSM.js";
|
|
53
|
+
import "./chunk-JUUBBBY5.js";
|
|
54
|
+
import "./chunk-DTEWAVNE.js";
|
|
55
|
+
import "./chunk-UIB33QQP.js";
|
|
56
|
+
import "./chunk-7WEQQJLG.js";
|
|
57
|
+
import "./chunk-ZCT5DJ3G.js";
|
|
58
|
+
import "./chunk-3MZ7DYRO.js";
|
|
59
|
+
import "./chunk-JTX3BUDK.js";
|
|
60
|
+
import "./chunk-ZEYA2WWX.js";
|
|
61
|
+
import "./chunk-DIH2G3YG.js";
|
|
62
|
+
import "./chunk-D6M3ZK66.js";
|
|
63
|
+
import "./chunk-RGCPELQN.js";
|
|
64
|
+
import "./chunk-CRG54LEB.js";
|
|
65
|
+
import "./chunk-TUCKEEXE.js";
|
|
66
|
+
import "./chunk-P6YQWIT2.js";
|
|
67
|
+
import "./chunk-DI4QAGRZ.js";
|
|
68
|
+
import "./chunk-3Y2EHT4F.js";
|
|
69
|
+
import "./chunk-ZXTAQYNA.js";
|
|
70
|
+
export {
|
|
71
|
+
REPAIR_DONE_LINE,
|
|
72
|
+
findPassphraseExports,
|
|
73
|
+
passphraseNote,
|
|
74
|
+
runWalletBalance,
|
|
75
|
+
runWalletCreate,
|
|
76
|
+
runWalletRepair,
|
|
77
|
+
runWalletShow,
|
|
78
|
+
withWalletLock
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingURL=wallet-HSW757W6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -6,7 +6,9 @@ Your agent can also browse and choose a tool directly. Browsing and inspection a
|
|
|
6
6
|
|
|
7
7
|
## Install and activate
|
|
8
8
|
|
|
9
|
-
Ask your agent to install Tenjin from tenjin.sh, or follow the [terminal instructions](../README.md#install). Setup explains sharing, lets you accept or customize spending limits, then offers to add $5 so you can start using tools. **Add $5** opens checkout in your browser, and the terminal or your agent waits for the payment and carries on when it lands. **Not now** skips funding; your agent asks when a task first needs a paid tool. `--yes` accepts spending defaults
|
|
9
|
+
Ask your agent to install Tenjin from tenjin.sh, or follow the [terminal instructions](../README.md#install). Setup explains sharing, lets you accept or customize spending limits, and on a fresh install asks whether to turn on DeepSeek subagents. It then offers to add $5 so you can start using tools. **Add $5** opens checkout in your browser, and the terminal or your agent waits for the payment and carries on when it lands. **Not now** skips funding; your agent asks when a task first needs a paid tool. `--yes` accepts setup and spending defaults. DeepSeek subagents and checkout each require their own choice.
|
|
10
|
+
|
|
11
|
+
Turning on DeepSeek subagents during fresh setup turns them on in any workspace. Each job costs up to your per-call spend limit, within your daily budget. Claude accepts or declines each offer. Existing users and saved off choices keep their behavior through updates and refreshes. Use `tenjin config subagents off` to turn them off and `tenjin config subagents on` to turn them on. [Scope, sharing and worker controls →](./subagents.md)
|
|
10
12
|
|
|
11
13
|
Use the activation step the installer returns:
|
|
12
14
|
|
|
@@ -24,9 +26,9 @@ Claude Code requires 2.1.287+. Codex routing hooks require 0.149.0+. Installatio
|
|
|
24
26
|
|
|
25
27
|
## When your agent runs the install
|
|
26
28
|
|
|
27
|
-
The agent installs for its current host,
|
|
29
|
+
The agent installs for its current host, relays any unanswered spending or subagent choice, and runs the setup commands itself. It reads `next` and `nextSteps` from the compact result. `tenjin install --json` retains full diagnostics.
|
|
28
30
|
|
|
29
|
-
When you choose **Add $5**, the agent runs `tenjin fund 5`, which opens checkout in your browser with $5 filled in. Opening checkout moves no money; you confirm the payment there. The agent then runs `tenjin balance --wait` in the background and continues when the money lands, so you never come back to tell it you are done. If you skip funding, the agent continues with available tools and asks when a task first needs a paid tool, saying what the tool is and what it costs. It asks at most once a session. An unknown balance or unconfirmed arrival does not justify another payment: running `tenjin fund` again while a payment is on its way waits on that payment instead of opening a second checkout.
|
|
31
|
+
When you choose **Add $5**, the agent runs `tenjin fund 5`, which opens checkout in your browser with $5 filled in. Opening checkout moves no money; you confirm the payment there. The agent then runs `tenjin balance --wait` in the background and continues when the money lands, so you never come back to tell it you are done. If you skip funding, the agent continues with available tools and asks when a task first needs a paid tool, saying what the tool is and what it costs. It asks at most once a session. An unknown balance or unconfirmed arrival does not justify another payment: running `tenjin fund` again while a payment is on its way waits on that payment instead of opening a second checkout. If you have an event or promo code, the agent runs `tenjin fund` and you type the code yourself under **Have a code?** on that page, never in chat; the agent waits with `tenjin balance --wait` the same way.
|
|
30
32
|
|
|
31
33
|
A spend limit that is used up is not a funding problem. The agent says the limit is reached, that your balance is fine, and how to raise the limit; it never opens checkout for it.
|
|
32
34
|
|
|
@@ -36,14 +38,16 @@ Installation and the first task add no optional retention or second-host questio
|
|
|
36
38
|
|
|
37
39
|
## What bounds a payment
|
|
38
40
|
|
|
39
|
-
| Control | Default and meaning
|
|
40
|
-
| ------------------- |
|
|
41
|
-
| `sessionBudget` | $5 automatic spending shared across chats. Resets 24 hours after its window starts, not on a new chat. Zero blocks automatic payments; `none` removes this ceiling.
|
|
42
|
-
| `maxAutoSpend` | $
|
|
43
|
-
| Wallet balance | No payment can exceed available funds.
|
|
44
|
-
| `allowlistCreators` | Optional restriction on which hosts may be paid. It is separate from harness permission to call a tool.
|
|
41
|
+
| Control | Default and meaning |
|
|
42
|
+
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| `sessionBudget` | $5 automatic spending shared across chats. Resets 24 hours after its window starts, not on a new chat. Zero blocks automatic payments; `none` removes this ceiling. |
|
|
44
|
+
| `maxAutoSpend` | $1.00 by default for one call's total, including multiple takes or comparison options. Accepts any non-negative USD amount with up to 6 decimal places; `0` blocks positive automatic payments. Saved limits stay unchanged. |
|
|
45
|
+
| Wallet balance | No payment can exceed available funds. |
|
|
46
|
+
| `allowlistCreators` | Optional restriction on which hosts may be paid. It is separate from harness permission to call a tool. |
|
|
47
|
+
|
|
48
|
+
Ordinary spending defaults apply before any answer. Where DeepSeek subagents are on, a job's cap is your per-call spend limit. Explicit amount flags replace the named ordinary spending limits. Existing zero, unlimited and custom settings are preserved. Project settings can only tighten routing/context sharing; they cannot change wallet spending limits.
|
|
45
49
|
|
|
46
|
-
|
|
50
|
+
A DeepSeek job's cap covers its routing, inference and web searches together. It is your per-call spend limit as it stands at each offer, or a lower ceiling you named with `--max-job`, so a job never costs more than one call may; the daily budget still applies, and a per-call limit of zero stops jobs. A worker's web search runs inside its model call, paid as tokens with no search charge; a page its WebFetch could not fetch is read through Exa for $0.001, paid like any lookup, within your per-call limit and daily budget too. [Quotes and cumulative job limits →](./subagents.md#charges-and-limits)
|
|
47
51
|
|
|
48
52
|
Changing global limits is a normal config write: the CLI does not distinguish a person from an agent. Your host's permissions and filesystem access protect those writes. Authorize limit changes deliberately; the request tool itself cannot raise them.
|
|
49
53
|
|
|
@@ -108,7 +112,9 @@ Bash(tenjin usage:*)
|
|
|
108
112
|
|
|
109
113
|
## What the hooks send
|
|
110
114
|
|
|
111
|
-
Routing sends the current prompt and at most six earlier messages, bounded to 16 KiB after known-secret masking. It excludes tool-result bodies and harness metadata. Search terms, URLs, delegated tasks, questions and your answers can also be routed with that context. Shortfall reports include status, size or error, never the fetched page or search results. Pasted text may be marked separately, but still reaches the router. Known-secret masking reduces exposure; it cannot identify every secret.
|
|
115
|
+
Routing sends the current prompt and at most six earlier messages, bounded to 16 KiB after known-secret masking. It excludes tool-result bodies and harness metadata. Search terms, URLs, delegated tasks, questions and your answers can also be routed with that context. Shortfall reports include status, size or error, never the fetched page or search results. Pasted text may be marked separately, but still reaches the router. Known-secret masking reduces exposure; it cannot identify every secret. This masking applies to routing. A DeepSeek worker you turn on forwards what it reads to Tenjin and DeepSeek unmasked, removing only the job's own tokens and your wallet key and passphrase: see [DeepSeek subagents](./subagents.md#what-goes-where-and-when).
|
|
116
|
+
|
|
117
|
+
With DeepSeek subagents on, the held assignment and parent context go to Tenjin and TypeSafe before the parent accepts, in a request of at most 16 KB that drops the oldest context first and never cuts the assignment. After the parent accepts, Tenjin and DeepSeek receive the accepted assignment, the instructions Claude Code loads for the worker as it does for a native subagent (your CLAUDE.md, rules and the files under `~/.claude`), and the job's tool results. A worker's web searches run inside the DeepSeek call; the address of a public page its WebFetch could not fetch goes to Exa. Model replies can be replayed for 24 hours; financial and continuation metadata persist. [DeepSeek disclosure and retention →](./subagents.md#data-and-permissions)
|
|
112
118
|
|
|
113
119
|
For a turn containing links, Tenjin reads the repository's Git remote hosts locally to mark matching links as your own, so the router can leave them to native tools. It sends those already-present links with that classification, not the Git config or remote credentials.
|
|
114
120
|
|
|
@@ -130,6 +136,8 @@ Run `tenjin wallet repair` yourself in a terminal when the saved passphrase is m
|
|
|
130
136
|
|
|
131
137
|
Codex support is experimental. It shares the wallet, limits and request executor, but activation and permission behavior differ.
|
|
132
138
|
|
|
139
|
+
DeepSeek subagents run on Claude Code only. Codex runs its own subagents natively and Tenjin offers none of them to DeepSeek.
|
|
140
|
+
|
|
133
141
|
Installation uses Codex's plugin commands and trusts only Tenjin's own hook rows through Codex's configuration API. It leaves hooks you disabled off. If trust cannot be saved, approve the hooks in `/hooks`.
|
|
134
142
|
|
|
135
143
|
The request permission hook permits calls under your spending policy, including with `approval_policy = "never"`. It also overrides `approval_mode = "prompt"` for this tool. Disable that one hook in `/hooks` to require your host's approval; with approvals forbidden, the call is refused. Internal model calls to the hook tool remain denied. [Host details →](./router-reference.md#host-integration)
|