@wrongstack/tools 1.0.3 → 1.0.4

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 (107) hide show
  1. package/README.md +0 -6
  2. package/dist/_util.d.ts +18 -0
  3. package/dist/audit.js +4 -4
  4. package/dist/bash.js +2 -2
  5. package/dist/browser/index.d.ts +1 -1
  6. package/dist/browser/index.js +9 -1
  7. package/dist/browser/tools.d.ts +14 -0
  8. package/dist/builtin.d.ts +16 -13
  9. package/dist/builtin.js +40 -44
  10. package/dist/{chunk-6LCKF5KH.js → chunk-24Q4O34E.js} +1 -1
  11. package/dist/{chunk-AQ5YBURX.js → chunk-2IC5FRD7.js} +2 -2
  12. package/dist/{chunk-4ERMPDHV.js → chunk-2QY3DC3H.js} +20 -16
  13. package/dist/{chunk-VU3QBYL4.js → chunk-2ZWQIVEW.js} +2 -2
  14. package/dist/{chunk-JDOO4P6Z.js → chunk-3F7HQ3KS.js} +2 -2
  15. package/dist/{chunk-DX5KZEMK.js → chunk-47GYABZW.js} +2 -2
  16. package/dist/{chunk-KYVOTHG7.js → chunk-4KI4HHID.js} +2 -2
  17. package/dist/{chunk-X6KXNHUO.js → chunk-5BKQVP56.js} +22 -5
  18. package/dist/{chunk-SMARDKAC.js → chunk-5UA4TNJJ.js} +2 -2
  19. package/dist/{chunk-SOR7OCYP.js → chunk-6XYFYLN7.js} +23 -1
  20. package/dist/{chunk-QU2VRCMM.js → chunk-A636Z2TG.js} +3 -3
  21. package/dist/{chunk-3JVSOBHU.js → chunk-AX5ZG5O5.js} +3 -3
  22. package/dist/{chunk-7HL23T3T.js → chunk-BU6VUXWG.js} +2 -2
  23. package/dist/{chunk-KIQTABBJ.js → chunk-C64UUXTA.js} +3 -3
  24. package/dist/{chunk-IRUEHGCR.js → chunk-D4HWMWGE.js} +3 -3
  25. package/dist/{chunk-E2ZD4ERD.js → chunk-EMCIC2JA.js} +3 -3
  26. package/dist/{chunk-ASEXQRA7.js → chunk-FEXPWYU7.js} +7 -5
  27. package/dist/{chunk-ZUFHAHTE.js → chunk-HKR56VNF.js} +15 -2
  28. package/dist/{chunk-3LS3FYEF.js → chunk-JK5WXW4S.js} +2 -2
  29. package/dist/{chunk-GU7QJ37F.js → chunk-JQ43NVFU.js} +2 -2
  30. package/dist/{chunk-AMURQAJX.js → chunk-KVEL4EFI.js} +3 -3
  31. package/dist/{chunk-VZGPASGD.js → chunk-MG7CUN6R.js} +2 -2
  32. package/dist/{chunk-32XPUSY3.js → chunk-NERS6GBT.js} +3 -3
  33. package/dist/{chunk-NOCU555K.js → chunk-NKOTOW6X.js} +3 -3
  34. package/dist/{chunk-YDTRKEYY.js → chunk-OBVXDVLE.js} +3 -3
  35. package/dist/{chunk-PNLDTRC5.js → chunk-OSXM3O3J.js} +6 -6
  36. package/dist/{chunk-VKAJMHVG.js → chunk-OZVGRDCM.js} +3 -3
  37. package/dist/{chunk-CVNCSMVU.js → chunk-PVQBD3TA.js} +46 -6
  38. package/dist/{chunk-FC3X7GGJ.js → chunk-R36RWYXE.js} +3 -3
  39. package/dist/{chunk-Z34CUZCZ.js → chunk-S6E2AM4U.js} +3 -3
  40. package/dist/{chunk-TYRVYBHW.js → chunk-T34DVSAE.js} +235 -176
  41. package/dist/{chunk-4YKVHCQC.js → chunk-TGVQMKVH.js} +3 -3
  42. package/dist/{chunk-6ZLRRC74.js → chunk-VQDSIHAR.js} +40 -2
  43. package/dist/{chunk-YECHJJJF.js → chunk-VSOVZ5JI.js} +4 -4
  44. package/dist/{chunk-RV7BVTDG.js → chunk-WKXL5XHU.js} +2 -2
  45. package/dist/{chunk-77MBK46T.js → chunk-WWAXJKX3.js} +3 -3
  46. package/dist/{chunk-24T5XIJU.js → chunk-YA2ZYCJY.js} +4 -4
  47. package/dist/{chunk-T7YVY2BV.js → chunk-YILT3CSO.js} +2 -2
  48. package/dist/{chunk-OUEH4I4X.js → chunk-YJQQ5F5J.js} +3 -3
  49. package/dist/{chunk-VO6M2FVG.js → chunk-YZLOYJGN.js} +2 -2
  50. package/dist/{chunk-MIV2RU5B.js → chunk-ZETZHHV5.js} +3 -3
  51. package/dist/clarify.d.ts +18 -3
  52. package/dist/codebase-index/codebase-search-tool.d.ts +2 -3
  53. package/dist/codebase-index/index.js +6 -6
  54. package/dist/codebase-index/parser-worker-script.js +1 -1
  55. package/dist/codebase-index/project-server-endpoint.d.ts +33 -0
  56. package/dist/codebase-index/project-server.js +3 -3
  57. package/dist/codebase-index/worker.js +2 -2
  58. package/dist/diff.js +2 -2
  59. package/dist/e2e.js +2 -2
  60. package/dist/edit.js +6 -6
  61. package/dist/exec.js +2 -2
  62. package/dist/fetch.js +2 -2
  63. package/dist/format.js +4 -4
  64. package/dist/git.js +2 -2
  65. package/dist/glob.js +2 -2
  66. package/dist/grep.js +2 -2
  67. package/dist/index.d.ts +2 -8
  68. package/dist/index.js +65 -81
  69. package/dist/install.js +4 -4
  70. package/dist/json.js +2 -2
  71. package/dist/kanban.js +2 -2
  72. package/dist/languages/index.js +2 -2
  73. package/dist/{legacy-bridge-WVQ4BHDI.js → legacy-bridge-XM2GV665.js} +4 -4
  74. package/dist/lint.js +4 -4
  75. package/dist/logs.js +2 -2
  76. package/dist/outdated.js +2 -2
  77. package/dist/pack.js +41 -45
  78. package/dist/{parser-dispatch-UQAB4E6V.js → parser-dispatch-IF75EZFB.js} +2 -2
  79. package/dist/patch.js +6 -6
  80. package/dist/plan.js +4 -4
  81. package/dist/read-url-content.d.ts +17 -0
  82. package/dist/read.js +6 -6
  83. package/dist/replace.js +6 -6
  84. package/dist/session-kanban.js +1 -1
  85. package/dist/task.js +4 -4
  86. package/dist/test.js +4 -4
  87. package/dist/todo.js +3 -3
  88. package/dist/tool-search.js +1 -1
  89. package/dist/tool-tier.d.ts +12 -2
  90. package/dist/tool-tier.js +42 -46
  91. package/dist/tree.js +2 -2
  92. package/dist/typecheck.js +4 -4
  93. package/dist/write.js +6 -6
  94. package/package.json +5 -21
  95. package/dist/batch-tool-use.d.ts +0 -24
  96. package/dist/batch-tool-use.js +0 -7
  97. package/dist/chunk-7ODZTPCU.js +0 -128
  98. package/dist/chunk-CHEK3ASV.js +0 -183
  99. package/dist/chunk-KLJZ4WV4.js +0 -213
  100. package/dist/chunk-VBF2YXUW.js +0 -203
  101. package/dist/document.d.ts +0 -25
  102. package/dist/document.js +0 -8
  103. package/dist/scaffold.d.ts +0 -23
  104. package/dist/scaffold.js +0 -10
  105. package/dist/set-working-dir.d.ts +0 -17
  106. package/dist/tool-help.d.ts +0 -21
  107. package/dist/tool-help.js +0 -7
