@langchain/langgraph 1.1.3 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/channels/any_value.d.cts +0 -1
- package/dist/channels/any_value.d.cts.map +1 -1
- package/dist/channels/any_value.d.ts +0 -1
- package/dist/channels/any_value.d.ts.map +1 -1
- package/dist/channels/base.d.cts.map +1 -1
- package/dist/channels/base.d.ts.map +1 -1
- package/dist/channels/binop.d.cts.map +1 -1
- package/dist/channels/binop.d.ts.map +1 -1
- package/dist/channels/dynamic_barrier_value.d.cts +0 -10
- package/dist/channels/dynamic_barrier_value.d.cts.map +1 -1
- package/dist/channels/dynamic_barrier_value.d.ts +0 -10
- package/dist/channels/dynamic_barrier_value.d.ts.map +1 -1
- package/dist/channels/ephemeral_value.d.cts +0 -1
- package/dist/channels/ephemeral_value.d.cts.map +1 -1
- package/dist/channels/ephemeral_value.d.ts +0 -1
- package/dist/channels/ephemeral_value.d.ts.map +1 -1
- package/dist/channels/last_value.d.cts +0 -1
- package/dist/channels/last_value.d.cts.map +1 -1
- package/dist/channels/last_value.d.ts +0 -1
- package/dist/channels/last_value.d.ts.map +1 -1
- package/dist/channels/named_barrier_value.d.cts +0 -1
- package/dist/channels/named_barrier_value.d.cts.map +1 -1
- package/dist/channels/named_barrier_value.d.ts +0 -1
- package/dist/channels/named_barrier_value.d.ts.map +1 -1
- package/dist/channels/topic.d.cts +0 -1
- package/dist/channels/topic.d.cts.map +1 -1
- package/dist/channels/topic.d.ts +0 -1
- package/dist/channels/topic.d.ts.map +1 -1
- package/dist/channels/untracked_value.d.cts +0 -1
- package/dist/channels/untracked_value.d.cts.map +1 -1
- package/dist/channels/untracked_value.d.ts +0 -1
- package/dist/channels/untracked_value.d.ts.map +1 -1
- package/dist/constants.d.cts +0 -15
- package/dist/constants.d.cts.map +1 -1
- package/dist/constants.d.ts +0 -15
- package/dist/constants.d.ts.map +1 -1
- package/dist/errors.d.cts.map +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/func/index.d.cts +0 -1
- package/dist/func/index.d.cts.map +1 -1
- package/dist/func/index.d.ts +0 -1
- package/dist/func/index.d.ts.map +1 -1
- package/dist/func/types.d.cts +0 -11
- package/dist/func/types.d.cts.map +1 -1
- package/dist/func/types.d.ts +0 -11
- package/dist/func/types.d.ts.map +1 -1
- package/dist/graph/annotation.d.cts.map +1 -1
- package/dist/graph/annotation.d.ts.map +1 -1
- package/dist/graph/graph.d.cts.map +1 -1
- package/dist/graph/graph.d.ts.map +1 -1
- package/dist/graph/index.d.ts +7 -0
- package/dist/graph/message.d.cts.map +1 -1
- package/dist/graph/message.d.ts +2 -2
- package/dist/graph/message.d.ts.map +1 -1
- package/dist/graph/messages_annotation.d.cts +5 -6
- package/dist/graph/messages_annotation.d.cts.map +1 -1
- package/dist/graph/messages_annotation.d.ts +1 -1
- package/dist/graph/messages_annotation.d.ts.map +1 -1
- package/dist/graph/messages_reducer.d.cts +0 -1
- package/dist/graph/messages_reducer.d.cts.map +1 -1
- package/dist/graph/messages_reducer.d.ts +0 -1
- package/dist/graph/messages_reducer.d.ts.map +1 -1
- package/dist/graph/state.cjs +59 -0
- package/dist/graph/state.cjs.map +1 -1
- package/dist/graph/state.d.cts +59 -0
- package/dist/graph/state.d.cts.map +1 -1
- package/dist/graph/state.d.ts +59 -0
- package/dist/graph/state.d.ts.map +1 -1
- package/dist/graph/state.js +59 -0
- package/dist/graph/state.js.map +1 -1
- package/dist/graph/types.d.cts +2 -18
- package/dist/graph/types.d.cts.map +1 -1
- package/dist/graph/types.d.ts +2 -18
- package/dist/graph/types.d.ts.map +1 -1
- package/dist/graph/zod/index.d.cts +1 -0
- package/dist/graph/zod/index.d.ts +1 -0
- package/dist/graph/zod/meta.d.cts.map +1 -1
- package/dist/graph/zod/meta.d.ts.map +1 -1
- package/dist/graph/zod/plugin.d.cts +30 -0
- package/dist/graph/zod/plugin.d.cts.map +1 -0
- package/dist/graph/zod/plugin.d.ts +30 -0
- package/dist/graph/zod/plugin.d.ts.map +1 -0
- package/dist/graph/zod/schema.d.cts +0 -1
- package/dist/graph/zod/schema.d.cts.map +1 -1
- package/dist/graph/zod/schema.d.ts +0 -1
- package/dist/graph/zod/schema.d.ts.map +1 -1
- package/dist/graph/zod/zod-registry.d.cts +0 -1
- package/dist/graph/zod/zod-registry.d.cts.map +1 -1
- package/dist/graph/zod/zod-registry.d.ts +0 -1
- package/dist/graph/zod/zod-registry.d.ts.map +1 -1
- package/dist/interrupt.d.cts.map +1 -1
- package/dist/interrupt.d.ts.map +1 -1
- package/dist/prebuilt/agentName.d.cts +0 -17
- package/dist/prebuilt/agentName.d.cts.map +1 -1
- package/dist/prebuilt/agentName.d.ts +0 -17
- package/dist/prebuilt/agentName.d.ts.map +1 -1
- package/dist/prebuilt/agent_executor.d.cts +5 -5
- package/dist/prebuilt/agent_executor.d.cts.map +1 -1
- package/dist/prebuilt/agent_executor.d.ts +6 -5
- package/dist/prebuilt/agent_executor.d.ts.map +1 -1
- package/dist/prebuilt/chat_agent_executor.d.cts.map +1 -1
- package/dist/prebuilt/chat_agent_executor.d.ts.map +1 -1
- package/dist/prebuilt/interrupt.d.cts.map +1 -1
- package/dist/prebuilt/interrupt.d.ts.map +1 -1
- package/dist/prebuilt/react_agent_executor.d.cts +8 -14
- package/dist/prebuilt/react_agent_executor.d.cts.map +1 -1
- package/dist/prebuilt/react_agent_executor.d.ts +10 -14
- package/dist/prebuilt/react_agent_executor.d.ts.map +1 -1
- package/dist/prebuilt/tool_executor.d.cts.map +1 -1
- package/dist/prebuilt/tool_executor.d.ts.map +1 -1
- package/dist/prebuilt/tool_node.d.cts.map +1 -1
- package/dist/prebuilt/tool_node.d.ts.map +1 -1
- package/dist/pregel/algo.d.cts +0 -1
- package/dist/pregel/algo.d.cts.map +1 -1
- package/dist/pregel/algo.d.ts +5 -1
- package/dist/pregel/algo.d.ts.map +1 -1
- package/dist/pregel/index.d.cts.map +1 -1
- package/dist/pregel/index.d.ts.map +1 -1
- package/dist/pregel/read.d.cts +0 -1
- package/dist/pregel/read.d.cts.map +1 -1
- package/dist/pregel/read.d.ts +1 -1
- package/dist/pregel/read.d.ts.map +1 -1
- package/dist/pregel/remote.cjs +1 -1
- package/dist/pregel/remote.cjs.map +1 -1
- package/dist/pregel/remote.d.cts.map +1 -1
- package/dist/pregel/remote.d.ts +2 -0
- package/dist/pregel/remote.d.ts.map +1 -1
- package/dist/pregel/remote.js +2 -2
- package/dist/pregel/remote.js.map +1 -1
- package/dist/pregel/runnable_types.d.cts.map +1 -1
- package/dist/pregel/runnable_types.d.ts.map +1 -1
- package/dist/pregel/stream.d.ts +2 -0
- package/dist/pregel/types.d.cts +0 -7
- package/dist/pregel/types.d.cts.map +1 -1
- package/dist/pregel/types.d.ts +0 -7
- package/dist/pregel/types.d.ts.map +1 -1
- package/dist/pregel/utils/config.d.cts +0 -1
- package/dist/pregel/utils/config.d.cts.map +1 -1
- package/dist/pregel/utils/config.d.ts +0 -1
- package/dist/pregel/utils/config.d.ts.map +1 -1
- package/dist/pregel/utils/index.d.cts +3 -7
- package/dist/pregel/utils/index.d.cts.map +1 -1
- package/dist/pregel/utils/index.d.ts +3 -7
- package/dist/pregel/utils/index.d.ts.map +1 -1
- package/dist/pregel/write.d.cts +0 -1
- package/dist/pregel/write.d.cts.map +1 -1
- package/dist/pregel/write.d.ts +0 -1
- package/dist/pregel/write.d.ts.map +1 -1
- package/dist/state/adapter.d.cts +0 -1
- package/dist/state/adapter.d.cts.map +1 -1
- package/dist/state/adapter.d.ts +0 -1
- package/dist/state/adapter.d.ts.map +1 -1
- package/dist/state/index.d.ts +7 -0
- package/dist/state/prebuilt/index.d.ts +1 -0
- package/dist/state/prebuilt/messages.d.cts +2 -2
- package/dist/state/prebuilt/messages.d.cts.map +1 -1
- package/dist/state/prebuilt/messages.d.ts +2 -2
- package/dist/state/prebuilt/messages.d.ts.map +1 -1
- package/dist/state/schema.d.cts.map +1 -1
- package/dist/state/schema.d.ts +1 -0
- package/dist/state/schema.d.ts.map +1 -1
- package/dist/state/types.d.cts +0 -20
- package/dist/state/types.d.cts.map +1 -1
- package/dist/state/types.d.ts +0 -20
- package/dist/state/types.d.ts.map +1 -1
- package/dist/state/values/reduced.d.cts +0 -1
- package/dist/state/values/reduced.d.cts.map +1 -1
- package/dist/state/values/reduced.d.ts +0 -1
- package/dist/state/values/reduced.d.ts.map +1 -1
- package/dist/state/values/untracked.d.cts +0 -1
- package/dist/state/values/untracked.d.cts.map +1 -1
- package/dist/state/values/untracked.d.ts +0 -1
- package/dist/state/values/untracked.d.ts.map +1 -1
- package/dist/utils.d.cts.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/web.d.ts +3 -0
- package/dist/writer.d.cts.map +1 -1
- package/dist/writer.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":["Runnable","RunnableConfig","RunnableFunc","StreamEvent","IterableReadableStream","All","BaseCache","BaseCheckpointSaver","BaseStore","CheckpointListOptions","CheckpointTuple","BaseChannel","Command","CommandInstance","StrRecord","PregelNode","LangGraphRunnableConfig","Durability","GetStateOptions","MultipleChannelSubscriptionOptions","PregelInputType","PregelInterface","PregelOptions","PregelOutputType","PregelParams","SingleChannelSubscriptionOptions","StateSnapshot","StreamMode","StreamOutputMap","RetryPolicy","ChannelWrite","WriteValue","StreamEventsOptions","Parameters","Channel","Record","PartialRunnable","RunInput","RunOutput","CallOptions","Partial","Promise","Pregel","InputType","OutputType","CommandType","Nodes","Channels","ContextType","Array","Omit","_langchain_core_runnables_graph0","Graph","Generator","AsyncGenerator","config","saved","subgraphCheckpointer","applyPendingWrites","AsyncIterableIterator","TStreamMode","TSubgraphs","TEncoding","StreamUpdatesType","StreamValuesType","NodeReturnType","StreamCustom","Uint8Array"],"sources":["../../src/pregel/index.d.ts"],"sourcesContent":["import { Runnable, RunnableConfig, RunnableFunc } from \"@langchain/core/runnables\";\nimport type { StreamEvent } from \"@langchain/core/tracers/log_stream\";\nimport { IterableReadableStream } from \"@langchain/core/utils/stream\";\nimport { All, BaseCache, BaseCheckpointSaver, BaseStore, CheckpointListOptions, CheckpointTuple } from \"@langchain/langgraph-checkpoint\";\nimport { BaseChannel } from \"../channels/base.js\";\nimport { Command, type CommandInstance } from \"../constants.js\";\nimport { StrRecord } from \"./algo.js\";\nimport { PregelNode } from \"./read.js\";\nimport { LangGraphRunnableConfig } from \"./runnable_types.js\";\nimport type { Durability, GetStateOptions, MultipleChannelSubscriptionOptions, PregelInputType, PregelInterface, PregelOptions, PregelOutputType, PregelParams, SingleChannelSubscriptionOptions, StateSnapshot, StreamMode, StreamOutputMap } from \"./types.js\";\nimport { RetryPolicy } from \"./utils/index.js\";\nimport { ChannelWrite } from \"./write.js\";\ntype WriteValue = Runnable | RunnableFunc<unknown, unknown> | unknown;\ntype StreamEventsOptions = Parameters<Runnable[\"streamEvents\"]>[2];\n/**\n * Utility class for working with channels in the Pregel system.\n * Provides static methods for subscribing to channels and writing to them.\n *\n * Channels are the communication pathways between nodes in a Pregel graph.\n * They enable message passing and state updates between different parts of the graph.\n */\nexport declare class Channel {\n /**\n * Creates a PregelNode that subscribes to a single channel.\n * This is used to define how nodes receive input from channels.\n *\n * @example\n * ```typescript\n * // Subscribe to a single channel\n * const node = Channel.subscribeTo(\"messages\");\n *\n * // Subscribe to multiple channels\n * const node = Channel.subscribeTo([\"messages\", \"state\"]);\n *\n * // Subscribe with a custom key\n * const node = Channel.subscribeTo(\"messages\", { key: \"chat\" });\n * ```\n *\n * @param channel Single channel name to subscribe to\n * @param options Subscription options\n * @returns A PregelNode configured to receive from the specified channels\n * @throws {Error} If a key is specified when subscribing to multiple channels\n */\n static subscribeTo(channel: string, options?: SingleChannelSubscriptionOptions): PregelNode;\n /**\n * Creates a PregelNode that subscribes to multiple channels.\n * This is used to define how nodes receive input from channels.\n *\n * @example\n * ```typescript\n * // Subscribe to a single channel\n * const node = Channel.subscribeTo(\"messages\");\n *\n * // Subscribe to multiple channels\n * const node = Channel.subscribeTo([\"messages\", \"state\"]);\n *\n * // Subscribe with a custom key\n * const node = Channel.subscribeTo(\"messages\", { key: \"chat\" });\n * ```\n *\n * @param channels Single channel name to subscribe to\n * @param options Subscription options\n * @returns A PregelNode configured to receive from the specified channels\n * @throws {Error} If a key is specified when subscribing to multiple channels\n */\n static subscribeTo(channels: string[], options?: MultipleChannelSubscriptionOptions): PregelNode;\n /**\n * Creates a ChannelWrite that specifies how to write values to channels.\n * This is used to define how nodes send output to channels.\n *\n * @example\n * ```typescript\n * // Write to multiple channels\n * const write = Channel.writeTo([\"output\", \"state\"]);\n *\n * // Write with specific values\n * const write = Channel.writeTo([\"output\"], {\n * state: \"completed\",\n * result: calculateResult()\n * });\n *\n * // Write with a transformation function\n * const write = Channel.writeTo([\"output\"], {\n * result: (x) => processResult(x)\n * });\n * ```\n *\n * @param channels - Array of channel names to write to\n * @param writes - Optional map of channel names to values or transformations\n * @returns A ChannelWrite object that can be used to write to the specified channels\n */\n static writeTo(channels: string[], writes?: Record<string, WriteValue>): ChannelWrite;\n}\nexport type { PregelInputType, PregelOptions, PregelOutputType };\ndeclare class PartialRunnable<RunInput, RunOutput, CallOptions extends RunnableConfig> extends Runnable<RunInput, RunOutput, CallOptions> {\n lc_namespace: string[];\n invoke(_input: RunInput, _options?: Partial<CallOptions>): Promise<any>;\n withConfig(_config: CallOptions): typeof this;\n stream(input: RunInput, options?: Partial<CallOptions>): Promise<IterableReadableStream<any>>;\n}\n/**\n * The Pregel class is the core runtime engine of LangGraph, implementing a message-passing graph computation model\n * inspired by [Google's Pregel system](https://research.google/pubs/pregel-a-system-for-large-scale-graph-processing/).\n * It provides the foundation for building reliable, controllable agent workflows that can evolve state over time.\n *\n * Key features:\n * - Message passing between nodes in discrete \"supersteps\"\n * - Built-in persistence layer through checkpointers\n * - First-class streaming support for values, updates, and events\n * - Human-in-the-loop capabilities via interrupts\n * - Support for parallel node execution within supersteps\n *\n * The Pregel class is not intended to be instantiated directly by consumers. Instead, use the following higher-level APIs:\n * - {@link StateGraph}: The main graph class for building agent workflows\n * - Compiling a {@link StateGraph} will return a {@link CompiledGraph} instance, which extends `Pregel`\n * - Functional API: A declarative approach using tasks and entrypoints\n * - A `Pregel` instance is returned by the {@link entrypoint} function\n *\n * @example\n * ```typescript\n * // Using StateGraph API\n * const graph = new StateGraph(annotation)\n * .addNode(\"nodeA\", myNodeFunction)\n * .addEdge(\"nodeA\", \"nodeB\")\n * .compile();\n *\n * // The compiled graph is a Pregel instance\n * const result = await graph.invoke(input);\n * ```\n *\n * @example\n * ```typescript\n * // Using Functional API\n * import { task, entrypoint } from \"@langchain/langgraph\";\n * import { MemorySaver } from \"@langchain/langgraph-checkpoint\";\n *\n * // Define tasks that can be composed\n * const addOne = task(\"add\", async (x: number) => x + 1);\n *\n * // Create a workflow using the entrypoint function\n * const workflow = entrypoint({\n * name: \"workflow\",\n * checkpointer: new MemorySaver()\n * }, async (numbers: number[]) => {\n * // Tasks can be run in parallel\n * const results = await Promise.all(numbers.map(n => addOne(n)));\n * return results;\n * });\n *\n * // The workflow is a Pregel instance\n * const result = await workflow.invoke([1, 2, 3]); // Returns [2, 3, 4]\n * ```\n *\n * @typeParam Nodes - Mapping of node names to their {@link PregelNode} implementations\n * @typeParam Channels - Mapping of channel names to their {@link BaseChannel} or {@link ManagedValueSpec} implementations\n * @typeParam ContextType - Type of context that can be passed to the graph\n * @typeParam InputType - Type of input values accepted by the graph\n * @typeParam OutputType - Type of output values produced by the graph\n */\nexport declare class Pregel<Nodes extends StrRecord<string, PregelNode>, Channels extends StrRecord<string, BaseChannel>, ContextType extends Record<string, any> = StrRecord<string, any>, InputType = PregelInputType, OutputType = PregelOutputType, StreamUpdatesType = InputType, StreamValuesType = OutputType, NodeReturnType = unknown, CommandType = CommandInstance, StreamCustom = any> extends PartialRunnable<InputType | CommandType | null, OutputType, PregelOptions<Nodes, Channels, ContextType>> implements PregelInterface<Nodes, Channels, ContextType> {\n /**\n * Name of the class when serialized\n * @internal\n */\n static lc_name(): string;\n /** @internal Used for type inference */\n \"~InputType\": InputType;\n /** @internal Used for type inference */\n \"~OutputType\": OutputType;\n /** @internal LangChain namespace for serialization necessary because Pregel extends Runnable */\n lc_namespace: string[];\n /** @internal Flag indicating this is a Pregel instance - necessary for serialization */\n lg_is_pregel: boolean;\n /** The nodes in the graph, mapping node names to their PregelNode instances */\n nodes: Nodes;\n /** The channels in the graph, mapping channel names to their BaseChannel or ManagedValueSpec instances */\n channels: Channels;\n /**\n * The input channels for the graph. These channels receive the initial input when the graph is invoked.\n * Can be a single channel key or an array of channel keys.\n */\n inputChannels: keyof Channels | Array<keyof Channels>;\n /**\n * The output channels for the graph. These channels contain the final output when the graph completes.\n * Can be a single channel key or an array of channel keys.\n */\n outputChannels: keyof Channels | Array<keyof Channels>;\n /** Whether to automatically validate the graph structure when it is compiled. Defaults to true. */\n autoValidate: boolean;\n /**\n * The streaming modes enabled for this graph. Defaults to [\"values\"].\n * Supported modes:\n * - \"values\": Streams the full state after each step\n * - \"updates\": Streams state updates after each step\n * - \"messages\": Streams messages from within nodes\n * - \"custom\": Streams custom events from within nodes\n * - \"debug\": Streams events related to the execution of the graph - useful for tracing & debugging graph execution\n */\n streamMode: StreamMode[];\n /**\n * Optional channels to stream. If not specified, all channels will be streamed.\n * Can be a single channel key or an array of channel keys.\n */\n streamChannels?: keyof Channels | Array<keyof Channels>;\n /**\n * Optional array of node names or \"all\" to interrupt after executing these nodes.\n * Used for implementing human-in-the-loop workflows.\n */\n interruptAfter?: Array<keyof Nodes> | All;\n /**\n * Optional array of node names or \"all\" to interrupt before executing these nodes.\n * Used for implementing human-in-the-loop workflows.\n */\n interruptBefore?: Array<keyof Nodes> | All;\n /** Optional timeout in milliseconds for the execution of each superstep */\n stepTimeout?: number;\n /** Whether to enable debug logging. Defaults to false. */\n debug: boolean;\n /**\n * Optional checkpointer for persisting graph state.\n * When provided, saves a checkpoint of the graph state at every superstep.\n * When false or undefined, checkpointing is disabled, and the graph will not be able to save or restore state.\n */\n checkpointer?: BaseCheckpointSaver | boolean;\n /** Optional retry policy for handling failures in node execution */\n retryPolicy?: RetryPolicy;\n /** The default configuration for graph execution, can be overridden on a per-invocation basis */\n config?: LangGraphRunnableConfig;\n /**\n * Optional long-term memory store for the graph, allows for persistence & retrieval of data across threads\n */\n store?: BaseStore;\n /**\n * Optional cache for the graph, useful for caching tasks.\n */\n cache?: BaseCache;\n /**\n * Optional interrupt helper function.\n * @internal\n */\n private userInterrupt?;\n /**\n * The trigger to node mapping for the graph run.\n * @internal\n */\n private triggerToNodes;\n /**\n * Constructor for Pregel - meant for internal use only.\n *\n * @internal\n */\n constructor(fields: PregelParams<Nodes, Channels>);\n /**\n * Creates a new instance of the Pregel graph with updated configuration.\n * This method follows the immutable pattern - instead of modifying the current instance,\n * it returns a new instance with the merged configuration.\n *\n * @example\n * ```typescript\n * // Create a new instance with debug enabled\n * const debugGraph = graph.withConfig({ debug: true });\n *\n * // Create a new instance with a specific thread ID\n * const threadGraph = graph.withConfig({\n * configurable: { thread_id: \"123\" }\n * });\n * ```\n *\n * @param config - The configuration to merge with the current configuration\n * @returns A new Pregel instance with the merged configuration\n */\n withConfig(config: Omit<LangGraphRunnableConfig, \"store\" | \"writer\" | \"interrupt\">): typeof this;\n /**\n * Validates the graph structure to ensure it is well-formed.\n * Checks for:\n * - No orphaned nodes\n * - Valid input/output channel configurations\n * - Valid interrupt configurations\n *\n * @returns this - The Pregel instance for method chaining\n * @throws {GraphValidationError} If the graph structure is invalid\n */\n validate(): this;\n /**\n * Gets a list of all channels that should be streamed.\n * If streamChannels is specified, returns those channels.\n * Otherwise, returns all channels in the graph.\n *\n * @returns Array of channel keys to stream\n */\n get streamChannelsList(): Array<keyof Channels>;\n /**\n * Gets the channels to stream in their original format.\n * If streamChannels is specified, returns it as-is (either single key or array).\n * Otherwise, returns all channels in the graph as an array.\n *\n * @returns Channel keys to stream, either as a single key or array\n */\n get streamChannelsAsIs(): keyof Channels | Array<keyof Channels>;\n /**\n * Gets a drawable representation of the graph structure.\n * This is an async version of getGraph() and is the preferred method to use.\n *\n * @param config - Configuration for generating the graph visualization\n * @returns A representation of the graph that can be visualized\n */\n getGraphAsync(config: RunnableConfig): Promise<import(\"@langchain/core/runnables/graph\").Graph>;\n /**\n * Gets all subgraphs within this graph.\n * A subgraph is a Pregel instance that is nested within a node of this graph.\n *\n * @deprecated Use getSubgraphsAsync instead. The async method will become the default in the next minor release.\n * @param namespace - Optional namespace to filter subgraphs\n * @param recurse - Whether to recursively get subgraphs of subgraphs\n * @returns Generator yielding tuples of [name, subgraph]\n */\n getSubgraphs(namespace?: string, recurse?: boolean): Generator<[string, Pregel<any, any>]>;\n /**\n * Gets all subgraphs within this graph asynchronously.\n * A subgraph is a Pregel instance that is nested within a node of this graph.\n *\n * @param namespace - Optional namespace to filter subgraphs\n * @param recurse - Whether to recursively get subgraphs of subgraphs\n * @returns AsyncGenerator yielding tuples of [name, subgraph]\n */\n getSubgraphsAsync(namespace?: string, recurse?: boolean): AsyncGenerator<[string, Pregel<any, any>]>;\n /**\n * Prepares a state snapshot from saved checkpoint data.\n * This is an internal method used by getState and getStateHistory.\n *\n * @param config - Configuration for preparing the snapshot\n * @param saved - Optional saved checkpoint data\n * @param subgraphCheckpointer - Optional checkpointer for subgraphs\n * @param applyPendingWrites - Whether to apply pending writes to tasks and then to channels\n * @returns A snapshot of the graph state\n * @internal\n */\n protected _prepareStateSnapshot({ config, saved, subgraphCheckpointer, applyPendingWrites }: {\n config: RunnableConfig;\n saved?: CheckpointTuple;\n subgraphCheckpointer?: BaseCheckpointSaver;\n applyPendingWrites?: boolean;\n }): Promise<StateSnapshot>;\n /**\n * Gets the current state of the graph.\n * Requires a checkpointer to be configured.\n *\n * @param config - Configuration for retrieving the state\n * @param options - Additional options\n * @returns A snapshot of the current graph state\n * @throws {GraphValueError} If no checkpointer is configured\n */\n getState(config: RunnableConfig, options?: GetStateOptions): Promise<StateSnapshot>;\n /**\n * Gets the history of graph states.\n * Requires a checkpointer to be configured.\n * Useful for:\n * - Debugging execution history\n * - Implementing time travel\n * - Analyzing graph behavior\n *\n * @param config - Configuration for retrieving the history\n * @param options - Options for filtering the history\n * @returns An async iterator of state snapshots\n * @throws {Error} If no checkpointer is configured\n */\n getStateHistory(config: RunnableConfig, options?: CheckpointListOptions): AsyncIterableIterator<StateSnapshot>;\n /**\n * Apply updates to the graph state in bulk.\n * Requires a checkpointer to be configured.\n *\n * This method is useful for recreating a thread\n * from a list of updates, especially if a checkpoint\n * is created as a result of multiple tasks.\n *\n * @internal The API might change in the future.\n *\n * @param startConfig - Configuration for the update\n * @param updates - The list of updates to apply to graph state\n * @returns Updated configuration\n * @throws {GraphValueError} If no checkpointer is configured\n * @throws {InvalidUpdateError} If the update cannot be attributed to a node or an update can be only applied in sequence.\n */\n bulkUpdateState(startConfig: LangGraphRunnableConfig, supersteps: Array<{\n updates: Array<{\n values?: Record<string, unknown> | unknown;\n asNode?: keyof Nodes | string;\n }>;\n }>): Promise<RunnableConfig>;\n /**\n * Updates the state of the graph with new values.\n * Requires a checkpointer to be configured.\n *\n * This method can be used for:\n * - Implementing human-in-the-loop workflows\n * - Modifying graph state during breakpoints\n * - Integrating external inputs into the graph\n *\n * @param inputConfig - Configuration for the update\n * @param values - The values to update the state with\n * @param asNode - Optional node name to attribute the update to\n * @returns Updated configuration\n * @throws {GraphValueError} If no checkpointer is configured\n * @throws {InvalidUpdateError} If the update cannot be attributed to a node\n */\n updateState(inputConfig: LangGraphRunnableConfig, values: Record<string, unknown> | unknown, asNode?: keyof Nodes | string): Promise<RunnableConfig>;\n /**\n * Gets the default values for various graph configuration options.\n * This is an internal method used to process and normalize configuration options.\n *\n * @param config - The input configuration options\n * @returns A tuple containing normalized values for:\n * - debug mode\n * - stream modes\n * - input keys\n * - output keys\n * - remaining config\n * - interrupt before nodes\n * - interrupt after nodes\n * - checkpointer\n * - store\n * - whether stream mode is single\n * - node cache\n * - whether checkpoint during is enabled\n * @internal\n */\n _defaults(config: PregelOptions<Nodes, Channels>): [\n boolean,\n StreamMode[],\n string | string[],\n string | string[],\n LangGraphRunnableConfig,\n All | string[],\n All | string[],\n BaseCheckpointSaver | undefined,\n BaseStore | undefined,\n boolean,\n BaseCache | undefined,\n Durability\n ];\n /**\n * Streams the execution of the graph, emitting state updates as they occur.\n * This is the primary method for observing graph execution in real-time.\n *\n * Stream modes:\n * - \"values\": Emits complete state after each step\n * - \"updates\": Emits only state changes after each step\n * - \"debug\": Emits detailed debug information\n * - \"messages\": Emits messages from within nodes\n * - \"custom\": Emits custom events from within nodes\n * - \"checkpoints\": Emits checkpoints from within nodes\n * - \"tasks\": Emits tasks from within nodes\n *\n * @param input - The input to start graph execution with\n * @param options - Configuration options for streaming\n * @returns An async iterable stream of graph state updates\n */\n stream<TStreamMode extends StreamMode | StreamMode[] | undefined, TSubgraphs extends boolean, TEncoding extends \"text/event-stream\" | undefined>(input: InputType | CommandType | null, options?: Partial<PregelOptions<Nodes, Channels, ContextType, TStreamMode, TSubgraphs, TEncoding>>): Promise<IterableReadableStream<StreamOutputMap<TStreamMode, TSubgraphs, StreamUpdatesType, StreamValuesType, keyof Nodes, NodeReturnType, StreamCustom, TEncoding>>>;\n /**\n * @inheritdoc\n */\n streamEvents(input: InputType | CommandType | null, options: Partial<PregelOptions<Nodes, Channels, ContextType>> & {\n version: \"v1\" | \"v2\";\n }, streamOptions?: StreamEventsOptions): IterableReadableStream<StreamEvent>;\n streamEvents(input: InputType | CommandType | null, options: Partial<PregelOptions<Nodes, Channels, ContextType>> & {\n version: \"v1\" | \"v2\";\n encoding: \"text/event-stream\";\n }, streamOptions?: StreamEventsOptions): IterableReadableStream<Uint8Array>;\n /**\n * Validates the input for the graph.\n * @param input - The input to validate\n * @returns The validated input\n * @internal\n */\n protected _validateInput(input: PregelInputType): Promise<any>;\n /**\n * Validates the context options for the graph.\n * @param context - The context options to validate\n * @returns The validated context options\n * @internal\n */\n protected _validateContext(context: Partial<LangGraphRunnableConfig[\"context\"]>): Promise<LangGraphRunnableConfig[\"context\"]>;\n /**\n * Internal iterator used by stream() to generate state updates.\n * This method handles the core logic of graph execution and streaming.\n *\n * @param input - The input to start graph execution with\n * @param options - Configuration options for streaming\n * @returns AsyncGenerator yielding state updates\n * @internal\n */\n _streamIterator(input: PregelInputType | Command, options?: Partial<PregelOptions<Nodes, Channels>>): AsyncGenerator<PregelOutputType>;\n /**\n * Run the graph with a single input and config.\n * @param input The input to the graph.\n * @param options The configuration to use for the run.\n */\n invoke(input: InputType | CommandType | null, options?: Partial<Omit<PregelOptions<Nodes, Channels, ContextType>, \"encoding\">>): Promise<OutputType>;\n private _runLoop;\n clearCache(): Promise<void>;\n}\n"],"mappings":";;;;;;;;;;;;;;;KAYK+B,UAAAA,GAAa/B,WAAWE;KACxB8B,mBAAAA,GAAsBC,WAAWjC;;AAFI;;;;;AACD;AACjB,cAQHkC,OAAAA,CARG;;;;AAQxB;;;;;;;;;;AAwEiE;;;;;;;;SAGzBM,WAAAA,CAAAA,OAAAA,EAAAA,MAAAA,EAAAA,OAAAA,CAAAA,EArDUf,gCAqDVe,CAAAA,EArD6CzB,UAqD7CyB;;;;;;;;;;AA+DxC;;;;;;;;;;;;SAA8V3B,WAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA,EAAAA,OAAAA,CAAAA,EA9FzSM,kCA8FySN,CAAAA,EA9FpQE,UA8FoQF;;;;;;;;;;;;;;;;;;;;;;;;;;SAiDzUoC,OAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA,EAAAA,MAAAA,CAAAA,EArH2Bd,MAqH3Bc,CAAAA,MAAAA,EArH0ClB,UAqH1CkB,CAAAA,CAAAA,EArHwDnB,YAqHxDmB;;cAlHPb,eAuHQa,CAAAA,QAAAA,EAAAA,SAAAA,EAAAA,oBAvHiDhD,cAuHjDgD,CAAAA,SAvHyEjD,QAuHzEiD,CAvHkFZ,QAuHlFY,EAvH4FX,SAuH5FW,EAvHuGV,WAuHvGU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|
1
|
-
{"version":3,"file":"index.d.ts","names":["Runnable","RunnableConfig","RunnableFunc","StreamEvent","IterableReadableStream","All","BaseCache","BaseCheckpointSaver","BaseStore","CheckpointListOptions","CheckpointTuple","BaseChannel","Command","CommandInstance","StrRecord","PregelNode","LangGraphRunnableConfig","Durability","GetStateOptions","MultipleChannelSubscriptionOptions","PregelInputType","PregelInterface","PregelOptions","PregelOutputType","PregelParams","SingleChannelSubscriptionOptions","StateSnapshot","StreamMode","StreamOutputMap","RetryPolicy","ChannelWrite","WriteValue","StreamEventsOptions","Parameters","Channel","Record","PartialRunnable","RunInput","RunOutput","CallOptions","Partial","Promise","Pregel","InputType","OutputType","CommandType","Nodes","Channels","ContextType","Array","Omit","_langchain_core_runnables_graph0","Graph","Generator","AsyncGenerator","config","saved","subgraphCheckpointer","applyPendingWrites","AsyncIterableIterator","TStreamMode","TSubgraphs","TEncoding","StreamUpdatesType","StreamValuesType","NodeReturnType","StreamCustom","Uint8Array"],"sources":["../../src/pregel/index.d.ts"],"sourcesContent":["import { Runnable, RunnableConfig, RunnableFunc } from \"@langchain/core/runnables\";\nimport type { StreamEvent } from \"@langchain/core/tracers/log_stream\";\nimport { IterableReadableStream } from \"@langchain/core/utils/stream\";\nimport { All, BaseCache, BaseCheckpointSaver, BaseStore, CheckpointListOptions, CheckpointTuple } from \"@langchain/langgraph-checkpoint\";\nimport { BaseChannel } from \"../channels/base.js\";\nimport { Command, type CommandInstance } from \"../constants.js\";\nimport { StrRecord } from \"./algo.js\";\nimport { PregelNode } from \"./read.js\";\nimport { LangGraphRunnableConfig } from \"./runnable_types.js\";\nimport type { Durability, GetStateOptions, MultipleChannelSubscriptionOptions, PregelInputType, PregelInterface, PregelOptions, PregelOutputType, PregelParams, SingleChannelSubscriptionOptions, StateSnapshot, StreamMode, StreamOutputMap } from \"./types.js\";\nimport { RetryPolicy } from \"./utils/index.js\";\nimport { ChannelWrite } from \"./write.js\";\ntype WriteValue = Runnable | RunnableFunc<unknown, unknown> | unknown;\ntype StreamEventsOptions = Parameters<Runnable[\"streamEvents\"]>[2];\n/**\n * Utility class for working with channels in the Pregel system.\n * Provides static methods for subscribing to channels and writing to them.\n *\n * Channels are the communication pathways between nodes in a Pregel graph.\n * They enable message passing and state updates between different parts of the graph.\n */\nexport declare class Channel {\n /**\n * Creates a PregelNode that subscribes to a single channel.\n * This is used to define how nodes receive input from channels.\n *\n * @example\n * ```typescript\n * // Subscribe to a single channel\n * const node = Channel.subscribeTo(\"messages\");\n *\n * // Subscribe to multiple channels\n * const node = Channel.subscribeTo([\"messages\", \"state\"]);\n *\n * // Subscribe with a custom key\n * const node = Channel.subscribeTo(\"messages\", { key: \"chat\" });\n * ```\n *\n * @param channel Single channel name to subscribe to\n * @param options Subscription options\n * @returns A PregelNode configured to receive from the specified channels\n * @throws {Error} If a key is specified when subscribing to multiple channels\n */\n static subscribeTo(channel: string, options?: SingleChannelSubscriptionOptions): PregelNode;\n /**\n * Creates a PregelNode that subscribes to multiple channels.\n * This is used to define how nodes receive input from channels.\n *\n * @example\n * ```typescript\n * // Subscribe to a single channel\n * const node = Channel.subscribeTo(\"messages\");\n *\n * // Subscribe to multiple channels\n * const node = Channel.subscribeTo([\"messages\", \"state\"]);\n *\n * // Subscribe with a custom key\n * const node = Channel.subscribeTo(\"messages\", { key: \"chat\" });\n * ```\n *\n * @param channels Single channel name to subscribe to\n * @param options Subscription options\n * @returns A PregelNode configured to receive from the specified channels\n * @throws {Error} If a key is specified when subscribing to multiple channels\n */\n static subscribeTo(channels: string[], options?: MultipleChannelSubscriptionOptions): PregelNode;\n /**\n * Creates a ChannelWrite that specifies how to write values to channels.\n * This is used to define how nodes send output to channels.\n *\n * @example\n * ```typescript\n * // Write to multiple channels\n * const write = Channel.writeTo([\"output\", \"state\"]);\n *\n * // Write with specific values\n * const write = Channel.writeTo([\"output\"], {\n * state: \"completed\",\n * result: calculateResult()\n * });\n *\n * // Write with a transformation function\n * const write = Channel.writeTo([\"output\"], {\n * result: (x) => processResult(x)\n * });\n * ```\n *\n * @param channels - Array of channel names to write to\n * @param writes - Optional map of channel names to values or transformations\n * @returns A ChannelWrite object that can be used to write to the specified channels\n */\n static writeTo(channels: string[], writes?: Record<string, WriteValue>): ChannelWrite;\n}\nexport type { PregelInputType, PregelOptions, PregelOutputType };\ndeclare class PartialRunnable<RunInput, RunOutput, CallOptions extends RunnableConfig> extends Runnable<RunInput, RunOutput, CallOptions> {\n lc_namespace: string[];\n invoke(_input: RunInput, _options?: Partial<CallOptions>): Promise<any>;\n withConfig(_config: CallOptions): typeof this;\n stream(input: RunInput, options?: Partial<CallOptions>): Promise<IterableReadableStream<any>>;\n}\n/**\n * The Pregel class is the core runtime engine of LangGraph, implementing a message-passing graph computation model\n * inspired by [Google's Pregel system](https://research.google/pubs/pregel-a-system-for-large-scale-graph-processing/).\n * It provides the foundation for building reliable, controllable agent workflows that can evolve state over time.\n *\n * Key features:\n * - Message passing between nodes in discrete \"supersteps\"\n * - Built-in persistence layer through checkpointers\n * - First-class streaming support for values, updates, and events\n * - Human-in-the-loop capabilities via interrupts\n * - Support for parallel node execution within supersteps\n *\n * The Pregel class is not intended to be instantiated directly by consumers. Instead, use the following higher-level APIs:\n * - {@link StateGraph}: The main graph class for building agent workflows\n * - Compiling a {@link StateGraph} will return a {@link CompiledGraph} instance, which extends `Pregel`\n * - Functional API: A declarative approach using tasks and entrypoints\n * - A `Pregel` instance is returned by the {@link entrypoint} function\n *\n * @example\n * ```typescript\n * // Using StateGraph API\n * const graph = new StateGraph(annotation)\n * .addNode(\"nodeA\", myNodeFunction)\n * .addEdge(\"nodeA\", \"nodeB\")\n * .compile();\n *\n * // The compiled graph is a Pregel instance\n * const result = await graph.invoke(input);\n * ```\n *\n * @example\n * ```typescript\n * // Using Functional API\n * import { task, entrypoint } from \"@langchain/langgraph\";\n * import { MemorySaver } from \"@langchain/langgraph-checkpoint\";\n *\n * // Define tasks that can be composed\n * const addOne = task(\"add\", async (x: number) => x + 1);\n *\n * // Create a workflow using the entrypoint function\n * const workflow = entrypoint({\n * name: \"workflow\",\n * checkpointer: new MemorySaver()\n * }, async (numbers: number[]) => {\n * // Tasks can be run in parallel\n * const results = await Promise.all(numbers.map(n => addOne(n)));\n * return results;\n * });\n *\n * // The workflow is a Pregel instance\n * const result = await workflow.invoke([1, 2, 3]); // Returns [2, 3, 4]\n * ```\n *\n * @typeParam Nodes - Mapping of node names to their {@link PregelNode} implementations\n * @typeParam Channels - Mapping of channel names to their {@link BaseChannel} or {@link ManagedValueSpec} implementations\n * @typeParam ContextType - Type of context that can be passed to the graph\n * @typeParam InputType - Type of input values accepted by the graph\n * @typeParam OutputType - Type of output values produced by the graph\n */\nexport declare class Pregel<Nodes extends StrRecord<string, PregelNode>, Channels extends StrRecord<string, BaseChannel>, ContextType extends Record<string, any> = StrRecord<string, any>, InputType = PregelInputType, OutputType = PregelOutputType, StreamUpdatesType = InputType, StreamValuesType = OutputType, NodeReturnType = unknown, CommandType = CommandInstance, StreamCustom = any> extends PartialRunnable<InputType | CommandType | null, OutputType, PregelOptions<Nodes, Channels, ContextType>> implements PregelInterface<Nodes, Channels, ContextType> {\n /**\n * Name of the class when serialized\n * @internal\n */\n static lc_name(): string;\n /** @internal Used for type inference */\n \"~InputType\": InputType;\n /** @internal Used for type inference */\n \"~OutputType\": OutputType;\n /** @internal LangChain namespace for serialization necessary because Pregel extends Runnable */\n lc_namespace: string[];\n /** @internal Flag indicating this is a Pregel instance - necessary for serialization */\n lg_is_pregel: boolean;\n /** The nodes in the graph, mapping node names to their PregelNode instances */\n nodes: Nodes;\n /** The channels in the graph, mapping channel names to their BaseChannel or ManagedValueSpec instances */\n channels: Channels;\n /**\n * The input channels for the graph. These channels receive the initial input when the graph is invoked.\n * Can be a single channel key or an array of channel keys.\n */\n inputChannels: keyof Channels | Array<keyof Channels>;\n /**\n * The output channels for the graph. These channels contain the final output when the graph completes.\n * Can be a single channel key or an array of channel keys.\n */\n outputChannels: keyof Channels | Array<keyof Channels>;\n /** Whether to automatically validate the graph structure when it is compiled. Defaults to true. */\n autoValidate: boolean;\n /**\n * The streaming modes enabled for this graph. Defaults to [\"values\"].\n * Supported modes:\n * - \"values\": Streams the full state after each step\n * - \"updates\": Streams state updates after each step\n * - \"messages\": Streams messages from within nodes\n * - \"custom\": Streams custom events from within nodes\n * - \"debug\": Streams events related to the execution of the graph - useful for tracing & debugging graph execution\n */\n streamMode: StreamMode[];\n /**\n * Optional channels to stream. If not specified, all channels will be streamed.\n * Can be a single channel key or an array of channel keys.\n */\n streamChannels?: keyof Channels | Array<keyof Channels>;\n /**\n * Optional array of node names or \"all\" to interrupt after executing these nodes.\n * Used for implementing human-in-the-loop workflows.\n */\n interruptAfter?: Array<keyof Nodes> | All;\n /**\n * Optional array of node names or \"all\" to interrupt before executing these nodes.\n * Used for implementing human-in-the-loop workflows.\n */\n interruptBefore?: Array<keyof Nodes> | All;\n /** Optional timeout in milliseconds for the execution of each superstep */\n stepTimeout?: number;\n /** Whether to enable debug logging. Defaults to false. */\n debug: boolean;\n /**\n * Optional checkpointer for persisting graph state.\n * When provided, saves a checkpoint of the graph state at every superstep.\n * When false or undefined, checkpointing is disabled, and the graph will not be able to save or restore state.\n */\n checkpointer?: BaseCheckpointSaver | boolean;\n /** Optional retry policy for handling failures in node execution */\n retryPolicy?: RetryPolicy;\n /** The default configuration for graph execution, can be overridden on a per-invocation basis */\n config?: LangGraphRunnableConfig;\n /**\n * Optional long-term memory store for the graph, allows for persistence & retrieval of data across threads\n */\n store?: BaseStore;\n /**\n * Optional cache for the graph, useful for caching tasks.\n */\n cache?: BaseCache;\n /**\n * Optional interrupt helper function.\n * @internal\n */\n private userInterrupt?;\n /**\n * The trigger to node mapping for the graph run.\n * @internal\n */\n private triggerToNodes;\n /**\n * Constructor for Pregel - meant for internal use only.\n *\n * @internal\n */\n constructor(fields: PregelParams<Nodes, Channels>);\n /**\n * Creates a new instance of the Pregel graph with updated configuration.\n * This method follows the immutable pattern - instead of modifying the current instance,\n * it returns a new instance with the merged configuration.\n *\n * @example\n * ```typescript\n * // Create a new instance with debug enabled\n * const debugGraph = graph.withConfig({ debug: true });\n *\n * // Create a new instance with a specific thread ID\n * const threadGraph = graph.withConfig({\n * configurable: { thread_id: \"123\" }\n * });\n * ```\n *\n * @param config - The configuration to merge with the current configuration\n * @returns A new Pregel instance with the merged configuration\n */\n withConfig(config: Omit<LangGraphRunnableConfig, \"store\" | \"writer\" | \"interrupt\">): typeof this;\n /**\n * Validates the graph structure to ensure it is well-formed.\n * Checks for:\n * - No orphaned nodes\n * - Valid input/output channel configurations\n * - Valid interrupt configurations\n *\n * @returns this - The Pregel instance for method chaining\n * @throws {GraphValidationError} If the graph structure is invalid\n */\n validate(): this;\n /**\n * Gets a list of all channels that should be streamed.\n * If streamChannels is specified, returns those channels.\n * Otherwise, returns all channels in the graph.\n *\n * @returns Array of channel keys to stream\n */\n get streamChannelsList(): Array<keyof Channels>;\n /**\n * Gets the channels to stream in their original format.\n * If streamChannels is specified, returns it as-is (either single key or array).\n * Otherwise, returns all channels in the graph as an array.\n *\n * @returns Channel keys to stream, either as a single key or array\n */\n get streamChannelsAsIs(): keyof Channels | Array<keyof Channels>;\n /**\n * Gets a drawable representation of the graph structure.\n * This is an async version of getGraph() and is the preferred method to use.\n *\n * @param config - Configuration for generating the graph visualization\n * @returns A representation of the graph that can be visualized\n */\n getGraphAsync(config: RunnableConfig): Promise<import(\"@langchain/core/runnables/graph\").Graph>;\n /**\n * Gets all subgraphs within this graph.\n * A subgraph is a Pregel instance that is nested within a node of this graph.\n *\n * @deprecated Use getSubgraphsAsync instead. The async method will become the default in the next minor release.\n * @param namespace - Optional namespace to filter subgraphs\n * @param recurse - Whether to recursively get subgraphs of subgraphs\n * @returns Generator yielding tuples of [name, subgraph]\n */\n getSubgraphs(namespace?: string, recurse?: boolean): Generator<[string, Pregel<any, any>]>;\n /**\n * Gets all subgraphs within this graph asynchronously.\n * A subgraph is a Pregel instance that is nested within a node of this graph.\n *\n * @param namespace - Optional namespace to filter subgraphs\n * @param recurse - Whether to recursively get subgraphs of subgraphs\n * @returns AsyncGenerator yielding tuples of [name, subgraph]\n */\n getSubgraphsAsync(namespace?: string, recurse?: boolean): AsyncGenerator<[string, Pregel<any, any>]>;\n /**\n * Prepares a state snapshot from saved checkpoint data.\n * This is an internal method used by getState and getStateHistory.\n *\n * @param config - Configuration for preparing the snapshot\n * @param saved - Optional saved checkpoint data\n * @param subgraphCheckpointer - Optional checkpointer for subgraphs\n * @param applyPendingWrites - Whether to apply pending writes to tasks and then to channels\n * @returns A snapshot of the graph state\n * @internal\n */\n protected _prepareStateSnapshot({ config, saved, subgraphCheckpointer, applyPendingWrites }: {\n config: RunnableConfig;\n saved?: CheckpointTuple;\n subgraphCheckpointer?: BaseCheckpointSaver;\n applyPendingWrites?: boolean;\n }): Promise<StateSnapshot>;\n /**\n * Gets the current state of the graph.\n * Requires a checkpointer to be configured.\n *\n * @param config - Configuration for retrieving the state\n * @param options - Additional options\n * @returns A snapshot of the current graph state\n * @throws {GraphValueError} If no checkpointer is configured\n */\n getState(config: RunnableConfig, options?: GetStateOptions): Promise<StateSnapshot>;\n /**\n * Gets the history of graph states.\n * Requires a checkpointer to be configured.\n * Useful for:\n * - Debugging execution history\n * - Implementing time travel\n * - Analyzing graph behavior\n *\n * @param config - Configuration for retrieving the history\n * @param options - Options for filtering the history\n * @returns An async iterator of state snapshots\n * @throws {Error} If no checkpointer is configured\n */\n getStateHistory(config: RunnableConfig, options?: CheckpointListOptions): AsyncIterableIterator<StateSnapshot>;\n /**\n * Apply updates to the graph state in bulk.\n * Requires a checkpointer to be configured.\n *\n * This method is useful for recreating a thread\n * from a list of updates, especially if a checkpoint\n * is created as a result of multiple tasks.\n *\n * @internal The API might change in the future.\n *\n * @param startConfig - Configuration for the update\n * @param updates - The list of updates to apply to graph state\n * @returns Updated configuration\n * @throws {GraphValueError} If no checkpointer is configured\n * @throws {InvalidUpdateError} If the update cannot be attributed to a node or an update can be only applied in sequence.\n */\n bulkUpdateState(startConfig: LangGraphRunnableConfig, supersteps: Array<{\n updates: Array<{\n values?: Record<string, unknown> | unknown;\n asNode?: keyof Nodes | string;\n }>;\n }>): Promise<RunnableConfig>;\n /**\n * Updates the state of the graph with new values.\n * Requires a checkpointer to be configured.\n *\n * This method can be used for:\n * - Implementing human-in-the-loop workflows\n * - Modifying graph state during breakpoints\n * - Integrating external inputs into the graph\n *\n * @param inputConfig - Configuration for the update\n * @param values - The values to update the state with\n * @param asNode - Optional node name to attribute the update to\n * @returns Updated configuration\n * @throws {GraphValueError} If no checkpointer is configured\n * @throws {InvalidUpdateError} If the update cannot be attributed to a node\n */\n updateState(inputConfig: LangGraphRunnableConfig, values: Record<string, unknown> | unknown, asNode?: keyof Nodes | string): Promise<RunnableConfig>;\n /**\n * Gets the default values for various graph configuration options.\n * This is an internal method used to process and normalize configuration options.\n *\n * @param config - The input configuration options\n * @returns A tuple containing normalized values for:\n * - debug mode\n * - stream modes\n * - input keys\n * - output keys\n * - remaining config\n * - interrupt before nodes\n * - interrupt after nodes\n * - checkpointer\n * - store\n * - whether stream mode is single\n * - node cache\n * - whether checkpoint during is enabled\n * @internal\n */\n _defaults(config: PregelOptions<Nodes, Channels>): [\n boolean,\n StreamMode[],\n string | string[],\n string | string[],\n LangGraphRunnableConfig,\n All | string[],\n All | string[],\n BaseCheckpointSaver | undefined,\n BaseStore | undefined,\n boolean,\n BaseCache | undefined,\n Durability\n ];\n /**\n * Streams the execution of the graph, emitting state updates as they occur.\n * This is the primary method for observing graph execution in real-time.\n *\n * Stream modes:\n * - \"values\": Emits complete state after each step\n * - \"updates\": Emits only state changes after each step\n * - \"debug\": Emits detailed debug information\n * - \"messages\": Emits messages from within nodes\n * - \"custom\": Emits custom events from within nodes\n * - \"checkpoints\": Emits checkpoints from within nodes\n * - \"tasks\": Emits tasks from within nodes\n *\n * @param input - The input to start graph execution with\n * @param options - Configuration options for streaming\n * @returns An async iterable stream of graph state updates\n */\n stream<TStreamMode extends StreamMode | StreamMode[] | undefined, TSubgraphs extends boolean, TEncoding extends \"text/event-stream\" | undefined>(input: InputType | CommandType | null, options?: Partial<PregelOptions<Nodes, Channels, ContextType, TStreamMode, TSubgraphs, TEncoding>>): Promise<IterableReadableStream<StreamOutputMap<TStreamMode, TSubgraphs, StreamUpdatesType, StreamValuesType, keyof Nodes, NodeReturnType, StreamCustom, TEncoding>>>;\n /**\n * @inheritdoc\n */\n streamEvents(input: InputType | CommandType | null, options: Partial<PregelOptions<Nodes, Channels, ContextType>> & {\n version: \"v1\" | \"v2\";\n }, streamOptions?: StreamEventsOptions): IterableReadableStream<StreamEvent>;\n streamEvents(input: InputType | CommandType | null, options: Partial<PregelOptions<Nodes, Channels, ContextType>> & {\n version: \"v1\" | \"v2\";\n encoding: \"text/event-stream\";\n }, streamOptions?: StreamEventsOptions): IterableReadableStream<Uint8Array>;\n /**\n * Validates the input for the graph.\n * @param input - The input to validate\n * @returns The validated input\n * @internal\n */\n protected _validateInput(input: PregelInputType): Promise<any>;\n /**\n * Validates the context options for the graph.\n * @param context - The context options to validate\n * @returns The validated context options\n * @internal\n */\n protected _validateContext(context: Partial<LangGraphRunnableConfig[\"context\"]>): Promise<LangGraphRunnableConfig[\"context\"]>;\n /**\n * Internal iterator used by stream() to generate state updates.\n * This method handles the core logic of graph execution and streaming.\n *\n * @param input - The input to start graph execution with\n * @param options - Configuration options for streaming\n * @returns AsyncGenerator yielding state updates\n * @internal\n */\n _streamIterator(input: PregelInputType | Command, options?: Partial<PregelOptions<Nodes, Channels>>): AsyncGenerator<PregelOutputType>;\n /**\n * Run the graph with a single input and config.\n * @param input The input to the graph.\n * @param options The configuration to use for the run.\n */\n invoke(input: InputType | CommandType | null, options?: Partial<Omit<PregelOptions<Nodes, Channels, ContextType>, \"encoding\">>): Promise<OutputType>;\n private _runLoop;\n clearCache(): Promise<void>;\n}\n"],"mappings":";;;;;;;;;;;;;;;KAYK+B,UAAAA,GAAa/B,WAAWE;KACxB8B,mBAAAA,GAAsBC,WAAWjC;;AAF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Q,aAAA,CAAc,KAAA,EAAO,QAAA,EAAU,WAAA;IAC9C,OAAA;IACA,QAAA;EAAA,GAEF,aAAA,GAAgB,mBAAA,GACf,sBAAA,CAAuB,UAAA;EAlExB;;;;;;EAAA,UAqGc,cAAA,CAAe,KAAA,EAAO,eAAA,GAAe,OAAA;EA9F/C;;;;;;EAAA,UAwGU,gBAAA,CACd,OAAA,EAAS,OAAA,CAAQ,uBAAA,eAChB,OAAA,CAAQ,uBAAA;EAlGL;;;;;;;;;EA+GU,eAAA,CACd,KAAA,EAAO,eAAA,GAAkB,OAAA,EACzB,OAAA,GAAU,OAAA,CAAQ,aAAA,CAAc,KAAA,EAAO,QAAA,KACtC,cAAA,CAAe,gBAAA;EA7EhB;;;;;EAkTa,MAAA,CACb,KAAA,EAAO,SAAA,GAAY,WAAA,SACnB,OAAA,GAAU,OAAA,CACR,IAAA,CAAK,aAAA,CAAc,KAAA,EAAO,QAAA,EAAU,WAAA,kBAErC,OAAA,CAAQ,UAAA;EAAA,QAwCG,QAAA;EAmER,UAAA,CAAA,GAAc,OAAA;AAAA"}
|
package/dist/pregel/read.d.cts
CHANGED
|
@@ -2,7 +2,6 @@ import { CachePolicy, RetryPolicy } from "./utils/index.cjs";
|
|
|
2
2
|
import { Runnable, RunnableBinding, RunnableBindingArgs, RunnableConfig, RunnableLike } from "@langchain/core/runnables";
|
|
3
3
|
|
|
4
4
|
//#region src/pregel/read.d.ts
|
|
5
|
-
|
|
6
5
|
interface PregelNodeArgs<RunInput, RunOutput> extends Partial<RunnableBindingArgs<RunInput, RunOutput>> {
|
|
7
6
|
channels: Record<string, string> | string[];
|
|
8
7
|
triggers: Array<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.d.cts","names":[
|
|
1
|
+
{"version":3,"file":"read.d.cts","names":[],"sources":["../../src/pregel/read.ts"],"mappings":";;;;UAuEU,cAAA,8BACA,OAAA,CAAQ,mBAAA,CAAoB,QAAA,EAAU,SAAA;EAC9C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RunnableBinding, RunnableBindingArgs, RunnableConfig, RunnableLike } from "@langchain/core/runnables";
|
|
3
4
|
|
|
4
5
|
//#region src/pregel/read.d.ts
|
|
5
|
-
|
|
6
6
|
interface PregelNodeArgs<RunInput, RunOutput> extends Partial<RunnableBindingArgs<RunInput, RunOutput>> {
|
|
7
7
|
channels: Record<string, string> | string[];
|
|
8
8
|
triggers: Array<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"read.d.ts","names":[],"sources":["../../src/pregel/read.ts"],"mappings":";;;;;UAuEU,cAAA,8BACA,OAAA,CAAQ,mBAAA,CAAoB,QAAA,EAAU,SAAA;EAC9C,QAAA,EAAU,MAAA;EACV,QAAA,EAAU,KAAA;EAEV,MAAA,IAAU,IAAA;EACV,OAAA,GAAU,QAAA,CAAS,SAAA;EACnB,IAAA;EACA,KAAA,GAAQ,QAAA,CAAS,QAAA,EAAU,SAAA;EAE3B,MAAA,GAAS,MAAA;EACT,MAAA,GAAS,cAAA;EACT,QAAA,GAAW,MAAA;EACX,WAAA,GAAc,WAAA;EACd,WAAA,GAAc,WAAA;EACd,SAAA,GAAY,QAAA;EACZ,IAAA;AAAA;AAAA,KAIU,mBAAA;AAAA,KAGA,oBAAA;AAAA,cAEC,UAAA,YACA,mBAAA,cACC,oBAAA,UACJ,eAAA,CAAgB,QAAA,EAAU,SAAA,EAAW,cAAA;EAC7C,aAAA;EAEA,QAAA,EAAU,MAAA;EAEV,QAAA;EAGA,MAAA,IAAU,IAAA;EAEV,OAAA,EAAS,QAAA;EAET,KAAA,EAAO,QAAA,CAAS,QAAA,EAAU,SAAA;EAG1B,MAAA,EAAQ,MAAA;EAER,QAAA,EAAU,MAAA;EAEV,IAAA;EAEA,WAAA,GAAc,WAAA;EAEd,WAAA,GAAc,WAAA;EAEd,SAAA,GAAY,QAAA;EAEZ,IAAA;EAEA,WAAA,CAAY,MAAA,EAAQ,cAAA,CAAe,QAAA,EAAU,SAAA;EA6C7C,UAAA,CAAA,GAAc,KAAA,CAAM,QAAA;EAsBpB,OAAA,CAAA,GAAW,QAAA,CAAS,QAAA,EAAU,SAAA;EAyB9B,IAAA,CAAK,QAAA,EAAU,KAAA,WAAgB,UAAA,CAAW,QAAA,EAAU,SAAA;EAwBpD,IAAA,cAAA,CACE,UAAA,EAAY,YAAA,GACX,UAAA,CAAW,QAAA,EAAU,OAAA,CAAQ,YAAA,EAAc,KAAA;AAAA"}
|
package/dist/pregel/remote.cjs
CHANGED
|
@@ -10,7 +10,7 @@ let _langchain_langgraph_sdk = require("@langchain/langgraph-sdk");
|
|
|
10
10
|
const _serializeInputs = (obj) => {
|
|
11
11
|
if (obj === null || typeof obj !== "object") return obj;
|
|
12
12
|
if (Array.isArray(obj)) return obj.map(_serializeInputs);
|
|
13
|
-
if (
|
|
13
|
+
if (_langchain_core_messages.BaseMessage.isInstance(obj)) return {
|
|
14
14
|
...obj.toDict().data,
|
|
15
15
|
role: obj.getType()
|
|
16
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.cjs","names":["Runnable","Client","CONFIG_KEY_STREAM","isCommand","CHECKPOINT_NAMESPACE_SEPARATOR","INTERRUPT","GraphInterrupt","RemoteException","DrawableGraph"],"sources":["../../src/pregel/remote.ts"],"sourcesContent":["import {\n Client,\n type Checkpoint,\n type ThreadState,\n} from \"@langchain/langgraph-sdk\";\nimport {\n Graph as DrawableGraph,\n Node as DrawableNode,\n} from \"@langchain/core/runnables/graph\";\nimport {\n mergeConfigs,\n Runnable,\n RunnableConfig,\n} from \"@langchain/core/runnables\";\nimport {\n All,\n CheckpointListOptions,\n CheckpointMetadata,\n} from \"@langchain/langgraph-checkpoint\";\nimport { StreamEvent } from \"@langchain/core/tracers/log_stream\";\nimport { IterableReadableStream } from \"@langchain/core/utils/stream\";\nimport { isBaseMessage } from \"@langchain/core/messages\";\n\nimport {\n BaseChannel,\n GraphInterrupt,\n LangGraphRunnableConfig,\n RemoteException,\n} from \"../web.js\";\nimport { StrRecord } from \"./algo.js\";\nimport { PregelInputType, PregelOptions, PregelOutputType } from \"./index.js\";\nimport { PregelNode } from \"./read.js\";\nimport {\n PregelParams,\n PregelInterface,\n PregelTaskDescription,\n StateSnapshot,\n StreamMode,\n} from \"./types.js\";\nimport {\n CHECKPOINT_NAMESPACE_SEPARATOR,\n CONFIG_KEY_STREAM,\n INTERRUPT,\n isCommand,\n} from \"../constants.js\";\n\nexport type RemoteGraphParams = Omit<\n PregelParams<StrRecord<string, PregelNode>, StrRecord<string, BaseChannel>>,\n \"channels\" | \"nodes\" | \"inputChannels\" | \"outputChannels\"\n> & {\n graphId: string;\n client?: Client;\n url?: string;\n apiKey?: string;\n headers?: Record<string, string>;\n streamResumable?: boolean;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst _serializeInputs = (obj: any): any => {\n if (obj === null || typeof obj !== \"object\") {\n return obj;\n }\n\n if (Array.isArray(obj)) {\n return obj.map(_serializeInputs);\n }\n\n // Handle BaseMessage instances by converting them to a serializable format\n if (isBaseMessage(obj)) {\n const dict = obj.toDict();\n return {\n ...dict.data,\n role: obj.getType(),\n };\n }\n\n return Object.fromEntries(\n Object.entries(obj).map(([key, value]) => [key, _serializeInputs(value)])\n );\n};\n\n/**\n * Return a tuple of the final list of stream modes sent to the\n * remote graph and a boolean flag indicating if only one stream mode was\n * originally requested and whether stream mode 'updates'\n * was present in the original list of stream modes.\n *\n * 'updates' mode is always added to the list of stream modes so that interrupts\n * can be detected in the remote graph.\n */\nconst getStreamModes = (\n streamMode?: StreamMode | StreamMode[],\n defaultStreamMode: StreamMode = \"updates\"\n) => {\n const updatedStreamModes: StreamMode[] = [];\n let reqUpdates = false;\n let reqSingle = true;\n\n if (\n streamMode !== undefined &&\n (typeof streamMode === \"string\" ||\n (Array.isArray(streamMode) && streamMode.length > 0))\n ) {\n reqSingle = typeof streamMode === \"string\";\n const mapped = Array.isArray(streamMode) ? streamMode : [streamMode];\n updatedStreamModes.push(...mapped);\n } else {\n updatedStreamModes.push(defaultStreamMode);\n }\n if (updatedStreamModes.includes(\"updates\")) {\n reqUpdates = true;\n } else {\n updatedStreamModes.push(\"updates\");\n }\n return {\n updatedStreamModes,\n reqUpdates,\n reqSingle,\n };\n};\n\n/**\n * The `RemoteGraph` class is a client implementation for calling remote\n * APIs that implement the LangGraph Server API specification.\n *\n * For example, the `RemoteGraph` class can be used to call APIs from deployments\n * on LangSmith Deployment.\n *\n * `RemoteGraph` behaves the same way as a `StateGraph` and can be used directly as\n * a node in another `StateGraph`.\n *\n * @example\n * ```ts\n * import { RemoteGraph } from \"@langchain/langgraph/remote\";\n *\n * // Can also pass a LangGraph SDK client instance directly\n * const remoteGraph = new RemoteGraph({\n * graphId: process.env.LANGGRAPH_REMOTE_GRAPH_ID!,\n * apiKey: process.env.LANGGRAPH_REMOTE_GRAPH_API_KEY,\n * url: process.env.LANGGRAPH_REMOTE_GRAPH_API_URL,\n * });\n *\n * const input = {\n * messages: [\n * {\n * role: \"human\",\n * content: \"Hello world!\",\n * },\n * ],\n * };\n *\n * const config = {\n * configurable: { thread_id: \"threadId1\" },\n * };\n *\n * await remoteGraph.invoke(input, config);\n * ```\n */\nexport class RemoteGraph<\n Nn extends StrRecord<string, PregelNode> = StrRecord<string, PregelNode>,\n Cc extends StrRecord<string, BaseChannel> = StrRecord<string, BaseChannel>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ContextType extends Record<string, any> = StrRecord<string, any>\n >\n extends Runnable<\n PregelInputType,\n PregelOutputType,\n PregelOptions<Nn, Cc, ContextType>\n >\n implements PregelInterface<Nn, Cc, ContextType>\n{\n static lc_name() {\n return \"RemoteGraph\";\n }\n\n lc_namespace = [\"langgraph\", \"pregel\"];\n\n lg_is_pregel = true;\n\n config?: RunnableConfig;\n\n graphId: string;\n\n protected client: Client;\n\n protected interruptBefore?: Array<keyof Nn> | All;\n\n protected interruptAfter?: Array<keyof Nn> | All;\n\n protected streamResumable?: boolean;\n\n constructor(params: RemoteGraphParams) {\n super(params);\n\n this.graphId = params.graphId;\n this.client =\n params.client ??\n new Client({\n apiUrl: params.url,\n apiKey: params.apiKey,\n defaultHeaders: params.headers,\n });\n this.config = params.config;\n this.interruptBefore = params.interruptBefore;\n this.interruptAfter = params.interruptAfter;\n this.streamResumable = params.streamResumable;\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore Remove ignore when we remove support for 0.2 versions of core\n override withConfig(config: RunnableConfig): typeof this {\n const mergedConfig = mergeConfigs(this.config, config);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (this.constructor as any)({ ...this, config: mergedConfig });\n }\n\n protected _sanitizeConfig(config: RunnableConfig) {\n const reservedConfigurableKeys = new Set([\n \"callbacks\",\n \"checkpoint_map\",\n \"checkpoint_id\",\n \"checkpoint_ns\",\n ]);\n\n const sanitizeObj = <T>(obj: T): T => {\n try {\n // This will only throw if we're trying to serialize a circular reference\n // or trying to serialize a BigInt...\n JSON.stringify(obj);\n return obj;\n } catch {\n const seen = new WeakSet();\n return JSON.parse(\n JSON.stringify(obj, (_, value) => {\n if (typeof value === \"object\" && value != null) {\n if (seen.has(value)) return \"[Circular]\";\n seen.add(value);\n }\n\n if (typeof value === \"bigint\") return value.toString();\n return value;\n })\n );\n }\n };\n\n // Remove non-JSON serializable fields from the config\n const sanitizedConfig = sanitizeObj(config);\n\n // Only include configurable keys that are not reserved and\n // not starting with \"__pregel_\" prefix\n const newConfigurable = Object.fromEntries(\n Object.entries(sanitizedConfig.configurable ?? {}).filter(\n ([k]) => !reservedConfigurableKeys.has(k) && !k.startsWith(\"__pregel_\")\n )\n );\n\n return {\n tags: sanitizedConfig.tags ?? [],\n metadata: sanitizedConfig.metadata ?? {},\n configurable: newConfigurable,\n recursion_limit: sanitizedConfig.recursionLimit,\n };\n }\n\n protected _getConfig(checkpoint: Record<string, unknown>): RunnableConfig {\n return {\n configurable: {\n thread_id: checkpoint.thread_id,\n checkpoint_ns: checkpoint.checkpoint_ns,\n checkpoint_id: checkpoint.checkpoint_id,\n checkpoint_map: checkpoint.checkpoint_map ?? {},\n },\n };\n }\n\n protected _getCheckpoint(config?: RunnableConfig): Checkpoint | undefined {\n if (config?.configurable === undefined) {\n return undefined;\n }\n\n const checkpointKeys = [\n \"thread_id\",\n \"checkpoint_ns\",\n \"checkpoint_id\",\n \"checkpoint_map\",\n ] as const;\n\n const checkpoint = Object.fromEntries(\n checkpointKeys\n .map((key) => [key, config.configurable![key]])\n .filter(([_, value]) => value !== undefined)\n );\n\n return Object.keys(checkpoint).length > 0 ? checkpoint : undefined;\n }\n\n protected _createStateSnapshot(state: ThreadState): StateSnapshot {\n const tasks: PregelTaskDescription[] = state.tasks.map((task) => {\n return {\n id: task.id,\n name: task.name,\n error: task.error ? { message: task.error } : undefined,\n // TODO: remove in LangGraph.js 0.4\n interrupts: task.interrupts.map(({ id, ...rest }) => ({\n interrupt_id: id,\n ...rest,\n })),\n // eslint-disable-next-line no-nested-ternary\n state: task.state\n ? this._createStateSnapshot(task.state)\n : task.checkpoint\n ? { configurable: task.checkpoint }\n : undefined,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result: (task as any).result,\n };\n });\n\n return {\n values: state.values,\n next: state.next ? [...state.next] : [],\n config: {\n configurable: {\n thread_id: state.checkpoint.thread_id,\n checkpoint_ns: state.checkpoint.checkpoint_ns,\n checkpoint_id: state.checkpoint.checkpoint_id,\n checkpoint_map: state.checkpoint.checkpoint_map ?? {},\n },\n },\n metadata: state.metadata\n ? (state.metadata as CheckpointMetadata)\n : undefined,\n createdAt: state.created_at ?? undefined,\n parentConfig: state.parent_checkpoint\n ? {\n configurable: {\n thread_id: state.parent_checkpoint.thread_id,\n checkpoint_ns: state.parent_checkpoint.checkpoint_ns,\n checkpoint_id: state.parent_checkpoint.checkpoint_id,\n checkpoint_map: state.parent_checkpoint.checkpoint_map ?? {},\n },\n }\n : undefined,\n tasks,\n };\n }\n\n override async invoke(\n input: PregelInputType,\n options?: Partial<PregelOptions<Nn, Cc, ContextType>>\n ): Promise<PregelOutputType> {\n let lastValue;\n const stream = await this.stream(input, {\n ...options,\n streamMode: \"values\",\n });\n for await (const chunk of stream) {\n lastValue = chunk;\n }\n return lastValue;\n }\n\n override streamEvents(\n input: PregelInputType,\n options: Partial<PregelOptions<Nn, Cc, ContextType>> & {\n version: \"v1\" | \"v2\";\n }\n ): IterableReadableStream<StreamEvent>;\n\n override streamEvents(\n input: PregelInputType,\n options: Partial<PregelOptions<Nn, Cc, ContextType>> & {\n version: \"v1\" | \"v2\";\n encoding: never;\n }\n ): IterableReadableStream<never>;\n\n override streamEvents(\n _input: PregelInputType,\n _options: Partial<PregelOptions<Nn, Cc, ContextType>> & {\n version: \"v1\" | \"v2\";\n encoding?: never;\n }\n ): IterableReadableStream<StreamEvent> {\n throw new Error(\"Not implemented.\");\n }\n\n override async *_streamIterator(\n input: PregelInputType,\n options?: Partial<PregelOptions<Nn, Cc, ContextType>>\n ): AsyncGenerator<PregelOutputType> {\n const mergedConfig = mergeConfigs(this.config, options);\n const sanitizedConfig = this._sanitizeConfig(mergedConfig);\n\n const streamProtocolInstance = options?.configurable?.[CONFIG_KEY_STREAM];\n\n const streamSubgraphs =\n options?.subgraphs ?? streamProtocolInstance !== undefined;\n\n const interruptBefore = options?.interruptBefore ?? this.interruptBefore;\n const interruptAfter = options?.interruptAfter ?? this.interruptAfter;\n\n const { updatedStreamModes, reqSingle, reqUpdates } = getStreamModes(\n options?.streamMode\n );\n\n const extendedStreamModes = [\n ...new Set([\n ...updatedStreamModes,\n ...(streamProtocolInstance?.modes ?? new Set()),\n ]),\n ].map((mode) => {\n if (mode === \"messages\") return \"messages-tuple\";\n return mode;\n });\n\n let command;\n let serializedInput;\n if (isCommand(input)) {\n // TODO: Remove cast when SDK type fix gets merged\n command = input.toJSON() as Record<string, unknown>;\n serializedInput = undefined;\n } else {\n serializedInput = _serializeInputs(input);\n }\n\n for await (const chunk of this.client.runs.stream(\n sanitizedConfig.configurable.thread_id as string,\n this.graphId,\n {\n command,\n input: serializedInput,\n config: sanitizedConfig,\n streamMode: extendedStreamModes,\n interruptBefore: interruptBefore as string[],\n interruptAfter: interruptAfter as string[],\n streamSubgraphs,\n ifNotExists: \"create\",\n signal: mergedConfig.signal,\n streamResumable: this.streamResumable,\n }\n )) {\n let mode;\n let namespace: string[];\n if (chunk.event.includes(CHECKPOINT_NAMESPACE_SEPARATOR)) {\n const eventComponents = chunk.event.split(\n CHECKPOINT_NAMESPACE_SEPARATOR\n );\n // eslint-disable-next-line prefer-destructuring\n mode = eventComponents[0];\n namespace = eventComponents.slice(1);\n } else {\n mode = chunk.event;\n namespace = [];\n }\n const callerNamespace = options?.configurable?.checkpoint_ns;\n if (typeof callerNamespace === \"string\") {\n namespace = callerNamespace\n .split(CHECKPOINT_NAMESPACE_SEPARATOR)\n .concat(namespace);\n }\n if (\n streamProtocolInstance !== undefined &&\n streamProtocolInstance.modes?.has(chunk.event)\n ) {\n streamProtocolInstance.push([namespace, mode, chunk.data]);\n }\n if (chunk.event.startsWith(\"updates\")) {\n if (\n typeof chunk.data === \"object\" &&\n chunk.data?.[INTERRUPT] !== undefined\n ) {\n throw new GraphInterrupt(chunk.data[INTERRUPT]);\n }\n if (!reqUpdates) {\n continue;\n }\n } else if (chunk.event?.startsWith(\"error\")) {\n throw new RemoteException(\n typeof chunk.data === \"string\"\n ? chunk.data\n : JSON.stringify(chunk.data)\n );\n }\n if (\n !updatedStreamModes.includes(\n chunk.event.split(CHECKPOINT_NAMESPACE_SEPARATOR)[0] as StreamMode\n )\n ) {\n continue;\n }\n if (options?.subgraphs) {\n if (reqSingle) {\n yield [namespace, chunk.data];\n } else {\n yield [namespace, mode, chunk.data];\n }\n } else if (reqSingle) {\n yield chunk.data;\n } else {\n yield [mode, chunk.data];\n }\n }\n }\n\n async updateState(\n inputConfig: LangGraphRunnableConfig,\n values: Record<string, unknown>,\n asNode?: string\n ): Promise<RunnableConfig> {\n const mergedConfig = mergeConfigs(this.config, inputConfig);\n const response = await this.client.threads.updateState(\n mergedConfig.configurable?.thread_id,\n { values, asNode, checkpoint: this._getCheckpoint(mergedConfig) }\n );\n // TODO: Fix SDK typing\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return this._getConfig((response as any).checkpoint);\n }\n\n async *getStateHistory(\n config: RunnableConfig,\n options?: CheckpointListOptions\n ): AsyncIterableIterator<StateSnapshot> {\n const mergedConfig = mergeConfigs(this.config, config);\n const states = await this.client.threads.getHistory(\n mergedConfig.configurable?.thread_id,\n {\n limit: options?.limit ?? 10,\n // TODO: Fix type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n before: this._getCheckpoint(options?.before) as any,\n metadata: options?.filter,\n checkpoint: this._getCheckpoint(mergedConfig),\n }\n );\n for (const state of states) {\n yield this._createStateSnapshot(state);\n }\n }\n\n protected _getDrawableNodes(\n nodes: Array<{\n id: string | number;\n name?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data?: Record<string, any> | string;\n metadata?: unknown;\n }>\n ): Record<string, DrawableNode> {\n const nodesMap: Record<string, DrawableNode> = {};\n for (const node of nodes) {\n const nodeId = node.id;\n nodesMap[nodeId] = {\n id: nodeId.toString(),\n name: typeof node.data === \"string\" ? node.data : node.data?.name ?? \"\",\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data: (node.data as any) ?? {},\n metadata:\n typeof node.data !== \"string\" ? node.data?.metadata ?? {} : {},\n };\n }\n return nodesMap;\n }\n\n async getState(\n config: RunnableConfig,\n options?: { subgraphs?: boolean }\n ): Promise<StateSnapshot> {\n const mergedConfig = mergeConfigs(this.config, config);\n\n const state = await this.client.threads.getState(\n mergedConfig.configurable?.thread_id,\n this._getCheckpoint(mergedConfig),\n options\n );\n return this._createStateSnapshot(state);\n }\n\n /** @deprecated Use getGraphAsync instead. The async method will become the default in the next minor release. */\n override getGraph(\n _?: RunnableConfig & { xray?: boolean | number }\n ): DrawableGraph {\n throw new Error(\n `The synchronous \"getGraph\" is not supported for this graph. Call \"getGraphAsync\" instead.`\n );\n }\n\n /**\n * Returns a drawable representation of the computation graph.\n */\n async getGraphAsync(config?: RunnableConfig & { xray?: boolean | number }) {\n const graph = await this.client.assistants.getGraph(this.graphId, {\n xray: config?.xray,\n });\n return new DrawableGraph({\n nodes: this._getDrawableNodes(graph.nodes),\n edges: graph.edges,\n });\n }\n\n /** @deprecated Use getSubgraphsAsync instead. The async method will become the default in the next minor release. */\n getSubgraphs(): Generator<[string, PregelInterface<Nn, Cc, ContextType>]> {\n throw new Error(\n `The synchronous \"getSubgraphs\" method is not supported for this graph. Call \"getSubgraphsAsync\" instead.`\n );\n }\n\n async *getSubgraphsAsync(\n namespace?: string,\n recurse = false\n ): AsyncGenerator<[string, PregelInterface<Nn, Cc, ContextType>]> {\n const subgraphs = await this.client.assistants.getSubgraphs(this.graphId, {\n namespace,\n recurse,\n });\n\n for (const [ns, graphSchema] of Object.entries(subgraphs)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const remoteSubgraph = new (this.constructor as any)({\n ...this,\n graphId: graphSchema.graph_id,\n });\n yield [ns, remoteSubgraph];\n }\n }\n}\n"],"mappings":";;;;;;;;;AA2DA,MAAM,oBAAoB,QAAkB;AAC1C,KAAI,QAAQ,QAAQ,OAAO,QAAQ,SACjC,QAAO;AAGT,KAAI,MAAM,QAAQ,IAAI,CACpB,QAAO,IAAI,IAAI,iBAAiB;AAIlC,iDAAkB,IAAI,CAEpB,QAAO;EACL,GAFW,IAAI,QAAQ,CAEf;EACR,MAAM,IAAI,SAAS;EACpB;AAGH,QAAO,OAAO,YACZ,OAAO,QAAQ,IAAI,CAAC,KAAK,CAAC,KAAK,WAAW,CAAC,KAAK,iBAAiB,MAAM,CAAC,CAAC,CAC1E;;;;;;;;;;;AAYH,MAAM,kBACJ,YACA,oBAAgC,cAC7B;CACH,MAAM,qBAAmC,EAAE;CAC3C,IAAI,aAAa;CACjB,IAAI,YAAY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AAM;;;CAIzC,AAAS,SACP,GACe;AACf,QAAM,IAAI,MACR,4FACD;;;;;CAMH,MAAM,cAAc,QAAuD;EACzE,MAAM,QAAQ,MAAM,KAAK,OAAO,WAAW,SAAS,KAAK,SAAS,EAChE,MAAM,QAAQ,MACf,CAAC;AACF,SAAO,IAAII,sCAAc;GACvB,OAAO,KAAK,kBAAkB,MAAM,MAAM;GAC1C,OAAO,MAAM;GACd,CAAC;;;CAIJ,eAA0E;AACxE,QAAM,IAAI,MACR,2GACD;;CAGH,OAAO,kBACL,WACA,UAAU,OACsD;EAChE,MAAM,YAAY,MAAM,KAAK,OAAO,WAAW,aAAa,KAAK,SAAS;GACxE;GACA;GACD,CAAC;AAEF,OAAK,MAAM,CAAC,IAAI,gBAAgB,OAAO,QAAQ,UAAU,CAMvD,OAAM,CAAC,IAJgB,IAAK,KAAK,YAAoB;GACnD,GAAG;GACH,SAAS,YAAY;GACtB,CAAC,CACwB"}
|
|
1
|
+
{"version":3,"file":"remote.cjs","names":["BaseMessage","Runnable","Client","CONFIG_KEY_STREAM","isCommand","CHECKPOINT_NAMESPACE_SEPARATOR","INTERRUPT","GraphInterrupt","RemoteException","DrawableGraph"],"sources":["../../src/pregel/remote.ts"],"sourcesContent":["import {\n Client,\n type Checkpoint,\n type ThreadState,\n} from \"@langchain/langgraph-sdk\";\nimport {\n Graph as DrawableGraph,\n Node as DrawableNode,\n} from \"@langchain/core/runnables/graph\";\nimport {\n mergeConfigs,\n Runnable,\n RunnableConfig,\n} from \"@langchain/core/runnables\";\nimport {\n All,\n CheckpointListOptions,\n CheckpointMetadata,\n} from \"@langchain/langgraph-checkpoint\";\nimport { StreamEvent } from \"@langchain/core/tracers/log_stream\";\nimport { IterableReadableStream } from \"@langchain/core/utils/stream\";\nimport { BaseMessage } from \"@langchain/core/messages\";\n\nimport {\n BaseChannel,\n GraphInterrupt,\n LangGraphRunnableConfig,\n RemoteException,\n} from \"../web.js\";\nimport { StrRecord } from \"./algo.js\";\nimport { PregelInputType, PregelOptions, PregelOutputType } from \"./index.js\";\nimport { PregelNode } from \"./read.js\";\nimport {\n PregelParams,\n PregelInterface,\n PregelTaskDescription,\n StateSnapshot,\n StreamMode,\n} from \"./types.js\";\nimport {\n CHECKPOINT_NAMESPACE_SEPARATOR,\n CONFIG_KEY_STREAM,\n INTERRUPT,\n isCommand,\n} from \"../constants.js\";\n\nexport type RemoteGraphParams = Omit<\n PregelParams<StrRecord<string, PregelNode>, StrRecord<string, BaseChannel>>,\n \"channels\" | \"nodes\" | \"inputChannels\" | \"outputChannels\"\n> & {\n graphId: string;\n client?: Client;\n url?: string;\n apiKey?: string;\n headers?: Record<string, string>;\n streamResumable?: boolean;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst _serializeInputs = (obj: any): any => {\n if (obj === null || typeof obj !== \"object\") {\n return obj;\n }\n\n if (Array.isArray(obj)) {\n return obj.map(_serializeInputs);\n }\n\n // Handle BaseMessage instances by converting them to a serializable format\n if (BaseMessage.isInstance(obj)) {\n const dict = obj.toDict();\n return {\n ...dict.data,\n role: obj.getType(),\n };\n }\n\n return Object.fromEntries(\n Object.entries(obj).map(([key, value]) => [key, _serializeInputs(value)])\n );\n};\n\n/**\n * Return a tuple of the final list of stream modes sent to the\n * remote graph and a boolean flag indicating if only one stream mode was\n * originally requested and whether stream mode 'updates'\n * was present in the original list of stream modes.\n *\n * 'updates' mode is always added to the list of stream modes so that interrupts\n * can be detected in the remote graph.\n */\nconst getStreamModes = (\n streamMode?: StreamMode | StreamMode[],\n defaultStreamMode: StreamMode = \"updates\"\n) => {\n const updatedStreamModes: StreamMode[] = [];\n let reqUpdates = false;\n let reqSingle = true;\n\n if (\n streamMode !== undefined &&\n (typeof streamMode === \"string\" ||\n (Array.isArray(streamMode) && streamMode.length > 0))\n ) {\n reqSingle = typeof streamMode === \"string\";\n const mapped = Array.isArray(streamMode) ? streamMode : [streamMode];\n updatedStreamModes.push(...mapped);\n } else {\n updatedStreamModes.push(defaultStreamMode);\n }\n if (updatedStreamModes.includes(\"updates\")) {\n reqUpdates = true;\n } else {\n updatedStreamModes.push(\"updates\");\n }\n return {\n updatedStreamModes,\n reqUpdates,\n reqSingle,\n };\n};\n\n/**\n * The `RemoteGraph` class is a client implementation for calling remote\n * APIs that implement the LangGraph Server API specification.\n *\n * For example, the `RemoteGraph` class can be used to call APIs from deployments\n * on LangSmith Deployment.\n *\n * `RemoteGraph` behaves the same way as a `StateGraph` and can be used directly as\n * a node in another `StateGraph`.\n *\n * @example\n * ```ts\n * import { RemoteGraph } from \"@langchain/langgraph/remote\";\n *\n * // Can also pass a LangGraph SDK client instance directly\n * const remoteGraph = new RemoteGraph({\n * graphId: process.env.LANGGRAPH_REMOTE_GRAPH_ID!,\n * apiKey: process.env.LANGGRAPH_REMOTE_GRAPH_API_KEY,\n * url: process.env.LANGGRAPH_REMOTE_GRAPH_API_URL,\n * });\n *\n * const input = {\n * messages: [\n * {\n * role: \"human\",\n * content: \"Hello world!\",\n * },\n * ],\n * };\n *\n * const config = {\n * configurable: { thread_id: \"threadId1\" },\n * };\n *\n * await remoteGraph.invoke(input, config);\n * ```\n */\nexport class RemoteGraph<\n Nn extends StrRecord<string, PregelNode> = StrRecord<string, PregelNode>,\n Cc extends StrRecord<string, BaseChannel> = StrRecord<string, BaseChannel>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ContextType extends Record<string, any> = StrRecord<string, any>\n >\n extends Runnable<\n PregelInputType,\n PregelOutputType,\n PregelOptions<Nn, Cc, ContextType>\n >\n implements PregelInterface<Nn, Cc, ContextType>\n{\n static lc_name() {\n return \"RemoteGraph\";\n }\n\n lc_namespace = [\"langgraph\", \"pregel\"];\n\n lg_is_pregel = true;\n\n config?: RunnableConfig;\n\n graphId: string;\n\n protected client: Client;\n\n protected interruptBefore?: Array<keyof Nn> | All;\n\n protected interruptAfter?: Array<keyof Nn> | All;\n\n protected streamResumable?: boolean;\n\n constructor(params: RemoteGraphParams) {\n super(params);\n\n this.graphId = params.graphId;\n this.client =\n params.client ??\n new Client({\n apiUrl: params.url,\n apiKey: params.apiKey,\n defaultHeaders: params.headers,\n });\n this.config = params.config;\n this.interruptBefore = params.interruptBefore;\n this.interruptAfter = params.interruptAfter;\n this.streamResumable = params.streamResumable;\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore Remove ignore when we remove support for 0.2 versions of core\n override withConfig(config: RunnableConfig): typeof this {\n const mergedConfig = mergeConfigs(this.config, config);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (this.constructor as any)({ ...this, config: mergedConfig });\n }\n\n protected _sanitizeConfig(config: RunnableConfig) {\n const reservedConfigurableKeys = new Set([\n \"callbacks\",\n \"checkpoint_map\",\n \"checkpoint_id\",\n \"checkpoint_ns\",\n ]);\n\n const sanitizeObj = <T>(obj: T): T => {\n try {\n // This will only throw if we're trying to serialize a circular reference\n // or trying to serialize a BigInt...\n JSON.stringify(obj);\n return obj;\n } catch {\n const seen = new WeakSet();\n return JSON.parse(\n JSON.stringify(obj, (_, value) => {\n if (typeof value === \"object\" && value != null) {\n if (seen.has(value)) return \"[Circular]\";\n seen.add(value);\n }\n\n if (typeof value === \"bigint\") return value.toString();\n return value;\n })\n );\n }\n };\n\n // Remove non-JSON serializable fields from the config\n const sanitizedConfig = sanitizeObj(config);\n\n // Only include configurable keys that are not reserved and\n // not starting with \"__pregel_\" prefix\n const newConfigurable = Object.fromEntries(\n Object.entries(sanitizedConfig.configurable ?? {}).filter(\n ([k]) => !reservedConfigurableKeys.has(k) && !k.startsWith(\"__pregel_\")\n )\n );\n\n return {\n tags: sanitizedConfig.tags ?? [],\n metadata: sanitizedConfig.metadata ?? {},\n configurable: newConfigurable,\n recursion_limit: sanitizedConfig.recursionLimit,\n };\n }\n\n protected _getConfig(checkpoint: Record<string, unknown>): RunnableConfig {\n return {\n configurable: {\n thread_id: checkpoint.thread_id,\n checkpoint_ns: checkpoint.checkpoint_ns,\n checkpoint_id: checkpoint.checkpoint_id,\n checkpoint_map: checkpoint.checkpoint_map ?? {},\n },\n };\n }\n\n protected _getCheckpoint(config?: RunnableConfig): Checkpoint | undefined {\n if (config?.configurable === undefined) {\n return undefined;\n }\n\n const checkpointKeys = [\n \"thread_id\",\n \"checkpoint_ns\",\n \"checkpoint_id\",\n \"checkpoint_map\",\n ] as const;\n\n const checkpoint = Object.fromEntries(\n checkpointKeys\n .map((key) => [key, config.configurable![key]])\n .filter(([_, value]) => value !== undefined)\n );\n\n return Object.keys(checkpoint).length > 0 ? checkpoint : undefined;\n }\n\n protected _createStateSnapshot(state: ThreadState): StateSnapshot {\n const tasks: PregelTaskDescription[] = state.tasks.map((task) => {\n return {\n id: task.id,\n name: task.name,\n error: task.error ? { message: task.error } : undefined,\n // TODO: remove in LangGraph.js 0.4\n interrupts: task.interrupts.map(({ id, ...rest }) => ({\n interrupt_id: id,\n ...rest,\n })),\n // eslint-disable-next-line no-nested-ternary\n state: task.state\n ? this._createStateSnapshot(task.state)\n : task.checkpoint\n ? { configurable: task.checkpoint }\n : undefined,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result: (task as any).result,\n };\n });\n\n return {\n values: state.values,\n next: state.next ? [...state.next] : [],\n config: {\n configurable: {\n thread_id: state.checkpoint.thread_id,\n checkpoint_ns: state.checkpoint.checkpoint_ns,\n checkpoint_id: state.checkpoint.checkpoint_id,\n checkpoint_map: state.checkpoint.checkpoint_map ?? {},\n },\n },\n metadata: state.metadata\n ? (state.metadata as CheckpointMetadata)\n : undefined,\n createdAt: state.created_at ?? undefined,\n parentConfig: state.parent_checkpoint\n ? {\n configurable: {\n thread_id: state.parent_checkpoint.thread_id,\n checkpoint_ns: state.parent_checkpoint.checkpoint_ns,\n checkpoint_id: state.parent_checkpoint.checkpoint_id,\n checkpoint_map: state.parent_checkpoint.checkpoint_map ?? {},\n },\n }\n : undefined,\n tasks,\n };\n }\n\n override async invoke(\n input: PregelInputType,\n options?: Partial<PregelOptions<Nn, Cc, ContextType>>\n ): Promise<PregelOutputType> {\n let lastValue;\n const stream = await this.stream(input, {\n ...options,\n streamMode: \"values\",\n });\n for await (const chunk of stream) {\n lastValue = chunk;\n }\n return lastValue;\n }\n\n override streamEvents(\n input: PregelInputType,\n options: Partial<PregelOptions<Nn, Cc, ContextType>> & {\n version: \"v1\" | \"v2\";\n }\n ): IterableReadableStream<StreamEvent>;\n\n override streamEvents(\n input: PregelInputType,\n options: Partial<PregelOptions<Nn, Cc, ContextType>> & {\n version: \"v1\" | \"v2\";\n encoding: never;\n }\n ): IterableReadableStream<never>;\n\n override streamEvents(\n _input: PregelInputType,\n _options: Partial<PregelOptions<Nn, Cc, ContextType>> & {\n version: \"v1\" | \"v2\";\n encoding?: never;\n }\n ): IterableReadableStream<StreamEvent> {\n throw new Error(\"Not implemented.\");\n }\n\n override async *_streamIterator(\n input: PregelInputType,\n options?: Partial<PregelOptions<Nn, Cc, ContextType>>\n ): AsyncGenerator<PregelOutputType> {\n const mergedConfig = mergeConfigs(this.config, options);\n const sanitizedConfig = this._sanitizeConfig(mergedConfig);\n\n const streamProtocolInstance = options?.configurable?.[CONFIG_KEY_STREAM];\n\n const streamSubgraphs =\n options?.subgraphs ?? streamProtocolInstance !== undefined;\n\n const interruptBefore = options?.interruptBefore ?? this.interruptBefore;\n const interruptAfter = options?.interruptAfter ?? this.interruptAfter;\n\n const { updatedStreamModes, reqSingle, reqUpdates } = getStreamModes(\n options?.streamMode\n );\n\n const extendedStreamModes = [\n ...new Set([\n ...updatedStreamModes,\n ...(streamProtocolInstance?.modes ?? new Set()),\n ]),\n ].map((mode) => {\n if (mode === \"messages\") return \"messages-tuple\";\n return mode;\n });\n\n let command;\n let serializedInput;\n if (isCommand(input)) {\n // TODO: Remove cast when SDK type fix gets merged\n command = input.toJSON() as Record<string, unknown>;\n serializedInput = undefined;\n } else {\n serializedInput = _serializeInputs(input);\n }\n\n for await (const chunk of this.client.runs.stream(\n sanitizedConfig.configurable.thread_id as string,\n this.graphId,\n {\n command,\n input: serializedInput,\n config: sanitizedConfig,\n streamMode: extendedStreamModes,\n interruptBefore: interruptBefore as string[],\n interruptAfter: interruptAfter as string[],\n streamSubgraphs,\n ifNotExists: \"create\",\n signal: mergedConfig.signal,\n streamResumable: this.streamResumable,\n }\n )) {\n let mode;\n let namespace: string[];\n if (chunk.event.includes(CHECKPOINT_NAMESPACE_SEPARATOR)) {\n const eventComponents = chunk.event.split(\n CHECKPOINT_NAMESPACE_SEPARATOR\n );\n // eslint-disable-next-line prefer-destructuring\n mode = eventComponents[0];\n namespace = eventComponents.slice(1);\n } else {\n mode = chunk.event;\n namespace = [];\n }\n const callerNamespace = options?.configurable?.checkpoint_ns;\n if (typeof callerNamespace === \"string\") {\n namespace = callerNamespace\n .split(CHECKPOINT_NAMESPACE_SEPARATOR)\n .concat(namespace);\n }\n if (\n streamProtocolInstance !== undefined &&\n streamProtocolInstance.modes?.has(chunk.event)\n ) {\n streamProtocolInstance.push([namespace, mode, chunk.data]);\n }\n if (chunk.event.startsWith(\"updates\")) {\n if (\n typeof chunk.data === \"object\" &&\n chunk.data?.[INTERRUPT] !== undefined\n ) {\n throw new GraphInterrupt(chunk.data[INTERRUPT]);\n }\n if (!reqUpdates) {\n continue;\n }\n } else if (chunk.event?.startsWith(\"error\")) {\n throw new RemoteException(\n typeof chunk.data === \"string\"\n ? chunk.data\n : JSON.stringify(chunk.data)\n );\n }\n if (\n !updatedStreamModes.includes(\n chunk.event.split(CHECKPOINT_NAMESPACE_SEPARATOR)[0] as StreamMode\n )\n ) {\n continue;\n }\n if (options?.subgraphs) {\n if (reqSingle) {\n yield [namespace, chunk.data];\n } else {\n yield [namespace, mode, chunk.data];\n }\n } else if (reqSingle) {\n yield chunk.data;\n } else {\n yield [mode, chunk.data];\n }\n }\n }\n\n async updateState(\n inputConfig: LangGraphRunnableConfig,\n values: Record<string, unknown>,\n asNode?: string\n ): Promise<RunnableConfig> {\n const mergedConfig = mergeConfigs(this.config, inputConfig);\n const response = await this.client.threads.updateState(\n mergedConfig.configurable?.thread_id,\n { values, asNode, checkpoint: this._getCheckpoint(mergedConfig) }\n );\n // TODO: Fix SDK typing\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return this._getConfig((response as any).checkpoint);\n }\n\n async *getStateHistory(\n config: RunnableConfig,\n options?: CheckpointListOptions\n ): AsyncIterableIterator<StateSnapshot> {\n const mergedConfig = mergeConfigs(this.config, config);\n const states = await this.client.threads.getHistory(\n mergedConfig.configurable?.thread_id,\n {\n limit: options?.limit ?? 10,\n // TODO: Fix type\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n before: this._getCheckpoint(options?.before) as any,\n metadata: options?.filter,\n checkpoint: this._getCheckpoint(mergedConfig),\n }\n );\n for (const state of states) {\n yield this._createStateSnapshot(state);\n }\n }\n\n protected _getDrawableNodes(\n nodes: Array<{\n id: string | number;\n name?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data?: Record<string, any> | string;\n metadata?: unknown;\n }>\n ): Record<string, DrawableNode> {\n const nodesMap: Record<string, DrawableNode> = {};\n for (const node of nodes) {\n const nodeId = node.id;\n nodesMap[nodeId] = {\n id: nodeId.toString(),\n name: typeof node.data === \"string\" ? node.data : node.data?.name ?? \"\",\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data: (node.data as any) ?? {},\n metadata:\n typeof node.data !== \"string\" ? node.data?.metadata ?? {} : {},\n };\n }\n return nodesMap;\n }\n\n async getState(\n config: RunnableConfig,\n options?: { subgraphs?: boolean }\n ): Promise<StateSnapshot> {\n const mergedConfig = mergeConfigs(this.config, config);\n\n const state = await this.client.threads.getState(\n mergedConfig.configurable?.thread_id,\n this._getCheckpoint(mergedConfig),\n options\n );\n return this._createStateSnapshot(state);\n }\n\n /** @deprecated Use getGraphAsync instead. The async method will become the default in the next minor release. */\n override getGraph(\n _?: RunnableConfig & { xray?: boolean | number }\n ): DrawableGraph {\n throw new Error(\n `The synchronous \"getGraph\" is not supported for this graph. Call \"getGraphAsync\" instead.`\n );\n }\n\n /**\n * Returns a drawable representation of the computation graph.\n */\n async getGraphAsync(config?: RunnableConfig & { xray?: boolean | number }) {\n const graph = await this.client.assistants.getGraph(this.graphId, {\n xray: config?.xray,\n });\n return new DrawableGraph({\n nodes: this._getDrawableNodes(graph.nodes),\n edges: graph.edges,\n });\n }\n\n /** @deprecated Use getSubgraphsAsync instead. The async method will become the default in the next minor release. */\n getSubgraphs(): Generator<[string, PregelInterface<Nn, Cc, ContextType>]> {\n throw new Error(\n `The synchronous \"getSubgraphs\" method is not supported for this graph. Call \"getSubgraphsAsync\" instead.`\n );\n }\n\n async *getSubgraphsAsync(\n namespace?: string,\n recurse = false\n ): AsyncGenerator<[string, PregelInterface<Nn, Cc, ContextType>]> {\n const subgraphs = await this.client.assistants.getSubgraphs(this.graphId, {\n namespace,\n recurse,\n });\n\n for (const [ns, graphSchema] of Object.entries(subgraphs)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const remoteSubgraph = new (this.constructor as any)({\n ...this,\n graphId: graphSchema.graph_id,\n });\n yield [ns, remoteSubgraph];\n }\n }\n}\n"],"mappings":";;;;;;;;;AA2DA,MAAM,oBAAoB,QAAkB;AAC1C,KAAI,QAAQ,QAAQ,OAAO,QAAQ,SACjC,QAAO;AAGT,KAAI,MAAM,QAAQ,IAAI,CACpB,QAAO,IAAI,IAAI,iBAAiB;AAIlC,KAAIA,qCAAY,WAAW,IAAI,CAE7B,QAAO;EACL,GAFW,IAAI,QAAQ,CAEf;EACR,MAAM,IAAI,SAAS;EACpB;AAGH,QAAO,OAAO,YACZ,OAAO,QAAQ,IAAI,CAAC,KAAK,CAAC,KAAK,WAAW,CAAC,KAAK,iBAAiB,MAAM,CAAC,CAAC,CAC1E;;;;;;;;;;;AAYH,MAAM,kBACJ,YACA,oBAAgC,cAC7B;CACH,MAAM,qBAAmC,EAAE;CAC3C,IAAI,aAAa;CACjB,IAAI,YAAY;AAEhB,KACE,eAAe,WACd,OAAO,eAAe,YACpB,MAAM,Q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R,4FACD;;;;;CAMH,MAAM,cAAc,QAAuD;EACzE,MAAM,QAAQ,MAAM,KAAK,OAAO,WAAW,SAAS,KAAK,SAAS,EAChE,MAAM,QAAQ,MACf,CAAC;AACF,SAAO,IAAII,sCAAc;GACvB,OAAO,KAAK,kBAAkB,MAAM,MAAM;GAC1C,OAAO,MAAM;GACd,CAAC;;;CAIJ,eAA0E;AACxE,QAAM,IAAI,MACR,2GACD;;CAGH,OAAO,kBACL,WACA,UAAU,OACsD;EAChE,MAAM,YAAY,MAAM,KAAK,OAAO,WAAW,aAAa,KAAK,SAAS;GACxE;GACA;GACD,CAAC;AAEF,OAAK,MAAM,CAAC,IAAI,gBAAgB,OAAO,QAAQ,UAAU,CAMvD,OAAM,CAAC,IAJgB,IAAK,KAAK,YAAoB;GACnD,GAAG;GACH,SAAS,YAAY;GACtB,CAAC,CACwB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.d.cts","names":[
|
|
1
|
+
{"version":3,"file":"remote.d.cts","names":[],"sources":["../../src/pregel/remote.ts"],"mappings":";;;;;;;;;;;;;KA8CY,iBAAA,GAAoB,IAAA,CAC9B,YAAA,CAAa,SAAA,SAAkB,UAAA,GAAa,SAAA,SAAkB,WAAA;EAG9D,OAAA;EACA,MAAA,GAAS,MAAA;EACT,GAAA;EACA,MAAA;EACA,OAAA,GAAU,MAAA;EACV,eAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;AAwGF;;;;;;;;;;;;;;cAAa,WAAA,YACE,SAAA,SAAkB,UAAA,IAAc,SAAA,SAAkB,UAAA,cAClD,SAAA,SAAkB,WAAA,IAAe,SAAA,SAAkB,WAAA,uBAE1C,MAAA,gBAAsB,SAAA,uBAEpC,QAAA,CACN,eAAA,EACA,gBAAA,EACA,aAAA,CAAc,EAAA,EAAI,EAAA,EAAI,WAAA,cAEb,eAAA,CAAgB,EAAA,EAAI,EAAA,EAAI,WAAA;EAAA,OAE5B,OAAA,CAAA;EAIP,YAA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qBAAA,GACT,qBAAA,CAAsB,aAAA;EAAA,UAkBf,iBAAA,CACR,KAAA,EAAO,KAAA;IACL,EAAA;IACA,IAAA;IAEA,IAAA,GAAO,MAAA;IACP,QAAA;EAAA,KAED,MAAA,SAAe,IAAA;EAgBZ,QAAA,CACJ,MAAA,EAAQ,cAAA,EACR,OAAA;IAAY,SAAA;EAAA,IACX,OAAA,CAAQ,aAAA;EArMsB;EAiNxB,QAAA,CACP,CAAA,GAAI,cAAA;IAAmB,IAAA;EAAA,IACtB,KAAA;EAnNQ;;;EA4NL,aAAA,CAAc,MAAA,GAAS,cAAA;IAAmB,IAAA;EAAA,IAAyB,OAAA,CAAA,KAAA;EA1MrD;EAqNpB,YAAA,CAAA,GAAgB,SAAA,UAAmB,eAAA,CAAgB,EAAA,EAAI,EAAA,EAAI,WAAA;EAMpD,iBAAA,CACL,SAAA,WACA,OAAA,aACC,cAAA,UAAwB,eAAA,CAAgB,EAAA,EAAI,EAAA,EAAI,WAAA;AAAA"}
|
package/dist/pregel/remote.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { LangGraphRunnableConfig } from "./runnable_types.js";
|
|
|
3
3
|
import { PregelNode } from "./read.js";
|
|
4
4
|
import { PregelInputType, PregelInterface, PregelOptions, PregelOutputType, PregelParams, StateSnapshot } from "./types.js";
|
|
5
5
|
import { StrRecord } from "./algo.js";
|
|
6
|
+
import "./index.js";
|
|
7
|
+
import "../web.js";
|
|
6
8
|
import { All, CheckpointListOptions } from "@langchain/langgraph-checkpoint";
|
|
7
9
|
import { Runnable, RunnableConfig } from "@langchain/core/runnables";
|
|
8
10
|
import { Graph, Node } from "@langchain/core/runnables/graph";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.d.ts","names":[
|
|
1
|
+
{"version":3,"file":"remote.d.ts","names":[],"sources":["../../src/pregel/remote.ts"],"mappings":";;;;;;;;;;;;;;;KA8CY,iBAAA,GAAoB,IAAA,CAC9B,YAAA,CAAa,SAAA,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
|
|
3
3
|
import "../web.js";
|
|
4
4
|
import { Runnable, mergeConfigs } from "@langchain/core/runnables";
|
|
5
5
|
import { Graph } from "@langchain/core/runnables/graph";
|
|
6
|
-
import {
|
|
6
|
+
import { BaseMessage } from "@langchain/core/messages";
|
|
7
7
|
import { Client } from "@langchain/langgraph-sdk";
|
|
8
8
|
|
|
9
9
|
//#region src/pregel/remote.ts
|
|
10
10
|
const _serializeInputs = (obj) => {
|
|
11
11
|
if (obj === null || typeof obj !== "object") return obj;
|
|
12
12
|
if (Array.isArray(obj)) return obj.map(_serializeInputs);
|
|
13
|
-
if (
|
|
13
|
+
if (BaseMessage.isInstance(obj)) return {
|
|
14
14
|
...obj.toDict().data,
|
|
15
15
|
role: obj.getType()
|
|
16
16
|
};
|