@wrongstack/tools 1.0.1 → 1.0.3

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 (98) hide show
  1. package/dist/_win32-resolve.d.ts +1 -6
  2. package/dist/audit.js +5 -5
  3. package/dist/bash.js +2 -2
  4. package/dist/builtin.js +30 -30
  5. package/dist/{chunk-7LQCT3LT.js → chunk-32XPUSY3.js} +3 -3
  6. package/dist/{chunk-N3K2SFEI.js → chunk-3JVSOBHU.js} +1408 -200
  7. package/dist/{chunk-7N5U2RAU.js → chunk-3LS3FYEF.js} +2 -2
  8. package/dist/{chunk-FBUP524S.js → chunk-4YKVHCQC.js} +13 -2
  9. package/dist/{chunk-KE7A76VC.js → chunk-5U5ULQX2.js} +4 -14
  10. package/dist/{chunk-NU2IZ72J.js → chunk-6LCKF5KH.js} +8 -6
  11. package/dist/{chunk-GDDXX27P.js → chunk-6ZLRRC74.js} +2 -2
  12. package/dist/{chunk-IYH4OHBP.js → chunk-77MBK46T.js} +3 -3
  13. package/dist/{chunk-DK4J2WMH.js → chunk-AMURQAJX.js} +2 -2
  14. package/dist/{chunk-ZTCJCYLN.js → chunk-CVNCSMVU.js} +49 -6
  15. package/dist/{chunk-MJSJWXBF.js → chunk-DX5KZEMK.js} +14 -2
  16. package/dist/{chunk-CGXTR34H.js → chunk-E2ZD4ERD.js} +2 -2
  17. package/dist/{chunk-DRRY6SCM.js → chunk-EMA2XENR.js} +2 -2
  18. package/dist/{chunk-3D5DJWOE.js → chunk-FC3X7GGJ.js} +11 -3
  19. package/dist/{chunk-T3SMFF5Q.js → chunk-GU7QJ37F.js} +2 -2
  20. package/dist/{chunk-4WPBS45A.js → chunk-IRUEHGCR.js} +3 -3
  21. package/dist/{chunk-WEEVSWQB.js → chunk-KIQTABBJ.js} +3 -3
  22. package/dist/{chunk-6H4ERJP7.js → chunk-KYVOTHG7.js} +2 -2
  23. package/dist/{chunk-O6BY43ZB.js → chunk-MIV2RU5B.js} +3 -3
  24. package/dist/{chunk-5KS24LTS.js → chunk-NOCU555K.js} +2 -2
  25. package/dist/{chunk-6GOZTS6F.js → chunk-OUEH4I4X.js} +3 -3
  26. package/dist/{chunk-YEISRT4S.js → chunk-PNLDTRC5.js} +1429 -242
  27. package/dist/{chunk-GKSG5CPH.js → chunk-QU2VRCMM.js} +2 -2
  28. package/dist/{chunk-VVZPQPTY.js → chunk-REWOZIA4.js} +5 -3
  29. package/dist/{chunk-MGPR7VG3.js → chunk-T7YVY2BV.js} +2 -2
  30. package/dist/{chunk-IAYMTTR2.js → chunk-TYRVYBHW.js} +27 -23
  31. package/dist/{chunk-LQSOU63Z.js → chunk-VKAJMHVG.js} +2 -2
  32. package/dist/{chunk-E7JE3UEX.js → chunk-VO6M2FVG.js} +2 -2
  33. package/dist/{chunk-NJX2RXKJ.js → chunk-YDTRKEYY.js} +11 -3
  34. package/dist/{chunk-MK2JK35J.js → chunk-YECHJJJF.js} +3 -3
  35. package/dist/{chunk-QA6IASYX.js → chunk-Z34CUZCZ.js} +3 -3
  36. package/dist/{chunk-UCYQTZ7F.js → chunk-ZKC5UNGD.js} +56 -2
  37. package/dist/codebase-index/atlas-brief.d.ts +90 -0
  38. package/dist/codebase-index/atlas-export.d.ts +38 -0
  39. package/dist/codebase-index/atlas-projection.d.ts +114 -0
  40. package/dist/codebase-index/atlas-types.d.ts +90 -0
  41. package/dist/codebase-index/background-indexer.d.ts +15 -4
  42. package/dist/codebase-index/codebase-context-tool.d.ts +54 -0
  43. package/dist/codebase-index/concept-enrichment.d.ts +154 -0
  44. package/dist/codebase-index/context-retrieval.d.ts +91 -0
  45. package/dist/codebase-index/embedding-pass.d.ts +95 -0
  46. package/dist/codebase-index/graph-adjacency-cache.d.ts +36 -0
  47. package/dist/codebase-index/graph-rank-pass.d.ts +46 -0
  48. package/dist/codebase-index/graph-rank.d.ts +198 -0
  49. package/dist/codebase-index/index-service.d.ts +15 -1
  50. package/dist/codebase-index/index.d.ts +34 -19
  51. package/dist/codebase-index/index.js +128 -11
  52. package/dist/codebase-index/parser-worker-script.js +4 -4
  53. package/dist/codebase-index/perf-metrics.d.ts +19 -0
  54. package/dist/codebase-index/project-server-protocol.d.ts +2 -0
  55. package/dist/codebase-index/project-server-query-cache.d.ts +4 -0
  56. package/dist/codebase-index/project-server.js +55 -8
  57. package/dist/codebase-index/repo-map-fallback.d.ts +18 -0
  58. package/dist/codebase-index/repo-map-render.d.ts +42 -0
  59. package/dist/codebase-index/repo-map-types.d.ts +21 -0
  60. package/dist/codebase-index/repo-map.d.ts +28 -16
  61. package/dist/codebase-index/schema.d.ts +20 -0
  62. package/dist/codebase-index/worker-protocol.d.ts +47 -1
  63. package/dist/codebase-index/worker.js +12 -6
  64. package/dist/codebase-index/writer-concepts.d.ts +84 -0
  65. package/dist/codebase-index/writer-graph-decorate.d.ts +30 -0
  66. package/dist/codebase-index/writer-graph-reader.d.ts +22 -0
  67. package/dist/codebase-index/writer-rank.d.ts +78 -0
  68. package/dist/codebase-index/writer-schema.d.ts +51 -0
  69. package/dist/codebase-index/writer-vectors.d.ts +53 -0
  70. package/dist/codebase-index/writer.d.ts +59 -0
  71. package/dist/edit.js +8 -8
  72. package/dist/exec.js +2 -2
  73. package/dist/fetch.js +1 -1
  74. package/dist/format.js +5 -5
  75. package/dist/{go-parser-D7ELWQ7F.js → go-parser-EMKTAAD3.js} +5 -3
  76. package/dist/index.d.ts +48 -48
  77. package/dist/index.js +57 -33
  78. package/dist/install.js +5 -5
  79. package/dist/languages/index.js +3 -3
  80. package/dist/{legacy-bridge-YXANP5QB.js → legacy-bridge-WVQ4BHDI.js} +5 -5
  81. package/dist/lint.js +5 -5
  82. package/dist/outdated.js +2 -2
  83. package/dist/pack.js +31 -31
  84. package/dist/parser-dispatch-UQAB4E6V.js +14 -0
  85. package/dist/patch.js +8 -8
  86. package/dist/plan.js +2 -2
  87. package/dist/{py-parser-QC6MR4GB.js → py-parser-DDG53RXI.js} +4 -4
  88. package/dist/read.js +8 -8
  89. package/dist/replace.js +8 -8
  90. package/dist/task.js +2 -2
  91. package/dist/test.js +5 -5
  92. package/dist/todo.js +1 -1
  93. package/dist/tool-tier.js +32 -32
  94. package/dist/typecheck.js +5 -5
  95. package/dist/win32.js +1 -1
  96. package/dist/write.js +8 -8
  97. package/package.json +5 -5
  98. package/dist/parser-dispatch-BDVCJXTV.js +0 -14
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  spawnStream
3
- } from "./chunk-DRRY6SCM.js";
3
+ } from "./chunk-EMA2XENR.js";
4
4
  import {
5
5
  normalizeCommandOutput,
6
6
  safeResolveReal
@@ -3515,4 +3515,4 @@ export {
3515
3515
  languagePackageTool,
3516
3516
  languageInfoTool
3517
3517
  };
3518
- //# sourceMappingURL=chunk-7N5U2RAU.js.map
3518
+ //# sourceMappingURL=chunk-3LS3FYEF.js.map
@@ -26,6 +26,16 @@ function activeBoardId(items, ctx) {
26
26
  const metaBoardId = metaKanban && typeof metaKanban === "object" ? metaKanban["boardId"] : void 0;
27
27
  return ctx.currentKanbanBoardId ?? (typeof metaBoardId === "string" ? metaBoardId : void 0) ?? items.find((item) => item.kanbanBoardId)?.kanbanBoardId ?? "";
28
28
  }
29
+ function deduplicateManagedTodoRows(items, boardId) {
30
+ const rowsById = /* @__PURE__ */ new Map();
31
+ for (const item of items) {
32
+ const existing = rowsById.get(item.id);
33
+ const itemIsBound = item.kanbanBoardId === boardId && Boolean(item.kanbanTaskId);
34
+ const existingIsBound = existing?.kanbanBoardId === boardId && Boolean(existing.kanbanTaskId);
35
+ if (!existing || itemIsBound && !existingIsBound) rowsById.set(item.id, item);
36
+ }
37
+ return [...rowsById.values()];
38
+ }
29
39
  function bindTodosToBoard(items, previous, board) {
30
40
  const previousById = new Map(previous.map((item) => [item.id, item]));
31
41
  const taskById = new Map(board.tasks.map((task) => [task.id, task]));
@@ -354,7 +364,8 @@ var todoTool = {
354
364
  const boardId = activeBoardId(items, ctx);
355
365
  let board = boardId ? await getBoard(ctx.projectRoot, boardId) : null;
356
366
  const managed = board?.lifecycle?.mode === "managed";
357
- let boundItems = managed && board ? bindTodosToBoard(items, ctx.todos ?? [], board) : items;
367
+ const managedItems = managed && board ? deduplicateManagedTodoRows(items, board.id) : items;
368
+ let boundItems = managed && board ? bindTodosToBoard(managedItems, ctx.todos ?? [], board) : managedItems;
358
369
  const creationWarnings = [];
359
370
  if (managed && board) {
360
371
  const managedBoardId = board.id;
@@ -476,4 +487,4 @@ var todoTool = {
476
487
  export {
477
488
  todoTool
478
489
  };
479
- //# sourceMappingURL=chunk-FBUP524S.js.map
490
+ //# sourceMappingURL=chunk-4YKVHCQC.js.map
@@ -1,6 +1,9 @@
1
1
  // src/_win32-resolve.ts
2
2
  import * as fs from "node:fs";
3
3
  import * as path from "node:path";
4
+ import {
5
+ buildWin32CmdShimInvocation
6
+ } from "@wrongstack/core/utils";
4
7
  function resolveWin32Command(cmd) {
5
8
  if (process.platform !== "win32") return cmd;
6
9
  if (cmd.includes("/") || cmd.includes("\\") || path.extname(cmd.replace(/\//g, "\\"))) {
@@ -46,19 +49,6 @@ function assertSafeWin32ShellArgs(args) {
46
49
  }
47
50
  }
48
51
  }
49
- function buildWin32CmdShimInvocation(command, args = []) {
50
- assertSafeWin32ShellArgs([command, ...args]);
51
- const line = ["call", quoteWin32CmdArg(command), ...args.map(quoteWin32CmdArg)].join(" ");
52
- return {
53
- command: process.env["COMSPEC"] ?? "cmd.exe",
54
- args: ["/d", "/c", line],
55
- windowsVerbatimArguments: true
56
- };
57
- }
58
- function quoteWin32CmdArg(arg) {
59
- const escaped = arg.replace(/(\\+)$/, "$1$1");
60
- return `"${escaped}"`;
61
- }
62
52
 
63
53
  export {
64
54
  resolveWin32Command,
@@ -66,4 +56,4 @@ export {
66
56
  assertSafeWin32ShellArgs,
67
57
  buildWin32CmdShimInvocation
68
58
  };
69
- //# sourceMappingURL=chunk-KE7A76VC.js.map
59
+ //# sourceMappingURL=chunk-5U5ULQX2.js.map
@@ -1,13 +1,14 @@
1
1
  import {
2
2
  resolvePythonBinary
3
- } from "./chunk-VVZPQPTY.js";
3
+ } from "./chunk-REWOZIA4.js";
4
4
  import {
5
5
  parseParserBatchOutput,
6
+ recordParserSubprocess,
6
7
  withSpawnGate
7
- } from "./chunk-UCYQTZ7F.js";
8
+ } from "./chunk-ZKC5UNGD.js";
8
9
  import {
9
10
  resolveWin32Command
10
- } from "./chunk-KE7A76VC.js";
11
+ } from "./chunk-5U5ULQX2.js";
11
12
 
12
13
  // src/codebase-index/import-extractor.ts
13
14
  var IMPORT_MAX_FILE_CHARS = 512 * 1024;
@@ -646,6 +647,7 @@ function runToolchainChild(binary, args, stdinPayload, timeoutMs) {
646
647
  let stdout = "";
647
648
  let proc;
648
649
  try {
650
+ recordParserSubprocess();
649
651
  proc = spawn(binary, args, { stdio: ["pipe", "pipe", "pipe"], windowsHide: true });
650
652
  } catch {
651
653
  resolve(null);
@@ -828,11 +830,11 @@ async function dispatch(file, content, lang) {
828
830
  return parseSymbols({ file, content, lang });
829
831
  }
830
832
  case "go": {
831
- const { parseSymbols } = await import("./go-parser-D7ELWQ7F.js");
833
+ const { parseSymbols } = await import("./go-parser-EMKTAAD3.js");
832
834
  return parseSymbols({ file, content, lang: "go" });
833
835
  }
834
836
  case "py": {
835
- const { parseSymbols } = await import("./py-parser-QC6MR4GB.js");
837
+ const { parseSymbols } = await import("./py-parser-DDG53RXI.js");
836
838
  return parseSymbols({ file, content, lang: "py" });
837
839
  }
838
840
  case "rs": {
@@ -889,4 +891,4 @@ export {
889
891
  parseFileContent,
890
892
  parseFilesContent
891
893
  };
892
- //# sourceMappingURL=chunk-NU2IZ72J.js.map
894
+ //# sourceMappingURL=chunk-6LCKF5KH.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveIndexDir
3
- } from "./chunk-N3K2SFEI.js";
3
+ } from "./chunk-3JVSOBHU.js";
4
4
 
5
5
  // src/codebase-index/project-server-endpoint.ts
6
6
  import { createHash } from "node:crypto";
@@ -120,4 +120,4 @@ export {
120
120
  PROJECT_INDEX_SERVER_MAX_FRAME_CHARS,
121
121
  encodeProjectServerMessage
122
122
  };
123
- //# sourceMappingURL=chunk-GDDXX27P.js.map
123
+ //# sourceMappingURL=chunk-6ZLRRC74.js.map
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-ZBMANLYH.js";
7
7
  import {
8
8
  enqueueReindex
9
- } from "./chunk-ZTCJCYLN.js";
9
+ } from "./chunk-CVNCSMVU.js";
10
10
  import {
11
11
  isBinaryBuffer,
12
12
  safeResolveReal,
@@ -274,7 +274,7 @@ function passesExtraGlob(extraGlob, name, full, base) {
274
274
  return extraGlob.test(full);
275
275
  }
276
276
  async function resolveFiles(filesInput, ctx, extraGlob) {
277
- const base = ctx.cwd;
277
+ const base = ctx.workingDir ?? ctx.cwd;
278
278
  const parts = Array.isArray(filesInput) ? filesInput.filter((s) => typeof s === "string").map((s) => s.trim()).filter(Boolean) : filesInput.trim().split(",").map((s) => s.trim()).filter(Boolean);
279
279
  const resolved = [];
280
280
  for (const p of parts) {
@@ -413,4 +413,4 @@ export {
413
413
  replaceTool,
414
414
  __resetRgDetectionForTests
415
415
  };
416
- //# sourceMappingURL=chunk-IYH4OHBP.js.map
416
+ //# sourceMappingURL=chunk-77MBK46T.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-MSOAX3GC.js";
4
4
  import {
5
5
  enqueueReindex
6
- } from "./chunk-ZTCJCYLN.js";
6
+ } from "./chunk-CVNCSMVU.js";
7
7
  import {
8
8
  safeResolveReal,
9
9
  sha256hex,
@@ -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-DK4J2WMH.js.map
521
+ //# sourceMappingURL=chunk-AMURQAJX.js.map
@@ -9,7 +9,7 @@ import {
9
9
  projectIndexServerBuildId,
10
10
  projectIndexServerEndpoint,
11
11
  projectIndexServerMetadataPath
12
- } from "./chunk-GDDXX27P.js";
12
+ } from "./chunk-6ZLRRC74.js";
13
13
  import {
14
14
  CircuitOpenError,
15
15
  IndexTimeoutError,
@@ -24,7 +24,10 @@ import {
24
24
  searchService,
25
25
  statsService,
26
26
  symbolGraphService
27
- } from "./chunk-N3K2SFEI.js";
27
+ } from "./chunk-3JVSOBHU.js";
28
+ import {
29
+ recordIpcPending
30
+ } from "./chunk-ZKC5UNGD.js";
28
31
  import {
29
32
  isIndexablePath
30
33
  } from "./chunk-YOHO4DVT.js";
@@ -385,6 +388,7 @@ var ProjectServerConnection = class {
385
388
  onAbort,
386
389
  onProgress: options.onProgress
387
390
  });
391
+ recordIpcPending(this.pending.size);
388
392
  if (signal && onAbort) {
389
393
  signal.addEventListener("abort", onAbort, { once: true });
390
394
  if (signal.aborted) {
@@ -1032,6 +1036,7 @@ async function callInline(op, args, opts) {
1032
1036
  }
1033
1037
  var chain = Promise.resolve();
1034
1038
  function withMutex(job) {
1039
+ if (process.env["WRONGSTACK_INDEX_BENCH_NO_HOST_MUTEX"] === "1") return job();
1035
1040
  const run = chain.then(job, job);
1036
1041
  chain = run.then(
1037
1042
  () => void 0,
@@ -1048,6 +1053,7 @@ function circuitOpenError() {
1048
1053
  var DEFAULT_DEBOUNCE_MS = 400;
1049
1054
  var DEFAULT_COALESCE_WINDOW_MS = 50;
1050
1055
  var debounceTimers = /* @__PURE__ */ new Map();
1056
+ var pendingReindexCompletions = /* @__PURE__ */ new Map();
1051
1057
  var readyReindexBatches = /* @__PURE__ */ new Map();
1052
1058
  function debounceKey(projectRoot, indexDir, file) {
1053
1059
  return JSON.stringify([projectRoot, indexDir ?? "", file]);
@@ -1055,6 +1061,11 @@ function debounceKey(projectRoot, indexDir, file) {
1055
1061
  function reindexBatchKey(projectRoot, indexDir) {
1056
1062
  return JSON.stringify([projectRoot, indexDir ?? ""]);
1057
1063
  }
1064
+ function settleReindexCompletions(completions, _error) {
1065
+ for (const completion of completions) {
1066
+ completion.resolve();
1067
+ }
1068
+ }
1058
1069
  function flushReadyReindexBatch(key) {
1059
1070
  const batch = readyReindexBatches.get(key);
1060
1071
  if (!batch) return;
@@ -1062,6 +1073,7 @@ function flushReadyReindexBatch(key) {
1062
1073
  if (!indexCircuitBreaker.allowRequest()) {
1063
1074
  const error = circuitOpenError();
1064
1075
  for (const onError of batch.onErrors) onError(error);
1076
+ settleReindexCompletions(batch.completions, error);
1065
1077
  return;
1066
1078
  }
1067
1079
  void withMutex(
@@ -1075,21 +1087,28 @@ function flushReadyReindexBatch(key) {
1075
1087
  { timeoutMs: batch.timeoutMs }
1076
1088
  )
1077
1089
  ).then(
1078
- () => indexCircuitBreaker.recordSuccess(),
1090
+ () => {
1091
+ indexCircuitBreaker.recordSuccess();
1092
+ settleReindexCompletions(batch.completions);
1093
+ },
1079
1094
  (err) => {
1080
1095
  indexCircuitBreaker.recordFailure(err);
1081
1096
  for (const onError of batch.onErrors) onError(err);
1097
+ settleReindexCompletions(batch.completions, err);
1082
1098
  }
1083
1099
  );
1084
1100
  }
1085
1101
  function addReadyReindex(opts) {
1086
1102
  const key = reindexBatchKey(opts.projectRoot, opts.indexDir);
1087
1103
  const windowMs = opts.coalesceWindowMs ?? DEFAULT_COALESCE_WINDOW_MS;
1104
+ const pending2 = pendingReindexCompletions.get(key);
1105
+ pendingReindexCompletions.delete(key);
1088
1106
  const existing = readyReindexBatches.get(key);
1089
1107
  if (existing) {
1090
1108
  existing.files.add(opts.file);
1091
1109
  existing.timeoutMs = Math.max(existing.timeoutMs, opts.timeoutMs);
1092
1110
  if (opts.onError) existing.onErrors.add(opts.onError);
1111
+ if (pending2) for (const completion of pending2) existing.completions.add(completion);
1093
1112
  if (windowMs > 0 && existing.flush) {
1094
1113
  clearTimeout(existing.flush);
1095
1114
  existing.flush = setTimeout(() => flushReadyReindexBatch(key), windowMs);
@@ -1102,7 +1121,8 @@ function addReadyReindex(opts) {
1102
1121
  indexDir: opts.indexDir,
1103
1122
  files: /* @__PURE__ */ new Set([opts.file]),
1104
1123
  timeoutMs: opts.timeoutMs,
1105
- onErrors: new Set(opts.onError ? [opts.onError] : [])
1124
+ onErrors: new Set(opts.onError ? [opts.onError] : []),
1125
+ completions: pending2 ?? /* @__PURE__ */ new Set()
1106
1126
  };
1107
1127
  batch.flush = setTimeout(() => flushReadyReindexBatch(key), Math.max(0, windowMs));
1108
1128
  batch.flush.unref?.();
@@ -1170,7 +1190,13 @@ async function runStartupIndex(opts) {
1170
1190
  }
1171
1191
  function enqueueReindex(opts) {
1172
1192
  const files = opts.files.filter(isIndexableFile);
1173
- if (files.length === 0) return;
1193
+ if (files.length === 0) return Promise.resolve();
1194
+ const completion = new Promise((resolve, reject) => {
1195
+ const key = reindexBatchKey(opts.projectRoot, opts.indexDir);
1196
+ const pending2 = pendingReindexCompletions.get(key) ?? /* @__PURE__ */ new Set();
1197
+ pending2.add({ resolve, reject });
1198
+ pendingReindexCompletions.set(key, pending2);
1199
+ });
1174
1200
  const ms = opts.debounceMs ?? DEFAULT_DEBOUNCE_MS;
1175
1201
  for (const file of files) {
1176
1202
  const key = debounceKey(opts.projectRoot, opts.indexDir, file);
@@ -1190,6 +1216,7 @@ function enqueueReindex(opts) {
1190
1216
  timer.unref?.();
1191
1217
  debounceTimers.set(key, timer);
1192
1218
  }
1219
+ return completion;
1193
1220
  }
1194
1221
  function cancelPendingReindexes() {
1195
1222
  for (const t of debounceTimers.values()) clearTimeout(t);
@@ -1197,7 +1224,15 @@ function cancelPendingReindexes() {
1197
1224
  for (const batch of readyReindexBatches.values()) {
1198
1225
  if (batch.flush) clearTimeout(batch.flush);
1199
1226
  }
1227
+ const cancelled = new Error("pending reindex cancelled");
1228
+ for (const batch of readyReindexBatches.values()) {
1229
+ settleReindexCompletions(batch.completions, cancelled);
1230
+ }
1200
1231
  readyReindexBatches.clear();
1232
+ for (const completions of pendingReindexCompletions.values()) {
1233
+ settleReindexCompletions(completions, cancelled);
1234
+ }
1235
+ pendingReindexCompletions.clear();
1201
1236
  }
1202
1237
  async function searchCodebaseIndex(args, opts = {}) {
1203
1238
  return callIndexOp("search", args, {
@@ -1211,6 +1246,12 @@ async function codebaseIndexStats(args, opts = {}) {
1211
1246
  signal: opts.signal
1212
1247
  });
1213
1248
  }
1249
+ async function codebaseContext(args) {
1250
+ return callIndexOp("context", args, { timeoutMs: DEFAULT_QUERY_TIMEOUT_MS });
1251
+ }
1252
+ async function codebaseVectorSearch(args) {
1253
+ return callIndexOp("vectorSearch", args, { timeoutMs: DEFAULT_QUERY_TIMEOUT_MS });
1254
+ }
1214
1255
  async function packageGraphService2(args) {
1215
1256
  return callIndexOp("packageGraph", args, { timeoutMs: DEFAULT_QUERY_TIMEOUT_MS });
1216
1257
  }
@@ -1260,6 +1301,8 @@ export {
1260
1301
  cancelPendingReindexes,
1261
1302
  searchCodebaseIndex,
1262
1303
  codebaseIndexStats,
1304
+ codebaseContext,
1305
+ codebaseVectorSearch,
1263
1306
  packageGraphService2 as packageGraphService,
1264
1307
  fileGraphService2 as fileGraphService,
1265
1308
  symbolGraphService2 as symbolGraphService,
@@ -1269,4 +1312,4 @@ export {
1269
1312
  checkCodebaseIndexServerHealth,
1270
1313
  ensureCodebaseIndexServer
1271
1314
  };
1272
- //# sourceMappingURL=chunk-ZTCJCYLN.js.map
1315
+ //# sourceMappingURL=chunk-CVNCSMVU.js.map
@@ -30,7 +30,19 @@ var fetchTool = {
30
30
  category: "Network",
31
31
  description: "Fetch a URL and return its content. HTML pages are automatically converted to clean markdown. This tool has strong SSRF protections (private IPs, localhost, and cloud metadata endpoints are blocked by default).",
32
32
  usageHint: "Use this when you need external information (documentation, API responses, web pages, etc.).\n\nSecurity notes:\n- Only HTTPS is allowed by default.\n- Internal/private networks are blocked unless explicitly enabled via environment variable.\n- Redirects are followed but re-validated at each hop.\n- Output is capped (128KB by default) to avoid flooding context.\nPrefer this over raw `bash curl` or `bash wget`.",
33
- permission: "auto",
33
+ // H-9 (AT-02): `fetch` was `permission:'auto'` with `mutating:false`, so
34
+ // the `tool.permission === 'auto' && !isMutating` branch at
35
+ // `permission-policy.ts:408-424` returned `{permission:'auto'}` for
36
+ // every call, in every mode (YOLO or not) — a complete, prompt-free
37
+ // exfiltration primitive when chained with the equally-unprompted
38
+ // `read` of `.env`/`~/.ssh/*` (sensitive-read gate is `!effectiveYolo`
39
+ // and therefore also skipped under the shipped default). Promoting to
40
+ // `permission:'confirm'` is the narrowest change that closes the
41
+ // exfiltration path: it prompts the user, and an "always" answer is
42
+ // persisted to `trust.json` against the URL subject declared below.
43
+ // The SSRF guard (`guardedFetch`) still constrains where the request
44
+ // can land; this change just ensures the *whether* is no longer silent.
45
+ permission: "confirm",
34
46
  mutating: false,
35
47
  capabilities: ["net.outbound"],
36
48
  icon: "web",
@@ -269,4 +281,4 @@ function prettyJson(s) {
269
281
  export {
270
282
  fetchTool
271
283
  };
272
- //# sourceMappingURL=chunk-MJSJWXBF.js.map
284
+ //# sourceMappingURL=chunk-DX5KZEMK.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  enqueueReindex
3
- } from "./chunk-ZTCJCYLN.js";
3
+ } from "./chunk-CVNCSMVU.js";
4
4
  import {
5
5
  resolveRealInsideRoot,
6
6
  safeResolveReal,
@@ -395,4 +395,4 @@ function extractPatchedFiles(output) {
395
395
  export {
396
396
  patchTool
397
397
  };
398
- //# sourceMappingURL=chunk-CGXTR34H.js.map
398
+ //# sourceMappingURL=chunk-E2ZD4ERD.js.map
@@ -9,7 +9,7 @@ import {
9
9
  import {
10
10
  buildWin32CmdShimInvocation,
11
11
  resolveWin32Command
12
- } from "./chunk-KE7A76VC.js";
12
+ } from "./chunk-5U5ULQX2.js";
13
13
 
14
14
  // src/_spawn-stream.ts
15
15
  import { spawn } from "node:child_process";
@@ -285,4 +285,4 @@ function utf8Prefix(text, maxBytes) {
285
285
  export {
286
286
  spawnStream
287
287
  };
288
- //# sourceMappingURL=chunk-DRRY6SCM.js.map
288
+ //# sourceMappingURL=chunk-EMA2XENR.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  tryLegacyCodeOperation
3
- } from "./chunk-T3SMFF5Q.js";
3
+ } from "./chunk-GU7QJ37F.js";
4
4
  import {
5
5
  spawnStream
6
- } from "./chunk-DRRY6SCM.js";
6
+ } from "./chunk-EMA2XENR.js";
7
7
  import {
8
8
  normalizeCommandOutput,
9
9
  safeResolveReal
@@ -100,6 +100,14 @@ var lintTool = {
100
100
  }
101
101
  yield { type: "log", text: `Running ${detected}\u2026`, data: { linter: detected } };
102
102
  const files = input.files ? (Array.isArray(input.files) ? input.files : input.files.split(",")).map((f) => f.trim().replace(/\\/g, "/")).filter(Boolean) : [];
103
+ for (const f of files) {
104
+ if (f.startsWith("-")) {
105
+ throw new ToolValidationError({
106
+ message: `lint: file path "${f}" may not begin with '-' (flag injection)`,
107
+ field: "files"
108
+ });
109
+ }
110
+ }
103
111
  const args = [];
104
112
  if (detected === "eslint") {
105
113
  if (input.fix) args.push("--fix");
@@ -181,4 +189,4 @@ async function detectLinter(cwd) {
181
189
  export {
182
190
  lintTool
183
191
  };
184
- //# sourceMappingURL=chunk-3D5DJWOE.js.map
192
+ //# sourceMappingURL=chunk-FC3X7GGJ.js.map
@@ -2,7 +2,7 @@ import {
2
2
  executeLanguagePlan,
3
3
  executePackagePlan,
4
4
  planLanguageOperation
5
- } from "./chunk-7N5U2RAU.js";
5
+ } from "./chunk-3LS3FYEF.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-T3SMFF5Q.js.map
107
+ //# sourceMappingURL=chunk-GU7QJ37F.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  tryLegacyCodeOperation
3
- } from "./chunk-T3SMFF5Q.js";
3
+ } from "./chunk-GU7QJ37F.js";
4
4
  import {
5
5
  spawnStream
6
- } from "./chunk-DRRY6SCM.js";
6
+ } from "./chunk-EMA2XENR.js";
7
7
  import {
8
8
  detectPackageManager,
9
9
  normalizeCommandOutput,
@@ -162,4 +162,4 @@ async function findTsConfig(cwd) {
162
162
  export {
163
163
  typecheckTool
164
164
  };
165
- //# sourceMappingURL=chunk-4WPBS45A.js.map
165
+ //# sourceMappingURL=chunk-IRUEHGCR.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  tryLegacyPackageOperation
3
- } from "./chunk-T3SMFF5Q.js";
3
+ } from "./chunk-GU7QJ37F.js";
4
4
  import {
5
5
  spawnStream
6
- } from "./chunk-DRRY6SCM.js";
6
+ } from "./chunk-EMA2XENR.js";
7
7
  import {
8
8
  COMMAND_OUTPUT_MAX_BYTES,
9
9
  detectPackageManager,
@@ -220,4 +220,4 @@ function extractAdvisories(data) {
220
220
  export {
221
221
  auditTool
222
222
  };
223
- //# sourceMappingURL=chunk-WEEVSWQB.js.map
223
+ //# sourceMappingURL=chunk-KIQTABBJ.js.map
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-HDYUBRMF.js";
15
15
  import {
16
16
  resolvePowerShell
17
- } from "./chunk-KE7A76VC.js";
17
+ } from "./chunk-5U5ULQX2.js";
18
18
  import {
19
19
  normalizeCommandOutput
20
20
  } from "./chunk-ZUFHAHTE.js";
@@ -1093,4 +1093,4 @@ export {
1093
1093
  checkAndBlockKillCommand,
1094
1094
  bashTool
1095
1095
  };
1096
- //# sourceMappingURL=chunk-6H4ERJP7.js.map
1096
+ //# sourceMappingURL=chunk-KYVOTHG7.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  tryLegacyPackageOperation
3
- } from "./chunk-T3SMFF5Q.js";
3
+ } from "./chunk-GU7QJ37F.js";
4
4
  import {
5
5
  spawnStream
6
- } from "./chunk-DRRY6SCM.js";
6
+ } from "./chunk-EMA2XENR.js";
7
7
  import {
8
8
  detectPackageManager,
9
9
  normalizeCommandOutput,
@@ -253,4 +253,4 @@ function resolveManifestPath(cwd, pkgManager) {
253
253
  export {
254
254
  installTool
255
255
  };
256
- //# sourceMappingURL=chunk-O6BY43ZB.js.map
256
+ //# sourceMappingURL=chunk-MIV2RU5B.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  todoTool
3
- } from "./chunk-FBUP524S.js";
3
+ } from "./chunk-4YKVHCQC.js";
4
4
  import {
5
5
  projectSessionPlanToKanban
6
6
  } from "./chunk-X6KXNHUO.js";
@@ -414,4 +414,4 @@ function mkResult(plan, ok, message, todos) {
414
414
  export {
415
415
  planTool
416
416
  };
417
- //# sourceMappingURL=chunk-5KS24LTS.js.map
417
+ //# sourceMappingURL=chunk-NOCU555K.js.map
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  buildWin32CmdShimInvocation,
7
7
  resolveWin32Command
8
- } from "./chunk-KE7A76VC.js";
8
+ } from "./chunk-5U5ULQX2.js";
9
9
  import {
10
10
  COMMAND_OUTPUT_MAX_BYTES,
11
11
  detectPackageManager,
@@ -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-YXANP5QB.js");
69
+ const { detectNonJsEcosystem } = await import("./legacy-bridge-WVQ4BHDI.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-6GOZTS6F.js.map
285
+ //# sourceMappingURL=chunk-OUEH4I4X.js.map