@@ -3,12 +3,12 @@ import {
3
3
  } from "./chunk-MSOAX3GC.js";
4
4
  import {
5
5
  enqueueReindex
6
- } from "./chunk-CVNCSMVU.js";
6
+ } from "./chunk-PVQBD3TA.js";
7
7
  import {
8
8
  safeResolveReal,
9
9
  sha256hex,
10
10
  truncateDiffPayload
11
- } from "./chunk-ZUFHAHTE.js";
11
+ } from "./chunk-HKR56VNF.js";
12
12
 
13
13
  // src/write.ts
14
14
  import * as fs from "node:fs/promises";
@@ -179,4 +179,4 @@ async function finishWrite(input, ctx, prepared, signal) {
179
179
  export {
180
180
  writeTool
181
181
  };
182
- //# sourceMappingURL=chunk-QU2VRCMM.js.map
182
+ //# sourceMappingURL=chunk-A636Z2TG.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  parseFilesContent
3
- } from "./chunk-6LCKF5KH.js";
3
+ } from "./chunk-24Q4O34E.js";
4
4
  import {
5
5
  recordFilesystemRead
6
6
  } from "./chunk-ZKC5UNGD.js";
@@ -4993,7 +4993,7 @@ var ParserWorkerPool = class {
4993
4993
  */
4994
4994
  async reparseInline(batch, orphaned, workerId) {
4995
4995
  try {
4996
- const { parseFileContent } = await import("./parser-dispatch-UQAB4E6V.js");
4996
+ const { parseFileContent } = await import("./parser-dispatch-IF75EZFB.js");
4997
4997
  for (const item of orphaned) {
4998
4998
  if (batch.settled) return;
4999
4999
  try {
@@ -5856,4 +5856,4 @@ export {
5856
5856
  incomingCallsService,
5857
5857
  outgoingCallsService
5858
5858
  };
5859
- //# sourceMappingURL=chunk-3JVSOBHU.js.map
5859
+ //# sourceMappingURL=chunk-AX5ZG5O5.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-ZBMANLYH.js";
4
4
  import {
5
5
  safeResolveReal
6
- } from "./chunk-ZUFHAHTE.js";
6
+ } from "./chunk-HKR56VNF.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-7HL23T3T.js.map
305
+ //# sourceMappingURL=chunk-BU6VUXWG.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  tryLegacyPackageOperation
3
- } from "./chunk-GU7QJ37F.js";
3
+ } from "./chunk-JQ43NVFU.js";
4
4
  import {
5
5
  spawnStream
6
6
  } from "./chunk-EMA2XENR.js";
@@ -9,7 +9,7 @@ import {
9
9
  detectPackageManager,
10
10
  normalizeCommandOutput,
11
11
  safeResolveReal
12
- } from "./chunk-ZUFHAHTE.js";
12
+ } from "./chunk-HKR56VNF.js";
13
13
 
14
14
  // src/audit.ts
15
15
  import { ToolValidationError } from "@wrongstack/core/types";
@@ -220,4 +220,4 @@ function extractAdvisories(data) {
220
220
  export {
221
221
  auditTool
222
222
  };
223
- //# sourceMappingURL=chunk-KIQTABBJ.js.map
223
+ //# sourceMappingURL=chunk-C64UUXTA.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  tryLegacyCodeOperation
3
- } from "./chunk-GU7QJ37F.js";
3
+ } from "./chunk-JQ43NVFU.js";
4
4
  import {
5
5
  spawnStream
6
6
  } from "./chunk-EMA2XENR.js";
