fix: use minimal CLI for conversation commands only
- Created bin/brainy-minimal.js with only conversation commands - Fixes 'brainyData.js does not export Brainy' error - Removed deprecated boolean package warning with override - Full CLI will be restored in 3.20.0 This is a temporary fix to ensure conversation setup/remove work while we refactor the complete CLI system.
This commit is contained in:
parent
d2ea0de1f0
commit
b26bb1646f
4 changed files with 89 additions and 7 deletions
82
bin/brainy-minimal.js
Executable file
82
bin/brainy-minimal.js
Executable file
|
|
@ -0,0 +1,82 @@
|
||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Brainy CLI - Minimal Version (Conversation Commands Only)
|
||||||
|
*
|
||||||
|
* This is a temporary minimal CLI that only includes working conversation commands
|
||||||
|
* Full CLI will be restored in version 3.20.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { Command } from 'commander'
|
||||||
|
import { readFileSync } from 'fs'
|
||||||
|
import { dirname, join } from 'path'
|
||||||
|
import { fileURLToPath } from 'url'
|
||||||
|
|
||||||
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
||||||
|
const packageJson = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf8'))
|
||||||
|
|
||||||
|
const program = new Command()
|
||||||
|
|
||||||
|
program
|
||||||
|
.name('brainy')
|
||||||
|
.description('🧠 Brainy - Infinite Agent Memory')
|
||||||
|
.version(packageJson.version)
|
||||||
|
|
||||||
|
// Dynamically load conversation command
|
||||||
|
const conversationCommand = await import('../dist/cli/commands/conversation.js').then(m => m.default)
|
||||||
|
|
||||||
|
program
|
||||||
|
.command('conversation')
|
||||||
|
.alias('conv')
|
||||||
|
.description('💬 Infinite agent memory and context management')
|
||||||
|
.addCommand(
|
||||||
|
new Command('setup')
|
||||||
|
.description('Set up MCP server for Claude Code integration')
|
||||||
|
.action(async () => {
|
||||||
|
await conversationCommand.handler({ action: 'setup', _: [] })
|
||||||
|
})
|
||||||
|
)
|
||||||
|
.addCommand(
|
||||||
|
new Command('remove')
|
||||||
|
.description('Remove MCP server and clean up')
|
||||||
|
.action(async () => {
|
||||||
|
await conversationCommand.handler({ action: 'remove', _: [] })
|
||||||
|
})
|
||||||
|
)
|
||||||
|
.addCommand(
|
||||||
|
new Command('search')
|
||||||
|
.description('Search messages across conversations')
|
||||||
|
.requiredOption('-q, --query <query>', 'Search query')
|
||||||
|
.option('-c, --conversation-id <id>', 'Filter by conversation')
|
||||||
|
.option('-r, --role <role>', 'Filter by role')
|
||||||
|
.option('-l, --limit <number>', 'Maximum results', '10')
|
||||||
|
.action(async (options) => {
|
||||||
|
await conversationCommand.handler({ action: 'search', ...options, _: [] })
|
||||||
|
})
|
||||||
|
)
|
||||||
|
.addCommand(
|
||||||
|
new Command('context')
|
||||||
|
.description('Get relevant context for a query')
|
||||||
|
.requiredOption('-q, --query <query>', 'Context query')
|
||||||
|
.option('-l, --limit <number>', 'Maximum messages', '10')
|
||||||
|
.action(async (options) => {
|
||||||
|
await conversationCommand.handler({ action: 'context', ...options, _: [] })
|
||||||
|
})
|
||||||
|
)
|
||||||
|
.addCommand(
|
||||||
|
new Command('thread')
|
||||||
|
.description('Get full conversation thread')
|
||||||
|
.requiredOption('-c, --conversation-id <id>', 'Conversation ID')
|
||||||
|
.action(async (options) => {
|
||||||
|
await conversationCommand.handler({ action: 'thread', ...options, _: [] })
|
||||||
|
})
|
||||||
|
)
|
||||||
|
.addCommand(
|
||||||
|
new Command('stats')
|
||||||
|
.description('Show conversation statistics')
|
||||||
|
.action(async () => {
|
||||||
|
await conversationCommand.handler({ action: 'stats', _: [] })
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
program.parse(process.argv)
|
||||||
6
package-lock.json
generated
6
package-lock.json
generated
|
|
@ -1840,9 +1840,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@huggingface/transformers": {
|
"node_modules/@huggingface/transformers": {
|
||||||
"version": "3.7.2",
|
"version": "3.7.4",
|
||||||
"resolved": "https://registry.npmjs.org/@huggingface/transformers/-/transformers-3.7.2.tgz",
|
"resolved": "https://registry.npmjs.org/@huggingface/transformers/-/transformers-3.7.4.tgz",
|
||||||
"integrity": "sha512-6SOxo6XziupnQ5Vs5vbbs74CNB6ViHLHGQJjY6zj88JeiDtJ2d/ADKxaay688Sf2KcjtdF3dyBL11C5pJS2NxQ==",
|
"integrity": "sha512-nMnLM26EX6SlGoIvljsLCbAWwltGJZEaTe/7ZtuVQP4S9Zo0swJ5zZAdZw9c8xGeEZ5Rfs23FSflsV64o4X2MQ==",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@huggingface/jinja": "^0.5.1",
|
"@huggingface/jinja": "^0.5.1",
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"bin": {
|
"bin": {
|
||||||
"brainy": "bin/brainy.js"
|
"brainy": "bin/brainy-minimal.js"
|
||||||
},
|
},
|
||||||
"sideEffects": [
|
"sideEffects": [
|
||||||
"./dist/setup.js",
|
"./dist/setup.js",
|
||||||
|
|
@ -128,6 +128,9 @@
|
||||||
"README.md",
|
"README.md",
|
||||||
"CHANGELOG.md"
|
"CHANGELOG.md"
|
||||||
],
|
],
|
||||||
|
"overrides": {
|
||||||
|
"boolean": "3.2.0"
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-commonjs": "^28.0.6",
|
"@rollup/plugin-commonjs": "^28.0.6",
|
||||||
"@rollup/plugin-node-resolve": "^16.0.1",
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,6 @@ import { Command } from 'commander'
|
||||||
import chalk from 'chalk'
|
import chalk from 'chalk'
|
||||||
import ora from 'ora'
|
import ora from 'ora'
|
||||||
import { Brainy } from '../brainy.js'
|
import { Brainy } from '../brainy.js'
|
||||||
import { neuralCommands } from './commands/neural.js'
|
|
||||||
import { coreCommands } from './commands/core.js'
|
|
||||||
import { utilityCommands } from './commands/utility.js'
|
|
||||||
import conversationCommand from './commands/conversation.js'
|
import conversationCommand from './commands/conversation.js'
|
||||||
import { readFileSync } from 'fs'
|
import { readFileSync } from 'fs'
|
||||||
import { fileURLToPath } from 'url'
|
import { fileURLToPath } from 'url'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue