@wrongstack/tools 1.0.2 → 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 (114) hide show
  1. package/README.md +0 -6
  2. package/dist/_util.d.ts +18 -0
  3. package/dist/_win32-resolve.d.ts +1 -6
  4. package/dist/audit.js +6 -6
  5. package/dist/bash.js +3 -3
  6. package/dist/browser/index.d.ts +1 -1
  7. package/dist/browser/index.js +9 -1
  8. package/dist/browser/tools.d.ts +14 -0
  9. package/dist/builtin.d.ts +16 -13
  10. package/dist/builtin.js +43 -47
  11. package/dist/{chunk-DL2ARI4S.js → chunk-24Q4O34E.js} +5 -5
  12. package/dist/{chunk-AQ5YBURX.js → chunk-2IC5FRD7.js} +2 -2
  13. package/dist/{chunk-4ERMPDHV.js → chunk-2QY3DC3H.js} +20 -16
  14. package/dist/{chunk-VU3QBYL4.js → chunk-2ZWQIVEW.js} +2 -2
  15. package/dist/{chunk-JDOO4P6Z.js → chunk-3F7HQ3KS.js} +2 -2
  16. package/dist/{chunk-MJSJWXBF.js → chunk-47GYABZW.js} +15 -3
  17. package/dist/{chunk-6H4ERJP7.js → chunk-4KI4HHID.js} +3 -3
  18. package/dist/{chunk-X6KXNHUO.js → chunk-5BKQVP56.js} +22 -5
  19. package/dist/{chunk-KE7A76VC.js → chunk-5U5ULQX2.js} +4 -14
  20. package/dist/{chunk-SMARDKAC.js → chunk-5UA4TNJJ.js} +2 -2
  21. package/dist/{chunk-SOR7OCYP.js → chunk-6XYFYLN7.js} +23 -1
  22. package/dist/{chunk-KVTEIUND.js → chunk-A636Z2TG.js} +3 -3
  23. package/dist/{chunk-52UXXQMP.js → chunk-AX5ZG5O5.js} +3 -3
  24. package/dist/{chunk-7HL23T3T.js → chunk-BU6VUXWG.js} +2 -2
  25. package/dist/{chunk-WEEVSWQB.js → chunk-C64UUXTA.js} +4 -4
  26. package/dist/{chunk-4WPBS45A.js → chunk-D4HWMWGE.js} +4 -4
  27. package/dist/{chunk-DRRY6SCM.js → chunk-EMA2XENR.js} +2 -2
  28. package/dist/{chunk-TU5MTW2S.js → chunk-EMCIC2JA.js} +3 -3
  29. package/dist/{chunk-ASEXQRA7.js → chunk-FEXPWYU7.js} +7 -5
  30. package/dist/{chunk-ZUFHAHTE.js → chunk-HKR56VNF.js} +15 -2
  31. package/dist/{chunk-7N5U2RAU.js → chunk-JK5WXW4S.js} +3 -3
  32. package/dist/{chunk-T3SMFF5Q.js → chunk-JQ43NVFU.js} +2 -2
  33. package/dist/{chunk-7XUEPBNT.js → chunk-KVEL4EFI.js} +3 -3
  34. package/dist/{chunk-VZGPASGD.js → chunk-MG7CUN6R.js} +2 -2
  35. package/dist/{chunk-NFX2IUQA.js → chunk-NERS6GBT.js} +3 -3
  36. package/dist/{chunk-5KS24LTS.js → chunk-NKOTOW6X.js} +3 -3
  37. package/dist/{chunk-NJX2RXKJ.js → chunk-OBVXDVLE.js} +12 -4
  38. package/dist/{chunk-HWXIRVKH.js → chunk-OSXM3O3J.js} +29 -15
  39. package/dist/{chunk-LQSOU63Z.js → chunk-OZVGRDCM.js} +3 -3
  40. package/dist/{chunk-TI5COGLY.js → chunk-PVQBD3TA.js} +46 -6
  41. package/dist/{chunk-3D5DJWOE.js → chunk-R36RWYXE.js} +12 -4
  42. package/dist/{chunk-3AU6CZWL.js → chunk-REWOZIA4.js} +2 -2
  43. package/dist/{chunk-QA6IASYX.js → chunk-S6E2AM4U.js} +4 -4
  44. package/dist/{chunk-UCXFTCAI.js → chunk-T34DVSAE.js} +236 -177
  45. package/dist/{chunk-FBUP524S.js → chunk-TGVQMKVH.js} +15 -4
  46. package/dist/{chunk-MBR5VAB5.js → chunk-VQDSIHAR.js} +40 -2
  47. package/dist/{chunk-UOYRAS4J.js → chunk-VSOVZ5JI.js} +4 -4
  48. package/dist/{chunk-RV7BVTDG.js → chunk-WKXL5XHU.js} +2 -2
  49. package/dist/{chunk-DKHMPKDG.js → chunk-WWAXJKX3.js} +4 -4
  50. package/dist/{chunk-24T5XIJU.js → chunk-YA2ZYCJY.js} +4 -4
  51. package/dist/{chunk-MGPR7VG3.js → chunk-YILT3CSO.js} +3 -3
  52. package/dist/{chunk-6GOZTS6F.js → chunk-YJQQ5F5J.js} +4 -4
  53. package/dist/{chunk-EL2NJXSK.js → chunk-YZLOYJGN.js} +2 -2
  54. package/dist/{chunk-O6BY43ZB.js → chunk-ZETZHHV5.js} +4 -4
  55. package/dist/clarify.d.ts +18 -3
  56. package/dist/codebase-index/codebase-search-tool.d.ts +2 -3
  57. package/dist/codebase-index/index.js +9 -9
  58. package/dist/codebase-index/parser-worker-script.js +3 -3
  59. package/dist/codebase-index/project-server-endpoint.d.ts +33 -0
  60. package/dist/codebase-index/project-server.js +5 -5
  61. package/dist/codebase-index/worker.js +4 -4
  62. package/dist/diff.js +2 -2
  63. package/dist/e2e.js +2 -2
  64. package/dist/edit.js +8 -8
  65. package/dist/exec.js +3 -3
  66. package/dist/fetch.js +2 -2
  67. package/dist/format.js +6 -6
  68. package/dist/git.js +2 -2
  69. package/dist/glob.js +2 -2
  70. package/dist/{go-parser-QIEXU3P2.js → go-parser-EMKTAAD3.js} +2 -2
  71. package/dist/grep.js +2 -2
  72. package/dist/index.d.ts +2 -8
  73. package/dist/index.js +68 -84
  74. package/dist/install.js +6 -6
  75. package/dist/json.js +2 -2
  76. package/dist/kanban.js +2 -2
  77. package/dist/languages/index.js +4 -4
  78. package/dist/{legacy-bridge-YXANP5QB.js → legacy-bridge-XM2GV665.js} +6 -6
  79. package/dist/lint.js +6 -6
  80. package/dist/logs.js +2 -2
  81. package/dist/outdated.js +3 -3
  82. package/dist/pack.js +44 -48
  83. package/dist/{parser-dispatch-37FT3EXQ.js → parser-dispatch-IF75EZFB.js} +4 -4
  84. package/dist/patch.js +8 -8
  85. package/dist/plan.js +4 -4
  86. package/dist/{py-parser-6GJTGUXK.js → py-parser-DDG53RXI.js} +3 -3
  87. package/dist/read-url-content.d.ts +17 -0
  88. package/dist/read.js +8 -8
  89. package/dist/replace.js +8 -8
  90. package/dist/session-kanban.js +1 -1
  91. package/dist/task.js +4 -4
  92. package/dist/test.js +6 -6
  93. package/dist/todo.js +3 -3
  94. package/dist/tool-search.js +1 -1
  95. package/dist/tool-tier.d.ts +12 -2
  96. package/dist/tool-tier.js +45 -49
  97. package/dist/tree.js +2 -2
  98. package/dist/typecheck.js +6 -6
  99. package/dist/win32.js +1 -1
  100. package/dist/write.js +8 -8
  101. package/package.json +5 -21
  102. package/dist/batch-tool-use.d.ts +0 -24
  103. package/dist/batch-tool-use.js +0 -7
  104. package/dist/chunk-7ODZTPCU.js +0 -128
  105. package/dist/chunk-CHEK3ASV.js +0 -183
  106. package/dist/chunk-KLJZ4WV4.js +0 -213
  107. package/dist/chunk-VBF2YXUW.js +0 -203
  108. package/dist/document.d.ts +0 -25
  109. package/dist/document.js +0 -8
  110. package/dist/scaffold.d.ts +0 -23
  111. package/dist/scaffold.js +0 -10
  112. package/dist/set-working-dir.d.ts +0 -17
  113. package/dist/tool-help.d.ts +0 -21
  114. package/dist/tool-help.js +0 -7
