@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
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveIndexDir
3
- } from "./chunk-3JVSOBHU.js";
3
+ } from "./chunk-AX5ZG5O5.js";
4
4
 
5
5
  // src/codebase-index/project-server-endpoint.ts
6
6
  import { createHash } from "node:crypto";
@@ -10,6 +10,8 @@ import * as path from "node:path";
10
10
  import { fileURLToPath } from "node:url";
11
11
  var PROJECT_INDEX_SERVER_PROTOCOL_VERSION = 1;
12
12
  var PROJECT_INDEX_SERVER_METADATA_FILE = "server.json";
13
+ var PROJECT_INDEX_SERVER_STDERR_FILE = "server.err.log";
14
+ var PROJECT_INDEX_SERVER_STDERR_MAX_BYTES = 64 * 1024;
13
15
  var PROJECT_INDEX_SERVER_SOCKET_DIR = `wsci-v${PROJECT_INDEX_SERVER_PROTOCOL_VERSION}`;
14
16
  var buildIdCache;
15
17
  function projectIndexServerBuildId(entrypoint) {
@@ -49,6 +51,38 @@ function projectIndexServerMetadataPath(projectRoot, indexDir) {
49
51
  PROJECT_INDEX_SERVER_METADATA_FILE
50
52
  );
51
53
  }
54
+ function projectIndexServerStderrPath(projectRoot, indexDir) {
55
+ return path.join(
56
+ path.resolve(resolveIndexDir(projectRoot, indexDir)),
57
+ PROJECT_INDEX_SERVER_STDERR_FILE
58
+ );
59
+ }
60
+ function readProjectIndexServerStderrTail(path_, maxLines = 4) {
61
+ let raw;
62
+ try {
63
+ const { size } = fs.statSync(path_);
64
+ const start = Math.max(0, size - PROJECT_INDEX_SERVER_STDERR_MAX_BYTES);
65
+ const fd = fs.openSync(path_, "r");
66
+ try {
67
+ const length = size - start;
68
+ if (length <= 0) return null;
69
+ const buffer = Buffer.alloc(length);
70
+ fs.readSync(fd, buffer, 0, length, start);
71
+ raw = buffer.toString("utf8");
72
+ } finally {
73
+ fs.closeSync(fd);
74
+ }
75
+ } catch {
76
+ return null;
77
+ }
78
+ const lines = raw.split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0);
79
+ if (lines.length === 0) return null;
80
+ return lines.slice(-maxLines).join(" | ");
81
+ }
82
+ var PROJECT_INDEX_SERVER_CLOSED_MESSAGE = "codebase-index server connection closed";
83
+ function formatProjectIndexServerCloseError(tail) {
84
+ return tail ? `${PROJECT_INDEX_SERVER_CLOSED_MESSAGE} (server stderr: ${tail})` : PROJECT_INDEX_SERVER_CLOSED_MESSAGE;
85
+ }
52
86
 
53
87
  // src/codebase-index/binary-frame.ts
54
88
  import { decode, encode } from "@msgpack/msgpack";
@@ -114,10 +148,14 @@ export {
114
148
  encodeBinaryFrame,
115
149
  decodeBinaryFrame,
116
150
  PROJECT_INDEX_SERVER_PROTOCOL_VERSION,
151
+ PROJECT_INDEX_SERVER_STDERR_MAX_BYTES,
117
152
  projectIndexServerBuildId,
118
153
  projectIndexServerEndpoint,
119
154
  projectIndexServerMetadataPath,
155
+ projectIndexServerStderrPath,
156
+ readProjectIndexServerStderrTail,
157
+ formatProjectIndexServerCloseError,
120
158
  PROJECT_INDEX_SERVER_MAX_FRAME_CHARS,
121
159
  encodeProjectServerMessage
122
160
  };
123
- //# sourceMappingURL=chunk-6ZLRRC74.js.map
161
+ //# sourceMappingURL=chunk-VQDSIHAR.js.map
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  getIndexState,
3
3
  searchCodebaseIndex
4
- } from "./chunk-CVNCSMVU.js";
4
+ } from "./chunk-PVQBD3TA.js";
5
5
  import {
6
6
  codebaseIndexDirOverride
7
- } from "./chunk-3JVSOBHU.js";
7
+ } from "./chunk-AX5ZG5O5.js";
8
8
  import {
9
9
  isBinaryBuffer,
10
10
  safeResolveReal,
11
11
  sha256hex
12
- } from "./chunk-ZUFHAHTE.js";
12
+ } from "./chunk-HKR56VNF.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-YECHJJJF.js.map
343
+ //# sourceMappingURL=chunk-VSOVZ5JI.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  safeResolveReal
3
- } from "./chunk-ZUFHAHTE.js";
3
+ } from "./chunk-HKR56VNF.js";
4
4
 
