token-goat 2.9.20 → 2.9.21

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 (45) hide show
  1. package/dist/{token-goat-chunk-T63VHOL3.mjs → token-goat-chunk-2ZHD3XCD.mjs} +1 -1
  2. package/dist/{token-goat-chunk-CBXLE54Q.mjs → token-goat-chunk-4IIU3GNS.mjs} +8 -8
  3. package/dist/{token-goat-chunk-I5PQRHFE.mjs → token-goat-chunk-4V4OZHHV.mjs} +8 -8
  4. package/dist/{token-goat-chunk-W6QYCWAT.mjs → token-goat-chunk-64OEF3UN.mjs} +6 -6
  5. package/dist/{token-goat-chunk-FWYZVS3E.mjs → token-goat-chunk-6AQLZMCO.mjs} +6 -6
  6. package/dist/{token-goat-chunk-ASTBLE2R.mjs → token-goat-chunk-BIEDTF6V.mjs} +3 -3
  7. package/dist/{token-goat-chunk-3VTJC7KU.mjs → token-goat-chunk-BKHJRFDE.mjs} +11 -11
  8. package/dist/{token-goat-chunk-2CLWWRFR.mjs → token-goat-chunk-CAHN4QU7.mjs} +10 -10
  9. package/dist/{token-goat-chunk-ITWYDOKP.mjs → token-goat-chunk-CMAJGP3E.mjs} +4 -4
  10. package/dist/token-goat-chunk-CMHBTXMY.mjs +41 -0
  11. package/dist/{token-goat-chunk-Z4ALQADF.mjs → token-goat-chunk-CZ5ZFJSN.mjs} +18 -18
  12. package/dist/{token-goat-chunk-PAVWB4L4.mjs → token-goat-chunk-DDP64XR7.mjs} +3 -3
  13. package/dist/{token-goat-chunk-DW4VKU7D.mjs → token-goat-chunk-DISVHOW6.mjs} +4 -4
  14. package/dist/{token-goat-chunk-H4VC5TR6.mjs → token-goat-chunk-FZN77SZD.mjs} +27 -27
  15. package/dist/{token-goat-chunk-3OGZOFLS.mjs → token-goat-chunk-GO7OWONJ.mjs} +16 -16
  16. package/dist/{token-goat-chunk-ERGHDBC6.mjs → token-goat-chunk-IAMIQLCV.mjs} +74 -62
  17. package/dist/{token-goat-chunk-MUJV7BR3.mjs → token-goat-chunk-IJUHQX2M.mjs} +1 -1
  18. package/dist/{token-goat-chunk-BQIC3AVL.mjs → token-goat-chunk-KQI24O4B.mjs} +2 -2
  19. package/dist/{token-goat-chunk-ONMU7BON.mjs → token-goat-chunk-KRPJIXCT.mjs} +2 -2
  20. package/dist/{token-goat-chunk-DYUBZZNP.mjs → token-goat-chunk-KVAXTA2W.mjs} +10 -10
  21. package/dist/{token-goat-chunk-ODF7H7WS.mjs → token-goat-chunk-LK3YOKDF.mjs} +2 -2
  22. package/dist/{token-goat-chunk-SL454EN5.mjs → token-goat-chunk-M43UJVYQ.mjs} +5 -5
  23. package/dist/{token-goat-chunk-74ADIZZX.mjs → token-goat-chunk-M6CDVASA.mjs} +1 -1
  24. package/dist/{token-goat-chunk-KT75DZK4.mjs → token-goat-chunk-MECDAPXB.mjs} +4 -4
  25. package/dist/{token-goat-chunk-ZHFM4DHJ.mjs → token-goat-chunk-MEKVJZUN.mjs} +2 -2
  26. package/dist/{token-goat-chunk-SP5QR2HN.mjs → token-goat-chunk-MQACN7VG.mjs} +3 -3
  27. package/dist/{token-goat-chunk-DNAF26L4.mjs → token-goat-chunk-MZQORUX5.mjs} +1 -1
  28. package/dist/{token-goat-chunk-PTW22MRC.mjs → token-goat-chunk-ORRDWKLA.mjs} +1 -1
  29. package/dist/{token-goat-chunk-MNJWG2ZO.mjs → token-goat-chunk-PCR43MCM.mjs} +2 -2
  30. package/dist/{token-goat-chunk-VSJGPEBB.mjs → token-goat-chunk-PDYQA3AP.mjs} +4 -4
  31. package/dist/{token-goat-chunk-K5XPIUVB.mjs → token-goat-chunk-PHDNWISV.mjs} +3 -3
  32. package/dist/{token-goat-chunk-EUZKG7ZO.mjs → token-goat-chunk-PPYZS7TI.mjs} +3 -3
  33. package/dist/{token-goat-chunk-T46UKRFM.mjs → token-goat-chunk-QTIRVK3M.mjs} +1 -1
  34. package/dist/{token-goat-chunk-GIPMOGOI.mjs → token-goat-chunk-QUM3UNWS.mjs} +5 -5
  35. package/dist/{token-goat-chunk-P4XBHZXU.mjs → token-goat-chunk-SHV6QQAS.mjs} +1 -1
  36. package/dist/{token-goat-chunk-DPHJU3P7.mjs → token-goat-chunk-SMUYPBF5.mjs} +21 -22
  37. package/dist/{token-goat-chunk-6LJNM4ZZ.mjs → token-goat-chunk-TGBSMHPM.mjs} +1 -1
  38. package/dist/{token-goat-chunk-VYXGHGUY.mjs → token-goat-chunk-VXKT3W4C.mjs} +3 -3
  39. package/dist/{token-goat-chunk-2Q3N5KUQ.mjs → token-goat-chunk-XJUPKJF5.mjs} +46 -38
  40. package/dist/{token-goat-chunk-K3ZNBN4U.mjs → token-goat-chunk-XQSSPX3X.mjs} +2 -2
  41. package/dist/{token-goat-chunk-AU2K2QHR.mjs → token-goat-chunk-ZJWPJL7O.mjs} +3 -3
  42. package/dist/token-goat-hook.mjs +17 -17
  43. package/dist/token-goat.core.mjs +27 -27
  44. package/package.json +1 -1
  45. package/dist/token-goat-chunk-G6SYQQO7.mjs +0 -41
