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/commands/wallet.ts"],"sourcesContent":["import { mkdir, readFile } from 'node:fs/promises';\nimport { homedir } from 'node:os';\nimport { dirname, join } from 'node:path';\nimport { CliError } from '../lib/errors';\nimport { emitNotice } from '../lib/output';\nimport { walletPath } from '../lib/paths';\nimport { withFileLock, LockTimeoutError } from '../lib/lock';\nimport { loadRawConfig, resolveSettings } from '../lib/config';\nimport { toMoney } from '../lib/money';\nimport { getUsdcBalance } from '../lib/usdc';\nimport { forgetRememberedBalance } from '../lib/usdc-balance';\nimport { addressQrLines } from '../lib/qr';\nimport { writePassphraseRecord } from '../lib/passphrase-record';\nimport { NO_KEYRING_LINE, REPAIR_CLAUSE, REPAIR_IN_TERMINAL } from '../lib/wallet-unlock';\nimport { channelCredit } from '../router/channel-credit';\nimport { FUND_COMMAND_LINE, FUNDING_LINE } from '../router/fee';\nimport { markUnlockPending } from '../router/router-observation';\nimport {\n commitLocalWallet,\n createLocalWallet,\n describeWallet,\n openKeystore,\n parkOutgoingWallet,\n prepareLocalWallet,\n repairLocalWalletPassphrase,\n resolveWalletProvider,\n restoreParkedWallet,\n verifyAndPreserveOutgoingWallet,\n type ArchivedWalletInfo,\n type ResolveWalletProviderOptions,\n} from '../lib/wallet';\nimport {\n readWalletRecord,\n walletExistsError,\n walletFileExists,\n type WalletRecord,\n} from '../lib/wallet/store';\nimport {\n describeStoreLocation,\n promptPassphrase,\n resolvePassphrase,\n resolvePassphraseForCreate,\n STORE_TIMEOUTS,\n storeNoun,\n unstorableWhy,\n type CreatePassphraseResult,\n type DurableStore,\n} from '../lib/wallet/passphrase';\nimport type { PassphraseOverrides } from '../lib/wallet/local';\nimport type { CommandContext, CommandResult } from '../context';\n\nconst KEY_STORAGE = 'encrypted (keystore v3, scrypt)';\nconst isWindows = process.platform === 'win32';\n\n/** The last line `tenjin wallet repair` prints: the save is proven, the unlock is not yet. */\nexport const REPAIR_DONE_LINE = 'Passphrase saved; start a new Claude Code session to verify.';\n\nexport interface WalletCreateOptions {\n /**\n * Explicitly replace the existing active wallet (mirrors the `--yes`-style\n * explicit-flag precedent): the outgoing wallet is ARCHIVED — passphrase\n * verified against its keystore and preserved under its own address, keystore\n * parked beside the new one — never destroyed. Without it, create refuses\n * when a wallet exists. There is always exactly ONE active wallet.\n */\n replace?: boolean;\n /** Test seam for passphrase resolution (keychain exec, TTY prompt, platform). */\n passphrase?: PassphraseOverrides;\n /**\n * The environment TENJIN_WALLET_PASSPHRASE is read from; defaults to\n * process.env. A seam rather than a global read so a caller (and above all a\n * test) can settle the passphrase source WITHOUT mutating the real process\n * environment, which under a parallel runner leaks across whole test files.\n */\n env?: NodeJS.ProcessEnv;\n /**\n * `--insecure-storage`: save the passphrase to the 0600 file even where an OS\n * keychain exists. For a person who chose it; never suggested by an error.\n */\n insecureStorage?: boolean;\n}\n\nexport async function runWalletCreate(\n ctx: CommandContext,\n opts: WalletCreateOptions = {},\n): Promise<CommandResult> {\n const { address, walletPath: path, passphrase, replaced } = await createWalletLocked(ctx, opts);\n\n const note = passphraseNote(passphrase, address, ctx.dataDir);\n const warnings = custodyWarnings();\n return {\n data: {\n address,\n walletPath: path,\n provider: 'local',\n policyEnforcement: 'client-only',\n keyStorage: KEY_STORAGE,\n passphraseSource: passphrase.source,\n passphraseLocation: passphrase.location,\n passphraseOrigin: passphrase.origin,\n passphraseDurable: passphrase.durable,\n passphraseNote: note,\n ...(replaced !== undefined\n ? {\n replaced: {\n address: replaced.address,\n archivedWalletPath: replaced.archivedPath,\n passphrasePreserved: replaced.passphraseLocation,\n ...(replaced.unarchivedReason !== undefined\n ? { unarchivedReason: replaced.unarchivedReason }\n : {}),\n },\n }\n : {}),\n warnings,\n },\n humanLines: [\n `Wallet created: ${address}`,\n `Key stored ${KEY_STORAGE}.`,\n note,\n ...(replaced !== undefined ? replacedNote(replaced, path) : []),\n FUNDING_LINE,\n ...warnings,\n ],\n };\n}\n\n/** Where the outgoing wallet's funds live, why they remain reachable, and how to restore it. */\nfunction replacedNote(replaced: ArchivedWalletInfo, activeWalletPath: string): string[] {\n const passphraseLine =\n replaced.passphraseLocation === 'store'\n ? `its passphrase is preserved in ${replaced.location ?? `the OS credential store (service tenjin-cli, account ${replaced.account})`}.`\n : replaced.passphraseLocation === 'env'\n ? 'its passphrase is TENJIN_WALLET_PASSPHRASE — keep that value.'\n : replaced.unarchivedReason === 'rejected-characters'\n ? 'its passphrase was NOT archived: the macOS keychain writer only stores printable ASCII passphrases, and this typed one contains other characters. Keep it yourself, or set TENJIN_WALLET_PASSPHRASE to it.'\n : 'its passphrase was NOT archived: this platform has no OS credential store. It exists only where you keep it.';\n return [\n `Previous wallet archived: ${replaced.address} still holds any funds sent to it.`,\n `Its keystore was moved to ${replaced.archivedPath}; ${passphraseLine}`,\n `To make it the active wallet again later: move the current ${activeWalletPath} aside first, then \\`mv ${replaced.archivedPath} ${activeWalletPath}\\`.`,\n ];\n}\n\n/**\n * Run `fn` under the cross-process wallet lock (`<dir>/wallet.create.lock`):\n * create, `--replace` and repair all change where a wallet's passphrase lives,\n * and the sidecar's read-modify-write assumes one writer at a time.\n *\n * A lock timeout is not the user's error; it surfaces as INTERNAL with the one\n * manual step (there is no auto-steal), keeping the JSON error contract. Every\n * other error — notably a create loser's WALLET_EXISTS — propagates unchanged.\n */\nexport async function withWalletLock<T>(dir: string, fn: () => Promise<T>): Promise<T> {\n // Ensure the data dir exists so the lock's own mkdir has a parent on a fresh\n // install; the exclusive wallet write re-ensures it at 0700 regardless.\n await mkdir(dir, { recursive: true, mode: 0o700 });\n const lockPath = join(dir, 'wallet.create.lock');\n try {\n return await withFileLock(lockPath, fn);\n } catch (err) {\n if (err instanceof LockTimeoutError) {\n throw new CliError('INTERNAL', err.message, {\n fix: `If no other tenjin process is running, remove ${lockPath} and retry.`,\n cause: err,\n });\n }\n throw err;\n }\n}\n\n/**\n * Run the whole create critical section under the wallet lock: the existence\n * pre-check, the passphrase choose-and-store, and the no-clobber write. Without\n * the lock these interleave across two concurrent creates — each generates a\n * distinct passphrase and persists it BEFORE the exclusive file write, so a\n * different process could win the file while this one's per-address entry\n * names a wallet that never landed. Serializing means the loser blocks until\n * the winner commits, then trips the exists check and exits WALLET_EXISTS\n * having never generated or stored a passphrase. The store-before-write\n * ordering stays (it still guards the single-process crash window), and the\n * exclusive write stays the final authority.\n *\n * The passphrase is resolved inside the prepare step's address callback so the\n * store entry is keyed to the new wallet's own address (issue #32), and the\n * sidecar records where it went BEFORE the key is encrypted: a sidecar that\n * cannot be written aborts the create, so no wallet exists whose passphrase\n * location nobody recorded.\n *\n * `--replace` ordering closes the no-active-wallet window: verify-and-preserve\n * the outgoing wallet (no file moves), fully PREPARE the replacement (key,\n * stored passphrase, encrypted keystore — every fallible step) while the old\n * wallet is still active, and only then park the old keystore and commit the\n * new one. A commit failure rolls the park back, so at every exit either the\n * old or the new wallet is the active one.\n */\nasync function createWalletLocked(\n ctx: CommandContext,\n opts: WalletCreateOptions,\n): Promise<{\n address: string;\n walletPath: string;\n passphrase: CreatePassphraseResult;\n replaced?: ArchivedWalletInfo;\n}> {\n const dir = ctx.dataDir;\n return withWalletLock(dir, async () => {\n const env = opts.env ?? process.env;\n let chosen: CreatePassphraseResult | undefined;\n const passphraseFor = async (forAddress: string): Promise<string> => {\n const resolved = await resolvePassphraseForCreate(\n {\n env,\n dir,\n ...opts.passphrase,\n // Create never prompts; this only picks the 10 s or 60 s write bound.\n isTTY: opts.passphrase?.isTTY ?? ctx.io.isTTY,\n onWait: (line) => emitNotice(ctx.io, line, { json: ctx.flags.json }),\n },\n forAddress,\n { insecureStorage: opts.insecureStorage === true },\n );\n if (resolved.durable && resolved.source !== 'env') {\n await writePassphraseRecord(dir, forAddress, { store: resolved.source, by: 'create' });\n }\n chosen = resolved;\n return resolved.passphrase;\n };\n const result = (path: { address: string; walletPath: string }) => {\n if (chosen === undefined) throw new CliError('INTERNAL', 'No wallet passphrase was chosen.');\n return { ...path, passphrase: chosen };\n };\n\n if (!(await walletFileExists(dir))) {\n return result(await createLocalWallet(dir, passphraseFor));\n }\n\n if (opts.replace !== true) throw walletExistsError(dir);\n const preserved = await verifyAndPreserveOutgoingWallet({\n dir,\n env,\n ...(opts.passphrase !== undefined ? { passphrase: opts.passphrase } : {}),\n });\n const prepared = await prepareLocalWallet(passphraseFor);\n const archivedPath = await parkOutgoingWallet(dir, preserved.account);\n try {\n const committed = await commitLocalWallet(dir, prepared);\n return { ...result(committed), replaced: { ...preserved, archivedPath } };\n } catch (err) {\n try {\n await restoreParkedWallet(dir, archivedPath);\n } catch (restoreErr) {\n // The no-clobber restore also refuses when a wallet.json appeared out\n // of band (commit EEXIST) — never overwrite it; name both files.\n throw new CliError(\n 'INTERNAL',\n 'Creating the replacement wallet failed after the old wallet was parked, and restoring it also failed.',\n {\n fix: `Your old wallet ${preserved.address} is intact at ${archivedPath} with its passphrase preserved. If a ${walletPath(dir)} now exists, another process wrote it — move it aside first. Then restore with \\`mv ${archivedPath} ${walletPath(dir)}\\`.`,\n cause: restoreErr,\n },\n );\n }\n // Old wallet restored as the active one; say so rather than surfacing a\n // raw fs error (or a WALLET_EXISTS whose fix suggests re-running --replace).\n throw new CliError(\n 'INTERNAL',\n 'Creating the replacement wallet failed; the previous wallet was restored and is the active wallet again.',\n {\n fix: 'Nothing was lost. Fix the underlying error, then retry `tenjin wallet create --replace`.',\n cause: err,\n },\n );\n }\n });\n}\n\n/**\n * THE ONE LINE THAT SAYS WHERE THE PASSPHRASE WENT (Q2, S4). A generated secret\n * in an OS store keeps today's three notes byte for byte; an env secret saved\n * there says the variable is no longer needed; the 0600 file says why it was\n * used; and an env secret nothing durable holds says so, and how to fix it\n * once the store answers. Every line that names `tenjin wallet repair` carries\n * REPAIR_CLAUSE, and a file failure never names a keychain (decision 6).\n */\nexport function passphraseNote(p: CreatePassphraseResult, address: string, dir: string): string {\n const account = address.toLowerCase();\n if (!p.durable) {\n const attempted = p.attempted ?? 'keychain';\n const only = 'so Claude Code can unlock this wallet only where that variable is set.';\n switch (p.notSaved) {\n case 'rejected-characters':\n // Repair would refuse the same value: the variable is the fix.\n return `Encrypted with TENJIN_WALLET_PASSPHRASE only: ${unstorableWhy(attempted)}, ${only} Keep it set in the environment Claude Code starts from.`;\n case 'conflict':\n case 'kept-existing':\n return `Encrypted with TENJIN_WALLET_PASSPHRASE only: ${describeStoreLocation(attempted, account, dir)} already holds a different passphrase for this wallet, ${only} Run \\`tenjin wallet repair\\` yourself ${REPAIR_CLAUSE} to replace it.`;\n default:\n break;\n }\n if (attempted === 'file') {\n const path = describeStoreLocation('file', account, dir);\n return `Encrypted with TENJIN_WALLET_PASSPHRASE only: Tenjin could not save the passphrase to ${path}, ${only} Check that ${dirname(path)} is writable, then run \\`tenjin wallet repair\\` yourself ${REPAIR_CLAUSE}.`;\n }\n if (p.notSaved === 'store-failed') {\n return `Encrypted with TENJIN_WALLET_PASSPHRASE only: Tenjin could not save the passphrase to the ${storeNoun(attempted)}, ${only} Run \\`tenjin wallet repair\\` yourself ${REPAIR_CLAUSE}.`;\n }\n return `Encrypted with TENJIN_WALLET_PASSPHRASE only: the ${storeNoun(attempted)} did not answer, ${only} Once it answers, run \\`tenjin wallet repair\\` yourself ${REPAIR_CLAUSE}.`;\n }\n if (p.source === 'file' || p.source === 'env') {\n if (p.fileReason === 'insecure-storage') {\n return `Passphrase saved to ${p.location} (readable only by you). Anyone who can read that file and wallet.json can spend this wallet.`;\n }\n return NO_KEYRING_LINE(p.location);\n }\n if (p.origin === 'env') {\n return `Passphrase from TENJIN_WALLET_PASSPHRASE saved to ${p.location}; Claude Code can unlock this wallet without the variable.`;\n }\n switch (p.source) {\n case 'keychain':\n return `Passphrase saved to your macOS keychain (service tenjin-cli, account ${account}); signing will be transparent on this machine.`;\n case 'dpapi':\n return `Passphrase saved to a DPAPI-encrypted per-wallet file (passphrase.${account}.dpapi), readable only by you on this Windows machine; signing will be transparent here.`;\n case 'secret-service':\n return `Passphrase saved to your Linux keyring (Secret Service, service tenjin-cli, account ${account}); signing will be transparent on this machine.`;\n }\n}\n\nexport interface WalletRepairOptions {\n /** `--insecure-storage`: save to the 0600 file even where an OS keychain exists. */\n insecureStorage?: boolean;\n /** Test seam for passphrase storage (keychain exec, TTY prompt, platform). */\n passphrase?: PassphraseOverrides;\n /** The environment TENJIN_WALLET_PASSPHRASE is read from; defaults to process.env. */\n env?: NodeJS.ProcessEnv;\n /** The home directory whose shell startup files are scanned for an export; defaults to os.homedir(). */\n home?: string;\n /** Reads one startup file, null when it cannot be read; a seam for tests. */\n readText?: (path: string) => Promise<string | null>;\n}\n\n/** What `tenjin wallet repair --json` prints. */\nexport interface WalletRepairData {\n address: string;\n passphraseStore: DurableStore;\n location: string;\n alreadySaved: boolean;\n replacedUnusableEntry: boolean;\n envOverride: {\n state: 'unset' | 'matches' | 'wrong';\n exports: Array<{ file: string; line: number }>;\n };\n restartRequired: true;\n next: typeof REPAIR_DONE_LINE;\n}\n\n/** The shell startup files a TENJIN_WALLET_PASSPHRASE export usually lives in, relative to home. */\nconst SHELL_STARTUP_FILES = [\n '.zshrc',\n '.zprofile',\n '.zshenv',\n '.bashrc',\n '.bash_profile',\n '.profile',\n '.config/fish/config.fish',\n];\n\n/**\n * `tenjin wallet repair`: for a wallet Claude Code cannot unlock. A PERSON runs\n * it, in their own terminal: it asks for the passphrase at a hidden prompt (or\n * uses TENJIN_WALLET_PASSPHRASE when that opens the wallet), proves it opens\n * this wallet, saves it where Claude Code's router can read it without a\n * prompt, and marks the unlock as awaiting confirmation, which the next\n * session's router confirms (\"Tenjin wallet unlocked.\").\n *\n * With no terminal and a wrong variable, the saved passphrase is checked in\n * its place, so a headless run still names the variable when the saved one\n * already opens the wallet. With no terminal and nothing usable it refuses with\n * REPAIR_IN_TERMINAL and never suggests passing the passphrase inline (B1): a passphrase never\n * goes on a command line or into chat. It reports success only when the store\n * reads this passphrase back (S1). A TENJIN_WALLET_PASSPHRASE in this shell\n * that does not open the wallet is named, with the startup-file line that\n * exports it, because it shadows the saved passphrase until removed.\n */\nexport async function runWalletRepair(\n ctx: CommandContext,\n opts: WalletRepairOptions = {},\n): Promise<CommandResult> {\n const env = opts.env ?? process.env;\n const dir = ctx.dataDir;\n const record = await readWalletRecord(dir);\n if (record === null) {\n throw new CliError('WALLET_MISSING', 'No wallet found to repair.', {\n fix: 'Run `tenjin wallet create` to create one.',\n });\n }\n const address = record.address;\n const humanPre: string[] = [];\n const envKey = env.TENJIN_WALLET_KEY;\n if (envKey !== undefined && envKey.trim().length > 0) {\n humanPre.push(\n 'TENJIN_WALLET_KEY is set and shadows the wallet file; repair fixes only the file wallet.',\n );\n }\n\n const fromEnv = env.TENJIN_WALLET_PASSPHRASE;\n let envState: WalletRepairData['envOverride']['state'] = 'unset';\n let candidate: string | undefined;\n if (fromEnv !== undefined && fromEnv.length > 0) {\n const opened = await openKeystore(record.keystore, address, fromEnv);\n envState = opened === 'wrong' ? 'wrong' : 'matches';\n // A mismatch is a tampered file; repair refuses it below with the tamper error.\n if (opened !== 'wrong') candidate = fromEnv;\n }\n const interactive = ctx.io.isTTY && (opts.passphrase?.isTTY ?? Boolean(process.stdin.isTTY));\n if (candidate === undefined && !interactive && envState === 'wrong') {\n // Headless with a wrong variable: a SAVED passphrase that opens the wallet\n // is the candidate, so an agent's run reaches the same conflict line (unset\n // the variable) a person's prompt would, instead of a bare USAGE.\n candidate = await savedPassphraseThatOpens(dir, env, record, opts.passphrase);\n }\n if (candidate === undefined) {\n if (!interactive) {\n throw new CliError(\n 'USAGE',\n envState === 'wrong'\n ? 'No passphrase to check: TENJIN_WALLET_PASSPHRASE is set but does not open this wallet, and no saved passphrase does.'\n : 'No passphrase to check.',\n { fix: REPAIR_IN_TERMINAL },\n );\n }\n const entered = await promptPassphrase(\n { env, ...opts.passphrase },\n `Passphrase for wallet ${address}: `,\n );\n if (entered.length === 0) {\n throw new CliError('USAGE', 'No passphrase entered; nothing was saved.', {\n fix: REPAIR_IN_TERMINAL,\n });\n }\n candidate = entered;\n }\n\n const passphrase = candidate;\n const outcome = await withWalletLock(dir, () =>\n repairLocalWalletPassphrase(\n {\n dir,\n env,\n passphrase: {\n ...opts.passphrase,\n isTTY: ctx.io.isTTY,\n onWait: (line) => emitNotice(ctx.io, line, { json: ctx.flags.json }),\n },\n },\n passphrase,\n opts.insecureStorage === true ? { insecureStorage: true } : {},\n ),\n );\n // The next session's router confirms the unlock and says so once. A failure\n // to record that only costs the confirmation line, never the saved passphrase,\n // so it does not fail a repair that is already proven.\n await markUnlockPending(dir, outcome.address).catch(() => undefined);\n\n const exports =\n envState === 'unset' ? [] : await scanShellExports(opts.home ?? homedir(), opts.readText);\n const savedLine = outcome.alreadySaved\n ? `Already saved in ${outcome.location}.`\n : outcome.fileReason === 'no-keyring'\n ? NO_KEYRING_LINE(outcome.location)\n : `Saved to ${outcome.location}.`;\n const envLine =\n envState === 'wrong'\n ? `! TENJIN_WALLET_PASSPHRASE is set in this shell but does not open this wallet. Tenjin now uses the saved passphrase, but remove the variable: \\`unset TENJIN_WALLET_PASSPHRASE\\`${\n exports.length > 0\n ? `, and delete the export at ${exports.map((e) => `${e.file}:${e.line}`).join(', ')}`\n : ''\n }.`\n : envState === 'matches'\n ? 'TENJIN_WALLET_PASSPHRASE in this shell matches; the saved copy is enough, so you can remove it.'\n : null;\n\n const data: WalletRepairData = {\n address: outcome.address,\n passphraseStore: outcome.store,\n location: outcome.location,\n alreadySaved: outcome.alreadySaved,\n replacedUnusableEntry: outcome.replacedUnusableEntry,\n envOverride: { state: envState, exports },\n restartRequired: true,\n next: REPAIR_DONE_LINE,\n };\n return {\n data,\n humanLines: [\n ...humanPre,\n `Wallet: ${outcome.address}`,\n 'Passphrase verified: it opens this wallet.',\n savedLine,\n ...(envLine !== null ? [envLine] : []),\n REPAIR_DONE_LINE,\n ],\n };\n}\n\n/**\n * The saved passphrase (keychain, 0600 file or legacy slot; never the variable\n * and never a prompt) when it opens this wallet, else undefined. Reads are\n * bounded like doctor's verify, so a locked keychain cannot hang a headless\n * run; any failure to read reads as \"none\".\n */\nasync function savedPassphraseThatOpens(\n dir: string,\n env: NodeJS.ProcessEnv,\n record: WalletRecord,\n overrides: PassphraseOverrides | undefined,\n): Promise<string | undefined> {\n try {\n const saved = await resolvePassphrase(\n {\n env,\n dir,\n ...overrides,\n isTTY: false,\n readDeadlineMs: overrides?.timeouts?.verifyReadMs ?? STORE_TIMEOUTS.verifyReadMs,\n },\n record.address,\n { skipEnv: true },\n );\n const opened = await openKeystore(record.keystore, record.address, saved.passphrase);\n return opened === 'ok' ? saved.passphrase : undefined;\n } catch {\n return undefined;\n }\n}\n\n/** Every TENJIN_WALLET_PASSPHRASE line in the usual shell startup files, as `~/<file>:<line>`. */\nasync function scanShellExports(\n home: string,\n readText: (path: string) => Promise<string | null> = (path) =>\n readFile(path, 'utf8').catch(() => null),\n): Promise<Array<{ file: string; line: number }>> {\n const files: Array<{ path: string; text: string }> = [];\n for (const rel of SHELL_STARTUP_FILES) {\n const text = await readText(join(home, rel));\n if (text !== null) files.push({ path: `~/${rel}`, text });\n }\n return findPassphraseExports(files);\n}\n\n/**\n * The lines that set TENJIN_WALLET_PASSPHRASE (any `export`, `set -gx` or plain\n * assignment naming it), skipping `#` comments. Line numbers are 1-based, as an\n * editor shows them. Only the location is returned, never the line's text: the\n * line may hold the passphrase itself.\n */\nexport function findPassphraseExports(\n files: Array<{ path: string; text: string }>,\n): Array<{ file: string; line: number }> {\n const found: Array<{ file: string; line: number }> = [];\n for (const { path, text } of files) {\n text.split(/\\r?\\n/).forEach((line, i) => {\n if (line.trimStart().startsWith('#')) return;\n if (/\\bTENJIN_WALLET_PASSPHRASE\\b/.test(line)) found.push({ file: path, line: i + 1 });\n });\n }\n return found;\n}\n\nexport interface WalletShowOptions extends ResolveWalletProviderOptions {\n /** `--no-qr`: print the address without the QR block at a TTY. */\n qr?: boolean;\n}\n\nexport async function runWalletShow(\n ctx: CommandContext,\n opts: WalletShowOptions = {},\n): Promise<CommandResult> {\n const provider = resolveWalletProvider(ctx, opts);\n const desc = await describeWallet(provider);\n // Diagnostics are the provider's own: a remote provider reports no local file\n // path or perms warning, so `show` never contaminates a remote wallet's output\n // with a stale local wallet.json's state. keyStorage/passphraseSource are the\n // custody posture reported without decrypting or requiring a passphrase.\n const {\n walletPath: path,\n keyStorage,\n passphraseSource,\n archivedWallets,\n warnings,\n } = await provider.diagnostics();\n\n const humanLines = [\n `Address: ${desc.address}`,\n ...(opts.qr !== false && ctx.io.isTTY && !ctx.flags.json\n ? addressQrLines(desc.address, ctx.io.stdout)\n : []),\n `Key source: ${desc.credentialSource}`,\n ];\n if (keyStorage !== undefined) humanLines.push(`Key storage: ${keyStorage}`);\n if (passphraseSource !== undefined) humanLines.push(`Passphrase: ${passphraseSource}`);\n if (archivedWallets !== undefined && archivedWallets.length > 0) {\n // A recovery hint, not a wallet switcher: exactly one wallet is ever active.\n humanLines.push(\n `Archived (replaced) wallets, funds recoverable via their preserved passphrases: ${archivedWallets.join(', ')}`,\n );\n }\n humanLines.push(...warnings);\n\n return {\n data: {\n address: desc.address,\n provider: desc.provider,\n credentialSource: desc.credentialSource,\n policyEnforcement: desc.policyEnforcement,\n ...(path !== undefined ? { walletPath: path } : {}),\n ...(keyStorage !== undefined ? { keyStorage } : {}),\n ...(passphraseSource !== undefined ? { passphraseSource } : {}),\n ...(archivedWallets !== undefined && archivedWallets.length > 0 ? { archivedWallets } : {}),\n warnings,\n },\n humanLines,\n };\n}\n\nexport async function runWalletBalance(\n ctx: CommandContext,\n opts: ResolveWalletProviderOptions = {},\n): Promise<CommandResult> {\n const provider = resolveWalletProvider(ctx, opts);\n const desc = await describeWallet(provider);\n\n const config = await loadRawConfig(ctx.dataDir);\n const rpcUrl = resolveSettings({\n config,\n flags: { baseUrl: ctx.flags.baseUrl },\n env: process.env,\n }).rpcUrl.value;\n\n let atomic: bigint;\n try {\n atomic = await getUsdcBalance(desc.address, rpcUrl);\n } catch (err) {\n throw new CliError('RPC_ERROR', `Could not read the USDC balance from ${rpcUrl}.`, {\n fix: 'Check your network, or set a working RPC with `tenjin config set rpcUrl <url>`.',\n cause: err,\n });\n }\n\n await forgetRememberedBalance(ctx.dataDir);\n\n const balance = toMoney(atomic.toString());\n // THE ROUTING CREDIT IS STILL THE USER'S: a deposit moved it off the wallet\n // into the routing channel, where the next routing fees draw from it.\n const credit = toMoney(\n (await channelCredit(ctx.dataDir, desc.address).catch(() => 0n)).toString(),\n );\n return {\n data: { address: desc.address, balance, routingCredit: credit },\n humanLines: [\n `Balance: ${balance.usd} USDC on Base` +\n (credit.atomic !== '0' ? ` (+${credit.usd} routing credit)` : ''),\n ...(atomic === 0n ? [FUND_COMMAND_LINE] : []),\n ],\n };\n}\n\nfunction custodyWarnings(): string[] {\n const warnings: string[] = [];\n if (hasEnvKey()) {\n warnings.push('TENJIN_WALLET_KEY is set and shadows this file at runtime.');\n }\n if (isWindows) {\n warnings.push('File permissions are not enforced on Windows; the key file is not restricted.');\n }\n return warnings;\n}\n\nfunction hasEnvKey(): boolean {\n const envKey = process.env.TENJIN_WALLET_KEY;\n return envKey !== undefined && envKey.length > 0;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,OAAO,gBAAgB;AAChC,SAAS,eAAe;AACxB,SAAS,SAAS,YAAY;AAiD9B,IAAM,cAAc;AACpB,IAAM,YAAY,QAAQ,aAAa;AAGhC,IAAM,mBAAmB;AA2BhC,eAAsB,gBACpB,KACA,OAA4B,CAAC,GACL;AACxB,QAAM,EAAE,SAAS,YAAY,MAAM,YAAY,SAAS,IAAI,MAAM,mBAAmB,KAAK,IAAI;AAE9F,QAAM,OAAO,eAAe,YAAY,SAAS,IAAI,OAAO;AAC5D,QAAM,WAAW,gBAAgB;AACjC,SAAO;AAAA,IACL,MAAM;AAAA,MACJ;AAAA,MACA,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,mBAAmB;AAAA,MACnB,YAAY;AAAA,MACZ,kBAAkB,WAAW;AAAA,MAC7B,oBAAoB,WAAW;AAAA,MAC/B,kBAAkB,WAAW;AAAA,MAC7B,mBAAmB,WAAW;AAAA,MAC9B,gBAAgB;AAAA,MAChB,GAAI,aAAa,SACb;AAAA,QACE,UAAU;AAAA,UACR,SAAS,SAAS;AAAA,UAClB,oBAAoB,SAAS;AAAA,UAC7B,qBAAqB,SAAS;AAAA,UAC9B,GAAI,SAAS,qBAAqB,SAC9B,EAAE,kBAAkB,SAAS,iBAAiB,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,EAC5E;AACA,MAAI,WAAW;AACb,aAAS,KAAK,+EAA+E;AAAA,EAC/F;AACA,SAAO;AACT;AAEA,SAAS,YAAqB;AAC5B,QAAM,SAAS,QAAQ,IAAI;AAC3B,SAAO,WAAW,UAAa,OAAO,SAAS;AACjD;","names":[]}
@@ -6,7 +6,7 @@ import { createHash } from "node:crypto";
6
6
  // src/lib/redact-rules.json
7
7
  var redact_rules_default = {
8
8
  schemaVersion: 1,
9
- note: "One rule table for every redaction surface in the CLI (src/lib/redact.ts), kept as data so the tenjin server-side ingest gate can vendor it verbatim. Every row is one detector: `id` is the stable finding `check`, `tier` is the finding severity, `match` is a JS regex or the name of an algorithmic detector a consumer must implement, `excerpt` is the masked-excerpt policy (never the secret), `skip` names a suppression predicate. `scopes` says where the row applies: `publish` (reported on the public marketplace), `team` (reported on a team shelf), `query` (its matches are replaced by the excerpt in hook queries and router packets by `mask()`; regex rows, plus the `hex64`, `pemBlock` and `bip39` algorithm rows). Precision first, as gitleaks and GitHub push protection do: a block row fires on a vendor prefix or an unambiguous shape, the generic `secret-assignment` row needs a secret-named word plus `=` or `:`, and entropy is never a trigger for a query. Table order is mask() order (the assignment row runs first, see its description). Several entries may share an `id`; they are one detector expressed as more than one pattern. Patterns adapted from gitleaks are MIT and attributed in NOTICE.md.",
9
+ note: "One rule table for every redaction surface in the CLI (src/lib/redact.ts), kept as data so the tenjin server-side ingest gate can vendor it verbatim. Every row is one detector: `id` is the stable finding `check`, `tier` is the finding severity, `match` is a JS regex or the name of an algorithmic detector a consumer must implement, `excerpt` is the masked-excerpt policy (never the secret), `skip` names a suppression predicate. `scopes` says where the row applies: `publish` (reported on the public marketplace), `team` (reported on a team shelf), `query` (its matches are replaced by the excerpt in hook queries and router packets by `mask()`; regex rows, plus the `hex64`, `pemBlock` and `bip39` algorithm rows). A row scoped `query` alone is masked and never reported. Precision first, as gitleaks and GitHub push protection do: a block row fires on a vendor prefix or an unambiguous shape, the generic `secret-assignment` row needs a secret-named word plus `=` or `:`, and entropy is never a trigger for a query. Table order is mask() order (the assignment row runs first, see its description). Several entries may share an `id`; they are one detector expressed as more than one pattern. Patterns adapted from gitleaks are MIT and attributed in NOTICE.md.",
10
10
  publicHexConstants: [
11
11
  {
12
12
  value: "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
@@ -578,6 +578,38 @@ var redact_rules_default = {
578
578
  handler: "nonLiteralValue"
579
579
  }
580
580
  },
581
+ {
582
+ id: "rpc-url-key",
583
+ tier: "warn",
584
+ scopes: ["query"],
585
+ description: "An RPC provider key in a URL path, keyed on the provider's documented host: QuickNode (<name>.<network>.quiknode.pro/<key>/), Alchemy (<chain>.g.alchemy.com/v2/<key> and /nft/v3/<key>), Infura (<network>.infura.io/v3/<key> and /ws/v3/<key>), Ankr (rpc.ankr.com/<chain>/<token>), Chainstack (nd-NNN-NNN-NNN.p2pify.com/<key>, <network>.core.chainstack.com/<key> and /ws/<key>), GetBlock (go.getblock.io/<token>/, shared.<region>.getblock.io/<token>/), dRPC (lb.drpc.live/<network>/<key>) and Tenderly (<network>.gateway.tenderly.co/<key>). Query only: it keeps the node key of tenjin-agent#388 out of a router packet now that url-path-credential no longer masks in queries (tenjin-agent#489). The key must be 16 or more [A-Za-z0-9_-] characters with a letter and a digit, so a keyless path (Alchemy `demo`, a chain name) stays. Blast API is left out: it shut down.",
586
+ source: "tenjin (tenjin-agent#489)",
587
+ match: {
588
+ kind: "regex",
589
+ pattern: "\\/(?=[\\w-]{16})(?<=\\b(?:https?|wss?):\\/\\/(?:[\\w-]+(?:\\.[\\w-]+)*\\.quiknode\\.pro|[\\w-]+\\.g\\.alchemy\\.com\\/(?:v2|nft\\/v3)|[\\w-]+\\.infura\\.io\\/(?:ws\\/)?v3|rpc\\.ankr\\.com\\/[\\w-]+|(?:ws-)?nd-[\\d-]+\\.p2pify\\.com|[\\w-]+\\.core\\.chainstack\\.com(?:\\/ws)?|(?:go|(?:shared|dedicated|limitless)\\.[\\w-]+)\\.getblock\\.io|lb\\.drpc\\.(?:live|org)\\/[\\w-]+|[\\w-]+\\.gateway\\.tenderly\\.co)\\/)(?=[\\w-]*[A-Za-z])(?=[\\w-]*\\d)[\\w-]{16,}(?=[.;:!]*(?:[\\/?#\\s\\\"'<>(),\\[\\]{}`]|$))",
590
+ flags: "gi"
591
+ },
592
+ excerpt: {
593
+ kind: "mask",
594
+ keep: 1
595
+ }
596
+ },
597
+ {
598
+ id: "webhook-url-token",
599
+ tier: "warn",
600
+ scopes: ["query"],
601
+ description: "A webhook token in a URL path, keyed on the service's documented host: Slack (hooks.slack.com/services/T.../B.../<token> and /triggers/...), Discord (discord.com/api/webhooks/<id>/<token>, with or without /v10, and the discordapp.com, ptb and canary hosts) and Make (hook.make.com/<token>, and the regional hook.<region>.make.com). Query only: anyone holding the URL can post as the hook, and url-path-credential no longer masks in queries (tenjin-agent#489). Any path segment of 16 or more [A-Za-z0-9_-] characters after the host is the token; ids before it are shorter. The Slack lookbehind spans at most four segments, so a line of long segments stays linear. Google Chat carries its token in the query string, which url-query-credential masks. Teams connector URLs are retired (2026-05), and a Zapier catch-hook id is 5 characters, so neither is listed.",
602
+ source: "tenjin (tenjin-agent#489)",
603
+ match: {
604
+ kind: "regex",
605
+ pattern: "\\/(?=[\\w-]{16})(?<=\\bhttps?:\\/\\/(?:hooks\\.slack\\.com(?:\\/[\\w-]+){1,4}|(?:(?:ptb|canary)\\.)?discord(?:app)?\\.com\\/api(?:\\/v\\d+)?\\/webhooks\\/\\d+|hook(?:\\.[a-z]{2}\\d)?\\.make\\.com)\\/)[\\w-]{16,}(?=[.;:!]*(?:[\\/?#\\s\\\"'<>(),\\[\\]{}`]|$))",
606
+ flags: "gi"
607
+ },
608
+ excerpt: {
609
+ kind: "mask",
610
+ keep: 1
611
+ }
612
+ },
581
613
  {
582
614
  id: "url-query-credential",
583
615
  tier: "warn",
@@ -597,8 +629,8 @@ var redact_rules_default = {
597
629
  {
598
630
  id: "url-path-credential",
599
631
  tier: "warn",
600
- scopes: ["query", "publish"],
601
- description: "A path segment of 24 or more [A-Za-z0-9_-] characters that mixes letters and digits, on an http(s) URL: the shape a webhook secret or a signed-link token takes. A CDN hash or a content id in a path masks too; in a query that costs one routing offer. Four exclusions, each from a measured miss: a segment with two hyphenated words (an article slug), a 40-hex git commit after a git path marker (/commit/, /commits/, /blob/, /tree/, /raw/, /compare/) or on a git host (github.com, gitlab.com, bitbucket.org, codeberg.org), since elsewhere a 40-hex segment is a node key (https://<name>.quiknode.pro/<40 hex>/), a 0x-prefixed 64-hex (the hex64 row already calls a 64-hex inside a URL a hash), a UUID, and a URL character class that stops at quotes, brackets and commas, so one match never spans two URLs in a JSON string. The segment must be whole (a `.` or `%` inside it is a filename or an encoded slug, not a token). The shape lookahead runs before the scheme lookbehind, and the lookbehind is bounded, so a line of short segments stays linear.",
632
+ scopes: ["publish"],
633
+ description: "A path segment of 24 or more [A-Za-z0-9_-] characters that mixes letters and digits, on an http(s) URL: the shape a webhook secret or a signed-link token takes. Not masked in a query: a document id, a gist, a share link or a Reddit slug has the same shape, and a mask there stops a public read with nothing sent (tenjin-agent#489). `rpc-url-key` masks the node keys a query can carry in a path. Four exclusions, each from a measured miss: a segment with two hyphenated words (an article slug), a 40-hex git commit after a git path marker (/commit/, /commits/, /blob/, /tree/, /raw/, /compare/) or on a git host (github.com, gitlab.com, bitbucket.org, codeberg.org), since elsewhere a 40-hex segment is a node key (https://<name>.quiknode.pro/<40 hex>/), a 0x-prefixed 64-hex (the hex64 row already calls a 64-hex inside a URL a hash), a UUID, and a URL character class that stops at quotes, brackets and commas, so one match never spans two URLs in a JSON string. The segment must be whole (a `.` or `%` inside it is a filename or an encoded slug, not a token). The shape lookahead runs before the scheme lookbehind, and the lookbehind is bounded, so a line of short segments stays linear.",
602
634
  source: "tenjin (tenjin-agent#388)",
603
635
  match: {
604
636
  kind: "regex",
@@ -1155,7 +1187,7 @@ function validateScopes(rule) {
1155
1187
  if (rule.tier !== "block" && rule.tier !== "warn") {
1156
1188
  throw new Error(`redact-rules.json: rule ${rule.id} has unknown tier ${String(rule.tier)}`);
1157
1189
  }
1158
- if (!rule.scopes.includes("publish")) {
1190
+ if (rule.scopes.includes("team") && !rule.scopes.includes("publish")) {
1159
1191
  throw new Error(`redact-rules.json: rule ${rule.id} reports for team but not publish`);
1160
1192
  }
1161
1193
  if (rule.tier === "block" && !rule.scopes.includes("team")) {
@@ -1248,6 +1280,7 @@ function compileExcerpt(rule) {
1248
1280
  validateCorpus(CORPUS.rules);
1249
1281
  var LINE_DETECTORS = compileLineDetectors(CORPUS.rules);
1250
1282
  var MASK_DETECTORS = LINE_DETECTORS.filter((d) => d.scopes.has("query"));
1283
+ var REPORT_DETECTORS = LINE_DETECTORS.filter((d) => d.scopes.has("publish"));
1251
1284
  var MASKED_ALGORITHMS = new Set(
1252
1285
  CORPUS.rules.filter((r) => r.match.kind === "algorithm" && r.scopes.includes("query")).map((r) => r.match.algorithm ?? "")
1253
1286
  );
@@ -1255,7 +1288,7 @@ function scanLineDetectors(lines) {
1255
1288
  const out = [];
1256
1289
  for (let i = 0; i < lines.length; i++) {
1257
1290
  const line = lines[i] ?? "";
1258
- for (const detector of LINE_DETECTORS) {
1291
+ for (const detector of REPORT_DETECTORS) {
1259
1292
  detector.re.lastIndex = 0;
1260
1293
  let m;
1261
1294
  while ((m = detector.re.exec(line)) !== null) {
@@ -1677,4 +1710,4 @@ export {
1677
1710
  EMITTED_CHECKS,
1678
1711
  checksFor
1679
1712
  };
1680
- //# sourceMappingURL=chunk-7QKHZQKW.js.map
1713
+ //# sourceMappingURL=chunk-IADZOXKN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/redact.ts","../src/lib/redact-rules.json","../src/lib/bip39-wordlist.json"],"sourcesContent":["/**\n * The one redaction module: every surface that decides what text may leave\n * this machine reads the same rule table (`redact-rules.json`) through this\n * file. Two verbs over one table, and the audience is a parameter:\n *\n * `findings(text, scope)` is the deterministic, offline publish scan. Pure:\n * identical input yields an identical `Finding[]`, no network and no model\n * call. It REPORTS, it never rewrites: every finding is a detector id, a tier,\n * offsets and a masked excerpt that never carries the matched secret. Locally\n * a finding is a flag the consent flow shows the agent, which fixes the text or\n * overrides with `--yes`; the server's ingest gate is the one place that\n * refuses (vendor tokens, private keys, seed phrases, DB passwords, bearer\n * headers). `publish` is the marketplace and reports every row; `team` is the\n * team shelf and reports only the rows whose `scopes` include it. WHICH rows\n * is data on the rule, never a list in a caller.\n *\n * `mask(text)` is the query-side verb: for the rows scoped `query` it replaces\n * each match with that row's excerpt (`ghp_…[redacted 36 chars]`,\n * `postgres://app:[redacted]@host`, `PGPASSWORD=[redacted 7 chars]`,\n * `0x…[redacted 64 chars]`) and touches nothing else. The regex rows run\n * first, then the hex-key, PEM and seed-phrase algorithms. Precision first,\n * the way gitleaks and GitHub push protection work: a vendor prefix fires on\n * format alone, the generic assignment rule needs a secret-named word plus `=`\n * or `:`, and entropy is never a trigger. Paths, hosts, IPs, commit SHAs, env\n * names and prose are never touched; a long mixed token in a URL path is\n * (owner policy, tenjin-agent#197 and the 2026-09-04 decision in\n * tenjin-notes/loop-redesign/06-pr-a-redact.md: search availability over\n * scrubbing; measured, the old scrub altered 16% of real prompts to stop two\n * vendor tokens).\n *\n * Two invariants, pinned by redact.fixtures.test.ts and redact.test.ts:\n *\n * REDACTION: a `block` excerpt is masked — a type-identifying prefix plus a\n * redaction count, never the matched secret. `pem-private-key` is the one\n * exception, its excerpt being the armor header. Secret-shaped warns\n * (secret-assignment, customer-identifier, high-entropy-string) are masked too.\n *\n * ReDoS: no pattern may contain a quantified group whose body can also match the\n * group's own separator while a further obligation follows it. Audited against a\n * single line of hundreds of kilobytes, the shape a JSONL transcript record takes.\n *\n * The rule corpus lives as DATA in `redact-rules.json` so the tenjin server-side\n * ingest gate can vendor it verbatim; this file compiles that data and\n * implements the handlers and algorithmic detectors it names. Per-rule\n * attribution is in the data file's `source` field and in NOTICE.md. No pattern\n * set is a runtime dependency: this is a wallet-holding CLI, kept offline with a\n * tight dep tree by design.\n */\n\nimport { createHash } from 'node:crypto';\nimport corpusJson from './redact-rules.json';\nimport wordlistJson from './bip39-wordlist.json';\n\n/** Where a rule applies: masked in hook queries, reported on the public\n * marketplace, reported on a team shelf. A row may carry any combination. */\nexport type Scope = 'query' | 'publish' | 'team';\n/** The audiences `findings()` reports for. */\nexport type ReportScope = Exclude<Scope, 'query'>;\n\nexport type FindingSeverity = 'block' | 'warn';\n\nexport interface Finding {\n /** Stable machine id for the detector, e.g. \"aws-access-key\". */\n check: string;\n severity: FindingSeverity;\n /** 1-based line number of the match (its start line, for multi-line matches). */\n line: number;\n /** [startColumn, endColumn) within `line`, 0-based (the start line for spans). */\n span: [number, number];\n /** Human-readable snippet; masked for every `block` finding. */\n excerpt: string;\n}\n\n/** Contiguous quoted/fenced runs at or above this word count read as copied. */\nconst LONG_QUOTE_WORDS = 80;\n\nexport function findings(text: string, scope: ReportScope): Finding[] {\n const lines = text.split('\\n');\n // EVERY detector runs whatever the scope, and the scope filters the RESULT.\n // The entropy catch-all suppresses itself against the spans the named\n // detectors claimed, and that set has to be the full one: a checksummed\n // wallet address is a publish-only warn, and on a team shelf it must stay\n // silent rather than resurface as high-entropy-string because the detector\n // that knows what it is was switched off.\n const found: Finding[] = [\n ...scanHex64(lines),\n ...scanLineDetectors(lines),\n ...scanPemBlocks(lines),\n ...scanSeedPhrases(lines),\n ...scanEnvDumpBlocks(lines),\n ...scanLongVerbatim(lines),\n ];\n const named = dedupeAndSort(suppressEmailsInDbUris(found));\n const all = dedupeAndSort([...named, ...scanHighEntropy(lines, named)]);\n if (scope === 'publish') return all;\n // Filtered by the EMITTING rule's scopes, never by a list of check names:\n // `checksFor` maps an emitted check (hex32-value) through the rule it comes\n // from, so dropping `team` from a rule's scopes drops everything it emits.\n const keep = CHECKS[scope];\n return all.filter((f) => keep.has(f.check));\n}\n\n/**\n * Replace every match of a `query`-scoped row with that row's masked excerpt.\n * Nothing else changes: no deletion, no squash, no bound. The `skip` handlers\n * apply exactly as they do for `findings()`, so a placeholder or a `$VAR`\n * value is left as written.\n */\nexport function mask(text: string): string {\n // C0 bytes are deleted first (whitespace kept): a control byte inside a name\n // is a splitter, `api_key<0x01>=hunter2` reads as two tokens to every row\n // below, and the hooks' clean() only removes it after the mask has decided.\n // eslint-disable-next-line no-control-regex\n let out = text.replace(/[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]/g, '');\n // Table order is mask order: the assignment row is first so a value that is\n // itself a vendor token is taken whole, name kept, and no later row sees a\n // stub to re-match.\n for (const detector of MASK_DETECTORS) {\n out = out.replace(detector.re, (...args: unknown[]) => {\n // replace() hands (match, ...groups, offset, input[, named groups]).\n // Rebuilt as an exec array so a skip can read the text around its match.\n const tail = typeof args.at(-1) === 'object' ? 3 : 2;\n const m = Object.assign(args.slice(0, -tail), {\n index: args.at(-tail) as number,\n input: args.at(-tail + 1) as string,\n }) as unknown as RegExpExecArray;\n return detector.skip?.(m) === true ? m[0] : detector.excerpt(m);\n });\n }\n // The algorithm rows after the regex pass, through the same scanners\n // findings() runs, so a key the publish scan blocks is a key the packet\n // never carries. A value the regex pass already masked no longer matches.\n if (MASKED_ALGORITHMS.has('hex64') || MASKED_ALGORITHMS.has('bip39')) {\n out = out.split('\\n').map(maskLineSpans).join('\\n');\n }\n if (MASKED_ALGORITHMS.has('bip39')) out = maskLooseMnemonics(out);\n return MASKED_ALGORITHMS.has('pemBlock') ? maskPemBlocks(out) : out;\n}\n\n/**\n * One line's hex and seed-phrase spans, each replaced by its finding's\n * excerpt. Built in one left-to-right pass rather than a splice per span: a\n * transcript line can carry thousands of keys. A `hex32-value` is a hash, not\n * a key, and stays as written.\n *\n * A wordlist run longer than the longest recovery phrase is not masked here:\n * a run of common words that long is text a routing decision reads (a repeated\n * word, a pasted list). {@link maskLooseMnemonics} masks any phrase inside it.\n * The publish scan reports the whole run either way.\n */\nfunction maskLineSpans(line: string): string {\n const lines = [line];\n const spans = [\n ...(MASKED_ALGORITHMS.has('hex64') ? scanHex64(lines) : []),\n ...(MASKED_ALGORITHMS.has('bip39') ? scanSeedPhrases(lines) : []),\n ]\n .filter((f) => f.check !== 'hex32-value')\n .filter(\n (f) =>\n f.check !== 'bip39-seed-phrase' ||\n line.slice(f.span[0], f.span[1]).split(/[\\s\"'`]+/).length <= SEED_PHRASE_MAX_WORDS,\n )\n .sort((a, b) => a.span[0] - b.span[0]);\n if (spans.length === 0) return line;\n const parts: string[] = [];\n let cursor = 0;\n for (const f of spans) {\n if (f.span[0] < cursor) continue;\n parts.push(line.slice(cursor, f.span[0]), f.excerpt);\n cursor = f.span[1];\n }\n parts.push(line.slice(cursor));\n return parts.join('');\n}\n\n/**\n * A PEM private key from its BEGIN marker through its END marker, or to the\n * end of the text when the paste has no END line. The armor header is kept as\n * the type marker; everything after it is key material and goes.\n */\nfunction maskPemBlocks(text: string): string {\n let out = '';\n let rest = text;\n for (;;) {\n const begin = PEM_BEGIN.exec(rest);\n if (begin === null) return out + rest;\n const body = begin.index + begin[0].length;\n const end = PEM_END.exec(rest.slice(body));\n const stop = end === null ? rest.length : body + end.index + end[0].length;\n out += rest.slice(0, begin.index) + maskKeeping(rest.slice(begin.index, stop), begin[0].length);\n rest = rest.slice(stop);\n }\n}\n\n// ---------------------------------------------------------------------------\n// Rule corpus: redact-rules.json compiled into executable detectors.\n// ---------------------------------------------------------------------------\n\ninterface RuleExcerpt {\n kind: string;\n keep?: number;\n max?: number;\n head?: number;\n tail?: number;\n handler?: string;\n}\n\ninterface Rule {\n id: string;\n tier: string;\n scopes: string[];\n description: string;\n source: string;\n match: { kind: string; pattern?: string; flags?: string; algorithm?: string };\n excerpt: RuleExcerpt;\n /** Drop the match without a finding (e.g. a placeholder value). */\n skip?: { handler: string };\n}\n\nconst SCOPES: ReadonlySet<string> = new Set(['query', 'publish', 'team']);\n\nconst CORPUS = corpusJson as unknown as {\n schemaVersion: number;\n rules: Rule[];\n publicHexConstants?: Array<{ value: string; name: string }>;\n};\n\n/** Algorithmic detectors this file implements; a corpus entry naming any other fails to compile. */\nconst ALGORITHMS = new Set(['hex64', 'pemBlock', 'bip39', 'envDump', 'entropy', 'longVerbatim']);\n/** The algorithms `mask()` can apply. A `query` row naming any other fails to compile. */\nconst MASKABLE_ALGORITHMS: ReadonlySet<string> = new Set(['hex64', 'pemBlock', 'bip39']);\n\nconst EXCERPT_HANDLERS: Record<string, (m: RegExpExecArray) => string> = {\n googleKey: (m) => maskKeeping(m[0], m[0].startsWith('AIza') ? 4 : 7),\n dbConnectionUri: (m) => `${m[1]}://${m[2]}:[redacted]@${m[4]}`,\n bearerToken: (m) => `Authorization: Bearer [redacted ${m[1]?.length ?? 0} chars]`,\n labeledValue: (m) => `${m[1]}=[redacted ${dequote(m[2] ?? '').length} chars]`,\n localPath: localPathExcerpt,\n};\n\nconst SKIP_HANDLERS: Record<string, (m: RegExpExecArray) => boolean> = {\n exampleDbPassword: (m) => isPlaceholder(m[3] ?? '') || isExamplePassword(m[3] ?? ''),\n placeholderGroup1: (m) => isPlaceholder(m[1] ?? ''),\n nonLiteralValue: skipNonLiteralValue,\n placeholderUsername: (m) => PLACEHOLDER_USERNAME.test(m[1] ?? m[2] ?? ''),\n reservedExampleEmail: (m) => RESERVED_EXAMPLE_DOMAIN.test(m[0]),\n hashLabelled: isLabelledHash,\n};\n\ninterface LineDetector {\n check: string;\n severity: FindingSeverity;\n scopes: ReadonlySet<string>;\n /** Global regex; `lastIndex` is reset per line. */\n re: RegExp;\n /** Build the (possibly masked) excerpt from a single match. */\n excerpt: (m: RegExpExecArray) => string;\n /** Drop this match without a finding (e.g. a placeholder value). */\n skip?: (m: RegExpExecArray) => boolean;\n}\n\n/**\n * Compile the data corpus. Throws rather than degrading: a corpus entry naming a\n * handler this build does not implement is a vendoring mistake, and a scan that\n * silently drops a block-tier detector is worse than one that refuses to start.\n */\nfunction validateScopes(rule: Rule): void {\n if (!Array.isArray(rule.scopes) || rule.scopes.length === 0) {\n throw new Error(`redact-rules.json: rule ${rule.id} has no scopes`);\n }\n for (const scope of rule.scopes) {\n if (!SCOPES.has(scope))\n throw new Error(`redact-rules.json: rule ${rule.id} names unknown scope ${scope}`);\n }\n if (rule.tier !== 'block' && rule.tier !== 'warn') {\n throw new Error(`redact-rules.json: rule ${rule.id} has unknown tier ${String(rule.tier)}`);\n }\n if (rule.scopes.includes('team') && !rule.scopes.includes('publish')) {\n throw new Error(`redact-rules.json: rule ${rule.id} reports for team but not publish`);\n }\n // The block tier is reported on every shelf; the server refuses on it.\n if (rule.tier === 'block' && !rule.scopes.includes('team')) {\n throw new Error(`redact-rules.json: block rule ${rule.id} must be scoped to team as well`);\n }\n const maskable =\n rule.match.kind === 'regex' ||\n (rule.match.kind === 'algorithm' && MASKABLE_ALGORITHMS.has(rule.match.algorithm ?? ''));\n if (rule.scopes.includes('query') && !maskable) {\n throw new Error(\n `redact-rules.json: rule ${rule.id} is masked in queries but mask() cannot apply it`,\n );\n }\n}\n\nfunction compileSkip(rule: Rule): ((m: RegExpExecArray) => boolean) | undefined {\n const skip = rule.skip === undefined ? undefined : SKIP_HANDLERS[rule.skip.handler];\n if (rule.skip !== undefined && skip === undefined) {\n throw new Error(`redact-rules.json: rule ${rule.id} names unknown skip ${rule.skip.handler}`);\n }\n return skip;\n}\n\nfunction compileRegex(rule: Rule): RegExp {\n if (rule.match.kind !== 'regex' || rule.match.pattern === undefined) {\n throw new Error(`redact-rules.json: rule ${rule.id} has unknown match kind ${rule.match.kind}`);\n }\n return new RegExp(rule.match.pattern, rule.match.flags ?? 'g');\n}\n\nfunction compileLineDetectors(rules: Rule[]): LineDetector[] {\n const out: LineDetector[] = [];\n for (const rule of rules) {\n if (rule.match.kind === 'algorithm') continue;\n out.push({\n check: rule.id,\n severity: rule.tier as FindingSeverity,\n scopes: new Set(rule.scopes),\n re: compileRegex(rule),\n excerpt: compileExcerpt(rule),\n skip: compileSkip(rule),\n });\n }\n return out;\n}\n\n/**\n * Validate every row once, whatever scope asks first. Throws rather than\n * degrading: a corpus entry naming a handler this build does not implement is\n * a vendoring mistake, and a scan that silently drops a block-tier detector is\n * worse than one that refuses to start.\n */\nfunction validateCorpus(rules: Rule[]): void {\n for (const rule of rules) {\n validateScopes(rule);\n if (rule.match.kind === 'algorithm') {\n if (!ALGORITHMS.has(rule.match.algorithm ?? '')) {\n throw new Error(`redact-rules.json: rule ${rule.id} names unknown algorithm`);\n }\n continue;\n }\n compileRegex(rule);\n }\n // The converse: every algorithm this file implements has exactly one row,\n // because the row's scopes are what let its findings through. A deleted\n // bip39 row would otherwise turn the seed-phrase block into silence.\n for (const algorithm of ALGORITHMS) {\n const rows = rules.filter(\n (r) => r.match.kind === 'algorithm' && r.match.algorithm === algorithm,\n );\n if (rows.length !== 1) {\n throw new Error(\n `redact-rules.json: algorithm ${algorithm} has ${rows.length} rows, needs exactly one`,\n );\n }\n }\n}\n\nfunction compileExcerpt(rule: Rule): (m: RegExpExecArray) => string {\n const policy = rule.excerpt;\n switch (policy.kind) {\n case 'mask': {\n const keep = policy.keep ?? 0;\n return (m) => maskKeeping(m[0], keep);\n }\n case 'verbatim': {\n const max = policy.max;\n return (m) => (max === undefined ? m[0] : truncate(m[0], max));\n }\n case 'abbreviate': {\n const head = policy.head ?? 6;\n const tail = policy.tail ?? 4;\n return (m) => `${m[0].slice(0, head)}…${m[0].slice(-tail)}`;\n }\n case 'custom': {\n const handler = EXCERPT_HANDLERS[policy.handler ?? ''];\n if (handler === undefined) {\n throw new Error(`redact-rules.json: rule ${rule.id} names unknown excerpt handler`);\n }\n return handler;\n }\n default:\n throw new Error(`redact-rules.json: rule ${rule.id} has unknown excerpt kind ${policy.kind}`);\n }\n}\n\nvalidateCorpus(CORPUS.rules);\nconst LINE_DETECTORS: LineDetector[] = compileLineDetectors(CORPUS.rules);\nconst MASK_DETECTORS: LineDetector[] = LINE_DETECTORS.filter((d) => d.scopes.has('query'));\n/** A row scoped `query` alone masks and never reports, so the publish scan skips it. */\nconst REPORT_DETECTORS: LineDetector[] = LINE_DETECTORS.filter((d) => d.scopes.has('publish'));\n/** Which algorithm rows `mask()` applies is data on the row, like the regex rows. */\nconst MASKED_ALGORITHMS: ReadonlySet<string> = new Set(\n CORPUS.rules\n .filter((r) => r.match.kind === 'algorithm' && r.scopes.includes('query'))\n .map((r) => r.match.algorithm ?? ''),\n);\n\nfunction scanLineDetectors(lines: string[]): Finding[] {\n const out: Finding[] = [];\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i] ?? '';\n for (const detector of REPORT_DETECTORS) {\n detector.re.lastIndex = 0;\n let m: RegExpExecArray | null;\n while ((m = detector.re.exec(line)) !== null) {\n if (!isSuppressedAsDocs(detector, m) && detector.skip?.(m) !== true) {\n out.push({\n check: detector.check,\n severity: detector.severity,\n line: i + 1,\n span: [m.index, m.index + m[0].length],\n excerpt: detector.excerpt(m),\n });\n }\n // Every detector pattern matches at least one character, so a global\n // exec() always advances lastIndex — no zero-width-match loop guard needed.\n }\n }\n }\n return out;\n}\n\n// ---------------------------------------------------------------------------\n// Suppression: placeholders and reserved example values.\n// ---------------------------------------------------------------------------\n\n/**\n * A match that is documentation scaffolding, not a live value: a run of `x`\n * placeholders, an angle/brace template, or a `your…` label. It exists to cut\n * warn fatigue, because `<YOUR_KEY>`-shaped samples are what teach an operator\n * to stop reading findings.\n *\n * TIER ORDERING INVARIANT — this test is a SUBSTRING test over the whole match,\n * so it may only ever suppress a `warn`. A block finding is non-bypassable by\n * contract, and a substring rule hands the bypass to anyone whose secret merely\n * CONTAINS a placeholder shape: real passwords carry `<`, `>`, `{`, `}` and\n * letter runs, so `postgres://app:Str0ng<Pw>Value@prod-db/main` is a live\n * credential, not a docs sample. Block-tier suppression is per-detector only,\n * and is anchored to the captured secret VALUE (isPlaceholder via the\n * `exampleDbPassword` / `placeholderGroup1` handlers), never to a substring of\n * the match. Pinned by \"the block tier is non-bypassable\" in scan.test.ts.\n */\nconst DOCS_PLACEHOLDER =\n /x{6,}|<[^<>]*>|\\{\\{[^{}]*\\}\\}|\\byour[_-]?(?:key|token|secret|password)\\b/i;\n\nfunction isSuppressedAsDocs(detector: LineDetector, m: RegExpExecArray): boolean {\n return detector.severity === 'warn' && DOCS_PLACEHOLDER.test(m[0]);\n}\n\n// RFC 2606 reserved second-level domains. The reserved .example TLD is NOT\n// included: `alice@corp.example` is the shape a real internal address takes in a\n// sanitized draft, and the email detector is a warn the author should still see.\nconst RESERVED_EXAMPLE_DOMAIN = /@(?:[A-Za-z0-9-]+\\.)*example\\.(?:com|org|net)$/i;\n\n// A home-path username that is a docs placeholder, not a real machine username.\nconst PLACEHOLDER_USERNAME = /^(?:user(?:name)?|you(?:rname)?|example|foo|me|myuser|somebody)$/i;\n\n/**\n * A db-connection-uri already masks the embedded password; the email detector,\n * however, would match `password@host` and echo the password verbatim in its\n * excerpt. Drop any email finding whose span sits inside a db-connection-uri\n * span on the same line so the masking cannot be bypassed.\n */\nfunction suppressEmailsInDbUris(findings: Finding[]): Finding[] {\n const uris = findings.filter((f) => f.check === 'db-connection-uri');\n if (uris.length === 0) return findings;\n return findings.filter(\n (f) =>\n f.check !== 'email' ||\n !uris.some((u) => u.line === f.line && f.span[0] >= u.span[0] && f.span[1] <= u.span[1]),\n );\n}\n\n/**\n * Never echo more than a short, non-secret prefix. The kept prefix is a public\n * type marker (`0x`, `AKIA`, `ghp_`, …), never key material; the rest is dropped.\n */\nfunction maskKeeping(match: string, prefixLen: number): string {\n const prefix = match.slice(0, Math.min(prefixLen, match.length));\n return `${prefix}…[redacted ${match.length - prefix.length} chars]`;\n}\n\nfunction truncate(value: string, max: number): string {\n return value.length > max ? `${value.slice(0, max - 3)}…` : value;\n}\n\nfunction localPathExcerpt(m: RegExpExecArray): string {\n // Splice at the capture's own offsets (d-flag indices): a plain\n // String.replace masks the FIRST occurrence of the username, which for a\n // username that is a substring of the /Users|/home prefix mangles the prefix\n // and echoes the real username.\n const bounds = m.indices?.[1] ?? m.indices?.[2];\n const masked =\n bounds === undefined\n ? m[0]\n : `${m[0].slice(0, bounds[0] - m.index)}[user]${m[0].slice(bounds[1] - m.index)}`;\n return truncate(masked, 60);\n}\n\n// Accepted gaps (owner call, tracked): a mnemonic laid out in a numbered grid\n// (`1. abandon 2. ability` across many short lines) breaks the whitespace-only\n// word run bip39 needs and is NOT detected. An all-lowercase, digit-free literal\n// that is not a BIP-39 run (a diceware passphrase, e.g.\n// PASSWORD=correcthorsebatterystaple) still yields no finding — a dictionary-word\n// run is indistinguishable from prose. Headerless base64/DER private keys are\n// detected only for OpenSSH (its magic is base64-stable); other DER encodings are not.\n\n/**\n * Shared skip for labeled-value detectors (secret-assignment,\n * customer-identifier — one helper so the two cannot drift): drop a value that\n * is a placeholder, a structural path/URL/regex, or — when UNQUOTED only, a\n * quoted string is a literal — a code expression (config.clientSecret,\n * user.account_id, hashAndSalt(input), a bare lowercase identifier).\n */\nfunction skipNonLiteralValue(m: RegExpExecArray): boolean {\n const raw = m[2] ?? '';\n const value = dequote(raw);\n if (isPlaceholder(value) || isStructural(value)) return true;\n return raw === value && isCodeExpression(value);\n}\n\n/** Strip a single matching pair of surrounding quotes from a captured value. */\nfunction dequote(value: string): string {\n const m = /^\"([^\"]*)\"$|^'([^']*)'$/.exec(value);\n return m !== null ? (m[1] ?? m[2] ?? '') : value;\n}\n\n// Placeholder tokens must match the WHOLE value, never merely a prefix: an early\n// prefix-anchored version let real secrets through (mySecretP@ss123,\n// yourCompanyProdKey_abc123, exampleRealKey99) and, because isPlaceholder also\n// gates the block-tier bearer/db-uri detectors, that was a block bypass.\nconst PLACEHOLDER_WORD =\n /^(?:xxx+|example|example-value|placeholder|redacted|changeme|dummy|sample|todo|tbd|none|null|secret|test|\\*+|\\.{3,})$/i;\n// your-/my- style kebab or snake placeholders (your-api-key, my_secret,\n// your-key-here) — lowercase words only, so a camelCase/digit-bearing real value\n// (yourCompanyProdKey_abc123) is NOT treated as a placeholder.\nconst PLACEHOLDER_PREFIX = /^(?:your|my)[-_][a-z]+(?:[-_][a-z]+)*$/i;\n\n/** A secret-assignment value that is an obvious placeholder, not a live secret. */\nfunction isPlaceholder(value: string): boolean {\n if (/^[<${%]/.test(value)) return true; // <your-key>, ${VAR}, {{x}}, %ENV%\n return PLACEHOLDER_WORD.test(value) || PLACEHOLDER_PREFIX.test(value);\n}\n\n/**\n * A right-hand side that is code, not a literal secret: a member/property access\n * (user.password), a call (hashAndSalt(input)), or a bare lowercase/snake-case\n * identifier reference (password, db_password). Only applied to UNQUOTED values —\n * a quoted string is a literal. camelCase / digit-bearing tokens are NOT code\n * (they read as opaque secrets), so a real value still fires.\n */\nfunction isCodeExpression(value: string): boolean {\n // Trailing code punctuation the value capture drags in (process.env.KEY, ).\n const v = value.replace(/[,;]+$/, '');\n if (/^[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)+$/.test(v)) return true; // a.b.c\n if (/^[A-Za-z_$][\\w$.]*\\([^)]*\\)$/.test(v)) return true; // f(...)\n // A call truncated at a quoted arg by the value capture: os.environ.get(\n if (/\\($/.test(v)) return true;\n return /^[a-z_$][a-z_$]*$/.test(v); // bare lowercase identifier\n}\n\n/** A structural value (path, URL, or regex literal), not a literal secret. */\nfunction isStructural(value: string): boolean {\n return /^(?:\\.?\\.?\\/|~\\/|https?:\\/\\/|\\^)/.test(value);\n}\n\n// Well-known example/default DB passwords — a connection string using one is a\n// docs snippet, not a leaked credential.\nconst EXAMPLE_PASSWORDS = new Set([\n 'password',\n 'postgres',\n 'mysql',\n 'root',\n 'admin',\n 'changeme',\n 'example',\n 'secret',\n 'test',\n 'guest',\n 'toor',\n]);\n\n/** A db-connection-uri password that is an obvious example/default, not a secret. */\nfunction isExamplePassword(password: string): boolean {\n return EXAMPLE_PASSWORDS.has(password.toLowerCase());\n}\n\n// EVM raw private key (0x + 64 hex) vs. a 32-byte public value. On Base the two\n// are syntactically identical, and a block finding is permanently\n// non-bypassable, so a post quoting a hash, an identifier, or an event topic\n// must not be hard-blocked. A 64-hex demotes to the WARN 'hex32-value' when it\n// sits inside an http(s) URL token, when a hash/identifier label precedes it, or\n// when it is a known public constant. An unlabeled bare 64-hex stays a block\n// 'raw-private-key' (continuing the BlockRun-credited wallet-key scanner): that\n// is the floor, and demotion never silences, so a real key mislabeled `hash`\n// still surfaces for review.\n//\n// The label window is what a replay over 389 published posts (tenjin#723)\n// forced open: every block-tier hit in the live catalog was a public hex\n// constant, and each missed the old rule differently — `hash was 0x…` (a word\n// between label and value), `source_id = 0x…` (an id-class label), and the\n// ERC-20 Transfer topic0 (no label at all). Hence the wider label set, up to TWO\n// short intervening tokens, and the constants set. Two is the bound that keeps\n// the window honest: \"the hash of the private key is 0x…\" is four tokens out and\n// still blocks. The replay's last survivor was markdown: the catalog writes\n// ``hash was `0x…` ``, so the separator class carries backticks and quotes.\n//\n// Only the SEPARATOR classes are permissive. What counts as a LABEL is closed,\n// which is why `` PRIVATE_KEY=`0x…` `` still blocks: no punctuation tolerance\n// can invent a label that is not in the set.\nconst HEX64_RE = /(?<![0-9a-fx])0x[0-9a-fA-F]{64}(?![0-9a-fA-F])/gi;\nconst HASH_LABEL_RE =\n /(?:^|[^a-z0-9])(?:blockhash|txhash|txn|tx|hash|salt|id|topic\\d*|root|digest|commitment)(?:[\\s:=/,._'\"`‘’“”-]*[A-Za-z0-9_]{1,12}){0,2}[\\s:=/,._'\"`‘’“”-]*$/i;\n\n/** Public 64-hex values that are never key material; see redact-rules.json. */\nconst PUBLIC_HEX_CONSTANTS = new Set(\n (CORPUS.publicHexConstants ?? []).map((c) => c.value.toLowerCase()),\n);\n\nfunction scanHex64(lines: string[]): Finding[] {\n const out: Finding[] = [];\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i] ?? '';\n HEX64_RE.lastIndex = 0;\n let m: RegExpExecArray | null;\n while ((m = HEX64_RE.exec(line)) !== null) {\n const hash = isHashContext(line, m.index, m[0]);\n out.push({\n check: hash ? 'hex32-value' : 'raw-private-key',\n severity: hash ? 'warn' : 'block',\n line: i + 1,\n span: [m.index, m.index + m[0].length],\n excerpt: hash ? `${m[0].slice(0, 6)}…${m[0].slice(-4)}` : maskKeeping(m[0], 2),\n });\n }\n }\n return out;\n}\n\n/**\n * How far back a label or URL scheme may sit. Bounded so the lookback is O(1)\n * per match rather than a fresh slice of the whole line: a transcript line\n * carrying hundreds of 64-hex values would otherwise be quadratic. A label is\n * relevant within ~40 characters and a scheme+host+path prefix within 256; past\n * that the value stays block, which is the fail-safe direction.\n */\nconst LABEL_LOOKBACK = 256;\n\nfunction isHashContext(line: string, matchIndex: number, match: string): boolean {\n if (PUBLIC_HEX_CONSTANTS.has(match.toLowerCase())) return true;\n const from = Math.max(0, matchIndex - LABEL_LOOKBACK);\n const before = line.slice(from, matchIndex);\n // A truncated window must not start mid-word, or `gridhash` cut to `hash`\n // reads as a label. Underscore is kept: it is the boundary `source_id` needs.\n const labelWindow = from === 0 ? before : before.replace(/^[A-Za-z0-9]+/, '');\n if (HASH_LABEL_RE.test(labelWindow)) return true;\n // The whitespace-delimited token containing the match starts with http(s)://.\n const prefix = /(\\S*)$/.exec(before)?.[1] ?? '';\n return /^https?:\\/\\//.test(line.slice(matchIndex - prefix.length));\n}\n\n/** The hash labels that keep a bare 64-hex or an 88-character base58 run as written. */\nconst BARE_HASH_LABEL_RE =\n /(?:^|[^a-z0-9])(?:tx|txn|txid|hash|sha\\d*|hmac|digest|commit|id|checksum|sig|signature)(?:[\\s:=/,._*'\"`‘’“”-]*[A-Za-z0-9_]{1,12}){0,2}[\\s:=/,._*'\"`‘’“”-]*$/i;\n\n/**\n * A bare key-shaped run that is a hash or a signature by context: a hash label\n * within two tokens before it, or an http(s) URL it sits inside. The same\n * window and URL test the 0x form's demotion uses, with the labels a bare\n * digest or a Solana signature carries.\n */\nfunction isLabelledHash(m: RegExpExecArray): boolean {\n const input = m.input;\n const from = Math.max(0, m.index - LABEL_LOOKBACK);\n const before = input.slice(from, m.index);\n const labelWindow = from === 0 ? before : before.replace(/^[A-Za-z0-9]+/, '');\n if (BARE_HASH_LABEL_RE.test(labelWindow)) return true;\n const prefix = /(\\S*)$/.exec(before)?.[1] ?? '';\n return /^https?:\\/\\//.test(input.slice(m.index - prefix.length));\n}\n\n// gitleaks private-key marker (RSA/EC/OPENSSH/PGP variants, optional BLOCK).\nconst PEM_BEGIN = /-----BEGIN[ A-Z0-9]*PRIVATE KEY(?: BLOCK)?-----/;\nconst PEM_END = /-----END[ A-Z0-9]*PRIVATE KEY(?: BLOCK)?-----/;\n\n/** A PEM private-key block is a single block finding on its BEGIN marker line. */\nfunction scanPemBlocks(lines: string[]): Finding[] {\n const out: Finding[] = [];\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i] ?? '';\n const m = PEM_BEGIN.exec(line);\n if (m !== null) {\n out.push({\n check: 'pem-private-key',\n severity: 'block',\n line: i + 1,\n span: [m.index, m.index + m[0].length],\n excerpt: m[0], // the header marker only — no key material follows on it\n });\n }\n }\n return out;\n}\n\n// ---------------------------------------------------------------------------\n// BIP-39 seed phrases — block. A wallet-adjacent CLI that catches a hex key but\n// not a mnemonic is not protecting the thing that actually loses the funds.\n// ---------------------------------------------------------------------------\n\nconst BIP39_WORDS = new Set((wordlistJson as { words: string }).words.split(' '));\n/** The shortest valid BIP-39 mnemonic. Below this a run is prose, not a phrase. */\nconst SEED_PHRASE_MIN_WORDS = 12;\n/** The longest BIP-39 mnemonic. */\nconst SEED_PHRASE_MAX_WORDS = 24;\nconst SEED_PHRASE_SIZES = [24, 21, 18, 15, 12];\nconst BIP39_INDEX = new Map(\n (wordlistJson as { words: string }).words.split(' ').map((word, index) => [word, index]),\n);\n\n/** What may sit between two words of a loosely written phrase. */\nconst LOOSE_SEPARATOR = /^[\\s,\"'`]+$/;\n\n/**\n * Recovery phrases the strict line scan does not see: any case, words joined\n * by commas, quotes or line breaks (a 6+6 paste), or a phrase inside a longer\n * wordlist run. Only a window that IS a phrase goes, 12 to 24 words whose\n * BIP-39 checksum holds, longest first; everything else stays as written, so\n * a capitalized or comma-separated list of common words is not a false hit.\n * The English wordlist is the only one this build ships.\n */\nfunction maskLooseMnemonics(text: string): string {\n const tokens = [...text.matchAll(/[A-Za-z]+/g)].map((m) => ({\n word: m[0].toLowerCase(),\n start: m.index,\n end: m.index + m[0].length,\n }));\n // A long run repeats itself (a word typed over and over), so each distinct\n // window is hashed once: the pass stays linear on a transcript-length text.\n const checked = new Map<string, boolean>();\n const valid = (window: string[]): boolean => {\n const key = window.join(' ');\n let result = checked.get(key);\n if (result === undefined) checked.set(key, (result = isMnemonic(window)));\n return result;\n };\n const parts: string[] = [];\n let cursor = 0;\n let i = 0;\n while (i < tokens.length) {\n let j = i;\n while (\n j < tokens.length &&\n BIP39_INDEX.has(tokens[j]!.word) &&\n (j === i || LOOSE_SEPARATOR.test(text.slice(tokens[j - 1]!.end, tokens[j]!.start)))\n ) {\n j++;\n }\n if (j === i) {\n i++;\n continue;\n }\n let k = i;\n while (k + SEED_PHRASE_MIN_WORDS <= j) {\n const size = SEED_PHRASE_SIZES.find(\n (n) => k + n <= j && valid(tokens.slice(k, k + n).map((t) => t.word)),\n );\n if (size === undefined) {\n k++;\n continue;\n }\n parts.push(\n text.slice(cursor, tokens[k]!.start),\n `[redacted ${size}-word BIP-39 recovery phrase]`,\n );\n cursor = tokens[k + size - 1]!.end;\n k += size;\n }\n i = j;\n }\n parts.push(text.slice(cursor));\n return parts.join('');\n}\n\n/** BIP-39: 11 bits per word, the last `n / 3` of them a SHA-256 checksum of the rest. */\nfunction isMnemonic(words: string[]): boolean {\n let bits = 0n;\n for (const word of words) bits = (bits << 11n) | BigInt(BIP39_INDEX.get(word) ?? 0);\n const checksumBits = BigInt(words.length / 3);\n const entropyBytes = (words.length * 11 - words.length / 3) / 8;\n const entropy = Buffer.from(\n (bits >> checksumBits).toString(16).padStart(entropyBytes * 2, '0'),\n 'hex',\n );\n const expected = BigInt(createHash('sha256').update(entropy).digest()[0]!) >> (8n - checksumBits);\n return (bits & ((1n << checksumBits) - 1n)) === expected;\n}\n\n/**\n * A run of >=12 consecutive wordlist words separated ONLY by whitespace or\n * quote characters. The rule is what keeps prose out: BIP-39 words are common\n * English, but twelve of them in a row with no punctuation is a phrase, not a\n * sentence. A quote is a separator so the `.env` form counts:\n * `MNEMONIC=\"abandon … about\"` (tenjin-agent#296). Tokens are walked rather\n * than matched by one regex so the span is exact and the pass stays linear on\n * a transcript-length line.\n */\nfunction scanSeedPhrases(lines: string[]): Finding[] {\n const out: Finding[] = [];\n const token = /[^\\s\"'`]+/g;\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i] ?? '';\n token.lastIndex = 0;\n let runStart = -1;\n let runEnd = -1;\n let runWords = 0;\n let m: RegExpExecArray | null;\n const flush = (): void => {\n if (runWords >= SEED_PHRASE_MIN_WORDS) {\n out.push({\n check: 'bip39-seed-phrase',\n severity: 'block',\n line: i + 1,\n span: [runStart, runEnd],\n excerpt: `[redacted ${runWords}-word BIP-39 recovery phrase]`,\n });\n }\n runWords = 0;\n };\n while ((m = token.exec(line)) !== null) {\n if (BIP39_WORDS.has(m[0])) {\n if (runWords === 0) runStart = m.index;\n runEnd = m.index + m[0].length;\n runWords++;\n } else {\n flush();\n }\n }\n flush();\n }\n return out;\n}\n\n// ---------------------------------------------------------------------------\n// .env dump blocks — warn. One finding per run, naming the KEYS only.\n// ---------------------------------------------------------------------------\n\nconst ENV_LINE = /^\\s*(?:export\\s+)?([A-Z][A-Z0-9_]{2,})=(\\S.*)$/;\n/** Three lines is the shortest run that reads as a file rather than one example. */\nconst ENV_BLOCK_MIN_LINES = 3;\n/** A run of short values is configuration (PORT=3000); a long literal is a payload. */\nconst ENV_SUBSTANTIAL_VALUE = 12;\n\nfunction scanEnvDumpBlocks(lines: string[]): Finding[] {\n const out: Finding[] = [];\n let i = 0;\n while (i < lines.length) {\n const keys: string[] = [];\n let substantial = false;\n const start = i;\n let m: RegExpExecArray | null;\n while (i < lines.length && (m = ENV_LINE.exec(lines[i] ?? '')) !== null) {\n keys.push(m[1] ?? '');\n const value = dequote((m[2] ?? '').trim());\n if (value.length >= ENV_SUBSTANTIAL_VALUE && !isPlaceholder(value) && !isStructural(value)) {\n substantial = true;\n }\n i++;\n }\n if (keys.length >= ENV_BLOCK_MIN_LINES && substantial) {\n const shown = keys.slice(0, 3).join(', ');\n const rest = keys.length - 3;\n out.push({\n check: 'env-dump-block',\n severity: 'warn',\n line: start + 1,\n span: [0, (lines[start] ?? '').length],\n excerpt: `${keys.length} KEY=VALUE lines (${shown}${rest > 0 ? `, +${rest} more` : ''})`,\n });\n }\n if (i === start) i++;\n }\n return out;\n}\n\n// ---------------------------------------------------------------------------\n// Generic high-entropy token — warn. The catch-all behind the named shapes.\n// ---------------------------------------------------------------------------\n\n// `/` and `=` are deliberately outside the candidate class: with them in, every\n// long URL path (`com/BackTrackCo/tenjin-agent/issues/45`) and every\n// SHOUTY_KEY=value line reads as one high-entropy token, which is the warn\n// fatigue this detector is supposed to avoid causing. The cost is that a\n// standard-base64 payload is split on its `/` bytes; the credential families\n// that actually carry `/`-bearing base64 (JWT, PEM, OpenSSH) have named detectors.\nconst ENTROPY_CANDIDATE = /[A-Za-z0-9+_-]{32,}/g;\n/** Below this, base62 tokens of this length are not distinguishable from text. */\nconst MIN_ENTROPY_BITS = 3.5;\n/**\n * Random base62 almost never runs more than eight same-case letters; an\n * identifier (getUserProfileByAccountIdentifier) always does. This single test\n * is what keeps long camelCase symbols out of the findings list.\n */\nconst MAX_SAME_CASE_RUN = 8;\n\n/**\n * Long tokens whose character profile reads as key material. Suppressed when the\n * token overlaps a finding a named detector already produced, so a JWT or an AWS\n * key is reported once, by the detector that knows what it is.\n */\nfunction scanHighEntropy(lines: string[], named: Finding[]): Finding[] {\n const out: Finding[] = [];\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i] ?? '';\n ENTROPY_CANDIDATE.lastIndex = 0;\n let m: RegExpExecArray | null;\n while ((m = ENTROPY_CANDIDATE.exec(line)) !== null) {\n const token = m[0];\n // Warn tier, so the substring placeholder test is allowed here.\n if (!looksRandom(token) || DOCS_PLACEHOLDER.test(token)) continue;\n const span: [number, number] = [m.index, m.index + token.length];\n if (named.some((f) => f.line === i + 1 && f.span[0] < span[1] && span[0] < f.span[1])) {\n continue;\n }\n out.push({\n check: 'high-entropy-string',\n severity: 'warn',\n line: i + 1,\n span,\n excerpt: maskKeeping(token, 4),\n });\n }\n }\n return out;\n}\n\nfunction looksRandom(token: string): boolean {\n if (!/[a-z]/.test(token) || !/[A-Z]/.test(token) || !/[0-9]/.test(token)) return false;\n if (longestSameCaseRun(token) > MAX_SAME_CASE_RUN) return false;\n return shannonBits(token) >= MIN_ENTROPY_BITS;\n}\n\nfunction longestSameCaseRun(token: string): number {\n let best = 0;\n let run = 0;\n let previous = '';\n for (const ch of token) {\n let kind = '';\n if (/[a-z]/.test(ch)) kind = 'lower';\n else if (/[A-Z]/.test(ch)) kind = 'upper';\n if (kind === '') run = 0;\n else run = kind === previous ? run + 1 : 1;\n previous = kind;\n if (run > best) best = run;\n }\n return best;\n}\n\nfunction shannonBits(token: string): number {\n const counts = new Map<string, number>();\n for (const ch of token) counts.set(ch, (counts.get(ch) ?? 0) + 1);\n let bits = 0;\n for (const n of counts.values()) {\n const p = n / token.length;\n bits -= p * Math.log2(p);\n }\n return bits;\n}\n\n/**\n * `hex32-value` is not a rule id: it is the warn form `scanHex64` demotes\n * `raw-private-key` to in hash context, so it follows that rule's scopes. A\n * team shelf keeps it because the emitting rule is scoped to team, never\n * because anything filters on `finding.check`. Exported for the fixture test\n * that pins the survivor set.\n */\nexport const EMITTED_CHECKS: Readonly<Record<string, string>> = {\n 'hex32-value': 'raw-private-key',\n};\n\n/** Every rule id `findings()` can report for a scope, emitted checks included. */\nexport function checksFor(scope: ReportScope): ReadonlySet<string> {\n const ids = new Set(CORPUS.rules.filter((r) => r.scopes.includes(scope)).map((r) => r.id));\n for (const [check, rule] of Object.entries(EMITTED_CHECKS)) if (ids.has(rule)) ids.add(check);\n return ids;\n}\n\nconst CHECKS: Record<ReportScope, ReadonlySet<string>> = {\n publish: checksFor('publish'),\n team: checksFor('team'),\n};\n\nconst FENCE = /^(\\s*)(`{3,}|~{3,})/;\n\n/**\n * Long verbatim runs — warn (a rights, not a secrets, concern). A fenced code\n * block or a contiguous `>` blockquote whose content reaches LONG_QUOTE_WORDS\n * reads as copied third-party material. Reported once on the run's first line.\n */\nfunction scanLongVerbatim(lines: string[]): Finding[] {\n const out: Finding[] = [];\n let i = 0;\n while (i < lines.length) {\n const line = lines[i] ?? '';\n const fence = FENCE.exec(line);\n if (fence !== null) {\n const marker = fence[2] ?? '```';\n const start = i;\n const body: string[] = [];\n i++;\n while (i < lines.length && !closesFence(lines[i] ?? '', marker)) {\n body.push(lines[i] ?? '');\n i++;\n }\n i++; // consume the closing fence (or run off the end)\n pushIfLong(out, body, start, line);\n continue;\n }\n if (/^\\s*>/.test(line)) {\n const start = i;\n const body: string[] = [];\n while (i < lines.length && /^\\s*>/.test(lines[i] ?? '')) {\n body.push((lines[i] ?? '').replace(/^\\s*>\\s?/, ''));\n i++;\n }\n pushIfLong(out, body, start, lines[start] ?? '');\n continue;\n }\n i++;\n }\n return out;\n}\n\nfunction closesFence(line: string, marker: string): boolean {\n const m = FENCE.exec(line);\n return m !== null && (m[2] ?? '').startsWith(marker);\n}\n\nfunction pushIfLong(out: Finding[], body: string[], startLine: number, firstLine: string): void {\n const text = body.join(' ').trim();\n const words = text.length === 0 ? 0 : text.split(/\\s+/).length;\n if (words < LONG_QUOTE_WORDS) return;\n out.push({\n check: 'long-verbatim-quote',\n severity: 'warn',\n line: startLine + 1,\n span: [0, firstLine.length],\n excerpt: truncate(text, 60),\n });\n}\n\n/**\n * Deterministic order: line, then start column, then check name. Exact duplicate\n * spans of the same check (e.g. two detectors on the same offset) collapse to one.\n */\nfunction dedupeAndSort(findings: Finding[]): Finding[] {\n const seen = new Set<string>();\n const unique = findings.filter((f) => {\n const key = `${f.check}:${f.line}:${f.span[0]}:${f.span[1]}`;\n if (seen.has(key)) return false;\n seen.add(key);\n return true;\n });\n return unique.sort(\n (a, b) => a.line - b.line || a.span[0] - b.span[0] || a.check.localeCompare(b.check),\n );\n}\n","{\n \"schemaVersion\": 1,\n \"note\": \"One rule table for every redaction surface in the CLI (src/lib/redact.ts), kept as data so the tenjin server-side ingest gate can vendor it verbatim. Every row is one detector: `id` is the stable finding `check`, `tier` is the finding severity, `match` is a JS regex or the name of an algorithmic detector a consumer must implement, `excerpt` is the masked-excerpt policy (never the secret), `skip` names a suppression predicate. `scopes` says where the row applies: `publish` (reported on the public marketplace), `team` (reported on a team shelf), `query` (its matches are replaced by the excerpt in hook queries and router packets by `mask()`; regex rows, plus the `hex64`, `pemBlock` and `bip39` algorithm rows). A row scoped `query` alone is masked and never reported. Precision first, as gitleaks and GitHub push protection do: a block row fires on a vendor prefix or an unambiguous shape, the generic `secret-assignment` row needs a secret-named word plus `=` or `:`, and entropy is never a trigger for a query. Table order is mask() order (the assignment row runs first, see its description). Several entries may share an `id`; they are one detector expressed as more than one pattern. Patterns adapted from gitleaks are MIT and attributed in NOTICE.md.\",\n \"publicHexConstants\": [\n {\n \"value\": \"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\",\n \"name\": \"topic0 ERC-20 / ERC-721 Transfer\"\n },\n {\n \"value\": \"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925\",\n \"name\": \"topic0 ERC-20 / ERC-721 Approval\"\n },\n {\n \"value\": \"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31\",\n \"name\": \"topic0 ERC-721 / ERC-1155 ApprovalForAll\"\n },\n {\n \"value\": \"0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62\",\n \"name\": \"topic0 ERC-1155 TransferSingle\"\n },\n {\n \"value\": \"0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb\",\n \"name\": \"topic0 ERC-1155 TransferBatch\"\n },\n {\n \"value\": \"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0\",\n \"name\": \"topic0 Ownable OwnershipTransferred\"\n },\n {\n \"value\": \"0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c\",\n \"name\": \"topic0 WETH Deposit\"\n },\n {\n \"value\": \"0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65\",\n \"name\": \"topic0 WETH Withdrawal\"\n },\n {\n \"value\": \"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\",\n \"name\": \"EIP-1967 implementation storage slot\"\n },\n {\n \"value\": \"0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103\",\n \"name\": \"EIP-1967 admin storage slot\"\n },\n {\n \"value\": \"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470\",\n \"name\": \"keccak256 of the empty string\"\n },\n {\n \"value\": \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n \"name\": \"the zero hash\"\n }\n ],\n \"excerptPolicies\": {\n \"mask\": \"Keep the first `keep` characters (a public type marker) and replace the rest with a redaction count.\",\n \"verbatim\": \"Echo the match, truncated to `max` characters when set. Only for non-secret matches.\",\n \"abbreviate\": \"Keep `head` leading and `tail` trailing characters joined by an ellipsis.\",\n \"custom\": \"Consumer-implemented builder named by `handler`.\"\n },\n \"rules\": [\n {\n \"id\": \"secret-assignment\",\n \"tier\": \"warn\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Secret-named assignment (API_KEY=, password:, token=) with a literal value. The JSON-quoted form (\\\"password\\\": \\\"...\\\") is the third row, not a quote read here: reading a quote after this name turned ordinary config keys into findings ({\\\"credentials\\\": \\\"include\\\"}, {\\\"max_tokens\\\": 128000}, {\\\"tokenizer\\\": \\\"cl100k_base\\\"}, review round 6). The separator class is [ \\\\t] rather than \\\\s so a heading line (`## Token:`) never swallows the next line when mask() runs over whole text. FIRST IN THE TABLE ON PURPOSE: mask() applies rows in table order, and a value that is itself a vendor token (`OPENAI_API_KEY=sk-...`) must be taken whole by this row, name kept, before a vendor row could leave a stub for this row to re-match.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b([A-Za-z0-9_]*(?:API[_-]?KEY|SECRET|ACCESS[_-]?KEY|SUBSCRIPTION[_-]?KEY|PRIVATE[_-]?KEY|PASSW(?:OR)?D|TOKEN|CREDENTIALS?|AUTH[_-]?TOKEN)[A-Za-z0-9_]*)[ \\\\t]*[:=][ \\\\t]*(\\\"[^\\\"]{6,}\\\"|'[^']{6,}'|[^\\\\s\\\"']{6,})\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"labeledValue\"\n },\n \"skip\": {\n \"handler\": \"nonLiteralValue\"\n }\n },\n {\n \"id\": \"secret-assignment\",\n \"tier\": \"warn\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Secret-named command-line flag with a SPACE-separated literal value (--api-key <v>, --token <v>): the one credential position the assignment form above cannot see, since it needs `=` or `:` after the name. `X-Api-Key: <v>` and `--api-key=<v>` already match above (Api-Key, api-key) and are deliberately not repeated here, so one value yields one finding. For the shapes a recorded command line takes (tenjin-agent#281): a hex-only key has no vendor prefix, and bare hex is deliberately never reported so a commit SHA still syncs, so the credential POSITION is the signal.\",\n \"source\": \"tenjin (closes tenjin-agent#281)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"(--(?:[a-z0-9]+-)*(?:api[_-]?key|api[_-]?token|access[_-]?key|access[_-]?token|auth[_-]?token|secret[_-]?key|private[_-]?key|subscription[_-]?key|credentials?|secret|token|password|passwd))[ \\\\t]+(\\\"[^\\\"]{6,}\\\"|'[^']{6,}'|[^\\\\s\\\"']{6,})\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"labeledValue\"\n },\n \"skip\": {\n \"handler\": \"nonLiteralValue\"\n }\n },\n {\n \"id\": \"secret-assignment\",\n \"tier\": \"warn\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Quoted secret name before `:` or `=` with a quoted value (\\\"password\\\": \\\"...\\\", 'api_key' = '...'), the JSON and YAML form of the first row (tenjin-agent#296). Narrower than the first row on purpose, so the review-round-6 config keys stay clean: the name must END in the secret word (no `max_tokens`, `tokenizer`, `passwordHash`), and the value must be quoted and carry a letter and a digit (no `128000`, no `\\\"include\\\"`). A letters-only quoted password is an accepted miss.\",\n \"source\": \"tenjin (tenjin-agent#296)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"(?<=[\\\"'])([A-Za-z0-9_-]*(?:API[_-]?KEY|SECRET|ACCESS[_-]?KEY|SUBSCRIPTION[_-]?KEY|PRIVATE[_-]?KEY|PASSW(?:OR)?D|TOKEN|CREDENTIALS?|AUTH[_-]?TOKEN))[\\\"'][ \\\\t]*[:=][ \\\\t]*(\\\"(?=[^\\\"]*\\\\d)(?=[^\\\"]*[A-Za-z])[^\\\"]{6,}\\\"|'(?=[^']*\\\\d)(?=[^']*[A-Za-z])[^']{6,}')\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"labeledValue\"\n },\n \"skip\": {\n \"handler\": \"nonLiteralValue\"\n }\n },\n {\n \"id\": \"aws-access-key\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"AWS access key id (AKIA/ASIA/ABIA/ACCA/A3T prefixes).\",\n \"source\": \"gitleaks:aws-access-token\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b(?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[0-9A-Z]{16}\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 4\n }\n },\n {\n \"id\": \"jwt\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"JSON Web Token: three base64url segments whose header starts eyJ.\",\n \"source\": \"gitleaks:jwt\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\beyJ[A-Za-z0-9_-]{5,}\\\\.eyJ[A-Za-z0-9_-]{5,}\\\\.[A-Za-z0-9_-]{5,}\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 3\n }\n },\n {\n \"id\": \"github-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"GitHub classic PAT/OAuth/app/refresh token or fine-grained PAT (github_pat_).\",\n \"source\": \"gitleaks:github-pat + github-fine-grained-pat\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b(?:gh[posru]_[0-9A-Za-z]{36}|github_pat_[0-9A-Za-z_]{82})\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 4\n }\n },\n {\n \"id\": \"slack-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Slack bot/user/app/refresh/legacy token.\",\n \"source\": \"gitleaks:slack-*-token\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bxox[baprs]-[0-9A-Za-z-]{10,}\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 5\n }\n },\n {\n \"id\": \"stripe-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Stripe live or test secret/restricted key.\",\n \"source\": \"gitleaks:stripe-access-token\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b[sr]k_(?:live|test)_[0-9A-Za-z]{10,99}\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 8\n }\n },\n {\n \"id\": \"anthropic-key\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Anthropic API key (sk-ant-).\",\n \"source\": \"gitleaks:anthropic-api-key\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bsk-ant-[0-9A-Za-z_-]{20,}\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 7\n }\n },\n {\n \"id\": \"openai-key\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"OpenAI key: classic sk- plus sk-proj-/sk-svcacct-/sk-admin-. The body must carry a digit so sk- kebab identifiers do not hard-block. Project, service-account and admin keys carry `_` and `-` throughout the body, so the prefixed branch takes the wider class and its own trailing guard; the bare branch keeps the digit requirement and its own guard. The guards live INSIDE each branch: a shared guard outside the alternation made a classic key followed by `-old` fail outright (review round 6).\",\n \"source\": \"gitleaks:openai-api-key\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bsk-(?!ant-)(?:(?:proj|svcacct|admin)-[0-9A-Za-z_-]{20,}(?![0-9A-Za-z_-])|(?=[0-9A-Za-z]*[0-9])[0-9A-Za-z]{20,}(?![0-9A-Za-z]))\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 3\n }\n },\n {\n \"id\": \"google-key\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Google API key (AIza) or OAuth client secret (GOCSPX-).\",\n \"source\": \"gitleaks:gcp-api-key + gcp-oauth-client-secret\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b(?:AIza[0-9A-Za-z_-]{35}|GOCSPX-[0-9A-Za-z_-]{20,})\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"googleKey\"\n }\n },\n {\n \"id\": \"npm-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"npm access token.\",\n \"source\": \"gitleaks:npm-access-token\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bnpm_[0-9A-Za-z]{36}\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 4\n }\n },\n {\n \"id\": \"supabase-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Supabase personal access token (sbp_) or secret/publishable API key (sb_*_).\",\n \"source\": \"gitleaks:supabase-access-token\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bsbp_[0-9a-f]{40}\\\\b|\\\\bsb_(?:secret|publishable)_[0-9A-Za-z_-]{20,}\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 4\n }\n },\n {\n \"id\": \"twilio-key\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Twilio API key SID (SK + 32 lowercase hex).\",\n \"source\": \"gitleaks:twilio-api-key\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bSK[0-9a-f]{32}\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 2\n }\n },\n {\n \"id\": \"sendgrid-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"SendGrid API key (SG.<id>.<secret>).\",\n \"source\": \"gitleaks:sendgrid-api-token\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bSG\\\\.[0-9A-Za-z_-]{16,32}\\\\.[0-9A-Za-z_-]{16,64}\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 3\n }\n },\n {\n \"id\": \"huggingface-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Hugging Face user access token (hf_).\",\n \"source\": \"gitleaks:huggingface-access-token\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bhf_[0-9A-Za-z]{30,}\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 3\n }\n },\n {\n \"id\": \"vercel-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Vercel Blob read/write store token.\",\n \"source\": \"tenjin (shape from the Vercel Blob docs)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bvercel_blob_[a-z]{2}_[0-9A-Za-z_]{24,}\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 12\n }\n },\n {\n \"id\": \"vercel-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Vercel platform token (vcp_/vci_/vca_/vcr_/vck_ prefixes).\",\n \"source\": \"secretlint:@secretlint/secretlint-rule-vercel\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b(?:vcp|vci|vca|vcr|vck)_[0-9A-Za-z]{20,60}(?![0-9A-Za-z])\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 4\n }\n },\n {\n \"id\": \"notion-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Notion integration token (ntn_).\",\n \"source\": \"secretlint:@secretlint/secretlint-rule-notion\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bntn_[0-9]{11}[0-9A-Za-z]{35}(?![0-9A-Za-z])\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 4\n }\n },\n {\n \"id\": \"linear-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Linear API key (lin_api_).\",\n \"source\": \"secretlint:@secretlint/secretlint-rule-linear\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\blin_api_[0-9A-Za-z_]{32,128}(?![0-9A-Za-z_])\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 8\n }\n },\n {\n \"id\": \"figma-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Figma personal access token (figd_).\",\n \"source\": \"secretlint:@secretlint/secretlint-rule-figma\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bfigd_[0-9A-Za-z_-]{40,200}(?![0-9A-Za-z_-])\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 5\n }\n },\n {\n \"id\": \"gitlab-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"GitLab personal access token (glpat-).\",\n \"source\": \"secretlint:@secretlint/secretlint-rule-gitlab\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bglpat-[0-9A-Za-z_-]{20,128}(?![0-9A-Za-z_-])\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 6\n }\n },\n {\n \"id\": \"docker-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Docker Hub personal access token (dckr_pat_).\",\n \"source\": \"secretlint:@secretlint/secretlint-rule-docker\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bdckr_pat_[0-9A-Za-z_-]{27}(?![0-9A-Za-z_-])\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 9\n }\n },\n {\n \"id\": \"cloudflare-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Cloudflare API key or account/user token (cfk_/cfut_/cfat_).\",\n \"source\": \"secretlint:@secretlint/secretlint-rule-cloudflare\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b(?:cfk|cfut|cfat)_[0-9A-Za-z]{40}[0-9a-f]{8}(?![0-9A-Za-z])\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 4\n }\n },\n {\n \"id\": \"databricks-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Databricks personal access token (dapi).\",\n \"source\": \"secretlint:@secretlint/secretlint-rule-databricks\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bdapi[0-9A-Fa-f]{32}(?:-[0-9])?(?![0-9A-Fa-f])\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 4\n }\n },\n {\n \"id\": \"openssh-private-key\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"OpenSSH private key body pasted without its PEM framing (base64 of the openssh-key-v1 magic).\",\n \"source\": \"gitleaks:private-key (framing-free variant)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bb3BlbnNzaC1rZXktdjEA[0-9A-Za-z+/=]{20,}\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 8\n }\n },\n {\n \"id\": \"totp-uri\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"otpauth:// TOTP/HOTP provisioning URI; its secret= parameter is a live second factor.\",\n \"source\": \"tenjin (RFC-style otpauth key URI)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\botpauth:\\\\/\\\\/[ht]otp\\\\/[^\\\\s\\\"'`<>)\\\\]]+\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 15\n }\n },\n {\n \"id\": \"db-connection-uri\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Basic-auth style URI with an embedded password (scheme://user:pass@host), including database connection strings. The scheme run is length-bounded: unbounded, it backtracks quadratically across a transcript-length dotted-token line that never reaches ://. The user may be empty: `redis://:password@host` is the standard Redis form.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b([a-z][a-z0-9+.-]{0,31}):\\\\/\\\\/([^\\\\s:@/]*):([^\\\\s@/]+)@([^\\\\s/:]+)\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"dbConnectionUri\"\n },\n \"skip\": {\n \"handler\": \"exampleDbPassword\"\n }\n },\n {\n \"id\": \"bearer-token\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Authorization: Bearer header carrying a live token.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bAuthorization:\\\\s*Bearer\\\\s+(\\\\S{8,})\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"bearerToken\"\n },\n \"skip\": {\n \"handler\": \"placeholderGroup1\"\n }\n },\n {\n \"id\": \"basic-auth-header\",\n \"tier\": \"warn\",\n \"scopes\": [\"query\", \"publish\"],\n \"description\": \"Authorization: Basic header: the base64 of user:password, under the entropy floor and on no vendor prefix (tenjin-agent#296). The header name is a bounded lookbehind behind a shape lookahead, so the mask keeps it, replaces the credential alone, and a whitespace run stays linear.\",\n \"source\": \"tenjin (tenjin-agent#296)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"(?=[A-Za-z0-9+/]{8})(?<=\\\\bAuthorization:[ \\\\t]{0,16}Basic[ \\\\t]{1,16})[A-Za-z0-9+/]{8,}={0,2}(?![A-Za-z0-9+/=])\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 0\n }\n },\n {\n \"id\": \"curl-user-credential\",\n \"tier\": \"warn\",\n \"scopes\": [\"query\", \"publish\"],\n \"description\": \"curl -u / --user user:password on one command (tenjin-agent#296): the password is masked and the command and user kept. Anchored on `curl` within 200 characters of the flag on the same pipeline segment, so `docker run -u 1000:1000` never matches. A `$VAR`, a placeholder or a bare lowercase word is skipped as the assignment row skips it.\",\n \"source\": \"tenjin (tenjin-agent#296)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"(\\\\bcurl\\\\b[^\\\\n|;&]{0,200}?[ \\\\t](?:-u|--user)(?:[ \\\\t]+|=)[\\\"']?[^\\\\s:\\\"']{1,64}):([^\\\\s\\\"']+)\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"labeledValue\"\n },\n \"skip\": {\n \"handler\": \"nonLiteralValue\"\n }\n },\n {\n \"id\": \"rpc-url-key\",\n \"tier\": \"warn\",\n \"scopes\": [\"query\"],\n \"description\": \"An RPC provider key in a URL path, keyed on the provider's documented host: QuickNode (<name>.<network>.quiknode.pro/<key>/), Alchemy (<chain>.g.alchemy.com/v2/<key> and /nft/v3/<key>), Infura (<network>.infura.io/v3/<key> and /ws/v3/<key>), Ankr (rpc.ankr.com/<chain>/<token>), Chainstack (nd-NNN-NNN-NNN.p2pify.com/<key>, <network>.core.chainstack.com/<key> and /ws/<key>), GetBlock (go.getblock.io/<token>/, shared.<region>.getblock.io/<token>/), dRPC (lb.drpc.live/<network>/<key>) and Tenderly (<network>.gateway.tenderly.co/<key>). Query only: it keeps the node key of tenjin-agent#388 out of a router packet now that url-path-credential no longer masks in queries (tenjin-agent#489). The key must be 16 or more [A-Za-z0-9_-] characters with a letter and a digit, so a keyless path (Alchemy `demo`, a chain name) stays. Blast API is left out: it shut down.\",\n \"source\": \"tenjin (tenjin-agent#489)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\/(?=[\\\\w-]{16})(?<=\\\\b(?:https?|wss?):\\\\/\\\\/(?:[\\\\w-]+(?:\\\\.[\\\\w-]+)*\\\\.quiknode\\\\.pro|[\\\\w-]+\\\\.g\\\\.alchemy\\\\.com\\\\/(?:v2|nft\\\\/v3)|[\\\\w-]+\\\\.infura\\\\.io\\\\/(?:ws\\\\/)?v3|rpc\\\\.ankr\\\\.com\\\\/[\\\\w-]+|(?:ws-)?nd-[\\\\d-]+\\\\.p2pify\\\\.com|[\\\\w-]+\\\\.core\\\\.chainstack\\\\.com(?:\\\\/ws)?|(?:go|(?:shared|dedicated|limitless)\\\\.[\\\\w-]+)\\\\.getblock\\\\.io|lb\\\\.drpc\\\\.(?:live|org)\\\\/[\\\\w-]+|[\\\\w-]+\\\\.gateway\\\\.tenderly\\\\.co)\\\\/)(?=[\\\\w-]*[A-Za-z])(?=[\\\\w-]*\\\\d)[\\\\w-]{16,}(?=[.;:!]*(?:[\\\\/?#\\\\s\\\\\\\"'<>(),\\\\[\\\\]{}`]|$))\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 1\n }\n },\n {\n \"id\": \"webhook-url-token\",\n \"tier\": \"warn\",\n \"scopes\": [\"query\"],\n \"description\": \"A webhook token in a URL path, keyed on the service's documented host: Slack (hooks.slack.com/services/T.../B.../<token> and /triggers/...), Discord (discord.com/api/webhooks/<id>/<token>, with or without /v10, and the discordapp.com, ptb and canary hosts) and Make (hook.make.com/<token>, and the regional hook.<region>.make.com). Query only: anyone holding the URL can post as the hook, and url-path-credential no longer masks in queries (tenjin-agent#489). Any path segment of 16 or more [A-Za-z0-9_-] characters after the host is the token; ids before it are shorter. The Slack lookbehind spans at most four segments, so a line of long segments stays linear. Google Chat carries its token in the query string, which url-query-credential masks. Teams connector URLs are retired (2026-05), and a Zapier catch-hook id is 5 characters, so neither is listed.\",\n \"source\": \"tenjin (tenjin-agent#489)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\/(?=[\\\\w-]{16})(?<=\\\\bhttps?:\\\\/\\\\/(?:hooks\\\\.slack\\\\.com(?:\\\\/[\\\\w-]+){1,4}|(?:(?:ptb|canary)\\\\.)?discord(?:app)?\\\\.com\\\\/api(?:\\\\/v\\\\d+)?\\\\/webhooks\\\\/\\\\d+|hook(?:\\\\.[a-z]{2}\\\\d)?\\\\.make\\\\.com)\\\\/)[\\\\w-]{16,}(?=[.;:!]*(?:[\\\\/?#\\\\s\\\\\\\"'<>(),\\\\[\\\\]{}`]|$))\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 1\n }\n },\n {\n \"id\": \"url-query-credential\",\n \"tier\": \"warn\",\n \"scopes\": [\"query\", \"publish\"],\n \"description\": \"Credential-named query parameter on a URL (?key=, &api_key=, ?token=, ?sig=, ?password=): the value is masked and the name kept. The value class stops at `&`, `#`, whitespace, quotes and brackets, so a value another row already replaced with `[redacted …]` is not masked twice.\",\n \"source\": \"tenjin (tenjin-agent#388)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"([?&](?:key|apikey|api_key|api-key|token|access_token|auth|secret|client_secret|sig|signature|password|pwd))=([^&#\\\\s\\\"'<>\\\\[\\\\]]+)\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"labeledValue\"\n }\n },\n {\n \"id\": \"url-path-credential\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"A path segment of 24 or more [A-Za-z0-9_-] characters that mixes letters and digits, on an http(s) URL: the shape a webhook secret or a signed-link token takes. Not masked in a query: a document id, a gist, a share link or a Reddit slug has the same shape, and a mask there stops a public read with nothing sent (tenjin-agent#489). `rpc-url-key` masks the node keys a query can carry in a path. Four exclusions, each from a measured miss: a segment with two hyphenated words (an article slug), a 40-hex git commit after a git path marker (/commit/, /commits/, /blob/, /tree/, /raw/, /compare/) or on a git host (github.com, gitlab.com, bitbucket.org, codeberg.org), since elsewhere a 40-hex segment is a node key (https://<name>.quiknode.pro/<40 hex>/), a 0x-prefixed 64-hex (the hex64 row already calls a 64-hex inside a URL a hash), a UUID, and a URL character class that stops at quotes, brackets and commas, so one match never spans two URLs in a JSON string. The segment must be whole (a `.` or `%` inside it is a filename or an encoded slug, not a token). The shape lookahead runs before the scheme lookbehind, and the lookbehind is bounded, so a line of short segments stays linear.\",\n \"source\": \"tenjin (tenjin-agent#388)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\/(?=[\\\\w-]{24})(?<=\\\\bhttps?:\\\\/\\\\/[^\\\\s?#\\\"'`<>()\\\\[\\\\]{},]{1,2048}\\\\/)(?=[\\\\w-]*[A-Za-z])(?=[\\\\w-]*\\\\d)(?![\\\\w-]*?(?<![A-Za-z])[A-Za-z]{3,}-[A-Za-z]{3})(?!(?:0x[0-9a-f]{64}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?![\\\\w-]))(?!(?=[0-9a-f]{40}(?![\\\\w-]))(?<=\\\\/(?:commit|commits|blob|tree|raw|compare)\\\\/|\\\\bhttps?:\\\\/\\\\/(?:www\\\\.)?(?:github\\\\.com|gitlab\\\\.com|bitbucket\\\\.org|codeberg\\\\.org)\\\\/[^\\\\s?#\\\"'`<>()\\\\[\\\\]{},]{0,2048}))[\\\\w-]{24,}(?=[.;:!]*(?:[\\\\/?#\\\\s\\\"'<>(),\\\\[\\\\]{}`]|$))\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 1\n }\n },\n {\n \"id\": \"bare-hex-key\",\n \"tier\": \"warn\",\n \"scopes\": [\"query\", \"publish\"],\n \"description\": \"64 hex with no 0x, the shape a private key takes when a tool exports it bare (tenjin-agent#388). A hash label within two tokens before it (tx, txn, txid, hash, sha, sha256, hmac, digest, commit, id, checksum, sig, signature, across markdown emphasis) or an http(s) URL around it makes it a hash and it is kept, the same downgrade the 0x form has. A 128-hex run (sha512) is not a 64-hex run and never matches.\",\n \"source\": \"tenjin (tenjin-agent#388)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"(?<![0-9A-Za-z])[0-9a-fA-F]{64}(?![0-9A-Za-z])\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 0\n },\n \"skip\": {\n \"handler\": \"hashLabelled\"\n }\n },\n {\n \"id\": \"bare-hex-key\",\n \"tier\": \"warn\",\n \"scopes\": [\"query\", \"publish\"],\n \"description\": \"A 64-hex key split into two 32-hex halves by one space or one newline, with an optional 0x on the first half. Bounded to exactly two adjacent halves: a third 32-hex run before or after (a list of MD5 sums) keeps the whole list as written, and a hash label keeps it as for the row above.\",\n \"source\": \"tenjin (tenjin-agent#388)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"(?<![0-9A-Za-z])(?<![0-9a-fA-F]{32}[ \\\\n])(?:0x)?[0-9a-fA-F]{32}[ \\\\n][0-9a-fA-F]{32}(?![0-9A-Za-z])(?![ \\\\n][0-9a-fA-F]{32})\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 0\n },\n \"skip\": {\n \"handler\": \"hashLabelled\"\n }\n },\n {\n \"id\": \"solana-secret-key\",\n \"tier\": \"warn\",\n \"scopes\": [\"query\", \"publish\"],\n \"description\": \"An 87 or 88 character base58 run: a Solana keypair's 64-byte secret key as a wallet exports it (tenjin-agent#388). A transaction signature has the same shape, so a tx or sig label before it or an http(s) URL around it keeps it, as for bare-hex-key. A 32-byte public key is 43 or 44 characters and never matches.\",\n \"source\": \"tenjin (tenjin-agent#388)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"(?<![1-9A-HJ-NP-Za-km-z])[1-9A-HJ-NP-Za-km-z]{87,88}(?![1-9A-HJ-NP-Za-km-z])\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 0\n },\n \"skip\": {\n \"handler\": \"hashLabelled\"\n }\n },\n {\n \"id\": \"solana-secret-key\",\n \"tier\": \"warn\",\n \"scopes\": [\"query\", \"publish\"],\n \"description\": \"A JSON array of exactly 64 integers from 0 to 255: the solana-keygen keypair file.\",\n \"source\": \"tenjin (tenjin-agent#388)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\[\\\\s*(?:(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)\\\\s*,\\\\s*){63}(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)\\\\s*\\\\]\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"mask\",\n \"keep\": 1\n }\n },\n {\n \"id\": \"wallet-address\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"EVM account/contract address (0x + 40 hex).\",\n \"source\": \"blockrun-mcp (wallet-key leak scanner)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"(?<![0-9a-fx])0x[0-9a-fA-F]{40}(?![0-9a-fA-F])\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"abbreviate\",\n \"head\": 6,\n \"tail\": 4\n }\n },\n {\n \"id\": \"confidential-marker\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Document classification legend (CONFIDENTIAL stamp, INTERNAL USE ONLY, DO NOT DISTRIBUTE). Case-sensitive: marker-shaped, not word-in-phrase.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b(?:STRICTLY|COMPANY|HIGHLY)\\\\s+CONFIDENTIAL\\\\b|(?<![A-Z]{2,}[ \\\\t]+)\\\\bCONFIDENTIAL\\\\b|\\\\bCONFIDENTIAL\\\\b(?![ \\\\t]+[A-Z]{2,})|\\\\bConfidential(?=\\\\s*(?:[-:.,;–—]|$))|\\\\b(?:INTERNAL|Internal)(?:\\\\s+(?:USE|Use))?\\\\s+(?:ONLY|Only)\\\\b|\\\\b(?:DO\\\\s+NOT\\\\s+DISTRIBUTE|Do\\\\s+Not\\\\s+Distribute)\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\"\n }\n },\n {\n \"id\": \"internal-hostname\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Hostname on a private-use suffix (.internal, .corp, .local, .lan, .intranet). Label count and label length are bounded: an unbounded (label\\\\.)+ run is quadratic on a transcript-length line of dotted digits.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b(?:[a-z0-9-]{1,63}\\\\.){1,6}(?:internal|corp|local|lan|intranet)\\\\b\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\"\n }\n },\n {\n \"id\": \"private-network-endpoint\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"RFC1918 / link-local IPv4 endpoint (10/8, 172.16/12, 192.168/16, 169.254/16).\",\n \"source\": \"tenjin (closes tenjin-agent#45)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"(?<![\\\\d.])(?:10\\\\.(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)\\\\.(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)\\\\.(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)|172\\\\.(?:1[6-9]|2\\\\d|3[01])\\\\.(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)\\\\.(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)|192\\\\.168\\\\.(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)\\\\.(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)|169\\\\.254\\\\.(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)\\\\.(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d))(?::\\\\d{2,5})?(?!\\\\.?\\\\d)\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\"\n }\n },\n {\n \"id\": \"private-network-endpoint\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Loopback / wildcard-bind development endpoint. Scheme or port required so prose about localhost does not warn.\",\n \"source\": \"tenjin (closes tenjin-agent#45)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"https?:\\\\/\\\\/(?:localhost|127\\\\.0\\\\.0\\\\.1|0\\\\.0\\\\.0\\\\.0|\\\\[::1\\\\])(?::\\\\d{2,5})?(?:\\\\/[^\\\\s\\\"'`<>?&)\\\\]]*)?|\\\\b(?:localhost|127\\\\.0\\\\.0\\\\.1|0\\\\.0\\\\.0\\\\.0):\\\\d{2,5}\\\\b\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\",\n \"max\": 80\n }\n },\n {\n \"id\": \"collaboration-url\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Link into a collaboration workspace (Google Docs/Drive, Notion, Figma, Slack archives, Linear, Jira/Confluence): the target is usually access-controlled.\",\n \"source\": \"tenjin (closes tenjin-agent#45)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"https?:\\\\/\\\\/(?:docs\\\\.google\\\\.com|drive\\\\.google\\\\.com|(?:[a-z0-9-]+\\\\.)?notion\\\\.(?:so|site)|(?:www\\\\.)?figma\\\\.com|(?:[a-z0-9-]+\\\\.)?slack\\\\.com\\\\/archives|linear\\\\.app|[a-z0-9-]+\\\\.atlassian\\\\.net)(?:\\\\/[^\\\\s\\\"'`<>?&)\\\\]]*)?\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\",\n \"max\": 80\n }\n },\n {\n \"id\": \"cloud-resource-id\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"AWS ARN: names an account, region, and resource.\",\n \"source\": \"tenjin (closes tenjin-agent#45)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\barn:aws[0-9a-z-]*:[0-9a-z-]+:[0-9a-z-]*:\\\\d{0,12}:[^\\\\s\\\"'`<>,)\\\\]]+\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\",\n \"max\": 80\n }\n },\n {\n \"id\": \"cloud-resource-id\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"GCP fully-qualified resource name (projects/<id>/<collection>/<name>).\",\n \"source\": \"tenjin (closes tenjin-agent#45)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bprojects\\\\/[a-z][a-z0-9-]{4,28}[a-z0-9]\\\\/(?:locations|topics|subscriptions|secrets|instances|serviceAccounts|datasets|buckets|zones|keyRings|clusters|jobs|models)\\\\/[^\\\\s\\\"'`<>,)\\\\]]+\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\",\n \"max\": 80\n }\n },\n {\n \"id\": \"cloud-resource-id\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Azure resource id: /subscriptions/<guid>/resourceGroups/<name>/...\",\n \"source\": \"tenjin (closes tenjin-agent#45)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\/subscriptions\\\\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\\\\/resourceGroups\\\\/[^\\\\s\\\"'`<>,)\\\\]/]+(?:\\\\/[^\\\\s\\\"'`<>,)\\\\]]*)?\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\",\n \"max\": 80\n }\n },\n {\n \"id\": \"cloud-resource-id\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Cloud object-storage location (s3://, gs://, or an S3/Azure Blob/GCS bucket hostname).\",\n \"source\": \"tenjin (closes tenjin-agent#45)\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b(?:s3|gs):\\\\/\\\\/[a-z0-9][a-z0-9._-]{2,62}(?:\\\\/[^\\\\s\\\"'`<>,?&)\\\\]]*)?|\\\\b[a-z0-9][a-z0-9.-]{1,62}\\\\.(?:s3(?:[.-][a-z0-9-]+)?\\\\.amazonaws\\\\.com|blob\\\\.core\\\\.windows\\\\.net|storage\\\\.googleapis\\\\.com)\\\\b\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\",\n \"max\": 80\n }\n },\n {\n \"id\": \"local-path\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Home-anchored local filesystem path: leaks the machine username and private project layout.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"(?:(?<![\\\\w.-])\\\\/(?:Users|home)\\\\/([A-Za-z0-9._-]+)(?:\\\\/[^\\\\s\\\"'`)\\\\]}>:,;?&/]+)+|\\\\b[A-Za-z]:\\\\\\\\[Uu]sers\\\\\\\\([^\\\\\\\\\\\\s\\\"']+)(?:\\\\\\\\[^\\\\\\\\\\\\s\\\"']+)+)\",\n \"flags\": \"dg\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"localPath\"\n },\n \"skip\": {\n \"handler\": \"placeholderUsername\"\n }\n },\n {\n \"id\": \"customer-identifier\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Labeled customer/account/tenant identifier with a literal value.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b((?:customer|client|account|tenant|subscriber)[ _-]?(?:id|number|no))\\\\b\\\\s*[:=#]\\\\s*(\\\"[^\\\"]{2,}\\\"|'[^']{2,}'|[A-Za-z0-9][A-Za-z0-9._-]{2,})\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"labeledValue\"\n },\n \"skip\": {\n \"handler\": \"nonLiteralValue\"\n }\n },\n {\n \"id\": \"paid-content-marker\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Third-party rights legend suggesting copied licensed material. Legend shapes only: bare paywall vocabulary is this marketplace’s own subject matter.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\ball rights reserved\\\\b|\\\\b(?:reprinted|reproduced|used) with permission\\\\b|\\\\bnot for (?:redistribution|republication)\\\\b|\\\\bdo not (?:redistribute|republish)\\\\b|(?:©|\\\\(c\\\\)|copyright)\\\\s*(?:19|20)\\\\d{2}\\\\b\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\"\n }\n },\n {\n \"id\": \"embedded-instruction\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Injection-shaped imperative captured from a prompt or tool output.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b(?:ignore|disregard|forget)\\\\s+(?:all\\\\s+|any\\\\s+)?(?:previous|prior|above|earlier|preceding)\\\\s+(?:instructions?|prompts?|context|messages?)\\\\b|\\\\bdo not (?:reveal|disclose|mention) (?:this|these|the above)\\\\b\",\n \"flags\": \"gi\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\"\n }\n },\n {\n \"id\": \"embedded-instruction\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Hidden-prompt document header. Case-sensitive: the all-caps header form is the injection-typed one.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\bBEGIN (?:SYSTEM|HIDDEN) (?:PROMPT|INSTRUCTIONS)\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\"\n }\n },\n {\n \"id\": \"email\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Email address (PII), subsuming corporate-domain addresses. Lengths follow the RFC limits so the local part and the domain cannot backtrack against each other: unbounded, the pair is quadratic on a transcript-length line.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"\\\\b[A-Za-z0-9._%+-]{1,64}@(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\\\.){1,8}[A-Za-z]{2,24}\\\\b\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\"\n },\n \"skip\": {\n \"handler\": \"reservedExampleEmail\"\n }\n },\n {\n \"id\": \"phone\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Telephone number (PII).\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"regex\",\n \"pattern\": \"(?<!\\\\d)(?:\\\\+?\\\\d{1,2}[\\\\s.-]?)?(?:\\\\(\\\\d{3}\\\\)|\\\\d{3})[\\\\s.-]\\\\d{3}[\\\\s.-]\\\\d{4}(?!\\\\d)\",\n \"flags\": \"g\"\n },\n \"excerpt\": {\n \"kind\": \"verbatim\"\n }\n },\n {\n \"id\": \"raw-private-key\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"0x + 64 hex with no hash context. Demoted to the warn detector hex32-value when a hash/identifier label precedes it (within two intervening tokens, across markdown and quote punctuation), when it sits inside an http(s) URL, or when it is one of the publicHexConstants below. An unlabeled bare 64-hex stays block: that is the floor.\",\n \"source\": \"blockrun-mcp (wallet-key leak scanner)\",\n \"match\": {\n \"kind\": \"algorithm\",\n \"algorithm\": \"hex64\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"hex64\"\n }\n },\n {\n \"id\": \"pem-private-key\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"PEM private-key armor (-----BEGIN ... PRIVATE KEY-----), RSA/EC/OPENSSH/PGP variants.\",\n \"source\": \"gitleaks:private-key\",\n \"match\": {\n \"kind\": \"algorithm\",\n \"algorithm\": \"pemBlock\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"pemBlock\"\n }\n },\n {\n \"id\": \"bip39-seed-phrase\",\n \"tier\": \"block\",\n \"scopes\": [\"query\", \"publish\", \"team\"],\n \"description\": \"Twelve or more consecutive BIP-39 English wordlist words separated only by whitespace or quote characters, so a quoted `.env` value (MNEMONIC=\\\"abandon ... about\\\") counts (tenjin-agent#296): a wallet recovery phrase.\",\n \"source\": \"tenjin; wordlist from BIP-0039 (see NOTICE.md)\",\n \"match\": {\n \"kind\": \"algorithm\",\n \"algorithm\": \"bip39\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"bip39\"\n }\n },\n {\n \"id\": \"env-dump-block\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Three or more consecutive SHOUTY_KEY=value lines carrying at least one substantial literal: a pasted .env file.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"algorithm\",\n \"algorithm\": \"envDump\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"envDump\"\n }\n },\n {\n \"id\": \"high-entropy-string\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Catch-all for unknown credential formats: a long mixed-case alphanumeric token whose Shannon entropy and case-run profile match random key material rather than an identifier.\",\n \"source\": \"tenjin (entropy heuristic in the spirit of gitleaks entropy gating)\",\n \"match\": {\n \"kind\": \"algorithm\",\n \"algorithm\": \"entropy\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"entropy\"\n }\n },\n {\n \"id\": \"long-verbatim-quote\",\n \"tier\": \"warn\",\n \"scopes\": [\"publish\"],\n \"description\": \"Fenced block or blockquote run long enough to read as copied third-party material.\",\n \"source\": \"tenjin\",\n \"match\": {\n \"kind\": \"algorithm\",\n \"algorithm\": \"longVerbatim\"\n },\n \"excerpt\": {\n \"kind\": \"custom\",\n \"handler\": \"longVerbatim\"\n }\n }\n ]\n}\n","{\n \"source\": \"BIP-0039 English wordlist (bitcoin/bips), as distributed by @scure/bip39 (MIT). Vendored as data, not as a dependency: see NOTICE.md.\",\n \"count\": 2048,\n \"words\": \"abandon ability able about above absent absorb abstract absurd abuse access accident account accuse achieve acid acoustic acquire across act action actor actress actual adapt add addict address adjust admit adult advance advice aerobic affair afford afraid again age agent agree ahead aim air airport aisle alarm album alcohol alert alien all alley allow almost alone alpha already also alter always amateur amazing among amount amused analyst anchor ancient anger angle angry animal ankle announce annual another answer antenna antique anxiety any apart apology appear apple approve april arch arctic area arena argue arm armed armor army around arrange arrest arrive arrow art artefact artist artwork ask aspect assault asset assist assume asthma athlete atom attack attend attitude attract auction audit august aunt author auto autumn average avocado avoid awake aware away awesome awful awkward axis baby bachelor bacon badge bag balance balcony ball bamboo banana banner bar barely bargain barrel base basic basket battle beach bean beauty because become beef before begin behave behind believe below belt bench benefit best betray better between beyond bicycle bid bike bind biology bird birth bitter black blade blame blanket blast bleak bless blind blood blossom blouse blue blur blush board boat body boil bomb bone bonus book boost border boring borrow boss bottom bounce box boy bracket brain brand brass brave bread breeze brick bridge brief bright bring brisk broccoli broken bronze broom brother brown brush bubble buddy budget buffalo build bulb bulk bullet bundle bunker burden burger burst bus business busy butter buyer buzz cabbage cabin cable cactus cage cake call calm camera camp can canal cancel candy cannon canoe canvas canyon capable capital captain car carbon card cargo carpet carry cart case cash casino castle casual cat catalog catch category cattle caught cause caution cave ceiling celery cement census century cereal certain chair chalk champion change chaos chapter charge chase chat cheap check cheese chef cherry chest chicken chief child chimney choice choose chronic chuckle chunk churn cigar cinnamon circle citizen city civil claim clap clarify claw clay clean clerk clever click client cliff climb clinic clip clock clog close cloth cloud clown club clump cluster clutch coach coast coconut code coffee coil coin collect color column combine come comfort comic common company concert conduct confirm congress connect consider control convince cook cool copper copy coral core corn correct cost cotton couch country couple course cousin cover coyote crack cradle craft cram crane crash crater crawl crazy cream credit creek crew cricket crime crisp critic crop cross crouch crowd crucial cruel cruise crumble crunch crush cry crystal cube culture cup cupboard curious current curtain curve cushion custom cute cycle dad damage damp dance danger daring dash daughter dawn day deal debate debris decade december decide decline decorate decrease deer defense define defy degree delay deliver demand demise denial dentist deny depart depend deposit depth deputy derive describe desert design desk despair destroy detail detect develop device devote diagram dial diamond diary dice diesel diet differ digital dignity dilemma dinner dinosaur direct dirt disagree discover disease dish dismiss disorder display distance divert divide divorce dizzy doctor document dog doll dolphin domain donate donkey donor door dose double dove draft dragon drama drastic draw dream dress drift drill drink drip drive drop drum dry duck dumb dune during dust dutch duty dwarf dynamic eager eagle early earn earth easily east easy echo ecology economy edge edit educate effort egg eight either elbow elder electric elegant element elephant elevator elite else embark embody embrace emerge emotion employ empower empty enable enact end endless endorse enemy energy enforce engage engine enhance enjoy enlist enough enrich enroll ensure enter entire entry envelope episode equal equip era erase erode erosion error erupt escape essay essence estate eternal ethics evidence evil evoke evolve exact example excess exchange excite exclude excuse execute exercise exhaust exhibit exile exist exit exotic expand expect expire explain expose express extend extra eye eyebrow fabric face faculty fade faint faith fall false fame family famous fan fancy fantasy farm fashion fat fatal father fatigue fault favorite feature february federal fee feed feel female fence festival fetch fever few fiber fiction field figure file film filter final find fine finger finish fire firm first fiscal fish fit fitness fix flag flame flash flat flavor flee flight flip float flock floor flower fluid flush fly foam focus fog foil fold follow food foot force forest forget fork fortune forum forward fossil foster found fox fragile frame frequent fresh friend fringe frog front frost frown frozen fruit fuel fun funny furnace fury future gadget gain galaxy gallery game gap garage garbage garden garlic garment gas gasp gate gather gauge gaze general genius genre gentle genuine gesture ghost giant gift giggle ginger giraffe girl give glad glance glare glass glide glimpse globe gloom glory glove glow glue goat goddess gold good goose gorilla gospel gossip govern gown grab grace grain grant grape grass gravity great green grid grief grit grocery group grow grunt guard guess guide guilt guitar gun gym habit hair half hammer hamster hand happy harbor hard harsh harvest hat have hawk hazard head health heart heavy hedgehog height hello helmet help hen hero hidden high hill hint hip hire history hobby hockey hold hole holiday hollow home honey hood hope horn horror horse hospital host hotel hour hover hub huge human humble humor hundred hungry hunt hurdle hurry hurt husband hybrid ice icon idea identify idle ignore ill illegal illness image imitate immense immune impact impose improve impulse inch include income increase index indicate indoor industry infant inflict inform inhale inherit initial inject injury inmate inner innocent input inquiry insane insect inside inspire install intact interest into invest invite involve iron island isolate issue item ivory jacket jaguar jar jazz jealous jeans jelly jewel job join joke journey joy judge juice jump jungle junior junk just kangaroo keen keep ketchup key kick kid kidney kind kingdom kiss kit kitchen kite kitten kiwi knee knife knock know lab label labor ladder lady lake lamp language laptop large later latin laugh laundry lava law lawn lawsuit layer lazy leader leaf learn leave lecture left leg legal legend leisure lemon lend length lens leopard lesson letter level liar liberty library license life lift light like limb limit link lion liquid list little live lizard load loan lobster local lock logic lonely long loop lottery loud lounge love loyal lucky luggage lumber lunar lunch luxury lyrics machine mad magic magnet maid mail main major make mammal man manage mandate mango mansion manual maple marble march margin marine market marriage mask mass master match material math matrix matter maximum maze meadow mean measure meat mechanic medal media melody melt member memory mention menu mercy merge merit merry mesh message metal method middle midnight milk million mimic mind minimum minor minute miracle mirror misery miss mistake mix mixed mixture mobile model modify mom moment monitor monkey monster month moon moral more morning mosquito mother motion motor mountain mouse move movie much muffin mule multiply muscle museum mushroom music must mutual myself mystery myth naive name napkin narrow nasty nation nature near neck need negative neglect neither nephew nerve nest net network neutral never news next nice night noble noise nominee noodle normal north nose notable note nothing notice novel now nuclear number nurse nut oak obey object oblige obscure observe obtain obvious occur ocean october odor off offer office often oil okay old olive olympic omit once one onion online only open opera opinion oppose option orange orbit orchard order ordinary organ orient original orphan ostrich other outdoor outer output outside oval oven over own owner oxygen oyster ozone pact paddle page pair palace palm panda panel panic panther paper parade parent park parrot party pass patch path patient patrol pattern pause pave payment peace peanut pear peasant pelican pen penalty pencil people pepper perfect permit person pet phone photo phrase physical piano picnic picture piece pig pigeon pill pilot pink pioneer pipe pistol pitch pizza place planet plastic plate play please pledge pluck plug plunge poem poet point polar pole police pond pony pool popular portion position possible post potato pottery poverty powder power practice praise predict prefer prepare present pretty prevent price pride primary print priority prison private prize problem process produce profit program project promote proof property prosper protect proud provide public pudding pull pulp pulse pumpkin punch pupil puppy purchase purity purpose purse push put puzzle pyramid quality quantum quarter question quick quit quiz quote rabbit raccoon race rack radar radio rail rain raise rally ramp ranch random range rapid rare rate rather raven raw razor ready real reason rebel rebuild recall receive recipe record recycle reduce reflect reform refuse region regret regular reject relax release relief rely remain remember remind remove render renew rent reopen repair repeat replace report require rescue resemble resist resource response result retire retreat return reunion reveal review reward rhythm rib ribbon rice rich ride ridge rifle right rigid ring riot ripple risk ritual rival river road roast robot robust rocket romance roof rookie room rose rotate rough round route royal rubber rude rug rule run runway rural sad saddle sadness safe sail salad salmon salon salt salute same sample sand satisfy satoshi sauce sausage save say scale scan scare scatter scene scheme school science scissors scorpion scout scrap screen script scrub sea search season seat second secret section security seed seek segment select sell seminar senior sense sentence series service session settle setup seven shadow shaft shallow share shed shell sheriff shield shift shine ship shiver shock shoe shoot shop short shoulder shove shrimp shrug shuffle shy sibling sick side siege sight sign silent silk silly silver similar simple since sing siren sister situate six size skate sketch ski skill skin skirt skull slab slam sleep slender slice slide slight slim slogan slot slow slush small smart smile smoke smooth snack snake snap sniff snow soap soccer social sock soda soft solar soldier solid solution solve someone song soon sorry sort soul sound soup source south space spare spatial spawn speak special speed spell spend sphere spice spider spike spin spirit split spoil sponsor spoon sport spot spray spread spring spy square squeeze squirrel stable stadium staff stage stairs stamp stand start state stay steak steel stem step stereo stick still sting stock stomach stone stool story stove strategy street strike strong struggle student stuff stumble style subject submit subway success such sudden suffer sugar suggest suit summer sun sunny sunset super supply supreme sure surface surge surprise surround survey suspect sustain swallow swamp swap swarm swear sweet swift swim swing switch sword symbol symptom syrup system table tackle tag tail talent talk tank tape target task taste tattoo taxi teach team tell ten tenant tennis tent term test text thank that theme then theory there they thing this thought three thrive throw thumb thunder ticket tide tiger tilt timber time tiny tip tired tissue title toast tobacco today toddler toe together toilet token tomato tomorrow tone tongue tonight tool tooth top topic topple torch tornado tortoise toss total tourist toward tower town toy track trade traffic tragic train transfer trap trash travel tray treat tree trend trial tribe trick trigger trim trip trophy trouble truck true truly trumpet trust truth try tube tuition tumble tuna tunnel turkey turn turtle twelve twenty twice twin twist two type typical ugly umbrella unable unaware uncle uncover under undo unfair unfold unhappy uniform unique unit universe unknown unlock until unusual unveil update upgrade uphold upon upper upset urban urge usage use used useful useless usual utility vacant vacuum vague valid valley valve van vanish vapor various vast vault vehicle velvet vendor venture venue verb verify version very vessel veteran viable vibrant vicious victory video view village vintage violin virtual virus visa visit visual vital vivid vocal voice void volcano volume vote voyage wage wagon wait walk wall walnut want warfare warm warrior wash wasp waste water wave way wealth weapon wear weasel weather web wedding weekend weird welcome west wet whale what wheat wheel when where whip whisper wide width wife wild will win window wine wing wink winner winter wire wisdom wise wish witness wolf woman wonder wood wool word work world worry worth wrap wreck wrestle wrist write wrong yard year yellow you young youth zebra zero zone zoo\"\n}\n"],"mappings":";;;AAiDA,SAAS,kBAAkB;;;ACjD3B;AAAA,EACE,eAAiB;AAAA,EACjB,MAAQ;AAAA,EACR,oBAAsB;AAAA,IACpB;AAAA,MACE,OAAS;AAAA,MACT,MAAQ;AAAA,IACV;AAAA,IACA;AAAA,MACE,OAAS;AAAA,MACT,MAAQ;AAAA,IACV;AAAA,IACA;AAAA,MACE,OAAS;AAAA,MACT,MAAQ;AAAA,IACV;AAAA,IACA;AAAA,MACE,OAAS;AAAA,MACT,MAAQ;AAAA,IACV;AAAA,IACA;AAAA,MACE,OAAS;AAAA,MACT,MAAQ;AAAA,IACV;AAAA,IACA;AAAA,MACE,OAAS;AAAA,MACT,MAAQ;AAAA,IACV;AAAA,IACA;AAAA,MACE,OAAS;AAAA,MACT,MAAQ;AAAA,IACV;AAAA,I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A,IAClB,MAAM,CAAC,GAAG,UAAU,MAAM;AAAA,IAC1B,SAAS,SAAS,MAAM,EAAE;AAAA,EAC5B,CAAC;AACH;AAMA,SAAS,cAAcA,WAAgC;AACrD,QAAM,OAAO,oBAAI,IAAY;AAC7B,QAAM,SAASA,UAAS,OAAO,CAAC,MAAM;AACpC,UAAM,MAAM,GAAG,EAAE,KAAK,IAAI,EAAE,IAAI,IAAI,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC1D,QAAI,KAAK,IAAI,GAAG,EAAG,QAAO;AAC1B,SAAK,IAAI,GAAG;AACZ,WAAO;AAAA,EACT,CAAC;AACD,SAAO,OAAO;AAAA,IACZ,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,cAAc,EAAE,KAAK;AAAA,EACrF;AACF;","names":["findings"]}
@@ -1,13 +1,13 @@
1
1
  import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
2
  import {
3
3
  hashTypedData
4
- } from "./chunk-BL3332HQ.js";
4
+ } from "./chunk-WFSPCCVW.js";
5
5
  import {
6
6
  getAddress,
7
7
  keccak256,
8
8
  toBytes,
9
9
  toHex
10
- } from "./chunk-TTNESUPQ.js";
10
+ } from "./chunk-2GP3HRYK.js";
11
11
 
12
12
  // node_modules/.pnpm/@x402+evm@2.28.0_typescript@6.0.3/node_modules/@x402/evm/dist/esm/chunk-EKCH75YB.mjs
13
13
  var EIP155_NETWORK_REGEX = /^eip155:(\d+)$/;
@@ -156,4 +156,4 @@ export {
156
156
  computeChannelId,
157
157
  getBatchSettlementEip712Domain
158
158
  };
159
- //# sourceMappingURL=chunk-7Q5FDF65.js.map
159
+ //# sourceMappingURL=chunk-IE7P2BZE.js.map