token-goat 2.9.15 → 2.9.17

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 (39) hide show
  1. package/README.md +2 -5
  2. package/dist/{token-goat-chunk-IVUQLQWN.mjs → token-goat-chunk-26YUO7MP.mjs} +5 -3
  3. package/dist/{token-goat-chunk-SZWYESBS.mjs → token-goat-chunk-2M33Q3O4.mjs} +172 -67
  4. package/dist/{token-goat-chunk-S4XRY446.mjs → token-goat-chunk-2VASS5VR.mjs} +4 -3
  5. package/dist/{token-goat-chunk-7ZYK25AO.mjs → token-goat-chunk-2XA5ZW4T.mjs} +4 -4
  6. package/dist/{token-goat-chunk-C5JIO6HK.mjs → token-goat-chunk-5WB7GDH4.mjs} +5 -5
  7. package/dist/{token-goat-chunk-MZDIJJ3R.mjs → token-goat-chunk-66224KCZ.mjs} +40 -3
  8. package/dist/{token-goat-chunk-NDRP4KJQ.mjs → token-goat-chunk-73GXYYZR.mjs} +248 -50
  9. package/dist/{token-goat-chunk-ATIFTMRC.mjs → token-goat-chunk-7EGKXBWT.mjs} +7 -7
  10. package/dist/{token-goat-chunk-GMQQA7E4.mjs → token-goat-chunk-7VQMOBPQ.mjs} +2453 -722
  11. package/dist/token-goat-chunk-BGHSSJUA.mjs +102 -0
  12. package/dist/{token-goat-chunk-2X2EBBC6.mjs → token-goat-chunk-BK3RPPTK.mjs} +2 -2
  13. package/dist/{token-goat-chunk-YQ7WI2CO.mjs → token-goat-chunk-C26ZBGBC.mjs} +393 -3957
  14. package/dist/{token-goat-chunk-SFAS46RE.mjs → token-goat-chunk-CICJFVIH.mjs} +2 -2
  15. package/dist/{token-goat-chunk-6DLVZDB6.mjs → token-goat-chunk-CKIJWTRQ.mjs} +13 -12
  16. package/dist/{token-goat-chunk-5V7DAC7V.mjs → token-goat-chunk-CPHVXKNU.mjs} +10 -3
  17. package/dist/{token-goat-chunk-LT7JRU6K.mjs → token-goat-chunk-EKGVCAES.mjs} +4 -4
  18. package/dist/{token-goat-chunk-Z6UXPYJA.mjs → token-goat-chunk-F2ARFHLJ.mjs} +1 -1
  19. package/dist/{token-goat-chunk-NDPO7GAH.mjs → token-goat-chunk-G75WIVFM.mjs} +21 -20
  20. package/dist/{token-goat-chunk-YZX7EFG4.mjs → token-goat-chunk-GLOM5W5C.mjs} +1 -1
  21. package/dist/{token-goat-chunk-GIIHUSZX.mjs → token-goat-chunk-GPCCYQSS.mjs} +41 -11
  22. package/dist/{token-goat-chunk-OUGNPMDA.mjs → token-goat-chunk-HRUGS6CO.mjs} +30 -14
  23. package/dist/{token-goat-chunk-LCZBPOIN.mjs → token-goat-chunk-IDHWKNKZ.mjs} +143 -51
  24. package/dist/{token-goat-chunk-YKG35VHC.mjs → token-goat-chunk-KZPO4DWC.mjs} +1 -1
  25. package/dist/{token-goat-chunk-NEI4NC54.mjs → token-goat-chunk-LKSXAMJB.mjs} +7 -2
  26. package/dist/{token-goat-chunk-K7F2BFIK.mjs → token-goat-chunk-MWSVUKVV.mjs} +1 -1
  27. package/dist/{token-goat-chunk-BL5LNGBG.mjs → token-goat-chunk-PKNOHVWP.mjs} +2966 -3869
  28. package/dist/{token-goat-chunk-A4JYKD5H.mjs → token-goat-chunk-RB24DBBS.mjs} +2 -2
  29. package/dist/{token-goat-chunk-3NSDDTGL.mjs → token-goat-chunk-RFFUCQK7.mjs} +5 -5
  30. package/dist/token-goat-chunk-RRNZMM3A.mjs +3364 -0
  31. package/dist/{token-goat-chunk-XEPXYDPI.mjs → token-goat-chunk-SWRKVA3J.mjs} +11 -2
  32. package/dist/{token-goat-chunk-NU7TLMQK.mjs → token-goat-chunk-THBLW56G.mjs} +10 -7
  33. package/dist/{token-goat-chunk-PM76YS22.mjs → token-goat-chunk-UBZCON6N.mjs} +1 -1
  34. package/dist/{token-goat-chunk-ASYEPR3S.mjs → token-goat-chunk-W2GUUQAQ.mjs} +7 -3
  35. package/dist/{token-goat-chunk-DQ4J5AFF.mjs → token-goat-chunk-YFGEUIEO.mjs} +69 -18
  36. package/dist/token-goat-hook.mjs +13 -12
  37. package/dist/token-goat.core.mjs +21 -20
  38. package/docs/cli.md +1 -0
  39. package/package.json +1 -1
