"""Configuration for LangGraph ↔ A2A integration."""

from __future__ import annotations

from typing import Any

from a2a.server.tasks import TaskStore
from a2a.types import AgentCapabilities, AgentSkill
from pydantic import BaseModel, ConfigDict, Field


class A2ALangGraphConfig(BaseModel):
    """Runtime and metadata settings for mounting a LangGraph workflow as an A2A agent."""

    model_config = ConfigDict(arbitrary_types_allowed=True, extra="ignore")

    agent_name: str = "LangGraph Agent"
    agent_description: str = "LangGraph workflow exposed over A2A"
    version: str = "0.1.0"
    protocol_version: str | None = "0.3.0"
    base_url: str = "http://127.0.0.1:8000"
    skills: list[AgentSkill] | None = None
    capabilities: AgentCapabilities | None = None
    default_input_modes: list[str] = Field(default_factory=lambda: ["text"])
    default_output_modes: list[str] = Field(default_factory=lambda: ["text"])
    security: list[dict[str, list[str]]] | None = None
    security_schemes: dict[str, Any] | None = None

    task_store: TaskStore | None = None
    executor_cls: Any = None
    max_content_length: int | None = Field(default=10 * 1024 * 1024)
    build_app_kwargs: dict[str, Any] = Field(default_factory=dict)
