tenjin-cli 0.1.0-alpha.3 → 0.1.0-alpha.31

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 (284) hide show
  1. package/NOTICE.md +54 -7
  2. package/README.md +100 -266
  3. package/dist/{_esm-FEASBWRP.js → _esm-MEXZI5DL.js} +9 -10
  4. package/dist/alive-J64H46HI.js +31 -0
  5. package/dist/{ccip-NQXCEK2U.js → ccip-7RMRLAGV.js} +4 -4
  6. package/dist/{ccip-XR5NE5QK.js → ccip-NLCSCHKI.js} +5 -5
  7. package/dist/chunk-27EPWVOY.js +108 -0
  8. package/dist/chunk-27EPWVOY.js.map +1 -0
  9. package/dist/chunk-2SNUOHAT.js +75 -0
  10. package/dist/chunk-2SNUOHAT.js.map +1 -0
  11. package/dist/{chunk-Z6MFJV5Z.js → chunk-2XLC3AEX.js} +857 -504
  12. package/dist/chunk-2XLC3AEX.js.map +1 -0
  13. package/dist/chunk-3623BLPV.js +184 -0
  14. package/dist/chunk-3623BLPV.js.map +1 -0
  15. package/dist/chunk-3UCIG4TG.js +65 -0
  16. package/dist/chunk-3UCIG4TG.js.map +1 -0
  17. package/dist/chunk-4ZZO6ULA.js +151 -0
  18. package/dist/chunk-4ZZO6ULA.js.map +1 -0
  19. package/dist/chunk-5C32RLTA.js +115 -0
  20. package/dist/chunk-5C32RLTA.js.map +1 -0
  21. package/dist/{chunk-ZMHYXMO6.js → chunk-5IEP5EGE.js} +3 -3
  22. package/dist/chunk-5K5W4S66.js +105 -0
  23. package/dist/chunk-5K5W4S66.js.map +1 -0
  24. package/dist/chunk-5MARFNSB.js +2018 -0
  25. package/dist/chunk-5MARFNSB.js.map +1 -0
  26. package/dist/{chunk-CYOF7ROH.js → chunk-6E5R45ZO.js} +3 -3
  27. package/dist/chunk-77TCKDEC.js +1987 -0
  28. package/dist/chunk-77TCKDEC.js.map +1 -0
  29. package/dist/chunk-7EKYXMUO.js +7536 -0
  30. package/dist/chunk-7EKYXMUO.js.map +1 -0
  31. package/dist/chunk-7Q5FDF65.js +159 -0
  32. package/dist/chunk-7Q5FDF65.js.map +1 -0
  33. package/dist/chunk-7QKHZQKW.js +1680 -0
  34. package/dist/chunk-7QKHZQKW.js.map +1 -0
  35. package/dist/{chunk-MUBUQVC3.js → chunk-7WEQQJLG.js} +6 -5
  36. package/dist/{chunk-MUBUQVC3.js.map → chunk-7WEQQJLG.js.map} +1 -1
  37. package/dist/chunk-7WU4OPLP.js +244 -0
  38. package/dist/chunk-7WU4OPLP.js.map +1 -0
  39. package/dist/chunk-7ZRL2LBQ.js +192 -0
  40. package/dist/chunk-7ZRL2LBQ.js.map +1 -0
  41. package/dist/chunk-A36LQPHV.js +29 -0
  42. package/dist/chunk-A36LQPHV.js.map +1 -0
  43. package/dist/chunk-AGZ7PJKY.js +326 -0
  44. package/dist/chunk-AGZ7PJKY.js.map +1 -0
  45. package/dist/chunk-AKWGE6JQ.js +49 -0
  46. package/dist/chunk-AKWGE6JQ.js.map +1 -0
  47. package/dist/chunk-B7HUUJOK.js +29 -0
  48. package/dist/chunk-B7HUUJOK.js.map +1 -0
  49. package/dist/{chunk-S3IGX57D.js → chunk-BL3332HQ.js} +290 -7361
  50. package/dist/chunk-BL3332HQ.js.map +1 -0
  51. package/dist/{chunk-5CLSD5YN.js → chunk-BPMWXTFX.js} +2 -2
  52. package/dist/chunk-D65GNPS3.js +12708 -0
  53. package/dist/chunk-D65GNPS3.js.map +1 -0
  54. package/dist/chunk-DOQGNFHM.js +121 -0
  55. package/dist/chunk-DOQGNFHM.js.map +1 -0
  56. package/dist/{chunk-YALGASEU.js → chunk-EGELTSPU.js} +2 -2
  57. package/dist/chunk-FW75G2W4.js +406 -0
  58. package/dist/chunk-FW75G2W4.js.map +1 -0
  59. package/dist/chunk-GA7JETVM.js +150 -0
  60. package/dist/chunk-GA7JETVM.js.map +1 -0
  61. package/dist/chunk-I3EQFHCD.js +175 -0
  62. package/dist/chunk-I3EQFHCD.js.map +1 -0
  63. package/dist/chunk-JKKAIPTU.js +108 -0
  64. package/dist/chunk-JKKAIPTU.js.map +1 -0
  65. package/dist/{chunk-QVX5MWJZ.js → chunk-JRGFKVAZ.js} +2 -2
  66. package/dist/{chunk-NCE5NSN6.js → chunk-K3I7C2MO.js} +142 -12
  67. package/dist/chunk-K3I7C2MO.js.map +1 -0
  68. package/dist/chunk-K72RURN3.js +239 -0
  69. package/dist/chunk-K72RURN3.js.map +1 -0
  70. package/dist/{chunk-HIVZG55D.js → chunk-KG3D7FIF.js} +2 -2
  71. package/dist/chunk-KOGZDMHO.js +21 -0
  72. package/dist/chunk-KOGZDMHO.js.map +1 -0
  73. package/dist/chunk-KXQ4UIP7.js +228 -0
  74. package/dist/chunk-KXQ4UIP7.js.map +1 -0
  75. package/dist/chunk-KXVP2VKA.js +194 -0
  76. package/dist/chunk-KXVP2VKA.js.map +1 -0
  77. package/dist/chunk-LEFIX6RS.js +100 -0
  78. package/dist/chunk-LEFIX6RS.js.map +1 -0
  79. package/dist/chunk-LHHMV4GU.js +27 -0
  80. package/dist/chunk-LHHMV4GU.js.map +1 -0
  81. package/dist/{chunk-YBMMV4Y4.js → chunk-MEFB5KHA.js} +13 -5
  82. package/dist/chunk-MEFB5KHA.js.map +1 -0
  83. package/dist/chunk-MNXS2U45.js +1768 -0
  84. package/dist/chunk-MNXS2U45.js.map +1 -0
  85. package/dist/{chunk-UGX7YPX2.js → chunk-NEFNKLBE.js} +9 -11
  86. package/dist/{chunk-UGX7YPX2.js.map → chunk-NEFNKLBE.js.map} +1 -1
  87. package/dist/chunk-OHRR5OYM.js +63 -0
  88. package/dist/chunk-OHRR5OYM.js.map +1 -0
  89. package/dist/chunk-ORWL5BSN.js +269 -0
  90. package/dist/chunk-ORWL5BSN.js.map +1 -0
  91. package/dist/chunk-P4NH7OUK.js +398 -0
  92. package/dist/chunk-P4NH7OUK.js.map +1 -0
  93. package/dist/{chunk-ZABPQJ3M.js → chunk-POUWHWID.js} +2 -2
  94. package/dist/chunk-QSCPK4F5.js +145 -0
  95. package/dist/chunk-QSCPK4F5.js.map +1 -0
  96. package/dist/chunk-QXP3Z3JN.js +131 -0
  97. package/dist/chunk-QXP3Z3JN.js.map +1 -0
  98. package/dist/{chunk-XJIW7USF.js → chunk-R5LCN54M.js} +118 -9
  99. package/dist/chunk-R5LCN54M.js.map +1 -0
  100. package/dist/chunk-S4SAZ7OD.js +30 -0
  101. package/dist/chunk-S4SAZ7OD.js.map +1 -0
  102. package/dist/chunk-SJLTEINJ.js +117 -0
  103. package/dist/chunk-SJLTEINJ.js.map +1 -0
  104. package/dist/{chunk-RRN3YTK7.js → chunk-TTNESUPQ.js} +3 -3
  105. package/dist/chunk-UKY4CHNC.js +498 -0
  106. package/dist/chunk-UKY4CHNC.js.map +1 -0
  107. package/dist/chunk-UQUOVWBG.js +114 -0
  108. package/dist/chunk-UQUOVWBG.js.map +1 -0
  109. package/dist/chunk-V6BSF6OC.js +260 -0
  110. package/dist/chunk-V6BSF6OC.js.map +1 -0
  111. package/dist/chunk-WJXLQXJY.js +43 -0
  112. package/dist/chunk-WJXLQXJY.js.map +1 -0
  113. package/dist/chunk-WK7F3B2E.js +114 -0
  114. package/dist/chunk-WK7F3B2E.js.map +1 -0
  115. package/dist/chunk-XKESD27X.js +10 -0
  116. package/dist/chunk-XKESD27X.js.map +1 -0
  117. package/dist/chunk-XQJXNMSB.js +23 -0
  118. package/dist/chunk-XQJXNMSB.js.map +1 -0
  119. package/dist/{chunk-HSDCI7OV.js → chunk-XZKD7DIF.js} +3 -3
  120. package/dist/chunk-Y527D4TV.js +56 -0
  121. package/dist/chunk-Y527D4TV.js.map +1 -0
  122. package/dist/chunk-YFPY4ONH.js +127 -0
  123. package/dist/chunk-YFPY4ONH.js.map +1 -0
  124. package/dist/{chunk-OYMYCW7J.js → chunk-YVFXE7RR.js} +606 -97
  125. package/dist/chunk-YVFXE7RR.js.map +1 -0
  126. package/dist/clack-EZ7TDWQU.js +19 -0
  127. package/dist/claude-cli-2YKABJJZ.js +31 -0
  128. package/dist/{cli-SBXI5AMS.js → cli-D5OE3URZ.js} +458 -218
  129. package/dist/cli-D5OE3URZ.js.map +1 -0
  130. package/dist/codex-event-PPNVRRDH.js +16 -0
  131. package/dist/codex-host-2RJOJW2B.js +28 -0
  132. package/dist/codex-install-UUZ6QMBQ.js +221 -0
  133. package/dist/codex-install-UUZ6QMBQ.js.map +1 -0
  134. package/dist/config-ZD4OB2DO.js +51 -0
  135. package/dist/dist-3LOO6M4U.js +2842 -0
  136. package/dist/dist-3LOO6M4U.js.map +1 -0
  137. package/dist/doctor-KBR34Q4B.js +601 -0
  138. package/dist/doctor-KBR34Q4B.js.map +1 -0
  139. package/dist/env-proxy-XL4P73MZ.js +15 -0
  140. package/dist/{ethersCompat-Df4a6QIZ-3YZIAXDK.js → ethersCompat-Df4a6QIZ-THAVUGIJ.js} +5 -5
  141. package/dist/ethersCompat-Df4a6QIZ-THAVUGIJ.js.map +1 -0
  142. package/dist/fund-5ITKQGYF.js +372 -0
  143. package/dist/fund-5ITKQGYF.js.map +1 -0
  144. package/dist/hook-command-4TYCHHRL.js +39 -0
  145. package/dist/hook-command-4TYCHHRL.js.map +1 -0
  146. package/dist/hosts/claude/.claude-plugin/marketplace.json +19 -0
  147. package/dist/hosts/claude/tenjin/.claude-plugin/plugin.json +15 -0
  148. package/dist/hosts/claude/tenjin/.mcp.json +12 -0
  149. package/dist/hosts/claude/tenjin/hooks/hooks.json +224 -0
  150. package/dist/hosts/claude/tenjin/hooks/register.tsx +589 -0
  151. package/dist/hosts/claude/tenjin/types/index.d.ts +41 -0
  152. package/dist/hosts/codex/.agents/plugins/marketplace.json +20 -0
  153. package/dist/hosts/codex/tenjin/.codex-plugin/plugin.json +16 -0
  154. package/dist/hosts/codex/tenjin/.mcp.json +12 -0
  155. package/dist/hosts/codex/tenjin/hooks/hooks.json +52 -0
  156. package/dist/hosts-FWZOV26H.js +216 -0
  157. package/dist/hosts-FWZOV26H.js.map +1 -0
  158. package/dist/index.js +21 -2
  159. package/dist/index.js.map +1 -1
  160. package/dist/install-XWGE4Q7L.js +77 -0
  161. package/dist/install-XWGE4Q7L.js.map +1 -0
  162. package/dist/install-identity-K7EJIQFP.js +30 -0
  163. package/dist/install-identity-K7EJIQFP.js.map +1 -0
  164. package/dist/install-wallet-XQ6XFZV4.js +117 -0
  165. package/dist/install-wallet-XQ6XFZV4.js.map +1 -0
  166. package/dist/mcp-3LIJSSJB.js +13553 -0
  167. package/dist/mcp-3LIJSSJB.js.map +1 -0
  168. package/dist/package-ZKQFDWLE.js +37 -0
  169. package/dist/package-ZKQFDWLE.js.map +1 -0
  170. package/dist/paths-POPTXJO6.js +61 -0
  171. package/dist/paths-POPTXJO6.js.map +1 -0
  172. package/dist/pay-WHBERZ3W.js +55 -0
  173. package/dist/pay-WHBERZ3W.js.map +1 -0
  174. package/dist/payments-KVICEKD2.js +110 -0
  175. package/dist/payments-KVICEKD2.js.map +1 -0
  176. package/dist/plugin-registration-5TIA564H.js +54 -0
  177. package/dist/plugin-registration-5TIA564H.js.map +1 -0
  178. package/dist/redact-6W23GGJC.js +15 -0
  179. package/dist/redact-6W23GGJC.js.map +1 -0
  180. package/dist/{secp256k1-N3ZHU7LB.js → secp256k1-ZZZT2CAX.js} +3 -3
  181. package/dist/secp256k1-ZZZT2CAX.js.map +1 -0
  182. package/dist/send-7G7Y7DLN.js +228 -0
  183. package/dist/send-7G7Y7DLN.js.map +1 -0
  184. package/dist/status-OF7RH5HM.js +120 -0
  185. package/dist/status-OF7RH5HM.js.map +1 -0
  186. package/dist/status-line-XOUE6MPL.js +90 -0
  187. package/dist/status-line-XOUE6MPL.js.map +1 -0
  188. package/dist/uninstall-JXUAFNDB.js +158 -0
  189. package/dist/uninstall-JXUAFNDB.js.map +1 -0
  190. package/dist/update-ZKUERSO2.js +44 -0
  191. package/dist/update-ZKUERSO2.js.map +1 -0
  192. package/dist/usdc-OGOGEHV2.js +40 -0
  193. package/dist/usdc-OGOGEHV2.js.map +1 -0
  194. package/dist/{viemAdapter-By13KInL-ZZE6UV4Y.js → viemAdapter-By13KInL-S3DA7DFW.js} +5 -5
  195. package/dist/viemAdapter-By13KInL-S3DA7DFW.js.map +1 -0
  196. package/dist/wallet-2HA6W4R4.js +43 -0
  197. package/dist/wallet-2HA6W4R4.js.map +1 -0
  198. package/dist/wallet-kdf-worker.mjs +980 -0
  199. package/docs/agent-permissions.md +196 -0
  200. package/docs/safety-model.md +59 -0
  201. package/docs/troubleshooting.md +13 -0
  202. package/package.json +28 -19
  203. package/LICENSE +0 -21
  204. package/dist/buy-EE6SEXP6.js +0 -1598
  205. package/dist/buy-EE6SEXP6.js.map +0 -1
  206. package/dist/candidate-ERMSYYQZ.js +0 -127
  207. package/dist/candidate-ERMSYYQZ.js.map +0 -1
  208. package/dist/chunk-3OV7E5G5.js +0 -18
  209. package/dist/chunk-3OV7E5G5.js.map +0 -1
  210. package/dist/chunk-4ONXEEQL.js +0 -152
  211. package/dist/chunk-4ONXEEQL.js.map +0 -1
  212. package/dist/chunk-662MSGZB.js +0 -286
  213. package/dist/chunk-662MSGZB.js.map +0 -1
  214. package/dist/chunk-7KUW4MJD.js +0 -59
  215. package/dist/chunk-7KUW4MJD.js.map +0 -1
  216. package/dist/chunk-AWPAWHNX.js +0 -333
  217. package/dist/chunk-AWPAWHNX.js.map +0 -1
  218. package/dist/chunk-DXTQ3CSI.js +0 -171
  219. package/dist/chunk-DXTQ3CSI.js.map +0 -1
  220. package/dist/chunk-ESPNTPQ2.js +0 -207
  221. package/dist/chunk-ESPNTPQ2.js.map +0 -1
  222. package/dist/chunk-FJPLRISB.js +0 -79
  223. package/dist/chunk-FJPLRISB.js.map +0 -1
  224. package/dist/chunk-GO75V3NZ.js +0 -160
  225. package/dist/chunk-GO75V3NZ.js.map +0 -1
  226. package/dist/chunk-JPHG2JW3.js +0 -96
  227. package/dist/chunk-JPHG2JW3.js.map +0 -1
  228. package/dist/chunk-NCE5NSN6.js.map +0 -1
  229. package/dist/chunk-OYMYCW7J.js.map +0 -1
  230. package/dist/chunk-RY4XKNV3.js +0 -140
  231. package/dist/chunk-RY4XKNV3.js.map +0 -1
  232. package/dist/chunk-S3IGX57D.js.map +0 -1
  233. package/dist/chunk-TLCMMYLY.js +0 -126
  234. package/dist/chunk-TLCMMYLY.js.map +0 -1
  235. package/dist/chunk-UO22YNY4.js +0 -69
  236. package/dist/chunk-UO22YNY4.js.map +0 -1
  237. package/dist/chunk-XHC6FCGZ.js +0 -261
  238. package/dist/chunk-XHC6FCGZ.js.map +0 -1
  239. package/dist/chunk-XJIW7USF.js.map +0 -1
  240. package/dist/chunk-YBMMV4Y4.js.map +0 -1
  241. package/dist/chunk-YN5SHIXQ.js +0 -126
  242. package/dist/chunk-YN5SHIXQ.js.map +0 -1
  243. package/dist/chunk-Z52RA3NC.js +0 -137
  244. package/dist/chunk-Z52RA3NC.js.map +0 -1
  245. package/dist/chunk-Z6MFJV5Z.js.map +0 -1
  246. package/dist/cli-SBXI5AMS.js.map +0 -1
  247. package/dist/config-VELDKLHY.js +0 -21
  248. package/dist/doctor-T3KWNNP2.js +0 -20
  249. package/dist/inspect-LMKOXE4Y.js +0 -96
  250. package/dist/inspect-LMKOXE4Y.js.map +0 -1
  251. package/dist/install-LEX3ENQ6.js +0 -387
  252. package/dist/install-LEX3ENQ6.js.map +0 -1
  253. package/dist/lookup-ZPN2Q67N.js +0 -129
  254. package/dist/lookup-ZPN2Q67N.js.map +0 -1
  255. package/dist/outcome-N7TAK6WR.js +0 -66
  256. package/dist/outcome-N7TAK6WR.js.map +0 -1
  257. package/dist/publish-BKBQQAW4.js +0 -1478
  258. package/dist/publish-BKBQQAW4.js.map +0 -1
  259. package/dist/usdc-JIAJW4SV.js +0 -22
  260. package/dist/wallet-CWEMYVIH.js +0 -179
  261. package/dist/wallet-CWEMYVIH.js.map +0 -1
  262. package/dist/wallet-PA54CRBL.js +0 -30
  263. package/skills/tenjin/SKILL.md +0 -199
  264. package/skills/tenjin-publish/SKILL.md +0 -111
  265. package/skills/tenjin-search/SKILL.md +0 -133
  266. /package/dist/{_esm-FEASBWRP.js.map → _esm-MEXZI5DL.js.map} +0 -0
  267. /package/dist/{ccip-NQXCEK2U.js.map → alive-J64H46HI.js.map} +0 -0
  268. /package/dist/{ccip-XR5NE5QK.js.map → ccip-7RMRLAGV.js.map} +0 -0
  269. /package/dist/{config-VELDKLHY.js.map → ccip-NLCSCHKI.js.map} +0 -0
  270. /package/dist/{chunk-ZMHYXMO6.js.map → chunk-5IEP5EGE.js.map} +0 -0
  271. /package/dist/{chunk-CYOF7ROH.js.map → chunk-6E5R45ZO.js.map} +0 -0
  272. /package/dist/{chunk-5CLSD5YN.js.map → chunk-BPMWXTFX.js.map} +0 -0
  273. /package/dist/{chunk-YALGASEU.js.map → chunk-EGELTSPU.js.map} +0 -0
  274. /package/dist/{chunk-QVX5MWJZ.js.map → chunk-JRGFKVAZ.js.map} +0 -0
  275. /package/dist/{chunk-HIVZG55D.js.map → chunk-KG3D7FIF.js.map} +0 -0
  276. /package/dist/{chunk-ZABPQJ3M.js.map → chunk-POUWHWID.js.map} +0 -0
  277. /package/dist/{chunk-RRN3YTK7.js.map → chunk-TTNESUPQ.js.map} +0 -0
  278. /package/dist/{chunk-HSDCI7OV.js.map → chunk-XZKD7DIF.js.map} +0 -0
  279. /package/dist/{doctor-T3KWNNP2.js.map → clack-EZ7TDWQU.js.map} +0 -0
  280. /package/dist/{ethersCompat-Df4a6QIZ-3YZIAXDK.js.map → claude-cli-2YKABJJZ.js.map} +0 -0
  281. /package/dist/{secp256k1-N3ZHU7LB.js.map → codex-event-PPNVRRDH.js.map} +0 -0
  282. /package/dist/{usdc-JIAJW4SV.js.map → codex-host-2RJOJW2B.js.map} +0 -0
  283. /package/dist/{viemAdapter-By13KInL-ZZE6UV4Y.js.map → config-ZD4OB2DO.js.map} +0 -0
  284. /package/dist/{wallet-PA54CRBL.js.map → env-proxy-XL4P73MZ.js.map} +0 -0
