@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
spawnStream
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EMA2XENR.js";
|
|
4
4
|
import {
|
|
5
5
|
normalizeCommandOutput,
|
|
6
6
|
safeResolveReal
|
|
@@ -3515,4 +3515,4 @@ export {
|
|
|
3515
3515
|
languagePackageTool,
|
|
3516
3516
|
languageInfoTool
|
|
3517
3517
|
};
|
|
3518
|
-
//# sourceMappingURL=chunk-
|
|
3518
|
+
//# sourceMappingURL=chunk-3LS3FYEF.js.map
|
|
@@ -26,6 +26,16 @@ function activeBoardId(items, ctx) {
|
|
|
26
26
|
const metaBoardId = metaKanban && typeof metaKanban === "object" ? metaKanban["boardId"] : void 0;
|
|
27
27
|
return ctx.currentKanbanBoardId ?? (typeof metaBoardId === "string" ? metaBoardId : void 0) ?? items.find((item) => item.kanbanBoardId)?.kanbanBoardId ?? "";
|
|
28
28
|
}
|
|
29
|
+
function deduplicateManagedTodoRows(items, boardId) {
|
|
30
|
+
const rowsById = /* @__PURE__ */ new Map();
|
|
31
|
+
for (const item of items) {
|
|
32
|
+
const existing = rowsById.get(item.id);
|
|
33
|
+
const itemIsBound = item.kanbanBoardId === boardId && Boolean(item.kanbanTaskId);
|
|
34
|
+
const existingIsBound = existing?.kanbanBoardId === boardId && Boolean(existing.kanbanTaskId);
|
|
35
|
+
if (!existing || itemIsBound && !existingIsBound) rowsById.set(item.id, item);
|
|
36
|
+
}
|
|
37
|
+
return [...rowsById.values()];
|
|
38
|
+
}
|
|
29
39
|
function bindTodosToBoard(items, previous, board) {
|
|
30
40
|
const previousById = new Map(previous.map((item) => [item.id, item]));
|
|
31
41
|
const taskById = new Map(board.tasks.map((task) => [task.id, task]));
|
|
@@ -354,7 +364,8 @@ var todoTool = {
|
|
|
354
364
|
const boardId = activeBoardId(items, ctx);
|
|
355
365
|
let board = boardId ? await getBoard(ctx.projectRoot, boardId) : null;
|
|
356
366
|
const managed = board?.lifecycle?.mode === "managed";
|
|
357
|
-
|
|
367
|
+
const managedItems = managed && board ? deduplicateManagedTodoRows(items, board.id) : items;
|
|
368
|
+
let boundItems = managed && board ? bindTodosToBoard(managedItems, ctx.todos ?? [], board) : managedItems;
|
|
358
369
|
const creationWarnings = [];
|
|
359
370
|
if (managed && board) {
|
|
360
371
|
const managedBoardId = board.id;
|
|
@@ -476,4 +487,4 @@ var todoTool = {
|
|
|
476
487
|
export {
|
|
477
488
|
todoTool
|
|
478
489
|
};
|
|
479
|
-
//# sourceMappingURL=chunk-
|
|
490
|
+
//# sourceMappingURL=chunk-4YKVHCQC.js.map
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
// src/_win32-resolve.ts
|
|
2
2
|
import * as fs from "node:fs";
|
|
3
3
|
import * as path from "node:path";
|
|
4
|
+
import {
|
|
5
|
+
buildWin32CmdShimInvocation
|
|
6
|
+
} from "@wrongstack/core/utils";
|
|
4
7
|
function resolveWin32Command(cmd) {
|
|
5
8
|
if (process.platform !== "win32") return cmd;
|
|
6
9
|
if (cmd.includes("/") || cmd.includes("\\") || path.extname(cmd.replace(/\//g, "\\"))) {
|
|
@@ -46,19 +49,6 @@ function assertSafeWin32ShellArgs(args) {
|
|
|
46
49
|
}
|
|
47
50
|
}
|
|
48
51
|
}
|
|
49
|
-
function buildWin32CmdShimInvocation(command, args = []) {
|
|
50
|
-
assertSafeWin32ShellArgs([command, ...args]);
|
|
51
|
-
const line = ["call", quoteWin32CmdArg(command), ...args.map(quoteWin32CmdArg)].join(" ");
|
|
52
|
-
return {
|
|
53
|
-
command: process.env["COMSPEC"] ?? "cmd.exe",
|
|
54
|
-
args: ["/d", "/c", line],
|
|
55
|
-
windowsVerbatimArguments: true
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
function quoteWin32CmdArg(arg) {
|
|
59
|
-
const escaped = arg.replace(/(\\+)$/, "$1$1");
|
|
60
|
-
return `"${escaped}"`;
|
|
61
|
-
}
|
|
62
52
|
|
|
63
53
|
export {
|
|
64
54
|
resolveWin32Command,
|
|
@@ -66,4 +56,4 @@ export {
|
|
|
66
56
|
assertSafeWin32ShellArgs,
|
|
67
57
|
buildWin32CmdShimInvocation
|
|
68
58
|
};
|
|
69
|
-
//# sourceMappingURL=chunk-
|
|
59
|
+
//# sourceMappingURL=chunk-5U5ULQX2.js.map
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolvePythonBinary
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-REWOZIA4.js";
|
|
4
4
|
import {
|
|
5
5
|
parseParserBatchOutput,
|
|
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/import-extractor.ts
|
|
13
14
|
var IMPORT_MAX_FILE_CHARS = 512 * 1024;
|
|
@@ -646,6 +647,7 @@ function runToolchainChild(binary, args, stdinPayload, timeoutMs) {
|
|
|
646
647
|
let stdout = "";
|
|
647
648
|
let proc;
|
|
648
649
|
try {
|
|
650
|
+
recordParserSubprocess();
|
|
649
651
|
proc = spawn(binary, args, { stdio: ["pipe", "pipe", "pipe"], windowsHide: true });
|
|
650
652
|
} catch {
|
|
651
653
|
resolve(null);
|
|
@@ -828,11 +830,11 @@ async function dispatch(file, content, lang) {
|
|
|
828
830
|
return parseSymbols({ file, content, lang });
|
|
829
831
|
}
|
|
830
832
|
case "go": {
|
|
831
|
-
const { parseSymbols } = await import("./go-parser-
|
|
833
|
+
const { parseSymbols } = await import("./go-parser-EMKTAAD3.js");
|
|
832
834
|
return parseSymbols({ file, content, lang: "go" });
|
|
833
835
|
}
|
|
834
836
|
case "py": {
|
|
835
|
-
const { parseSymbols } = await import("./py-parser-
|
|
837
|
+
const { parseSymbols } = await import("./py-parser-DDG53RXI.js");
|
|
836
838
|
return parseSymbols({ file, content, lang: "py" });
|
|
837
839
|
}
|
|
838
840
|
case "rs": {
|
|
@@ -889,4 +891,4 @@ export {
|
|
|
889
891
|
parseFileContent,
|
|
890
892
|
parseFilesContent
|
|
891
893
|
};
|
|
892
|
-
//# sourceMappingURL=chunk-
|
|
894
|
+
//# sourceMappingURL=chunk-6LCKF5KH.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveIndexDir
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3JVSOBHU.js";
|
|
4
4
|
|
|
5
5
|
// src/codebase-index/project-server-endpoint.ts
|
|
6
6
|
import { createHash } from "node:crypto";
|
|
@@ -120,4 +120,4 @@ export {
|
|
|
120
120
|
PROJECT_INDEX_SERVER_MAX_FRAME_CHARS,
|
|
121
121
|
encodeProjectServerMessage
|
|
122
122
|
};
|
|
123
|
-
//# sourceMappingURL=chunk-
|
|
123
|
+
//# sourceMappingURL=chunk-6ZLRRC74.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-ZBMANLYH.js";
|
|
7
7
|
import {
|
|
8
8
|
enqueueReindex
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CVNCSMVU.js";
|
|
10
10
|
import {
|
|
11
11
|
isBinaryBuffer,
|
|
12
12
|
safeResolveReal,
|
|
@@ -274,7 +274,7 @@ function passesExtraGlob(extraGlob, name, full, base) {
|
|
|
274
274
|
return extraGlob.test(full);
|
|
275
275
|
}
|
|
276
276
|
async function resolveFiles(filesInput, ctx, extraGlob) {
|
|
277
|
-
const base = ctx.cwd;
|
|
277
|
+
const base = ctx.workingDir ?? ctx.cwd;
|
|
278
278
|
const parts = Array.isArray(filesInput) ? filesInput.filter((s) => typeof s === "string").map((s) => s.trim()).filter(Boolean) : filesInput.trim().split(",").map((s) => s.trim()).filter(Boolean);
|
|
279
279
|
const resolved = [];
|
|
280
280
|
for (const p of parts) {
|
|
@@ -413,4 +413,4 @@ export {
|
|
|
413
413
|
replaceTool,
|
|
414
414
|
__resetRgDetectionForTests
|
|
415
415
|
};
|
|
416
|
-
//# sourceMappingURL=chunk-
|
|
416
|
+
//# sourceMappingURL=chunk-77MBK46T.js.map
|
|
@@ -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,
|
|
@@ -518,4 +518,4 @@ Compare this against your old_string and retry with the file's actual text.` : "
|
|
|
518
518
|
export {
|
|
519
519
|
editTool
|
|
520
520
|
};
|
|
521
|
-
//# sourceMappingURL=chunk-
|
|
521
|
+
//# sourceMappingURL=chunk-AMURQAJX.js.map
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
projectIndexServerBuildId,
|
|
10
10
|
projectIndexServerEndpoint,
|
|
11
11
|
projectIndexServerMetadataPath
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-6ZLRRC74.js";
|
|
13
13
|
import {
|
|
14
14
|
CircuitOpenError,
|
|
15
15
|
IndexTimeoutError,
|
|
@@ -24,7 +24,10 @@ import {
|
|
|
24
24
|
searchService,
|
|
25
25
|
statsService,
|
|
26
26
|
symbolGraphService
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-3JVSOBHU.js";
|
|
28
|
+
import {
|
|
29
|
+
recordIpcPending
|
|
30
|
+
} from "./chunk-ZKC5UNGD.js";
|
|
28
31
|
import {
|
|
29
32
|
isIndexablePath
|
|
30
33
|
} from "./chunk-YOHO4DVT.js";
|
|
@@ -385,6 +388,7 @@ var ProjectServerConnection = class {
|
|
|
385
388
|
onAbort,
|
|
386
389
|
onProgress: options.onProgress
|
|
387
390
|
});
|
|
391
|
+
recordIpcPending(this.pending.size);
|
|
388
392
|
if (signal && onAbort) {
|
|
389
393
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
390
394
|
if (signal.aborted) {
|
|
@@ -1032,6 +1036,7 @@ async function callInline(op, args, opts) {
|
|
|
1032
1036
|
}
|
|
1033
1037
|
var chain = Promise.resolve();
|
|
1034
1038
|
function withMutex(job) {
|
|
1039
|
+
if (process.env["WRONGSTACK_INDEX_BENCH_NO_HOST_MUTEX"] === "1") return job();
|
|
1035
1040
|
const run = chain.then(job, job);
|
|
1036
1041
|
chain = run.then(
|
|
1037
1042
|
() => void 0,
|
|
@@ -1048,6 +1053,7 @@ function circuitOpenError() {
|
|
|
1048
1053
|
var DEFAULT_DEBOUNCE_MS = 400;
|
|
1049
1054
|
var DEFAULT_COALESCE_WINDOW_MS = 50;
|
|
1050
1055
|
var debounceTimers = /* @__PURE__ */ new Map();
|
|
1056
|
+
var pendingReindexCompletions = /* @__PURE__ */ new Map();
|
|
1051
1057
|
var readyReindexBatches = /* @__PURE__ */ new Map();
|
|
1052
1058
|
function debounceKey(projectRoot, indexDir, file) {
|
|
1053
1059
|
return JSON.stringify([projectRoot, indexDir ?? "", file]);
|
|
@@ -1055,6 +1061,11 @@ function debounceKey(projectRoot, indexDir, file) {
|
|
|
1055
1061
|
function reindexBatchKey(projectRoot, indexDir) {
|
|
1056
1062
|
return JSON.stringify([projectRoot, indexDir ?? ""]);
|
|
1057
1063
|
}
|
|
1064
|
+
function settleReindexCompletions(completions, _error) {
|
|
1065
|
+
for (const completion of completions) {
|
|
1066
|
+
completion.resolve();
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1058
1069
|
function flushReadyReindexBatch(key) {
|
|
1059
1070
|
const batch = readyReindexBatches.get(key);
|
|
1060
1071
|
if (!batch) return;
|
|
@@ -1062,6 +1073,7 @@ function flushReadyReindexBatch(key) {
|
|
|
1062
1073
|
if (!indexCircuitBreaker.allowRequest()) {
|
|
1063
1074
|
const error = circuitOpenError();
|
|
1064
1075
|
for (const onError of batch.onErrors) onError(error);
|
|
1076
|
+
settleReindexCompletions(batch.completions, error);
|
|
1065
1077
|
return;
|
|
1066
1078
|
}
|
|
1067
1079
|
void withMutex(
|
|
@@ -1075,21 +1087,28 @@ function flushReadyReindexBatch(key) {
|
|
|
1075
1087
|
{ timeoutMs: batch.timeoutMs }
|
|
1076
1088
|
)
|
|
1077
1089
|
).then(
|
|
1078
|
-
() =>
|
|
1090
|
+
() => {
|
|
1091
|
+
indexCircuitBreaker.recordSuccess();
|
|
1092
|
+
settleReindexCompletions(batch.completions);
|
|
1093
|
+
},
|
|
1079
1094
|
(err) => {
|
|
1080
1095
|
indexCircuitBreaker.recordFailure(err);
|
|
1081
1096
|
for (const onError of batch.onErrors) onError(err);
|
|
1097
|
+
settleReindexCompletions(batch.completions, err);
|
|
1082
1098
|
}
|
|
1083
1099
|
);
|
|
1084
1100
|
}
|
|
1085
1101
|
function addReadyReindex(opts) {
|
|
1086
1102
|
const key = reindexBatchKey(opts.projectRoot, opts.indexDir);
|
|
1087
1103
|
const windowMs = opts.coalesceWindowMs ?? DEFAULT_COALESCE_WINDOW_MS;
|
|
1104
|
+
const pending2 = pendingReindexCompletions.get(key);
|
|
1105
|
+
pendingReindexCompletions.delete(key);
|
|
1088
1106
|
const existing = readyReindexBatches.get(key);
|
|
1089
1107
|
if (existing) {
|
|
1090
1108
|
existing.files.add(opts.file);
|
|
1091
1109
|
existing.timeoutMs = Math.max(existing.timeoutMs, opts.timeoutMs);
|
|
1092
1110
|
if (opts.onError) existing.onErrors.add(opts.onError);
|
|
1111
|
+
if (pending2) for (const completion of pending2) existing.completions.add(completion);
|
|
1093
1112
|
if (windowMs > 0 && existing.flush) {
|
|
1094
1113
|
clearTimeout(existing.flush);
|
|
1095
1114
|
existing.flush = setTimeout(() => flushReadyReindexBatch(key), windowMs);
|
|
@@ -1102,7 +1121,8 @@ function addReadyReindex(opts) {
|
|
|
1102
1121
|
indexDir: opts.indexDir,
|
|
1103
1122
|
files: /* @__PURE__ */ new Set([opts.file]),
|
|
1104
1123
|
timeoutMs: opts.timeoutMs,
|
|
1105
|
-
onErrors: new Set(opts.onError ? [opts.onError] : [])
|
|
1124
|
+
onErrors: new Set(opts.onError ? [opts.onError] : []),
|
|
1125
|
+
completions: pending2 ?? /* @__PURE__ */ new Set()
|
|
1106
1126
|
};
|
|
1107
1127
|
batch.flush = setTimeout(() => flushReadyReindexBatch(key), Math.max(0, windowMs));
|
|
1108
1128
|
batch.flush.unref?.();
|
|
@@ -1170,7 +1190,13 @@ async function runStartupIndex(opts) {
|
|
|
1170
1190
|
}
|
|
1171
1191
|
function enqueueReindex(opts) {
|
|
1172
1192
|
const files = opts.files.filter(isIndexableFile);
|
|
1173
|
-
if (files.length === 0) return;
|
|
1193
|
+
if (files.length === 0) return Promise.resolve();
|
|
1194
|
+
const completion = new Promise((resolve, reject) => {
|
|
1195
|
+
const key = reindexBatchKey(opts.projectRoot, opts.indexDir);
|
|
1196
|
+
const pending2 = pendingReindexCompletions.get(key) ?? /* @__PURE__ */ new Set();
|
|
1197
|
+
pending2.add({ resolve, reject });
|
|
1198
|
+
pendingReindexCompletions.set(key, pending2);
|
|
1199
|
+
});
|
|
1174
1200
|
const ms = opts.debounceMs ?? DEFAULT_DEBOUNCE_MS;
|
|
1175
1201
|
for (const file of files) {
|
|
1176
1202
|
const key = debounceKey(opts.projectRoot, opts.indexDir, file);
|
|
@@ -1190,6 +1216,7 @@ function enqueueReindex(opts) {
|
|
|
1190
1216
|
timer.unref?.();
|
|
1191
1217
|
debounceTimers.set(key, timer);
|
|
1192
1218
|
}
|
|
1219
|
+
return completion;
|
|
1193
1220
|
}
|
|
1194
1221
|
function cancelPendingReindexes() {
|
|
1195
1222
|
for (const t of debounceTimers.values()) clearTimeout(t);
|
|
@@ -1197,7 +1224,15 @@ function cancelPendingReindexes() {
|
|
|
1197
1224
|
for (const batch of readyReindexBatches.values()) {
|
|
1198
1225
|
if (batch.flush) clearTimeout(batch.flush);
|
|
1199
1226
|
}
|
|
1227
|
+
const cancelled = new Error("pending reindex cancelled");
|
|
1228
|
+
for (const batch of readyReindexBatches.values()) {
|
|
1229
|
+
settleReindexCompletions(batch.completions, cancelled);
|
|
1230
|
+
}
|
|
1200
1231
|
readyReindexBatches.clear();
|
|
1232
|
+
for (const completions of pendingReindexCompletions.values()) {
|
|
1233
|
+
settleReindexCompletions(completions, cancelled);
|
|
1234
|
+
}
|
|
1235
|
+
pendingReindexCompletions.clear();
|
|
1201
1236
|
}
|
|
1202
1237
|
async function searchCodebaseIndex(args, opts = {}) {
|
|
1203
1238
|
return callIndexOp("search", args, {
|
|
@@ -1211,6 +1246,12 @@ async function codebaseIndexStats(args, opts = {}) {
|
|
|
1211
1246
|
signal: opts.signal
|
|
1212
1247
|
});
|
|
1213
1248
|
}
|
|
1249
|
+
async function codebaseContext(args) {
|
|
1250
|
+
return callIndexOp("context", args, { timeoutMs: DEFAULT_QUERY_TIMEOUT_MS });
|
|
1251
|
+
}
|
|
1252
|
+
async function codebaseVectorSearch(args) {
|
|
1253
|
+
return callIndexOp("vectorSearch", args, { timeoutMs: DEFAULT_QUERY_TIMEOUT_MS });
|
|
1254
|
+
}
|
|
1214
1255
|
async function packageGraphService2(args) {
|
|
1215
1256
|
return callIndexOp("packageGraph", args, { timeoutMs: DEFAULT_QUERY_TIMEOUT_MS });
|
|
1216
1257
|
}
|
|
@@ -1260,6 +1301,8 @@ export {
|
|
|
1260
1301
|
cancelPendingReindexes,
|
|
1261
1302
|
searchCodebaseIndex,
|
|
1262
1303
|
codebaseIndexStats,
|
|
1304
|
+
codebaseContext,
|
|
1305
|
+
codebaseVectorSearch,
|
|
1263
1306
|
packageGraphService2 as packageGraphService,
|
|
1264
1307
|
fileGraphService2 as fileGraphService,
|
|
1265
1308
|
symbolGraphService2 as symbolGraphService,
|
|
@@ -1269,4 +1312,4 @@ export {
|
|
|
1269
1312
|
checkCodebaseIndexServerHealth,
|
|
1270
1313
|
ensureCodebaseIndexServer
|
|
1271
1314
|
};
|
|
1272
|
-
//# sourceMappingURL=chunk-
|
|
1315
|
+
//# sourceMappingURL=chunk-CVNCSMVU.js.map
|
|
@@ -30,7 +30,19 @@ var fetchTool = {
|
|
|
30
30
|
category: "Network",
|
|
31
31
|
description: "Fetch a URL and return its content. HTML pages are automatically converted to clean markdown. This tool has strong SSRF protections (private IPs, localhost, and cloud metadata endpoints are blocked by default).",
|
|
32
32
|
usageHint: "Use this when you need external information (documentation, API responses, web pages, etc.).\n\nSecurity notes:\n- Only HTTPS is allowed by default.\n- Internal/private networks are blocked unless explicitly enabled via environment variable.\n- Redirects are followed but re-validated at each hop.\n- Output is capped (128KB by default) to avoid flooding context.\nPrefer this over raw `bash curl` or `bash wget`.",
|
|
33
|
-
permission:
|
|
33
|
+
// H-9 (AT-02): `fetch` was `permission:'auto'` with `mutating:false`, so
|
|
34
|
+
// the `tool.permission === 'auto' && !isMutating` branch at
|
|
35
|
+
// `permission-policy.ts:408-424` returned `{permission:'auto'}` for
|
|
36
|
+
// every call, in every mode (YOLO or not) — a complete, prompt-free
|
|
37
|
+
// exfiltration primitive when chained with the equally-unprompted
|
|
38
|
+
// `read` of `.env`/`~/.ssh/*` (sensitive-read gate is `!effectiveYolo`
|
|
39
|
+
// and therefore also skipped under the shipped default). Promoting to
|
|
40
|
+
// `permission:'confirm'` is the narrowest change that closes the
|
|
41
|
+
// exfiltration path: it prompts the user, and an "always" answer is
|
|
42
|
+
// persisted to `trust.json` against the URL subject declared below.
|
|
43
|
+
// The SSRF guard (`guardedFetch`) still constrains where the request
|
|
44
|
+
// can land; this change just ensures the *whether* is no longer silent.
|
|
45
|
+
permission: "confirm",
|
|
34
46
|
mutating: false,
|
|
35
47
|
capabilities: ["net.outbound"],
|
|
36
48
|
icon: "web",
|
|
@@ -269,4 +281,4 @@ function prettyJson(s) {
|
|
|
269
281
|
export {
|
|
270
282
|
fetchTool
|
|
271
283
|
};
|
|
272
|
-
//# sourceMappingURL=chunk-
|
|
284
|
+
//# sourceMappingURL=chunk-DX5KZEMK.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
enqueueReindex
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CVNCSMVU.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveRealInsideRoot,
|
|
6
6
|
safeResolveReal,
|
|
@@ -395,4 +395,4 @@ function extractPatchedFiles(output) {
|
|
|
395
395
|
export {
|
|
396
396
|
patchTool
|
|
397
397
|
};
|
|
398
|
-
//# sourceMappingURL=chunk-
|
|
398
|
+
//# sourceMappingURL=chunk-E2ZD4ERD.js.map
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
buildWin32CmdShimInvocation,
|
|
11
11
|
resolveWin32Command
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-5U5ULQX2.js";
|
|
13
13
|
|
|
14
14
|
// src/_spawn-stream.ts
|
|
15
15
|
import { spawn } from "node:child_process";
|
|
@@ -285,4 +285,4 @@ function utf8Prefix(text, maxBytes) {
|
|
|
285
285
|
export {
|
|
286
286
|
spawnStream
|
|
287
287
|
};
|
|
288
|
-
//# sourceMappingURL=chunk-
|
|
288
|
+
//# sourceMappingURL=chunk-EMA2XENR.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
|
|
@@ -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-
|
|
192
|
+
//# sourceMappingURL=chunk-FC3X7GGJ.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
executeLanguagePlan,
|
|
3
3
|
executePackagePlan,
|
|
4
4
|
planLanguageOperation
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-3LS3FYEF.js";
|
|
6
6
|
|
|
7
7
|
// src/languages/legacy-bridge.ts
|
|
8
8
|
import * as fs from "node:fs/promises";
|
|
@@ -104,4 +104,4 @@ export {
|
|
|
104
104
|
tryLegacyCodeOperation,
|
|
105
105
|
tryLegacyPackageOperation
|
|
106
106
|
};
|
|
107
|
-
//# sourceMappingURL=chunk-
|
|
107
|
+
//# sourceMappingURL=chunk-GU7QJ37F.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
|
detectPackageManager,
|
|
9
9
|
normalizeCommandOutput,
|
|
@@ -162,4 +162,4 @@ async function findTsConfig(cwd) {
|
|
|
162
162
|
export {
|
|
163
163
|
typecheckTool
|
|
164
164
|
};
|
|
165
|
-
//# sourceMappingURL=chunk-
|
|
165
|
+
//# sourceMappingURL=chunk-IRUEHGCR.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
tryLegacyPackageOperation
|
|
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
|
COMMAND_OUTPUT_MAX_BYTES,
|
|
9
9
|
detectPackageManager,
|
|
@@ -220,4 +220,4 @@ function extractAdvisories(data) {
|
|
|
220
220
|
export {
|
|
221
221
|
auditTool
|
|
222
222
|
};
|
|
223
|
-
//# sourceMappingURL=chunk-
|
|
223
|
+
//# sourceMappingURL=chunk-KIQTABBJ.js.map
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-HDYUBRMF.js";
|
|
15
15
|
import {
|
|
16
16
|
resolvePowerShell
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-5U5ULQX2.js";
|
|
18
18
|
import {
|
|
19
19
|
normalizeCommandOutput
|
|
20
20
|
} from "./chunk-ZUFHAHTE.js";
|
|
@@ -1093,4 +1093,4 @@ export {
|
|
|
1093
1093
|
checkAndBlockKillCommand,
|
|
1094
1094
|
bashTool
|
|
1095
1095
|
};
|
|
1096
|
-
//# sourceMappingURL=chunk-
|
|
1096
|
+
//# sourceMappingURL=chunk-KYVOTHG7.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
tryLegacyPackageOperation
|
|
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
|
detectPackageManager,
|
|
9
9
|
normalizeCommandOutput,
|
|
@@ -253,4 +253,4 @@ function resolveManifestPath(cwd, pkgManager) {
|
|
|
253
253
|
export {
|
|
254
254
|
installTool
|
|
255
255
|
};
|
|
256
|
-
//# sourceMappingURL=chunk-
|
|
256
|
+
//# sourceMappingURL=chunk-MIV2RU5B.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
|
projectSessionPlanToKanban
|
|
6
6
|
} from "./chunk-X6KXNHUO.js";
|
|
@@ -414,4 +414,4 @@ function mkResult(plan, ok, message, todos) {
|
|
|
414
414
|
export {
|
|
415
415
|
planTool
|
|
416
416
|
};
|
|
417
|
-
//# sourceMappingURL=chunk-
|
|
417
|
+
//# sourceMappingURL=chunk-NOCU555K.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
buildWin32CmdShimInvocation,
|
|
7
7
|
resolveWin32Command
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5U5ULQX2.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-
|
|
69
|
+
const { detectNonJsEcosystem } = await import("./legacy-bridge-WVQ4BHDI.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-
|
|
285
|
+
//# sourceMappingURL=chunk-OUEH4I4X.js.map
|