token-goat 2.9.30 → 2.9.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/README.md +24 -7
  2. package/SECURITY.md +10 -2
  3. package/THIRD_PARTY_NOTICES.md +1 -1
  4. package/dist/native/linux-arm64/tg-hook +0 -0
  5. package/dist/native/linux-x64/tg-hook +0 -0
  6. package/dist/native/win32-arm64/tg-hook.exe +0 -0
  7. package/dist/native/win32-x64/tg-hook.exe +0 -0
  8. package/dist/{token-goat-chunk-QSBRTGM2.mjs → token-goat-chunk-25TRAWET.mjs} +17 -7
  9. package/dist/token-goat-chunk-2KXO6V2B.mjs +203 -0
  10. package/dist/{token-goat-chunk-IVKIZWAB.mjs → token-goat-chunk-2M7E4PF7.mjs} +41 -12
  11. package/dist/{token-goat-chunk-SMVRN2HU.mjs → token-goat-chunk-2UPZGKKY.mjs} +2 -2
  12. package/dist/token-goat-chunk-2WLPWKHV.mjs +135 -0
  13. package/dist/token-goat-chunk-2XBMMDBD.mjs +126 -0
  14. package/dist/token-goat-chunk-32ZOY4N5.mjs +23 -0
  15. package/dist/token-goat-chunk-3EZRNKTK.mjs +188 -0
  16. package/dist/token-goat-chunk-4ADZHI7J.mjs +63 -0
  17. package/dist/token-goat-chunk-4GBVPH3D.mjs +242 -0
  18. package/dist/{token-goat-chunk-KWPNJBDH.mjs → token-goat-chunk-4GILLLWY.mjs} +7 -4
  19. package/dist/{token-goat-chunk-67TQJ76B.mjs → token-goat-chunk-4NAPX7BA.mjs} +36 -3
  20. package/dist/{token-goat-chunk-PU7V3FD6.mjs → token-goat-chunk-4SC7UJYV.mjs} +3354 -2553
  21. package/dist/token-goat-chunk-4SMRO4TO.mjs +366 -0
  22. package/dist/{token-goat-chunk-AFLYLHDH.mjs → token-goat-chunk-4ZBFWLXF.mjs} +283 -427
  23. package/dist/{token-goat-chunk-JDWCRD6M.mjs → token-goat-chunk-57BIAXJL.mjs} +73 -40
  24. package/dist/token-goat-chunk-5AC66HNP.mjs +115 -0
  25. package/dist/token-goat-chunk-5IMLKSOP.mjs +145 -0
  26. package/dist/token-goat-chunk-646E6U44.mjs +398 -0
  27. package/dist/token-goat-chunk-65N4RHP4.mjs +33 -0
  28. package/dist/{token-goat-chunk-JN4XMLSD.mjs → token-goat-chunk-6DG6HWP3.mjs} +8 -2
  29. package/dist/token-goat-chunk-6ENQSNRZ.mjs +573 -0
  30. package/dist/token-goat-chunk-6ZY4GNF2.mjs +91 -0
  31. package/dist/{token-goat-chunk-VPBBTSJR.mjs → token-goat-chunk-76FGDLRO.mjs} +262 -255
  32. package/dist/{token-goat-chunk-7IN2MKDS.mjs → token-goat-chunk-7EZTZOMC.mjs} +121 -289
  33. package/dist/{token-goat-chunk-OJBNYTJP.mjs → token-goat-chunk-7MAOA6X4.mjs} +640 -80
  34. package/dist/token-goat-chunk-7R2ZVVAX.mjs +218 -0
  35. package/dist/{token-goat-chunk-PD5VKH46.mjs → token-goat-chunk-AUNGYYQX.mjs} +2 -2
  36. package/dist/{token-goat-chunk-HG45AF2B.mjs → token-goat-chunk-AUQYRMMH.mjs} +794 -37
  37. package/dist/token-goat-chunk-B3PEKBYG.mjs +128 -0
  38. package/dist/{token-goat-chunk-A3CK6N5Z.mjs → token-goat-chunk-BA4HI6BW.mjs} +1309 -110
  39. package/dist/{token-goat-chunk-JB6QN6VF.mjs → token-goat-chunk-BFCWY73P.mjs} +59 -23
  40. package/dist/{token-goat-chunk-B45VMIIH.mjs → token-goat-chunk-BWGFUZZE.mjs} +7 -5
  41. package/dist/{token-goat-chunk-P4QMM4WK.mjs → token-goat-chunk-C75NA7PL.mjs} +50 -23
  42. package/dist/token-goat-chunk-CBIQ7WTD.mjs +87 -0
  43. package/dist/token-goat-chunk-CETM74KC.mjs +307 -0
  44. package/dist/{token-goat-chunk-H2PHHGM5.mjs → token-goat-chunk-CIMQ2BB3.mjs} +57 -12
  45. package/dist/{token-goat-chunk-N2NMER56.mjs → token-goat-chunk-CJLS3CDL.mjs} +46 -4
  46. package/dist/{token-goat-chunk-VES7EL7O.mjs → token-goat-chunk-CO3UYX6G.mjs} +1 -1
  47. package/dist/token-goat-chunk-COPNXRJM.mjs +154 -0
  48. package/dist/token-goat-chunk-CSJ5L3NL.mjs +479 -0
  49. package/dist/{token-goat-chunk-4LCCNRTG.mjs → token-goat-chunk-CVCEVUGK.mjs} +8 -6
  50. package/dist/{token-goat-chunk-B2RZZCSS.mjs → token-goat-chunk-CXHOFN7R.mjs} +37 -20
  51. package/dist/token-goat-chunk-D735C4QM.mjs +603 -0
  52. package/dist/{token-goat-chunk-APGZXSPS.mjs → token-goat-chunk-DGS2LVNA.mjs} +47 -30
  53. package/dist/{token-goat-chunk-54K3EUV3.mjs → token-goat-chunk-DOWRSMWO.mjs} +1 -1
  54. package/dist/token-goat-chunk-E45INMY3.mjs +71 -0
  55. package/dist/token-goat-chunk-EC5F37F4.mjs +244 -0
  56. package/dist/{token-goat-chunk-XTQAOTSO.mjs → token-goat-chunk-EDBDRVH5.mjs} +4 -1
  57. package/dist/{token-goat-chunk-5BCIJXMO.mjs → token-goat-chunk-EELTBKDM.mjs} +14 -10
  58. package/dist/{token-goat-chunk-W3QCJS6G.mjs → token-goat-chunk-F4HYL64R.mjs} +8 -6
  59. package/dist/token-goat-chunk-F6PAUIEK.mjs +624 -0
  60. package/dist/token-goat-chunk-FDSREWLX.mjs +692 -0
  61. package/dist/token-goat-chunk-GGGG7RWB.mjs +236 -0
  62. package/dist/{token-goat-chunk-C63JQV5K.mjs → token-goat-chunk-GL3ETKSC.mjs} +233 -15
  63. package/dist/token-goat-chunk-GVB2MUST.mjs +1298 -0
  64. package/dist/token-goat-chunk-GWFLAUMQ.mjs +307 -0
  65. package/dist/{token-goat-chunk-ZEJVMUQH.mjs → token-goat-chunk-HLPW63A7.mjs} +2 -2
  66. package/dist/{token-goat-chunk-GOLEOXZP.mjs → token-goat-chunk-HU4TORC5.mjs} +44 -26
  67. package/dist/{token-goat-chunk-Z57YODA2.mjs → token-goat-chunk-I7VKZZAW.mjs} +2 -2
  68. package/dist/{token-goat-chunk-NYKZLXMK.mjs → token-goat-chunk-IA6XSPE3.mjs} +6 -6
  69. package/dist/{token-goat-chunk-E3OQX2XT.mjs → token-goat-chunk-IAGXMHIK.mjs} +81 -42
  70. package/dist/{token-goat-chunk-HYBFA5X3.mjs → token-goat-chunk-IK2DRMFX.mjs} +24 -68
  71. package/dist/{token-goat-chunk-COBQGL5S.mjs → token-goat-chunk-INNPTRUX.mjs} +249 -299
  72. package/dist/{token-goat-chunk-7NADEDKJ.mjs → token-goat-chunk-JJ5BX4F4.mjs} +6 -1
  73. package/dist/{token-goat-chunk-PEPTHRFF.mjs → token-goat-chunk-JVFSHVFJ.mjs} +6 -6
  74. package/dist/token-goat-chunk-KGEFFSHD.mjs +50 -0
  75. package/dist/token-goat-chunk-KQBLRPBN.mjs +433 -0
  76. package/dist/{token-goat-chunk-Q5VTGRH7.mjs → token-goat-chunk-LCNQ2CNN.mjs} +55 -319
  77. package/dist/token-goat-chunk-M3LFJDPU.mjs +58 -0
  78. package/dist/token-goat-chunk-M52KPT3C.mjs +87 -0
  79. package/dist/token-goat-chunk-MBEG42H7.mjs +150 -0
  80. package/dist/{token-goat-chunk-EVC4TOLE.mjs → token-goat-chunk-METECDOH.mjs} +3 -12
  81. package/dist/{token-goat-chunk-T4FK7VOV.mjs → token-goat-chunk-MHX7XCC3.mjs} +2 -1
  82. package/dist/token-goat-chunk-N5LSOVSU.mjs +137 -0
  83. package/dist/{token-goat-chunk-LOBGHXPB.mjs → token-goat-chunk-N5MMR2IW.mjs} +1 -1
  84. package/dist/token-goat-chunk-N7B3JQ2C.mjs +160 -0
  85. package/dist/{token-goat-chunk-RHXKCZX3.mjs → token-goat-chunk-NISNMD7T.mjs} +2182 -2959
  86. package/dist/token-goat-chunk-NMD42SFQ.mjs +434 -0
  87. package/dist/token-goat-chunk-NOSS5VWY.mjs +174 -0
  88. package/dist/{token-goat-chunk-KQNZDCBD.mjs → token-goat-chunk-NSNSPPBG.mjs} +25 -3
  89. package/dist/token-goat-chunk-OBOFIHKN.mjs +38 -0
  90. package/dist/token-goat-chunk-OBRFJ5O5.mjs +76 -0
  91. package/dist/{token-goat-chunk-JTQQGXZH.mjs → token-goat-chunk-ODBT2USM.mjs} +124 -57
  92. package/dist/token-goat-chunk-OS5EM5PP.mjs +107 -0
  93. package/dist/token-goat-chunk-OUKDTVNU.mjs +1178 -0
  94. package/dist/token-goat-chunk-OXFMP75N.mjs +566 -0
  95. package/dist/{token-goat-chunk-DZX2YDPT.mjs → token-goat-chunk-OYIYKDDT.mjs} +2 -2
  96. package/dist/{token-goat-chunk-QCLDAQTS.mjs → token-goat-chunk-P6HQSWQ3.mjs} +50 -53
  97. package/dist/token-goat-chunk-P6VGNTQT.mjs +71 -0
  98. package/dist/{token-goat-chunk-7BXSNBY5.mjs → token-goat-chunk-PFWIMH2E.mjs} +23 -15
  99. package/dist/token-goat-chunk-PJZXIS3G.mjs +39 -0
  100. package/dist/token-goat-chunk-PUO5INXP.mjs +606 -0
  101. package/dist/{token-goat-chunk-GFBSN7BD.mjs → token-goat-chunk-PX5PQWTY.mjs} +22 -250
  102. package/dist/token-goat-chunk-Q5QDBC6O.mjs +111 -0
  103. package/dist/token-goat-chunk-QFNQXSDT.mjs +40 -0
  104. package/dist/{token-goat-chunk-FBNQNSJK.mjs → token-goat-chunk-QH7YVYOY.mjs} +2198 -2782
  105. package/dist/{token-goat-chunk-64FBPDTK.mjs → token-goat-chunk-QLMUHEPB.mjs} +12 -9
  106. package/dist/{token-goat-chunk-RZRTDST7.mjs → token-goat-chunk-QQOJIHL3.mjs} +37 -11
  107. package/dist/{token-goat-chunk-XKI4SEMX.mjs → token-goat-chunk-QQTWJY2O.mjs} +19 -0
  108. package/dist/{token-goat-chunk-U4N3BN2W.mjs → token-goat-chunk-QYHO5CPH.mjs} +3 -2
  109. package/dist/token-goat-chunk-RELAVWAD.mjs +27 -0
  110. package/dist/{token-goat-chunk-ETBHVDB6.mjs → token-goat-chunk-RSLPOBKQ.mjs} +22 -11
  111. package/dist/token-goat-chunk-SAMFDIS2.mjs +712 -0
  112. package/dist/token-goat-chunk-SDELXLDM.mjs +48 -0
  113. package/dist/{token-goat-chunk-4JJS54TR.mjs → token-goat-chunk-SOAFZNNZ.mjs} +161 -38
  114. package/dist/{token-goat-chunk-664RTTUV.mjs → token-goat-chunk-SRTHT7KV.mjs} +21 -16
  115. package/dist/{token-goat-chunk-4FVIAHSI.mjs → token-goat-chunk-T5P5ACNQ.mjs} +7 -6
  116. package/dist/token-goat-chunk-T5YGG4V3.mjs +45 -0
  117. package/dist/token-goat-chunk-TAUZ4OFS.mjs +110 -0
  118. package/dist/{token-goat-chunk-COTXZHTS.mjs → token-goat-chunk-TM6MC754.mjs} +4 -3
  119. package/dist/token-goat-chunk-TWUKBOMP.mjs +72 -0
  120. package/dist/{token-goat-chunk-3CHUNJ2O.mjs → token-goat-chunk-U2KSB4SG.mjs} +8 -5
  121. package/dist/{token-goat-chunk-3Z5S4KGM.mjs → token-goat-chunk-U4WHMG6Y.mjs} +29 -49
  122. package/dist/{token-goat-chunk-PY533T7F.mjs → token-goat-chunk-UGJHGR5A.mjs} +21 -15
  123. package/dist/{token-goat-chunk-CYCEYAEO.mjs → token-goat-chunk-UOUDVA5U.mjs} +1 -1
  124. package/dist/{token-goat-chunk-JDHE26RP.mjs → token-goat-chunk-URRJ33GR.mjs} +16 -5
  125. package/dist/{token-goat-chunk-56EIMS3E.mjs → token-goat-chunk-UZOROKIS.mjs} +23 -17
  126. package/dist/{token-goat-chunk-CZ3LUXYZ.mjs → token-goat-chunk-VIHGGGEI.mjs} +427 -308
  127. package/dist/token-goat-chunk-VTJLAA7P.mjs +21 -0
  128. package/dist/token-goat-chunk-VWDXLT4F.mjs +678 -0
  129. package/dist/{token-goat-chunk-YARZFCZS.mjs → token-goat-chunk-VWZA2H4P.mjs} +62 -53
  130. package/dist/{token-goat-chunk-SQSSNQPE.mjs → token-goat-chunk-VXEXMJDL.mjs} +3979 -4745
  131. package/dist/token-goat-chunk-WBA5SKT4.mjs +547 -0
  132. package/dist/{token-goat-chunk-SJHWVNDQ.mjs → token-goat-chunk-WDH44VAU.mjs} +7 -4
  133. package/dist/token-goat-chunk-X2SUP3EI.mjs +107 -0
  134. package/dist/token-goat-chunk-X3BELZSJ.mjs +125 -0
  135. package/dist/{token-goat-chunk-FZ3NEW5O.mjs → token-goat-chunk-XLRBNZCC.mjs} +13 -8
  136. package/dist/{token-goat-chunk-Z44YO3QZ.mjs → token-goat-chunk-XRKUX6CM.mjs} +1 -1
  137. package/dist/token-goat-chunk-XX6O25RN.mjs +82 -0
  138. package/dist/token-goat-chunk-XZSUHBVS.mjs +65 -0
  139. package/dist/{token-goat-chunk-WY3L4DVT.mjs → token-goat-chunk-Y2ZTQOCL.mjs} +13 -8
  140. package/dist/{token-goat-chunk-UQ5UK2T7.mjs → token-goat-chunk-YB4VMGK2.mjs} +1 -1
  141. package/dist/token-goat-chunk-YBIIY3HR.mjs +51 -0
  142. package/dist/{token-goat-chunk-ZQSJMO2R.mjs → token-goat-chunk-YHVDKQBR.mjs} +105 -105
  143. package/dist/{token-goat-chunk-H2K3QP6H.mjs → token-goat-chunk-YJB5XLWI.mjs} +8 -6
  144. package/dist/{token-goat-chunk-ZCDTCVIS.mjs → token-goat-chunk-YKB6AQG3.mjs} +5 -2
  145. package/dist/token-goat-chunk-YMTG2YA5.mjs +35 -0
  146. package/dist/token-goat-chunk-YPBZYQRV.mjs +40 -0
  147. package/dist/{token-goat-chunk-HOJLCGDP.mjs → token-goat-chunk-YY6AVUFL.mjs} +2033 -2251
  148. package/dist/token-goat-chunk-Z7N5OMMP.mjs +98 -0
  149. package/dist/token-goat-chunk-ZNMNUPAZ.mjs +938 -0
  150. package/dist/token-goat-hook-client.cjs +1 -1
  151. package/dist/token-goat-hook-client.mjs +3 -3
  152. package/dist/token-goat-hook.mjs +67 -38
  153. package/dist/token-goat.core.mjs +4 -4
  154. package/docs/C4_RUNTIME_ARCHITECTURE.md +1 -1
  155. package/docs/cli.md +40 -21
  156. package/docs/install.md +19 -9
  157. package/docs/security.md +5 -3
  158. package/package.json +2 -1
  159. package/dist/token-goat-chunk-5KDMCMF2.mjs +0 -362
  160. package/dist/token-goat-chunk-6QMAS7AB.mjs +0 -42
  161. package/dist/token-goat-chunk-7F2UBPD3.mjs +0 -397
  162. package/dist/token-goat-chunk-ARDNEC2U.mjs +0 -248
  163. package/dist/token-goat-chunk-ATCPY7EQ.mjs +0 -134
  164. package/dist/token-goat-chunk-EFHMMIGP.mjs +0 -68
  165. package/dist/token-goat-chunk-IVALLT3S.mjs +0 -48
  166. package/dist/token-goat-chunk-JDU3EXSU.mjs +0 -65
  167. package/dist/token-goat-chunk-MKPF4CL5.mjs +0 -37
  168. package/dist/token-goat-chunk-RC35RBUL.mjs +0 -312
  169. package/dist/token-goat-chunk-USILZ3T3.mjs +0 -53
  170. package/dist/token-goat-chunk-VL3YIFHZ.mjs +0 -2975
  171. package/dist/token-goat-chunk-XU4P6Z24.mjs +0 -133
  172. package/dist/token-goat-chunk-Y776AENC.mjs +0 -1597