@@ -251,7 +251,9 @@ function applySessionKanbanBoardToTodos(context, board, options) {
251
251
  ).map((task) => sessionTodoFromTask(task, board));
252
252
  const allCompleted = projectedTodos.length > 0 && projectedTodos.every((todo) => todo.status === "completed");
253
253
  const effectiveTodos = allCompleted ? [] : projectedTodos;
254
- if (sameTodos(context.todos, effectiveTodos)) return [...context.todos];
254
+ if (sameTodos(context.todos, projectedTodos) || sameTodos(context.todos, effectiveTodos)) {
255
+ return [...context.todos];
256
+ }
255
257
  options.suppressedTodoMirrors.add(context);
256
258
  try {
257
259
  context.state.replaceTodos(projectedTodos);
@@ -279,7 +281,11 @@ function applyManagedKanbanBoardToTodos(context, board, suppressedTodoMirrors2,
279
281
  (task) => task.status !== "archived" && task.mergedIntoTaskId === void 0 && (!task.childTaskIds || task.childTaskIds.length === 0)
280
282
  )
281
283
  ).map((task) => managedTodoFromTask(task, board));
282
- if (sameTodos(context.todos, projectedTodos)) return [...context.todos];
284
+ const allCompleted = projectedTodos.length > 0 && projectedTodos.every((todo) => todo.status === "completed");
285
+ const effectiveTodos = allCompleted ? [] : projectedTodos;
286
+ if (sameTodos(context.todos, projectedTodos) || sameTodos(context.todos, effectiveTodos)) {
287
+ return [...context.todos];
288
+ }
283
289
  suppressedTodoMirrors2.add(context);