@@ -3,12 +3,12 @@ const require = __cjsRequire(import.meta.url);
3
3
  import {
4
4
  isRewriteWorthwhile,
5
5
  resolveMinNetSavingsBytes
6
- } from "./token-goat-chunk-PAVWB4L4.mjs";
6
+ } from "./token-goat-chunk-DDP64XR7.mjs";
7
7
  import {
8
8
  COPILOT_CLI_TOOL_NAME_MAP,
9
9
  foldToolName,
10
10
  readCopilotMcpTools
11
- } from "./token-goat-chunk-SP5QR2HN.mjs";
11
+ } from "./token-goat-chunk-MQACN7VG.mjs";
12
12
  import {
13
13
  contentHash,
14
14
  exportSessionState,
@@ -36,11 +36,11 @@ import {
36
36
  wasFileReadThisSession,
37
37
  wasFileTruncatedThisSession,
38
38
  writeSessionManifest
39
- } from "./token-goat-chunk-KT75DZK4.mjs";
39
+ } from "./token-goat-chunk-MECDAPXB.mjs";
40
40
  import {
41
41
  claudeConfigDir,
42
42
  estimateTokens
43
- } from "./token-goat-chunk-ZHFM4DHJ.mjs";
43
+ } from "./token-goat-chunk-MEKVJZUN.mjs";
44
44
  import {
45
45
  getBashOutput,
46
46
  isGeneratedFile,
@@ -48,7 +48,7 @@ import {
48
48
  isLockFile,
49
49
  isManifestFile,
50
50
  storeBashOutputSync
51
- } from "./token-goat-chunk-SL454EN5.mjs";
51
+ } from "./token-goat-chunk-M43UJVYQ.mjs";
52
52
  import {
53
53
  DEFAULT_MAX_AGE_MS,
54
54
  SOURCE_HINT,
@@ -60,7 +60,7 @@ import {
60
60
  savedTokensFromBytes,
61
61
  summarize,
62
62
  sweepCacheRoots
63
- } from "./token-goat-chunk-K5XPIUVB.mjs";
63
+ } from "./token-goat-chunk-PHDNWISV.mjs";
64
64
  import {
65
65
  parse
66
66
  } from "./token-goat-chunk-3BTK54F3.mjs";
@@ -94,13 +94,13 @@ import {
94
94
  maxChunksEmbedSha,
95
95
  parseSourceSymbolsTreeSitterOnly,
96
96
  parserFingerprintForLanguage
97
- } from "./token-goat-chunk-ERGHDBC6.mjs";
97
+ } from "./token-goat-chunk-IAMIQLCV.mjs";
98
98
  import {
99
99
  getFileEntry,
100
100
  pathEqClause,
101
101
  projectScopeClause,
102
102
  querySymbols
103
- } from "./token-goat-chunk-K3ZNBN4U.mjs";
103
+ } from "./token-goat-chunk-XQSSPX3X.mjs";
104
104
  import {
105
105
  detectLanguage,
106
106
  detectLanguageOfFile,
@@ -108,7 +108,7 @@ import {
108
108
  getDb,
109
109
  languageHasFlag,
110
110
  redactIfDotenv
111
- } from "./token-goat-chunk-T63VHOL3.mjs";
111
+ } from "./token-goat-chunk-2ZHD3XCD.mjs";
112
112
  import {
113
113
  detectHarness,
114
114
  fileIsAbsent,
@@ -122,7 +122,7 @@ import {
122
122
  ownGet,
123
123
  resolveProjectRoot,
124
124
  shortFingerprint
125
- } from "./token-goat-chunk-74ADIZZX.mjs";
125
+ } from "./token-goat-chunk-M6CDVASA.mjs";
126
126
  import {
127
127
  registerReset
128
128
  } from "./token-goat-chunk-EEIDFMEM.mjs";
