@wrongstack/tools 1.0.6 → 1.0.8

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 (89) hide show
  1. package/dist/audit.js +4 -4
  2. package/dist/bash.js +2 -2
  3. package/dist/builtin.js +39 -39
  4. package/dist/{chunk-HKR56VNF.js → chunk-2IAEJRLT.js} +4 -3
  5. package/dist/{chunk-5UA4TNJJ.js → chunk-2NTHMZV3.js} +2 -2
  6. package/dist/{chunk-JQ43NVFU.js → chunk-3LQJXJDM.js} +2 -2
  7. package/dist/{chunk-47GYABZW.js → chunk-4SW6BXUR.js} +2 -2
  8. package/dist/{chunk-4KI4HHID.js → chunk-5KRKL3WD.js} +3 -3
  9. package/dist/{chunk-7EQ2LUXU.js → chunk-5MP76C72.js} +3 -3
  10. package/dist/{chunk-7PEZU5Y4.js → chunk-7E55DAFW.js} +8 -8
  11. package/dist/{chunk-D4HWMWGE.js → chunk-AH7J5HWL.js} +3 -3
  12. package/dist/{chunk-OZVGRDCM.js → chunk-B62LKMWQ.js} +3 -3
  13. package/dist/{chunk-WKXL5XHU.js → chunk-BVHKBBGA.js} +2 -2
  14. package/dist/{chunk-54SIRJ6D.js → chunk-C4DSQBTT.js} +3 -3
  15. package/dist/{chunk-2ZWQIVEW.js → chunk-CAF4L6KN.js} +2 -2
  16. package/dist/{chunk-MG7CUN6R.js → chunk-EGT5QLCB.js} +6 -3
  17. package/dist/{chunk-ZSW5KO5S.js → chunk-FI6SOIVE.js} +31 -7
  18. package/dist/{chunk-TL5T4A4E.js → chunk-GF4JHLCO.js} +3 -3
  19. package/dist/{chunk-OVFQC6FU.js → chunk-GNLHBDFO.js} +341 -146
  20. package/dist/{chunk-ZETZHHV5.js → chunk-H2VB7GCR.js} +3 -3
  21. package/dist/{chunk-C64UUXTA.js → chunk-HCPSVK7J.js} +3 -3
  22. package/dist/{chunk-K7Y2IWEB.js → chunk-HIRVCXLP.js} +4 -4
  23. package/dist/{chunk-IMIHTHF7.js → chunk-HOFVYIPI.js} +38 -10
  24. package/dist/{chunk-CYPYJIAF.js → chunk-JB5JLY7V.js} +4 -4
  25. package/dist/{chunk-S6E2AM4U.js → chunk-KF7GMVNU.js} +3 -3
  26. package/dist/{chunk-IOOFLBVM.js → chunk-KMXPP32M.js} +3 -3
  27. package/dist/{chunk-REWOZIA4.js → chunk-M2W36JT7.js} +2 -2
  28. package/dist/{chunk-FRIUJ534.js → chunk-MF6ZUBI7.js} +3 -3
  29. package/dist/{chunk-BU6VUXWG.js → chunk-N3OTTQNC.js} +2 -2
  30. package/dist/{chunk-YJQQ5F5J.js → chunk-NL45OWEO.js} +3 -3
  31. package/dist/{chunk-NKOTOW6X.js → chunk-O6AGFJBO.js} +3 -3
  32. package/dist/{chunk-YILT3CSO.js → chunk-OGQMPX3J.js} +18 -7
  33. package/dist/{chunk-OBVXDVLE.js → chunk-QJARSK2G.js} +3 -3
  34. package/dist/{chunk-R36RWYXE.js → chunk-R3HIZVFS.js} +3 -3
  35. package/dist/{chunk-TGVQMKVH.js → chunk-S6CGSFLX.js} +3 -3
  36. package/dist/{chunk-JK5WXW4S.js → chunk-SEONDNLN.js} +2 -2
  37. package/dist/{chunk-6IEBD27U.js → chunk-SKRMUHTU.js} +2 -2
  38. package/dist/{chunk-DOHU3XHS.js → chunk-TU6UVATU.js} +3 -3
  39. package/dist/{chunk-G35NLPG5.js → chunk-WKLUOXR4.js} +3 -3
  40. package/dist/{chunk-6ZRP5IKQ.js → chunk-YUK3WLHJ.js} +2 -2
  41. package/dist/{chunk-5BKQVP56.js → chunk-YZECCW3F.js} +34 -14
  42. package/dist/{chunk-3F7HQ3KS.js → chunk-YZQSUL5G.js} +2 -2
  43. package/dist/{chunk-2IC5FRD7.js → chunk-ZMCV3XOV.js} +2 -2
  44. package/dist/{chunk-WBAPU3AB.js → chunk-ZOUG3KKS.js} +2 -2
  45. package/dist/clarify.d.ts +26 -19
  46. package/dist/codebase-index/index.js +8 -8
  47. package/dist/codebase-index/parser-worker-script.js +3 -3
  48. package/dist/codebase-index/project-server.js +5 -5
  49. package/dist/codebase-index/worker.js +4 -4
  50. package/dist/diff.js +2 -2
  51. package/dist/e2e.js +2 -2
  52. package/dist/edit.js +8 -8
  53. package/dist/exec.js +2 -2
  54. package/dist/fetch.js +2 -2
  55. package/dist/format.js +4 -4
  56. package/dist/{generic-parser-WFMIRHBX.js → generic-parser-N2PLGBC2.js} +2 -2
  57. package/dist/git.js +2 -2
  58. package/dist/glob.js +2 -2
  59. package/dist/{go-parser-EMKTAAD3.js → go-parser-VDPRQEGM.js} +5 -5
  60. package/dist/grep.js +2 -2
  61. package/dist/index.d.ts +1 -1
  62. package/dist/index.js +41 -41
  63. package/dist/install.js +4 -4
  64. package/dist/{json-parser-34DHYCPW.js → json-parser-IJD77VL4.js} +11 -17
  65. package/dist/json.js +2 -2
  66. package/dist/kanban.js +2 -2
  67. package/dist/languages/index.js +2 -2
  68. package/dist/{legacy-bridge-XM2GV665.js → legacy-bridge-4T4OTSQP.js} +4 -4
  69. package/dist/lint.js +4 -4
  70. package/dist/logs.js +2 -2
  71. package/dist/outdated.js +2 -2
  72. package/dist/pack.js +40 -40
  73. package/dist/{parser-dispatch-HZDZSIYH.js → parser-dispatch-4E2SDQUO.js} +4 -4
  74. package/dist/patch.js +8 -8
  75. package/dist/plan.js +4 -4
  76. package/dist/{py-parser-DDG53RXI.js → py-parser-MAW6DHFE.js} +3 -3
  77. package/dist/read.js +8 -8
  78. package/dist/replace.js +8 -8
  79. package/dist/session-kanban.d.ts +7 -0
  80. package/dist/session-kanban.js +3 -1
  81. package/dist/task.js +4 -4
  82. package/dist/test.js +4 -4
  83. package/dist/todo.js +3 -3
  84. package/dist/tool-tier.js +41 -41
  85. package/dist/tree.js +2 -2
  86. package/dist/typecheck.js +4 -4
  87. package/dist/write.js +8 -8
  88. package/dist/{yaml-parser-RGBXEZE4.js → yaml-parser-DFBC5FWH.js} +7 -6
  89. package/package.json +5 -5
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  getIndexState,
3
3
  searchCodebaseIndex
