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.
Files changed (176) hide show
  1. package/README.md +18 -3
  2. package/dist/{buy-2JBYPHAI.js → buy-VIRNSYGN.js} +24 -23
  3. package/dist/{chunk-QWBUKIP2.js → chunk-2MYQN7HM.js} +66 -27
  4. package/dist/chunk-2MYQN7HM.js.map +1 -0
  5. package/dist/{chunk-DAZAXFSF.js → chunk-2RF2GIJQ.js} +57 -226
  6. package/dist/chunk-2RF2GIJQ.js.map +1 -0
  7. package/dist/{chunk-VEAERJVJ.js → chunk-3GL2Z5QK.js} +23 -9
  8. package/dist/chunk-3GL2Z5QK.js.map +1 -0
  9. package/dist/{chunk-IUQZ4Z7M.js → chunk-4CQIDQOT.js} +6 -1
  10. package/dist/chunk-4CQIDQOT.js.map +1 -0
  11. package/dist/{chunk-IXZJ3JOO.js → chunk-4KG27W2S.js} +10 -10
  12. package/dist/chunk-4KG27W2S.js.map +1 -0
  13. package/dist/{chunk-54AJIO3E.js → chunk-5QQTYWEU.js} +4 -3
  14. package/dist/chunk-5QQTYWEU.js.map +1 -0
  15. package/dist/chunk-65DTCCJ7.js +21 -0
  16. package/dist/chunk-65DTCCJ7.js.map +1 -0
  17. package/dist/{chunk-7NADDA2V.js → chunk-A5DKHMUN.js} +20 -8
  18. package/dist/chunk-A5DKHMUN.js.map +1 -0
  19. package/dist/{chunk-WYLMJQVH.js → chunk-B63XPWQ4.js} +24 -18
  20. package/dist/chunk-B63XPWQ4.js.map +1 -0
  21. package/dist/{chunk-L6G35FU5.js → chunk-CAR6FHK6.js} +5 -5
  22. package/dist/{chunk-7GJQ5RGA.js → chunk-CPCX67TI.js} +20 -22
  23. package/dist/{chunk-7GJQ5RGA.js.map → chunk-CPCX67TI.js.map} +1 -1
  24. package/dist/{chunk-XVPQGCH4.js → chunk-CQBVCYI2.js} +36 -50
  25. package/dist/chunk-CQBVCYI2.js.map +1 -0
  26. package/dist/chunk-DBU5CXBV.js +4731 -0
  27. package/dist/chunk-DBU5CXBV.js.map +1 -0
  28. package/dist/chunk-DHJD77OW.js +81 -0
  29. package/dist/chunk-DHJD77OW.js.map +1 -0
  30. package/dist/{chunk-XGZ5EVMB.js → chunk-EDZSNPE5.js} +2 -2
  31. package/dist/{chunk-736DW4V3.js → chunk-EFWZPUTC.js} +2 -2
  32. package/dist/chunk-EPFL6CTE.js +448 -0
  33. package/dist/chunk-EPFL6CTE.js.map +1 -0
  34. package/dist/{chunk-3P3ES4XU.js → chunk-GHLVXVZD.js} +3 -5
  35. package/dist/{chunk-3P3ES4XU.js.map → chunk-GHLVXVZD.js.map} +1 -1
  36. package/dist/{chunk-4UHNXY6B.js → chunk-H3SOOJ2I.js} +88 -294
  37. package/dist/chunk-H3SOOJ2I.js.map +1 -0
  38. package/dist/{chunk-MJSXP4LW.js → chunk-HPJGOLTN.js} +6 -8
  39. package/dist/{chunk-MJSXP4LW.js.map → chunk-HPJGOLTN.js.map} +1 -1
  40. package/dist/{chunk-J6FUAIRR.js → chunk-HRGBS2PA.js} +4 -6
  41. package/dist/{chunk-J6FUAIRR.js.map → chunk-HRGBS2PA.js.map} +1 -1
  42. package/dist/{chunk-FDUD3W5V.js → chunk-ITUXPJIS.js} +55 -58
  43. package/dist/chunk-ITUXPJIS.js.map +1 -0
  44. package/dist/{chunk-ETKZWJ4B.js → chunk-JBIKAAT3.js} +2 -2
  45. package/dist/{chunk-ETKZWJ4B.js.map → chunk-JBIKAAT3.js.map} +1 -1
  46. package/dist/{chunk-3ZW7HPY5.js → chunk-KAJZHIQ4.js} +13 -10
  47. package/dist/chunk-KAJZHIQ4.js.map +1 -0
  48. package/dist/{chunk-OWVVI4VQ.js → chunk-KINZ23CV.js} +107 -4535
  49. package/dist/chunk-KINZ23CV.js.map +1 -0
  50. package/dist/{chunk-PCX2JQ2J.js → chunk-LRYV3SK7.js} +9 -7
  51. package/dist/{chunk-PCX2JQ2J.js.map → chunk-LRYV3SK7.js.map} +1 -1
  52. package/dist/{chunk-ACBEHJAH.js → chunk-NIKXHWOL.js} +11 -13
  53. package/dist/{chunk-ACBEHJAH.js.map → chunk-NIKXHWOL.js.map} +1 -1
  54. package/dist/chunk-OKDRDT74.js +209 -0
  55. package/dist/chunk-OKDRDT74.js.map +1 -0
  56. package/dist/chunk-OKYSNAS3.js +2144 -0
  57. package/dist/chunk-OKYSNAS3.js.map +1 -0
  58. package/dist/{chunk-B676GPS2.js → chunk-OLWTRUTS.js} +7 -3
  59. package/dist/{chunk-B676GPS2.js.map → chunk-OLWTRUTS.js.map} +1 -1
  60. package/dist/{chunk-WU5CZPLD.js → chunk-QQ6ELLSA.js} +6 -8
  61. package/dist/{chunk-WU5CZPLD.js.map → chunk-QQ6ELLSA.js.map} +1 -1
  62. package/dist/{chunk-NAAMHWSI.js → chunk-QZ6ROAJU.js} +5 -4
  63. package/dist/chunk-QZ6ROAJU.js.map +1 -0
  64. package/dist/{chunk-GEHL43VE.js → chunk-R7RSCBI7.js} +130 -47
  65. package/dist/chunk-R7RSCBI7.js.map +1 -0
  66. package/dist/{chunk-LSWP7MU2.js → chunk-U6VPKMGC.js} +127 -27
  67. package/dist/chunk-U6VPKMGC.js.map +1 -0
  68. package/dist/{chunk-W4VW5XYB.js → chunk-US456VUI.js} +6 -6
  69. package/dist/{chunk-O75FOHXS.js → chunk-V44J2MXV.js} +64 -36
  70. package/dist/chunk-V44J2MXV.js.map +1 -0
  71. package/dist/{chunk-4Y53PDH6.js → chunk-VJQKL3YH.js} +10 -7
  72. package/dist/{chunk-4Y53PDH6.js.map → chunk-VJQKL3YH.js.map} +1 -1
  73. package/dist/{chunk-VRPLZERE.js → chunk-VJSQSLBM.js} +47 -26
  74. package/dist/chunk-VJSQSLBM.js.map +1 -0
  75. package/dist/{chunk-PKW3H26Z.js → chunk-VYOJOX4Z.js} +9 -7
  76. package/dist/chunk-VYOJOX4Z.js.map +1 -0
  77. package/dist/chunk-WY2K35OL.js +269 -0
  78. package/dist/chunk-WY2K35OL.js.map +1 -0
  79. package/dist/{chunk-PAOVPSP6.js → chunk-ZFJJ3EXC.js} +53 -5
  80. package/dist/chunk-ZFJJ3EXC.js.map +1 -0
  81. package/dist/{cli-U2BEUA55.js → cli-KKRKBU5T.js} +71 -40
  82. package/dist/{cli-U2BEUA55.js.map → cli-KKRKBU5T.js.map} +1 -1
  83. package/dist/config-JMRUNYE6.js +37 -0
  84. package/dist/discover-B5HF6SHM.js +102 -0
  85. package/dist/discover-B5HF6SHM.js.map +1 -0
  86. package/dist/doctor-ZBG7X66D.js +32 -0
  87. package/dist/edit-PZJIILQE.js +40 -0
  88. package/dist/{fund-Y5IAHZ5D.js → fund-EUDH5KPA.js} +19 -19
  89. package/dist/index.js +1 -1
  90. package/dist/{inspect-NFQ6SQQQ.js → inspect-QC6WEQPN.js} +20 -20
  91. package/dist/{install-DXX7PVUP.js → install-GNK2W3PI.js} +196 -78
  92. package/dist/install-GNK2W3PI.js.map +1 -0
  93. package/dist/outcome-KSGWZHUS.js +24 -0
  94. package/dist/pay-BC4UICPA.js +361 -0
  95. package/dist/pay-BC4UICPA.js.map +1 -0
  96. package/dist/publish-LXWFDIKF.js +42 -0
  97. package/dist/{read-W7QVRBVD.js → read-JMNUQ56P.js} +21 -21
  98. package/dist/{run-CJWPGMIQ.js → run-XYTQ5TWQ.js} +52 -45
  99. package/dist/{run-CJWPGMIQ.js.map → run-XYTQ5TWQ.js.map} +1 -1
  100. package/dist/search-TSQAB45E.js +25 -0
  101. package/dist/{send-C5EOKXOU.js → send-G746D7PQ.js} +14 -15
  102. package/dist/{send-C5EOKXOU.js.map → send-G746D7PQ.js.map} +1 -1
  103. package/dist/{session-OBCUUIFX.js → session-JBKWMJ24.js} +17 -17
  104. package/dist/{skill-heal-D6EPLPS6.js → skill-heal-WKD67SLJ.js} +17 -9
  105. package/dist/skill-heal-WKD67SLJ.js.map +1 -0
  106. package/dist/skill-placement-RIU4AMC2.js +20 -0
  107. package/dist/{uninstall-OWJNJ5LI.js → uninstall-5E263VTS.js} +12 -12
  108. package/dist/uninstall-5E263VTS.js.map +1 -0
  109. package/dist/{update-24Y2CQTT.js → update-R76LHOZW.js} +7 -8
  110. package/dist/{update-24Y2CQTT.js.map → update-R76LHOZW.js.map} +1 -1
  111. package/dist/{wallet-SLRIYJ2U.js → wallet-TQ7D5EQ7.js} +7 -8
  112. package/dist/{wallet-OFXDIIGP.js → wallet-ZAVXWLWP.js} +11 -12
  113. package/dist/wallet-ZAVXWLWP.js.map +1 -0
  114. package/docs/agent-permissions.md +17 -2
  115. package/docs/command-reference.md +84 -42
  116. package/docs/safety-model.md +9 -0
  117. package/package.json +1 -1
  118. package/skills/tenjin/SKILL.md +38 -29
  119. package/skills/tenjin-pay/SKILL.md +76 -0
  120. package/skills/tenjin-publish/SKILL.md +10 -7
  121. package/skills/tenjin-search/SKILL.md +18 -13
  122. package/skills/tenjin-search/references/permissions.md +9 -3
  123. package/dist/chunk-3ZW7HPY5.js.map +0 -1
  124. package/dist/chunk-4UHNXY6B.js.map +0 -1
  125. package/dist/chunk-54AJIO3E.js.map +0 -1
  126. package/dist/chunk-7NADDA2V.js.map +0 -1
  127. package/dist/chunk-DAZAXFSF.js.map +0 -1
  128. package/dist/chunk-DTCXO7HS.js +0 -791
  129. package/dist/chunk-DTCXO7HS.js.map +0 -1
  130. package/dist/chunk-FDUD3W5V.js.map +0 -1
  131. package/dist/chunk-GEHL43VE.js.map +0 -1
  132. package/dist/chunk-IU2HVT3Y.js +0 -313
  133. package/dist/chunk-IU2HVT3Y.js.map +0 -1
  134. package/dist/chunk-IUQZ4Z7M.js.map +0 -1
  135. package/dist/chunk-IXZJ3JOO.js.map +0 -1
  136. package/dist/chunk-LSWP7MU2.js.map +0 -1
  137. package/dist/chunk-NAAMHWSI.js.map +0 -1
  138. package/dist/chunk-O75FOHXS.js.map +0 -1
  139. package/dist/chunk-OWVVI4VQ.js.map +0 -1
  140. package/dist/chunk-PAOVPSP6.js.map +0 -1
  141. package/dist/chunk-PKW3H26Z.js.map +0 -1
  142. package/dist/chunk-PQZVDCCA.js +0 -125
  143. package/dist/chunk-PQZVDCCA.js.map +0 -1
  144. package/dist/chunk-QWBUKIP2.js.map +0 -1
  145. package/dist/chunk-VEAERJVJ.js.map +0 -1
  146. package/dist/chunk-VRPLZERE.js.map +0 -1
  147. package/dist/chunk-WYLMJQVH.js.map +0 -1
  148. package/dist/chunk-XVPQGCH4.js.map +0 -1
  149. package/dist/chunk-ZQIQ55KK.js +0 -51
  150. package/dist/chunk-ZQIQ55KK.js.map +0 -1
  151. package/dist/config-CNUIX23Q.js +0 -32
  152. package/dist/doctor-QJJXRWTO.js +0 -31
  153. package/dist/edit-HJ44P44P.js +0 -40
  154. package/dist/install-DXX7PVUP.js.map +0 -1
  155. package/dist/outcome-ANV4QIED.js +0 -24
  156. package/dist/publish-PCBTCXCZ.js +0 -42
  157. package/dist/search-JGAVKTYJ.js +0 -25
  158. package/dist/skill-heal-D6EPLPS6.js.map +0 -1
  159. package/dist/uninstall-OWJNJ5LI.js.map +0 -1
  160. /package/dist/{buy-2JBYPHAI.js.map → buy-VIRNSYGN.js.map} +0 -0
  161. /package/dist/{chunk-L6G35FU5.js.map → chunk-CAR6FHK6.js.map} +0 -0
  162. /package/dist/{chunk-XGZ5EVMB.js.map → chunk-EDZSNPE5.js.map} +0 -0
  163. /package/dist/{chunk-736DW4V3.js.map → chunk-EFWZPUTC.js.map} +0 -0
  164. /package/dist/{chunk-W4VW5XYB.js.map → chunk-US456VUI.js.map} +0 -0
  165. /package/dist/{config-CNUIX23Q.js.map → config-JMRUNYE6.js.map} +0 -0
  166. /package/dist/{doctor-QJJXRWTO.js.map → doctor-ZBG7X66D.js.map} +0 -0
  167. /package/dist/{edit-HJ44P44P.js.map → edit-PZJIILQE.js.map} +0 -0
  168. /package/dist/{fund-Y5IAHZ5D.js.map → fund-EUDH5KPA.js.map} +0 -0
  169. /package/dist/{inspect-NFQ6SQQQ.js.map → inspect-QC6WEQPN.js.map} +0 -0
  170. /package/dist/{outcome-ANV4QIED.js.map → outcome-KSGWZHUS.js.map} +0 -0
  171. /package/dist/{publish-PCBTCXCZ.js.map → publish-LXWFDIKF.js.map} +0 -0
  172. /package/dist/{read-W7QVRBVD.js.map → read-JMNUQ56P.js.map} +0 -0
  173. /package/dist/{search-JGAVKTYJ.js.map → search-TSQAB45E.js.map} +0 -0
  174. /package/dist/{session-OBCUUIFX.js.map → session-JBKWMJ24.js.map} +0 -0
  175. /package/dist/{wallet-OFXDIIGP.js.map → skill-placement-RIU4AMC2.js.map} +0 -0
  176. /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-ACBEHJAH.js";
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-7GJQ5RGA.js";
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-GEHL43VE.js";
14
- import "./chunk-J6FUAIRR.js";
15
- import "./chunk-54AJIO3E.js";
16
- import "./chunk-XGZ5EVMB.js";
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-3P3ES4XU.js";
22
+ } from "./chunk-GHLVXVZD.js";
20
23
  import {
21
24
  removeMarkerLines
22
- } from "./chunk-WYLMJQVH.js";
25
+ } from "./chunk-B63XPWQ4.js";
26
+ import {
27
+ placeOptionalSkill
28
+ } from "./chunk-DHJD77OW.js";
23
29
  import {
24
30
  installSkill
25
- } from "./chunk-NAAMHWSI.js";
31
+ } from "./chunk-QZ6ROAJU.js";
26
32
  import {
27
33
  sanitizeForTerminal
28
- } from "./chunk-B676GPS2.js";
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
- persistSearchHookMode,
38
- selectOne,
39
- wireSearchHooks
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-IUQZ4Z7M.js";
49
- import "./chunk-PKW3H26Z.js";
50
- import "./chunk-736DW4V3.js";
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
- } from "./chunk-IU2HVT3Y.js";
63
- import "./chunk-VEAERJVJ.js";
64
- import {
65
- CONFIG_DEFAULTS,
66
- PublishModeSchema,
67
- SearchHookModeSchema,
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-QWBUKIP2.js";
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
- } from "./chunk-PAOVPSP6.js";
93
- import "./chunk-7FK2UN2T.js";
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.searchMode: off` to config.
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 ? parseSearchHookModeFlag(parsed.data.searchHooks, "--search-hooks") : 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; it makes no network call.";
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 hook prints a one-line reminder that Tenjin may have an answer; it sends nothing off-machine. ${shared}`;
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 WebSearch hook asks tenjin.blog the same question (free and anonymous, ~2s budget, 5s harness kill) and mentions a tested answer if one exists; the query text leaves the machine. It can never block or change the search. ${shared}`;
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.searchMode <auto|remind|off>`;
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.searchMode). Turn them on: tenjin config set hooks.searchMode auto, then tenjin install`;
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
- if (!plans.some((p) => p.harness === "claude")) {
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: "before a WebSearch, ask tenjin.blog the same question (free, anonymous, 2s budget) and mention a tested answer; the query text leaves the machine"
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 stored = (await loadRawConfig(dataDir)).hooks?.searchMode;
672
- if (!plans.some((p) => p.harness === "claude")) {
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("claude", home, dataDir, stored ?? DEFAULT_HOOK_MODE, "declined");
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("claude", home, dataDir, stored ?? DEFAULT_HOOK_MODE, "declined");
688
- }
689
- if (dryRun) return hooksSkipped("claude", home, dataDir, mode, "dry-run");
690
- if (mode !== (stored ?? DEFAULT_HOOK_MODE) || stored === void 0) {
691
- await persistSearchHookMode(dataDir, mode);
778
+ return hooksSkipped(
779
+ hasHermes ? "hermes" : "claude",
780
+ home,
781
+ dataDir,
782
+ stored ?? DEFAULT_HOOK_MODE,
783
+ "declined"
784
+ );
692
785
  }
693
- if (mode === "off") return hooksSkipped("claude", home, dataDir, mode, "mode-off");
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
- var DEFAULT_HOOK_MODE = CONFIG_DEFAULTS.hooks.searchMode;
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 = SearchHookModeSchema.safeParse(answer);
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((v) => planFor(validateHarness(v), ["override"], true, home));
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
- if (claudeBy.length > 0) plans.push(planFor("claude", claudeBy, true, home));
721
- if (codexBy.length > 0) plans.push(planFor("codex", codexBy, true, home));
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 { harness, detected, detectedBy, skillsDir, wiresAgentsMd: harness !== "claude", home };
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-DXX7PVUP.js.map
972
+ //# sourceMappingURL=install-GNK2W3PI.js.map