"""Auto-generated by bindgen. Do not edit."""
# ruff: noqa: E501, F401, I001
# fmt: off

from __future__ import annotations

from dataclasses import dataclass
from typing import Any, Optional, Union

from wasmtime.component import Variant as _WitVariant
from wasmtime.component import VariantCase as _WitVariantCase


@dataclass(kw_only=True)
class BashTool:
    """Bash tool configuration."""
    default_timeout_s: int | None


@dataclass(kw_only=True)
class FileEditorTool:
    """File editor tool configuration."""
    workspace_root: str | None


@dataclass(kw_only=True)
class HttpRequestTool:
    """HTTP request tool configuration."""
    allowed_hosts: list[str]
    max_response_bytes: int


@dataclass(kw_only=True)
class NotebookTool:
    """Notebook tool configuration."""
    workspace_root: str | None


class VendedTool:
    """Built-in tools."""

    class Bash(_WitVariantCase):
        """Run shell commands in a persistent bash session."""
        tag = 'bash'

    class FileEditor(_WitVariantCase):
        """Create, view, and edit files on disk."""
        tag = 'file-editor'

    class HttpRequest(_WitVariantCase):
        """Make HTTP requests."""
        tag = 'http-request'

    class Notebook(_WitVariantCase):
        """Read and execute Jupyter notebook cells."""
        tag = 'notebook'

    _CASES: dict[str, type] = {
        'bash': Bash,
        'file-editor': FileEditor,
        'http-request': HttpRequest,
        'notebook': Notebook,
    }

    @staticmethod
    def lift(raw: _WitVariant) -> VendedTool:
        cls = VendedTool._CASES.get(raw.tag)
        if cls is None:
            raise ValueError(f'unknown VendedTool arm: {raw.tag!r}')
        return cls(raw.payload)

@dataclass(kw_only=True)
class SkillSource:
    """Location of a skill definition on disk."""
    path: str


@dataclass(kw_only=True)
class AgentSkills:
    """Skills plugin configuration."""
    skills: list[SkillSource]
    strict: bool
    max_resource_files: int | None
    state_key: str | None


@dataclass(kw_only=True)
class ContextOffloader:
    """Context offloader plugin configuration."""
    max_result_tokens: int | None
    preview_tokens: int | None
    include_retrieval_tool: bool


class VendedPlugin:
    """Built-in plugins."""

    class Skills(_WitVariantCase):
        """Load and activate Anthropic-style skills from disk."""
        tag = 'skills'

    class ContextOffloader(_WitVariantCase):
        """Offload large tool results to external storage."""
        tag = 'context-offloader'

    _CASES: dict[str, type] = {
        'skills': Skills,
        'context-offloader': ContextOffloader,
    }

    @staticmethod
    def lift(raw: _WitVariant) -> VendedPlugin:
        cls = VendedPlugin._CASES.get(raw.tag)
        if cls is None:
            raise ValueError(f'unknown VendedPlugin arm: {raw.tag!r}')
        return cls(raw.payload)
