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
@@ -6,43 +6,58 @@ import {
6
6
  buildWasteReport,
7
7
  findProjectSession,
8
8
  isCopilotTranscript,
9
+ noSessionTranscriptMessage,
9
10
  unusedMcpServers
10
- } from "./token-goat-chunk-5BCIJXMO.mjs";
11
- import "./token-goat-chunk-JTQQGXZH.mjs";
12
- import "./token-goat-chunk-67TQJ76B.mjs";
13
- import "./token-goat-chunk-H2PHHGM5.mjs";
14
- import "./token-goat-chunk-P4QMM4WK.mjs";
15
- import "./token-goat-chunk-5KDMCMF2.mjs";
16
- import "./token-goat-chunk-APGZXSPS.mjs";
17
- import "./token-goat-chunk-COBQGL5S.mjs";
18
- import "./token-goat-chunk-ATCPY7EQ.mjs";
19
- import "./token-goat-chunk-VPBBTSJR.mjs";
20
- import "./token-goat-chunk-SJHWVNDQ.mjs";
21
- import "./token-goat-chunk-AFLYLHDH.mjs";
11
+ } from "./token-goat-chunk-EELTBKDM.mjs";
12
+ import "./token-goat-chunk-ODBT2USM.mjs";
13
+ import "./token-goat-chunk-DGS2LVNA.mjs";
14
+ import "./token-goat-chunk-INNPTRUX.mjs";
15
+ import "./token-goat-chunk-CIMQ2BB3.mjs";
16
+ import "./token-goat-chunk-WDH44VAU.mjs";
22
17
  import "./token-goat-chunk-BPGCUMR7.mjs";
23
- import "./token-goat-chunk-C63JQV5K.mjs";
24
- import "./token-goat-chunk-JB6QN6VF.mjs";
18
+ import "./token-goat-chunk-KQBLRPBN.mjs";
19
+ import "./token-goat-chunk-4ZBFWLXF.mjs";
20
+ import "./token-goat-chunk-C75NA7PL.mjs";
21
+ import {
22
+ writeCommandFailure
23
+ } from "./token-goat-chunk-CBIQ7WTD.mjs";
24
+ import "./token-goat-chunk-P6VGNTQT.mjs";
25
+ import "./token-goat-chunk-76FGDLRO.mjs";
26
+ import "./token-goat-chunk-GL3ETKSC.mjs";
25
27
  import "./token-goat-chunk-EVMZJ27Z.mjs";
26
- import "./token-goat-chunk-HYBFA5X3.mjs";
27
- import "./token-goat-chunk-ARDNEC2U.mjs";
28
- import "./token-goat-chunk-3Z5S4KGM.mjs";
29
- import "./token-goat-chunk-VL3YIFHZ.mjs";
28
+ import "./token-goat-chunk-IK2DRMFX.mjs";
29
+ import "./token-goat-chunk-4NAPX7BA.mjs";
30
+ import "./token-goat-chunk-U4WHMG6Y.mjs";
31
+ import "./token-goat-chunk-GVB2MUST.mjs";
30
32
  import "./token-goat-chunk-XB5KKOCG.mjs";
31
- import "./token-goat-chunk-4FVIAHSI.mjs";
33
+ import "./token-goat-chunk-OUKDTVNU.mjs";
34
+ import "./token-goat-chunk-4GILLLWY.mjs";
35
+ import "./token-goat-chunk-BFCWY73P.mjs";
36
+ import "./token-goat-chunk-KGEFFSHD.mjs";
37
+ import "./token-goat-chunk-XX6O25RN.mjs";
38
+ import "./token-goat-chunk-HAVAOB3S.mjs";
39
+ import "./token-goat-chunk-F6PAUIEK.mjs";
40
+ import "./token-goat-chunk-65N4RHP4.mjs";
41
+ import "./token-goat-chunk-X2SUP3EI.mjs";
42
+ import "./token-goat-chunk-T5P5ACNQ.mjs";
43
+ import "./token-goat-chunk-7EZTZOMC.mjs";
44
+ import "./token-goat-chunk-QYHO5CPH.mjs";
32
45
  import {
33
46
  resolveProjectRoot
34
- } from "./token-goat-chunk-7IN2MKDS.mjs";
35
- import "./token-goat-chunk-U4N3BN2W.mjs";
47
+ } from "./token-goat-chunk-4GBVPH3D.mjs";
36
48
  import "./token-goat-chunk-YZAAZU2S.mjs";
37
49
  import "./token-goat-chunk-IVE6U7KV.mjs";
