engramx 2.1.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +70 -0
- package/README.md +106 -17
- package/dist/{aider-context-J557IHIP.js → aider-context-6IDE3R7U.js} +1 -1
- package/dist/{chunk-PEH54LYC.js → chunk-645NBY6L.js} +42 -5
- package/dist/chunk-73IBCRFI.js +215 -0
- package/dist/{chunk-ZVWRIVWQ.js → chunk-B4UOE64J.js} +29 -11
- package/dist/{chunk-XFE6ZANP.js → chunk-FKY6HIT2.js} +1 -1
- package/dist/chunk-RJC6RNXJ.js +1405 -0
- package/dist/{chunk-4XA6ENNL.js → chunk-VLTWBTQ7.js} +14 -15
- package/dist/chunk-ZUC6OXSL.js +178 -0
- package/dist/cli.js +276 -1258
- package/dist/{core-TSXA5XZH.js → core-77F2BVYV.js} +2 -2
- package/dist/{cursor-mdc-VEOFFDVO.js → cursor-mdc-EEO7PYZ3.js} +1 -1
- package/dist/{exporter-AWXS34AS.js → exporter-ZYJ4WM2F.js} +1 -1
- package/dist/{importer-3Q5M6QBL.js → importer-4UWQDH4W.js} +1 -1
- package/dist/index.js +3 -3
- package/dist/mcp-client-ROOJF76V.js +9 -0
- package/dist/mcp-config-QD4NPVXB.js +12 -0
- package/dist/{migrate-UKCO6BUU.js → migrate-KJ5K5NWO.js} +1 -1
- package/dist/{plugin-loader-STTGYIL5.js → plugin-loader-SQQB6V74.js} +69 -23
- package/dist/resolver-H7GXVP73.js +21 -0
- package/dist/serve.js +2 -2
- package/dist/{server-A6MUVKQK.js → server-2ZQKXJ5M.js} +74 -6
- package/dist/{windsurf-rules-RWPKBHRD.js → windsurf-rules-XF7MYF6J.js} +1 -1
- package/dist/{wizard-AOXWMSXW.js → wizard-UH27IO4I.js} +2 -2
- package/package.json +3 -2
- package/dist/{tuner-KFNNGKG3.js → tuner-Y2YENAZC.js} +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runMigrations
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-645NBY6L.js";
|
|
4
4
|
|
|
5
5
|
// src/core.ts
|
|
6
6
|
import { join as join4, resolve as resolve2, relative as relative2 } from "path";
|
|
@@ -98,8 +98,8 @@ var GraphStore = class _GraphStore {
|
|
|
98
98
|
}
|
|
99
99
|
upsertNode(node) {
|
|
100
100
|
this.db.run(
|
|
101
|
-
`INSERT OR REPLACE INTO nodes (id, label, kind, source_file, source_location, confidence, confidence_score, last_verified, query_count, metadata)
|
|
102
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
|
101
|
+
`INSERT OR REPLACE INTO nodes (id, label, kind, source_file, source_location, confidence, confidence_score, last_verified, query_count, metadata, valid_until, invalidated_by_commit)
|
|
102
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
|
103
103
|
[
|
|
104
104
|
node.id,
|
|
105
105
|
node.label,
|
|
@@ -110,7 +110,9 @@ var GraphStore = class _GraphStore {
|
|
|
110
110
|
node.confidenceScore,
|
|
111
111
|
node.lastVerified,
|
|
112
112
|
node.queryCount,
|
|
113
|
-
JSON.stringify(node.metadata)
|
|
113
|
+
JSON.stringify(node.metadata),
|
|
114
|
+
node.validUntil ?? null,
|
|
115
|
+
node.invalidatedByCommit ?? null
|
|
114
116
|
]
|
|
115
117
|
);
|
|
116
118
|
}
|
|
@@ -502,6 +504,8 @@ var GraphStore = class _GraphStore {
|
|
|
502
504
|
this.db.close();
|
|
503
505
|
}
|
|
504
506
|
rowToNode(row) {
|
|
507
|
+
const validUntilRaw = row.valid_until;
|
|
508
|
+
const invalidatedByRaw = row.invalidated_by_commit;
|
|
505
509
|
return {
|
|
506
510
|
id: row.id,
|
|
507
511
|
label: row.label,
|
|
@@ -512,7 +516,9 @@ var GraphStore = class _GraphStore {
|
|
|
512
516
|
confidenceScore: row.confidence_score ?? 1,
|
|
513
517
|
lastVerified: row.last_verified ?? 0,
|
|
514
518
|
queryCount: row.query_count ?? 0,
|
|
515
|
-
metadata: JSON.parse(row.metadata || "{}")
|
|
519
|
+
metadata: JSON.parse(row.metadata || "{}"),
|
|
520
|
+
validUntil: validUntilRaw === null || validUntilRaw === void 0 ? void 0 : validUntilRaw,
|
|
521
|
+
invalidatedByCommit: invalidatedByRaw === null || invalidatedByRaw === void 0 ? void 0 : invalidatedByRaw
|
|
516
522
|
};
|
|
517
523
|
}
|
|
518
524
|
rowToEdge(row) {
|
|
@@ -1246,6 +1252,7 @@ function getPatterns(lang) {
|
|
|
1246
1252
|
return { classes: [], functions: [], imports: [], exports: [] };
|
|
1247
1253
|
}
|
|
1248
1254
|
}
|
|
1255
|
+
var MAX_DEPTH = 100;
|
|
1249
1256
|
var DEFAULT_SKIP_DIRS = /* @__PURE__ */ new Set([
|
|
1250
1257
|
"node_modules",
|
|
1251
1258
|
"dist",
|
|
@@ -1297,7 +1304,8 @@ function extractDirectory(dirPath, rootDir, options = {}) {
|
|
|
1297
1304
|
if (ignorePatterns.has(name)) return true;
|
|
1298
1305
|
return false;
|
|
1299
1306
|
}
|
|
1300
|
-
function walk(dir) {
|
|
1307
|
+
function walk(dir, depth) {
|
|
1308
|
+
if (depth > MAX_DEPTH) return;
|
|
1301
1309
|
let realDir;
|
|
1302
1310
|
try {
|
|
1303
1311
|
realDir = realpathSync(dir);
|
|
@@ -1306,12 +1314,17 @@ function extractDirectory(dirPath, rootDir, options = {}) {
|
|
|
1306
1314
|
}
|
|
1307
1315
|
if (visitedDirs.has(realDir)) return;
|
|
1308
1316
|
visitedDirs.add(realDir);
|
|
1309
|
-
|
|
1317
|
+
let entries;
|
|
1318
|
+
try {
|
|
1319
|
+
entries = readdirSync(dir, { withFileTypes: true });
|
|
1320
|
+
} catch {
|
|
1321
|
+
return;
|
|
1322
|
+
}
|
|
1310
1323
|
for (const entry of entries) {
|
|
1311
1324
|
const fullPath = join(dir, entry.name);
|
|
1312
1325
|
if (entry.isDirectory()) {
|
|
1313
1326
|
if (shouldSkipDir(entry.name)) continue;
|
|
1314
|
-
walk(fullPath);
|
|
1327
|
+
walk(fullPath, depth + 1);
|
|
1315
1328
|
continue;
|
|
1316
1329
|
}
|
|
1317
1330
|
if (!entry.isFile()) continue;
|
|
@@ -1337,7 +1350,7 @@ function extractDirectory(dirPath, rootDir, options = {}) {
|
|
|
1337
1350
|
options.onProgress?.(fileCount, skippedCount, relPath);
|
|
1338
1351
|
}
|
|
1339
1352
|
}
|
|
1340
|
-
walk(dirPath);
|
|
1353
|
+
walk(dirPath, 0);
|
|
1341
1354
|
return { nodes: allNodes, edges: allEdges, fileCount, totalLines, mtimes, skippedCount };
|
|
1342
1355
|
}
|
|
1343
1356
|
|
|
@@ -1384,6 +1397,8 @@ function mineGitHistory(projectRoot, maxCommits = 200) {
|
|
|
1384
1397
|
const fileChangeCount = /* @__PURE__ */ new Map();
|
|
1385
1398
|
const authorMap = /* @__PURE__ */ new Map();
|
|
1386
1399
|
const commitBlocks = log.split("\n\n").filter(Boolean);
|
|
1400
|
+
const SKIP_PREFIXES = ["dist/", "build/", "node_modules/", ".venv/", "target/", "coverage/"];
|
|
1401
|
+
const MAX_FILES_PER_COMMIT = 50;
|
|
1387
1402
|
for (const block of commitBlocks) {
|
|
1388
1403
|
const lines = block.split("\n").filter(Boolean);
|
|
1389
1404
|
if (lines.length === 0) continue;
|
|
@@ -1391,9 +1406,12 @@ function mineGitHistory(projectRoot, maxCommits = 200) {
|
|
|
1391
1406
|
const parts = header.split("|");
|
|
1392
1407
|
if (parts.length < 3) continue;
|
|
1393
1408
|
const author = parts[1];
|
|
1394
|
-
|
|
1395
|
-
(f) => f.length > 0 && !f.includes("|") && !f.startsWith(" ") && f.includes(".")
|
|
1409
|
+
let files = fileLines.filter(
|
|
1410
|
+
(f) => f.length > 0 && !f.includes("|") && !f.startsWith(" ") && f.includes(".") && !SKIP_PREFIXES.some((p) => f.startsWith(p))
|
|
1396
1411
|
);
|
|
1412
|
+
if (files.length > MAX_FILES_PER_COMMIT) {
|
|
1413
|
+
files = files.slice(0, MAX_FILES_PER_COMMIT);
|
|
1414
|
+
}
|
|
1397
1415
|
for (const file of files) {
|
|
1398
1416
|
fileChangeCount.set(file, (fileChangeCount.get(file) ?? 0) + 1);
|
|
1399
1417
|
if (!authorMap.has(file)) authorMap.set(file, /* @__PURE__ */ new Set());
|