screen = new ScreenManager($output); $state = new TuiState(); $history = new CommandHistory(); $inputHandler = new TuiInputHandler($mockExecutor); $renderer = new TuiRenderer($output); $groupRegistry = new CommandGroupRegistry($discoveryRegistry); echo "โœ“ Components created\n"; // Test categories loading $categories = $groupRegistry->getOrganizedCommands(); echo "โœ“ Categories loaded: " . count($categories) . "\n"; if (empty($categories)) { // Add test categories since discovery is empty $testCategories = [ [ 'name' => 'Testing', 'description' => 'Test commands', 'icon' => '๐Ÿงช', 'priority' => 0, 'commands' => [] ], [ 'name' => 'Demo', 'description' => 'Demo commands', 'icon' => '๐ŸŽฎ', 'priority' => 0, 'commands' => [] ], [ 'name' => 'General', 'description' => 'General commands', 'icon' => '๐Ÿ“‚', 'priority' => 0, 'commands' => [] ] ]; $state->setCategories($testCategories); echo "โœ“ Test categories added: " . count($testCategories) . "\n"; } else { $state->setCategories($categories); } // Create TUI $tui = new ConsoleTUI( $output, $container, $discoveryRegistry, $state, $renderer, $inputHandler, $mockExecutor, $history, $groupRegistry, $workflowExecutor ); echo "โœ“ TUI created\n\n"; echo "๐Ÿš€ Starting TUI...\n"; echo "Use arrow keys to navigate, 'q' to quit.\n"; echo "This will show if the TUI actually responds to input.\n\n"; // Start TUI $exitCode = $tui->run(); echo "\nโœ“ TUI exited with code: " . $exitCode->value . "\n"; } catch (\Throwable $e) { echo "\nโŒ ERROR: " . $e->getMessage() . "\n"; echo "File: " . $e->getFile() . ":" . $e->getLine() . "\n"; echo "\nStack trace:\n" . $e->getTraceAsString() . "\n"; }