@wrongstack/tools 0.319.1 → 0.320.1

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 (81) hide show
  1. package/dist/audit.js +7 -7
  2. package/dist/bash.js +5 -5
  3. package/dist/browser/index.js +1 -1
  4. package/dist/builtin.js +36 -36
  5. package/dist/{chunk-GMZYW52L.js → chunk-23EX5WDO.js} +6 -3
  6. package/dist/{chunk-OG2BEUBY.js → chunk-34VLZ35Z.js} +13 -9
  7. package/dist/{chunk-O44IMQCN.js → chunk-3GIKYHLA.js} +3 -3
  8. package/dist/{chunk-OTINMOKK.js → chunk-4BABEJC2.js} +26 -26
  9. package/dist/{chunk-42BHI7TN.js → chunk-4CQWNZ62.js} +2 -2
  10. package/dist/{chunk-AKHYMB4V.js → chunk-5UFVCIUB.js} +5 -5
  11. package/dist/{chunk-IYKXK356.js → chunk-DFQDJT22.js} +4 -4
  12. package/dist/{chunk-3PVYQFRQ.js → chunk-ESLPBT5A.js} +2 -1
  13. package/dist/{chunk-X5FOFGXX.js → chunk-HR67OWEP.js} +3 -3
  14. package/dist/{chunk-ATSKPZUK.js → chunk-I7FBZOEP.js} +2 -2
  15. package/dist/{chunk-KY4PXYSO.js → chunk-J43O3BOX.js} +3 -3
  16. package/dist/{chunk-EADULOZV.js → chunk-J74TMK4M.js} +3 -3
  17. package/dist/{chunk-IWS56OY7.js → chunk-JLYA4X7K.js} +47 -3
  18. package/dist/{chunk-FQZOHLG3.js → chunk-JSNSMG5R.js} +3 -2
  19. package/dist/{chunk-DC4KMPJO.js → chunk-JVRLTEO7.js} +2 -2
  20. package/dist/{chunk-V43EQ6VR.js → chunk-KE7A76VC.js} +3 -2
  21. package/dist/{chunk-LOBRWKCR.js → chunk-KWXIKGE3.js} +3 -3
  22. package/dist/{chunk-RTZWBNTY.js → chunk-LRDIRJJL.js} +6 -5
  23. package/dist/{chunk-TTZOK6IY.js → chunk-NDIT3SBZ.js} +2 -2
  24. package/dist/{chunk-RNWUCZ2U.js → chunk-NSPNFOJ7.js} +7 -5
  25. package/dist/{chunk-CMOUCKGC.js → chunk-NU2IZ72J.js} +6 -6
  26. package/dist/{chunk-WHIIIREL.js → chunk-NYRLWDT5.js} +7 -3
  27. package/dist/{chunk-BSJSNVGA.js → chunk-OTPTQBYE.js} +8 -6
  28. package/dist/{chunk-ZHH3BEWU.js → chunk-OYP27E3I.js} +4 -4
  29. package/dist/{chunk-UDVKRX5R.js → chunk-PV6HIZQD.js} +2 -2
  30. package/dist/{chunk-NKNOBUBU.js → chunk-QGF2C7TF.js} +2 -2
  31. package/dist/{chunk-5EUJF3WC.js → chunk-QSNVDHOZ.js} +3 -3
  32. package/dist/{chunk-45JPRMC2.js → chunk-QWKSKFKZ.js} +7 -3
  33. package/dist/{chunk-2VSZC6QM.js → chunk-SCMRM6NL.js} +6 -4
  34. package/dist/{chunk-RJZQWEMS.js → chunk-T77XOX7E.js} +3 -2
  35. package/dist/{chunk-64VIJPFV.js → chunk-UZFY3CKD.js} +3 -3
  36. package/dist/{chunk-IIF5HIVF.js → chunk-VVZPQPTY.js} +2 -2
  37. package/dist/{chunk-MNP3GE7H.js → chunk-W232EFEM.js} +15 -13
  38. package/dist/{chunk-RLMX75EM.js → chunk-WAQASTXB.js} +3 -3
  39. package/dist/{chunk-YOKD4GWJ.js → chunk-XSSFBS5I.js} +4 -3
  40. package/dist/{chunk-UQQS3VNT.js → chunk-YTKSNTT4.js} +3 -3
  41. package/dist/{chunk-DP6CXMJZ.js → chunk-Z5Q3TXRY.js} +3 -3
  42. package/dist/{chunk-CFLJFDYV.js → chunk-Z6IHMJMC.js} +6 -3
  43. package/dist/{chunk-NWZ6XGBJ.js → chunk-ZBMANLYH.js} +5 -3
  44. package/dist/{chunk-JDPQOR7C.js → chunk-ZMW6WJFT.js} +17 -17
  45. package/dist/codebase-index/index.js +10 -10
  46. package/dist/codebase-index/parser-worker-script.js +3 -3
  47. package/dist/codebase-index/project-server.js +5 -5
  48. package/dist/codebase-index/worker.js +4 -4
  49. package/dist/diff.js +2 -2
  50. package/dist/edit.js +8 -8
  51. package/dist/exec.js +5 -5
  52. package/dist/format.js +7 -7
  53. package/dist/glob.js +2 -2
  54. package/dist/{go-parser-IKHW67WE.js → go-parser-D7ELWQ7F.js} +2 -2
  55. package/dist/grep.js +2 -2
  56. package/dist/index.js +40 -40
  57. package/dist/install.js +7 -7
  58. package/dist/{json-parser-2EOVP5MR.js → json-parser-34DHYCPW.js} +1 -18
  59. package/dist/languages/index.js +5 -5
  60. package/dist/{legacy-bridge-3T7SR4SK.js → legacy-bridge-FOV5ODDI.js} +7 -7
  61. package/dist/lint.js +7 -7
  62. package/dist/memory.js +1 -1
  63. package/dist/next-steps.d.ts +7 -0
  64. package/dist/next-steps.js +82 -38
  65. package/dist/outdated.js +3 -3
  66. package/dist/pack.js +37 -37
  67. package/dist/{parser-dispatch-QGC4HSP5.js → parser-dispatch-BDVCJXTV.js} +4 -4
  68. package/dist/patch.js +7 -7
  69. package/dist/process-registry.js +1 -1
  70. package/dist/ps-slash.js +3 -3
  71. package/dist/{py-parser-RFWG2HYI.js → py-parser-QC6MR4GB.js} +3 -3
  72. package/dist/read.js +7 -7
  73. package/dist/replace.js +8 -8
  74. package/dist/test.js +7 -7
  75. package/dist/tool-search.js +1 -1
  76. package/dist/tool-tier.js +38 -38
  77. package/dist/tree.js +1 -1
  78. package/dist/typecheck.js +7 -7
  79. package/dist/win32.js +1 -1
  80. package/dist/write.js +8 -8
  81. package/package.json +5 -5
