#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""MAC地址查询Skill"""

import sys
import os
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(__file__))))

from skills.base_skill import BaseSkill
from network_tools import run_mac_lookup


class MacLookupSkill(BaseSkill):
    """MAC地址查询Skill"""
    
    def get_metadata(self):
        return {
            "name": "mac_lookup",
            "display_name": "MAC地址查询",
            "description": "查询MAC地址对应的厂商信息",
            "category": "info",
            "keywords": ["mac", "地址", "厂商", "制造商", "查询"],
            "parameters": [
                {
                    "name": "mac",
                    "type": "string",
                    "required": True,
                    "description": "MAC地址,格式:00:1B:44:11:3A:B7"
                }
            ],
            "examples": [
                "查询MAC地址00:1B:44:11:3A:B7",
                "查询mac 00-1B-44-11-3A-B7"
            ],
            "requires_admin": False,
            "requires_ui": False
        }
    
    def execute(self, mac: str) -> str:
        """查询MAC地址"""
        return run_mac_lookup(mac)
