mnemosyne-core 2.0.1 → 2.0.2

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.
@@ -1,5 +1,11 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __getOwnPropNames = Object.getOwnPropertyNames;
3
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
4
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
5
+ }) : x)(function(x) {
6
+ if (typeof require !== "undefined") return require.apply(this, arguments);
7
+ throw Error('Dynamic require of "' + x + '" is not supported');
8
+ });
3
9
  var __esm = (fn, res) => function __init() {
4
10
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
5
11
  };
@@ -86,9 +92,22 @@ function loadConfig() {
86
92
  return defaultConfig();
87
93
  }
88
94
  }
95
+ function getVersion() {
96
+ try {
97
+ const pkg = JSON.parse(readFileSync(resolve(__dirname, "../package.json"), "utf-8"));
98
+ return pkg.version;
99
+ } catch {
100
+ try {
101
+ const pkg = JSON.parse(readFileSync(resolve(process.cwd(), "package.json"), "utf-8"));
102
+ return pkg.version;
103
+ } catch {
104
+ return "2.0.1";
105
+ }
106
+ }
107
+ }
89
108
  function defaultConfig() {
90
109
  return {
91
- server: { port: 7321, host: "localhost", version: "2.0.0" },
110
+ server: { port: 7321, host: "localhost", version: getVersion() },
92
111
  database: { path: "data/nexus.db", wal_mode: true, vec_extension_path: "data/vec0" },
93
112
  storage: { files_dir: "data/files", max_file_size_mb: 50, backups_dir: "data/backups", backup_interval_hours: 24, max_backups: 7 },
94
113
  limits: { max_atoms_per_project: 1e4, rate_limit_requests: 100, rate_limit_window_ms: 6e4 },
@@ -1519,12 +1538,20 @@ function handleEvents(store, pathname, method, res, searchParams) {
1519
1538
  }
1520
1539
 
1521
1540
  // src/api/routes/health.ts
1541
+ var PKG_VERSION = (() => {
1542
+ try {
1543
+ const pkg = JSON.parse(__require("fs").readFileSync(__require("path").resolve(__dirname, "../../../package.json"), "utf-8"));
1544
+ return pkg.version;
1545
+ } catch {
1546
+ return "2.0.1";
1547
+ }
1548
+ })();
1522
1549
  function handleHealth(store, pathname, method, res) {
1523
- if (pathname === "/health" && method === "GET") {
1550
+ if ((pathname === "/health" || pathname === "/api/v1/health") && method === "GET") {
1524
1551
  const stats = store.getStats();
1525
1552
  json(res, 200, {
1526
1553
  status: "ok",
1527
- version: "2.0.0",
1554
+ version: PKG_VERSION,
1528
1555
  storage: "sqlite",
1529
1556
  database: store.config.database.path,
1530
1557
  uptime: process.uptime(),