"""AlbusOS — AI agent runtime with pathway-based execution and composable skills.

This is the public namespace for ``pip install albusos``.

Development workflow (design → develop → deploy):

    from albusos import PathwayBuilder, AgentBuilder, ToolOutput

    # Build a pathway — validated at construction time
    pathway = (
        PathwayBuilder("research", pathway_id="research")
        .tool("search", "web.search", args={"query": "{{input.query}}"})
        .llm("summarize", "Summarize: {{search.output}}")
        .connect("input", "search")
        .connect("search", "summarize")
        .connect("summarize", "output")
        .build()
    )

    # Export to YAML for deployment
    pathway.to_yaml()

Runtime API (executing agents and pathways):

    from albusos import chat, run, create_server
    response = await chat("Hello, what can you do?")

Integration with client repos (e.g. MCP servers):

    # Your service installs albusos, provides its own agents/skills/tools.
    # albusOS handles: engine, pathways, LLM routing, stdlib primitives.
    # Your repo handles: domain tools, agent configs, MCP/HTTP transport.
"""

from __future__ import annotations

# ---------------------------------------------------------------------------
# Agent runtime (the core entity)
# ---------------------------------------------------------------------------
from core.agent import Agent, AgentRepository

# ---------------------------------------------------------------------------
# Builders (primary authoring interface)
# ---------------------------------------------------------------------------
from core.builders.agent import AgentBuilder
from core.builders.pathway import PathwayBuilder
from core.builders.skill import SkillBuilder
from core.pathways.nodes.handoff import HandoffCandidate
from core.pathways.pathway import Pathway, PathwayMode

# ---------------------------------------------------------------------------
# Tool authoring (for writing tool scripts)
# ---------------------------------------------------------------------------
from core.pathways.models.tool import ToolOutput

# ---------------------------------------------------------------------------
# Tool registry (register/discover tools)
# ---------------------------------------------------------------------------
from core.tools import ToolRegistry, get_tool_registry

# ---------------------------------------------------------------------------
# Core types
# ---------------------------------------------------------------------------
from core.types.agents import AgentDefinition, ModelRouting
from core.types.execution import ExecutionBudget
from core.types.state import ThreadState

# ---------------------------------------------------------------------------
# Runtime API (executing agents and pathways)
# ---------------------------------------------------------------------------
from server import chat, chat_sync, create_server, run, run_sync
from server.runtime import ExecutionResult

# ---------------------------------------------------------------------------
# Stdlib bootstrap (opt-in general agent capabilities)
# ---------------------------------------------------------------------------
from stdlib.bootstrap import load_stdlib

__all__ = [
    # Runtime API
    "chat",
    "chat_sync",
    "create_server",
    "run",
    "run_sync",
    # Agent (runtime entity)
    "Agent",
    "AgentRepository",
    # Core types
    "AgentDefinition",
    "ExecutionBudget",
    "ExecutionResult",
    "ModelRouting",
    "ThreadState",
    # Builders
    "AgentBuilder",
    "HandoffCandidate",
    "Pathway",
    "PathwayBuilder",
    "PathwayMode",
    "SkillBuilder",
    # Tool authoring
    "ToolOutput",
    # Tool registry
    "ToolRegistry",
    "get_tool_registry",
    "load_stdlib",
]
