#!/usr/bin/env npx tsx
import { fileURLToPath as __fileURLToPath } from 'url';
import { dirname as __pathDirname } from 'path';
const __filename = __fileURLToPath(import.meta.url);
const __dirname = __pathDirname(__filename);
import "dotenv/config";
import { SwarmTUI } from "../src/features/tui/swarm-monitor.js";
import { logger } from "../src/core/monitoring/logger.js";
async function validateTUIShortcuts() {
  try {
    console.log("\u{1F9EA} Validating TUI Keyboard Shortcuts...");
    const tui = new SwarmTUI();
    await tui.initialize();
    const screen = tui.screen;
    if (!screen) {
      throw new Error("Screen not initialized");
    }
    const keyHandlers = screen._events.key || [];
    console.log("\u{1F4CB} Validation Results:");
    console.log(`\u2705 Screen initialized: ${screen ? "Yes" : "No"}`);
    console.log(`\u2705 Key handlers registered: ${keyHandlers.length > 0 ? "Yes" : "No"}`);
    console.log("\n\u{1F50D} Testing Help Function:");
    try {
      tui.showHelp();
      console.log("\u2705 Help function works");
    } catch (error) {
      console.log("\u274C Help function failed:", error.message);
    }
    console.log("\n\u{1F50D} Testing Detect Function:");
    try {
      await tui.showDetectedSwarms();
      console.log("\u2705 Detect function works");
    } catch (error) {
      console.log("\u274C Detect function failed:", error.message);
    }
    console.log("\n\u{1F50D} Testing Refresh Function:");
    try {
      await tui.refreshData();
      console.log("\u2705 Refresh function works");
    } catch (error) {
      console.log("\u274C Refresh function failed:", error.message);
    }
    console.log("\n\u{1F50D} Testing Clear Logs Function:");
    try {
      tui.clearLogs();
      console.log("\u2705 Clear logs function works");
    } catch (error) {
      console.log("\u274C Clear logs function failed:", error.message);
    }
    tui.cleanup();
    console.log("\n\u2705 All TUI shortcut validations passed!");
    console.log("\u{1F4A1} Run scripts/test-tui-shortcuts.ts for interactive testing");
  } catch (error) {
    logger.error("TUI shortcuts validation failed", error);
    console.error("\u274C Validation failed:", error.message);
    process.exit(1);
  }
}
validateTUIShortcuts();
//# sourceMappingURL=validate-tui-shortcuts.js.map