4
- } from "./chunk-DOHU3XHS.js";
4
+ } from "./chunk-TU6UVATU.js";
5
5
  import {
6
6
  codebaseIndexDirOverride
7
- } from "./chunk-54SIRJ6D.js";
7
+ } from "./chunk-C4DSQBTT.js";
8
8
  import {
9
9
  isBinaryBuffer,
10
10
  safeResolveReal,
11
11
  sha256hex
12
- } from "./chunk-HKR56VNF.js";
12
+ } from "./chunk-2IAEJRLT.js";
13
13
 
14
14
  // src/read.ts
15
15
  import * as fs from "node:fs/promises";
@@ -340,4 +340,4 @@ ${interesting.join("\n")}` : "symbols/imports: (none detected)"
340
340
  export {
341
341
  readTool
342
342
  };
343
- //# sourceMappingURL=chunk-K7Y2IWEB.js.map
343
+ //# sourceMappingURL=chunk-HIRVCXLP.js.map
@@ -8,7 +8,7 @@ import {
8
8
  assertRealInsideRoot,
9
9
  makeRootRelativizer,
10
10
  safeResolveReal
11
- } from "./chunk-HKR56VNF.js";
11
+ } from "./chunk-2IAEJRLT.js";
12
12
 
13
13
  // src/glob.ts
14
14
  import * as fs from "node:fs/promises";
@@ -71,6 +71,36 @@ var globTool = {
71
71
  const results = [];
72
72
  const visitedRealDirs = /* @__PURE__ */ new Set();
73
73
  let truncated = false;
74
+ const siftUp = (start) => {
75
+ let i = start;
76
+ while (i > 0) {
77
+ const parent = i - 1 >> 1;
78
+ if (results[parent].mtime <= results[i].mtime) return;
79
+ const tmp = results[i];
80
+ results[i] = results[parent];
81
+ results[parent] = tmp;
82
+ i = parent;
83
+ }
84
+ };
85
+ const siftDown = (start) => {
86
+ let i = start;
87
+ for (; ; ) {
88
+ const left = i * 2 + 1;
89
+ const right = left + 1;
90
+ let smallest = i;
91
+ if (left < results.length && results[left].mtime < results[smallest].mtime) {
92
+ smallest = left;
93
+ }
94
+ if (right < results.length && results[right].mtime < results[smallest].mtime) {
95
+ smallest = right;
96
+ }
97
+ if (smallest === i) return;
98
+ const tmp = results[i];
99
+ results[i] = results[smallest];
100
+ results[smallest] = tmp;
101
+ i = smallest;
102
+ }
103
+ };
74
104
  const pushResult = async (full) => {
75
105
  if (signal?.aborted) {
76
106
  truncated = true;
@@ -82,18 +112,16 @@ var globTool = {
82
112
  truncated = true;
83
113
  return;
84
114
  }
115
+ const entry = { rel: full, mtime: st.mtimeMs };
85
116
  if (results.length < limit) {
86
- results.push({ rel: full, mtime: st.mtimeMs });
117
+ results.push(entry);
118
+ siftUp(results.length - 1);
87
119
  return;
88
120
  }
89
121
  truncated = true;
90
- let oldestIndex = 0;
91
- for (let i = 1; i < results.length; i++) {
92
- if (results[i].mtime < results[oldestIndex].mtime) oldestIndex = i;
93
- }
94
- if (st.mtimeMs > results[oldestIndex].mtime) {
95
- results[oldestIndex] = { rel: full, mtime: st.mtimeMs };
96
- }
122
+ if (st.mtimeMs <= results[0].mtime) return;
123
+ results[0] = entry;
124
+ siftDown(0);
97
125
  } catch {
98
126
  }
99
127
  };
@@ -160,4 +188,4 @@ var globTool = {
160
188
  export {
161
189
  globTool
162
190
  };
163
- //# sourceMappingURL=chunk-IMIHTHF7.js.map
191
+ //# sourceMappingURL=chunk-HOFVYIPI.js.map
@@ -15,7 +15,7 @@ import {
15
15
  outgoingCallsService,
16
16
  runStartupIndex,
17
17
  searchCodebaseIndex
18
- } from "./chunk-DOHU3XHS.js";
18
+ } from "./chunk-TU6UVATU.js";
19
19
  import {
20
20
  IndexTimeoutError,
21
21
  SCHEMA_VERSION,
@@ -26,7 +26,7 @@ import {
26
26
  posixIndexPath,
27
27
  resolveIndexDir,
28
28
  xxhash64String
29
- } from "./chunk-54SIRJ6D.js";
29
+ } from "./chunk-C4DSQBTT.js";
30
30
  import {
31
31
  EXT_TO_LANG,
32
32
  detectLang,
@@ -38,7 +38,7 @@ import {
38
38
  import {
39
39
  normalizeCommandOutput,
40
40
  safeResolveProjectPath
41
- } from "./chunk-HKR56VNF.js";
41
+ } from "./chunk-2IAEJRLT.js";
42
42
 
43
43
  // src/codebase-index/ast-invariant-engine.ts
44
44
  var tsModule = null;
@@ -4047,4 +4047,4 @@ export {
4047
4047
  embedFiles,
4048
4048
  embedProjectFiles
4049
4049
  };
4050
- //# sourceMappingURL=chunk-CYPYJIAF.js.map
4050
+ //# sourceMappingURL=chunk-JB5JLY7V.js.map
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  tryLegacyCodeOperation
3
- } from "./chunk-JQ43NVFU.js";
3
+ } from "./chunk-3LQJXJDM.js";
4
4
  import {
5
5
  spawnStream
6
6
  } from "./chunk-EMA2XENR.js";
7
7
  import {
8
8
  normalizeCommandOutput,
9
9
  safeResolveReal
10
- } from "./chunk-HKR56VNF.js";
10
+ } from "./chunk-2IAEJRLT.js";
11
11
 
12
12
  // src/test.ts
13
13
  import * as path from "node:path";
@@ -231,4 +231,4 @@ ${result.stderr}` : result.stdout || result.stderr || result.error || "";
231
231
  export {
232
232
  testTool
233
233
  };