package/dist/audit.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  auditTool
3
- } from "./chunk-64VIJPFV.js";
4
- import "./chunk-ATSKPZUK.js";
5
- import "./chunk-TTZOK6IY.js";
6
- import "./chunk-ZHH3BEWU.js";
7
- import "./chunk-2VSZC6QM.js";
8
- import "./chunk-3PVYQFRQ.js";
3
+ } from "./chunk-UZFY3CKD.js";
4
+ import "./chunk-I7FBZOEP.js";
5
+ import "./chunk-NDIT3SBZ.js";
6
+ import "./chunk-OYP27E3I.js";
7
+ import "./chunk-SCMRM6NL.js";
8
+ import "./chunk-ESLPBT5A.js";
9
9
  import "./chunk-HFXSNKCV.js";
10
- import "./chunk-V43EQ6VR.js";
10
+ import "./chunk-KE7A76VC.js";
11
11
  import "./chunk-ZUFHAHTE.js";
12
12
  export {
13
13
  auditTool
package/dist/bash.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  bashTool
3
- } from "./chunk-AKHYMB4V.js";
3
+ } from "./chunk-5UFVCIUB.js";
4
4
  import "./chunk-BTSFTGIL.js";
5
- import "./chunk-NKNOBUBU.js";
6
- import "./chunk-2VSZC6QM.js";
7
- import "./chunk-3PVYQFRQ.js";
5
+ import "./chunk-QGF2C7TF.js";
6
+ import "./chunk-SCMRM6NL.js";
7
+ import "./chunk-ESLPBT5A.js";
8
8
  import "./chunk-HFXSNKCV.js";
9
- import "./chunk-V43EQ6VR.js";
9
+ import "./chunk-KE7A76VC.js";
10
10
  import "./chunk-ZUFHAHTE.js";
11
11
  export {
12
12
  bashTool
@@ -27,7 +27,7 @@ import {
27
27
  resolvePinnedBrowserTarget,
28
28
  safeBrowserUrl,
29
29
  shutdownBrowserTools
30
- } from "../chunk-45JPRMC2.js";
30
+ } from "../chunk-QWKSKFKZ.js";
31
31
  export {
32
32
  BrowserArtifactStore,
33
33
  BrowserNetworkGuardProxy,
package/dist/builtin.js CHANGED
@@ -6,46 +6,46 @@ import {
6
6
  TIER2_TOOLS,
7
7
  TIER3_TOOLS,
8
8
  builtinTools
9
- } from "./chunk-OTINMOKK.js";
9
+ } from "./chunk-4BABEJC2.js";
10
10
  import "./chunk-VPALDFYM.js";