5
5
  // src/e2e.ts
6
6
  import { open, readdir } from "node:fs/promises";
@@ -422,4 +422,4 @@ export {
422
422
  discoverE2EProjects,
423
423
  e2ePlanTool
424
424
  };
425
- //# sourceMappingURL=chunk-RV7BVTDG.js.map
425
+ //# sourceMappingURL=chunk-WKXL5XHU.js.map
@@ -6,13 +6,13 @@ import {
6
6
  } from "./chunk-ZBMANLYH.js";
7
7
  import {
8
8
  enqueueReindex
9
- } from "./chunk-CVNCSMVU.js";
9
+ } from "./chunk-PVQBD3TA.js";
10
10
  import {
11
11
  isBinaryBuffer,
12
12
  safeResolveReal,
13
13
  sha256hex,
14
14
  truncateDiffPayload
15
- } from "./chunk-ZUFHAHTE.js";
15
+ } from "./chunk-HKR56VNF.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-77MBK46T.js.map
416
+ //# sourceMappingURL=chunk-WWAXJKX3.js.map
@@ -2,8 +2,8 @@
2
2
  var toolSearchTool = {
3
3
  name: "tool_search",
4
4
  category: "Meta",
5
- description: "Search the catalog of available tools by name or description. Use this to discover which tool to use for a task. For the full schema and usage details of a specific tool, use `tool_help` instead.",
6
- usageHint: "SELF-DISCOVERY TOOL:\n\n- Use when you need to find the right tool for a job.\n- `query` searches names and descriptions.\n- You can filter by `tags` (category), `permission`, or `mutating`.\n- Once you find the right tool name, use `tool_help` with that name for full schema details.\nCall this before guessing tool names. It helps you discover the best tool for the current situation.",
5
+ description: "Search the catalog of available tools by name or description. Use this to discover which tool to use for a task, including tools whose schemas were withheld from this request to save tokens.",
6
+ usageHint: "SELF-DISCOVERY TOOL:\n\n- Use when you need to find the right tool for a job.\n- `query` searches names and descriptions.\n- You can filter by `tags` (category), `permission`, or `mutating`.\n- The catalog searched here is the full registry, not just the tools listed in this request.\n- Once you find the right tool name, invoke it with `tool_use`.\nCall this before concluding a capability is unavailable.",
7
7
  permission: "auto",
8
8
  mutating: false,
9
9
  timeoutMs: 1e3,
@@ -68,7 +68,7 @@ var toolSearchTool = {
68
68
  mutating: t.mutating
69
69
  }));
70
70
  const totalAvailable = tools.length;
71
- const hint = results.length === 0 && query ? `No tools matched "${input.query}". Use tool-help (without arguments) to see all ${totalAvailable} available tools.` : void 0;
71
+ const hint = results.length === 0 && query ? `No tools matched "${input.query}". ${totalAvailable} tools are available; call tool_search with no query to list them all.` : void 0;
72
72
  return {
73
73
  tools: results,
74
74
  total: filtered.length,
@@ -82,4 +82,4 @@ var toolSearchTool = {
82
82
  export {
83
83
  toolSearchTool
84
84
  };
85
- //# sourceMappingURL=chunk-24T5XIJU.js.map
85
+ //# sourceMappingURL=chunk-YA2ZYCJY.js.map
@@ -20,7 +20,7 @@ import {
20
20
  COMMAND_OUTPUT_MAX_BYTES,
21
21
  normalizeCommandOutput,
22
22
  safeResolveReal
23
- } from "./chunk-ZUFHAHTE.js";
23
+ } from "./chunk-HKR56VNF.js";
24
24
 
25
25
  // src/exec.ts
26
26
  import { spawn } from "node:child_process";
@@ -1835,4 +1835,4 @@ export {
1835
1835
  getExecAllowlist,
1836
1836
  execTool
1837
1837
  };
1838
- //# sourceMappingURL=chunk-T7YVY2BV.js.map
1838
+ //# sourceMappingURL=chunk-YILT3CSO.js.map
@@ -11,7 +11,7 @@ import {
11
11
  detectPackageManager,
12
12
  normalizeCommandOutput,
13
13
  safeResolveReal
14
- } from "./chunk-ZUFHAHTE.js";
14
+ } from "./chunk-HKR56VNF.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-WVQ4BHDI.js");
69
+ const { detectNonJsEcosystem } = await import("./legacy-bridge-XM2GV665.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-OUEH4I4X.js.map
285
+ //# sourceMappingURL=chunk-YJQQ5F5J.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  builtinTools
3
- } from "./chunk-TYRVYBHW.js";
3
+ } from "./chunk-T34DVSAE.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-VO6M2FVG.js.map
15
+ //# sourceMappingURL=chunk-YZLOYJGN.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";
@@ -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/install.ts
14
14
  import { join } from "node:path";
