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.
Files changed (32) hide show
  1. package/CHANGELOG.md +150 -0
  2. package/README.md +67 -7
  3. package/dist/{aider-context-TNGSXMVY.js → aider-context-BC5R2ZTA.js} +1 -1
  4. package/dist/cache-AK6CF3BC.js +10 -0
  5. package/dist/chunk-22INHMKB.js +31 -0
  6. package/dist/chunk-533LR4I7.js +220 -0
  7. package/dist/{chunk-QOG4K427.js → chunk-C6GBUOAL.js} +1 -1
  8. package/dist/chunk-CIQQ5Y3S.js +338 -0
  9. package/dist/chunk-KL6NSPVA.js +59 -0
  10. package/dist/{chunk-SBHGK5WA.js → chunk-PEH54LYC.js} +85 -3
  11. package/dist/{chunk-6SFMVYUN.js → chunk-SJT7VS2G.js} +127 -23
  12. package/dist/cli.js +383 -258
  13. package/dist/{core-77MHT3QV.js → core-6IY5L6II.js} +2 -2
  14. package/dist/{cursor-mdc-HWVUZUZH.js → cursor-mdc-GJ7E5LDD.js} +1 -1
  15. package/dist/{exporter-A3VSLS4U.js → exporter-GWU2GF23.js} +1 -1
  16. package/dist/grammars/tree-sitter-go.wasm +0 -0
  17. package/dist/grammars/tree-sitter-javascript.wasm +0 -0
  18. package/dist/grammars/tree-sitter-python.wasm +0 -0
  19. package/dist/grammars/tree-sitter-rust.wasm +0 -0
  20. package/dist/grammars/tree-sitter-tsx.wasm +0 -0
  21. package/dist/grammars/tree-sitter-typescript.wasm +0 -0
  22. package/dist/{importer-LU2YFZDY.js → importer-V62NGZRK.js} +1 -1
  23. package/dist/index.js +3 -3
  24. package/dist/{migrate-5ZJWF2HD.js → migrate-UKCO6BUU.js} +3 -1
  25. package/dist/plugin-loader-STTGYIL5.js +106 -0
  26. package/dist/serve.js +2 -2
  27. package/dist/server-6AOI7NQP.js +1370 -0
  28. package/dist/{tuner-2LVIEE5V.js → tuner-KFNNGKG3.js} +4 -2
  29. package/dist/windsurf-rules-C7SVDHBL.js +59 -0
  30. package/package.json +4 -3
  31. package/dist/chunk-CEAANHHX.js +0 -88
  32. package/dist/server-I3C74ZLB.js +0 -193
@@ -11,8 +11,8 @@ import {
11
11
  path,
12
12
  query,
13
13
  stats
14
- } from "./chunk-6SFMVYUN.js";
15
- import "./chunk-SBHGK5WA.js";
14
+ } from "./chunk-SJT7VS2G.js";
15
+ import "./chunk-PEH54LYC.js";
16
16
  export {
17
17
  benchmark,
18
18
  computeKeywordIDF,
@@ -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-77MHT3QV.js");
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-77MHT3QV.js");
15
+ const { getStore } = await import("./core-6IY5L6II.js");
16
16
  const store = await getStore(projectRoot);
17
17
  try {
18
18
  const allNodes = store.getAllNodes();
@@ -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-77MHT3QV.js");
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-QOG4K427.js";
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-6SFMVYUN.js";
27
- import "./chunk-SBHGK5WA.js";
26
+ } from "./chunk-SJT7VS2G.js";
27
+ import "./chunk-PEH54LYC.js";
28
28
  export {
29
29
  GraphStore,
30
30
  SUPPORTED_EXTENSIONS,
@@ -1,10 +1,12 @@
1
1
  import {
2
2
  CURRENT_SCHEMA_VERSION,
3
3
  getSchemaVersion,
4
+ rollback,
4
5
  runMigrations
5
- } from "./chunk-SBHGK5WA.js";
6
+ } from "./chunk-PEH54LYC.js";
6
7
  export {
7
8
  CURRENT_SCHEMA_VERSION,
8
9
  getSchemaVersion,
10
+ rollback,
9
11
  runMigrations
10
12
  };
@@ -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
@@ -8,8 +8,8 @@ import {
8
8
  query,
9
9
  stats,
10
10
  truncateGraphemeSafe
11
- } from "./chunk-6SFMVYUN.js";
12
- import "./chunk-SBHGK5WA.js";
11
+ } from "./chunk-SJT7VS2G.js";
12
+ import "./chunk-PEH54LYC.js";
13
13
 
14
14
  // src/serve.ts
15
15
  function clampInt(value, defaultValue, min, max) {