vektor-slipstream 1.3.2 → 1.3.4
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/boot-patch.js +33 -0
- package/index.js +1 -1
- package/package.json +5 -3
- package/vektor-cli.js +62 -6
package/boot-patch.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const _orig = console.log.bind(console);
|
|
3
|
+
let _bootLine = 0;
|
|
4
|
+
let _inBoot = false;
|
|
5
|
+
|
|
6
|
+
const REPLACEMENTS = [
|
|
7
|
+
' \u250C\u2500 EP CPU\u00B7Hash',
|
|
8
|
+
' \u251C\u2500 MDL hash-projection (384-dim)',
|
|
9
|
+
' \u251C\u2500 EMB <1ms (post-warmup)',
|
|
10
|
+
' \u251C\u2500 DB WAL | mmap:1GB | cache:64MB',
|
|
11
|
+
' \u251C\u2500 WRM \u2713',
|
|
12
|
+
' \u2514\u2500 TMR {ms}ms total',
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
console.log = function(...args) {
|
|
16
|
+
if (args.length === 1 && typeof args[0] === 'string') {
|
|
17
|
+
const s = args[0];
|
|
18
|
+
if (s.includes('VEKTOR SLIPSTREAM')) { _inBoot = true; _bootLine = 0; }
|
|
19
|
+
if (_inBoot && (s.includes('\u2699') || s.includes('\uD83E') || s.includes('\u26A1') || s.includes('\uD83D\uDCBE') || s.includes('\uD83D\uDD25') || s.includes('\u23F1'))) {
|
|
20
|
+
const rep = REPLACEMENTS[_bootLine];
|
|
21
|
+
if (rep) {
|
|
22
|
+
const ms = (s.match(/(\d+)ms/) || [])[1];
|
|
23
|
+
_orig(rep.replace('{ms}', ms || ''));
|
|
24
|
+
_bootLine++;
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (s.includes('SQLite')) _inBoot = false;
|
|
29
|
+
}
|
|
30
|
+
return _orig(...args);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
module.exports = require('./slipstream-core');
|
package/index.js
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
'use strict';
|
|
32
32
|
|
|
33
|
-
const { createMemory } = require('vektor-slipstream');
|
|
33
|
+
const { createMemory } = require('vektor-slipstream/boot');
|
|
34
34
|
const cortex = require('./cortex');
|
|
35
35
|
const axon = require('./axon');
|
|
36
36
|
const cerebellum = require('./cerebellum');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vektor-slipstream",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.4",
|
|
4
4
|
"description": "Hardware-accelerated persistent memory for AI agents. Local-first, zero cloud dependency, $0 embedding cost.",
|
|
5
5
|
"main": "slipstream-core.js",
|
|
6
6
|
"bin": {
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"./cloak/axon": "./axon.js",
|
|
22
22
|
"./cloak/cerebellum": "./cerebellum.js",
|
|
23
23
|
"./cloak/token": "./token.js",
|
|
24
|
-
"./cloak/mcp": "./index.js"
|
|
24
|
+
"./cloak/mcp": "./index.js",
|
|
25
|
+
"./boot": "./boot-patch.js"
|
|
25
26
|
},
|
|
26
27
|
"keywords": [
|
|
27
28
|
"ai",
|
|
@@ -103,7 +104,8 @@
|
|
|
103
104
|
"models/vocab.json",
|
|
104
105
|
"examples/",
|
|
105
106
|
"mistral/",
|
|
106
|
-
"vektor-slipstream.dxt"
|
|
107
|
+
"vektor-slipstream.dxt",
|
|
108
|
+
"boot-patch.js"
|
|
107
109
|
],
|
|
108
110
|
"publishConfig": {
|
|
109
111
|
"access": "public"
|
package/vektor-cli.js
CHANGED
|
@@ -258,12 +258,12 @@ async function cmdRem() {
|
|
|
258
258
|
printBox();
|
|
259
259
|
console.log(' Running REM dream cycle...\n');
|
|
260
260
|
try {
|
|
261
|
-
const { createMemory } = require('./
|
|
261
|
+
const { createMemory } = require('./boot-patch');
|
|
262
262
|
const dbPath = process.env.VEKTOR_DB_PATH ||
|
|
263
263
|
path.join(os.homedir(), 'vektor-slipstream-memory.db');
|
|
264
264
|
|
|
265
265
|
if (!fs.existsSync(dbPath)) {
|
|
266
|
-
console.error(yellow(' ⚠
|
|
266
|
+
console.error(yellow(' ⚠ No memory database found at: ' + dbPath));
|
|
267
267
|
console.log(dim(' Run: npx vektor test to create one'));
|
|
268
268
|
process.exit(1);
|
|
269
269
|
}
|
|
@@ -275,10 +275,66 @@ async function cmdRem() {
|
|
|
275
275
|
licenceKey: process.env.VEKTOR_LICENCE_KEY,
|
|
276
276
|
});
|
|
277
277
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
278
|
+
// ── Phase 1: Audit ──────────────────────────────────────────────────────
|
|
279
|
+
console.log(' ' + dim('┌─ Phase 1/4 Auditing memory graph...'));
|
|
280
|
+
const stats = await memory.stats();
|
|
281
|
+
const total = stats.total || 0;
|
|
282
|
+
console.log(dim(' │ Total nodes: ' + total));
|
|
283
|
+
|
|
284
|
+
if (total === 0) {
|
|
285
|
+
console.log(green(' └─ Memory graph is empty — nothing to consolidate\n'));
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// ── Phase 2: Surface recent activity ───────────────────────────────────
|
|
290
|
+
console.log(' ' + dim('├─ Phase 2/4 Scanning recent activity...'));
|
|
291
|
+
const recent = await memory.recent(20);
|
|
292
|
+
console.log(dim(' │ Recent nodes scanned: ' + (recent ? recent.length : 0)));
|
|
293
|
+
|
|
294
|
+
// ── Phase 3: Prune noise nodes ──────────────────────────────────────────
|
|
295
|
+
console.log(' ' + dim('├─ Phase 3/4 Pruning noise nodes...'));
|
|
296
|
+
let pruned = 0;
|
|
297
|
+
const NOISE = [
|
|
298
|
+
'cloak warmup probe',
|
|
299
|
+
'VEKTOR CLI test — memory is working correctly',
|
|
300
|
+
];
|
|
301
|
+
for (const pattern of NOISE) {
|
|
302
|
+
try {
|
|
303
|
+
const nodes = await memory.recall(pattern, 10);
|
|
304
|
+
if (!nodes || !nodes.length) continue;
|
|
305
|
+
for (const node of nodes) {
|
|
306
|
+
if (node.content && NOISE.some(n => node.content.includes(n))) {
|
|
307
|
+
if (node.id) { await memory.remove(node.id); pruned++; }
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
} catch { /* non-fatal */ }
|
|
311
|
+
}
|
|
312
|
+
console.log(dim(' │ Noise nodes pruned: ' + pruned));
|
|
313
|
+
|
|
314
|
+
// ── Phase 4: Briefing as consolidation summary ──────────────────────────
|
|
315
|
+
console.log(' ' + dim('├─ Phase 4/4 Generating consolidation summary...'));
|
|
316
|
+
let briefSnippet = '';
|
|
317
|
+
try {
|
|
318
|
+
const brief = await memory.briefing();
|
|
319
|
+
if (brief) briefSnippet = brief.slice(0, 120) + (brief.length > 120 ? '...' : '');
|
|
320
|
+
} catch { /* non-fatal */ }
|
|
321
|
+
|
|
322
|
+
// ── Result ──────────────────────────────────────────────────────────────
|
|
323
|
+
const statsAfter = await memory.stats();
|
|
324
|
+
const totalAfter = statsAfter.total || 0;
|
|
325
|
+
const delta = total - totalAfter;
|
|
326
|
+
|
|
327
|
+
console.log(green(' └─ REM cycle complete\n'));
|
|
328
|
+
console.log(' ' + dim('Before:') + ' ' + total + ' nodes');
|
|
329
|
+
console.log(' ' + dim('After: ') + ' ' + totalAfter + ' nodes');
|
|
330
|
+
console.log(' ' + dim('Pruned:') + ' ' + pruned + ' noise nodes');
|
|
331
|
+
if (delta > pruned) {
|
|
332
|
+
console.log(' ' + dim('AUDN: ') + ' ' + (delta - pruned) + ' duplicates resolved');
|
|
333
|
+
}
|
|
334
|
+
if (briefSnippet) {
|
|
335
|
+
console.log('\n ' + dim('Briefing: ') + briefSnippet);
|
|
336
|
+
}
|
|
337
|
+
|
|
282
338
|
} catch (e) {
|
|
283
339
|
console.error(red(' ✗ REM error: ') + e.message);
|
|
284
340
|
process.exit(1);
|