38
- import "./token-goat-chunk-GOLEOXZP.mjs";
50
+ import {
51
+ countNoun
52
+ } from "./token-goat-chunk-HU4TORC5.mjs";
53
+ import {
54
+ echoedValue
55
+ } from "./token-goat-chunk-GGGG7RWB.mjs";
39
56
  import "./token-goat-chunk-AM5V6GSX.mjs";
40
57
  import {
41
58
  displaySafeJson
42
59
  } from "./token-goat-chunk-FNFBKLRD.mjs";
43
- import "./token-goat-chunk-VES7EL7O.mjs";
44
- import "./token-goat-chunk-KWPNJBDH.mjs";
45
- import "./token-goat-chunk-HAVAOB3S.mjs";
60
+ import "./token-goat-chunk-CO3UYX6G.mjs";
46
61
  import {
47
62
  init_define_import_meta_env
48
63
  } from "./token-goat-chunk-A37V4PBF.mjs";
@@ -56,11 +71,11 @@ function buildFeedbackCardFromClaude(report) {
56
71
  const fixes = [];
57
72
  if (report.neverTouchedAgain.length > 0) {
58
73
  const files = report.neverTouchedAgain.map((f) => path.basename(f.filePath)).join(", ");
59
- preAudit.push(`Whole-file reads without reuse: ${files} (${report.neverTouchedAgain.length} file(s) read once via Read)`);
74
+ preAudit.push(`Whole-file reads without reuse: ${files} (${countNoun(report.neverTouchedAgain.length, "file")} read once via Read)`);
60
75
  fixes.push('Prefer `token-goat symbol` or `read "file::symbol"` instead of reading whole files.');
61
76
  }
62
77
  if (report.repeatedUncompressedBash.length > 0) {
63
- const cmds = report.repeatedUncompressedBash.map((b) => `"${b.normalized.slice(0, 40)}" (${b.count}x)`).join(", ");
78
+ const cmds = report.repeatedUncompressedBash.map((b) => `${echoedValue(b.normalized.slice(0, 40))} (${b.count}x)`).join(", ");
64
79
  preAudit.push(`Repeated uncompressed terminal commands: ${cmds}`);
65
80
  fixes.push("Use token-goat bash-output cache or compress flags for repetitive terminal invocations.");
66
81
  }
@@ -90,21 +105,21 @@ function buildFeedbackCardFromCopilot(report) {
90
105
  const totalMcpTokens = report.mcpTools.servers.reduce((sum, s) => sum + s.estimatedTokens, 0);
91
106
  const heavy = report.mcpTools.servers.filter((s) => s.estimatedTokens > 1e3);
92
107
  if (heavy.length > 0 || totalMcpTokens > 1500) {
93
- const details = report.mcpTools.servers.map((s) => `${s.serverName} (${s.toolCount} tool(s), ~${s.estimatedTokens.toLocaleString()} tok/turn)`).join(", ");
108
+ const details = report.mcpTools.servers.map((s) => `${s.serverName} (${countNoun(s.toolCount, "tool")}, ~${s.estimatedTokens.toLocaleString()} tok/turn)`).join(", ");
94
109
  const turns = Math.max(1, report.turns);
95
110
  const cumulative = totalMcpTokens * turns;
96
111
  preAudit.push(
97
- `High fixed MCP tool definition overhead: ${details}; total ~${totalMcpTokens.toLocaleString()} tok/turn re-sent across ${turns} turn(s) (~${cumulative.toLocaleString()} cumulative tokens).`
112
+ `High fixed MCP tool definition overhead: ${details}; total ~${totalMcpTokens.toLocaleString()} tok/turn re-sent across ${countNoun(turns, "turn")} (~${cumulative.toLocaleString()} cumulative tokens).`
98
113
  );
99
114
  const unused = unusedMcpServers(report);
100
115
  if (unused === null) {
101
116
  const heavyNames = (heavy.length > 0 ? heavy : report.mcpTools.servers).map((s) => s.serverName).join(", ");
102
117
  fixes.push(
103
- `Disable the MCP server(s) you do not use among ${heavyNames} with 'copilot mcp disable <name>', or exclude individual tools with '--excluded-tools'. This session's log records no tool calls, so it cannot say which went unused.`
118
+ `Disable any MCP server you do not use among ${heavyNames} with 'copilot mcp disable <name>', or exclude individual tools with '--excluded-tools'. This session's log records no tool calls, so it cannot say which went unused.`
104
119
  );
105
120
  } else if (unused.length > 0) {
106
121
  const commands = unused.map((s) => `'copilot mcp disable ${s.serverName}' (~${s.estimatedTokens.toLocaleString()} tok/turn)`).join(", ");
107
- fixes.push(`Disable the MCP server(s) this session never called: ${commands}. ${MCP_DISABLE_NOTE}`);
122
+ fixes.push(`Disable ${unused.length === 1 ? "the MCP server" : "the MCP servers"} this session never called: ${commands}. ${MCP_DISABLE_NOTE}`);
108
123
  }
109
124
  }
110
125
  }
@@ -115,7 +130,7 @@ function buildFeedbackCardFromCopilot(report) {
115
130
  fixes.push("Maintain current token-efficient tooling and MCP server configuration.");
116
131
  }
117
132
  return {
118
- taskSummary: `Copilot CLI session (${report.turns} turn(s) recorded in ${report.sessionId}).`,
133
+ taskSummary: `Copilot CLI session (${countNoun(report.turns, "turn")} recorded in ${report.sessionId}).`,
119
134
  preAuditFindings: preAudit,
120
135
  auditExecutionFindings: [],
121
136
  recommendedFix: fixes
@@ -147,15 +162,8 @@ async function runAuditCommand(opts = {}) {
147
162
  if (opts.transcript !== void 0) {
148
163
  const resolved = path.resolve(opts.transcript);
149
164
  if (!fs.existsSync(resolved)) {
150
- const err = `transcript not found: ${resolved}`;
151
- if (opts.json === true) {
152
- process.stdout.write(`${displaySafeJson({ error: err }, 0)}
153
- `);
154
- } else {
155
- process.stderr.write(`token-goat: ${err}
156
- `);
157
- }
158
- process.exitCode = 1;
165
+ const err = `transcript not found: ${echoedValue(resolved)}`;
166
+ writeCommandFailure(opts.json === true, { error: err }, err);
159
167
  return;
160
168
  }
161
169
  if (isCopilotTranscript(resolved)) {
@@ -181,18 +189,7 @@ async function runAuditCommand(opts = {}) {
181
189
  }
182
190
  const detected = findProjectSession(projectRoot);
183
191
  if (detected === null) {
184
- const err = "no session transcript found for project";
185
- if (opts.json === true) {
186
- process.stdout.write(`${displaySafeJson({ error: err, project: projectRoot }, 0)}
187
- `);
188
- } else {
189
- process.stdout.write(`
190
- # token-goat audit
191
- Project: ${projectRoot}
192
- No session transcript found. Pass --transcript <path> to specify one explicitly.
193
- `);
194
- }
195
- process.exitCode = 1;
192
+ writeCommandFailure(opts.json === true, { error: "no session transcript found for project", project: projectRoot }, noSessionTranscriptMessage(projectRoot));
196
193
  return;
197
194
  }
198
195
  if (detected.kind === "copilot") {
@@ -0,0 +1,71 @@
1
+ import { createRequire as __cjsRequire } from 'node:module';
2
+ const require = __cjsRequire(import.meta.url);
3
+ import {
4
+ VSCODE_TOOL_NAME_KEY,
5
+ getCwd
6
+ } from "./token-goat-chunk-76FGDLRO.mjs";
7
+ import {
8
+ escapesOntoNetworkThroughLinks,
9
+ foldPathForContainment,
10
+ isInsideRoot
11
+ } from "./token-goat-chunk-AM5V6GSX.mjs";
12
+ import {
13
+ isUncOrDevicePath,
14
+ resolveIndexPath,
15
+ wslMountOfIndexKey
16
+ } from "./token-goat-chunk-FNFBKLRD.mjs";
17
+ import {
18
+ init_define_import_meta_env
19
+ } from "./token-goat-chunk-A37V4PBF.mjs";
20
+
21
+ // src/vscode_path_gate.ts
22
+ init_define_import_meta_env();
23
+ import * as path from "node:path";
24
+ function resolvesToUncPath(target, cwd) {
25
+ try {
26
+ return isUncOrDevicePath(path.resolve(cwd ?? process.cwd(), target));
27
+ } catch {
28
+ return false;
29
+ }
30
+ }
31
+ function vscodePathAllowed(filePath, workspace) {
32
+ if (isUncOrDevicePath(filePath)) return false;
33
+ if (workspace === void 0 || isUncOrDevicePath(workspace)) return false;
34
+ const resolvedRoot = path.resolve(workspace);
35
+ const resolvedTarget = path.resolve(workspace, filePath);
36
+ const root = foldPathForContainment(resolvedRoot.replace(/\\/g, "/"));
37
+ const target = foldPathForContainment(resolvedTarget.replace(/\\/g, "/"));
38
+ if (target !== root && !target.startsWith(root.endsWith("/") ? root : root + "/")) return false;
39
+ return isInsideRoot(resolvedTarget, resolvedRoot);
40
+ }
41
+ function isVscodeEvent(event) {
42
+ return event.raw["_tg_harness"] === "vscode" || event.raw[VSCODE_TOOL_NAME_KEY] !== void 0;
43
+ }
44
+ function preToolPathDeclined(event, target) {
45
+ if (target === void 0) return false;
46
+ const cwd = getCwd(event);
47
+ if (spellingDeclined(event, target, cwd)) return true;
48
+ const mount = secondSpellingAtMount(target, cwd);
49
+ return mount !== null && spellingDeclined(event, mount, cwd);
50
+ }
51
+ function spellingDeclined(event, target, cwd) {
52
+ if (isUncOrDevicePath(target) || resolvesToUncPath(target, cwd)) return true;
53
+ if (isVscodeEvent(event)) return !vscodePathAllowed(target, cwd);
54
+ return escapesOntoNetworkThroughLinks(target, cwd);
55
+ }
56
+ function secondSpellingAtMount(target, cwd) {
57
+ if (process.platform === "win32") return null;
58
+ const base = cwd ?? "/";
59
+ const mount = wslMountOfIndexKey(resolveIndexPath(target, base));
60
+ return mount !== null && mount !== path.resolve(base, target) ? mount : null;
61
+ }
62
+ function commandPathIsTouchable(filePath, event) {
63
+ if (event === void 0) return !escapesOntoNetworkThroughLinks(filePath);
64
+ return !preToolPathDeclined(event, filePath);
65
+ }
66
+
67
+ export {
68
+ vscodePathAllowed,
69
+ preToolPathDeclined,
70
+ commandPathIsTouchable
71
+ };
@@ -2,29 +2,29 @@ import { createRequire as __cjsRequire } from 'node:module';
2
2
  const require = __cjsRequire(import.meta.url);
3
3
  import {
4
4
  getTrackedFiles
5
- } from "./token-goat-chunk-FBNQNSJK.mjs";
5
+ } from "./token-goat-chunk-OBOFIHKN.mjs";
6
6
  import {
7
7
  enqueueDirtyPathsSafe
8
- } from "./token-goat-chunk-H2PHHGM5.mjs";
8
+ } from "./token-goat-chunk-CIMQ2BB3.mjs";
9
9
  import {
10
10
  indexedPathSpellingIsStale,
11
11
  parserFingerprintForLanguage
12
- } from "./token-goat-chunk-RHXKCZX3.mjs";
12
+ } from "./token-goat-chunk-NISNMD7T.mjs";
13
13
  import {
14
- getProjectFileEntries,
15
- projectScopeClause
16
- } from "./token-goat-chunk-HYBFA5X3.mjs";
14
+ getProjectFileEntries
15
+ } from "./token-goat-chunk-IK2DRMFX.mjs";
17
16
  import {
18
- getDb
19
- } from "./token-goat-chunk-VL3YIFHZ.mjs";
17
+ getDb,
18
+ projectScopeClause
19
+ } from "./token-goat-chunk-GVB2MUST.mjs";
20
20
  import {
21
21
  fingerprintFile,
22
22
  getDisplayRoot,
23
- indexedFileIsGone
24
- } from "./token-goat-chunk-7IN2MKDS.mjs";
23
+ statIndexedFile
24
+ } from "./token-goat-chunk-4GBVPH3D.mjs";
25
25
  import {
26
26
  countNoun
27
- } from "./token-goat-chunk-GOLEOXZP.mjs";
27
+ } from "./token-goat-chunk-HU4TORC5.mjs";
28
28
  import {
29
29
  foldPath
30
30
  } from "./token-goat-chunk-AM5V6GSX.mjs";
