"""
Tools for security-audit-agent-that-revi agent.
"""

TOOLS = [
    {
        "name": "read_file",
        "desc": "Read file contents",
        "handler": "lambda a: f'Reading: {a[\"path\"]}'"
    },
    {
        "name": "grep_search",
        "desc": "Search for patterns in files",
        "handler": "lambda a: f'Searching: {a[\"pattern\"]}'"
    },
    {
        "name": "check_secrets",
        "desc": "Scan for exposed secrets",
        "handler": "lambda a: 'No secrets found'"
    },
    {
        "name": "generate_report",
        "desc": "Generate security report",
        "handler": "lambda a: 'Report generated'"
    }
]

def execute_tool(name: str, args: dict) -> str:
    """Execute a tool by name with given args."""
    handlers = {"read_file": lambda a: f'Reading: {a["path"]}',
    "grep_search": lambda a: f'Searching: {a["pattern"]}',
    "check_secrets": lambda a: 'No secrets found',
    "generate_report": lambda a: 'Report generated'}
    handler = handlers.get(name)
    if handler:
        return handler(args)
    return f"Unknown tool: {name}"