234
- //# sourceMappingURL=chunk-S6E2AM4U.js.map
234
+ //# sourceMappingURL=chunk-KF7GMVNU.js.map
@@ -6,13 +6,13 @@ import {
6
6
  } from "./chunk-ZBMANLYH.js";
7
7
  import {
8
8
  enqueueReindex
9
- } from "./chunk-DOHU3XHS.js";
9
+ } from "./chunk-TU6UVATU.js";
10
10
  import {
11
11
  isBinaryBuffer,
12
12
  safeResolveReal,
13
13
  sha256hex,
14
14
  truncateDiffPayload
15
- } from "./chunk-HKR56VNF.js";
15
+ } from "./chunk-2IAEJRLT.js";
16
16
 
17
17
  // src/replace.ts
18
18
  import { spawn } from "node:child_process";
@@ -413,4 +413,4 @@ export {
413
413
  replaceTool,
414
414
  __resetRgDetectionForTests
415
415
  };
416
- //# sourceMappingURL=chunk-IOOFLBVM.js.map
416
+ //# sourceMappingURL=chunk-KMXPP32M.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  parseGeneric
3
- } from "./chunk-6IEBD27U.js";
3
+ } from "./chunk-SKRMUHTU.js";
4
4
  import {
5
5
  parseParserOutput,
6
6
  recordParserSubprocess,
@@ -384,4 +384,4 @@ export {
384
384
  parseSymbols,
385
385
  resolvePythonBinary
386
386
  };
387
- //# sourceMappingURL=chunk-REWOZIA4.js.map
387
+ //# sourceMappingURL=chunk-M2W36JT7.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  builtinToolsPack
3
- } from "./chunk-6ZRP5IKQ.js";
3
+ } from "./chunk-YUK3WLHJ.js";
4
4
  import {
5
5
  TIER1_TOOLS,
6
6
  TIER2_TOOLS
7
- } from "./chunk-OVFQC6FU.js";
7
+ } from "./chunk-GNLHBDFO.js";
8
8
 
