tenjin-cli 0.1.0-alpha.33 → 0.1.0-alpha.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (495) hide show
  1. package/NOTICE.md +110 -0
  2. package/README.md +87 -81
  3. package/dist/{_esm-BIN7VY2L.js → _esm-2KST7HQ7.js} +7 -7
  4. package/dist/alive-5TV22PNF.js +51 -0
  5. package/dist/auth-XI7BJFLW.js +47 -0
  6. package/dist/{auto-update-Y24UL56V.js → auto-update-7L24KDWA.js} +4 -5
  7. package/dist/balance-DFHC6XEU.js +71 -0
  8. package/dist/{ccip-DHDFKTQV.js → ccip-HOW3DZYF.js} +4 -4
  9. package/dist/chunk-24XKUN2S.js +202 -0
  10. package/dist/chunk-24XKUN2S.js.map +1 -0
  11. package/dist/chunk-2L7TDGLV.js +56 -0
  12. package/dist/chunk-2L7TDGLV.js.map +1 -0
  13. package/dist/{chunk-C2Q76BVM.js → chunk-2U7H35IP.js} +29 -7
  14. package/dist/chunk-2U7H35IP.js.map +1 -0
  15. package/dist/chunk-2W4DQQUU.js +176 -0
  16. package/dist/chunk-2W4DQQUU.js.map +1 -0
  17. package/dist/{chunk-LRW6S53P.js → chunk-34SAECKZ.js} +35 -11
  18. package/dist/chunk-34SAECKZ.js.map +1 -0
  19. package/dist/{chunk-2I4QTOLB.js → chunk-3MZ7DYRO.js} +1 -1
  20. package/dist/chunk-3MZ7DYRO.js.map +1 -0
  21. package/dist/{chunk-RVPYTUP4.js → chunk-3Y2EHT4F.js} +13 -9
  22. package/dist/chunk-3Y2EHT4F.js.map +1 -0
  23. package/dist/chunk-3Y6BHIN6.js +169 -0
  24. package/dist/chunk-3Y6BHIN6.js.map +1 -0
  25. package/dist/{chunk-4K7TQHNP.js → chunk-3YPL6T3P.js} +17 -33
  26. package/dist/chunk-3YPL6T3P.js.map +1 -0
  27. package/dist/{chunk-E7SW44LM.js → chunk-44MVIRZH.js} +121 -6
  28. package/dist/chunk-44MVIRZH.js.map +1 -0
  29. package/dist/chunk-45MMSBHA.js +321 -0
  30. package/dist/chunk-45MMSBHA.js.map +1 -0
  31. package/dist/{chunk-3FMZGI7I.js → chunk-4CE6TMI5.js} +1 -1
  32. package/dist/chunk-4CE6TMI5.js.map +1 -0
  33. package/dist/{chunk-QXP3Z3JN.js → chunk-4MBCJFY4.js} +35 -3
  34. package/dist/chunk-4MBCJFY4.js.map +1 -0
  35. package/dist/chunk-4TPL54KW.js +227 -0
  36. package/dist/chunk-4TPL54KW.js.map +1 -0
  37. package/dist/chunk-54ELBTKE.js +1615 -0
  38. package/dist/chunk-54ELBTKE.js.map +1 -0
  39. package/dist/{chunk-NDGZDTSJ.js → chunk-5F4OB5B3.js} +115 -57
  40. package/dist/chunk-5F4OB5B3.js.map +1 -0
  41. package/dist/chunk-5HN4KVQU.js +3348 -0
  42. package/dist/chunk-5HN4KVQU.js.map +1 -0
  43. package/dist/{chunk-ZDZERB6L.js → chunk-5J4E5GYI.js} +572 -407
  44. package/dist/chunk-5J4E5GYI.js.map +1 -0
  45. package/dist/{chunk-ZNNXRNFD.js → chunk-5N4GGUBN.js} +48 -6
  46. package/dist/chunk-5N4GGUBN.js.map +1 -0
  47. package/dist/chunk-5USBZ2MU.js +58 -0
  48. package/dist/chunk-5USBZ2MU.js.map +1 -0
  49. package/dist/chunk-64WOMNYR.js +183 -0
  50. package/dist/chunk-64WOMNYR.js.map +1 -0
  51. package/dist/{chunk-ILNIZ5I2.js → chunk-65RS4LQS.js} +1825 -1715
  52. package/dist/chunk-65RS4LQS.js.map +1 -0
  53. package/dist/{chunk-IE7P2BZE.js → chunk-6QMDUDF2.js} +3 -3
  54. package/dist/{chunk-IADZOXKN.js → chunk-7SLOTLO7.js} +19 -697
  55. package/dist/chunk-7SLOTLO7.js.map +1 -0
  56. package/dist/{chunk-WFSPCCVW.js → chunk-7V25UAQO.js} +99 -99
  57. package/dist/{chunk-WFSPCCVW.js.map → chunk-7V25UAQO.js.map} +1 -1
  58. package/dist/chunk-BGA4DO5M.js +719 -0
  59. package/dist/chunk-BGA4DO5M.js.map +1 -0
  60. package/dist/chunk-BVP7YK2J.js +706 -0
  61. package/dist/chunk-BVP7YK2J.js.map +1 -0
  62. package/dist/chunk-C265QIMJ.js +83 -0
  63. package/dist/chunk-C265QIMJ.js.map +1 -0
  64. package/dist/{chunk-XQJXNMSB.js → chunk-CRG54LEB.js} +1 -1
  65. package/dist/chunk-CRG54LEB.js.map +1 -0
  66. package/dist/{chunk-KG3D7FIF.js → chunk-CZJOMUBP.js} +2 -2
  67. package/dist/{chunk-36RVGZNY.js → chunk-D6M3ZK66.js} +22 -39
  68. package/dist/chunk-D6M3ZK66.js.map +1 -0
  69. package/dist/{chunk-3UCIG4TG.js → chunk-DI4QAGRZ.js} +1 -11
  70. package/dist/chunk-DI4QAGRZ.js.map +1 -0
  71. package/dist/{chunk-JKKAIPTU.js → chunk-DIH2G3YG.js} +47 -10
  72. package/dist/chunk-DIH2G3YG.js.map +1 -0
  73. package/dist/chunk-DJ36BM62.js +78 -0
  74. package/dist/chunk-DJ36BM62.js.map +1 -0
  75. package/dist/chunk-DTEWAVNE.js +114 -0
  76. package/dist/chunk-DTEWAVNE.js.map +1 -0
  77. package/dist/chunk-F2KJAJ7T.js +13 -0
  78. package/dist/chunk-F2KJAJ7T.js.map +1 -0
  79. package/dist/{chunk-BF4XHEQK.js → chunk-F3QPGYOY.js} +6 -6
  80. package/dist/chunk-F3QPGYOY.js.map +1 -0
  81. package/dist/{chunk-3GNJXKIT.js → chunk-F43CV6UC.js} +2 -2
  82. package/dist/{chunk-J57UC3DD.js → chunk-FKVJKLPI.js} +3 -3
  83. package/dist/{chunk-V2LQLN5H.js → chunk-FYFHH7V5.js} +59 -8
  84. package/dist/{chunk-V2LQLN5H.js.map → chunk-FYFHH7V5.js.map} +1 -1
  85. package/dist/chunk-GAJC4BQZ.js +1096 -0
  86. package/dist/chunk-GAJC4BQZ.js.map +1 -0
  87. package/dist/{chunk-DOQGNFHM.js → chunk-GH5UKMZD.js} +2 -12
  88. package/dist/{chunk-DOQGNFHM.js.map → chunk-GH5UKMZD.js.map} +1 -1
  89. package/dist/{chunk-WYXUQGOL.js → chunk-HAZAN4UM.js} +7 -6
  90. package/dist/chunk-HAZAN4UM.js.map +1 -0
  91. package/dist/chunk-HI5XQOX2.js +393 -0
  92. package/dist/chunk-HI5XQOX2.js.map +1 -0
  93. package/dist/chunk-HKGUKAQW.js +488 -0
  94. package/dist/chunk-HKGUKAQW.js.map +1 -0
  95. package/dist/{chunk-SO3XRZPX.js → chunk-HPRVFJPM.js} +6 -6
  96. package/dist/{chunk-L6JEXB3E.js → chunk-HQR4BWKX.js} +3 -131
  97. package/dist/chunk-HQR4BWKX.js.map +1 -0
  98. package/dist/chunk-HZKANST2.js +177 -0
  99. package/dist/chunk-HZKANST2.js.map +1 -0
  100. package/dist/{chunk-UUGOUOVT.js → chunk-I557SAOM.js} +8 -2
  101. package/dist/chunk-I557SAOM.js.map +1 -0
  102. package/dist/{chunk-TC2WZLSC.js → chunk-IGLWLH73.js} +8 -7
  103. package/dist/chunk-IGLWLH73.js.map +1 -0
  104. package/dist/chunk-ILWCKCOI.js +58 -0
  105. package/dist/chunk-ILWCKCOI.js.map +1 -0
  106. package/dist/{chunk-2GP3HRYK.js → chunk-INSIW65E.js} +182 -182
  107. package/dist/{chunk-MPZUYCAP.js → chunk-IULCDMVG.js} +12 -1
  108. package/dist/chunk-IULCDMVG.js.map +1 -0
  109. package/dist/{chunk-INTFHMU4.js → chunk-IVNSUAVC.js} +25 -26
  110. package/dist/chunk-IVNSUAVC.js.map +1 -0
  111. package/dist/chunk-JDQZCREI.js +87 -0
  112. package/dist/chunk-JDQZCREI.js.map +1 -0
  113. package/dist/chunk-JHFFUVON.js +1050 -0
  114. package/dist/chunk-JHFFUVON.js.map +1 -0
  115. package/dist/{chunk-RL5UUDT4.js → chunk-JNUKLSMZ.js} +3 -3
  116. package/dist/chunk-JTILUN4W.js +2933 -0
  117. package/dist/chunk-JTILUN4W.js.map +1 -0
  118. package/dist/{chunk-OJNTCYQQ.js → chunk-JTX3BUDK.js} +37 -53
  119. package/dist/chunk-JTX3BUDK.js.map +1 -0
  120. package/dist/{chunk-X5ZBP3IY.js → chunk-JUUBBBY5.js} +2 -2
  121. package/dist/chunk-JUUBBBY5.js.map +1 -0
  122. package/dist/chunk-JWAK7JQB.js +15 -0
  123. package/dist/chunk-JWAK7JQB.js.map +1 -0
  124. package/dist/{chunk-UXZONNEQ.js → chunk-K5KNGC4I.js} +34 -31
  125. package/dist/chunk-K5KNGC4I.js.map +1 -0
  126. package/dist/chunk-KAQ4Q3TO.js +135 -0
  127. package/dist/chunk-KAQ4Q3TO.js.map +1 -0
  128. package/dist/chunk-KFVJYLVL.js +125 -0
  129. package/dist/chunk-KFVJYLVL.js.map +1 -0
  130. package/dist/chunk-KGUE5AVX.js +69 -0
  131. package/dist/chunk-KGUE5AVX.js.map +1 -0
  132. package/dist/{chunk-FVIGCDSV.js → chunk-KLDMLWXT.js} +11 -85
  133. package/dist/chunk-KLDMLWXT.js.map +1 -0
  134. package/dist/chunk-KNKDMTHU.js +453 -0
  135. package/dist/chunk-KNKDMTHU.js.map +1 -0
  136. package/dist/chunk-LDA6TAYQ.js +95 -0
  137. package/dist/chunk-LDA6TAYQ.js.map +1 -0
  138. package/dist/chunk-LWSSIZOY.js +347 -0
  139. package/dist/chunk-LWSSIZOY.js.map +1 -0
  140. package/dist/{chunk-ZURZHELF.js → chunk-MAHNZA6C.js} +158 -41
  141. package/dist/chunk-MAHNZA6C.js.map +1 -0
  142. package/dist/chunk-MEWZCIA6.js +220 -0
  143. package/dist/chunk-MEWZCIA6.js.map +1 -0
  144. package/dist/{chunk-2SNUOHAT.js → chunk-MEZJ3I63.js} +49 -1
  145. package/dist/chunk-MEZJ3I63.js.map +1 -0
  146. package/dist/chunk-MJDO4EXD.js +353 -0
  147. package/dist/chunk-MJDO4EXD.js.map +1 -0
  148. package/dist/chunk-NJA6NT3A.js +6595 -0
  149. package/dist/chunk-NJA6NT3A.js.map +1 -0
  150. package/dist/{chunk-LHHMV4GU.js → chunk-NVSKJPRC.js} +1 -1
  151. package/dist/{chunk-LHHMV4GU.js.map → chunk-NVSKJPRC.js.map} +1 -1
  152. package/dist/{chunk-4YOZGGTZ.js → chunk-OC7K2DVZ.js} +5 -5
  153. package/dist/chunk-OC7K2DVZ.js.map +1 -0
  154. package/dist/chunk-ODRPASFP.js +2078 -0
  155. package/dist/chunk-ODRPASFP.js.map +1 -0
  156. package/dist/chunk-OJJFANO6.js +133 -0
  157. package/dist/chunk-OJJFANO6.js.map +1 -0
  158. package/dist/{chunk-JNJWBTU2.js → chunk-OQWPRFAC.js} +332 -882
  159. package/dist/chunk-OQWPRFAC.js.map +1 -0
  160. package/dist/chunk-P4I7BFNJ.js +11 -0
  161. package/dist/chunk-P4I7BFNJ.js.map +1 -0
  162. package/dist/{chunk-SNNSAGMT.js → chunk-P6YQWIT2.js} +4058 -4039
  163. package/dist/chunk-P6YQWIT2.js.map +1 -0
  164. package/dist/{chunk-JRGFKVAZ.js → chunk-PETQ5WEA.js} +2 -2
  165. package/dist/{chunk-HMWYAUA6.js → chunk-Q6RSJCXB.js} +29 -69
  166. package/dist/chunk-Q6RSJCXB.js.map +1 -0
  167. package/dist/{chunk-U3IKUGRP.js → chunk-QKEUKBRK.js} +17 -23
  168. package/dist/chunk-QKEUKBRK.js.map +1 -0
  169. package/dist/{chunk-2RWB7RKE.js → chunk-QKYUCITR.js} +174 -5814
  170. package/dist/chunk-QKYUCITR.js.map +1 -0
  171. package/dist/chunk-QQDPRTLP.js +127 -0
  172. package/dist/chunk-QQDPRTLP.js.map +1 -0
  173. package/dist/chunk-QQYCYAKI.js +79 -0
  174. package/dist/chunk-QQYCYAKI.js.map +1 -0
  175. package/dist/chunk-R4KDH477.js +1064 -0
  176. package/dist/chunk-R4KDH477.js.map +1 -0
  177. package/dist/chunk-R5TR2DIK.js +119 -0
  178. package/dist/chunk-R5TR2DIK.js.map +1 -0
  179. package/dist/chunk-R62PKTAG.js +66 -0
  180. package/dist/chunk-R62PKTAG.js.map +1 -0
  181. package/dist/{chunk-BFDQ4WNW.js → chunk-RFZA7PSM.js} +4 -5
  182. package/dist/chunk-RFZA7PSM.js.map +1 -0
  183. package/dist/chunk-RGCPELQN.js +219 -0
  184. package/dist/chunk-RGCPELQN.js.map +1 -0
  185. package/dist/chunk-RGVCOG2S.js +910 -0
  186. package/dist/chunk-RGVCOG2S.js.map +1 -0
  187. package/dist/chunk-SOLNJ3AZ.js +209 -0
  188. package/dist/chunk-SOLNJ3AZ.js.map +1 -0
  189. package/dist/chunk-TFT2X7SH.js +77 -0
  190. package/dist/chunk-TFT2X7SH.js.map +1 -0
  191. package/dist/chunk-TUCKEEXE.js +2 -0
  192. package/dist/chunk-TVWCLUBI.js +293 -0
  193. package/dist/chunk-TVWCLUBI.js.map +1 -0
  194. package/dist/chunk-U4TRWSVE.js +78 -0
  195. package/dist/chunk-U4TRWSVE.js.map +1 -0
  196. package/dist/chunk-UIB33QQP.js +379 -0
  197. package/dist/chunk-UIB33QQP.js.map +1 -0
  198. package/dist/chunk-V6GIVALQ.js +1889 -0
  199. package/dist/chunk-V6GIVALQ.js.map +1 -0
  200. package/dist/chunk-VHXCPXUS.js +366 -0
  201. package/dist/chunk-VHXCPXUS.js.map +1 -0
  202. package/dist/{chunk-HGZEPQUT.js → chunk-VU6GMWF6.js} +17 -8
  203. package/dist/chunk-VU6GMWF6.js.map +1 -0
  204. package/dist/chunk-VWZYE3NC.js +8415 -0
  205. package/dist/chunk-VWZYE3NC.js.map +1 -0
  206. package/dist/{chunk-AGMVASXZ.js → chunk-W2GXIARJ.js} +88 -11
  207. package/dist/chunk-W2GXIARJ.js.map +1 -0
  208. package/dist/chunk-W4G3K3V7.js +288 -0
  209. package/dist/chunk-W4G3K3V7.js.map +1 -0
  210. package/dist/chunk-W74LJ5OT.js +588 -0
  211. package/dist/chunk-W74LJ5OT.js.map +1 -0
  212. package/dist/chunk-W7ELYLYK.js +233 -0
  213. package/dist/chunk-W7ELYLYK.js.map +1 -0
  214. package/dist/{chunk-BPMWXTFX.js → chunk-WFZX352D.js} +7 -7
  215. package/dist/chunk-WXA3WTPF.js +20 -0
  216. package/dist/chunk-WXA3WTPF.js.map +1 -0
  217. package/dist/chunk-XRGFH7FI.js +454 -0
  218. package/dist/chunk-XRGFH7FI.js.map +1 -0
  219. package/dist/chunk-XSCGUO2U.js +330 -0
  220. package/dist/chunk-XSCGUO2U.js.map +1 -0
  221. package/dist/chunk-XWROSMI5.js +1039 -0
  222. package/dist/chunk-XWROSMI5.js.map +1 -0
  223. package/dist/chunk-Y2EXZ47H.js +40 -0
  224. package/dist/chunk-Y2EXZ47H.js.map +1 -0
  225. package/dist/chunk-YJGEVBKZ.js +47 -0
  226. package/dist/chunk-YJGEVBKZ.js.map +1 -0
  227. package/dist/{chunk-6CMM6YCB.js → chunk-YWWMISDY.js} +2 -2
  228. package/dist/{chunk-WXA2BWTE.js → chunk-ZCT5DJ3G.js} +2 -48
  229. package/dist/chunk-ZCT5DJ3G.js.map +1 -0
  230. package/dist/chunk-ZEYA2WWX.js +982 -0
  231. package/dist/chunk-ZEYA2WWX.js.map +1 -0
  232. package/dist/chunk-ZRC7Z5X3.js +82 -0
  233. package/dist/chunk-ZRC7Z5X3.js.map +1 -0
  234. package/dist/{chunk-3AIHRXKO.js → chunk-ZS7JIUJ3.js} +12 -10
  235. package/dist/chunk-ZS7JIUJ3.js.map +1 -0
  236. package/dist/{clack-EZ7TDWQU.js → clack-Q4RNC5VE.js} +2 -6
  237. package/dist/{claude-cli-2YKABJJZ.js → claude-cli-GIIHOBGT.js} +4 -2
  238. package/dist/claude-install-BAUSJMW3.js +64 -0
  239. package/dist/{cli-E36SPKBW.js → cli-QY4KKA3D.js} +632 -150
  240. package/dist/cli-QY4KKA3D.js.map +1 -0
  241. package/dist/client-3YQKORVK.js +710 -0
  242. package/dist/client-3YQKORVK.js.map +1 -0
  243. package/dist/{codex-event-ZO2GEFE6.js → codex-event-EUTCAOTQ.js} +3 -5
  244. package/dist/{codex-host-KECJVTA2.js → codex-host-ZON3S6HU.js} +7 -7
  245. package/dist/{codex-install-HQZDGFXW.js → codex-install-HZV2DOAB.js} +242 -88
  246. package/dist/codex-install-HZV2DOAB.js.map +1 -0
  247. package/dist/config-QZOBMTEL.js +57 -0
  248. package/dist/config-names-Z5NZD5R2.js +224 -0
  249. package/dist/config-names-Z5NZD5R2.js.map +1 -0
  250. package/dist/config-rules-YOYHS6YL.js +55 -0
  251. package/dist/config-subagents-WQV2ZAD5.js +362 -0
  252. package/dist/config-subagents-WQV2ZAD5.js.map +1 -0
  253. package/dist/connect-YDWTYU4B.js +1020 -0
  254. package/dist/connect-YDWTYU4B.js.map +1 -0
  255. package/dist/core-0a66n3e7-TTP554XV.js +127 -0
  256. package/dist/core-0a66n3e7-TTP554XV.js.map +1 -0
  257. package/dist/core-0bmnpbz2-C2JIRVZO.js +10790 -0
  258. package/dist/core-0bmnpbz2-C2JIRVZO.js.map +1 -0
  259. package/dist/core-9je8ee1j-74DGHWPV.js +30 -0
  260. package/dist/core-9je8ee1j-74DGHWPV.js.map +1 -0
  261. package/dist/core-wadgcjfh-TSZFQZGH.js +666 -0
  262. package/dist/core-wadgcjfh-TSZFQZGH.js.map +1 -0
  263. package/dist/core-zg882d22-LKV5DZYW.js +37 -0
  264. package/dist/core-zg882d22-LKV5DZYW.js.map +1 -0
  265. package/dist/decision-QSKHOGCO.js +145 -0
  266. package/dist/{doctor-I6XQEKWD.js → doctor-ZWJXRD75.js} +162 -148
  267. package/dist/doctor-ZWJXRD75.js.map +1 -0
  268. package/dist/{env-proxy-R6ZMLQTT.js → env-proxy-XLSLHBKQ.js} +2 -2
  269. package/dist/{ethersCompat-Df4a6QIZ-X6YZWAML.js → ethersCompat-Df4a6QIZ-K3DMHR6Y.js} +5 -5
  270. package/dist/explicit-ME2NRADQ.js +371 -0
  271. package/dist/explicit-ME2NRADQ.js.map +1 -0
  272. package/dist/flush-stdio-NYIJ3QXT.js +18 -0
  273. package/dist/fund-VF7TLDJH.js +722 -0
  274. package/dist/fund-VF7TLDJH.js.map +1 -0
  275. package/dist/hook-command-VZ27MGWO.js +49 -0
  276. package/dist/hosts/claude/.claude-plugin/marketplace.json +2 -2
  277. package/dist/hosts/claude/tenjin/.claude-plugin/plugin.json +2 -2
  278. package/dist/hosts/claude/tenjin/hooks/hook-data.ts +152 -0
  279. package/dist/hosts/claude/tenjin/hooks/hooks.json +7 -0
  280. package/dist/hosts/claude/tenjin/hooks/model-viewer.tsx +2987 -0
  281. package/dist/hosts/claude/tenjin/hooks/register.tsx +527 -56
  282. package/dist/hosts/claude/tenjin/skills/tenjin-pay/SKILL.md +14 -4
  283. package/dist/hosts/claude/tenjin/types/index.d.ts +144 -1
  284. package/dist/{hosts-DVQJ32QC.js → hosts-3EMTVM4H.js} +7 -6
  285. package/dist/index.js +18 -15
  286. package/dist/index.js.map +1 -1
  287. package/dist/install-ZA7L2UF3.js +115 -0
  288. package/dist/install-funding-JDGYTF72.js +30 -0
  289. package/dist/install-identity-FFAYEFLX.js +30 -0
  290. package/dist/{install-wallet-5M4OTYLX.js → install-wallet-2SFOVE3Q.js} +68 -53
  291. package/dist/install-wallet-2SFOVE3Q.js.map +1 -0
  292. package/dist/mcp-36S6MK3C.js +67642 -0
  293. package/dist/mcp-36S6MK3C.js.map +1 -0
  294. package/dist/new-install-5L4GY3LN.js +51 -0
  295. package/dist/{package-IJFGMWEV.js → package-BONDXSV3.js} +2 -2
  296. package/dist/{passphrase-IFTDS3CU.js → passphrase-T4ULBN4M.js} +16 -12
  297. package/dist/{paths-XCSAKISU.js → paths-O2KDWZ76.js} +18 -28
  298. package/dist/pay-CMV5KL74.js +74 -0
  299. package/dist/{payments-HFPPWHTV.js → payments-Z6UBZL4Z.js} +36 -26
  300. package/dist/payments-Z6UBZL4Z.js.map +1 -0
  301. package/dist/reclaim-subagent-credit-ABSF67SJ.js +105 -0
  302. package/dist/reclaim-subagent-credit-ABSF67SJ.js.map +1 -0
  303. package/dist/{redact-D7ASVWKL.js → redact-LOTHE5TS.js} +2 -8
  304. package/dist/redact-LOTHE5TS.js.map +1 -0
  305. package/dist/routing-quote-AHLAREXR.js +40 -0
  306. package/dist/routing-quote-AHLAREXR.js.map +1 -0
  307. package/dist/run-JH7ELYAM.js +88 -0
  308. package/dist/run-JH7ELYAM.js.map +1 -0
  309. package/dist/runtime-2GX4ALJP.js +410 -0
  310. package/dist/runtime-2GX4ALJP.js.map +1 -0
  311. package/dist/runtime-activate-IDQ2NCSP.js +39 -0
  312. package/dist/runtime-activate-IDQ2NCSP.js.map +1 -0
  313. package/dist/{runtime-fetch-ZSSSK72Y.js → runtime-fetch-6LOBHBEN.js} +4 -4
  314. package/dist/runtime-fetch-6LOBHBEN.js.map +1 -0
  315. package/dist/runtime-launchers-YAPKCBHV.js +31 -0
  316. package/dist/runtime-launchers-YAPKCBHV.js.map +1 -0
  317. package/dist/{runtime-layout-WIDILZ6K.js → runtime-layout-QHZQJV7C.js} +5 -4
  318. package/dist/runtime-layout-QHZQJV7C.js.map +1 -0
  319. package/dist/runtime-place-4POL4KK4.js +37 -0
  320. package/dist/runtime-place-4POL4KK4.js.map +1 -0
  321. package/dist/runtime-provenance-MNJGVBV2.js +12 -0
  322. package/dist/runtime-provenance-MNJGVBV2.js.map +1 -0
  323. package/dist/{secp256k1-ZZZT2CAX.js → secp256k1-N5P2GVGF.js} +3 -3
  324. package/dist/secp256k1-N5P2GVGF.js.map +1 -0
  325. package/dist/{send-GCVEAQKL.js → send-ELXFKEKY.js} +35 -32
  326. package/dist/send-ELXFKEKY.js.map +1 -0
  327. package/dist/status-FXUFWJDM.js +404 -0
  328. package/dist/status-FXUFWJDM.js.map +1 -0
  329. package/dist/{status-line-OPCXDHL2.js → status-line-IH5JBWBC.js} +51 -43
  330. package/dist/status-line-IH5JBWBC.js.map +1 -0
  331. package/dist/streamableHttp-CP2ZQBIK.js +768 -0
  332. package/dist/streamableHttp-CP2ZQBIK.js.map +1 -0
  333. package/dist/{uninstall-BAWRBXXQ.js → uninstall-LJZUKM4D.js} +76 -76
  334. package/dist/uninstall-LJZUKM4D.js.map +1 -0
  335. package/dist/update-EUIX72IX.js +68 -0
  336. package/dist/update-EUIX72IX.js.map +1 -0
  337. package/dist/usage-EKDC7LUC.js +180 -0
  338. package/dist/usage-EKDC7LUC.js.map +1 -0
  339. package/dist/{usdc-VG4CIOUK.js → usdc-YIHK2OMC.js} +8 -12
  340. package/dist/usdc-YIHK2OMC.js.map +1 -0
  341. package/dist/{viemAdapter-By13KInL-DOFTEIJV.js → viemAdapter-By13KInL-PRLSIESK.js} +5 -5
  342. package/dist/viemAdapter-By13KInL-PRLSIESK.js.map +1 -0
  343. package/dist/wallet-HSW757W6.js +80 -0
  344. package/dist/wallet-HSW757W6.js.map +1 -0
  345. package/dist/wallet-kdf-worker.mjs +1433 -818
  346. package/docs/agent-permissions.md +88 -155
  347. package/docs/router-reference.md +236 -0
  348. package/docs/safety-model.md +31 -33
  349. package/docs/subagents-internals.md +97 -0
  350. package/docs/subagents.md +348 -0
  351. package/docs/troubleshooting.md +10 -6
  352. package/package.json +12 -8
  353. package/scripts/installers/install.sh +7 -1
  354. package/dist/alive-GSOWKUOY.js +0 -38
  355. package/dist/chunk-2I4QTOLB.js.map +0 -1
  356. package/dist/chunk-2M2VPI2E.js +0 -560
  357. package/dist/chunk-2M2VPI2E.js.map +0 -1
  358. package/dist/chunk-2RWB7RKE.js.map +0 -1
  359. package/dist/chunk-2SNUOHAT.js.map +0 -1
  360. package/dist/chunk-3623BLPV.js +0 -184
  361. package/dist/chunk-3623BLPV.js.map +0 -1
  362. package/dist/chunk-36RVGZNY.js.map +0 -1
  363. package/dist/chunk-3AIHRXKO.js.map +0 -1
  364. package/dist/chunk-3FMZGI7I.js.map +0 -1
  365. package/dist/chunk-3UCIG4TG.js.map +0 -1
  366. package/dist/chunk-4K7TQHNP.js.map +0 -1
  367. package/dist/chunk-4LMUQMBH.js +0 -29
  368. package/dist/chunk-4LMUQMBH.js.map +0 -1
  369. package/dist/chunk-4USCZ2NI.js +0 -228
  370. package/dist/chunk-4USCZ2NI.js.map +0 -1
  371. package/dist/chunk-4YOZGGTZ.js.map +0 -1
  372. package/dist/chunk-62KNUYWD.js +0 -111
  373. package/dist/chunk-62KNUYWD.js.map +0 -1
  374. package/dist/chunk-A5GKIG5O.js +0 -2037
  375. package/dist/chunk-A5GKIG5O.js.map +0 -1
  376. package/dist/chunk-AGMVASXZ.js.map +0 -1
  377. package/dist/chunk-BF4XHEQK.js.map +0 -1
  378. package/dist/chunk-BFDQ4WNW.js.map +0 -1
  379. package/dist/chunk-C2Q76BVM.js.map +0 -1
  380. package/dist/chunk-CEXSOI5R.js +0 -808
  381. package/dist/chunk-CEXSOI5R.js.map +0 -1
  382. package/dist/chunk-E7SW44LM.js.map +0 -1
  383. package/dist/chunk-EDJWHDDL.js +0 -33
  384. package/dist/chunk-EDJWHDDL.js.map +0 -1
  385. package/dist/chunk-FVIGCDSV.js.map +0 -1
  386. package/dist/chunk-GTTUCOPD.js +0 -105
  387. package/dist/chunk-GTTUCOPD.js.map +0 -1
  388. package/dist/chunk-HDPUXS3Z.js +0 -122
  389. package/dist/chunk-HDPUXS3Z.js.map +0 -1
  390. package/dist/chunk-HGGWCP7W.js +0 -120
  391. package/dist/chunk-HGGWCP7W.js.map +0 -1
  392. package/dist/chunk-HGZEPQUT.js.map +0 -1
  393. package/dist/chunk-HMWYAUA6.js.map +0 -1
  394. package/dist/chunk-IADZOXKN.js.map +0 -1
  395. package/dist/chunk-ILNIZ5I2.js.map +0 -1
  396. package/dist/chunk-INTFHMU4.js.map +0 -1
  397. package/dist/chunk-JKKAIPTU.js.map +0 -1
  398. package/dist/chunk-JNJWBTU2.js.map +0 -1
  399. package/dist/chunk-KM7RY2ZS.js +0 -246
  400. package/dist/chunk-KM7RY2ZS.js.map +0 -1
  401. package/dist/chunk-KOGZDMHO.js +0 -21
  402. package/dist/chunk-KOGZDMHO.js.map +0 -1
  403. package/dist/chunk-L6JEXB3E.js.map +0 -1
  404. package/dist/chunk-LRW6S53P.js.map +0 -1
  405. package/dist/chunk-LXAYUOXI.js +0 -511
  406. package/dist/chunk-LXAYUOXI.js.map +0 -1
  407. package/dist/chunk-MEFB5KHA.js +0 -59
  408. package/dist/chunk-MEFB5KHA.js.map +0 -1
  409. package/dist/chunk-MPZUYCAP.js.map +0 -1
  410. package/dist/chunk-NDGZDTSJ.js.map +0 -1
  411. package/dist/chunk-OJNTCYQQ.js.map +0 -1
  412. package/dist/chunk-P3LFTKE7.js +0 -58
  413. package/dist/chunk-P3LFTKE7.js.map +0 -1
  414. package/dist/chunk-QXP3Z3JN.js.map +0 -1
  415. package/dist/chunk-RVPYTUP4.js.map +0 -1
  416. package/dist/chunk-SNNSAGMT.js.map +0 -1
  417. package/dist/chunk-TC2WZLSC.js.map +0 -1
  418. package/dist/chunk-TKPF35W6.js +0 -29
  419. package/dist/chunk-TKPF35W6.js.map +0 -1
  420. package/dist/chunk-U3IKUGRP.js.map +0 -1
  421. package/dist/chunk-UUGOUOVT.js.map +0 -1
  422. package/dist/chunk-UXZONNEQ.js.map +0 -1
  423. package/dist/chunk-WXA2BWTE.js.map +0 -1
  424. package/dist/chunk-WYXUQGOL.js.map +0 -1
  425. package/dist/chunk-X5ZBP3IY.js.map +0 -1
  426. package/dist/chunk-XKESD27X.js +0 -10
  427. package/dist/chunk-XKESD27X.js.map +0 -1
  428. package/dist/chunk-XQJXNMSB.js.map +0 -1
  429. package/dist/chunk-Y527D4TV.js +0 -56
  430. package/dist/chunk-Y527D4TV.js.map +0 -1
  431. package/dist/chunk-ZDZERB6L.js.map +0 -1
  432. package/dist/chunk-ZNNXRNFD.js.map +0 -1
  433. package/dist/chunk-ZURZHELF.js.map +0 -1
  434. package/dist/cli-E36SPKBW.js.map +0 -1
  435. package/dist/codex-install-HQZDGFXW.js.map +0 -1
  436. package/dist/config-HY2E4GGW.js +0 -55
  437. package/dist/doctor-I6XQEKWD.js.map +0 -1
  438. package/dist/fund-2QRO7OJL.js +0 -378
  439. package/dist/fund-2QRO7OJL.js.map +0 -1
  440. package/dist/hook-command-2UBCSZG6.js +0 -43
  441. package/dist/install-ILUX5C4A.js +0 -107
  442. package/dist/install-identity-TZKGY6LQ.js +0 -31
  443. package/dist/install-wallet-5M4OTYLX.js.map +0 -1
  444. package/dist/mcp-LE4DUS22.js +0 -14127
  445. package/dist/mcp-LE4DUS22.js.map +0 -1
  446. package/dist/pay-WCG3IH4R.js +0 -55
  447. package/dist/payments-HFPPWHTV.js.map +0 -1
  448. package/dist/plugin-registration-PZFI5GZW.js +0 -68
  449. package/dist/runtime-UZOKSUZX.js +0 -1321
  450. package/dist/runtime-UZOKSUZX.js.map +0 -1
  451. package/dist/send-GCVEAQKL.js.map +0 -1
  452. package/dist/status-HCVAOCN7.js +0 -150
  453. package/dist/status-HCVAOCN7.js.map +0 -1
  454. package/dist/status-line-OPCXDHL2.js.map +0 -1
  455. package/dist/uninstall-BAWRBXXQ.js.map +0 -1
  456. package/dist/update-CACXLQLR.js +0 -56
  457. package/dist/wallet-QL4UUXEZ.js +0 -55
  458. /package/dist/{_esm-BIN7VY2L.js.map → _esm-2KST7HQ7.js.map} +0 -0
  459. /package/dist/{alive-GSOWKUOY.js.map → alive-5TV22PNF.js.map} +0 -0
  460. /package/dist/{auto-update-Y24UL56V.js.map → auth-XI7BJFLW.js.map} +0 -0
  461. /package/dist/{ccip-DHDFKTQV.js.map → auto-update-7L24KDWA.js.map} +0 -0
  462. /package/dist/{clack-EZ7TDWQU.js.map → balance-DFHC6XEU.js.map} +0 -0
  463. /package/dist/{claude-cli-2YKABJJZ.js.map → ccip-HOW3DZYF.js.map} +0 -0
  464. /package/dist/{chunk-IE7P2BZE.js.map → chunk-6QMDUDF2.js.map} +0 -0
  465. /package/dist/{chunk-KG3D7FIF.js.map → chunk-CZJOMUBP.js.map} +0 -0
  466. /package/dist/{chunk-3GNJXKIT.js.map → chunk-F43CV6UC.js.map} +0 -0
  467. /package/dist/{chunk-J57UC3DD.js.map → chunk-FKVJKLPI.js.map} +0 -0
  468. /package/dist/{chunk-SO3XRZPX.js.map → chunk-HPRVFJPM.js.map} +0 -0
  469. /package/dist/{chunk-2GP3HRYK.js.map → chunk-INSIW65E.js.map} +0 -0
  470. /package/dist/{chunk-RL5UUDT4.js.map → chunk-JNUKLSMZ.js.map} +0 -0
  471. /package/dist/{chunk-JRGFKVAZ.js.map → chunk-PETQ5WEA.js.map} +0 -0
  472. /package/dist/{codex-event-ZO2GEFE6.js.map → chunk-TUCKEEXE.js.map} +0 -0
  473. /package/dist/{chunk-BPMWXTFX.js.map → chunk-WFZX352D.js.map} +0 -0
  474. /package/dist/{chunk-6CMM6YCB.js.map → chunk-YWWMISDY.js.map} +0 -0
  475. /package/dist/{codex-host-KECJVTA2.js.map → clack-Q4RNC5VE.js.map} +0 -0
  476. /package/dist/{config-HY2E4GGW.js.map → claude-cli-GIIHOBGT.js.map} +0 -0
  477. /package/dist/{env-proxy-R6ZMLQTT.js.map → claude-install-BAUSJMW3.js.map} +0 -0
  478. /package/dist/{ethersCompat-Df4a6QIZ-X6YZWAML.js.map → codex-event-EUTCAOTQ.js.map} +0 -0
  479. /package/dist/{hook-command-2UBCSZG6.js.map → codex-host-ZON3S6HU.js.map} +0 -0
  480. /package/dist/{hosts-DVQJ32QC.js.map → config-QZOBMTEL.js.map} +0 -0
  481. /package/dist/{install-ILUX5C4A.js.map → config-rules-YOYHS6YL.js.map} +0 -0
  482. /package/dist/{install-identity-TZKGY6LQ.js.map → decision-QSKHOGCO.js.map} +0 -0
  483. /package/dist/{package-IJFGMWEV.js.map → env-proxy-XLSLHBKQ.js.map} +0 -0
  484. /package/dist/{passphrase-IFTDS3CU.js.map → ethersCompat-Df4a6QIZ-K3DMHR6Y.js.map} +0 -0
  485. /package/dist/{paths-XCSAKISU.js.map → flush-stdio-NYIJ3QXT.js.map} +0 -0
  486. /package/dist/{pay-WCG3IH4R.js.map → hook-command-VZ27MGWO.js.map} +0 -0
  487. /package/dist/{plugin-registration-PZFI5GZW.js.map → hosts-3EMTVM4H.js.map} +0 -0
  488. /package/dist/{redact-D7ASVWKL.js.map → install-ZA7L2UF3.js.map} +0 -0
  489. /package/dist/{runtime-fetch-ZSSSK72Y.js.map → install-funding-JDGYTF72.js.map} +0 -0
  490. /package/dist/{runtime-layout-WIDILZ6K.js.map → install-identity-FFAYEFLX.js.map} +0 -0
  491. /package/dist/{secp256k1-ZZZT2CAX.js.map → new-install-5L4GY3LN.js.map} +0 -0
  492. /package/dist/{update-CACXLQLR.js.map → package-BONDXSV3.js.map} +0 -0
  493. /package/dist/{usdc-VG4CIOUK.js.map → passphrase-T4ULBN4M.js.map} +0 -0
  494. /package/dist/{viemAdapter-By13KInL-DOFTEIJV.js.map → paths-O2KDWZ76.js.map} +0 -0
  495. /package/dist/{wallet-QL4UUXEZ.js.map → pay-CMV5KL74.js.map} +0 -0
