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

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 (270) hide show
  1. package/README.md +45 -26
  2. package/dist/{_esm-MEXZI5DL.js → _esm-BIN7VY2L.js} +128 -132
  3. package/dist/{alive-J64H46HI.js → alive-GSOWKUOY.js} +13 -6
  4. package/dist/auto-update-Y24UL56V.js +24 -0
  5. package/dist/{ccip-7RMRLAGV.js → ccip-DHDFKTQV.js} +2 -2
  6. package/dist/{chunk-TTNESUPQ.js → chunk-2GP3HRYK.js} +2120 -193
  7. package/dist/chunk-2GP3HRYK.js.map +1 -0
  8. package/dist/chunk-2M2VPI2E.js +560 -0
  9. package/dist/chunk-2M2VPI2E.js.map +1 -0
  10. package/dist/{chunk-D65GNPS3.js → chunk-2RWB7RKE.js} +288 -108
  11. package/dist/chunk-2RWB7RKE.js.map +1 -0
  12. package/dist/{chunk-AGZ7PJKY.js → chunk-36RVGZNY.js} +22 -5
  13. package/dist/chunk-36RVGZNY.js.map +1 -0
  14. package/dist/chunk-3AIHRXKO.js +72 -0
  15. package/dist/chunk-3AIHRXKO.js.map +1 -0
  16. package/dist/{chunk-S4SAZ7OD.js → chunk-3FMZGI7I.js} +12 -2
  17. package/dist/{chunk-S4SAZ7OD.js.map → chunk-3FMZGI7I.js.map} +1 -1
  18. package/dist/chunk-3GNJXKIT.js +198 -0
  19. package/dist/chunk-3GNJXKIT.js.map +1 -0
  20. package/dist/{chunk-UQUOVWBG.js → chunk-4K7TQHNP.js} +7 -7
  21. package/dist/{chunk-A36LQPHV.js → chunk-4LMUQMBH.js} +1 -1
  22. package/dist/{chunk-A36LQPHV.js.map → chunk-4LMUQMBH.js.map} +1 -1
  23. package/dist/{chunk-KXQ4UIP7.js → chunk-4USCZ2NI.js} +2 -2
  24. package/dist/chunk-4YOZGGTZ.js +247 -0
  25. package/dist/chunk-4YOZGGTZ.js.map +1 -0
  26. package/dist/chunk-62KNUYWD.js +111 -0
  27. package/dist/chunk-62KNUYWD.js.map +1 -0
  28. package/dist/{chunk-POUWHWID.js → chunk-6CMM6YCB.js} +3 -3
  29. package/dist/{chunk-POUWHWID.js.map → chunk-6CMM6YCB.js.map} +1 -1
  30. package/dist/{chunk-5MARFNSB.js → chunk-A5GKIG5O.js} +49 -30
  31. package/dist/chunk-A5GKIG5O.js.map +1 -0
  32. package/dist/{chunk-YFPY4ONH.js → chunk-AGMVASXZ.js} +4 -4
  33. package/dist/chunk-BF4XHEQK.js +116 -0
  34. package/dist/chunk-BF4XHEQK.js.map +1 -0
  35. package/dist/chunk-BFDQ4WNW.js +119 -0
  36. package/dist/chunk-BFDQ4WNW.js.map +1 -0
  37. package/dist/{chunk-P4NH7OUK.js → chunk-C2Q76BVM.js} +49 -50
  38. package/dist/chunk-C2Q76BVM.js.map +1 -0
  39. package/dist/chunk-CEXSOI5R.js +808 -0
  40. package/dist/chunk-CEXSOI5R.js.map +1 -0
  41. package/dist/{chunk-QSCPK4F5.js → chunk-E7SW44LM.js} +4 -11
  42. package/dist/chunk-E7SW44LM.js.map +1 -0
  43. package/dist/chunk-EDJWHDDL.js +33 -0
  44. package/dist/chunk-EDJWHDDL.js.map +1 -0
  45. package/dist/chunk-F3ED5WTR.js +13 -0
  46. package/dist/chunk-F3ED5WTR.js.map +1 -0
  47. package/dist/{chunk-K72RURN3.js → chunk-FVIGCDSV.js} +2 -2
  48. package/dist/chunk-FVIGCDSV.js.map +1 -0
  49. package/dist/{chunk-5K5W4S66.js → chunk-GTTUCOPD.js} +2 -2
  50. package/dist/{chunk-4ZZO6ULA.js → chunk-HDPUXS3Z.js} +19 -48
  51. package/dist/chunk-HDPUXS3Z.js.map +1 -0
  52. package/dist/{chunk-LEFIX6RS.js → chunk-HGGWCP7W.js} +31 -11
  53. package/dist/chunk-HGGWCP7W.js.map +1 -0
  54. package/dist/{chunk-ORWL5BSN.js → chunk-HGZEPQUT.js} +2 -2
  55. package/dist/chunk-HMWYAUA6.js +478 -0
  56. package/dist/chunk-HMWYAUA6.js.map +1 -0
  57. package/dist/{chunk-7QKHZQKW.js → chunk-IADZOXKN.js} +39 -6
  58. package/dist/chunk-IADZOXKN.js.map +1 -0
  59. package/dist/{chunk-7Q5FDF65.js → chunk-IE7P2BZE.js} +3 -3
  60. package/dist/{chunk-77TCKDEC.js → chunk-ILNIZ5I2.js} +788 -508
  61. package/dist/chunk-ILNIZ5I2.js.map +1 -0
  62. package/dist/{hosts-FWZOV26H.js → chunk-INTFHMU4.js} +79 -24
  63. package/dist/chunk-INTFHMU4.js.map +1 -0
  64. package/dist/{chunk-6E5R45ZO.js → chunk-J57UC3DD.js} +4 -4
  65. package/dist/{chunk-6E5R45ZO.js.map → chunk-J57UC3DD.js.map} +1 -1
  66. package/dist/chunk-JNJWBTU2.js +3497 -0
  67. package/dist/chunk-JNJWBTU2.js.map +1 -0
  68. package/dist/{chunk-7WU4OPLP.js → chunk-KM7RY2ZS.js} +5 -3
  69. package/dist/{chunk-7WU4OPLP.js.map → chunk-KM7RY2ZS.js.map} +1 -1
  70. package/dist/chunk-L6JEXB3E.js +293 -0
  71. package/dist/chunk-L6JEXB3E.js.map +1 -0
  72. package/dist/chunk-LRW6S53P.js +450 -0
  73. package/dist/chunk-LRW6S53P.js.map +1 -0
  74. package/dist/{chunk-UKY4CHNC.js → chunk-LXAYUOXI.js} +24 -11
  75. package/dist/chunk-LXAYUOXI.js.map +1 -0
  76. package/dist/{chunk-WJXLQXJY.js → chunk-MPZUYCAP.js} +4 -1
  77. package/dist/{chunk-WJXLQXJY.js.map → chunk-MPZUYCAP.js.map} +1 -1
  78. package/dist/chunk-NDGZDTSJ.js +393 -0
  79. package/dist/chunk-NDGZDTSJ.js.map +1 -0
  80. package/dist/{chunk-SJLTEINJ.js → chunk-OJNTCYQQ.js} +17 -1
  81. package/dist/chunk-OJNTCYQQ.js.map +1 -0
  82. package/dist/{chunk-OHRR5OYM.js → chunk-P3LFTKE7.js} +5 -10
  83. package/dist/chunk-P3LFTKE7.js.map +1 -0
  84. package/dist/{chunk-XZKD7DIF.js → chunk-RL5UUDT4.js} +3 -3
  85. package/dist/{chunk-XZKD7DIF.js.map → chunk-RL5UUDT4.js.map} +1 -1
  86. package/dist/{chunk-5C32RLTA.js → chunk-RVPYTUP4.js} +20 -5
  87. package/dist/chunk-RVPYTUP4.js.map +1 -0
  88. package/dist/{chunk-YVFXE7RR.js → chunk-SNNSAGMT.js} +7279 -2627
  89. package/dist/chunk-SNNSAGMT.js.map +1 -0
  90. package/dist/{chunk-WK7F3B2E.js → chunk-SO3XRZPX.js} +3 -3
  91. package/dist/{chunk-R5LCN54M.js → chunk-TC2WZLSC.js} +13 -17
  92. package/dist/{chunk-R5LCN54M.js.map → chunk-TC2WZLSC.js.map} +1 -1
  93. package/dist/{chunk-B7HUUJOK.js → chunk-TKPF35W6.js} +3 -3
  94. package/dist/{chunk-KXVP2VKA.js → chunk-U3IKUGRP.js} +32 -33
  95. package/dist/chunk-U3IKUGRP.js.map +1 -0
  96. package/dist/{chunk-AKWGE6JQ.js → chunk-UUGOUOVT.js} +37 -2
  97. package/dist/chunk-UUGOUOVT.js.map +1 -0
  98. package/dist/{chunk-2XLC3AEX.js → chunk-UXZONNEQ.js} +536 -510
  99. package/dist/chunk-UXZONNEQ.js.map +1 -0
  100. package/dist/{chunk-7ZRL2LBQ.js → chunk-V2LQLN5H.js} +6 -6
  101. package/dist/{chunk-NEFNKLBE.js → chunk-WFSPCCVW.js} +1536 -423
  102. package/dist/chunk-WFSPCCVW.js.map +1 -0
  103. package/dist/{chunk-27EPWVOY.js → chunk-WXA2BWTE.js} +7 -3
  104. package/dist/chunk-WXA2BWTE.js.map +1 -0
  105. package/dist/chunk-WYXUQGOL.js +191 -0
  106. package/dist/chunk-WYXUQGOL.js.map +1 -0
  107. package/dist/chunk-X5ZBP3IY.js +97 -0
  108. package/dist/chunk-X5ZBP3IY.js.map +1 -0
  109. package/dist/{chunk-MNXS2U45.js → chunk-ZDZERB6L.js} +206 -297
  110. package/dist/chunk-ZDZERB6L.js.map +1 -0
  111. package/dist/chunk-ZNNXRNFD.js +113 -0
  112. package/dist/chunk-ZNNXRNFD.js.map +1 -0
  113. package/dist/{chunk-FW75G2W4.js → chunk-ZURZHELF.js} +5 -5
  114. package/dist/{cli-D5OE3URZ.js → cli-E36SPKBW.js} +145 -64
  115. package/dist/{cli-D5OE3URZ.js.map → cli-E36SPKBW.js.map} +1 -1
  116. package/dist/{codex-event-PPNVRRDH.js → codex-event-ZO2GEFE6.js} +2 -2
  117. package/dist/{codex-host-2RJOJW2B.js → codex-host-KECJVTA2.js} +7 -6
  118. package/dist/codex-install-HQZDGFXW.js +436 -0
  119. package/dist/codex-install-HQZDGFXW.js.map +1 -0
  120. package/dist/{config-ZD4OB2DO.js → config-HY2E4GGW.js} +21 -17
  121. package/dist/doctor-I6XQEKWD.js +1323 -0
  122. package/dist/doctor-I6XQEKWD.js.map +1 -0
  123. package/dist/{env-proxy-XL4P73MZ.js → env-proxy-R6ZMLQTT.js} +6 -2
  124. package/dist/{ethersCompat-Df4a6QIZ-THAVUGIJ.js → ethersCompat-Df4a6QIZ-X6YZWAML.js} +3 -3
  125. package/dist/{fund-5ITKQGYF.js → fund-2QRO7OJL.js} +43 -37
  126. package/dist/{fund-5ITKQGYF.js.map → fund-2QRO7OJL.js.map} +1 -1
  127. package/dist/hook-command-2UBCSZG6.js +43 -0
  128. package/dist/hosts/claude/.claude-plugin/marketplace.json +2 -2
  129. package/dist/hosts/claude/tenjin/.claude-plugin/plugin.json +2 -2
  130. package/dist/hosts/claude/tenjin/hooks/register.tsx +51 -11
  131. package/dist/hosts/claude/tenjin/skills/tenjin-pay/SKILL.md +82 -0
  132. package/dist/hosts/claude/tenjin/types/index.d.ts +2 -1
  133. package/dist/hosts/codex/tenjin/.mcp.json +3 -0
  134. package/dist/hosts/codex/tenjin/hooks/hooks.json +51 -5
  135. package/dist/hosts-DVQJ32QC.js +38 -0
  136. package/dist/index.js +32 -11
  137. package/dist/index.js.map +1 -1
  138. package/dist/install-ILUX5C4A.js +107 -0
  139. package/dist/{install-identity-K7EJIQFP.js → install-identity-TZKGY6LQ.js} +11 -10
  140. package/dist/install-wallet-5M4OTYLX.js +281 -0
  141. package/dist/install-wallet-5M4OTYLX.js.map +1 -0
  142. package/dist/isows-native-Q2UDIVPT.js +9 -0
  143. package/dist/isows-native-Q2UDIVPT.js.map +1 -0
  144. package/dist/{mcp-3LIJSSJB.js → mcp-LE4DUS22.js} +785 -211
  145. package/dist/mcp-LE4DUS22.js.map +1 -0
  146. package/dist/{mine.wasm-6PIT3DK6.js → mine.wasm-QFAHIFPY.js} +2 -2
  147. package/dist/{mine.wasm-6PIT3DK6.js.map → mine.wasm-QFAHIFPY.js.map} +1 -1
  148. package/dist/{package-ZKQFDWLE.js → package-IJFGMWEV.js} +4 -2
  149. package/dist/passphrase-IFTDS3CU.js +44 -0
  150. package/dist/{paths-POPTXJO6.js → paths-XCSAKISU.js} +10 -2
  151. package/dist/{pay-WHBERZ3W.js → pay-WCG3IH4R.js} +29 -29
  152. package/dist/{payments-KVICEKD2.js → payments-HFPPWHTV.js} +15 -14
  153. package/dist/{payments-KVICEKD2.js.map → payments-HFPPWHTV.js.map} +1 -1
  154. package/dist/plugin-registration-PZFI5GZW.js +68 -0
  155. package/dist/{redact-6W23GGJC.js → redact-D7ASVWKL.js} +2 -2
  156. package/dist/runtime-UZOKSUZX.js +1321 -0
  157. package/dist/runtime-UZOKSUZX.js.map +1 -0
  158. package/dist/runtime-fetch-ZSSSK72Y.js +23 -0
  159. package/dist/runtime-layout-WIDILZ6K.js +25 -0
  160. package/dist/{send-7G7Y7DLN.js → send-GCVEAQKL.js} +24 -22
  161. package/dist/{send-7G7Y7DLN.js.map → send-GCVEAQKL.js.map} +1 -1
  162. package/dist/{status-OF7RH5HM.js → status-HCVAOCN7.js} +55 -25
  163. package/dist/status-HCVAOCN7.js.map +1 -0
  164. package/dist/{status-line-XOUE6MPL.js → status-line-OPCXDHL2.js} +10 -9
  165. package/dist/{status-line-XOUE6MPL.js.map → status-line-OPCXDHL2.js.map} +1 -1
  166. package/dist/uninstall-BAWRBXXQ.js +481 -0
  167. package/dist/uninstall-BAWRBXXQ.js.map +1 -0
  168. package/dist/update-CACXLQLR.js +56 -0
  169. package/dist/update-CACXLQLR.js.map +1 -0
  170. package/dist/{usdc-OGOGEHV2.js → usdc-VG4CIOUK.js} +6 -8
  171. package/dist/usdc-VG4CIOUK.js.map +1 -0
  172. package/dist/{viemAdapter-By13KInL-S3DA7DFW.js → viemAdapter-By13KInL-DOFTEIJV.js} +3 -3
  173. package/dist/viemAdapter-By13KInL-DOFTEIJV.js.map +1 -0
  174. package/dist/wallet-QL4UUXEZ.js +55 -0
  175. package/dist/wallet-QL4UUXEZ.js.map +1 -0
  176. package/dist/wallet-kdf-worker.mjs +8 -8
  177. package/docs/agent-permissions.md +50 -28
  178. package/docs/safety-model.md +1 -1
  179. package/docs/troubleshooting.md +72 -1
  180. package/package.json +17 -4
  181. package/scripts/installers/install.ps1 +67 -0
  182. package/scripts/installers/install.sh +68 -0
  183. package/dist/_esm-C5CRWCYU.js +0 -3737
  184. package/dist/_esm-C5CRWCYU.js.map +0 -1
  185. package/dist/ccip-NLCSCHKI.js +0 -19
  186. package/dist/chunk-27EPWVOY.js.map +0 -1
  187. package/dist/chunk-2XLC3AEX.js.map +0 -1
  188. package/dist/chunk-4ZZO6ULA.js.map +0 -1
  189. package/dist/chunk-5C32RLTA.js.map +0 -1
  190. package/dist/chunk-5IEP5EGE.js +0 -5332
  191. package/dist/chunk-5IEP5EGE.js.map +0 -1
  192. package/dist/chunk-5MARFNSB.js.map +0 -1
  193. package/dist/chunk-77TCKDEC.js.map +0 -1
  194. package/dist/chunk-7EKYXMUO.js +0 -7536
  195. package/dist/chunk-7EKYXMUO.js.map +0 -1
  196. package/dist/chunk-7QKHZQKW.js.map +0 -1
  197. package/dist/chunk-AGZ7PJKY.js.map +0 -1
  198. package/dist/chunk-AKWGE6JQ.js.map +0 -1
  199. package/dist/chunk-BL3332HQ.js +0 -7611
  200. package/dist/chunk-BL3332HQ.js.map +0 -1
  201. package/dist/chunk-D65GNPS3.js.map +0 -1
  202. package/dist/chunk-EGELTSPU.js +0 -2865
  203. package/dist/chunk-EGELTSPU.js.map +0 -1
  204. package/dist/chunk-GA7JETVM.js +0 -150
  205. package/dist/chunk-GA7JETVM.js.map +0 -1
  206. package/dist/chunk-I3EQFHCD.js +0 -175
  207. package/dist/chunk-I3EQFHCD.js.map +0 -1
  208. package/dist/chunk-K3I7C2MO.js +0 -1185
  209. package/dist/chunk-K3I7C2MO.js.map +0 -1
  210. package/dist/chunk-K72RURN3.js.map +0 -1
  211. package/dist/chunk-KXVP2VKA.js.map +0 -1
  212. package/dist/chunk-LEFIX6RS.js.map +0 -1
  213. package/dist/chunk-MNXS2U45.js.map +0 -1
  214. package/dist/chunk-NEFNKLBE.js.map +0 -1
  215. package/dist/chunk-OHRR5OYM.js.map +0 -1
  216. package/dist/chunk-P4NH7OUK.js.map +0 -1
  217. package/dist/chunk-QSCPK4F5.js.map +0 -1
  218. package/dist/chunk-SJLTEINJ.js.map +0 -1
  219. package/dist/chunk-TTNESUPQ.js.map +0 -1
  220. package/dist/chunk-UKY4CHNC.js.map +0 -1
  221. package/dist/chunk-V6BSF6OC.js +0 -260
  222. package/dist/chunk-V6BSF6OC.js.map +0 -1
  223. package/dist/chunk-YVFXE7RR.js.map +0 -1
  224. package/dist/codex-install-UUZ6QMBQ.js +0 -221
  225. package/dist/codex-install-UUZ6QMBQ.js.map +0 -1
  226. package/dist/doctor-KBR34Q4B.js +0 -601
  227. package/dist/doctor-KBR34Q4B.js.map +0 -1
  228. package/dist/hook-command-4TYCHHRL.js +0 -39
  229. package/dist/hosts-FWZOV26H.js.map +0 -1
  230. package/dist/install-XWGE4Q7L.js +0 -77
  231. package/dist/install-wallet-XQ6XFZV4.js +0 -117
  232. package/dist/install-wallet-XQ6XFZV4.js.map +0 -1
  233. package/dist/mcp-3LIJSSJB.js.map +0 -1
  234. package/dist/plugin-registration-5TIA564H.js +0 -54
  235. package/dist/status-OF7RH5HM.js.map +0 -1
  236. package/dist/uninstall-JXUAFNDB.js +0 -158
  237. package/dist/uninstall-JXUAFNDB.js.map +0 -1
  238. package/dist/update-ZKUERSO2.js +0 -44
  239. package/dist/wallet-2HA6W4R4.js +0 -43
  240. /package/dist/{_esm-MEXZI5DL.js.map → _esm-BIN7VY2L.js.map} +0 -0
  241. /package/dist/{alive-J64H46HI.js.map → alive-GSOWKUOY.js.map} +0 -0
  242. /package/dist/{ccip-7RMRLAGV.js.map → auto-update-Y24UL56V.js.map} +0 -0
  243. /package/dist/{ccip-NLCSCHKI.js.map → ccip-DHDFKTQV.js.map} +0 -0
  244. /package/dist/{chunk-UQUOVWBG.js.map → chunk-4K7TQHNP.js.map} +0 -0
  245. /package/dist/{chunk-KXQ4UIP7.js.map → chunk-4USCZ2NI.js.map} +0 -0
  246. /package/dist/{chunk-YFPY4ONH.js.map → chunk-AGMVASXZ.js.map} +0 -0
  247. /package/dist/{chunk-5K5W4S66.js.map → chunk-GTTUCOPD.js.map} +0 -0
  248. /package/dist/{chunk-ORWL5BSN.js.map → chunk-HGZEPQUT.js.map} +0 -0
  249. /package/dist/{chunk-7Q5FDF65.js.map → chunk-IE7P2BZE.js.map} +0 -0
  250. /package/dist/{chunk-WK7F3B2E.js.map → chunk-SO3XRZPX.js.map} +0 -0
  251. /package/dist/{chunk-B7HUUJOK.js.map → chunk-TKPF35W6.js.map} +0 -0
  252. /package/dist/{chunk-7ZRL2LBQ.js.map → chunk-V2LQLN5H.js.map} +0 -0
  253. /package/dist/{chunk-FW75G2W4.js.map → chunk-ZURZHELF.js.map} +0 -0
  254. /package/dist/{codex-event-PPNVRRDH.js.map → codex-event-ZO2GEFE6.js.map} +0 -0
  255. /package/dist/{codex-host-2RJOJW2B.js.map → codex-host-KECJVTA2.js.map} +0 -0
  256. /package/dist/{config-ZD4OB2DO.js.map → config-HY2E4GGW.js.map} +0 -0
  257. /package/dist/{env-proxy-XL4P73MZ.js.map → env-proxy-R6ZMLQTT.js.map} +0 -0
  258. /package/dist/{ethersCompat-Df4a6QIZ-THAVUGIJ.js.map → ethersCompat-Df4a6QIZ-X6YZWAML.js.map} +0 -0
  259. /package/dist/{hook-command-4TYCHHRL.js.map → hook-command-2UBCSZG6.js.map} +0 -0
  260. /package/dist/{install-XWGE4Q7L.js.map → hosts-DVQJ32QC.js.map} +0 -0
  261. /package/dist/{install-identity-K7EJIQFP.js.map → install-ILUX5C4A.js.map} +0 -0
  262. /package/dist/{package-ZKQFDWLE.js.map → install-identity-TZKGY6LQ.js.map} +0 -0
  263. /package/dist/{paths-POPTXJO6.js.map → package-IJFGMWEV.js.map} +0 -0
  264. /package/dist/{pay-WHBERZ3W.js.map → passphrase-IFTDS3CU.js.map} +0 -0
  265. /package/dist/{plugin-registration-5TIA564H.js.map → paths-XCSAKISU.js.map} +0 -0
  266. /package/dist/{redact-6W23GGJC.js.map → pay-WCG3IH4R.js.map} +0 -0
  267. /package/dist/{update-ZKUERSO2.js.map → plugin-registration-PZFI5GZW.js.map} +0 -0
  268. /package/dist/{usdc-OGOGEHV2.js.map → redact-D7ASVWKL.js.map} +0 -0
  269. /package/dist/{viemAdapter-By13KInL-S3DA7DFW.js.map → runtime-fetch-ZSSSK72Y.js.map} +0 -0
  270. /package/dist/{wallet-2HA6W4R4.js.map → runtime-layout-WIDILZ6K.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/router/alive.ts","../src/lib/wallet-facts.ts","../src/router/notice-markers.ts"],"sourcesContent":["import { createHash } from 'node:crypto';\nimport { mkdir, readdir, readFile, rm, rmdir, stat, writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { DEFAULT_MAX_AUTO_SPEND } from '../lib/config';\nimport { configPath, walletPath } from '../lib/paths';\nimport {\n DEFAULT_RPC_URL,\n readUsdcBalanceWithFallback,\n rememberingBalanceReader,\n} from '../lib/usdc-balance';\nimport { readWalletFacts } from '../lib/wallet-facts';\nimport { noticeFor } from './notice-markers';\nimport { sessionStartMessage } from './wallet-reasons';\n\n/**\n * THE PLUGIN SAYS IT IS HERE. While a machine carries both the plugin and the\n * settings install it replaces, every event would run two sets of routing legs\n * and offer the same lookup twice. The plugin's `SessionStart` entry runs\n * `tenjin hook alive` before any other event of the session, and it writes:\n *\n * - a per-session marker, which every leg a settings install launched checks\n * first, staying silent in a session the plugin serves;\n * - a per-machine stamp, the proof the guarded migration waits for: the plugin\n * has loaded in a real session on this machine at least once, so the\n * settings install can be removed without leaving the machine unrouted.\n *\n * Outside `progress/`, whose files are pruned after ten minutes. Markers are\n * pruned here after a week, which outlasts any session that still matters.\n *\n * SHIM: the per-session check goes on or after 2026-12-01, the first release\n * cut 30 or more days after the plugin PR 2 ships; the stamp stays for doctor.\n *\n * It also says, once, when the wallet's FILES already show it cannot sign in\n * this session ({@link walletAtStart}). That is a file fact, not a verdict:\n * `alive` never unlocks, never execs, never reads a keychain and never replays\n * what a router saw (Q4). Everything else waits for the router's first notice.\n */\n\nconst MARKER_TTL_MS = 7 * 24 * 60 * 60 * 1000;\nconst STAMP = 'plugin-loaded.json';\n/** A session id names a file only through its hash, so any string is safe. */\nconst MAX_SESSION_ID = 200;\n\nexport function aliveDir(dataDir: string): string {\n return join(dataDir, 'alive');\n}\n\nfunction markerName(sessionId: string): string {\n return createHash('sha256').update(sessionId).digest('hex').slice(0, 32);\n}\n\nfunction sessionIdOf(event: unknown): string | null {\n if (event === null || typeof event !== 'object') return null;\n const id = (event as { session_id?: unknown }).session_id;\n return typeof id === 'string' && id.length > 0 && id.length <= MAX_SESSION_ID ? id : null;\n}\n\nexport interface AliveStamp {\n at: string;\n /** The CLI version whose plugin loaded. */\n version: string;\n}\n\n/** What a `SessionStart` hook prints when the wallet cannot sign: one line for\n * the person, one for the model. */\nexport interface AliveAnswer {\n systemMessage: string;\n hookSpecificOutput: { hookEventName: 'SessionStart'; additionalContext: string };\n}\n\n/**\n * The `alive` leg: marker, stamp, prune, then the wallet's files. It prints\n * only when the wallet file is unreadable or the saved passphrase file is gone\n * (with TENJIN_WALLET_PASSPHRASE unset), because a `SessionStart` hook's stdout\n * is added to the session's context and nothing else there is definite before\n * a router has tried to unlock; everything else waits for the router's first\n * notice. The answer carries the person's fix in `systemMessage` and the\n * model's `agentFix` in `additionalContext` (B1), and the reason's notice\n * marker is written so the session's first prompt leg does not say it again.\n * ({@link aliveMain} adds the balance notice as JSON when there is no answer.)\n * It never fails the session: every error is swallowed, and gives null.\n */\nexport async function runAliveHook(\n event: unknown,\n opts: { dataDir: string; version: string; now?: number; env?: NodeJS.ProcessEnv },\n): Promise<AliveAnswer | null> {\n const sessionId = sessionIdOf(event);\n const now = opts.now ?? Date.now();\n const dir = aliveDir(opts.dataDir);\n try {\n await mkdir(dir, { recursive: true, mode: 0o700 });\n if (sessionId !== null) {\n await writeFile(join(dir, markerName(sessionId)), `${new Date(now).toISOString()}\\n`);\n }\n const stamp: AliveStamp = { at: new Date(now).toISOString(), version: opts.version };\n await writeFile(join(dir, STAMP), `${JSON.stringify(stamp)}\\n`);\n await pruneMarkers(dir, now);\n } catch {\n // A marker that could not be written costs only a duplicate offer.\n }\n try {\n const reason = await walletAtStart(opts.dataDir, opts.env ?? process.env);\n if (reason === null) return null;\n const { systemMessage, additionalContext } = sessionStartMessage(reason);\n if (sessionId !== null) {\n await noticeFor(opts.dataDir, sessionId, reason, now).catch(() => undefined);\n }\n return {\n systemMessage,\n hookSpecificOutput: { hookEventName: 'SessionStart', additionalContext },\n };\n } catch {\n return null;\n }\n}\n\n/**\n * WHAT THE FILES ALONE SAY AT SESSION START, and only what is definite (Q4).\n * Filesystem only: one wallet.json read, the sidecar read and a few stats; no\n * exec, no keychain, no scrypt, and never the router's unlock-state, so it\n * cannot repeat a verdict that has since changed. In order:\n *\n * - a TENJIN_WALLET_KEY (valid or not) shadows the file, and whether it works\n * is the router's to report: null;\n * - no wallet.json: null, never `no_wallet`, because the person may have\n * installed with `--no-wallet` on purpose;\n * - a wallet.json nothing can read: `wallet_corrupt`;\n * - the sidecar names the file store, its `.plain` file is gone, and\n * TENJIN_WALLET_PASSPHRASE is unset: `passphrase_missing`;\n * - anything else: null.\n */\nexport async function walletAtStart(\n dataDir: string,\n env: NodeJS.ProcessEnv,\n): Promise<'wallet_corrupt' | 'passphrase_missing' | null> {\n const facts = await readWalletFacts(dataDir, env);\n if (facts.envKey !== 'absent') return null;\n if (facts.walletFile === 'absent') return null;\n if (facts.walletFile === 'unparsable') return 'wallet_corrupt';\n if (facts.passphraseFileMissing && !facts.envPassphraseSet) return 'passphrase_missing';\n return null;\n}\n\nasync function pruneMarkers(dir: string, now: number): Promise<void> {\n for (const name of await readdir(dir).catch(() => [] as string[])) {\n if (!/^[0-9a-f]{32}$/.test(name)) continue;\n const path = join(dir, name);\n const s = await stat(path).catch(() => null);\n if (s !== null && now - s.mtimeMs > MARKER_TTL_MS) await rm(path, { force: true });\n }\n}\n\n/** Has the plugin's `alive` leg marked this session? False on any doubt. */\nexport async function sessionServedByPlugin(dataDir: string, event: unknown): Promise<boolean> {\n const sessionId = sessionIdOf(event);\n if (sessionId === null) return false;\n return (await stat(join(aliveDir(dataDir), markerName(sessionId))).catch(() => null)) !== null;\n}\n\n/** The machine's stamp, or null when the plugin has never loaded here. */\nexport async function readAliveStamp(dataDir: string): Promise<AliveStamp | null> {\n try {\n const parsed = JSON.parse(await readFile(join(aliveDir(dataDir), STAMP), 'utf8')) as unknown;\n if (parsed === null || typeof parsed !== 'object') return null;\n const { at, version } = parsed as { at?: unknown; version?: unknown };\n return typeof at === 'string' && typeof version === 'string' ? { at, version } : null;\n } catch {\n return null;\n }\n}\n\n/** `uninstall`: the markers and the stamp, and nothing else under the data dir. */\nexport async function removeAliveState(dataDir: string): Promise<boolean> {\n const dir = aliveDir(dataDir);\n const existed = (await stat(dir).catch(() => null)) !== null;\n if (!existed) return false;\n for (const name of await readdir(dir).catch(() => [] as string[])) {\n if (name === STAMP || /^[0-9a-f]{32}$/.test(name)) await rm(join(dir, name), { force: true });\n }\n // Only when empty: a file somebody else put there keeps the folder.\n await rmdir(dir).catch(() => undefined);\n return true;\n}\n\n/** How long the leg waits on a balance read before it says nothing. */\nexport const WALLET_READ_MS = 2_000;\n\n/**\n * THE WALLET, SAID TO THE PERSON AT THE START OF A SESSION while it cannot\n * pay: the leg's `systemMessage`, which Claude Code shows the user and never\n * the model, on every surface and without the mod. Null when there is no\n * wallet, the balance could not be read in time, or the wallet holds at least\n * the per-call limit.\n */\nexport async function walletNotice(\n dataDir: string,\n opts: { read?: typeof readUsdcBalanceWithFallback; timeoutMs?: number } = {},\n): Promise<string | null> {\n const wallet = await readJson(walletPath(dataDir));\n const address = typeof wallet?.address === 'string' ? wallet.address : undefined;\n if (address === undefined || !/^0x[0-9a-fA-F]{40}$/.test(address)) return null;\n const config = await readJson(configPath(dataDir));\n const rpcUrl = typeof config?.rpcUrl === 'string' ? config.rpcUrl : DEFAULT_RPC_URL;\n const timeoutMs = opts.timeoutMs ?? WALLET_READ_MS;\n const read = rememberingBalanceReader(dataDir, {\n ...(opts.read !== undefined ? { read: opts.read } : {}),\n });\n const balance = await read(address, rpcUrl, { timeoutMs });\n if (balance === null) return null;\n // The per-call limit as the spend policy reads it: the file's, else the default.\n const cap = BigInt(\n typeof config?.maxAutoSpend === 'string' && /^\\d{1,30}$/.test(config.maxAutoSpend)\n ? config.maxAutoSpend\n : DEFAULT_MAX_AUTO_SPEND,\n );\n if (balance > 0n && balance >= cap) return null;\n // Only the person reads it, inside the session: they ask, the agent runs it.\n return `Tenjin balance: $${dollars(balance)}. Ask your agent to add funds to Tenjin.`;\n}\n\n/** `$0.00`, `$0.10`, `$0.007`: whole cents keep two decimals. */\nfunction dollars(atomic: bigint): string {\n const fraction = (atomic % 1_000_000n).toString().padStart(6, '0').replace(/0+$/, '');\n return `${atomic / 1_000_000n}.${fraction.padEnd(2, '0')}`;\n}\n\nasync function readJson(path: string): Promise<Record<string, unknown> | null> {\n try {\n const value: unknown = JSON.parse(await readFile(path, 'utf8'));\n return value !== null && typeof value === 'object' ? (value as Record<string, unknown>) : null;\n } catch {\n return null;\n }\n}\n\n/**\n * The command form's entry, read off stdin: `tenjin hook alive`. It writes the\n * answer, when there is one, as one JSON line and WAITS for the write to land:\n * on macOS stdout to a pipe is asynchronous, and `src/index.ts` calls\n * `process.exit(0)` right after this returns, which would drop it. With no\n * answer from the wallet's files, it prints the balance notice\n * ({@link walletNotice}) as a JSON `systemMessage`, which Claude Code shows the\n * user; plain text would be added to the session's context. A wallet that\n * cannot sign is told that, never to add funds.\n */\nexport async function aliveMain(opts: {\n dataDir: string;\n version: string;\n env?: NodeJS.ProcessEnv;\n /** Test seams: the harness event and the stream the answer goes to. */\n readEvent?: () => Promise<string>;\n stdout?: Pick<NodeJS.WritableStream, 'write'>;\n}): Promise<void> {\n const raw = await (opts.readEvent ?? (() => readStdin(1_000)))().catch(() => '');\n const answer = await runAliveHook(parseEvent(raw), {\n dataDir: opts.dataDir,\n version: opts.version,\n ...(opts.env !== undefined ? { env: opts.env } : {}),\n });\n const notice = answer === null ? await walletNotice(opts.dataDir).catch(() => null) : null;\n const payload = answer ?? (notice !== null ? { systemMessage: notice } : null);\n if (payload === null) return;\n const out = opts.stdout ?? process.stdout;\n await new Promise<void>((resolve) => {\n try {\n out.write(`${JSON.stringify(payload)}\\n`, () => resolve());\n } catch {\n resolve();\n }\n });\n}\n\nfunction parseEvent(raw: string): unknown {\n try {\n return JSON.parse(raw) as unknown;\n } catch {\n return null;\n }\n}\n\nfunction readStdin(timeoutMs: number): Promise<string> {\n return new Promise((resolve, reject) => {\n const chunks: Buffer[] = [];\n let size = 0;\n const timer = setTimeout(() => reject(new Error('no harness event')), timeoutMs);\n process.stdin.on('data', (chunk: Buffer) => {\n size += chunk.length;\n if (size > 1_000_000) {\n clearTimeout(timer);\n reject(new Error('harness event too large'));\n return;\n }\n chunks.push(chunk);\n });\n process.stdin.once('end', () => {\n clearTimeout(timer);\n resolve(Buffer.concat(chunks).toString('utf8'));\n });\n process.stdin.once('error', () => {\n clearTimeout(timer);\n reject(new Error('harness event unreadable'));\n });\n });\n}\n\n/**\n * A plugin leg marks its own session too, for a session that loaded the plugin\n * without a `SessionStart` (a `/reload-plugins` mid-session): from the next\n * event on, the settings install's legs there stay silent. A stat when the\n * marker is already there.\n */\nexport async function markSessionServed(dataDir: string, event: unknown): Promise<void> {\n const sessionId = sessionIdOf(event);\n if (sessionId === null) return;\n const path = join(aliveDir(dataDir), markerName(sessionId));\n if ((await stat(path).catch(() => null)) !== null) return;\n try {\n await mkdir(aliveDir(dataDir), { recursive: true, mode: 0o700 });\n await writeFile(path, `${new Date().toISOString()}\\n`);\n } catch {\n // Costs only a duplicate offer.\n }\n}\n","import { readFile, stat } from 'node:fs/promises';\nimport { hasCode } from './errno';\nimport { readPassphraseRecord } from './passphrase-record';\nimport { passphraseFilePathFor, passphraseRecordPath, walletPath } from './paths';\nimport { PRIVATE_KEY_RE, type DurableStore } from './wallet-unlock';\n\n/**\n * WHAT THE FILES SAY ABOUT THE WALLET, without unlocking it. The hooks, `alive`\n * and the routing payer's memo need to know \"is there a wallet, is it readable,\n * where was its passphrase saved, and did any of that change\" on every prompt,\n * and none of them may load the wallet layer (`src/router/dist-chunks.test.ts`)\n * or pay for a keychain read or an scrypt to find out.\n *\n * So this reads only: wallet.json's cleartext address, the sidecar, two or three\n * `stat`s, and the environment. It never execs and never throws; anything it\n * cannot read is reported as the fact it is (`unparsable`, null), and deciding\n * what that means is `src/router/eligibility.ts`'s job.\n */\nexport interface WalletFacts {\n /** TENJIN_WALLET_KEY trimmed vs PRIVATE_KEY_RE (S12); whitespace-only = absent. */\n envKey: 'absent' | 'valid' | 'malformed';\n /** unparsable = unreadable, bad JSON, or no valid address. */\n walletFile: 'present' | 'absent' | 'unparsable';\n /** Cleartext top-level address of wallet.json. */\n address: string | null;\n envPassphraseSet: boolean;\n /** Sidecar entry for `address`. */\n passphraseStore: DurableStore | null;\n /** Sidecar says 'file' and the .plain file is absent. */\n passphraseFileMissing: boolean;\n walletMtimeMs: number | null;\n sidecarMtimeMs: number | null;\n}\n\n/** The same address test `hooks.ts` applies to wallet.json's cleartext field. */\nconst ADDRESS_RE = /^0x[0-9a-fA-F]{40}$/;\n\n/**\n * Read {@link WalletFacts} for `dataDir` under `env`. Never rejects.\n *\n * `envKey` runs the exact test `loadCredential` (src/lib/wallet/local.ts)\n * runs, through the one shared {@link PRIVATE_KEY_RE}, so a key these facts\n * call valid is one the signer accepts. The env passphrase counts as set only\n * when non-empty, as the passphrase resolver treats it.\n */\nexport async function readWalletFacts(\n dataDir: string,\n env: NodeJS.ProcessEnv,\n): Promise<WalletFacts> {\n const key = env.TENJIN_WALLET_KEY?.trim() ?? '';\n const envKey: WalletFacts['envKey'] =\n key.length === 0 ? 'absent' : PRIVATE_KEY_RE.test(key) ? 'valid' : 'malformed';\n const passphrase = env.TENJIN_WALLET_PASSPHRASE;\n const envPassphraseSet = passphrase !== undefined && passphrase.length > 0;\n\n const { walletFile, address } = await readWalletAddress(dataDir);\n const [walletMtimeMs, sidecarMtimeMs] = await Promise.all([\n mtimeOf(walletPath(dataDir)),\n mtimeOf(passphraseRecordPath(dataDir)),\n ]);\n\n let passphraseStore: DurableStore | null = null;\n let passphraseFileMissing = false;\n if (address !== null) {\n passphraseStore =\n (await readPassphraseRecord(dataDir, address).catch(() => null))?.store ?? null;\n if (passphraseStore === 'file') {\n // Only a definite ENOENT is \"missing\". Any other stat failure says\n // nothing about whether the file is there, so it claims nothing.\n passphraseFileMissing = await stat(passphraseFilePathFor(address.toLowerCase(), dataDir))\n .then(() => false)\n .catch((err: unknown) => hasCode(err, 'ENOENT'));\n }\n }\n\n return {\n envKey,\n walletFile,\n address,\n envPassphraseSet,\n passphraseStore,\n passphraseFileMissing,\n walletMtimeMs,\n sidecarMtimeMs,\n };\n}\n\n/** `${walletMtimeMs}:${sidecarMtimeMs}`, the stamp the payer memo compares. */\nexport function unlockStamp(f: Pick<WalletFacts, 'walletMtimeMs' | 'sidecarMtimeMs'>): string {\n return `${f.walletMtimeMs}:${f.sidecarMtimeMs}`;\n}\n\n/** wallet.json's state and cleartext address. ENOENT is absent; any other\n * failure to read or understand it is unparsable. */\nasync function readWalletAddress(\n dataDir: string,\n): Promise<Pick<WalletFacts, 'walletFile' | 'address'>> {\n let text: string;\n try {\n text = await readFile(walletPath(dataDir), 'utf8');\n } catch (err) {\n return { walletFile: hasCode(err, 'ENOENT') ? 'absent' : 'unparsable', address: null };\n }\n try {\n const record: unknown = JSON.parse(text);\n const address = (record as { address?: unknown } | null)?.address;\n return typeof address === 'string' && ADDRESS_RE.test(address)\n ? { walletFile: 'present', address }\n : { walletFile: 'unparsable', address: null };\n } catch {\n return { walletFile: 'unparsable', address: null };\n }\n}\n\nasync function mtimeOf(path: string): Promise<number | null> {\n try {\n return (await stat(path)).mtimeMs;\n } catch {\n return null;\n }\n}\n","import { createHash, randomBytes } from 'node:crypto';\nimport { mkdir, open, readFile, readdir, rename, rm } from 'node:fs/promises';\nimport { basename, dirname, join } from 'node:path';\nimport { writeFileAtomic } from '../lib/atomic-json';\nimport { hasCode } from '../lib/errno';\nimport type { UnlockReason } from '../lib/wallet-unlock';\nimport { WALLET_CLASS, walletClearedSentence } from './wallet-reasons';\n\n/**\n * WHAT A SESSION HAS ALREADY BEEN TOLD, on disk, because every hook leg is its\n * own process (or a fresh call into `tenjin mcp`) and none of them remembers\n * the last. Under `<dataDir>/router/notices`:\n *\n * <sha32> the old once-per-session marker ({@link firstNoticeFor})\n * <sha32>-<sha8> told this session this reason ({@link noticeFor})\n * <sha32>.current `${at}\\n${why}`: the reason told last, or `cleared`\n *\n * `<sha32>` is the first 32 hex of sha256(session id) and `<sha8>` the first 8\n * of sha256(reason), so neither a session id nor a reason ever names a file.\n *\n * ONCE PER (SESSION, REASON), WITH A CLEAR LINE (decision 15). A wallet that\n * goes from \"no passphrase\" to \"wrong passphrase\" is news twice; the same\n * reason on every prompt is news once. Once a paid call succeeds after a\n * wallet-class reason was told, the session hears that it cleared, once\n * ({@link noticeCleared}), and the reason's marker goes with it, so a relapse is\n * told again.\n *\n * Every file's FIRST line is the time it was written, and pruning reads only\n * that line, so old markers, new ones and `.current` all age out the same way:\n * a week after they were last written.\n *\n * Hook-safe: node, `lib/atomic-json`, `lib/errno` and the reason strings.\n */\n\n/** How long a session's notice marker is kept. */\nconst NOTICE_KEEP_MS = 7 * 86_400_000;\n\n/** What `.current` says once the reason told last has been cleared. */\nconst CLEARED = 'cleared';\n\n/** Every reason {@link settleCurrent} clears: the unlock reasons and the\n * unclassified fallback, all of which \"Tenjin wallet unlocked.\" answers. */\nconst UNLOCK_CLASS: ReadonlyArray<UnlockReason | 'wallet_locked'> = [\n 'no_wallet',\n 'wallet_corrupt',\n 'env_key_invalid',\n 'passphrase_missing',\n 'passphrase_wrong',\n 'env_passphrase_wrong',\n 'keychain_locked',\n 'unlock_timeout',\n 'wallet_locked',\n];\n\nfunction noticesDir(dataDir: string): string {\n return join(dataDir, 'router', 'notices');\n}\n\nfunction sessionHash(sessionId: string): string {\n return createHash('sha256').update(sessionId).digest('hex').slice(0, 32);\n}\n\nfunction reasonMarker(dataDir: string, sessionId: string, why: string): string {\n const reason = createHash('sha256').update(why).digest('hex').slice(0, 8);\n return join(noticesDir(dataDir), `${sessionHash(sessionId)}-${reason}`);\n}\n\nfunction currentPath(dataDir: string, sessionId: string): string {\n return join(noticesDir(dataDir), `${sessionHash(sessionId)}.current`);\n}\n\n/** Record the reason told last (or `cleared`), atomically: two legs at once\n * leave one whole answer, never a torn one. */\nasync function writeCurrent(\n dataDir: string,\n sessionId: string,\n now: number,\n why: string,\n): Promise<void> {\n await writeFileAtomic(currentPath(dataDir, sessionId), `${now}\\n${why}`, {\n mode: 0o600,\n dirMode: 0o700,\n });\n}\n\n/**\n * 'tell' ONCE PER (SESSION, REASON): the first caller creates the marker,\n * records `why` as the reason told last, and gets 'tell'; every later caller\n * for the same pair gets 'quiet'. A new reason is a new marker, so it is told.\n * Rejects only on an I/O failure other than \"already there\"; callers treat\n * that as quiet.\n */\nexport async function noticeFor(\n dataDir: string,\n sessionId: string,\n why: string,\n now: number,\n): Promise<'tell' | 'quiet'> {\n const created = await createExclusive(reasonMarker(dataDir, sessionId, why), String(now));\n if (!created) return 'quiet';\n await writeCurrent(dataDir, sessionId, now, why);\n await pruneNotices(dataDir, now);\n return 'tell';\n}\n\n/**\n * THE CLEAR LINE, after a paid call succeeded: `Tenjin wallet unlocked.` or\n * `Tenjin wallet funded.` when the reason told last in this session was a\n * wallet-class one, else null.\n *\n * CLAIM BY UNLINK. Two legs can finish paid calls at once and both read the\n * same `.current`; only the one that takes that reason's marker away returns\n * the sentence, so it is said once. Removing the marker is also what lets the\n * reason be told again if the wallet relapses. The take is a rename to a name\n * of this caller's own, then a remove: two concurrent `unlink`s of one path\n * were both seen to succeed on macOS, and a rename of one source has exactly\n * one winner.\n */\nexport async function noticeCleared(\n dataDir: string,\n sessionId: string,\n now: number,\n): Promise<string | null> {\n const text = await readFile(currentPath(dataDir, sessionId), 'utf8').catch(() => null);\n if (text === null) return null;\n const why = text.split('\\n')[1] ?? '';\n if (!WALLET_CLASS.has(why)) return null;\n const marker = reasonMarker(dataDir, sessionId, why);\n const claimed = join(\n dirname(marker),\n `.${basename(marker)}.${randomBytes(6).toString('hex')}.claimed`,\n );\n try {\n await rename(marker, claimed);\n } catch {\n // Another leg claimed it (ENOENT), or it cannot be touched: say nothing.\n return null;\n }\n await rm(claimed, { force: true }).catch(() => undefined);\n await writeCurrent(dataDir, sessionId, now, CLEARED);\n return walletClearedSentence(why);\n}\n\n/**\n * The router's wallet news already said `Tenjin wallet unlocked.` on this\n * session's leg: mark the reason told last as cleared, so a later paid call\n * does not say it twice, and drop the markers of every unlock reason, so a\n * relapse is told again.\n */\nexport async function settleCurrent(\n dataDir: string,\n sessionId: string,\n now: number,\n): Promise<void> {\n await writeCurrent(dataDir, sessionId, now, CLEARED);\n await Promise.all(\n UNLOCK_CLASS.map((why) =>\n rm(reasonMarker(dataDir, sessionId, why), { force: true }).catch(() => undefined),\n ),\n );\n}\n\n/**\n * TRUE ONCE PER SESSION: the first caller for a session id creates its marker\n * and gets true; every later one gets false. Each marker holds the time it was\n * made, and those older than a week go on the way past, so the directory does\n * not grow with every session ever run.\n */\nexport async function firstNoticeFor(\n dataDir: string,\n sessionId: string,\n now: number,\n): Promise<boolean> {\n const created = await createExclusive(\n join(noticesDir(dataDir), sessionHash(sessionId)),\n String(now),\n );\n if (created) await pruneNotices(dataDir, now);\n return created;\n}\n\n/**\n * Remove every notice file whose first line is not a time, or is a time more\n * than a week before `now`. Only the first line: `.current` carries its reason\n * on the second, and must age like any marker rather than look malformed.\n *\n * Skipped: a dot-file (another leg's `.current` mid-rename) and an empty file\n * (another leg's marker between its exclusive create and its write), so a prune\n * never pulls a file out from under a writer.\n */\nasync function pruneNotices(dataDir: string, now: number): Promise<void> {\n const dir = noticesDir(dataDir);\n for (const entry of await readdir(dir).catch(() => [] as string[])) {\n if (entry.startsWith('.')) continue;\n const path = join(dir, entry);\n const text = await readFile(path, 'utf8').catch(() => 'NaN');\n if (text.length === 0) continue;\n const at = Number(text.split('\\n')[0]);\n if (!Number.isFinite(at) || now - at > NOTICE_KEEP_MS) await rm(path, { force: true });\n }\n}\n\n/** Create `path` holding `body`, only if it is not already there: true when\n * this call made it, false on EEXIST, and any other failure rethrown. */\nexport async function createExclusive(path: string, body: string): Promise<boolean> {\n try {\n await mkdir(join(path, '..'), { recursive: true, mode: 0o700 });\n const handle = await open(path, 'wx', 0o600);\n try {\n await handle.writeFile(body);\n } finally {\n await handle.close();\n }\n return true;\n } catch (err) {\n if (hasCode(err, 'EEXIST')) return false;\n throw err;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,cAAAA,mBAAkB;AAC3B,SAAS,SAAAC,QAAO,WAAAC,UAAS,YAAAC,W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AC/E,YAAQ,MAAM,GAAG,QAAQ,CAAC,UAAkB;AAC1C,cAAQ,MAAM;AACd,UAAI,OAAO,KAAW;AACpB,qBAAa,KAAK;AAClB,eAAO,IAAI,MAAM,yBAAyB,CAAC;AAC3C;AAAA,MACF;AACA,aAAO,KAAK,KAAK;AAAA,IACnB,CAAC;AACD,YAAQ,MAAM,KAAK,OAAO,MAAM;AAC9B,mBAAa,KAAK;AAClB,cAAQ,OAAO,OAAO,MAAM,EAAE,SAAS,MAAM,CAAC;AAAA,IAChD,CAAC;AACD,YAAQ,MAAM,KAAK,SAAS,MAAM;AAChC,mBAAa,KAAK;AAClB,aAAO,IAAI,MAAM,0BAA0B,CAAC;AAAA,IAC9C,CAAC;AAAA,EACH,CAAC;AACH;AAQA,eAAsB,kBAAkB,SAAiB,OAA+B;AACtF,QAAM,YAAY,YAAY,KAAK;AACnC,MAAI,cAAc,KAAM;AACxB,QAAM,OAAON,MAAK,SAAS,OAAO,GAAG,WAAW,SAAS,CAAC;AAC1D,MAAK,MAAMI,MAAK,IAAI,EAAE,MAAM,MAAM,IAAI,MAAO,KAAM;AACnD,MAAI;AACF,UAAMF,OAAM,SAAS,OAAO,GAAG,EAAE,WAAW,MAAM,MAAM,IAAM,CAAC;AAC/D,UAAM,UAAU,MAAM,IAAG,oBAAI,KAAK,GAAE,YAAY,CAAC;AAAA,CAAI;AAAA,EACvD,QAAQ;AAAA,EAER;AACF;","names":["createHash","mkdir","readdir","readFile","rm","stat","join","readFile","readFile","readFile","join","createHash","mkdir","readdir","stat","rm","readFile"]}
@@ -11,6 +11,12 @@ function dataDir(env = process.env) {
11
11
  function defaultDataDir(home = homedir()) {
12
12
  return join(home, ".tenjin");
13
13
  }
14
+ function runtimeDir(dir = dataDir()) {
15
+ return join(dir, "runtime");
16
+ }
17
+ function launcherDir(home = homedir()) {
18
+ return join(home, ".local", "bin");
19
+ }
14
20
  function configPath(dir = dataDir()) {
15
21
  return join(dir, "config.json");
16
22
  }
@@ -44,6 +50,12 @@ function passphraseBlobPath(dir = dataDir()) {
44
50
  function passphraseBlobPathFor(account, dir = dataDir()) {
45
51
  return join(dir, `passphrase.${account}.dpapi`);
46
52
  }
53
+ function passphraseRecordPath(dir = dataDir()) {
54
+ return join(dir, "passphrase-store.json");
55
+ }
56
+ function passphraseFilePathFor(account, dir = dataDir()) {
57
+ return join(dir, `passphrase.${account}.plain`);
58
+ }
47
59
  function archivedWalletPath(account, dir = dataDir()) {
48
60
  return join(dir, `wallet.${account}.json.bak`);
49
61
  }
@@ -88,6 +100,8 @@ function quotesDir(dir = dataDir()) {
88
100
  export {
89
101
  dataDir,
90
102
  defaultDataDir,
103
+ runtimeDir,
104
+ launcherDir,
91
105
  configPath,
92
106
  walletPath,
93
107
  installIdPath,
@@ -99,6 +113,8 @@ export {
99
113
  hookHealthPath,
100
114
  passphraseBlobPath,
101
115
  passphraseBlobPathFor,
116
+ passphraseRecordPath,
117
+ passphraseFilePathFor,
102
118
  archivedWalletPath,
103
119
  loopDbPath,
104
120
  daemonTokenPath,
@@ -114,4 +130,4 @@ export {
114
130
  jobsDir,
115
131
  quotesDir
116
132
  };
117
- //# sourceMappingURL=chunk-SJLTEINJ.js.map
133
+ //# sourceMappingURL=chunk-OJNTCYQQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/paths.ts"],"sourcesContent":["import { homedir } from 'node:os';\nimport { join, resolve } from 'node:path';\n\n/**\n * Where the CLI keeps its config and wallet. Defaults to ~/.tenjin, overridable\n * via TENJIN_DATA_DIR (CI, ephemeral agents, and every test — which point it at\n * a temp dir so the real home is never touched).\n */\nexport function dataDir(env: NodeJS.ProcessEnv = process.env): string {\n const override = env.TENJIN_DATA_DIR;\n // Absolute, always: the daemon compares this string against its own\n // `data_dir` and is spawned with it as `cwd`, so a relative override must\n // mean the same directory from every process.\n if (override !== undefined && override.length > 0) return resolve(override);\n return defaultDataDir();\n}\n\n/**\n * The data dir a run with no override resolves. Split out of {@link dataDir} so\n * a caller holding a home directory can ask whether some other profile IS the\n * default one, without a second copy of the `.tenjin` literal.\n */\nexport function defaultDataDir(home: string = homedir()): string {\n return join(home, '.tenjin');\n}\n\n/**\n * Tenjin's own runtime: copies of the CLI, the Node that runs them and the\n * plugin folder Claude Code loads, so neither an npm folder nor the `node` on\n * PATH has to outlive an upgrade. Only the default data dir has one; see\n * `src/lib/runtime.ts`.\n */\nexport function runtimeDir(dir: string = dataDir()): string {\n return join(dir, 'runtime');\n}\n\n/**\n * Where the `tenjin` launcher goes: `~/.local/bin`, the folder the XDG layout\n * and most shells' defaults already put on PATH, and none of a Node version\n * manager's.\n */\nexport function launcherDir(home: string = homedir()): string {\n return join(home, '.local', 'bin');\n}\n\nexport function configPath(dir: string = dataDir()): string {\n return join(dir, 'config.json');\n}\n\nexport function walletPath(dir: string = dataDir()): string {\n return join(dir, 'wallet.json');\n}\n\n/**\n * The anonymous install id sent to Tenjin as `tenjin-install-id` (lib/install-identity).\n * Under the data dir so it survives upgrades and reinstalls of the CLI itself.\n */\nexport function installIdPath(dir: string = dataDir()): string {\n return join(dir, 'install-id');\n}\n\n/**\n * Where the delegated P-256 session key + its wallet-signed SIWX delegation are\n * cached (B3, D35). A short-lived (≤24h) hot key: lower stakes than wallet.json,\n * but still written 0600 and address-bound so a wallet change invalidates it.\n */\nexport function sessionPath(dir: string = dataDir()): string {\n return join(dir, 'session.json');\n}\n\n/**\n * Where the client-side rolling spend ledger lives (lib/wallet/spend.ts).\n *\n * Its own file, NOT session.json: the two schemas are incompatible and both\n * readers treat a parse failure as \"absent\", so a shared path meant each writer\n * silently destroyed the other's file — a session key wiped the spend window, and\n * the next spend wiped the session key.\n */\nexport function spendLedgerPath(dir: string = dataDir()): string {\n return join(dir, 'spend.json');\n}\n\n/**\n * The wallet's last USDC balance read (lib/usdc-balance). A pure cache, a\n * minute long: an unreadable file is simply read again from the chain.\n */\nexport function balanceCachePath(dir: string = dataDir()): string {\n return join(dir, 'balance.json');\n}\n\n/**\n * Where the once-a-day \"a newer tenjin-cli exists\" check caches the registry\n * answer. A pure cache: nothing here is authoritative, so an unreadable file is\n * simply re-fetched.\n */\nexport function updateCheckPath(dir: string = dataDir()): string {\n return join(dir, 'update-check.json');\n}\n\n/**\n * Where `install` writes the standalone harness hook scripts. Under the data dir\n * rather than the harness's own config directory: the scripts are ours, a harness\n * only ever holds the path to them, and one location serves every harness.\n */\nexport function hooksDir(dir: string = dataDir()): string {\n return join(dir, 'hooks');\n}\n\n/**\n * How the marketplace has been answering the dispatch hook lately, so a run of\n * failures stops the arm instead of paying the fetch budget per subagent through\n * an outage. Hook-written, unlocked, and cheap to lose, since a missing file\n * reads as \"healthy\". Its own file because two hooks writing one unlocked file\n * would erase each other.\n */\nexport function hookHealthPath(dir: string = dataDir()): string {\n return join(dir, 'hook-health.json');\n}\n\n/**\n * Where the LEGACY (pre-per-wallet) Windows DPAPI passphrase blob lives. The\n * file holds a DPAPI CurrentUser ciphertext, not the passphrase in plaintext.\n * New writes go to the per-wallet path below; this one is only read as a\n * migration fallback and removed after a verified per-wallet copy exists.\n */\nexport function passphraseBlobPath(dir: string = dataDir()): string {\n return join(dir, 'passphrase.dpapi');\n}\n\n/**\n * The per-wallet Windows DPAPI passphrase blob: one file per wallet address\n * (lowercase), so creating a new wallet never clobbers an old wallet's blob.\n * Only ever written on win32; other platforms use their own OS store.\n */\nexport function passphraseBlobPathFor(account: string, dir: string = dataDir()): string {\n return join(dir, `passphrase.${account}.dpapi`);\n}\n\n/**\n * The sidecar that records WHERE each wallet's passphrase was saved\n * (`src/lib/passphrase-record.ts`), keyed by lowercase address. A separate\n * file rather than a field in wallet.json, so the funded key file is never\n * rewritten and an older CLI still reads it. No sidecar means today's lookup\n * order, unchanged.\n */\nexport function passphraseRecordPath(dir: string = dataDir()): string {\n return join(dir, 'passphrase-store.json');\n}\n\n/**\n * The per-wallet passphrase FILE store: the plaintext passphrase, mode 0600 in\n * a 0700 directory, no trailing newline. Not encrypted; the same trade-off the\n * GitHub CLI makes with its `hosts.yml` token. Used only where no OS credential\n * store exists (headless Linux, WSL, a sandbox) or when the user chose\n * `--insecure-storage`; never as the fallback for a keychain that is merely\n * locked. One file per wallet address (lowercase), like the DPAPI blob above.\n */\nexport function passphraseFilePathFor(account: string, dir: string = dataDir()): string {\n return join(dir, `passphrase.${account}.plain`);\n}\n\n/**\n * Where `wallet create --replace` parks the outgoing wallet's keystore, keyed by\n * its lowercase address so successive replaces can never collide. Together with\n * the wallet's per-address passphrase entry in the OS store, this file keeps the\n * replaced wallet's funds recoverable; it is never read by the active-wallet\n * path.\n */\nexport function archivedWalletPath(account: string, dir: string = dataDir()): string {\n return join(dir, `wallet.${account}.json.bak`);\n}\n\n/**\n * The loop daemon's own state, all under the data dir (tenjin-notes\n * loop-redesign/02-redesign.md §4, §10).\n */\nexport function loopDbPath(dir: string = dataDir()): string {\n return join(dir, 'loop.db');\n}\n\n/** 32 random bytes, hex, 0600. Minted by `tenjin daemon start`, rotated only by\n * reinstall, NEVER deleted by the daemon: every transport reads it, and an idle\n * exit that removed it would strand them all. */\nexport function daemonTokenPath(dir: string = dataDir()): string {\n return join(dir, 'daemon.token');\n}\n\n/** `{ pid, port, started_at, data_dir }`, advisory: written after the bind,\n * removed at exit only by the process whose pid it names. Liveness is\n * `GET /health`, never this file alone. */\nexport function daemonPidPath(dir: string = dataDir()): string {\n return join(dir, 'daemon.pid');\n}\n\n/** Where a detached daemon's stdout and stderr go, and where the shim writes its\n * one `daemon-down` line when it cannot reach one. */\nexport function daemonLogPath(dir: string = dataDir()): string {\n return join(dir, 'daemon.log');\n}\n\n/** An empty file whose mtime is the last spawn attempt; the shim's backoff. */\nexport function daemonSpawnPath(dir: string = dataDir()): string {\n return join(dir, 'daemon.spawn');\n}\n\n/** The single-file daemon bundle `tenjin daemon start` copies from `dist`. */\nexport function daemonBundlePath(dir: string = dataDir()): string {\n return join(hooksDir(dir), 'tenjin-daemon.mjs');\n}\n\n/** The ensure-and-forward shim the two `command` hook entries run. */\nexport function shimBundlePath(dir: string = dataDir()): string {\n return join(hooksDir(dir), 'tenjin-shim.mjs');\n}\n\n/** Tenjin's own vitest reporter, copied beside the bundles. NOT A HOOK ENTRY\n * and never spawned: a repo's own `vitest.config.ts` imports it by this\n * absolute path, which is why `doctor` can hint at it verbatim. */\nexport const VITEST_REPORTER_FILE = 'tenjin-vitest-reporter.mjs';\n\nexport function vitestReporterPath(dir: string = dataDir()): string {\n return join(hooksDir(dir), VITEST_REPORTER_FILE);\n}\n\n/**\n * Where a router lookup that bought a file (a sound, an image) saves it. The\n * bytes cannot ride in the tool result, so the result names this file instead.\n */\nexport function downloadsDir(dir: string = dataDir()): string {\n return join(dir, 'downloads');\n}\n\n/**\n * One JSON line per paid router call: what was bought, from whom, for how much,\n * the settlement it carried and the files it saved. The user's own record; only\n * reconcile reads it back (`tenjin payments reconcile`, and the `request` tool's\n * pass beside each lookup), to settle what was left unknown.\n */\nexport function paidLedgerPath(dir: string = dataDir()): string {\n return join(dir, 'paid', 'ledger.jsonl');\n}\n\n/**\n * One file per take of a paid router call whose seller was still working when\n * the call ended: where to poll, until when, and what it saved. `request({job})`\n * resumes from it in any later process.\n */\nexport function jobsDir(dir: string = dataDir()): string {\n return join(dir, 'jobs');\n}\n\n/**\n * One file per quote: a router call over the automatic limits, kept with its\n * exact plan until the user approves it, it runs once, or it expires.\n */\nexport function quotesDir(dir: string = dataDir()): string {\n return join(dir, 'quotes');\n}\n"],"mappings":";;;AAAA,SAAS,eAAe;AACxB,SAAS,MAAM,eAAe;AAOvB,SAAS,QAAQ,MAAyB,QAAQ,KAAa;AACpE,QAAM,WAAW,IAAI;AAIrB,MAAI,aAAa,UAAa,SAAS,SAAS,EAAG,QAAO,QAAQ,QAAQ;AAC1E,SAAO,eAAe;AACxB;AAOO,SAAS,eAAe,OAAe,QAAQ,GAAW;AAC/D,SAAO,KAAK,MAAM,SAAS;AAC7B;AAQO,SAAS,WAAW,MAAc,QAAQ,GAAW;AAC1D,SAAO,KAAK,KAAK,SAAS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W,MAAc,QAAQ,GAAW;AAC1D,SAAO,KAAK,KAAK,SAAS;AAC5B;AAKO,SAAS,gBAAgB,MAAc,QAAQ,GAAW;AAC/D,SAAO,KAAK,KAAK,cAAc;AACjC;AAKO,SAAS,cAAc,MAAc,QAAQ,GAAW;AAC7D,SAAO,KAAK,KAAK,YAAY;AAC/B;AAIO,SAAS,cAAc,MAAc,QAAQ,GAAW;AAC7D,SAAO,KAAK,KAAK,YAAY;AAC/B;AAGO,SAAS,gBAAgB,MAAc,QAAQ,GAAW;AAC/D,SAAO,KAAK,KAAK,cAAc;AACjC;AAGO,SAAS,iBAAiB,MAAc,QAAQ,GAAW;AAChE,SAAO,KAAK,SAAS,GAAG,GAAG,mBAAmB;AAChD;AAGO,SAAS,eAAe,MAAc,QAAQ,GAAW;AAC9D,SAAO,KAAK,SAAS,GAAG,GAAG,iBAAiB;AAC9C;AAKO,IAAM,uBAAuB;AAE7B,SAAS,mBAAmB,MAAc,QAAQ,GAAW;AAClE,SAAO,KAAK,SAAS,GAAG,GAAG,oBAAoB;AACjD;AAMO,SAAS,aAAa,MAAc,QAAQ,GAAW;AAC5D,SAAO,KAAK,KAAK,WAAW;AAC9B;AAQO,SAAS,eAAe,MAAc,QAAQ,GAAW;AAC9D,SAAO,KAAK,KAAK,QAAQ,cAAc;AACzC;AAOO,SAAS,QAAQ,MAAc,QAAQ,GAAW;AACvD,SAAO,KAAK,KAAK,MAAM;AACzB;AAMO,SAAS,UAAU,MAAc,QAAQ,GAAW;AACzD,SAAO,KAAK,KAAK,QAAQ;AAC3B;","names":[]}
@@ -36,7 +36,6 @@ function codexRouterEvent(raw) {
36
36
  ...call,
37
37
  eventName: "PostToolUse",
38
38
  nativeOutcome: text === "" ? { error: "Web search returned no results" } : null,
39
- search: text === void 0 || split.entry.tool !== "WebSearch" ? null : { raw: {}, results: [] },
40
39
  savedPdf: null
41
40
  };
42
41
  }
@@ -45,14 +44,10 @@ function codexSession(sessionId) {
45
44
  }
46
45
  function codexResponse(response) {
47
46
  if (response === null || typeof response !== "object") return null;
48
- const output = response.hookSpecificOutput;
49
- if (output === void 0) return null;
50
- if (output.updatedToolOutput !== void 0) {
51
- const results = output.updatedToolOutput.results;
52
- if (typeof results?.[0] !== "string") return null;
53
- return { hookSpecificOutput: { hookEventName: "PostToolUse", additionalContext: results[0] } };
54
- }
55
- return { hookSpecificOutput: output };
47
+ const { hookSpecificOutput: output, systemMessage } = response;
48
+ const message = typeof systemMessage === "string" ? { systemMessage } : {};
49
+ if (output === void 0) return Object.keys(message).length > 0 ? message : null;
50
+ return { hookSpecificOutput: output, ...message };
56
51
  }
57
52
 
58
53
  export {
@@ -60,4 +55,4 @@ export {
60
55
  codexSession,
61
56
  codexResponse
62
57
  };
63
- //# sourceMappingURL=chunk-OHRR5OYM.js.map
58
+ //# sourceMappingURL=chunk-P3LFTKE7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/router/codex-event.ts"],"sourcesContent":["import { decode, splitWebrun } from '../adapters/codex-wire';\nimport type { HookEvent } from './hooks';\n\n/**\n * A Codex hook event as the router's arms read it: the root session's prompt,\n * and any `webrun` call holding a plain search or a URL open, read as that one\n * entry ({@link splitWebrun}) with the rest of the call beside it. A child's\n * task is ciphertext. Everything else is null. Codex has no\n * PostToolUseFailure and returns one text for the whole call, so the\n * after-call arm reads a shortfall only from an empty result.\n */\nexport function codexRouterEvent(raw: unknown): HookEvent | null {\n const input = decode(raw);\n if (input === null || input.agent !== undefined || input.session.length > 200) return null;\n const common = {\n sessionId: input.session,\n ...(input.cwd ? { cwd: input.cwd } : {}),\n ...(input.transcript?.path !== undefined ? { transcriptPath: input.transcript.path } : {}),\n };\n if (input.event === 'prompt' && input.prompt !== undefined)\n return { kind: 'prompt', ...common, prompt: input.prompt };\n const tool = input.tool;\n const toolInput = (raw as { tool_input?: unknown }).tool_input;\n if (tool?.name !== 'webrun' || toolInput === null || typeof toolInput !== 'object') return null;\n const split = splitWebrun(toolInput as Record<string, unknown>);\n if (split === null) return null;\n const call = {\n ...common,\n tool: split.entry.tool,\n pending: split.entry,\n ...(split.rest !== null ? { rest: split.rest } : {}),\n targets: split.targets,\n ...(tool.callId !== undefined ? { toolUseId: tool.callId } : {}),\n };\n if (input.event === 'tool.before') return { kind: 'native', ...call };\n if (input.event !== 'tool.after') return null;\n const text = tool.result?.text;\n return {\n kind: 'shortfall',\n ...call,\n eventName: 'PostToolUse',\n nativeOutcome: text === '' ? { error: 'Web search returned no results' } : null,\n savedPdf: null,\n };\n}\n\n/** Where a Codex session's local state lives, never shared with Claude's. */\nexport function codexSession(sessionId: string): string {\n return `codex:${sessionId}`;\n}\n\n/**\n * A Claude-shaped answer as Codex takes it: `hookSpecificOutput` as it is (a\n * deny, or a line after the call in `additionalContext`, such as a free\n * lookup noted on a search), and `systemMessage`, the line for the user (an\n * unpaid routing fee, a deposit): Codex takes it on every event and shows it\n * as a warning (openai/codex `hooks/src/events/*.rs`, CLI 0.157.1). Nothing\n * else survives, because Codex refuses an answer carrying a field it does not\n * know.\n */\nexport function codexResponse(response: unknown): unknown {\n if (response === null || typeof response !== 'object') return null;\n const { hookSpecificOutput: output, systemMessage } = response as {\n hookSpecificOutput?: Record<string, unknown>;\n systemMessage?: unknown;\n };\n const message = typeof systemMessage === 'string' ? { systemMessage } : {};\n if (output === undefined) return Object.keys(message).length > 0 ? message : null;\n return { hookSpecificOutput: output, ...message };\n}\n"],"mappings":";;;;;;;AAWO,SAAS,iBAAiB,KAAgC;AAC/D,QAAM,QAAQ,OAAO,GAAG;AACxB,MAAI,UAAU,QAAQ,MAAM,UAAU,UAAa,MAAM,QAAQ,SAAS,IAAK,QAAO;AACtF,QAAM,SAAS;AAAA,IACb,WAAW,MAAM;AAAA,IACjB,GAAI,MAAM,MAAM,EAAE,KAAK,MAAM,IAAI,IAAI,CAAC;AAAA,IACtC,GAAI,MAAM,YAAY,SAAS,SAAY,EAAE,gBAAgB,MAAM,WAAW,KAAK,IAAI,CAAC;AAAA,EAC1F;AACA,M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 var require_node_exports = __commonJS({
5016
5016
  }
5017
5017
  });
5018
5018
 
5019
- // node_modules/.pnpm/@signinwithethereum+siwe@4.2.0_viem@2.55.2_typescript@6.0.3_zod@4.4.3_/node_modules/@signinwithethereum/siwe/dist/rolldown-runtime-CAFD8bLK.js
5019
+ // node_modules/.pnpm/@signinwithethereum+siwe@4.2.0_viem@2.55.2_typescript@6.0.3_zod@4.6.7_/node_modules/@signinwithethereum/siwe/dist/rolldown-runtime-CAFD8bLK.js
5020
5020
  var e = Object.defineProperty;
5021
5021
  var t = (t3, n2) => {
5022
5022
  let r3 = {};
@@ -7740,7 +7740,7 @@ var h = class {
7740
7740
  }
7741
7741
  };
7742
7742
 
7743
- // node_modules/.pnpm/@signinwithethereum+siwe@4.2.0_viem@2.55.2_typescript@6.0.3_zod@4.4.3_/node_modules/@signinwithethereum/siwe/dist/utils-9-kzgPFC.js
7743
+ // node_modules/.pnpm/@signinwithethereum+siwe@4.2.0_viem@2.55.2_typescript@6.0.3_zod@4.6.7_/node_modules/@signinwithethereum/siwe/dist/utils-9-kzgPFC.js
7744
7744
  var t2 = [
7745
7745
  "signature",
7746
7746
  "scheme",
@@ -7803,4 +7803,4 @@ export {
7803
7803
  p2 as p,
7804
7804
  m2 as m
7805
7805
  };
7806
- //# sourceMappingURL=chunk-XZKD7DIF.js.map
7806
+ //# sourceMappingURL=chunk-RL5UUDT4.js.map