11
- import "./chunk-RTZWBNTY.js";
11
+ import "./chunk-LRDIRJJL.js";
12
12
  import "./chunk-XRNN44QY.js";
13
13
  import "./chunk-B4HTSV6Z.js";
14
14
  import "./chunk-3M7LLN7W.js";
15
- import "./chunk-RJZQWEMS.js";
15
+ import "./chunk-T77XOX7E.js";
16
16
  import "./chunk-FRN7TIAA.js";
17
17
  import "./chunk-WXJY3BKV.js";
18
18
  import "./chunk-QBV725YG.js";
19
19
  import "./chunk-ELRRTWNP.js";
20
- import "./chunk-UQQS3VNT.js";
21
- import "./chunk-RLMX75EM.js";
22
- import "./chunk-64VIJPFV.js";
23
- import "./chunk-IYKXK356.js";
20
+ import "./chunk-YTKSNTT4.js";
21
+ import "./chunk-WAQASTXB.js";
22
+ import "./chunk-UZFY3CKD.js";
23
+ import "./chunk-DFQDJT22.js";
24
24
  import "./chunk-FQNXYA6W.js";
25
25
  import "./chunk-IU4DV2PA.js";
26
26
  import "./chunk-2OXHS3KZ.js";
27
27
  import "./chunk-6AAOT4PW.js";
28
- import "./chunk-IWS56OY7.js";
28
+ import "./chunk-JLYA4X7K.js";
29
29
  import "./chunk-VD2LV5WO.js";
30
- import "./chunk-OG2BEUBY.js";
31
- import "./chunk-MNP3GE7H.js";
32
- import "./chunk-LOBRWKCR.js";
33
- import "./chunk-EADULOZV.js";
34
- import "./chunk-5EUJF3WC.js";
35
- import "./chunk-ATSKPZUK.js";
36
- import "./chunk-TTZOK6IY.js";
37
- import "./chunk-ZHH3BEWU.js";
38
- import "./chunk-X5FOFGXX.js";
39
- import "./chunk-JDPQOR7C.js";
40
- import "./chunk-YOKD4GWJ.js";
30
+ import "./chunk-34VLZ35Z.js";
31
+ import "./chunk-W232EFEM.js";
32
+ import "./chunk-KWXIKGE3.js";
33
+ import "./chunk-J74TMK4M.js";
34
+ import "./chunk-QSNVDHOZ.js";
35
+ import "./chunk-I7FBZOEP.js";
36
+ import "./chunk-NDIT3SBZ.js";
37
+ import "./chunk-OYP27E3I.js";
38
+ import "./chunk-HR67OWEP.js";
39
+ import "./chunk-ZMW6WJFT.js";
40
+ import "./chunk-XSSFBS5I.js";
41
41
  import "./chunk-Q5JPPCZC.js";
42
- import "./chunk-NWZ6XGBJ.js";
43
- import "./chunk-AKHYMB4V.js";
44
- import "./chunk-BSJSNVGA.js";
42
+ import "./chunk-ZBMANLYH.js";
43
+ import "./chunk-5UFVCIUB.js";
44
+ import "./chunk-OTPTQBYE.js";
45
45
  import "./chunk-BTSFTGIL.js";
46
- import "./chunk-NKNOBUBU.js";
47
- import "./chunk-2VSZC6QM.js";
48
- import "./chunk-3PVYQFRQ.js";
46
+ import "./chunk-QGF2C7TF.js";
47
+ import "./chunk-SCMRM6NL.js";
48
+ import "./chunk-ESLPBT5A.js";
49
49
  import "./chunk-HFXSNKCV.js";
50
50
  import "./chunk-C2DQKVLO.js";
51
51
  import "./chunk-QPNYDH5B.js";
@@ -53,21 +53,21 @@ import "./chunk-NBDZMMG2.js";
53
53
  import "./chunk-BK732J7I.js";
54
54
  import "./chunk-W2CECGTG.js";
55
55
  import "./chunk-X6KXNHUO.js";
56
- import "./chunk-45JPRMC2.js";
57
- import "./chunk-RNWUCZ2U.js";
58
- import "./chunk-O44IMQCN.js";
59
- import "./chunk-CFLJFDYV.js";
60
- import "./chunk-FQZOHLG3.js";
61
- import "./chunk-DP6CXMJZ.js";
62
- import "./chunk-UDVKRX5R.js";
63
- import "./chunk-KY4PXYSO.js";
64
- import "./chunk-CMOUCKGC.js";
65
- import "./chunk-IIF5HIVF.js";
56
+ import "./chunk-QWKSKFKZ.js";
57
+ import "./chunk-NSPNFOJ7.js";
58
+ import "./chunk-3GIKYHLA.js";
59
+ import "./chunk-Z6IHMJMC.js";
60
+ import "./chunk-JSNSMG5R.js";
61
+ import "./chunk-Z5Q3TXRY.js";
62
+ import "./chunk-PV6HIZQD.js";
63
+ import "./chunk-J43O3BOX.js";
64
+ import "./chunk-NU2IZ72J.js";
65
+ import "./chunk-VVZPQPTY.js";
66
66
  import "./chunk-6IEBD27U.js";
