"""Windows capability catalog (incremental rollout)."""

from __future__ import annotations

from Mudabbir.tools.capabilities.schema import CapabilitySpec


WINDOWS_CAPABILITIES: tuple[CapabilitySpec, ...] = (
    # Stage A: high-usage controls
    CapabilitySpec(
        id="system.lock_screen",
        aliases_ar=("قفل الشاشة", "اقفل الشاشة"),
        aliases_en=("lock screen",),
        risk_level="safe",
        executor="desktop",
        stage="A",
    ),
    CapabilitySpec(
        id="system.shutdown",
        aliases_ar=("إيقاف التشغيل", "اطفي الجهاز"),
        aliases_en=("shutdown", "power off"),
        risk_level="destructive",
        executor="powershell",
        stage="A",
    ),
    CapabilitySpec(
        id="system.restart",
        aliases_ar=("إعادة التشغيل",),
        aliases_en=("restart", "reboot"),
        risk_level="destructive",
        executor="powershell",
        stage="A",
    ),
    CapabilitySpec(
        id="system.sleep",
        aliases_ar=("وضع السكون", "سكون"),
        aliases_en=("sleep mode", "sleep"),
        risk_level="elevated",
        executor="powershell",
        stage="A",
    ),
    CapabilitySpec(
        id="audio.volume",
        aliases_ar=("مستوى الصوت", "رفع الصوت", "خفض الصوت", "كتم الصوت"),
        aliases_en=("volume", "mute", "unmute", "increase volume", "decrease volume"),
        risk_level="safe",
        executor="desktop",
        stage="A",
    ),
    CapabilitySpec(
        id="audio.media_controls",
        aliases_ar=("تشغيل", "إيقاف مؤقت", "التالي", "السابق"),
        aliases_en=("play", "pause", "next track", "previous track"),
        risk_level="safe",
        executor="desktop",
        stage="A",
    ),
    CapabilitySpec(
        id="display.brightness",
        aliases_ar=("السطوع", "رفع الإضاءة", "خفض الإضاءة"),
        aliases_en=("brightness",),
        risk_level="safe",
        executor="desktop",
        stage="A",
    ),
    CapabilitySpec(
        id="display.screenshot",
        aliases_ar=("لقطة شاشة", "سكرين شوت"),
        aliases_en=("screenshot", "screen capture"),
        risk_level="safe",
        executor="desktop",
        stage="A",
    ),
    CapabilitySpec(
        id="apps.launch",
        aliases_ar=("افتح", "شغل التطبيق"),
        aliases_en=("open app", "launch app"),
        risk_level="safe",
        executor="desktop",
        stage="A",
    ),
    CapabilitySpec(
        id="apps.close",
        aliases_ar=("اغلق التطبيق", "سكر البرنامج"),
        aliases_en=("close app", "kill process"),
        risk_level="elevated",
        executor="desktop",
        stage="A",
    ),
    CapabilitySpec(
        id="files.search",
        aliases_ar=("ابحث عن ملف",),
        aliases_en=("find file", "search files"),
        risk_level="safe",
        executor="desktop",
        stage="A",
    ),
    CapabilitySpec(
        id="files.manage",
        aliases_ar=("إنشاء مجلد", "حذف ملف", "إعادة تسمية", "ضغط ملف", "فك ضغط"),
        aliases_en=("create folder", "delete file", "rename file", "zip", "unzip"),
        risk_level="elevated",
        executor="desktop",
        stage="A",
    ),
    CapabilitySpec(
        id="network.status",
        aliases_ar=("حالة الشبكة", "الاي بي"),
        aliases_en=("network status", "ip address"),
        risk_level="safe",
        executor="powershell",
        stage="A",
    ),
    CapabilitySpec(
        id="network.wifi_ops",
        aliases_ar=("تشغيل الواي فاي", "إيقاف الواي فاي", "كلمات سر الواي فاي", "اتصل بالشبكة"),
        aliases_en=("wifi on", "wifi off", "wifi passwords", "connect wifi", "disconnect wifi"),
        risk_level="elevated",
        executor="powershell",
        stage="B",
    ),
    CapabilitySpec(
        id="network.sharing_hotspot",
        aliases_ar=("نقطة الاتصال", "مشاركة الملفات", "المجلدات المشتركة"),
        aliases_en=("hotspot", "file sharing", "shared folders"),
        risk_level="elevated",
        executor="powershell",
        stage="B",
    ),
    CapabilitySpec(
        id="network.ping",
        aliases_ar=("اختبار اتصال", "بينق"),
        aliases_en=("ping", "connectivity test"),
        risk_level="safe",
        executor="powershell",
        stage="A",
    ),
    CapabilitySpec(
        id="window.focus",
        aliases_ar=("فعّل النافذة", "ركز النافذة"),
        aliases_en=("focus window", "bring to front"),
        risk_level="safe",
        executor="desktop",
        stage="A",
    ),
    CapabilitySpec(
        id="window.layout",
        aliases_ar=("تصغير", "تكبير", "نصف الشاشة", "عرض المهام"),
        aliases_en=("minimize", "maximize", "split screen", "task view", "show desktop"),
        risk_level="safe",
        executor="desktop",
        stage="A",
    ),
    CapabilitySpec(
        id="input.mouse_keyboard",
        aliases_ar=("حرك الماوس", "انقر", "اضغط زر"),
        aliases_en=("move mouse", "click", "press key", "hotkey"),
        risk_level="safe",
        executor="desktop",
        stage="A",
    ),
    CapabilitySpec(
        id="process.manage",
        aliases_ar=("قائمة العمليات", "إنهاء عملية", "أعلى استهلاك"),
        aliases_en=("list processes", "kill process", "top cpu", "top ram"),
        risk_level="elevated",
        executor="desktop",
        stage="A",
    ),
    CapabilitySpec(
        id="process.control",
        aliases_ar=("تعليق عملية", "استئناف عملية", "العمليات غير المستجيبة"),
        aliases_en=("suspend process", "resume process", "unresponsive processes"),
        risk_level="destructive",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="service.manage",
        aliases_ar=("الخدمات", "تشغيل خدمة", "إيقاف خدمة"),
        aliases_en=("services", "start service", "stop service", "restart service"),
        risk_level="elevated",
        executor="powershell",
        stage="A",
    ),
    CapabilitySpec(
        id="users.manage",
        aliases_ar=("إنشاء مستخدم", "حذف مستخدم", "تغيير كلمة السر"),
        aliases_en=("create user", "delete user", "set user password"),
        risk_level="destructive",
        executor="powershell",
        stage="B",
    ),
    CapabilitySpec(
        id="tasks.schedule",
        aliases_ar=("مهمة مجدولة", "جدولة"),
        aliases_en=("task scheduler", "scheduled task"),
        risk_level="elevated",
        executor="powershell",
        stage="B",
    ),
    CapabilitySpec(
        id="registry.manage",
        aliases_ar=("السجل", "ريجستري"),
        aliases_en=("registry", "regedit"),
        risk_level="destructive",
        executor="powershell",
        stage="C",
    ),
    CapabilitySpec(
        id="disk.maintenance",
        aliases_ar=("فحص القرص", "تنظيف مؤقت", "سمارت"),
        aliases_en=("disk health", "temp cleanup", "smart status", "chkdsk"),
        risk_level="elevated",
        executor="powershell",
        stage="B",
    ),
    CapabilitySpec(
        id="security.firewall",
        aliases_ar=("جدار الحماية", "فتح منفذ", "اغلاق منفذ"),
        aliases_en=("firewall", "block port", "unblock rule"),
        risk_level="destructive",
        executor="powershell",
        stage="C",
    ),
    CapabilitySpec(
        id="security.devices",
        aliases_ar=("تعطيل usb", "تفعيل usb", "تعطيل الكاميرا", "تفعيل الكاميرا"),
        aliases_en=("disable usb", "enable usb", "disable camera", "enable camera"),
        risk_level="destructive",
        executor="powershell",
        stage="C",
    ),
    CapabilitySpec(
        id="web.integration",
        aliases_ar=("فتح رابط", "تحميل ملف", "الطقس"),
        aliases_en=("open url", "download file", "weather"),
        risk_level="safe",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="hardware.info",
        aliases_ar=("معلومات الهاردوير", "المعالج", "الرام", "كرت الشاشة"),
        aliases_en=("hardware info", "cpu info", "ram info", "gpu info"),
        risk_level="safe",
        executor="powershell",
        stage="B",
    ),
    CapabilitySpec(
        id="updates.manage",
        aliases_ar=("التحديثات", "فحص التحديثات", "قائمة التحديثات"),
        aliases_en=("windows updates", "check updates", "list updates"),
        risk_level="elevated",
        executor="powershell",
        stage="B",
    ),
    CapabilitySpec(
        id="ui.customize",
        aliases_ar=("الوضع الداكن", "الوضع الفاتح", "شفافية"),
        aliases_en=("dark mode", "light mode", "transparency", "taskbar autohide"),
        risk_level="elevated",
        executor="powershell",
        stage="B",
    ),
    CapabilitySpec(
        id="ui.desktop_icons_night",
        aliases_ar=("إظهار أيقونات سطح المكتب", "إخفاء أيقونات سطح المكتب", "الوضع الليلي"),
        aliases_en=("show desktop icons", "hide desktop icons", "night light"),
        risk_level="safe",
        executor="powershell",
        stage="B",
    ),
    CapabilitySpec(
        id="automation.misc",
        aliases_ar=("تأخير", "رسالة منبثقة", "نطق النص", "تكرار مفتاح"),
        aliases_en=("delay", "popup", "text to speech", "repeat key"),
        risk_level="safe",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="apps.quick_open",
        aliases_ar=("افتح المفكرة", "افتح الحاسبة", "افتح الرسام"),
        aliases_en=("open notepad", "open calculator", "open paint", "open task manager"),
        risk_level="safe",
        executor="desktop",
        stage="A",
    ),
    CapabilitySpec(
        id="system.identity",
        aliases_ar=("المنطقة الزمنية", "لغة النظام", "موديل الجهاز", "مفتاح الويندوز"),
        aliases_en=("timezone", "system language", "device model", "windows key"),
        risk_level="safe",
        executor="powershell",
        stage="B",
    ),
    CapabilitySpec(
        id="developer.tools",
        aliases_ar=("أدوات المطور", "فتح cmd كمسؤول", "فتح powershell كمسؤول", "sfc", "event viewer"),
        aliases_en=("developer tools", "open cmd admin", "open powershell admin", "sfc scan", "event viewer"),
        risk_level="elevated",
        executor="powershell",
        stage="B",
    ),
    CapabilitySpec(
        id="shell.navigation",
        aliases_ar=("الإعدادات السريعة", "مركز الإشعارات", "win+r", "win+s", "سطح مكتب افتراضي"),
        aliases_en=("quick settings", "notification center", "run dialog", "search", "virtual desktop"),
        risk_level="safe",
        executor="desktop",
        stage="A",
    ),
    CapabilitySpec(
        id="search.discovery",
        aliases_ar=("البحث داخل الملفات", "ملفات أكبر من", "ملفات اليوم", "كل الصور", "كل الفيديوهات"),
        aliases_en=("search text in files", "files larger than", "modified today", "find images", "find videos"),
        risk_level="safe",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="performance.monitoring",
        aliases_ar=("أعلى استهلاك معالج", "أعلى استهلاك رام", "تفريغ الرام"),
        aliases_en=("top cpu", "top ram", "empty ram"),
        risk_level="elevated",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="media.control",
        aliases_ar=("إيقاف كل الوسائط", "التالي", "السابق", "فتح يوتيوب"),
        aliases_en=("stop all media", "next media", "previous media", "open youtube"),
        risk_level="safe",
        executor="desktop",
        stage="A",
    ),
    CapabilitySpec(
        id="browser.deep",
        aliases_ar=("فتح عدة روابط", "مسح كاش كروم", "مسح كاش إيدج"),
        aliases_en=("multi open urls", "clear chrome cache", "clear edge cache"),
        risk_level="elevated",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="maintenance.cleanup",
        aliases_ar=("تنظيف النظام", "تفريغ الرام", "تنظيف WinSxS"),
        aliases_en=("system cleanup", "empty ram", "winsxs cleanup"),
        risk_level="elevated",
        executor="powershell",
        stage="B",
    ),
    CapabilitySpec(
        id="drivers.management",
        aliases_ar=("قائمة التعريفات", "نسخ احتياطي للتعريفات"),
        aliases_en=("drivers list", "drivers backup"),
        risk_level="elevated",
        executor="powershell",
        stage="B",
    ),
    CapabilitySpec(
        id="poweruser.fun",
        aliases_ar=("وضع الطيران", "god mode", "عكس الألوان"),
        aliases_en=("airplane mode", "god mode", "invert colors"),
        risk_level="safe",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="screenshot.advanced",
        aliases_ar=("لقطة شاشة", "لقطة نافذة", "قص الشاشة"),
        aliases_en=("screenshot", "active window screenshot", "snipping tool", "region screenshot"),
        risk_level="safe",
        executor="desktop",
        stage="A",
    ),
    CapabilitySpec(
        id="text.processing",
        aliases_ar=("تحويل نص لملف", "عدد الكلمات", "بحث واستبدال"),
        aliases_en=("text to file", "word count", "search replace"),
        risk_level="safe",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="api.integration",
        aliases_ar=("أسعار العملات", "الطقس", "ترجمة"),
        aliases_en=("currency rates", "weather", "translate"),
        risk_level="safe",
        executor="powershell",
        stage="B",
    ),
    CapabilitySpec(
        id="office.basics",
        aliases_ar=("افتح وورد", "تحويل docx الى pdf", "طباعة"),
        aliases_en=("open word", "docx to pdf", "print file"),
        risk_level="elevated",
        executor="powershell",
        stage="B",
    ),
    CapabilitySpec(
        id="remote.access",
        aliases_ar=("اتصال سطح مكتب بعيد", "vpn"),
        aliases_en=("remote desktop", "vpn connect", "vpn disconnect"),
        risk_level="elevated",
        executor="powershell",
        stage="B",
    ),
    CapabilitySpec(
        id="clipboard.manage",
        aliases_ar=("الحافظة", "مسح الحافظة", "سجل الحافظة"),
        aliases_en=("clipboard", "clear clipboard", "clipboard history"),
        risk_level="safe",
        executor="desktop",
        stage="A",
    ),
    CapabilitySpec(
        id="browser.shortcuts",
        aliases_ar=("تبويب جديد", "اغلاق تبويب", "تحديث الصفحة"),
        aliases_en=("new tab", "close tab", "reload", "history", "downloads"),
        risk_level="safe",
        executor="desktop",
        stage="A",
    ),
    CapabilitySpec(
        id="browser.home_navigation",
        aliases_ar=("الصفحة الرئيسية", "العودة للرئيسية"),
        aliases_en=("browser home", "go home page"),
        risk_level="safe",
        executor="desktop",
        stage="A",
    ),
    CapabilitySpec(
        id="window.positioning",
        aliases_ar=("إحداثيات النافذة", "حرك النافذة", "تغيير حجم النافذة"),
        aliases_en=("window coordinates", "move window", "resize window"),
        risk_level="safe",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="window.visibility",
        aliases_ar=("إخفاء النافذة", "إظهار النافذة", "إحضار للمقدمة"),
        aliases_en=("hide window", "show window", "bring window to front"),
        risk_level="safe",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="window.transparency",
        aliases_ar=("شفافية النافذة", "اجعل النافذة شفافة"),
        aliases_en=("window transparency", "set window opacity"),
        risk_level="elevated",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="process.priority",
        aliases_ar=("تغيير أولوية العملية", "أولوية العملية"),
        aliases_en=("set process priority", "process priority high normal low"),
        risk_level="elevated",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="process.pid_metrics",
        aliases_ar=("استهلاك عملية", "خيوط العملية", "وقت بدء العملية"),
        aliases_en=("process cpu usage", "process ram usage", "process threads", "process start time"),
        risk_level="safe",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="process.kill_unresponsive",
        aliases_ar=("إنهاء العمليات غير المستجيبة", "اقتل البرامج المعلقة"),
        aliases_en=("kill unresponsive processes", "terminate hanging apps"),
        risk_level="destructive",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="audio.mixer",
        aliases_ar=("فتح خلط الصوت", "فتح الميكسار"),
        aliases_en=("open volume mixer", "sndvol"),
        risk_level="safe",
        executor="desktop",
        stage="A",
    ),
    CapabilitySpec(
        id="audio.microphone_settings",
        aliases_ar=("فتح إعدادات الميكروفون", "إعدادات المايك"),
        aliases_en=("open microphone settings", "mic settings"),
        risk_level="safe",
        executor="desktop",
        stage="A",
    ),
    CapabilitySpec(
        id="background.apps_observability",
        aliases_ar=("تطبيقات الخلفية", "التطبيقات المصغرة", "تطبيقات مرئية", "ghost apps"),
        aliases_en=("background processes", "minimized windows", "visible windows", "ghost apps"),
        risk_level="safe",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="background.network_usage",
        aliases_ar=("استخدام الشبكة لكل تطبيق", "التطبيقات التي تستخدم الانترنت"),
        aliases_en=("network usage per app", "apps using internet"),
        risk_level="safe",
        executor="powershell",
        stage="B",
    ),
    CapabilitySpec(
        id="background.privacy_usage",
        aliases_ar=("من يستخدم الكاميرا", "من يستخدم الميكروفون"),
        aliases_en=("camera usage app", "microphone usage app"),
        risk_level="safe",
        executor="powershell",
        stage="B",
    ),
    CapabilitySpec(
        id="startup.management",
        aliases_ar=("برامج بدء التشغيل", "تعطيل بدء التشغيل", "تفعيل بدء التشغيل"),
        aliases_en=("startup list", "disable startup app", "enable startup app"),
        risk_level="elevated",
        executor="powershell",
        stage="B",
    ),
    CapabilitySpec(
        id="startup.security",
        aliases_ar=("توقيع برامج بدء التشغيل", "تنبيه برنامج بدء تشغيل جديد"),
        aliases_en=("startup signature check", "new startup alert"),
        risk_level="safe",
        executor="powershell",
        stage="B",
    ),
    CapabilitySpec(
        id="performance.deep_monitoring",
        aliases_ar=("أعلى استهلاك قرص", "ملف التبادل", "سرعة القراءة والكتابة"),
        aliases_en=("top disk usage", "page file usage", "disk read write speed"),
        risk_level="safe",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="security.session_awareness",
        aliases_ar=("المستخدمين المسجلين", "الجلسات البعيدة", "محاولات اختراق فاشلة"),
        aliases_en=("logged in users", "remote sessions", "failed login audits"),
        risk_level="elevated",
        executor="powershell",
        stage="B",
    ),
    CapabilitySpec(
        id="utilities.smart_automation",
        aliases_ar=("مؤقت", "قفل الماوس", "توفير الطاقة عند بطارية منخفضة"),
        aliases_en=("timer", "mouse lock", "battery guard"),
        risk_level="safe",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="dev.integration",
        aliases_ar=("إظهار متغيرات البيئة", "إصدار بايثون", "سجل git", "فتح المحرر"),
        aliases_en=("environment variables", "python version", "git log", "open editor"),
        risk_level="safe",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="debug.system_logs",
        aliases_ar=("تحليل أخطاء النظام", "ملخص bsod", "event viewer errors"),
        aliases_en=("system error analysis", "bsod summary", "event errors"),
        risk_level="safe",
        executor="powershell",
        stage="B",
    ),
    CapabilitySpec(
        id="vision.screen_understanding",
        aliases_ar=("وصف الشاشة", "ماذا على الشاشة", "تحليل الشاشة"),
        aliases_en=("describe screen", "what is on screen", "screen analysis"),
        risk_level="safe",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="vision.ocr_extraction",
        aliases_ar=("استخراج نص من صورة", "ocr", "نسخ النص من الشاشة"),
        aliases_en=("extract text from image", "ocr screen", "copy ocr text"),
        risk_level="safe",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="threat.file_reputation",
        aliases_ar=("فحص ملف مشبوه", "بصمة الملف", "sha256", "virustotal"),
        aliases_en=("file hash", "virustotal lookup", "suspicious file scan"),
        risk_level="safe",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="threat.suspicious_network_behavior",
        aliases_ar=("سلوك مشبوه", "اتصالات مشبوهة", "تطبيقات تتصل بالخارج"),
        aliases_en=("suspicious behavior", "suspicious connections", "apps with external connections"),
        risk_level="safe",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="files.semantic_organization",
        aliases_ar=("نظم سطح المكتب", "تنظيم الملفات تلقائيا", "تصنيف الملفات"),
        aliases_en=("organize desktop", "auto classify files", "semantic file organization"),
        risk_level="elevated",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="files.smart_batch_rename",
        aliases_ar=("إعادة تسمية ذكية", "تغيير أسماء الملفات تلقائيا"),
        aliases_en=("smart rename files", "batch rename by date"),
        risk_level="elevated",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="content.local_generation",
        aliases_ar=("كتابة مسودة", "مسودة بريد", "حفظ في وورد"),
        aliases_en=("draft email", "local content generation", "save draft to word"),
        risk_level="safe",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="content.text_to_table",
        aliases_ar=("تحويل نص إلى اكسل", "تحويل أرقام لجدول"),
        aliases_en=("text numbers to excel", "text to spreadsheet"),
        risk_level="safe",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="automation.anti_idle",
        aliases_ar=("اضغط F5 كل دقيقة", "منع الخمول", "ابقاء الجلسة نشطة"),
        aliases_en=("anti idle f5", "prevent idle", "keep session alive"),
        risk_level="safe",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="window.tray_control",
        aliases_ar=("تصغير إلى شريط النظام", "إرجاع من شريط النظام"),
        aliases_en=("minimize to tray", "restore from tray"),
        risk_level="safe",
        executor="desktop",
        stage="B",
    ),
    CapabilitySpec(
        id="network.port_owner",
        aliases_ar=("من يستخدم المنفذ", "مالك البورت"),
        aliases_en=("port owner", "which process uses port"),
        risk_level="safe",
        executor="powershell",
        stage="B",
    ),
)