9
9
  // src/tool-tier.ts
10
10
  function toolNameSet(tools) {
@@ -54,4 +54,4 @@ export {
54
54
  selectBuiltinToolsForTier,
55
55
  registerBuiltinToolTier
56
56
  };
57
- //# sourceMappingURL=chunk-FRIUJ534.js.map
57
+ //# sourceMappingURL=chunk-MF6ZUBI7.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-ZBMANLYH.js";
4
4
  import {
5
5
  safeResolveReal
6
- } from "./chunk-HKR56VNF.js";
6
+ } from "./chunk-2IAEJRLT.js";
7
7
 
8
8
  // src/diff.ts
9
9
  import { spawn } from "node:child_process";
@@ -302,4 +302,4 @@ ${parts.join("\n")}`;
302
302
  export {
303
303
  diffTool
304
304
  };
305
- //# sourceMappingURL=chunk-BU6VUXWG.js.map
305
+ //# sourceMappingURL=chunk-N3OTTQNC.js.map
@@ -11,7 +11,7 @@ import {
11
11
  detectPackageManager,
12
12
  normalizeCommandOutput,
13
13
  safeResolveReal
14
- } from "./chunk-HKR56VNF.js";
14
+ } from "./chunk-2IAEJRLT.js";
15
15
 
16
16
  // src/outdated.ts
17
17
  import { spawn } from "node:child_process";
@@ -66,7 +66,7 @@ var outdatedTool = {
66
66
  const manager = await detectPackageManager(cwd, ctx.projectRoot);
67
67
  if (manager === "npm") {
68
68
  try {
69
- const { detectNonJsEcosystem } = await import("./legacy-bridge-XM2GV665.js");
69
+ const { detectNonJsEcosystem } = await import("./legacy-bridge-4T4OTSQP.js");
70
70
  const nonJs = await detectNonJsEcosystem(cwd, ctx.projectRoot);
71
71
  if (nonJs) {
72
72
  const { planLanguageOperation, executePackagePlan } = await import("./languages/index.js");
@@ -282,4 +282,4 @@ Note: exit code 1 from \`outdated\` means outdated packages were found (expected
282
282
  export {
283
283
  outdatedTool
284
284
  };
285
- //# sourceMappingURL=chunk-YJQQ5F5J.js.map
285
+ //# sourceMappingURL=chunk-NL45OWEO.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  todoTool
3
- } from "./chunk-TGVQMKVH.js";
3
+ } from "./chunk-S6CGSFLX.js";
4
4
  import {
5
5
  projectSessionPlanToKanban
6
- } from "./chunk-5BKQVP56.js";
6
+ } from "./chunk-YZECCW3F.js";
7
7
 
8
8
  // src/plan.ts
9
9
  import { randomUUID } from "node:crypto";
@@ -414,4 +414,4 @@ function mkResult(plan, ok, message, todos) {
414
414
  export {
415
415
  planTool
416
416
  };
417
- //# sourceMappingURL=chunk-NKOTOW6X.js.map
417
+ //# sourceMappingURL=chunk-O6AGFJBO.js.map
@@ -20,7 +20,7 @@ import {
20
20
  COMMAND_OUTPUT_MAX_BYTES,
21
21
  normalizeCommandOutput,
22
22
  safeResolveReal
23
- } from "./chunk-HKR56VNF.js";
23
+ } from "./chunk-2IAEJRLT.js";
24
24
 
25
25
  // src/exec.ts
26
26
  import { spawn } from "node:child_process";
@@ -74,9 +74,18 @@ var RULES = [
74
74
  }
75
75
  const letters = flagLetters(args);
76
76
  if (letters.has("r") && letters.has("f")) return true;
77
- const has = (flag) => args.some((a) => a.toLowerCase() === `/${flag}`);
78
- if (cmd === "rmdir" || cmd === "rd") return has("s") && has("q");
79
- if (cmd === "del" || cmd === "erase") return has("s");
77
+ const cmdFlags = /* @__PURE__ */ new Set();
78
+ for (const a of args) {
79
+ if (/^(?:\/[a-zA-Z])+$/.test(a)) {
80
+ for (const ch of a.toLowerCase()) {
81
+ if (ch >= "a" && ch <= "z") cmdFlags.add(ch);
82
+ }
83
+ } else if (/^\/[sqfpa]+$/i.test(a)) {
84
+ for (const ch of a.toLowerCase().slice(1)) cmdFlags.add(ch);
85
+ }
86
+ }
87
+ if (cmd === "rmdir" || cmd === "rd") return cmdFlags.has("s") && cmdFlags.has("q");
88
+ if (cmd === "del" || cmd === "erase") return cmdFlags.has("s");
80
89
  return false;
81
90
  },
82
91
  reason: "recursive force-delete"
@@ -263,8 +272,10 @@ var RULES = [
263
272
  if (cmd !== "git") return false;
264
273
  const cleanIdx = args.indexOf("clean");
265
274
  if (cleanIdx < 0) return false;
266
- return args.slice(cleanIdx + 1).some(
267
- (a) => a === "-f" || a === "--force" || a.startsWith("-f") || a.startsWith("--force=")
275
+ const after = args.slice(cleanIdx + 1);
276
+ if (after.some((a) => a === "--dry-run" || /^-[a-z]*n[a-z]*$/i.test(a))) return false;
277
+ return after.some(
278
+ (a) => a === "--force" || a.startsWith("--force=") || /^-[a-z]+$/i.test(a) && a.toLowerCase().includes("f")
268
279
  );
269
280
  },
270
281
  reason: "git clean -f (deletes untracked files)"
@@ -1835,4 +1846,4 @@ export {
1835
1846
  getExecAllowlist,
1836
1847
  execTool
1837
1848
  };
1838
- //# sourceMappingURL=chunk-YILT3CSO.js.map
1849
+ //# sourceMappingURL=chunk-OGQMPX3J.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  tryLegacyCodeOperation
3
- } from "./chunk-JQ43NVFU.js";
3
+ } from "./chunk-3LQJXJDM.js";
4
4
  import {
5
5
  spawnStream
6
6
  } from "./chunk-EMA2XENR.js";
@@ -8,7 +8,7 @@ import {
8
8
  ensureInsideRoot,
9
9
  normalizeCommandOutput,
10
10
  safeResolveReal
11
- } from "./chunk-HKR56VNF.js";
11
+ } from "./chunk-2IAEJRLT.js";
12
12
 
13
13
  // src/format.ts
14
14
  import * as path from "node:path";
@@ -251,4 +251,4 @@ export {
251
251
  parseFormatterCounts,
252
252
  detectFixer
253
253
  };
254
- //# sourceMappingURL=chunk-OBVXDVLE.js.map
254
+ //# sourceMappingURL=chunk-QJARSK2G.js.map
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  tryLegacyCodeOperation
3
- } from "./chunk-JQ43NVFU.js";
3
+ } from "./chunk-3LQJXJDM.js";
4
4
  import {
5
5
  spawnStream
6
6
  } from "./chunk-EMA2XENR.js";
7
7
  import {
8
8
  normalizeCommandOutput,
9
9
  safeResolveReal
10
- } from "./chunk-HKR56VNF.js";
10
+ } from "./chunk-2IAEJRLT.js";
11
11
 
12
12
  // src/lint.ts
13
13
  import { ToolValidationError } from "@wrongstack/core/types";
@@ -189,4 +189,4 @@ async function detectLinter(cwd) {
189
189
  export {
190
190
  lintTool
191
191
  };
192
- //# sourceMappingURL=chunk-R36RWYXE.js.map
192
+ //# sourceMappingURL=chunk-R3HIZVFS.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  kanbanTool
3
- } from "./chunk-5UA4TNJJ.js";
3
+ } from "./chunk-2NTHMZV3.js";
4
4
  import {
5
5
  applyManagedKanbanBoardToTodos,
6
6
  blockingTitles,
7
7
  mirrorSessionTodosToKanban,
8
8
  takeSessionMirrorFailure
9
- } from "./chunk-5BKQVP56.js";
9
+ } from "./chunk-YZECCW3F.js";
10
10
 
11
11
  // src/todo.ts
12
12
  import {
@@ -487,4 +487,4 @@ var todoTool = {
487
487
  export {
488
488
  todoTool
489
489
  };
490
- //# sourceMappingURL=chunk-TGVQMKVH.js.map
490
+ //# sourceMappingURL=chunk-S6CGSFLX.js.map
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  normalizeCommandOutput,
6
6
  safeResolveReal
7
- } from "./chunk-HKR56VNF.js";
7
+ } from "./chunk-2IAEJRLT.js";
8
8
 
9
9
  // src/languages/detect.ts
10
10
  import { createHash } from "node:crypto";
@@ -3515,4 +3515,4 @@ export {
3515
3515
  languagePackageTool,
3516
3516
  languageInfoTool
3517
3517
  };
3518
- //# sourceMappingURL=chunk-JK5WXW4S.js.map
3518
+ //# sourceMappingURL=chunk-SEONDNLN.js.map
@@ -262,7 +262,7 @@ function lineColAt(offsets, index) {
262
262
  else high = mid;
263
263
  }
264
264
  const lastNl = low > 0 ? offsets[low - 1] : -1;
265
- return { line: low + 1, col: index - lastNl };
265
+ return { line: low + 1, col: index - lastNl - 1 };
266
266
  }
267
267
  var GENERIC_MAX_SYMBOLS_DEFAULT = 500;
268
268
  var GENERIC_MAX_FILE_CHARS = 128 * 1024;
@@ -329,4 +329,4 @@ export {
329
329
  parseGeneric,
330
330
  parseSymbols
331
331
  };
332
- //# sourceMappingURL=chunk-6IEBD27U.js.map
332
+ //# sourceMappingURL=chunk-SKRMUHTU.js.map
@@ -13,7 +13,7 @@ import {
13
13
  projectIndexServerMetadataPath,
14
14
  projectIndexServerStderrPath,
15
15
  readProjectIndexServerStderrTail
16
- } from "./chunk-WBAPU3AB.js";
16
+ } from "./chunk-ZOUG3KKS.js";
17
17
  import {
18
18
  CircuitOpenError,
19
19
  IndexTimeoutError,
@@ -28,7 +28,7 @@ import {
28
28
  searchService,
29
29
  statsService,
30
30
  symbolGraphService
31
- } from "./chunk-54SIRJ6D.js";
31
+ } from "./chunk-C4DSQBTT.js";
32
32
  import {
33
33
  recordIpcPending
34
34
  } from "./chunk-ZKC5UNGD.js";
@@ -1352,4 +1352,4 @@ export {
1352
1352
  checkCodebaseIndexServerHealth,
1353
1353
  ensureCodebaseIndexServer
1354
1354
  };
1355
- //# sourceMappingURL=chunk-DOHU3XHS.js.map
1355
+ //# sourceMappingURL=chunk-TU6UVATU.js.map
@@ -3,12 +3,12 @@ import {
3
3
  } from "./chunk-MSOAX3GC.js";
4
4
  import {
5
5
  enqueueReindex
6
- } from "./chunk-DOHU3XHS.js";
6
+ } from "./chunk-TU6UVATU.js";
7
7
  import {
8
8
  safeResolveReal,
9
9
  sha256hex,
10
10
  truncateDiffPayload
11
- } from "./chunk-HKR56VNF.js";
11
+ } from "./chunk-2IAEJRLT.js";
12
12
 
13
13
  // src/edit.ts
14
14
  import * as fs from "node:fs/promises";
@@ -518,4 +518,4 @@ Compare this against your old_string and retry with the file's actual text.` : "
518
518
  export {
519
519
  editTool
520
520
  };
