"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from .applypatchengineenum import ApplyPatchEngineEnum
from openrouter.types import BaseModel
from openrouter.utils import validate_open_enum
from pydantic.functional_validators import PlainValidator
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class ApplyPatchServerToolConfigTypedDict(TypedDict):
    r"""Configuration for the openrouter:apply_patch server tool"""

    engine: NotRequired[ApplyPatchEngineEnum]
    r"""Which apply_patch engine to use. \"auto\" (default) uses native passthrough when the endpoint advertises native apply_patch support, otherwise falls back to OpenRouter's HITL validator. \"native\" forces native passthrough — when the endpoint does not support native, the request falls back to HITL. \"openrouter\" always runs the HITL validator. Native passthrough streams the diff incrementally via `apply_patch_call_operation_diff.delta` events; HITL buffers the diff for atomic delivery as a single delta."""


class ApplyPatchServerToolConfig(BaseModel):
    r"""Configuration for the openrouter:apply_patch server tool"""

    engine: Annotated[
        Optional[ApplyPatchEngineEnum], PlainValidator(validate_open_enum(False))
    ] = None
    r"""Which apply_patch engine to use. \"auto\" (default) uses native passthrough when the endpoint advertises native apply_patch support, otherwise falls back to OpenRouter's HITL validator. \"native\" forces native passthrough — when the endpoint does not support native, the request falls back to HITL. \"openrouter\" always runs the HITL validator. Native passthrough streams the diff incrementally via `apply_patch_call_operation_diff.delta` events; HITL buffers the diff for atomic delivery as a single delta."""