@@ -0,0 +1,588 @@
1
+ import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
+ import {
3
+ describeLimits,
4
+ replacementShort,
5
+ replacementSupport,
6
+ settingsReadback,
7
+ summarizeRule
8
+ } from "./chunk-KNKDMTHU.js";
9
+ import {
10
+ cachedIdentities
11
+ } from "./chunk-3Y6BHIN6.js";
12
+ import {
13
+ closestNames
14
+ } from "./chunk-R62PKTAG.js";
15
+ import {
16
+ ROUTER_DEFAULTS
17
+ } from "./chunk-KGUE5AVX.js";
18
+ import {
19
+ LockTimeoutError,
20
+ withFileLock
21
+ } from "./chunk-2W4DQQUU.js";
22
+ import {
23
+ paint,
24
+ style
25
+ } from "./chunk-KLDMLWXT.js";
26
+ import {
27
+ formatUsdDisplay,
28
+ parseUsdToAtomic,
29
+ toMoney
30
+ } from "./chunk-MEZJ3I63.js";
31
+ import {
32
+ projectRouterPath,
33
+ readProjectRouterFile,
34
+ routerSettings
35
+ } from "./chunk-W2GXIARJ.js";
36
+ import {
37
+ CONFIG_KEYS,
38
+ EXPERIMENTAL_CONFIG_KEYS,
39
+ PERSONAL_ROUTER_KEYS,
40
+ RETIRED_PAYMENT_GUIDANCE,
41
+ ROUTER_CONFIG_KEYS,
42
+ ROUTER_CONTEXTS,
43
+ RawConfigSchema,
44
+ SEND_MAX_UNSET,
45
+ UPDATE_CONFIG_KEYS,
46
+ loadRawConfig,
47
+ parseOnOffFlag,
48
+ parseUpdateModeFlag,
49
+ resolveSettings,
50
+ retiredPaymentKeys
51
+ } from "./chunk-UIB33QQP.js";
52
+ import {
53
+ writeFileAtomic
54
+ } from "./chunk-7WEQQJLG.js";
55
+ import {
56
+ configPath
57
+ } from "./chunk-JTX3BUDK.js";
58
+ import {
59
+ PRODUCTION_ORIGIN
60
+ } from "./chunk-CRG54LEB.js";
61
+ import {
62
+ CliError
63
+ } from "./chunk-DI4QAGRZ.js";
64
+
65
+ // src/commands/config.ts
66
+ import { mkdir } from "node:fs/promises";
67
+ import { dirname } from "node:path";
68
+ var UNLISTED_KEYS = /* @__PURE__ */ new Set(["allowlistCreators"]);
69
+ var KEY_WIDTH = Math.max(
70
+ ...[...CONFIG_KEYS, ...UPDATE_CONFIG_KEYS, ...ROUTER_CONFIG_KEYS, ...EXPERIMENTAL_CONFIG_KEYS].filter((key) => !UNLISTED_KEYS.has(key)).map((key) => key.length)
71
+ );
72
+ var KEY_DESCRIPTIONS = {
73
+ maxAutoSpend: "automatic router limit per call, the runaway guard: default 1.00, 0 blocks positive automatic payments; router.enabled false turns the router off",
74
+ sessionBudget: "automatic router daily budget shared across chats (5 by default): 0 blocks automatic spend, none removes the ceiling",
75
+ sendMaxAmount: "hard cap per tenjin wallet send; unset = send refuses until set, 0 disables send, none = uncapped; never bypassed by --yes",
76
+ allowlistCreators: "only auto-pay these creators (empty = any)",
77
+ baseUrl: "Tenjin API base URL the router asks",
78
+ rpcUrl: "Base RPC endpoint for balance reads",
79
+ bazaarRegistries: "x402 registries used to verify direct-payment listings",
80
+ "update.mode": "auto=update in the background where Tenjin's runtime is set up (else as nudge), nudge=report a newer version (stderr line, JSON envelope, hook output), off=neither report nor ask npm",
81
+ "router.enabled": "false stops every router hook and the request tool; --project sets it for this repository, --project --local for you alone in it",
82
+ "router.context": "session=a hook packet carries up to six prior messages, turn=the current turn only; --project and --local as for router.enabled",
83
+ "router.improve": "Help improve routing: true=Tenjin keeps the secret-masked text of turns the router sees, to grade its offers; false (the default) keeps none, and turning it off deletes what was kept; this machine only, never --project",
84
+ "experimental.bazaar": "EXPERIMENTAL. on=the router may also suggest unreviewed sellers from Coinbase's open x402 Bazaar, off=curated services and Tenjin's reviewed list only"
85
+ };
86
+ var EXPERIMENTAL_BAZAAR_WARNING = "Experimental: the router may now also suggest sellers from Coinbase's open x402 Bazaar. They are unreviewed third parties, Tenjin has not checked them, matches can be noisy, prices can vary with the input, and payments are real, under your spend limits. To find them, short snippets of your prompts are sent to Coinbase's public Bazaar search. Tenjin's reviewed list stays on either way. Turn this off with `tenjin config set experimental.bazaar off`.";
87
+ function isExperimentalKey(key) {
88
+ return EXPERIMENTAL_CONFIG_KEYS.includes(key);
89
+ }
90
+ function isRouterKey(key) {
91
+ return ROUTER_CONFIG_KEYS.includes(key);
92
+ }
93
+ function renderRouterSetting(key, settings) {
94
+ const { value, source, path } = key === "router.subagents" ? settings.subagents : key === "router.enabled" ? settings.enabled : key === "router.context" ? settings.context : settings.improve;
95
+ return { value, source, ...path !== void 0 ? { path } : {} };
96
+ }
97
+ var IMPROVE_ON_NOTE = "Help improve routing is on: Tenjin keeps the secret-masked text of turns the router sees, including anything pasted into them, to check and improve its offers. Turn it off any time with `tenjin config set router.improve false`, which also deletes what was kept.";
98
+ async function resolveRouterFromContext(ctx) {
99
+ return routerSettings({ cwd: process.cwd(), dataDir: ctx.dataDir });
100
+ }
101
+ function isUpdateKey(key) {
102
+ return UPDATE_CONFIG_KEYS.includes(key);
103
+ }
104
+ async function runConfigList(ctx, opts = {}) {
105
+ const settings = await resolveFromContext(ctx);
106
+ const data = {};
107
+ const humanLines = [];
108
+ const show = (key, line) => {
109
+ if (!UNLISTED_KEYS.has(key)) humanLines.push(line);
110
+ };
111
+ for (const key of CONFIG_KEYS) {
112
+ const entry = renderSetting(key, settings[key].value, settings[key].source);
113
+ data[key] = entry;
114
+ show(key, describedLine(key, entry));
115
+ }
116
+ for (const key of UPDATE_CONFIG_KEYS) {
117
+ const entry = {
118
+ value: settings.updateMode.value,
119
+ source: settings.updateMode.source
120
+ };
121
+ data[key] = entry;
122
+ show(key, describedLine(key, entry));
123
+ }
124
+ const router = await resolveRouterFromContext(ctx);
125
+ for (const key of ROUTER_CONFIG_KEYS) {
126
+ const entry = renderRouterSetting(key, router);
127
+ data[key] = entry;
128
+ show(key, describedLine(key, entry));
129
+ }
130
+ for (const key of EXPERIMENTAL_CONFIG_KEYS) {
131
+ const entry = {
132
+ value: settings.experimentalBazaar.value,
133
+ source: settings.experimentalBazaar.source
134
+ };
135
+ data[key] = entry;
136
+ show(key, describedLine(key, entry));
137
+ }
138
+ const identities = await cachedIdentities(ctx.dataDir);
139
+ const readback = settingsReadback(
140
+ router,
141
+ identities,
142
+ describeLimits(settings.maxAutoSpend.value, settings.sessionBudget.value),
143
+ await replacementSupport(ctx.dataDir)
144
+ );
145
+ return {
146
+ data: { ...data, settings: readback.data },
147
+ humanLines: opts.all === true ? [...humanLines, "", ...readback.lines] : listingLines(ctx, router, identities, readback.data, data)
148
+ };
149
+ }
150
+ var NOT_CHANGES = /* @__PURE__ */ new Set([
151
+ ...UNLISTED_KEYS,
152
+ "maxAutoSpend",
153
+ "sessionBudget"
154
+ ]);
155
+ function shortValue({ value }) {
156
+ if (Array.isArray(value)) return value.length > 0 ? value.join(", ") : "(empty)";
157
+ if (typeof value === "boolean") return value ? "on" : "off";
158
+ if (value === null) return "none";
159
+ if (typeof value === "object") return `$${formatUsdDisplay(value.atomic)}`;
160
+ return value;
161
+ }
162
+ function listingLines(ctx, router, identities, readback, keys) {
163
+ const dim = (text) => paint(ctx.io, "dim", text);
164
+ const yellow = (text) => paint(ctx.io, "yellow", text);
165
+ const under = " ";
166
+ const rules = readback.rules.map((rule) => ({
167
+ ...summarizeRule(rule, identities, router.accounts.saved),
168
+ inactive: rule.inactive,
169
+ undo: rule.reset
170
+ }));
171
+ const fallbacks = (readback.accounts ?? []).filter(({ onRefusal }) => onRefusal === "tenjin").map(({ label, reset }) => ({
172
+ mark: "\u21BB",
173
+ name: label,
174
+ does: "Tenjin's tool steps in when it refuses",
175
+ inactive: void 0,
176
+ undo: reset
177
+ }));
178
+ const rows = [...rules, ...fallbacks];
179
+ const AUTOMATIC = "Automatic picks";
180
+ const width = Math.max(16, AUTOMATIC.length, ...rows.map(({ name }) => name.length)) + 2;
181
+ const lines = [];
182
+ const { enabled } = router;
183
+ if (!enabled.value) {
184
+ lines.push(
185
+ enabled.source === "project" || enabled.source === "local" ? `\u25CB Tenjin is paused here by ${enabled.path ?? "a project file"}, so none of this applies` : "\u25CB Tenjin is paused, so none of this applies: tenjin config set router.enabled true",
186
+ ""
187
+ );
188
+ }
189
+ lines.push("Your rules");
190
+ if (router.policy.status === "invalid") {
191
+ lines.push(
192
+ ` ${yellow(`! Your rules can't be read (${router.policy.problem})`)}`,
193
+ `${under}${dim("fix: tenjin config reset --all")}`
194
+ );
195
+ } else if (rows.length === 0) {
196
+ lines.push(" none yet, so Tenjin uses its defaults");
197
+ }
198
+ for (const row of rows) {
199
+ lines.push(
200
+ ` ${row.mark} ${row.name.padEnd(width)}${row.does}${row.inactive !== void 0 ? ` ${yellow(`! ${row.inactive}`)}` : ""}`
201
+ );
202
+ if (row.undo !== void 0) lines.push(`${under}${dim(`undo: ${row.undo}`)}`);
203
+ }
204
+ const replacement = router.nativeReplacement;
205
+ lines.push(`${under}${AUTOMATIC.padEnd(width)}${replacementShort(replacement, identities)}`);
206
+ if (replacement.problem !== void 0)
207
+ lines.push(`${under}${dim("fix: tenjin config replacement off")}`);
208
+ const { perCall, daily } = readback.limits;
209
+ lines.push(
210
+ "",
211
+ "Limits",
212
+ `${under}${perCall} a call \xB7 ${daily === null ? "no daily limit" : `${daily} a day`}`
213
+ );
214
+ const changed = Object.entries(keys).filter(
215
+ ([key, entry]) => entry.source !== "default" && !NOT_CHANGES.has(key)
216
+ );
217
+ if (changed.length > 0) {
218
+ lines.push("", "Changed from the default");
219
+ for (const [key, entry] of changed) {
220
+ const where = entry.source === "file" ? "" : ` ${dim(`(${entry.source}${entry.path !== void 0 && entry.source !== "env" ? ` ${entry.path}` : ""})`)}`;
221
+ lines.push(`${under}${key.padEnd(KEY_WIDTH + 3)}${shortValue(entry)}${where}`);
222
+ }
223
+ }
224
+ lines.push("", dim("Every setting: tenjin config --all \xB7 How to change: tenjin config --help"));
225
+ return lines;
226
+ }
227
+ async function runConfigGet({ key }, ctx) {
228
+ if (isUpdateKey(key)) {
229
+ const { updateMode } = await resolveFromContext(ctx);
230
+ const entry2 = { value: updateMode.value, source: updateMode.source };
231
+ return { data: { key, ...entry2 }, humanLines: [formatLine(key, entry2)] };
232
+ }
233
+ if (isRouterKey(key)) {
234
+ const entry2 = renderRouterSetting(key, await resolveRouterFromContext(ctx));
235
+ return { data: { key, ...entry2 }, humanLines: [formatLine(key, entry2)] };
236
+ }
237
+ if (isExperimentalKey(key)) {
238
+ const { experimentalBazaar } = await resolveFromContext(ctx);
239
+ const entry2 = {
240
+ value: experimentalBazaar.value,
241
+ source: experimentalBazaar.source
242
+ };
243
+ return { data: { key, ...entry2 }, humanLines: [formatLine(key, entry2)] };
244
+ }
245
+ const configKey = assertKey(key);
246
+ const settings = await resolveFromContext(ctx);
247
+ const entry = renderSetting(configKey, settings[configKey].value, settings[configKey].source);
248
+ return { data: { key: configKey, ...entry }, humanLines: [formatLine(configKey, entry)] };
249
+ }
250
+ async function runConfigSet({
251
+ key,
252
+ value,
253
+ project,
254
+ local
255
+ }, ctx) {
256
+ if (local === true && project !== true) {
257
+ throw new CliError("USAGE", "--local names the personal project file, so it needs --project", {
258
+ fix: `Run \`tenjin config set --project --local ${key} ${value}\`.`
259
+ });
260
+ }
261
+ if (key === "router.improve") {
262
+ if (project === true) {
263
+ throw new CliError("USAGE", "router.improve is not a project key", {
264
+ fix: "It is your own choice for this machine: drop --project to set it."
265
+ });
266
+ }
267
+ return setImprove(value, ctx);
268
+ }
269
+ if (isProjectRouterKey(key)) {
270
+ return setRouterKey(key, value, ctx, project === true ? { local: local === true } : void 0);
271
+ }
272
+ if (project === true) {
273
+ throw new CliError("USAGE", `${key} is not a project key`, {
274
+ fix: `--project applies to ${PROJECT_ROUTER_KEYS.join(" and ")} only; drop it to set ${key} for this machine.`
275
+ });
276
+ }
277
+ if (isUpdateKey(key)) return setUpdateKey(key, value, ctx);
278
+ if (isExperimentalKey(key)) return setExperimentalKey(key, value, ctx);
279
+ const configKey = assertKey(key);
280
+ const stored = parseValue(configKey, value);
281
+ await persist(ctx.dataDir, (existing) => ({ ...existing, [configKey]: stored }));
282
+ const entry = renderSetting(configKey, stored, "file");
283
+ return { data: { key: configKey, ...entry }, humanLines: [formatLine(configKey, entry)] };
284
+ }
285
+ async function setUpdateKey(key, value, ctx) {
286
+ const parsed = parseUpdateModeFlag(value, key);
287
+ await persist(ctx.dataDir, (existing) => ({
288
+ ...existing,
289
+ update: { ...existing.update, mode: parsed }
290
+ }));
291
+ const entry = { value: parsed, source: "file" };
292
+ return { data: { key, ...entry }, humanLines: [formatLine(key, entry)] };
293
+ }
294
+ async function setExperimentalKey(key, value, ctx) {
295
+ const parsed = parseOnOffFlag(value, key);
296
+ await persist(ctx.dataDir, (existing) => ({
297
+ ...existing,
298
+ experimental: { ...existing.experimental, bazaar: parsed }
299
+ }));
300
+ const entry = { value: parsed, source: "file" };
301
+ const warning = parsed === "on" ? EXPERIMENTAL_BAZAAR_WARNING : void 0;
302
+ return {
303
+ data: { key, ...entry, ...warning !== void 0 ? { warning } : {} },
304
+ humanLines: [formatLine(key, entry), ...warning !== void 0 ? [warning] : []]
305
+ };
306
+ }
307
+ var PROJECT_ROUTER_KEYS = [
308
+ "router.enabled",
309
+ "router.context",
310
+ "router.subagents"
311
+ ];
312
+ function isProjectRouterKey(key) {
313
+ return PROJECT_ROUTER_KEYS.includes(key);
314
+ }
315
+ async function setImprove(value, ctx) {
316
+ const key = "router.improve";
317
+ const parsed = parseBoolean(value);
318
+ let before;
319
+ await persist(ctx.dataDir, (existing) => {
320
+ before = existing.router?.improve;
321
+ return { ...existing, router: { ...existing.router, improve: parsed } };
322
+ });
323
+ const written = { value: parsed, source: "file", path: configPath(ctx.dataDir) };
324
+ if (parsed) {
325
+ return {
326
+ data: { key, ...written, note: IMPROVE_ON_NOTE },
327
+ humanLines: [formatLine(key, written), IMPROVE_ON_NOTE]
328
+ };
329
+ }
330
+ if (before === void 0)
331
+ return { data: { key, ...written }, humanLines: [formatLine(key, written)] };
332
+ const { requestForget } = await import("./decision-QSKHOGCO.js");
333
+ const { baseUrl } = await resolveFromContext(ctx);
334
+ const forget = await requestForget({ baseUrl: baseUrl.value });
335
+ const said = forget.ok ? "Tenjin was asked to delete the turns it kept for this machine." : `Tenjin could not be asked to delete the turns it kept (${forget.reason}); run \`tenjin config set router.improve false\` again to retry.`;
336
+ return {
337
+ data: { key, ...written, forget: forget.ok ? "sent" : "failed", note: said },
338
+ humanLines: [formatLine(key, written), forget.ok ? said : style("yellow", said)]
339
+ };
340
+ }
341
+ async function setRouterKey(key, value, ctx, project) {
342
+ const field = key === "router.enabled" ? "enabled" : key === "router.subagents" ? "subagents" : "context";
343
+ const parsed = field !== "context" ? parseBoolean(value) : parseRouterContext(value);
344
+ let written;
345
+ if (project === void 0) {
346
+ await persist(ctx.dataDir, (existing) => ({
347
+ ...existing,
348
+ router: { ...existing.router, [field]: parsed }
349
+ }));
350
+ written = { value: parsed, source: "file", path: configPath(ctx.dataDir) };
351
+ } else {
352
+ const path = await projectRouterPath({ cwd: process.cwd(), local: project.local });
353
+ await persistProjectRouter(path, field, parsed);
354
+ written = { value: parsed, source: project.local ? "local" : "project", path };
355
+ }
356
+ const effective = renderRouterSetting(key, await resolveRouterFromContext(ctx));
357
+ const humanLines = [formatLine(key, written)];
358
+ if (effective.value !== written.value) {
359
+ humanLines.push(
360
+ `Still ${String(effective.value)} here: ${effective.path ?? "the default"} is tighter, and a nearer file can only tighten an outer one.`
361
+ );
362
+ }
363
+ if (project?.local === true) {
364
+ humanLines.push("Keep .tenjin/config.local.json out of git: add it to .gitignore.");
365
+ }
366
+ return { data: { key, ...written, effective }, humanLines };
367
+ }
368
+ function parseRouterContext(value) {
369
+ const found = ROUTER_CONTEXTS.find((context) => context === value);
370
+ if (found !== void 0) return found;
371
+ throw new CliError("USAGE", `Invalid router.context: ${JSON.stringify(value)}`, {
372
+ fix: 'Use "session" or "turn".'
373
+ });
374
+ }
375
+ async function persistProjectRouter(path, field, value) {
376
+ await mkdir(dirname(path), { recursive: true, mode: 493 });
377
+ const lockPath = `${path}.lock`;
378
+ try {
379
+ await withFileLock(lockPath, () => mergeProjectRouter(path, field, value));
380
+ } catch (err) {
381
+ if (err instanceof LockTimeoutError) {
382
+ throw new CliError("INTERNAL", err.message, {
383
+ fix: `If no other tenjin process is running, remove ${lockPath} and retry.`,
384
+ cause: err
385
+ });
386
+ }
387
+ throw err;
388
+ }
389
+ }
390
+ async function mergeProjectRouter(path, field, value) {
391
+ const existing = await readProjectRouterFile(path);
392
+ const block = existing?.json.router;
393
+ const next = {
394
+ ...existing?.json ?? {},
395
+ router: { ...block !== void 0 ? block : {}, [field]: value }
396
+ };
397
+ await writeFileAtomic(path, `${JSON.stringify(next, null, 2)}
398
+ `, {
399
+ mode: 420,
400
+ dirMode: 493
401
+ });
402
+ }
403
+ async function persistRouterProject(dir, projectDir, present = true) {
404
+ await persist(dir, (existing) => {
405
+ const known = new Set(existing.install?.routerProjects ?? []);
406
+ if (present) known.add(projectDir);
407
+ else known.delete(projectDir);
408
+ return { ...existing, install: { ...existing.install, routerProjects: [...known].sort() } };
409
+ });
410
+ }
411
+ async function persistRouterDefaults(dir, refresh = false, limits = ROUTER_DEFAULTS, chosen = []) {
412
+ const result = { set: [], kept: [], removed: [] };
413
+ if (refresh && retiredPaymentKeys(await loadRawConfig(dir)).length === 0) return result;
414
+ await persist(dir, (existing) => {
415
+ const next = { ...existing };
416
+ result.removed = retiredPaymentKeys(existing);
417
+ for (const key of result.removed) delete next[key];
418
+ if (refresh) return next;
419
+ for (const key of Object.keys(ROUTER_DEFAULTS)) {
420
+ const value = limits[key];
421
+ if (existing[key] !== void 0 && !chosen.includes(key)) result.kept.push(key);
422
+ else if (value !== void 0) {
423
+ next[key] = value;
424
+ result.set.push(key);
425
+ }
426
+ }
427
+ return next;
428
+ });
429
+ return result;
430
+ }
431
+ async function resolveFromContext(ctx) {
432
+ const config = await loadRawConfig(ctx.dataDir);
433
+ return resolveSettings({ config, flags: { baseUrl: ctx.flags.baseUrl }, env: process.env });
434
+ }
435
+ function assertKey(key) {
436
+ if (key === "bazaarPay" || key === "confirm") {
437
+ throw new CliError("USAGE", `Retired config key: ${key}`, { fix: RETIRED_PAYMENT_GUIDANCE });
438
+ }
439
+ if (CONFIG_KEYS.includes(key)) return key;
440
+ if (PERSONAL_ROUTER_KEYS.includes(key)) {
441
+ throw new CliError("USAGE", `${key} changes only through its own operations`, {
442
+ fix: "`tenjin config` shows it; `tenjin config --help` lists the operations that change it."
443
+ });
444
+ }
445
+ const keys = [
446
+ ...CONFIG_KEYS,
447
+ ...UPDATE_CONFIG_KEYS,
448
+ ...ROUTER_CONFIG_KEYS,
449
+ ...EXPERIMENTAL_CONFIG_KEYS
450
+ ];
451
+ const near = closestNames(
452
+ keys.map((name) => ({ id: name, label: name })),
453
+ key
454
+ ).map(({ id }) => id);
455
+ throw new CliError("USAGE", `Unknown config key: ${JSON.stringify(key)}`, {
456
+ fix: `${near.length > 0 ? `Did you mean: ${near.join(", ")}? ` : ""}Valid keys: ${keys.join(", ")}.`
457
+ });
458
+ }
459
+ function renderSetting(key, stored, source) {
460
+ return {
461
+ ...renderValue(key, stored),
462
+ source,
463
+ ...["maxAutoSpend", "sessionBudget", "sendMaxAmount"].includes(key) ? { description: KEY_DESCRIPTIONS[key] } : {}
464
+ };
465
+ }
466
+ function renderValue(key, stored) {
467
+ if (Array.isArray(stored) || typeof stored === "boolean") return { value: stored };
468
+ if (key === "sessionBudget" && stored === "none") return { value: null };
469
+ if (key === "maxAutoSpend" || key === "sessionBudget") return { value: toMoney(stored) };
470
+ if (key === "sendMaxAmount") {
471
+ return { value: stored === "none" || stored === SEND_MAX_UNSET ? stored : toMoney(stored) };
472
+ }
473
+ return { value: stored };
474
+ }
475
+ function parseValue(key, value) {
476
+ switch (key) {
477
+ case "sessionBudget":
478
+ return value === "none" ? "none" : parseUsdToAtomic(value);
479
+ case "maxAutoSpend":
480
+ return parseUsdToAtomic(value);
481
+ case "sendMaxAmount":
482
+ return value === "none" ? "none" : parseUsdToAtomic(value);
483
+ case "allowlistCreators":
484
+ return parseAllowlist(value);
485
+ case "baseUrl":
486
+ case "rpcUrl":
487
+ return parseHttpUrl(value);
488
+ case "bazaarRegistries":
489
+ return parseRegistryList(value);
490
+ }
491
+ }
492
+ function parseRegistryList(value) {
493
+ return value.split(",").map((entry) => entry.trim()).filter((entry) => entry.length > 0).map((entry) => parseHttpUrl(entry));
494
+ }
495
+ function parseBoolean(value) {
496
+ if (value === "true" || value === "on") return true;
497
+ if (value === "false" || value === "off") return false;
498
+ throw new CliError("USAGE", `Invalid boolean value: ${JSON.stringify(value)}`, {
499
+ fix: 'Use "on" or "off" (or "true"/"false").'
500
+ });
501
+ }
502
+ function parseAllowlist(value) {
503
+ const entries = value.split(",").map((entry) => entry.trim()).filter((entry) => entry.length > 0);
504
+ for (const entry of entries) {
505
+ if (/\s/.test(entry)) {
506
+ throw new CliError("USAGE", `Invalid creator entry: ${JSON.stringify(entry)}`, {
507
+ fix: "Creator entries cannot contain spaces; separate multiple with commas."
508
+ });
509
+ }
510
+ }
511
+ return entries;
512
+ }
513
+ function parseHttpUrl(value) {
514
+ let url;
515
+ try {
516
+ url = new URL(value);
517
+ } catch {
518
+ throw new CliError("USAGE", `Invalid URL: ${JSON.stringify(value)}`, {
519
+ fix: `Pass an absolute http(s) URL like ${PRODUCTION_ORIGIN}.`
520
+ });
521
+ }
522
+ if (url.protocol !== "http:" && url.protocol !== "https:") {
523
+ throw new CliError("USAGE", `URL must be http or https: ${JSON.stringify(value)}`, {
524
+ fix: `Pass an absolute http(s) URL like ${PRODUCTION_ORIGIN}.`
525
+ });
526
+ }
527
+ return value;
528
+ }
529
+ async function persist(dir, merge, lock) {
530
+ await mkdir(dir, { recursive: true, mode: 448 });
531
+ const lockPath = `${configPath(dir)}.lock`;
532
+ try {
533
+ await withFileLock(
534
+ lockPath,
535
+ async () => {
536
+ const existing = await loadRawConfig(dir);
537
+ const merged = merge(existing);
538
+ if (merged === existing) return;
539
+ const validated = RawConfigSchema.parse(merged);
540
+ await writeFileAtomic(configPath(dir), `${JSON.stringify(validated, null, 2)}
541
+ `, {
542
+ mode: 384,
543
+ dirMode: 448
544
+ });
545
+ },
546
+ lock
547
+ );
548
+ } catch (err) {
549
+ if (err instanceof LockTimeoutError) {
550
+ throw new CliError("INTERNAL", err.message, {
551
+ fix: `If no other tenjin process is running, remove ${lockPath} and retry.`,
552
+ cause: err
553
+ });
554
+ }
555
+ throw err;
556
+ }
557
+ }
558
+ function formatLine(key, entry) {
559
+ const label = key.padEnd(KEY_WIDTH);
560
+ const where = entry.path !== void 0 && (entry.source === "project" || entry.source === "local") ? ` ${entry.path}` : "";
561
+ return ` ${label} ${displayValue(entry)} ${style("dim", `(${entry.source}${where})`)}`;
562
+ }
563
+ function describedLine(key, entry) {
564
+ const description = KEY_DESCRIPTIONS[key];
565
+ const line = formatLine(key, entry);
566
+ return description !== void 0 ? `${line} ${style("dim", `- ${description}`)}` : line;
567
+ }
568
+ function displayValue(entry) {
569
+ const { value } = entry;
570
+ if (Array.isArray(value)) return value.length > 0 ? value.join(", ") : "(empty)";
571
+ if (typeof value === "boolean") return value ? "true" : "false";
572
+ if (value === null) return "none (no limit)";
573
+ if (typeof value === "object") return `${value.usd} USD`;
574
+ return value;
575
+ }
576
+
577
+ export {
578
+ EXPERIMENTAL_BAZAAR_WARNING,
579
+ IMPROVE_ON_NOTE,
580
+ runConfigList,
581
+ runConfigGet,
582
+ runConfigSet,
583
+ persistRouterProject,
584
+ persistRouterDefaults,
585
+ resolveFromContext,
586
+ persist
587
+ };
588
+ //# sourceMappingURL=chunk-W74LJ5OT.js.map