@@ -5,11 +5,11 @@ import {
5
5
  isSupportedOcrLang,
6
6
  loadConfig,
7
7
  resolveOcrLangs
8
- } from "./token-goat-chunk-S4XRY446.mjs";
8
+ } from "./token-goat-chunk-2VASS5VR.mjs";
9
9
  import {
10
10
  ensureDirSync,
11
11
  tokenGoatHome
12
- } from "./token-goat-chunk-PM76YS22.mjs";
12
+ } from "./token-goat-chunk-UBZCON6N.mjs";
13
13
  import {
14
14
  fenceUntrustedOcrText
15
15
  } from "./token-goat-chunk-ERTXEKB6.mjs";
@@ -4,26 +4,27 @@ import {
4
4
  buildEvent,
5
5
  relay,
6
6
  relayInProcess
7
- } from "./token-goat-chunk-SZWYESBS.mjs";
8
- import "./token-goat-chunk-YZX7EFG4.mjs";
7
+ } from "./token-goat-chunk-2M33Q3O4.mjs";
8
+ import "./token-goat-chunk-GLOM5W5C.mjs";
9
9
  import {
10
10
  MAX_STDIN_BYTES,
11
11
  readStdinJson
12
- } from "./token-goat-chunk-OUGNPMDA.mjs";
13
- import "./token-goat-chunk-BL5LNGBG.mjs";
14
- import "./token-goat-chunk-YQ7WI2CO.mjs";
12
+ } from "./token-goat-chunk-HRUGS6CO.mjs";
13
+ import "./token-goat-chunk-PKNOHVWP.mjs";
14
+ import "./token-goat-chunk-C26ZBGBC.mjs";
15
+ import "./token-goat-chunk-26YUO7MP.mjs";
15
16
  import "./token-goat-chunk-3BTK54F3.mjs";
16
- import "./token-goat-chunk-NDRP4KJQ.mjs";
17
- import "./token-goat-chunk-2X2EBBC6.mjs";
18
- import "./token-goat-chunk-Y4AFKTHK.mjs";
19
- import "./token-goat-chunk-IVUQLQWN.mjs";
20
- import "./token-goat-chunk-K7F2BFIK.mjs";
21
- import "./token-goat-chunk-S4XRY446.mjs";
17
+ import "./token-goat-chunk-73GXYYZR.mjs";
18
+ import "./token-goat-chunk-BK3RPPTK.mjs";
19
+ import "./token-goat-chunk-MWSVUKVV.mjs";
20
+ import "./token-goat-chunk-2VASS5VR.mjs";
22
21
  import "./token-goat-chunk-EEIDFMEM.mjs";