67
67
  import "./chunk-UCYQTZ7F.js";
68
68
  import "./chunk-YOHO4DVT.js";
69
69
  import "./chunk-DTQ75VBC.js";
70
- import "./chunk-V43EQ6VR.js";
70
+ import "./chunk-KE7A76VC.js";
71
71
  import "./chunk-ZUFHAHTE.js";
72
72
  export {
73
73
  BUILTIN_TOOL_DESCRIPTIONS,
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  builtinToolsPack
3
- } from "./chunk-DC4KMPJO.js";
3
+ } from "./chunk-JVRLTEO7.js";
4
4
  import {
5
5
  TIER1_TOOLS,
6
6
  TIER2_TOOLS
7
- } from "./chunk-OTINMOKK.js";
7
+ } from "./chunk-4BABEJC2.js";
8
8
 
9
9
  // src/tool-tier.ts
10
10
  function toolNameSet(tools) {
@@ -18,6 +18,7 @@ var BUILTIN_TIER_COUNTS = {
18
18
  aggressive: TIER1_TOOLS.length
19
19
  };
20
20
  function selectBuiltinToolsForTier(tier, allTools) {
21
+ if (!Array.isArray(allTools)) return [];
21
22
  switch (tier) {
22
23
  case "off":
23
24
  return [...allTools];
@@ -35,6 +36,8 @@ function selectBuiltinToolsForTier(tier, allTools) {
35
36
  const tier1Names = toolNameSet(TIER1_TOOLS);
36
37
  return allTools.filter((tool) => tier1Names.has(tool.name));
37
38
  }
39
+ default:
40
+ return [...allTools];
38
41
  }
39
42
  }
40
43
  function registerBuiltinToolTier(options) {
@@ -51,4 +54,4 @@ export {
51
54
  selectBuiltinToolsForTier,
52
55
  registerBuiltinToolTier
53
56
  };
54
- //# sourceMappingURL=chunk-GMZYW52L.js.map
57
+ //# sourceMappingURL=chunk-23EX5WDO.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  mapWithConcurrency
3
- } from "./chunk-NWZ6XGBJ.js";
3
+ } from "./chunk-ZBMANLYH.js";
4
4
  import {
5
5
  safeResolveReal
6
6
  } from "./chunk-ZUFHAHTE.js";
@@ -70,25 +70,25 @@ var diffTool = {
70
70
  }
71
71
  };
