engramx 1.0.1 → 2.0.1
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 +150 -0
- package/README.md +67 -7
- package/dist/{aider-context-TNGSXMVY.js → aider-context-BC5R2ZTA.js} +1 -1
- package/dist/cache-AK6CF3BC.js +10 -0
- package/dist/chunk-22INHMKB.js +31 -0
- package/dist/chunk-533LR4I7.js +220 -0
- package/dist/{chunk-QOG4K427.js → chunk-C6GBUOAL.js} +1 -1
- package/dist/chunk-CIQQ5Y3S.js +338 -0
- package/dist/chunk-KL6NSPVA.js +59 -0
- package/dist/{chunk-SBHGK5WA.js → chunk-PEH54LYC.js} +85 -3
- package/dist/{chunk-6SFMVYUN.js → chunk-SJT7VS2G.js} +127 -23
- package/dist/cli.js +383 -258
- package/dist/{core-77MHT3QV.js → core-6IY5L6II.js} +2 -2
- package/dist/{cursor-mdc-HWVUZUZH.js → cursor-mdc-GJ7E5LDD.js} +1 -1
- package/dist/{exporter-A3VSLS4U.js → exporter-GWU2GF23.js} +1 -1
- package/dist/grammars/tree-sitter-go.wasm +0 -0
- package/dist/grammars/tree-sitter-javascript.wasm +0 -0
- package/dist/grammars/tree-sitter-python.wasm +0 -0
- package/dist/grammars/tree-sitter-rust.wasm +0 -0
- package/dist/grammars/tree-sitter-tsx.wasm +0 -0
- package/dist/grammars/tree-sitter-typescript.wasm +0 -0
- package/dist/{importer-LU2YFZDY.js → importer-V62NGZRK.js} +1 -1
- package/dist/index.js +3 -3
- package/dist/{migrate-5ZJWF2HD.js → migrate-UKCO6BUU.js} +3 -1
- package/dist/plugin-loader-STTGYIL5.js +106 -0
- package/dist/serve.js +2 -2
- package/dist/server-6AOI7NQP.js +1370 -0
- package/dist/{tuner-2LVIEE5V.js → tuner-KFNNGKG3.js} +4 -2
- package/dist/windsurf-rules-C7SVDHBL.js +59 -0
- package/package.json +4 -3
- package/dist/chunk-CEAANHHX.js +0 -88
- package/dist/server-I3C74ZLB.js +0 -193
|
@@ -33,7 +33,7 @@ function buildSection(heading, bullets) {
|
|
|
33
33
|
return [`## ${heading}`, "", ...bullets, ""].join("\n");
|
|
34
34
|
}
|
|
35
35
|
async function generateCursorMdc(projectPath) {
|
|
36
|
-
const { getStore } = await import("./core-
|
|
36
|
+
const { getStore } = await import("./core-6IY5L6II.js");
|
|
37
37
|
const store = await getStore(projectPath);
|
|
38
38
|
try {
|
|
39
39
|
const allNodes = store.getAllNodes();
|
|
@@ -12,7 +12,7 @@ function buildSection(heading, nodes) {
|
|
|
12
12
|
return [`## ${heading}`, "", ...bullets, ""].join("\n");
|
|
13
13
|
}
|
|
14
14
|
async function exportCcs(projectRoot) {
|
|
15
|
-
const { getStore } = await import("./core-
|
|
15
|
+
const { getStore } = await import("./core-6IY5L6II.js");
|
|
16
16
|
const store = await getStore(projectRoot);
|
|
17
17
|
try {
|
|
18
18
|
const allNodes = store.getAllNodes();
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -25,7 +25,7 @@ async function importCcs(projectRoot) {
|
|
|
25
25
|
if (!existsSync(filePath)) {
|
|
26
26
|
return { nodesCreated: 0, sectionsFound: 0 };
|
|
27
27
|
}
|
|
28
|
-
const { getStore } = await import("./core-
|
|
28
|
+
const { getStore } = await import("./core-6IY5L6II.js");
|
|
29
29
|
const store = await getStore(projectRoot);
|
|
30
30
|
try {
|
|
31
31
|
const raw = readFileSync(filePath, "utf-8");
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
generateSummary,
|
|
5
5
|
install,
|
|
6
6
|
uninstall
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-C6GBUOAL.js";
|
|
8
8
|
import {
|
|
9
9
|
GraphStore,
|
|
10
10
|
SUPPORTED_EXTENSIONS,
|
|
@@ -23,8 +23,8 @@ import {
|
|
|
23
23
|
sliceGraphemeSafe,
|
|
24
24
|
stats,
|
|
25
25
|
truncateGraphemeSafe
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import "./chunk-
|
|
26
|
+
} from "./chunk-SJT7VS2G.js";
|
|
27
|
+
import "./chunk-PEH54LYC.js";
|
|
28
28
|
export {
|
|
29
29
|
GraphStore,
|
|
30
30
|
SUPPORTED_EXTENSIONS,
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// src/providers/plugin-loader.ts
|
|
2
|
+
import { existsSync, readdirSync, mkdirSync } from "fs";
|
|
3
|
+
import { join } from "path";
|
|
4
|
+
import { homedir } from "os";
|
|
5
|
+
import { pathToFileURL } from "url";
|
|
6
|
+
function getPluginsDir() {
|
|
7
|
+
return join(homedir(), ".engram", "plugins");
|
|
8
|
+
}
|
|
9
|
+
var PLUGINS_DIR = getPluginsDir();
|
|
10
|
+
function ensurePluginsDir(dir) {
|
|
11
|
+
const target = dir ?? getPluginsDir();
|
|
12
|
+
if (!existsSync(target)) {
|
|
13
|
+
mkdirSync(target, { recursive: true });
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function validatePlugin(mod) {
|
|
17
|
+
if (!mod || typeof mod !== "object") {
|
|
18
|
+
return { plugin: null, reason: "module did not export an object" };
|
|
19
|
+
}
|
|
20
|
+
const m = mod;
|
|
21
|
+
const candidate = m.default !== void 0 ? m.default : mod;
|
|
22
|
+
if (!candidate || typeof candidate !== "object") {
|
|
23
|
+
return { plugin: null, reason: "default export is not an object" };
|
|
24
|
+
}
|
|
25
|
+
const p = candidate;
|
|
26
|
+
const required = [
|
|
27
|
+
"name",
|
|
28
|
+
"label",
|
|
29
|
+
"tier",
|
|
30
|
+
"tokenBudget",
|
|
31
|
+
"timeoutMs",
|
|
32
|
+
"version",
|
|
33
|
+
"resolve",
|
|
34
|
+
"isAvailable"
|
|
35
|
+
];
|
|
36
|
+
for (const field of required) {
|
|
37
|
+
if (p[field] === void 0 || p[field] === null) {
|
|
38
|
+
return { plugin: null, reason: `missing required field: ${field}` };
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (typeof p.resolve !== "function") {
|
|
42
|
+
return { plugin: null, reason: "resolve must be a function" };
|
|
43
|
+
}
|
|
44
|
+
if (typeof p.isAvailable !== "function") {
|
|
45
|
+
return { plugin: null, reason: "isAvailable must be a function" };
|
|
46
|
+
}
|
|
47
|
+
if (p.tier !== 1 && p.tier !== 2) {
|
|
48
|
+
return { plugin: null, reason: `tier must be 1 or 2 (got ${String(p.tier)})` };
|
|
49
|
+
}
|
|
50
|
+
if (typeof p.name !== "string" || p.name.length === 0) {
|
|
51
|
+
return { plugin: null, reason: "name must be a non-empty string" };
|
|
52
|
+
}
|
|
53
|
+
return { plugin: candidate, reason: "" };
|
|
54
|
+
}
|
|
55
|
+
async function loadPlugins(dir) {
|
|
56
|
+
const pluginsDir = dir ?? getPluginsDir();
|
|
57
|
+
const loaded = [];
|
|
58
|
+
const failed = [];
|
|
59
|
+
if (!existsSync(pluginsDir)) {
|
|
60
|
+
return { loaded, failed };
|
|
61
|
+
}
|
|
62
|
+
let files;
|
|
63
|
+
try {
|
|
64
|
+
files = readdirSync(pluginsDir).filter((f) => f.endsWith(".mjs") || f.endsWith(".js"));
|
|
65
|
+
} catch {
|
|
66
|
+
return { loaded, failed };
|
|
67
|
+
}
|
|
68
|
+
for (const file of files) {
|
|
69
|
+
const fullPath = join(pluginsDir, file);
|
|
70
|
+
try {
|
|
71
|
+
const mod = await import(pathToFileURL(fullPath).href);
|
|
72
|
+
const { plugin, reason } = validatePlugin(mod);
|
|
73
|
+
if (plugin) {
|
|
74
|
+
if (!loaded.some((p) => p.name === plugin.name)) {
|
|
75
|
+
loaded.push(plugin);
|
|
76
|
+
} else {
|
|
77
|
+
failed.push({ file, reason: `duplicate name: ${plugin.name}` });
|
|
78
|
+
}
|
|
79
|
+
} else {
|
|
80
|
+
failed.push({ file, reason });
|
|
81
|
+
}
|
|
82
|
+
} catch (e) {
|
|
83
|
+
failed.push({ file, reason: e.message });
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return { loaded, failed };
|
|
87
|
+
}
|
|
88
|
+
var _cache = null;
|
|
89
|
+
async function getLoadedPlugins(dir) {
|
|
90
|
+
if (_cache === null) {
|
|
91
|
+
_cache = await loadPlugins(dir);
|
|
92
|
+
}
|
|
93
|
+
return _cache;
|
|
94
|
+
}
|
|
95
|
+
function _resetPluginCache() {
|
|
96
|
+
_cache = null;
|
|
97
|
+
}
|
|
98
|
+
export {
|
|
99
|
+
PLUGINS_DIR,
|
|
100
|
+
_resetPluginCache,
|
|
101
|
+
ensurePluginsDir,
|
|
102
|
+
getLoadedPlugins,
|
|
103
|
+
getPluginsDir,
|
|
104
|
+
loadPlugins,
|
|
105
|
+
validatePlugin
|
|
106
|
+
};
|
package/dist/serve.js
CHANGED