23
22
  import "./token-goat-chunk-OSUFN2FV.mjs";
24
- import "./token-goat-chunk-PM76YS22.mjs";
23
+ import "./token-goat-chunk-UBZCON6N.mjs";
25
24
  import "./token-goat-chunk-ERTXEKB6.mjs";
25
+ import "./token-goat-chunk-Y4AFKTHK.mjs";
26
26
  import "./token-goat-chunk-GMOUBOX4.mjs";
27
+ import "./token-goat-chunk-RRNZMM3A.mjs";
27
28
  import "./token-goat-chunk-A37V4PBF.mjs";
28
29
  export {
29
30
  MAX_STDIN_BYTES,
@@ -6,10 +6,12 @@ import {
6
6
  collectParagraphTexts,
7
7
  collectTextRuns,
8
8
  decodeZipEntry,
9
+ dropAlternateContentFallbacks,
10
+ inlineMathRuns,
9
11
  ooxmlPartBudget,
10
12
  parseOoxmlPart,
11
13
  readOoxmlZip
12
- } from "./token-goat-chunk-MZDIJJ3R.mjs";
14
+ } from "./token-goat-chunk-66224KCZ.mjs";
13
15
  import {
14
16
  displaySafeText
15
17
  } from "./token-goat-chunk-ERTXEKB6.mjs";
@@ -28,11 +30,16 @@ function headingLevel(styleVal) {
28
30
  const m = /^heading\s*(\d)$/i.exec(styleVal);
29
31
  return m?.[1] !== void 0 ? parseInt(m[1], 10) : null;
30
32
  }
33
+ function inlineRunSeparators(xml) {
34
+ return xml.replace(/<w:tab\s*\/>/g, "<w:t> </w:t>").replace(/<w:(?:br|cr)(?:\s[^/>]*)?\/>/g, "<w:t>\n</w:t>");
35
+ }
31
36
  async function loadDocumentBody(filePath) {
32
37
  const entries = await readOoxmlZip(filePath, ".docx");
33
38
  const xml = decodeZipEntry(entries, "word/document.xml", ooxmlPartBudget());
34
39
  if (xml === null) throw new NotAnOfficeDocumentError(`no word/document.xml found in ${filePath} (not a valid .docx?)`);
35
- return parseOoxmlPart(xml);
40
+ const parsed = await parseOoxmlPart(inlineMathRuns(inlineRunSeparators(xml), '<w:r><w:t xml:space="preserve">', "</w:t></w:r>"));
41
+ dropAlternateContentFallbacks(parsed);
42
+ return parsed;
36
43
  }
