@wrongstack/tools 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_win32-resolve.d.ts +1 -6
- package/dist/audit.js +5 -5
- package/dist/bash.js +2 -2
- package/dist/builtin.js +30 -30
- package/dist/{chunk-7LQCT3LT.js → chunk-32XPUSY3.js} +3 -3
- package/dist/{chunk-N3K2SFEI.js → chunk-3JVSOBHU.js} +1408 -200
- package/dist/{chunk-7N5U2RAU.js → chunk-3LS3FYEF.js} +2 -2
- package/dist/{chunk-FBUP524S.js → chunk-4YKVHCQC.js} +13 -2
- package/dist/{chunk-KE7A76VC.js → chunk-5U5ULQX2.js} +4 -14
- package/dist/{chunk-NU2IZ72J.js → chunk-6LCKF5KH.js} +8 -6
- package/dist/{chunk-GDDXX27P.js → chunk-6ZLRRC74.js} +2 -2
- package/dist/{chunk-IYH4OHBP.js → chunk-77MBK46T.js} +3 -3
- package/dist/{chunk-DK4J2WMH.js → chunk-AMURQAJX.js} +2 -2
- package/dist/{chunk-ZTCJCYLN.js → chunk-CVNCSMVU.js} +49 -6
- package/dist/{chunk-MJSJWXBF.js → chunk-DX5KZEMK.js} +14 -2
- package/dist/{chunk-CGXTR34H.js → chunk-E2ZD4ERD.js} +2 -2
- package/dist/{chunk-DRRY6SCM.js → chunk-EMA2XENR.js} +2 -2
- package/dist/{chunk-3D5DJWOE.js → chunk-FC3X7GGJ.js} +11 -3
- package/dist/{chunk-T3SMFF5Q.js → chunk-GU7QJ37F.js} +2 -2
- package/dist/{chunk-4WPBS45A.js → chunk-IRUEHGCR.js} +3 -3
- package/dist/{chunk-WEEVSWQB.js → chunk-KIQTABBJ.js} +3 -3
- package/dist/{chunk-6H4ERJP7.js → chunk-KYVOTHG7.js} +2 -2
- package/dist/{chunk-O6BY43ZB.js → chunk-MIV2RU5B.js} +3 -3
- package/dist/{chunk-5KS24LTS.js → chunk-NOCU555K.js} +2 -2
- package/dist/{chunk-6GOZTS6F.js → chunk-OUEH4I4X.js} +3 -3
- package/dist/{chunk-YEISRT4S.js → chunk-PNLDTRC5.js} +1429 -242
- package/dist/{chunk-GKSG5CPH.js → chunk-QU2VRCMM.js} +2 -2
- package/dist/{chunk-VVZPQPTY.js → chunk-REWOZIA4.js} +5 -3
- package/dist/{chunk-MGPR7VG3.js → chunk-T7YVY2BV.js} +2 -2
- package/dist/{chunk-IAYMTTR2.js → chunk-TYRVYBHW.js} +27 -23
- package/dist/{chunk-LQSOU63Z.js → chunk-VKAJMHVG.js} +2 -2
- package/dist/{chunk-E7JE3UEX.js → chunk-VO6M2FVG.js} +2 -2
- package/dist/{chunk-NJX2RXKJ.js → chunk-YDTRKEYY.js} +11 -3
- package/dist/{chunk-MK2JK35J.js → chunk-YECHJJJF.js} +3 -3
- package/dist/{chunk-QA6IASYX.js → chunk-Z34CUZCZ.js} +3 -3
- package/dist/{chunk-UCYQTZ7F.js → chunk-ZKC5UNGD.js} +56 -2
- package/dist/codebase-index/atlas-brief.d.ts +90 -0
- package/dist/codebase-index/atlas-export.d.ts +38 -0
- package/dist/codebase-index/atlas-projection.d.ts +114 -0
- package/dist/codebase-index/atlas-types.d.ts +90 -0
- package/dist/codebase-index/background-indexer.d.ts +15 -4
- package/dist/codebase-index/codebase-context-tool.d.ts +54 -0
- package/dist/codebase-index/concept-enrichment.d.ts +154 -0
- package/dist/codebase-index/context-retrieval.d.ts +91 -0
- package/dist/codebase-index/embedding-pass.d.ts +95 -0
- package/dist/codebase-index/graph-adjacency-cache.d.ts +36 -0
- package/dist/codebase-index/graph-rank-pass.d.ts +46 -0
- package/dist/codebase-index/graph-rank.d.ts +198 -0
- package/dist/codebase-index/index-service.d.ts +15 -1
- package/dist/codebase-index/index.d.ts +34 -19
- package/dist/codebase-index/index.js +128 -11
- package/dist/codebase-index/parser-worker-script.js +4 -4
- package/dist/codebase-index/perf-metrics.d.ts +19 -0
- package/dist/codebase-index/project-server-protocol.d.ts +2 -0
- package/dist/codebase-index/project-server-query-cache.d.ts +4 -0
- package/dist/codebase-index/project-server.js +55 -8
- package/dist/codebase-index/repo-map-fallback.d.ts +18 -0
- package/dist/codebase-index/repo-map-render.d.ts +42 -0
- package/dist/codebase-index/repo-map-types.d.ts +21 -0
- package/dist/codebase-index/repo-map.d.ts +28 -16
- package/dist/codebase-index/schema.d.ts +20 -0
- package/dist/codebase-index/worker-protocol.d.ts +47 -1
- package/dist/codebase-index/worker.js +12 -6
- package/dist/codebase-index/writer-concepts.d.ts +84 -0
- package/dist/codebase-index/writer-graph-decorate.d.ts +30 -0
- package/dist/codebase-index/writer-graph-reader.d.ts +22 -0
- package/dist/codebase-index/writer-rank.d.ts +78 -0
- package/dist/codebase-index/writer-schema.d.ts +51 -0
- package/dist/codebase-index/writer-vectors.d.ts +53 -0
- package/dist/codebase-index/writer.d.ts +59 -0
- package/dist/edit.js +8 -8
- package/dist/exec.js +2 -2
- package/dist/fetch.js +1 -1
- package/dist/format.js +5 -5
- package/dist/{go-parser-D7ELWQ7F.js → go-parser-EMKTAAD3.js} +5 -3
- package/dist/index.d.ts +48 -48
- package/dist/index.js +57 -33
- package/dist/install.js +5 -5
- package/dist/languages/index.js +3 -3
- package/dist/{legacy-bridge-YXANP5QB.js → legacy-bridge-WVQ4BHDI.js} +5 -5
- package/dist/lint.js +5 -5
- package/dist/outdated.js +2 -2
- package/dist/pack.js +31 -31
- package/dist/parser-dispatch-UQAB4E6V.js +14 -0
- package/dist/patch.js +8 -8
- package/dist/plan.js +2 -2
- package/dist/{py-parser-QC6MR4GB.js → py-parser-DDG53RXI.js} +4 -4
- package/dist/read.js +8 -8
- package/dist/replace.js +8 -8
- package/dist/task.js +2 -2
- package/dist/test.js +5 -5
- package/dist/todo.js +1 -1
- package/dist/tool-tier.js +32 -32
- package/dist/typecheck.js +5 -5
- package/dist/win32.js +1 -1
- package/dist/write.js +8 -8
- package/package.json +5 -5
- package/dist/parser-dispatch-BDVCJXTV.js +0 -14
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-MSOAX3GC.js";
|
|
4
4
|
import {
|
|
5
5
|
enqueueReindex
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CVNCSMVU.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-
|
|
182
|
+
//# sourceMappingURL=chunk-QU2VRCMM.js.map
|
|
@@ -3,11 +3,12 @@ import {
|
|
|
3
3
|
} from "./chunk-6IEBD27U.js";
|
|
4
4
|
import {
|
|
5
5
|
parseParserOutput,
|
|
6
|
+
recordParserSubprocess,
|
|
6
7
|
withSpawnGate
|
|
7
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ZKC5UNGD.js";
|
|
8
9
|
import {
|
|
9
10
|
resolveWin32Command
|
|
10
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-5U5ULQX2.js";
|
|
11
12
|
|
|
12
13
|
// src/codebase-index/py-parser.ts
|
|
13
14
|
import { spawn } from "node:child_process";
|
|
@@ -306,6 +307,7 @@ function commandIsAvailable(command) {
|
|
|
306
307
|
function spawnPyParser(pyBinary, scriptPath, filePath, content) {
|
|
307
308
|
return new Promise((resolve, reject) => {
|
|
308
309
|
let settled = false;
|
|
310
|
+
recordParserSubprocess();
|
|
309
311
|
const proc = spawn(pyBinary, [scriptPath, filePath], {
|
|
310
312
|
stdio: ["pipe", "pipe", "pipe"],
|
|
311
313
|
windowsHide: true
|
|
@@ -382,4 +384,4 @@ export {
|
|
|
382
384
|
parseSymbols,
|
|
383
385
|
resolvePythonBinary
|
|
384
386
|
};
|
|
385
|
-
//# sourceMappingURL=chunk-
|
|
387
|
+
//# sourceMappingURL=chunk-REWOZIA4.js.map
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
buildWin32CmdShimInvocation,
|
|
17
17
|
resolveWin32Command
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-5U5ULQX2.js";
|
|
19
19
|
import {
|
|
20
20
|
COMMAND_OUTPUT_MAX_BYTES,
|
|
21
21
|
normalizeCommandOutput,
|
|
@@ -1835,4 +1835,4 @@ export {
|
|
|
1835
1835
|
getExecAllowlist,
|
|
1836
1836
|
execTool
|
|
1837
1837
|
};
|
|
1838
|
-
//# sourceMappingURL=chunk-
|
|
1838
|
+
//# sourceMappingURL=chunk-T7YVY2BV.js.map
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-RV7BVTDG.js";
|
|
4
4
|
import {
|
|
5
5
|
codebaseAstReplaceTool,
|
|
6
|
+
codebaseContextTool,
|
|
6
7
|
codebaseImpactAnalysisTool,
|
|
7
8
|
codebaseIncomingCallsTool,
|
|
8
9
|
codebaseIndexTool,
|
|
@@ -14,13 +15,13 @@ import {
|
|
|
14
15
|
codebaseStatsTool,
|
|
15
16
|
codebaseTargetedTestTool,
|
|
16
17
|
deadCodeScanTool
|
|
17
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-PNLDTRC5.js";
|
|
18
19
|
import {
|
|
19
20
|
planTool
|
|
20
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-NOCU555K.js";
|
|
21
22
|
import {
|
|
22
23
|
taskTool
|
|
23
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-VKAJMHVG.js";
|
|
24
25
|
import {
|
|
25
26
|
toolSearchTool
|
|
26
27
|
} from "./chunk-24T5XIJU.js";
|
|
@@ -38,16 +39,16 @@ import {
|
|
|
38
39
|
} from "./chunk-IXIS7RSG.js";
|
|
39
40
|
import {
|
|
40
41
|
testTool
|
|
41
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-Z34CUZCZ.js";
|
|
42
43
|
import {
|
|
43
44
|
installTool
|
|
44
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-MIV2RU5B.js";
|
|
45
46
|
import {
|
|
46
47
|
auditTool
|
|
47
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-KIQTABBJ.js";
|
|
48
49
|
import {
|
|
49
50
|
outdatedTool
|
|
50
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-OUEH4I4X.js";
|
|
51
52
|
import {
|
|
52
53
|
logsTool
|
|
53
54
|
} from "./chunk-VU3QBYL4.js";
|
|
@@ -62,7 +63,7 @@ import {
|
|
|
62
63
|
} from "./chunk-AQ5YBURX.js";
|
|
63
64
|
import {
|
|
64
65
|
patchTool
|
|
65
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-E2ZD4ERD.js";
|
|
66
67
|
import {
|
|
67
68
|
jsonTool
|
|
68
69
|
} from "./chunk-VZGPASGD.js";
|
|
@@ -74,21 +75,21 @@ import {
|
|
|
74
75
|
} from "./chunk-JDOO4P6Z.js";
|
|
75
76
|
import {
|
|
76
77
|
lintTool
|
|
77
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-FC3X7GGJ.js";
|
|
78
79
|
import {
|
|
79
80
|
formatTool
|
|
80
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-YDTRKEYY.js";
|
|
81
82
|
import {
|
|
82
83
|
typecheckTool
|
|
83
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-IRUEHGCR.js";
|
|
84
85
|
import {
|
|
85
86
|
languageInfoTool,
|
|
86
87
|
languagePackageTool,
|
|
87
88
|
languageTool
|
|
88
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-3LS3FYEF.js";
|
|
89
90
|
import {
|
|
90
91
|
replaceTool
|
|
91
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-77MBK46T.js";
|
|
92
93
|
import {
|
|
93
94
|
globTool
|
|
94
95
|
} from "./chunk-ASEXQRA7.js";
|
|
@@ -100,11 +101,11 @@ import {
|
|
|
100
101
|
checkAndBlockKillCommand,
|
|
101
102
|
diagnoseBashism,
|
|
102
103
|
shellArgs
|
|
103
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-KYVOTHG7.js";
|
|
104
105
|
import {
|
|
105
106
|
detectDanger,
|
|
106
107
|
execTool
|
|
107
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-T7YVY2BV.js";
|
|
108
109
|
import {
|
|
109
110
|
buildChildEnv
|
|
110
111
|
} from "./chunk-BTSFTGIL.js";
|
|
@@ -118,13 +119,13 @@ import {
|
|
|
118
119
|
} from "./chunk-HDYUBRMF.js";
|
|
119
120
|
import {
|
|
120
121
|
fetchTool
|
|
121
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-DX5KZEMK.js";
|
|
122
123
|
import {
|
|
123
124
|
searchTool
|
|
124
125
|
} from "./chunk-62OAECEQ.js";
|
|
125
126
|
import {
|
|
126
127
|
todoTool
|
|
127
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-4YKVHCQC.js";
|
|
128
129
|
import {
|
|
129
130
|
kanbanTool
|
|
130
131
|
} from "./chunk-SMARDKAC.js";
|
|
@@ -133,16 +134,16 @@ import {
|
|
|
133
134
|
} from "./chunk-SOR7OCYP.js";
|
|
134
135
|
import {
|
|
135
136
|
readTool
|
|
136
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-YECHJJJF.js";
|
|
137
138
|
import {
|
|
138
139
|
writeTool
|
|
139
|
-
} from "./chunk-
|
|
140
|
+
} from "./chunk-QU2VRCMM.js";
|
|
140
141
|
import {
|
|
141
142
|
editTool
|
|
142
|
-
} from "./chunk-
|
|
143
|
+
} from "./chunk-AMURQAJX.js";
|
|
143
144
|
import {
|
|
144
145
|
resolvePowerShell
|
|
145
|
-
} from "./chunk-
|
|
146
|
+
} from "./chunk-5U5ULQX2.js";
|
|
146
147
|
import {
|
|
147
148
|
normalizeCommandOutput,
|
|
148
149
|
safeResolveProjectPath,
|
|
@@ -1233,7 +1234,8 @@ var BUILTIN_TOOL_DESCRIPTIONS = {
|
|
|
1233
1234
|
"codebase-stats": "Report codebase-index health, indexed file and symbol counts, languages, and freshness. Use it before relying on indexed discovery results.",
|
|
1234
1235
|
"codebase-search": "Search indexed symbols, signatures, and documentation with optional language, kind, path, or LSP-kind filters. Use it for semantic discovery before broad text search.",
|
|
1235
1236
|
"codebase-skeleton": "Extract a compact structural skeleton from a source file or directory, preserving declarations while omitting implementation detail. Use it to understand unfamiliar code quickly.",
|
|
1236
|
-
"codebase-
|
|
1237
|
+
"codebase-context": "Find the files and declarations a task touches from a plain-language description. Ranked symbol search seeds a personalised walk over the reference graph, so results include what the matches are structurally attached to, not just what matched by name. Start here for any task spanning more than one file.",
|
|
1238
|
+
"codebase-repo-map": "Generate a centrality-ranked, token-budgeted Repository Map within ~1200 tokens by default: package clusters with their hub file, the repo-wide hotspots, then the signatures of the most central files. Use at the beginning of complex tasks or when navigating unfamiliar repositories to get a bird-eye view of the architecture.",
|
|
1237
1239
|
"codebase-impact-analysis": "Find likely callers, dependents, related tests, and change risk for a named symbol. Use it before changing a public or widely used declaration.",
|
|
1238
1240
|
"codebase-targeted-test": "Discover and run tests that cover a specified symbol, source file, or explicit test files. Use it for focused regression validation after a change.",
|
|
1239
1241
|
"security-ast-scan": "Statically scan source code for supported security patterns and return findings with locations. Use it as a focused code check, not as a substitute for a full security assessment.",
|
|
@@ -1305,6 +1307,7 @@ var TIER1_TOOLS = [
|
|
|
1305
1307
|
codebaseSearchTool,
|
|
1306
1308
|
codebaseSkeletonTool,
|
|
1307
1309
|
codebaseRepoMapTool,
|
|
1310
|
+
codebaseContextTool,
|
|
1308
1311
|
codebaseImpactAnalysisTool,
|
|
1309
1312
|
codebaseTargetedTestTool,
|
|
1310
1313
|
securityAstScanTool,
|
|
@@ -1366,6 +1369,7 @@ var rawBuiltinTools = [
|
|
|
1366
1369
|
codebaseSearchTool,
|
|
1367
1370
|
codebaseSkeletonTool,
|
|
1368
1371
|
codebaseRepoMapTool,
|
|
1372
|
+
codebaseContextTool,
|
|
1369
1373
|
codebaseImpactAnalysisTool,
|
|
1370
1374
|
codebaseTargetedTestTool,
|
|
1371
1375
|
securityAstScanTool,
|
|
@@ -1434,4 +1438,4 @@ export {
|
|
|
1434
1438
|
TIER3_TOOLS,
|
|
1435
1439
|
builtinTools
|
|
1436
1440
|
};
|
|
1437
|
-
//# sourceMappingURL=chunk-
|
|
1441
|
+
//# sourceMappingURL=chunk-TYRVYBHW.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
todoTool
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4YKVHCQC.js";
|
|
4
4
|
import {
|
|
5
5
|
mirrorSessionTasksToKanban
|
|
6
6
|
} from "./chunk-X6KXNHUO.js";
|
|
@@ -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-
|
|
585
|
+
//# sourceMappingURL=chunk-VKAJMHVG.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
builtinTools
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TYRVYBHW.js";
|
|
4
4
|
|
|
5
5
|
// src/pack.ts
|
|
6
6
|
var builtinToolsPack = {
|
|
@@ -12,4 +12,4 @@ var builtinToolsPack = {
|
|
|
12
12
|
export {
|
|
13
13
|
builtinToolsPack
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-VO6M2FVG.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
tryLegacyCodeOperation
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GU7QJ37F.js";
|
|
4
4
|
import {
|
|
5
5
|
spawnStream
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EMA2XENR.js";
|
|
7
7
|
import {
|
|
8
8
|
ensureInsideRoot,
|
|
9
9
|
normalizeCommandOutput,
|
|
@@ -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-
|
|
254
|
+
//# sourceMappingURL=chunk-YDTRKEYY.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getIndexState,
|
|
3
3
|
searchCodebaseIndex
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CVNCSMVU.js";
|
|
5
5
|
import {
|
|
6
6
|
codebaseIndexDirOverride
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3JVSOBHU.js";
|
|
8
8
|
import {
|
|
9
9
|
isBinaryBuffer,
|
|
10
10
|
safeResolveReal,
|
|
@@ -340,4 +340,4 @@ ${interesting.join("\n")}` : "symbols/imports: (none detected)"
|
|
|
340
340
|
export {
|
|
341
341
|
readTool
|
|
342
342
|
};
|
|
343
|
-
//# sourceMappingURL=chunk-
|
|
343
|
+
//# sourceMappingURL=chunk-YECHJJJF.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
tryLegacyCodeOperation
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GU7QJ37F.js";
|
|
4
4
|
import {
|
|
5
5
|
spawnStream
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EMA2XENR.js";
|
|
7
7
|
import {
|
|
8
8
|
normalizeCommandOutput,
|
|
9
9
|
safeResolveReal
|
|
@@ -231,4 +231,4 @@ ${result.stderr}` : result.stdout || result.stderr || result.error || "";
|
|
|
231
231
|
export {
|
|
232
232
|
testTool
|
|
233
233
|
};
|
|
234
|
-
//# sourceMappingURL=chunk-
|
|
234
|
+
//# sourceMappingURL=chunk-Z34CUZCZ.js.map
|
|
@@ -94,10 +94,58 @@ function dedupeRefs(refs) {
|
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
// src/codebase-index/perf-metrics.ts
|
|
98
|
+
var counters = {
|
|
99
|
+
filesystemBytesRead: 0,
|
|
100
|
+
filesystemReadCount: 0,
|
|
101
|
+
parserGateWaitMs: 0,
|
|
102
|
+
parserGateCalls: 0,
|
|
103
|
+
parserSubprocessCount: 0,
|
|
104
|
+
ipcPendingPeak: 0,
|
|
105
|
+
writeQueueWaitMs: 0,
|
|
106
|
+
writeQueueCalls: 0
|
|
107
|
+
};
|
|
108
|
+
function resetCodebaseIndexPerfMetrics() {
|
|
109
|
+
for (const key of Object.keys(counters)) {
|
|
110
|
+
counters[key] = 0;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function getCodebaseIndexPerfSnapshot() {
|
|
114
|
+
return { ...counters };
|
|
115
|
+
}
|
|
116
|
+
function recordFilesystemRead(bytes) {
|
|
117
|
+
counters.filesystemBytesRead += Math.max(0, bytes);
|
|
118
|
+
counters.filesystemReadCount++;
|
|
119
|
+
}
|
|
120
|
+
function recordParserGateWait(waitMs) {
|
|
121
|
+
counters.parserGateWaitMs += Math.max(0, waitMs);
|
|
122
|
+
counters.parserGateCalls++;
|
|
123
|
+
}
|
|
124
|
+
function recordParserSubprocess() {
|
|
125
|
+
counters.parserSubprocessCount++;
|
|
126
|
+
}
|
|
127
|
+
function recordIpcPending(depth) {
|
|
128
|
+
counters.ipcPendingPeak = Math.max(counters.ipcPendingPeak, depth);
|
|
129
|
+
}
|
|
130
|
+
function recordWriteQueueWait(waitMs) {
|
|
131
|
+
counters.writeQueueWaitMs += Math.max(0, waitMs);
|
|
132
|
+
counters.writeQueueCalls++;
|
|
133
|
+
}
|
|
134
|
+
|
|
97
135
|
// src/codebase-index/spawn-gate.ts
|
|
98
136
|
var chain = Promise.resolve();
|
|
99
137
|
function withSpawnGate(fn) {
|
|
100
|
-
const
|
|
138
|
+
const queuedAt = performance.now();
|
|
139
|
+
const run = chain.then(
|
|
140
|
+
() => {
|
|
141
|
+
recordParserGateWait(performance.now() - queuedAt);
|
|
142
|
+
return fn();
|
|
143
|
+
},
|
|
144
|
+
() => {
|
|
145
|
+
recordParserGateWait(performance.now() - queuedAt);
|
|
146
|
+
return fn();
|
|
147
|
+
}
|
|
148
|
+
);
|
|
101
149
|
chain = run.then(
|
|
102
150
|
() => void 0,
|
|
103
151
|
() => void 0
|
|
@@ -108,6 +156,12 @@ function withSpawnGate(fn) {
|
|
|
108
156
|
export {
|
|
109
157
|
parseParserOutput,
|
|
110
158
|
parseParserBatchOutput,
|
|
159
|
+
resetCodebaseIndexPerfMetrics,
|
|
160
|
+
getCodebaseIndexPerfSnapshot,
|
|
161
|
+
recordFilesystemRead,
|
|
162
|
+
recordParserSubprocess,
|
|
163
|
+
recordIpcPending,
|
|
164
|
+
recordWriteQueueWait,
|
|
111
165
|
withSpawnGate
|
|
112
166
|
};
|
|
113
|
-
//# sourceMappingURL=chunk-
|
|
167
|
+
//# sourceMappingURL=chunk-ZKC5UNGD.js.map
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Atlas brief — what an agent should already know before it asks anything.
|
|
3
|
+
*
|
|
4
|
+
* Every other part of this subsystem answers a question. This one answers the
|
|
5
|
+
* question nobody asks: *what is this repository?* An agent that has to
|
|
6
|
+
* discover the shape of an 8,000-file monorepo by search costs a dozen tool
|
|
7
|
+
* calls per session and rediscovers the same thing every session. A few
|
|
8
|
+
* hundred tokens of "here are the twenty files everything depends on, here is
|
|
9
|
+
* what each package is for" removes that repeatedly-paid cost.
|
|
10
|
+
*
|
|
11
|
+
* ## Why it is a structure, not a string
|
|
12
|
+
*
|
|
13
|
+
* The renderer lives with the caller because the budget does. The CLI's
|
|
14
|
+
* system-prompt contributor has a hard token ceiling and trims from the
|
|
15
|
+
* bottom; a webui panel or a `--brief` flag would want different cuts of the
|
|
16
|
+
* same data. Building a string here would force one budget on all of them.
|
|
17
|
+
*
|
|
18
|
+
* ## Why it reports staleness rather than hiding it
|
|
19
|
+
*
|
|
20
|
+
* A brief describing code that has since changed is worse than no brief: it
|
|
21
|
+
* is confidently wrong in a way the reader cannot detect. `staleFiles` is
|
|
22
|
+
* carried so the caller can say so out loud.
|
|
23
|
+
*/
|
|
24
|
+
import { type IndexStore } from './writer.js';
|
|
25
|
+
/** Hubs named in the brief. Past roughly this many, it stops being a summary. */
|
|
26
|
+
export declare const BRIEF_HUB_LIMIT = 20;
|
|
27
|
+
/** Packages named in the brief. */
|
|
28
|
+
export declare const BRIEF_PACKAGE_LIMIT = 12;
|
|
29
|
+
/** Subsystem one-liners included when the concept layer has run. */
|
|
30
|
+
export declare const BRIEF_SUBSYSTEM_LIMIT = 10;
|
|
31
|
+
export interface AtlasBriefHub {
|
|
32
|
+
path: string;
|
|
33
|
+
/** Rank relative to the most central file in the repository. */
|
|
34
|
+
rank: number;
|
|
35
|
+
/** Concept-layer summary, when the layer has run for this file. */
|
|
36
|
+
concept?: string | undefined;
|
|
37
|
+
}
|
|
38
|
+
export interface AtlasBriefPackage {
|
|
39
|
+
name: string;
|
|
40
|
+
files: number;
|
|
41
|
+
/** The package's most central file. */
|
|
42
|
+
hub: string;
|
|
43
|
+
}
|
|
44
|
+
export interface AtlasBriefSubsystem {
|
|
45
|
+
name: string;
|
|
46
|
+
summary: string;
|
|
47
|
+
}
|
|
48
|
+
export interface AtlasBrief {
|
|
49
|
+
/** True once the rank pass has run; false means only counts are meaningful. */
|
|
50
|
+
ranked: boolean;
|
|
51
|
+
counts: {
|
|
52
|
+
files: number;
|
|
53
|
+
symbols: number;
|
|
54
|
+
packages: number;
|
|
55
|
+
};
|
|
56
|
+
hubs: AtlasBriefHub[];
|
|
57
|
+
packages: AtlasBriefPackage[];
|
|
58
|
+
subsystems: AtlasBriefSubsystem[];
|
|
59
|
+
/**
|
|
60
|
+
* Files whose content changed since the written atlas was generated, or
|
|
61
|
+
* `undefined` when no atlas has been written — a project that never ran
|
|
62
|
+
* `--write` is not stale, it simply has no projection.
|
|
63
|
+
*/
|
|
64
|
+
staleFiles?: number | undefined;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Build the brief from an open store.
|
|
68
|
+
*
|
|
69
|
+
* Reads only what it names: the ranked head, not the whole ranking. On an
|
|
70
|
+
* index with no ranks this returns `ranked: false` and empty lists rather
|
|
71
|
+
* than falling back to a filename heuristic — a guess presented as the
|
|
72
|
+
* repository's structure is the failure mode this whole subsystem exists to
|
|
73
|
+
* remove.
|
|
74
|
+
*/
|
|
75
|
+
export declare function buildAtlasBrief(store: IndexStore, projectRoot: string): Promise<AtlasBrief>;
|
|
76
|
+
/** Reported when a project has no index to summarise. */
|
|
77
|
+
export type AtlasBriefIndexMissing = {
|
|
78
|
+
indexed: false;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Build a project's brief, owning the store lifetime.
|
|
82
|
+
*
|
|
83
|
+
* Refuses without an index for the same reason every other project-level
|
|
84
|
+
* entry point does: acquiring a store CREATES the database, and a prompt
|
|
85
|
+
* contributor must never be the thing that indexes a repository.
|
|
86
|
+
*/
|
|
87
|
+
export declare function buildProjectAtlasBrief(projectRoot: string, opts?: {
|
|
88
|
+
indexDir?: string | undefined;
|
|
89
|
+
}): Promise<AtlasBrief | AtlasBriefIndexMissing>;
|
|
90
|
+
//# sourceMappingURL=atlas-brief.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single-file, dependency-free HTML rendering of the atlas.
|
|
3
|
+
*
|
|
4
|
+
* The WebUI's CodeMap is the interactive view, but it needs a running server, a
|
|
5
|
+
* built index and a browser pointed at localhost. This is the other half: one
|
|
6
|
+
* file you can attach to a pull request, publish as a CI artifact, or mail to
|
|
7
|
+
* somebody who will never install the toolchain.
|
|
8
|
+
*
|
|
9
|
+
* ## Why it embeds rather than fetches
|
|
10
|
+
*
|
|
11
|
+
* A page that fetches `atlas.json` beside it does not work from `file://` in
|
|
12
|
+
* any modern browser — the request is a cross-origin one to a null origin. The
|
|
13
|
+
* data is inlined as JSON so a double-click opens a working map.
|
|
14
|
+
*
|
|
15
|
+
* ## Why the layout is computed here, not in the page
|
|
16
|
+
*
|
|
17
|
+
* A force simulation in the page would make the same input produce a slightly
|
|
18
|
+
* different picture on every open. Positions are computed once, deterministic
|
|
19
|
+
* given the document, so two exports of the same index are byte-identical and
|
|
20
|
+
* a committed export diffs meaningfully.
|
|
21
|
+
*/
|
|
22
|
+
import type { AtlasDocument } from './atlas-types.js';
|
|
23
|
+
/** Packages drawn on the canvas. Beyond this the picture stops being readable. */
|
|
24
|
+
export declare const EXPORT_PACKAGE_LIMIT = 40;
|
|
25
|
+
/** Files listed in the ranked table. */
|
|
26
|
+
export declare const EXPORT_FILE_LIMIT = 120;
|
|
27
|
+
export interface AtlasExportOptions {
|
|
28
|
+
/** Repository name shown in the header. */
|
|
29
|
+
projectName?: string | undefined;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Render the atlas as one self-contained HTML document.
|
|
33
|
+
*
|
|
34
|
+
* Deterministic: the same {@link AtlasDocument} always produces the same bytes,
|
|
35
|
+
* with no timestamp, no random ids and no measurement of the host.
|
|
36
|
+
*/
|
|
37
|
+
export declare function renderAtlasHtml(document: AtlasDocument, options?: AtlasExportOptions): string;
|
|
38
|
+
//# sourceMappingURL=atlas-export.d.ts.map
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Atlas — a committable projection of the codebase index.
|
|
3
|
+
*
|
|
4
|
+
* The index itself is a 180 MB SQLite database under `~/.wrongstack/projects/`:
|
|
5
|
+
* machine-local, binary, and unreviewable. That means every fresh clone, every
|
|
6
|
+
* CI run and every teammate starts cold, and nobody can see in a pull request
|
|
7
|
+
* what the index believes about the code.
|
|
8
|
+
*
|
|
9
|
+
* The atlas is the derived, human-sized answer to that: a small, deterministic
|
|
10
|
+
* set of files written into the repository at `.wrongstack/atlas/`. The
|
|
11
|
+
* database stays canonical — this is strictly a one-way projection, and
|
|
12
|
+
* regenerating it from an unchanged index must produce byte-identical output.
|
|
13
|
+
*
|
|
14
|
+
* ## Determinism is a hard requirement
|
|
15
|
+
*
|
|
16
|
+
* Anything that varies between two runs over the same index turns every
|
|
17
|
+
* indexing run into a merge conflict. So: no timestamps, no host paths, keys
|
|
18
|
+
* emitted in sorted order, floats rounded to a fixed precision, and LF line
|
|
19
|
+
* endings (the pre-commit hook enforces those repo-wide anyway).
|
|
20
|
+
*
|
|
21
|
+
* ## Staleness is reported, never guessed
|
|
22
|
+
*
|
|
23
|
+
* A committed atlas describing code that has since moved is worse than no
|
|
24
|
+
* atlas, because it is confidently wrong. {@link checkAtlasFreshness} compares
|
|
25
|
+
* the recorded per-file content hashes against the live index and says exactly
|
|
26
|
+
* which files drifted.
|
|
27
|
+
*/
|
|
28
|
+
import type { AtlasDocument, AtlasEdge, AtlasFile, AtlasManifest, AtlasPackage, AtlasProjection, AtlasSymbol } from './atlas-types.js';
|
|
29
|
+
import type { FileRankRow } from './graph-rank.js';
|
|
30
|
+
import { type IndexStore } from './writer.js';
|
|
31
|
+
/** Directory the projection is written to, relative to the project root. */
|
|
32
|
+
export declare const ATLAS_DIR: string;
|
|
33
|
+
export declare const ATLAS_JSON = "atlas.json";
|
|
34
|
+
export declare const ATLAS_MARKDOWN = "ATLAS.md";
|
|
35
|
+
export declare const ATLAS_MANIFEST = "manifest.json";
|
|
36
|
+
/**
|
|
37
|
+
* Bumped when the emitted shape changes. A reader seeing a different schema
|
|
38
|
+
* reports the atlas as stale rather than misinterpreting its fields.
|
|
39
|
+
*/
|
|
40
|
+
export declare const ATLAS_SCHEMA = 2;
|
|
41
|
+
/**
|
|
42
|
+
* Files carried in the projection. Enough to describe the architecture,
|
|
43
|
+
* small enough to read in a diff — the full 8k-file list would be neither.
|
|
44
|
+
*/
|
|
45
|
+
export declare const ATLAS_FILE_LIMIT = 300;
|
|
46
|
+
export type { AtlasDocument, AtlasEdge, AtlasFile, AtlasManifest, AtlasPackage, AtlasProjection, AtlasSymbol, };
|
|
47
|
+
/**
|
|
48
|
+
* Build the projection from the index. Pure with respect to the filesystem —
|
|
49
|
+
* {@link writeAtlas} is what touches disk.
|
|
50
|
+
*/
|
|
51
|
+
export declare function buildAtlas(store: IndexStore, projectRoot: string): AtlasProjection;
|
|
52
|
+
export interface WrittenAtlas {
|
|
53
|
+
dir: string;
|
|
54
|
+
files: string[];
|
|
55
|
+
fileCount: number;
|
|
56
|
+
packageCount: number;
|
|
57
|
+
}
|
|
58
|
+
/** Write the projection into `<projectRoot>/.wrongstack/atlas/`. */
|
|
59
|
+
export declare function writeAtlas(store: IndexStore, projectRoot: string): Promise<WrittenAtlas>;
|
|
60
|
+
export interface AtlasFreshness {
|
|
61
|
+
fresh: boolean;
|
|
62
|
+
/** Why it is not fresh. Absent when `fresh`. */
|
|
63
|
+
reason?: 'missing' | 'unreadable' | 'schema' | 'drift' | undefined;
|
|
64
|
+
/** Atlas files whose content hash no longer matches the index. */
|
|
65
|
+
changed: string[];
|
|
66
|
+
/** Atlas files the index no longer knows about. */
|
|
67
|
+
removed: string[];
|
|
68
|
+
/** Indexed files absent from the atlas manifest. */
|
|
69
|
+
added: number;
|
|
70
|
+
/** True when the whole-repository digest still matches. */
|
|
71
|
+
digestMatches: boolean;
|
|
72
|
+
}
|
|
73
|
+
/** Files listed in a drift report before it is summarised rather than enumerated. */
|
|
74
|
+
export declare const MAX_REPORTED_DRIFT = 20;
|
|
75
|
+
/**
|
|
76
|
+
* Compare the committed atlas against the live index.
|
|
77
|
+
*
|
|
78
|
+
* Reads only the manifest — the atlas document and markdown are derived from
|
|
79
|
+
* the same data, so a manifest that matches means all three are current.
|
|
80
|
+
*/
|
|
81
|
+
export declare function checkAtlasFreshness(store: IndexStore, projectRoot: string): Promise<AtlasFreshness>;
|
|
82
|
+
/**
|
|
83
|
+
* Project-level entry points.
|
|
84
|
+
*
|
|
85
|
+
* These own the store lifetime so callers outside this package never have to
|
|
86
|
+
* touch `indexStorePool`. Both refuse to run when there is no index yet:
|
|
87
|
+
* opening a store CREATES the database, and neither writing an atlas nor
|
|
88
|
+
* checking one should be the thing that indexes a project.
|
|
89
|
+
*/
|
|
90
|
+
export type AtlasIndexMissing = {
|
|
91
|
+
indexed: false;
|
|
92
|
+
};
|
|
93
|
+
/** Write the atlas for a project, or report that it has no index yet. */
|
|
94
|
+
export declare function writeProjectAtlas(projectRoot: string, opts?: {
|
|
95
|
+
indexDir?: string | undefined;
|
|
96
|
+
}): Promise<WrittenAtlas | AtlasIndexMissing>;
|
|
97
|
+
/** Check a project's written atlas against its index. */
|
|
98
|
+
export declare function checkProjectAtlasFreshness(projectRoot: string, opts?: {
|
|
99
|
+
indexDir?: string | undefined;
|
|
100
|
+
}): Promise<AtlasFreshness | AtlasIndexMissing>;
|
|
101
|
+
/**
|
|
102
|
+
* Build a project's static HTML atlas, or report that it has no index yet.
|
|
103
|
+
*
|
|
104
|
+
* Returns the markup rather than writing it: where the file belongs is the
|
|
105
|
+
* caller's decision (a CI artifact directory, a temp file the CLI opens, an
|
|
106
|
+
* HTTP response body), and this package should not guess.
|
|
107
|
+
*/
|
|
108
|
+
export declare function exportProjectAtlasHtml(projectRoot: string, opts?: {
|
|
109
|
+
indexDir?: string | undefined;
|
|
110
|
+
projectName?: string | undefined;
|
|
111
|
+
}): Promise<string | AtlasIndexMissing>;
|
|
112
|
+
/** Re-exported for callers that render rank rows next to atlas output. */
|
|
113
|
+
export type { FileRankRow };
|
|
114
|
+
//# sourceMappingURL=atlas-projection.d.ts.map
|