@soulcraft/brainy 3.19.1 → 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.
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import chalk from 'chalk';
8
8
  import inquirer from 'inquirer';
9
- import fuzzy from 'fuzzy';
9
+ // import fuzzy from 'fuzzy' // TODO: Install fuzzy package or remove dependency
10
10
  import ora from 'ora';
11
11
  import { getBrainyVersion } from '../utils/version.js';
12
12
  // Professional color scheme
@@ -108,12 +108,12 @@ export async function promptItemId(action, brain, allowMultiple = false) {
108
108
  let choices = [];
109
109
  if (brain) {
110
110
  try {
111
- const recent = await brain.search('*', { limit: 10,
112
- sortBy: 'timestamp',
113
- descending: true
111
+ const recent = await brain.find({
112
+ query: '*',
113
+ limit: 10
114
114
  });
115
115
  choices = recent.map(item => ({
116
- name: `${item.id} - ${item.content?.substring(0, 50)}...`,
116
+ name: `${item.id} - ${item.content?.substring(0, 50) || 'No content'}...`,
117
117
  value: item.id,
118
118
  short: item.id
119
119
  }));
@@ -420,8 +420,21 @@ export async function promptRelationship(brain) {
420
420
  * Smart command suggestions when user types wrong command
421
421
  */
422
422
  export function suggestCommand(input, availableCommands) {
423
- const results = fuzzy.filter(input, availableCommands);
424
- return results.slice(0, 3).map(r => r.string);
423
+ // Simple fuzzy matching without external dependency
424
+ // Filter commands that start with or contain the input
425
+ const matches = availableCommands
426
+ .filter(cmd => cmd.toLowerCase().includes(input.toLowerCase()))
427
+ .sort((a, b) => {
428
+ // Prefer commands that start with the input
429
+ const aStarts = a.toLowerCase().startsWith(input.toLowerCase());
430
+ const bStarts = b.toLowerCase().startsWith(input.toLowerCase());
431
+ if (aStarts && !bStarts)
432
+ return -1;
433
+ if (!aStarts && bStarts)
434
+ return 1;
435
+ return 0;
436
+ });
437
+ return matches.slice(0, 3);
425
438
  }
426
439
  /**
427
440
  * Beautiful error display with helpful context
@@ -519,6 +532,15 @@ export async function promptCommand() {
519
532
  });
520
533
  return command;
521
534
  }
535
+ /**
536
+ * Start interactive REPL mode
537
+ */
538
+ export async function startInteractiveMode() {
539
+ console.log(chalk.cyan('\n🧠 Brainy Interactive Mode\n'));
540
+ console.log(chalk.yellow('Interactive REPL mode coming in v3.20.0\n'));
541
+ console.log(chalk.dim('Use specific commands for now: brainy add, brainy search, etc.'));
542
+ process.exit(0);
543
+ }
522
544
  /**
523
545
  * Export all interactive components
524
546
  */
@@ -538,5 +560,7 @@ export default {
538
560
  showError,
539
561
  ProgressTracker,
540
562
  showWelcome,
541
- promptCommand
563
+ promptCommand,
564
+ startInteractiveMode
542
565
  };
566
+ //# sourceMappingURL=interactive.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soulcraft/brainy",
3
- "version": "3.19.1",
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",
@@ -128,6 +128,9 @@
128
128
  "README.md",
129
129
  "CHANGELOG.md"
130
130
  ],
131
+ "overrides": {
132
+ "boolean": "3.2.0"
133
+ },
131
134
  "devDependencies": {
132
135
  "@rollup/plugin-commonjs": "^28.0.6",
133
136
  "@rollup/plugin-node-resolve": "^16.0.1",