ctxloom-pro 1.7.4 → 1.7.5
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/README.md
CHANGED
|
@@ -69,7 +69,7 @@ The full first-run flow is **one install + one trial + one init per project.** E
|
|
|
69
69
|
npm install -g ctxloom-pro
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
> **For local trial / dev use the unpinned command above is fine.** For unattended CI usage, pin to the exact version (`ctxloom-pro@1.7.
|
|
72
|
+
> **For local trial / dev use the unpinned command above is fine.** For unattended CI usage, pin to the exact version (`ctxloom-pro@1.7.5`) so future CLI releases don't silently desync your agent-spec coverage — see the workflow example below.
|
|
73
73
|
|
|
74
74
|
### 2 — Start your free trial (once per email)
|
|
75
75
|
|
|
@@ -383,7 +383,7 @@ jobs:
|
|
|
383
383
|
# Exact pin (not `@^1`) so future CLI releases that add/remove MCP
|
|
384
384
|
# tools don't silently desync your reviewer-agent specs. Bump on
|
|
385
385
|
# every release; see CHANGELOG.md for the live version table.
|
|
386
|
-
- run: npm install -g ctxloom-pro@1.7.
|
|
386
|
+
- run: npm install -g ctxloom-pro@1.7.5
|
|
387
387
|
- run: ctxloom index
|
|
388
388
|
- run: ctxloom rules check --json
|
|
389
389
|
```
|
|
@@ -2929,7 +2929,7 @@ var CallGraphIndex = class _CallGraphIndex {
|
|
|
2929
2929
|
var TS_EXTENSIONS2 = /* @__PURE__ */ new Set([".ts", ".tsx", ".js", ".jsx", ".mjs", ".vue"]);
|
|
2930
2930
|
var PY_EXTENSIONS = /* @__PURE__ */ new Set([".py", ".ipynb"]);
|
|
2931
2931
|
var AST_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".tsx", ".js", ".jsx", ".mjs", ".py", ".go", ".rs", ".java", ".cs", ".rb", ".kt", ".kts", ".swift", ".ipynb", ".php", ".dart"]);
|
|
2932
|
-
var CTXLOOM_VERSION = "1.7.
|
|
2932
|
+
var CTXLOOM_VERSION = "1.7.5".length > 0 ? "1.7.5" : "dev";
|
|
2933
2933
|
var SNAPSHOT_SCHEMA_VERSION = 2;
|
|
2934
2934
|
function compareCtxloomVersions(snapshotVer, currentVer) {
|
|
2935
2935
|
if (snapshotVer === currentVer) return "same";
|
|
@@ -2986,6 +2986,28 @@ var DependencyGraph = class {
|
|
|
2986
2986
|
rootDir = "";
|
|
2987
2987
|
snapshotDir = "";
|
|
2988
2988
|
tsPathsResolver = null;
|
|
2989
|
+
/**
|
|
2990
|
+
* fs.watch handle on `.ctxloom/graph-snapshot.json`. When the file is
|
|
2991
|
+
* rewritten externally (e.g. the user runs `ctxloom index` from a
|
|
2992
|
+
* terminal while an MCP server is live), this watcher triggers an
|
|
2993
|
+
* in-memory rehydrate so subsequent tool calls reflect the new graph
|
|
2994
|
+
* without needing the user to restart their MCP client.
|
|
2995
|
+
*
|
|
2996
|
+
* Real repro that motivated this (v1.7.5): EasyMoney user ran
|
|
2997
|
+
* `rm -rf .ctxloom && ctxloom index` from the terminal but the
|
|
2998
|
+
* Claude Desktop MCP server kept serving the pre-wipe in-memory
|
|
2999
|
+
* graph (`Files: 2`) because there was no mechanism to detect the
|
|
3000
|
+
* fresh snapshot on disk. Confusing diagnostic loop.
|
|
3001
|
+
*/
|
|
3002
|
+
snapshotWatcher = null;
|
|
3003
|
+
/** Debounce timer for snapshot-change events. */
|
|
3004
|
+
snapshotReloadTimer = null;
|
|
3005
|
+
/**
|
|
3006
|
+
* Tracks the snapshot mtime we last loaded from disk so the watcher
|
|
3007
|
+
* can suppress its own-write echo. saveSnapshot() updates this just
|
|
3008
|
+
* before writing; the watcher ignores any change whose mtime <= this.
|
|
3009
|
+
*/
|
|
3010
|
+
lastLoadedSnapshotMtimeMs = 0;
|
|
2989
3011
|
/**
|
|
2990
3012
|
* Build the graph from all supported files in rootDir using AST parsing.
|
|
2991
3013
|
*/
|
|
@@ -3185,6 +3207,105 @@ var DependencyGraph = class {
|
|
|
3185
3207
|
this.snapshotDir = path7.join(rootDir, ".ctxloom");
|
|
3186
3208
|
return this.loadSnapshot();
|
|
3187
3209
|
}
|
|
3210
|
+
/**
|
|
3211
|
+
* Start watching `.ctxloom/graph-snapshot.json` for external rewrites.
|
|
3212
|
+
* When the user runs `ctxloom index` (or any other tool) from a
|
|
3213
|
+
* terminal against the same project root, the watcher detects the
|
|
3214
|
+
* new mtime, reloads the snapshot, and atomically swaps the
|
|
3215
|
+
* in-memory graph — so subsequent MCP tool calls see the fresh
|
|
3216
|
+
* graph without requiring an MCP client restart.
|
|
3217
|
+
*
|
|
3218
|
+
* Own writes (via saveSnapshot) update lastLoadedSnapshotMtimeMs
|
|
3219
|
+
* BEFORE the rename completes, so the watcher's own-write echo is
|
|
3220
|
+
* filtered out by the mtime check.
|
|
3221
|
+
*
|
|
3222
|
+
* Debounced 200 ms — matches the FileWatcher cadence and absorbs
|
|
3223
|
+
* the burst of fs.watch events some platforms emit for a single
|
|
3224
|
+
* write (Linux can fire `rename` + `change`, macOS sometimes
|
|
3225
|
+
* fires multiple `change` for atomic rename).
|
|
3226
|
+
*
|
|
3227
|
+
* Idempotent: calling twice is harmless (re-uses the existing
|
|
3228
|
+
* watcher). Call stopSnapshotWatcher() before disposing the graph
|
|
3229
|
+
* to release the FD.
|
|
3230
|
+
*/
|
|
3231
|
+
startSnapshotWatcher(debounceMs = 200) {
|
|
3232
|
+
if (this.snapshotWatcher) return;
|
|
3233
|
+
if (!this.snapshotDir) {
|
|
3234
|
+
logger.warn("startSnapshotWatcher: no snapshotDir set, call buildFromDirectory first");
|
|
3235
|
+
return;
|
|
3236
|
+
}
|
|
3237
|
+
const snapshotPath = this.getSnapshotPath();
|
|
3238
|
+
if (!fs7.existsSync(snapshotPath)) {
|
|
3239
|
+
logger.warn("startSnapshotWatcher: snapshot file does not exist yet", { path: snapshotPath });
|
|
3240
|
+
return;
|
|
3241
|
+
}
|
|
3242
|
+
try {
|
|
3243
|
+
this.snapshotWatcher = fs7.watch(snapshotPath, { persistent: false }, (eventType) => {
|
|
3244
|
+
if (this.snapshotReloadTimer) clearTimeout(this.snapshotReloadTimer);
|
|
3245
|
+
this.snapshotReloadTimer = setTimeout(() => {
|
|
3246
|
+
this.snapshotReloadTimer = null;
|
|
3247
|
+
void this.maybeReloadSnapshot(eventType);
|
|
3248
|
+
}, debounceMs);
|
|
3249
|
+
});
|
|
3250
|
+
this.snapshotWatcher.on("error", (err) => {
|
|
3251
|
+
logger.warn("snapshot watcher error", { detail: err instanceof Error ? err.message : String(err) });
|
|
3252
|
+
});
|
|
3253
|
+
logger.info("Graph snapshot hot-reload watcher started", { path: snapshotPath });
|
|
3254
|
+
} catch (err) {
|
|
3255
|
+
logger.warn("startSnapshotWatcher: failed to attach fs.watch", {
|
|
3256
|
+
detail: err instanceof Error ? err.message : String(err)
|
|
3257
|
+
});
|
|
3258
|
+
this.snapshotWatcher = null;
|
|
3259
|
+
}
|
|
3260
|
+
}
|
|
3261
|
+
/**
|
|
3262
|
+
* Stop the snapshot watcher and clear any pending debounce timer.
|
|
3263
|
+
* Call before disposing the graph to release the FD held by fs.watch.
|
|
3264
|
+
* Idempotent.
|
|
3265
|
+
*/
|
|
3266
|
+
stopSnapshotWatcher() {
|
|
3267
|
+
if (this.snapshotReloadTimer) {
|
|
3268
|
+
clearTimeout(this.snapshotReloadTimer);
|
|
3269
|
+
this.snapshotReloadTimer = null;
|
|
3270
|
+
}
|
|
3271
|
+
if (this.snapshotWatcher) {
|
|
3272
|
+
try {
|
|
3273
|
+
this.snapshotWatcher.close();
|
|
3274
|
+
} catch {
|
|
3275
|
+
}
|
|
3276
|
+
this.snapshotWatcher = null;
|
|
3277
|
+
}
|
|
3278
|
+
}
|
|
3279
|
+
/**
|
|
3280
|
+
* Internal: called from the debounced watcher. Compares on-disk
|
|
3281
|
+
* mtime against `lastLoadedSnapshotMtimeMs` to filter own-write
|
|
3282
|
+
* echoes, then re-hydrates the in-memory maps from disk via
|
|
3283
|
+
* loadSnapshot(). Atomic from the perspective of MCP tool calls
|
|
3284
|
+
* because Node's event loop ensures loadSnapshot's map assignments
|
|
3285
|
+
* happen in a single tick (no other code interleaves).
|
|
3286
|
+
*/
|
|
3287
|
+
async maybeReloadSnapshot(eventType) {
|
|
3288
|
+
const snapshotPath = this.getSnapshotPath();
|
|
3289
|
+
let currentMtime = 0;
|
|
3290
|
+
try {
|
|
3291
|
+
currentMtime = fs7.statSync(snapshotPath).mtimeMs;
|
|
3292
|
+
} catch {
|
|
3293
|
+
return;
|
|
3294
|
+
}
|
|
3295
|
+
if (currentMtime <= this.lastLoadedSnapshotMtimeMs) {
|
|
3296
|
+
return;
|
|
3297
|
+
}
|
|
3298
|
+
const ok = await this.loadSnapshot();
|
|
3299
|
+
if (ok) {
|
|
3300
|
+
logger.info("Graph snapshot hot-reloaded", {
|
|
3301
|
+
event: eventType,
|
|
3302
|
+
files: this.forwardEdges.size,
|
|
3303
|
+
edges: this.edgeCount()
|
|
3304
|
+
});
|
|
3305
|
+
} else {
|
|
3306
|
+
logger.warn("Graph snapshot hot-reload skipped (snapshot invalid or version-stale)");
|
|
3307
|
+
}
|
|
3308
|
+
}
|
|
3188
3309
|
/**
|
|
3189
3310
|
* Get files that the given file directly imports.
|
|
3190
3311
|
*/
|
|
@@ -3459,6 +3580,10 @@ var DependencyGraph = class {
|
|
|
3459
3580
|
const tmpPath = `${snapshotPath}.${process.pid}.tmp`;
|
|
3460
3581
|
fs7.writeFileSync(tmpPath, JSON.stringify(data, null, 2));
|
|
3461
3582
|
fs7.renameSync(tmpPath, snapshotPath);
|
|
3583
|
+
try {
|
|
3584
|
+
this.lastLoadedSnapshotMtimeMs = fs7.statSync(snapshotPath).mtimeMs;
|
|
3585
|
+
} catch {
|
|
3586
|
+
}
|
|
3462
3587
|
const callData = this.callGraphIndex.toJSON();
|
|
3463
3588
|
const callPath = path7.join(this.snapshotDir, "call-graph-snapshot.json");
|
|
3464
3589
|
const callTmp = `${callPath}.${process.pid}.tmp`;
|
|
@@ -3536,6 +3661,10 @@ var DependencyGraph = class {
|
|
|
3536
3661
|
this.callGraphIndex = new CallGraphIndex();
|
|
3537
3662
|
}
|
|
3538
3663
|
}
|
|
3664
|
+
try {
|
|
3665
|
+
this.lastLoadedSnapshotMtimeMs = fs7.statSync(snapshotPath).mtimeMs;
|
|
3666
|
+
} catch {
|
|
3667
|
+
}
|
|
3539
3668
|
return true;
|
|
3540
3669
|
} catch (err) {
|
|
3541
3670
|
logger.error("Failed to load graph snapshot, will rebuild", { detail: err instanceof Error ? err.message : String(err) });
|
|
@@ -12161,7 +12290,7 @@ function resolveTelemetryLevel() {
|
|
|
12161
12290
|
}
|
|
12162
12291
|
var TELEMETRY_LEVEL = resolveTelemetryLevel();
|
|
12163
12292
|
var TELEMETRY_DISABLED = TELEMETRY_LEVEL === "off";
|
|
12164
|
-
var CTXLOOM_VERSION2 = "1.7.
|
|
12293
|
+
var CTXLOOM_VERSION2 = "1.7.5".length > 0 ? "1.7.5" : "dev";
|
|
12165
12294
|
var POSTHOG_HOST = "https://eu.i.posthog.com";
|
|
12166
12295
|
var POSTHOG_KEY = process.env["POSTHOG_API_KEY"] ?? (true ? "phc_CiDkmFLcZ2K6uCpcoSUQLmFrnnUvsyXGhSxopX5TVKE6" : "");
|
|
12167
12296
|
var SENTRY_DSN = process.env["SENTRY_DSN"] ?? (true ? "https://81c94a0f04a8e242dee493ac1e17f733@o4508531702497280.ingest.de.sentry.io/4511256875368528" : "");
|
|
@@ -2705,7 +2705,7 @@ var CallGraphIndex = class _CallGraphIndex {
|
|
|
2705
2705
|
var TS_EXTENSIONS2 = /* @__PURE__ */ new Set([".ts", ".tsx", ".js", ".jsx", ".mjs", ".vue"]);
|
|
2706
2706
|
var PY_EXTENSIONS = /* @__PURE__ */ new Set([".py", ".ipynb"]);
|
|
2707
2707
|
var AST_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".tsx", ".js", ".jsx", ".mjs", ".py", ".go", ".rs", ".java", ".cs", ".rb", ".kt", ".kts", ".swift", ".ipynb", ".php", ".dart"]);
|
|
2708
|
-
var CTXLOOM_VERSION = "1.7.
|
|
2708
|
+
var CTXLOOM_VERSION = "1.7.5".length > 0 ? "1.7.5" : "dev";
|
|
2709
2709
|
var SNAPSHOT_SCHEMA_VERSION = 2;
|
|
2710
2710
|
function compareCtxloomVersions(snapshotVer, currentVer) {
|
|
2711
2711
|
if (snapshotVer === currentVer) return "same";
|
|
@@ -2762,6 +2762,28 @@ var DependencyGraph = class {
|
|
|
2762
2762
|
rootDir = "";
|
|
2763
2763
|
snapshotDir = "";
|
|
2764
2764
|
tsPathsResolver = null;
|
|
2765
|
+
/**
|
|
2766
|
+
* fs.watch handle on `.ctxloom/graph-snapshot.json`. When the file is
|
|
2767
|
+
* rewritten externally (e.g. the user runs `ctxloom index` from a
|
|
2768
|
+
* terminal while an MCP server is live), this watcher triggers an
|
|
2769
|
+
* in-memory rehydrate so subsequent tool calls reflect the new graph
|
|
2770
|
+
* without needing the user to restart their MCP client.
|
|
2771
|
+
*
|
|
2772
|
+
* Real repro that motivated this (v1.7.5): EasyMoney user ran
|
|
2773
|
+
* `rm -rf .ctxloom && ctxloom index` from the terminal but the
|
|
2774
|
+
* Claude Desktop MCP server kept serving the pre-wipe in-memory
|
|
2775
|
+
* graph (`Files: 2`) because there was no mechanism to detect the
|
|
2776
|
+
* fresh snapshot on disk. Confusing diagnostic loop.
|
|
2777
|
+
*/
|
|
2778
|
+
snapshotWatcher = null;
|
|
2779
|
+
/** Debounce timer for snapshot-change events. */
|
|
2780
|
+
snapshotReloadTimer = null;
|
|
2781
|
+
/**
|
|
2782
|
+
* Tracks the snapshot mtime we last loaded from disk so the watcher
|
|
2783
|
+
* can suppress its own-write echo. saveSnapshot() updates this just
|
|
2784
|
+
* before writing; the watcher ignores any change whose mtime <= this.
|
|
2785
|
+
*/
|
|
2786
|
+
lastLoadedSnapshotMtimeMs = 0;
|
|
2765
2787
|
/**
|
|
2766
2788
|
* Build the graph from all supported files in rootDir using AST parsing.
|
|
2767
2789
|
*/
|
|
@@ -2961,6 +2983,105 @@ var DependencyGraph = class {
|
|
|
2961
2983
|
this.snapshotDir = path6.join(rootDir, ".ctxloom");
|
|
2962
2984
|
return this.loadSnapshot();
|
|
2963
2985
|
}
|
|
2986
|
+
/**
|
|
2987
|
+
* Start watching `.ctxloom/graph-snapshot.json` for external rewrites.
|
|
2988
|
+
* When the user runs `ctxloom index` (or any other tool) from a
|
|
2989
|
+
* terminal against the same project root, the watcher detects the
|
|
2990
|
+
* new mtime, reloads the snapshot, and atomically swaps the
|
|
2991
|
+
* in-memory graph — so subsequent MCP tool calls see the fresh
|
|
2992
|
+
* graph without requiring an MCP client restart.
|
|
2993
|
+
*
|
|
2994
|
+
* Own writes (via saveSnapshot) update lastLoadedSnapshotMtimeMs
|
|
2995
|
+
* BEFORE the rename completes, so the watcher's own-write echo is
|
|
2996
|
+
* filtered out by the mtime check.
|
|
2997
|
+
*
|
|
2998
|
+
* Debounced 200 ms — matches the FileWatcher cadence and absorbs
|
|
2999
|
+
* the burst of fs.watch events some platforms emit for a single
|
|
3000
|
+
* write (Linux can fire `rename` + `change`, macOS sometimes
|
|
3001
|
+
* fires multiple `change` for atomic rename).
|
|
3002
|
+
*
|
|
3003
|
+
* Idempotent: calling twice is harmless (re-uses the existing
|
|
3004
|
+
* watcher). Call stopSnapshotWatcher() before disposing the graph
|
|
3005
|
+
* to release the FD.
|
|
3006
|
+
*/
|
|
3007
|
+
startSnapshotWatcher(debounceMs = 200) {
|
|
3008
|
+
if (this.snapshotWatcher) return;
|
|
3009
|
+
if (!this.snapshotDir) {
|
|
3010
|
+
logger.warn("startSnapshotWatcher: no snapshotDir set, call buildFromDirectory first");
|
|
3011
|
+
return;
|
|
3012
|
+
}
|
|
3013
|
+
const snapshotPath = this.getSnapshotPath();
|
|
3014
|
+
if (!fs6.existsSync(snapshotPath)) {
|
|
3015
|
+
logger.warn("startSnapshotWatcher: snapshot file does not exist yet", { path: snapshotPath });
|
|
3016
|
+
return;
|
|
3017
|
+
}
|
|
3018
|
+
try {
|
|
3019
|
+
this.snapshotWatcher = fs6.watch(snapshotPath, { persistent: false }, (eventType) => {
|
|
3020
|
+
if (this.snapshotReloadTimer) clearTimeout(this.snapshotReloadTimer);
|
|
3021
|
+
this.snapshotReloadTimer = setTimeout(() => {
|
|
3022
|
+
this.snapshotReloadTimer = null;
|
|
3023
|
+
void this.maybeReloadSnapshot(eventType);
|
|
3024
|
+
}, debounceMs);
|
|
3025
|
+
});
|
|
3026
|
+
this.snapshotWatcher.on("error", (err) => {
|
|
3027
|
+
logger.warn("snapshot watcher error", { detail: err instanceof Error ? err.message : String(err) });
|
|
3028
|
+
});
|
|
3029
|
+
logger.info("Graph snapshot hot-reload watcher started", { path: snapshotPath });
|
|
3030
|
+
} catch (err) {
|
|
3031
|
+
logger.warn("startSnapshotWatcher: failed to attach fs.watch", {
|
|
3032
|
+
detail: err instanceof Error ? err.message : String(err)
|
|
3033
|
+
});
|
|
3034
|
+
this.snapshotWatcher = null;
|
|
3035
|
+
}
|
|
3036
|
+
}
|
|
3037
|
+
/**
|
|
3038
|
+
* Stop the snapshot watcher and clear any pending debounce timer.
|
|
3039
|
+
* Call before disposing the graph to release the FD held by fs.watch.
|
|
3040
|
+
* Idempotent.
|
|
3041
|
+
*/
|
|
3042
|
+
stopSnapshotWatcher() {
|
|
3043
|
+
if (this.snapshotReloadTimer) {
|
|
3044
|
+
clearTimeout(this.snapshotReloadTimer);
|
|
3045
|
+
this.snapshotReloadTimer = null;
|
|
3046
|
+
}
|
|
3047
|
+
if (this.snapshotWatcher) {
|
|
3048
|
+
try {
|
|
3049
|
+
this.snapshotWatcher.close();
|
|
3050
|
+
} catch {
|
|
3051
|
+
}
|
|
3052
|
+
this.snapshotWatcher = null;
|
|
3053
|
+
}
|
|
3054
|
+
}
|
|
3055
|
+
/**
|
|
3056
|
+
* Internal: called from the debounced watcher. Compares on-disk
|
|
3057
|
+
* mtime against `lastLoadedSnapshotMtimeMs` to filter own-write
|
|
3058
|
+
* echoes, then re-hydrates the in-memory maps from disk via
|
|
3059
|
+
* loadSnapshot(). Atomic from the perspective of MCP tool calls
|
|
3060
|
+
* because Node's event loop ensures loadSnapshot's map assignments
|
|
3061
|
+
* happen in a single tick (no other code interleaves).
|
|
3062
|
+
*/
|
|
3063
|
+
async maybeReloadSnapshot(eventType) {
|
|
3064
|
+
const snapshotPath = this.getSnapshotPath();
|
|
3065
|
+
let currentMtime = 0;
|
|
3066
|
+
try {
|
|
3067
|
+
currentMtime = fs6.statSync(snapshotPath).mtimeMs;
|
|
3068
|
+
} catch {
|
|
3069
|
+
return;
|
|
3070
|
+
}
|
|
3071
|
+
if (currentMtime <= this.lastLoadedSnapshotMtimeMs) {
|
|
3072
|
+
return;
|
|
3073
|
+
}
|
|
3074
|
+
const ok = await this.loadSnapshot();
|
|
3075
|
+
if (ok) {
|
|
3076
|
+
logger.info("Graph snapshot hot-reloaded", {
|
|
3077
|
+
event: eventType,
|
|
3078
|
+
files: this.forwardEdges.size,
|
|
3079
|
+
edges: this.edgeCount()
|
|
3080
|
+
});
|
|
3081
|
+
} else {
|
|
3082
|
+
logger.warn("Graph snapshot hot-reload skipped (snapshot invalid or version-stale)");
|
|
3083
|
+
}
|
|
3084
|
+
}
|
|
2964
3085
|
/**
|
|
2965
3086
|
* Get files that the given file directly imports.
|
|
2966
3087
|
*/
|
|
@@ -3235,6 +3356,10 @@ var DependencyGraph = class {
|
|
|
3235
3356
|
const tmpPath = `${snapshotPath}.${process.pid}.tmp`;
|
|
3236
3357
|
fs6.writeFileSync(tmpPath, JSON.stringify(data, null, 2));
|
|
3237
3358
|
fs6.renameSync(tmpPath, snapshotPath);
|
|
3359
|
+
try {
|
|
3360
|
+
this.lastLoadedSnapshotMtimeMs = fs6.statSync(snapshotPath).mtimeMs;
|
|
3361
|
+
} catch {
|
|
3362
|
+
}
|
|
3238
3363
|
const callData = this.callGraphIndex.toJSON();
|
|
3239
3364
|
const callPath = path6.join(this.snapshotDir, "call-graph-snapshot.json");
|
|
3240
3365
|
const callTmp = `${callPath}.${process.pid}.tmp`;
|
|
@@ -3312,6 +3437,10 @@ var DependencyGraph = class {
|
|
|
3312
3437
|
this.callGraphIndex = new CallGraphIndex();
|
|
3313
3438
|
}
|
|
3314
3439
|
}
|
|
3440
|
+
try {
|
|
3441
|
+
this.lastLoadedSnapshotMtimeMs = fs6.statSync(snapshotPath).mtimeMs;
|
|
3442
|
+
} catch {
|
|
3443
|
+
}
|
|
3315
3444
|
return true;
|
|
3316
3445
|
} catch (err) {
|
|
3317
3446
|
logger.error("Failed to load graph snapshot, will rebuild", { detail: err instanceof Error ? err.message : String(err) });
|
|
@@ -10959,7 +11088,7 @@ var TELEMETRY_DISABLED = TELEMETRY_LEVEL === "off";
|
|
|
10959
11088
|
function getTelemetryLevel() {
|
|
10960
11089
|
return TELEMETRY_LEVEL;
|
|
10961
11090
|
}
|
|
10962
|
-
var CTXLOOM_VERSION2 = "1.7.
|
|
11091
|
+
var CTXLOOM_VERSION2 = "1.7.5".length > 0 ? "1.7.5" : "dev";
|
|
10963
11092
|
var POSTHOG_HOST = "https://eu.i.posthog.com";
|
|
10964
11093
|
var POSTHOG_KEY = process.env["POSTHOG_API_KEY"] ?? (true ? "phc_CiDkmFLcZ2K6uCpcoSUQLmFrnnUvsyXGhSxopX5TVKE6" : "");
|
|
10965
11094
|
var SENTRY_DSN = process.env["SENTRY_DSN"] ?? (true ? "https://81c94a0f04a8e242dee493ac1e17f733@o4508531702497280.ingest.de.sentry.io/4511256875368528" : "");
|
|
@@ -11294,6 +11423,11 @@ async function disposeProjectState(state) {
|
|
|
11294
11423
|
await state.watcher?.stop();
|
|
11295
11424
|
} catch {
|
|
11296
11425
|
}
|
|
11426
|
+
try {
|
|
11427
|
+
const graph = state.graphPromise ? await state.graphPromise.catch(() => null) : null;
|
|
11428
|
+
graph?.stopSnapshotWatcher();
|
|
11429
|
+
} catch {
|
|
11430
|
+
}
|
|
11297
11431
|
try {
|
|
11298
11432
|
const store = state.storePromise ? await state.storePromise : null;
|
|
11299
11433
|
await store?.close();
|
|
@@ -12640,4 +12774,4 @@ export {
|
|
|
12640
12774
|
skillFilePath,
|
|
12641
12775
|
installHarness
|
|
12642
12776
|
};
|
|
12643
|
-
//# sourceMappingURL=chunk-
|
|
12777
|
+
//# sourceMappingURL=chunk-2YELCPTS.js.map
|
package/dist/index.js
CHANGED
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
validateDefaultRoot,
|
|
48
48
|
wrapWithIndexingEnvelope,
|
|
49
49
|
writeCODEOWNERS
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-2YELCPTS.js";
|
|
51
51
|
import {
|
|
52
52
|
addCtxloomToConfig,
|
|
53
53
|
detectInstalledClients
|
|
@@ -127,6 +127,7 @@ async function initGraph(state) {
|
|
|
127
127
|
const graph = new DependencyGraph();
|
|
128
128
|
graph.setParser(parser);
|
|
129
129
|
await graph.buildFromDirectory(state.projectRoot);
|
|
130
|
+
graph.startSnapshotWatcher();
|
|
130
131
|
state.graphInitialized = true;
|
|
131
132
|
return graph;
|
|
132
133
|
} catch (err) {
|
|
@@ -1067,7 +1068,7 @@ try {
|
|
|
1067
1068
|
} catch {
|
|
1068
1069
|
}
|
|
1069
1070
|
var args = process.argv.slice(2);
|
|
1070
|
-
var ctxloomVersion = "1.7.
|
|
1071
|
+
var ctxloomVersion = "1.7.5".length > 0 ? "1.7.5" : "dev";
|
|
1071
1072
|
if (args.includes("--version") || args.includes("-v")) {
|
|
1072
1073
|
process.stdout.write(`ctxloom ${ctxloomVersion}
|
|
1073
1074
|
`);
|
|
@@ -1162,7 +1163,7 @@ async function checkLicense() {
|
|
|
1162
1163
|
if (command !== void 0 && LICENSE_GATE_BYPASS_COMMANDS.has(command)) return;
|
|
1163
1164
|
const ciKey = process.env["CTXLOOM_LICENSE_KEY"];
|
|
1164
1165
|
if (ciKey) {
|
|
1165
|
-
const { ApiClient } = await import("./src-
|
|
1166
|
+
const { ApiClient } = await import("./src-NCWA7NVW.js");
|
|
1166
1167
|
const client = new ApiClient(process.env["CTXLOOM_API_BASE"]);
|
|
1167
1168
|
try {
|
|
1168
1169
|
const result = await client.validate(ciKey, "ci-ephemeral");
|
|
@@ -1555,7 +1556,7 @@ async function main() {
|
|
|
1555
1556
|
}
|
|
1556
1557
|
if (!skipHarness) {
|
|
1557
1558
|
process.stdout.write("\n");
|
|
1558
|
-
const { installHarness } = await import("./src-
|
|
1559
|
+
const { installHarness } = await import("./src-NCWA7NVW.js");
|
|
1559
1560
|
const h = installHarness({ cwd: initRoot, dryRun, force, extraHosts });
|
|
1560
1561
|
const harnessFiles = [
|
|
1561
1562
|
h.claudeMd,
|
|
@@ -1618,7 +1619,7 @@ async function main() {
|
|
|
1618
1619
|
process.exit(1);
|
|
1619
1620
|
}
|
|
1620
1621
|
if (alias !== void 0) {
|
|
1621
|
-
const { validateAlias } = await import("./src-
|
|
1622
|
+
const { validateAlias } = await import("./src-NCWA7NVW.js");
|
|
1622
1623
|
const v = validateAlias(alias);
|
|
1623
1624
|
if (!v.ok) {
|
|
1624
1625
|
console.error(`[ctxloom] Invalid alias: ${v.reason}`);
|
|
@@ -1977,7 +1978,7 @@ Suggested reviewers for ${files.length} file(s):`);
|
|
|
1977
1978
|
process.stderr.write("[ctxloom] --limit must be a non-negative integer (0 for unlimited)\n");
|
|
1978
1979
|
process.exit(2);
|
|
1979
1980
|
}
|
|
1980
|
-
const { loadRulesConfig, RulesChecker, formatText, formatJson, RulesConfigError } = await import("./src-
|
|
1981
|
+
const { loadRulesConfig, RulesChecker, formatText, formatJson, RulesConfigError } = await import("./src-NCWA7NVW.js");
|
|
1981
1982
|
let config;
|
|
1982
1983
|
try {
|
|
1983
1984
|
config = await loadRulesConfig(root);
|
|
@@ -2001,7 +2002,7 @@ Suggested reviewers for ${files.length} file(s):`);
|
|
|
2001
2002
|
}
|
|
2002
2003
|
let graph;
|
|
2003
2004
|
if (useSnapshot) {
|
|
2004
|
-
const { DependencyGraph: DG } = await import("./src-
|
|
2005
|
+
const { DependencyGraph: DG } = await import("./src-NCWA7NVW.js");
|
|
2005
2006
|
graph = new DG();
|
|
2006
2007
|
const loaded = await graph.loadSnapshotOnly(root);
|
|
2007
2008
|
if (!loaded) {
|
|
@@ -2010,7 +2011,7 @@ Suggested reviewers for ${files.length} file(s):`);
|
|
|
2010
2011
|
}
|
|
2011
2012
|
} else {
|
|
2012
2013
|
process.stderr.write("[ctxloom] Building dependency graph...\n");
|
|
2013
|
-
const { ASTParser: ASTParser2, DependencyGraph: DependencyGraph2 } = await import("./src-
|
|
2014
|
+
const { ASTParser: ASTParser2, DependencyGraph: DependencyGraph2 } = await import("./src-NCWA7NVW.js");
|
|
2014
2015
|
let parser;
|
|
2015
2016
|
try {
|
|
2016
2017
|
parser = new ASTParser2();
|
|
@@ -132,7 +132,7 @@ import {
|
|
|
132
132
|
wrapBlock,
|
|
133
133
|
wrapWithIndexingEnvelope,
|
|
134
134
|
writeCODEOWNERS
|
|
135
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-2YELCPTS.js";
|
|
136
136
|
import {
|
|
137
137
|
VectorStore
|
|
138
138
|
} from "./chunk-XQEQLXY5.js";
|
|
@@ -304,4 +304,4 @@ export {
|
|
|
304
304
|
wrapWithIndexingEnvelope,
|
|
305
305
|
writeCODEOWNERS
|
|
306
306
|
};
|
|
307
|
-
//# sourceMappingURL=src-
|
|
307
|
+
//# sourceMappingURL=src-NCWA7NVW.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ctxloom-pro",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.5",
|
|
4
4
|
"description": "ctxloom — The Universal Code Context Engine. A local-first MCP server providing intelligent code context via hybrid Vector + AST + Graph search with Skeletonization (92% token reduction).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|