284
290
  try {
285
291
  context.state.replaceTodos(projectedTodos);
@@ -369,6 +375,16 @@ async function applySessionKanbanTaskToSource(context, task, suppressedTodoMirro
369
375
  // src/session-kanban.ts
370
376
  var SESSION_BOARD_TAG = "session-work";
371
377
  var MIRROR_DISABLED_ENV = "WRONGSTACK_KANBAN_TASK_MIRROR";
378
+ var PURGE_AFTER_ARCHIVE_DAYS_ENV = "WRONGSTACK_KANBAN_ARCHIVE_PURGE_DAYS";
379
+ function sessionBoardRetention() {
380
+ const raw = Number.parseFloat(process.env[PURGE_AFTER_ARCHIVE_DAYS_ENV] ?? "");
381
+ const purgeDays = Number.isFinite(raw) && raw > 0 ? raw : void 0;
382
+ return {
383
+ mode: "archive_after_ttl",
384
+ ttlMs: 7 * 24 * 60 * 60 * 1e3,
385
+ ...purgeDays !== void 0 ? { purgeAfterArchiveMs: Math.round(purgeDays * 24 * 60 * 60 * 1e3) } : {}
386
+ };
387
+ }
372
388
  var SESSION_KANBAN_COLUMNS = DEFAULT_COLUMNS.map((column) => ({
373
389
  ...column
374
390
  }));
@@ -464,7 +480,7 @@ async function ensureSessionKanbanBoard(projectRoot, sessionId) {
464
480
  columns: SESSION_KANBAN_COLUMNS,
465
481
  generatedBy: `session-kanban:${sessionId}`,
466
482
  kind: "session_mirror",
467
- retention: { mode: "archive_after_ttl", ttlMs: 7 * 24 * 60 * 60 * 1e3 }
483
+ retention: sessionBoardRetention()
468
484
  });
469
485
  }