@@ -8,7 +8,7 @@ import {
8
8
  detectPackageManager,
9
9
  normalizeCommandOutput,
10
10
  safeResolveReal
11
- } from "./chunk-ZUFHAHTE.js";
11
+ } from "./chunk-HKR56VNF.js";
12
12
 
13
13
  // src/typecheck.ts
14
14
  import * as path from "node:path";
@@ -162,4 +162,4 @@ async function findTsConfig(cwd) {
162
162
  export {
163
163
  typecheckTool
164
164
  };
165
- //# sourceMappingURL=chunk-IRUEHGCR.js.map
165
+ //# sourceMappingURL=chunk-D4HWMWGE.js.map
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  enqueueReindex
3
- } from "./chunk-CVNCSMVU.js";
3
+ } from "./chunk-PVQBD3TA.js";
4
4
  import {
5
5
  resolveRealInsideRoot,
6
6
  safeResolveReal,
7
7
  sha256hex
8
- } from "./chunk-ZUFHAHTE.js";
8
+ } from "./chunk-HKR56VNF.js";
9
9
 
10
10
  // src/patch.ts
11
11
  import { spawn } from "node:child_process";
@@ -395,4 +395,4 @@ function extractPatchedFiles(output) {
395
395
  export {
396
396
  patchTool
397
397
  };
398
- //# sourceMappingURL=chunk-E2ZD4ERD.js.map
398
+ //# sourceMappingURL=chunk-EMCIC2JA.js.map
@@ -6,21 +6,22 @@ import {
6
6
  } from "./chunk-2CTZW6JQ.js";
7
7
  import {
8
8
  assertRealInsideRoot,
9
+ makeRootRelativizer,
9
10
  safeResolveReal
10
- } from "./chunk-ZUFHAHTE.js";
11
+ } from "./chunk-HKR56VNF.js";
11
12
 
