mnemosyne-core 2.0.0 → 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,94 +1,4 @@
1
- import { S as Store } from '../Store-N3j0Vaj6.mjs';
2
- import * as http from 'http';
1
+ export { J as JsonRpcRequest, a as JsonRpcResponse, M as McpServer, b as McpSseTransport, c as McpStdioTransport, d as McpTool, T as TOOLS } from '../index-yTOihMUk.mjs';
2
+ import '../Store-BtdYuiUx.mjs';
3
3
  import 'better-sqlite3';
4
-
5
- /**
6
- * MCP Protocol Types
7
- */
8
- interface JsonRpcRequest {
9
- jsonrpc: "2.0";
10
- id: string | number | null;
11
- method: string;
12
- params?: any;
13
- }
14
- interface JsonRpcResponse {
15
- jsonrpc: "2.0";
16
- id: string | number | null;
17
- result?: any;
18
- error?: {
19
- code: number;
20
- message: string;
21
- data?: any;
22
- };
23
- }
24
- interface McpTool {
25
- name: string;
26
- description: string;
27
- inputSchema: any;
28
- handler: (args: any, store: Store) => any;
29
- }
30
-
31
- /**
32
- * MCP Server
33
- * JSON-RPC handler for Model Context Protocol.
34
- */
35
-
36
- declare class McpServer {
37
- private store;
38
- private toolMap;
39
- constructor(store: Store);
40
- /**
41
- * Returns `null` for notifications (no response needed).
42
- */
43
- handleRequest(req: JsonRpcRequest): JsonRpcResponse | null;
44
- getManifest(): {
45
- name: string;
46
- version: string;
47
- description: string;
48
- protocol: string;
49
- transport: string[];
50
- endpoints: {
51
- sse: string;
52
- messages: string;
53
- };
54
- tools: {
55
- name: string;
56
- description: string;
57
- }[];
58
- };
59
- private ok;
60
- private err;
61
- }
62
-
63
- /**
64
- * MCP Tool Definitions
65
- * All tools exposed to MCP clients (Claude Desktop, Cursor, etc.)
66
- */
67
-
68
- declare const TOOLS: McpTool[];
69
-
70
- declare class McpSseTransport {
71
- private server;
72
- private sessions;
73
- private sessionCounter;
74
- constructor(server: McpServer);
75
- handleSse(req: http.IncomingMessage, res: http.ServerResponse): void;
76
- handleMessage(req: http.IncomingMessage, res: http.ServerResponse, body: any): void;
77
- private sendSse;
78
- }
79
-
80
- /**
81
- * MCP Stdio Transport
82
- * Line-delimited JSON-RPC over stdin/stdout.
83
- * This is what Claude Desktop uses to communicate with MCP servers.
84
- */
85
-
86
- declare class McpStdioTransport {
87
- private server;
88
- private buffer;
89
- constructor(server: McpServer);
90
- start(): void;
91
- send(message: JsonRpcResponse): void;
92
- }
93
-
94
- export { type JsonRpcRequest, type JsonRpcResponse, McpServer, McpSseTransport, McpStdioTransport, type McpTool, TOOLS };
4
+ import 'http';
@@ -1,94 +1,4 @@
1
- import { S as Store } from '../Store-N3j0Vaj6.js';
2
- import * as http from 'http';
1
+ export { J as JsonRpcRequest, a as JsonRpcResponse, M as McpServer, b as McpSseTransport, c as McpStdioTransport, d as McpTool, T as TOOLS } from '../index-DWk78ifo.js';
2
+ import '../Store-BtdYuiUx.js';
3
3
  import 'better-sqlite3';
