@claude-flow/memory 3.0.0-alpha.20 → 3.0.0-alpha.21
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/README.md +858 -858
- package/dist/agentdb-backend.js +26 -26
- package/dist/auto-memory-bridge.test.js +46 -46
- package/dist/controller-registry.d.ts +16 -0
- package/dist/controller-registry.d.ts.map +1 -1
- package/dist/controller-registry.js +37 -0
- package/dist/controller-registry.js.map +1 -1
- package/dist/sqlite-backend.js +79 -79
- package/dist/sqljs-backend.js +36 -36
- package/package.json +48 -48
package/dist/sqlite-backend.js
CHANGED
|
@@ -102,19 +102,19 @@ export class SQLiteBackend extends EventEmitter {
|
|
|
102
102
|
async store(entry) {
|
|
103
103
|
this.ensureInitialized();
|
|
104
104
|
const startTime = performance.now();
|
|
105
|
-
const stmt = this.db.prepare(`
|
|
106
|
-
INSERT OR REPLACE INTO memory_entries (
|
|
107
|
-
id, key, content, type, namespace, tags, metadata,
|
|
108
|
-
owner_id, access_level, created_at, updated_at, expires_at,
|
|
109
|
-
version, "references", access_count, last_accessed_at
|
|
110
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
105
|
+
const stmt = this.db.prepare(`
|
|
106
|
+
INSERT OR REPLACE INTO memory_entries (
|
|
107
|
+
id, key, content, type, namespace, tags, metadata,
|
|
108
|
+
owner_id, access_level, created_at, updated_at, expires_at,
|
|
109
|
+
version, "references", access_count, last_accessed_at
|
|
110
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
111
111
|
`);
|
|
112
112
|
stmt.run(entry.id, entry.key, entry.content, entry.type, entry.namespace, JSON.stringify(entry.tags), JSON.stringify(entry.metadata), entry.ownerId || null, entry.accessLevel, entry.createdAt, entry.updatedAt, entry.expiresAt || null, entry.version, JSON.stringify(entry.references), entry.accessCount, entry.lastAccessedAt);
|
|
113
113
|
// Store embedding separately (as BLOB)
|
|
114
114
|
if (entry.embedding) {
|
|
115
|
-
const embeddingStmt = this.db.prepare(`
|
|
116
|
-
INSERT OR REPLACE INTO memory_embeddings (entry_id, embedding)
|
|
117
|
-
VALUES (?, ?)
|
|
115
|
+
const embeddingStmt = this.db.prepare(`
|
|
116
|
+
INSERT OR REPLACE INTO memory_embeddings (entry_id, embedding)
|
|
117
|
+
VALUES (?, ?)
|
|
118
118
|
`);
|
|
119
119
|
embeddingStmt.run(entry.id, Buffer.from(entry.embedding.buffer));
|
|
120
120
|
}
|
|
@@ -146,9 +146,9 @@ export class SQLiteBackend extends EventEmitter {
|
|
|
146
146
|
*/
|
|
147
147
|
async getByKey(namespace, key) {
|
|
148
148
|
this.ensureInitialized();
|
|
149
|
-
const stmt = this.db.prepare(`
|
|
150
|
-
SELECT * FROM memory_entries
|
|
151
|
-
WHERE namespace = ? AND key = ?
|
|
149
|
+
const stmt = this.db.prepare(`
|
|
150
|
+
SELECT * FROM memory_entries
|
|
151
|
+
WHERE namespace = ? AND key = ?
|
|
152
152
|
`);
|
|
153
153
|
const row = stmt.get(namespace, key);
|
|
154
154
|
if (!row)
|
|
@@ -215,13 +215,13 @@ export class SQLiteBackend extends EventEmitter {
|
|
|
215
215
|
return [];
|
|
216
216
|
if (this.ftsAvailable) {
|
|
217
217
|
try {
|
|
218
|
-
const stmt = this.db.prepare(`
|
|
219
|
-
SELECT e.*, fts.rank as fts_rank
|
|
220
|
-
FROM memory_fts AS fts
|
|
221
|
-
JOIN memory_entries AS e ON e.id = fts.id
|
|
222
|
-
WHERE memory_fts MATCH ?
|
|
223
|
-
ORDER BY fts.rank
|
|
224
|
-
LIMIT ?
|
|
218
|
+
const stmt = this.db.prepare(`
|
|
219
|
+
SELECT e.*, fts.rank as fts_rank
|
|
220
|
+
FROM memory_fts AS fts
|
|
221
|
+
JOIN memory_entries AS e ON e.id = fts.id
|
|
222
|
+
WHERE memory_fts MATCH ?
|
|
223
|
+
ORDER BY fts.rank
|
|
224
|
+
LIMIT ?
|
|
225
225
|
`);
|
|
226
226
|
const rows = stmt.all(escapeFtsQuery(query), limit);
|
|
227
227
|
return rows.map((row) => {
|
|
@@ -309,9 +309,9 @@ export class SQLiteBackend extends EventEmitter {
|
|
|
309
309
|
}
|
|
310
310
|
// Use parameterized query with JSON functions
|
|
311
311
|
const tagPlaceholders = query.tags.map(() => '?').join(', ');
|
|
312
|
-
sql += ` AND EXISTS (
|
|
313
|
-
SELECT 1 FROM json_each(tags) AS t
|
|
314
|
-
WHERE t.value IN (${tagPlaceholders})
|
|
312
|
+
sql += ` AND EXISTS (
|
|
313
|
+
SELECT 1 FROM json_each(tags) AS t
|
|
314
|
+
WHERE t.value IN (${tagPlaceholders})
|
|
315
315
|
)`;
|
|
316
316
|
params.push(...query.tags);
|
|
317
317
|
}
|
|
@@ -407,9 +407,9 @@ export class SQLiteBackend extends EventEmitter {
|
|
|
407
407
|
const deleteEntries = this.db.prepare('DELETE FROM memory_entries WHERE namespace = ?');
|
|
408
408
|
const result = deleteEntries.run(namespace);
|
|
409
409
|
// Clean up orphaned embeddings
|
|
410
|
-
this.db.prepare(`
|
|
411
|
-
DELETE FROM memory_embeddings
|
|
412
|
-
WHERE entry_id NOT IN (SELECT id FROM memory_entries)
|
|
410
|
+
this.db.prepare(`
|
|
411
|
+
DELETE FROM memory_embeddings
|
|
412
|
+
WHERE entry_id NOT IN (SELECT id FROM memory_entries)
|
|
413
413
|
`).run();
|
|
414
414
|
return result.changes;
|
|
415
415
|
}
|
|
@@ -419,10 +419,10 @@ export class SQLiteBackend extends EventEmitter {
|
|
|
419
419
|
async getStats() {
|
|
420
420
|
this.ensureInitialized();
|
|
421
421
|
// Count by namespace
|
|
422
|
-
const namespaceStmt = this.db.prepare(`
|
|
423
|
-
SELECT namespace, COUNT(*) as count
|
|
424
|
-
FROM memory_entries
|
|
425
|
-
GROUP BY namespace
|
|
422
|
+
const namespaceStmt = this.db.prepare(`
|
|
423
|
+
SELECT namespace, COUNT(*) as count
|
|
424
|
+
FROM memory_entries
|
|
425
|
+
GROUP BY namespace
|
|
426
426
|
`);
|
|
427
427
|
const namespaceRows = namespaceStmt.all();
|
|
428
428
|
const entriesByNamespace = {};
|
|
@@ -430,10 +430,10 @@ export class SQLiteBackend extends EventEmitter {
|
|
|
430
430
|
entriesByNamespace[row.namespace] = row.count;
|
|
431
431
|
}
|
|
432
432
|
// Count by type
|
|
433
|
-
const typeStmt = this.db.prepare(`
|
|
434
|
-
SELECT type, COUNT(*) as count
|
|
435
|
-
FROM memory_entries
|
|
436
|
-
GROUP BY type
|
|
433
|
+
const typeStmt = this.db.prepare(`
|
|
434
|
+
SELECT type, COUNT(*) as count
|
|
435
|
+
FROM memory_entries
|
|
436
|
+
GROUP BY type
|
|
437
437
|
`);
|
|
438
438
|
const typeRows = typeStmt.all();
|
|
439
439
|
const entriesByType = {
|
|
@@ -540,49 +540,49 @@ export class SQLiteBackend extends EventEmitter {
|
|
|
540
540
|
if (!this.db)
|
|
541
541
|
return;
|
|
542
542
|
// Main entries table
|
|
543
|
-
this.db.exec(`
|
|
544
|
-
CREATE TABLE IF NOT EXISTS memory_entries (
|
|
545
|
-
id TEXT PRIMARY KEY,
|
|
546
|
-
key TEXT NOT NULL,
|
|
547
|
-
content TEXT NOT NULL,
|
|
548
|
-
type TEXT NOT NULL,
|
|
549
|
-
namespace TEXT NOT NULL,
|
|
550
|
-
tags TEXT NOT NULL,
|
|
551
|
-
metadata TEXT NOT NULL,
|
|
552
|
-
owner_id TEXT,
|
|
553
|
-
access_level TEXT NOT NULL,
|
|
554
|
-
created_at INTEGER NOT NULL,
|
|
555
|
-
updated_at INTEGER NOT NULL,
|
|
556
|
-
expires_at INTEGER,
|
|
557
|
-
version INTEGER NOT NULL,
|
|
558
|
-
"references" TEXT NOT NULL,
|
|
559
|
-
access_count INTEGER NOT NULL,
|
|
560
|
-
last_accessed_at INTEGER NOT NULL
|
|
561
|
-
);
|
|
562
|
-
|
|
563
|
-
CREATE INDEX IF NOT EXISTS idx_namespace ON memory_entries(namespace);
|
|
564
|
-
CREATE INDEX IF NOT EXISTS idx_key ON memory_entries(key);
|
|
565
|
-
CREATE INDEX IF NOT EXISTS idx_namespace_key ON memory_entries(namespace, key);
|
|
566
|
-
CREATE INDEX IF NOT EXISTS idx_type ON memory_entries(type);
|
|
567
|
-
CREATE INDEX IF NOT EXISTS idx_owner_id ON memory_entries(owner_id);
|
|
568
|
-
CREATE INDEX IF NOT EXISTS idx_created_at ON memory_entries(created_at);
|
|
569
|
-
CREATE INDEX IF NOT EXISTS idx_updated_at ON memory_entries(updated_at);
|
|
570
|
-
CREATE INDEX IF NOT EXISTS idx_expires_at ON memory_entries(expires_at);
|
|
571
|
-
|
|
572
|
-
CREATE TABLE IF NOT EXISTS memory_embeddings (
|
|
573
|
-
entry_id TEXT PRIMARY KEY,
|
|
574
|
-
embedding BLOB,
|
|
575
|
-
FOREIGN KEY (entry_id) REFERENCES memory_entries(id) ON DELETE CASCADE
|
|
576
|
-
);
|
|
543
|
+
this.db.exec(`
|
|
544
|
+
CREATE TABLE IF NOT EXISTS memory_entries (
|
|
545
|
+
id TEXT PRIMARY KEY,
|
|
546
|
+
key TEXT NOT NULL,
|
|
547
|
+
content TEXT NOT NULL,
|
|
548
|
+
type TEXT NOT NULL,
|
|
549
|
+
namespace TEXT NOT NULL,
|
|
550
|
+
tags TEXT NOT NULL,
|
|
551
|
+
metadata TEXT NOT NULL,
|
|
552
|
+
owner_id TEXT,
|
|
553
|
+
access_level TEXT NOT NULL,
|
|
554
|
+
created_at INTEGER NOT NULL,
|
|
555
|
+
updated_at INTEGER NOT NULL,
|
|
556
|
+
expires_at INTEGER,
|
|
557
|
+
version INTEGER NOT NULL,
|
|
558
|
+
"references" TEXT NOT NULL,
|
|
559
|
+
access_count INTEGER NOT NULL,
|
|
560
|
+
last_accessed_at INTEGER NOT NULL
|
|
561
|
+
);
|
|
562
|
+
|
|
563
|
+
CREATE INDEX IF NOT EXISTS idx_namespace ON memory_entries(namespace);
|
|
564
|
+
CREATE INDEX IF NOT EXISTS idx_key ON memory_entries(key);
|
|
565
|
+
CREATE INDEX IF NOT EXISTS idx_namespace_key ON memory_entries(namespace, key);
|
|
566
|
+
CREATE INDEX IF NOT EXISTS idx_type ON memory_entries(type);
|
|
567
|
+
CREATE INDEX IF NOT EXISTS idx_owner_id ON memory_entries(owner_id);
|
|
568
|
+
CREATE INDEX IF NOT EXISTS idx_created_at ON memory_entries(created_at);
|
|
569
|
+
CREATE INDEX IF NOT EXISTS idx_updated_at ON memory_entries(updated_at);
|
|
570
|
+
CREATE INDEX IF NOT EXISTS idx_expires_at ON memory_entries(expires_at);
|
|
571
|
+
|
|
572
|
+
CREATE TABLE IF NOT EXISTS memory_embeddings (
|
|
573
|
+
entry_id TEXT PRIMARY KEY,
|
|
574
|
+
embedding BLOB,
|
|
575
|
+
FOREIGN KEY (entry_id) REFERENCES memory_entries(id) ON DELETE CASCADE
|
|
576
|
+
);
|
|
577
577
|
`);
|
|
578
578
|
// ADR-125 Phase 5 — FTS5 virtual table for keyword search.
|
|
579
579
|
// FTS5 is built into better-sqlite3 since 11.x. Surrounding try/catch so
|
|
580
580
|
// older SQLite builds gracefully skip FTS without taking the whole backend
|
|
581
581
|
// offline; queries against `searchKeyword` will fall back to LIKE.
|
|
582
582
|
try {
|
|
583
|
-
this.db.exec(`
|
|
584
|
-
CREATE VIRTUAL TABLE IF NOT EXISTS memory_fts
|
|
585
|
-
USING fts5(id UNINDEXED, content, tokenize='porter unicode61');
|
|
583
|
+
this.db.exec(`
|
|
584
|
+
CREATE VIRTUAL TABLE IF NOT EXISTS memory_fts
|
|
585
|
+
USING fts5(id UNINDEXED, content, tokenize='porter unicode61');
|
|
586
586
|
`);
|
|
587
587
|
this.ftsAvailable = true;
|
|
588
588
|
}
|
|
@@ -622,18 +622,18 @@ export class SQLiteBackend extends EventEmitter {
|
|
|
622
622
|
* Synchronous store for use in transactions
|
|
623
623
|
*/
|
|
624
624
|
storeSync(entry) {
|
|
625
|
-
const stmt = this.db.prepare(`
|
|
626
|
-
INSERT OR REPLACE INTO memory_entries (
|
|
627
|
-
id, key, content, type, namespace, tags, metadata,
|
|
628
|
-
owner_id, access_level, created_at, updated_at, expires_at,
|
|
629
|
-
version, "references", access_count, last_accessed_at
|
|
630
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
625
|
+
const stmt = this.db.prepare(`
|
|
626
|
+
INSERT OR REPLACE INTO memory_entries (
|
|
627
|
+
id, key, content, type, namespace, tags, metadata,
|
|
628
|
+
owner_id, access_level, created_at, updated_at, expires_at,
|
|
629
|
+
version, "references", access_count, last_accessed_at
|
|
630
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
631
631
|
`);
|
|
632
632
|
stmt.run(entry.id, entry.key, entry.content, entry.type, entry.namespace, JSON.stringify(entry.tags), JSON.stringify(entry.metadata), entry.ownerId || null, entry.accessLevel, entry.createdAt, entry.updatedAt, entry.expiresAt || null, entry.version, JSON.stringify(entry.references), entry.accessCount, entry.lastAccessedAt);
|
|
633
633
|
if (entry.embedding) {
|
|
634
|
-
const embeddingStmt = this.db.prepare(`
|
|
635
|
-
INSERT OR REPLACE INTO memory_embeddings (entry_id, embedding)
|
|
636
|
-
VALUES (?, ?)
|
|
634
|
+
const embeddingStmt = this.db.prepare(`
|
|
635
|
+
INSERT OR REPLACE INTO memory_embeddings (entry_id, embedding)
|
|
636
|
+
VALUES (?, ?)
|
|
637
637
|
`);
|
|
638
638
|
embeddingStmt.run(entry.id, Buffer.from(entry.embedding.buffer));
|
|
639
639
|
}
|
package/dist/sqljs-backend.js
CHANGED
|
@@ -117,26 +117,26 @@ export class SqlJsBackend extends EventEmitter {
|
|
|
117
117
|
if (!this.db)
|
|
118
118
|
return;
|
|
119
119
|
// Main entries table
|
|
120
|
-
this.db.run(`
|
|
121
|
-
CREATE TABLE IF NOT EXISTS memory_entries (
|
|
122
|
-
id TEXT PRIMARY KEY,
|
|
123
|
-
key TEXT NOT NULL,
|
|
124
|
-
content TEXT NOT NULL,
|
|
125
|
-
embedding BLOB,
|
|
126
|
-
type TEXT NOT NULL,
|
|
127
|
-
namespace TEXT NOT NULL,
|
|
128
|
-
tags TEXT NOT NULL,
|
|
129
|
-
metadata TEXT NOT NULL,
|
|
130
|
-
owner_id TEXT,
|
|
131
|
-
access_level TEXT NOT NULL,
|
|
132
|
-
created_at INTEGER NOT NULL,
|
|
133
|
-
updated_at INTEGER NOT NULL,
|
|
134
|
-
expires_at INTEGER,
|
|
135
|
-
version INTEGER NOT NULL DEFAULT 1,
|
|
136
|
-
"references" TEXT NOT NULL,
|
|
137
|
-
access_count INTEGER NOT NULL DEFAULT 0,
|
|
138
|
-
last_accessed_at INTEGER NOT NULL
|
|
139
|
-
)
|
|
120
|
+
this.db.run(`
|
|
121
|
+
CREATE TABLE IF NOT EXISTS memory_entries (
|
|
122
|
+
id TEXT PRIMARY KEY,
|
|
123
|
+
key TEXT NOT NULL,
|
|
124
|
+
content TEXT NOT NULL,
|
|
125
|
+
embedding BLOB,
|
|
126
|
+
type TEXT NOT NULL,
|
|
127
|
+
namespace TEXT NOT NULL,
|
|
128
|
+
tags TEXT NOT NULL,
|
|
129
|
+
metadata TEXT NOT NULL,
|
|
130
|
+
owner_id TEXT,
|
|
131
|
+
access_level TEXT NOT NULL,
|
|
132
|
+
created_at INTEGER NOT NULL,
|
|
133
|
+
updated_at INTEGER NOT NULL,
|
|
134
|
+
expires_at INTEGER,
|
|
135
|
+
version INTEGER NOT NULL DEFAULT 1,
|
|
136
|
+
"references" TEXT NOT NULL,
|
|
137
|
+
access_count INTEGER NOT NULL DEFAULT 0,
|
|
138
|
+
last_accessed_at INTEGER NOT NULL
|
|
139
|
+
)
|
|
140
140
|
`);
|
|
141
141
|
// Indexes for performance
|
|
142
142
|
this.db.run('CREATE INDEX IF NOT EXISTS idx_namespace ON memory_entries(namespace)');
|
|
@@ -147,9 +147,9 @@ export class SqlJsBackend extends EventEmitter {
|
|
|
147
147
|
this.db.run('CREATE UNIQUE INDEX IF NOT EXISTS idx_namespace_key ON memory_entries(namespace, key)');
|
|
148
148
|
// ADR-125 Phase 5 — FTS5 keyword index. sql.js ships FTS5 since 1.10.
|
|
149
149
|
try {
|
|
150
|
-
this.db.run(`
|
|
151
|
-
CREATE VIRTUAL TABLE IF NOT EXISTS memory_fts
|
|
152
|
-
USING fts5(id UNINDEXED, content, tokenize='porter unicode61')
|
|
150
|
+
this.db.run(`
|
|
151
|
+
CREATE VIRTUAL TABLE IF NOT EXISTS memory_fts
|
|
152
|
+
USING fts5(id UNINDEXED, content, tokenize='porter unicode61')
|
|
153
153
|
`);
|
|
154
154
|
this.ftsAvailable = true;
|
|
155
155
|
}
|
|
@@ -166,12 +166,12 @@ export class SqlJsBackend extends EventEmitter {
|
|
|
166
166
|
async store(entry) {
|
|
167
167
|
this.ensureInitialized();
|
|
168
168
|
const startTime = performance.now();
|
|
169
|
-
const stmt = `
|
|
170
|
-
INSERT OR REPLACE INTO memory_entries (
|
|
171
|
-
id, key, content, embedding, type, namespace, tags, metadata,
|
|
172
|
-
owner_id, access_level, created_at, updated_at, expires_at,
|
|
173
|
-
version, "references", access_count, last_accessed_at
|
|
174
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
169
|
+
const stmt = `
|
|
170
|
+
INSERT OR REPLACE INTO memory_entries (
|
|
171
|
+
id, key, content, embedding, type, namespace, tags, metadata,
|
|
172
|
+
owner_id, access_level, created_at, updated_at, expires_at,
|
|
173
|
+
version, "references", access_count, last_accessed_at
|
|
174
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
175
175
|
`;
|
|
176
176
|
const embeddingBuffer = entry.embedding
|
|
177
177
|
? Buffer.from(entry.embedding.buffer)
|
|
@@ -301,13 +301,13 @@ export class SqlJsBackend extends EventEmitter {
|
|
|
301
301
|
return [];
|
|
302
302
|
if (this.ftsAvailable) {
|
|
303
303
|
try {
|
|
304
|
-
const stmt = this.db.prepare(`
|
|
305
|
-
SELECT e.*, fts.rank as fts_rank
|
|
306
|
-
FROM memory_fts AS fts
|
|
307
|
-
JOIN memory_entries AS e ON e.id = fts.id
|
|
308
|
-
WHERE memory_fts MATCH ?
|
|
309
|
-
ORDER BY fts.rank
|
|
310
|
-
LIMIT ?
|
|
304
|
+
const stmt = this.db.prepare(`
|
|
305
|
+
SELECT e.*, fts.rank as fts_rank
|
|
306
|
+
FROM memory_fts AS fts
|
|
307
|
+
JOIN memory_entries AS e ON e.id = fts.id
|
|
308
|
+
WHERE memory_fts MATCH ?
|
|
309
|
+
ORDER BY fts.rank
|
|
310
|
+
LIMIT ?
|
|
311
311
|
`);
|
|
312
312
|
stmt.bind([escapeFtsQuery(query), limit]);
|
|
313
313
|
const results = [];
|
package/package.json
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@claude-flow/memory",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"description": "Memory module - AgentDB unification, HNSW indexing, vector search, hybrid SQLite+AgentDB backend (ADR-009)",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": "./dist/index.js",
|
|
10
|
-
"./*": "./dist/*.js"
|
|
11
|
-
},
|
|
12
|
-
"scripts": {
|
|
13
|
-
"test": "vitest run",
|
|
14
|
-
"bench": "vitest bench --config vitest.bench.config.ts",
|
|
15
|
-
"build": "tsc",
|
|
16
|
-
"prebuild": "rm -rf dist tsconfig.tsbuildinfo",
|
|
17
|
-
"prepublishOnly": "npm run build && node -e \"const m = await import('./dist/index.js'); const required = ['ControllerRegistry','MemoryService','UnifiedMemoryService','PersistentSonaCoordinator','RvfLearningStore','RvfMigrator']; const missing = required.filter(k => !m[k]); if (missing.length) { console.error('Missing exports:', missing); process.exit(1); } const forbidden = ['HnswLite','RvfBackend']; const leaks = forbidden.filter(k => k in m); if (leaks.length) { console.error('Forbidden public exports present (ADR-125):', leaks); process.exit(1); } console.log('All required exports present; ADR-125 surface clean');\""
|
|
18
|
-
},
|
|
19
|
-
"dependencies": {
|
|
20
|
-
"agentdb": "^3.0.0-alpha.16",
|
|
21
|
-
"sql.js": "^1.10.3"
|
|
22
|
-
},
|
|
23
|
-
"optionalDependencies": {
|
|
24
|
-
"better-sqlite3": "^12.9.0"
|
|
25
|
-
},
|
|
26
|
-
"devDependencies": {
|
|
27
|
-
"@types/better-sqlite3": "^7.6.11",
|
|
28
|
-
"@types/sql.js": "^1.4.9",
|
|
29
|
-
"vitest": "^4.0.16"
|
|
30
|
-
},
|
|
31
|
-
"files": [
|
|
32
|
-
"dist",
|
|
33
|
-
"README.md"
|
|
34
|
-
],
|
|
35
|
-
"publishConfig": {
|
|
36
|
-
"access": "public",
|
|
37
|
-
"tag": "v3alpha"
|
|
38
|
-
},
|
|
39
|
-
"os": [
|
|
40
|
-
"darwin",
|
|
41
|
-
"linux",
|
|
42
|
-
"win32"
|
|
43
|
-
],
|
|
44
|
-
"cpu": [
|
|
45
|
-
"x64",
|
|
46
|
-
"arm64"
|
|
47
|
-
]
|
|
48
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@claude-flow/memory",
|
|
3
|
+
"version": "3.0.0-alpha.21",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Memory module - AgentDB unification, HNSW indexing, vector search, hybrid SQLite+AgentDB backend (ADR-009)",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./dist/index.js",
|
|
10
|
+
"./*": "./dist/*.js"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"test": "vitest run",
|
|
14
|
+
"bench": "vitest bench --config vitest.bench.config.ts",
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"prebuild": "rm -rf dist tsconfig.tsbuildinfo",
|
|
17
|
+
"prepublishOnly": "npm run build && node -e \"const m = await import('./dist/index.js'); const required = ['ControllerRegistry','MemoryService','UnifiedMemoryService','PersistentSonaCoordinator','RvfLearningStore','RvfMigrator']; const missing = required.filter(k => !m[k]); if (missing.length) { console.error('Missing exports:', missing); process.exit(1); } const forbidden = ['HnswLite','RvfBackend']; const leaks = forbidden.filter(k => k in m); if (leaks.length) { console.error('Forbidden public exports present (ADR-125):', leaks); process.exit(1); } console.log('All required exports present; ADR-125 surface clean');\""
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"agentdb": "^3.0.0-alpha.16",
|
|
21
|
+
"sql.js": "^1.10.3"
|
|
22
|
+
},
|
|
23
|
+
"optionalDependencies": {
|
|
24
|
+
"better-sqlite3": "^12.9.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/better-sqlite3": "^7.6.11",
|
|
28
|
+
"@types/sql.js": "^1.4.9",
|
|
29
|
+
"vitest": "^4.0.16"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"README.md"
|
|
34
|
+
],
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public",
|
|
37
|
+
"tag": "v3alpha"
|
|
38
|
+
},
|
|
39
|
+
"os": [
|
|
40
|
+
"darwin",
|
|
41
|
+
"linux",
|
|
42
|
+
"win32"
|
|
43
|
+
],
|
|
44
|
+
"cpu": [
|
|
45
|
+
"x64",
|
|
46
|
+
"arm64"
|
|
47
|
+
]
|
|
48
|
+
}
|