@@ -253,4 +253,4 @@ function resolveManifestPath(cwd, pkgManager) {
253
253
  export {
254
254
  installTool
255
255
  };
256
- //# sourceMappingURL=chunk-MIV2RU5B.js.map
256
+ //# sourceMappingURL=chunk-ZETZHHV5.js.map
package/dist/clarify.d.ts CHANGED
@@ -3,29 +3,44 @@
3
3
  *
4
4
  * Prompts the user with structured, multiple-choice questions when architectural,
5
5
  * database schema, API contract, or domain logic assumptions are underspecified.
6
- * Prevents silent misaligned migrations, breaking changes, and refactoring re-work.
6
+ * Bridges clarify + ask_question into a single unified interactive tool
7
+ * functioning consistently across CLI, TUI, and WebUI.
7
8
  */
8
9
  import type { Tool } from '@wrongstack/core/types';
9
- export interface ClarifyQuestionInput {
10
+ export interface ClarifyQuestionItem {
10
11
  /** The core decision or question to clarify with the user. */
11
12
  question: string;
12
13
  /** Context or explanation of why this decision matters (e.g. index performance, validation). */
13
14
  context?: string | undefined;
14
- /** 2 to 4 structured, distinct choices for the user to select. */
15
+ /** 2 to 6 structured, distinct choices for the user to select. */
15
16
  options: string[];
16
17
  /** The option recommended by the assistant based on best practices. */
17
18
  recommendedOption?: string | undefined;
18
19
  /** Whether the user can select multiple options simultaneously. */
19
20
  isMultiSelect?: boolean | undefined;
21
+ /** Snake-case alias for isMultiSelect (Antigravity compatibility). */
22
+ is_multi_select?: boolean | undefined;
20
23
  /** Allow write-in custom responses in addition to options (default: true). */
21
24
  allowCustomResponse?: boolean | undefined;
22
25
  }
26
+ export interface ClarifyQuestionInput extends Partial<ClarifyQuestionItem> {
27
+ /** Batch questions list (Antigravity ask_question parity). */
28
+ questions?: ClarifyQuestionItem[] | undefined;
29
+ }
23
30
  export type ClarifyInput = ClarifyQuestionInput;
31
+ export interface ClarifyAnswerItem {
32
+ question: string;
33
+ selectedOptions: string[];
34
+ customResponse?: string | undefined;
35
+ }
24
36
  export interface ClarifyOutput {
25
37
  status: 'answered' | 'auto_decided' | 'skipped';
38
+ /** Primary / single question (for backward compatibility). */
26
39
  question: string;
27
40
  selectedOptions: string[];
28
41
  customResponse?: string | undefined;
42
+ /** Complete list of answers when clarifying one or more questions. */
43
+ answers?: ClarifyAnswerItem[] | undefined;
29
44
  decisionSummary: string;
30
45
  error?: string | undefined;
31
46
  }
@@ -35,9 +35,8 @@ export interface CodebaseSearchInput {
35
35
  limit?: number | undefined;
36
36
  lspKind?: number | undefined;
37
37
  /**
38
- * When true, hints that LSP-based search should be preferred over the index.
39
- * The built-in tool ignores this (index-only), but when the LSP plugin is
40
- * active it intercepts the tool and provides live LSP workspaceSymbol results.
38
+ * Deprecated compatibility hint. The built-in tool is index-only; the LSP
39
+ * plugin exposes live workspace-symbol search as `codebase-lsp-search`.
41
40
  */
42
41
  preferLsp?: boolean | undefined;
43
42
  }
@@ -51,7 +51,7 @@ import {
51
51
  setContextQueryEmbedder,
52
52
  writeAtlas,
53
53
  writeProjectAtlas
54
- } from "../chunk-PNLDTRC5.js";
54
+ } from "../chunk-OSXM3O3J.js";
55
55
  import "../chunk-XRNN44QY.js";
56
56
  import "../chunk-EMA2XENR.js";
57
57
  import "../chunk-SCMRM6NL.js";
@@ -78,11 +78,11 @@ import {
78
78
  shutdownCodebaseIndexHost,
79
79
  shutdownCodebaseIndexServer,
80
80
  symbolGraphService
81
- } from "../chunk-CVNCSMVU.js";
81
+ } from "../chunk-PVQBD3TA.js";
82
82
  import {
83
83
  projectIndexServerEndpoint,
84
84
  projectIndexServerMetadataPath
85
- } from "../chunk-6ZLRRC74.js";
85
+ } from "../chunk-VQDSIHAR.js";
86
86
  import {
87
87
  CONCEPT_RELATIONS,
88
88
  CONTRADICTED_VISIBILITY_WEIGHT,
@@ -122,8 +122,8 @@ import {
122
122
  shouldRefreshRanks,
123
123
  toSymbolRankRows,
124
124
  tokenise
125
- } from "../chunk-3JVSOBHU.js";
126
- import "../chunk-6LCKF5KH.js";
125
+ } from "../chunk-AX5ZG5O5.js";
126
+ import "../chunk-24Q4O34E.js";
127
127
  import "../chunk-REWOZIA4.js";
