tenjin-cli 0.1.0-alpha.15 → 0.1.0-alpha.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE.md +54 -7
- package/README.md +41 -310
- package/dist/{_esm-N4KAVXQR.js → _esm-CE7KNONL.js} +9 -10
- package/dist/{ccip-ZGGWQN4X.js → ccip-7RMRLAGV.js} +4 -4
- package/dist/{ccip-RPPPKTJR.js → ccip-NLCSCHKI.js} +5 -5
- package/dist/chunk-25TJPVBF.js +353 -0
- package/dist/chunk-25TJPVBF.js.map +1 -0
- package/dist/chunk-2BKS2FVE.js +93 -0
- package/dist/chunk-2BKS2FVE.js.map +1 -0
- package/dist/chunk-2QYORQBF.js +55 -0
- package/dist/chunk-2QYORQBF.js.map +1 -0
- package/dist/{chunk-NIKXHWOL.js → chunk-2U5ZVEV3.js} +16 -16
- package/dist/chunk-2U5ZVEV3.js.map +1 -0
- package/dist/{chunk-HPJGOLTN.js → chunk-3AJS6LLN.js} +13 -8
- package/dist/chunk-3AJS6LLN.js.map +1 -0
- package/dist/{chunk-KINZ23CV.js → chunk-3AUDA53C.js} +4740 -23
- package/dist/chunk-3AUDA53C.js.map +1 -0
- package/dist/{chunk-MJZZTKCC.js → chunk-56MOAIP5.js} +5 -10
- package/dist/chunk-56MOAIP5.js.map +1 -0
- package/dist/{chunk-U5S527PP.js → chunk-5IEP5EGE.js} +3 -3
- package/dist/chunk-5X4SZ5BF.js +227 -0
- package/dist/chunk-5X4SZ5BF.js.map +1 -0
- package/dist/chunk-7WEQQJLG.js +68 -0
- package/dist/chunk-7WEQQJLG.js.map +1 -0
- package/dist/{chunk-7FK2UN2T.js → chunk-AWQPGIR6.js} +65 -67
- package/dist/{chunk-7FK2UN2T.js.map → chunk-AWQPGIR6.js.map} +1 -1
- package/dist/{chunk-ZFJJ3EXC.js → chunk-BBVUVBUO.js} +516 -185
- package/dist/chunk-BBVUVBUO.js.map +1 -0
- package/dist/{chunk-JBIKAAT3.js → chunk-BFFM2WFK.js} +8 -8
- package/dist/chunk-BFFM2WFK.js.map +1 -0
- package/dist/{chunk-KYQVEKP5.js → chunk-BPMWXTFX.js} +8 -8
- package/dist/chunk-DMZZLPZN.js +205 -0
- package/dist/chunk-DMZZLPZN.js.map +1 -0
- package/dist/{chunk-47PP7TAG.js → chunk-EGELTSPU.js} +1356 -1356
- package/dist/chunk-EGELTSPU.js.map +1 -0
- package/dist/chunk-GULLJQXA.js +698 -0
- package/dist/chunk-GULLJQXA.js.map +1 -0
- package/dist/{chunk-S5RYMCV6.js → chunk-HPWO4O6S.js} +3 -3
- package/dist/chunk-HVRC33OL.js +174 -0
- package/dist/chunk-HVRC33OL.js.map +1 -0
- package/dist/{chunk-W6R3HAAG.js → chunk-JRGFKVAZ.js} +2 -2
- package/dist/{chunk-XJN5WUKL.js → chunk-KG3D7FIF.js} +2 -2
- package/dist/chunk-L3PVMIYQ.js +10328 -0
- package/dist/chunk-L3PVMIYQ.js.map +1 -0
- package/dist/{chunk-QW2Q2KAH.js → chunk-LHHMV4GU.js} +2 -2
- package/dist/{chunk-ZOBNS7CX.js → chunk-MEFB5KHA.js} +4 -18
- package/dist/chunk-MEFB5KHA.js.map +1 -0
- package/dist/{chunk-M2O56UK7.js → chunk-N35E6CM2.js} +293 -163
- package/dist/chunk-N35E6CM2.js.map +1 -0
- package/dist/chunk-OCBHUHWB.js +69 -0
- package/dist/chunk-OCBHUHWB.js.map +1 -0
- package/dist/chunk-OIM4HLN6.js +1405 -0
- package/dist/chunk-OIM4HLN6.js.map +1 -0
- package/dist/{chunk-VYOJOX4Z.js → chunk-OJLYNM4Z.js} +54 -33
- package/dist/chunk-OJLYNM4Z.js.map +1 -0
- package/dist/{chunk-POJRB2AE.js → chunk-POUWHWID.js} +2 -2
- package/dist/chunk-PZEN5PHN.js +285 -0
- package/dist/chunk-PZEN5PHN.js.map +1 -0
- package/dist/chunk-SKAHDQH7.js +1785 -0
- package/dist/chunk-SKAHDQH7.js.map +1 -0
- package/dist/{chunk-KZAAWQNP.js → chunk-TTNESUPQ.js} +3 -3
- package/dist/chunk-U5DXNFJC.js +137 -0
- package/dist/chunk-U5DXNFJC.js.map +1 -0
- package/dist/chunk-USS336NF.js +165 -0
- package/dist/chunk-USS336NF.js.map +1 -0
- package/dist/{chunk-UO22YNY4.js → chunk-WH7OWT6G.js} +49 -1
- package/dist/chunk-WH7OWT6G.js.map +1 -0
- package/dist/chunk-WXC57XGG.js +29 -0
- package/dist/chunk-WXC57XGG.js.map +1 -0
- package/dist/{chunk-YLYINX2H.js → chunk-XZKD7DIF.js} +3 -3
- package/dist/{chunk-CPCX67TI.js → chunk-YEETV6IW.js} +1079 -1039
- package/dist/chunk-YEETV6IW.js.map +1 -0
- package/dist/{chunk-OLWTRUTS.js → chunk-YJHHCWM3.js} +35 -16
- package/dist/chunk-YJHHCWM3.js.map +1 -0
- package/dist/{cli-KKRKBU5T.js → cli-M3XCSOU6.js} +289 -374
- package/dist/cli-M3XCSOU6.js.map +1 -0
- package/dist/config-MXOX7XDR.js +41 -0
- package/dist/{dist-U4M6QCKE.js → dist-3LOO6M4U.js} +10 -10
- package/dist/doctor-LU4YIZWM.js +349 -0
- package/dist/doctor-LU4YIZWM.js.map +1 -0
- package/dist/{ethersCompat-Df4a6QIZ-WHYKB6HA.js → ethersCompat-Df4a6QIZ-THAVUGIJ.js} +5 -5
- package/dist/{chunk-KAJZHIQ4.js → fund-A54P2QFK.js} +80 -24
- package/dist/fund-A54P2QFK.js.map +1 -0
- package/dist/hook-command-U6KWPEDQ.js +377 -0
- package/dist/hook-command-U6KWPEDQ.js.map +1 -0
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/dist/install-XUM2XSHW.js +53 -0
- package/dist/install-wallet-QIOFORTX.js +105 -0
- package/dist/install-wallet-QIOFORTX.js.map +1 -0
- package/dist/{run-XYTQ5TWQ.js → mcp-HJC2PLRV.js} +3727 -10670
- package/dist/mcp-HJC2PLRV.js.map +1 -0
- package/dist/paths-P2N4JTDZ.js +49 -0
- package/dist/pay-SBXZEPEP.js +37 -0
- package/dist/redact-46ZHF2NH.js +17 -0
- package/dist/{secp256k1-XRPVBC6V.js → secp256k1-ZZZT2CAX.js} +3 -3
- package/dist/{send-G746D7PQ.js → send-ASD2ZXJD.js} +28 -29
- package/dist/send-ASD2ZXJD.js.map +1 -0
- package/dist/{chunk-QZ6ROAJU.js → skill-placement-NFVHY6A3.js} +157 -11
- package/dist/skill-placement-NFVHY6A3.js.map +1 -0
- package/dist/status-T2SDB57A.js +63 -0
- package/dist/status-T2SDB57A.js.map +1 -0
- package/dist/status-line-CGPUSDMC.js +71 -0
- package/dist/status-line-CGPUSDMC.js.map +1 -0
- package/dist/status-line-wiring-BYPHTYZE.js +30 -0
- package/dist/tenjin-daemon.mjs +20060 -0
- package/dist/tenjin-shim.mjs +251 -0
- package/dist/tenjin-vitest-reporter.mjs +49 -0
- package/dist/uninstall-FKYZHAM3.js +144 -0
- package/dist/uninstall-FKYZHAM3.js.map +1 -0
- package/dist/{update-R76LHOZW.js → update-ANJ2AOTN.js} +133 -16
- package/dist/update-ANJ2AOTN.js.map +1 -0
- package/dist/{viemAdapter-By13KInL-TUQJBMHM.js → viemAdapter-By13KInL-X2VY6CY3.js} +5 -5
- package/dist/wallet-PWAHVKWW.js +31 -0
- package/dist/wallet-kdf-worker.mjs +980 -0
- package/docs/agent-permissions.md +65 -354
- package/docs/safety-model.md +16 -6
- package/package.json +8 -7
- package/LICENSE +0 -21
- package/dist/buy-VIRNSYGN.js +0 -47
- package/dist/chunk-2MYQN7HM.js +0 -247
- package/dist/chunk-2MYQN7HM.js.map +0 -1
- package/dist/chunk-2RF2GIJQ.js +0 -1188
- package/dist/chunk-2RF2GIJQ.js.map +0 -1
- package/dist/chunk-3GL2Z5QK.js +0 -57
- package/dist/chunk-3GL2Z5QK.js.map +0 -1
- package/dist/chunk-47PP7TAG.js.map +0 -1
- package/dist/chunk-4CQIDQOT.js +0 -167
- package/dist/chunk-4CQIDQOT.js.map +0 -1
- package/dist/chunk-4KG27W2S.js +0 -614
- package/dist/chunk-4KG27W2S.js.map +0 -1
- package/dist/chunk-5QQTYWEU.js +0 -199
- package/dist/chunk-5QQTYWEU.js.map +0 -1
- package/dist/chunk-65DTCCJ7.js +0 -21
- package/dist/chunk-65DTCCJ7.js.map +0 -1
- package/dist/chunk-A5DKHMUN.js +0 -173
- package/dist/chunk-A5DKHMUN.js.map +0 -1
- package/dist/chunk-B63XPWQ4.js +0 -246
- package/dist/chunk-B63XPWQ4.js.map +0 -1
- package/dist/chunk-CAR6FHK6.js +0 -105
- package/dist/chunk-CAR6FHK6.js.map +0 -1
- package/dist/chunk-CPCX67TI.js.map +0 -1
- package/dist/chunk-CQBVCYI2.js +0 -162
- package/dist/chunk-CQBVCYI2.js.map +0 -1
- package/dist/chunk-DBU5CXBV.js +0 -4731
- package/dist/chunk-DBU5CXBV.js.map +0 -1
- package/dist/chunk-DHJD77OW.js +0 -81
- package/dist/chunk-DHJD77OW.js.map +0 -1
- package/dist/chunk-EDZSNPE5.js +0 -35
- package/dist/chunk-EDZSNPE5.js.map +0 -1
- package/dist/chunk-EFWZPUTC.js +0 -65
- package/dist/chunk-EFWZPUTC.js.map +0 -1
- package/dist/chunk-EPFL6CTE.js +0 -448
- package/dist/chunk-EPFL6CTE.js.map +0 -1
- package/dist/chunk-GHLVXVZD.js +0 -142
- package/dist/chunk-GHLVXVZD.js.map +0 -1
- package/dist/chunk-H3SOOJ2I.js +0 -580
- package/dist/chunk-H3SOOJ2I.js.map +0 -1
- package/dist/chunk-HPJGOLTN.js.map +0 -1
- package/dist/chunk-HRGBS2PA.js +0 -203
- package/dist/chunk-HRGBS2PA.js.map +0 -1
- package/dist/chunk-ITUXPJIS.js +0 -314
- package/dist/chunk-ITUXPJIS.js.map +0 -1
- package/dist/chunk-JBIKAAT3.js.map +0 -1
- package/dist/chunk-KAJZHIQ4.js.map +0 -1
- package/dist/chunk-KINZ23CV.js.map +0 -1
- package/dist/chunk-LRYV3SK7.js +0 -235
- package/dist/chunk-LRYV3SK7.js.map +0 -1
- package/dist/chunk-M2O56UK7.js.map +0 -1
- package/dist/chunk-MJZZTKCC.js.map +0 -1
- package/dist/chunk-NIKXHWOL.js.map +0 -1
- package/dist/chunk-OKDRDT74.js +0 -209
- package/dist/chunk-OKDRDT74.js.map +0 -1
- package/dist/chunk-OKYSNAS3.js +0 -2144
- package/dist/chunk-OKYSNAS3.js.map +0 -1
- package/dist/chunk-OLWTRUTS.js.map +0 -1
- package/dist/chunk-QQ6ELLSA.js +0 -143
- package/dist/chunk-QQ6ELLSA.js.map +0 -1
- package/dist/chunk-QZ6ROAJU.js.map +0 -1
- package/dist/chunk-R7RSCBI7.js +0 -794
- package/dist/chunk-R7RSCBI7.js.map +0 -1
- package/dist/chunk-SGK2B724.js +0 -67
- package/dist/chunk-SGK2B724.js.map +0 -1
- package/dist/chunk-U6VPKMGC.js +0 -390
- package/dist/chunk-U6VPKMGC.js.map +0 -1
- package/dist/chunk-UHTVXQ2O.js +0 -140
- package/dist/chunk-UHTVXQ2O.js.map +0 -1
- package/dist/chunk-UO22YNY4.js.map +0 -1
- package/dist/chunk-US456VUI.js +0 -149
- package/dist/chunk-US456VUI.js.map +0 -1
- package/dist/chunk-V44J2MXV.js +0 -400
- package/dist/chunk-V44J2MXV.js.map +0 -1
- package/dist/chunk-VJQKL3YH.js +0 -216
- package/dist/chunk-VJQKL3YH.js.map +0 -1
- package/dist/chunk-VJSQSLBM.js +0 -1442
- package/dist/chunk-VJSQSLBM.js.map +0 -1
- package/dist/chunk-VYOJOX4Z.js.map +0 -1
- package/dist/chunk-WY2K35OL.js +0 -269
- package/dist/chunk-WY2K35OL.js.map +0 -1
- package/dist/chunk-ZFJJ3EXC.js.map +0 -1
- package/dist/chunk-ZOBNS7CX.js.map +0 -1
- package/dist/cli-KKRKBU5T.js.map +0 -1
- package/dist/config-JMRUNYE6.js +0 -37
- package/dist/discover-B5HF6SHM.js +0 -102
- package/dist/discover-B5HF6SHM.js.map +0 -1
- package/dist/doctor-ZBG7X66D.js +0 -32
- package/dist/edit-PZJIILQE.js +0 -40
- package/dist/fund-EUDH5KPA.js +0 -40
- package/dist/inspect-QC6WEQPN.js +0 -37
- package/dist/install-GNK2W3PI.js +0 -972
- package/dist/install-GNK2W3PI.js.map +0 -1
- package/dist/outcome-KSGWZHUS.js +0 -24
- package/dist/pay-BC4UICPA.js +0 -361
- package/dist/pay-BC4UICPA.js.map +0 -1
- package/dist/publish-LXWFDIKF.js +0 -42
- package/dist/read-JMNUQ56P.js +0 -160
- package/dist/read-JMNUQ56P.js.map +0 -1
- package/dist/run-XYTQ5TWQ.js.map +0 -1
- package/dist/search-TSQAB45E.js +0 -25
- package/dist/secp256k1-XRPVBC6V.js.map +0 -1
- package/dist/send-G746D7PQ.js.map +0 -1
- package/dist/session-JBKWMJ24.js +0 -89
- package/dist/session-JBKWMJ24.js.map +0 -1
- package/dist/skill-heal-WKD67SLJ.js +0 -92
- package/dist/skill-heal-WKD67SLJ.js.map +0 -1
- package/dist/skill-placement-RIU4AMC2.js +0 -20
- package/dist/skill-placement-RIU4AMC2.js.map +0 -1
- package/dist/uninstall-5E263VTS.js +0 -73
- package/dist/uninstall-5E263VTS.js.map +0 -1
- package/dist/update-R76LHOZW.js.map +0 -1
- package/dist/usdc-4VCDHFWX.js +0 -38
- package/dist/usdc-4VCDHFWX.js.map +0 -1
- package/dist/viemAdapter-By13KInL-TUQJBMHM.js.map +0 -1
- package/dist/wallet-TQ7D5EQ7.js +0 -41
- package/dist/wallet-TQ7D5EQ7.js.map +0 -1
- package/dist/wallet-ZAVXWLWP.js +0 -32
- package/dist/wallet-ZAVXWLWP.js.map +0 -1
- package/docs/command-reference.md +0 -303
- package/skills/tenjin/SKILL.md +0 -373
- package/skills/tenjin-pay/SKILL.md +0 -76
- package/skills/tenjin-publish/SKILL.md +0 -227
- package/skills/tenjin-publish/references/maintain.md +0 -39
- package/skills/tenjin-search/SKILL.md +0 -154
- package/skills/tenjin-search/references/permissions.md +0 -112
- /package/dist/{_esm-N4KAVXQR.js.map → _esm-CE7KNONL.js.map} +0 -0
- /package/dist/{buy-VIRNSYGN.js.map → ccip-7RMRLAGV.js.map} +0 -0
- /package/dist/{ccip-RPPPKTJR.js.map → ccip-NLCSCHKI.js.map} +0 -0
- /package/dist/{chunk-U5S527PP.js.map → chunk-5IEP5EGE.js.map} +0 -0
- /package/dist/{chunk-KYQVEKP5.js.map → chunk-BPMWXTFX.js.map} +0 -0
- /package/dist/{chunk-S5RYMCV6.js.map → chunk-HPWO4O6S.js.map} +0 -0
- /package/dist/{chunk-W6R3HAAG.js.map → chunk-JRGFKVAZ.js.map} +0 -0
- /package/dist/{chunk-XJN5WUKL.js.map → chunk-KG3D7FIF.js.map} +0 -0
- /package/dist/{chunk-QW2Q2KAH.js.map → chunk-LHHMV4GU.js.map} +0 -0
- /package/dist/{chunk-POJRB2AE.js.map → chunk-POUWHWID.js.map} +0 -0
- /package/dist/{chunk-KZAAWQNP.js.map → chunk-TTNESUPQ.js.map} +0 -0
- /package/dist/{chunk-YLYINX2H.js.map → chunk-XZKD7DIF.js.map} +0 -0
- /package/dist/{ccip-ZGGWQN4X.js.map → config-MXOX7XDR.js.map} +0 -0
- /package/dist/{dist-U4M6QCKE.js.map → dist-3LOO6M4U.js.map} +0 -0
- /package/dist/{config-JMRUNYE6.js.map → ethersCompat-Df4a6QIZ-THAVUGIJ.js.map} +0 -0
- /package/dist/{doctor-ZBG7X66D.js.map → install-XUM2XSHW.js.map} +0 -0
- /package/dist/{edit-PZJIILQE.js.map → paths-P2N4JTDZ.js.map} +0 -0
- /package/dist/{ethersCompat-Df4a6QIZ-WHYKB6HA.js.map → pay-SBXZEPEP.js.map} +0 -0
- /package/dist/{fund-EUDH5KPA.js.map → redact-46ZHF2NH.js.map} +0 -0
- /package/dist/{inspect-QC6WEQPN.js.map → secp256k1-ZZZT2CAX.js.map} +0 -0
- /package/dist/{outcome-KSGWZHUS.js.map → status-line-wiring-BYPHTYZE.js.map} +0 -0
- /package/dist/{publish-LXWFDIKF.js.map → viemAdapter-By13KInL-X2VY6CY3.js.map} +0 -0
- /package/dist/{search-TSQAB45E.js.map → wallet-PWAHVKWW.js.map} +0 -0
package/dist/buy-VIRNSYGN.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
runBuy
|
|
4
|
-
} from "./chunk-OKDRDT74.js";
|
|
5
|
-
import "./chunk-CAR6FHK6.js";
|
|
6
|
-
import "./chunk-2RF2GIJQ.js";
|
|
7
|
-
import "./chunk-QW2Q2KAH.js";
|
|
8
|
-
import "./chunk-LRYV3SK7.js";
|
|
9
|
-
import "./chunk-SGK2B724.js";
|
|
10
|
-
import "./chunk-KINZ23CV.js";
|
|
11
|
-
import "./chunk-DBU5CXBV.js";
|
|
12
|
-
import "./chunk-KZAAWQNP.js";
|
|
13
|
-
import "./chunk-S5RYMCV6.js";
|
|
14
|
-
import "./chunk-POJRB2AE.js";
|
|
15
|
-
import "./chunk-YLYINX2H.js";
|
|
16
|
-
import "./chunk-VJQKL3YH.js";
|
|
17
|
-
import "./chunk-ITUXPJIS.js";
|
|
18
|
-
import "./chunk-MJZZTKCC.js";
|
|
19
|
-
import "./chunk-7FK2UN2T.js";
|
|
20
|
-
import "./chunk-CPCX67TI.js";
|
|
21
|
-
import "./chunk-M2O56UK7.js";
|
|
22
|
-
import "./chunk-UHTVXQ2O.js";
|
|
23
|
-
import "./chunk-EDZSNPE5.js";
|
|
24
|
-
import "./chunk-5QQTYWEU.js";
|
|
25
|
-
import "./chunk-GHLVXVZD.js";
|
|
26
|
-
import "./chunk-OLWTRUTS.js";
|
|
27
|
-
import "./chunk-VYOJOX4Z.js";
|
|
28
|
-
import "./chunk-EFWZPUTC.js";
|
|
29
|
-
import "./chunk-U6VPKMGC.js";
|
|
30
|
-
import "./chunk-UO22YNY4.js";
|
|
31
|
-
import "./chunk-A5DKHMUN.js";
|
|
32
|
-
import "./chunk-3GL2Z5QK.js";
|
|
33
|
-
import "./chunk-JBIKAAT3.js";
|
|
34
|
-
import "./chunk-2MYQN7HM.js";
|
|
35
|
-
import "./chunk-ZOBNS7CX.js";
|
|
36
|
-
import "./chunk-ZFJJ3EXC.js";
|
|
37
|
-
import "./chunk-W6R3HAAG.js";
|
|
38
|
-
import "./chunk-U5S527PP.js";
|
|
39
|
-
import "./chunk-47PP7TAG.js";
|
|
40
|
-
import "./chunk-XJN5WUKL.js";
|
|
41
|
-
import "./chunk-RBJPAZFI.js";
|
|
42
|
-
import "./chunk-KYQVEKP5.js";
|
|
43
|
-
import "./chunk-ZXTAQYNA.js";
|
|
44
|
-
export {
|
|
45
|
-
runBuy
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=buy-VIRNSYGN.js.map
|
package/dist/chunk-2MYQN7HM.js
DELETED
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
CliError,
|
|
4
|
-
hasCode
|
|
5
|
-
} from "./chunk-ZFJJ3EXC.js";
|
|
6
|
-
|
|
7
|
-
// src/lib/production-origin.ts
|
|
8
|
-
var PRODUCTION_ORIGIN = "https://tenjin.blog";
|
|
9
|
-
var PRODUCTION_HOST = new URL(PRODUCTION_ORIGIN).host;
|
|
10
|
-
var KNOWN_DEPLOYMENT_ORIGINS = /* @__PURE__ */ new Set([
|
|
11
|
-
PRODUCTION_ORIGIN,
|
|
12
|
-
"https://tenjin.sh"
|
|
13
|
-
]);
|
|
14
|
-
function isSameDeployment(a, b) {
|
|
15
|
-
if (a === b) return true;
|
|
16
|
-
return KNOWN_DEPLOYMENT_ORIGINS.has(a) && KNOWN_DEPLOYMENT_ORIGINS.has(b);
|
|
17
|
-
}
|
|
18
|
-
function knownDeploymentOrigins() {
|
|
19
|
-
return [...KNOWN_DEPLOYMENT_ORIGINS];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// src/lib/skills-source.ts
|
|
23
|
-
import { existsSync } from "fs";
|
|
24
|
-
import { dirname, join } from "path";
|
|
25
|
-
var SKILL_NAMES = ["tenjin-search", "tenjin-publish", "tenjin"];
|
|
26
|
-
var OPTIONAL_PAY_SKILL = "tenjin-pay";
|
|
27
|
-
var OPTIONAL_SKILL_NAMES = [OPTIONAL_PAY_SKILL];
|
|
28
|
-
var PACKAGED_SKILL_NAMES = [...SKILL_NAMES, ...OPTIONAL_SKILL_NAMES];
|
|
29
|
-
var SHIPPED_SKILL_FILES = {
|
|
30
|
-
"tenjin-search": ["SKILL.md", "references/permissions.md"],
|
|
31
|
-
"tenjin-publish": ["SKILL.md", "references/maintain.md"],
|
|
32
|
-
tenjin: ["SKILL.md"],
|
|
33
|
-
"tenjin-pay": ["SKILL.md"]
|
|
34
|
-
};
|
|
35
|
-
var SENTINEL = join("tenjin", "SKILL.md");
|
|
36
|
-
function resolveSkillsSource(startDir) {
|
|
37
|
-
let dir = startDir;
|
|
38
|
-
for (let i = 0; i < 8; i += 1) {
|
|
39
|
-
const candidate = join(dir, "skills");
|
|
40
|
-
if (existsSync(join(candidate, SENTINEL))) return candidate;
|
|
41
|
-
const parent = dirname(dir);
|
|
42
|
-
if (parent === dir) break;
|
|
43
|
-
dir = parent;
|
|
44
|
-
}
|
|
45
|
-
throw new CliError("INTERNAL", "Could not locate the packaged Tenjin skills directory", {
|
|
46
|
-
fix: "Reinstall tenjin-cli; the published package must ship the skills/ directory (files array).",
|
|
47
|
-
details: { startDir }
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// src/lib/skill-wiring.ts
|
|
52
|
-
import { existsSync as existsSync2, statSync } from "fs";
|
|
53
|
-
import { constants, open } from "fs/promises";
|
|
54
|
-
import { delimiter, join as join2 } from "path";
|
|
55
|
-
var CLI_SKILL_NAMES = [
|
|
56
|
-
"tenjin-search",
|
|
57
|
-
"tenjin-publish"
|
|
58
|
-
];
|
|
59
|
-
var HOSTED_SKILL_NAME = "tenjin";
|
|
60
|
-
function skillsDirsFor(home, hermesHome) {
|
|
61
|
-
return [
|
|
62
|
-
join2(home, ".claude", "skills"),
|
|
63
|
-
join2(home, ".agents", "skills"),
|
|
64
|
-
join2(hermesHome, "skills")
|
|
65
|
-
];
|
|
66
|
-
}
|
|
67
|
-
var HARNESS_TARGETS = ["claude", "codex", "hermes", "shared"];
|
|
68
|
-
function harnessTargetDir(home, harness, hermesHome) {
|
|
69
|
-
if (harness === "claude") return join2(home, ".claude", "skills");
|
|
70
|
-
if (harness === "hermes") return join2(hermesHome, "skills");
|
|
71
|
-
return join2(home, ".agents", "skills");
|
|
72
|
-
}
|
|
73
|
-
function harnessFlagFor(home, dir, hermesHome) {
|
|
74
|
-
if (dir === join2(home, ".claude", "skills")) return "claude";
|
|
75
|
-
if (dir === join2(hermesHome, "skills")) return "hermes";
|
|
76
|
-
return "shared";
|
|
77
|
-
}
|
|
78
|
-
function harnessDetectedBy(home, harness, which, hermesHome) {
|
|
79
|
-
const reasons = [];
|
|
80
|
-
const harnessHome = harness === "hermes" ? hermesHome : join2(home, `.${harness}`);
|
|
81
|
-
const hasHome = existsSync2(harnessHome);
|
|
82
|
-
if (hasHome) reasons.push("home-dir");
|
|
83
|
-
if (which(harness) && (harness !== "hermes" || hasHome)) reasons.push("binary");
|
|
84
|
-
return reasons;
|
|
85
|
-
}
|
|
86
|
-
function detectHarnesses(home, which, hermesHome) {
|
|
87
|
-
return {
|
|
88
|
-
claude: harnessDetectedBy(home, "claude", which, hermesHome).length > 0,
|
|
89
|
-
codex: harnessDetectedBy(home, "codex", which, hermesHome).length > 0,
|
|
90
|
-
hermes: harnessDetectedBy(home, "hermes", which, hermesHome).length > 0
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
function harnessReads(home, dir, present, hermesHome) {
|
|
94
|
-
const target = harnessFlagFor(home, dir, hermesHome);
|
|
95
|
-
if (target === "claude") return present.claude;
|
|
96
|
-
if (target === "hermes") return present.hermes;
|
|
97
|
-
return present.codex || !present.claude && !present.hermes;
|
|
98
|
-
}
|
|
99
|
-
function harnessRequested(home, dir, requested, hermesHome) {
|
|
100
|
-
return requested.some((h) => harnessTargetDir(home, h, hermesHome) === dir);
|
|
101
|
-
}
|
|
102
|
-
function harnessInPlay(home, dir, present, requested, hermesHome) {
|
|
103
|
-
return harnessReads(home, dir, present, hermesHome) || harnessRequested(home, dir, requested, hermesHome);
|
|
104
|
-
}
|
|
105
|
-
function onPath(bin, env) {
|
|
106
|
-
const raw = env.PATH ?? "";
|
|
107
|
-
const exts = process.platform === "win32" ? ["", ...(env.PATHEXT ?? ".EXE;.CMD;.BAT;.COM").split(";").filter((e) => e.length > 0)] : [""];
|
|
108
|
-
for (const part of raw.split(delimiter)) {
|
|
109
|
-
if (part.length === 0) continue;
|
|
110
|
-
for (const ext of exts) {
|
|
111
|
-
if (isFile(join2(part, bin + ext))) return true;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
return false;
|
|
115
|
-
}
|
|
116
|
-
function isFile(p) {
|
|
117
|
-
try {
|
|
118
|
-
return statSync(p).isFile();
|
|
119
|
-
} catch {
|
|
120
|
-
return false;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
async function readHarnessWiring(dir) {
|
|
124
|
-
const exists = existsSync2(dir);
|
|
125
|
-
const skills = [];
|
|
126
|
-
for (const name of SKILL_NAMES) skills.push(await readSkillWiring(dir, name));
|
|
127
|
-
return { dir, exists, skills, state: classify(skills) };
|
|
128
|
-
}
|
|
129
|
-
async function readAllWiring(home, hermesHome) {
|
|
130
|
-
const out = [];
|
|
131
|
-
for (const dir of skillsDirsFor(home, hermesHome)) out.push(await readHarnessWiring(dir));
|
|
132
|
-
return out;
|
|
133
|
-
}
|
|
134
|
-
function classify(skills) {
|
|
135
|
-
const cli = CLI_SKILL_NAMES.map((n) => skills.find((s) => s.name === n)).filter(
|
|
136
|
-
(s) => s?.present === true
|
|
137
|
-
);
|
|
138
|
-
if (cli.length === 0) return skills.some((s) => s.present) ? "hosted-only" : "empty";
|
|
139
|
-
if (cli.some((s) => s?.modelInvocable === false)) return "shadowed";
|
|
140
|
-
return cli.length === CLI_SKILL_NAMES.length ? "wired" : "partial";
|
|
141
|
-
}
|
|
142
|
-
async function readSkillFile(path) {
|
|
143
|
-
let handle;
|
|
144
|
-
try {
|
|
145
|
-
handle = await open(path, constants.O_RDONLY | (constants.O_NONBLOCK ?? 0));
|
|
146
|
-
} catch (err) {
|
|
147
|
-
if (hasCode(err, "ENOENT")) return { kind: "absent" };
|
|
148
|
-
return { kind: "unreadable", err };
|
|
149
|
-
}
|
|
150
|
-
try {
|
|
151
|
-
if (!(await handle.stat()).isFile()) return { kind: "not-regular" };
|
|
152
|
-
return { kind: "ok", bytes: await handle.readFile() };
|
|
153
|
-
} catch (err) {
|
|
154
|
-
return { kind: "unreadable", err };
|
|
155
|
-
} finally {
|
|
156
|
-
await handle.close().catch(() => void 0);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
async function readSkillWiring(dir, name) {
|
|
160
|
-
const read = await readSkillFile(join2(dir, name, "SKILL.md"));
|
|
161
|
-
if (read.kind === "absent") return { name, present: false };
|
|
162
|
-
if (read.kind !== "ok")
|
|
163
|
-
return { name, present: true, modelInvocable: false, reason: "unreadable" };
|
|
164
|
-
const text = read.bytes.toString("utf8");
|
|
165
|
-
if (isModelInvocationDisabled(text)) {
|
|
166
|
-
return { name, present: true, modelInvocable: false, reason: "disabled" };
|
|
167
|
-
}
|
|
168
|
-
return { name, present: true, modelInvocable: true };
|
|
169
|
-
}
|
|
170
|
-
var YAML_TRUE = /^(?:true|yes|on)$/i;
|
|
171
|
-
function isModelInvocationDisabled(skillMd) {
|
|
172
|
-
const frontmatter = extractFrontmatter(skillMd);
|
|
173
|
-
if (frontmatter === null) return false;
|
|
174
|
-
return frontmatter.some((line) => {
|
|
175
|
-
const m = /^disable-model-invocation:\s*(.+?)\s*$/.exec(line.trim());
|
|
176
|
-
if (m === null) return false;
|
|
177
|
-
const value = (m[1] ?? "").replace(/\s+#.*$/, "").replace(/^["']|["']$/g, "");
|
|
178
|
-
return YAML_TRUE.test(value);
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
function skillFrontmatterName(skillMd) {
|
|
182
|
-
const frontmatter = extractFrontmatter(skillMd);
|
|
183
|
-
if (frontmatter === null) return null;
|
|
184
|
-
for (const line of frontmatter) {
|
|
185
|
-
const m = /^name:\s*(.+?)\s*$/.exec(line);
|
|
186
|
-
if (m !== null) return (m[1] ?? "").replace(/^["']|["']$/g, "");
|
|
187
|
-
}
|
|
188
|
-
return null;
|
|
189
|
-
}
|
|
190
|
-
function extractFrontmatter(text) {
|
|
191
|
-
const lines = text.replace(/^\uFEFF/, "").split(/\r?\n/);
|
|
192
|
-
const open2 = lines.findIndex((l) => l.trim().length > 0);
|
|
193
|
-
if (open2 === -1 || lines[open2]?.trim() !== "---") return null;
|
|
194
|
-
const end = lines.findIndex((l, i) => i > open2 && l.trim() === "---");
|
|
195
|
-
if (end === -1) return null;
|
|
196
|
-
return lines.slice(open2 + 1, end);
|
|
197
|
-
}
|
|
198
|
-
function cliSkillsWired(wiring) {
|
|
199
|
-
return wiring.state === "wired";
|
|
200
|
-
}
|
|
201
|
-
function missingCliSkills(wiring) {
|
|
202
|
-
return CLI_SKILL_NAMES.filter(
|
|
203
|
-
(name) => wiring.skills.find((x) => x.name === name)?.present !== true
|
|
204
|
-
);
|
|
205
|
-
}
|
|
206
|
-
function shadowedCliSkills(wiring) {
|
|
207
|
-
return CLI_SKILL_NAMES.filter((name) => {
|
|
208
|
-
const s = wiring.skills.find((x) => x.name === name);
|
|
209
|
-
return s?.present === true && s.modelInvocable === false;
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
function anyTenjinSkill(wiring) {
|
|
213
|
-
return wiring.state !== "empty";
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
export {
|
|
217
|
-
PRODUCTION_ORIGIN,
|
|
218
|
-
PRODUCTION_HOST,
|
|
219
|
-
isSameDeployment,
|
|
220
|
-
knownDeploymentOrigins,
|
|
221
|
-
SKILL_NAMES,
|
|
222
|
-
OPTIONAL_PAY_SKILL,
|
|
223
|
-
OPTIONAL_SKILL_NAMES,
|
|
224
|
-
SHIPPED_SKILL_FILES,
|
|
225
|
-
resolveSkillsSource,
|
|
226
|
-
CLI_SKILL_NAMES,
|
|
227
|
-
HOSTED_SKILL_NAME,
|
|
228
|
-
skillsDirsFor,
|
|
229
|
-
HARNESS_TARGETS,
|
|
230
|
-
harnessTargetDir,
|
|
231
|
-
harnessFlagFor,
|
|
232
|
-
harnessDetectedBy,
|
|
233
|
-
detectHarnesses,
|
|
234
|
-
harnessReads,
|
|
235
|
-
harnessRequested,
|
|
236
|
-
harnessInPlay,
|
|
237
|
-
onPath,
|
|
238
|
-
readAllWiring,
|
|
239
|
-
readSkillFile,
|
|
240
|
-
isModelInvocationDisabled,
|
|
241
|
-
skillFrontmatterName,
|
|
242
|
-
cliSkillsWired,
|
|
243
|
-
missingCliSkills,
|
|
244
|
-
shadowedCliSkills,
|
|
245
|
-
anyTenjinSkill
|
|
246
|
-
};
|
|
247
|
-
//# sourceMappingURL=chunk-2MYQN7HM.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/production-origin.ts","../src/lib/skills-source.ts","../src/lib/skill-wiring.ts"],"sourcesContent":["/**\n * The one place the production Tenjin origin is written down. Every shipped\n * default, fallback, identity string, and piece of operator copy that names the\n * live site derives from here; `production-origin.test.ts` keeps it that way.\n *\n * This is NOT the base URL a command talks to. Ordinary requests resolve\n * `baseUrl` through config/flag/env precedence (`CONFIG_DEFAULTS.baseUrl` merely\n * starts from this value); `fund` alone pins production with no override surface\n * at all (owner decision, 2026-08-12) because its mint signs with the wallet key.\n * `fund.test.ts` and `client-meta.test.ts` each hold their own written-out copy,\n * so flipping this line alone reds the suite instead of moving the money path.\n */\nexport const PRODUCTION_ORIGIN = 'https://tenjin.blog';\n\n/**\n * The bare host, for prose and messages that name the site rather than link to\n * it. Derived, not written twice: a flip cannot leave the two disagreeing.\n */\nexport const PRODUCTION_HOST = new URL(PRODUCTION_ORIGIN).host;\n\n/**\n * Every origin the ONE production deployment answers on, as `URL.origin` spells\n * it. Membership means a request to any of them reaches the same server,\n * publishers, prices, and SIWX domain acceptance. It exists because the server\n * builds candidate URLs from its own `NEXT_PUBLIC_APP_URL`, not the request\n * host, so the moment tenjin#402 flips that global a CLI on the other origin\n * sees every candidate as off-origin (tenjin#738).\n *\n * Membership is NOT trust and NOT an allowlist of places the CLI may pay, but it\n * IS the widest set a wallet-signed credential can reach, so widening it is a\n * security change. Removal runbook: docs/safety-model.md.\n */\nconst KNOWN_DEPLOYMENT_ORIGINS: ReadonlySet<string> = new Set([\n PRODUCTION_ORIGIN,\n 'https://tenjin.sh',\n]);\n\n/**\n * Do these two origins name the same deployment? Exact match, or two members of\n * the set. BOTH sides must be members, so a self-hosted or preview base gains no\n * alias and keeps today's strict compare, and a differing scheme or port is a\n * different origin that aliases to nothing. Takes `URL.origin` strings; anything\n * else is not a member and falls through to the exact compare.\n */\nexport function isSameDeployment(a: string, b: string): boolean {\n if (a === b) return true;\n return KNOWN_DEPLOYMENT_ORIGINS.has(a) && KNOWN_DEPLOYMENT_ORIGINS.has(b);\n}\n\n/** The set as a plain array, for the generated hook script that cannot import. */\nexport function knownDeploymentOrigins(): string[] {\n return [...KNOWN_DEPLOYMENT_ORIGINS];\n}\n","import { existsSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { CliError } from './errors';\n\n/**\n * The packaged skills `install` copies into every target harness. All three go to\n * every target: `tenjin` (the zero-install curriculum, works with no CLI),\n * `tenjin-search` and `tenjin-publish` (thin CLI adapters). Order is the install\n * order and the human-render order.\n */\nexport const SKILL_NAMES = ['tenjin-search', 'tenjin-publish', 'tenjin'] as const;\nexport type SkillName = (typeof SKILL_NAMES)[number];\n\n/**\n * OPTIONAL skills ship in the package but are PRESENT only while their gate is\n * on, and are never required for a directory to count as wired: tenjin-pay\n * exists exactly while the `bazaarPay` toggle does (lib/skill-placement). The\n * heal and doctor cover them when present, exactly like everything else whose\n * presence is the operator's consent.\n */\nexport const OPTIONAL_PAY_SKILL = 'tenjin-pay';\nexport const OPTIONAL_SKILL_NAMES = [OPTIONAL_PAY_SKILL] as const;\nexport type OptionalSkillName = (typeof OPTIONAL_SKILL_NAMES)[number];\n\n/** Every skill directory this package ships, gated or not, in install order. */\nexport const PACKAGED_SKILL_NAMES = [...SKILL_NAMES, ...OPTIONAL_SKILL_NAMES] as const;\n\n/**\n * Every file a packaged skill ships, per skill, as a path relative to the skill\n * directory.\n *\n * DECLARED rather than discovered, because `uninstall` needs it on a machine\n * where the packaged source may be gone or unreadable, and \"remove exactly the\n * files this package wrote\" is not a question it can answer by listing the\n * operator's directory — everything else in there is theirs. `install` still\n * copies the real tree; a test pins this list against it, so a new reference\n * file that nobody declares fails the build rather than becoming litter no\n * uninstall can reclaim.\n *\n * The OPTIONAL skills are declared here for the same reason the required ones\n * are: `uninstall` reclaims a tenjin-pay directory whatever `bazaarPay` says at\n * the time, so a gate flipped back off cannot strand the files it wrote.\n */\nexport const SHIPPED_SKILL_FILES: Record<SkillName | OptionalSkillName, readonly string[]> = {\n 'tenjin-search': ['SKILL.md', 'references/permissions.md'],\n 'tenjin-publish': ['SKILL.md', 'references/maintain.md'],\n tenjin: ['SKILL.md'],\n 'tenjin-pay': ['SKILL.md'],\n};\n\n// A `skills/` directory is the real one iff it holds `tenjin/SKILL.md`; a bare\n// `skills/` created for some other reason up the tree can't false-positive.\nconst SENTINEL = join('tenjin', 'SKILL.md');\n\n/**\n * Locate the packaged `skills/` directory by walking up from `startDir`. This has\n * to work in two layouts from one resolver: a global npm install where the module\n * lives in `dist/` with `skills/` a sibling (the `files` array ships it), and a\n * repo/source run where the module is under `src/` and `skills/` sits at the repo\n * root. Walking up until a `skills/` with the sentinel appears covers both without\n * hard-coding either depth. Sync (existsSync) on purpose: this is one-shot path\n * resolution at command start, the same shape as `require.resolve`.\n */\nexport function resolveSkillsSource(startDir: string): string {\n let dir = startDir;\n for (let i = 0; i < 8; i += 1) {\n const candidate = join(dir, 'skills');\n if (existsSync(join(candidate, SENTINEL))) return candidate;\n const parent = dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n throw new CliError('INTERNAL', 'Could not locate the packaged Tenjin skills directory', {\n fix: 'Reinstall tenjin-cli; the published package must ship the skills/ directory (files array).',\n details: { startDir },\n });\n}\n","import { existsSync, statSync } from 'node:fs';\nimport { constants, open } from 'node:fs/promises';\nimport type { FileHandle } from 'node:fs/promises';\nimport { hasCode } from './errno';\nimport { delimiter, join } from 'node:path';\nimport { SKILL_NAMES } from './skills-source';\nimport type { SkillName } from './skills-source';\n\n/**\n * CLI_SKILL_NAMES are the thin adapter skills (roadmap C1), both required for the\n * CLI to be usable from a harness; HOSTED_SKILL_NAME is the zero-install\n * curriculum mirror (roadmap G4), typed as their complement so a rename in\n * skills-source.ts is a compile error here rather than a silently-always-false\n * `cliSkillsWired`.\n */\nexport const CLI_SKILL_NAMES = [\n 'tenjin-search',\n 'tenjin-publish',\n] as const satisfies readonly SkillName[];\nexport type CliSkillName = (typeof CLI_SKILL_NAMES)[number];\nexport type HostedSkillName = Exclude<SkillName, CliSkillName>;\nexport const HOSTED_SKILL_NAME: HostedSkillName = 'tenjin';\n\nexport type NotInvocableReason = 'disabled' | 'unreadable';\n\nexport interface SkillWiring {\n name: string;\n present: boolean;\n /** Undefined when absent. False means on disk yet never surfaced to the model. */\n modelInvocable?: boolean;\n reason?: NotInvocableReason;\n}\n\n/**\n * One directory's verdict. `shadowed` and `partial` are actionable; `hosted-only`\n * is a working zero-install machine, not a defect; `empty` is not a Tenjin dir.\n */\nexport type DirState = 'empty' | 'hosted-only' | 'partial' | 'shadowed' | 'wired';\n\nexport interface HarnessWiring {\n dir: string;\n exists: boolean;\n skills: SkillWiring[];\n state: DirState;\n}\n\n/**\n * `hermesHome` is REQUIRED on every function in this module, and deliberately has\n * no `join(home, '.hermes')` default. A default makes a wrong value invisible at\n * the call site, and the failure it hides is silent: an unattended caller that\n * omits it (`skill-heal`) simply stops covering the Hermes skills directory under\n * a custom HERMES_HOME. A missing argument is a compile error instead.\n */\nexport function skillsDirsFor(home: string, hermesHome: string): string[] {\n return [\n join(home, '.claude', 'skills'),\n join(home, '.agents', 'skills'),\n join(hermesHome, 'skills'),\n ];\n}\n\n/**\n * Every value `install --harness` accepts: the two detectable harnesses plus the\n * `shared` fallback. It lives beside the detection probes because `doctor` has to map\n * a PERSISTED choice back to a directory using the same rules `install` targeted it\n * with, and a second copy of that mapping is exactly the drift this module exists to\n * prevent.\n */\nexport const HARNESS_TARGETS = ['claude', 'codex', 'hermes', 'shared'] as const;\nexport type HarnessTarget = (typeof HARNESS_TARGETS)[number];\n\n/** The skills directory a target writes to. `codex` and `shared` share ~/.agents/skills. */\nexport function harnessTargetDir(home: string, harness: HarnessTarget, hermesHome: string): string {\n if (harness === 'claude') return join(home, '.claude', 'skills');\n if (harness === 'hermes') return join(hermesHome, 'skills');\n return join(home, '.agents', 'skills');\n}\n\n/**\n * The `--harness` value that targets `dir`. A Claude-only machine never targets\n * ~/.agents/skills by default, so a bare `tenjin install` cannot clear a problem\n * found there.\n */\nexport function harnessFlagFor(home: string, dir: string, hermesHome: string): string {\n if (dir === join(home, '.claude', 'skills')) return 'claude';\n if (dir === join(hermesHome, 'skills')) return 'hermes';\n return 'shared';\n}\n\n/** The harnesses `install` probes for. `shared` is a fallback target, never detected. */\nexport type DetectableHarness = Exclude<HarnessTarget, 'shared'>;\n\n/**\n * Why we think `harness` is on this machine: its home dir (~/.claude, ~/.codex) and\n * its binary on PATH. Single-sourced so `install` picks its targets and `doctor`\n * decides which directories MUST be wired from the same two probes — a directory no\n * harness here reads is a leftover, not a defect.\n */\nexport function harnessDetectedBy(\n home: string,\n harness: DetectableHarness,\n which: (bin: string) => boolean,\n hermesHome: string,\n): string[] {\n const reasons: string[] = [];\n const harnessHome = harness === 'hermes' ? hermesHome : join(home, `.${harness}`);\n const hasHome = existsSync(harnessHome);\n if (hasHome) reasons.push('home-dir');\n // A common JavaScript engine binary is also named `hermes`; unlike Claude and\n // Codex it is not sufficient evidence on its own. Pair it with Hermes' home.\n if (which(harness) && (harness !== 'hermes' || hasHome)) reasons.push('binary');\n return reasons;\n}\n\nexport interface HarnessPresence {\n claude: boolean;\n codex: boolean;\n hermes: boolean;\n}\n\nexport function detectHarnesses(\n home: string,\n which: (bin: string) => boolean,\n hermesHome: string,\n): HarnessPresence {\n return {\n claude: harnessDetectedBy(home, 'claude', which, hermesHome).length > 0,\n codex: harnessDetectedBy(home, 'codex', which, hermesHome).length > 0,\n hermes: harnessDetectedBy(home, 'hermes', which, hermesHome).length > 0,\n };\n}\n\n/**\n * Does a harness ON THIS MACHINE read `dir`? Claude Code reads ~/.claude/skills and\n * Codex reads ~/.agents/skills, so a wired .agents does NOT make Claude Code wired:\n * the question has to be asked per directory. When neither harness is detected the\n * shared directory is still in play, because that is the fallback target `install`\n * writes to, so a half-written fallback install is still reported.\n */\nexport function harnessReads(\n home: string,\n dir: string,\n present: HarnessPresence,\n hermesHome: string,\n): boolean {\n const target = harnessFlagFor(home, dir, hermesHome);\n if (target === 'claude') return present.claude;\n if (target === 'hermes') return present.hermes;\n return present.codex || (!present.claude && !present.hermes);\n}\n\n/**\n * Did a past `tenjin install --harness ...` name `dir` on purpose? Detection only sees\n * the harnesses this CLI probes for, and ~/.agents/skills is the cross-harness Agent\n * Skills convention, so \"no Codex here\" is not \"nothing reads it\". `requested` is the\n * user's own answer to that question and outranks the probes.\n */\nexport function harnessRequested(\n home: string,\n dir: string,\n requested: readonly HarnessTarget[],\n hermesHome: string,\n): boolean {\n return requested.some((h) => harnessTargetDir(home, h, hermesHome) === dir);\n}\n\n/**\n * Is `dir` this machine's business at all: read by a detected harness, or explicitly\n * requested. The union is kept separate from `harnessReads` so the reported\n * `harnessPresent` stays a detection fact and does not quietly absorb a config value.\n */\nexport function harnessInPlay(\n home: string,\n dir: string,\n present: HarnessPresence,\n requested: readonly HarnessTarget[],\n hermesHome: string,\n): boolean {\n return (\n harnessReads(home, dir, present, hermesHome) ||\n harnessRequested(home, dir, requested, hermesHome)\n );\n}\n\n/**\n * Is `bin` a real executable file on PATH? Gates on statSync().isFile() so a\n * same-named DIRECTORY on PATH never false-positives as the binary, and probes the\n * PATHEXT extensions on win32 where the real binary is `claude.cmd`/`claude.exe`\n * rather than a bare `claude`.\n */\nexport function onPath(bin: string, env: NodeJS.ProcessEnv): boolean {\n const raw = env.PATH ?? '';\n const exts =\n process.platform === 'win32'\n ? ['', ...(env.PATHEXT ?? '.EXE;.CMD;.BAT;.COM').split(';').filter((e) => e.length > 0)]\n : [''];\n for (const part of raw.split(delimiter)) {\n if (part.length === 0) continue;\n for (const ext of exts) {\n if (isFile(join(part, bin + ext))) return true;\n }\n }\n return false;\n}\n\nfunction isFile(p: string): boolean {\n try {\n return statSync(p).isFile();\n } catch {\n return false;\n }\n}\n\nexport async function readHarnessWiring(dir: string): Promise<HarnessWiring> {\n const exists = existsSync(dir);\n const skills: SkillWiring[] = [];\n for (const name of SKILL_NAMES) skills.push(await readSkillWiring(dir, name));\n return { dir, exists, skills, state: classify(skills) };\n}\n\nexport async function readAllWiring(home: string, hermesHome: string): Promise<HarnessWiring[]> {\n const out: HarnessWiring[] = [];\n for (const dir of skillsDirsFor(home, hermesHome)) out.push(await readHarnessWiring(dir));\n return out;\n}\n\nfunction classify(skills: SkillWiring[]): DirState {\n const cli = CLI_SKILL_NAMES.map((n) => skills.find((s) => s.name === n)).filter(\n (s) => s?.present === true,\n );\n if (cli.length === 0) return skills.some((s) => s.present) ? 'hosted-only' : 'empty';\n if (cli.some((s) => s?.modelInvocable === false)) return 'shadowed';\n return cli.length === CLI_SKILL_NAMES.length ? 'wired' : 'partial';\n}\n\n/**\n * What reading a SKILL.md found. A skill path is operator-controlled, so it is not\n * necessarily a file at all.\n */\nexport type SkillFileRead =\n | { kind: 'ok'; bytes: Buffer }\n | { kind: 'absent' }\n | { kind: 'not-regular' }\n | { kind: 'unreadable'; err: unknown };\n\n/**\n * Read a SKILL.md through ONE descriptor, and only when it is a regular file.\n *\n * `readFile` on a FIFO blocks until a writer appears, and on a character device it\n * streams without end; neither call fails, so no error handling reaches them. A\n * pipe at a wired SKILL.md path hung `tenjin doctor` and `tenjin install` past\n * SIGTERM. Opening non-blocking returns immediately whatever the node type is,\n * `fstat` on that descriptor says what it actually is, and only a regular file is\n * read. Checking the pathname and then reading the pathname would let the two\n * answer about different files.\n *\n * O_NONBLOCK does not exist on Windows, where it degrades to 0; FIFOs are not a\n * meaningful case there.\n */\nexport async function readSkillFile(path: string): Promise<SkillFileRead> {\n let handle: FileHandle;\n try {\n handle = await open(path, constants.O_RDONLY | (constants.O_NONBLOCK ?? 0));\n } catch (err) {\n if (hasCode(err, 'ENOENT')) return { kind: 'absent' };\n return { kind: 'unreadable', err };\n }\n try {\n if (!(await handle.stat()).isFile()) return { kind: 'not-regular' };\n return { kind: 'ok', bytes: await handle.readFile() };\n } catch (err) {\n return { kind: 'unreadable', err };\n } finally {\n await handle.close().catch(() => undefined);\n }\n}\n\nasync function readSkillWiring(dir: string, name: string): Promise<SkillWiring> {\n const read = await readSkillFile(join(dir, name, 'SKILL.md'));\n if (read.kind === 'absent') return { name, present: false };\n // A pipe or a device is there, but it is not a skill and must never be read as\n // one; `unreadable` is the state that already describes \"present, unusable\".\n if (read.kind !== 'ok')\n return { name, present: true, modelInvocable: false, reason: 'unreadable' };\n const text = read.bytes.toString('utf8');\n if (isModelInvocationDisabled(text)) {\n return { name, present: true, modelInvocable: false, reason: 'disabled' };\n }\n return { name, present: true, modelInvocable: true };\n}\n\n/** YAML 1.1 truthy spellings a harness frontmatter parser may accept. */\nconst YAML_TRUE = /^(?:true|yes|on)$/i;\n\n/**\n * Deliberately not a general YAML parse: only the leading `---` block is read,\n * because this repo's own skills discuss the key in prose and a whole-file match\n * would call a working skill disabled.\n */\nexport function isModelInvocationDisabled(skillMd: string): boolean {\n const frontmatter = extractFrontmatter(skillMd);\n if (frontmatter === null) return false;\n return frontmatter.some((line) => {\n const m = /^disable-model-invocation:\\s*(.+?)\\s*$/.exec(line.trim());\n if (m === null) return false;\n // Strip an inline `# comment` and optional quotes before testing truthiness.\n const value = (m[1] ?? '').replace(/\\s+#.*$/, '').replace(/^[\"']|[\"']$/g, '');\n return YAML_TRUE.test(value);\n });\n}\n\n/**\n * The `name:` a SKILL.md declares in its leading frontmatter, or null when it\n * declares none. It is what a harness registers the skill AS, so it is also the\n * cheapest evidence that a file at one of our paths is one of ours: the\n * unattended self-heal refuses to overwrite a same-named third-party skill.\n */\nexport function skillFrontmatterName(skillMd: string): string | null {\n const frontmatter = extractFrontmatter(skillMd);\n if (frontmatter === null) return null;\n for (const line of frontmatter) {\n const m = /^name:\\s*(.+?)\\s*$/.exec(line);\n if (m !== null) return (m[1] ?? '').replace(/^[\"']|[\"']$/g, '');\n }\n return null;\n}\n\nfunction extractFrontmatter(text: string): string[] | null {\n // Tolerate a UTF-8 BOM, CRLF, and leading blank lines before the opening fence.\n const lines = text.replace(/^\\uFEFF/, '').split(/\\r?\\n/);\n const open = lines.findIndex((l) => l.trim().length > 0);\n if (open === -1 || lines[open]?.trim() !== '---') return null;\n const end = lines.findIndex((l, i) => i > open && l.trim() === '---');\n if (end === -1) return null;\n return lines.slice(open + 1, end);\n}\n\nexport function cliSkillsWired(wiring: HarnessWiring): boolean {\n return wiring.state === 'wired';\n}\n\nexport function missingCliSkills(wiring: HarnessWiring): string[] {\n return CLI_SKILL_NAMES.filter(\n (name) => wiring.skills.find((x) => x.name === name)?.present !== true,\n );\n}\n\nexport function shadowedCliSkills(wiring: HarnessWiring): string[] {\n return CLI_SKILL_NAMES.filter((name) => {\n const s = wiring.skills.find((x) => x.name === name);\n return s?.present === true && s.modelInvocable === false;\n });\n}\n\nexport function anyTenjinSkill(wiring: HarnessWiring): boolean {\n return wiring.state !== 'empty';\n}\n"],"mappings":";;;;;;;AAYO,IAAM,oBAAoB;AAM1B,IAAM,kBAAkB,IAAI,IAAI,iBAAiB,EAAE;AAc1D,IAAM,2BAAgD,oBAAI,IAAI;AAAA,EAC5D;AAAA,EACA;AACF,CAAC;AASM,SAAS,iBAAiB,GAAW,GAAoB;AAC9D,MAAI,MAAM,EAAG,QAAO;AACpB,SAAO,yBAAyB,IAAI,CAAC,KAAK,yBAAyB,IAAI,CAAC;AAC1E;AAGO,SAAS,yBAAmC;AACjD,SAAO,CAAC,GAAG,wBAAwB;AACrC;;;ACpDA,SAAS,kBAAkB;AAC3B,SAAS,SAAS,YAAY;AASvB,IAAM,cAAc,CAAC,iBAAiB,kBAAkB,QAAQ;AAUhE,IAAM,qBAAqB;AAC3B,IAAM,uBAAuB,CAAC,kBAAkB;AAIhD,IAAM,uBAAuB,CAAC,GAAG,aAAa,GAAG,oBAAoB;AAkBrE,IAAM,sBAAgF;AAAA,EAC3F,iBAAiB,CAAC,YAAY,2BAA2B;AAAA,EACzD,kBAAkB,CAAC,YAAY,wBAAwB;AAAA,EACvD,QAAQ,CAAC,UAAU;AAAA,EACnB,cAAc,CAAC,UAAU;AAC3B;AAIA,IAAM,WAAW,KAAK,UAAU,UAAU;AAWnC,SAAS,oBAAoB,UAA0B;AAC5D,MAAI,MAAM;AACV,WAAS,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG;AAC7B,UAAM,YAAY,KAAK,KAAK,QAAQ;AACpC,QAAI,WAAW,KAAK,WAAW,QAAQ,CAAC,EAAG,QAAO;AAClD,UAAM,SAAS,QAAQ,GAAG;AAC1B,QAAI,WAAW,IAAK;AACpB,UAAM;AAAA,EACR;AACA,QAAM,IAAI,SAAS,YAAY,yDAAyD;AAAA,IACtF,KAAK;AAAA,IACL,SAAS,EAAE,SAAS;AAAA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