@@ -36,7 +36,7 @@ import {
36
36
  } from "./token-goat-chunk-FNFBKLRD.mjs";
37
37
  import {
38
38
  globalDbPath
39
- } from "./token-goat-chunk-VES7EL7O.mjs";
39
+ } from "./token-goat-chunk-CO3UYX6G.mjs";
40
40
  import {
41
41
  init_define_import_meta_env
42
42
  } from "./token-goat-chunk-A37V4PBF.mjs";
@@ -115,7 +115,7 @@ function runReconcile(opts = {}) {
115
115
  lines.push(`${countNoun(unqueued, "file")} of the above could not be queued for reindexing: the queue takes nothing under the OS temp dir, and nothing at all when it cannot be written. Run token-goat index here to bring the index up to date.`);
116
116
  }
117
117
  if (result.trackedUnavailable) {
118
- lines.push("This project has an index but git listed no files in it, so nothing on disk was compared against it and changed or new files could not be found. Files gone from disk were still detected. Run token-goat inside the repository, or reindex with --walk if this directory is deliberately not under git.");
118
+ lines.push("This project has an index but git listed no files in it, so new files could not be found. Indexed files that changed or are gone from disk were still detected. Run token-goat inside the repository, or reindex with --walk if this directory is deliberately not under git.");
119
119
  }