37
44
  async function docxOutline(filePath) {
38
45
  const parsed = await loadDocumentBody(filePath);
@@ -65,7 +72,7 @@ async function docxTables(filePath) {
65
72
  const tcElements = collectElements(tr, "w:tc");
66
73
  const rowCells = [];
67
74
  for (const tc of tcElements) {
68
- const cellText = collectParagraphTexts(tc, "w:p", "w:t", ["w:tbl"], "w:br").map((t) => t.replace(/\r?\n/g, " ").trim()).filter((t) => t.length > 0).join(" ");
75
+ const cellText = collectParagraphTexts(tc, "w:p", "w:t", ["w:tbl"]).map((t) => t.replace(/\r?\n/g, " ").trim()).filter((t) => t.length > 0).join(" ");
69
76
  rowCells.push(cellText);
70
77
  }
71
78
  if (rowCells.length > maxCols) maxCols = rowCells.length;
@@ -5,13 +5,13 @@ import {
5
5
  docxTables,
6
6
  docxText,
7
7
  formatDocxTables
8
- } from "./token-goat-chunk-5V7DAC7V.mjs";
9
- import "./token-goat-chunk-MZDIJJ3R.mjs";
8
+ } from "./token-goat-chunk-CPHVXKNU.mjs";
9
+ import "./token-goat-chunk-66224KCZ.mjs";
10
10
  import "./token-goat-chunk-XTQAOTSO.mjs";
11
11
  import "./token-goat-chunk-AH6QILZM.mjs";
12
- import "./token-goat-chunk-Y4AFKTHK.mjs";
13
- import "./token-goat-chunk-PM76YS22.mjs";
12
+ import "./token-goat-chunk-UBZCON6N.mjs";
14
13
  import "./token-goat-chunk-ERTXEKB6.mjs";
14
+ import "./token-goat-chunk-Y4AFKTHK.mjs";
15
15
  import "./token-goat-chunk-GMOUBOX4.mjs";
16
16
  import "./token-goat-chunk-A37V4PBF.mjs";
17
17
  export {
@@ -27,7 +27,7 @@ import {
27
27
  reconstructLayout,
28
28
  resolveDestPage,
29
29
  withPdfDocument
30
- } from "./token-goat-chunk-NEI4NC54.mjs";
30
+ } from "./token-goat-chunk-LKSXAMJB.mjs";
31
31
  import "./token-goat-chunk-AH6QILZM.mjs";
32
32
  import "./token-goat-chunk-Y4AFKTHK.mjs";
33
33
  import "./token-goat-chunk-GMOUBOX4.mjs";
@@ -70,37 +70,38 @@ import {
70
70
  requirePositiveInt,
71
71
  run,
72
72
  visualStudioManualSteps
73
- } from "./token-goat-chunk-GMQQA7E4.mjs";
74
- import "./token-goat-chunk-LCZBPOIN.mjs";
73
+ } from "./token-goat-chunk-7VQMOBPQ.mjs";
74
+ import "./token-goat-chunk-IDHWKNKZ.mjs";
75
+ import "./token-goat-chunk-CICJFVIH.mjs";
75
76
  import "./token-goat-chunk-LMFO66YD.mjs";
76
77
  import {
77
78
  cmdDescribe,
78
79
  cmdSessionSchema
79
- } from "./token-goat-chunk-OUGNPMDA.mjs";
80
- import "./token-goat-chunk-BL5LNGBG.mjs";
81
- import "./token-goat-chunk-YQ7WI2CO.mjs";
82
- import "./token-goat-chunk-NEI4NC54.mjs";
83
- import "./token-goat-chunk-5V7DAC7V.mjs";
84
- import "./token-goat-chunk-ASYEPR3S.mjs";
85
- import "./token-goat-chunk-NU7TLMQK.mjs";
86
- import "./token-goat-chunk-YKG35VHC.mjs";
80
+ } from "./token-goat-chunk-HRUGS6CO.mjs";
81
+ import "./token-goat-chunk-PKNOHVWP.mjs";
82
+ import "./token-goat-chunk-C26ZBGBC.mjs";
83
+ import "./token-goat-chunk-26YUO7MP.mjs";
84
+ import "./token-goat-chunk-LKSXAMJB.mjs";
85
+ import "./token-goat-chunk-CPHVXKNU.mjs";
86
+ import "./token-goat-chunk-W2GUUQAQ.mjs";
87
+ import "./token-goat-chunk-THBLW56G.mjs";
88
+ import "./token-goat-chunk-KZPO4DWC.mjs";
87
89
  import "./token-goat-chunk-3BTK54F3.mjs";
88
- import "./token-goat-chunk-MZDIJJ3R.mjs";
90
+ import "./token-goat-chunk-66224KCZ.mjs";
89
91
  import "./token-goat-chunk-XTQAOTSO.mjs";
90
92
  import "./token-goat-chunk-AH6QILZM.mjs";
