@soulcraft/brainy 3.20.0 → 3.20.1
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.
|
@@ -250,6 +250,8 @@ main()
|
|
|
250
250
|
});
|
|
251
251
|
await brain.init();
|
|
252
252
|
spinner.succeed('Initialized Brainy database');
|
|
253
|
+
// Shutdown Brainy to release resources
|
|
254
|
+
await brain.close();
|
|
253
255
|
// Success!
|
|
254
256
|
console.log(chalk.bold.green('\n✅ Setup complete!\n'));
|
|
255
257
|
console.log(chalk.cyan('📁 Memory storage:'), brainyDir);
|
|
@@ -367,6 +369,7 @@ async function handleSearch(argv) {
|
|
|
367
369
|
spinner.succeed(`Found ${results.length} messages`);
|
|
368
370
|
if (results.length === 0) {
|
|
369
371
|
console.log(chalk.yellow('No messages found'));
|
|
372
|
+
await brain.close();
|
|
370
373
|
return;
|
|
371
374
|
}
|
|
372
375
|
// Display results
|
|
@@ -376,6 +379,7 @@ async function handleSearch(argv) {
|
|
|
376
379
|
console.log(chalk.dim(` Score: ${result.score.toFixed(3)} | Conv: ${result.conversationId}`));
|
|
377
380
|
console.log();
|
|
378
381
|
}
|
|
382
|
+
await brain.close();
|
|
379
383
|
}
|
|
380
384
|
/**
|
|
381
385
|
* Handle context command - Get relevant context
|
|
@@ -398,6 +402,7 @@ async function handleContext(argv) {
|
|
|
398
402
|
spinner.succeed(`Retrieved ${context.messages.length} relevant messages`);
|
|
399
403
|
if (context.messages.length === 0) {
|
|
400
404
|
console.log(chalk.yellow('No relevant context found'));
|
|
405
|
+
await brain.close();
|
|
401
406
|
return;
|
|
402
407
|
}
|
|
403
408
|
// Display context
|
|
@@ -420,6 +425,7 @@ async function handleContext(argv) {
|
|
|
420
425
|
console.log(chalk.dim(` - ${conv.title || conv.id} (${conv.relevance.toFixed(2)})`));
|
|
421
426
|
}
|
|
422
427
|
}
|
|
428
|
+
await brain.close();
|
|
423
429
|
}
|
|
424
430
|
/**
|
|
425
431
|
* Handle thread command - Get conversation thread
|
|
@@ -452,6 +458,7 @@ async function handleThread(argv) {
|
|
|
452
458
|
console.log(chalk.cyan(`${msg.role}:`), msg.content);
|
|
453
459
|
console.log(chalk.dim(` ${new Date(msg.createdAt).toLocaleString()}`));
|
|
454
460
|
}
|
|
461
|
+
await brain.close();
|
|
455
462
|
}
|
|
456
463
|
/**
|
|
457
464
|
* Handle stats command - Show statistics
|
|
@@ -487,6 +494,7 @@ async function handleStats(argv) {
|
|
|
487
494
|
console.log(chalk.dim(` ${phase}: ${count}`));
|
|
488
495
|
}
|
|
489
496
|
}
|
|
497
|
+
await brain.close();
|
|
490
498
|
}
|
|
491
499
|
/**
|
|
492
500
|
* Handle export command - Export conversation
|
|
@@ -505,6 +513,7 @@ async function handleExport(argv) {
|
|
|
505
513
|
const output = argv.output || `conversation_${argv.conversationId}.json`;
|
|
506
514
|
await fs.writeFile(output, JSON.stringify(exported, null, 2), 'utf8');
|
|
507
515
|
spinner.succeed(`Exported to ${output}`);
|
|
516
|
+
await brain.close();
|
|
508
517
|
}
|
|
509
518
|
/**
|
|
510
519
|
* Handle import command - Import conversation
|
|
@@ -523,6 +532,7 @@ async function handleImport(argv) {
|
|
|
523
532
|
const data = JSON.parse(await fs.readFile(inputFile, 'utf8'));
|
|
524
533
|
const conversationId = await conv.importConversation(data);
|
|
525
534
|
spinner.succeed(`Imported as conversation ${conversationId}`);
|
|
535
|
+
await brain.close();
|
|
526
536
|
}
|
|
527
537
|
export default conversationCommand;
|
|
528
538
|
//# sourceMappingURL=conversation.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soulcraft/brainy",
|
|
3
|
-
"version": "3.20.
|
|
3
|
+
"version": "3.20.1",
|
|
4
4
|
"description": "Universal Knowledge Protocol™ - World's first Triple Intelligence database unifying vector, graph, and document search in one API. 31 nouns × 40 verbs for infinite expressiveness.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|