@@ -3,53 +3,75 @@ const require = __cjsRequire(import.meta.url);
3
3
  import {
4
4
  serveOne,
5
5
  swapEnv
6
- } from "./token-goat-chunk-Z44YO3QZ.mjs";
6
+ } from "./token-goat-chunk-XRKUX6CM.mjs";
7
7
  import {
8
8
  relayInProcess
9
- } from "./token-goat-chunk-SQSSNQPE.mjs";
10
- import "./token-goat-chunk-ZEJVMUQH.mjs";
11
- import "./token-goat-chunk-GFBSN7BD.mjs";
9
+ } from "./token-goat-chunk-VXEXMJDL.mjs";
10
+ import "./token-goat-chunk-Q5QDBC6O.mjs";
11
+ import "./token-goat-chunk-G5PJ7AGM.mjs";
12
12
  import "./token-goat-chunk-5RG5SBL6.mjs";
13
+ import "./token-goat-chunk-HLPW63A7.mjs";
13
14
  import {
14
15
  HOOK_EVENTS
15
16
  } from "./token-goat-chunk-KKUFXAPD.mjs";
16
- import "./token-goat-chunk-7F2UBPD3.mjs";
17
- import "./token-goat-chunk-54K3EUV3.mjs";
18
- import "./token-goat-chunk-7BXSNBY5.mjs";
19
- import "./token-goat-chunk-G5PJ7AGM.mjs";
20
- import "./token-goat-chunk-YARZFCZS.mjs";
21
- import "./token-goat-chunk-FBNQNSJK.mjs";
22
- import "./token-goat-chunk-PEPTHRFF.mjs";
17
+ import "./token-goat-chunk-6ENQSNRZ.mjs";
18
+ import "./token-goat-chunk-PX5PQWTY.mjs";
19
+ import "./token-goat-chunk-VWDXLT4F.mjs";
20
+ import "./token-goat-chunk-DOWRSMWO.mjs";
21
+ import "./token-goat-chunk-5AC66HNP.mjs";
22
+ import "./token-goat-chunk-PUO5INXP.mjs";
23
+ import "./token-goat-chunk-2XBMMDBD.mjs";
24
+ import "./token-goat-chunk-PFWIMH2E.mjs";
25
+ import "./token-goat-chunk-Z7N5OMMP.mjs";
26
+ import "./token-goat-chunk-LCNQ2CNN.mjs";
27
+ import "./token-goat-chunk-GWFLAUMQ.mjs";
28
+ import "./token-goat-chunk-PJZXIS3G.mjs";
29
+ import "./token-goat-chunk-JVFSHVFJ.mjs";
30
+ import "./token-goat-chunk-ODBT2USM.mjs";
31
+ import "./token-goat-chunk-DGS2LVNA.mjs";
32
+ import "./token-goat-chunk-INNPTRUX.mjs";
33
+ import "./token-goat-chunk-VWZA2H4P.mjs";
34
+ import "./token-goat-chunk-N5LSOVSU.mjs";
35
+ import "./token-goat-chunk-OBOFIHKN.mjs";
36
+ import {
37
+ primeHiddenRulesAhead,
38
+ primeManagedPolicyAhead
39
+ } from "./token-goat-chunk-QH7YVYOY.mjs";
40
+ import "./token-goat-chunk-NOSS5VWY.mjs";
41
+ import "./token-goat-chunk-NMD42SFQ.mjs";
42
+ import "./token-goat-chunk-SAMFDIS2.mjs";
43
+ import "./token-goat-chunk-4SMRO4TO.mjs";
44
+ import "./token-goat-chunk-WBA5SKT4.mjs";
23
45
  import "./token-goat-chunk-MNWKPRAL.mjs";