91
- import "./token-goat-chunk-XEPXYDPI.mjs";
92
- import "./token-goat-chunk-NDRP4KJQ.mjs";
93
- import "./token-goat-chunk-2X2EBBC6.mjs";
94
- import "./token-goat-chunk-Y4AFKTHK.mjs";
95
- import "./token-goat-chunk-SFAS46RE.mjs";
96
- import "./token-goat-chunk-IVUQLQWN.mjs";
97
- import "./token-goat-chunk-K7F2BFIK.mjs";
98
- import "./token-goat-chunk-S4XRY446.mjs";
93
+ import "./token-goat-chunk-SWRKVA3J.mjs";
94
+ import "./token-goat-chunk-73GXYYZR.mjs";
95
+ import "./token-goat-chunk-BK3RPPTK.mjs";
96
+ import "./token-goat-chunk-MWSVUKVV.mjs";
97
+ import "./token-goat-chunk-2VASS5VR.mjs";
99
98
  import "./token-goat-chunk-EEIDFMEM.mjs";
100
99
  import "./token-goat-chunk-OSUFN2FV.mjs";
101
- import "./token-goat-chunk-PM76YS22.mjs";
100
+ import "./token-goat-chunk-UBZCON6N.mjs";
102
101
  import "./token-goat-chunk-ERTXEKB6.mjs";
102
+ import "./token-goat-chunk-Y4AFKTHK.mjs";
103
103
  import "./token-goat-chunk-GMOUBOX4.mjs";
104
+ import "./token-goat-chunk-RRNZMM3A.mjs";
104
105
  import "./token-goat-chunk-A37V4PBF.mjs";
105
106
  export {
106
107
  CliError,
@@ -2,7 +2,7 @@ import { createRequire as __cjsRequire } from 'node:module';
2
2
  const require = __cjsRequire(import.meta.url);
3
3
  import {
4
4
  detectHarness
5
- } from "./token-goat-chunk-S4XRY446.mjs";
5
+ } from "./token-goat-chunk-2VASS5VR.mjs";
6
6
  import {
7
7
  init_define_import_meta_env
8
8
  } from "./token-goat-chunk-A37V4PBF.mjs";
@@ -25,12 +25,11 @@ import {
25
25
  extractSwift,
26
26
  extractThrift,
27
27
  extractWgsl
28
- } from "./token-goat-chunk-XEPXYDPI.mjs";
28
+ } from "./token-goat-chunk-SWRKVA3J.mjs";
29
29
  import {
30
30
  extractShellBannerHeading
31
- } from "./token-goat-chunk-NDRP4KJQ.mjs";
32
- import "./token-goat-chunk-2X2EBBC6.mjs";
33
- import "./token-goat-chunk-Y4AFKTHK.mjs";
31
+ } from "./token-goat-chunk-73GXYYZR.mjs";
32
+ import "./token-goat-chunk-BK3RPPTK.mjs";
34
33
  import {
35
34
  GENERIC_CLAUSE,
36
35
  assignBraceBlockSpans,
@@ -59,16 +58,17 @@ import {
59
58
  stripMultilineStringSpan,
60
59
  stripStringLiterals,
61
60
  stripXmlComments
62
- } from "./token-goat-chunk-K7F2BFIK.mjs";
63
- import "./token-goat-chunk-S4XRY446.mjs";
61
+ } from "./token-goat-chunk-MWSVUKVV.mjs";
62
+ import "./token-goat-chunk-2VASS5VR.mjs";
64
63
  import "./token-goat-chunk-EEIDFMEM.mjs";
65
64
  import "./token-goat-chunk-OSUFN2FV.mjs";
66
65
  import {
67
66
  countContentLines,
68
67
  escapeRegExp,
69
68
  pushAll
70
- } from "./token-goat-chunk-PM76YS22.mjs";
69
+ } from "./token-goat-chunk-UBZCON6N.mjs";
71
70
  import "./token-goat-chunk-ERTXEKB6.mjs";
71
+ import "./token-goat-chunk-Y4AFKTHK.mjs";
72
72
  import "./token-goat-chunk-GMOUBOX4.mjs";