128
128
  import "../chunk-6IEBD27U.js";
129
129
  import {
@@ -140,7 +140,7 @@ import {
140
140
  loadGitignoreMatcher
141
141
  } from "../chunk-2CTZW6JQ.js";
142
142
  import "../chunk-5U5ULQX2.js";
143
- import "../chunk-ZUFHAHTE.js";
143
+ import "../chunk-HKR56VNF.js";
144
144
  export {
145
145
  ATLAS_DIR,
146
146
  ATLAS_FILE_LIMIT,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  parseFilesContent
3
- } from "../chunk-6LCKF5KH.js";
3
+ } from "../chunk-24Q4O34E.js";
4
4
  import "../chunk-REWOZIA4.js";
5
5
  import "../chunk-6IEBD27U.js";
6
6
  import "../chunk-ZKC5UNGD.js";
@@ -1,4 +1,6 @@
1
1
  export declare const PROJECT_INDEX_SERVER_PROTOCOL_VERSION = 1;
2
+ /** Keep only the tail; a daemon that crash-loops must not fill the disk. */
3
+ export declare const PROJECT_INDEX_SERVER_STDERR_MAX_BYTES: number;
2
4
  /**
3
5
  * Content identity for the actual server artifact.
4
6
  *
@@ -33,4 +35,35 @@ export declare function projectIndexServerKey(projectRoot: string, indexDir?: st
33
35
  */
34
36
  export declare function projectIndexServerEndpoint(projectRoot: string, indexDir?: string): string;
35
37
  export declare function projectIndexServerMetadataPath(projectRoot: string, indexDir?: string): string;
38
+ /**
39
+ * Where a detached daemon's stderr is kept.
40
+ *
41
+ * The daemon used to be spawned with `stdio: 'ignore'`, so when it died the
42
+ * only trace was the client's `codebase-index server connection closed` —
43
+ * a message that names the symptom and no cause. Node writes an uncaught
44
+ * exception's stack to stderr before exiting, and V8 writes its fatal
45
+ * out-of-memory message there too (which no JS handler can intercept), so
46
+ * keeping the stream is what makes a dead daemon explain itself.
47
+ */
48
+ export declare function projectIndexServerStderrPath(projectRoot: string, indexDir?: string): string;
49
+ /**
50
+ * The tail of a daemon's stderr, condensed to one line for an error message.
51
+ *
52
+ * Returns null when there is nothing useful: no file, an empty one, or only
53
+ * whitespace. Reads at most the last `PROJECT_INDEX_SERVER_STDERR_MAX_BYTES`
54
+ * so a large file cannot be pulled into memory here.
55
+ */
56
+ export declare function readProjectIndexServerStderrTail(path_: string, maxLines?: number): string | null;
57
+ /** The base close message. Kept as a PREFIX so existing substring matchers
58
+ * (and anyone grepping logs for it) keep working when a reason is appended. */
59
+ export declare const PROJECT_INDEX_SERVER_CLOSED_MESSAGE = "codebase-index server connection closed";
60
+ /**
61
+ * Compose the error a closed connection rejects with.
62
+ *
63
+ * A closed socket has two very different causes — an orderly shutdown and the
64
+ * daemon dying — and they used to be reported identically. When the daemon
65
+ * left something on stderr, that text is the whole difference between a
66
+ * failure someone can act on and one that reads as a flake.
67
+ */
68
+ export declare function formatProjectIndexServerCloseError(tail: string | null): string;
36
69
  //# sourceMappingURL=project-server-endpoint.d.ts.map
