vektor-slipstream 1.4.2 → 1.4.3
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/package.json +2 -2
- package/vektor-setup.js +266 -266
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vektor-slipstream",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"description": "Hardware-accelerated persistent memory for AI agents. Local-first, zero cloud dependency, $0 embedding cost.",
|
|
5
5
|
"main": "slipstream-core-extended.js",
|
|
6
6
|
"types": "./types/index.d.ts",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"dependencies": {
|
|
73
73
|
"better-sqlite3": "^12.8.0",
|
|
74
74
|
"onnxruntime-node": "^1.17.3",
|
|
75
|
-
"vektor-slipstream": "^1.4.
|
|
75
|
+
"vektor-slipstream": "^1.4.2"
|
|
76
76
|
},
|
|
77
77
|
"optionalDependencies": {
|
|
78
78
|
"@anthropic-ai/sdk": "^0.82.0",
|
package/vektor-setup.js
CHANGED
|
@@ -1,266 +1,266 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
'use strict';
|
|
3
|
-
/**
|
|
4
|
-
* vektor-setup.js — VEKTOR Slipstream First-Run Wizard
|
|
5
|
-
* ─────────────────────────────────────────────────────────────────────────────
|
|
6
|
-
* Guides the user through:
|
|
7
|
-
* 1. Licence activation
|
|
8
|
-
* 2. Hardware detection
|
|
9
|
-
* 3. Memory engine test
|
|
10
|
-
* 4. Integration setup (Claude MCP, LangChain, OpenAI, Mistral)
|
|
11
|
-
* 5. Optional Playwright install for Cloak
|
|
12
|
-
* ─────────────────────────────────────────────────────────────────────────────
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
const readline = require('readline');
|
|
16
|
-
const { execSync, spawn } = require('child_process');
|
|
17
|
-
const path = require('path');
|
|
18
|
-
const os = require('os');
|
|
19
|
-
const fs = require('fs');
|
|
20
|
-
|
|
21
|
-
const PKG = require('./package.json');
|
|
22
|
-
|
|
23
|
-
// ── Colours ───────────────────────────────────────────────────────────────────
|
|
24
|
-
const C = {
|
|
25
|
-
reset: '\x1b[0m', cyan: '\x1b[36m', green: '\x1b[32m',
|
|
26
|
-
yellow: '\x1b[33m', red: '\x1b[31m', dim: '\x1b[2m', bold: '\x1b[1m',
|
|
27
|
-
};
|
|
28
|
-
const cyan = s => C.cyan + s + C.reset;
|
|
29
|
-
const green = s => C.green + s + C.reset;
|
|
30
|
-
const yellow = s => C.yellow + s + C.reset;
|
|
31
|
-
const red = s => C.red + s + C.reset;
|
|
32
|
-
const dim = s => C.dim + s + C.reset;
|
|
33
|
-
const bold = s => C.bold + s + C.reset;
|
|
34
|
-
|
|
35
|
-
function ask(question) {
|
|
36
|
-
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
37
|
-
return new Promise(resolve => rl.question(question, ans => { rl.close(); resolve(ans.trim()); }));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function askYN(question) {
|
|
41
|
-
return ask(question + ' [y/n] › ').then(a => a.toLowerCase().startsWith('y'));
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function step(n, total, label) {
|
|
45
|
-
console.log(`\n${cyan(`[${n}/${total}]`)} ${bold(label)}`);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function ok(msg) { console.log(green(' ✓ ') + msg); }
|
|
49
|
-
function warn(msg) { console.log(yellow(' ⚠ ') + msg); }
|
|
50
|
-
function info(msg) { console.log(dim(' → ') + msg); }
|
|
51
|
-
function fail(msg) { console.log(red(' ✗ ') + msg); }
|
|
52
|
-
|
|
53
|
-
// ── Main wizard ───────────────────────────────────────────────────────────────
|
|
54
|
-
|
|
55
|
-
async function main() {
|
|
56
|
-
console.log('');
|
|
57
|
-
console.log(cyan(' ╔══════════════════════════════════════════════════════╗'));
|
|
58
|
-
console.log(cyan(' ║') + bold(' VEKTOR SLIPSTREAM — SETUP WIZARD ') + cyan('║'));
|
|
59
|
-
console.log(cyan(' ╚══════════════════════════════════════════════════════╝'));
|
|
60
|
-
console.log(dim(` v${PKG.version} · vektormemory.com\n`));
|
|
61
|
-
console.log(' Welcome. This wizard will get VEKTOR running in under 5 minutes.');
|
|
62
|
-
console.log(dim(' Press Ctrl+C at any time to exit.\n'));
|
|
63
|
-
|
|
64
|
-
const TOTAL = 5;
|
|
65
|
-
|
|
66
|
-
// ── Step 1: Licence ─────────────────────────────────────────────────────────
|
|
67
|
-
step(1, TOTAL, 'Licence Activation');
|
|
68
|
-
|
|
69
|
-
let licenceKey = process.env.VEKTOR_LICENCE_KEY;
|
|
70
|
-
|
|
71
|
-
if (licenceKey) {
|
|
72
|
-
ok(`VEKTOR_LICENCE_KEY is set in environment`);
|
|
73
|
-
} else {
|
|
74
|
-
// Check cache
|
|
75
|
-
const cacheFile = path.join(os.homedir(), '.vektor', 'licence.json');
|
|
76
|
-
if (fs.existsSync(cacheFile)) {
|
|
77
|
-
ok('Licence cache found — already activated on this machine');
|
|
78
|
-
} else {
|
|
79
|
-
console.log('');
|
|
80
|
-
console.log(' Paste your licence key from your Polar purchase email.');
|
|
81
|
-
console.log(dim(' Purchase at: https://vektormemory.com/product#pricing\n'));
|
|
82
|
-
|
|
83
|
-
try {
|
|
84
|
-
const { resolveAndValidateLicence } = require('./vektor-licence-prompt');
|
|
85
|
-
const { validateLicence } = require('./vektor-licence');
|
|
86
|
-
await resolveAndValidateLicence(validateLicence);
|
|
87
|
-
ok('Licence activated and cached');
|
|
88
|
-
} catch (e) {
|
|
89
|
-
fail('Licence activation failed: ' + e.message);
|
|
90
|
-
console.log(dim('\n You can retry with: npx vektor activate'));
|
|
91
|
-
process.exit(1);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// ── Step 2: Hardware detection ───────────────────────────────────────────────
|
|
97
|
-
step(2, TOTAL, 'Hardware Detection');
|
|
98
|
-
|
|
99
|
-
const platform = os.platform();
|
|
100
|
-
const arch = os.arch();
|
|
101
|
-
info(`Platform: ${platform} / ${arch}`);
|
|
102
|
-
|
|
103
|
-
let accelerator = 'CPU';
|
|
104
|
-
if (platform === 'darwin' && arch === 'arm64') {
|
|
105
|
-
accelerator = 'Apple Silicon (CoreML)';
|
|
106
|
-
ok('Apple Silicon detected — CoreML acceleration available');
|
|
107
|
-
} else {
|
|
108
|
-
// Check for CUDA
|
|
109
|
-
try {
|
|
110
|
-
execSync('nvidia-smi', { stdio: 'ignore' });
|
|
111
|
-
accelerator = 'NVIDIA CUDA';
|
|
112
|
-
ok('NVIDIA GPU detected — CUDA acceleration available');
|
|
113
|
-
} catch {
|
|
114
|
-
ok(`CPU mode — embeddings will use hash-projection (<1ms) until @xenova/transformers loads`);
|
|
115
|
-
info('For full semantic embeddings: npm install @xenova/transformers');
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// ── Step 3: Memory test ──────────────────────────────────────────────────────
|
|
120
|
-
step(3, TOTAL, 'Memory Engine Test');
|
|
121
|
-
|
|
122
|
-
try {
|
|
123
|
-
const { createMemory } = require('./slipstream-core');
|
|
124
|
-
info('Booting memory engine...');
|
|
125
|
-
|
|
126
|
-
const memory = await createMemory({
|
|
127
|
-
agentId: 'setup-test',
|
|
128
|
-
dbPath: './vektor-setup-test.db',
|
|
129
|
-
silent: true,
|
|
130
|
-
licenceKey: process.env.VEKTOR_LICENCE_KEY,
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
ok('Memory engine booted');
|
|
134
|
-
|
|
135
|
-
const { id } = await memory.remember('VEKTOR setup test — system is working');
|
|
136
|
-
ok(`Memory store works (id: ${id})`);
|
|
137
|
-
|
|
138
|
-
const results = await memory.recall('setup test working', 3);
|
|
139
|
-
ok(`Memory recall works (${results.length} result${results.length === 1 ? '' : 's'})`);
|
|
140
|
-
|
|
141
|
-
try { fs.unlinkSync('./vektor-setup-test.db'); } catch (_) {}
|
|
142
|
-
ok('Test complete — memory engine is healthy');
|
|
143
|
-
|
|
144
|
-
} catch (e) {
|
|
145
|
-
fail('Memory engine error: ' + e.message);
|
|
146
|
-
if (e.message.includes('better-sqlite3')) {
|
|
147
|
-
warn('SQLite binary mismatch — run: npm rebuild better-sqlite3');
|
|
148
|
-
}
|
|
149
|
-
process.exit(1);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// ── Step 4: Integrations ─────────────────────────────────────────────────────
|
|
153
|
-
step(4, TOTAL, 'Integration Setup');
|
|
154
|
-
|
|
155
|
-
console.log('');
|
|
156
|
-
console.log(' Which integrations do you want to set up?');
|
|
157
|
-
console.log(dim(' (You can set these up later with: npx vektor help)\n'));
|
|
158
|
-
|
|
159
|
-
// Claude MCP
|
|
160
|
-
const setupMcp = await askYN(' Claude Desktop MCP server?');
|
|
161
|
-
if (setupMcp) {
|
|
162
|
-
const mcpScript = path.join(__dirname, 'examples', 'example-claude-mcp.js');
|
|
163
|
-
const configPath = path.join(os.homedir(),
|
|
164
|
-
process.platform === 'win32' ? 'AppData/Roaming/Claude/claude_desktop_config.json' :
|
|
165
|
-
process.platform === 'darwin' ? 'Library/Application Support/Claude/claude_desktop_config.json' :
|
|
166
|
-
'.config/Claude/claude_desktop_config.json'
|
|
167
|
-
);
|
|
168
|
-
|
|
169
|
-
console.log('');
|
|
170
|
-
info('Add this to your claude_desktop_config.json:');
|
|
171
|
-
console.log('');
|
|
172
|
-
console.log(cyan(' {'));
|
|
173
|
-
console.log(cyan(' "mcpServers": {'));
|
|
174
|
-
console.log(cyan(' "slipstream": {'));
|
|
175
|
-
console.log(cyan(' "command": "node",'));
|
|
176
|
-
console.log(cyan(` "args": ["${mcpScript.replace(/\\/g, '/')}", "--mcp"],`));
|
|
177
|
-
console.log(cyan(' "env": {'));
|
|
178
|
-
console.log(cyan(` "VEKTOR_LICENCE_KEY": "${process.env.VEKTOR_LICENCE_KEY || 'YOUR-KEY-HERE'}"`));
|
|
179
|
-
console.log(cyan(' }'));
|
|
180
|
-
console.log(cyan(' }'));
|
|
181
|
-
console.log(cyan(' }'));
|
|
182
|
-
console.log(cyan(' }'));
|
|
183
|
-
console.log('');
|
|
184
|
-
|
|
185
|
-
if (fs.existsSync(configPath)) {
|
|
186
|
-
info(`Config file found at: ${configPath}`);
|
|
187
|
-
const autoAdd = await askYN(' Auto-add to config?');
|
|
188
|
-
if (autoAdd) {
|
|
189
|
-
try {
|
|
190
|
-
let config = {};
|
|
191
|
-
try { config = JSON.parse(fs.readFileSync(configPath, 'utf8')); } catch (_) {}
|
|
192
|
-
if (!config.mcpServers) config.mcpServers = {};
|
|
193
|
-
config.mcpServers.slipstream = {
|
|
194
|
-
command: 'node',
|
|
195
|
-
args: [mcpScript.replace(/\\/g, '/'), '--mcp'],
|
|
196
|
-
env: { VEKTOR_LICENCE_KEY: process.env.VEKTOR_LICENCE_KEY || '' },
|
|
197
|
-
};
|
|
198
|
-
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
199
|
-
ok('Added to claude_desktop_config.json — restart Claude Desktop');
|
|
200
|
-
} catch (e) {
|
|
201
|
-
warn('Could not auto-add: ' + e.message);
|
|
202
|
-
info('Add manually using the JSON above');
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
} else {
|
|
206
|
-
info(`Config not found at expected path — add manually`);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
// Mistral
|
|
211
|
-
const setupMistral = await askYN(' Mistral / Le Chat integration?');
|
|
212
|
-
if (setupMistral) {
|
|
213
|
-
const mistralSetup = path.join(__dirname, 'mistral', 'mistral-setup.js');
|
|
214
|
-
if (fs.existsSync(mistralSetup)) {
|
|
215
|
-
info('Run: node ' + mistralSetup);
|
|
216
|
-
ok('Mistral bridge is included in the package');
|
|
217
|
-
} else {
|
|
218
|
-
warn('Mistral setup script not found in package');
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
// Playwright / Cloak
|
|
223
|
-
const setupCloak = await askYN(' Cloak browser tools (cloak_fetch, cloak_render)?');
|
|
224
|
-
if (setupCloak) {
|
|
225
|
-
try {
|
|
226
|
-
require('playwright');
|
|
227
|
-
ok('Playwright already installed');
|
|
228
|
-
} catch (_) {
|
|
229
|
-
info('Installing Playwright...');
|
|
230
|
-
try {
|
|
231
|
-
execSync('npm install playwright', { stdio: 'inherit' });
|
|
232
|
-
execSync('npx playwright install chromium', { stdio: 'inherit' });
|
|
233
|
-
ok('Playwright installed — cloak_fetch and cloak_render are ready');
|
|
234
|
-
} catch (e) {
|
|
235
|
-
warn('Playwright install failed: ' + e.message);
|
|
236
|
-
info('Try manually: npm install playwright && npx playwright install chromium');
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
// ── Step 5: Done ─────────────────────────────────────────────────────────────
|
|
242
|
-
step(5, TOTAL, 'Setup Complete');
|
|
243
|
-
|
|
244
|
-
console.log('');
|
|
245
|
-
console.log(green(' VEKTOR Slipstream is ready.\n'));
|
|
246
|
-
console.log(' Quick start:\n');
|
|
247
|
-
console.log(dim(' const { createMemory } = require(\'vektor-slipstream\');'));
|
|
248
|
-
console.log(dim(' const memory = await createMemory({ agentId: \'my-agent\' });'));
|
|
249
|
-
console.log(dim(' await memory.remember(\'User prefers TypeScript\');'));
|
|
250
|
-
console.log(dim(' const ctx = await memory.recall(\'coding preferences\');'));
|
|
251
|
-
console.log('');
|
|
252
|
-
console.log(' Commands:');
|
|
253
|
-
console.log(` ${cyan('npx vektor status')} — check system health`);
|
|
254
|
-
console.log(` ${cyan('npx vektor test')} — run memory test`);
|
|
255
|
-
console.log(` ${cyan('npx vektor mcp')} — start Claude MCP server`);
|
|
256
|
-
console.log(` ${cyan('npx vektor help')} — all commands`);
|
|
257
|
-
console.log('');
|
|
258
|
-
console.log(dim(' Docs: https://vektormemory.com/docs'));
|
|
259
|
-
console.log(dim(' Support: hello@vektormemory.com'));
|
|
260
|
-
console.log('');
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
main().catch(e => {
|
|
264
|
-
console.error(red('\n Setup error: ') + e.message);
|
|
265
|
-
process.exit(1);
|
|
266
|
-
});
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/**
|
|
4
|
+
* vektor-setup.js — VEKTOR Slipstream First-Run Wizard
|
|
5
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
6
|
+
* Guides the user through:
|
|
7
|
+
* 1. Licence activation
|
|
8
|
+
* 2. Hardware detection
|
|
9
|
+
* 3. Memory engine test
|
|
10
|
+
* 4. Integration setup (Claude MCP, LangChain, OpenAI, Mistral)
|
|
11
|
+
* 5. Optional Playwright install for Cloak
|
|
12
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
const readline = require('readline');
|
|
16
|
+
const { execSync, spawn } = require('child_process');
|
|
17
|
+
const path = require('path');
|
|
18
|
+
const os = require('os');
|
|
19
|
+
const fs = require('fs');
|
|
20
|
+
|
|
21
|
+
const PKG = require('./package.json');
|
|
22
|
+
|
|
23
|
+
// ── Colours ───────────────────────────────────────────────────────────────────
|
|
24
|
+
const C = {
|
|
25
|
+
reset: '\x1b[0m', cyan: '\x1b[36m', green: '\x1b[32m',
|
|
26
|
+
yellow: '\x1b[33m', red: '\x1b[31m', dim: '\x1b[2m', bold: '\x1b[1m',
|
|
27
|
+
};
|
|
28
|
+
const cyan = s => C.cyan + s + C.reset;
|
|
29
|
+
const green = s => C.green + s + C.reset;
|
|
30
|
+
const yellow = s => C.yellow + s + C.reset;
|
|
31
|
+
const red = s => C.red + s + C.reset;
|
|
32
|
+
const dim = s => C.dim + s + C.reset;
|
|
33
|
+
const bold = s => C.bold + s + C.reset;
|
|
34
|
+
|
|
35
|
+
function ask(question) {
|
|
36
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
37
|
+
return new Promise(resolve => rl.question(question, ans => { rl.close(); resolve(ans.trim()); }));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function askYN(question) {
|
|
41
|
+
return ask(question + ' [y/n] › ').then(a => a.toLowerCase().startsWith('y'));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function step(n, total, label) {
|
|
45
|
+
console.log(`\n${cyan(`[${n}/${total}]`)} ${bold(label)}`);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function ok(msg) { console.log(green(' ✓ ') + msg); }
|
|
49
|
+
function warn(msg) { console.log(yellow(' ⚠ ') + msg); }
|
|
50
|
+
function info(msg) { console.log(dim(' → ') + msg); }
|
|
51
|
+
function fail(msg) { console.log(red(' ✗ ') + msg); }
|
|
52
|
+
|
|
53
|
+
// ── Main wizard ───────────────────────────────────────────────────────────────
|
|
54
|
+
|
|
55
|
+
async function main() {
|
|
56
|
+
console.log('');
|
|
57
|
+
console.log(cyan(' ╔══════════════════════════════════════════════════════╗'));
|
|
58
|
+
console.log(cyan(' ║') + bold(' VEKTOR SLIPSTREAM — SETUP WIZARD ') + cyan('║'));
|
|
59
|
+
console.log(cyan(' ╚══════════════════════════════════════════════════════╝'));
|
|
60
|
+
console.log(dim(` v${PKG.version} · vektormemory.com\n`));
|
|
61
|
+
console.log(' Welcome. This wizard will get VEKTOR running in under 5 minutes.');
|
|
62
|
+
console.log(dim(' Press Ctrl+C at any time to exit.\n'));
|
|
63
|
+
|
|
64
|
+
const TOTAL = 5;
|
|
65
|
+
|
|
66
|
+
// ── Step 1: Licence ─────────────────────────────────────────────────────────
|
|
67
|
+
step(1, TOTAL, 'Licence Activation');
|
|
68
|
+
|
|
69
|
+
let licenceKey = process.env.VEKTOR_LICENCE_KEY;
|
|
70
|
+
|
|
71
|
+
if (licenceKey) {
|
|
72
|
+
ok(`VEKTOR_LICENCE_KEY is set in environment`);
|
|
73
|
+
} else {
|
|
74
|
+
// Check cache
|
|
75
|
+
const cacheFile = path.join(os.homedir(), '.vektor', 'licence.json');
|
|
76
|
+
if (fs.existsSync(cacheFile)) {
|
|
77
|
+
ok('Licence cache found — already activated on this machine');
|
|
78
|
+
} else {
|
|
79
|
+
console.log('');
|
|
80
|
+
console.log(' Paste your licence key from your Polar purchase email.');
|
|
81
|
+
console.log(dim(' Purchase at: https://vektormemory.com/product#pricing\n'));
|
|
82
|
+
|
|
83
|
+
try {
|
|
84
|
+
const { resolveAndValidateLicence } = require('./vektor-licence-prompt');
|
|
85
|
+
const { validateLicence } = require('./vektor-licence');
|
|
86
|
+
await resolveAndValidateLicence(validateLicence);
|
|
87
|
+
ok('Licence activated and cached');
|
|
88
|
+
} catch (e) {
|
|
89
|
+
fail('Licence activation failed: ' + e.message);
|
|
90
|
+
console.log(dim('\n You can retry with: npx vektor activate'));
|
|
91
|
+
process.exit(1);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// ── Step 2: Hardware detection ───────────────────────────────────────────────
|
|
97
|
+
step(2, TOTAL, 'Hardware Detection');
|
|
98
|
+
|
|
99
|
+
const platform = os.platform();
|
|
100
|
+
const arch = os.arch();
|
|
101
|
+
info(`Platform: ${platform} / ${arch}`);
|
|
102
|
+
|
|
103
|
+
let accelerator = 'CPU';
|
|
104
|
+
if (platform === 'darwin' && arch === 'arm64') {
|
|
105
|
+
accelerator = 'Apple Silicon (CoreML)';
|
|
106
|
+
ok('Apple Silicon detected — CoreML acceleration available');
|
|
107
|
+
} else {
|
|
108
|
+
// Check for CUDA
|
|
109
|
+
try {
|
|
110
|
+
execSync('nvidia-smi', { stdio: 'ignore' });
|
|
111
|
+
accelerator = 'NVIDIA CUDA';
|
|
112
|
+
ok('NVIDIA GPU detected — CUDA acceleration available');
|
|
113
|
+
} catch {
|
|
114
|
+
ok(`CPU mode — embeddings will use hash-projection (<1ms) until @xenova/transformers loads`);
|
|
115
|
+
info('For full semantic embeddings: npm install @xenova/transformers');
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// ── Step 3: Memory test ──────────────────────────────────────────────────────
|
|
120
|
+
step(3, TOTAL, 'Memory Engine Test');
|
|
121
|
+
|
|
122
|
+
try {
|
|
123
|
+
const { createMemory } = require('./slipstream-core');
|
|
124
|
+
info('Booting memory engine...');
|
|
125
|
+
|
|
126
|
+
const memory = await createMemory({
|
|
127
|
+
agentId: 'setup-test',
|
|
128
|
+
dbPath: './vektor-setup-test.db',
|
|
129
|
+
silent: true,
|
|
130
|
+
licenceKey: process.env.VEKTOR_LICENCE_KEY,
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
ok('Memory engine booted');
|
|
134
|
+
|
|
135
|
+
const { id } = await memory.remember('VEKTOR setup test — system is working');
|
|
136
|
+
ok(`Memory store works (id: ${id})`);
|
|
137
|
+
|
|
138
|
+
const results = await memory.recall('setup test working', 3);
|
|
139
|
+
ok(`Memory recall works (${results.length} result${results.length === 1 ? '' : 's'})`);
|
|
140
|
+
|
|
141
|
+
try { fs.unlinkSync('./vektor-setup-test.db'); } catch (_) {}
|
|
142
|
+
ok('Test complete — memory engine is healthy');
|
|
143
|
+
|
|
144
|
+
} catch (e) {
|
|
145
|
+
fail('Memory engine error: ' + e.message);
|
|
146
|
+
if (e.message.includes('better-sqlite3')) {
|
|
147
|
+
warn('SQLite binary mismatch — run: npm rebuild better-sqlite3');
|
|
148
|
+
}
|
|
149
|
+
process.exit(1);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// ── Step 4: Integrations ─────────────────────────────────────────────────────
|
|
153
|
+
step(4, TOTAL, 'Integration Setup');
|
|
154
|
+
|
|
155
|
+
console.log('');
|
|
156
|
+
console.log(' Which integrations do you want to set up?');
|
|
157
|
+
console.log(dim(' (You can set these up later with: npx vektor help)\n'));
|
|
158
|
+
|
|
159
|
+
// Claude MCP
|
|
160
|
+
const setupMcp = await askYN(' Claude Desktop MCP server?');
|
|
161
|
+
if (setupMcp) {
|
|
162
|
+
const mcpScript = path.join(__dirname, 'examples', 'example-claude-mcp.js');
|
|
163
|
+
const configPath = path.join(os.homedir(),
|
|
164
|
+
process.platform === 'win32' ? 'AppData/Roaming/Claude/claude_desktop_config.json' :
|
|
165
|
+
process.platform === 'darwin' ? 'Library/Application Support/Claude/claude_desktop_config.json' :
|
|
166
|
+
'.config/Claude/claude_desktop_config.json'
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
console.log('');
|
|
170
|
+
info('Add this to your claude_desktop_config.json:');
|
|
171
|
+
console.log('');
|
|
172
|
+
console.log(cyan(' {'));
|
|
173
|
+
console.log(cyan(' "mcpServers": {'));
|
|
174
|
+
console.log(cyan(' "slipstream": {'));
|
|
175
|
+
console.log(cyan(' "command": "node",'));
|
|
176
|
+
console.log(cyan(` "args": ["${mcpScript.replace(/\\/g, '/')}", "--mcp"],`));
|
|
177
|
+
console.log(cyan(' "env": {'));
|
|
178
|
+
console.log(cyan(` "VEKTOR_LICENCE_KEY": "${process.env.VEKTOR_LICENCE_KEY || 'YOUR-KEY-HERE'}"`));
|
|
179
|
+
console.log(cyan(' }'));
|
|
180
|
+
console.log(cyan(' }'));
|
|
181
|
+
console.log(cyan(' }'));
|
|
182
|
+
console.log(cyan(' }'));
|
|
183
|
+
console.log('');
|
|
184
|
+
|
|
185
|
+
if (fs.existsSync(configPath)) {
|
|
186
|
+
info(`Config file found at: ${configPath}`);
|
|
187
|
+
const autoAdd = await askYN(' Auto-add to config?');
|
|
188
|
+
if (autoAdd) {
|
|
189
|
+
try {
|
|
190
|
+
let config = {};
|
|
191
|
+
try { config = JSON.parse(fs.readFileSync(configPath, 'utf8')); } catch (_) {}
|
|
192
|
+
if (!config.mcpServers) config.mcpServers = {};
|
|
193
|
+
config.mcpServers.slipstream = {
|
|
194
|
+
command: 'node',
|
|
195
|
+
args: [mcpScript.replace(/\\/g, '/'), '--mcp'],
|
|
196
|
+
env: { VEKTOR_LICENCE_KEY: process.env.VEKTOR_LICENCE_KEY || '' },
|
|
197
|
+
};
|
|
198
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
199
|
+
ok('Added to claude_desktop_config.json — restart Claude Desktop');
|
|
200
|
+
} catch (e) {
|
|
201
|
+
warn('Could not auto-add: ' + e.message);
|
|
202
|
+
info('Add manually using the JSON above');
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
} else {
|
|
206
|
+
info(`Config not found at expected path — add manually`);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// Mistral
|
|
211
|
+
const setupMistral = await askYN(' Mistral / Le Chat integration?');
|
|
212
|
+
if (setupMistral) {
|
|
213
|
+
const mistralSetup = path.join(__dirname, 'mistral', 'mistral-setup.js');
|
|
214
|
+
if (fs.existsSync(mistralSetup)) {
|
|
215
|
+
info('Run: node ' + mistralSetup);
|
|
216
|
+
ok('Mistral bridge is included in the package');
|
|
217
|
+
} else {
|
|
218
|
+
warn('Mistral setup script not found in package');
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// Playwright / Cloak
|
|
223
|
+
const setupCloak = await askYN(' Cloak browser tools (cloak_fetch, cloak_render)?');
|
|
224
|
+
if (setupCloak) {
|
|
225
|
+
try {
|
|
226
|
+
require('playwright');
|
|
227
|
+
ok('Playwright already installed');
|
|
228
|
+
} catch (_) {
|
|
229
|
+
info('Installing Playwright...');
|
|
230
|
+
try {
|
|
231
|
+
execSync('npm install playwright', { stdio: 'inherit' });
|
|
232
|
+
execSync('npx playwright install chromium', { stdio: 'inherit' });
|
|
233
|
+
ok('Playwright installed — cloak_fetch and cloak_render are ready');
|
|
234
|
+
} catch (e) {
|
|
235
|
+
warn('Playwright install failed: ' + e.message);
|
|
236
|
+
info('Try manually: npm install playwright && npx playwright install chromium');
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// ── Step 5: Done ─────────────────────────────────────────────────────────────
|
|
242
|
+
step(5, TOTAL, 'Setup Complete');
|
|
243
|
+
|
|
244
|
+
console.log('');
|
|
245
|
+
console.log(green(' VEKTOR Slipstream is ready.\n'));
|
|
246
|
+
console.log(' Quick start:\n');
|
|
247
|
+
console.log(dim(' const { createMemory } = require(\'vektor-slipstream\');'));
|
|
248
|
+
console.log(dim(' const memory = await createMemory({ agentId: \'my-agent\' });'));
|
|
249
|
+
console.log(dim(' await memory.remember(\'User prefers TypeScript\');'));
|
|
250
|
+
console.log(dim(' const ctx = await memory.recall(\'coding preferences\');'));
|
|
251
|
+
console.log('');
|
|
252
|
+
console.log(' Commands:');
|
|
253
|
+
console.log(` ${cyan('npx vektor status')} — check system health`);
|
|
254
|
+
console.log(` ${cyan('npx vektor test')} — run memory test`);
|
|
255
|
+
console.log(` ${cyan('npx vektor mcp')} — start Claude MCP server`);
|
|
256
|
+
console.log(` ${cyan('npx vektor help')} — all commands`);
|
|
257
|
+
console.log('');
|
|
258
|
+
console.log(dim(' Docs: https://vektormemory.com/docs'));
|
|
259
|
+
console.log(dim(' Support: hello@vektormemory.com'));
|
|
260
|
+
console.log('');
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
main().catch(e => {
|
|
264
|
+
console.error(red('\n Setup error: ') + e.message);
|
|
265
|
+
process.exit(1);
|
|
266
|
+
});
|