24
- import "./token-goat-chunk-JTQQGXZH.mjs";
25
- import "./token-goat-chunk-67TQJ76B.mjs";
26
- import "./token-goat-chunk-H2PHHGM5.mjs";
46
+ import "./token-goat-chunk-CIMQ2BB3.mjs";
47
+ import "./token-goat-chunk-WDH44VAU.mjs";
48
+ import "./token-goat-chunk-BPGCUMR7.mjs";
49
+ import "./token-goat-chunk-KQBLRPBN.mjs";
50
+ import "./token-goat-chunk-4ZBFWLXF.mjs";
27
51
  import {
28
52
  materializeShrunkImageFile
29
- } from "./token-goat-chunk-P4QMM4WK.mjs";
30
- import "./token-goat-chunk-5KDMCMF2.mjs";
31
- import "./token-goat-chunk-APGZXSPS.mjs";
32
- import "./token-goat-chunk-COBQGL5S.mjs";
33
- import "./token-goat-chunk-ATCPY7EQ.mjs";
53
+ } from "./token-goat-chunk-C75NA7PL.mjs";
54
+ import "./token-goat-chunk-CBIQ7WTD.mjs";
55
+ import "./token-goat-chunk-P6VGNTQT.mjs";
34
56
  import {
35
57
  COPILOT_CLI_TOOL_NAME_MAP,
36
58
  foldToolName
37
- } from "./token-goat-chunk-VPBBTSJR.mjs";
38
- import "./token-goat-chunk-Q5VTGRH7.mjs";
39
- import "./token-goat-chunk-Y776AENC.mjs";
40
- import "./token-goat-chunk-SJHWVNDQ.mjs";
41
- import "./token-goat-chunk-AFLYLHDH.mjs";
42
- import "./token-goat-chunk-BPGCUMR7.mjs";
43
- import "./token-goat-chunk-C63JQV5K.mjs";
44
- import "./token-goat-chunk-JB6QN6VF.mjs";
45
- import "./token-goat-chunk-RHXKCZX3.mjs";
59
+ } from "./token-goat-chunk-76FGDLRO.mjs";
60
+ import "./token-goat-chunk-GL3ETKSC.mjs";
61
+ import "./token-goat-chunk-OXFMP75N.mjs";
62
+ import "./token-goat-chunk-NISNMD7T.mjs";
46
63
  import "./token-goat-chunk-EVMZJ27Z.mjs";
