@lzehrung/codegraph 2.3.14 → 2.3.15
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/codegraph-skill/codegraph/SKILL.md +1 -1
- package/dist/agent/query-index/workerPool.d.ts.map +1 -1
- package/dist/agent/query-index/workerPool.js +2 -0
- package/dist/agent/query-index/workerPool.js.map +1 -1
- package/dist/bin/cli.js +102 -21
- package/dist/bin/queryIndexWorker.js +30 -0
- package/dist/bin/rawQueryWorker.js +34 -0
- package/dist/indexer/build-index.d.ts.map +1 -1
- package/dist/indexer/build-index.js +29 -2
- package/dist/indexer/build-index.js.map +1 -1
- package/dist/indexer/types.d.ts +2 -0
- package/dist/indexer/types.d.ts.map +1 -1
- package/dist/native/runtime.d.ts.map +1 -1
- package/dist/native/runtime.js +2 -0
- package/dist/native/runtime.js.map +1 -1
- package/dist/sqlite/rawQueryWorkerPool.d.ts.map +1 -1
- package/dist/sqlite/rawQueryWorkerPool.js +10 -6
- package/dist/sqlite/rawQueryWorkerPool.js.map +1 -1
- package/dist/sqlite-driver.d.ts +1 -0
- package/dist/sqlite-driver.d.ts.map +1 -1
- package/dist/sqlite-driver.js +6 -0
- package/dist/sqlite-driver.js.map +1 -1
- package/dist/util/projectFiles.d.ts.map +1 -1
- package/dist/util/projectFiles.js +10 -1
- package/dist/util/projectFiles.js.map +1 -1
- package/dist/util/windowsProcessDrain.d.ts +23 -0
- package/dist/util/windowsProcessDrain.d.ts.map +1 -0
- package/dist/util/windowsProcessDrain.js +51 -0
- package/dist/util/windowsProcessDrain.js.map +1 -0
- package/dist/worker/nativeWorkerPool.d.ts.map +1 -1
- package/dist/worker/nativeWorkerPool.js +2 -0
- package/dist/worker/nativeWorkerPool.js.map +1 -1
- package/package.json +3 -3
|
@@ -134,7 +134,7 @@ Current-state commands validate the on-disk index automatically and default to t
|
|
|
134
134
|
- Repeated agent queries over one repo snapshot: prefer MCP so the index stays warm. MCP inputs are flat JSON objects and the server root is fixed at startup; send only fields in the mounted tool schema, never CLI flags such as `--root` or `--json`. Unknown tool fields are rejected as invalid parameters. If the first MCP call fails at startup or loses its transport, do not retry the same server; run `codegraph doctor`, use the equivalent CLI command for this session, and restart the agent client after package upgrades.
|
|
135
135
|
- Durable graph handoff: use `codegraph graph --root . ./src --json --output codegraph.json` rather than parsing display text. `graph --json` and `index --json` payloads include an `analysis` object (`mode`, `backend`, `label`, fallback counts); when `mode` is `mixed` or `reduced` the run used regex/graph-only extraction for some or all files, so treat symbol accuracy accordingly. Degraded runs also print a `Backend:` warning on stderr even without `--progress`.
|
|
136
136
|
- Search and inspect performance diagnosis: add `--report` for JSON on stderr or `--report-file <path>` for a file while keeping normal command output unchanged.
|
|
137
|
-
- Index discovery diagnosis: `--report` timing JSON can include `sourceDiscoveryMs` and `
|
|
137
|
+
- Index discovery diagnosis: `--report` timing JSON can include `sourceDiscoveryMs`, `metadataDiscoveryMs`, `gitListMs`, `filesystemScanMs`, and `cacheProbeMs` when those steps run.
|
|
138
138
|
|
|
139
139
|
### Human Graph Viewer
|
|
140
140
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workerPool.d.ts","sourceRoot":"","sources":["../../../src/agent/query-index/workerPool.ts"],"names":[],"mappings":"AAKA,OAAO,EAAyB,KAAK,sBAAsB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"workerPool.d.ts","sourceRoot":"","sources":["../../../src/agent/query-index/workerPool.ts"],"names":[],"mappings":"AAKA,OAAO,EAAyB,KAAK,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAIlF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAIlE;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD;;;;;;GAMG;AACH,wBAAgB,oCAAoC,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,SAAyB,GAAG,OAAO,CAErH;AAMD,wBAAgB,2BAA2B,IAAI,MAAM,CAUpD;AACD,wBAAsB,+BAA+B,CACnD,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,SAAS,IAAI,CAAC,oBAAoB,EAAE,cAAc,GAAG,gBAAgB,CAAC,EAAE,GAC9E,OAAO,CAAC,sBAAsB,EAAE,GAAG,IAAI,CAAC,CAc1C;AAED,wBAAsB,8BAA8B,CAClD,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,SAAS,IAAI,CAAC,oBAAoB,EAAE,cAAc,GAAG,gBAAgB,CAAC,EAAE,GAC9E,OAAO,CAAC,sBAAsB,EAAE,GAAG,IAAI,CAAC,CA2C1C;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,SAAS,IAAI,CAAC,oBAAoB,EAAE,cAAc,GAAG,gBAAgB,CAAC,EAAE,GAC9E,OAAO,CAAC,sBAAsB,EAAE,GAAG,IAAI,CAAC,CAM1C"}
|
|
@@ -6,6 +6,7 @@ import { findPackageRoot } from "../../util/packageInfo.js";
|
|
|
6
6
|
import { prepareQueryIndexFile } from "./content.js";
|
|
7
7
|
import { resolveQueryIndexSourcePath } from "./paths.js";
|
|
8
8
|
import { resolveWorkerThreadCount } from "../../util/workerThreads.js";
|
|
9
|
+
import { markWindowsProcessDrainRequired } from "../../util/windowsProcessDrain.js";
|
|
9
10
|
const QUERY_INDEX_MAX_THREADS = 4;
|
|
10
11
|
/**
|
|
11
12
|
* Every worker thread imports the language registry before it can prepare its first file, so a
|
|
@@ -66,6 +67,7 @@ export async function prepareQueryIndexFilesInWorker(projectRoot, files) {
|
|
|
66
67
|
catch {
|
|
67
68
|
return await prepareQueryIndexFilesInProcess(projectRoot, files);
|
|
68
69
|
}
|
|
70
|
+
markWindowsProcessDrainRequired();
|
|
69
71
|
const pool = new Piscina({
|
|
70
72
|
filename: workerPath,
|
|
71
73
|
minThreads: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workerPool.js","sourceRoot":"","sources":["../../../src/agent/query-index/workerPool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAA+B,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"workerPool.js","sourceRoot":"","sources":["../../../src/agent/query-index/workerPool.ts"],"names":[],"mappings":"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"}
|
package/dist/bin/cli.js
CHANGED
|
@@ -1181,7 +1181,7 @@ function createInteractiveProgressDisplay(write, delayMs = 0) {
|
|
|
1181
1181
|
let mode = "build";
|
|
1182
1182
|
let activity = progressAction(mode);
|
|
1183
1183
|
let interval;
|
|
1184
|
-
let
|
|
1184
|
+
let delay2;
|
|
1185
1185
|
const clear = () => {
|
|
1186
1186
|
if (!rendered)
|
|
1187
1187
|
return;
|
|
@@ -1202,9 +1202,9 @@ function createInteractiveProgressDisplay(write, delayMs = 0) {
|
|
|
1202
1202
|
clearInterval(interval);
|
|
1203
1203
|
interval = void 0;
|
|
1204
1204
|
}
|
|
1205
|
-
if (
|
|
1206
|
-
clearTimeout(
|
|
1207
|
-
|
|
1205
|
+
if (delay2 !== void 0) {
|
|
1206
|
+
clearTimeout(delay2);
|
|
1207
|
+
delay2 = void 0;
|
|
1208
1208
|
}
|
|
1209
1209
|
};
|
|
1210
1210
|
const start = (update) => {
|
|
@@ -1225,8 +1225,8 @@ function createInteractiveProgressDisplay(write, delayMs = 0) {
|
|
|
1225
1225
|
interval.unref();
|
|
1226
1226
|
};
|
|
1227
1227
|
if (delayMs) {
|
|
1228
|
-
|
|
1229
|
-
|
|
1228
|
+
delay2 = setTimeout(beginRendering, delayMs);
|
|
1229
|
+
delay2.unref();
|
|
1230
1230
|
} else {
|
|
1231
1231
|
beginRendering();
|
|
1232
1232
|
}
|
|
@@ -1294,12 +1294,12 @@ function createLogProgressDisplay(write, delayMs = 0) {
|
|
|
1294
1294
|
let total = 0;
|
|
1295
1295
|
let mode = "build";
|
|
1296
1296
|
let activity = progressAction(mode);
|
|
1297
|
-
let
|
|
1297
|
+
let delay2;
|
|
1298
1298
|
let heartbeat;
|
|
1299
1299
|
const stopTimers = () => {
|
|
1300
|
-
if (
|
|
1301
|
-
clearTimeout(
|
|
1302
|
-
|
|
1300
|
+
if (delay2 !== void 0) {
|
|
1301
|
+
clearTimeout(delay2);
|
|
1302
|
+
delay2 = void 0;
|
|
1303
1303
|
}
|
|
1304
1304
|
if (heartbeat !== void 0) {
|
|
1305
1305
|
clearInterval(heartbeat);
|
|
@@ -1330,8 +1330,8 @@ function createLogProgressDisplay(write, delayMs = 0) {
|
|
|
1330
1330
|
mode = update.mode ?? "build";
|
|
1331
1331
|
activity = update.activity ?? `${progressAction(mode)} project index`;
|
|
1332
1332
|
if (delayMs) {
|
|
1333
|
-
|
|
1334
|
-
|
|
1333
|
+
delay2 = setTimeout(renderStart, delayMs);
|
|
1334
|
+
delay2.unref();
|
|
1335
1335
|
} else {
|
|
1336
1336
|
renderStart();
|
|
1337
1337
|
}
|
|
@@ -14252,6 +14252,13 @@ function couldBeDirectorySymlink(filePath) {
|
|
|
14252
14252
|
return true;
|
|
14253
14253
|
return DIRECTORY_METADATA_EXTENSIONS.has(extension.toLowerCase());
|
|
14254
14254
|
}
|
|
14255
|
+
function isProjectMetadataDirectoryName(dirPath) {
|
|
14256
|
+
const basename2 = path9.posix.basename(normalizePath(dirPath));
|
|
14257
|
+
if (DIRECTORY_METADATA_BASENAMES.has(basename2.toLowerCase()))
|
|
14258
|
+
return true;
|
|
14259
|
+
const extension = path9.posix.extname(basename2);
|
|
14260
|
+
return Boolean(extension) && DIRECTORY_METADATA_EXTENSIONS.has(extension.toLowerCase());
|
|
14261
|
+
}
|
|
14255
14262
|
function globLiteralPrefix(globPattern) {
|
|
14256
14263
|
const prefix = [];
|
|
14257
14264
|
let seenLiteral = false;
|
|
@@ -14983,7 +14990,7 @@ async function discoverProjectFilesInternal(projectRoot, options) {
|
|
|
14983
14990
|
const candidateFiles = Array.from(new Set(gitCandidates.files.map(normalizePath)));
|
|
14984
14991
|
const metadataCandidates = candidateFiles.filter((file2) => PROJECT_FILE_DEFINITIONS.some((definition, definitionIndex) => definition.kind === "file" && matchesDefinition(path9.basename(file2), definitionIndex)));
|
|
14985
14992
|
const fileMatches = filterGitIgnoredEntries(await filterRealPathsWithinRootEntries(metadataCandidates, realRoot, reportMetadataFileChecks));
|
|
14986
|
-
const rawCandidateDirectories = collectCandidateAncestorDirectories(root, candidateFiles);
|
|
14993
|
+
const rawCandidateDirectories = collectCandidateAncestorDirectories(root, candidateFiles).filter(isProjectMetadataDirectoryName);
|
|
14987
14994
|
const candidateDirectoryKeys = new Set(rawCandidateDirectories.map(fileIdentityKey));
|
|
14988
14995
|
const safeSymlinkDirectoryKeys = new Set(safeSymlinkDirectories.map(fileIdentityKey));
|
|
14989
14996
|
const directoryMatches = [
|
|
@@ -20580,6 +20587,40 @@ var init_bindingLoader = __esm({
|
|
|
20580
20587
|
}
|
|
20581
20588
|
});
|
|
20582
20589
|
|
|
20590
|
+
// dist/util/windowsProcessDrain.js
|
|
20591
|
+
function markWindowsProcessDrainRequired() {
|
|
20592
|
+
drainRequired = true;
|
|
20593
|
+
ensureWindowsProcessDrainHook();
|
|
20594
|
+
}
|
|
20595
|
+
function delay(ms) {
|
|
20596
|
+
return new Promise((resolve) => {
|
|
20597
|
+
setTimeout(resolve, ms);
|
|
20598
|
+
});
|
|
20599
|
+
}
|
|
20600
|
+
function ensureWindowsProcessDrainHook() {
|
|
20601
|
+
if (process.platform !== "win32" || beforeExitListener)
|
|
20602
|
+
return;
|
|
20603
|
+
beforeExitListener = () => {
|
|
20604
|
+
void drainWindowsProcessHandles();
|
|
20605
|
+
};
|
|
20606
|
+
process.once("beforeExit", beforeExitListener);
|
|
20607
|
+
}
|
|
20608
|
+
async function drainWindowsProcessHandles(options) {
|
|
20609
|
+
const platform = options?.platform ?? process.platform;
|
|
20610
|
+
const required2 = options?.required ?? drainRequired;
|
|
20611
|
+
if (platform !== "win32" || !required2)
|
|
20612
|
+
return;
|
|
20613
|
+
await (options?.wait ?? delay)(WINDOWS_LIBUV_EXIT_DRAIN_MS);
|
|
20614
|
+
}
|
|
20615
|
+
var WINDOWS_LIBUV_EXIT_DRAIN_MS, drainRequired, beforeExitListener;
|
|
20616
|
+
var init_windowsProcessDrain = __esm({
|
|
20617
|
+
"dist/util/windowsProcessDrain.js"() {
|
|
20618
|
+
"use strict";
|
|
20619
|
+
WINDOWS_LIBUV_EXIT_DRAIN_MS = 100;
|
|
20620
|
+
drainRequired = false;
|
|
20621
|
+
}
|
|
20622
|
+
});
|
|
20623
|
+
|
|
20583
20624
|
// dist/native/runtime.js
|
|
20584
20625
|
import fs14 from "node:fs";
|
|
20585
20626
|
import path25 from "node:path";
|
|
@@ -20608,6 +20649,7 @@ function loadBinding() {
|
|
|
20608
20649
|
});
|
|
20609
20650
|
if (loaded.binding) {
|
|
20610
20651
|
const supportedLanguageIds = new Set(loaded.binding.supportedLanguageIds());
|
|
20652
|
+
markWindowsProcessDrainRequired();
|
|
20611
20653
|
bindingState = {
|
|
20612
20654
|
loaded: true,
|
|
20613
20655
|
binding: loaded.binding,
|
|
@@ -20832,6 +20874,7 @@ var init_runtime = __esm({
|
|
|
20832
20874
|
init_ast();
|
|
20833
20875
|
init_bindingLoader();
|
|
20834
20876
|
init_runtimeCache();
|
|
20877
|
+
init_windowsProcessDrain();
|
|
20835
20878
|
require2 = createRequire2(import.meta.url);
|
|
20836
20879
|
localNativePackageRoot = path25.resolve(path25.dirname(fileURLToPath2(import.meta.url)), "../../packages/codegraph-native");
|
|
20837
20880
|
NATIVE_REQUIRED_ERROR_PREFIX = "native tree-sitter required by explicit option but unavailable";
|
|
@@ -32065,6 +32108,7 @@ var init_sqlite_driver = __esm({
|
|
|
32065
32108
|
"dist/sqlite-driver.js"() {
|
|
32066
32109
|
"use strict";
|
|
32067
32110
|
init_errors();
|
|
32111
|
+
init_windowsProcessDrain();
|
|
32068
32112
|
requireNodeModule = createRequire4(import.meta.url);
|
|
32069
32113
|
reportedReadonlyAuthorizerDegradation = false;
|
|
32070
32114
|
READONLY_AUTHORIZER_CONSTANTS = [
|
|
@@ -32123,6 +32167,7 @@ var init_sqlite_driver = __esm({
|
|
|
32123
32167
|
SqliteDatabase = class {
|
|
32124
32168
|
db;
|
|
32125
32169
|
statements = /* @__PURE__ */ new Map();
|
|
32170
|
+
closed = false;
|
|
32126
32171
|
constructor(filePath, options) {
|
|
32127
32172
|
if (!isNodeSqliteUsable()) {
|
|
32128
32173
|
throw nodeSqliteUnavailableError() ?? new Error("node:sqlite is unavailable");
|
|
@@ -32132,6 +32177,7 @@ var init_sqlite_driver = __esm({
|
|
|
32132
32177
|
readOnly: options?.readonly,
|
|
32133
32178
|
timeout: options?.timeout ?? 5e3
|
|
32134
32179
|
});
|
|
32180
|
+
markWindowsProcessDrainRequired();
|
|
32135
32181
|
if (options?.readonly) {
|
|
32136
32182
|
const { constants: constants2 } = sqlite;
|
|
32137
32183
|
if (this.db.setAuthorizer && canInstallReadonlyAuthorizer(constants2)) {
|
|
@@ -32176,8 +32222,11 @@ var init_sqlite_driver = __esm({
|
|
|
32176
32222
|
};
|
|
32177
32223
|
}
|
|
32178
32224
|
close() {
|
|
32225
|
+
if (this.closed)
|
|
32226
|
+
return;
|
|
32179
32227
|
this.statements.clear();
|
|
32180
32228
|
this.db.close();
|
|
32229
|
+
this.closed = true;
|
|
32181
32230
|
}
|
|
32182
32231
|
};
|
|
32183
32232
|
}
|
|
@@ -55208,6 +55257,7 @@ function createNativeWorkerPool(opts) {
|
|
|
55208
55257
|
const bounded = typeof requestedMax === "number" && Number.isFinite(requestedMax) && requestedMax > 0 ? Math.max(1, Math.floor(requestedMax)) : HARD_MAX_THREADS;
|
|
55209
55258
|
const threads = Math.min(resolveThreadCount(opts?.threads), bounded);
|
|
55210
55259
|
const workerPath = resolveNativeWorkerPath();
|
|
55260
|
+
markWindowsProcessDrainRequired();
|
|
55211
55261
|
return new Piscina({
|
|
55212
55262
|
filename: workerPath,
|
|
55213
55263
|
minThreads: 1,
|
|
@@ -55223,6 +55273,7 @@ var init_nativeWorkerPool = __esm({
|
|
|
55223
55273
|
"use strict";
|
|
55224
55274
|
init_esm_wrapper();
|
|
55225
55275
|
init_workerThreads();
|
|
55276
|
+
init_windowsProcessDrain();
|
|
55226
55277
|
HARD_MAX_THREADS = 64;
|
|
55227
55278
|
DEFAULT_NATIVE_THREAD_CAP = 8;
|
|
55228
55279
|
}
|
|
@@ -55942,6 +55993,16 @@ function emitIndexCheckActivity(opts, activity, current = 0, total = 0) {
|
|
|
55942
55993
|
total
|
|
55943
55994
|
});
|
|
55944
55995
|
}
|
|
55996
|
+
function createCountedCheckProgress(opts, activity, total) {
|
|
55997
|
+
emitIndexCheckActivity(opts, activity, 0, total);
|
|
55998
|
+
let completed = 0;
|
|
55999
|
+
return () => {
|
|
56000
|
+
completed += 1;
|
|
56001
|
+
if (completed === total || completed % 100 === 0) {
|
|
56002
|
+
emitIndexCheckActivity(opts, activity, completed, total);
|
|
56003
|
+
}
|
|
56004
|
+
};
|
|
56005
|
+
}
|
|
55945
56006
|
function resetDiscoveryTimingSteps(timings) {
|
|
55946
56007
|
if (!timings)
|
|
55947
56008
|
return;
|
|
@@ -55949,6 +56010,7 @@ function resetDiscoveryTimingSteps(timings) {
|
|
|
55949
56010
|
delete timings.filesystemScanMs;
|
|
55950
56011
|
delete timings.sourceDiscoveryMs;
|
|
55951
56012
|
delete timings.metadataDiscoveryMs;
|
|
56013
|
+
delete timings.cacheProbeMs;
|
|
55952
56014
|
const remaining = (timings.steps ?? []).filter((step) => !DISCOVERY_TIMING_STEP_NAMES.has(step.name));
|
|
55953
56015
|
if (remaining.length) {
|
|
55954
56016
|
timings.steps = remaining;
|
|
@@ -56049,6 +56111,10 @@ async function buildIndexFromFileListShared(projectRoot, rawFiles, opts, helperO
|
|
|
56049
56111
|
}
|
|
56050
56112
|
const manifestEntriesForIndex = useManifest ? projectIndexManifestEntries2(cachedGraphEntries ?? []) : /* @__PURE__ */ new Map();
|
|
56051
56113
|
const modules = /* @__PURE__ */ new Map();
|
|
56114
|
+
const moduleCacheAvailable = opts?.cache !== "disk" || diskModuleCacheExists(projectRoot, opts);
|
|
56115
|
+
const shouldReportFileCacheCheck = Boolean(helperOpts?.reportDiscoveryProgress);
|
|
56116
|
+
const reportFileCacheCheck = shouldReportFileCacheCheck ? createCountedCheckProgress(opts, "Checking file cache", normalizedFiles.length) : () => void 0;
|
|
56117
|
+
const cacheProbeStart = performance6.now();
|
|
56052
56118
|
const gitAvailable = await isGitRepo(projectRoot);
|
|
56053
56119
|
const needsPersistentSignatures = cacheEnabled || useManifest;
|
|
56054
56120
|
const useGitSignatures = gitAvailable && needsPersistentSignatures;
|
|
@@ -56088,7 +56154,6 @@ async function buildIndexFromFileListShared(projectRoot, rawFiles, opts, helperO
|
|
|
56088
56154
|
return !(matchesGitSig || cachedEdgesEntry.sig === sigInfo.sig);
|
|
56089
56155
|
};
|
|
56090
56156
|
const jsonDependencies = /* @__PURE__ */ new Map();
|
|
56091
|
-
const moduleCacheAvailable = opts?.cache !== "disk" || diskModuleCacheExists(projectRoot, opts);
|
|
56092
56157
|
const cacheProbes = new Map(await mapLimit(normalizedFiles, conc, async (file2) => {
|
|
56093
56158
|
try {
|
|
56094
56159
|
let sigInfo = fileSignatures.get(file2);
|
|
@@ -56117,8 +56182,15 @@ async function buildIndexFromFileListShared(projectRoot, rawFiles, opts, helperO
|
|
|
56117
56182
|
return [file2, { sigInfo, mod: mod2 }];
|
|
56118
56183
|
} catch (error51) {
|
|
56119
56184
|
return [file2, { error: error51 }];
|
|
56185
|
+
} finally {
|
|
56186
|
+
reportFileCacheCheck();
|
|
56120
56187
|
}
|
|
56121
56188
|
}));
|
|
56189
|
+
if (timings) {
|
|
56190
|
+
const cacheProbeMs = Math.round(performance6.now() - cacheProbeStart);
|
|
56191
|
+
timings.cacheProbeMs = cacheProbeMs;
|
|
56192
|
+
recordBuildTimingStep(timings, { name: "cache-probe", ms: cacheProbeMs });
|
|
56193
|
+
}
|
|
56122
56194
|
const cacheMisses = Array.from(cacheProbes, ([file2, probe]) => !("error" in probe) && !probe.mod ? file2 : null).filter((file2) => file2 !== null);
|
|
56123
56195
|
const workerSetup = await setupWorkerPool(opts, countNativeWorkerEligibleFiles(cacheMisses, opts?.languageExtensions));
|
|
56124
56196
|
try {
|
|
@@ -56154,6 +56226,8 @@ async function buildIndexFromFileListShared(projectRoot, rawFiles, opts, helperO
|
|
|
56154
56226
|
buildStartedAt = performance6.now();
|
|
56155
56227
|
emitIndexLifecycleProgress(opts, "start", "build", totalFiles);
|
|
56156
56228
|
};
|
|
56229
|
+
if (cacheMisses.length)
|
|
56230
|
+
ensureBuildProgressStarted();
|
|
56157
56231
|
const fileResults = await mapLimit(normalizedFiles, conc, async (file2) => {
|
|
56158
56232
|
try {
|
|
56159
56233
|
const cacheProbe = cacheProbes.get(file2);
|
|
@@ -56431,6 +56505,7 @@ async function buildProjectIndexWithManifestOptions(projectRoot, opts, helperOpt
|
|
|
56431
56505
|
manifestMode: useDiskCache ? "read-write" : "off",
|
|
56432
56506
|
warnNoFilesMessage: `Warning: No files found in project root: ${projectRoot}. Check codegraph.config.json globs and CLI --include-glob/--ignore-glob filters. Diagnostic: codegraph doctor`,
|
|
56433
56507
|
...helperOpts?.ignoreExistingManifest ? { ignoreExistingManifest: true } : {},
|
|
56508
|
+
...helperOpts?.reportDiscoveryProgress ? { reportDiscoveryProgress: true } : {},
|
|
56434
56509
|
projectFiles,
|
|
56435
56510
|
transientFiles,
|
|
56436
56511
|
...discoveredSymlinkDirectories !== void 0 ? { symlinkDirectories: discoveredSymlinkDirectories } : {}
|
|
@@ -57321,7 +57396,7 @@ var init_build_index = __esm({
|
|
|
57321
57396
|
init_build_workers();
|
|
57322
57397
|
init_incremental_plan();
|
|
57323
57398
|
init_parsed_cache();
|
|
57324
|
-
DISCOVERY_TIMING_STEP_NAMES = /* @__PURE__ */ new Set(["git-list", "git-ignore", "filesystem-scan"]);
|
|
57399
|
+
DISCOVERY_TIMING_STEP_NAMES = /* @__PURE__ */ new Set(["git-list", "git-ignore", "filesystem-scan", "cache-probe"]);
|
|
57325
57400
|
}
|
|
57326
57401
|
});
|
|
57327
57402
|
|
|
@@ -63284,12 +63359,15 @@ function resolveRawSqlQueryWorkerPath() {
|
|
|
63284
63359
|
}
|
|
63285
63360
|
async function runRawSqlQueryInWorker(task, deadlineMs, signal) {
|
|
63286
63361
|
const workerPath = resolveRawSqlQueryWorkerPath();
|
|
63287
|
-
return await rawSqlQueryWorkerLifecycle.run(task, deadlineMs, signal, () =>
|
|
63288
|
-
|
|
63289
|
-
|
|
63290
|
-
|
|
63291
|
-
|
|
63292
|
-
|
|
63362
|
+
return await rawSqlQueryWorkerLifecycle.run(task, deadlineMs, signal, () => {
|
|
63363
|
+
markWindowsProcessDrainRequired();
|
|
63364
|
+
return new Piscina({
|
|
63365
|
+
filename: workerPath,
|
|
63366
|
+
minThreads: 1,
|
|
63367
|
+
maxThreads: 1,
|
|
63368
|
+
idleTimeout: 5e3
|
|
63369
|
+
});
|
|
63370
|
+
});
|
|
63293
63371
|
}
|
|
63294
63372
|
var MAX_RAW_SQL_QUERY_WORKERS, SqliteQueryDeadlineExceededError, SqliteQueryCancelledError, SqliteQueryWorkerCleanupCapacityExceededError, RawSqlQueryWorkerLifecycle, rawSqlQueryWorkerLifecycle;
|
|
63295
63373
|
var init_rawQueryWorkerPool = __esm({
|
|
@@ -63297,6 +63375,7 @@ var init_rawQueryWorkerPool = __esm({
|
|
|
63297
63375
|
"use strict";
|
|
63298
63376
|
init_esm_wrapper();
|
|
63299
63377
|
init_packageInfo();
|
|
63378
|
+
init_windowsProcessDrain();
|
|
63300
63379
|
MAX_RAW_SQL_QUERY_WORKERS = 2;
|
|
63301
63380
|
SqliteQueryDeadlineExceededError = class extends Error {
|
|
63302
63381
|
constructor(deadlineMs) {
|
|
@@ -75707,6 +75786,7 @@ async function prepareQueryIndexFilesInWorker(projectRoot, files) {
|
|
|
75707
75786
|
} catch {
|
|
75708
75787
|
return await prepareQueryIndexFilesInProcess(projectRoot, files);
|
|
75709
75788
|
}
|
|
75789
|
+
markWindowsProcessDrainRequired();
|
|
75710
75790
|
const pool = new Piscina({
|
|
75711
75791
|
filename: workerPath,
|
|
75712
75792
|
minThreads: 1,
|
|
@@ -75747,6 +75827,7 @@ var init_workerPool = __esm({
|
|
|
75747
75827
|
init_content();
|
|
75748
75828
|
init_paths2();
|
|
75749
75829
|
init_workerThreads();
|
|
75830
|
+
init_windowsProcessDrain();
|
|
75750
75831
|
QUERY_INDEX_MAX_THREADS = 4;
|
|
75751
75832
|
QUERY_INDEX_WORKER_MIN_FILES = 512;
|
|
75752
75833
|
}
|
|
@@ -3552,6 +3552,35 @@ function loadNativeBinding(options) {
|
|
|
3552
3552
|
}
|
|
3553
3553
|
}
|
|
3554
3554
|
|
|
3555
|
+
// dist/util/windowsProcessDrain.js
|
|
3556
|
+
var WINDOWS_LIBUV_EXIT_DRAIN_MS = 100;
|
|
3557
|
+
var drainRequired = false;
|
|
3558
|
+
var beforeExitListener;
|
|
3559
|
+
function markWindowsProcessDrainRequired() {
|
|
3560
|
+
drainRequired = true;
|
|
3561
|
+
ensureWindowsProcessDrainHook();
|
|
3562
|
+
}
|
|
3563
|
+
function delay(ms) {
|
|
3564
|
+
return new Promise((resolve) => {
|
|
3565
|
+
setTimeout(resolve, ms);
|
|
3566
|
+
});
|
|
3567
|
+
}
|
|
3568
|
+
function ensureWindowsProcessDrainHook() {
|
|
3569
|
+
if (process.platform !== "win32" || beforeExitListener)
|
|
3570
|
+
return;
|
|
3571
|
+
beforeExitListener = () => {
|
|
3572
|
+
void drainWindowsProcessHandles();
|
|
3573
|
+
};
|
|
3574
|
+
process.once("beforeExit", beforeExitListener);
|
|
3575
|
+
}
|
|
3576
|
+
async function drainWindowsProcessHandles(options) {
|
|
3577
|
+
const platform = options?.platform ?? process.platform;
|
|
3578
|
+
const required = options?.required ?? drainRequired;
|
|
3579
|
+
if (platform !== "win32" || !required)
|
|
3580
|
+
return;
|
|
3581
|
+
await (options?.wait ?? delay)(WINDOWS_LIBUV_EXIT_DRAIN_MS);
|
|
3582
|
+
}
|
|
3583
|
+
|
|
3555
3584
|
// dist/native/runtime.js
|
|
3556
3585
|
var require2 = createRequire(import.meta.url);
|
|
3557
3586
|
var localNativePackageRoot = path5.resolve(path5.dirname(fileURLToPath(import.meta.url)), "../../packages/codegraph-native");
|
|
@@ -3581,6 +3610,7 @@ function loadBinding() {
|
|
|
3581
3610
|
});
|
|
3582
3611
|
if (loaded.binding) {
|
|
3583
3612
|
const supportedLanguageIds = new Set(loaded.binding.supportedLanguageIds());
|
|
3613
|
+
markWindowsProcessDrainRequired();
|
|
3584
3614
|
bindingState = {
|
|
3585
3615
|
loaded: true,
|
|
3586
3616
|
binding: loaded.binding,
|
|
@@ -25,6 +25,35 @@ function errorMessage(error) {
|
|
|
25
25
|
return String(error);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
// dist/util/windowsProcessDrain.js
|
|
29
|
+
var WINDOWS_LIBUV_EXIT_DRAIN_MS = 100;
|
|
30
|
+
var drainRequired = false;
|
|
31
|
+
var beforeExitListener;
|
|
32
|
+
function markWindowsProcessDrainRequired() {
|
|
33
|
+
drainRequired = true;
|
|
34
|
+
ensureWindowsProcessDrainHook();
|
|
35
|
+
}
|
|
36
|
+
function delay(ms) {
|
|
37
|
+
return new Promise((resolve) => {
|
|
38
|
+
setTimeout(resolve, ms);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function ensureWindowsProcessDrainHook() {
|
|
42
|
+
if (process.platform !== "win32" || beforeExitListener)
|
|
43
|
+
return;
|
|
44
|
+
beforeExitListener = () => {
|
|
45
|
+
void drainWindowsProcessHandles();
|
|
46
|
+
};
|
|
47
|
+
process.once("beforeExit", beforeExitListener);
|
|
48
|
+
}
|
|
49
|
+
async function drainWindowsProcessHandles(options) {
|
|
50
|
+
const platform = options?.platform ?? process.platform;
|
|
51
|
+
const required = options?.required ?? drainRequired;
|
|
52
|
+
if (platform !== "win32" || !required)
|
|
53
|
+
return;
|
|
54
|
+
await (options?.wait ?? delay)(WINDOWS_LIBUV_EXIT_DRAIN_MS);
|
|
55
|
+
}
|
|
56
|
+
|
|
28
57
|
// dist/sqlite-driver.js
|
|
29
58
|
var requireNodeModule = createRequire(import.meta.url);
|
|
30
59
|
var sqliteModule;
|
|
@@ -160,6 +189,7 @@ var SqliteStatement = class _SqliteStatement {
|
|
|
160
189
|
var SqliteDatabase = class {
|
|
161
190
|
db;
|
|
162
191
|
statements = /* @__PURE__ */ new Map();
|
|
192
|
+
closed = false;
|
|
163
193
|
constructor(filePath, options) {
|
|
164
194
|
if (!isNodeSqliteUsable()) {
|
|
165
195
|
throw nodeSqliteUnavailableError() ?? new Error("node:sqlite is unavailable");
|
|
@@ -169,6 +199,7 @@ var SqliteDatabase = class {
|
|
|
169
199
|
readOnly: options?.readonly,
|
|
170
200
|
timeout: options?.timeout ?? 5e3
|
|
171
201
|
});
|
|
202
|
+
markWindowsProcessDrainRequired();
|
|
172
203
|
if (options?.readonly) {
|
|
173
204
|
const { constants } = sqlite;
|
|
174
205
|
if (this.db.setAuthorizer && canInstallReadonlyAuthorizer(constants)) {
|
|
@@ -213,8 +244,11 @@ var SqliteDatabase = class {
|
|
|
213
244
|
};
|
|
214
245
|
}
|
|
215
246
|
close() {
|
|
247
|
+
if (this.closed)
|
|
248
|
+
return;
|
|
216
249
|
this.statements.clear();
|
|
217
250
|
this.db.close();
|
|
251
|
+
this.closed = true;
|
|
218
252
|
}
|
|
219
253
|
};
|
|
220
254
|
function isReadOnlySqliteError(error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-index.d.ts","sourceRoot":"","sources":["../../src/indexer/build-index.ts"],"names":[],"mappings":"AA4FA,OAAO,EACL,KAAK,YAAY,EAGjB,KAAK,gBAAgB,EAErB,KAAK,uBAAuB,EAI5B,KAAK,YAAY,EAIlB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"build-index.d.ts","sourceRoot":"","sources":["../../src/indexer/build-index.ts"],"names":[],"mappings":"AA4FA,OAAO,EACL,KAAK,YAAY,EAGjB,KAAK,gBAAgB,EAErB,KAAK,uBAAuB,EAI5B,KAAK,YAAY,EAIlB,MAAM,YAAY,CAAC;AA6pCpB;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAKvG;AAED;;;;;;GAMG;AACH,wBAAsB,0BAA0B,CAC9C,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAAE,EACpB,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,YAAY,CAAC,CAmBvB;AA4BD;;;;;;GAMG;AACH,wBAAsB,4BAA4B,CAChD,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,uBAAuB,GAChC,OAAO,CAAC,YAAY,CAAC,CA8wBvB;AAED,wBAAsB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA8IpH"}
|
|
@@ -414,7 +414,17 @@ function emitIndexCheckActivity(opts, activity, current = 0, total = 0) {
|
|
|
414
414
|
total,
|
|
415
415
|
});
|
|
416
416
|
}
|
|
417
|
-
|
|
417
|
+
function createCountedCheckProgress(opts, activity, total) {
|
|
418
|
+
emitIndexCheckActivity(opts, activity, 0, total);
|
|
419
|
+
let completed = 0;
|
|
420
|
+
return () => {
|
|
421
|
+
completed += 1;
|
|
422
|
+
if (completed === total || completed % 100 === 0) {
|
|
423
|
+
emitIndexCheckActivity(opts, activity, completed, total);
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
const DISCOVERY_TIMING_STEP_NAMES = new Set(["git-list", "git-ignore", "filesystem-scan", "cache-probe"]);
|
|
418
428
|
function resetDiscoveryTimingSteps(timings) {
|
|
419
429
|
if (!timings)
|
|
420
430
|
return;
|
|
@@ -422,6 +432,7 @@ function resetDiscoveryTimingSteps(timings) {
|
|
|
422
432
|
delete timings.filesystemScanMs;
|
|
423
433
|
delete timings.sourceDiscoveryMs;
|
|
424
434
|
delete timings.metadataDiscoveryMs;
|
|
435
|
+
delete timings.cacheProbeMs;
|
|
425
436
|
const remaining = (timings.steps ?? []).filter((step) => !DISCOVERY_TIMING_STEP_NAMES.has(step.name));
|
|
426
437
|
if (remaining.length) {
|
|
427
438
|
timings.steps = remaining;
|
|
@@ -534,6 +545,12 @@ async function buildIndexFromFileListShared(projectRoot, rawFiles, opts, helperO
|
|
|
534
545
|
? projectIndexManifestEntries(cachedGraphEntries ?? [])
|
|
535
546
|
: new Map();
|
|
536
547
|
const modules = new Map();
|
|
548
|
+
const moduleCacheAvailable = opts?.cache !== "disk" || diskModuleCacheExists(projectRoot, opts);
|
|
549
|
+
const shouldReportFileCacheCheck = Boolean(helperOpts?.reportDiscoveryProgress);
|
|
550
|
+
const reportFileCacheCheck = shouldReportFileCacheCheck
|
|
551
|
+
? createCountedCheckProgress(opts, "Checking file cache", normalizedFiles.length)
|
|
552
|
+
: () => undefined;
|
|
553
|
+
const cacheProbeStart = performance.now();
|
|
537
554
|
const gitAvailable = await isGitRepo(projectRoot);
|
|
538
555
|
const needsPersistentSignatures = cacheEnabled || useManifest;
|
|
539
556
|
const useGitSignatures = gitAvailable && needsPersistentSignatures;
|
|
@@ -580,7 +597,6 @@ async function buildIndexFromFileListShared(projectRoot, rawFiles, opts, helperO
|
|
|
580
597
|
// Cache lookup determines the work a full build will actually parse. Complete that cheap phase
|
|
581
598
|
// before starting Piscina, so a warm build does not bootstrap workers and partial hits bound
|
|
582
599
|
// the pool to real parse misses rather than the input file list.
|
|
583
|
-
const moduleCacheAvailable = opts?.cache !== "disk" || diskModuleCacheExists(projectRoot, opts);
|
|
584
600
|
const cacheProbes = new Map(await mapLimit(normalizedFiles, conc, async (file) => {
|
|
585
601
|
try {
|
|
586
602
|
let sigInfo = fileSignatures.get(file);
|
|
@@ -616,7 +632,15 @@ async function buildIndexFromFileListShared(projectRoot, rawFiles, opts, helperO
|
|
|
616
632
|
catch (error) {
|
|
617
633
|
return [file, { error }];
|
|
618
634
|
}
|
|
635
|
+
finally {
|
|
636
|
+
reportFileCacheCheck();
|
|
637
|
+
}
|
|
619
638
|
}));
|
|
639
|
+
if (timings) {
|
|
640
|
+
const cacheProbeMs = Math.round(performance.now() - cacheProbeStart);
|
|
641
|
+
timings.cacheProbeMs = cacheProbeMs;
|
|
642
|
+
recordBuildTimingStep(timings, { name: "cache-probe", ms: cacheProbeMs });
|
|
643
|
+
}
|
|
620
644
|
const cacheMisses = Array.from(cacheProbes, ([file, probe]) => !("error" in probe) && !probe.mod ? file : null).filter((file) => file !== null);
|
|
621
645
|
const workerSetup = await setupWorkerPool(opts, countNativeWorkerEligibleFiles(cacheMisses, opts?.languageExtensions));
|
|
622
646
|
try {
|
|
@@ -658,6 +682,8 @@ async function buildIndexFromFileListShared(projectRoot, rawFiles, opts, helperO
|
|
|
658
682
|
buildStartedAt = performance.now();
|
|
659
683
|
emitIndexLifecycleProgress(opts, "start", "build", totalFiles);
|
|
660
684
|
};
|
|
685
|
+
if (cacheMisses.length)
|
|
686
|
+
ensureBuildProgressStarted();
|
|
661
687
|
const fileResults = await mapLimit(normalizedFiles, conc, async (file) => {
|
|
662
688
|
try {
|
|
663
689
|
const cacheProbe = cacheProbes.get(file);
|
|
@@ -972,6 +998,7 @@ async function buildProjectIndexWithManifestOptions(projectRoot, opts, helperOpt
|
|
|
972
998
|
manifestMode: useDiskCache ? "read-write" : "off",
|
|
973
999
|
warnNoFilesMessage: `Warning: No files found in project root: ${projectRoot}. Check codegraph.config.json globs and CLI --include-glob/--ignore-glob filters. Diagnostic: codegraph doctor`,
|
|
974
1000
|
...(helperOpts?.ignoreExistingManifest ? { ignoreExistingManifest: true } : {}),
|
|
1001
|
+
...(helperOpts?.reportDiscoveryProgress ? { reportDiscoveryProgress: true } : {}),
|
|
975
1002
|
projectFiles,
|
|
976
1003
|
transientFiles,
|
|
977
1004
|
...(discoveredSymlinkDirectories !== undefined ? { symlinkDirectories: discoveredSymlinkDirectories } : {}),
|