72
72
  async function gitDiff(input, ctx, signal) {
73
- if (input.a !== void 0 && (!input.a || !input.a.trim())) {
73
+ if (input.a !== void 0 && (typeof input.a !== "string" || !input.a.trim())) {
74
74
  throw new ToolValidationError({
75
75
  message: "diff: ref 'a' cannot be empty or whitespace-only",
76
76
  field: "a"
77
77
  });
78
78
  }
79
- if (input.b !== void 0 && (!input.b || !input.b.trim())) {
79
+ if (input.b !== void 0 && (typeof input.b !== "string" || !input.b.trim())) {
80
80
  throw new ToolValidationError({
81
81
  message: "diff: ref 'b' cannot be empty or whitespace-only",
82
82
  field: "b"
83
83
  });
84
84
  }
85
- if (input.a?.trim().startsWith("-")) {
85
+ if (typeof input.a === "string" && input.a.trim().startsWith("-")) {
86
86
  throw new ToolValidationError({
87
87
  message: `diff: unsafe ref "${input.a}" \u2014 refs may not begin with '-' (flag injection)`,
88
88
  field: "a"
89
89
  });
90
90
  }
91
- if (input.b?.trim().startsWith("-")) {
91
+ if (typeof input.b === "string" && input.b.trim().startsWith("-")) {
92
92
  throw new ToolValidationError({
93
93
  message: `diff: unsafe ref "${input.b}" \u2014 refs may not begin with '-' (flag injection)`,
94
94
  field: "b"
@@ -119,8 +119,11 @@ async function gitDiff(input, ctx, signal) {
119
119
  if (input.a) args.push(input.a.trim());
120
120
  if (input.b) args.push(input.b.trim());
121
121
  if (input.files) {
122
- const files = Array.isArray(input.files) ? input.files : input.files.split(",");
123
- args.push("--", ...files.map((f) => f.trim().replace(/\\/g, "/")));
122
+ const rawFiles = Array.isArray(input.files) ? input.files : typeof input.files === "string" ? input.files.split(",") : [];
123
+ const files = rawFiles.filter((f) => typeof f === "string").map((f) => f.trim().replace(/\\/g, "/")).filter(Boolean);
124
+ if (files.length > 0) {
125
+ args.push("--", ...files);
126
+ }
124
127
  }
125
128
  const result = await runGit(args, gitDir, signal);
126
129
  let diff = result.stdout;
@@ -184,7 +187,8 @@ function runGit(args, cwd, signal) {
184
187
  async function fileDiff(input, ctx, signal) {
185
188
  signal.throwIfAborted();
186
189
  void input.context;
187
- const files = input.files ? (Array.isArray(input.files) ? input.files : input.files.split(",")).map((f) => f.trim()).filter(Boolean) : [];
190
+ const rawFiles = Array.isArray(input.files) ? input.files : typeof input.files === "string" ? input.files.split(",") : [];
191
+ const files = rawFiles.filter((f) => typeof f === "string").map((f) => f.trim()).filter(Boolean);
188
192
  if (files.length === 0) {
189
193
  return {
190
194
  diff: "No files specified",
@@ -245,4 +249,4 @@ ${parts.join("\n")}`;
245
249
  export {
246
250
  diffTool
247
251
  };
248
- //# sourceMappingURL=chunk-OG2BEUBY.js.map
252
+ //# sourceMappingURL=chunk-34VLZ35Z.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  checkSyntax
3
- } from "./chunk-FQZOHLG3.js";
3
+ } from "./chunk-JSNSMG5R.js";
4
4
  import {
5
5
  enqueueReindex
6
- } from "./chunk-DP6CXMJZ.js";
6
+ } from "./chunk-Z5Q3TXRY.js";
7
7
  import {
8
8
  safeResolveReal,
9
9
  sha256hex,
@@ -179,4 +179,4 @@ async function finishWrite(input, ctx, prepared, signal) {
179
179
  export {
180
180
  writeTool
181
181
  };
182
- //# sourceMappingURL=chunk-O44IMQCN.js.map
182
+ //# sourceMappingURL=chunk-3GIKYHLA.js.map
@@ -14,7 +14,7 @@ import {
14
14
  codebaseStatsTool,
15
15
  codebaseTargetedTestTool,
16
16
  deadCodeScanTool
17
- } from "./chunk-RTZWBNTY.js";
17
+ } from "./chunk-LRDIRJJL.js";
18
18
  import {
19
19
  planTool
20
20
  } from "./chunk-B4HTSV6Z.js";
@@ -23,7 +23,7 @@ import {
23
23
  } from "./chunk-3M7LLN7W.js";
24
24
  import {
25
25
  toolSearchTool
26
- } from "./chunk-RJZQWEMS.js";
26
+ } from "./chunk-T77XOX7E.js";
27
27
  import {
28
28
  toolUseTool
29
29
  } from "./chunk-FRN7TIAA.js";
@@ -38,16 +38,16 @@ import {
38
38
  } from "./chunk-ELRRTWNP.js";
39
39
  import {
40
40
  testTool
41
- } from "./chunk-UQQS3VNT.js";
41
+ } from "./chunk-YTKSNTT4.js";
42
42
  import {
43
43
  installTool
44
- } from "./chunk-RLMX75EM.js";
44
+ } from "./chunk-WAQASTXB.js";
45
45
  import {
46
46
  auditTool
47
- } from "./chunk-64VIJPFV.js";
47
+ } from "./chunk-UZFY3CKD.js";
48
48
  import {
49
49
  outdatedTool
50
- } from "./chunk-IYKXK356.js";
50
+ } from "./chunk-DFQDJT22.js";
51
51
  import {
52
52
  logsTool
53
53
  } from "./chunk-FQNXYA6W.js";
@@ -62,60 +62,60 @@ import {
62
62
  } from "./chunk-6AAOT4PW.js";
63
63
  import {
64
64
  patchTool
65
- } from "./chunk-IWS56OY7.js";
65
+ } from "./chunk-JLYA4X7K.js";
66
66
  import {
67
67
  jsonTool
68
68
  } from "./chunk-VD2LV5WO.js";
69
69
  import {
70
70
  diffTool
71
- } from "./chunk-OG2BEUBY.js";
71
+ } from "./chunk-34VLZ35Z.js";
72
72
  import {
73
73
  treeTool
74
- } from "./chunk-MNP3GE7H.js";
74
+ } from "./chunk-W232EFEM.js";
75
75
  import {
76
76
  lintTool
77
- } from "./chunk-LOBRWKCR.js";
77
+ } from "./chunk-KWXIKGE3.js";
78
78
  import {
79
79
  formatTool
80
- } from "./chunk-EADULOZV.js";
80
+ } from "./chunk-J74TMK4M.js";
81
81
  import {
82
82
  typecheckTool
83
- } from "./chunk-5EUJF3WC.js";
83
+ } from "./chunk-QSNVDHOZ.js";
84
84
  import {
85
85
  languageInfoTool,
86
86
  languagePackageTool,
87
87
  languageTool
88
- } from "./chunk-TTZOK6IY.js";
88
+ } from "./chunk-NDIT3SBZ.js";
89
89
  import {
90
90
  replaceTool
91
- } from "./chunk-X5FOFGXX.js";
91
+ } from "./chunk-HR67OWEP.js";
92
92
  import {
93
93
  globTool
94
- } from "./chunk-JDPQOR7C.js";
94
+ } from "./chunk-ZMW6WJFT.js";
95
95
  import {
96
96
  grepTool
97
- } from "./chunk-YOKD4GWJ.js";
97
+ } from "./chunk-XSSFBS5I.js";
98
98
  import {
99
99
  bashTool,
100
100
  checkAndBlockKillCommand,
101
101
  diagnoseBashism,
102
102
  shellArgs
103
- } from "./chunk-AKHYMB4V.js";
103
+ } from "./chunk-5UFVCIUB.js";
104
104
  import {
105
105
  detectDanger,
106
106
  execTool
107
- } from "./chunk-BSJSNVGA.js";
107
+ } from "./chunk-OTPTQBYE.js";
108
108
  import {
109
109
  buildChildEnv
110
110
  } from "./chunk-BTSFTGIL.js";
111
111
  import {
112
112
  createOutputSpool,
113
113
  spoolNote
114
- } from "./chunk-2VSZC6QM.js";
114
+ } from "./chunk-SCMRM6NL.js";
115
115
  import {
116
116
  getProcessRegistry,
117
117
  redactCommand
118
- } from "./chunk-3PVYQFRQ.js";
118
+ } from "./chunk-ESLPBT5A.js";
119
119
  import {
120
120
  fetchTool
121
121
  } from "./chunk-C2DQKVLO.js";
@@ -130,19 +130,19 @@ import {
130
130
  } from "./chunk-W2CECGTG.js";
131
131
  import {
132
132
  browserTools
133
- } from "./chunk-45JPRMC2.js";
133
+ } from "./chunk-QWKSKFKZ.js";
134
134
  import {
135
135
  readTool
136
- } from "./chunk-RNWUCZ2U.js";
136
+ } from "./chunk-NSPNFOJ7.js";
137
137
  import {
138
138
  writeTool
139
- } from "./chunk-O44IMQCN.js";
139
+ } from "./chunk-3GIKYHLA.js";
140
140
  import {
141
141
  editTool
142
- } from "./chunk-CFLJFDYV.js";
142
+ } from "./chunk-Z6IHMJMC.js";
143
143
  import {
144
144
  resolvePowerShell
145
- } from "./chunk-V43EQ6VR.js";
145
+ } from "./chunk-KE7A76VC.js";
146
146
  import {
147
147
  normalizeCommandOutput,
148
148
  safeResolveProjectPath,
@@ -1277,4 +1277,4 @@ export {
1277
1277
  TIER3_TOOLS,
1278
1278
  builtinTools
1279
1279
  };
1280
- //# sourceMappingURL=chunk-OTINMOKK.js.map
1280
+ //# sourceMappingURL=chunk-4BABEJC2.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getPersistentProcessRegistry
3
- } from "./chunk-NKNOBUBU.js";
3
+ } from "./chunk-QGF2C7TF.js";
4
4
 
5
5
  // src/ps-slash.ts
6
6
  import * as os from "node:os";
@@ -334,4 +334,4 @@ export {
334
334
  formatInstanceSummary,
335
335
  createGlobalPsSlashCommand
336
336
  };
337
- //# sourceMappingURL=chunk-42BHI7TN.js.map
337
+ //# sourceMappingURL=chunk-4CQWNZ62.js.map
@@ -3,18 +3,18 @@ import {
3
3
  } from "./chunk-BTSFTGIL.js";
4
4
  import {
5
5
  getPersistentProcessRegistry
6
- } from "./chunk-NKNOBUBU.js";
6
+ } from "./chunk-QGF2C7TF.js";
7
7
  import {
8
8
  createOutputSpool,
9
9
  spoolNote
10
- } from "./chunk-2VSZC6QM.js";
10
+ } from "./chunk-SCMRM6NL.js";
11
11
  import {
12
12
  getProcessRegistry,
13
13
  redactCommand
14
- } from "./chunk-3PVYQFRQ.js";
14
+ } from "./chunk-ESLPBT5A.js";
15
15
  import {
16
16
  resolvePowerShell
17
- } from "./chunk-V43EQ6VR.js";
17
+ } from "./chunk-KE7A76VC.js";
18
18
  import {
19
19
  normalizeCommandOutput
20
20
  } from "./chunk-ZUFHAHTE.js";
@@ -977,4 +977,4 @@ export {
977
977
  checkAndBlockKillCommand,
978
978
  bashTool
979
979
  };
980
- //# sourceMappingURL=chunk-AKHYMB4V.js.map
980
+ //# sourceMappingURL=chunk-5UFVCIUB.js.map
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  getProcessRegistry,
3
3
  redactCommand
4
- } from "./chunk-3PVYQFRQ.js";
4
+ } from "./chunk-ESLPBT5A.js";
5
5
  import {
6
6
  buildWin32CmdShimInvocation,
7
7
  resolveWin32Command
8
- } from "./chunk-V43EQ6VR.js";
8
+ } from "./chunk-KE7A76VC.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-3T7SR4SK.js");
69
+ const { detectNonJsEcosystem } = await import("./legacy-bridge-FOV5ODDI.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-IYKXK356.js.map
285
+ //# sourceMappingURL=chunk-DFQDJT22.js.map
@@ -30,6 +30,7 @@ var SENSITIVE_FLAG_PATTERNS = [
30
30
  /--\w*(?:token|key|secret|password|passwd|auth|credential)\w*[=\s,][A-Za-z0-9+/=]{32,}/g
31
31
  ];
32
32
  function redactCommand(cmd) {
33
+ if (typeof cmd !== "string") return "";
33
34
  let result = cmd;
34
35
  for (const pattern of SENSITIVE_FLAG_PATTERNS) {
35
36
  result = result.replace(pattern, (match) => {
@@ -469,4 +470,4 @@ export {
469
470
  getProcessRegistry,
470
471
  _resetProcessRegistry
471
472
  };
472
- //# sourceMappingURL=chunk-3PVYQFRQ.js.map
473
+ //# sourceMappingURL=chunk-ESLPBT5A.js.map
@@ -3,10 +3,10 @@ import {
3
3
  } from "./chunk-Q5JPPCZC.js";
4
4
  import {
5
5
  mapWithConcurrency
6
- } from "./chunk-NWZ6XGBJ.js";
6
+ } from "./chunk-ZBMANLYH.js";
7
7
  import {
8
8
  enqueueReindex
9
- } from "./chunk-DP6CXMJZ.js";
9
+ } from "./chunk-Z5Q3TXRY.js";
10
10
  import {
11
11
  isBinaryBuffer,
12
12
  safeResolveReal,
@@ -413,4 +413,4 @@ export {
413
413
  replaceTool,
414
414
  __resetRgDetectionForTests
415
415
  };
416
- //# sourceMappingURL=chunk-X5FOFGXX.js.map
416
+ //# sourceMappingURL=chunk-HR67OWEP.js.map
@@ -2,7 +2,7 @@ import {
2
2
  executeLanguagePlan,
3
3
  executePackagePlan,
4
4
  planLanguageOperation
5
- } from "./chunk-TTZOK6IY.js";
5
+ } from "./chunk-NDIT3SBZ.js";
6
6
 
7
7
  // src/languages/legacy-bridge.ts
8
8
  import * as fs from "node:fs/promises";
@@ -98,4 +98,4 @@ export {
98
98
  tryLegacyCodeOperation,
99
99
  tryLegacyPackageOperation
100
100
  };
101
- //# sourceMappingURL=chunk-ATSKPZUK.js.map
101
+ //# sourceMappingURL=chunk-I7FBZOEP.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  parseFilesContent
3
- } from "./chunk-CMOUCKGC.js";
3
+ } from "./chunk-NU2IZ72J.js";
4
4
  import {
5
5
  INDEXABLE_EXTENSIONS,
6
6
  LANG_FAMILY_ENTRIES,
@@ -3819,7 +3819,7 @@ var ParserWorkerPool = class {
3819
3819
  */
3820
3820
  async reparseInline(batch, orphaned, workerId) {
3821
3821
  try {
3822
- const { parseFileContent } = await import("./parser-dispatch-QGC4HSP5.js");
3822
+ const { parseFileContent } = await import("./parser-dispatch-BDVCJXTV.js");
3823
3823
  for (const item of orphaned) {
3824
3824
  if (batch.settled) return;
3825
3825
  try {
@@ -4608,4 +4608,4 @@ export {
4608
4608
  incomingCallsService,
4609
4609
  outgoingCallsService
4610
4610
  };
4611
- //# sourceMappingURL=chunk-KY4PXYSO.js.map
4611
+ //# sourceMappingURL=chunk-J43O3BOX.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  tryLegacyCodeOperation
3
- } from "./chunk-ATSKPZUK.js";
3
+ } from "./chunk-I7FBZOEP.js";
4
4
  import {
5
5
  spawnStream
6
- } from "./chunk-ZHH3BEWU.js";
6
+ } from "./chunk-OYP27E3I.js";
7
7
  import {
8
8
  normalizeCommandOutput,
9
9
  safeResolveReal
@@ -200,4 +200,4 @@ async function detectFixer(cwd) {
200
200
  export {
201
201
  formatTool
202
202
  };
203
- //# sourceMappingURL=chunk-EADULOZV.js.map
203
+ //# sourceMappingURL=chunk-J74TMK4M.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  enqueueReindex
3
- } from "./chunk-DP6CXMJZ.js";
3
+ } from "./chunk-Z5Q3TXRY.js";
4
4
  import {
5
5
  resolveRealInsideRoot,
6
6
  safeResolveReal,
@@ -42,6 +42,21 @@ var patchTool = {
42
42
  },
43
43
  required: ["patch"]
44
44
  },
45
+ // VULN-001 Phase 2: the permission layer's input-key heuristic cannot see
46
+ // destinations encoded in the diff body, so the confirm prompt keyed on
47
+ // `directory` (".") while the patch wrote elsewhere. Declares the stripped
48
+ // relative destinations; execute()'s realpath containment above remains
49
+ // the authority on whether they are allowed.
50
+ writeTargets(input) {
51
+ if (!input?.patch || typeof input.patch !== "string" || !input.patch.trim()) return [];
52
+ const strip = typeof input.strip === "number" && Number.isFinite(input.strip) && input.strip >= 0 ? Math.floor(input.strip) : 1;
53
+ const out = [];
54
+ for (const target of extractDiffTargets(input.patch)) {
55
+ const stripped = stripPathComponents(target.raw, strip);
56
+ if (stripped) out.push(stripped);
57
+ }
58
+ return out;
59
+ },
45
60
  async execute(input, ctx, opts) {
46
61
  if (!input?.patch || typeof input.patch !== "string" || !input.patch.trim()) {
47
62
  throw new ToolValidationError({
@@ -68,6 +83,11 @@ var patchTool = {
68
83
  }
69
84
  const realRoot = await fs.realpath(ctx.projectRoot).catch(() => path.resolve(ctx.projectRoot));
70
85
  const targets = extractDiffTargets(input.patch);
86
+ if (targets.length === 0) {
87
+ return refuse(
88
+ "patch refused: no file target could be parsed from the patch (fail-closed containment \u2014 refusing an unparseable diff)"
89
+ );
90
+ }
71
91
  const resolvedTargets = [];
72
92
  for (const t of targets) {
73
93
  const stripped = stripPathComponents(t.raw, strip);
@@ -233,6 +253,31 @@ function extractDiffTargets(patch) {
233
253
  if (oldLinesLeft <= 0 && newLinesLeft <= 0) inHunk = false;
234
254
  continue;
235
255
  }
256
+ if (line.startsWith("diff --git ")) {
257
+ const rest = line.slice("diff --git ".length);
258
+ if (rest.startsWith('"')) {
259
+ const quoted = /^"((?:[^"\\]|\\.)*)"\s+"((?:[^"\\]|\\.)*)"$/.exec(rest);
260
+ if (quoted) {
261
+ for (const half of [quoted[1], quoted[2]]) {
262
+ const p = clean(half);
263
+ if (p) out.push({ raw: p, deleted: false });
264
+ }
265
+ }
266
+ } else {
267
+ const bIdx = rest.lastIndexOf(" b/");
268
+ if (rest.startsWith("a/") && bIdx !== -1) {
269
+ out.push({ raw: rest.slice(0, bIdx), deleted: false });
270
+ out.push({ raw: rest.slice(bIdx + 1), deleted: false });
271
+ }
272
+ }
273
+ continue;
274
+ }
275
+ const extended = /^(?:rename|copy) (?:from|to) (.+)$/.exec(line);
276
+ if (extended) {
277
+ const p = clean(extended[1]);
278
+ if (p && p !== "/dev/null") out.push({ raw: p, deleted: false });
279
+ continue;
280
+ }
236
281
  const oldMatch = /^---\s+([^\t\r\n]+)/.exec(line);
237
282
  if (oldMatch) {
238
283
  lastOld = clean(oldMatch[1]);
@@ -269,7 +314,6 @@ function runPatch(args, cwd, signal, fallback) {
269
314
  if (!result.unavailable) return { ...result, engine: "patch" };
270
315
  const gitArgs = [
271
316
  "apply",
272
- "--unsafe-paths",
273
317
  `-p${fallback.strip}`,
274
318
  "--verbose",
275
319
  ...fallback.dryRun ? ["--check"] : [],
@@ -336,4 +380,4 @@ function extractPatchedFiles(output) {
336
380
  export {
337
381
  patchTool
338
382
  };
339
- //# sourceMappingURL=chunk-IWS56OY7.js.map
383
+ //# sourceMappingURL=chunk-JLYA4X7K.js.map