@@ -1,4 +1,16 @@
1
1
  import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
+ import {
3
+ PRODUCTION_ORIGIN
4
+ } from "./chunk-XQJXNMSB.js";
5
+ import {
6
+ CliError
7
+ } from "./chunk-3UCIG4TG.js";
8
+ import {
9
+ DEFAULT_RPC_URL
10
+ } from "./chunk-27EPWVOY.js";
11
+ import {
12
+ configPath
13
+ } from "./chunk-SJLTEINJ.js";
2
14
  import {
3
15
  __export
4
16
  } from "./chunk-ZXTAQYNA.js";
@@ -509,7 +521,7 @@ __export(core_exports2, {
509
521
  parse: () => parse,
510
522
  parseAsync: () => parseAsync,
511
523
  prettifyError: () => prettifyError,
512
- process: () => process2,
524
+ process: () => process,
513
525
  regexes: () => regexes_exports,
514
526
  registry: () => registry,
515
527
  safeDecode: () => safeDecode,
@@ -11434,7 +11446,7 @@ function initializeContext(params) {
11434
11446
  external: params?.external ?? void 0
11435
11447
  };
11436
11448
  }
11437
- function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
11449
+ function process(schema, ctx, _params = { path: [], schemaPath: [] }) {
11438
11450
  var _a3;
11439
11451
  const def = schema._zod.def;
11440
11452
  const seen = ctx.seen.get(schema);
@@ -11471,7 +11483,7 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
11471
11483
  if (parent) {
11472
11484
  if (!result.ref)
11473
11485
  result.ref = parent;
11474
- process2(parent, ctx, params);
11486
+ process(parent, ctx, params);
11475
11487
  ctx.seen.get(parent).isParent = true;
11476
11488
  }
11477
11489
  }
@@ -11759,14 +11771,14 @@ function isTransforming(_schema, _ctx) {
11759
11771
  }
11760
11772
  var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
11761
11773
  const ctx = initializeContext({ ...params, processors });
11762
- process2(schema, ctx);
11774
+ process(schema, ctx);
11763
11775
  extractDefs(ctx, schema);
11764
11776
  return finalize(ctx, schema);
11765
11777
  };
