behemoth-cli
Version:
🌍 BEHEMOTH CLIv3.760.4 - Level 50+ POST-SINGULARITY Intelligence Trading AI
70 lines • 2.53 kB
JavaScript
import { helpCommand } from './definitions/help.js';
import { loginCommand } from './definitions/login.js';
import { modelCommand } from './definitions/model.js';
import { clearCommand } from './definitions/clear.js';
import { reasoningCommand } from './definitions/reasoning.js';
// BEHEMOTH Crypto Trading Commands
import { analyzeCommand } from './definitions/analyze.js';
import { cosmicCommand } from './definitions/cosmic.js';
import { technicalCommand } from './definitions/technical.js';
import { riskCommand } from './definitions/risk.js';
import { tradeCommand } from './definitions/trade.js';
import { multiAgentCommand } from './definitions/multi-agent.js';
import { multiCommand } from './definitions/multi.js';
import { logoutCommand } from './definitions/logout.js';
import { keysCommand } from './definitions/keys.js';
import { chartCommand } from './definitions/chart-simple.js';
// N8N Workflow Commands
import { n8nCommand } from './definitions/n8n.js';
// User Guide Commands
import { howtoCommand } from './definitions/howto.js';
const availableCommands = [
// Core system commands
helpCommand,
loginCommand,
logoutCommand,
keysCommand,
modelCommand,
clearCommand,
reasoningCommand,
// BEHEMOTH crypto trading commands
analyzeCommand,
cosmicCommand,
technicalCommand,
riskCommand,
tradeCommand,
multiAgentCommand,
multiCommand,
chartCommand,
// N8N workflow commands
n8nCommand,
// User guide commands
howtoCommand,
];
export function getAvailableCommands() {
return [...availableCommands];
}
export function getCommandNames() {
return getAvailableCommands().map(cmd => cmd.command);
}
export function handleSlashCommand(command, context) {
// Extract the command part, everything up to the first space or end of string
const fullCommand = command.slice(1);
const spaceIndex = fullCommand.indexOf(' ');
const cmd = spaceIndex > -1
? fullCommand.substring(0, spaceIndex).toLowerCase()
: fullCommand.toLowerCase();
const args = spaceIndex > -1 ? fullCommand.substring(spaceIndex + 1).trim() : '';
// Parse arguments into an array
context.parsedArgs = args ? args.split(' ') : [];
const commandDef = getAvailableCommands().find(c => c.command === cmd);
// Add user message for the command
context.addMessage({
role: 'user',
content: command,
});
if (commandDef) {
commandDef.handler(context);
}
}
//# sourceMappingURL=index.js.map