tenjin-cli 0.1.0-alpha.15 → 0.1.0-alpha.17

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 (278) hide show
  1. package/NOTICE.md +54 -7
  2. package/README.md +43 -310
  3. package/dist/{_esm-N4KAVXQR.js → _esm-CE7KNONL.js} +9 -10
  4. package/dist/{ccip-ZGGWQN4X.js → ccip-7RMRLAGV.js} +4 -4
  5. package/dist/{ccip-RPPPKTJR.js → ccip-NLCSCHKI.js} +5 -5
  6. package/dist/chunk-2BKS2FVE.js +93 -0
  7. package/dist/chunk-2BKS2FVE.js.map +1 -0
  8. package/dist/chunk-2G2WLVHB.js +102 -0
  9. package/dist/chunk-2G2WLVHB.js.map +1 -0
  10. package/dist/chunk-2I4QTOLB.js +11 -0
  11. package/dist/chunk-2I4QTOLB.js.map +1 -0
  12. package/dist/chunk-2JGT3KDW.js +172 -0
  13. package/dist/chunk-2JGT3KDW.js.map +1 -0
  14. package/dist/chunk-2QYORQBF.js +55 -0
  15. package/dist/chunk-2QYORQBF.js.map +1 -0
  16. package/dist/chunk-35M3VITA.js +102 -0
  17. package/dist/chunk-35M3VITA.js.map +1 -0
  18. package/dist/{chunk-KINZ23CV.js → chunk-3AUDA53C.js} +4740 -23
  19. package/dist/chunk-3AUDA53C.js.map +1 -0
  20. package/dist/{chunk-MJZZTKCC.js → chunk-56MOAIP5.js} +5 -10
  21. package/dist/chunk-56MOAIP5.js.map +1 -0
  22. package/dist/{chunk-U5S527PP.js → chunk-5IEP5EGE.js} +3 -3
  23. package/dist/chunk-5QHHRMRA.js +227 -0
  24. package/dist/chunk-5QHHRMRA.js.map +1 -0
  25. package/dist/{chunk-JBIKAAT3.js → chunk-5UDD5VSY.js} +8 -8
  26. package/dist/chunk-5UDD5VSY.js.map +1 -0
  27. package/dist/chunk-7QKHZQKW.js +1680 -0
  28. package/dist/chunk-7QKHZQKW.js.map +1 -0
  29. package/dist/{chunk-ZFJJ3EXC.js → chunk-AR7U7BRG.js} +550 -182
  30. package/dist/chunk-AR7U7BRG.js.map +1 -0
  31. package/dist/chunk-AUKDYPPX.js +130 -0
  32. package/dist/chunk-AUKDYPPX.js.map +1 -0
  33. package/dist/{chunk-7FK2UN2T.js → chunk-AWQPGIR6.js} +65 -67
  34. package/dist/{chunk-7FK2UN2T.js.map → chunk-AWQPGIR6.js.map} +1 -1
  35. package/dist/{chunk-KYQVEKP5.js → chunk-BPMWXTFX.js} +8 -8
  36. package/dist/{chunk-47PP7TAG.js → chunk-EGELTSPU.js} +1356 -1356
  37. package/dist/chunk-EGELTSPU.js.map +1 -0
  38. package/dist/{chunk-S5RYMCV6.js → chunk-HPWO4O6S.js} +3 -3
  39. package/dist/chunk-J5INH7WB.js +299 -0
  40. package/dist/chunk-J5INH7WB.js.map +1 -0
  41. package/dist/chunk-JLEF5WHM.js +132 -0
  42. package/dist/chunk-JLEF5WHM.js.map +1 -0
  43. package/dist/{chunk-W6R3HAAG.js → chunk-JRGFKVAZ.js} +2 -2
  44. package/dist/{chunk-XJN5WUKL.js → chunk-KG3D7FIF.js} +2 -2
  45. package/dist/chunk-KK4YGYTV.js +808 -0
  46. package/dist/chunk-KK4YGYTV.js.map +1 -0
  47. package/dist/{chunk-CPCX67TI.js → chunk-KUBEYXSO.js} +1076 -1038
  48. package/dist/chunk-KUBEYXSO.js.map +1 -0
  49. package/dist/{chunk-QW2Q2KAH.js → chunk-LHHMV4GU.js} +2 -2
  50. package/dist/{chunk-NIKXHWOL.js → chunk-LJ4DMVFI.js} +16 -16
  51. package/dist/chunk-LJ4DMVFI.js.map +1 -0
  52. package/dist/{chunk-ZOBNS7CX.js → chunk-MEFB5KHA.js} +4 -18
  53. package/dist/chunk-MEFB5KHA.js.map +1 -0
  54. package/dist/{chunk-HPJGOLTN.js → chunk-MRGADYDD.js} +13 -8
  55. package/dist/chunk-MRGADYDD.js.map +1 -0
  56. package/dist/{chunk-M2O56UK7.js → chunk-N35E6CM2.js} +293 -163
  57. package/dist/chunk-N35E6CM2.js.map +1 -0
  58. package/dist/chunk-O4ZNKFRU.js +366 -0
  59. package/dist/chunk-O4ZNKFRU.js.map +1 -0
  60. package/dist/chunk-PDA2BVFY.js +244 -0
  61. package/dist/chunk-PDA2BVFY.js.map +1 -0
  62. package/dist/{chunk-POJRB2AE.js → chunk-POUWHWID.js} +2 -2
  63. package/dist/chunk-QDD2RN7G.js +10238 -0
  64. package/dist/chunk-QDD2RN7G.js.map +1 -0
  65. package/dist/chunk-S2NRVRPF.js +171 -0
  66. package/dist/chunk-S2NRVRPF.js.map +1 -0
  67. package/dist/chunk-TGLKKLQG.js +11 -0
  68. package/dist/chunk-TGLKKLQG.js.map +1 -0
  69. package/dist/chunk-TP4D47BY.js +127 -0
  70. package/dist/chunk-TP4D47BY.js.map +1 -0
  71. package/dist/{chunk-KZAAWQNP.js → chunk-TTNESUPQ.js} +3 -3
  72. package/dist/{chunk-UO22YNY4.js → chunk-U2DZISAH.js} +43 -1
  73. package/dist/chunk-U2DZISAH.js.map +1 -0
  74. package/dist/chunk-WGQVJM56.js +165 -0
  75. package/dist/chunk-WGQVJM56.js.map +1 -0
  76. package/dist/{chunk-OLWTRUTS.js → chunk-WLMJE3GJ.js} +35 -16
  77. package/dist/chunk-WLMJE3GJ.js.map +1 -0
  78. package/dist/chunk-WS4JA6TC.js +137 -0
  79. package/dist/chunk-WS4JA6TC.js.map +1 -0
  80. package/dist/chunk-WXC57XGG.js +29 -0
  81. package/dist/chunk-WXC57XGG.js.map +1 -0
  82. package/dist/{chunk-YLYINX2H.js → chunk-XZKD7DIF.js} +3 -3
  83. package/dist/chunk-XZOEUYMX.js +1784 -0
  84. package/dist/chunk-XZOEUYMX.js.map +1 -0
  85. package/dist/{cli-KKRKBU5T.js → cli-VHYYYYXM.js} +303 -374
  86. package/dist/cli-VHYYYYXM.js.map +1 -0
  87. package/dist/config-5ADBAAXU.js +42 -0
  88. package/dist/{dist-U4M6QCKE.js → dist-3LOO6M4U.js} +10 -10
  89. package/dist/doctor-Q35VQW3S.js +436 -0
  90. package/dist/doctor-Q35VQW3S.js.map +1 -0
  91. package/dist/{ethersCompat-Df4a6QIZ-WHYKB6HA.js → ethersCompat-Df4a6QIZ-THAVUGIJ.js} +5 -5
  92. package/dist/{chunk-KAJZHIQ4.js → fund-GDDPL2BB.js} +81 -24
  93. package/dist/fund-GDDPL2BB.js.map +1 -0
  94. package/dist/hook-command-PBERPRE3.js +763 -0
  95. package/dist/hook-command-PBERPRE3.js.map +1 -0
  96. package/dist/index.js +8 -3
  97. package/dist/index.js.map +1 -1
  98. package/dist/install-OKDKGUXM.js +60 -0
  99. package/dist/install-wallet-SI4LZ73K.js +106 -0
  100. package/dist/install-wallet-SI4LZ73K.js.map +1 -0
  101. package/dist/{run-XYTQ5TWQ.js → mcp-XX3WRQEZ.js} +3766 -10677
  102. package/dist/mcp-XX3WRQEZ.js.map +1 -0
  103. package/dist/paths-P2N4JTDZ.js +49 -0
  104. package/dist/pay-3SYKHKWJ.js +39 -0
  105. package/dist/redact-6W23GGJC.js +15 -0
  106. package/dist/{secp256k1-XRPVBC6V.js → secp256k1-ZZZT2CAX.js} +3 -3
  107. package/dist/{send-G746D7PQ.js → send-LQRKTEJT.js} +29 -29
  108. package/dist/send-LQRKTEJT.js.map +1 -0
  109. package/dist/{chunk-QZ6ROAJU.js → skill-placement-JMDPSKE6.js} +155 -10
  110. package/dist/skill-placement-JMDPSKE6.js.map +1 -0
  111. package/dist/status-FFC6FO72.js +64 -0
  112. package/dist/status-FFC6FO72.js.map +1 -0
  113. package/dist/status-line-SAXSU6CR.js +87 -0
  114. package/dist/status-line-SAXSU6CR.js.map +1 -0
  115. package/dist/status-line-wiring-L2WYIYBM.js +29 -0
  116. package/dist/tenjin-daemon.mjs +20421 -0
  117. package/dist/tenjin-shim.mjs +251 -0
  118. package/dist/tenjin-vitest-reporter.mjs +49 -0
  119. package/dist/uninstall-OACH27UV.js +147 -0
  120. package/dist/uninstall-OACH27UV.js.map +1 -0
  121. package/dist/{update-R76LHOZW.js → update-4W6EKLGZ.js} +132 -16
  122. package/dist/update-4W6EKLGZ.js.map +1 -0
  123. package/dist/{viemAdapter-By13KInL-TUQJBMHM.js → viemAdapter-By13KInL-X2VY6CY3.js} +5 -5
  124. package/dist/wallet-BMEXRR3P.js +32 -0
  125. package/dist/wallet-kdf-worker.mjs +980 -0
  126. package/docs/agent-permissions.md +71 -352
  127. package/docs/safety-model.md +16 -6
  128. package/package.json +8 -7
  129. package/LICENSE +0 -21
  130. package/dist/buy-VIRNSYGN.js +0 -47
  131. package/dist/chunk-2MYQN7HM.js +0 -247
  132. package/dist/chunk-2MYQN7HM.js.map +0 -1
  133. package/dist/chunk-2RF2GIJQ.js +0 -1188
  134. package/dist/chunk-2RF2GIJQ.js.map +0 -1
  135. package/dist/chunk-3GL2Z5QK.js +0 -57
  136. package/dist/chunk-3GL2Z5QK.js.map +0 -1
  137. package/dist/chunk-47PP7TAG.js.map +0 -1
  138. package/dist/chunk-4CQIDQOT.js +0 -167
  139. package/dist/chunk-4CQIDQOT.js.map +0 -1
  140. package/dist/chunk-4KG27W2S.js +0 -614
  141. package/dist/chunk-4KG27W2S.js.map +0 -1
  142. package/dist/chunk-5QQTYWEU.js +0 -199
  143. package/dist/chunk-5QQTYWEU.js.map +0 -1
  144. package/dist/chunk-65DTCCJ7.js +0 -21
  145. package/dist/chunk-65DTCCJ7.js.map +0 -1
  146. package/dist/chunk-A5DKHMUN.js +0 -173
  147. package/dist/chunk-A5DKHMUN.js.map +0 -1
  148. package/dist/chunk-B63XPWQ4.js +0 -246
  149. package/dist/chunk-B63XPWQ4.js.map +0 -1
  150. package/dist/chunk-CAR6FHK6.js +0 -105
  151. package/dist/chunk-CAR6FHK6.js.map +0 -1
  152. package/dist/chunk-CPCX67TI.js.map +0 -1
  153. package/dist/chunk-CQBVCYI2.js +0 -162
  154. package/dist/chunk-CQBVCYI2.js.map +0 -1
  155. package/dist/chunk-DBU5CXBV.js +0 -4731
  156. package/dist/chunk-DBU5CXBV.js.map +0 -1
  157. package/dist/chunk-DHJD77OW.js +0 -81
  158. package/dist/chunk-DHJD77OW.js.map +0 -1
  159. package/dist/chunk-EDZSNPE5.js +0 -35
  160. package/dist/chunk-EDZSNPE5.js.map +0 -1
  161. package/dist/chunk-EFWZPUTC.js +0 -65
  162. package/dist/chunk-EFWZPUTC.js.map +0 -1
  163. package/dist/chunk-EPFL6CTE.js +0 -448
  164. package/dist/chunk-EPFL6CTE.js.map +0 -1
  165. package/dist/chunk-GHLVXVZD.js +0 -142
  166. package/dist/chunk-GHLVXVZD.js.map +0 -1
  167. package/dist/chunk-H3SOOJ2I.js +0 -580
  168. package/dist/chunk-H3SOOJ2I.js.map +0 -1
  169. package/dist/chunk-HPJGOLTN.js.map +0 -1
  170. package/dist/chunk-HRGBS2PA.js +0 -203
  171. package/dist/chunk-HRGBS2PA.js.map +0 -1
  172. package/dist/chunk-ITUXPJIS.js +0 -314
  173. package/dist/chunk-ITUXPJIS.js.map +0 -1
  174. package/dist/chunk-JBIKAAT3.js.map +0 -1
  175. package/dist/chunk-KAJZHIQ4.js.map +0 -1
  176. package/dist/chunk-KINZ23CV.js.map +0 -1
  177. package/dist/chunk-LRYV3SK7.js +0 -235
  178. package/dist/chunk-LRYV3SK7.js.map +0 -1
  179. package/dist/chunk-M2O56UK7.js.map +0 -1
  180. package/dist/chunk-MJZZTKCC.js.map +0 -1
  181. package/dist/chunk-NIKXHWOL.js.map +0 -1
  182. package/dist/chunk-OKDRDT74.js +0 -209
  183. package/dist/chunk-OKDRDT74.js.map +0 -1
  184. package/dist/chunk-OKYSNAS3.js +0 -2144
  185. package/dist/chunk-OKYSNAS3.js.map +0 -1
  186. package/dist/chunk-OLWTRUTS.js.map +0 -1
  187. package/dist/chunk-QQ6ELLSA.js +0 -143
  188. package/dist/chunk-QQ6ELLSA.js.map +0 -1
  189. package/dist/chunk-QZ6ROAJU.js.map +0 -1
  190. package/dist/chunk-R7RSCBI7.js +0 -794
  191. package/dist/chunk-R7RSCBI7.js.map +0 -1
  192. package/dist/chunk-SGK2B724.js +0 -67
  193. package/dist/chunk-SGK2B724.js.map +0 -1
  194. package/dist/chunk-U6VPKMGC.js +0 -390
  195. package/dist/chunk-U6VPKMGC.js.map +0 -1
  196. package/dist/chunk-UHTVXQ2O.js +0 -140
  197. package/dist/chunk-UHTVXQ2O.js.map +0 -1
  198. package/dist/chunk-UO22YNY4.js.map +0 -1
  199. package/dist/chunk-US456VUI.js +0 -149
  200. package/dist/chunk-US456VUI.js.map +0 -1
  201. package/dist/chunk-V44J2MXV.js +0 -400
  202. package/dist/chunk-V44J2MXV.js.map +0 -1
  203. package/dist/chunk-VJQKL3YH.js +0 -216
  204. package/dist/chunk-VJQKL3YH.js.map +0 -1
  205. package/dist/chunk-VJSQSLBM.js +0 -1442
  206. package/dist/chunk-VJSQSLBM.js.map +0 -1
  207. package/dist/chunk-VYOJOX4Z.js +0 -165
  208. package/dist/chunk-VYOJOX4Z.js.map +0 -1
  209. package/dist/chunk-WY2K35OL.js +0 -269
  210. package/dist/chunk-WY2K35OL.js.map +0 -1
  211. package/dist/chunk-ZFJJ3EXC.js.map +0 -1
  212. package/dist/chunk-ZOBNS7CX.js.map +0 -1
  213. package/dist/cli-KKRKBU5T.js.map +0 -1
  214. package/dist/config-JMRUNYE6.js +0 -37
  215. package/dist/discover-B5HF6SHM.js +0 -102
  216. package/dist/discover-B5HF6SHM.js.map +0 -1
  217. package/dist/doctor-ZBG7X66D.js +0 -32
  218. package/dist/edit-PZJIILQE.js +0 -40
  219. package/dist/fund-EUDH5KPA.js +0 -40
  220. package/dist/inspect-QC6WEQPN.js +0 -37
  221. package/dist/install-GNK2W3PI.js +0 -972
  222. package/dist/install-GNK2W3PI.js.map +0 -1
  223. package/dist/outcome-KSGWZHUS.js +0 -24
  224. package/dist/pay-BC4UICPA.js +0 -361
  225. package/dist/pay-BC4UICPA.js.map +0 -1
  226. package/dist/publish-LXWFDIKF.js +0 -42
  227. package/dist/read-JMNUQ56P.js +0 -160
  228. package/dist/read-JMNUQ56P.js.map +0 -1
  229. package/dist/run-XYTQ5TWQ.js.map +0 -1
  230. package/dist/search-TSQAB45E.js +0 -25
  231. package/dist/secp256k1-XRPVBC6V.js.map +0 -1
  232. package/dist/send-G746D7PQ.js.map +0 -1
  233. package/dist/session-JBKWMJ24.js +0 -89
  234. package/dist/session-JBKWMJ24.js.map +0 -1
  235. package/dist/skill-heal-WKD67SLJ.js +0 -92
  236. package/dist/skill-heal-WKD67SLJ.js.map +0 -1
  237. package/dist/skill-placement-RIU4AMC2.js +0 -20
  238. package/dist/skill-placement-RIU4AMC2.js.map +0 -1
  239. package/dist/uninstall-5E263VTS.js +0 -73
  240. package/dist/uninstall-5E263VTS.js.map +0 -1
  241. package/dist/update-R76LHOZW.js.map +0 -1
  242. package/dist/usdc-4VCDHFWX.js +0 -38
  243. package/dist/usdc-4VCDHFWX.js.map +0 -1
  244. package/dist/viemAdapter-By13KInL-TUQJBMHM.js.map +0 -1
  245. package/dist/wallet-TQ7D5EQ7.js +0 -41
  246. package/dist/wallet-TQ7D5EQ7.js.map +0 -1
  247. package/dist/wallet-ZAVXWLWP.js +0 -32
  248. package/dist/wallet-ZAVXWLWP.js.map +0 -1
  249. package/docs/command-reference.md +0 -303
  250. package/skills/tenjin/SKILL.md +0 -373
  251. package/skills/tenjin-pay/SKILL.md +0 -76
  252. package/skills/tenjin-publish/SKILL.md +0 -227
  253. package/skills/tenjin-publish/references/maintain.md +0 -39
  254. package/skills/tenjin-search/SKILL.md +0 -154
  255. package/skills/tenjin-search/references/permissions.md +0 -112
  256. /package/dist/{_esm-N4KAVXQR.js.map → _esm-CE7KNONL.js.map} +0 -0
  257. /package/dist/{buy-VIRNSYGN.js.map → ccip-7RMRLAGV.js.map} +0 -0
  258. /package/dist/{ccip-RPPPKTJR.js.map → ccip-NLCSCHKI.js.map} +0 -0
  259. /package/dist/{chunk-U5S527PP.js.map → chunk-5IEP5EGE.js.map} +0 -0
  260. /package/dist/{chunk-KYQVEKP5.js.map → chunk-BPMWXTFX.js.map} +0 -0
  261. /package/dist/{chunk-S5RYMCV6.js.map → chunk-HPWO4O6S.js.map} +0 -0
  262. /package/dist/{chunk-W6R3HAAG.js.map → chunk-JRGFKVAZ.js.map} +0 -0
  263. /package/dist/{chunk-XJN5WUKL.js.map → chunk-KG3D7FIF.js.map} +0 -0
  264. /package/dist/{chunk-QW2Q2KAH.js.map → chunk-LHHMV4GU.js.map} +0 -0
  265. /package/dist/{chunk-POJRB2AE.js.map → chunk-POUWHWID.js.map} +0 -0
  266. /package/dist/{chunk-KZAAWQNP.js.map → chunk-TTNESUPQ.js.map} +0 -0
  267. /package/dist/{chunk-YLYINX2H.js.map → chunk-XZKD7DIF.js.map} +0 -0
  268. /package/dist/{ccip-ZGGWQN4X.js.map → config-5ADBAAXU.js.map} +0 -0
  269. /package/dist/{dist-U4M6QCKE.js.map → dist-3LOO6M4U.js.map} +0 -0
  270. /package/dist/{config-JMRUNYE6.js.map → ethersCompat-Df4a6QIZ-THAVUGIJ.js.map} +0 -0
  271. /package/dist/{doctor-ZBG7X66D.js.map → install-OKDKGUXM.js.map} +0 -0
  272. /package/dist/{edit-PZJIILQE.js.map → paths-P2N4JTDZ.js.map} +0 -0
  273. /package/dist/{ethersCompat-Df4a6QIZ-WHYKB6HA.js.map → pay-3SYKHKWJ.js.map} +0 -0
  274. /package/dist/{fund-EUDH5KPA.js.map → redact-6W23GGJC.js.map} +0 -0
  275. /package/dist/{inspect-QC6WEQPN.js.map → secp256k1-ZZZT2CAX.js.map} +0 -0
  276. /package/dist/{outcome-KSGWZHUS.js.map → status-line-wiring-L2WYIYBM.js.map} +0 -0
  277. /package/dist/{publish-LXWFDIKF.js.map → viemAdapter-By13KInL-X2VY6CY3.js.map} +0 -0
  278. /package/dist/{search-TSQAB45E.js.map → wallet-BMEXRR3P.js.map} +0 -0