4
-
5
- /**
6
- * MCP Protocol Types
7
- */
8
- interface JsonRpcRequest {
9
- jsonrpc: "2.0";
10
- id: string | number | null;
11
- method: string;
12
- params?: any;
13
- }
14
- interface JsonRpcResponse {
15
- jsonrpc: "2.0";
16
- id: string | number | null;
17
- result?: any;
18
- error?: {
19
- code: number;
20
- message: string;
21
- data?: any;
22
- };
23
- }
24
- interface McpTool {
25
- name: string;
26
- description: string;
27
- inputSchema: any;
28
- handler: (args: any, store: Store) => any;
29
- }
30
-
31
- /**
32
- * MCP Server
33
- * JSON-RPC handler for Model Context Protocol.
34
- */
35
-
36
- declare class McpServer {
37
- private store;
38
- private toolMap;
39
- constructor(store: Store);
40
- /**
41
- * Returns `null` for notifications (no response needed).
42
- */
43
- handleRequest(req: JsonRpcRequest): JsonRpcResponse | null;
44
- getManifest(): {
45
- name: string;
46
- version: string;
47
- description: string;
48
- protocol: string;
49
- transport: string[];
50
- endpoints: {
51
- sse: string;
52
- messages: string;
53
- };
54
- tools: {
55
- name: string;
56
- description: string;
57
- }[];
58
- };
59
- private ok;
60
- private err;
61
- }
62
-
63
- /**
64
- * MCP Tool Definitions
65
- * All tools exposed to MCP clients (Claude Desktop, Cursor, etc.)
66
- */
67
-
68
- declare const TOOLS: McpTool[];
69
-
70
- declare class McpSseTransport {
71
- private server;
72
- private sessions;
73
- private sessionCounter;
74
- constructor(server: McpServer);
75
- handleSse(req: http.IncomingMessage, res: http.ServerResponse): void;
76
- handleMessage(req: http.IncomingMessage, res: http.ServerResponse, body: any): void;
77
- private sendSse;
78
- }
79
-
80
- /**
81
- * MCP Stdio Transport
82
- * Line-delimited JSON-RPC over stdin/stdout.
83
- * This is what Claude Desktop uses to communicate with MCP servers.
84
- */
85
-
86
- declare class McpStdioTransport {
87
- private server;
88
- private buffer;
89
- constructor(server: McpServer);
90
- start(): void;
91
- send(message: JsonRpcResponse): void;
92
- }
93
-
94
- export { type JsonRpcRequest, type JsonRpcResponse, McpServer, McpSseTransport, McpStdioTransport, type McpTool, TOOLS };
4
+ import 'http';
@@ -1,5 +1,5 @@
1
1
  import * as http from 'http';
2
- import { S as Store } from '../Store-N3j0Vaj6.mjs';
2
+ import { S as Store } from '../Store-BtdYuiUx.mjs';
3
3
  import 'better-sqlite3';
4
4
 
5
5
  declare class ApiRouter {
@@ -1,5 +1,5 @@
1
1
  import * as http from 'http';
2
- import { S as Store } from '../Store-N3j0Vaj6.js';
2
+ import { S as Store } from '../Store-BtdYuiUx.js';
3
3
  import 'better-sqlite3';
4
4
 
5
5
  declare class ApiRouter {
@@ -106,9 +106,22 @@ function loadConfig() {
106
106
  return defaultConfig();
107
107
  }
108
108
  }
109
+ function getVersion() {
110
+ try {
111
+ const pkg = JSON.parse((0, import_fs.readFileSync)((0, import_path.resolve)(__dirname, "../package.json"), "utf-8"));
112
+ return pkg.version;
113
+ } catch {
114
+ try {
115
+ const pkg = JSON.parse((0, import_fs.readFileSync)((0, import_path.resolve)(process.cwd(), "package.json"), "utf-8"));
116
+ return pkg.version;
117
+ } catch {
118
+ return "2.0.1";
119
+ }
120
+ }
121
+ }
109
122
  function defaultConfig() {
110
123
  return {
111
- server: { port: 7321, host: "localhost", version: "2.0.0" },
124
+ server: { port: 7321, host: "localhost", version: getVersion() },
112
125
  database: { path: "data/nexus.db", wal_mode: true, vec_extension_path: "data/vec0" },
113
126
  storage: { files_dir: "data/files", max_file_size_mb: 50, backups_dir: "data/backups", backup_interval_hours: 24, max_backups: 7 },
114
127
  limits: { max_atoms_per_project: 1e4, rate_limit_requests: 100, rate_limit_window_ms: 6e4 },
@@ -1548,12 +1561,20 @@ function handleEvents(store, pathname, method, res, searchParams) {
1548
1561
  }
1549
1562
 
1550
1563
  // src/api/routes/health.ts
1564
+ var PKG_VERSION = (() => {
1565
+ try {
1566
+ const pkg = JSON.parse(require("fs").readFileSync(require("path").resolve(__dirname, "../../../package.json"), "utf-8"));
1567
+ return pkg.version;
1568
+ } catch {
1569
+ return "2.0.1";
1570
+ }
1571
+ })();
1551
1572
  function handleHealth(store, pathname, method, res) {
1552
- if (pathname === "/health" && method === "GET") {
1573
+ if ((pathname === "/health" || pathname === "/api/v1/health") && method === "GET") {
1553
1574
  const stats = store.getStats();
1554
1575
  json(res, 200, {
1555
1576
  status: "ok",
1556
- version: "2.0.0",
1577
+ version: PKG_VERSION,
1557
1578
  storage: "sqlite",
1558
1579
  database: store.config.database.path,
1559
1580
  uptime: process.uptime(),