@@ -152,7 +152,7 @@ import {
152
152
  statSize,
153
153
  toKB,
154
154
  tokenGoatHome
155
- } from "./token-goat-chunk-6LJNM4ZZ.mjs";
155
+ } from "./token-goat-chunk-TGBSMHPM.mjs";
156
156
  import {
157
157
  TOOL_RESULTS_ID_CHARS,
158
158
  displaySafeJson,
@@ -1354,7 +1354,7 @@ ${dataUrl2}`);
1354
1354
  }
1355
1355
  recordStat("image_shrink", shrinkSaved, shrinkTokens, void 0, basename10);
1356
1356
  if (loadConfig().image_shrink.ocr_enabled) {
1357
- const { ocrImage, isTextHeavy, formatOcrSummary } = await import("./token-goat-chunk-GIPMOGOI.mjs");
1357
+ const { ocrImage, isTextHeavy, formatOcrSummary } = await import("./token-goat-chunk-QUM3UNWS.mjs");
1358
1358
  const ocr = await ocrImage(result.data);
1359
1359
  if (ocr !== null && isTextHeavy(ocr, loadConfig().image_shrink.ocr_min_confidence)) {
1360
1360
  const emitted = formatOcrSummary(ocr, basename10, result.originalBytes);
@@ -1674,6 +1674,7 @@ function sweepKnownRoots(dbPath = globalDbPath(), opts) {
1674
1674
  const db = getDb(dbPath);
1675
1675
  const now = opts?.now ?? Date.now();
1676
1676
  const graceMs = opts?.missingGraceMs ?? KNOWN_ROOT_MISSING_GRACE_MS;
1677
+ const dryRun = opts?.dryRun === true;
1677
1678
  const roots = db.prepare("SELECT root, first_missing_ms FROM known_roots").all();
1678
1679
  let prunedRows = 0;
1679
1680
  const prunedRoots = [];
@@ -1688,17 +1689,17 @@ function sweepKnownRoots(dbPath = globalDbPath(), opts) {
1688
1689
  }
1689
1690
  if (!reachable) {
1690
1691
  if (firstMissingMs === null) {
1691
- db.prepare("UPDATE known_roots SET first_missing_ms = ? WHERE root = ?").run(now, root);
1692
+ if (!dryRun) db.prepare("UPDATE known_roots SET first_missing_ms = ? WHERE root = ?").run(now, root);
1692
1693
  continue;
1693
1694
  }
1694
1695
  if (now - firstMissingMs < graceMs) continue;
1695
- const count = pruneDeletedFiles(root, dbPath);
1696
+ const count = dryRun ? findDeletablePaths(root, dbPath).length : pruneDeletedFiles(root, dbPath);
1696
1697
  prunedRows += count;
1697
1698
  if (count > 0) prunedRoots.push(root);
1698
- db.prepare("DELETE FROM known_roots WHERE root = ?").run(root);
1699
+ if (!dryRun) db.prepare("DELETE FROM known_roots WHERE root = ?").run(root);
1699
1700
  continue;
1700
1701
  }
1701
- if (firstMissingMs !== null) {
1702
+ if (firstMissingMs !== null && !dryRun) {
1702
1703
  db.prepare("UPDATE known_roots SET first_missing_ms = NULL WHERE root = ?").run(root);
1703
1704
  }
1704
1705
  const total = countFilesUnderRoot(root, dbPath);
@@ -1709,11 +1710,11 @@ function sweepKnownRoots(dbPath = globalDbPath(), opts) {
1709
1710
  flaggedRoots.push(root);
1710
1711
  continue;
1711
1712
  }
1712
- prunedRows += removeDeletedFilesBestEffort(db, deletable).length;
1713
+ prunedRows += dryRun ? deletable.length : removeDeletedFilesBestEffort(db, deletable).length;
1713
1714
  prunedRoots.push(root);
1714
1715
  }
1715
- const prunedOrphanChunkPaths = pruneOrphanedChunks(dbPath);
1716
- const prunedOrphanVectors = pruneOrphanedVectors(dbPath);
1716
+ const prunedOrphanChunkPaths = dryRun ? findOrphanedChunkPaths(dbPath) : pruneOrphanedChunks(dbPath);
1717
+ const prunedOrphanVectors = dryRun ? 0 : pruneOrphanedVectors(dbPath);
1717
1718
  return { prunedRows, prunedRoots, flaggedRoots, prunedOrphanChunkPaths, prunedOrphanVectors };
1718
1719
  }
1719
1720
  function findTopIndexedProjects(dbPath = globalDbPath(), limit = 3) {
@@ -7313,9 +7314,7 @@ export {
7313
7314
  pruneBlockedRoot,
7314
7315
  findSystemTempFiles,
7315
7316
  pruneSystemTempFiles,
7316
- findOrphanedChunkPaths,
7317
- pruneOrphanedChunks,
7318
- pruneOrphanedVectors,
7317
+ sweepKnownRoots,
7319
7318
  findTopIndexedProjects,
7320
7319
  indexSizeBytes,
7321
7320
  reclaimIndex,
@@ -21,7 +21,7 @@ init_define_import_meta_env();
21
21
  import { createRequire } from "node:module";
22
22
  function resolveVersion() {
23
23
  if (true) {
24
- return "2.9.20";
24
+ return "2.9.21";
25
25
  }
26
26
  const require2 = createRequire(import.meta.url);
27
27
  const pkg = require2("../package.json");
@@ -5,11 +5,11 @@ import {
5
5
  docxTables,
6
6
  docxText,
7
7
  formatDocxTables
8
- } from "./token-goat-chunk-PTW22MRC.mjs";
9
- import "./token-goat-chunk-T46UKRFM.mjs";
8
+ } from "./token-goat-chunk-ORRDWKLA.mjs";
9
+ import "./token-goat-chunk-QTIRVK3M.mjs";
10
10
  import "./token-goat-chunk-XTQAOTSO.mjs";
11
11
  import "./token-goat-chunk-AH6QILZM.mjs";
12
- import "./token-goat-chunk-6LJNM4ZZ.mjs";
12
+ import "./token-goat-chunk-TGBSMHPM.mjs";
13
13
  import "./token-goat-chunk-NMTKNYGF.mjs";
14
14
  import "./token-goat-chunk-Y4AFKTHK.mjs";
15
15
  import "./token-goat-chunk-GMOUBOX4.mjs";
@@ -2,16 +2,16 @@ import { createRequire as __cjsRequire } from 'node:module';
2
2
  const require = __cjsRequire(import.meta.url);
3
3
  import {
4
4
  compareSemver
5
- } from "./token-goat-chunk-ONMU7BON.mjs";
5
+ } from "./token-goat-chunk-KRPJIXCT.mjs";
6
6
  import {
7
7
  buildCopilotWasteReport,
8
8
  findLatestCopilotSession,
9
9
  findProjectSession,
10
10
  isCopilotTranscript
11
- } from "./token-goat-chunk-EUZKG7ZO.mjs";
11
+ } from "./token-goat-chunk-PPYZS7TI.mjs";
12
12
  import {
13
13
  buildResumePacket
14
- } from "./token-goat-chunk-W6QYCWAT.mjs";
14
+ } from "./token-goat-chunk-64OEF3UN.mjs";
15
15
  import {
16
16
  ALL_SYMBOLS_IN_FILE_LIMIT,
17
17
  AMBIGUOUS_HEADING_LIMIT,
@@ -107,7 +107,7 @@ import {
107
107
  symbolNamesInFile,
108
108
  upsertNote,
109
109
  warnIfFilesStale
110
- } from "./token-goat-chunk-3VTJC7KU.mjs";
110
+ } from "./token-goat-chunk-BKHJRFDE.mjs";
111
111
  import {
112
112
  DEFAULT_RECONCILE_BUDGET_MS,
113
113
  HOOK_EVENTS,
@@ -126,17 +126,17 @@ import {
126
126
  runRecallCommand,
127
127
  runReconcile,
128
128
  storeWebOutput
129
- } from "./token-goat-chunk-I5PQRHFE.mjs";
129
+ } from "./token-goat-chunk-4V4OZHHV.mjs";
130
130
  import {
131
131
  buildWasteReport,
132
132
  extractResultText,
133
133
  findLatestTranscript,
134
134
  projectTranscriptsDir,
135
135
  safeStringify
136
- } from "./token-goat-chunk-BQIC3AVL.mjs";
136
+ } from "./token-goat-chunk-KQI24O4B.mjs";
137
137
  import {
138
138
  buildManifest
139
- } from "./token-goat-chunk-VSJGPEBB.mjs";
139
+ } from "./token-goat-chunk-PDYQA3AP.mjs";
140
140
  import {
141
141
  GEMINI_TOOL_NAME_MAP,
142
142
  MAX_FILES_SCANNED,
@@ -163,7 +163,6 @@ import {
163
163
  findContentDuplicates,
164
164
  findMemSuggestionCandidates,
165
165
  findMemoryMd,
166
- findOrphanedChunkPaths,
167
166
  findSystemTempFiles,
168
167
  findTopIndexedProjects,
169
168
  formatMemSuggestions,
@@ -190,8 +189,6 @@ import {
190
189
  markCategoryIneffective,
191
190
  pruneBlockedRoot,
192
191
  pruneDeletedFiles,
193
- pruneOrphanedChunks,
194
- pruneOrphanedVectors,
195
192
  pruneSystemTempFiles,
196
193
  pruneUnembeddableChunks,
197
194
  readCompactBody,
@@ -205,19 +202,20 @@ import {
205
202
  shrinkImage,
206
203
  startDetachedWorker,
207
204
  stopWorker,
205
+ sweepKnownRoots,
208
206
  toolMatcherFor,
209
207
  urlPolicyDenialReason,
210
208
  visionTokensSavedByText,
211
209
  walkProject,
212
210
  writeCompact
213
- } from "./token-goat-chunk-DPHJU3P7.mjs";
211
+ } from "./token-goat-chunk-SMUYPBF5.mjs";
214
212
  import {
215
213
  CompressedOutput,
216
214
  TOOL_FILTERS,
217
215
  ToolFilter,
218
216
  deliverCompressed,
219
217
  detectFromCommand
220
- } from "./token-goat-chunk-PAVWB4L4.mjs";
218
+ } from "./token-goat-chunk-DDP64XR7.mjs";
221
219
  import {
222
220
  HOOKS_SCRIPT_FILE,
223
221
  MATERIALIZE_SHRUNK_IMAGE_JS,
@@ -255,7 +253,7 @@ import {
255
253
  visualStudioProjectMcpPath,
256
254
  visualStudioSolutionVscodeMcpPath,
257
255
  visualStudioUserMcpPath
258
- } from "./token-goat-chunk-SP5QR2HN.mjs";
256
+ } from "./token-goat-chunk-MQACN7VG.mjs";
259
257
  import {
260
258
  AGENT_SALT_MARKER,
261
259
  CONTEXT_AUTOCOMPACT_TOKENS,
@@ -281,7 +279,7 @@ import {
281
279
  skillOutputsDir,
282
280
  storeCompact,
283
281
  storeOutput
284
- } from "./token-goat-chunk-KT75DZK4.mjs";
282
+ } from "./token-goat-chunk-MECDAPXB.mjs";
285
283
  import {
286
284
  capJsonRows,
287
285
  claudeConfigDir,
@@ -290,14 +288,14 @@ import {
290
288
  formatBytes,
291
289
  formatTokenEstimate,
292
290
  trimToBudget
293
- } from "./token-goat-chunk-ZHFM4DHJ.mjs";
291
+ } from "./token-goat-chunk-MEKVJZUN.mjs";
294
292
  import {
295
293
  BASH_OUTPUT_SUBDIR,
296
294
  clipLongMatchLine,
297
295
  combineStreams,
298
296
  getBashOutput,
299
297
  isRecallCacheType
300
- } from "./token-goat-chunk-SL454EN5.mjs";
298
+ } from "./token-goat-chunk-M43UJVYQ.mjs";
301
299
  import {
302
300
  C,
303
301
  DEFAULT_MAX_AGE_MS,
@@ -323,19 +321,19 @@ import {
323
321
  statsHasHarnessColumn,
324
322
  stripAnsiEscapes,
325
323
  summarize
326
- } from "./token-goat-chunk-K5XPIUVB.mjs";
324
+ } from "./token-goat-chunk-PHDNWISV.mjs";
327
325
  import {
328
326
  docxOutline,
329
327
  docxTables,
330
328
  docxText,
331
329
  formatDocxTables
332
- } from "./token-goat-chunk-PTW22MRC.mjs";
330
+ } from "./token-goat-chunk-ORRDWKLA.mjs";
333
331
  import {
334
332
  pptxNotesText,
335
333
  pptxOutline,
336
334
  pptxSlideText,
337
335
  pptxTextGrep
338
- } from "./token-goat-chunk-DNAF26L4.mjs";
336
+ } from "./token-goat-chunk-MZQORUX5.mjs";
339
337
  import {
340
338
  formatXlsxColumns,
341
339
  formatXlsxRange,
@@ -344,11 +342,11 @@ import {
344
342
  querySheet,
345
343
  rangeSheet,
346
344
  xlsxColumns
347
- } from "./token-goat-chunk-ODF7H7WS.mjs";
345
+ } from "./token-goat-chunk-LK3YOKDF.mjs";
348
346
  import {
349
347
  formatCsvTable,
350
348
  parseWhereSpecs
351
- } from "./token-goat-chunk-P4XBHZXU.mjs";
349
+ } from "./token-goat-chunk-SHV6QQAS.mjs";
352
350
  import {
353
351
  assetEmbedSha,
354
352
  deleteFileEmbeddings,
@@ -374,12 +372,12 @@ import {
374
372
  readSection,
375
373
  treeSitterCoreAvailable,
376
374
  treeSitterCoreLoadError
377
- } from "./token-goat-chunk-ERGHDBC6.mjs";
375
+ } from "./token-goat-chunk-IAMIQLCV.mjs";
378
376
  import {
379
377
  getFileEntry,
380
378
  getProjectFileEntries,
381
379
  querySymbols
382
- } from "./token-goat-chunk-K3ZNBN4U.mjs";
380
+ } from "./token-goat-chunk-XQSSPX3X.mjs";
383
381
  import {
384
382
  TREE_SITTER_LANGUAGES,
385
383
  detectLanguage,
@@ -390,7 +388,7 @@ import {
390
388
  matchGroovySlashy,
391
389
  nonTreeSitterLanguageCount,
392
390
  redactIfDotenv
393
- } from "./token-goat-chunk-T63VHOL3.mjs";
391
+ } from "./token-goat-chunk-2ZHD3XCD.mjs";
394
392
  import {
395
393
  CONFIG_KEY_ENV_OVERRIDES,
396
394
  PROJECT_LOCKED_KEYS,
@@ -419,7 +417,7 @@ import {
419
417
  stringify,
420
418
  validateEnumField,
421
419
  validateNumericField
422
- } from "./token-goat-chunk-74ADIZZX.mjs";
420
+ } from "./token-goat-chunk-M6CDVASA.mjs";
423
421
  import {
424
422
  ENV_KEYS,
425
423
  LOCK_WAIT_MS_HARDENED,
@@ -480,7 +478,7 @@ import {
480
478
  withRetryOnLock,
481
479
  writeIfDifferent,
482
480
  writeJsonSettings
483
- } from "./token-goat-chunk-6LJNM4ZZ.mjs";
481
+ } from "./token-goat-chunk-TGBSMHPM.mjs";
484
482
  import {
485
483
  UNTRUSTED_FILE_TAG,
486
484
  UNTRUSTED_TOOL_TAG,
@@ -8471,7 +8469,7 @@ async function runDoctorAndExit(opts) {
8471
8469
  }
8472
8470
  }
8473
8471
  try {
8474
- const { checkUpdateStatus } = await import("./token-goat-chunk-AU2K2QHR.mjs");
8472
+ const { checkUpdateStatus } = await import("./token-goat-chunk-ZJWPJL7O.mjs");
8475
8473
  const update = await checkUpdateStatus(1500);
8476
8474
  if (update.updateAvailable && update.latest) {
8477
8475
  console.log(`
@@ -9324,10 +9322,11 @@ function cmdProject(opts) {
9324
9322
  const removed = before.length - after.length;
9325
9323
  const stale = before.filter((r) => !after.includes(r));
9326
9324
  const staleTempFiles = findSystemTempFiles();
9327
- const orphanChunkPaths = findOrphanedChunkPaths();
9325
+ const sweep = sweepKnownRoots(void 0, { dryRun: opts.dryRun === true });
9326
+ const orphanChunkPaths = sweep.prunedOrphanChunkPaths;
9328
9327
  if (opts.dryRun === true) {
9329
9328
  if (opts.json === true) {
9330
- emit(displaySafeJson({ dryRun: true, wouldPrune: removed, stale, wouldPruneTempFiles: staleTempFiles.length, staleTempFiles, wouldPruneOrphanChunkFiles: orphanChunkPaths.length, orphanChunkPaths, blocked_roots: before }));
9329
+ emit(displaySafeJson({ dryRun: true, wouldPrune: removed, stale, wouldPruneTempFiles: staleTempFiles.length, staleTempFiles, wouldPruneOrphanChunkFiles: orphanChunkPaths.length, orphanChunkPaths, wouldPruneDeadFileRows: sweep.prunedRows, deadRowRoots: sweep.prunedRoots, flaggedRoots: sweep.flaggedRoots, blocked_roots: before }));
9331
9330
  return;
9332
9331
  }
9333
9332
  if (removed === 0) {
@@ -9348,22 +9347,31 @@ function cmdProject(opts) {
9348
9347
  emit(`Would prune orphaned embedding chunks for ${orphanChunkPaths.length} file(s):`);
9349
9348
  for (const p of orphanChunkPaths) emit(` ${p}`);
9350
9349
  }
9350
+ if (sweep.prunedRows === 0) {
9351
+ emit("Would prune 0 dead file row(s) under known roots. Nothing to do.");
9352
+ } else {
9353
+ emit(`Would prune ${sweep.prunedRows} dead file row(s) under ${sweep.prunedRoots.length} known root(s):`);
9354
+ for (const r of sweep.prunedRoots) emit(` ${r}`);
9355
+ }
9356
+ for (const r of sweep.flaggedRoots) emit(` skipped (too many rows would go at once, root may be partly offline): ${r}`);
9351
9357
  return;
9352
9358
  }
9353
9359
  cfg.worker.blocked_roots = after;
9354
9360
  saveConfigSafe(cfg);
9355
9361
  invalidateConfigCache();
9356
9362
  const prunedTempFiles = pruneSystemTempFiles();
9357
- const prunedOrphanChunks = pruneOrphanedChunks();
9358
- const prunedOrphanVectors = pruneOrphanedVectors();
9363
+ const prunedOrphanChunks = sweep.prunedOrphanChunkPaths;
9364
+ const prunedOrphanVectors = sweep.prunedOrphanVectors;
9359
9365
  if (opts.json === true) {
9360
- emit(displaySafeJson({ pruned: removed, blocked_roots: after, prunedTempFiles: prunedTempFiles.length, prunedOrphanChunkFiles: prunedOrphanChunks.length, prunedOrphanVectors }));
9366
+ emit(displaySafeJson({ pruned: removed, blocked_roots: after, prunedTempFiles: prunedTempFiles.length, prunedOrphanChunkFiles: prunedOrphanChunks.length, prunedOrphanVectors, prunedDeadFileRows: sweep.prunedRows, deadRowRoots: sweep.prunedRoots, flaggedRoots: sweep.flaggedRoots }));
9361
9367
  return;
9362
9368
  }
9363
9369
  emit(`Pruned ${removed} stale root(s). Remaining: ${after.length}`);
9364
9370
  emit(`Pruned ${prunedTempFiles.length} stale indexed temp-dir file(s).`);
9365
9371
  emit(`Pruned orphaned embedding chunks for ${prunedOrphanChunks.length} file(s).`);
9366
9372
  emit(`Pruned ${prunedOrphanVectors} orphaned embedding vector(s).`);
9373
+ emit(`Pruned ${sweep.prunedRows} dead file row(s) under ${sweep.prunedRoots.length} known root(s).`);
9374
+ for (const r of sweep.flaggedRoots) emit(` skipped (too many rows would go at once, root may be partly offline): ${r}`);
9367
9375
  return;
9368
9376
  }
9369
9377
  emitErr(`project: unknown action '${action}'. Use list, exclude, or prune.`);
@@ -18417,7 +18425,7 @@ function cmdWaste(opts = {}) {
18417
18425
  });
18418
18426
  }