@@ -1,580 +0,0 @@
1
- import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
- import {
3
- modeGatedPointer
4
- } from "./chunk-4CQIDQOT.js";
5
- import {
6
- loadProjectConfig
7
- } from "./chunk-VYOJOX4Z.js";
8
- import {
9
- parseUsdToAtomic,
10
- toMoney
11
- } from "./chunk-EFWZPUTC.js";
12
- import {
13
- CONFIG_KEYS,
14
- HOOKS_CONFIG_KEYS,
15
- LEGACY_HOOKS_CONFIG_KEYS,
16
- PUBLISH_CONFIG_KEYS,
17
- PublishModeSchema,
18
- RawConfigSchema,
19
- SEND_MAX_UNSET,
20
- UPDATE_CONFIG_KEYS,
21
- loadRawConfig,
22
- parseAgentDispatchHookModeFlag,
23
- parseSessionPrimerFlag,
24
- parseStopNagFlag,
25
- parseUpdateModeFlag,
26
- parseWebSearchHookModeFlag,
27
- resolveSettings
28
- } from "./chunk-U6VPKMGC.js";
29
- import {
30
- MODE_GATED_RULES,
31
- inspectFreeVerbRules,
32
- resolveHermesHomeLenient,
33
- retractModeGatedRules,
34
- stopHookIsCurrent,
35
- wireFreeVerbAllowlist
36
- } from "./chunk-OKYSNAS3.js";
37
- import {
38
- PRODUCTION_ORIGIN,
39
- detectHarnesses,
40
- harnessInPlay,
41
- harnessTargetDir,
42
- onPath
43
- } from "./chunk-2MYQN7HM.js";
44
- import {
45
- LockTimeoutError,
46
- withFileLock
47
- } from "./chunk-ZOBNS7CX.js";
48
- import {
49
- CliError,
50
- configPath,
51
- writeFileAtomic
52
- } from "./chunk-ZFJJ3EXC.js";
53
-
54
- // src/commands/config.ts
55
- import { mkdir } from "fs/promises";
56
- import { homedir } from "os";
57
- import { styleText } from "util";
58
-
59
- // src/lib/clack.ts
60
- var SHOW_CURSOR = "\x1B[?25h";
61
- function withInputEnd(streams, onEnd, run) {
62
- const controller = new AbortController();
63
- let settleEnd;
64
- const ended = new Promise((resolve) => {
65
- settleEnd = () => {
66
- streams.output.write(SHOW_CURSOR);
67
- resolve(onEnd);
68
- };
69
- });
70
- const end = () => {
71
- controller.abort();
72
- settleEnd?.();
73
- };
74
- const onKeypress = (_text, key) => {
75
- if (key?.ctrl === true && key.name === "d") end();
76
- };
77
- streams.input.on("keypress", onKeypress);
78
- if (streams.input.readableEnded) {
79
- queueMicrotask(end);
80
- } else {
81
- streams.input.once("end", end);
82
- streams.input.once("close", end);
83
- }
84
- return Promise.race([run(controller.signal), ended]).finally(() => {
85
- streams.input.off("keypress", onKeypress);
86
- streams.input.off("end", end);
87
- streams.input.off("close", end);
88
- });
89
- }
90
- function resolveStreams(streams) {
91
- return { input: streams.input ?? process.stdin, output: streams.output ?? process.stderr };
92
- }
93
- async function selectOne(opts) {
94
- const { select, isCancel } = await import("./dist-U4M6QCKE.js");
95
- const streams = resolveStreams(opts.streams ?? {});
96
- return withInputEnd(streams, null, async (signal) => {
97
- const answer = await select({
98
- message: opts.message,
99
- options: opts.choices.map((c) => ({
100
- value: c.value,
101
- label: c.label,
102
- ...c.hint !== void 0 ? { hint: c.hint } : {}
103
- })),
104
- initialValue: opts.initialValue,
105
- input: streams.input,
106
- output: streams.output,
107
- signal
108
- });
109
- return isCancel(answer) ? null : answer;
110
- });
111
- }
112
- async function confirmChoice(message, initialValue = true, streams = {}) {
113
- const { confirm, isCancel } = await import("./dist-U4M6QCKE.js");
114
- const resolved = resolveStreams(streams);
115
- return withInputEnd(resolved, false, async (signal) => {
116
- const answer = await confirm({
117
- message,
118
- initialValue,
119
- input: resolved.input,
120
- output: resolved.output,
121
- signal
122
- });
123
- return isCancel(answer) ? false : answer;
124
- });
125
- }
126
- async function intro(message) {
127
- const clack = await import("./dist-U4M6QCKE.js");
128
- clack.intro(message, { output: process.stderr });
129
- }
130
- async function outro(message) {
131
- const clack = await import("./dist-U4M6QCKE.js");
132
- clack.outro(message, { output: process.stderr });
133
- }
134
-
135
- // src/commands/config.ts
136
- var CONFIRM_ABOVE = "above:";
137
- var KEY_WIDTH = Math.max(
138
- ...[...CONFIG_KEYS, ...PUBLISH_CONFIG_KEYS, ...HOOKS_CONFIG_KEYS, ...UPDATE_CONFIG_KEYS].map(
139
- (key) => key.length
140
- )
141
- );
142
- var KEY_DESCRIPTIONS = {
143
- maxAutoSpend: "auto-approve a read up to this amount",
144
- sessionBudget: "cap on total auto-spend per session",
145
- confirm: "when to ask before paying",
146
- sendMaxAmount: "hard cap per tenjin send; unset = send refuses until set, 0 disables send, none = uncapped; never bypassed by --yes",
147
- allowlistCreators: "only auto-pay these creators (empty = any)",
148
- baseUrl: "Tenjin API base URL",
149
- rpcUrl: "Base RPC endpoint for balance reads",
150
- evalCohort: "opt in to the search evaluation cohort",
151
- bazaarPay: "let `tenjin pay` spend at registry-listed non-Tenjin endpoints",
152
- bazaarRegistries: "x402 discovery registries for `discover` and the pay lane",
153
- "publish.mode": "review=always ask, auto=ask on findings, full-auto=only hard blocks stop it",
154
- "publish.defaultPrice": "price used when none is given",
155
- "hooks.webSearch": "harness WebSearch hook (before WebSearch): auto=ask Tenjin first, remind=static reminder, off=inert",
156
- "hooks.agentDispatch": "harness subagent-dispatch hook (before Agent/Task \u2014 most sensitive payload): auto=ask Tenjin first, remind=static reminder, off=inert",
157
- "hooks.stopNag": "end-of-turn reminder about searches nothing answered yet: on=both arms, deliberate-only=drop the batched web-search arm, off=neither",
158
- "hooks.sessionPrimer": "one-paragraph search-first primer at session start: on=print it, off=print nothing",
159
- "update.mode": "nudge=report a newer version (stderr line, JSON envelope, hook output), off=neither report nor ask npm"
160
- };
161
- function isPublishKey(key) {
162
- return PUBLISH_CONFIG_KEYS.includes(key);
163
- }
164
- function isHooksKey(key) {
165
- return HOOKS_CONFIG_KEYS.includes(key);
166
- }
167
- function isLegacyHooksKey(key) {
168
- return LEGACY_HOOKS_CONFIG_KEYS.includes(key);
169
- }
170
- function normalizeHooksKey(key) {
171
- if (HOOKS_CONFIG_KEYS.includes(key)) return key;
172
- if (key === "hooks.searchMode") return "hooks.webSearch";
173
- if (key === "hooks.dispatchMode") return "hooks.agentDispatch";
174
- return null;
175
- }
176
- function isUpdateKey(key) {
177
- return UPDATE_CONFIG_KEYS.includes(key);
178
- }
179
- async function runConfigList(ctx) {
180
- const settings = await resolveFromContext(ctx);
181
- const data = {};
182
- const humanLines = [];
183
- for (const key of CONFIG_KEYS) {
184
- const entry = renderSetting(key, settings[key].value, settings[key].source);
185
- data[key] = entry;
186
- humanLines.push(describedLine(key, entry));
187
- }
188
- for (const key of PUBLISH_CONFIG_KEYS) {
189
- const entry = renderPublishSetting(key, settings);
190
- data[key] = entry;
191
- humanLines.push(describedLine(key, entry, downgradeNote(key, settings)));
192
- }
193
- for (const key of HOOKS_CONFIG_KEYS) {
194
- const entry = renderHooksSetting(key, settings);
195
- data[key] = entry;
196
- humanLines.push(describedLine(key, entry));
197
- }
198
- for (const key of UPDATE_CONFIG_KEYS) {
199
- const entry = {
200
- value: settings.updateMode.value,
201
- source: settings.updateMode.source
202
- };
203
- data[key] = entry;
204
- humanLines.push(describedLine(key, entry));
205
- }
206
- return { data, humanLines };
207
- }
208
- async function runConfigGet({ key }, ctx) {
209
- if (isPublishKey(key)) {
210
- const settings2 = await resolveFromContext(ctx);
211
- const entry2 = renderPublishSetting(key, settings2);
212
- return {
213
- data: { key, ...entry2 },
214
- humanLines: [withNote(formatLine(key, entry2), downgradeNote(key, settings2))]
215
- };
216
- }
217
- const normalized = normalizeHooksKey(key);
218
- if (normalized !== null) {
219
- const entry2 = renderHooksSetting(normalized, await resolveFromContext(ctx));
220
- return { data: { key, ...entry2 }, humanLines: [formatLine(key, entry2)] };
221
- }
222
- if (isUpdateKey(key)) {
223
- const { updateMode } = await resolveFromContext(ctx);
224
- const entry2 = { value: updateMode.value, source: updateMode.source };
225
- return { data: { key, ...entry2 }, humanLines: [formatLine(key, entry2)] };
226
- }
227
- const configKey = assertKey(key);
228
- const settings = await resolveFromContext(ctx);
229
- const entry = renderSetting(configKey, settings[configKey].value, settings[configKey].source);
230
- return { data: { key: configKey, ...entry }, humanLines: [formatLine(configKey, entry)] };
231
- }
232
- async function runConfigSet({ key, value }, ctx, deps = {}) {
233
- if (isPublishKey(key)) return setPublishKey(key, value, ctx, deps);
234
- if (isHooksKey(key) || isLegacyHooksKey(key)) {
235
- const normalized = normalizeHooksKey(key);
236
- return setHooksKey(normalized, value, ctx, deps);
237
- }
238
- if (isUpdateKey(key)) return setUpdateKey(key, value, ctx);
239
- const configKey = assertKey(key);
240
- const stored = parseValue(configKey, value);
241
- await persist(ctx.dataDir, (existing) => ({ ...existing, [configKey]: stored }));
242
- if (configKey === "bazaarPay") {
243
- try {
244
- const { syncBazaarSkill } = await import("./skill-placement-RIU4AMC2.js");
245
- await syncBazaarSkill(stored === true, deps.placeSkill ?? { io: ctx.io });
246
- } catch {
247
- }
248
- }
249
- const entry = renderSetting(configKey, stored, "file");
250
- return { data: { key: configKey, ...entry }, humanLines: [formatLine(configKey, entry)] };
251
- }
252
- async function setPublishKey(key, value, ctx, deps) {
253
- const entry = key === "publish.mode" ? { value: parsePublishMode(value), source: "file" } : { value: toMoney(parseUsdToAtomic(value)), source: "file" };
254
- const subkey = key === "publish.mode" ? "mode" : "defaultPrice";
255
- const stored = key === "publish.mode" ? entry.value : entry.value.atomic;
256
- await persist(ctx.dataDir, (existing) => ({
257
- ...existing,
258
- publish: { ...existing.publish, [subkey]: stored }
259
- }));
260
- const humanLines = [formatLine(key, entry)];
261
- if (key !== "publish.mode") return { data: { key, ...entry }, humanLines };
262
- const allowlist = await syncPublishRule(entry.value, ctx, deps);
263
- return {
264
- data: { key, ...entry, allowlist },
265
- humanLines: [...humanLines, ...allowlistLines(allowlist)]
266
- };
267
- }
268
- function publishRuleQuestion(mode, pending) {
269
- const gated = new Set(MODE_GATED_RULES);
270
- const others = pending.filter((rule) => !gated.has(rule)).length;
271
- const also = others > 0 ? ` Also adds the ${others} free-verb rule(s) \`tenjin install\` writes.` : "";
272
- return `publish.mode ${mode} is unattended only if your harness allowlist carries ${MODE_GATED_RULES.join(" and ")}. Add them to ~/.claude/settings.json now?${also}`;
273
- }
274
- async function syncPublishRule(mode, ctx, deps) {
275
- const home = deps.homeDir ?? homedir();
276
- const nothing = { added: [], removed: [] };
277
- const write = async () => {
278
- const result = await (deps.wireAllowlist ?? wireFreeVerbAllowlist)(home, mode);
279
- if (result.skipped !== void 0) {
280
- return {
281
- added: [],
282
- removed: [],
283
- skipped: "unwritable",
284
- ...result.fix !== void 0 ? { pointer: result.fix } : {}
285
- };
286
- }
287
- return { added: result.added, removed: result.removed };
288
- };
289
- const isClaude = deps.harnessIsClaude ?? await claudeInPlay(home, ctx, deps);
290
- if (!isClaude) {
291
- return { ...nothing, skipped: "not-claude" };
292
- }
293
- const probe = await (deps.inspectAllowlist ?? inspectFreeVerbRules)(home, mode);
294
- const gated = new Set(MODE_GATED_RULES);
295
- const missing = (probe.pending ?? []).filter((r) => gated.has(r));
296
- const pointer = modeGatedPointer(mode, missing) ?? void 0;
297
- if (mode === "review") {
298
- const retracted = await (deps.retractModeGated ?? retractModeGatedRules)(home);
299
- if (retracted.skipped !== void 0) {
300
- return {
301
- ...nothing,
302
- skipped: "unwritable",
303
- ...retracted.fix !== void 0 ? { pointer: retracted.fix } : {}
304
- };
305
- }
306
- return { added: [], removed: retracted.removed };
307
- }
308
- if (probe.satisfied !== void 0) return nothing;
309
- const canPrompt = ctx.flags.json === true ? false : deps.isInteractive ?? Boolean(process.stdin.isTTY);
310
- if (!canPrompt) return { ...nothing, skipped: "no-tty", ...pointer ? { pointer } : {} };
311
- const confirm = deps.confirmRule ?? ((label) => confirmChoice(label, true));
312
- if (!await confirm(publishRuleQuestion(mode, probe.pending ?? []))) {
313
- return { ...nothing, skipped: "declined", ...pointer ? { pointer } : {} };
314
- }
315
- return write();
316
- }
317
- async function claudeInPlay(home, ctx, deps) {
318
- const env = deps.env ?? process.env;
319
- const which = deps.which ?? ((bin) => onPath(bin, env));
320
- const requested = await loadRawConfig(ctx.dataDir).then((c) => c.install?.harness ?? []).catch(() => []);
321
- const hermesHome = resolveHermesHomeLenient(home, env).home;
322
- return harnessInPlay(
323
- home,
324
- harnessTargetDir(home, "claude", hermesHome),
325
- detectHarnesses(home, which, hermesHome),
326
- requested,
327
- hermesHome
328
- );
329
- }
330
- function allowlistLines(sync) {
331
- const lines = [];
332
- if (sync.added.length > 0) {
333
- lines.push(`Added ${sync.added.length} harness rule(s) to your allowlist.`);
334
- }
335
- if (sync.removed.length > 0) {
336
- lines.push(`Removed ${sync.removed.join(", ")} from your allowlist.`);
337
- }
338
- if (sync.pointer !== void 0) lines.push(sync.pointer);
339
- return lines;
340
- }
341
- async function setHooksKey(key, value, ctx, deps) {
342
- const subkey = key === "hooks.webSearch" ? "webSearch" : key === "hooks.agentDispatch" ? "agentDispatch" : key === "hooks.stopNag" ? "stopNag" : "sessionPrimer";
343
- const parsed = key === "hooks.webSearch" ? parseWebSearchHookModeFlag(value, key) : key === "hooks.agentDispatch" ? parseAgentDispatchHookModeFlag(value, key) : key === "hooks.stopNag" ? parseStopNagFlag(value, key) : parseSessionPrimerFlag(value, key);
344
- await persist(ctx.dataDir, (existing) => ({
345
- ...existing,
346
- hooks: { ...existing.hooks, [subkey]: parsed }
347
- }));
348
- const entry = { value: parsed, source: "file" };
349
- const current = await (deps.stopHookIsCurrent ?? stopHookIsCurrent)(ctx.dataDir);
350
- const stale = parsed === "deliberate-only" && !current ? `The installed Stop hook predates ${JSON.stringify(parsed)} and will keep treating it as "on". Run \`tenjin install\` to update it.` : void 0;
351
- return {
352
- data: { key, ...entry, ...stale !== void 0 ? { hookScriptStale: true } : {} },
353
- humanLines: [formatLine(key, entry), ...stale !== void 0 ? [stale] : []]
354
- };
355
- }
356
- async function setUpdateKey(key, value, ctx) {
357
- const parsed = parseUpdateModeFlag(value, key);
358
- await persist(ctx.dataDir, (existing) => ({
359
- ...existing,
360
- update: { ...existing.update, mode: parsed }
361
- }));
362
- const entry = { value: parsed, source: "file" };
363
- return { data: { key, ...entry }, humanLines: [formatLine(key, entry)] };
364
- }
365
- function parsePublishMode(value) {
366
- const parsed = PublishModeSchema.safeParse(value);
367
- if (parsed.success) return parsed.data;
368
- throw new CliError("USAGE", `Invalid publish mode: ${JSON.stringify(value)}`, {
369
- fix: 'Use "review", "auto", or "full-auto".'
370
- });
371
- }
372
- async function persistPublishMode(dir, mode) {
373
- await persist(dir, (existing) => ({
374
- ...existing,
375
- publish: { ...existing.publish, mode }
376
- }));
377
- }
378
- async function persistBazaarPay(dir, enabled) {
379
- await persist(dir, (existing) => ({ ...existing, bazaarPay: enabled }));
380
- }
381
- async function persistWebSearchHookMode(dir, mode) {
382
- await persist(dir, (existing) => ({
383
- ...existing,
384
- hooks: { ...existing.hooks, webSearch: mode }
385
- }));
386
- }
387
- async function persistAgentDispatchHookMode(dir, mode) {
388
- await persist(dir, (existing) => ({
389
- ...existing,
390
- hooks: { ...existing.hooks, agentDispatch: mode }
391
- }));
392
- }
393
- async function persistSearchHookMode(dir, mode) {
394
- return persistWebSearchHookMode(dir, mode);
395
- }
396
- async function persistInstallHarness(dir, harness) {
397
- await persist(dir, (existing) => ({
398
- ...existing,
399
- install: { ...existing.install, harness: [...harness] }
400
- }));
401
- }
402
- async function resolveFromContext(ctx) {
403
- const config = await loadRawConfig(ctx.dataDir);
404
- const project = await loadProjectConfig(process.cwd());
405
- return resolveSettings({
406
- config,
407
- flags: { baseUrl: ctx.flags.baseUrl },
408
- env: process.env,
409
- project: project?.layer
410
- });
411
- }
412
- function assertKey(key) {
413
- if (CONFIG_KEYS.includes(key)) return key;
414
- throw new CliError("USAGE", `Unknown config key: ${JSON.stringify(key)}`, {
415
- fix: `Valid keys: ${[...CONFIG_KEYS, ...PUBLISH_CONFIG_KEYS, ...HOOKS_CONFIG_KEYS].join(", ")}.`
416
- });
417
- }
418
- function renderSetting(key, stored, source) {
419
- return { ...renderValue(key, stored), source };
420
- }
421
- function renderPublishSetting(key, settings) {
422
- if (key === "publish.mode") {
423
- return { value: settings.publishMode.value, source: settings.publishMode.source };
424
- }
425
- return {
426
- value: toMoney(settings.publishDefaultPrice.value),
427
- source: settings.publishDefaultPrice.source
428
- };
429
- }
430
- function renderHooksSetting(key, settings) {
431
- const resolved = key === "hooks.webSearch" ? settings.hooksWebSearch : key === "hooks.agentDispatch" ? settings.hooksAgentDispatch : key === "hooks.stopNag" ? settings.hooksStopNag : settings.hooksSessionPrimer;
432
- return { value: resolved.value, source: resolved.source };
433
- }
434
- function renderValue(key, stored) {
435
- if (Array.isArray(stored) || typeof stored === "boolean") return { value: stored };
436
- if (key === "maxAutoSpend" || key === "sessionBudget") return { value: toMoney(stored) };
437
- if (key === "sendMaxAmount") {
438
- return { value: stored === "none" || stored === SEND_MAX_UNSET ? stored : toMoney(stored) };
439
- }
440
- if (key === "confirm" && stored.startsWith(CONFIRM_ABOVE)) {
441
- return { value: stored, threshold: toMoney(stored.slice(CONFIRM_ABOVE.length)) };
442
- }
443
- return { value: stored };
444
- }
445
- function parseValue(key, value) {
446
- switch (key) {
447
- case "maxAutoSpend":
448
- case "sessionBudget":
449
- return parseUsdToAtomic(value);
450
- // throws USAGE on a bad amount
451
- case "sendMaxAmount":
452
- return value === "none" ? "none" : parseUsdToAtomic(value);
453
- case "confirm":
454
- return parseConfirm(value);
455
- case "allowlistCreators":
456
- return parseAllowlist(value);
457
- case "baseUrl":
458
- case "rpcUrl":
459
- return parseHttpUrl(value);
460
- case "evalCohort":
461
- case "bazaarPay":
462
- return parseBoolean(value);
463
- case "bazaarRegistries":
464
- return parseRegistryList(value);
465
- }
466
- }
467
- function parseRegistryList(value) {
468
- return value.split(",").map((entry) => entry.trim()).filter((entry) => entry.length > 0).map((entry) => parseHttpUrl(entry));
469
- }
470
- function parseBoolean(value) {
471
- if (value === "true" || value === "on") return true;
472
- if (value === "false" || value === "off") return false;
473
- throw new CliError("USAGE", `Invalid boolean value: ${JSON.stringify(value)}`, {
474
- fix: 'Use "on" or "off" (or "true"/"false").'
475
- });
476
- }
477
- function parseConfirm(value) {
478
- if (value === "always") return "always";
479
- if (value.startsWith(CONFIRM_ABOVE)) {
480
- return `${CONFIRM_ABOVE}${parseUsdToAtomic(value.slice(CONFIRM_ABOVE.length))}`;
481
- }
482
- throw new CliError("USAGE", `Invalid confirm value: ${JSON.stringify(value)}`, {
483
- fix: 'Use "always" or "above:<usd>", e.g. above:0.25.'
484
- });
485
- }
486
- function parseAllowlist(value) {
487
- const entries = value.split(",").map((entry) => entry.trim()).filter((entry) => entry.length > 0);
488
- for (const entry of entries) {
489
- if (/\s/.test(entry)) {
490
- throw new CliError("USAGE", `Invalid creator entry: ${JSON.stringify(entry)}`, {
491
- fix: "Creator entries cannot contain spaces; separate multiple with commas."
492
- });
493
- }
494
- }
495
- return entries;
496
- }
497
- function parseHttpUrl(value) {
498
- let url;
499
- try {
500
- url = new URL(value);
501
- } catch {
502
- throw new CliError("USAGE", `Invalid URL: ${JSON.stringify(value)}`, {
503
- fix: `Pass an absolute http(s) URL like ${PRODUCTION_ORIGIN}.`
504
- });
505
- }
506
- if (url.protocol !== "http:" && url.protocol !== "https:") {
507
- throw new CliError("USAGE", `URL must be http or https: ${JSON.stringify(value)}`, {
508
- fix: `Pass an absolute http(s) URL like ${PRODUCTION_ORIGIN}.`
509
- });
510
- }
511
- return value;
512
- }
513
- async function persist(dir, merge) {
514
- await mkdir(dir, { recursive: true, mode: 448 });
515
- const lockPath = `${configPath(dir)}.lock`;
516
- try {
517
- await withFileLock(lockPath, async () => {
518
- const existing = await loadRawConfig(dir);
519
- const merged = merge(existing);
520
- const validated = RawConfigSchema.parse(merged);
521
- await writeFileAtomic(configPath(dir), `${JSON.stringify(validated, null, 2)}
522
- `, {
523
- mode: 420,
524
- dirMode: 448
525
- });
526
- });
527
- } catch (err) {
528
- if (err instanceof LockTimeoutError) {
529
- throw new CliError("INTERNAL", err.message, {
530
- fix: `If no other tenjin process is running, remove ${lockPath} and retry.`,
531
- cause: err
532
- });
533
- }
534
- throw err;
535
- }
536
- }
537
- function formatLine(key, entry) {
538
- const label = key.padEnd(KEY_WIDTH);
539
- return ` ${label} ${displayValue(entry)} ${styleText("dim", `(${entry.source})`)}`;
540
- }
541
- function describedLine(key, entry, note) {
542
- const description = KEY_DESCRIPTIONS[key];
543
- let line = formatLine(key, entry);
544
- if (description !== void 0) line += ` ${styleText("dim", `- ${description}`)}`;
545
- return withNote(line, note);
546
- }
547
- function withNote(line, note) {
548
- return note !== void 0 ? `${line} ${styleText("dim", `(${note})`)}` : line;
549
- }
550
- function downgradeNote(key, settings) {
551
- if (key !== "publish.mode" || settings.publishMode.downgradedWarning === void 0) {
552
- return void 0;
553
- }
554
- return "downgraded from full-auto: committed .tenjin.json (gitignore it to opt in)";
555
- }
556
- function displayValue(entry) {
557
- const { value } = entry;
558
- if (Array.isArray(value)) return value.length > 0 ? value.join(", ") : "(empty)";
559
- if (typeof value === "boolean") return value ? "true" : "false";
560
- if (typeof value === "object") return `${value.usd} USD`;
561
- if (entry.threshold !== void 0) return `above ${entry.threshold.usd} USD`;
562
- return value;
563
- }
564
-
565
- export {
566
- selectOne,
567
- confirmChoice,
568
- intro,
569
- outro,
570
- runConfigList,
571
- runConfigGet,
572
- runConfigSet,
573
- persistPublishMode,
574
- persistBazaarPay,
575
- persistWebSearchHookMode,
576
- persistAgentDispatchHookMode,
577
- persistSearchHookMode,
578
- persistInstallHarness
579
- };
580
- //# sourceMappingURL=chunk-H3SOOJ2I.js.map