47
- import "./token-goat-chunk-HYBFA5X3.mjs";
64
+ import "./token-goat-chunk-IK2DRMFX.mjs";
48
65
  import "./token-goat-chunk-5Y6ZYL6U.mjs";
49
- import "./token-goat-chunk-ARDNEC2U.mjs";
50
- import "./token-goat-chunk-3Z5S4KGM.mjs";
51
- import "./token-goat-chunk-VL3YIFHZ.mjs";
66
+ import "./token-goat-chunk-4NAPX7BA.mjs";
67
+ import "./token-goat-chunk-U4WHMG6Y.mjs";
68
+ import {
69
+ limitDbWaitsForHook
70
+ } from "./token-goat-chunk-GVB2MUST.mjs";
52
71
  import "./token-goat-chunk-XB5KKOCG.mjs";
72
+ import "./token-goat-chunk-OUKDTVNU.mjs";
73
+ import "./token-goat-chunk-3BTK54F3.mjs";
74
+ import "./token-goat-chunk-4GILLLWY.mjs";
53
75
  import {
54
76
  HARNESS_PROTOCOL_VERSION,
55
77
  PROTOCOL_VERSION,
@@ -70,29 +92,35 @@ import {
70
92
  serverKeyPath,
71
93
  touchMarker,
72
94
  writeFrame
73
- } from "./token-goat-chunk-LOBGHXPB.mjs";
74
- import "./token-goat-chunk-3BTK54F3.mjs";
75
- import "./token-goat-chunk-4FVIAHSI.mjs";
95
+ } from "./token-goat-chunk-N5MMR2IW.mjs";
96
+ import "./token-goat-chunk-BFCWY73P.mjs";
97
+ import "./token-goat-chunk-KGEFFSHD.mjs";
98
+ import "./token-goat-chunk-XX6O25RN.mjs";
99
+ import "./token-goat-chunk-HAVAOB3S.mjs";
100
+ import "./token-goat-chunk-F6PAUIEK.mjs";
101
+ import "./token-goat-chunk-65N4RHP4.mjs";
102
+ import "./token-goat-chunk-X2SUP3EI.mjs";
103
+ import "./token-goat-chunk-T5P5ACNQ.mjs";
76
104
  import {
77
105
  hookServerEnabled,
78
106
  ownGet
79
- } from "./token-goat-chunk-7IN2MKDS.mjs";
80
- import "./token-goat-chunk-U4N3BN2W.mjs";
107
+ } from "./token-goat-chunk-7EZTZOMC.mjs";
108
+ import "./token-goat-chunk-QYHO5CPH.mjs";
109
+ import "./token-goat-chunk-4GBVPH3D.mjs";
81
110
  import {
82
111
  clearPerRequestCaches
83
112
  } from "./token-goat-chunk-YZAAZU2S.mjs";