@@ -10,7 +10,7 @@ import {
10
10
  projectIndexServerBuildId,
11
11
  projectIndexServerEndpoint,
12
12
  projectIndexServerMetadataPath
13
- } from "../chunk-6ZLRRC74.js";
13
+ } from "../chunk-VQDSIHAR.js";
14
14
  import {
15
15
  contextService,
16
16
  fileGraphService,
@@ -24,8 +24,8 @@ import {
24
24
  statsService,
25
25
  symbolGraphService,
26
26
  vectorSearchService
27
- } from "../chunk-3JVSOBHU.js";
28
- import "../chunk-6LCKF5KH.js";
27
+ } from "../chunk-AX5ZG5O5.js";
28
+ import "../chunk-24Q4O34E.js";
29
29
  import "../chunk-REWOZIA4.js";
30
30
  import "../chunk-6IEBD27U.js";
31
31
  import {
@@ -9,8 +9,8 @@ import {
9
9
  statsService,
10
10
  symbolGraphService,
11
11
  vectorSearchService
12
- } from "../chunk-3JVSOBHU.js";
13
- import "../chunk-6LCKF5KH.js";
12
+ } from "../chunk-AX5ZG5O5.js";
13
+ import "../chunk-24Q4O34E.js";
14
14
  import "../chunk-REWOZIA4.js";
15
15
  import "../chunk-6IEBD27U.js";
16
16
  import "../chunk-ZKC5UNGD.js";
package/dist/diff.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  diffTool
3
- } from "./chunk-7HL23T3T.js";
3
+ } from "./chunk-BU6VUXWG.js";
4
4
  import "./chunk-ZBMANLYH.js";
5
- import "./chunk-ZUFHAHTE.js";
5
+ import "./chunk-HKR56VNF.js";
6
6
  export {
7
7
  diffTool
8
8
  };
package/dist/e2e.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  discoverE2EProjects,
3
3
  e2ePlanTool
4
- } from "./chunk-RV7BVTDG.js";
5
- import "./chunk-ZUFHAHTE.js";
4
+ } from "./chunk-WKXL5XHU.js";
5
+ import "./chunk-HKR56VNF.js";
6
6
  export {
7
7
  discoverE2EProjects,
8
8
  e2ePlanTool
package/dist/edit.js CHANGED
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  editTool
3
- } from "./chunk-AMURQAJX.js";
3
+ } from "./chunk-KVEL4EFI.js";
4
4
  import "./chunk-MSOAX3GC.js";
5
- import "./chunk-CVNCSMVU.js";
6
- import "./chunk-6ZLRRC74.js";
7
- import "./chunk-3JVSOBHU.js";
8
- import "./chunk-6LCKF5KH.js";
5
+ import "./chunk-PVQBD3TA.js";
6
+ import "./chunk-VQDSIHAR.js";
7
+ import "./chunk-AX5ZG5O5.js";
8
+ import "./chunk-24Q4O34E.js";
9
9
  import "./chunk-REWOZIA4.js";
10
10
  import "./chunk-6IEBD27U.js";
11
11
  import "./chunk-ZKC5UNGD.js";
12
12
  import "./chunk-YOHO4DVT.js";
13
13
  import "./chunk-2CTZW6JQ.js";
14
14
  import "./chunk-5U5ULQX2.js";
15
- import "./chunk-ZUFHAHTE.js";
15
+ import "./chunk-HKR56VNF.js";
16
16
  export {
17
17
  editTool
18
18
  };
package/dist/exec.js CHANGED
@@ -7,14 +7,14 @@ import {
7
7
  isExecCommandAllowed,
8
8
  resetDangerBypass,
9
9
  resetExecPolicy
10
- } from "./chunk-T7YVY2BV.js";
10
+ } from "./chunk-YILT3CSO.js";
11
11
  import "./chunk-BTSFTGIL.js";
12
12
  import "./chunk-PVCB7RUZ.js";
13
13
  import "./chunk-SCMRM6NL.js";
14
14
  import "./chunk-HDYUBRMF.js";
15
15
  import "./chunk-7JJFC6CT.js";
16
16
  import "./chunk-5U5ULQX2.js";