521
- //# sourceMappingURL=chunk-G35NLPG5.js.map
521
+ //# sourceMappingURL=chunk-WKLUOXR4.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  builtinTools
3
- } from "./chunk-OVFQC6FU.js";
3
+ } from "./chunk-GNLHBDFO.js";
4
4
 
5
5
  // src/pack.ts
6
6
  var builtinToolsPack = {
@@ -12,4 +12,4 @@ var builtinToolsPack = {
12
12
  export {
13
13
  builtinToolsPack
14
14
  };
15
- //# sourceMappingURL=chunk-6ZRP5IKQ.js.map
15
+ //# sourceMappingURL=chunk-YUK3WLHJ.js.map
@@ -611,7 +611,7 @@ function queueLatestMirror(projectRoot, sessionId, graph, sourceSystem) {
611
611
  });
612
612
  if (activeMirrors.has(key)) return;
613
613
  activeMirrors.add(key);
614
- void (async () => {
614
+ const pump = (async () => {
615
615
  try {
616
616
  for (; ; ) {
617
617
  const pending = pendingMirrors.get(key);
@@ -666,6 +666,7 @@ function queueLatestMirror(projectRoot, sessionId, graph, sourceSystem) {
666
666
  }
667
667
  }
668
668
  })();
669
+ trackBackgroundWork(pump);
669
670
  }
670
671
  function takeSessionMirrorFailure(projectRoot, sessionId) {
671
672
  if (!projectRoot || !sessionId) return void 0;
@@ -704,20 +705,38 @@ function projectSessionPlanToKanban(projectRoot, items, sessionId) {
704
705
  "session-plan"
705
706
  );
706
707
  }
707
- function fireAndForget(context, work) {
708
- void work.catch((err) => {
709
- const message = err instanceof Error ? err.message : String(err);
710
- console.warn(
711
- JSON.stringify({
712
- level: "warn",
713
- event: "session-kanban",
714
- context,
715
- message,
716
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
717
- })
718
- );
708
+ var backgroundWork = /* @__PURE__ */ new Set();
709
+ function trackBackgroundWork(work) {
710
+ const tracked = work.then(
711
+ () => void 0,
712
+ () => void 0
713
+ );
714
+ backgroundWork.add(tracked);
715
+ void tracked.then(() => {
716
+ backgroundWork.delete(tracked);
719
717
  });
720
718
  }
719
+ async function settleSessionKanbanBackgroundWork(maxPasses = 25) {
720
+ for (let pass = 0; pass < maxPasses && backgroundWork.size > 0; pass += 1) {
721
+ await Promise.all([...backgroundWork]);
722
+ }
723
+ }
724
+ function fireAndForget(context, work) {
725
+ trackBackgroundWork(
726
+ work.catch((err) => {
727
+ const message = err instanceof Error ? err.message : String(err);
728
+ console.warn(
729
+ JSON.stringify({
730
+ level: "warn",
731
+ event: "session-kanban",
732
+ context,
733
+ message,
734
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
735
+ })
736
+ );
737
+ })
738
+ );
739
+ }
721
740
  function mirrorSessionTodosToKanban(projectRoot, todos, sessionId) {
722
741
  queueLatestMirror(
723
742
  projectRoot,
@@ -1003,6 +1022,7 @@ export {
1003
1022
  projectSessionTodosToKanban,
1004
1023
  projectSessionTasksToKanban,
1005
1024
  projectSessionPlanToKanban,
1025
+ settleSessionKanbanBackgroundWork,
1006
1026
  mirrorSessionTodosToKanban,
1007
1027
  mirrorSessionTasksToKanban,
1008
1028
  mirrorSessionPlanToKanban,
@@ -1014,4 +1034,4 @@ export {
1014
1034
  applyManagedKanbanBoardToTodos2 as applyManagedKanbanBoardToTodos,
1015
1035
  applySessionKanbanTaskToSource2 as applySessionKanbanTaskToSource
1016
1036
  };
1017
- //# sourceMappingURL=chunk-5BKQVP56.js.map
1037
+ //# sourceMappingURL=chunk-YZECCW3F.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  safeResolveReal
3
- } from "./chunk-HKR56VNF.js";
3
+ } from "./chunk-2IAEJRLT.js";
4
4
 
5
5
  // src/tree.ts
6
6
  import * as fs from "node:fs/promises";
@@ -248,4 +248,4 @@ export {
248
248
  MAX_TREE_OUTPUT_BYTES,
249
249
  treeTool
250
250
  };
251
- //# sourceMappingURL=chunk-3F7HQ3KS.js.map
251
+ //# sourceMappingURL=chunk-YZQSUL5G.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  COMMAND_OUTPUT_MAX_BYTES,
3
3
  normalizeCommandOutput
4
- } from "./chunk-HKR56VNF.js";
4
+ } from "./chunk-2IAEJRLT.js";
5
5
 
6
6
  // src/git.ts
7
7
  import { spawn } from "node:child_process";
@@ -373,4 +373,4 @@ function runGit(args, cwd, signal) {
373
373
  export {
374
374
  gitTool
375
375
  };
376
- //# sourceMappingURL=chunk-2IC5FRD7.js.map
376
+ //# sourceMappingURL=chunk-ZMCV3XOV.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveIndexDir
3
- } from "./chunk-54SIRJ6D.js";
3
+ } from "./chunk-C4DSQBTT.js";
4
4
 
5
5
  // src/codebase-index/project-server-endpoint.ts
6
6
  import { createHash } from "node:crypto";
@@ -158,4 +158,4 @@ export {
158
158
  PROJECT_INDEX_SERVER_MAX_FRAME_CHARS,
159
159
  encodeProjectServerMessage
160
160
  };
161
- //# sourceMappingURL=chunk-WBAPU3AB.js.map
161
+ //# sourceMappingURL=chunk-ZOUG3KKS.js.map