84
113
  import "./token-goat-chunk-IVE6U7KV.mjs";
85
114
  import "./token-goat-chunk-Y4AFKTHK.mjs";
86
- import "./token-goat-chunk-GOLEOXZP.mjs";
115
+ import "./token-goat-chunk-HU4TORC5.mjs";
116
+ import "./token-goat-chunk-GGGG7RWB.mjs";
87
117
  import "./token-goat-chunk-AM5V6GSX.mjs";
88
118
  import "./token-goat-chunk-FNFBKLRD.mjs";
89
119
  import {
90
120
  VERSION,
91
121
  configPath,
92
122
  ensureDataDirPrivate
93
- } from "./token-goat-chunk-VES7EL7O.mjs";
94
- import "./token-goat-chunk-KWPNJBDH.mjs";
95
- import "./token-goat-chunk-HAVAOB3S.mjs";
123
+ } from "./token-goat-chunk-CO3UYX6G.mjs";
96
124
  import {
97
125
  init_define_import_meta_env
98
126
  } from "./token-goat-chunk-A37V4PBF.mjs";
@@ -152,6 +180,13 @@ function bashResultByteLength(resp) {
152
180
  }
153
181
  return 0;
154
182
  }
183
+ var TG_LEDGER_PREFIX_RE = /^(?:(?:cd\s+(?:"[^"]*"|'[^']*'|\S+)|export[ \t]+[A-Za-z_]\w*=(?:"[^"]*"|'[^']*'|[^\s"'])*(?:[ \t]+[A-Za-z_]\w*=(?:"[^"]*"|'[^']*'|[^\s"'])*)*)[ \t]*(?:&&|;|\r?\n)\s*)+/;
184
+ var TG_LEDGER_READ_RE = /^(?:[A-Za-z_][A-Za-z0-9_]*=\S+\s+)*(?:env\s+(?:(?:(?:-u|--unset)\s+\S+|-(?![A-Za-z]*C|-c)\S*|[A-Za-z_][A-Za-z0-9_]*=\S+)\s+)*)?(?:token-goat|tg|node(?:\.exe)?\s+["']?(?:\S*[\\/])?token-goat(?:\.mjs)?["']?)\s+(?:read|section|symbol)\b/i;
185
+ function isLedgerReadCommand(cmd) {
186
+ if (typeof cmd !== "string") return false;
187
+ const body = cmd.trim().replace(/^\(\s*/, "");
188
+ return TG_LEDGER_READ_RE.test((body.replace(TG_LEDGER_PREFIX_RE, "") || body).trim());
189
+ }
155
190
  function isAsyncDetachEligible(event, input) {
156
191
  if (event === "subagent_stop") return true;
157
192
  if (event !== "post_tool_use") return false;
@@ -164,7 +199,7 @@ function isAsyncDetachEligible(event, input) {
164
199
  const notebookPath = get(toolInput, "notebook_path");
165
200
  return !ASYNC_DETACH_SKIP_EXT_RE.test(typeof filePath === "string" ? filePath : typeof notebookPath === "string" ? notebookPath : "");
166
201
  }
167
- if (toolName === "Bash") return bashResultByteLength(get(payload, "tool_response")) < ASYNC_DETACH_BASH_MAX_BYTES;
202
+ if (toolName === "Bash") return !isLedgerReadCommand(get(get(payload, "tool_input"), "command")) && bashResultByteLength(get(payload, "tool_response")) < ASYNC_DETACH_BASH_MAX_BYTES;
168
203
  return false;
169
204
  } catch {
170
205
  return false;
@@ -537,6 +572,7 @@ async function handle(request, runCli, send) {
537
572
  const res = await serveOne({ id: 0, argv: request.argv, cwd: request.cwd, env: request.env }, runCli, clearPerRequestCaches);
538
573
  return send({ ok: true, stdout: res.stdout, stderr: res.stderr, status: res.status });
539
574
  }
575
+ limitDbWaitsForHook();
540
576
  const startedAt = performance.now();
541
577
  const cwdBefore = process.cwd();
542
578
  const restoreEnv = swapEnv(request.env);
@@ -571,6 +607,7 @@ function parseHarnessRequest(body, harness) {
571
607
  }
572
608
  async function handleHarness(request, harness, early, finish) {
573
609
  clearPerRequestCaches();
610
+ limitDbWaitsForHook();
574
611
  const startedAt = performance.now();
575
612
  const cwdBefore = process.cwd();
576
613
  const restoreEnv = swapEnv(request.env);
@@ -630,6 +667,8 @@ async function runHookServer(slot, runCli) {
630
667
  return;
631
668
  }
632
669
  ensureDataDirPrivate();
670
+ primeHiddenRulesAhead();
671
+ primeManagedPolicyAhead();
633
672
  const key = ensureServerKey();
634
673
  const keyPath = serverKeyPath();
635
674
  const loadedStamp = bundleStamp();
@@ -1,53 +1,26 @@
1
1
  import { createRequire as __cjsRequire } from 'node:module';
2
2
  const require = __cjsRequire(import.meta.url);
3
3
  import {
4
- getDb
5
- } from "./token-goat-chunk-VL3YIFHZ.mjs";
4
+ filePathSpellingsClause,
5
+ fileRowByIndexKey,
6
+ getReadDb,
7
+ pathEqClause,
8
+ pathSuffixClause,
9
+ projectScopeClause
10
+ } from "./token-goat-chunk-GVB2MUST.mjs";
6
11
  import {
7
- foldPath,
8
- isCaseInsensitiveFs
12
+ foldPath
9
13
  } from "./token-goat-chunk-AM5V6GSX.mjs";
10
14
  import {
11
15
  normalizePath
12
16
  } from "./token-goat-chunk-FNFBKLRD.mjs";
13
17
  import {
14
18
  globalDbPath
15
- } from "./token-goat-chunk-VES7EL7O.mjs";
19
+ } from "./token-goat-chunk-CO3UYX6G.mjs";
16
20
  import {
17
21
  init_define_import_meta_env
18
22
  } from "./token-goat-chunk-A37V4PBF.mjs";
19
23
 
20
- // src/sql_path.ts
21
- init_define_import_meta_env();
22
- function pathEqClause(column) {
23
- return isCaseInsensitiveFs() ? `TG_LOWER(${column}) = ?` : `${column} = ?`;
24
- }
25
- function pathSuffixClause(column) {
26
- const col = isCaseInsensitiveFs() ? `TG_LOWER(${column})` : column;
27
- return {
28
- // Both separators are accepted because not every writer into `symbols` stores a normalizePath'd (forward-slash) file_path, and the JS-side path-boundary test this narrowing feeds treats `/` and `\` alike.
29
- clause: `(${col} = ? OR substr(${col}, -length(?)) = ? OR substr(${col}, -length(?)) = ?)`,
30
- params: (baseName) => {
31
- const folded = foldPath(baseName);
32
- return [folded, `/${folded}`, `/${folded}`, `\\${folded}`, `\\${folded}`];
33
- }
34
- };
35
- }
36
- function projectScopeClause(column) {
37
- const caseInsensitive = isCaseInsensitiveFs();
38
- const col = caseInsensitive ? `TG_LOWER(${column})` : column;
39
- return {
40
- // Parenthesised so an OR anywhere in the surrounding WHERE cannot bind tighter than the pair.
41
- clause: `(${col} >= ? AND ${col} < ?)`,
42
- params: (root) => {
43
- const folded = caseInsensitive ? foldPath(normalizePath(root)) : normalizePath(root);
44
- const lower = folded.endsWith("/") ? folded : `${folded}/`;
45
- const upper = `${lower.slice(0, -1)}0`;
46
- return [lower, upper];
47
- }
48
- };
49
- }
50
-
51
24
  // src/index_reader.ts
52
25
  init_define_import_meta_env();
53
26
 
@@ -181,15 +154,9 @@ function buildSymbolWhere(opts) {
181
154
  params.push(opts.name);
182
155
  }
183
156
  if (opts.filePath !== void 0) {
184
- const key = indexKey(opts.filePath);
185
- if (key.includes("/") || key.includes("\\")) {
186
- const alt = key.includes("/") ? key.replace(/\//g, "\\") : key.replace(/\\/g, "/");
187
- where.push(`(${pathEqClause("file_path")} OR ${pathEqClause("file_path")})`);
188
- params.push(foldPath(key), foldPath(alt));
189
- } else {
190
- where.push(pathEqClause("file_path"));
191
- params.push(foldPath(key));
192
- }
157
+ const spellings = filePathSpellingsClause("file_path", opts.filePath);
158
+ where.push(spellings.clause);
159
+ params.push(...spellings.params);
193
160
  }
194
161
  if (opts.kind !== void 0) {
195
162
  where.push("kind = ?");
@@ -213,7 +180,7 @@ function querySymbols(opts = {}, dbPath = globalDbPath()) {
213
180
  const limit = opts.limit ?? DEFAULT_QUERY_LIMIT;
214
181
  const offset = opts.offset ?? 0;
215
182
  const sql = `SELECT file_path, name, kind, line_start, line_end, body, docstring, parent FROM symbols ${clause} ORDER BY file_path, line_start, rowid LIMIT ? OFFSET ?`;
216
- const db = getDb(dbPath);
183
+ const db = getReadDb(dbPath);
217
184
  const rows = db.prepare(sql).all(...params, limit, offset);
218
185
  return rows.map(toSymbolEntry);
219
186
  }
@@ -222,14 +189,14 @@ function distinctSymbolKinds(rootDir, dbPath = globalDbPath()) {
222
189
  const params = [];
223
190
  applyRootDirScope(rootDir, "file_path", where, params);
224
191
  const clause = where.length > 0 ? `WHERE ${where.join(" AND ")}` : "";
225
- const db = getDb(dbPath);
192
+ const db = getReadDb(dbPath);
226
193
  const rows = db.prepare(`SELECT DISTINCT kind FROM symbols ${clause} ORDER BY kind`).all(...params);
227
194
  return rows.map((r) => r.kind);
228
195
  }
229
196
  function countSymbols(opts = {}, dbPath = globalDbPath()) {
230
197
  const { clause, params } = buildSymbolWhere(opts);
231
198
  const sql = `SELECT COUNT(*) as cnt FROM symbols ${clause}`;
232
- const db = getDb(dbPath);
199
+ const db = getReadDb(dbPath);
233
200
  const row = db.prepare(sql).get(...params);
234
201
  return row.cnt;
235
202
  }
@@ -247,20 +214,20 @@ function queryRefs(opts, dbPath = globalDbPath()) {
247
214
  const { clause, params } = buildRefsWhere(opts);
248
215
  const limit = opts.limit ?? DEFAULT_QUERY_LIMIT;
249
216
  const sql = `SELECT file_path, name, line, col, context FROM refs ${clause} ORDER BY file_path, line LIMIT ?`;
250
- const db = getDb(dbPath);
217
+ const db = getReadDb(dbPath);
251
218
  const rows = db.prepare(sql).all(...params, limit);
252
219
  return rows.map(toRefEntry);
253
220
  }
254
221
  function countRefs(opts, dbPath = globalDbPath()) {
255
222
  const { clause, params } = buildRefsWhere(opts);
256
223
  const sql = `SELECT COUNT(*) as cnt FROM refs ${clause}`;
257
- const db = getDb(dbPath);
224
+ const db = getReadDb(dbPath);
258
225
  const row = db.prepare(sql).get(...params);
259
226
  return row.cnt;
260
227
  }
261
228
  function queryRefsByContext(context, filePath, dbPath = globalDbPath()) {
262
229
  const sql = `SELECT file_path, name, line, col, context FROM refs WHERE context = ? AND ${pathEqClause("file_path")} ORDER BY line LIMIT 20`;
263
- const db = getDb(dbPath);
230
+ const db = getReadDb(dbPath);
264
231
  const rows = db.prepare(sql).all(context, foldPath(indexKey(filePath)));
265
232
  return rows.map(toRefEntry);
266
233
  }
@@ -268,7 +235,7 @@ var REF_COUNT_BATCH = 900;
268
235
  function queryRefCounts(names, dbPath = globalDbPath(), rootDir) {
269
236
  const counts = /* @__PURE__ */ new Map();
270
237
  if (names.length === 0) return counts;
271
- const db = getDb(dbPath);
238
+ const db = getReadDb(dbPath);
272
239
  const scopeWhere = [];
273
240
  const scopeParams = [];
274
241
  applyRootDirScope(rootDir, "file_path", scopeWhere, scopeParams);
@@ -295,7 +262,7 @@ function getOwnProjectFileEntries(rootDir, dbPath = globalDbPath()) {
295
262
  return fileEntriesWhere(clause, params, dbPath);
296
263
  }
297
264
  function fileEntriesWhere(clause, params, dbPath) {
298
- const rows = getDb(dbPath).prepare(`SELECT path, sha, mtime, language, indexed_at, embed_sha, parser_sha FROM files WHERE ${clause}`).all(...params);
265
+ const rows = getReadDb(dbPath).prepare(`SELECT path, sha, mtime, language, indexed_at, embed_sha, parser_sha FROM files WHERE ${clause}`).all(...params);
299
266
  const out = /* @__PURE__ */ new Map();
300
267
  for (const row of rows) {
301
268
  out.set(foldPath(row.path), {
@@ -311,17 +278,8 @@ function fileEntriesWhere(clause, params, dbPath) {
311
278
  return out;
312
279
  }
313
280
  function getFileEntry(filePath, dbPath = globalDbPath()) {
314
- const db = getDb(dbPath);
315
- const key = indexKey(filePath);
316
- let row = db.prepare(
317
- `SELECT path, sha, mtime, language, indexed_at, embed_sha, parser_sha FROM files WHERE ${pathEqClause("path")}`
318
- ).get(foldPath(key));
319
- if (row === void 0 && (key.includes("/") || key.includes("\\"))) {
320
- const altPath = key.includes("/") ? key.replace(/\//g, "\\") : key.replace(/\\/g, "/");
321
- row = db.prepare(
322
- `SELECT path, sha, mtime, language, indexed_at, embed_sha, parser_sha FROM files WHERE ${pathEqClause("path")}`
323
- ).get(foldPath(altPath));
324
- }
281
+ const db = getReadDb(dbPath);
282
+ const row = fileRowByIndexKey(db, filePath, "path, sha, mtime, language, indexed_at, embed_sha, parser_sha");
325
283
  if (row === void 0) return null;
326
284
  return {
327
285
  filePath: row.path,
@@ -348,7 +306,7 @@ function runFtsQuery(db, match, limit, scope) {
348
306
  function searchSymbolsFts(query, limit = 50, dbPath = globalDbPath(), rootDir) {
349
307
  const andMatch = sanitizeFtsQuery(query, "AND");
350
308
  if (andMatch === "") return [];
351
- const db = getDb(dbPath);
309
+ const db = getReadDb(dbPath);
352
310
  const scope = rootDir !== void 0 ? ownProjectScope("s.file_path", indexKey(rootDir)) : void 0;
353
311
  try {
354
312
  const andResults = runFtsQuery(db, andMatch, limit, scope);
@@ -362,9 +320,7 @@ function searchSymbolsFts(query, limit = 50, dbPath = globalDbPath(), rootDir) {
362
320
  }
363
321
 
364
322
  export {
365
- pathEqClause,
366
- pathSuffixClause,
367
- projectScopeClause,
323
+ commonGitDir,
368
324
  ownProjectScope,
369
325
  nestedWorktreeExclusions,
370
326
  DEFAULT_QUERY_LIMIT,