"""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, ClassVar, Optional, TYPE_CHECKING, Union

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


class VendedTool:
    """Built-in tools."""
    if TYPE_CHECKING:
        Bash: ClassVar[type["_VendedTool_Bash"]]
        FileEditor: ClassVar[type["_VendedTool_FileEditor"]]
        HttpRequest: ClassVar[type["_VendedTool_HttpRequest"]]
        Notebook: ClassVar[type["_VendedTool_Notebook"]]
        _CASES: ClassVar[dict[str, type]]
        @staticmethod
        def lift(raw: _WitVariant) -> "VendedTool": ...

class _VendedTool_Bash(_WitVariantCase, VendedTool):
    """Run shell commands in a persistent bash session."""
    tag = 'bash'
VendedTool.Bash = _VendedTool_Bash  # type: ignore[attr-defined]

class _VendedTool_FileEditor(_WitVariantCase, VendedTool):
    """Create, view, and edit files on disk."""
    tag = 'file-editor'
VendedTool.FileEditor = _VendedTool_FileEditor  # type: ignore[attr-defined]

class _VendedTool_HttpRequest(_WitVariantCase, VendedTool):
    """Make HTTP requests."""
    tag = 'http-request'
VendedTool.HttpRequest = _VendedTool_HttpRequest  # type: ignore[attr-defined]

class _VendedTool_Notebook(_WitVariantCase, VendedTool):
    """Read and write named text notebooks stored in agent state."""
    tag = 'notebook'
VendedTool.Notebook = _VendedTool_Notebook  # type: ignore[attr-defined]

VendedTool._CASES = {  # type: ignore[attr-defined]
    'bash': VendedTool.Bash,
    'file-editor': VendedTool.FileEditor,
    'http-request': VendedTool.HttpRequest,
    'notebook': VendedTool.Notebook,
}


def _VendedTool_lift(raw: _WitVariant) -> VendedTool:
    cls = VendedTool._CASES.get(raw.tag)  # type: ignore[attr-defined]
    if cls is None:
        raise ValueError(f'unknown VendedTool arm: {raw.tag!r}')
    return cls(raw.payload)
VendedTool.lift = staticmethod(_VendedTool_lift)  # type: ignore[attr-defined]

@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."""
    if TYPE_CHECKING:
        Skills: ClassVar[type["_VendedPlugin_Skills"]]
        ContextOffloader: ClassVar[type["_VendedPlugin_ContextOffloader"]]
        _CASES: ClassVar[dict[str, type]]
        @staticmethod
        def lift(raw: _WitVariant) -> "VendedPlugin": ...

class _VendedPlugin_Skills(_WitVariantCase, VendedPlugin):
    """Load and activate Anthropic-style skills from disk."""
    tag = 'skills'
VendedPlugin.Skills = _VendedPlugin_Skills  # type: ignore[attr-defined]

class _VendedPlugin_ContextOffloader(_WitVariantCase, VendedPlugin):
    """Offload large tool results to external storage."""
    tag = 'context-offloader'
VendedPlugin.ContextOffloader = _VendedPlugin_ContextOffloader  # type: ignore[attr-defined]

VendedPlugin._CASES = {  # type: ignore[attr-defined]
    'skills': VendedPlugin.Skills,
    'context-offloader': VendedPlugin.ContextOffloader,
}


def _VendedPlugin_lift(raw: _WitVariant) -> VendedPlugin:
    cls = VendedPlugin._CASES.get(raw.tag)  # type: ignore[attr-defined]
    if cls is None:
        raise ValueError(f'unknown VendedPlugin arm: {raw.tag!r}')
    return cls(raw.payload)
VendedPlugin.lift = staticmethod(_VendedPlugin_lift)  # type: ignore[attr-defined]