11766
11778
  var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
11767
11779
  const { libraryOptions, target } = params ?? {};
11768
11780
  const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
11769
- process2(schema, ctx);
11781
+ process(schema, ctx);
11770
11782
  extractDefs(ctx, schema);
11771
11783
  return finalize(ctx, schema);
11772
11784
  };
@@ -12012,7 +12024,7 @@ var arrayProcessor = (schema, ctx, _json, params) => {
12012
12024
  if (typeof maximum === "number")
12013
12025
  json2.maxItems = maximum;
12014
12026
  json2.type = "array";
12015
- json2.items = process2(def.element, ctx, {
12027
+ json2.items = process(def.element, ctx, {
12016
12028
  ...params,
12017
12029
  path: [...params.path, "items"]
12018
12030
  });
@@ -12024,7 +12036,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
12024
12036
  json2.properties = {};
12025
12037
  const shape = def.shape;
12026
12038
  for (const key in shape) {
12027
- json2.properties[key] = process2(shape[key], ctx, {
12039
+ json2.properties[key] = process(shape[key], ctx, {
12028
12040
  ...params,
12029
12041
  path: [...params.path, "properties", key]
12030
12042
  });
@@ -12047,7 +12059,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
12047
12059
  if (ctx.io === "output")
12048
12060
  json2.additionalProperties = false;
12049
12061
  } else if (def.catchall) {
12050
- json2.additionalProperties = process2(def.catchall, ctx, {
12062
+ json2.additionalProperties = process(def.catchall, ctx, {
12051
12063
  ...params,
12052
12064
  path: [...params.path, "additionalProperties"]
12053
12065
  });
@@ -12056,7 +12068,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
12056
12068
  var unionProcessor = (schema, ctx, json2, params) => {
12057
12069
  const def = schema._zod.def;
12058
12070
  const isExclusive = def.inclusive === false;
12059
- const options = def.options.map((x, i) => process2(x, ctx, {
12071
+ const options = def.options.map((x, i) => process(x, ctx, {
12060
12072
  ...params,
12061
12073
  path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
12062
12074
  }));
@@ -12068,11 +12080,11 @@ var unionProcessor = (schema, ctx, json2, params) => {
12068
12080
  };
12069
12081
  var intersectionProcessor = (schema, ctx, json2, params) => {
12070
12082
  const def = schema._zod.def;
12071
- const a = process2(def.left, ctx, {
12083
+ const a = process(def.left, ctx, {
12072
12084
  ...params,
12073
12085
  path: [...params.path, "allOf", 0]
12074
12086
  });
12075
- const b = process2(def.right, ctx, {
12087
+ const b = process(def.right, ctx, {
12076
12088
  ...params,
12077
12089
  path: [...params.path, "allOf", 1]
12078
12090
  });
@@ -12089,11 +12101,11 @@ var tupleProcessor = (schema, ctx, _json, params) => {
12089
12101
  json2.type = "array";
12090
12102
  const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
12091
12103
  const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
12092
- const prefixItems = def.items.map((x, i) => process2(x, ctx, {
12104
+ const prefixItems = def.items.map((x, i) => process(x, ctx, {
12093
12105
  ...params,
12094
12106
  path: [...params.path, prefixPath, i]
12095
12107
  }));
12096
- const rest = def.rest ? process2(def.rest, ctx, {
12108
+ const rest = def.rest ? process(def.rest, ctx, {
12097
12109
  ...params,
12098
12110
  path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
12099
12111
  }) : null;
@@ -12133,7 +12145,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
12133
12145
  const keyBag = keyType._zod.bag;
12134
12146
  const patterns = keyBag?.patterns;
12135
12147
  if (def.mode === "loose" && patterns && patterns.size > 0) {
12136
- const valueSchema = process2(def.valueType, ctx, {
12148
+ const valueSchema = process(def.valueType, ctx, {
12137
12149
  ...params,
12138
12150
  path: [...params.path, "patternProperties", "*"]
12139
12151
  });
@@ -12143,12 +12155,12 @@ var recordProcessor = (schema, ctx, _json, params) => {
12143
12155
  }
12144
12156
  } else {
12145
12157
  if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
12146
- json2.propertyNames = process2(def.keyType, ctx, {
12158
+ json2.propertyNames = process(def.keyType, ctx, {
12147
12159
  ...params,
12148
12160
  path: [...params.path, "propertyNames"]
12149
12161
  });
12150
12162
  }
12151
- json2.additionalProperties = process2(def.valueType, ctx, {
12163
+ json2.additionalProperties = process(def.valueType, ctx, {
12152
12164
  ...params,
12153
12165
  path: [...params.path, "additionalProperties"]
12154
12166
  });
@@ -12163,7 +12175,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
12163
12175
  };
12164
12176
  var nullableProcessor = (schema, ctx, json2, params) => {
12165
12177
  const def = schema._zod.def;
12166
- const inner = process2(def.innerType, ctx, params);
12178
+ const inner = process(def.innerType, ctx, params);
12167
12179
  const seen = ctx.seen.get(schema);
12168
12180
  if (ctx.target === "openapi-3.0") {
12169
12181
  seen.ref = def.innerType;
@@ -12174,20 +12186,20 @@ var nullableProcessor = (schema, ctx, json2, params) => {
12174
12186
  };
12175
12187
  var nonoptionalProcessor = (schema, ctx, _json, params) => {
12176
12188
  const def = schema._zod.def;
12177
- process2(def.innerType, ctx, params);
12189
+ process(def.innerType, ctx, params);
12178
12190
  const seen = ctx.seen.get(schema);
12179
12191
  seen.ref = def.innerType;
12180
12192
  };
12181
12193
  var defaultProcessor = (schema, ctx, json2, params) => {
12182
12194
  const def = schema._zod.def;
12183
- process2(def.innerType, ctx, params);
12195
+ process(def.innerType, ctx, params);
12184
12196
  const seen = ctx.seen.get(schema);
12185
12197
  seen.ref = def.innerType;
12186
12198
  json2.default = JSON.parse(JSON.stringify(def.defaultValue));
12187
12199
  };
12188
12200
  var prefaultProcessor = (schema, ctx, json2, params) => {
12189
12201
  const def = schema._zod.def;
12190
- process2(def.innerType, ctx, params);
12202
+ process(def.innerType, ctx, params);
12191
12203
  const seen = ctx.seen.get(schema);
12192
12204
  seen.ref = def.innerType;
12193
12205
  if (ctx.io === "input")
@@ -12195,7 +12207,7 @@ var prefaultProcessor = (schema, ctx, json2, params) => {
12195
12207
  };
12196
12208
  var catchProcessor = (schema, ctx, json2, params) => {
12197
12209
  const def = schema._zod.def;
12198
- process2(def.innerType, ctx, params);
12210
+ process(def.innerType, ctx, params);
12199
12211
  const seen = ctx.seen.get(schema);
12200
12212
  seen.ref = def.innerType;
12201
12213
  let catchValue;
@@ -12210,32 +12222,32 @@ var pipeProcessor = (schema, ctx, _json, params) => {
12210
12222
  const def = schema._zod.def;
12211
12223
  const inIsTransform = def.in._zod.traits.has("$ZodTransform");
12212
12224
  const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
12213
- process2(innerType, ctx, params);
12225
+ process(innerType, ctx, params);
12214
12226
  const seen = ctx.seen.get(schema);
12215
12227
  seen.ref = innerType;
12216
12228
  };
12217
12229
  var readonlyProcessor = (schema, ctx, json2, params) => {
12218
12230
  const def = schema._zod.def;
12219
- process2(def.innerType, ctx, params);
12231
+ process(def.innerType, ctx, params);
12220
12232
  const seen = ctx.seen.get(schema);
12221
12233
  seen.ref = def.innerType;
12222
12234
  json2.readOnly = true;
12223
12235
  };
12224
12236
  var promiseProcessor = (schema, ctx, _json, params) => {
12225
12237
  const def = schema._zod.def;
12226
- process2(def.innerType, ctx, params);
12238
+ process(def.innerType, ctx, params);
12227
12239
  const seen = ctx.seen.get(schema);
12228
12240
  seen.ref = def.innerType;
12229
12241
  };
12230
12242
  var optionalProcessor = (schema, ctx, _json, params) => {
12231
12243
  const def = schema._zod.def;
12232
- process2(def.innerType, ctx, params);
12244
+ process(def.innerType, ctx, params);
12233
12245
  const seen = ctx.seen.get(schema);
12234
12246
  seen.ref = def.innerType;
12235
12247
  };
12236
12248
  var lazyProcessor = (schema, ctx, _json, params) => {
12237
12249
  const innerType = schema._zod.innerType;
12238
- process2(innerType, ctx, params);
12250
+ process(innerType, ctx, params);
12239
12251
  const seen = ctx.seen.get(schema);
12240
12252
  seen.ref = innerType;
12241
12253
  };
@@ -12287,7 +12299,7 @@ function toJSONSchema(input, params) {
12287
12299
  const defs = {};
12288
12300
  for (const entry of registry2._idmap.entries()) {
12289
12301
  const [_, schema] = entry;
12290
- process2(schema, ctx2);
12302
+ process(schema, ctx2);
12291
12303
  }
12292
12304
  const schemas = {};
12293
12305
  const external = {
@@ -12310,7 +12322,7 @@ function toJSONSchema(input, params) {
12310
12322
  return { schemas };
12311
12323
  }
12312
12324
  const ctx = initializeContext({ ...params, processors: allProcessors });
12313
- process2(input, ctx);
12325
+ process(input, ctx);
12314
12326
  extractDefs(ctx, input);
12315
12327
  return finalize(ctx, input);
12316
12328
  }
@@ -12368,7 +12380,7 @@ var JSONSchemaGenerator = class {
12368
12380
  * This must be called before emit().
12369
12381
  */
12370
12382
  process(schema, _params = { path: [], schemaPath: [] }) {
12371
- return process2(schema, this.ctx, _params);
12383
+ return process(schema, this.ctx, _params);
12372
12384
  }
12373
12385
  /**
12374
12386
  * Emit the final JSON Schema after processing.
@@ -14517,80 +14529,577 @@ function date4(params) {
14517
14529
  // node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
14518
14530
  config(en_default());
14519
14531
 
14520
- // src/lib/errors.ts
14521
- var EXIT_BY_CODE = {
14522
- NODE_UNSUPPORTED: 1,
14523
- USAGE: 2,
14524
- CONFIG_INVALID: 2,
14525
- WALLET_EXISTS: 3,
14526
- WALLET_MISSING: 1,
14527
- WALLET_INVALID_KEY: 1,
14528
- PROVIDER_ERROR: 1,
14529
- RPC_ERROR: 1,
14530
- API_UNREACHABLE: 1,
14531
- CONTRACT_MISMATCH: 1,
14532
- REFUSED: 3,
14533
- NETWORK_ERROR: 1,
14534
- INTERNAL: 1,
14535
- NOT_IMPLEMENTED: 1,
14536
- POLICY_REFUSED: 3,
14537
- PAYMENT_FAILED: 4,
14538
- RESOURCE_NOT_FOUND: 1,
14539
- LOOKUP_NOT_FOUND: 1,
14540
- RATE_LIMITED: 1,
14541
- // A publish awaiting confirmation or hard-blocked is understood-but-refused (3),
14542
- // the same posture as POLICY_REFUSED; a write that failed after approval is a
14543
- // settlement-class failure (4), like PAYMENT_FAILED.
14544
- NEEDS_CONFIRMATION: 3,
14545
- PUBLISH_BLOCKED: 3,
14546
- PUBLISH_FAILED: 4
14547
- };
14548
- function exitCodeFor(code) {
14549
- return EXIT_BY_CODE[code];
14550
- }
14551
- var CliError = class extends Error {
14552
- code;
14553
- exitCode;
14554
- fix;
14555
- details;
14556
- constructor(code, message, opts = {}) {
14557
- super(message, opts.cause !== void 0 ? { cause: opts.cause } : void 0);
14558
- this.name = "CliError";
14559
- this.code = code;
14560
- this.exitCode = opts.exitCode ?? exitCodeFor(code);
14561
- this.fix = opts.fix;
14562
- this.details = opts.details;
14563
- }
14564
- };
14532
+ // src/lib/config.ts
14533
+ import { readFile } from "node:fs/promises";
14565
14534
 
14566
- // src/lib/paths.ts
14567
- import { homedir } from "os";
14568
- import { join } from "path";
14569
- function dataDir(env = process.env) {
14570
- const override = env.TENJIN_DATA_DIR;
14571
- if (override !== void 0 && override.length > 0) return override;
14572
- return join(homedir(), ".tenjin");
14535
+ // src/adapters/types.ts
14536
+ var HARNESSES = ["claude", "codex"];
14537
+
14538
+ // src/lib/config.ts
14539
+ var atomicString = external_exports.string().regex(/^\d+$/, "expected an atomic USDC integer string");
14540
+ var PublishModeSchema = external_exports.enum(["review", "auto", "full-auto"]);
14541
+ var AckServerWarningsSchema = external_exports.enum(["mode", "on", "off"]);
14542
+ function parseAckServerWarnings(value, keyName) {
14543
+ const parsed = AckServerWarningsSchema.safeParse(value);
14544
+ if (parsed.success) return parsed.data;
14545
+ throw new CliError("USAGE", `Invalid ${keyName} ${JSON.stringify(value)}`, {
14546
+ fix: 'Use "mode", "on", or "off".'
14547
+ });
14548
+ }
14549
+ var PublishConfigSchema = external_exports.object({
14550
+ mode: PublishModeSchema,
14551
+ defaultPrice: atomicString,
14552
+ ackServerWarnings: AckServerWarningsSchema
14553
+ });
14554
+ var HOOK_ARMS = [
14555
+ "prompt",
14556
+ "web-search",
14557
+ "web-fetch",
14558
+ "subagent",
14559
+ "failure",
14560
+ "publish",
14561
+ "primer"
14562
+ ];
14563
+ var HooksConfigSchema = external_exports.object({
14564
+ prompt: external_exports.boolean(),
14565
+ "web-search": external_exports.boolean(),
14566
+ "web-fetch": external_exports.boolean(),
14567
+ subagent: external_exports.boolean(),
14568
+ failure: external_exports.boolean(),
14569
+ publish: external_exports.boolean(),
14570
+ primer: external_exports.boolean()
14571
+ });
14572
+ var ROUTER_CONTEXTS = ["session", "turn"];
14573
+ var RouterLayerSchema = external_exports.object({
14574
+ enabled: external_exports.boolean().optional(),
14575
+ context: external_exports.enum(ROUTER_CONTEXTS).optional()
14576
+ });
14577
+ var RouterConfigSchema = RouterLayerSchema.required();
14578
+ function parseRouterLayer(json2, path) {
14579
+ if (json2 === null || typeof json2 !== "object" || Array.isArray(json2)) {
14580
+ throw new CliError("CONFIG_INVALID", `Config at ${path} is not a JSON object`, {
14581
+ fix: `Fix ${path}, or delete it.`
14582
+ });
14583
+ }
14584
+ const parsed = RouterLayerSchema.safeParse(json2.router ?? {});
14585
+ if (!parsed.success) {
14586
+ throw new CliError("CONFIG_INVALID", `Config at ${path} has an invalid router block`, {
14587
+ fix: `Use router.enabled true|false and router.context "session"|"turn" in ${path}, or delete it.`,
14588
+ details: parsed.error.issues
14589
+ });
14590
+ }
14591
+ const { enabled, context } = parsed.data;
14592
+ return {
14593
+ ...enabled !== void 0 ? { enabled } : {},
14594
+ ...context !== void 0 ? { context } : {}
14595
+ };
14596
+ }
14597
+ var UpdateModeSchema = external_exports.enum(["nudge", "off"]);
14598
+ var positiveInt = external_exports.number().int().positive();
14599
+ var LoopConfigSchema = external_exports.object({
14600
+ human_wait_ms: positiveInt,
14601
+ tool_wait_ms: positiveInt,
14602
+ idle_exit_min: positiveInt,
14603
+ port: external_exports.number().int().min(0).max(65535).nullable()
14604
+ });
14605
+ var PublicFallbackSchema = external_exports.enum(["on", "off"]);
14606
+ var TeamConfigSchema = external_exports.object({ publicFallback: PublicFallbackSchema });
14607
+ var ExperimentalConfigSchema = external_exports.object({ bazaar: PublicFallbackSchema });
14608
+ function parsePublicFallbackFlag(value, keyName) {
14609
+ const parsed = PublicFallbackSchema.safeParse(value);
14610
+ if (parsed.success) return parsed.data;
14611
+ throw new CliError("USAGE", `Invalid ${keyName}: ${JSON.stringify(value)}`, {
14612
+ fix: 'Use "on" or "off".'
14613
+ });
14614
+ }
14615
+ function parseLoopValue(key, value) {
14616
+ const field = key.slice("loop.".length);
14617
+ if (field === "port" && (value === "null" || value === "auto")) return null;
14618
+ const n = /^\d+$/.test(value.trim()) ? Number(value.trim()) : NaN;
14619
+ const parsed = LoopConfigSchema.shape[field].safeParse(n);
14620
+ if (parsed.success) return parsed.data;
14621
+ throw new CliError("USAGE", `Invalid ${key}: ${JSON.stringify(value)}`, {
14622
+ fix: field === "port" ? 'Use an integer from 0 to 65535, or "null" to derive one from the data dir.' : "Use a positive integer."
14623
+ });
14624
+ }
14625
+ var UpdateConfigSchema = external_exports.object({
14626
+ mode: UpdateModeSchema
14627
+ });
14628
+ function parseUpdateModeFlag(value, flagName) {
14629
+ const parsed = UpdateModeSchema.safeParse(value);
14630
+ if (parsed.success) return parsed.data;
14631
+ throw new CliError("USAGE", `Invalid ${flagName} ${JSON.stringify(value)}`, {
14632
+ fix: 'Use "nudge" or "off".'
14633
+ });
14634
+ }
14635
+ var InstallConfigSchema = external_exports.object({
14636
+ harness: external_exports.array(external_exports.enum(HARNESSES)),
14637
+ /**
14638
+ * The EXACT rule strings still pending the last time an install explicitly
14639
+ * declined the free-verb allowlist (`--no-grant`), so `--refresh`
14640
+ * can subtract them from what it would
14641
+ * otherwise report as pending instead of recomputing from the settings file
14642
+ * and nagging about a settled "no" on every refresh (tenjin-agent#234).
14643
+ *
14644
+ * A LIST, NOT A FLAG, on purpose: a boolean has no way to say "these were
14645
+ * declined" without also silencing every rule a LATER version might add, so a
14646
+ * genuinely new suggestion would never be reported again either. Per-rule
14647
+ * suppression means only the rules that were actually offered and refused
14648
+ * stay quiet; a new one still surfaces.
14649
+ *
14650
+ * Cleared back to `[]` the next time an install actually wires the allowlist,
14651
+ * or finds it already fully satisfied, so a later legitimate grant (manual or
14652
+ * otherwise) is never shadowed by a stale decline.
14653
+ */
14654
+ grantDeclined: external_exports.array(external_exports.string()),
14655
+ /**
14656
+ * Absolute directories a `tenjin install --project` wired, so `tenjin update`
14657
+ * can refresh them. It spawns `install --refresh` from the HOME directory,
14658
+ * which is the one place a project install can never be found by looking
14659
+ * around: without this list a project-only machine refreshed nothing and
14660
+ * reported success while its hooks stayed on the old build.
14661
+ *
14662
+ * A LIST, because one machine can wire several projects, and entries are
14663
+ * dropped by `tenjin uninstall --project` and by any refresh that finds the
14664
+ * project's settings file no longer carries our entries.
14665
+ */
14666
+ routerProjects: external_exports.array(external_exports.string())
14667
+ });
14668
+ var STORED_INSTALL_HARNESSES = [...HARNESSES, "shared"];
14669
+ function resolveInstallHarness(value) {
14670
+ const normalized = new Set(value?.map((harness) => harness === "shared" ? "codex" : harness));
14671
+ return HARNESSES.filter((harness) => normalized.has(harness));
14573
14672
  }
14574
- function configPath(dir = dataDir()) {
14575
- return join(dir, "config.json");
14673
+ var RawInstallHarnessSchema = external_exports.array(external_exports.enum(STORED_INSTALL_HARNESSES)).transform(resolveInstallHarness);
14674
+ var ConfigSchema = external_exports.object({
14675
+ maxAutoSpend: atomicString,
14676
+ sessionBudget: external_exports.union([atomicString, external_exports.literal("none")]),
14677
+ /**
14678
+ * Hard per-send cap for `tenjin wallet send`, NOT satisfiable by --yes or a prompt
14679
+ * (the spend-policy posture): an atomic amount caps each send, "0" disables
14680
+ * the verb entirely, and "none" = explicitly uncapped (send exists to drain
14681
+ * the wallet, but uncapped is an opt-in, never a default). The key has NO
14682
+ * usable default: absent from config.json, `tenjin wallet send` refuses until it is
14683
+ * set (see resolveSendMaxAmount). Client-enforced like every spend key (see
14684
+ * the note above).
14685
+ */
14686
+ sendMaxAmount: external_exports.union([external_exports.literal("none"), atomicString]),
14687
+ allowlistCreators: external_exports.array(external_exports.string()),
14688
+ baseUrl: external_exports.url(),
14689
+ /**
14690
+ * The PUBLIC marketplace, consume-only, and the second shelf a team-mode
14691
+ * lookup falls through to. Distinct from `baseUrl` because in team mode
14692
+ * `baseUrl` is the team's own deployment: `publish`, `read` and the first leg
14693
+ * of every search go there, and this is the shelf that still gets asked when
14694
+ * the team's own has nothing. In public mode the two are the same origin and
14695
+ * nothing falls through.
14696
+ */
14697
+ publicShelfUrl: external_exports.url(),
14698
+ /**
14699
+ * The team shelf's Vercel "Protection Bypass for Automation" secret, and the
14700
+ * ONE key that decides which mode this CLI is in: empty (the default) is
14701
+ * public mode, byte-for-byte what it always did; non-empty is team mode.
14702
+ *
14703
+ * It is a DOOR KEY, not a credential of the operator's: it gets a request past
14704
+ * Deployment Protection on the team's preview deployment and authenticates
14705
+ * nobody. Stored in plain config.json alongside everything else for exactly
14706
+ * that reason — anything that can read this file can already read the wallet's
14707
+ * keystore path and rewrite `baseUrl`. It is redacted from `config get` and
14708
+ * `config list` all the same, because those outputs are pasted into issues.
14709
+ *
14710
+ * Sent ONLY to `baseUrl`'s origin; see lib/http.ts's `bypass` option, which
14711
+ * derives that from the request URL rather than from the caller's intent.
14712
+ */
14713
+ shelfBypassSecret: external_exports.string(),
14714
+ rpcUrl: external_exports.url(),
14715
+ /**
14716
+ * Evaluation-cohort opt-in (spec 09 §3): when true, search sends
14717
+ * X-Tenjin-Eval-Cohort: 1 and the server stores the generalized question for
14718
+ * 90 days. Off by default; no query text is retained server-side without it.
14719
+ */
14720
+ evalCohort: external_exports.boolean(),
14721
+ /** x402 discovery registries (facilitator base URLs) `discover` queries and
14722
+ * the Bazaar pay lane verifies against. */
14723
+ bazaarRegistries: external_exports.array(external_exports.url()),
14724
+ publish: PublishConfigSchema,
14725
+ install: InstallConfigSchema,
14726
+ hooks: HooksConfigSchema,
14727
+ update: UpdateConfigSchema,
14728
+ loop: LoopConfigSchema,
14729
+ team: TeamConfigSchema,
14730
+ router: RouterConfigSchema,
14731
+ experimental: ExperimentalConfigSchema
14732
+ });
14733
+ var RawInstallConfigSchema = InstallConfigSchema.partial().extend({
14734
+ harness: RawInstallHarnessSchema.optional(),
14735
+ grantDeclined: external_exports.array(external_exports.string()).optional()
14736
+ }).passthrough();
14737
+ var RawConfigSchema = ConfigSchema.partial().extend({
14738
+ publish: PublishConfigSchema.partial().passthrough().optional(),
14739
+ install: RawInstallConfigSchema.optional(),
14740
+ hooks: HooksConfigSchema.partial().passthrough().optional(),
14741
+ update: UpdateConfigSchema.partial().passthrough().optional(),
14742
+ loop: LoopConfigSchema.partial().passthrough().optional(),
14743
+ team: TeamConfigSchema.partial().passthrough().optional(),
14744
+ router: RouterLayerSchema.passthrough().optional(),
14745
+ experimental: ExperimentalConfigSchema.partial().passthrough().optional()
14746
+ }).passthrough();
14747
+ function resolveGrantDeclined(value) {
14748
+ return value ?? [];
14749
+ }
14750
+ var SEND_MAX_UNSET = "unset";
14751
+ var DEFAULT_BAZAAR_REGISTRIES = [
14752
+ "https://api.cdp.coinbase.com/platform/v2/x402",
14753
+ "https://facilitator.ultravioletadao.xyz",
14754
+ "https://facilitator.payai.network"
14755
+ ];
14756
+ var DEFAULT_MAX_AUTO_SPEND = "250000";
14757
+ var DEFAULT_SESSION_BUDGET = "5000000";
14758
+ var MAX_AUTO_SPEND_FLOOR_ATOMIC = 250000n;
14759
+ var MAX_AUTO_SPEND_FLOOR_WHY = "The $0.25 minimum is the routing deposit: below it, routing cannot pay at all. To stop automatic payments, turn the router off with `tenjin config set router.enabled false`.";
14760
+ var CONFIG_DEFAULTS = {
14761
+ maxAutoSpend: DEFAULT_MAX_AUTO_SPEND,
14762
+ sessionBudget: DEFAULT_SESSION_BUDGET,
14763
+ // A type placeholder only, never honored: Config requires every key (and
14764
+ // CONFIG_KEYS derives from these). resolveSendMaxAmount never reads it — an
14765
+ // absent key resolves to SEND_MAX_UNSET and `tenjin wallet send` refuses until the
14766
+ // cap is set. '0' (send disabled) rather than 'none' (uncapped) so that if a
14767
+ // future caller ever DOES read the cap through loadConfig/fileOrDefault, the
14768
+ // leak fails closed instead of silently running uncapped.
14769
+ sendMaxAmount: "0",
14770
+ allowlistCreators: [],
14771
+ baseUrl: PRODUCTION_ORIGIN,
14772
+ publicShelfUrl: PRODUCTION_ORIGIN,
14773
+ // Empty = public mode. Setting it is the whole of "turn on team mode".
14774
+ shelfBypassSecret: "",
14775
+ rpcUrl: DEFAULT_RPC_URL,
14776
+ evalCohort: false,
14777
+ bazaarRegistries: DEFAULT_BAZAAR_REGISTRIES,
14778
+ publish: { mode: "review", defaultPrice: "100000", ackServerWarnings: "mode" },
14779
+ install: { harness: [], grantDeclined: [], routerProjects: [] },
14780
+ // Every hook is on out of the box: a vanilla install turns the whole loop on,
14781
+ // and the disclosure and the undo ride the install output. `false` leaves the
14782
+ // registered entries inert without touching settings.json, so any of these is
14783
+ // one `config set` away in either direction.
14784
+ hooks: {
14785
+ prompt: true,
14786
+ "web-search": true,
14787
+ "web-fetch": true,
14788
+ subagent: true,
14789
+ failure: true,
14790
+ publish: true,
14791
+ primer: true
14792
+ },
14793
+ update: { mode: "nudge" },
14794
+ loop: {
14795
+ human_wait_ms: 2500,
14796
+ tool_wait_ms: 4e3,
14797
+ idle_exit_min: 30,
14798
+ port: null
14799
+ },
14800
+ team: { publicFallback: "on" },
14801
+ router: { enabled: true, context: "session" },
14802
+ experimental: { bazaar: "off" }
14803
+ };
14804
+ var NESTED_CONFIG_KEYS = /* @__PURE__ */ new Set([
14805
+ "publish",
14806
+ "install",
14807
+ "hooks",
14808
+ "update",
14809
+ "loop",
14810
+ "team",
14811
+ "router",
14812
+ "experimental"
14813
+ ]);
14814
+ var CONFIG_KEYS = Object.keys(CONFIG_DEFAULTS).filter(
14815
+ (key) => !NESTED_CONFIG_KEYS.has(key)
14816
+ );
14817
+ var PUBLISH_CONFIG_KEYS = [
14818
+ "publish.mode",
14819
+ "publish.defaultPrice",
14820
+ "publish.ackServerWarnings"
14821
+ ];
14822
+ var HOOKS_CONFIG_KEYS = HOOK_ARMS.map(
14823
+ (arm) => `hooks.${arm}`
14824
+ );
14825
+ var UPDATE_CONFIG_KEYS = ["update.mode"];
14826
+ var LOOP_CONFIG_KEYS = [
14827
+ "loop.human_wait_ms",
14828
+ "loop.tool_wait_ms",
14829
+ "loop.idle_exit_min",
14830
+ "loop.port"
14831
+ ];
14832
+ var TEAM_CONFIG_KEYS = ["team.publicFallback"];
14833
+ var EXPERIMENTAL_CONFIG_KEYS = ["experimental.bazaar"];
14834
+ var ROUTER_CONFIG_KEYS = ["router.enabled", "router.context"];
14835
+ var RETIRED_PAYMENT_KEYS = ["bazaarPay", "confirm"];
14836
+ var RETIRED_PAYMENT_GUIDANCE = "Retired payment settings no longer control payments. Use router.enabled, maxAutoSpend and sessionBudget for automatic routing; manual pay always requires consent. Run tenjin install to remove retired keys.";
14837
+ function retiredPaymentKeys(raw) {
14838
+ return RETIRED_PAYMENT_KEYS.filter((key) => Object.hasOwn(raw, key));
14839
+ }
14840
+ async function loadRawConfig(dir) {
14841
+ const path = configPath(dir);
14842
+ let raw;
14843
+ try {
14844
+ raw = await readFile(path, "utf8");
14845
+ } catch (err) {
14846
+ if (isNotFound(err)) return {};
14847
+ throw new CliError("CONFIG_INVALID", `Could not read config at ${path}`, {
14848
+ fix: `Check file permissions on ${path}.`,
14849
+ cause: err
14850
+ });
14851
+ }
14852
+ let json2;
14853
+ try {
14854
+ json2 = JSON.parse(raw);
14855
+ } catch (err) {
14856
+ throw new CliError("CONFIG_INVALID", `Config at ${path} is not valid JSON`, {
14857
+ fix: `Fix the JSON syntax in ${path}, or delete it to restore defaults.`,
14858
+ cause: err
14859
+ });
14860
+ }
14861
+ const parsed = RawConfigSchema.safeParse(json2);
14862
+ if (!parsed.success) {
14863
+ throw new CliError("CONFIG_INVALID", `Config at ${path} is invalid`, {
14864
+ fix: `Correct the reported keys in ${path}, or delete it to restore defaults.`,
14865
+ details: parsed.error.issues
14866
+ });
14867
+ }
14868
+ return parsed.data;
14576
14869
  }
14577
- function walletPath(dir = dataDir()) {
14578
- return join(dir, "wallet.json");
14870
+ async function loadConfig(dir) {
14871
+ const raw = { ...await loadRawConfig(dir) };
14872
+ for (const key of retiredPaymentKeys(raw)) delete raw[key];
14873
+ return {
14874
+ ...CONFIG_DEFAULTS,
14875
+ ...raw,
14876
+ publish: {
14877
+ mode: raw.publish?.mode ?? CONFIG_DEFAULTS.publish.mode,
14878
+ defaultPrice: raw.publish?.defaultPrice ?? CONFIG_DEFAULTS.publish.defaultPrice,
14879
+ ackServerWarnings: raw.publish?.ackServerWarnings ?? CONFIG_DEFAULTS.publish.ackServerWarnings
14880
+ },
14881
+ install: {
14882
+ harness: raw.install?.harness ?? CONFIG_DEFAULTS.install.harness,
14883
+ routerProjects: raw.install?.routerProjects ?? CONFIG_DEFAULTS.install.routerProjects,
14884
+ grantDeclined: resolveGrantDeclined(raw.install?.grantDeclined)
14885
+ },
14886
+ hooks: resolveHooksConfig(raw),
14887
+ update: { mode: raw.update?.mode ?? CONFIG_DEFAULTS.update.mode },
14888
+ loop: resolveLoopConfig(raw),
14889
+ team: { publicFallback: raw.team?.publicFallback ?? CONFIG_DEFAULTS.team.publicFallback },
14890
+ router: {
14891
+ enabled: raw.router?.enabled ?? CONFIG_DEFAULTS.router.enabled,
14892
+ context: raw.router?.context ?? CONFIG_DEFAULTS.router.context
14893
+ },
14894
+ experimental: {
14895
+ bazaar: raw.experimental?.bazaar ?? CONFIG_DEFAULTS.experimental.bazaar
14896
+ }
14897
+ };
14579
14898
  }
14580
- function sessionPath(dir = dataDir()) {
14581
- return join(dir, "session.json");
14899
+ function resolveLoopConfig(raw) {
14900
+ const file2 = raw.loop ?? {};
14901
+ return {
14902
+ human_wait_ms: file2.human_wait_ms ?? CONFIG_DEFAULTS.loop.human_wait_ms,
14903
+ tool_wait_ms: file2.tool_wait_ms ?? CONFIG_DEFAULTS.loop.tool_wait_ms,
14904
+ idle_exit_min: file2.idle_exit_min ?? CONFIG_DEFAULTS.loop.idle_exit_min,
14905
+ port: file2.port === void 0 ? CONFIG_DEFAULTS.loop.port : file2.port
14906
+ };
14907
+ }
14908
+ function resolveSettings(input) {
14909
+ const { config: config2, flags, env, project } = input;
14910
+ return {
14911
+ maxAutoSpend: fileOrDefault("maxAutoSpend", config2),
14912
+ sessionBudget: fileOrDefault("sessionBudget", config2),
14913
+ sendMaxAmount: resolveSendMaxAmount(config2),
14914
+ allowlistCreators: fileOrDefault("allowlistCreators", config2),
14915
+ baseUrl: resolveBaseUrl(config2, flags, env),
14916
+ publicShelfUrl: fileOrDefault("publicShelfUrl", config2),
14917
+ shelfBypassSecret: fileOrDefault("shelfBypassSecret", config2),
14918
+ rpcUrl: fileOrDefault("rpcUrl", config2),
14919
+ evalCohort: fileOrDefault("evalCohort", config2),
14920
+ bazaarRegistries: fileOrDefault("bazaarRegistries", config2),
14921
+ publishMode: resolvePublishMode({ config: config2, project, env }),
14922
+ publishDefaultPrice: resolvePublishDefaultPrice({ config: config2, project }),
14923
+ publishAckServerWarnings: resolveAckServerWarnings(config2),
14924
+ hooks: resolveHookSettings(config2),
14925
+ updateMode: resolveUpdateMode(config2),
14926
+ loop: resolveLoopSettings(config2),
14927
+ teamPublicFallback: resolveTeamPublicFallback(config2),
14928
+ experimentalBazaar: resolveExperimentalBazaar(config2)
14929
+ };
14930
+ }
14931
+ function resolveLoopSettings(config2) {
14932
+ const file2 = config2.loop ?? {};
14933
+ const one = (key) => {
14934
+ const fromFile = file2[key];
14935
+ if (fromFile !== void 0) return { value: fromFile, source: "file" };
14936
+ return { value: CONFIG_DEFAULTS.loop[key], source: "default" };
14937
+ };
14938
+ return {
14939
+ human_wait_ms: one("human_wait_ms"),
14940
+ tool_wait_ms: one("tool_wait_ms"),
14941
+ idle_exit_min: one("idle_exit_min"),
14942
+ port: one("port")
14943
+ };
14944
+ }
14945
+ function resolveExperimentalBazaar(config2) {
14946
+ const fromFile = config2.experimental?.bazaar;
14947
+ if (fromFile !== void 0) return { value: fromFile, source: "file" };
14948
+ return { value: CONFIG_DEFAULTS.experimental.bazaar, source: "default" };
14949
+ }
14950
+ function resolveTeamPublicFallback(config2) {
14951
+ const fromFile = config2.team?.publicFallback;
14952
+ if (fromFile !== void 0) return { value: fromFile, source: "file" };
14953
+ return { value: CONFIG_DEFAULTS.team.publicFallback, source: "default" };
14954
+ }
14955
+ function resolveAckServerWarnings(config2) {
14956
+ const fromFile = config2.publish?.ackServerWarnings;
14957
+ if (fromFile !== void 0) return { value: fromFile, source: "file" };
14958
+ return { value: CONFIG_DEFAULTS.publish.ackServerWarnings, source: "default" };
14959
+ }
14960
+ function resolveUpdateMode(config2) {
14961
+ const fromFile = config2.update?.mode;
14962
+ if (fromFile !== void 0) return { value: fromFile, source: "file" };
14963
+ return { value: CONFIG_DEFAULTS.update.mode, source: "default" };
14964
+ }
14965
+ function resolveHook(config2, arm) {
14966
+ const fromFile = config2.hooks?.[arm];
14967
+ if (fromFile !== void 0) return { value: fromFile, source: "file" };
14968
+ return { value: CONFIG_DEFAULTS.hooks[arm], source: "default" };
14969
+ }
14970
+ function resolveHookSettings(config2) {
14971
+ return Object.fromEntries(
14972
+ HOOK_ARMS.map((arm) => [arm, resolveHook(config2, arm)])
14973
+ );
14974
+ }
14975
+ function resolveHooksConfig(raw) {
14976
+ return Object.fromEntries(
14977
+ HOOK_ARMS.map((arm) => [arm, raw.hooks?.[arm] ?? CONFIG_DEFAULTS.hooks[arm]])
14978
+ );
14979
+ }
14980
+ var FULL_AUTO_DOWNGRADE_WARNING = 'Ignoring publish.mode "full-auto" from a committed .tenjin.json (cloning a repo must not enable auto-publish); using "auto". Add .tenjin.json to .gitignore to opt in.';
14981
+ function coercePublishMode(raw) {
14982
+ if (raw === void 0 || raw.length === 0) return void 0;
14983
+ const parsed = PublishModeSchema.safeParse(raw);
14984
+ return parsed.success ? parsed.data : void 0;
14985
+ }
14986
+ function resolvePublishMode(input) {
14987
+ const { config: config2, project, env, flag } = input;
14988
+ let winner = { value: CONFIG_DEFAULTS.publish.mode, source: "default" };
14989
+ const fromFile = config2.publish?.mode;
14990
+ if (fromFile !== void 0) winner = { value: fromFile, source: "file" };
14991
+ if (project !== void 0 && project.publish?.mode !== void 0) {
14992
+ const fromProject = project.publish.mode;
14993
+ if (fromProject === "full-auto" && !project.gitignored) {
14994
+ winner = { value: "auto", source: "project", downgradedWarning: FULL_AUTO_DOWNGRADE_WARNING };
14995
+ } else {
14996
+ winner = { value: fromProject, source: "project" };
14997
+ }
14998
+ }
14999
+ const fromEnv = coercePublishMode(env.TENJIN_PUBLISH_MODE);
15000
+ if (fromEnv !== void 0) winner = { value: fromEnv, source: "env" };
15001
+ const fromFlag = coercePublishMode(flag);
15002
+ if (fromFlag !== void 0) winner = { value: fromFlag, source: "flag" };
15003
+ return winner;
15004
+ }
15005
+ function resolvePublishDefaultPrice(input) {
15006
+ const { config: config2, project } = input;
15007
+ let result = {
15008
+ value: CONFIG_DEFAULTS.publish.defaultPrice,
15009
+ source: "default"
15010
+ };
15011
+ if (config2.publish?.defaultPrice !== void 0) {
15012
+ result = { value: config2.publish.defaultPrice, source: "file" };
15013
+ }
15014
+ if (project?.publish?.defaultPrice !== void 0) {
15015
+ result = { value: project.publish.defaultPrice, source: "project" };
15016
+ }
15017
+ return result;
15018
+ }
15019
+ function resolveSendMaxAmount(config2) {
15020
+ if (config2.sendMaxAmount !== void 0) return { value: config2.sendMaxAmount, source: "file" };
15021
+ return { value: SEND_MAX_UNSET, source: "default" };
15022
+ }
15023
+ function fileOrDefault(key, config2) {
15024
+ const fromFile = config2[key];
15025
+ if (fromFile !== void 0) return { value: fromFile, source: "file" };
15026
+ return { value: CONFIG_DEFAULTS[key], source: "default" };
15027
+ }
15028
+ function resolveBaseUrl(config2, flags, env) {
15029
+ if (flags.baseUrl !== void 0 && flags.baseUrl.length > 0) {
15030
+ return { value: flags.baseUrl, source: "flag" };
15031
+ }
15032
+ const fromEnv = env.TENJIN_BASE_URL;
15033
+ if (fromEnv !== void 0 && fromEnv.length > 0) {
15034
+ return { value: fromEnv, source: "env" };
15035
+ }
15036
+ if (config2.baseUrl !== void 0) return { value: config2.baseUrl, source: "file" };
15037
+ return { value: CONFIG_DEFAULTS.baseUrl, source: "default" };
14582
15038
  }
14583
- function passphraseBlobPath(dir = dataDir()) {
14584
- return join(dir, "passphrase.dpapi");
15039
+ function isNotFound(err) {
15040
+ return typeof err === "object" && err !== null && "code" in err && err.code === "ENOENT";
14585
15041
  }
14586
15042
 
14587
15043
  export {
15044
+ $constructor,
15045
+ defineLazy,
15046
+ clone,
15047
+ normalizeParams,
15048
+ parse,
15049
+ parseAsync,
15050
+ safeParse,
15051
+ safeParseAsync,
15052
+ $ZodType,
15053
+ $ZodObject,
15054
+ toJSONSchema,
15055
+ iso_exports,
15056
+ string2 as string,
15057
+ number2 as number,
15058
+ boolean2 as boolean,
15059
+ _null3 as _null,
15060
+ unknown,
15061
+ array,
15062
+ object,
15063
+ looseObject,
15064
+ union,
15065
+ discriminatedUnion,
15066
+ intersection,
15067
+ record,
15068
+ _enum2 as _enum,
15069
+ literal,
15070
+ ZodOptional,
15071
+ optional,
15072
+ custom,
15073
+ preprocess,
14588
15074
  external_exports,
14589
- CliError,
14590
- dataDir,
14591
- configPath,
14592
- walletPath,
14593
- sessionPath,
14594
- passphraseBlobPath
14595
- };
14596
- //# sourceMappingURL=chunk-OYMYCW7J.js.map
15075
+ HARNESSES,
15076
+ PublishModeSchema,
15077
+ parseAckServerWarnings,
15078
+ ROUTER_CONTEXTS,
15079
+ parseRouterLayer,
15080
+ parsePublicFallbackFlag,
15081
+ parseLoopValue,
15082
+ parseUpdateModeFlag,
15083
+ RawConfigSchema,
15084
+ SEND_MAX_UNSET,
15085
+ DEFAULT_MAX_AUTO_SPEND,
15086
+ DEFAULT_SESSION_BUDGET,
15087
+ MAX_AUTO_SPEND_FLOOR_ATOMIC,
15088
+ MAX_AUTO_SPEND_FLOOR_WHY,
15089
+ CONFIG_DEFAULTS,
15090
+ CONFIG_KEYS,
15091
+ PUBLISH_CONFIG_KEYS,
15092
+ HOOKS_CONFIG_KEYS,
15093
+ UPDATE_CONFIG_KEYS,
15094
+ LOOP_CONFIG_KEYS,
15095
+ TEAM_CONFIG_KEYS,
15096
+ EXPERIMENTAL_CONFIG_KEYS,
15097
+ ROUTER_CONFIG_KEYS,
15098
+ RETIRED_PAYMENT_GUIDANCE,
15099
+ retiredPaymentKeys,
15100
+ loadRawConfig,
15101
+ loadConfig,
15102
+ resolveSettings,
15103
+ resolveExperimentalBazaar
15104
+ };
15105
+ //# sourceMappingURL=chunk-YVFXE7RR.js.map