12
13
  // src/glob.ts
13
14
  import * as fs from "node:fs/promises";
14
15
  import * as path from "node:path";
15
- import { compileGlob, DEFAULT_WALK_IGNORE_DIRS } from "@wrongstack/core/utils";
16
16
  import { ToolValidationError } from "@wrongstack/core/types";
17
+ import { compileGlob, DEFAULT_WALK_IGNORE_DIRS } from "@wrongstack/core/utils";
17
18
  var DEFAULT_IGNORE = new Set(DEFAULT_WALK_IGNORE_DIRS);
18
19
  var WALK_CONCURRENCY = 16;
19
20
  var globTool = {
20
21
  name: "glob",
21
22
  category: "Filesystem",
22
23
  description: "Find files by path pattern. Results are sorted by modification time, newest first, so when the list is truncated at `limit` it is the oldest files that are dropped (recency-biased). Use index-backed `codebase-search` first for code symbols or concepts when it is live.",
23
- usageHint: "PATH DISCOVERY AND SEARCH SCOPING:\n\n- When `codebase-search` is live, use it first for code concepts; use `glob` for filenames, path patterns, and non-indexed files.\n- Combine with `path` and `limit`.\n- Default ignores common build/dependency directories.\nMuch more efficient than shell `find` for most use cases inside the agent.",
24
+ usageHint: "PATH DISCOVERY AND SEARCH SCOPING:\n\n- When `codebase-search` is live, use it first for code concepts; use `glob` for filenames, path patterns, and non-indexed files.\n- Combine with `path` and `limit`.\n- Default ignores common build/dependency directories.\n- Returned paths are relative to the project root.\nMuch more efficient than shell `find` for most use cases inside the agent.",
24
25
  selection: {
25
26
  doNotUseWhen: "you need to search inside file contents.",
26
27
  useInstead: ["grep"]
@@ -151,11 +152,12 @@ var globTool = {
151
152
  };
152
153
  await walk(base, "");
153
154
  results.sort((a, b) => b.mtime - a.mtime);
154
- return { files: results.map((r) => r.rel), truncated };
155
+ const relativize = makeRootRelativizer(ctx.cwd);
156
+ return { files: results.map((r) => relativize(r.rel)), truncated };
155
157
  }
156
158
  };
157
159
 
158
160
  export {
159
161
  globTool
160
162
  };
161
- //# sourceMappingURL=chunk-ASEXQRA7.js.map
163
+ //# sourceMappingURL=chunk-FEXPWYU7.js.map
@@ -216,6 +216,18 @@ function normalizeCommandOutput(raw, opts = {}) {
216
216
  text = text.replace(/\n{3,}/g, "\n\n");
217
217
  return truncateHeadTail(text, opts.maxBytes ?? COMMAND_OUTPUT_MAX_BYTES);
218
218
  }
219
+ function makeRootRelativizer(root) {
220
+ const resolved = path.resolve(root);
221
+ const prefix = resolved.endsWith(path.sep) ? resolved : resolved + path.sep;
222
+ const compare = process.platform === "win32" ? prefix.toLowerCase() : prefix;
223
+ return (absPath) => {
224
+ if (absPath.length <= prefix.length) return absPath;
225
+ const head = process.platform === "win32" ? absPath.slice(0, prefix.length).toLowerCase() : absPath.slice(0, prefix.length);
226
+ if (head !== compare) return absPath;
227
+ const rest = absPath.slice(prefix.length);
228
+ return rest.length > 0 ? rest : absPath;
229
+ };
230
+ }
219
231
 