470
486
  if (!sameColumns(board.columns) || !board.tags?.includes(SESSION_BOARD_TAG)) {
@@ -640,10 +656,11 @@ function queueLatestMirror(projectRoot, sessionId, graph, sourceSystem) {
640
656
  const pending = pendingMirrors.get(key);
641
657
  if (pending) {
642
658
  pendingMirrors.delete(key);
659
+ const carried = pending.reconciliationGraph ? completedReconciliationGraph(pending.graph, [pending.reconciliationGraph]) : void 0;
643
660
  queueLatestMirror(
644
661
  pending.projectRoot,
645
662
  pending.sessionId,
646
- pending.graph,
663
+ carried ?? pending.graph,
647
664
  pending.sourceSystem
648
665
  );
649
666
  }
@@ -997,4 +1014,4 @@ export {
997
1014
  applyManagedKanbanBoardToTodos2 as applyManagedKanbanBoardToTodos,
998
1015
  applySessionKanbanTaskToSource2 as applySessionKanbanTaskToSource
999
1016
  };
1000
- //# sourceMappingURL=chunk-X6KXNHUO.js.map
1017
+ //# sourceMappingURL=chunk-5BKQVP56.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,7 +1,7 @@
1
1
  import {
2
2
  applySessionKanbanTaskToSource,
3
3
  taskFileToSerializedGraph
4
- } from "./chunk-X6KXNHUO.js";
4
+ } from "./chunk-5BKQVP56.js";
5
5
 
6
6
  // src/kanban.ts
7
7
  import { stripLifecycleIssues as stripLifecycleIssues2 } from "@wrongstack/kanban";
@@ -2118,4 +2118,4 @@ export {
2118
2118
  recordKanbanVerificationEvidence,
2119
2119
  kanbanTool
2120
2120
  };
2121
- //# sourceMappingURL=chunk-SMARDKAC.js.map
2121
+ //# sourceMappingURL=chunk-5UA4TNJJ.js.map
@@ -1363,6 +1363,24 @@ var browserTools = [
1363
1363
  ];
1364
1364
  for (const tool of browserTools) tool.icon = "web";
1365
1365
  for (const tool of browserTools) tool.timeoutMs ??= 6e4;
1366
+ var BROWSER_TOOL_NAMES = Object.freeze(browserTools.map((t) => t.name));
1367
+ function enableBrowserSuite(registry) {
1368
+ let count = 0;
1369
+ for (const name of BROWSER_TOOL_NAMES) {
1370
+ if (registry.enable(name)) count++;
1371
+ }
1372
+ return count;
1373
+ }
1374
+ function disableBrowserSuite(registry) {
1375
+ let count = 0;
1376
+ for (const name of BROWSER_TOOL_NAMES) {
1377
+ if (registry.disable(name, "user")) count++;
1378
+ }
1379
+ return count;
1380
+ }
1381
+ function isBrowserSuiteEnabled(registry) {
1382
+ return BROWSER_TOOL_NAMES.every((name) => !registry.isDisabled(name) && registry.get(name) !== void 0);
1383
+ }
1366
1384
  async function shutdownBrowserTools() {
1367
1385
  const active = [...managers.values()];
1368
1386
  managers.clear();
@@ -1396,6 +1414,10 @@ export {
1396
1414
  browserUploadTool,
1397
1415
  browserCloseTool,
1398
1416
  browserTools,
1417
+ BROWSER_TOOL_NAMES,
1418
+ enableBrowserSuite,
1419
+ disableBrowserSuite,
1420
+ isBrowserSuiteEnabled,
1399
1421
  shutdownBrowserTools
1400
1422
  };
1401
- //# sourceMappingURL=chunk-SOR7OCYP.js.map
1423
+ //# sourceMappingURL=chunk-6XYFYLN7.js.map
@@ -3,12 +3,12 @@ import {
3
3
  } from "./chunk-MSOAX3GC.js";
4
4
  import {
5
5
  enqueueReindex
6
- } from "./chunk-TI5COGLY.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-KVTEIUND.js.map
182
+ //# sourceMappingURL=chunk-A636Z2TG.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  parseFilesContent
3
- } from "./chunk-DL2ARI4S.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-37FT3EXQ.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-52UXXQMP.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,15 +1,15 @@
1
1
  import {
2
2
  tryLegacyPackageOperation
3
- } from "./chunk-T3SMFF5Q.js";
3
+ } from "./chunk-JQ43NVFU.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,
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-WEEVSWQB.js.map
223
+ //# sourceMappingURL=chunk-C64UUXTA.js.map
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  tryLegacyCodeOperation
3
- } from "./chunk-T3SMFF5Q.js";
3
+ } from "./chunk-JQ43NVFU.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,
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-4WPBS45A.js.map
165
+ //# sourceMappingURL=chunk-D4HWMWGE.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,11 +1,11 @@
1
1
  import {
2
2
  enqueueReindex
3
- } from "./chunk-TI5COGLY.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-TU5MTW2S.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
@@ -1,10 +1,10 @@
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
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-7N5U2RAU.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-7N5U2RAU.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-T3SMFF5Q.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-TI5COGLY.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-7XUEPBNT.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-EL2NJXSK.js";
3
+ } from "./chunk-YZLOYJGN.js";
4
4
  import {
5
5
  TIER1_TOOLS,
6
6
  TIER2_TOOLS
7
- } from "./chunk-UCXFTCAI.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-NFX2IUQA.js.map
57
+ //# sourceMappingURL=chunk-NERS6GBT.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  todoTool
3
- } from "./chunk-FBUP524S.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-5KS24LTS.js.map
417
+ //# sourceMappingURL=chunk-NKOTOW6X.js.map
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  tryLegacyCodeOperation
3
- } from "./chunk-T3SMFF5Q.js";
3
+ } from "./chunk-JQ43NVFU.js";
4
4
  import {
5
5
  spawnStream
6
- } from "./chunk-DRRY6SCM.js";
6
+ } from "./chunk-EMA2XENR.js";
7
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";
@@ -149,6 +149,14 @@ var formatTool = {
149
149
  });
150
150
  }
151
151
  }
152
+ for (const f of fileList) {
153
+ if (f.startsWith("-")) {
154
+ throw new ToolValidationError({
155
+ message: `format: file path "${f}" may not begin with '-' (flag injection)`,
156
+ field: "files"
157
+ });
158
+ }
159
+ }
152
160
  let args;
153
161
  if (detected === "prettier") {
154
162
  args = [input.check ? "--check" : "--write"];
@@ -243,4 +251,4 @@ export {
243
251
  parseFormatterCounts,
244
252
  detectFixer
245
253
  };
246
- //# sourceMappingURL=chunk-NJX2RXKJ.js.map
254
+ //# sourceMappingURL=chunk-OBVXDVLE.js.map