73
73
  import {
74
74
  init_define_import_meta_env
@@ -111,6 +111,27 @@ var PROPERTY_RE = new RegExp(
111
111
  var PROPERTY_HEADER_RE = new RegExp(
112
112
  `${MEMBER_INDENT}(?:(?:public|protected|private|internal|static|virtual|override|abstract|sealed|new|readonly)\\s+)*${TYPE_SLOT}\\s+${MEMBER_NAME}\\s*$`
113
113
  );
114
+ var EVENT_RE = new RegExp(
115
+ `${MEMBER_INDENT}(?:(?:public|protected|private|internal|static|virtual|override|abstract|sealed|new|extern|unsafe)\\s+)*event\\s`
116
+ );
117
+ var EVENT_NAME_RE = new RegExp(`(${IDENT})\\s*$`);
118
+ function splitEventDeclarators(decl) {
119
+ const parts = [];
120
+ let depth = 0;
121
+ let start = 0;
122
+ for (let i = 0; i < decl.length; i++) {
123
+ const c = decl[i];
124
+ if (c === "<") depth++;
125
+ else if (c === ">") {
126
+ if (depth > 0) depth--;
127
+ } else if (c === "," && depth === 0) {
128
+ parts.push(decl.slice(start, i));
129
+ start = i + 1;
130
+ }
131
+ }
132
+ parts.push(decl.slice(start));
133
+ return parts;
134
+ }
114
135
  var ALLMAN_ACCESSOR_RE = /^(?:get\s*;\s*set\s*;|set\s*;\s*get\s*;|get\s*;|set\s*;)$/;
115
136
  var ALLMAN_ACCESSOR_BODY_RE = /^(?:get|set)\b/;
116
137
  var PROPERTY_ARROW_RE = new RegExp(
@@ -183,7 +204,7 @@ function extractCsharp(content, filePath) {
183
204
  const delM = DELEGATE_RE.exec(stripLeadingAttributes(stripped));
184
205
  if (delM) {
185
206
  const delegateParent = classStack.length > 0 ? classStack[classStack.length - 1].name : void 0;
186
- symbols.push(makeLineSymbol(filePath, stripVerbatim(delM[1] ?? ""), "interface", lineNum, stripped.slice(0, 200), delegateParent, lines, "c"));
207
+ symbols.push(makeLineSymbol(filePath, stripVerbatim(delM[1] ?? ""), "type", lineNum, stripped.slice(0, 200), delegateParent, lines, "c"));
187
208
  }
188
209
  const cm = CLASS_HEADER_RE.exec(stripLeadingAttributes(stripped));
189
210
  if (cm) {
@@ -206,7 +227,16 @@ function extractCsharp(content, filePath) {
206
227
  symbols.push(makeLineSymbol(filePath, frame.name, "method", lineNum, sig.slice(0, 200), frame.name, lines, "c"));
207
228
  }
208
229
  let isPropertyLine = false;
209
- const propM = PROPERTY_RE.exec(lineNoAttr);
230
+ const eventM = EVENT_RE.exec(lineNoAttr);
231
+ if (eventM) {
232
+ isPropertyLine = true;
233
+ const decl = lineNoAttr.slice(eventM[0].length).split(/[;{]/)[0] ?? "";
234
+ for (const part of splitEventDeclarators(decl)) {
235
+ const declM = EVENT_NAME_RE.exec(part.split("=")[0]?.trim() ?? "");
236
+ if (declM) symbols.push(makeLineSymbol(filePath, stripVerbatim(declM[1] ?? ""), "var", lineNum, stripped.slice(0, 200), frame.name, lines, "c"));
237
+ }
238
+ }
239
+ const propM = isPropertyLine ? null : PROPERTY_RE.exec(lineNoAttr);
210
240
  if (propM) {
211
241
  isPropertyLine = true;
212
242
  symbols.push(makeLineSymbol(filePath, stripVerbatim(propM[1] ?? ""), "var", lineNum, stripped.slice(0, 200), frame.name, lines, "c"));
@@ -1164,7 +1194,7 @@ var VB6_PROPERTY_RE = new RegExp(String.raw`^Property\s+(?:Get|Let|Set)\s+(${ID}
1164
1194
  var PROPERTY_RE2 = new RegExp(String.raw`^Property\s+(${ID})`, "i");
1165
1195
  var PROCEDURE_RE = new RegExp(String.raw`^(Sub|Function)\s+(${ID})`, "i");
1166
1196
  var OPERATOR_RE = /^Operator\s+([^\s(]+)\s*\(/i;
1167
- var EVENT_RE = new RegExp(String.raw`^Event\s+(${ID})`, "i");
1197
+ var EVENT_RE2 = new RegExp(String.raw`^Event\s+(${ID})`, "i");
1168
1198
  var CONST_RE3 = /^Const\s+(\S.*)$/i;
1169
1199
  var DIM_RE = /^Dim\s+(\S.*)$/i;
1170
1200
  var FIELD_AFTER_MODIFIERS_RE = new RegExp(String.raw`^(${ID})\s*(?:\(|As\b|=|,|$)`, "i");
@@ -1496,7 +1526,7 @@ function extractVb(content, filePath) {
1496
1526
  open("operator", m[1], "method", stmt);
1497
1527
  continue;
1498
1528
  }
1499
- if ((m = EVENT_RE.exec(rest)) !== null) {
1529
+ if ((m = EVENT_RE2.exec(rest)) !== null) {
1500
1530
  const name = cleanName(m[1]);
1501
1531
  if (modifiers.has("custom") && !inInterface) open("event", name, "event", stmt);
1502
1532
  else emit2(name, "event", stmt);
@@ -2,32 +2,33 @@ import { createRequire as __cjsRequire } from 'node:module';
2
2
  const require = __cjsRequire(import.meta.url);
3
3
  import {
4
4
  enqueueDirtyPathSafe,
5
+ getToolName,
5
6
  getTrackedFiles
6
- } from "./token-goat-chunk-BL5LNGBG.mjs";
7
+ } from "./token-goat-chunk-PKNOHVWP.mjs";
7
8
  import {
8
- getToolName,
9
9
  indexRecallEntry
10
- } from "./token-goat-chunk-YQ7WI2CO.mjs";
11
- import {
12
- PARSER_FINGERPRINT
13
- } from "./token-goat-chunk-NDRP4KJQ.mjs";
14
- import {
15
- getProjectFileEntries
16
- } from "./token-goat-chunk-2X2EBBC6.mjs";
10
+ } from "./token-goat-chunk-C26ZBGBC.mjs";
17
11
  import {
18
12
  isBlobStale,
19
13
  loadBlob,
20
14
  redactSecrets,
21
15
  storeBlob
22
- } from "./token-goat-chunk-IVUQLQWN.mjs";
16
+ } from "./token-goat-chunk-26YUO7MP.mjs";
17
+ import {
18
+ PARSER_FINGERPRINT
19
+ } from "./token-goat-chunk-73GXYYZR.mjs";
20
+ import {
21
+ getProjectFileEntries,
22
+ projectScopeClause
23
+ } from "./token-goat-chunk-BK3RPPTK.mjs";
23
24
  import {
24
25
  getDb
25
- } from "./token-goat-chunk-K7F2BFIK.mjs";
26
+ } from "./token-goat-chunk-MWSVUKVV.mjs";
26
27
  import {
27
28
  fingerprintFile,
28
29
  getDisplayRoot,
29
30
  shortFingerprint
30
- } from "./token-goat-chunk-S4XRY446.mjs";
31
+ } from "./token-goat-chunk-2VASS5VR.mjs";
31
32
  import {
32
33
  registerReset
33
34
  } from "./token-goat-chunk-EEIDFMEM.mjs";
@@ -37,7 +38,7 @@ import {
37
38
  extractErrorMessage,
38
39
  foldPath,
39
40
  globalDbPath
40
- } from "./token-goat-chunk-PM76YS22.mjs";
41
+ } from "./token-goat-chunk-UBZCON6N.mjs";
41
42
  import {
42
43
  displaySafeJson,
43
44
  normalizePath,
@@ -815,6 +816,10 @@ function runReconcile(opts = {}) {
815
816
  const reparseVerb = opts.dryRun === true ? "would reparse" : "queued for reparse";
816
817
  lines.push(`${countNoun(result.parserStale, "file")} of the above ${result.parserStale === 1 ? "was" : "were"} unchanged on disk but indexed by an older parser (${reparseVerb}).`);
817
818
  }
819
+ if (result.embedStale > 0) {
820
+ const reembedVerb = opts.dryRun === true ? "would re-embed" : "queued for re-embedding";
821
+ lines.push(`${countNoun(result.embedStale, "file")} of the above ${result.embedStale === 1 ? "was" : "were"} unchanged on disk but held out-of-date embeddings (${reembedVerb}).`);
822
+ }
818
823
  if (result.trackedUnavailable) {
819
824
  lines.push("This project has an index but git listed no files in it, so nothing could be compared and no deletions were computed. Run token-goat inside the repository, or reindex with --walk if this directory is deliberately not under git.");
820
825
  }
@@ -836,6 +841,10 @@ function reconcileProject(opts = {}) {
836
841
  const tracked = getTrackedFiles(cwd);
837
842
  const projectRoot = resolveIndexPath(".", cwd);
838
843
  const indexed = getProjectFileEntries(projectRoot, dbPath);
844
+ const chunkScope = projectScopeClause("file_path");
845
+ const chunked = new Set(
846
+ getDb(dbPath).prepare(`SELECT DISTINCT file_path FROM chunks WHERE ${chunkScope.clause}`).pluck().all(...chunkScope.params(projectRoot)).map((p) => foldPath(normalizePath(p)))
847
+ );
839
848
  let scanOrder = tracked;
840
849
  const cursorPath = tracked.length > 0 ? readReconcileCursor(dbPath, projectRoot) : null;
841
850
  if (cursorPath !== null) {
@@ -850,6 +859,7 @@ function reconcileProject(opts = {}) {
850
859
  const seenOnDisk = /* @__PURE__ */ new Set();
851
860
  let mtimeOnly = 0;
852
861
  let parserStale = 0;
862
+ let embedStale = 0;
853
863
  let scanned = 0;
854
864
  let budgetExhausted = false;
855
865
  let lastScanned = null;
@@ -872,6 +882,11 @@ function reconcileProject(opts = {}) {
872
882
  parserStale++;
873
883
  continue;
874
884
  }
885
+ if (entry.embedSha === "" && chunked.has(folded)) {
886
+ changed.push(file);
887
+ embedStale++;
888
+ continue;
889
+ }
875
890
  let mtimeMs;
876
891
  try {
877
892
  mtimeMs = fs2.statSync(file).mtimeMs;
@@ -879,7 +894,7 @@ function reconcileProject(opts = {}) {
879
894
  changed.push(file);
880
895
  continue;
881
896
  }
882
- if (entry.mtime !== 0 && mtimeMs === entry.mtime) continue;
897
+ if (entry.mtime !== 0 && mtimeMs / 1e3 === entry.mtime) continue;
883
898
  const diskSha = fingerprintFile(file);
884
899
  if (diskSha === null) {
885
900
  changed.push(file);
@@ -927,6 +942,7 @@ function reconcileProject(opts = {}) {
927
942
  removed,
928
943
  mtimeOnly,
929
944
  parserStale,
945
+ embedStale,
930
946
  budgetExhausted,
931
947
  trackedUnavailable,
932
948
  unscanned: Math.max(0, tracked.length - scanned),