import { BaseChannel } from "../channels/base.js"; import { END, START, Send } from "../constants.js"; import { LangGraphRunnableConfig, RunnableLike as RunnableLike$1 } from "../pregel/runnable_types.js"; import { StateDefinition, StateType } from "./annotation.js"; import { RunnableCallable } from "../utils.js"; import { PregelNode } from "../pregel/read.js"; import { PregelParams } from "../pregel/types.js"; import { Pregel } from "../pregel/index.js"; import { All, BaseCheckpointSaver } from "@langchain/langgraph-checkpoint"; import { Runnable, RunnableConfig } from "@langchain/core/runnables"; import { Graph } from "@langchain/core/runnables/graph"; //#region src/graph/graph.d.ts interface BranchOptions { source: N; path: RunnableLike$1; pathMap?: Record | (N | typeof END)[]; } type BranchPathReturnValue = string | Send | (string | Send)[] | Promise; type NodeAction = RunnableLike$1 : U, LangGraphRunnableConfig>>; declare class Branch { path: Runnable; ends?: Record; constructor(options: Omit, "source">); run(writer: (dests: (string | Send)[], config: LangGraphRunnableConfig) => Runnable | void | Promise, reader?: (config: CallOptions) => IO): RunnableCallable; _route(input: IO, config: CallOptions, writer: (dests: (string | Send)[], config: LangGraphRunnableConfig) => Runnable | void | Promise, reader?: (config: CallOptions) => IO): Promise; } type NodeSpec = { runnable: Runnable; metadata?: Record; subgraphs?: Pregel[]; ends?: string[]; defer?: boolean; }; type AddNodeOptions = { metadata?: Record; subgraphs?: Pregel[]; ends?: Nodes[]; defer?: boolean; }; declare class Graph$1 = NodeSpec, C extends StateDefinition = StateDefinition> { nodes: Record; edges: Set<[N | typeof START, N | typeof END]>; branches: Record>>; entryPoint?: string; compiled: boolean; constructor(); protected warnIfCompiled(message: string): void; get allEdges(): Set<[string, string]>; addNode(nodes: Record> | [key: K, action: NodeAction, options?: AddNodeOptions][]): Graph$1; addNode(key: K, action: NodeAction, options?: AddNodeOptions): Graph$1; addEdge(startKey: N | typeof START, endKey: N | typeof END): this; addConditionalEdges(source: BranchOptions>>): this; addConditionalEdges(source: N, path: RunnableLike$1>>, pathMap?: BranchOptions>>["pathMap"]): this; /** * @deprecated use `addEdge(START, key)` instead */ setEntryPoint(key: N): this; /** * @deprecated use `addEdge(key, END)` instead */ setFinishPoint(key: N): this; compile({ checkpointer, interruptBefore, interruptAfter, name }?: { checkpointer?: BaseCheckpointSaver | false; interruptBefore?: N[] | All; interruptAfter?: N[] | All; name?: string; }): CompiledGraph; validate(interrupt?: string[]): void; } declare class CompiledGraph = Record, InputType = any, OutputType = any, NodeReturnType = unknown, CommandType = unknown, StreamCustomType = any> extends Pregel>, Record, ContextType & Record, InputType, OutputType, InputType, OutputType, NodeReturnType, CommandType, StreamCustomType> { "~NodeType": N; "~NodeReturnType": NodeReturnType; "~RunInput": Update; "~RunOutput": State; builder: Graph$1; constructor({ builder, ...rest }: { builder: Graph$1; } & PregelParams>, Record>); attachNode(key: N, node: NodeSpec): void; attachEdge(start: N | typeof START, end: N | typeof END): void; attachBranch(start: N | typeof START, name: string, branch: Branch): void; /** * Returns a drawable representation of the computation graph. */ getGraphAsync(config?: RunnableConfig & { xray?: boolean | number; }): Promise; /** * Returns a drawable representation of the computation graph. * * @deprecated Use getGraphAsync instead. The async method will be the default in the next minor core release. */ getGraph(config?: RunnableConfig & { xray?: boolean | number; }): Graph; } //#endregion export { AddNodeOptions, Branch, CompiledGraph, Graph$1 as Graph, NodeSpec }; //# sourceMappingURL=graph.d.ts.map