@mem-weave/server 0.2.0 → 0.2.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.
- package/dist/cli-entry.js +5 -1
- package/dist/db/database.js +3 -1
- package/package.json +2 -2
package/dist/cli-entry.js
CHANGED
|
@@ -25,7 +25,7 @@ async function main() {
|
|
|
25
25
|
env: process.env,
|
|
26
26
|
configPath: process.env.MEMWEAVE_CONFIG
|
|
27
27
|
});
|
|
28
|
-
// Print message + data
|
|
28
|
+
// Print message + data
|
|
29
29
|
if (result.message) {
|
|
30
30
|
if (result.ok) {
|
|
31
31
|
// eslint-disable-next-line no-console
|
|
@@ -40,6 +40,10 @@ async function main() {
|
|
|
40
40
|
// eslint-disable-next-line no-console
|
|
41
41
|
console.log(JSON.stringify(result.data, null, 2));
|
|
42
42
|
}
|
|
43
|
+
// For the `start` command, the HTTP server keeps the event loop alive —
|
|
44
|
+
// do NOT call process.exit() or it would kill the server immediately.
|
|
45
|
+
if (parsed.command === 'start')
|
|
46
|
+
return;
|
|
43
47
|
process.exit(result.ok ? 0 : 1);
|
|
44
48
|
}
|
|
45
49
|
main().catch((err) => {
|
package/dist/db/database.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { mkdirSync } from 'node:fs';
|
|
2
2
|
import { dirname } from 'node:path';
|
|
3
|
+
import { createRequire } from 'node:module';
|
|
3
4
|
import Database from 'better-sqlite3';
|
|
4
5
|
import { SCHEMA_SQL } from './schema.js';
|
|
5
6
|
import { logger } from '../server/logger.js';
|
|
7
|
+
const _require = createRequire(import.meta.url);
|
|
6
8
|
/**
|
|
7
9
|
* Default dimensions for the memory_vectors vec0 table. The actual configured
|
|
8
10
|
* dimensions come from the EmbeddingConfig; the table is created lazily by
|
|
@@ -36,7 +38,7 @@ export function openDatabase(path, options = {}) {
|
|
|
36
38
|
// Use a dynamic import to avoid hard-failing test environments that
|
|
37
39
|
// exercise only non-vector code paths.
|
|
38
40
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
39
|
-
const sqliteVec =
|
|
41
|
+
const sqliteVec = _require('sqlite-vec');
|
|
40
42
|
sqliteVec.load(db);
|
|
41
43
|
const dims = options.vectorDimensions ?? VECTOR_DEFAULT_DIMENSIONS;
|
|
42
44
|
ensureVecTable(db, dims);
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mem-weave/server",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "MemWeave local-first memory infrastructure for AI agents: structured memory, 4-layer retrieval (BM25 + vector + graph + causal), token-budgeted injection, server-side write deduplication, and background consolidation. Server process: Fastify REST API + CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cli-entry.js",
|
|
7
7
|
"types": "./dist/cli-entry.d.ts",
|
|
8
8
|
"bin": {
|
|
9
|
-
"memweave": "dist/cli-entry.js"
|
|
9
|
+
"memweave": "./dist/cli-entry.js"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"dist",
|