tenjin-cli 0.1.0-alpha.14 → 0.1.0-alpha.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -3
- package/dist/{buy-2JBYPHAI.js → buy-VIRNSYGN.js} +24 -23
- package/dist/{chunk-QWBUKIP2.js → chunk-2MYQN7HM.js} +66 -27
- package/dist/chunk-2MYQN7HM.js.map +1 -0
- package/dist/{chunk-DAZAXFSF.js → chunk-2RF2GIJQ.js} +57 -226
- package/dist/chunk-2RF2GIJQ.js.map +1 -0
- package/dist/{chunk-VEAERJVJ.js → chunk-3GL2Z5QK.js} +23 -9
- package/dist/chunk-3GL2Z5QK.js.map +1 -0
- package/dist/{chunk-IUQZ4Z7M.js → chunk-4CQIDQOT.js} +6 -1
- package/dist/chunk-4CQIDQOT.js.map +1 -0
- package/dist/{chunk-IXZJ3JOO.js → chunk-4KG27W2S.js} +10 -10
- package/dist/chunk-4KG27W2S.js.map +1 -0
- package/dist/{chunk-54AJIO3E.js → chunk-5QQTYWEU.js} +4 -3
- package/dist/chunk-5QQTYWEU.js.map +1 -0
- package/dist/chunk-65DTCCJ7.js +21 -0
- package/dist/chunk-65DTCCJ7.js.map +1 -0
- package/dist/{chunk-7NADDA2V.js → chunk-A5DKHMUN.js} +20 -8
- package/dist/chunk-A5DKHMUN.js.map +1 -0
- package/dist/{chunk-WYLMJQVH.js → chunk-B63XPWQ4.js} +24 -18
- package/dist/chunk-B63XPWQ4.js.map +1 -0
- package/dist/{chunk-L6G35FU5.js → chunk-CAR6FHK6.js} +5 -5
- package/dist/{chunk-7GJQ5RGA.js → chunk-CPCX67TI.js} +20 -22
- package/dist/{chunk-7GJQ5RGA.js.map → chunk-CPCX67TI.js.map} +1 -1
- package/dist/{chunk-XVPQGCH4.js → chunk-CQBVCYI2.js} +36 -50
- package/dist/chunk-CQBVCYI2.js.map +1 -0
- package/dist/chunk-DBU5CXBV.js +4731 -0
- package/dist/chunk-DBU5CXBV.js.map +1 -0
- package/dist/chunk-DHJD77OW.js +81 -0
- package/dist/chunk-DHJD77OW.js.map +1 -0
- package/dist/{chunk-XGZ5EVMB.js → chunk-EDZSNPE5.js} +2 -2
- package/dist/{chunk-736DW4V3.js → chunk-EFWZPUTC.js} +2 -2
- package/dist/chunk-EPFL6CTE.js +448 -0
- package/dist/chunk-EPFL6CTE.js.map +1 -0
- package/dist/{chunk-3P3ES4XU.js → chunk-GHLVXVZD.js} +3 -5
- package/dist/{chunk-3P3ES4XU.js.map → chunk-GHLVXVZD.js.map} +1 -1
- package/dist/{chunk-4UHNXY6B.js → chunk-H3SOOJ2I.js} +88 -294
- package/dist/chunk-H3SOOJ2I.js.map +1 -0
- package/dist/{chunk-MJSXP4LW.js → chunk-HPJGOLTN.js} +6 -8
- package/dist/{chunk-MJSXP4LW.js.map → chunk-HPJGOLTN.js.map} +1 -1
- package/dist/{chunk-J6FUAIRR.js → chunk-HRGBS2PA.js} +4 -6
- package/dist/{chunk-J6FUAIRR.js.map → chunk-HRGBS2PA.js.map} +1 -1
- package/dist/{chunk-FDUD3W5V.js → chunk-ITUXPJIS.js} +55 -58
- package/dist/chunk-ITUXPJIS.js.map +1 -0
- package/dist/{chunk-ETKZWJ4B.js → chunk-JBIKAAT3.js} +2 -2
- package/dist/{chunk-ETKZWJ4B.js.map → chunk-JBIKAAT3.js.map} +1 -1
- package/dist/{chunk-3ZW7HPY5.js → chunk-KAJZHIQ4.js} +13 -10
- package/dist/chunk-KAJZHIQ4.js.map +1 -0
- package/dist/{chunk-OWVVI4VQ.js → chunk-KINZ23CV.js} +107 -4535
- package/dist/chunk-KINZ23CV.js.map +1 -0
- package/dist/{chunk-PCX2JQ2J.js → chunk-LRYV3SK7.js} +9 -7
- package/dist/{chunk-PCX2JQ2J.js.map → chunk-LRYV3SK7.js.map} +1 -1
- package/dist/{chunk-ACBEHJAH.js → chunk-NIKXHWOL.js} +11 -13
- package/dist/{chunk-ACBEHJAH.js.map → chunk-NIKXHWOL.js.map} +1 -1
- package/dist/chunk-OKDRDT74.js +209 -0
- package/dist/chunk-OKDRDT74.js.map +1 -0
- package/dist/chunk-OKYSNAS3.js +2144 -0
- package/dist/chunk-OKYSNAS3.js.map +1 -0
- package/dist/{chunk-B676GPS2.js → chunk-OLWTRUTS.js} +7 -3
- package/dist/{chunk-B676GPS2.js.map → chunk-OLWTRUTS.js.map} +1 -1
- package/dist/{chunk-WU5CZPLD.js → chunk-QQ6ELLSA.js} +6 -8
- package/dist/{chunk-WU5CZPLD.js.map → chunk-QQ6ELLSA.js.map} +1 -1
- package/dist/{chunk-NAAMHWSI.js → chunk-QZ6ROAJU.js} +5 -4
- package/dist/chunk-QZ6ROAJU.js.map +1 -0
- package/dist/{chunk-GEHL43VE.js → chunk-R7RSCBI7.js} +130 -47
- package/dist/chunk-R7RSCBI7.js.map +1 -0
- package/dist/{chunk-LSWP7MU2.js → chunk-U6VPKMGC.js} +127 -27
- package/dist/chunk-U6VPKMGC.js.map +1 -0
- package/dist/{chunk-W4VW5XYB.js → chunk-US456VUI.js} +6 -6
- package/dist/{chunk-O75FOHXS.js → chunk-V44J2MXV.js} +64 -36
- package/dist/chunk-V44J2MXV.js.map +1 -0
- package/dist/{chunk-4Y53PDH6.js → chunk-VJQKL3YH.js} +10 -7
- package/dist/{chunk-4Y53PDH6.js.map → chunk-VJQKL3YH.js.map} +1 -1
- package/dist/{chunk-VRPLZERE.js → chunk-VJSQSLBM.js} +47 -26
- package/dist/chunk-VJSQSLBM.js.map +1 -0
- package/dist/{chunk-PKW3H26Z.js → chunk-VYOJOX4Z.js} +9 -7
- package/dist/chunk-VYOJOX4Z.js.map +1 -0
- package/dist/chunk-WY2K35OL.js +269 -0
- package/dist/chunk-WY2K35OL.js.map +1 -0
- package/dist/{chunk-PAOVPSP6.js → chunk-ZFJJ3EXC.js} +53 -5
- package/dist/chunk-ZFJJ3EXC.js.map +1 -0
- package/dist/{cli-U2BEUA55.js → cli-KKRKBU5T.js} +71 -40
- package/dist/{cli-U2BEUA55.js.map → cli-KKRKBU5T.js.map} +1 -1
- package/dist/config-JMRUNYE6.js +37 -0
- package/dist/discover-B5HF6SHM.js +102 -0
- package/dist/discover-B5HF6SHM.js.map +1 -0
- package/dist/doctor-ZBG7X66D.js +32 -0
- package/dist/edit-PZJIILQE.js +40 -0
- package/dist/{fund-Y5IAHZ5D.js → fund-EUDH5KPA.js} +19 -19
- package/dist/index.js +1 -1
- package/dist/{inspect-NFQ6SQQQ.js → inspect-QC6WEQPN.js} +20 -20
- package/dist/{install-DXX7PVUP.js → install-GNK2W3PI.js} +196 -78
- package/dist/install-GNK2W3PI.js.map +1 -0
- package/dist/outcome-KSGWZHUS.js +24 -0
- package/dist/pay-BC4UICPA.js +361 -0
- package/dist/pay-BC4UICPA.js.map +1 -0
- package/dist/publish-LXWFDIKF.js +42 -0
- package/dist/{read-W7QVRBVD.js → read-JMNUQ56P.js} +21 -21
- package/dist/{run-CJWPGMIQ.js → run-XYTQ5TWQ.js} +52 -45
- package/dist/{run-CJWPGMIQ.js.map → run-XYTQ5TWQ.js.map} +1 -1
- package/dist/search-TSQAB45E.js +25 -0
- package/dist/{send-C5EOKXOU.js → send-G746D7PQ.js} +14 -15
- package/dist/{send-C5EOKXOU.js.map → send-G746D7PQ.js.map} +1 -1
- package/dist/{session-OBCUUIFX.js → session-JBKWMJ24.js} +17 -17
- package/dist/{skill-heal-D6EPLPS6.js → skill-heal-WKD67SLJ.js} +17 -9
- package/dist/skill-heal-WKD67SLJ.js.map +1 -0
- package/dist/skill-placement-RIU4AMC2.js +20 -0
- package/dist/{uninstall-OWJNJ5LI.js → uninstall-5E263VTS.js} +12 -12
- package/dist/uninstall-5E263VTS.js.map +1 -0
- package/dist/{update-24Y2CQTT.js → update-R76LHOZW.js} +7 -8
- package/dist/{update-24Y2CQTT.js.map → update-R76LHOZW.js.map} +1 -1
- package/dist/{wallet-SLRIYJ2U.js → wallet-TQ7D5EQ7.js} +7 -8
- package/dist/{wallet-OFXDIIGP.js → wallet-ZAVXWLWP.js} +11 -12
- package/dist/wallet-ZAVXWLWP.js.map +1 -0
- package/docs/agent-permissions.md +17 -2
- package/docs/command-reference.md +84 -42
- package/docs/safety-model.md +9 -0
- package/package.json +1 -1
- package/skills/tenjin/SKILL.md +38 -29
- package/skills/tenjin-pay/SKILL.md +76 -0
- package/skills/tenjin-publish/SKILL.md +10 -7
- package/skills/tenjin-search/SKILL.md +18 -13
- package/skills/tenjin-search/references/permissions.md +9 -3
- package/dist/chunk-3ZW7HPY5.js.map +0 -1
- package/dist/chunk-4UHNXY6B.js.map +0 -1
- package/dist/chunk-54AJIO3E.js.map +0 -1
- package/dist/chunk-7NADDA2V.js.map +0 -1
- package/dist/chunk-DAZAXFSF.js.map +0 -1
- package/dist/chunk-DTCXO7HS.js +0 -791
- package/dist/chunk-DTCXO7HS.js.map +0 -1
- package/dist/chunk-FDUD3W5V.js.map +0 -1
- package/dist/chunk-GEHL43VE.js.map +0 -1
- package/dist/chunk-IU2HVT3Y.js +0 -313
- package/dist/chunk-IU2HVT3Y.js.map +0 -1
- package/dist/chunk-IUQZ4Z7M.js.map +0 -1
- package/dist/chunk-IXZJ3JOO.js.map +0 -1
- package/dist/chunk-LSWP7MU2.js.map +0 -1
- package/dist/chunk-NAAMHWSI.js.map +0 -1
- package/dist/chunk-O75FOHXS.js.map +0 -1
- package/dist/chunk-OWVVI4VQ.js.map +0 -1
- package/dist/chunk-PAOVPSP6.js.map +0 -1
- package/dist/chunk-PKW3H26Z.js.map +0 -1
- package/dist/chunk-PQZVDCCA.js +0 -125
- package/dist/chunk-PQZVDCCA.js.map +0 -1
- package/dist/chunk-QWBUKIP2.js.map +0 -1
- package/dist/chunk-VEAERJVJ.js.map +0 -1
- package/dist/chunk-VRPLZERE.js.map +0 -1
- package/dist/chunk-WYLMJQVH.js.map +0 -1
- package/dist/chunk-XVPQGCH4.js.map +0 -1
- package/dist/chunk-ZQIQ55KK.js +0 -51
- package/dist/chunk-ZQIQ55KK.js.map +0 -1
- package/dist/config-CNUIX23Q.js +0 -32
- package/dist/doctor-QJJXRWTO.js +0 -31
- package/dist/edit-HJ44P44P.js +0 -40
- package/dist/install-DXX7PVUP.js.map +0 -1
- package/dist/outcome-ANV4QIED.js +0 -24
- package/dist/publish-PCBTCXCZ.js +0 -42
- package/dist/search-JGAVKTYJ.js +0 -25
- package/dist/skill-heal-D6EPLPS6.js.map +0 -1
- package/dist/uninstall-OWJNJ5LI.js.map +0 -1
- /package/dist/{buy-2JBYPHAI.js.map → buy-VIRNSYGN.js.map} +0 -0
- /package/dist/{chunk-L6G35FU5.js.map → chunk-CAR6FHK6.js.map} +0 -0
- /package/dist/{chunk-XGZ5EVMB.js.map → chunk-EDZSNPE5.js.map} +0 -0
- /package/dist/{chunk-736DW4V3.js.map → chunk-EFWZPUTC.js.map} +0 -0
- /package/dist/{chunk-W4VW5XYB.js.map → chunk-US456VUI.js.map} +0 -0
- /package/dist/{config-CNUIX23Q.js.map → config-JMRUNYE6.js.map} +0 -0
- /package/dist/{doctor-QJJXRWTO.js.map → doctor-ZBG7X66D.js.map} +0 -0
- /package/dist/{edit-HJ44P44P.js.map → edit-PZJIILQE.js.map} +0 -0
- /package/dist/{fund-Y5IAHZ5D.js.map → fund-EUDH5KPA.js.map} +0 -0
- /package/dist/{inspect-NFQ6SQQQ.js.map → inspect-QC6WEQPN.js.map} +0 -0
- /package/dist/{outcome-ANV4QIED.js.map → outcome-KSGWZHUS.js.map} +0 -0
- /package/dist/{publish-PCBTCXCZ.js.map → publish-LXWFDIKF.js.map} +0 -0
- /package/dist/{read-W7QVRBVD.js.map → read-JMNUQ56P.js.map} +0 -0
- /package/dist/{search-JGAVKTYJ.js.map → search-TSQAB45E.js.map} +0 -0
- /package/dist/{session-OBCUUIFX.js.map → session-JBKWMJ24.js.map} +0 -0
- /package/dist/{wallet-OFXDIIGP.js.map → skill-placement-RIU4AMC2.js.map} +0 -0
- /package/dist/{wallet-SLRIYJ2U.js.map → wallet-TQ7D5EQ7.js.map} +0 -0
|
@@ -1,82 +1,88 @@
|
|
|
1
1
|
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
runWalletCreate
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NIKXHWOL.js";
|
|
5
5
|
import "./chunk-MJZZTKCC.js";
|
|
6
|
+
import "./chunk-7FK2UN2T.js";
|
|
6
7
|
import {
|
|
7
8
|
describeWallet,
|
|
8
9
|
resolveWalletProvider
|
|
9
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CPCX67TI.js";
|
|
11
|
+
import "./chunk-M2O56UK7.js";
|
|
12
|
+
import "./chunk-UHTVXQ2O.js";
|
|
10
13
|
import {
|
|
11
14
|
collectDoctorChecks,
|
|
12
15
|
isNoWalletCheck
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-R7RSCBI7.js";
|
|
17
|
+
import "./chunk-HRGBS2PA.js";
|
|
18
|
+
import "./chunk-EDZSNPE5.js";
|
|
19
|
+
import "./chunk-5QQTYWEU.js";
|
|
17
20
|
import {
|
|
18
21
|
walletFileExists
|
|
19
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-GHLVXVZD.js";
|
|
20
23
|
import {
|
|
21
24
|
removeMarkerLines
|
|
22
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-B63XPWQ4.js";
|
|
26
|
+
import {
|
|
27
|
+
placeOptionalSkill
|
|
28
|
+
} from "./chunk-DHJD77OW.js";
|
|
23
29
|
import {
|
|
24
30
|
installSkill
|
|
25
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-QZ6ROAJU.js";
|
|
26
32
|
import {
|
|
27
33
|
sanitizeForTerminal
|
|
28
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-OLWTRUTS.js";
|
|
29
35
|
import {
|
|
30
36
|
confirmChoice,
|
|
31
|
-
hooksSkipped,
|
|
32
|
-
hooksUndo,
|
|
33
37
|
intro,
|
|
34
38
|
outro,
|
|
39
|
+
persistAgentDispatchHookMode,
|
|
40
|
+
persistBazaarPay,
|
|
35
41
|
persistInstallHarness,
|
|
36
42
|
persistPublishMode,
|
|
37
|
-
|
|
38
|
-
selectOne
|
|
39
|
-
|
|
40
|
-
} from "./chunk-4UHNXY6B.js";
|
|
41
|
-
import {
|
|
42
|
-
ownsAnyLock,
|
|
43
|
-
releaseOwnedLocks
|
|
44
|
-
} from "./chunk-ZOBNS7CX.js";
|
|
43
|
+
persistWebSearchHookMode,
|
|
44
|
+
selectOne
|
|
45
|
+
} from "./chunk-H3SOOJ2I.js";
|
|
45
46
|
import {
|
|
46
47
|
PERMISSIONS_DOC_URL,
|
|
47
48
|
recommendedPermissions
|
|
48
|
-
} from "./chunk-
|
|
49
|
-
import "./chunk-
|
|
50
|
-
import "./chunk-
|
|
49
|
+
} from "./chunk-4CQIDQOT.js";
|
|
50
|
+
import "./chunk-VYOJOX4Z.js";
|
|
51
|
+
import "./chunk-EFWZPUTC.js";
|
|
52
|
+
import {
|
|
53
|
+
CONFIG_DEFAULTS,
|
|
54
|
+
PublishModeSchema,
|
|
55
|
+
WebSearchModeSchema,
|
|
56
|
+
loadRawConfig,
|
|
57
|
+
parsePublishModeFlag,
|
|
58
|
+
parseWebSearchHookModeFlag
|
|
59
|
+
} from "./chunk-U6VPKMGC.js";
|
|
51
60
|
import "./chunk-UO22YNY4.js";
|
|
52
|
-
import "./chunk-DTCXO7HS.js";
|
|
53
61
|
import {
|
|
54
62
|
FREE_VERB_RULES,
|
|
55
63
|
MODE_GATED_RULES,
|
|
64
|
+
hooksSkipped,
|
|
65
|
+
hooksUndo,
|
|
56
66
|
inspectFreeVerbRules,
|
|
57
67
|
permissionsSkipped,
|
|
58
68
|
planFreeVerbAllowlist,
|
|
69
|
+
resolveHermesHome,
|
|
70
|
+
resolveHermesHomeLenient,
|
|
59
71
|
retractModeGatedRules,
|
|
60
72
|
rulesForPublishMode,
|
|
61
|
-
wireFreeVerbAllowlist
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
loadRawConfig,
|
|
69
|
-
parsePublishModeFlag,
|
|
70
|
-
parseSearchHookModeFlag
|
|
71
|
-
} from "./chunk-LSWP7MU2.js";
|
|
72
|
-
import "./chunk-ETKZWJ4B.js";
|
|
73
|
-
import {
|
|
74
|
-
walletPath
|
|
75
|
-
} from "./chunk-ZQIQ55KK.js";
|
|
73
|
+
wireFreeVerbAllowlist,
|
|
74
|
+
wireHermesIntegration,
|
|
75
|
+
wireSearchHooks
|
|
76
|
+
} from "./chunk-OKYSNAS3.js";
|
|
77
|
+
import "./chunk-A5DKHMUN.js";
|
|
78
|
+
import "./chunk-3GL2Z5QK.js";
|
|
79
|
+
import "./chunk-JBIKAAT3.js";
|
|
76
80
|
import {
|
|
77
81
|
CLI_SKILL_NAMES,
|
|
78
82
|
HARNESS_TARGETS,
|
|
79
83
|
HOSTED_SKILL_NAME,
|
|
84
|
+
OPTIONAL_PAY_SKILL,
|
|
85
|
+
PRODUCTION_HOST,
|
|
80
86
|
SKILL_NAMES,
|
|
81
87
|
harnessDetectedBy,
|
|
82
88
|
harnessTargetDir,
|
|
@@ -84,15 +90,17 @@ import {
|
|
|
84
90
|
onPath,
|
|
85
91
|
readSkillFile,
|
|
86
92
|
resolveSkillsSource
|
|
87
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-2MYQN7HM.js";
|
|
94
|
+
import {
|
|
95
|
+
ownsAnyLock,
|
|
96
|
+
releaseOwnedLocks
|
|
97
|
+
} from "./chunk-ZOBNS7CX.js";
|
|
88
98
|
import {
|
|
89
99
|
CliError,
|
|
90
100
|
external_exports,
|
|
91
|
-
hasCode
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
import "./chunk-M2O56UK7.js";
|
|
95
|
-
import "./chunk-UHTVXQ2O.js";
|
|
101
|
+
hasCode,
|
|
102
|
+
walletPath
|
|
103
|
+
} from "./chunk-ZFJJ3EXC.js";
|
|
96
104
|
import "./chunk-W6R3HAAG.js";
|
|
97
105
|
import "./chunk-U5S527PP.js";
|
|
98
106
|
import "./chunk-47PP7TAG.js";
|
|
@@ -136,7 +144,8 @@ var InstallInputSchema = external_exports.object({
|
|
|
136
144
|
/**
|
|
137
145
|
* `--no-hooks`: register no hooks THIS RUN, changing nothing persistent. It is
|
|
138
146
|
* deliberately not the same as `--search-hooks off`, which is a durable
|
|
139
|
-
* statement about behavior and writes `hooks.
|
|
147
|
+
* statement about behavior and writes `hooks.webSearch: off` (and
|
|
148
|
+
* `hooks.agentDispatch: off`) to config.
|
|
140
149
|
*/
|
|
141
150
|
noHooks: external_exports.boolean().optional()
|
|
142
151
|
});
|
|
@@ -195,7 +204,7 @@ async function installBody(input, ctx, deps, markPhase) {
|
|
|
195
204
|
const noHooks = parsed.data.noHooks === true;
|
|
196
205
|
const allowFreeVerbs = parsed.data.allowFreeVerbs;
|
|
197
206
|
const publishModeFlag = parsed.data.publishMode !== void 0 ? parseModeFlag(parsed.data.publishMode) : void 0;
|
|
198
|
-
const searchHooksFlag = parsed.data.searchHooks !== void 0 ?
|
|
207
|
+
const searchHooksFlag = parsed.data.searchHooks !== void 0 ? parseWebSearchHookModeFlag(parsed.data.searchHooks, "--search-hooks") : void 0;
|
|
199
208
|
const env = deps.env ?? process.env;
|
|
200
209
|
const home = deps.homeDir ?? homedir();
|
|
201
210
|
if (!isAbsolute(home)) {
|
|
@@ -208,13 +217,17 @@ async function installBody(input, ctx, deps, markPhase) {
|
|
|
208
217
|
);
|
|
209
218
|
}
|
|
210
219
|
const which = deps.which ?? ((bin) => onPath(bin, env));
|
|
220
|
+
const targetsHermes = parsed.data.harness?.includes("hermes") === true;
|
|
221
|
+
const hermesTarget = targetsHermes ? { home: resolveHermesHome(home, env), warning: void 0 } : resolveHermesHomeLenient(home, env);
|
|
222
|
+
const hermesHome = hermesTarget.home;
|
|
211
223
|
const humanOutput = ctx.flags.json === true ? false : deps.isInteractive ?? ctx.io.isTTY;
|
|
212
224
|
const canPrompt = humanOutput && (deps.isInteractive ?? Boolean(process.stdin.isTTY));
|
|
213
225
|
const skillsSource = deps.skillsSourceDir ?? resolveSkillsSource(fileURLToPath(new URL(".", import.meta.url)));
|
|
214
226
|
await assertSkillsSource(skillsSource);
|
|
215
|
-
const plans = resolvePlans(parsed.data.harness, home, which);
|
|
227
|
+
const plans = resolvePlans(parsed.data.harness, home, hermesHome, which);
|
|
216
228
|
const explicitHarness = parsed.data.harness !== void 0 && parsed.data.harness.length > 0;
|
|
217
229
|
const harnesses = [];
|
|
230
|
+
const rawConfig = await loadRawConfig(ctx.dataDir);
|
|
218
231
|
if (!dryRun) markPhase("writing-skills");
|
|
219
232
|
for (const plan of plans) {
|
|
220
233
|
harnesses.push(await applyPlan(plan, skillsSource, dryRun));
|
|
@@ -249,10 +262,60 @@ async function installBody(input, ctx, deps, markPhase) {
|
|
|
249
262
|
ctx.dataDir,
|
|
250
263
|
() => resolveHooks({ plans, home, ctx, deps, flag: searchHooksFlag, noHooks, dryRun, canPrompt })
|
|
251
264
|
);
|
|
265
|
+
const hermesResult = harnesses.find((result) => result.harness === "hermes");
|
|
266
|
+
if (hermesResult !== void 0) {
|
|
267
|
+
const tenjinCommand = deps.tenjinCommand ?? process.argv[1];
|
|
268
|
+
const nodeCommand = deps.nodeCommand ?? process.execPath;
|
|
269
|
+
if (tenjinCommand === void 0 || !isAbsolute(tenjinCommand) || !isAbsolute(nodeCommand)) {
|
|
270
|
+
throw new CliError(
|
|
271
|
+
"INTERNAL",
|
|
272
|
+
"Hermes integration requires absolute Tenjin and Node executable paths.",
|
|
273
|
+
{ fix: "Run `tenjin install --harness hermes` through the installed Tenjin CLI." }
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
hermesResult.hermes = await wireHermesIntegration({
|
|
277
|
+
hermesHome,
|
|
278
|
+
dataDir: ctx.dataDir,
|
|
279
|
+
tenjinCommand,
|
|
280
|
+
nodeCommand,
|
|
281
|
+
dryRun,
|
|
282
|
+
// Activation consent: the operator named Hermes on the command line.
|
|
283
|
+
explicit: explicitHarness && targetsHermes,
|
|
284
|
+
// Write consent, read off the SAME hooks decision that gates Claude's
|
|
285
|
+
// settings.json, because `--no-hooks` promises "writes no config" in the
|
|
286
|
+
// README and that promise cannot hold on only one of the two harnesses.
|
|
287
|
+
hooks: { enabled: hermesHooksEnabled(hooks), fix: hooks.fix, mode: hooks.mode }
|
|
288
|
+
});
|
|
289
|
+
for (const part of [
|
|
290
|
+
hermesResult.hermes.mcp,
|
|
291
|
+
hermesResult.hermes.plugin,
|
|
292
|
+
hermesResult.hermes.activation
|
|
293
|
+
]) {
|
|
294
|
+
if (part.warning !== void 0) hermesResult.warnings.push(part.warning);
|
|
295
|
+
}
|
|
296
|
+
if (hermesTarget.warning !== void 0) hermesResult.warnings.push(hermesTarget.warning);
|
|
297
|
+
}
|
|
252
298
|
const wallet = await underDataDir(
|
|
253
299
|
ctx.dataDir,
|
|
254
300
|
() => resolveWallet(ctx, deps, walletSkip(dryRun, noWallet), canPrompt)
|
|
255
301
|
);
|
|
302
|
+
const bazaarPay = await underDataDir(
|
|
303
|
+
ctx.dataDir,
|
|
304
|
+
() => resolveBazaarPay(ctx, deps, dryRun, canPrompt, rawConfig.bazaarPay)
|
|
305
|
+
);
|
|
306
|
+
if (!dryRun) {
|
|
307
|
+
for (const plan of plans) {
|
|
308
|
+
try {
|
|
309
|
+
await placeOptionalSkill(
|
|
310
|
+
OPTIONAL_PAY_SKILL,
|
|
311
|
+
plan.skillsDir,
|
|
312
|
+
skillsSource,
|
|
313
|
+
bazaarPay.enabled
|
|
314
|
+
);
|
|
315
|
+
} catch {
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
256
319
|
const doctorDeps = { ...deps.doctorDeps ?? {} };
|
|
257
320
|
doctorDeps.homeDir ??= home;
|
|
258
321
|
doctorDeps.which ??= which;
|
|
@@ -269,6 +332,7 @@ async function installBody(input, ctx, deps, markPhase) {
|
|
|
269
332
|
pointerCleanup,
|
|
270
333
|
doctor: { status: doctor.failure !== void 0 ? "fail" : "pass", checks: doctor.checks },
|
|
271
334
|
publishMode,
|
|
335
|
+
bazaarPay,
|
|
272
336
|
// Shipped with the install rather than left for the operator to discover after
|
|
273
337
|
// their first auto-mode denial (#33). Static constants, no config key: see
|
|
274
338
|
// lib/permissions.ts for why this is deliberately not operator-editable state.
|
|
@@ -386,17 +450,17 @@ function summaryLines(io, s) {
|
|
|
386
450
|
];
|
|
387
451
|
}
|
|
388
452
|
function hooksDisclosure(h) {
|
|
389
|
-
const shared = "A Stop hook reminds you locally when a MISS you searched for is still unpublished;
|
|
453
|
+
const shared = "A Stop hook reminds you locally when a MISS you searched for is still unpublished, and a SessionStart hook prints one paragraph on when to search first; neither makes a network call.";
|
|
390
454
|
if (h.mode === "remind") {
|
|
391
|
-
return `The WebSearch
|
|
455
|
+
return `The WebSearch and dispatch hooks print a one-line reminder that Tenjin may have an answer; they send nothing off-machine. ${shared}`;
|
|
392
456
|
}
|
|
393
|
-
return `Before a web search, the
|
|
457
|
+
return `Before a web search or a subagent dispatch, the hooks ask ${PRODUCTION_HOST} the same question (free and anonymous, ~2s budget, 5s harness kill) and mention a tested answer if one exists; the query text, or at most 400 characters of the subagent prompt, leaves the machine. They can never block or change the tool call. ${shared}`;
|
|
394
458
|
}
|
|
395
459
|
function hooksLine(io, h) {
|
|
396
460
|
const label = paint(io, "bold", "Search hooks:");
|
|
397
461
|
const wrote = h.added.length + h.updated.length;
|
|
398
462
|
if (wrote > 0) {
|
|
399
|
-
return `${paint(io, "green", "\u2713")} ${label} ${h.mode} mode, ${wrote} hook(s) registered in ${h.path}. Change: tenjin config set hooks.
|
|
463
|
+
return `${paint(io, "green", "\u2713")} ${label} ${h.mode} mode, ${wrote} hook event(s) registered in ${h.path}. Change: tenjin config set hooks.webSearch <auto|remind|off> (or hooks.agentDispatch)`;
|
|
400
464
|
}
|
|
401
465
|
if (h.skipped === void 0) {
|
|
402
466
|
return `${paint(io, "green", "\u2713")} ${label} ${h.mode} mode, already registered in ${h.path}`;
|
|
@@ -404,11 +468,14 @@ function hooksLine(io, h) {
|
|
|
404
468
|
if (h.skipped === "harness-not-claude") {
|
|
405
469
|
return `${paint(io, "dim", "-")} ${label} not wired (Claude Code only).`;
|
|
406
470
|
}
|
|
471
|
+
if (h.skipped === "native-harness") {
|
|
472
|
+
return `${paint(io, "green", "\u2713")} ${label} ${h.mode} mode through the native Hermes plugin. Change: tenjin config set hooks.webSearch <auto|remind|off> (or hooks.agentDispatch)`;
|
|
473
|
+
}
|
|
407
474
|
if (h.skipped === "dry-run") {
|
|
408
475
|
return `${paint(io, "dim", "-")} ${label} unchanged (dry run).`;
|
|
409
476
|
}
|
|
410
477
|
if (h.skipped === "mode-off") {
|
|
411
|
-
return `${paint(io, "dim", "-")} ${label} off (hooks.
|
|
478
|
+
return `${paint(io, "dim", "-")} ${label} off (hooks.webSearch). Turn them on: tenjin config set hooks.webSearch auto, then tenjin install`;
|
|
412
479
|
}
|
|
413
480
|
if (h.skipped === "declined") {
|
|
414
481
|
return `${paint(io, "dim", "-")} ${label} not registered this run; nothing was configured. Register them: tenjin install`;
|
|
@@ -419,7 +486,7 @@ function hooksLine(io, h) {
|
|
|
419
486
|
return `${paint(io, "yellow", "!")} ${label} ${h.path} was left untouched. Fix it, then: tenjin install`;
|
|
420
487
|
}
|
|
421
488
|
function harnessLabel(h) {
|
|
422
|
-
return h === "claude" ? "Claude Code" : h === "codex" ? "Codex" : "Agent Skills";
|
|
489
|
+
return h === "claude" ? "Claude Code" : h === "codex" ? "Codex" : h === "hermes" ? "Hermes" : "Agent Skills";
|
|
423
490
|
}
|
|
424
491
|
function skillsLine(io, h, dryRun) {
|
|
425
492
|
const changed = h.skills.some((s) => s.status !== "up-to-date");
|
|
@@ -540,6 +607,15 @@ async function defaultCreateWallet(ctx, passphrase, env) {
|
|
|
540
607
|
function defaultConfirm(label) {
|
|
541
608
|
return confirmChoice(label, true);
|
|
542
609
|
}
|
|
610
|
+
var BAZAAR_QUESTION = "Enable the Bazaar pay lane? x402 lets this wallet pay HTTP endpoints that answer with a priced 402, and the Bazaar (https://docs.cdp.coinbase.com/x402/bazaar) is the public catalog of them. When on, `tenjin pay` may pay Bazaar-listed non-Tenjin endpoints under your spend policy. More: https://x402.org";
|
|
611
|
+
async function resolveBazaarPay(ctx, deps, dryRun, canPrompt, existing) {
|
|
612
|
+
if (existing !== void 0) return { enabled: existing, status: "kept" };
|
|
613
|
+
if (dryRun || !canPrompt) return { enabled: false, status: "not-asked" };
|
|
614
|
+
const confirm = deps.confirmBazaarPay ?? ((label) => confirmChoice(label, false));
|
|
615
|
+
const yes = await confirm(BAZAAR_QUESTION);
|
|
616
|
+
await persistBazaarPay(ctx.dataDir, yes);
|
|
617
|
+
return { enabled: yes, status: yes ? "enabled" : "declined" };
|
|
618
|
+
}
|
|
543
619
|
function summaryAlreadySaysNoWallet(wallet) {
|
|
544
620
|
return wallet.status === "declined" || wallet.status === "skipped";
|
|
545
621
|
}
|
|
@@ -631,7 +707,8 @@ async function resolvePermissions(args) {
|
|
|
631
707
|
// reverse is true, and the operator needs to know which file changed.
|
|
632
708
|
...result.path === void 0 ? { path: retractedFrom } : {}
|
|
633
709
|
};
|
|
634
|
-
|
|
710
|
+
const hasClaude = plans.some((p) => p.harness === "claude");
|
|
711
|
+
if (!hasClaude) {
|
|
635
712
|
return withRetraction(
|
|
636
713
|
permissionsSkipped(plans[0]?.harness ?? "shared", home, "harness-not-claude")
|
|
637
714
|
);
|
|
@@ -656,7 +733,7 @@ var SEARCH_HOOKS_CHOICES = [
|
|
|
656
733
|
{
|
|
657
734
|
value: "auto",
|
|
658
735
|
label: "Yes, check Tenjin first (recommended)",
|
|
659
|
-
hint:
|
|
736
|
+
hint: `before a WebSearch or a subagent dispatch, ask ${PRODUCTION_HOST} the same question (free, anonymous, 2s budget) and mention a tested answer; the query or the first 400 chars of the prompt leaves the machine`
|
|
660
737
|
},
|
|
661
738
|
{
|
|
662
739
|
value: "remind",
|
|
@@ -668,8 +745,16 @@ var SEARCH_HOOKS_CHOICES = [
|
|
|
668
745
|
async function resolveHooks(args) {
|
|
669
746
|
const { plans, home, ctx, deps, flag, noHooks, dryRun, canPrompt } = args;
|
|
670
747
|
const dataDir = ctx.dataDir;
|
|
671
|
-
const
|
|
672
|
-
|
|
748
|
+
const rawHooks = (await loadRawConfig(dataDir)).hooks;
|
|
749
|
+
const stored = rawHooks?.webSearch ?? rawHooks?.searchMode;
|
|
750
|
+
const storedWebSearch = rawHooks?.webSearch ?? rawHooks?.searchMode;
|
|
751
|
+
const storedAgentDispatchRaw = rawHooks?.agentDispatch ?? (rawHooks?.dispatchMode === "inherit" ? storedWebSearch : rawHooks?.dispatchMode);
|
|
752
|
+
const storedAgentDispatch = storedAgentDispatchRaw ?? (rawHooks?.searchMode !== void 0 ? storedWebSearch : void 0);
|
|
753
|
+
const storedWebSearchEff = storedWebSearch ?? DEFAULT_HOOK_MODE;
|
|
754
|
+
const storedAgentDispatchEff = storedAgentDispatch ?? storedWebSearch ?? DEFAULT_HOOK_MODE;
|
|
755
|
+
const hasClaude = plans.some((p) => p.harness === "claude");
|
|
756
|
+
const hasHermes = plans.some((p) => p.harness === "hermes");
|
|
757
|
+
if (!hasClaude && !hasHermes) {
|
|
673
758
|
const harness = plans[0]?.harness ?? "shared";
|
|
674
759
|
return hooksSkipped(
|
|
675
760
|
harness,
|
|
@@ -680,26 +765,47 @@ async function resolveHooks(args) {
|
|
|
680
765
|
);
|
|
681
766
|
}
|
|
682
767
|
if (noHooks) {
|
|
683
|
-
return hooksSkipped(
|
|
768
|
+
return hooksSkipped(
|
|
769
|
+
hasHermes ? "hermes" : "claude",
|
|
770
|
+
home,
|
|
771
|
+
dataDir,
|
|
772
|
+
stored ?? DEFAULT_HOOK_MODE,
|
|
773
|
+
"declined"
|
|
774
|
+
);
|
|
684
775
|
}
|
|
685
776
|
const mode = await chooseHookMode(flag, stored, deps, dryRun, canPrompt);
|
|
686
777
|
if (mode === null) {
|
|
687
|
-
return hooksSkipped(
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
778
|
+
return hooksSkipped(
|
|
779
|
+
hasHermes ? "hermes" : "claude",
|
|
780
|
+
home,
|
|
781
|
+
dataDir,
|
|
782
|
+
stored ?? DEFAULT_HOOK_MODE,
|
|
783
|
+
"declined"
|
|
784
|
+
);
|
|
692
785
|
}
|
|
693
|
-
|
|
786
|
+
const resultHarness = hasHermes && !hasClaude ? "hermes" : "claude";
|
|
787
|
+
if (dryRun) return hooksSkipped(resultHarness, home, dataDir, mode, "dry-run");
|
|
788
|
+
const isExplicitChoice = flag !== void 0 || canPrompt && !dryRun;
|
|
789
|
+
const hasAnyHookKey = rawHooks?.webSearch !== void 0 || rawHooks?.agentDispatch !== void 0 || rawHooks?.searchMode !== void 0 || rawHooks?.dispatchMode !== void 0;
|
|
790
|
+
const needsSync = isExplicitChoice ? rawHooks?.webSearch === void 0 || rawHooks?.agentDispatch === void 0 || mode !== storedWebSearchEff || mode !== storedAgentDispatchEff : !hasAnyHookKey;
|
|
791
|
+
if (needsSync) {
|
|
792
|
+
await persistWebSearchHookMode(dataDir, mode);
|
|
793
|
+
await persistAgentDispatchHookMode(dataDir, mode);
|
|
794
|
+
}
|
|
795
|
+
if (mode === "off") return hooksSkipped(resultHarness, home, dataDir, mode, "mode-off");
|
|
796
|
+
if (!hasClaude) return hooksSkipped("hermes", home, dataDir, mode, "native-harness");
|
|
694
797
|
return wireSearchHooks({ homeDir: home, dataDir, mode });
|
|
695
798
|
}
|
|
696
|
-
|
|
799
|
+
function hermesHooksEnabled(hooks) {
|
|
800
|
+
return hooks.skipped !== "declined" && hooks.skipped !== "mode-off" && hooks.skipped !== "harness-not-claude";
|
|
801
|
+
}
|
|
802
|
+
var DEFAULT_HOOK_MODE = CONFIG_DEFAULTS.hooks.webSearch;
|
|
697
803
|
async function chooseHookMode(flag, stored, deps, dryRun, canPrompt) {
|
|
698
804
|
if (flag !== void 0) return flag;
|
|
699
805
|
if (dryRun || !canPrompt) return stored ?? DEFAULT_HOOK_MODE;
|
|
700
806
|
const answer = await (deps.promptSearchHooks ?? defaultPromptSearchHooks)();
|
|
701
807
|
if (answer === null) return null;
|
|
702
|
-
const parsed =
|
|
808
|
+
const parsed = WebSearchModeSchema.safeParse(answer);
|
|
703
809
|
return parsed.success ? parsed.data : null;
|
|
704
810
|
}
|
|
705
811
|
function defaultPromptSearchHooks() {
|
|
@@ -709,24 +815,35 @@ function defaultPromptSearchHooks() {
|
|
|
709
815
|
initialValue: "auto"
|
|
710
816
|
});
|
|
711
817
|
}
|
|
712
|
-
function resolvePlans(override, home, which) {
|
|
818
|
+
function resolvePlans(override, home, hermesHome, which) {
|
|
713
819
|
if (override !== void 0 && override.length > 0) {
|
|
714
|
-
const plans2 = override.map(
|
|
820
|
+
const plans2 = override.map(
|
|
821
|
+
(v) => planFor(validateHarness(v), ["override"], true, home, hermesHome)
|
|
822
|
+
);
|
|
715
823
|
return dedupeBySkillsDir(plans2);
|
|
716
824
|
}
|
|
717
825
|
const plans = [];
|
|
718
|
-
const claudeBy = harnessDetectedBy(home, "claude", which);
|
|
719
|
-
const codexBy = harnessDetectedBy(home, "codex", which);
|
|
720
|
-
|
|
721
|
-
if (
|
|
826
|
+
const claudeBy = harnessDetectedBy(home, "claude", which, hermesHome);
|
|
827
|
+
const codexBy = harnessDetectedBy(home, "codex", which, hermesHome);
|
|
828
|
+
const hermesBy = harnessDetectedBy(home, "hermes", which, hermesHome);
|
|
829
|
+
if (claudeBy.length > 0) plans.push(planFor("claude", claudeBy, true, home, hermesHome));
|
|
830
|
+
if (codexBy.length > 0) plans.push(planFor("codex", codexBy, true, home, hermesHome));
|
|
831
|
+
if (hermesBy.length > 0) plans.push(planFor("hermes", hermesBy, true, home, hermesHome));
|
|
722
832
|
if (plans.length === 0) {
|
|
723
|
-
plans.push(planFor("shared", ["fallback"], false, home));
|
|
833
|
+
plans.push(planFor("shared", ["fallback"], false, home, hermesHome));
|
|
724
834
|
}
|
|
725
835
|
return dedupeBySkillsDir(plans);
|
|
726
836
|
}
|
|
727
|
-
function planFor(harness, detectedBy, detected, home) {
|
|
728
|
-
const skillsDir = harnessTargetDir(home, harness);
|
|
729
|
-
return {
|
|
837
|
+
function planFor(harness, detectedBy, detected, home, hermesHome) {
|
|
838
|
+
const skillsDir = harnessTargetDir(home, harness, hermesHome);
|
|
839
|
+
return {
|
|
840
|
+
harness,
|
|
841
|
+
detected,
|
|
842
|
+
detectedBy,
|
|
843
|
+
skillsDir,
|
|
844
|
+
wiresAgentsMd: harness !== "claude" && harness !== "hermes",
|
|
845
|
+
home
|
|
846
|
+
};
|
|
730
847
|
}
|
|
731
848
|
function dedupeBySkillsDir(plans) {
|
|
732
849
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -842,6 +959,7 @@ async function assertSkillsSource(dir) {
|
|
|
842
959
|
}
|
|
843
960
|
}
|
|
844
961
|
export {
|
|
962
|
+
BAZAAR_QUESTION,
|
|
845
963
|
PERMISSIONS_QUESTION,
|
|
846
964
|
PUBLISH_MODE_CHOICES,
|
|
847
965
|
PUBLISH_MODE_QUESTION,
|
|
@@ -851,4 +969,4 @@ export {
|
|
|
851
969
|
permissionsQuestion,
|
|
852
970
|
runInstall
|
|
853
971
|
};
|
|
854
|
-
//# sourceMappingURL=install-
|
|
972
|
+
//# sourceMappingURL=install-GNK2W3PI.js.map
|