@wrongstack/tools 0.318.0 → 0.319.0
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.
- package/dist/_util.d.ts +13 -0
- package/dist/audit.js +4 -4
- package/dist/bash.js +2 -2
- package/dist/builtin.js +37 -37
- package/dist/{chunk-TKA4VEX2.js → chunk-2472NT76.js} +2 -2
- package/dist/{chunk-UE3UBMCP.js → chunk-4Q7LFU4T.js} +3 -3
- package/dist/{chunk-ZZT45EHF.js → chunk-65EMYN5G.js} +3 -3
- package/dist/{chunk-A6BRWIXN.js → chunk-6IEBD27U.js} +20 -5
- package/dist/{chunk-P7ZQ2FAJ.js → chunk-7WV3D4S3.js} +2 -2
- package/dist/{chunk-3U4H6ZRF.js → chunk-C3W3V54D.js} +4 -4
- package/dist/{chunk-AGUSOFNI.js → chunk-COUNXG4X.js} +3 -3
- package/dist/{chunk-VB3MJGCV.js → chunk-D4CXUZIF.js} +2 -2
- package/dist/{chunk-5WNDJHT6.js → chunk-DPKTXJQS.js} +2 -2
- package/dist/{chunk-EMRGN4KM.js → chunk-HBM4QNXU.js} +2 -2
- package/dist/{chunk-J5SKD6LN.js → chunk-HWDB2G7J.js} +2 -2
- package/dist/{chunk-ZLTFLC25.js → chunk-IIF5HIVF.js} +2 -2
- package/dist/{chunk-UKGMDCXT.js → chunk-KD5EHYA2.js} +2 -2
- package/dist/{chunk-VZLX2JZG.js → chunk-MRKWZCHZ.js} +3 -3
- package/dist/{chunk-S2GBLQ5S.js → chunk-MYRMD6PZ.js} +3 -3
- package/dist/{chunk-EOOFNYIT.js → chunk-N5O3FK5Q.js} +2 -2
- package/dist/{chunk-EEOFQDT6.js → chunk-OCUXN6Y3.js} +46 -2
- package/dist/{chunk-3QQSBUXR.js → chunk-ODFVG54U.js} +3 -3
- package/dist/{chunk-6GZPSWP3.js → chunk-OJ4FIBAN.js} +2 -2
- package/dist/{chunk-CISOLTOP.js → chunk-OYVPBPCL.js} +3 -3
- package/dist/{chunk-WI3VDXHD.js → chunk-PMHVSHMU.js} +40 -10
- package/dist/{chunk-CIFAIIHI.js → chunk-PRXZOIEW.js} +3 -3
- package/dist/{chunk-D33S4RQG.js → chunk-QLF74MSV.js} +7 -1
- package/dist/{chunk-CVALEVGA.js → chunk-QZDOQRF7.js} +3 -3
- package/dist/{chunk-YF3D5INN.js → chunk-RK47IWO3.js} +67 -68
- package/dist/{chunk-MX25MTDJ.js → chunk-SYXW3Y5Z.js} +2 -2
- package/dist/{chunk-BLCSYKNN.js → chunk-TFMVHYJI.js} +4 -3
- package/dist/{chunk-JJQB6R7Y.js → chunk-TX3R5NVV.js} +6 -6
- package/dist/{chunk-SOG7XIRF.js → chunk-UC3RKRIV.js} +2 -2
- package/dist/{chunk-ZE6KLBUO.js → chunk-UMXVT7ST.js} +2 -2
- package/dist/{chunk-K23JNFE3.js → chunk-VALQFAY2.js} +109 -34
- package/dist/{chunk-4AEZIFOW.js → chunk-VFF3Q5Z3.js} +3 -3
- package/dist/{chunk-6GVXZCQV.js → chunk-W4GAAI3M.js} +2 -2
- package/dist/{chunk-HTYEO67J.js → chunk-WNUJR3H4.js} +2 -2
- package/dist/{chunk-CPVLVQYT.js → chunk-Y7QXSE7N.js} +3 -3
- package/dist/{chunk-CPSAF2AU.js → chunk-YZHK4TLF.js} +2 -2
- package/dist/{chunk-MRZOVQ5D.js → chunk-Z4VBTVUM.js} +3 -3
- package/dist/{chunk-4E42D7UF.js → chunk-ZDUGI5BC.js} +2 -2
- package/dist/{chunk-WJYXMB2R.js → chunk-ZKSBHXVB.js} +3 -3
- package/dist/codebase-index/generic-parser.d.ts +8 -1
- package/dist/codebase-index/index.js +9 -9
- package/dist/codebase-index/parser-worker-script.js +3 -3
- package/dist/codebase-index/project-server.js +5 -5
- package/dist/codebase-index/worker.js +4 -4
- package/dist/codebase-index/writer-refs.d.ts +1 -1
- package/dist/diff.js +2 -2
- package/dist/document.js +2 -2
- package/dist/e2e.js +2 -2
- package/dist/edit.js +8 -8
- package/dist/exec.js +2 -2
- package/dist/fetch.js +2 -2
- package/dist/format.js +4 -4
- package/dist/{generic-parser-VUXDIAOZ.js → generic-parser-WFMIRHBX.js} +2 -2
- package/dist/git.js +2 -2
- package/dist/glob.js +2 -2
- package/dist/grep.js +2 -2
- package/dist/index.js +39 -39
- package/dist/install.js +4 -4
- package/dist/json.js +2 -2
- package/dist/languages/index.js +2 -2
- package/dist/{legacy-bridge-SFNXIRAP.js → legacy-bridge-EC7GM2IW.js} +4 -4
- package/dist/lint.js +4 -4
- package/dist/logs.js +2 -2
- package/dist/outdated.js +2 -2
- package/dist/pack.js +38 -38
- package/dist/{parser-dispatch-X62UWXJS.js → parser-dispatch-3PDBKIQ7.js} +4 -4
- package/dist/patch.js +8 -8
- package/dist/{py-parser-TDXSQZBC.js → py-parser-RFWG2HYI.js} +3 -3
- package/dist/read.js +8 -8
- package/dist/replace.js +8 -8
- package/dist/scaffold.js +2 -2
- package/dist/test.js +4 -4
- package/dist/tool-tier.js +39 -39
- package/dist/{tree-sitter-parser-AIERW3YI.js → tree-sitter-parser-FGKHJGSX.js} +2 -2
- package/dist/tree.js +2 -2
- package/dist/typecheck.js +4 -4
- package/dist/write.js +8 -8
- package/package.json +5 -5
package/dist/_util.d.ts
CHANGED
|
@@ -69,6 +69,19 @@ export declare function resolveRealInsideRoot(absPath: string, ctx: Context): Pr
|
|
|
69
69
|
* caller then opened.
|
|
70
70
|
*/
|
|
71
71
|
export declare function safeResolveReal(input: string, ctx: Context): Promise<string>;
|
|
72
|
+
/**
|
|
73
|
+
* Project-root-relative variant of {@link safeResolveReal} for the codebase
|
|
74
|
+
* tools whose documented input contract is "relative to projectRoot or
|
|
75
|
+
* absolute" (codebase-skeleton, security-ast-scan, codebase-invariant-check,
|
|
76
|
+
* codebase-ast-replace). The sibling file tools (edit/grep/glob/…) resolve
|
|
77
|
+
* relative input against the session cwd — that is THEIR contract; these four
|
|
78
|
+
* always resolved against the project root and their schemas say so. Routing
|
|
79
|
+
* them through plain safeResolveReal silently changed that: with a nested
|
|
80
|
+
* workingDir (worktrees, set_working_dir) a relative input resolved to the
|
|
81
|
+
* wrong file. Containment is still enforced exactly as in safeResolveReal
|
|
82
|
+
* (realpath + allowOutsideProjectRoot honored).
|
|
83
|
+
*/
|
|
84
|
+
export declare function safeResolveProjectPath(input: string, ctx: Context): Promise<string>;
|
|
72
85
|
/**
|
|
73
86
|
* Truncate a diff (or similar text payload) to `maxBytes`, cutting at a line
|
|
74
87
|
* boundary and appending an explicit marker. Used by the mutating file tools
|
package/dist/audit.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
auditTool
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-QZDOQRF7.js";
|
|
4
|
+
import "./chunk-ZDUGI5BC.js";
|
|
5
|
+
import "./chunk-UC3RKRIV.js";
|
|
6
6
|
import "./chunk-ZHH3BEWU.js";
|
|
7
7
|
import "./chunk-2VSZC6QM.js";
|
|
8
8
|
import "./chunk-3PVYQFRQ.js";
|
|
9
9
|
import "./chunk-HFXSNKCV.js";
|
|
10
10
|
import "./chunk-V43EQ6VR.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-QLF74MSV.js";
|
|
12
12
|
export {
|
|
13
13
|
auditTool
|
|
14
14
|
};
|
package/dist/bash.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
bashTool
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WNUJR3H4.js";
|
|
4
4
|
import "./chunk-BTSFTGIL.js";
|
|
5
5
|
import "./chunk-NKNOBUBU.js";
|
|
6
6
|
import "./chunk-2VSZC6QM.js";
|
|
7
7
|
import "./chunk-3PVYQFRQ.js";
|
|
8
8
|
import "./chunk-HFXSNKCV.js";
|
|
9
9
|
import "./chunk-V43EQ6VR.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-QLF74MSV.js";
|
|
11
11
|
export {
|
|
12
12
|
bashTool
|
|
13
13
|
};
|
package/dist/builtin.js
CHANGED
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
TIER2_TOOLS,
|
|
6
6
|
TIER3_TOOLS,
|
|
7
7
|
builtinTools
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-VALQFAY2.js";
|
|
9
|
+
import "./chunk-DPKTXJQS.js";
|
|
10
|
+
import "./chunk-RK47IWO3.js";
|
|
11
|
+
import "./chunk-OCUXN6Y3.js";
|
|
12
12
|
import "./chunk-H6AWAZ2Y.js";
|
|
13
13
|
import "./chunk-X5K3U6GI.js";
|
|
14
14
|
import "./chunk-RJZQWEMS.js";
|
|
@@ -16,58 +16,58 @@ import "./chunk-FRN7TIAA.js";
|
|
|
16
16
|
import "./chunk-WXJY3BKV.js";
|
|
17
17
|
import "./chunk-QBV725YG.js";
|
|
18
18
|
import "./chunk-6RNIFLG4.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-Y7QXSE7N.js";
|
|
20
|
+
import "./chunk-4Q7LFU4T.js";
|
|
21
|
+
import "./chunk-QZDOQRF7.js";
|
|
22
|
+
import "./chunk-Z4VBTVUM.js";
|
|
23
|
+
import "./chunk-YZHK4TLF.js";
|
|
24
|
+
import "./chunk-HBM4QNXU.js";
|
|
25
|
+
import "./chunk-2472NT76.js";
|
|
26
|
+
import "./chunk-UMXVT7ST.js";
|
|
27
|
+
import "./chunk-COUNXG4X.js";
|
|
28
|
+
import "./chunk-D4CXUZIF.js";
|
|
29
|
+
import "./chunk-7WV3D4S3.js";
|
|
30
|
+
import "./chunk-HWDB2G7J.js";
|
|
31
|
+
import "./chunk-ZKSBHXVB.js";
|
|
32
|
+
import "./chunk-ODFVG54U.js";
|
|
33
|
+
import "./chunk-VFF3Q5Z3.js";
|
|
34
|
+
import "./chunk-ZDUGI5BC.js";
|
|
35
|
+
import "./chunk-UC3RKRIV.js";
|
|
36
36
|
import "./chunk-ZHH3BEWU.js";
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-OYVPBPCL.js";
|
|
38
|
+
import "./chunk-OJ4FIBAN.js";
|
|
39
|
+
import "./chunk-N5O3FK5Q.js";
|
|
40
40
|
import "./chunk-Q5JPPCZC.js";
|
|
41
41
|
import "./chunk-NWZ6XGBJ.js";
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-
|
|
42
|
+
import "./chunk-WNUJR3H4.js";
|
|
43
|
+
import "./chunk-PMHVSHMU.js";
|
|
44
44
|
import "./chunk-BTSFTGIL.js";
|
|
45
45
|
import "./chunk-NKNOBUBU.js";
|
|
46
46
|
import "./chunk-2VSZC6QM.js";
|
|
47
47
|
import "./chunk-3PVYQFRQ.js";
|
|
48
48
|
import "./chunk-HFXSNKCV.js";
|
|
49
|
-
import "./chunk-
|
|
49
|
+
import "./chunk-KD5EHYA2.js";
|
|
50
50
|
import "./chunk-PQTONQ4P.js";
|
|
51
51
|
import "./chunk-NBDZMMG2.js";
|
|
52
52
|
import "./chunk-5ZYEGP2P.js";
|
|
53
53
|
import "./chunk-FJEQZHZN.js";
|
|
54
54
|
import "./chunk-CWALNI6K.js";
|
|
55
55
|
import "./chunk-45JPRMC2.js";
|
|
56
|
-
import "./chunk-
|
|
57
|
-
import "./chunk-
|
|
58
|
-
import "./chunk-
|
|
56
|
+
import "./chunk-C3W3V54D.js";
|
|
57
|
+
import "./chunk-MYRMD6PZ.js";
|
|
58
|
+
import "./chunk-PRXZOIEW.js";
|
|
59
59
|
import "./chunk-FQZOHLG3.js";
|
|
60
|
-
import "./chunk-
|
|
61
|
-
import "./chunk-
|
|
62
|
-
import "./chunk-
|
|
63
|
-
import "./chunk-
|
|
64
|
-
import "./chunk-
|
|
65
|
-
import "./chunk-
|
|
60
|
+
import "./chunk-MRKWZCHZ.js";
|
|
61
|
+
import "./chunk-W4GAAI3M.js";
|
|
62
|
+
import "./chunk-TFMVHYJI.js";
|
|
63
|
+
import "./chunk-TX3R5NVV.js";
|
|
64
|
+
import "./chunk-IIF5HIVF.js";
|
|
65
|
+
import "./chunk-6IEBD27U.js";
|
|
66
66
|
import "./chunk-UCYQTZ7F.js";
|
|
67
67
|
import "./chunk-YOHO4DVT.js";
|
|
68
68
|
import "./chunk-DTQ75VBC.js";
|
|
69
69
|
import "./chunk-V43EQ6VR.js";
|
|
70
|
-
import "./chunk-
|
|
70
|
+
import "./chunk-QLF74MSV.js";
|
|
71
71
|
export {
|
|
72
72
|
OFF_ONLY_TOOLS,
|
|
73
73
|
OPTIONAL_TOOLS,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
safeResolveReal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QLF74MSV.js";
|
|
4
4
|
|
|
5
5
|
// src/scaffold.ts
|
|
6
6
|
import * as fs from "node:fs/promises";
|
|
@@ -197,4 +197,4 @@ function substituteVars(content, name, vars) {
|
|
|
197
197
|
export {
|
|
198
198
|
scaffoldTool
|
|
199
199
|
};
|
|
200
|
-
//# sourceMappingURL=chunk-
|
|
200
|
+
//# sourceMappingURL=chunk-2472NT76.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
tryLegacyPackageOperation
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZDUGI5BC.js";
|
|
4
4
|
import {
|
|
5
5
|
spawnStream
|
|
6
6
|
} from "./chunk-ZHH3BEWU.js";
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
detectPackageManager,
|
|
9
9
|
normalizeCommandOutput,
|
|
10
10
|
safeResolveReal
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-QLF74MSV.js";
|
|
12
12
|
|
|
13
13
|
// src/install.ts
|
|
14
14
|
import { join } from "node:path";
|
|
@@ -221,4 +221,4 @@ function resolveManifestPath(cwd, pkgManager) {
|
|
|
221
221
|
export {
|
|
222
222
|
installTool
|
|
223
223
|
};
|
|
224
|
-
//# sourceMappingURL=chunk-
|
|
224
|
+
//# sourceMappingURL=chunk-4Q7LFU4T.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
builtinToolsPack
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SYXW3Y5Z.js";
|
|
4
4
|
import {
|
|
5
5
|
TIER1_TOOLS,
|
|
6
6
|
TIER2_TOOLS
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VALQFAY2.js";
|
|
8
8
|
|
|
9
9
|
// src/tool-tier.ts
|
|
10
10
|
function toolNameSet(tools) {
|
|
@@ -51,4 +51,4 @@ export {
|
|
|
51
51
|
selectBuiltinToolsForTier,
|
|
52
52
|
registerBuiltinToolTier
|
|
53
53
|
};
|
|
54
|
-
//# sourceMappingURL=chunk-
|
|
54
|
+
//# sourceMappingURL=chunk-65EMYN5G.js.map
|
|
@@ -2,7 +2,17 @@
|
|
|
2
2
|
var C_LIKE = [
|
|
3
3
|
{ re: /\b(?:class|struct|enum|interface|union)\s+([A-Za-z_]\w*)/g, kind: "class" },
|
|
4
4
|
{
|
|
5
|
-
|
|
5
|
+
// H-10 (security report VF-11): the old shape
|
|
6
|
+
// `(?:…modifiers…)?\s*(?:[\w:<>[\]\s*&]+)\s+name\(` had three adjacent
|
|
7
|
+
// quantifiers that could each consume whitespace (`\s*`, the class with
|
|
8
|
+
// `\s` inside, `\s+`) — catastrophic backtracking on whitespace runs
|
|
9
|
+
// (516 bytes = 4.5 s measured). Decomposed so whitespace is owned by
|
|
10
|
+
// exactly one position: modifiers each consume their own trailing
|
|
11
|
+
// whitespace, the type is a single no-whitespace class, one `\s+`
|
|
12
|
+
// separates type from name. Generic types with internal spaces
|
|
13
|
+
// (`Map<String, Integer> x;`) are no longer matched — tree-sitter is the
|
|
14
|
+
// primary parser for C/C++ and this is only its WASM-less fallback.
|
|
15
|
+
re: /\b(?:(?:public|private|protected|static|final|async|override|virtual|inline|export)\s+)?[\w:<>[\]*&]+\s+([A-Za-z_]\w*)\s*\([^;{]*\)\s*(?:const)?\s*[{;]/g,
|
|
6
16
|
kind: "function"
|
|
7
17
|
},
|
|
8
18
|
{ re: /\b(?:namespace)\s+([A-Za-z_]\w*)/g, kind: "namespace" }
|
|
@@ -33,7 +43,11 @@ var LANG_PATTERNS = {
|
|
|
33
43
|
java: [
|
|
34
44
|
{ re: /\b(?:class|interface|enum|record)\s+([A-Za-z_]\w*)/g, kind: "class" },
|
|
35
45
|
{
|
|
36
|
-
|
|
46
|
+
// H-10 (security report VF-11): same rewrite as C_LIKE above — the old
|
|
47
|
+
// `(?:…|\s)+\s*[\w.<>,[\]\s]+\s+` let three quantifiers compete for the
|
|
48
|
+
// same whitespace (800 bytes of padding measured at 42 s). Whitespace
|
|
49
|
+
// now has exactly one owner per position.
|
|
50
|
+
re: /\b(?:(?:public|private|protected|static|final|abstract|synchronized|native|default)\s+)*[\w.$,<>[\]]+\s+([A-Za-z_]\w*)\s*\(/g,
|
|
37
51
|
kind: "method"
|
|
38
52
|
}
|
|
39
53
|
],
|
|
@@ -41,7 +55,8 @@ var LANG_PATTERNS = {
|
|
|
41
55
|
{ re: /\b(?:class|interface|struct|enum|record)\s+([A-Za-z_]\w*)/g, kind: "class" },
|
|
42
56
|
{ re: /\bnamespace\s+([A-Za-z_.\w]+)/g, kind: "namespace" },
|
|
43
57
|
{
|
|
44
|
-
|
|
58
|
+
// H-10: see java above.
|
|
59
|
+
re: /\b(?:(?:public|private|protected|internal|static|async|override|virtual)\s+)*[\w.$,<>[\]]+\s+([A-Za-z_]\w*)\s*\(/g,
|
|
45
60
|
kind: "method"
|
|
46
61
|
}
|
|
47
62
|
],
|
|
@@ -250,7 +265,7 @@ function lineColAt(offsets, index) {
|
|
|
250
265
|
return { line: low + 1, col: index - lastNl };
|
|
251
266
|
}
|
|
252
267
|
var GENERIC_MAX_SYMBOLS_DEFAULT = 500;
|
|
253
|
-
var GENERIC_MAX_FILE_CHARS =
|
|
268
|
+
var GENERIC_MAX_FILE_CHARS = 128 * 1024;
|
|
254
269
|
function parseGeneric(opts) {
|
|
255
270
|
const { file, lang } = opts;
|
|
256
271
|
const maxSymbols = opts.maxSymbols ?? GENERIC_MAX_SYMBOLS_DEFAULT;
|
|
@@ -314,4 +329,4 @@ export {
|
|
|
314
329
|
parseGeneric,
|
|
315
330
|
parseSymbols
|
|
316
331
|
};
|
|
317
|
-
//# sourceMappingURL=chunk-
|
|
332
|
+
//# sourceMappingURL=chunk-6IEBD27U.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
safeResolveReal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QLF74MSV.js";
|
|
4
4
|
|
|
5
5
|
// src/diff.ts
|
|
6
6
|
import { spawn } from "node:child_process";
|
|
@@ -210,4 +210,4 @@ ${numbered}`;
|
|
|
210
210
|
export {
|
|
211
211
|
diffTool
|
|
212
212
|
};
|
|
213
|
-
//# sourceMappingURL=chunk-
|
|
213
|
+
//# sourceMappingURL=chunk-7WV3D4S3.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getIndexState,
|
|
3
3
|
searchCodebaseIndex
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MRKWZCHZ.js";
|
|
5
5
|
import {
|
|
6
6
|
codebaseIndexDirOverride
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TFMVHYJI.js";
|
|
8
8
|
import {
|
|
9
9
|
isBinaryBuffer,
|
|
10
10
|
safeResolveReal,
|
|
11
11
|
sha256hex
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-QLF74MSV.js";
|
|
13
13
|
|
|
14
14
|
// src/read.ts
|
|
15
15
|
import * as fs from "node:fs/promises";
|
|
@@ -295,4 +295,4 @@ ${interesting.join("\n")}` : "symbols/imports: (none detected)"
|
|
|
295
295
|
export {
|
|
296
296
|
readTool
|
|
297
297
|
};
|
|
298
|
-
//# sourceMappingURL=chunk-
|
|
298
|
+
//# sourceMappingURL=chunk-C3W3V54D.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
enqueueReindex
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MRKWZCHZ.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveRealInsideRoot,
|
|
6
6
|
safeResolveReal,
|
|
7
7
|
sha256hex
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-QLF74MSV.js";
|
|
9
9
|
|
|
10
10
|
// src/patch.ts
|
|
11
11
|
import { spawn } from "node:child_process";
|
|
@@ -313,4 +313,4 @@ function extractPatchedFiles(output) {
|
|
|
313
313
|
export {
|
|
314
314
|
patchTool
|
|
315
315
|
};
|
|
316
|
-
//# sourceMappingURL=chunk-
|
|
316
|
+
//# sourceMappingURL=chunk-COUNXG4X.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-Q5JPPCZC.js";
|
|
5
5
|
import {
|
|
6
6
|
safeResolveReal
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-QLF74MSV.js";
|
|
8
8
|
|
|
9
9
|
// src/json.ts
|
|
10
10
|
import * as fs from "node:fs/promises";
|
|
@@ -607,4 +607,4 @@ function toYaml(data, indent = 0) {
|
|
|
607
607
|
export {
|
|
608
608
|
jsonTool
|
|
609
609
|
};
|
|
610
|
-
//# sourceMappingURL=chunk-
|
|
610
|
+
//# sourceMappingURL=chunk-D4CXUZIF.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
safeResolveReal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QLF74MSV.js";
|
|
4
4
|
|
|
5
5
|
// src/e2e.ts
|
|
6
6
|
import { open, readdir } from "node:fs/promises";
|
|
@@ -422,4 +422,4 @@ export {
|
|
|
422
422
|
discoverE2EProjects,
|
|
423
423
|
e2ePlanTool
|
|
424
424
|
};
|
|
425
|
-
//# sourceMappingURL=chunk-
|
|
425
|
+
//# sourceMappingURL=chunk-DPKTXJQS.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureInsideRoot,
|
|
3
3
|
safeResolveReal
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QLF74MSV.js";
|
|
5
5
|
|
|
6
6
|
// src/document.ts
|
|
7
7
|
import * as fs from "node:fs/promises";
|
|
@@ -167,4 +167,4 @@ function processFile(content, absPath, _style, _overwrite, target) {
|
|
|
167
167
|
export {
|
|
168
168
|
documentTool
|
|
169
169
|
};
|
|
170
|
-
//# sourceMappingURL=chunk-
|
|
170
|
+
//# sourceMappingURL=chunk-HBM4QNXU.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
safeResolveReal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QLF74MSV.js";
|
|
4
4
|
|
|
5
5
|
// src/tree.ts
|
|
6
6
|
import * as fs from "node:fs/promises";
|
|
@@ -232,4 +232,4 @@ async function walkDir(dir, depth, opts) {
|
|
|
232
232
|
export {
|
|
233
233
|
treeTool
|
|
234
234
|
};
|
|
235
|
-
//# sourceMappingURL=chunk-
|
|
235
|
+
//# sourceMappingURL=chunk-HWDB2G7J.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseGeneric
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6IEBD27U.js";
|
|
4
4
|
import {
|
|
5
5
|
parseParserOutput,
|
|
6
6
|
withSpawnGate
|
|
@@ -382,4 +382,4 @@ export {
|
|
|
382
382
|
parseSymbols,
|
|
383
383
|
resolvePythonBinary
|
|
384
384
|
};
|
|
385
|
-
//# sourceMappingURL=chunk-
|
|
385
|
+
//# sourceMappingURL=chunk-IIF5HIVF.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./chunk-NBDZMMG2.js";
|
|
6
6
|
import {
|
|
7
7
|
truncateMiddle
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-QLF74MSV.js";
|
|
9
9
|
|
|
10
10
|
// src/fetch.ts
|
|
11
11
|
import { FetchError, ToolError, ToolValidationError } from "@wrongstack/core/types";
|
|
@@ -236,4 +236,4 @@ function prettyJson(s) {
|
|
|
236
236
|
export {
|
|
237
237
|
fetchTool
|
|
238
238
|
};
|
|
239
|
-
//# sourceMappingURL=chunk-
|
|
239
|
+
//# sourceMappingURL=chunk-KD5EHYA2.js.map
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
projectIndexServerBuildId,
|
|
10
10
|
projectIndexServerEndpoint,
|
|
11
11
|
projectIndexServerMetadataPath
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-W4GAAI3M.js";
|
|
13
13
|
import {
|
|
14
14
|
CircuitOpenError,
|
|
15
15
|
IndexTimeoutError,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
searchService,
|
|
25
25
|
statsService,
|
|
26
26
|
symbolGraphService
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-TFMVHYJI.js";
|
|
28
28
|
import {
|
|
29
29
|
isIndexablePath
|
|
30
30
|
} from "./chunk-YOHO4DVT.js";
|
|
@@ -1269,4 +1269,4 @@ export {
|
|
|
1269
1269
|
checkCodebaseIndexServerHealth,
|
|
1270
1270
|
ensureCodebaseIndexServer
|
|
1271
1271
|
};
|
|
1272
|
-
//# sourceMappingURL=chunk-
|
|
1272
|
+
//# sourceMappingURL=chunk-MRKWZCHZ.js.map
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
} from "./chunk-FQZOHLG3.js";
|
|
4
4
|
import {
|
|
5
5
|
enqueueReindex
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MRKWZCHZ.js";
|
|
7
7
|
import {
|
|
8
8
|
safeResolveReal,
|
|
9
9
|
sha256hex,
|
|
10
10
|
truncateDiffPayload
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-QLF74MSV.js";
|
|
12
12
|
|
|
13
13
|
// src/write.ts
|
|
14
14
|
import * as fs from "node:fs/promises";
|
|
@@ -155,4 +155,4 @@ async function finishWrite(input, ctx, prepared, signal) {
|
|
|
155
155
|
export {
|
|
156
156
|
writeTool
|
|
157
157
|
};
|
|
158
|
-
//# sourceMappingURL=chunk-
|
|
158
|
+
//# sourceMappingURL=chunk-MYRMD6PZ.js.map
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
isBinaryBuffer,
|
|
13
13
|
safeResolveReal
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-QLF74MSV.js";
|
|
15
15
|
|
|
16
16
|
// src/grep.ts
|
|
17
17
|
import { spawn } from "node:child_process";
|
|
@@ -476,4 +476,4 @@ export {
|
|
|
476
476
|
grepTool,
|
|
477
477
|
__resetRgDetectionForTests
|
|
478
478
|
};
|
|
479
|
-
//# sourceMappingURL=chunk-
|
|
479
|
+
//# sourceMappingURL=chunk-N5O3FK5Q.js.map
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
// src/codebase-index/tree-sitter-parser.ts
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
2
4
|
import * as path from "node:path";
|
|
3
5
|
import { fileURLToPath } from "node:url";
|
|
4
6
|
|
|
@@ -759,6 +761,43 @@ function emitSymbol(node, kind, file, lang, scopeStack, content, nlOffsets, quer
|
|
|
759
761
|
// src/codebase-index/tree-sitter-parser.ts
|
|
760
762
|
var WASM_DIR = fileURLToPath(new URL("./wasm/", import.meta.url));
|
|
761
763
|
var RUNTIME_WASM = path.join(WASM_DIR, "tree-sitter-runtime.wasm");
|
|
764
|
+
var CHECKSUMS_PATH = path.join(WASM_DIR, "checksums.json");
|
|
765
|
+
var cachedChecksums;
|
|
766
|
+
function expectedChecksums() {
|
|
767
|
+
if (cachedChecksums !== void 0) return cachedChecksums;
|
|
768
|
+
try {
|
|
769
|
+
cachedChecksums = JSON.parse(readFileSync(CHECKSUMS_PATH, "utf8"));
|
|
770
|
+
} catch (err) {
|
|
771
|
+
if (err.code === "ENOENT") {
|
|
772
|
+
cachedChecksums = null;
|
|
773
|
+
} else {
|
|
774
|
+
console.error(
|
|
775
|
+
`[tree-sitter] grammar checksum manifest is unreadable (${CHECKSUMS_PATH}): ${err instanceof Error ? err.message : String(err)}. Treating as an integrity failure \u2014 tree-sitter grammars will not load.`
|
|
776
|
+
);
|
|
777
|
+
cachedChecksums = {};
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
return cachedChecksums;
|
|
781
|
+
}
|
|
782
|
+
function verifyWasmIntegrity(wasmPath) {
|
|
783
|
+
const manifest = expectedChecksums();
|
|
784
|
+
if (manifest === null) return;
|
|
785
|
+
const rel = path.relative(WASM_DIR, wasmPath).split(path.sep).join("/");
|
|
786
|
+
const expected = manifest[rel];
|
|
787
|
+
if (expected === void 0) {
|
|
788
|
+
console.error(
|
|
789
|
+
`[tree-sitter] grammar ${rel} is not pinned in checksums.json. Refusing to load; falling back to the regex parser. If this change is intentional, regenerate wasm/checksums.json via scripts/check-tree-sitter-wasm.mjs --write and review the diff.`
|
|
790
|
+
);
|
|
791
|
+
throw new Error(`tree-sitter grammar not pinned: ${rel}`);
|
|
792
|
+
}
|
|
793
|
+
const actual = createHash("sha256").update(readFileSync(wasmPath)).digest("hex");
|
|
794
|
+
if (actual !== expected) {
|
|
795
|
+
console.error(
|
|
796
|
+
`[tree-sitter] grammar integrity FAILED for ${rel}: expected sha256 ${expected}, found ${actual}. Refusing to load; falling back to the regex parser. If this change is intentional, regenerate wasm/checksums.json via scripts/check-tree-sitter-wasm.mjs --write and review the diff.`
|
|
797
|
+
);
|
|
798
|
+
throw new Error(`tree-sitter grammar integrity failure: ${rel}`);
|
|
799
|
+
}
|
|
800
|
+
}
|
|
762
801
|
var LANG_TO_GRAMMAR = {
|
|
763
802
|
c: "c",
|
|
764
803
|
cpp: "cpp",
|
|
@@ -786,7 +825,10 @@ function getRuntime() {
|
|
|
786
825
|
if (!runtimePromise) {
|
|
787
826
|
runtimePromise = (async () => {
|
|
788
827
|
const mod = await import("web-tree-sitter");
|
|
789
|
-
const init = () =>
|
|
828
|
+
const init = () => {
|
|
829
|
+
verifyWasmIntegrity(RUNTIME_WASM);
|
|
830
|
+
return mod.Parser.init({ locateFile: () => RUNTIME_WASM });
|
|
831
|
+
};
|
|
790
832
|
return { Parser: mod.Parser, Language: mod.Language, init };
|
|
791
833
|
})();
|
|
792
834
|
}
|
|
@@ -803,6 +845,7 @@ async function loadLanguage(lang) {
|
|
|
803
845
|
const wasmPath = path.join(WASM_DIR, grammarName, `tree-sitter-${grammarName}.wasm`);
|
|
804
846
|
const { Language, init } = await getRuntime();
|
|
805
847
|
await init();
|
|
848
|
+
verifyWasmIntegrity(wasmPath);
|
|
806
849
|
const languageObj = await Language.load(wasmPath);
|
|
807
850
|
return { lang, Language: languageObj };
|
|
808
851
|
})();
|
|
@@ -874,6 +917,7 @@ async function parseTreeSitterAst(opts) {
|
|
|
874
917
|
const { Parser, Language, init } = await getRuntime();
|
|
875
918
|
await init();
|
|
876
919
|
const wasmPath = path.join(WASM_DIR, grammar, `tree-sitter-${grammar}.wasm`);
|
|
920
|
+
verifyWasmIntegrity(wasmPath);
|
|
877
921
|
const languageObj = await Language.load(wasmPath);
|
|
878
922
|
const parser = new Parser();
|
|
879
923
|
parser.setLanguage(languageObj);
|
|
@@ -895,4 +939,4 @@ export {
|
|
|
895
939
|
__smokeRootType,
|
|
896
940
|
parseTreeSitterAst
|
|
897
941
|
};
|
|
898
|
-
//# sourceMappingURL=chunk-
|
|
942
|
+
//# sourceMappingURL=chunk-OCUXN6Y3.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
tryLegacyCodeOperation
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZDUGI5BC.js";
|
|
4
4
|
import {
|
|
5
5
|
spawnStream
|
|
6
6
|
} from "./chunk-ZHH3BEWU.js";
|
|
7
7
|
import {
|
|
8
8
|
normalizeCommandOutput,
|
|
9
9
|
safeResolveReal
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QLF74MSV.js";
|
|
11
11
|
|
|
12
12
|
// src/format.ts
|
|
13
13
|
var formatTool = {
|
|
@@ -176,4 +176,4 @@ async function detectFixer(cwd) {
|
|
|
176
176
|
export {
|
|
177
177
|
formatTool
|
|
178
178
|
};
|
|
179
|
-
//# sourceMappingURL=chunk-
|
|
179
|
+
//# sourceMappingURL=chunk-ODFVG54U.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
assertRealInsideRoot,
|
|
9
9
|
safeResolveReal
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QLF74MSV.js";
|
|
11
11
|
|
|
12
12
|
// src/glob.ts
|
|
13
13
|
import * as fs from "node:fs/promises";
|
|
@@ -151,4 +151,4 @@ var globTool = {
|
|
|
151
151
|
export {
|
|
152
152
|
globTool
|
|
153
153
|
};
|
|
154
|
-
//# sourceMappingURL=chunk-
|
|
154
|
+
//# sourceMappingURL=chunk-OJ4FIBAN.js.map
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-Q5JPPCZC.js";
|
|
4
4
|
import {
|
|
5
5
|
enqueueReindex
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MRKWZCHZ.js";
|
|
7
7
|
import {
|
|
8
8
|
isBinaryBuffer,
|
|
9
9
|
safeResolveReal,
|
|
10
10
|
sha256hex,
|
|
11
11
|
truncateDiffPayload
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-QLF74MSV.js";
|
|
13
13
|
|
|
14
14
|
// src/replace.ts
|
|
15
15
|
import { spawn } from "node:child_process";
|
|
@@ -374,4 +374,4 @@ export {
|
|
|
374
374
|
replaceTool,
|
|
375
375
|
__resetRgDetectionForTests
|
|
376
376
|
};
|
|
377
|
-
//# sourceMappingURL=chunk-
|
|
377
|
+
//# sourceMappingURL=chunk-OYVPBPCL.js.map
|