18419
18427
  async function cmdAudit(opts = {}) {
18420
- const { runAuditCommand } = await import("./token-goat-chunk-DYUBZZNP.mjs");
18428
+ const { runAuditCommand } = await import("./token-goat-chunk-KVAXTA2W.mjs");
18421
18429
  return runAuditCommand({
18422
18430
  ...opts.project !== void 0 ? { project: opts.project } : {},
18423
18431
  ...opts.transcript !== void 0 ? { transcript: opts.transcript } : {},
@@ -20350,7 +20358,7 @@ async function cmdMcpServe() {
20350
20358
  let StdioServerTransport;
20351
20359
  try {
20352
20360
  ;
20353
- ({ createMcpServer } = await import("./token-goat-chunk-3OGZOFLS.mjs"));
20361
+ ({ createMcpServer } = await import("./token-goat-chunk-GO7OWONJ.mjs"));
20354
20362
  ({ StdioServerTransport } = await import("./token-goat-chunk-EVC4TOLE.mjs"));
20355
20363
  } catch (err2) {
20356
20364
  process.stderr.write(
@@ -20375,7 +20383,7 @@ async function cmdHook(event, opts) {
20375
20383
  if (typeof opts.harness === "string" && opts.harness.length > 0) {
20376
20384
  process.env[ENV_KEYS.HARNESS_OVERRIDE] = opts.harness;
20377
20385
  }
20378
- const { relay } = await import("./token-goat-chunk-G6SYQQO7.mjs");
20386
+ const { relay } = await import("./token-goat-chunk-CMHBTXMY.mjs");
20379
20387
  await relay(event);
20380
20388
  }
20381
20389
  function projectHooksCommitNote(pathFiles, hooksConfigPath) {
@@ -20412,7 +20420,7 @@ async function cmdInstall(opts) {
20412
20420
  if (opts.project === true && opts.user === true) {
20413
20421
  throw new Error("install takes either -p/--project or --user, not both.");
20414
20422
  }
20415
- await import("./token-goat-chunk-G6SYQQO7.mjs");
20423
+ await import("./token-goat-chunk-CMHBTXMY.mjs");
20416
20424
  const scope = opts.project === true ? "project" : "user";
20417
20425
  if (wantsClaudeCodeBase(opts)) {
20418
20426
  const result = installHooks(scope);
@@ -21003,7 +21011,7 @@ async function cmdCompress(commandArgs, opts = {}) {
21003
21011
  process.exitCode = 1;
21004
21012
  return;
21005
21013
  }
21006
- const bashRunner = await import("./token-goat-chunk-CBXLE54Q.mjs");
21014
+ const bashRunner = await import("./token-goat-chunk-4IIU3GNS.mjs");
21007
21015
  if (opts.compress === false) {
21008
21016
  process.exitCode = bashRunner.runRaw(command, parseTimeout(opts.timeout, bashRunner.DEFAULT_TIMEOUT_SECONDS));
21009
21017
  return;
@@ -21269,7 +21277,7 @@ function buildProgram() {
21269
21277
  program2.command("compress [command...]").alias("bash").alias("run").description("run a shell command (under a POSIX shell / bash) and emit a compressed view of its output").allowUnknownOption(true).option("-c, --cmd <command>", "the shell command to run, as one string (use / for paths across platforms)").option("--cmd-b64 <payload>", "the shell command as a base64-encoded string (preserves quotes, backslashes, and symbols across platforms)").option("-f, --filter <name>", "filter name (auto-detected from the command when omitted)").option("--timeout <seconds>", "wall-clock timeout in seconds (0 = built-in default)").option("--no-compress", "stream output raw without compression (debug the wrapper)").option("--profile <name>", "compression profile: aggressive | balanced | minimal").option("--max-tokens <n>", "post-compress token cap (0 = no cap)").option("-q, --quiet-success", "on exit code 0, emit only [tg: ok] summary and store full output for recall via bash-output").option("--native", "use native platform shell (e.g. cmd.exe on Windows) instead of bash, preserving Windows path backslashes").action(cmdCompress);
21270
21278
  program2.command("upgrade").alias("update").description("check for updates and upgrade token-goat to the latest version").option("--check", "check whether an update is available without installing").option("-j, --json", "emit version check status as JSON").action(
21271
21279
  (opts) => guard(async () => {
21272
- const { cmdUpgrade } = await import("./token-goat-chunk-AU2K2QHR.mjs");
21280
+ const { cmdUpgrade } = await import("./token-goat-chunk-ZJWPJL7O.mjs");
21273
21281
  await cmdUpgrade(opts, () => cmdInstall({}));
21274
21282
  })()
21275
21283
  );
@@ -2,12 +2,12 @@ import { createRequire as __cjsRequire } from 'node:module';
2
2
  const require = __cjsRequire(import.meta.url);
3
3
  import {
4
4
  getDb
5
- } from "./token-goat-chunk-T63VHOL3.mjs";
5
+ } from "./token-goat-chunk-2ZHD3XCD.mjs";
6
6
  import {
7
7
  foldPath,
8
8
  globalDbPath,
9
9
  isCaseInsensitiveFs
10
- } from "./token-goat-chunk-6LJNM4ZZ.mjs";
10
+ } from "./token-goat-chunk-TGBSMHPM.mjs";
11
11
  import {
12
12
  normalizePath
13
13
  } from "./token-goat-chunk-NMTKNYGF.mjs";
@@ -5,10 +5,10 @@ import {
5
5
  cmdUpgrade,
6
6
  compareSemver,
7
7
  fetchLatestVersion
8
- } from "./token-goat-chunk-ONMU7BON.mjs";
9
- import "./token-goat-chunk-74ADIZZX.mjs";
8
+ } from "./token-goat-chunk-KRPJIXCT.mjs";
9
+ import "./token-goat-chunk-M6CDVASA.mjs";
10
10
  import "./token-goat-chunk-EEIDFMEM.mjs";
11
- import "./token-goat-chunk-6LJNM4ZZ.mjs";
11
+ import "./token-goat-chunk-TGBSMHPM.mjs";
12
12
  import "./token-goat-chunk-NMTKNYGF.mjs";
13
13
  import "./token-goat-chunk-GMOUBOX4.mjs";
14
14
  import "./token-goat-chunk-A37V4PBF.mjs";
@@ -2,26 +2,26 @@ import { createRequire as __cjsRequire } from 'node:module';
2
2
  const require = __cjsRequire(import.meta.url);
3
3
  import {
4
4
  relayInProcess
5
- } from "./token-goat-chunk-Z4ALQADF.mjs";
6
- import "./token-goat-chunk-ITWYDOKP.mjs";
7
- import "./token-goat-chunk-I5PQRHFE.mjs";
8
- import "./token-goat-chunk-BQIC3AVL.mjs";
9
- import "./token-goat-chunk-VSJGPEBB.mjs";
10
- import "./token-goat-chunk-DPHJU3P7.mjs";
11
- import "./token-goat-chunk-PAVWB4L4.mjs";
12
- import "./token-goat-chunk-SP5QR2HN.mjs";
13
- import "./token-goat-chunk-KT75DZK4.mjs";
14
- import "./token-goat-chunk-ZHFM4DHJ.mjs";
15
- import "./token-goat-chunk-SL454EN5.mjs";
16
- import "./token-goat-chunk-K5XPIUVB.mjs";
5
+ } from "./token-goat-chunk-CZ5ZFJSN.mjs";
6
+ import "./token-goat-chunk-CMAJGP3E.mjs";
7
+ import "./token-goat-chunk-4V4OZHHV.mjs";
8
+ import "./token-goat-chunk-KQI24O4B.mjs";
9
+ import "./token-goat-chunk-PDYQA3AP.mjs";
10
+ import "./token-goat-chunk-SMUYPBF5.mjs";
11
+ import "./token-goat-chunk-DDP64XR7.mjs";
12
+ import "./token-goat-chunk-MQACN7VG.mjs";
13
+ import "./token-goat-chunk-MECDAPXB.mjs";
14
+ import "./token-goat-chunk-MEKVJZUN.mjs";
15
+ import "./token-goat-chunk-M43UJVYQ.mjs";
16
+ import "./token-goat-chunk-PHDNWISV.mjs";
17
17
  import "./token-goat-chunk-3BTK54F3.mjs";
18
- import "./token-goat-chunk-ERGHDBC6.mjs";
19
- import "./token-goat-chunk-K3ZNBN4U.mjs";
20
- import "./token-goat-chunk-T63VHOL3.mjs";
21
- import "./token-goat-chunk-74ADIZZX.mjs";
18
+ import "./token-goat-chunk-IAMIQLCV.mjs";
19
+ import "./token-goat-chunk-XQSSPX3X.mjs";
20
+ import "./token-goat-chunk-2ZHD3XCD.mjs";
21
+ import "./token-goat-chunk-M6CDVASA.mjs";
22
22
  import "./token-goat-chunk-EEIDFMEM.mjs";
23
23
  import "./token-goat-chunk-OSUFN2FV.mjs";
24
- import "./token-goat-chunk-6LJNM4ZZ.mjs";
24
+ import "./token-goat-chunk-TGBSMHPM.mjs";
25
25
  import "./token-goat-chunk-NMTKNYGF.mjs";
26
26
  import "./token-goat-chunk-Y4AFKTHK.mjs";
27
27
  import "./token-goat-chunk-GMOUBOX4.mjs";
@@ -2,42 +2,42 @@ import { createRequire as __cjsRequire } from 'node:module';
2
2
  const require = __cjsRequire(import.meta.url);
3
3
  import {
4
4
  run
5
- } from "./token-goat-chunk-2Q3N5KUQ.mjs";
6
- import "./token-goat-chunk-ONMU7BON.mjs";
7
- import "./token-goat-chunk-EUZKG7ZO.mjs";
8
- import "./token-goat-chunk-W6QYCWAT.mjs";
9
- import "./token-goat-chunk-3VTJC7KU.mjs";
10
- import "./token-goat-chunk-MNJWG2ZO.mjs";
5
+ } from "./token-goat-chunk-XJUPKJF5.mjs";
6
+ import "./token-goat-chunk-KRPJIXCT.mjs";
7
+ import "./token-goat-chunk-PPYZS7TI.mjs";
8
+ import "./token-goat-chunk-64OEF3UN.mjs";
9
+ import "./token-goat-chunk-BKHJRFDE.mjs";
10
+ import "./token-goat-chunk-PCR43MCM.mjs";
11
11
  import "./token-goat-chunk-DA43OE7L.mjs";
12
- import "./token-goat-chunk-I5PQRHFE.mjs";
13
- import "./token-goat-chunk-BQIC3AVL.mjs";
14
- import "./token-goat-chunk-VSJGPEBB.mjs";
15
- import "./token-goat-chunk-DPHJU3P7.mjs";
16
- import "./token-goat-chunk-PAVWB4L4.mjs";
17
- import "./token-goat-chunk-SP5QR2HN.mjs";
18
- import "./token-goat-chunk-KT75DZK4.mjs";
19
- import "./token-goat-chunk-ZHFM4DHJ.mjs";
20
- import "./token-goat-chunk-SL454EN5.mjs";
21
- import "./token-goat-chunk-K5XPIUVB.mjs";
12
+ import "./token-goat-chunk-4V4OZHHV.mjs";
13
+ import "./token-goat-chunk-KQI24O4B.mjs";
14
+ import "./token-goat-chunk-PDYQA3AP.mjs";
15
+ import "./token-goat-chunk-SMUYPBF5.mjs";
16
+ import "./token-goat-chunk-DDP64XR7.mjs";
17
+ import "./token-goat-chunk-MQACN7VG.mjs";
18
+ import "./token-goat-chunk-MECDAPXB.mjs";
19
+ import "./token-goat-chunk-MEKVJZUN.mjs";
20
+ import "./token-goat-chunk-M43UJVYQ.mjs";
21
+ import "./token-goat-chunk-PHDNWISV.mjs";
22
22
  import "./token-goat-chunk-LKSXAMJB.mjs";
23
- import "./token-goat-chunk-PTW22MRC.mjs";
24
- import "./token-goat-chunk-DNAF26L4.mjs";
25
- import "./token-goat-chunk-ODF7H7WS.mjs";
26
- import "./token-goat-chunk-P4XBHZXU.mjs";
23
+ import "./token-goat-chunk-ORRDWKLA.mjs";
24
+ import "./token-goat-chunk-MZQORUX5.mjs";
25
+ import "./token-goat-chunk-LK3YOKDF.mjs";
26
+ import "./token-goat-chunk-SHV6QQAS.mjs";
27
27
  import "./token-goat-chunk-3BTK54F3.mjs";
28
- import "./token-goat-chunk-T46UKRFM.mjs";
28
+ import "./token-goat-chunk-QTIRVK3M.mjs";
29
29
  import "./token-goat-chunk-XTQAOTSO.mjs";
30
30
  import "./token-goat-chunk-AH6QILZM.mjs";
31
- import "./token-goat-chunk-MUJV7BR3.mjs";
32
- import "./token-goat-chunk-ERGHDBC6.mjs";
33
- import "./token-goat-chunk-K3ZNBN4U.mjs";
34
- import "./token-goat-chunk-T63VHOL3.mjs";
35
- import "./token-goat-chunk-74ADIZZX.mjs";
31
+ import "./token-goat-chunk-IJUHQX2M.mjs";
32
+ import "./token-goat-chunk-IAMIQLCV.mjs";
33
+ import "./token-goat-chunk-XQSSPX3X.mjs";
34
+ import "./token-goat-chunk-2ZHD3XCD.mjs";
35
+ import "./token-goat-chunk-M6CDVASA.mjs";
36
36
  import "./token-goat-chunk-EEIDFMEM.mjs";
37
37
  import "./token-goat-chunk-OSUFN2FV.mjs";
38
38
  import {
39
39
  installEpipeGuard
40
- } from "./token-goat-chunk-6LJNM4ZZ.mjs";
40
+ } from "./token-goat-chunk-TGBSMHPM.mjs";
41
41
  import "./token-goat-chunk-NMTKNYGF.mjs";
42
42
  import "./token-goat-chunk-Y4AFKTHK.mjs";
43
43
  import "./token-goat-chunk-GMOUBOX4.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "token-goat",
3
- "version": "2.9.20",
3
+ "version": "2.9.21",
4
4
  "description": "Surgical token-reduction companion for Claude Code and other AI coding agents",
5
5
  "type": "module",
6
6
  "main": "./dist/token-goat.mjs",