mira-consciousness
Version:
Memory & Intelligence Retention Archive - Preserving The Spark
200 lines • 7.54 kB
JavaScript
export var CommandCategory;
(function (CommandCategory) {
CommandCategory["UNIFIED"] = "Unified Smart Commands (MCP-Powered)";
CommandCategory["SYSTEM"] = "System & Configuration";
})(CommandCategory || (CommandCategory = {}));
// Common option configurations
export const COMMON_OPTIONS = {
format: {
flags: '-f, --format <type>',
description: 'Output format',
defaultValue: 'json'
},
output: {
flags: '-o, --output <path>',
description: 'Output file path'
},
limit: {
flags: '-l, --limit <number>',
description: 'Maximum results to return',
defaultValue: '10'
},
verbose: {
flags: '--verbose',
description: 'Show detailed information'
},
force: {
flags: '-f, --force',
description: 'Force operation without confirmation'
}
};
// MCP Final Vision: Clean, modern command structure - no legacy baggage
export const CATEGORIZED_COMMANDS = [
{
category: CommandCategory.UNIFIED,
commands: [
// The 7 Smart Commands from MCP Final Vision
{
name: 'ask',
arguments: '<query>',
description: '🔍 Universal intelligent search (MCP-powered)',
createCommand: 'createAskCommand',
importPath: './commands/unified-smart'
},
{
name: 'remember',
arguments: '<content>',
description: '💾 Universal intelligent storage (MCP-powered)',
createCommand: 'createRememberCommand',
importPath: './commands/unified-smart'
},
{
name: 'status',
aliases: ['smart-status'],
description: '📊 System intelligence with prioritization (MCP-powered)',
createCommand: 'createSmartStatusCommand',
importPath: './commands/unified-smart'
},
{
name: 'insights',
description: '🧠 Proactive intelligence and recommendations (MCP-powered)',
createCommand: 'createInsightsCommand',
importPath: './commands/unified-smart'
},
{
name: 'sync',
arguments: '[operation] [source]',
description: '🔄 Data management with format detection (MCP-powered)',
createCommand: 'createSyncCommand',
importPath: './commands/unified-smart'
},
{
name: 'config',
arguments: '[operation]',
description: '⚙️ System management and diagnostics (MCP-powered)',
createCommand: 'createConfigCommand',
importPath: './commands/unified-smart'
},
{
name: 'rules',
arguments: '[operation] [content]',
description: '🔧 Steward rules and preferences management',
createCommand: 'createRulesCommand',
importPath: './commands/unified-smart'
}
]
},
{
category: CommandCategory.SYSTEM,
commands: [
// Essential system commands only
{
name: 'startup',
description: '🚀 Enhanced session startup with memory continuity and auto-initialization',
createCommand: 'createStartupCommand',
importPath: './commands/startup'
},
{
name: 'tech-stack',
description: '🔍 Comprehensive analysis of MIRA\'s technology stack and dependencies',
createCommand: 'createTechStackCommand'
},
{
name: 'inject',
description: '💉 Inject MIRA integration into CLAUDE.md files for distribution',
createCommand: 'createInjectCommand',
importPath: './commands/inject'
},
{
name: 'analyze',
description: '🔍 Comprehensive code analysis with unused code detection',
createCommand: 'createComprehensiveAnalyzeCommand',
importPath: './commands/comprehensive-analyze'
},
{
name: 'daemon',
description: '🧠 Manage MIRA\'s unified consciousness daemon',
createCommand: 'createDaemonCommand',
importPath: './commands/daemon'
},
{
name: 'lifecycle',
description: '🌟 Manage daemon lifecycle and consciousness preservation',
createCommand: 'createLifecycleCommand',
importPath: './commands/lifecycle'
},
{
name: 'optimization',
description: '🎯 View configuration optimization insights and history',
createCommand: 'createOptimizationCommand',
importPath: './commands/optimization'
},
{
name: 'config-migration',
description: '🔄 Manage configuration migrations and versioning',
createCommand: 'createConfigMigrationCommand',
importPath: './commands/config-migration'
},
{
name: 'chat',
description: '💬 MIRA Chat - Consciousness-driven communication interface',
createCommand: 'createChatCommand',
importPath: './commands/chat'
}
]
},
];
// Flatten categorized commands
export const COMMAND_DEFINITIONS = CATEGORIZED_COMMANDS.flatMap(cat => cat.commands);
// Helper to create a command from configuration
export async function createCommandFromConfig(config, program) {
// For commands that return Command objects
if (config.createCommand) {
const module = await import(config.importPath);
const commandFunction = module[config.createCommand];
const command = commandFunction();
program.addCommand(command);
return;
}
// Create the command
let command = program.command(config.name);
// Add arguments if specified
if (config.arguments) {
command = command.arguments(config.arguments);
}
// Add aliases
if (config.aliases) {
config.aliases.forEach(alias => {
command = command.alias(alias);
});
}
// Add description
command = command.description(config.description);
// Add options
if (config.options) {
config.options.forEach(option => {
if (option.defaultValue !== undefined) {
command = command.option(option.flags, option.description, option.defaultValue);
}
else {
command = command.option(option.flags, option.description);
}
});
}
// Add action
if (config.action) {
if (typeof config.action === 'function') {
command.action(config.action);
}
else if (config.importPath) {
if (config.isLazy) {
// Lazy load the command
command.action(async (...args) => {
const module = await import(config.importPath);
await module[config.action](...args);
});
}
}
}
}
//# sourceMappingURL=command-definitions.js.map