220
232
  export {
221
233
  sha256hex,
@@ -229,6 +241,7 @@ export {
229
241
  truncateMiddle,
230
242
  isBinaryBuffer,
231
243
  COMMAND_OUTPUT_MAX_BYTES,
232
- normalizeCommandOutput
244
+ normalizeCommandOutput,
245
+ makeRootRelativizer
233
246
  };
234
- //# sourceMappingURL=chunk-ZUFHAHTE.js.map
247
+ //# sourceMappingURL=chunk-HKR56VNF.js.map
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  normalizeCommandOutput,
6
6
  safeResolveReal
7
- } from "./chunk-ZUFHAHTE.js";
7
+ } from "./chunk-HKR56VNF.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-3LS3FYEF.js.map
3518
+ //# sourceMappingURL=chunk-JK5WXW4S.js.map
@@ -2,7 +2,7 @@ import {
2
2
  executeLanguagePlan,
3
3
  executePackagePlan,
4
4
  planLanguageOperation
5
- } from "./chunk-3LS3FYEF.js";
5
+ } from "./chunk-JK5WXW4S.js";
6
6
 
7
7
  // src/languages/legacy-bridge.ts
8
8
  import * as fs from "node:fs/promises";
@@ -104,4 +104,4 @@ export {
104
104
  tryLegacyCodeOperation,
105
105
  tryLegacyPackageOperation
106
106
  };
107
- //# sourceMappingURL=chunk-GU7QJ37F.js.map
107
+ //# sourceMappingURL=chunk-JQ43NVFU.js.map
@@ -3,12 +3,12 @@ import {
3
3
  } from "./chunk-MSOAX3GC.js";
4
4
  import {
5
5
  enqueueReindex
6
- } from "./chunk-CVNCSMVU.js";
6
+ } from "./chunk-PVQBD3TA.js";
7
7
  import {
8
8
  safeResolveReal,
9
9
  sha256hex,
10
10
  truncateDiffPayload
11
- } from "./chunk-ZUFHAHTE.js";
11
+ } from "./chunk-HKR56VNF.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-AMURQAJX.js.map
521
+ //# sourceMappingURL=chunk-KVEL4EFI.js.map
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-YJTXRH5Y.js";
5
5
  import {
6
6
  safeResolveReal
7
- } from "./chunk-ZUFHAHTE.js";
7
+ } from "./chunk-HKR56VNF.js";
8
8
 
9
9
  // src/json.ts
10
10
  import * as fs from "node:fs/promises";