120
120
  if (result.budgetExhausted) {
121
121
  lines.push(`Stopped at the ${result.elapsedMs}ms budget with ${countNoun(result.unscanned, "file")} unchecked, so there may be more drift; deletions were not computed at all, because an unchecked file is indistinguishable from a deleted one. Raise --budget-ms for a complete sweep.`);
@@ -216,13 +216,21 @@ function reconcileProject(opts = {}) {
216
216
  removed.length = 0;
217
217
  break;
218
218
  }
219
- if (indexedFileIsGone(entry.filePath)) removed.push(entry.filePath);
219
+ const st = statIndexedFile(entry.filePath);
220
+ if (st === "gone") {
221
+ removed.push(entry.filePath);
222
+ continue;
223
+ }
224
+ if (st === null || entry.mtime !== 0 && st.mtimeMs / 1e3 === entry.mtime) continue;
225
+ const diskSha = fingerprintFile(entry.filePath);
226
+ if (diskSha === entry.sha) mtimeOnly++;
227
+ else if (diskSha !== null) changed.push(entry.filePath);
220
228
  }
221
229
  }
222
230
  let enqueued = 0;
223
231
  if (opts.dryRun !== true) {
224
232
  const toEnqueue = [...changed, ...added, ...removed].map((p) => resolveIndexPath(p, cwd));
225
- enqueued = enqueueDirtyPathsSafe(toEnqueue, { alreadyResolved: true });
233
+ enqueued = enqueueDirtyPathsSafe(toEnqueue, { alreadyResolved: true, ...opts.queueDir !== void 0 ? { dir: opts.queueDir } : {} });
226
234
  if (budgetExhausted) {
227
235
  if (lastScanned !== null) writeReconcileCursor(dbPath, projectRoot, lastScanned);
228
236
  } else if (tracked.length > 0) {
@@ -0,0 +1,39 @@
1
+ import { createRequire as __cjsRequire } from 'node:module';
2
+ const require = __cjsRequire(import.meta.url);
3
+ import {
4
+ getHarnessName
5
+ } from "./token-goat-chunk-QYHO5CPH.mjs";
6
+ import {
7
+ init_define_import_meta_env
8
+ } from "./token-goat-chunk-A37V4PBF.mjs";
9
+
10
+ // src/harness_channels.ts
11
+ init_define_import_meta_env();
12
+ var PROMPT_SUBMIT_CONTEXT_DROPPED = /* @__PURE__ */ new Set([]);
13
+ function dropsPromptSubmitContext() {
14
+ return PROMPT_SUBMIT_CONTEXT_DROPPED.has(getHarnessName());
15
+ }
16
+ var PRE_COMPACT_CONTEXT_DROPPED = /* @__PURE__ */ new Set(["copilot_cli", "codex"]);
17
+ function dropsPreCompactContext() {
18
+ return PRE_COMPACT_CONTEXT_DROPPED.has(getHarnessName());
19
+ }
20
+ var STOP_CONTEXT_DROPPED = /* @__PURE__ */ new Set(["copilot_cli", "vscode"]);
21
+ function dropsStopContext() {
22
+ return STOP_CONTEXT_DROPPED.has(getHarnessName());
23
+ }
24
+ var PRE_COMPACT_RESUMES_ON_PROMPT = /* @__PURE__ */ new Set(["copilot_cli"]);
25
+ function resumesCompactionOnPrompt() {
26
+ return PRE_COMPACT_RESUMES_ON_PROMPT.has(getHarnessName()) && !dropsPromptSubmitContext();
27
+ }
28
+ var SESSION_START_MAY_BE_DEFERRED = /* @__PURE__ */ new Set(["copilot_cli", "vscode"]);
29
+ function sessionStartMayBeDeferred(host) {
30
+ return SESSION_START_MAY_BE_DEFERRED.has(host);
31
+ }
32
+
33
+ export {
34
+ dropsPromptSubmitContext,
35
+ dropsPreCompactContext,
36
+ dropsStopContext,
37
+ resumesCompactionOnPrompt,
38
+ sessionStartMayBeDeferred
39
+ };