17
- import "./chunk-ZUFHAHTE.js";
17
+ import "./chunk-HKR56VNF.js";
18
18
  export {
19
19
  configureDangerBypass,
20
20
  configureExecPolicy,
package/dist/fetch.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  fetchTool
3
- } from "./chunk-DX5KZEMK.js";
3
+ } from "./chunk-47GYABZW.js";
4
4
  import {
5
5
  guardedFetch,
6
6
  guardedLookup
7
7
  } from "./chunk-NBDZMMG2.js";
8
- import "./chunk-ZUFHAHTE.js";
8
+ import "./chunk-HKR56VNF.js";
9
9
  export {
10
10
  fetchTool,
11
11
  guardedFetch,
package/dist/format.js CHANGED
@@ -2,15 +2,15 @@ import {
2
2
  detectFixer,
3
3
  formatTool,
4
4
  parseFormatterCounts
5
- } from "./chunk-YDTRKEYY.js";
6
- import "./chunk-GU7QJ37F.js";
7
- import "./chunk-3LS3FYEF.js";
5
+ } from "./chunk-OBVXDVLE.js";
6
+ import "./chunk-JQ43NVFU.js";
7
+ import "./chunk-JK5WXW4S.js";
8
8
  import "./chunk-EMA2XENR.js";
9
9
  import "./chunk-SCMRM6NL.js";
10
10
  import "./chunk-HDYUBRMF.js";
11
11
  import "./chunk-7JJFC6CT.js";
12
12
  import "./chunk-5U5ULQX2.js";
13
- import "./chunk-ZUFHAHTE.js";
13
+ import "./chunk-HKR56VNF.js";
14
14
  export {
15
15
  detectFixer,
16
16
  formatTool,
package/dist/git.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  gitTool
3
- } from "./chunk-AQ5YBURX.js";
4
- import "./chunk-ZUFHAHTE.js";
3
+ } from "./chunk-2IC5FRD7.js";
4
+ import "./chunk-HKR56VNF.js";
5
5
  export {
6
6
  gitTool
7
7
  };
package/dist/glob.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  globTool
3
- } from "./chunk-ASEXQRA7.js";
3
+ } from "./chunk-FEXPWYU7.js";
4
4
  import "./chunk-ZBMANLYH.js";
5
5
  import "./chunk-2CTZW6JQ.js";
6
- import "./chunk-ZUFHAHTE.js";
6
+ import "./chunk-HKR56VNF.js";
7
7
  export {
8
8
  globTool
9
9
  };
package/dist/grep.js CHANGED
@@ -2,11 +2,11 @@ import {
2
2
  __resetRgDetectionForTests,
3
3
  __setRgAvailableForTests,
4
4
  grepTool
5
- } from "./chunk-4ERMPDHV.js";
5
+ } from "./chunk-2QY3DC3H.js";
6
6
  import "./chunk-YJTXRH5Y.js";
7
7
  import "./chunk-ZBMANLYH.js";
8
8
  import "./chunk-2CTZW6JQ.js";