@@ -701,4 +701,4 @@ ${toYaml(v, indent + 1)}`;
701
701
  export {
702
702
  jsonTool
703
703
  };
704
- //# sourceMappingURL=chunk-VZGPASGD.js.map
704
+ //# sourceMappingURL=chunk-MG7CUN6R.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  builtinToolsPack
3
- } from "./chunk-VO6M2FVG.js";
3
+ } from "./chunk-YZLOYJGN.js";
4
4
  import {
5
5
  TIER1_TOOLS,
6
6
  TIER2_TOOLS
7
- } from "./chunk-TYRVYBHW.js";
7
+ } from "./chunk-T34DVSAE.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-32XPUSY3.js.map
57
+ //# sourceMappingURL=chunk-NERS6GBT.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  todoTool
3
- } from "./chunk-4YKVHCQC.js";
3
+ } from "./chunk-TGVQMKVH.js";
4
4
  import {
5
5
  projectSessionPlanToKanban
6
- } from "./chunk-X6KXNHUO.js";
6
+ } from "./chunk-5BKQVP56.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-NOCU555K.js.map
417
+ //# sourceMappingURL=chunk-NKOTOW6X.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  tryLegacyCodeOperation
3
- } from "./chunk-GU7QJ37F.js";
3
+ } from "./chunk-JQ43NVFU.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-ZUFHAHTE.js";
11
+ } from "./chunk-HKR56VNF.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-YDTRKEYY.js.map
254
+ //# sourceMappingURL=chunk-OBVXDVLE.js.map
@@ -15,7 +15,7 @@ import {
15
15
  outgoingCallsService,
16
16
  runStartupIndex,
17
17
  searchCodebaseIndex
18
- } from "./chunk-CVNCSMVU.js";
18
+ } from "./chunk-PVQBD3TA.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-3JVSOBHU.js";
29
+ } from "./chunk-AX5ZG5O5.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-ZUFHAHTE.js";
41
+ } from "./chunk-HKR56VNF.js";
42
42
 
43
43
  // src/codebase-index/ast-invariant-engine.ts
44
44
  var tsModule = null;
@@ -1026,7 +1026,7 @@ var codebaseSearchTool = {
1026
1026
  name: "codebase-search",
1027
1027
  category: "Project",
1028
1028
  icon: "index",
1029
- description: "Search code symbols using a fast SQLite+BM25 index, with optional LSP fallback. Prefer this before broad `tree`, `glob`, or `grep` exploration when finding code by name or concept. Use `grep` instead for exact text, regexes, unsupported content, or concrete usage sites. Set `preferLsp: true` for live precision when the LSP plugin is active (supersedes codebase-lsp-search).",
1029
+ description: "Search code symbols using a fast SQLite+BM25 index. Prefer this before broad `tree`, `glob`, or `grep` exploration when finding code by name or concept. Use `grep` instead for exact text, regexes, unsupported content, or concrete usage sites. When LSP tools are active, use `codebase-lsp-search` for live workspace-symbol results.",
1030
1030
  usageHint: "FIRST CHOICE FOR INDEXABLE CODE UNDERSTANDING:\n\n- Call before broad `tree`, `glob`, or `grep` exploration when locating symbols, concepts, definitions, or candidate modules.\n- `kind` filter is very useful (e.g. only functions or only interfaces).\n- Combine with `file` filter to scope to a specific directory or module.\n- If `indexStatus` reports no persisted data, run `codebase-index` and retry.",
1031
1031
  permission: "auto",
1032
1032
  mutating: false,
@@ -1088,7 +1088,7 @@ var codebaseSearchTool = {
1088
1088
  },
1089
1089
  preferLsp: {
1090
1090
  type: "boolean",
1091
- description: "Prefer live LSP results over the index. Ignored unless the LSP plugin is active; when it is active and this is true, results come from live workspaceSymbol queries."
1091
+ description: "Deprecated compatibility hint. This built-in remains index-only; use codebase-lsp-search for live LSP results."
1092
1092
  }
1093
1093
  },
1094
1094
  required: ["query"]
@@ -4047,4 +4047,4 @@ export {
4047
4047
  embedFiles,
4048
4048
  embedProjectFiles
4049
4049
  };
4050
- //# sourceMappingURL=chunk-PNLDTRC5.js.map
4050
+ //# sourceMappingURL=chunk-OSXM3O3J.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  todoTool
3
- } from "./chunk-4YKVHCQC.js";
3
+ } from "./chunk-TGVQMKVH.js";
4
4
  import {
5
5
  mirrorSessionTasksToKanban
6
- } from "./chunk-X6KXNHUO.js";
6
+ } from "./chunk-5BKQVP56.js";
7
7
 
8
8
  // src/task.ts
9
9
  import { randomUUID } from "node:crypto";
@@ -582,4 +582,4 @@ ${formatTaskList(file.tasks)}` : file.tasks.length > 0 ? formatTaskList(file.tas
582
582
  export {
583
583
  taskTool
584
584
  };
585
- //# sourceMappingURL=chunk-VKAJMHVG.js.map
585
+ //# sourceMappingURL=chunk-OZVGRDCM.js.map
@@ -2,14 +2,18 @@ import {
2
2
  MAX_BINARY_FRAME_BYTES,
3
3
  PROJECT_INDEX_SERVER_MAX_FRAME_CHARS,
4
4
  PROJECT_INDEX_SERVER_PROTOCOL_VERSION,
5
+ PROJECT_INDEX_SERVER_STDERR_MAX_BYTES,
5
6
  decodeBinaryFrame,
6
7
  encodeBinaryFrame,
7
8
  encodeProjectServerMessage,
9
+ formatProjectIndexServerCloseError,
8
10
  isBinaryFrame,
9
11
  projectIndexServerBuildId,
10
12
  projectIndexServerEndpoint,
11
- projectIndexServerMetadataPath
12
- } from "./chunk-6ZLRRC74.js";
13
+ projectIndexServerMetadataPath,
14
+ projectIndexServerStderrPath,
15
+ readProjectIndexServerStderrTail
16
+ } from "./chunk-VQDSIHAR.js";
13
17
  import {
14
18
  CircuitOpenError,
15
19
  IndexTimeoutError,
@@ -24,7 +28,7 @@ import {
24
28
  searchService,
25
29
  statsService,
26
30
  symbolGraphService
27
- } from "./chunk-3JVSOBHU.js";
31
+ } from "./chunk-AX5ZG5O5.js";
28
32
  import {
29
33
  recordIpcPending
30
34
  } from "./chunk-ZKC5UNGD.js";
