codecrucible-synth
Version:
Production-Ready AI Development Platform with Multi-Voice Synthesis, Smithery MCP Integration, Enterprise Security, and Zero-Timeout Reliability
226 lines • 5.67 kB
TypeScript
/**
* Refactored CLI - Main Interface
* Reduced from 2334 lines to ~400 lines by extracting modules
*/
import { REPLInterface } from './types.js';
import { UnifiedModelClient } from '../refactor/unified-model-client.js';
import { VoiceArchetypeSystem } from '../voices/voice-archetype-system.js';
import { MCPServerManager } from '../mcp-servers/mcp-server-manager.js';
import { AppConfig } from '../config/config-manager.js';
import { CLIOptions, CLIContext } from './cli/index.js';
export type { CLIContext, CLIOptions };
export declare class CLI implements REPLInterface {
private context;
private initialized;
private workingDirectory;
private contextAwareCLI;
private autoConfigurator;
private repl?;
private commands;
private authMiddleware;
private rbacSystem;
private secretsManager;
private auditLogger;
private dynamicModelRouter;
private toolOrchestrator;
private static globalListenersRegistered;
private abortController;
private activeOperations;
private isShuttingDown;
constructor(modelClient: UnifiedModelClient, voiceSystem: VoiceArchetypeSystem, mcpManager: MCPServerManager, config: AppConfig);
/**
* Build runtime context for system prompt generation
*/
private buildRuntimeContext;
/**
* Build system prompt with enterprise configuration
*/
private buildSystemPrompt;
/**
* Get InteractiveREPL instance, creating it only when needed
*/
private getREPL;
/**
* Register cleanup handlers for graceful shutdown
*/
private registerCleanupHandlers;
/**
* Synchronous cleanup for exit handler
*/
private syncCleanup;
/**
* Main CLI entry point
*/
run(args: string[]): Promise<void>;
/**
* Execute specific commands
*/
private executeCommand;
/**
* Authenticate CLI request
*/
private authenticateRequest;
/**
* Process a text prompt using the voice system
*/
processPrompt(prompt: string, options?: CLIOptions): Promise<string>;
/**
* Execute prompt processing with voice system
*/
/**
* Legacy analysis method (kept for backward compatibility)
*/
/**
* Analyze project structure and metadata
*/
/**
* Analyze code metrics and lines of code
*/
/**
* Analyze dependencies from package.json
*/
/**
* Analyze configuration files
*/
/**
* Analyze test coverage and test files
*/
/**
* Discover project components by analyzing file structure
*/
/**
* Discover architecture components by analyzing imports and exports
*/
/**
* Detect real issues in the codebase
*/
/**
* Assess security configuration
*/
/**
* Analyze performance characteristics
*/
/**
* Generate recommendations based on analysis
*/
private generateRecommendations;
/**
* Count files by extension for analysis
*/
private countFilesByType;
/**
* Analyze the task type from the prompt
*/
/**
* Execute in Auditor mode (LM Studio optimized for fast analysis)
*/
/**
* Execute in Writer mode (Ollama optimized for quality generation)
*/
/**
* Execute in Auto mode (intelligent routing)
*/
/**
* Configure the model client to use the selected model
*/
/**
* Format the response based on execution mode
*/
/**
* Display streaming response using enhanced streaming client
*/
/**
* Start interactive mode
*/
private startInteractiveMode;
/**
* Handle slash commands
*/
private handleSlashCommand;
/**
* Handle file output
*/
private handleFileOutput;
/**
* Initialize the CLI system
*/
initialize(config?: any, workingDirectory?: string): Promise<void>;
/**
* Handle configuration management
*/
private handleConfiguration;
/**
* Clean up resources
*/
destroy(): Promise<void>;
/**
* Handle errors with proper formatting and exit codes
*/
private handleError;
/**
* Track an active operation for graceful shutdown
*/
private trackOperation;
/**
* Untrack a completed operation
*/
private untrackOperation;
checkOllamaStatus(): Promise<boolean>;
getAllAvailableModels(): Promise<any[]>;
updateConfiguration(_newConfig: any): Promise<boolean>;
/**
* Handle role switching via slash commands
*/
private handleRoleSwitch;
/**
* Handle model switching
*/
/**
* Handle model listing
*/
/**
* Handle model reload
*/
/**
* Show slash command help
*/
/**
* Handle Sequential Dual Agent Review
*/
private handleSequentialReview;
/**
* Show system status
*/
showStatus(): Promise<void>;
/**
* List available models
*/
listModels(): void;
/**
* Execute prompt processing (REPLInterface method)
*/
executePromptProcessing(prompt: string, options?: any): Promise<any>;
/**
* Display streaming response
*/
private displayStreamingResponse;
/**
* Show slash command help
*/
private showSlashHelp;
/**
* Handle model switch
*/
private handleModelSwitch;
/**
* Handle model list
*/
private handleModelList;
/**
* Handle model reload
*/
private handleModelReload;
}
export declare const CodeCrucibleCLI: typeof CLI;
export default CLI;
//# sourceMappingURL=cli.d.ts.map