@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
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-XRNN44QY.js";
4
4
  import {
5
5
  spawnStream
6
- } from "./chunk-DRRY6SCM.js";
6
+ } from "./chunk-EMA2XENR.js";
7
7
  import {
8
8
  codebaseContext,
9
9
  codebaseIndexStats,
@@ -15,7 +15,7 @@ import {
15
15
  outgoingCallsService,
16
16
  runStartupIndex,
17
17
  searchCodebaseIndex
18
- } from "./chunk-TI5COGLY.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-52UXXQMP.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;
@@ -875,6 +875,7 @@ var codebaseImpactAnalysisTool = {
875
875
  };
876
876
 
877
877
  // src/codebase-index/codebase-incoming-calls-tool.ts
878
+ import { ToolValidationError } from "@wrongstack/core/types";
878
879
  import { toErrorMessage as toErrorMessage3 } from "@wrongstack/core/utils";
879
880
  var codebaseIncomingCallsTool = {
880
881
  name: "codebase-incoming-calls",
@@ -912,6 +913,12 @@ var codebaseIncomingCallsTool = {
912
913
  required: ["symbol"]
913
914
  },
914
915
  async execute(input, ctx) {
916
+ if (!input?.symbol || typeof input.symbol !== "string" || !input.symbol.trim()) {
917
+ throw new ToolValidationError({
918
+ message: "codebase-incoming-calls: symbol is required and cannot be empty",
919
+ field: "symbol"
920
+ });
921
+ }
915
922
  const state = getIndexState();
916
923
  if (state.lastError) {
917
924
  const circuit = state.circuit;
@@ -1007,10 +1014,10 @@ var codebaseIncomingCallsTool = {
1007
1014
  };
1008
1015
 
1009
1016
  // src/codebase-index/codebase-index-tool.ts
1010
- import { ToolValidationError as ToolValidationError2 } from "@wrongstack/core/types";
1017
+ import { ToolValidationError as ToolValidationError3 } from "@wrongstack/core/types";
1011
1018
 
1012
1019
  // src/codebase-index/codebase-search-tool.ts
1013
- import { ToolValidationError } from "@wrongstack/core/types";
1020
+ import { ToolValidationError as ToolValidationError2 } from "@wrongstack/core/types";
1014
1021
  import { toErrorMessage as toErrorMessage4 } from "@wrongstack/core/utils";
1015
1022
  var INDEXABLE_LANG_IDS = [
1016
1023
  ...new Set(Object.values(EXT_TO_LANG))
@@ -1019,7 +1026,7 @@ var codebaseSearchTool = {
1019
1026
  name: "codebase-search",
1020
1027
  category: "Project",
1021
1028
  icon: "index",
1022
- 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.",
1023
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.",
1024
1031
  permission: "auto",
1025
1032
  mutating: false,
@@ -1081,20 +1088,20 @@ var codebaseSearchTool = {
1081
1088
  },
1082
1089
  preferLsp: {
1083
1090
  type: "boolean",
1084
- 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."
1085
1092
  }
1086
1093
  },
1087
1094
  required: ["query"]
1088
1095
  },
1089
1096
  async execute(input, ctx, execOpts) {
1090
1097
  if (!input?.query || typeof input.query !== "string" || !input.query.trim()) {
1091
- throw new ToolValidationError({
1098
+ throw new ToolValidationError2({
1092
1099
  message: "codebase-search: query is required and cannot be empty",
1093
1100
  field: "query"
1094
1101
  });
1095
1102
  }
1096
1103
  if (input.lspKind !== void 0 && (!Number.isInteger(input.lspKind) || input.lspKind < 1 || input.lspKind > 26)) {
1097
- throw new ToolValidationError({
1104
+ throw new ToolValidationError2({
1098
1105
  message: "codebase-search: lspKind must be an integer between 1 and 26",
1099
1106
  field: "lspKind"
1100
1107
  });
@@ -1212,7 +1219,7 @@ var codebaseIndexTool = {
1212
1219
  signal?.throwIfAborted();
1213
1220
  if (input.langs) {
1214
1221
  if (!Array.isArray(input.langs) || input.langs.length === 0) {
1215
- throw new ToolValidationError2({
1222
+ throw new ToolValidationError3({
1216
1223
  message: "codebase-index: langs cannot be an empty array. Pass at least one valid language or omit langs.",
1217
1224
  field: "langs"
1218
1225
  });
@@ -1221,7 +1228,7 @@ var codebaseIndexTool = {
1221
1228
  (lang) => !INDEXABLE_LANG_IDS.includes(lang)
1222
1229
  );
1223
1230
  if (unknown.length > 0) {
1224
- throw new ToolValidationError2({
1231
+ throw new ToolValidationError3({
1225
1232
  message: `codebase-index: unknown lang(s) ${unknown.map((l) => `"${l}"`).join(", ")}. Valid ids: ${INDEXABLE_LANG_IDS.join(", ")}.`,
1226
1233
  field: "langs"
1227
1234
  });
@@ -1350,6 +1357,7 @@ var codebaseInvariantCheckTool = {
1350
1357
  };
1351
1358
 
1352
1359
  // src/codebase-index/codebase-outgoing-calls-tool.ts
1360
+ import { ToolValidationError as ToolValidationError4 } from "@wrongstack/core/types";
1353
1361
  import { toErrorMessage as toErrorMessage6 } from "@wrongstack/core/utils";
1354
1362
  var codebaseOutgoingCallsTool = {
1355
1363
  name: "codebase-outgoing-calls",
@@ -1387,6 +1395,12 @@ var codebaseOutgoingCallsTool = {
1387
1395
  required: ["symbol"]
1388
1396
  },
1389
1397
  async execute(input, ctx) {
1398
+ if (!input?.symbol || typeof input.symbol !== "string" || !input.symbol.trim()) {
1399
+ throw new ToolValidationError4({
1400
+ message: "codebase-outgoing-calls: symbol is required and cannot be empty",
1401
+ field: "symbol"
1402
+ });
1403
+ }
1390
1404
  const state = getIndexState();
1391
1405
  if (state.lastError) {
1392
1406
  const circuit = state.circuit;
@@ -3554,7 +3568,7 @@ async function buildProjectAtlasBrief(projectRoot, opts = {}) {
3554
3568
  }
3555
3569
 
3556
3570
  // src/codebase-index/codebase-context-tool.ts
3557
- import { ToolValidationError as ToolValidationError3 } from "@wrongstack/core/types";
3571
+ import { ToolValidationError as ToolValidationError5 } from "@wrongstack/core/types";
3558
3572
  import { toErrorMessage as toErrorMessage11 } from "@wrongstack/core/utils";
3559
3573
  var TOOL_TIMEOUT_MS = 35e3;
3560
3574
  var VECTOR_HIT_LIMIT = 12;
@@ -3617,7 +3631,7 @@ var codebaseContextTool = {
3617
3631
  async execute(input, ctx, execOpts) {
3618
3632
  const query = typeof input.query === "string" ? input.query.trim() : "";
3619
3633
  if (query.length === 0) {
3620
- throw new ToolValidationError3({
3634
+ throw new ToolValidationError5({
3621
3635
  message: "codebase-context requires a non-empty `query`.",
3622
3636
  field: "query"
3623
3637
  });
@@ -4033,4 +4047,4 @@ export {
4033
4047
  embedFiles,
4034
4048
  embedProjectFiles
4035
4049
  };
4036
- //# sourceMappingURL=chunk-HWXIRVKH.js.map
4050
+ //# sourceMappingURL=chunk-OSXM3O3J.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
  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-LQSOU63Z.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-MBR5VAB5.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-52UXXQMP.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-TI5COGLY.js.map
1355
+ //# sourceMappingURL=chunk-PVQBD3TA.js.map
@@ -1,13 +1,13 @@
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
  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";
@@ -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-R36RWYXE.js.map
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-ZKC5UNGD.js";
9
9
  import {
10
10
  resolveWin32Command
11
- } from "./chunk-KE7A76VC.js";
11
+ } from "./chunk-5U5ULQX2.js";
12
12
 
13
13
  // src/codebase-index/py-parser.ts
14
14
  import { spawn } from "node:child_process";
@@ -384,4 +384,4 @@ export {
384
384
  parseSymbols,
385
385
  resolvePythonBinary
386
386
  };
387
- //# sourceMappingURL=chunk-3AU6CZWL.js.map
387
+ //# sourceMappingURL=chunk-REWOZIA4.js.map
@@ -1,13 +1,13 @@
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
  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-QA6IASYX.js.map
234
+ //# sourceMappingURL=chunk-S6E2AM4U.js.map