@@ -158,6 +162,7 @@ function cancellationError(signal) {
158
162
  import { spawn } from "node:child_process";
159
163
  import * as fs2 from "node:fs";
160
164
  import * as net from "node:net";
165
+ import * as path from "node:path";
161
166
  import { fileURLToPath as fileURLToPath2 } from "node:url";
162
167
  var ProjectServerConnection = class {
163
168
  constructor(projectRoot, indexDir, endpoint) {
@@ -587,6 +592,21 @@ var ProjectServerConnection = class {
587
592
  if (message.ok) entry.resolve(message.result);
588
593
  else entry.reject(remoteError(message.error, message.errorName));
589
594
  }
595
+ /**
596
+ * Why the connection closed, as far as the daemon left evidence.
597
+ *
598
+ * A closed socket has two very different causes — an orderly shutdown, and
599
+ * the daemon dying — and they were reported identically. If the daemon
600
+ * wrote anything to stderr, that text is the difference between a failure
601
+ * someone can act on and one that reads as a flake.
602
+ */
603
+ closeReason() {
604
+ return formatProjectIndexServerCloseError(
605
+ readProjectIndexServerStderrTail(
606
+ projectIndexServerStderrPath(this.projectRoot, this.indexDir)
607
+ )
608
+ );
609
+ }
590
610
  onClose(socket) {
591
611
  if (socket !== this.socket) return;
592
612
  const wasConnected = this.info !== null;
@@ -594,7 +614,7 @@ var ProjectServerConnection = class {
594
614
  this.info = null;
595
615
  this.activity = null;
596
616
  this.health = null;
597
- const error = new Error("codebase-index server connection closed");
617
+ const error = new Error(this.closeReason());
598
618
  this.connectReject?.(error);
599
619
  this.connectResolve = null;
600
620
  this.connectReject = null;
@@ -651,12 +671,32 @@ var ProjectServerConnection = class {
651
671
  }
652
672
  const args = [fileURLToPath2(url), "--project-root", this.projectRoot];
653
673
  if (this.indexDir) args.push("--index-dir", this.indexDir);
674
+ let stderrTarget = "ignore";
675
+ try {
676
+ const logPath = projectIndexServerStderrPath(this.projectRoot, this.indexDir);
677
+ fs2.mkdirSync(path.dirname(logPath), { recursive: true });
678
+ try {
679
+ if (fs2.statSync(logPath).size > PROJECT_INDEX_SERVER_STDERR_MAX_BYTES) {
680
+ fs2.truncateSync(logPath, 0);
681
+ }
682
+ } catch {
683
+ }
684
+ stderrTarget = fs2.openSync(logPath, "a");
685
+ } catch {
686
+ stderrTarget = "ignore";
687
+ }
654
688
  const child = spawn(process.execPath, args, {
655
689
  detached: true,
656
- stdio: "ignore",
690
+ stdio: ["ignore", "ignore", stderrTarget],
657
691
  windowsHide: true,
658
692
  env: process.env
659
693
  });
694
+ if (typeof stderrTarget === "number") {
695
+ try {
696
+ fs2.closeSync(stderrTarget);
697
+ } catch {
698
+ }
699
+ }
660
700
  child.unref();
661
701
  }
662
702
  forceKillKnownServer() {
@@ -1312,4 +1352,4 @@ export {
1312
1352
  checkCodebaseIndexServerHealth,
1313
1353
  ensureCodebaseIndexServer
1314
1354
  };
1315
- //# sourceMappingURL=chunk-CVNCSMVU.js.map
1355
+ //# sourceMappingURL=chunk-PVQBD3TA.js.map
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  tryLegacyCodeOperation
3
- } from "./chunk-GU7QJ37F.js";
3
+ } from "./chunk-JQ43NVFU.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-ZUFHAHTE.js";
10
+ } from "./chunk-HKR56VNF.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-FC3X7GGJ.js.map
192
+ //# sourceMappingURL=chunk-R36RWYXE.js.map
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  tryLegacyCodeOperation
3
- } from "./chunk-GU7QJ37F.js";
3
+ } from "./chunk-JQ43NVFU.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-ZUFHAHTE.js";
10
+ } from "./chunk-HKR56VNF.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-Z34CUZCZ.js.map
234
+ //# sourceMappingURL=chunk-S6E2AM4U.js.map