9
- import "./chunk-ZUFHAHTE.js";
9
+ import "./chunk-HKR56VNF.js";
10
10
  export {
11
11
  __resetRgDetectionForTests,
12
12
  __setRgAvailableForTests,
package/dist/index.d.ts CHANGED
@@ -8,16 +8,14 @@ export { type AuditContext, type AuditInput, type AuditOutput, type AuditVulnera
8
8
  export { type AutoProceedLoopGuard, createAutoProceedLoopGuard, GROUNDED_NO_PROGRESS_STEER, type GroundedRepetitionAction, type GroundedRepetitionSignal, type LoopGuardOptions, normalizeForRepetition, type RepetitionSignal, } from './auto-proceed-loop-guard.js';
9
9
  export { type BashInput, type BashOutput, bashTool, } from './bash.js';
10
10
  export { checkAndBlockKillCommand, type KillCheckResult, type KillCommand, } from './bash-kill-guard.js';
11
- export { type BatchToolUseInput, type BatchToolUseOutput, batchToolUseTool, } from './batch-tool-use.js';
12
11
  export * from './browser/index.js';
13
12
  export { builtinTools, OFF_ONLY_TOOLS, OPTIONAL_TOOLS, TIER1_TOOLS, TIER2_TOOLS, TIER3_TOOLS, } from './builtin.js';
14
13
  export { type BreakerState, CircuitBreaker, type CircuitBreakerConfig, type CircuitBreakerSnapshot, } from './circuit-breaker.js';
15
- export { type ClarifyInput, type ClarifyOutput, type ClarifyQuestionInput, clarifyTool, } from './clarify.js';
14
+ export { type ClarifyAnswerItem, type ClarifyInput, type ClarifyOutput, type ClarifyQuestionInput, type ClarifyQuestionItem, clarifyTool, } from './clarify.js';
16
15
  export type { CircuitSnapshot, CircuitState, CodebaseAstReplaceInput, CodebaseAstReplaceOutput, CodebaseImpactAnalysisInput, CodebaseImpactAnalysisOutput, CodebaseIncomingCallsInput, CodebaseIncomingCallsOutput, CodebaseIndexInput, CodebaseIndexOutput, CodebaseInvariantCheckInput, CodebaseInvariantCheckOutput, CodebaseOutgoingCallsInput, CodebaseOutgoingCallsOutput, CodebaseRepoMapInput, CodebaseRepoMapOutput, CodebaseSearchInput, CodebaseSearchOutput, CodebaseSkeletonInput, CodebaseSkeletonOutput, CodebaseStatsInput, CodebaseStatsOutput, CodebaseTargetedTestInput, CodebaseTargetedTestOutput, CodeMapGraph, DeadCodeScanInput, DeadCodeScanOutput, DeadFile, DeadPackage, DeadSymbol, GraphEdge, GraphNode, ImpactAnalysisInput, ImpactAnalysisOutput, ImpactCallSite, IncomingCallsInput, IncomingCallsOutput, OutgoingCallsInput, OutgoingCallsOutput, ProjectIndexDaemonAvailability, ProjectIndexServerActivity, ProjectIndexServerClientHealth, ProjectIndexServerConnectionState, ProjectIndexServerConnectionStatus, ProjectIndexServerHealth, TargetedTestInput, TargetedTestOutput, } from './codebase-index/index.js';
17
16
  export { ATLAS_DIR, type AtlasBrief, type AtlasBriefIndexMissing, type AtlasFreshness, type AtlasIndexMissing, buildProjectAtlasBrief, CircuitOpenError, CONCEPT_RELATIONS, type ConceptIndexMissing, type ContextResult, cancelPendingReindexes, checkCodebaseIndexServerHealth, checkProjectAtlasFreshness, codebaseAstReplaceTool, codebaseContextTool, codebaseImpactAnalysisTool, codebaseIncomingCallsTool, codebaseIndexStats, codebaseIndexTool, codebaseInvariantCheckTool, codebaseOutgoingCallsTool, codebaseRepoMapTool, codebaseSearchTool, codebaseSkeletonTool, codebaseStatsTool, codebaseTargetedTestTool, deadCodeScanTool, type EmbeddingPort, type EmbedIndexMissing, type EmbedResult, type EnrichResult, embedProjectFiles, enqueueReindex, enrichProjectConcepts, ensureCodebaseIndexServer, exportProjectAtlasHtml, extractDirectorySkeleton, extractFileSkeleton, type FileSkeletonResult, fileGraphService, generateRepoMap, getIndexState, IndexCircuitBreaker, IndexTimeoutError, indexCircuitBreaker, isIndexableFile, isIndexing, isIndexReady, MAX_CRUX_LINES, MAX_REPORTED_DRIFT, type MutateSymbolOptions, type MutateSymbolResult, onIndexStateChange, packageGraphService, type RepoMapOptions, type RepoMapResult, replaceSymbolInFile, resetIndexCircuitBreaker, resolveProjectIndexDaemonAvailability, runDeadCodeScan, runStartupIndex, type SkeletonOptions, type SkeletonSymbolRange, type SummarizeFileInput, type SummarizeFileResult, type SummarizerPort, type SummarizeSubsystemInput, type SummarizeSubsystemResult, searchCodebaseIndex, setContextQueryEmbedder, shutdownCodebaseIndexHost, shutdownCodebaseIndexServer, symbolGraphService, writeProjectAtlas, } from './codebase-index/index.js';
18
17
  export { type DesignInput, type DesignOutput, designTool, } from './design.js';
19
18
  export { type DiffInput, type DiffMode, type DiffOutput, diffTool, } from './diff.js';
20
- export { type DocumentedItem, type DocumentInput, type DocumentOutput, documentTool, } from './document.js';
21
19
  export { discoverE2EProjects, type E2EExecutionPlan, type E2EFramework, type E2EPackageManager, type E2EPlanInput, type E2EPlanOutput, type E2EProjectPlan, type E2EServerHint, e2ePlanTool, } from './e2e.js';
22
20
  export { type EditInput, type EditOutput, editTool, type MatchTier, } from './edit.js';
23
21
  export { configureDangerBypass, configureExecPolicy, type ExecInput, type ExecOutput, execTool, getDangerBypass, getExecAllowlist, isExecCommandAllowed, resetDangerBypass, resetExecPolicy, } from './exec.js';
@@ -48,23 +46,19 @@ export { getPersistentProcessRegistry, type PersistentProcessEntry, type Persist
48
46
  export { createGlobalPsSlashCommand, formatGlobalStatus, formatInstanceList, formatInstanceSummary, type GlobalProcessStatus, getInstanceCount, type InstanceInfo, type InstanceListOptions, listInstances, } from './ps-slash.js';
49
47
  export { PWSH_TOOL_DESCRIPTION, PWSH_TOOL_USAGE_HINT, type PwshInput, type PwshOutput, pwshTool, } from './pwsh.js';
50
48
  export { type ReadInput, type ReadMode, type ReadOutput, readTool, type SymbolEntry, } from './read.js';
49
+ export { type ReadUrlContentInput, type ReadUrlContentOutput, readUrlContentTool, } from './read-url-content.js';
51
50
  export { type ReplaceInput, type ReplaceOutput, replaceTool, } from './replace.js';
52
- export { BUILT_IN_TEMPLATES, type ScaffoldInput, type ScaffoldOutput, type ScaffoldTemplate, scaffoldTool, } from './scaffold.js';
53
51
  export { type CacheEntry as SearchCacheEntry, type SearchInput, type SearchOutput, type SearchResult, searchTool, } from './search.js';
54
52
  export { analyzeSecurityAndPerformance, type SecurityFinding, type SecurityScanInput, type SecurityScanOutput, securityAstScanTool, } from './security-ast-scan-tool.js';
55
53
  export { applySessionKanbanBoardToTodos, applySessionKanbanTaskToSource, attachSessionKanbanMirror, ensureSessionKanbanBoard, hydrateSessionKanban, mirrorSessionPlanToKanban, mirrorSessionTasksToKanban, mirrorSessionTodosToKanban, projectSessionPlanToKanban, projectSessionTasksToKanban, projectSessionTodosToKanban, rebindSessionKanbanTask, SESSION_KANBAN_COLUMNS, } from './session-kanban.js';
56
- export { type SetWorkingDirInput, type SetWorkingDirOutput, setWorkingDirTool, } from './set-working-dir.js';
57
54
  export { type LoadedResource, makeSkillTool, type SkillResource, type SkillToolInput, type SkillToolOutput, } from './skill.js';
58
55
  export { type TaskAction, type TaskAdditionItem, type TaskInput, type TaskOutput, type TaskReplacementItem, taskTool, } from './task.js';
59
56
  export { type TestContext, type TestInput, type TestOutput, type TestRunnerName, testTool, } from './test.js';
60
57
  export { type TodoInput, type TodoKanbanBinding, type TodoOutput, todoTool, } from './todo.js';
61
58
  export { computeLineDiff, DIFF_MAX_LINES, type DiffRow, type DiffRowKind, diffFromToolInput, type ToolDiff, } from './tool-diff.js';
62
- export { type ToolHelpInput, type ToolHelpOutput, toolHelpTool, } from './tool-help.js';
63
59
  export { FALLBACK_ICON, getToolIcon, TOOL_ICON_CONFIG, TOOL_ICON_MAP, type ToolIconConfig, type ToolIconId, } from './tool-icon-map.js';
64
- export { type ToolSearchInput, type ToolSearchOutput, toolSearchTool, } from './tool-search.js';
65
60
  export { FALLBACK_HEAD_FIELDS, SUMMARIZE_TOOL_INPUT_BROWSER_SRC, summarizeToolInput, } from './tool-summary.js';
66
61
  export { type RegisterBuiltinToolTierOptions, registerBuiltinToolTier, selectBuiltinToolsForTier, } from './tool-tier.js';
67
- export { type ToolUseInput, type ToolUseOutput, toolUseTool, } from './tool-use.js';
68
62
  export { DEFAULT_MAX_TREE_ENTRIES, MAX_TREE_OUTPUT_BYTES, type TreeContext, type TreeInput, type TreeOutput, treeTool, } from './tree.js';
69
63
  export { type TypecheckContext, type TypecheckInput, type TypecheckOutput, typecheckTool, } from './typecheck.js';
70
64
  export { type WriteInput, type WriteOutput, writeTool, } from './write.js';