from __future__ import annotations
from typing import Any, Callable, Dict, Optional, Protocol

START: str
END: str
State = Dict[str, Any]

class InMemorySaver: ...
class ToolNode: ...

def tools_condition(*args: Any, **kwargs: Any) -> str: ...

class CompiledGraph(Protocol):
    def invoke(self, state: State, config: Optional[dict] = ...) -> State: ...
    async def ainvoke(self, state: State, config: Optional[dict] = ...) -> State: ...

ConditionFn = Callable[[State], str]

class StateGraph:
    def __init__(self, state_type: Any = ...) -> None: ...
    def add_node(self, name: str, node: Callable[[State], State]) -> StateGraph: ...
    def add_edge(self, src: str, dst: str) -> StateGraph: ...
    def add_conditional_edges(
        self,
        source: str,
        condition: ConditionFn,
        path_map: Optional[dict[str, str]] = ...,
    ) -> StateGraph: ...
    def compile(self, checkpointer: Any = ...) -> CompiledGraph: ...
