@langchain/langgraph 1.2.5 → 1.2.7

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.
Files changed (111) hide show
  1. package/dist/channels/base.cjs.map +1 -1
  2. package/dist/channels/base.js.map +1 -1
  3. package/dist/channels/binop.cjs.map +1 -1
  4. package/dist/channels/binop.js.map +1 -1
  5. package/dist/constants.cjs.map +1 -1
  6. package/dist/constants.d.cts.map +1 -1
  7. package/dist/constants.d.ts.map +1 -1
  8. package/dist/constants.js.map +1 -1
  9. package/dist/func/types.d.cts.map +1 -1
  10. package/dist/func/types.d.ts.map +1 -1
  11. package/dist/graph/annotation.cjs.map +1 -1
  12. package/dist/graph/annotation.d.cts.map +1 -1
  13. package/dist/graph/annotation.d.ts.map +1 -1
  14. package/dist/graph/annotation.js.map +1 -1
  15. package/dist/graph/graph.cjs +2 -2
  16. package/dist/graph/graph.cjs.map +1 -1
  17. package/dist/graph/graph.d.cts.map +1 -1
  18. package/dist/graph/graph.d.ts.map +1 -1
  19. package/dist/graph/graph.js +2 -2
  20. package/dist/graph/graph.js.map +1 -1
  21. package/dist/graph/state.cjs.map +1 -1
  22. package/dist/graph/state.d.cts.map +1 -1
  23. package/dist/graph/state.d.ts.map +1 -1
  24. package/dist/graph/state.js.map +1 -1
  25. package/dist/graph/types.cjs.map +1 -1
  26. package/dist/graph/types.d.cts.map +1 -1
  27. package/dist/graph/types.d.ts.map +1 -1
  28. package/dist/graph/types.js.map +1 -1
  29. package/dist/graph/zod/meta.cjs.map +1 -1
  30. package/dist/graph/zod/meta.d.cts.map +1 -1
  31. package/dist/graph/zod/meta.d.ts.map +1 -1
  32. package/dist/graph/zod/meta.js.map +1 -1
  33. package/dist/graph/zod/zod-registry.cjs.map +1 -1
  34. package/dist/graph/zod/zod-registry.d.cts.map +1 -1
  35. package/dist/graph/zod/zod-registry.d.ts.map +1 -1
  36. package/dist/graph/zod/zod-registry.js.map +1 -1
  37. package/dist/index.cjs +1 -1
  38. package/dist/index.cjs.map +1 -1
  39. package/dist/index.d.cts +4 -4
  40. package/dist/index.d.ts +4 -4
  41. package/dist/index.js +1 -1
  42. package/dist/index.js.map +1 -1
  43. package/dist/interrupt.cjs.map +1 -1
  44. package/dist/interrupt.d.cts.map +1 -1
  45. package/dist/interrupt.d.ts.map +1 -1
  46. package/dist/interrupt.js.map +1 -1
  47. package/dist/prebuilt/react_agent_executor.cjs.map +1 -1
  48. package/dist/prebuilt/react_agent_executor.d.cts.map +1 -1
  49. package/dist/prebuilt/react_agent_executor.d.ts.map +1 -1
  50. package/dist/prebuilt/react_agent_executor.js.map +1 -1
  51. package/dist/prebuilt/tool_executor.cjs.map +1 -1
  52. package/dist/prebuilt/tool_executor.d.cts.map +1 -1
  53. package/dist/prebuilt/tool_executor.d.ts.map +1 -1
  54. package/dist/prebuilt/tool_executor.js.map +1 -1
  55. package/dist/pregel/algo.cjs.map +1 -1
  56. package/dist/pregel/algo.js.map +1 -1
  57. package/dist/pregel/debug.cjs.map +1 -1
  58. package/dist/pregel/debug.js.map +1 -1
  59. package/dist/pregel/index.cjs +8 -6
  60. package/dist/pregel/index.cjs.map +1 -1
  61. package/dist/pregel/index.d.cts.map +1 -1
  62. package/dist/pregel/index.d.ts.map +1 -1
  63. package/dist/pregel/index.js +8 -6
  64. package/dist/pregel/index.js.map +1 -1
  65. package/dist/pregel/loop.cjs +20 -4
  66. package/dist/pregel/loop.cjs.map +1 -1
  67. package/dist/pregel/loop.js +20 -4
  68. package/dist/pregel/loop.js.map +1 -1
  69. package/dist/pregel/read.cjs.map +1 -1
  70. package/dist/pregel/read.d.cts.map +1 -1
  71. package/dist/pregel/read.d.ts.map +1 -1
  72. package/dist/pregel/read.js.map +1 -1
  73. package/dist/pregel/remote.cjs.map +1 -1
  74. package/dist/pregel/remote.d.cts.map +1 -1
  75. package/dist/pregel/remote.d.ts.map +1 -1
  76. package/dist/pregel/remote.js.map +1 -1
  77. package/dist/pregel/retry.cjs.map +1 -1
  78. package/dist/pregel/retry.js.map +1 -1
  79. package/dist/pregel/runnable_types.d.cts.map +1 -1
  80. package/dist/pregel/runnable_types.d.ts.map +1 -1
  81. package/dist/pregel/stream.cjs +2 -8
  82. package/dist/pregel/stream.cjs.map +1 -1
  83. package/dist/pregel/stream.js +2 -8
  84. package/dist/pregel/stream.js.map +1 -1
  85. package/dist/pregel/types.cjs.map +1 -1
  86. package/dist/pregel/types.d.cts.map +1 -1
  87. package/dist/pregel/types.d.ts.map +1 -1
  88. package/dist/pregel/types.js.map +1 -1
  89. package/dist/pregel/utils/index.cjs +1 -12
  90. package/dist/pregel/utils/index.cjs.map +1 -1
  91. package/dist/pregel/utils/index.js +1 -12
  92. package/dist/pregel/utils/index.js.map +1 -1
  93. package/dist/pregel/validate.cjs.map +1 -1
  94. package/dist/pregel/validate.js.map +1 -1
  95. package/dist/pregel/write.cjs.map +1 -1
  96. package/dist/pregel/write.js.map +1 -1
  97. package/dist/state/schema.cjs.map +1 -1
  98. package/dist/state/schema.d.cts.map +1 -1
  99. package/dist/state/schema.d.ts.map +1 -1
  100. package/dist/state/schema.js.map +1 -1
  101. package/dist/state/types.cjs.map +1 -1
  102. package/dist/state/types.d.cts.map +1 -1
  103. package/dist/state/types.d.ts.map +1 -1
  104. package/dist/state/types.js.map +1 -1
  105. package/dist/utils.cjs.map +1 -1
  106. package/dist/utils.js.map +1 -1
  107. package/dist/web.cjs +11 -0
  108. package/dist/web.d.cts +6 -3
  109. package/dist/web.d.ts +6 -3
  110. package/dist/web.js +6 -3
  111. package/package.json +8 -20
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","names":[],"sources":["../../src/pregel/types.ts"],"mappings":";;;;;;;;;;;;;;AAsBA;KAAY,UAAA;AAAA,KAUA,UAAA;AAAA,KAGA,eAAA;AAAA,KAGA,gBAAA;AAAA,KAGP,mBAAA,IAAuB,WAAA,EAAa,MAAA;AAAA,KAGpC,iBAAA,GAAoB,MAAA;AAAA,KAEpB,uBAAA;EACH,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,GAAW,kBAAA;EA5Xe;;;EAAA,SAgY1B,SAAA;EA7XW;;;;EAAA,SAkYX,YAAA,GAAe,cAAA;EAnWX;;;EAAA,SAuWJ,KAAA,EAAO,qBAAA;AAAA;;;;KAMN,kCAAA;EAnUc;;;EAuUxB,IAAA;AAAA;;;;KAMU,gCAAA;EAlQC;;;;;EAwQX,GAAA;EAhagC;;;EAoahC,IAAA;AAAA;;;;KAMU,eAAA;EAtauB;;;;EA2ajC,SAAA;AAAA;AAAA,KA4CU,WAAA;EACV,IAAA,MAAU,IAAA,0BAA8B,OAAA;EACxC,IAAA;EACA,KAAA;EACA,KAAA,GAAQ,WAAA;EACR,KAAA,GAAQ,WAAA;EACR,SAAA;AAAA;AAAA,cAGW,IAAA;EACX,IAAA,MAAU,IAAA,0BAA8B,OAAA;EAExC,IAAA;EAEA,KAAA;EAEA,KAAA,GAAQ,WAAA;EAER,KAAA,GAAQ,WAAA;EAER,SAAA;EAAA,SAES,SAAA;EAET,WAAA,CAAA;IAAc,IAAA;IAAM,IAAA;IAAM,KAAA;IAAO,KAAA;IAAO,KAAA;IAAO;EAAA,GAAa,WAAA;AAAA;AAAA,KAmBlD,cAAA;AAAA,KACA,gBAAA;AAAA,KACA,YAAA,oCACyB,IAAA,aACxB,QAAA,0BAAkC,IAAA;AAAA,KACnC,QAAA,GAAW,cAAA,GAAiB,YAAA,GAAe,gBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/pregel/types.ts"],"sourcesContent":["import type { Runnable, RunnableConfig } from \"@langchain/core/runnables\";\nimport type {\n All,\n PendingWrite,\n CheckpointMetadata,\n BaseCheckpointSaver,\n BaseStore,\n CheckpointListOptions,\n BaseCache,\n} from \"@langchain/langgraph-checkpoint\";\nimport { Graph as DrawableGraph } from \"@langchain/core/runnables/graph\";\nimport { IterableReadableStream } from \"@langchain/core/utils/stream\";\nimport type { BaseMessage } from \"@langchain/core/messages\";\nimport type { BaseChannel } from \"../channels/base.js\";\nimport type { PregelNode } from \"./read.js\";\nimport type { Interrupt } from \"../constants.js\";\nimport { CachePolicy, RetryPolicy } from \"./utils/index.js\";\nimport { LangGraphRunnableConfig } from \"./runnable_types.js\";\n\n/**\n * Selects the type of output you'll receive when streaming from the graph. See [Streaming](/langgraphjs/how-tos/#streaming) for more details.\n */\nexport type StreamMode =\n | \"values\"\n | \"updates\"\n | \"debug\"\n | \"messages\"\n | \"checkpoints\"\n | \"tasks\"\n | \"custom\"\n | \"tools\";\n\nexport type Durability = \"exit\" | \"async\" | \"sync\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type PregelInputType = any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type PregelOutputType = any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype StreamMessageOutput = [BaseMessage, Record<string, any>];\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype StreamDebugOutput = Record<string, any>;\n\ntype StreamCheckpointsOutput<StreamValues> = {\n values: StreamValues;\n next: string[];\n config: RunnableConfig;\n metadata?: CheckpointMetadata;\n parentConfig?: RunnableConfig | undefined;\n tasks: PregelTaskDescription[];\n};\n\ninterface StreamTasksOutputBase {\n id: string;\n name: string;\n interrupts: Interrupt[];\n}\n\ninterface StreamTasksCreateOutput<StreamValues> extends StreamTasksOutputBase {\n input: StreamValues;\n triggers: string[];\n}\n\ninterface StreamTasksResultOutput<Keys, StreamUpdates>\n extends StreamTasksOutputBase {\n result: [Keys, StreamUpdates][];\n}\n\ntype StreamTasksOutput<StreamUpdates, StreamValues, Nodes = string> =\n | StreamTasksCreateOutput<StreamValues>\n | StreamTasksResultOutput<Nodes, StreamUpdates>;\n\nexport type StreamToolsOutput =\n | {\n event: \"on_tool_start\";\n toolCallId?: string;\n name: string;\n input: unknown;\n }\n | {\n event: \"on_tool_event\";\n toolCallId?: string;\n name: string;\n data: unknown;\n }\n | {\n event: \"on_tool_end\";\n toolCallId?: string;\n name: string;\n output: unknown;\n }\n | {\n event: \"on_tool_error\";\n toolCallId?: string;\n name: string;\n error: unknown;\n };\n\ntype DefaultStreamMode = \"updates\";\n\nexport type IsEventStream<T> = [T] extends [\"text/event-stream\"]\n ? [\"text/event-stream\"] extends [T]\n ? true\n : false\n : false;\n\nexport type StreamOutputMap<\n TStreamMode extends StreamMode | StreamMode[] | undefined,\n TStreamSubgraphs extends boolean,\n StreamUpdates,\n StreamValues,\n Nodes,\n NodeReturnType,\n StreamCustom,\n TEncoding extends \"text/event-stream\" | undefined\n> = IsEventStream<TEncoding> extends true\n ? Uint8Array\n : (\n undefined extends TStreamMode\n ? []\n : StreamMode | StreamMode[] extends TStreamMode\n ? TStreamMode extends StreamMode[]\n ? TStreamMode[number]\n : TStreamMode\n : TStreamMode extends StreamMode[]\n ? TStreamMode[number]\n : []\n ) extends infer Multiple extends StreamMode\n ? [TStreamSubgraphs] extends [true]\n ? {\n values: [string[], \"values\", StreamValues];\n updates: [\n string[],\n \"updates\",\n NodeReturnType extends Record<string, unknown>\n ? { [K in keyof NodeReturnType]?: NodeReturnType[K] }\n : Record<Nodes extends string ? Nodes : string, StreamUpdates>\n ];\n messages: [string[], \"messages\", StreamMessageOutput];\n custom: [string[], \"custom\", StreamCustom];\n checkpoints: [\n string[],\n \"checkpoints\",\n StreamCheckpointsOutput<StreamValues>\n ];\n tasks: [\n string[],\n \"tasks\",\n StreamTasksOutput<StreamUpdates, StreamValues>\n ];\n tools: [string[], \"tools\", StreamToolsOutput];\n debug: [string[], \"debug\", StreamDebugOutput];\n }[Multiple]\n : {\n values: [\"values\", StreamValues];\n updates: [\n \"updates\",\n NodeReturnType extends Record<string, unknown>\n ? { [K in keyof NodeReturnType]?: NodeReturnType[K] }\n : Record<Nodes extends string ? Nodes : string, StreamUpdates>\n ];\n messages: [\"messages\", StreamMessageOutput];\n custom: [\"custom\", StreamCustom];\n checkpoints: [\"checkpoints\", StreamCheckpointsOutput<StreamValues>];\n tasks: [\"tasks\", StreamTasksOutput<StreamUpdates, StreamValues, Nodes>];\n tools: [\"tools\", StreamToolsOutput];\n debug: [\"debug\", StreamDebugOutput];\n }[Multiple]\n : (\n undefined extends TStreamMode ? DefaultStreamMode : TStreamMode\n ) extends infer Single extends StreamMode\n ? [TStreamSubgraphs] extends [true]\n ? {\n values: [string[], StreamValues];\n updates: [\n string[],\n NodeReturnType extends Record<string, unknown>\n ? { [K in keyof NodeReturnType]?: NodeReturnType[K] }\n : Record<Nodes extends string ? Nodes : string, StreamUpdates>\n ];\n messages: [string[], StreamMessageOutput];\n custom: [string[], StreamCustom];\n checkpoints: [string[], StreamCheckpointsOutput<StreamValues>];\n tasks: [\n string[],\n StreamTasksOutput<StreamUpdates, StreamValues, Nodes>\n ];\n tools: [string[], StreamToolsOutput];\n debug: [string[], StreamDebugOutput];\n }[Single]\n : {\n values: StreamValues;\n updates: NodeReturnType extends Record<string, unknown>\n ? { [K in keyof NodeReturnType]?: NodeReturnType[K] }\n : Record<Nodes extends string ? Nodes : string, StreamUpdates>;\n messages: StreamMessageOutput;\n custom: StreamCustom;\n checkpoints: StreamCheckpointsOutput<StreamValues>;\n tasks: StreamTasksOutput<StreamUpdates, StreamValues, Nodes>;\n tools: StreamToolsOutput;\n debug: StreamDebugOutput;\n }[Single]\n : never;\n\n/**\n * Configuration options for executing a Pregel graph.\n * These options control how the graph executes, what data is streamed, and how interrupts are handled.\n *\n * @typeParam Nodes - Mapping of node names to their {@link PregelNode} implementations\n * @typeParam Channels - Mapping of channel names to their {@link BaseChannel} implementations\n * @typeParam ContextType - Type of context that can be passed to the graph\n */\nexport interface PregelOptions<\n Nodes extends StrRecord<string, PregelNode>,\n Channels extends StrRecord<string, BaseChannel>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ContextType extends Record<string, any> = Record<string, any>,\n TStreamMode extends StreamMode | StreamMode[] | undefined =\n | StreamMode\n | StreamMode[]\n | undefined,\n TSubgraphs extends boolean = boolean,\n TEncoding extends \"text/event-stream\" | undefined =\n | \"text/event-stream\"\n | undefined\n> extends RunnableConfig<ContextType> {\n /**\n * Controls what information is streamed during graph execution.\n * Multiple modes can be enabled simultaneously.\n *\n * Supported modes:\n * - \"values\": Streams complete state after each step\n * - \"updates\": Streams only state changes after each step\n * - \"messages\": Streams messages from within nodes\n * - \"custom\": Streams custom events from within nodes\n * - \"debug\": Streams detailed execution events for tracing & debugging\n *\n * @example\n * ```typescript\n * // Stream only values\n * streamMode: \"values\"\n *\n * // Stream both values and debug info\n * streamMode: [\"values\", \"debug\"]\n * ```\n *\n * @default [\"values\"]\n */\n streamMode?: TStreamMode;\n\n /**\n * Specifies which channel keys to retrieve from the checkpoint when resuming execution.\n * This is an advanced option that you generally don't need to set manually.\n * The graph will automatically determine the appropriate input keys based on its configuration.\n */\n inputKeys?: keyof Channels | Array<keyof Channels>;\n\n /**\n * Specifies which channel keys to include in the output stream and final result.\n * Use this to filter which parts of the graph state you want to observe.\n *\n * @example\n * ```typescript\n * // Stream only the 'result' channel\n * outputKeys: \"result\"\n *\n * // Stream multiple channels\n * outputKeys: [\"result\", \"intermediateState\"]\n * ```\n */\n outputKeys?: keyof Channels | Array<keyof Channels>;\n\n /**\n * List of nodes where execution should be interrupted BEFORE the node runs.\n * Can be used for debugging and advanced state manipulation use cases. For\n * human-in-the-loop workflows, developers should prefer the\n * @link {interrupt} function instead.\n *\n * When interrupted, a resume @link {Command} must be provided to continue\n * execution.\n *\n * @example\n * ```typescript\n * // Interrupt before specific nodes\n * interruptBefore: [\"humanReview\", \"qualityCheck\"]\n *\n * // Interrupt before all nodes\n * interruptBefore: \"all\"\n * ```\n */\n interruptBefore?: All | Array<keyof Nodes>;\n\n /**\n * List of nodes where execution should be interrupted AFTER the node runs.\n * Similar to interruptBefore, but interrupts after node completion.\n * Useful when the node's output needs to be reviewed before proceeding.\n *\n * @example\n * ```typescript\n * // Interrupt after specific nodes\n * interruptAfter: [\"generateContent\", \"analyze\"]\n *\n * // Interrupt after all nodes\n * interruptAfter: \"all\"\n * ```\n */\n interruptAfter?: All | Array<keyof Nodes>;\n\n /**\n * Enables detailed debug logging during graph execution.\n * When enabled, prints information about:\n * - Task execution\n * - Channel updates\n * - Checkpoint writes\n *\n * @default false\n */\n debug?: boolean;\n\n /**\n * Whether to include subgraph execution details in the stream.\n * When true, state updates from nested graphs will also be streamed.\n *\n * @default false\n */\n subgraphs?: TSubgraphs;\n\n /**\n * Whether to checkpoint intermediate steps, defaults to `true`.\n * If `false`, only the final checkpoint is saved.\n * @deprecated Use `durability` instead.\n */\n checkpointDuring?: boolean;\n\n /**\n * Whether to checkpoint during the run (or only at the end/interruption).\n * - `\"async\"`: Save checkpoint asynchronously while the next step executes (default).\n * - `\"sync\"`: Save checkpoint synchronously before the next step starts.\n * - `\"exit\"`: Save checkpoint only when the graph exits.\n * @default \"async\"\n */\n durability?: Durability;\n\n /**\n * A shared value store that allows you to store and retrieve state across\n * threads. Useful for implementing long-term memory patterns.\n */\n store?: BaseStore;\n\n /**\n * Optional cache for the graph, useful for caching tasks.\n */\n cache?: BaseCache;\n\n /**\n * Static context for the graph run, like `userId`, `dbConnection` etc.\n */\n context?: ContextType;\n\n /**\n * The encoding to use for the stream.\n * - `undefined`: Use the default format.\n * - `\"text/event-stream\"`: Use the Server-Sent Events format.\n * @default undefined\n */\n encoding?: TEncoding;\n}\n\n/**\n * Construct a type with a set of properties K of type T\n */\ntype StrRecord<K extends string, T> = {\n [P in K]: T;\n};\n\nexport interface PregelInterface<\n Nodes extends StrRecord<string, PregelNode>,\n Channels extends StrRecord<string, BaseChannel>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ContextType extends Record<string, any> = StrRecord<string, any>\n> {\n lg_is_pregel: boolean;\n\n withConfig(config: RunnableConfig): PregelInterface<Nodes, Channels>;\n\n getGraphAsync(\n config: RunnableConfig & { xray?: boolean | number }\n ): Promise<DrawableGraph>;\n\n /** @deprecated Use getSubgraphsAsync instead. The async method will become the default in the next minor release. */\n getSubgraphs(\n namespace?: string,\n recurse?: boolean\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): Generator<[string, PregelInterface<any, any>]>;\n\n getSubgraphsAsync(\n namespace?: string,\n recurse?: boolean\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): AsyncGenerator<[string, PregelInterface<any, any>]>;\n\n getState(\n config: RunnableConfig,\n options?: { subgraphs?: boolean }\n ): Promise<StateSnapshot>;\n\n getStateHistory(\n config: RunnableConfig,\n options?: CheckpointListOptions\n ): AsyncIterableIterator<StateSnapshot>;\n\n updateState(\n inputConfig: LangGraphRunnableConfig,\n values: Record<string, unknown> | unknown,\n asNode?: keyof Nodes | string\n ): Promise<RunnableConfig>;\n\n stream(\n input: PregelInputType,\n options?: Partial<PregelOptions<Nodes, Channels, ContextType>>\n ): Promise<IterableReadableStream<PregelOutputType>>;\n\n invoke(\n input: PregelInputType,\n options?: Partial<PregelOptions<Nodes, Channels, ContextType>>\n ): Promise<PregelOutputType>;\n}\n\n/**\n * Parameters for creating a Pregel graph.\n * @internal\n */\nexport type PregelParams<\n Nodes extends StrRecord<string, PregelNode>,\n Channels extends StrRecord<string, BaseChannel>\n> = {\n /**\n * The name of the graph. @see {@link Runnable.name}\n */\n name?: string;\n\n /**\n * The nodes in the graph.\n */\n nodes: Nodes;\n\n /**\n * The channels in the graph.\n */\n channels: Channels;\n\n /**\n * Whether to validate the graph.\n *\n * @default true\n */\n autoValidate?: boolean;\n\n /**\n * The stream mode for the graph run. See [Streaming](/langgraphjs/how-tos/#streaming) for more details.\n *\n * @default [\"values\"]\n */\n streamMode?: StreamMode | StreamMode[];\n\n /**\n * The input channels for the graph run.\n */\n inputChannels: keyof Channels | Array<keyof Channels>;\n\n /**\n * The output channels for the graph run.\n */\n outputChannels: keyof Channels | Array<keyof Channels>;\n\n /**\n * After processing one of the nodes named in this list, the graph will be interrupted and a resume {@link Command} must be provided to proceed with the execution of this thread.\n * @default []\n */\n interruptAfter?: Array<keyof Nodes> | All;\n\n /**\n * Before processing one of the nodes named in this list, the graph will be interrupted and a resume {@link Command} must be provided to proceed with the execution of this thread.\n * @default []\n */\n interruptBefore?: Array<keyof Nodes> | All;\n\n /**\n * The channels to stream from the graph run.\n * @default []\n */\n streamChannels?: keyof Channels | Array<keyof Channels>;\n\n /**\n * @default undefined\n */\n stepTimeout?: number;\n\n /**\n * @default false\n */\n debug?: boolean;\n\n /**\n * The {@link BaseCheckpointSaver | checkpointer} to use for the graph run.\n */\n checkpointer?: BaseCheckpointSaver | boolean;\n\n /**\n * The default retry policy for this graph. For defaults, see {@link RetryPolicy}.\n */\n retryPolicy?: RetryPolicy;\n\n /**\n * The configuration for the graph run.\n */\n config?: LangGraphRunnableConfig;\n\n /**\n * External key-value store.\n */\n store?: BaseStore;\n\n /**\n * Storage used for node caching.\n */\n cache?: BaseCache;\n\n /**\n * The trigger to node mapping for the graph run.\n * @internal\n */\n triggerToNodes?: Record<string, string[]>;\n\n /**\n * Interrupt helper function.\n * @internal\n */\n userInterrupt?: unknown;\n};\n\nexport interface PregelTaskDescription {\n readonly id: string;\n readonly name: string;\n readonly error?: unknown;\n readonly interrupts: Interrupt[];\n readonly state?: LangGraphRunnableConfig | StateSnapshot;\n readonly path?: TaskPath;\n readonly result?: unknown;\n}\n\ninterface CacheKey {\n ns: string[];\n key: string;\n ttl?: number;\n}\n\nexport interface PregelExecutableTask<\n NodeKey extends PropertyKey,\n ChannelKey extends PropertyKey\n> {\n readonly name: NodeKey;\n readonly input: unknown;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly proc: Runnable<any, any, LangGraphRunnableConfig>;\n readonly writes: PendingWrite<ChannelKey>[];\n readonly config?: LangGraphRunnableConfig;\n readonly triggers: Array<string>;\n readonly retry_policy?: RetryPolicy;\n readonly cache_key?: CacheKey;\n readonly id: string;\n readonly path?: TaskPath;\n readonly subgraphs?: Runnable[];\n readonly writers: Runnable[];\n}\n\nexport interface StateSnapshot {\n /**\n * Current values of channels\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly values: Record<string, any> | any;\n /**\n * Nodes to execute in the next step, if any\n */\n readonly next: Array<string>;\n /**\n * Config used to fetch this snapshot\n */\n readonly config: RunnableConfig;\n /**\n * Metadata about the checkpoint\n */\n readonly metadata?: CheckpointMetadata;\n /**\n * Time when the snapshot was created\n */\n readonly createdAt?: string;\n /**\n * Config used to fetch the parent snapshot, if any\n * @default undefined\n */\n readonly parentConfig?: RunnableConfig | undefined;\n /**\n * Tasks to execute in this step. If already attempted, may contain an error.\n */\n readonly tasks: PregelTaskDescription[];\n}\n\n/**\n * Options for subscribing to multiple channels.\n */\nexport type MultipleChannelSubscriptionOptions = {\n /**\n * Optional tags to associate with the subscription.\n */\n tags?: string[];\n};\n\n/**\n * Options for subscribing to a single channel.\n */\nexport type SingleChannelSubscriptionOptions = {\n /**\n * When specified, the channel mapping will be an object with this key pointing\n * to the array of channels to subscribe to. Otherwise, the channel mapping\n * will be an array of channels.\n */\n key?: string;\n /**\n * Optional tags to associate with the subscription.\n */\n tags?: string[];\n};\n\n/**\n * Options for getting the state of the graph.\n */\nexport type GetStateOptions = {\n /**\n * Whether to include subgraph states.\n * @default false\n */\n subgraphs?: boolean;\n};\n\n/**\n * Used for storing/retrieving internal execution state.\n *\n * @internal\n */\nexport type PregelScratchpad<Resume = unknown> = {\n /** Counter for tracking call invocations */\n callCounter: number;\n /** Counter for tracking interrupts */\n interruptCounter: number;\n /** List of resume values */\n resume: Resume[];\n /** Single resume value for null task ID */\n nullResume: Resume;\n\n consumeNullResume: () => Resume | undefined;\n /** Counter for tracking subgraph invocations */\n subgraphCounter: number;\n\n /** The input to the currently executing task */\n currentTaskInput: unknown;\n};\n\n/**\n * @internal\n */\nexport type PregelAbortSignals = {\n /** Aborts when the user calls `stream.cancel()` or aborts the {@link AbortSignal} that they passed in via the `signal` option */\n externalAbortSignal?: AbortSignal;\n\n /**\n * Aborts when the currently executing task throws any error other than a {@link GraphBubbleUp}\n */\n timeoutAbortSignal?: AbortSignal;\n\n /**\n * A reference to the AbortSignal that is passed to the node. Aborts on step timeout, stream cancel, or when an error is thrown.\n */\n composedAbortSignal?: AbortSignal;\n};\n\nexport type CallOptions = {\n func: (...args: unknown[]) => unknown | Promise<unknown>;\n name: string;\n input: unknown;\n cache?: CachePolicy;\n retry?: RetryPolicy;\n callbacks?: unknown;\n};\n\nexport class Call {\n func: (...args: unknown[]) => unknown | Promise<unknown>;\n\n name: string;\n\n input: unknown;\n\n retry?: RetryPolicy;\n\n cache?: CachePolicy;\n\n callbacks?: unknown;\n\n readonly __lg_type = \"call\";\n\n constructor({ func, name, input, retry, cache, callbacks }: CallOptions) {\n this.func = func;\n this.name = name;\n this.input = input;\n this.retry = retry;\n this.cache = cache;\n this.callbacks = callbacks;\n }\n}\n\nexport function isCall(value: unknown): value is Call {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"__lg_type\" in value &&\n value.__lg_type === \"call\"\n );\n}\n\nexport type SimpleTaskPath = [string, string | number];\nexport type VariadicTaskPath = [string, ...(string | number)[], boolean];\nexport type CallTaskPath =\n | [string, ...(string | number)[], Call]\n | [string, TaskPath, ...(string | number)[], Call];\nexport type TaskPath = SimpleTaskPath | CallTaskPath | VariadicTaskPath;\n"],"mappings":";AA4rBA,IAAa,OAAb,MAAkB;CAChB;CAEA;CAEA;CAEA;CAEA;CAEA;CAEA,YAAqB;CAErB,YAAY,EAAE,MAAM,MAAM,OAAO,OAAO,OAAO,aAA0B;AACvE,OAAK,OAAO;AACZ,OAAK,OAAO;AACZ,OAAK,QAAQ;AACb,OAAK,QAAQ;AACb,OAAK,QAAQ;AACb,OAAK,YAAY;;;AAIrB,SAAgB,OAAO,OAA+B;AACpD,QACE,OAAO,UAAU,YACjB,UAAU,QACV,eAAe,SACf,MAAM,cAAc"}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/pregel/types.ts"],"sourcesContent":["import type { Runnable, RunnableConfig } from \"@langchain/core/runnables\";\nimport type {\n All,\n PendingWrite,\n CheckpointMetadata,\n BaseCheckpointSaver,\n BaseStore,\n CheckpointListOptions,\n BaseCache,\n} from \"@langchain/langgraph-checkpoint\";\nimport { Graph as DrawableGraph } from \"@langchain/core/runnables/graph\";\nimport { IterableReadableStream } from \"@langchain/core/utils/stream\";\nimport type { BaseMessage } from \"@langchain/core/messages\";\nimport type { BaseChannel } from \"../channels/base.js\";\nimport type { PregelNode } from \"./read.js\";\nimport type { Interrupt } from \"../constants.js\";\nimport { CachePolicy, RetryPolicy } from \"./utils/index.js\";\nimport { LangGraphRunnableConfig } from \"./runnable_types.js\";\n\n/**\n * Selects the type of output you'll receive when streaming from the graph. See [Streaming](/langgraphjs/how-tos/#streaming) for more details.\n */\nexport type StreamMode =\n | \"values\"\n | \"updates\"\n | \"debug\"\n | \"messages\"\n | \"checkpoints\"\n | \"tasks\"\n | \"custom\"\n | \"tools\";\n\nexport type Durability = \"exit\" | \"async\" | \"sync\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type PregelInputType = any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type PregelOutputType = any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype StreamMessageOutput = [BaseMessage, Record<string, any>];\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype StreamDebugOutput = Record<string, any>;\n\ntype StreamCheckpointsOutput<StreamValues> = {\n values: StreamValues;\n next: string[];\n config: RunnableConfig;\n metadata?: CheckpointMetadata;\n parentConfig?: RunnableConfig | undefined;\n tasks: PregelTaskDescription[];\n};\n\ninterface StreamTasksOutputBase {\n id: string;\n name: string;\n interrupts: Interrupt[];\n}\n\ninterface StreamTasksCreateOutput<StreamValues> extends StreamTasksOutputBase {\n input: StreamValues;\n triggers: string[];\n}\n\ninterface StreamTasksResultOutput<\n Keys,\n StreamUpdates,\n> extends StreamTasksOutputBase {\n result: [Keys, StreamUpdates][];\n}\n\ntype StreamTasksOutput<StreamUpdates, StreamValues, Nodes = string> =\n | StreamTasksCreateOutput<StreamValues>\n | StreamTasksResultOutput<Nodes, StreamUpdates>;\n\nexport type StreamToolsOutput =\n | {\n event: \"on_tool_start\";\n toolCallId?: string;\n name: string;\n input: unknown;\n }\n | {\n event: \"on_tool_event\";\n toolCallId?: string;\n name: string;\n data: unknown;\n }\n | {\n event: \"on_tool_end\";\n toolCallId?: string;\n name: string;\n output: unknown;\n }\n | {\n event: \"on_tool_error\";\n toolCallId?: string;\n name: string;\n error: unknown;\n };\n\ntype DefaultStreamMode = \"updates\";\n\nexport type IsEventStream<T> = [T] extends [\"text/event-stream\"]\n ? [\"text/event-stream\"] extends [T]\n ? true\n : false\n : false;\n\nexport type StreamOutputMap<\n TStreamMode extends StreamMode | StreamMode[] | undefined,\n TStreamSubgraphs extends boolean,\n StreamUpdates,\n StreamValues,\n Nodes,\n NodeReturnType,\n StreamCustom,\n TEncoding extends \"text/event-stream\" | undefined,\n> =\n IsEventStream<TEncoding> extends true\n ? Uint8Array\n : (\n undefined extends TStreamMode\n ? []\n : StreamMode | StreamMode[] extends TStreamMode\n ? TStreamMode extends StreamMode[]\n ? TStreamMode[number]\n : TStreamMode\n : TStreamMode extends StreamMode[]\n ? TStreamMode[number]\n : []\n ) extends infer Multiple extends StreamMode\n ? [TStreamSubgraphs] extends [true]\n ? {\n values: [string[], \"values\", StreamValues];\n updates: [\n string[],\n \"updates\",\n NodeReturnType extends Record<string, unknown>\n ? { [K in keyof NodeReturnType]?: NodeReturnType[K] }\n : Record<Nodes extends string ? Nodes : string, StreamUpdates>,\n ];\n messages: [string[], \"messages\", StreamMessageOutput];\n custom: [string[], \"custom\", StreamCustom];\n checkpoints: [\n string[],\n \"checkpoints\",\n StreamCheckpointsOutput<StreamValues>,\n ];\n tasks: [\n string[],\n \"tasks\",\n StreamTasksOutput<StreamUpdates, StreamValues>,\n ];\n tools: [string[], \"tools\", StreamToolsOutput];\n debug: [string[], \"debug\", StreamDebugOutput];\n }[Multiple]\n : {\n values: [\"values\", StreamValues];\n updates: [\n \"updates\",\n NodeReturnType extends Record<string, unknown>\n ? { [K in keyof NodeReturnType]?: NodeReturnType[K] }\n : Record<Nodes extends string ? Nodes : string, StreamUpdates>,\n ];\n messages: [\"messages\", StreamMessageOutput];\n custom: [\"custom\", StreamCustom];\n checkpoints: [\"checkpoints\", StreamCheckpointsOutput<StreamValues>];\n tasks: [\n \"tasks\",\n StreamTasksOutput<StreamUpdates, StreamValues, Nodes>,\n ];\n tools: [\"tools\", StreamToolsOutput];\n debug: [\"debug\", StreamDebugOutput];\n }[Multiple]\n : (\n undefined extends TStreamMode ? DefaultStreamMode : TStreamMode\n ) extends infer Single extends StreamMode\n ? [TStreamSubgraphs] extends [true]\n ? {\n values: [string[], StreamValues];\n updates: [\n string[],\n NodeReturnType extends Record<string, unknown>\n ? { [K in keyof NodeReturnType]?: NodeReturnType[K] }\n : Record<\n Nodes extends string ? Nodes : string,\n StreamUpdates\n >,\n ];\n messages: [string[], StreamMessageOutput];\n custom: [string[], StreamCustom];\n checkpoints: [string[], StreamCheckpointsOutput<StreamValues>];\n tasks: [\n string[],\n StreamTasksOutput<StreamUpdates, StreamValues, Nodes>,\n ];\n tools: [string[], StreamToolsOutput];\n debug: [string[], StreamDebugOutput];\n }[Single]\n : {\n values: StreamValues;\n updates: NodeReturnType extends Record<string, unknown>\n ? { [K in keyof NodeReturnType]?: NodeReturnType[K] }\n : Record<Nodes extends string ? Nodes : string, StreamUpdates>;\n messages: StreamMessageOutput;\n custom: StreamCustom;\n checkpoints: StreamCheckpointsOutput<StreamValues>;\n tasks: StreamTasksOutput<StreamUpdates, StreamValues, Nodes>;\n tools: StreamToolsOutput;\n debug: StreamDebugOutput;\n }[Single]\n : never;\n\n/**\n * Configuration options for executing a Pregel graph.\n * These options control how the graph executes, what data is streamed, and how interrupts are handled.\n *\n * @typeParam Nodes - Mapping of node names to their {@link PregelNode} implementations\n * @typeParam Channels - Mapping of channel names to their {@link BaseChannel} implementations\n * @typeParam ContextType - Type of context that can be passed to the graph\n */\nexport interface PregelOptions<\n Nodes extends StrRecord<string, PregelNode>,\n Channels extends StrRecord<string, BaseChannel>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ContextType extends Record<string, any> = Record<string, any>,\n TStreamMode extends StreamMode | StreamMode[] | undefined =\n | StreamMode\n | StreamMode[]\n | undefined,\n TSubgraphs extends boolean = boolean,\n TEncoding extends \"text/event-stream\" | undefined =\n | \"text/event-stream\"\n | undefined,\n> extends RunnableConfig<ContextType> {\n /**\n * Controls what information is streamed during graph execution.\n * Multiple modes can be enabled simultaneously.\n *\n * Supported modes:\n * - \"values\": Streams complete state after each step\n * - \"updates\": Streams only state changes after each step\n * - \"messages\": Streams messages from within nodes\n * - \"custom\": Streams custom events from within nodes\n * - \"debug\": Streams detailed execution events for tracing & debugging\n *\n * @example\n * ```typescript\n * // Stream only values\n * streamMode: \"values\"\n *\n * // Stream both values and debug info\n * streamMode: [\"values\", \"debug\"]\n * ```\n *\n * @default [\"values\"]\n */\n streamMode?: TStreamMode;\n\n /**\n * Specifies which channel keys to retrieve from the checkpoint when resuming execution.\n * This is an advanced option that you generally don't need to set manually.\n * The graph will automatically determine the appropriate input keys based on its configuration.\n */\n inputKeys?: keyof Channels | Array<keyof Channels>;\n\n /**\n * Specifies which channel keys to include in the output stream and final result.\n * Use this to filter which parts of the graph state you want to observe.\n *\n * @example\n * ```typescript\n * // Stream only the 'result' channel\n * outputKeys: \"result\"\n *\n * // Stream multiple channels\n * outputKeys: [\"result\", \"intermediateState\"]\n * ```\n */\n outputKeys?: keyof Channels | Array<keyof Channels>;\n\n /**\n * List of nodes where execution should be interrupted BEFORE the node runs.\n * Can be used for debugging and advanced state manipulation use cases. For\n * human-in-the-loop workflows, developers should prefer the\n * @link {interrupt} function instead.\n *\n * When interrupted, a resume @link {Command} must be provided to continue\n * execution.\n *\n * @example\n * ```typescript\n * // Interrupt before specific nodes\n * interruptBefore: [\"humanReview\", \"qualityCheck\"]\n *\n * // Interrupt before all nodes\n * interruptBefore: \"all\"\n * ```\n */\n interruptBefore?: All | Array<keyof Nodes>;\n\n /**\n * List of nodes where execution should be interrupted AFTER the node runs.\n * Similar to interruptBefore, but interrupts after node completion.\n * Useful when the node's output needs to be reviewed before proceeding.\n *\n * @example\n * ```typescript\n * // Interrupt after specific nodes\n * interruptAfter: [\"generateContent\", \"analyze\"]\n *\n * // Interrupt after all nodes\n * interruptAfter: \"all\"\n * ```\n */\n interruptAfter?: All | Array<keyof Nodes>;\n\n /**\n * Enables detailed debug logging during graph execution.\n * When enabled, prints information about:\n * - Task execution\n * - Channel updates\n * - Checkpoint writes\n *\n * @default false\n */\n debug?: boolean;\n\n /**\n * Whether to include subgraph execution details in the stream.\n * When true, state updates from nested graphs will also be streamed.\n *\n * @default false\n */\n subgraphs?: TSubgraphs;\n\n /**\n * Whether to checkpoint intermediate steps, defaults to `true`.\n * If `false`, only the final checkpoint is saved.\n * @deprecated Use `durability` instead.\n */\n checkpointDuring?: boolean;\n\n /**\n * Whether to checkpoint during the run (or only at the end/interruption).\n * - `\"async\"`: Save checkpoint asynchronously while the next step executes (default).\n * - `\"sync\"`: Save checkpoint synchronously before the next step starts.\n * - `\"exit\"`: Save checkpoint only when the graph exits.\n * @default \"async\"\n */\n durability?: Durability;\n\n /**\n * A shared value store that allows you to store and retrieve state across\n * threads. Useful for implementing long-term memory patterns.\n */\n store?: BaseStore;\n\n /**\n * Optional cache for the graph, useful for caching tasks.\n */\n cache?: BaseCache;\n\n /**\n * Static context for the graph run, like `userId`, `dbConnection` etc.\n */\n context?: ContextType;\n\n /**\n * The encoding to use for the stream.\n * - `undefined`: Use the default format.\n * - `\"text/event-stream\"`: Use the Server-Sent Events format.\n * @default undefined\n */\n encoding?: TEncoding;\n}\n\n/**\n * Construct a type with a set of properties K of type T\n */\ntype StrRecord<K extends string, T> = {\n [P in K]: T;\n};\n\nexport interface PregelInterface<\n Nodes extends StrRecord<string, PregelNode>,\n Channels extends StrRecord<string, BaseChannel>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ContextType extends Record<string, any> = StrRecord<string, any>,\n> {\n lg_is_pregel: boolean;\n\n withConfig(config: RunnableConfig): PregelInterface<Nodes, Channels>;\n\n getGraphAsync(\n config: RunnableConfig & { xray?: boolean | number }\n ): Promise<DrawableGraph>;\n\n /** @deprecated Use getSubgraphsAsync instead. The async method will become the default in the next minor release. */\n getSubgraphs(\n namespace?: string,\n recurse?: boolean\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): Generator<[string, PregelInterface<any, any>]>;\n\n getSubgraphsAsync(\n namespace?: string,\n recurse?: boolean\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): AsyncGenerator<[string, PregelInterface<any, any>]>;\n\n getState(\n config: RunnableConfig,\n options?: { subgraphs?: boolean }\n ): Promise<StateSnapshot>;\n\n getStateHistory(\n config: RunnableConfig,\n options?: CheckpointListOptions\n ): AsyncIterableIterator<StateSnapshot>;\n\n updateState(\n inputConfig: LangGraphRunnableConfig,\n values: Record<string, unknown> | unknown,\n asNode?: keyof Nodes | string\n ): Promise<RunnableConfig>;\n\n stream(\n input: PregelInputType,\n options?: Partial<PregelOptions<Nodes, Channels, ContextType>>\n ): Promise<IterableReadableStream<PregelOutputType>>;\n\n invoke(\n input: PregelInputType,\n options?: Partial<PregelOptions<Nodes, Channels, ContextType>>\n ): Promise<PregelOutputType>;\n}\n\n/**\n * Parameters for creating a Pregel graph.\n * @internal\n */\nexport type PregelParams<\n Nodes extends StrRecord<string, PregelNode>,\n Channels extends StrRecord<string, BaseChannel>,\n> = {\n /**\n * The name of the graph. @see {@link Runnable.name}\n */\n name?: string;\n\n /**\n * The nodes in the graph.\n */\n nodes: Nodes;\n\n /**\n * The channels in the graph.\n */\n channels: Channels;\n\n /**\n * Whether to validate the graph.\n *\n * @default true\n */\n autoValidate?: boolean;\n\n /**\n * The stream mode for the graph run. See [Streaming](/langgraphjs/how-tos/#streaming) for more details.\n *\n * @default [\"values\"]\n */\n streamMode?: StreamMode | StreamMode[];\n\n /**\n * The input channels for the graph run.\n */\n inputChannels: keyof Channels | Array<keyof Channels>;\n\n /**\n * The output channels for the graph run.\n */\n outputChannels: keyof Channels | Array<keyof Channels>;\n\n /**\n * After processing one of the nodes named in this list, the graph will be interrupted and a resume {@link Command} must be provided to proceed with the execution of this thread.\n * @default []\n */\n interruptAfter?: Array<keyof Nodes> | All;\n\n /**\n * Before processing one of the nodes named in this list, the graph will be interrupted and a resume {@link Command} must be provided to proceed with the execution of this thread.\n * @default []\n */\n interruptBefore?: Array<keyof Nodes> | All;\n\n /**\n * The channels to stream from the graph run.\n * @default []\n */\n streamChannels?: keyof Channels | Array<keyof Channels>;\n\n /**\n * @default undefined\n */\n stepTimeout?: number;\n\n /**\n * @default false\n */\n debug?: boolean;\n\n /**\n * The {@link BaseCheckpointSaver | checkpointer} to use for the graph run.\n */\n checkpointer?: BaseCheckpointSaver | boolean;\n\n /**\n * The default retry policy for this graph. For defaults, see {@link RetryPolicy}.\n */\n retryPolicy?: RetryPolicy;\n\n /**\n * The configuration for the graph run.\n */\n config?: LangGraphRunnableConfig;\n\n /**\n * External key-value store.\n */\n store?: BaseStore;\n\n /**\n * Storage used for node caching.\n */\n cache?: BaseCache;\n\n /**\n * The trigger to node mapping for the graph run.\n * @internal\n */\n triggerToNodes?: Record<string, string[]>;\n\n /**\n * Interrupt helper function.\n * @internal\n */\n userInterrupt?: unknown;\n};\n\nexport interface PregelTaskDescription {\n readonly id: string;\n readonly name: string;\n readonly error?: unknown;\n readonly interrupts: Interrupt[];\n readonly state?: LangGraphRunnableConfig | StateSnapshot;\n readonly path?: TaskPath;\n readonly result?: unknown;\n}\n\ninterface CacheKey {\n ns: string[];\n key: string;\n ttl?: number;\n}\n\nexport interface PregelExecutableTask<\n NodeKey extends PropertyKey,\n ChannelKey extends PropertyKey,\n> {\n readonly name: NodeKey;\n readonly input: unknown;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly proc: Runnable<any, any, LangGraphRunnableConfig>;\n readonly writes: PendingWrite<ChannelKey>[];\n readonly config?: LangGraphRunnableConfig;\n readonly triggers: Array<string>;\n readonly retry_policy?: RetryPolicy;\n readonly cache_key?: CacheKey;\n readonly id: string;\n readonly path?: TaskPath;\n readonly subgraphs?: Runnable[];\n readonly writers: Runnable[];\n}\n\nexport interface StateSnapshot {\n /**\n * Current values of channels\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly values: Record<string, any> | any;\n /**\n * Nodes to execute in the next step, if any\n */\n readonly next: Array<string>;\n /**\n * Config used to fetch this snapshot\n */\n readonly config: RunnableConfig;\n /**\n * Metadata about the checkpoint\n */\n readonly metadata?: CheckpointMetadata;\n /**\n * Time when the snapshot was created\n */\n readonly createdAt?: string;\n /**\n * Config used to fetch the parent snapshot, if any\n * @default undefined\n */\n readonly parentConfig?: RunnableConfig | undefined;\n /**\n * Tasks to execute in this step. If already attempted, may contain an error.\n */\n readonly tasks: PregelTaskDescription[];\n}\n\n/**\n * Options for subscribing to multiple channels.\n */\nexport type MultipleChannelSubscriptionOptions = {\n /**\n * Optional tags to associate with the subscription.\n */\n tags?: string[];\n};\n\n/**\n * Options for subscribing to a single channel.\n */\nexport type SingleChannelSubscriptionOptions = {\n /**\n * When specified, the channel mapping will be an object with this key pointing\n * to the array of channels to subscribe to. Otherwise, the channel mapping\n * will be an array of channels.\n */\n key?: string;\n /**\n * Optional tags to associate with the subscription.\n */\n tags?: string[];\n};\n\n/**\n * Options for getting the state of the graph.\n */\nexport type GetStateOptions = {\n /**\n * Whether to include subgraph states.\n * @default false\n */\n subgraphs?: boolean;\n};\n\n/**\n * Used for storing/retrieving internal execution state.\n *\n * @internal\n */\nexport type PregelScratchpad<Resume = unknown> = {\n /** Counter for tracking call invocations */\n callCounter: number;\n /** Counter for tracking interrupts */\n interruptCounter: number;\n /** List of resume values */\n resume: Resume[];\n /** Single resume value for null task ID */\n nullResume: Resume;\n\n consumeNullResume: () => Resume | undefined;\n /** Counter for tracking subgraph invocations */\n subgraphCounter: number;\n\n /** The input to the currently executing task */\n currentTaskInput: unknown;\n};\n\n/**\n * @internal\n */\nexport type PregelAbortSignals = {\n /** Aborts when the user calls `stream.cancel()` or aborts the {@link AbortSignal} that they passed in via the `signal` option */\n externalAbortSignal?: AbortSignal;\n\n /**\n * Aborts when the currently executing task throws any error other than a {@link GraphBubbleUp}\n */\n timeoutAbortSignal?: AbortSignal;\n\n /**\n * A reference to the AbortSignal that is passed to the node. Aborts on step timeout, stream cancel, or when an error is thrown.\n */\n composedAbortSignal?: AbortSignal;\n};\n\nexport type CallOptions = {\n func: (...args: unknown[]) => unknown | Promise<unknown>;\n name: string;\n input: unknown;\n cache?: CachePolicy;\n retry?: RetryPolicy;\n callbacks?: unknown;\n};\n\nexport class Call {\n func: (...args: unknown[]) => unknown | Promise<unknown>;\n\n name: string;\n\n input: unknown;\n\n retry?: RetryPolicy;\n\n cache?: CachePolicy;\n\n callbacks?: unknown;\n\n readonly __lg_type = \"call\";\n\n constructor({ func, name, input, retry, cache, callbacks }: CallOptions) {\n this.func = func;\n this.name = name;\n this.input = input;\n this.retry = retry;\n this.cache = cache;\n this.callbacks = callbacks;\n }\n}\n\nexport function isCall(value: unknown): value is Call {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"__lg_type\" in value &&\n value.__lg_type === \"call\"\n );\n}\n\nexport type SimpleTaskPath = [string, string | number];\nexport type VariadicTaskPath = [string, ...(string | number)[], boolean];\nexport type CallTaskPath =\n | [string, ...(string | number)[], Call]\n | [string, TaskPath, ...(string | number)[], Call];\nexport type TaskPath = SimpleTaskPath | CallTaskPath | VariadicTaskPath;\n"],"mappings":";AAqsBA,IAAa,OAAb,MAAkB;CAChB;CAEA;CAEA;CAEA;CAEA;CAEA;CAEA,YAAqB;CAErB,YAAY,EAAE,MAAM,MAAM,OAAO,OAAO,OAAO,aAA0B;AACvE,OAAK,OAAO;AACZ,OAAK,OAAO;AACZ,OAAK,QAAQ;AACb,OAAK,QAAQ;AACb,OAAK,QAAQ;AACb,OAAK,YAAY;;;AAIrB,SAAgB,OAAO,OAA+B;AACpD,QACE,OAAO,UAAU,YACjB,UAAU,QACV,eAAe,SACf,MAAM,cAAc"}
@@ -45,15 +45,8 @@ function patchCheckpointMap(config, metadata) {
45
45
  }
46
46
  /**
47
47
  * Combine multiple abort signals into a single abort signal.
48
- *
49
- * On Node 20+ / modern runtimes, uses `AbortSignal.any()` which lets the
50
- * runtime manage listener lifecycle — no manual dispose needed. On older
51
- * runtimes, falls back to manual listener management and returns a `dispose`
52
- * function that callers MUST invoke when the combined signal is no longer
53
- * needed, to avoid leaking listeners on the source signals.
54
- *
55
48
  * @param signals - The abort signals to combine.
56
- * @returns A combined abort signal and an optional dispose function.
49
+ * @returns A combined abort signal and a dispose function to remove the abort listener if unused.
57
50
  */
58
51
  function combineAbortSignals(...x) {
59
52
  const signals = [...new Set(x.filter(Boolean))];
@@ -65,10 +58,6 @@ function combineAbortSignals(...x) {
65
58
  signal: signals[0],
66
59
  dispose: void 0
67
60
  };
68
- if (typeof AbortSignal.any === "function") return {
69
- signal: AbortSignal.any(signals),
70
- dispose: void 0
71
- };
72
61
  const combinedController = new AbortController();
73
62
  const listener = () => {
74
63
  const reason = signals.find((s) => s.aborted)?.reason;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["START","CONFIG_KEY_CHECKPOINT_MAP"],"sources":["../../../src/pregel/utils/index.ts"],"sourcesContent":["import { Callbacks } from \"@langchain/core/callbacks/manager\";\nimport { RunnableConfig } from \"@langchain/core/runnables\";\nimport type {\n ChannelVersions,\n CheckpointMetadata,\n} from \"@langchain/langgraph-checkpoint\";\nimport { CONFIG_KEY_CHECKPOINT_MAP, START } from \"../../constants.js\";\n\nexport function getNullChannelVersion(currentVersions: ChannelVersions) {\n // Short circuit for commonly used channels such as __start__\n // (used by StateGraph)\n const startVersion = typeof currentVersions[START];\n if (startVersion === \"number\") return 0;\n if (startVersion === \"string\") return \"\";\n\n // Defer back to obtaining a first key from channel versions\n for (const key in currentVersions) {\n if (!Object.prototype.hasOwnProperty.call(currentVersions, key)) continue;\n const versionType = typeof currentVersions[key];\n if (versionType === \"number\") return 0;\n if (versionType === \"string\") return \"\";\n break;\n }\n\n return undefined;\n}\n\nexport function getNewChannelVersions(\n previousVersions: ChannelVersions,\n currentVersions: ChannelVersions\n): ChannelVersions {\n // Get new channel versions\n if (Object.keys(previousVersions).length > 0) {\n const nullVersion = getNullChannelVersion(currentVersions);\n return Object.fromEntries(\n Object.entries(currentVersions).filter(\n ([k, v]) => v > (previousVersions[k] ?? nullVersion)\n )\n );\n } else {\n return currentVersions;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function _coerceToDict(value: any, defaultKey: string) {\n return value &&\n !Array.isArray(value) &&\n // eslint-disable-next-line no-instanceof/no-instanceof\n !(value instanceof Date) &&\n typeof value === \"object\"\n ? value\n : { [defaultKey]: value };\n}\n\nexport type RetryPolicy = {\n /**\n * Amount of time that must elapse before the first retry occurs in milliseconds.\n * @default 500\n */\n initialInterval?: number;\n\n /**\n * Multiplier by which the interval increases after each retry.\n * @default 2\n */\n backoffFactor?: number;\n\n /**\n * Maximum amount of time that may elapse between retries in milliseconds.\n * @default 128000\n */\n maxInterval?: number;\n\n /**\n * Maximum amount of time that may elapse between retries.\n * @default 3\n */\n maxAttempts?: number;\n\n /** Whether to add random jitter to the interval between retries. */\n jitter?: boolean;\n\n /** A function that returns True for exceptions that should trigger a retry. */\n retryOn?: (e: any) => boolean; // eslint-disable-line @typescript-eslint/no-explicit-any\n\n /** Whether to log a warning when a retry is attempted. Defaults to true. */\n logWarning?: boolean;\n};\n\n/**\n * Configuration for caching nodes.\n */\nexport type CachePolicy = {\n /**\n * A function used to generate a cache key from node's input.\n * @returns A key for the cache.\n */\n keyFunc?: (args: unknown[]) => string;\n\n /**\n * The time to live for the cache in seconds.\n * If not defined, the entry will never expire.\n */\n ttl?: number;\n};\n\nexport function patchConfigurable(\n config: RunnableConfig | undefined,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n patch: Record<string, any>\n): RunnableConfig {\n if (config === null) {\n return { configurable: patch };\n } else if (config?.configurable === undefined) {\n return { ...config, configurable: patch };\n } else {\n return {\n ...config,\n configurable: { ...config.configurable, ...patch },\n };\n }\n}\n\nexport function patchCheckpointMap(\n config: RunnableConfig,\n metadata?: CheckpointMetadata\n): RunnableConfig {\n const parents = metadata?.parents ?? {};\n\n if (Object.keys(parents).length > 0) {\n return patchConfigurable(config, {\n [CONFIG_KEY_CHECKPOINT_MAP]: {\n ...parents,\n [config.configurable?.checkpoint_ns ?? \"\"]:\n config.configurable?.checkpoint_id,\n },\n });\n } else {\n return config;\n }\n}\n\n/**\n * Combine multiple abort signals into a single abort signal.\n *\n * On Node 20+ / modern runtimes, uses `AbortSignal.any()` which lets the\n * runtime manage listener lifecycle — no manual dispose needed. On older\n * runtimes, falls back to manual listener management and returns a `dispose`\n * function that callers MUST invoke when the combined signal is no longer\n * needed, to avoid leaking listeners on the source signals.\n *\n * @param signals - The abort signals to combine.\n * @returns A combined abort signal and an optional dispose function.\n */\nexport function combineAbortSignals(...x: (AbortSignal | undefined)[]): {\n signal: AbortSignal | undefined;\n dispose?: () => void;\n} {\n const signals = [...new Set(x.filter(Boolean))] as AbortSignal[];\n\n if (signals.length === 0) {\n return { signal: undefined, dispose: undefined };\n }\n\n if (signals.length === 1) {\n return { signal: signals[0], dispose: undefined };\n }\n\n // AbortSignal.any() (Node 20+) handles listener cleanup automatically —\n // the derived signal becomes GC-eligible when unreachable, even if source\n // signals are still alive. No dispose needed.\n if (typeof AbortSignal.any === \"function\") {\n return { signal: AbortSignal.any(signals), dispose: undefined };\n }\n\n // Fallback for Node 18: manual listener management.\n const combinedController = new AbortController();\n const listener = () => {\n const reason = signals.find((s) => s.aborted)?.reason;\n combinedController.abort(reason);\n signals.forEach((s) => s.removeEventListener(\"abort\", listener));\n };\n\n signals.forEach((s) => s.addEventListener(\"abort\", listener, { once: true }));\n\n const hasAlreadyAbortedSignal = signals.find((s) => s.aborted);\n if (hasAlreadyAbortedSignal) {\n combinedController.abort(hasAlreadyAbortedSignal.reason);\n }\n\n return {\n signal: combinedController.signal,\n dispose: () => {\n signals.forEach((s) => s.removeEventListener(\"abort\", listener));\n },\n };\n}\n\n/**\n * Combine multiple callbacks into a single callback.\n * @param callback1 - The first callback to combine.\n * @param callback2 - The second callback to combine.\n * @returns A single callback that is a combination of the input callbacks.\n */\nexport const combineCallbacks = (\n callback1?: Callbacks,\n callback2?: Callbacks\n): Callbacks | undefined => {\n if (!callback1 && !callback2) {\n return undefined;\n }\n\n if (!callback1) {\n return callback2;\n }\n\n if (!callback2) {\n return callback1;\n }\n if (Array.isArray(callback1) && Array.isArray(callback2)) {\n return [...callback1, ...callback2];\n }\n if (Array.isArray(callback1)) {\n return [...callback1, callback2] as Callbacks;\n }\n if (Array.isArray(callback2)) {\n return [callback1, ...callback2];\n }\n return [callback1, callback2] as Callbacks;\n};\n"],"mappings":";;AAQA,SAAgB,sBAAsB,iBAAkC;CAGtE,MAAM,eAAe,OAAO,gBAAgBA,kBAAAA;AAC5C,KAAI,iBAAiB,SAAU,QAAO;AACtC,KAAI,iBAAiB,SAAU,QAAO;AAGtC,MAAK,MAAM,OAAO,iBAAiB;AACjC,MAAI,CAAC,OAAO,UAAU,eAAe,KAAK,iBAAiB,IAAI,CAAE;EACjE,MAAM,cAAc,OAAO,gBAAgB;AAC3C,MAAI,gBAAgB,SAAU,QAAO;AACrC,MAAI,gBAAgB,SAAU,QAAO;AACrC;;;AAMJ,SAAgB,sBACd,kBACA,iBACiB;AAEjB,KAAI,OAAO,KAAK,iBAAiB,CAAC,SAAS,GAAG;EAC5C,MAAM,cAAc,sBAAsB,gBAAgB;AAC1D,SAAO,OAAO,YACZ,OAAO,QAAQ,gBAAgB,CAAC,QAC7B,CAAC,GAAG,OAAO,KAAK,iBAAiB,MAAM,aACzC,CACF;OAED,QAAO;;AAKX,SAAgB,cAAc,OAAY,YAAoB;AAC5D,QAAO,SACL,CAAC,MAAM,QAAQ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E,MAAM,0BAA0B,QAAQ,MAAM,MAAM,EAAE,QAAQ;AAC9D,KAAI,wBACF,oBAAmB,MAAM,wBAAwB,OAAO;AAG1D,QAAO;EACL,QAAQ,mBAAmB;EAC3B,eAAe;AACb,WAAQ,SAAS,MAAM,EAAE,oBAAoB,SAAS,SAAS,CAAC;;EAEnE;;;;;;;;AASH,MAAa,oBACX,WACA,cAC0B;AAC1B,KAAI,CAAC,aAAa,CAAC,UACjB;AAGF,KAAI,CAAC,UACH,QAAO;AAGT,KAAI,CAAC,UACH,QAAO;AAET,KAAI,MAAM,QAAQ,UAAU,IAAI,MAAM,QAAQ,UAAU,CACtD,QAAO,CAAC,GAAG,WAAW,GAAG,UAAU;AAErC,KAAI,MAAM,QAAQ,UAAU,CAC1B,QAAO,CAAC,GAAG,WAAW,UAAU;AAElC,KAAI,MAAM,QAAQ,UAAU,CAC1B,QAAO,CAAC,WAAW,GAAG,UAAU;AAElC,QAAO,CAAC,WAAW,UAAU"}
1
+ {"version":3,"file":"index.cjs","names":["START","CONFIG_KEY_CHECKPOINT_MAP"],"sources":["../../../src/pregel/utils/index.ts"],"sourcesContent":["import { Callbacks } from \"@langchain/core/callbacks/manager\";\nimport { RunnableConfig } from \"@langchain/core/runnables\";\nimport type {\n ChannelVersions,\n CheckpointMetadata,\n} from \"@langchain/langgraph-checkpoint\";\nimport { CONFIG_KEY_CHECKPOINT_MAP, START } from \"../../constants.js\";\n\nexport function getNullChannelVersion(currentVersions: ChannelVersions) {\n // Short circuit for commonly used channels such as __start__\n // (used by StateGraph)\n const startVersion = typeof currentVersions[START];\n if (startVersion === \"number\") return 0;\n if (startVersion === \"string\") return \"\";\n\n // Defer back to obtaining a first key from channel versions\n for (const key in currentVersions) {\n if (!Object.prototype.hasOwnProperty.call(currentVersions, key)) continue;\n const versionType = typeof currentVersions[key];\n if (versionType === \"number\") return 0;\n if (versionType === \"string\") return \"\";\n break;\n }\n\n return undefined;\n}\n\nexport function getNewChannelVersions(\n previousVersions: ChannelVersions,\n currentVersions: ChannelVersions\n): ChannelVersions {\n // Get new channel versions\n if (Object.keys(previousVersions).length > 0) {\n const nullVersion = getNullChannelVersion(currentVersions);\n return Object.fromEntries(\n Object.entries(currentVersions).filter(\n ([k, v]) => v > (previousVersions[k] ?? nullVersion)\n )\n );\n } else {\n return currentVersions;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function _coerceToDict(value: any, defaultKey: string) {\n return value &&\n !Array.isArray(value) &&\n // eslint-disable-next-line no-instanceof/no-instanceof\n !(value instanceof Date) &&\n typeof value === \"object\"\n ? value\n : { [defaultKey]: value };\n}\n\nexport type RetryPolicy = {\n /**\n * Amount of time that must elapse before the first retry occurs in milliseconds.\n * @default 500\n */\n initialInterval?: number;\n\n /**\n * Multiplier by which the interval increases after each retry.\n * @default 2\n */\n backoffFactor?: number;\n\n /**\n * Maximum amount of time that may elapse between retries in milliseconds.\n * @default 128000\n */\n maxInterval?: number;\n\n /**\n * Maximum amount of time that may elapse between retries.\n * @default 3\n */\n maxAttempts?: number;\n\n /** Whether to add random jitter to the interval between retries. */\n jitter?: boolean;\n\n /** A function that returns True for exceptions that should trigger a retry. */\n retryOn?: (e: any) => boolean; // eslint-disable-line @typescript-eslint/no-explicit-any\n\n /** Whether to log a warning when a retry is attempted. Defaults to true. */\n logWarning?: boolean;\n};\n\n/**\n * Configuration for caching nodes.\n */\nexport type CachePolicy = {\n /**\n * A function used to generate a cache key from node's input.\n * @returns A key for the cache.\n */\n keyFunc?: (args: unknown[]) => string;\n\n /**\n * The time to live for the cache in seconds.\n * If not defined, the entry will never expire.\n */\n ttl?: number;\n};\n\nexport function patchConfigurable(\n config: RunnableConfig | undefined,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n patch: Record<string, any>\n): RunnableConfig {\n if (config === null) {\n return { configurable: patch };\n } else if (config?.configurable === undefined) {\n return { ...config, configurable: patch };\n } else {\n return {\n ...config,\n configurable: { ...config.configurable, ...patch },\n };\n }\n}\n\nexport function patchCheckpointMap(\n config: RunnableConfig,\n metadata?: CheckpointMetadata\n): RunnableConfig {\n const parents = metadata?.parents ?? {};\n\n if (Object.keys(parents).length > 0) {\n return patchConfigurable(config, {\n [CONFIG_KEY_CHECKPOINT_MAP]: {\n ...parents,\n [config.configurable?.checkpoint_ns ?? \"\"]:\n config.configurable?.checkpoint_id,\n },\n });\n } else {\n return config;\n }\n}\n\n/**\n * Combine multiple abort signals into a single abort signal.\n * @param signals - The abort signals to combine.\n * @returns A combined abort signal and a dispose function to remove the abort listener if unused.\n */\nexport function combineAbortSignals(...x: (AbortSignal | undefined)[]): {\n signal: AbortSignal | undefined;\n dispose?: () => void;\n} {\n const signals = [...new Set(x.filter(Boolean))] as AbortSignal[];\n\n if (signals.length === 0) {\n return { signal: undefined, dispose: undefined };\n }\n\n if (signals.length === 1) {\n return { signal: signals[0], dispose: undefined };\n }\n\n const combinedController = new AbortController();\n const listener = () => {\n const reason = signals.find((s) => s.aborted)?.reason;\n combinedController.abort(reason);\n signals.forEach((s) => s.removeEventListener(\"abort\", listener));\n };\n\n signals.forEach((s) => s.addEventListener(\"abort\", listener, { once: true }));\n\n const hasAlreadyAbortedSignal = signals.find((s) => s.aborted);\n if (hasAlreadyAbortedSignal) {\n combinedController.abort(hasAlreadyAbortedSignal.reason);\n }\n\n return {\n signal: combinedController.signal,\n dispose: () => {\n signals.forEach((s) => s.removeEventListener(\"abort\", listener));\n },\n };\n}\n\n/**\n * Combine multiple callbacks into a single callback.\n * @param callback1 - The first callback to combine.\n * @param callback2 - The second callback to combine.\n * @returns A single callback that is a combination of the input callbacks.\n */\nexport const combineCallbacks = (\n callback1?: Callbacks,\n callback2?: Callbacks\n): Callbacks | undefined => {\n if (!callback1 && !callback2) {\n return undefined;\n }\n\n if (!callback1) {\n return callback2;\n }\n\n if (!callback2) {\n return callback1;\n }\n if (Array.isArray(callback1) && Array.isArray(callback2)) {\n return [...callback1, ...callback2];\n }\n if (Array.isArray(callback1)) {\n return [...callback1, callback2] as Callbacks;\n }\n if (Array.isArray(callback2)) {\n return [callback1, ...callback2];\n }\n return [callback1, callback2] as Callbacks;\n};\n"],"mappings":";;AAQA,SAAgB,sBAAsB,iBAAkC;CAGtE,MAAM,eAAe,OAAO,gBAAgBA,kBAAAA;AAC5C,KAAI,iBAAiB,SAAU,QAAO;AACtC,KAAI,iBAAiB,SAAU,QAAO;AAGtC,MAAK,MAAM,OAAO,iBAAiB;AACjC,MAAI,CAAC,OAAO,UAAU,eAAe,KAAK,iBAAiB,IAAI,CAAE;EACjE,MAAM,cAAc,OAAO,gBAAgB;AAC3C,MAAI,gBAAgB,SAAU,QAAO;AACrC,MAAI,gBAAgB,SAAU,QAAO;AACrC;;;AAMJ,SAAgB,sBACd,kBACA,iBACiB;AAEjB,KAAI,OAAO,KAAK,iBAAiB,CAAC,SAAS,GAAG;EAC5C,MAAM,cAAc,sBAAsB,gBAAgB;AAC1D,SAAO,OAAO,YACZ,OAAO,QAAQ,gBAAgB,CAAC,QAC7B,CAAC,GAAG,OAAO,KAAK,iBAAiB,MAAM,aACzC,CACF;OAED,QAAO;;AAKX,SAAgB,cAAc,OAAY,YAAoB;AAC5D,QAAO,SACL,CAAC,MAAM,QAAQ,MAAM,IAErB,EAAE,iBAAiB,SACnB,OAAO,UAAU,WACf,QACA,GAAG,aAAa,OAAO;;AAuD7B,SAAgB,kBACd,QAEA,OACgB;AAChB,KAAI,WAAW,KACb,QAAO,EAAE,cAAc,OAAO;UACrB,QAAQ,iBAAiB,KAAA,EAClC,QAAO;EAAE,GAAG;EAAQ,cAAc;EAAO;KAEzC,QAAO;EACL,GAAG;EACH,cAAc;GAAE,GAAG,OAAO;GAAc,GAAG;GAAO;EACnD;;AAIL,SAAgB,mBACd,QACA,UACgB;CAChB,MAAM,UAAU,UAAU,WAAW,EAAE;AAEvC,KAAI,OAAO,KAAK,QAAQ,CAAC,SAAS,EAChC,QAAO,kBAAkB,QAAQ,GAC9BC,kBAAAA,4BAA4B;EAC3B,GA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AC,WAAW,UAAU"}
@@ -45,15 +45,8 @@ function patchCheckpointMap(config, metadata) {
45
45
  }
46
46
  /**
47
47
  * Combine multiple abort signals into a single abort signal.
48
- *
49
- * On Node 20+ / modern runtimes, uses `AbortSignal.any()` which lets the
50
- * runtime manage listener lifecycle — no manual dispose needed. On older
51
- * runtimes, falls back to manual listener management and returns a `dispose`
52
- * function that callers MUST invoke when the combined signal is no longer
53
- * needed, to avoid leaking listeners on the source signals.
54
- *
55
48
  * @param signals - The abort signals to combine.
56
- * @returns A combined abort signal and an optional dispose function.
49
+ * @returns A combined abort signal and a dispose function to remove the abort listener if unused.
57
50
  */
58
51
  function combineAbortSignals(...x) {
59
52
  const signals = [...new Set(x.filter(Boolean))];
@@ -65,10 +58,6 @@ function combineAbortSignals(...x) {
65
58
  signal: signals[0],
66
59
  dispose: void 0
67
60
  };
68
- if (typeof AbortSignal.any === "function") return {
69
- signal: AbortSignal.any(signals),
70
- dispose: void 0
71
- };
72
61
  const combinedController = new AbortController();
73
62
  const listener = () => {
74
63
  const reason = signals.find((s) => s.aborted)?.reason;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/pregel/utils/index.ts"],"sourcesContent":["import { Callbacks } from \"@langchain/core/callbacks/manager\";\nimport { RunnableConfig } from \"@langchain/core/runnables\";\nimport type {\n ChannelVersions,\n CheckpointMetadata,\n} from \"@langchain/langgraph-checkpoint\";\nimport { CONFIG_KEY_CHECKPOINT_MAP, START } from \"../../constants.js\";\n\nexport function getNullChannelVersion(currentVersions: ChannelVersions) {\n // Short circuit for commonly used channels such as __start__\n // (used by StateGraph)\n const startVersion = typeof currentVersions[START];\n if (startVersion === \"number\") return 0;\n if (startVersion === \"string\") return \"\";\n\n // Defer back to obtaining a first key from channel versions\n for (const key in currentVersions) {\n if (!Object.prototype.hasOwnProperty.call(currentVersions, key)) continue;\n const versionType = typeof currentVersions[key];\n if (versionType === \"number\") return 0;\n if (versionType === \"string\") return \"\";\n break;\n }\n\n return undefined;\n}\n\nexport function getNewChannelVersions(\n previousVersions: ChannelVersions,\n currentVersions: ChannelVersions\n): ChannelVersions {\n // Get new channel versions\n if (Object.keys(previousVersions).length > 0) {\n const nullVersion = getNullChannelVersion(currentVersions);\n return Object.fromEntries(\n Object.entries(currentVersions).filter(\n ([k, v]) => v > (previousVersions[k] ?? nullVersion)\n )\n );\n } else {\n return currentVersions;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function _coerceToDict(value: any, defaultKey: string) {\n return value &&\n !Array.isArray(value) &&\n // eslint-disable-next-line no-instanceof/no-instanceof\n !(value instanceof Date) &&\n typeof value === \"object\"\n ? value\n : { [defaultKey]: value };\n}\n\nexport type RetryPolicy = {\n /**\n * Amount of time that must elapse before the first retry occurs in milliseconds.\n * @default 500\n */\n initialInterval?: number;\n\n /**\n * Multiplier by which the interval increases after each retry.\n * @default 2\n */\n backoffFactor?: number;\n\n /**\n * Maximum amount of time that may elapse between retries in milliseconds.\n * @default 128000\n */\n maxInterval?: number;\n\n /**\n * Maximum amount of time that may elapse between retries.\n * @default 3\n */\n maxAttempts?: number;\n\n /** Whether to add random jitter to the interval between retries. */\n jitter?: boolean;\n\n /** A function that returns True for exceptions that should trigger a retry. */\n retryOn?: (e: any) => boolean; // eslint-disable-line @typescript-eslint/no-explicit-any\n\n /** Whether to log a warning when a retry is attempted. Defaults to true. */\n logWarning?: boolean;\n};\n\n/**\n * Configuration for caching nodes.\n */\nexport type CachePolicy = {\n /**\n * A function used to generate a cache key from node's input.\n * @returns A key for the cache.\n */\n keyFunc?: (args: unknown[]) => string;\n\n /**\n * The time to live for the cache in seconds.\n * If not defined, the entry will never expire.\n */\n ttl?: number;\n};\n\nexport function patchConfigurable(\n config: RunnableConfig | undefined,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n patch: Record<string, any>\n): RunnableConfig {\n if (config === null) {\n return { configurable: patch };\n } else if (config?.configurable === undefined) {\n return { ...config, configurable: patch };\n } else {\n return {\n ...config,\n configurable: { ...config.configurable, ...patch },\n };\n }\n}\n\nexport function patchCheckpointMap(\n config: RunnableConfig,\n metadata?: CheckpointMetadata\n): RunnableConfig {\n const parents = metadata?.parents ?? {};\n\n if (Object.keys(parents).length > 0) {\n return patchConfigurable(config, {\n [CONFIG_KEY_CHECKPOINT_MAP]: {\n ...parents,\n [config.configurable?.checkpoint_ns ?? \"\"]:\n config.configurable?.checkpoint_id,\n },\n });\n } else {\n return config;\n }\n}\n\n/**\n * Combine multiple abort signals into a single abort signal.\n *\n * On Node 20+ / modern runtimes, uses `AbortSignal.any()` which lets the\n * runtime manage listener lifecycle — no manual dispose needed. On older\n * runtimes, falls back to manual listener management and returns a `dispose`\n * function that callers MUST invoke when the combined signal is no longer\n * needed, to avoid leaking listeners on the source signals.\n *\n * @param signals - The abort signals to combine.\n * @returns A combined abort signal and an optional dispose function.\n */\nexport function combineAbortSignals(...x: (AbortSignal | undefined)[]): {\n signal: AbortSignal | undefined;\n dispose?: () => void;\n} {\n const signals = [...new Set(x.filter(Boolean))] as AbortSignal[];\n\n if (signals.length === 0) {\n return { signal: undefined, dispose: undefined };\n }\n\n if (signals.length === 1) {\n return { signal: signals[0], dispose: undefined };\n }\n\n // AbortSignal.any() (Node 20+) handles listener cleanup automatically —\n // the derived signal becomes GC-eligible when unreachable, even if source\n // signals are still alive. No dispose needed.\n if (typeof AbortSignal.any === \"function\") {\n return { signal: AbortSignal.any(signals), dispose: undefined };\n }\n\n // Fallback for Node 18: manual listener management.\n const combinedController = new AbortController();\n const listener = () => {\n const reason = signals.find((s) => s.aborted)?.reason;\n combinedController.abort(reason);\n signals.forEach((s) => s.removeEventListener(\"abort\", listener));\n };\n\n signals.forEach((s) => s.addEventListener(\"abort\", listener, { once: true }));\n\n const hasAlreadyAbortedSignal = signals.find((s) => s.aborted);\n if (hasAlreadyAbortedSignal) {\n combinedController.abort(hasAlreadyAbortedSignal.reason);\n }\n\n return {\n signal: combinedController.signal,\n dispose: () => {\n signals.forEach((s) => s.removeEventListener(\"abort\", listener));\n },\n };\n}\n\n/**\n * Combine multiple callbacks into a single callback.\n * @param callback1 - The first callback to combine.\n * @param callback2 - The second callback to combine.\n * @returns A single callback that is a combination of the input callbacks.\n */\nexport const combineCallbacks = (\n callback1?: Callbacks,\n callback2?: Callbacks\n): Callbacks | undefined => {\n if (!callback1 && !callback2) {\n return undefined;\n }\n\n if (!callback1) {\n return callback2;\n }\n\n if (!callback2) {\n return callback1;\n }\n if (Array.isArray(callback1) && Array.isArray(callback2)) {\n return [...callback1, ...callback2];\n }\n if (Array.isArray(callback1)) {\n return [...callback1, callback2] as Callbacks;\n }\n if (Array.isArray(callback2)) {\n return [callback1, ...callback2];\n }\n return [callback1, callback2] as Callbacks;\n};\n"],"mappings":";;AAQA,SAAgB,sBAAsB,iBAAkC;CAGtE,MAAM,eAAe,OAAO,gBAAgB;AAC5C,KAAI,iBAAiB,SAAU,QAAO;AACtC,KAAI,iBAAiB,SAAU,QAAO;AAGtC,MAAK,MAAM,OAAO,iBAAiB;AACjC,MAAI,CAAC,OAAO,UAAU,eAAe,KAAK,iBAAiB,IAAI,CAAE;EACjE,MAAM,cAAc,OAAO,gBAAgB;AAC3C,MAAI,gBAAgB,SAAU,QAAO;AACrC,MAAI,gBAAgB,SAAU,QAAO;AACrC;;;AAMJ,SAAgB,sBACd,kBACA,iBACiB;AAEjB,KAAI,OAAO,KAAK,iBAAiB,CAAC,SAAS,GAAG;EAC5C,MAAM,cAAc,sBAAsB,gBAAgB;AAC1D,SAAO,OAAO,YACZ,OAAO,QAAQ,gBAAgB,CAAC,QAC7B,CAAC,GAAG,OAAO,KAAK,iBAAiB,MAAM,aACzC,CACF;OAED,QAAO;;AAKX,SAAgB,cAAc,OAAY,YAAoB;AAC5D,QAAO,SACL,CAAC,MAAM,QAAQ,MAAM,IAErB,EAAE,iBAAiB,SACnB,OAAO,UAAU,WACf,QACA,GAAG,aAAa,OAAO;;AAuD7B,SAAgB,kBACd,QAEA,OACgB;A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Q,mBAAmB;EAC3B,eAAe;AACb,WAAQ,SAAS,MAAM,EAAE,oBAAoB,SAAS,SAAS,CAAC;;EAEnE;;;;;;;;AASH,MAAa,oBACX,WACA,cAC0B;AAC1B,KAAI,CAAC,aAAa,CAAC,UACjB;AAGF,KAAI,CAAC,UACH,QAAO;AAGT,KAAI,CAAC,UACH,QAAO;AAET,KAAI,MAAM,QAAQ,UAAU,IAAI,MAAM,QAAQ,UAAU,CACtD,QAAO,CAAC,GAAG,WAAW,GAAG,UAAU;AAErC,KAAI,MAAM,QAAQ,UAAU,CAC1B,QAAO,CAAC,GAAG,WAAW,UAAU;AAElC,KAAI,MAAM,QAAQ,UAAU,CAC1B,QAAO,CAAC,WAAW,GAAG,UAAU;AAElC,QAAO,CAAC,WAAW,UAAU"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/pregel/utils/index.ts"],"sourcesContent":["import { Callbacks } from \"@langchain/core/callbacks/manager\";\nimport { RunnableConfig } from \"@langchain/core/runnables\";\nimport type {\n ChannelVersions,\n CheckpointMetadata,\n} from \"@langchain/langgraph-checkpoint\";\nimport { CONFIG_KEY_CHECKPOINT_MAP, START } from \"../../constants.js\";\n\nexport function getNullChannelVersion(currentVersions: ChannelVersions) {\n // Short circuit for commonly used channels such as __start__\n // (used by StateGraph)\n const startVersion = typeof currentVersions[START];\n if (startVersion === \"number\") return 0;\n if (startVersion === \"string\") return \"\";\n\n // Defer back to obtaining a first key from channel versions\n for (const key in currentVersions) {\n if (!Object.prototype.hasOwnProperty.call(currentVersions, key)) continue;\n const versionType = typeof currentVersions[key];\n if (versionType === \"number\") return 0;\n if (versionType === \"string\") return \"\";\n break;\n }\n\n return undefined;\n}\n\nexport function getNewChannelVersions(\n previousVersions: ChannelVersions,\n currentVersions: ChannelVersions\n): ChannelVersions {\n // Get new channel versions\n if (Object.keys(previousVersions).length > 0) {\n const nullVersion = getNullChannelVersion(currentVersions);\n return Object.fromEntries(\n Object.entries(currentVersions).filter(\n ([k, v]) => v > (previousVersions[k] ?? nullVersion)\n )\n );\n } else {\n return currentVersions;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function _coerceToDict(value: any, defaultKey: string) {\n return value &&\n !Array.isArray(value) &&\n // eslint-disable-next-line no-instanceof/no-instanceof\n !(value instanceof Date) &&\n typeof value === \"object\"\n ? value\n : { [defaultKey]: value };\n}\n\nexport type RetryPolicy = {\n /**\n * Amount of time that must elapse before the first retry occurs in milliseconds.\n * @default 500\n */\n initialInterval?: number;\n\n /**\n * Multiplier by which the interval increases after each retry.\n * @default 2\n */\n backoffFactor?: number;\n\n /**\n * Maximum amount of time that may elapse between retries in milliseconds.\n * @default 128000\n */\n maxInterval?: number;\n\n /**\n * Maximum amount of time that may elapse between retries.\n * @default 3\n */\n maxAttempts?: number;\n\n /** Whether to add random jitter to the interval between retries. */\n jitter?: boolean;\n\n /** A function that returns True for exceptions that should trigger a retry. */\n retryOn?: (e: any) => boolean; // eslint-disable-line @typescript-eslint/no-explicit-any\n\n /** Whether to log a warning when a retry is attempted. Defaults to true. */\n logWarning?: boolean;\n};\n\n/**\n * Configuration for caching nodes.\n */\nexport type CachePolicy = {\n /**\n * A function used to generate a cache key from node's input.\n * @returns A key for the cache.\n */\n keyFunc?: (args: unknown[]) => string;\n\n /**\n * The time to live for the cache in seconds.\n * If not defined, the entry will never expire.\n */\n ttl?: number;\n};\n\nexport function patchConfigurable(\n config: RunnableConfig | undefined,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n patch: Record<string, any>\n): RunnableConfig {\n if (config === null) {\n return { configurable: patch };\n } else if (config?.configurable === undefined) {\n return { ...config, configurable: patch };\n } else {\n return {\n ...config,\n configurable: { ...config.configurable, ...patch },\n };\n }\n}\n\nexport function patchCheckpointMap(\n config: RunnableConfig,\n metadata?: CheckpointMetadata\n): RunnableConfig {\n const parents = metadata?.parents ?? {};\n\n if (Object.keys(parents).length > 0) {\n return patchConfigurable(config, {\n [CONFIG_KEY_CHECKPOINT_MAP]: {\n ...parents,\n [config.configurable?.checkpoint_ns ?? \"\"]:\n config.configurable?.checkpoint_id,\n },\n });\n } else {\n return config;\n }\n}\n\n/**\n * Combine multiple abort signals into a single abort signal.\n * @param signals - The abort signals to combine.\n * @returns A combined abort signal and a dispose function to remove the abort listener if unused.\n */\nexport function combineAbortSignals(...x: (AbortSignal | undefined)[]): {\n signal: AbortSignal | undefined;\n dispose?: () => void;\n} {\n const signals = [...new Set(x.filter(Boolean))] as AbortSignal[];\n\n if (signals.length === 0) {\n return { signal: undefined, dispose: undefined };\n }\n\n if (signals.length === 1) {\n return { signal: signals[0], dispose: undefined };\n }\n\n const combinedController = new AbortController();\n const listener = () => {\n const reason = signals.find((s) => s.aborted)?.reason;\n combinedController.abort(reason);\n signals.forEach((s) => s.removeEventListener(\"abort\", listener));\n };\n\n signals.forEach((s) => s.addEventListener(\"abort\", listener, { once: true }));\n\n const hasAlreadyAbortedSignal = signals.find((s) => s.aborted);\n if (hasAlreadyAbortedSignal) {\n combinedController.abort(hasAlreadyAbortedSignal.reason);\n }\n\n return {\n signal: combinedController.signal,\n dispose: () => {\n signals.forEach((s) => s.removeEventListener(\"abort\", listener));\n },\n };\n}\n\n/**\n * Combine multiple callbacks into a single callback.\n * @param callback1 - The first callback to combine.\n * @param callback2 - The second callback to combine.\n * @returns A single callback that is a combination of the input callbacks.\n */\nexport const combineCallbacks = (\n callback1?: Callbacks,\n callback2?: Callbacks\n): Callbacks | undefined => {\n if (!callback1 && !callback2) {\n return undefined;\n }\n\n if (!callback1) {\n return callback2;\n }\n\n if (!callback2) {\n return callback1;\n }\n if (Array.isArray(callback1) && Array.isArray(callback2)) {\n return [...callback1, ...callback2];\n }\n if (Array.isArray(callback1)) {\n return [...callback1, callback2] as Callbacks;\n }\n if (Array.isArray(callback2)) {\n return [callback1, ...callback2];\n }\n return [callback1, callback2] as Callbacks;\n};\n"],"mappings":";;AAQA,SAAgB,sBAAsB,iBAAkC;CAGtE,MAAM,eAAe,OA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AAQ,CAAC,CAAC;AAE/C,KAAI,QAAQ,WAAW,EACrB,QAAO;EAAE,QAAQ,KAAA;EAAW,SAAS,KAAA;EAAW;AAGlD,KAAI,QAAQ,WAAW,EACrB,QAAO;EAAE,QAAQ,QAAQ;EAAI,SAAS,KAAA;EAAW;CAGnD,MAAM,qBAAqB,IAAI,iBAAiB;CAChD,MAAM,iBAAiB;EACrB,MAAM,SAAS,QAAQ,MAAM,MAAM,EAAE,QAAQ,EAAE;AAC/C,qBAAmB,MAAM,OAAO;AAChC,UAAQ,SAAS,MAAM,EAAE,oBAAoB,SAAS,SAAS,CAAC;;AAGlE,SAAQ,SAAS,MAAM,EAAE,iBAAiB,SAAS,UAAU,EAAE,MAAM,MAAM,CAAC,CAAC;CAE7E,MAAM,0BAA0B,QAAQ,MAAM,MAAM,EAAE,QAAQ;AAC9D,KAAI,wBACF,oBAAmB,MAAM,wBAAwB,OAAO;AAG1D,QAAO;EACL,QAAQ,mBAAmB;EAC3B,eAAe;AACb,WAAQ,SAAS,MAAM,EAAE,oBAAoB,SAAS,SAAS,CAAC;;EAEnE;;;;;;;;AASH,MAAa,oBACX,WACA,cAC0B;AAC1B,KAAI,CAAC,aAAa,CAAC,UACjB;AAGF,KAAI,CAAC,UACH,QAAO;AAGT,KAAI,CAAC,UACH,QAAO;AAET,KAAI,MAAM,QAAQ,UAAU,IAAI,MAAM,QAAQ,UAAU,CACtD,QAAO,CAAC,GAAG,WAAW,GAAG,UAAU;AAErC,KAAI,MAAM,QAAQ,UAAU,CAC1B,QAAO,CAAC,GAAG,WAAW,UAAU;AAElC,KAAI,MAAM,QAAQ,UAAU,CAC1B,QAAO,CAAC,WAAW,GAAG,UAAU;AAElC,QAAO,CAAC,WAAW,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"validate.cjs","names":["INTERRUPT","PregelNode"],"sources":["../../src/pregel/validate.ts"],"sourcesContent":["import { All } from \"@langchain/langgraph-checkpoint\";\nimport { BaseChannel } from \"../channels/index.js\";\nimport { INTERRUPT } from \"../constants.js\";\nimport { PregelNode } from \"./read.js\";\n\nexport class GraphValidationError extends Error {\n constructor(message?: string) {\n super(message);\n this.name = \"GraphValidationError\";\n }\n}\n\nexport function validateGraph<\n Nn extends Record<string, PregelNode>,\n Cc extends Record<string, BaseChannel>\n>({\n nodes,\n channels,\n inputChannels,\n outputChannels,\n streamChannels,\n interruptAfterNodes,\n interruptBeforeNodes,\n}: {\n nodes: Nn;\n channels: Cc;\n inputChannels: keyof Cc | Array<keyof Cc>;\n outputChannels: keyof Cc | Array<keyof Cc>;\n streamChannels?: keyof Cc | Array<keyof Cc>;\n interruptAfterNodes?: Array<keyof Nn> | All;\n interruptBeforeNodes?: Array<keyof Nn> | All;\n}): void {\n if (!channels) {\n throw new GraphValidationError(\"Channels not provided\");\n }\n\n const subscribedChannels = new Set<keyof Cc>();\n const allOutputChannels = new Set<keyof Cc>();\n\n for (const [name, node] of Object.entries(nodes)) {\n if (name === INTERRUPT) {\n throw new GraphValidationError(`\"Node name ${INTERRUPT} is reserved\"`);\n }\n if (node.constructor === PregelNode) {\n node.triggers.forEach((trigger) => subscribedChannels.add(trigger));\n } else {\n throw new GraphValidationError(\n `Invalid node type ${typeof node}, expected PregelNode`\n );\n }\n }\n\n // side effect: update channels\n for (const chan of subscribedChannels) {\n if (!(chan in channels)) {\n throw new GraphValidationError(\n `Subscribed channel '${String(chan)}' not in channels`\n );\n }\n }\n\n if (!Array.isArray(inputChannels)) {\n if (!subscribedChannels.has(inputChannels)) {\n throw new GraphValidationError(\n `Input channel ${String(\n inputChannels\n )} is not subscribed to by any node`\n );\n }\n } else {\n if (inputChannels.every((channel) => !subscribedChannels.has(channel))) {\n throw new GraphValidationError(\n `None of the input channels ${inputChannels} are subscribed to by any node`\n );\n }\n }\n\n if (!Array.isArray(outputChannels)) {\n allOutputChannels.add(outputChannels);\n } else {\n outputChannels.forEach((chan) => allOutputChannels.add(chan));\n }\n\n if (streamChannels && !Array.isArray(streamChannels)) {\n allOutputChannels.add(streamChannels);\n } else if (Array.isArray(streamChannels)) {\n streamChannels.forEach((chan) => allOutputChannels.add(chan));\n }\n\n for (const chan of allOutputChannels) {\n if (!(chan in channels)) {\n throw new GraphValidationError(\n `Output channel '${String(chan)}' not in channels`\n );\n }\n }\n\n // validate interrupt before/after\n if (interruptAfterNodes && interruptAfterNodes !== \"*\") {\n for (const node of interruptAfterNodes) {\n if (!(node in nodes)) {\n throw new GraphValidationError(`Node ${String(node)} not in nodes`);\n }\n }\n }\n\n if (interruptBeforeNodes && interruptBeforeNodes !== \"*\") {\n for (const node of interruptBeforeNodes) {\n if (!(node in nodes)) {\n throw new GraphValidationError(`Node ${String(node)} not in nodes`);\n }\n }\n }\n}\n\nexport function validateKeys<Cc extends Record<string, BaseChannel>>(\n keys: keyof Cc | Array<keyof Cc>,\n channels: Cc\n): void {\n if (Array.isArray(keys)) {\n for (const key of keys) {\n if (!(key in channels)) {\n throw new Error(`Key ${String(key)} not found in channels`);\n }\n }\n } else {\n if (!(keys in channels)) {\n throw new Error(`Key ${String(keys)} not found in channels`);\n }\n }\n}\n"],"mappings":";;;AAKA,IAAa,uBAAb,cAA0C,MAAM;CAC9C,YAAY,SAAkB;AAC5B,QAAM,QAAQ;AACd,OAAK,OAAO;;;AAIhB,SAAgB,cAGd,EACA,OACA,UACA,eACA,gBACA,gBACA,qBACA,wBASO;AACP,KAAI,CAAC,SACH,OAAM,IAAI,qBAAqB,wBAAwB;CAGzD,MAAM,qCAAqB,IAAI,KAAe;CAC9C,MAAM,oCAAoB,IAAI,KAAe;AAE7C,MAAK,MAAM,CAAC,MAAM,SAAS,OAAO,QAAQ,MAAM,EAAE;AAChD,MAAI,SAAA,gBACF,OAAM,IAAI,qBAAqB,cAAcA,kBAAAA,UAAU,eAAe;AAExE,MAAI,KAAK,gBAAgBC,aAAAA,WACvB,MAAK,SAAS,SAAS,YAAY,mBAAmB,IAAI,QAAQ,CAAC;MAEnE,OAAM,IAAI,qBACR,qBAAqB,OAAO,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AwB"}
1
+ {"version":3,"file":"validate.cjs","names":["INTERRUPT","PregelNode"],"sources":["../../src/pregel/validate.ts"],"sourcesContent":["import { All } from \"@langchain/langgraph-checkpoint\";\nimport { BaseChannel } from \"../channels/index.js\";\nimport { INTERRUPT } from \"../constants.js\";\nimport { PregelNode } from \"./read.js\";\n\nexport class GraphValidationError extends Error {\n constructor(message?: string) {\n super(message);\n this.name = \"GraphValidationError\";\n }\n}\n\nexport function validateGraph<\n Nn extends Record<string, PregelNode>,\n Cc extends Record<string, BaseChannel>,\n>({\n nodes,\n channels,\n inputChannels,\n outputChannels,\n streamChannels,\n interruptAfterNodes,\n interruptBeforeNodes,\n}: {\n nodes: Nn;\n channels: Cc;\n inputChannels: keyof Cc | Array<keyof Cc>;\n outputChannels: keyof Cc | Array<keyof Cc>;\n streamChannels?: keyof Cc | Array<keyof Cc>;\n interruptAfterNodes?: Array<keyof Nn> | All;\n interruptBeforeNodes?: Array<keyof Nn> | All;\n}): void {\n if (!channels) {\n throw new GraphValidationError(\"Channels not provided\");\n }\n\n const subscribedChannels = new Set<keyof Cc>();\n const allOutputChannels = new Set<keyof Cc>();\n\n for (const [name, node] of Object.entries(nodes)) {\n if (name === INTERRUPT) {\n throw new GraphValidationError(`\"Node name ${INTERRUPT} is reserved\"`);\n }\n if (node.constructor === PregelNode) {\n node.triggers.forEach((trigger) => subscribedChannels.add(trigger));\n } else {\n throw new GraphValidationError(\n `Invalid node type ${typeof node}, expected PregelNode`\n );\n }\n }\n\n // side effect: update channels\n for (const chan of subscribedChannels) {\n if (!(chan in channels)) {\n throw new GraphValidationError(\n `Subscribed channel '${String(chan)}' not in channels`\n );\n }\n }\n\n if (!Array.isArray(inputChannels)) {\n if (!subscribedChannels.has(inputChannels)) {\n throw new GraphValidationError(\n `Input channel ${String(\n inputChannels\n )} is not subscribed to by any node`\n );\n }\n } else {\n if (inputChannels.every((channel) => !subscribedChannels.has(channel))) {\n throw new GraphValidationError(\n `None of the input channels ${inputChannels} are subscribed to by any node`\n );\n }\n }\n\n if (!Array.isArray(outputChannels)) {\n allOutputChannels.add(outputChannels);\n } else {\n outputChannels.forEach((chan) => allOutputChannels.add(chan));\n }\n\n if (streamChannels && !Array.isArray(streamChannels)) {\n allOutputChannels.add(streamChannels);\n } else if (Array.isArray(streamChannels)) {\n streamChannels.forEach((chan) => allOutputChannels.add(chan));\n }\n\n for (const chan of allOutputChannels) {\n if (!(chan in channels)) {\n throw new GraphValidationError(\n `Output channel '${String(chan)}' not in channels`\n );\n }\n }\n\n // validate interrupt before/after\n if (interruptAfterNodes && interruptAfterNodes !== \"*\") {\n for (const node of interruptAfterNodes) {\n if (!(node in nodes)) {\n throw new GraphValidationError(`Node ${String(node)} not in nodes`);\n }\n }\n }\n\n if (interruptBeforeNodes && interruptBeforeNodes !== \"*\") {\n for (const node of interruptBeforeNodes) {\n if (!(node in nodes)) {\n throw new GraphValidationError(`Node ${String(node)} not in nodes`);\n }\n }\n }\n}\n\nexport function validateKeys<Cc extends Record<string, BaseChannel>>(\n keys: keyof Cc | Array<keyof Cc>,\n channels: Cc\n): void {\n if (Array.isArray(keys)) {\n for (const key of keys) {\n if (!(key in channels)) {\n throw new Error(`Key ${String(key)} not found in channels`);\n }\n }\n } else {\n if (!(keys in channels)) {\n throw new Error(`Key ${String(keys)} not found in channels`);\n }\n }\n}\n"],"mappings":";;;AAKA,IAAa,uBAAb,cAA0C,MAAM;CAC9C,YAAY,SAAkB;AAC5B,QAAM,QAAQ;AACd,OAAK,OAAO;;;AAIhB,SAAgB,cAGd,EACA,OACA,UACA,eACA,gBACA,gBACA,qBACA,wBASO;AACP,KAAI,CAAC,SACH,OAAM,IAAI,qBAAqB,wBAAwB;CAGzD,MAAM,qCAAqB,IAAI,KAAe;CAC9C,MAAM,oCAAoB,IAAI,KAAe;AAE7C,MAAK,MAAM,CAAC,MAAM,SAAS,OAAO,QAAQ,MAAM,EAAE;AAChD,MAAI,SAAA,gBACF,OAAM,IAAI,qBAAqB,cAAcA,kBAA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B,KAAI,EAAE,OAAO,UACX,OAAM,IAAI,MAAM,OAAO,OAAO,IAAI,CAAC,wBAAwB;YAI3D,EAAE,QAAQ,UACZ,OAAM,IAAI,MAAM,OAAO,OAAO,KAAK,CAAC,wBAAwB"}
@@ -1 +1 @@
1
- {"version":3,"file":"validate.js","names":[],"sources":["../../src/pregel/validate.ts"],"sourcesContent":["import { All } from \"@langchain/langgraph-checkpoint\";\nimport { BaseChannel } from \"../channels/index.js\";\nimport { INTERRUPT } from \"../constants.js\";\nimport { PregelNode } from \"./read.js\";\n\nexport class GraphValidationError extends Error {\n constructor(message?: string) {\n super(message);\n this.name = \"GraphValidationError\";\n }\n}\n\nexport function validateGraph<\n Nn extends Record<string, PregelNode>,\n Cc extends Record<string, BaseChannel>\n>({\n nodes,\n channels,\n inputChannels,\n outputChannels,\n streamChannels,\n interruptAfterNodes,\n interruptBeforeNodes,\n}: {\n nodes: Nn;\n channels: Cc;\n inputChannels: keyof Cc | Array<keyof Cc>;\n outputChannels: keyof Cc | Array<keyof Cc>;\n streamChannels?: keyof Cc | Array<keyof Cc>;\n interruptAfterNodes?: Array<keyof Nn> | All;\n interruptBeforeNodes?: Array<keyof Nn> | All;\n}): void {\n if (!channels) {\n throw new GraphValidationError(\"Channels not provided\");\n }\n\n const subscribedChannels = new Set<keyof Cc>();\n const allOutputChannels = new Set<keyof Cc>();\n\n for (const [name, node] of Object.entries(nodes)) {\n if (name === INTERRUPT) {\n throw new GraphValidationError(`\"Node name ${INTERRUPT} is reserved\"`);\n }\n if (node.constructor === PregelNode) {\n node.triggers.forEach((trigger) => subscribedChannels.add(trigger));\n } else {\n throw new GraphValidationError(\n `Invalid node type ${typeof node}, expected PregelNode`\n );\n }\n }\n\n // side effect: update channels\n for (const chan of subscribedChannels) {\n if (!(chan in channels)) {\n throw new GraphValidationError(\n `Subscribed channel '${String(chan)}' not in channels`\n );\n }\n }\n\n if (!Array.isArray(inputChannels)) {\n if (!subscribedChannels.has(inputChannels)) {\n throw new GraphValidationError(\n `Input channel ${String(\n inputChannels\n )} is not subscribed to by any node`\n );\n }\n } else {\n if (inputChannels.every((channel) => !subscribedChannels.has(channel))) {\n throw new GraphValidationError(\n `None of the input channels ${inputChannels} are subscribed to by any node`\n );\n }\n }\n\n if (!Array.isArray(outputChannels)) {\n allOutputChannels.add(outputChannels);\n } else {\n outputChannels.forEach((chan) => allOutputChannels.add(chan));\n }\n\n if (streamChannels && !Array.isArray(streamChannels)) {\n allOutputChannels.add(streamChannels);\n } else if (Array.isArray(streamChannels)) {\n streamChannels.forEach((chan) => allOutputChannels.add(chan));\n }\n\n for (const chan of allOutputChannels) {\n if (!(chan in channels)) {\n throw new GraphValidationError(\n `Output channel '${String(chan)}' not in channels`\n );\n }\n }\n\n // validate interrupt before/after\n if (interruptAfterNodes && interruptAfterNodes !== \"*\") {\n for (const node of interruptAfterNodes) {\n if (!(node in nodes)) {\n throw new GraphValidationError(`Node ${String(node)} not in nodes`);\n }\n }\n }\n\n if (interruptBeforeNodes && interruptBeforeNodes !== \"*\") {\n for (const node of interruptBeforeNodes) {\n if (!(node in nodes)) {\n throw new GraphValidationError(`Node ${String(node)} not in nodes`);\n }\n }\n }\n}\n\nexport function validateKeys<Cc extends Record<string, BaseChannel>>(\n keys: keyof Cc | Array<keyof Cc>,\n channels: Cc\n): void {\n if (Array.isArray(keys)) {\n for (const key of keys) {\n if (!(key in channels)) {\n throw new Error(`Key ${String(key)} not found in channels`);\n }\n }\n } else {\n if (!(keys in channels)) {\n throw new Error(`Key ${String(keys)} not found in channels`);\n }\n }\n}\n"],"mappings":";;;AAKA,IAAa,uBAAb,cAA0C,MAAM;CAC9C,YAAY,SAAkB;AAC5B,QAAM,QAAQ;AACd,OAAK,OAAO;;;AAIhB,SAAgB,cAGd,EACA,OACA,UACA,eACA,gBACA,gBACA,qBACA,wBASO;AACP,KAAI,CAAC,SACH,OAAM,IAAI,qBAAqB,wBAAwB;CAGzD,MAAM,qCAAqB,IAAI,KAAe;CAC9C,MAAM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qBAAqB,QAAQ,OAAO,KAAK,CAAC,eAAe;;;AAM3E,SAAgB,aACd,MACA,UACM;AACN,KAAI,MAAM,QAAQ,KAAK;OAChB,MAAM,OAAO,KAChB,KAAI,EAAE,OAAO,UACX,OAAM,IAAI,MAAM,OAAO,OAAO,IAAI,CAAC,wBAAwB;YAI3D,EAAE,QAAQ,UACZ,OAAM,IAAI,MAAM,OAAO,OAAO,KAAK,CAAC,wBAAwB"}
1
+ {"version":3,"file":"validate.js","names":[],"sources":["../../src/pregel/validate.ts"],"sourcesContent":["import { All } from \"@langchain/langgraph-checkpoint\";\nimport { BaseChannel } from \"../channels/index.js\";\nimport { INTERRUPT } from \"../constants.js\";\nimport { PregelNode } from \"./read.js\";\n\nexport class GraphValidationError extends Error {\n constructor(message?: string) {\n super(message);\n this.name = \"GraphValidationError\";\n }\n}\n\nexport function validateGraph<\n Nn extends Record<string, PregelNode>,\n Cc extends Record<string, BaseChannel>,\n>({\n nodes,\n channels,\n inputChannels,\n outputChannels,\n streamChannels,\n interruptAfterNodes,\n interruptBeforeNodes,\n}: {\n nodes: Nn;\n channels: Cc;\n inputChannels: keyof Cc | Array<keyof Cc>;\n outputChannels: keyof Cc | Array<keyof Cc>;\n streamChannels?: keyof Cc | Array<keyof Cc>;\n interruptAfterNodes?: Array<keyof Nn> | All;\n interruptBeforeNodes?: Array<keyof Nn> | All;\n}): void {\n if (!channels) {\n throw new GraphValidationError(\"Channels not provided\");\n }\n\n const subscribedChannels = new Set<keyof Cc>();\n const allOutputChannels = new Set<keyof Cc>();\n\n for (const [name, node] of Object.entries(nodes)) {\n if (name === INTERRUPT) {\n throw new GraphValidationError(`\"Node name ${INTERRUPT} is reserved\"`);\n }\n if (node.constructor === PregelNode) {\n node.triggers.forEach((trigger) => subscribedChannels.add(trigger));\n } else {\n throw new GraphValidationError(\n `Invalid node type ${typeof node}, expected PregelNode`\n );\n }\n }\n\n // side effect: update channels\n for (const chan of subscribedChannels) {\n if (!(chan in channels)) {\n throw new GraphValidationError(\n `Subscribed channel '${String(chan)}' not in channels`\n );\n }\n }\n\n if (!Array.isArray(inputChannels)) {\n if (!subscribedChannels.has(inputChannels)) {\n throw new GraphValidationError(\n `Input channel ${String(\n inputChannels\n )} is not subscribed to by any node`\n );\n }\n } else {\n if (inputChannels.every((channel) => !subscribedChannels.has(channel))) {\n throw new GraphValidationError(\n `None of the input channels ${inputChannels} are subscribed to by any node`\n );\n }\n }\n\n if (!Array.isArray(outputChannels)) {\n allOutputChannels.add(outputChannels);\n } else {\n outputChannels.forEach((chan) => allOutputChannels.add(chan));\n }\n\n if (streamChannels && !Array.isArray(streamChannels)) {\n allOutputChannels.add(streamChannels);\n } else if (Array.isArray(streamChannels)) {\n streamChannels.forEach((chan) => allOutputChannels.add(chan));\n }\n\n for (const chan of allOutputChannels) {\n if (!(chan in channels)) {\n throw new GraphValidationError(\n `Output channel '${String(chan)}' not in channels`\n );\n }\n }\n\n // validate interrupt before/after\n if (interruptAfterNodes && interruptAfterNodes !== \"*\") {\n for (const node of interruptAfterNodes) {\n if (!(node in nodes)) {\n throw new GraphValidationError(`Node ${String(node)} not in nodes`);\n }\n }\n }\n\n if (interruptBeforeNodes && interruptBeforeNodes !== \"*\") {\n for (const node of interruptBeforeNodes) {\n if (!(node in nodes)) {\n throw new GraphValidationError(`Node ${String(node)} not in nodes`);\n }\n }\n }\n}\n\nexport function validateKeys<Cc extends Record<string, BaseChannel>>(\n keys: keyof Cc | Array<keyof Cc>,\n channels: Cc\n): void {\n if (Array.isArray(keys)) {\n for (const key of keys) {\n if (!(key in channels)) {\n throw new Error(`Key ${String(key)} not found in channels`);\n }\n }\n } else {\n if (!(keys in channels)) {\n throw new Error(`Key ${String(keys)} not found in channels`);\n }\n }\n}\n"],"mappings":";;;AAKA,IAAa,uBAAb,cAA0C,MAAM;CAC9C,YAAY,SAAkB;AAC5B,QAAM,QAAQ;AACd,OAAK,OAAO;;;AAIhB,SAAgB,cAGd,EACA,OACA,UACA,eACA,gBACA,gBAC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K,CAAC,eAAe;;AAKzE,KAAI,wBAAwB,yBAAyB;OAC9C,MAAM,QAAQ,qBACjB,KAAI,EAAE,QAAQ,OACZ,OAAM,IAAI,qBAAqB,QAAQ,OAAO,KAAK,CAAC,eAAe;;;AAM3E,SAAgB,aACd,MACA,UACM;AACN,KAAI,MAAM,QAAQ,KAAK;OAChB,MAAM,OAAO,KAChB,KAAI,EAAE,OAAO,UACX,OAAM,IAAI,MAAM,OAAO,OAAO,IAAI,CAAC,wBAAwB;YAI3D,EAAE,QAAQ,UACZ,OAAM,IAAI,MAAM,OAAO,OAAO,KAAK,CAAC,wBAAwB"}
@@ -1 +1 @@
1
- {"version":3,"file":"write.cjs","names":["RunnableCallable","_isSend","InvalidUpdateError","TASKS","CONFIG_KEY_SEND","Runnable"],"sources":["../../src/pregel/write.ts"],"sourcesContent":["import {\n Runnable,\n RunnableConfig,\n RunnableLike,\n} from \"@langchain/core/runnables\";\nimport { _isSend, CONFIG_KEY_SEND, Send, TASKS } from \"../constants.js\";\nimport { RunnableCallable } from \"../utils.js\";\nimport { InvalidUpdateError } from \"../errors.js\";\n\ntype TYPE_SEND = (values: Array<[string, unknown]>) => void;\n\nexport const SKIP_WRITE = {\n [Symbol.for(\"LG_SKIP_WRITE\")]: true,\n};\n\nfunction _isSkipWrite(x: unknown) {\n return (\n typeof x === \"object\" &&\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (x as any)?.[Symbol.for(\"LG_SKIP_WRITE\")] !== undefined\n );\n}\n\nexport const PASSTHROUGH = {\n [Symbol.for(\"LG_PASSTHROUGH\")]: true,\n};\n\nfunction _isPassthrough(x: unknown) {\n return (\n typeof x === \"object\" &&\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (x as any)?.[Symbol.for(\"LG_PASSTHROUGH\")] !== undefined\n );\n}\n\nconst IS_WRITER = Symbol(\"IS_WRITER\");\n\n/**\n * Mapping of write channels to Runnables that return the value to be written,\n * or None to skip writing.\n */\nexport class ChannelWrite<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunInput = any\n> extends RunnableCallable<RunInput, RunInput> {\n writes: Array<ChannelWriteEntry | ChannelWriteTupleEntry | Send>;\n\n constructor(\n writes: Array<ChannelWriteEntry | ChannelWriteTupleEntry | Send>,\n tags?: string[]\n ) {\n const name = `ChannelWrite<${writes\n .map((packet) => {\n if (_isSend(packet)) {\n return packet.node;\n } else if (\"channel\" in packet) {\n return packet.channel;\n }\n return \"...\";\n })\n .join(\",\")}>`;\n super({\n ...{ writes, name, tags },\n trace: false,\n func: async (input: RunInput, config?: RunnableConfig) => {\n return this._write(input, config ?? {});\n },\n });\n\n this.writes = writes;\n }\n\n async _write(input: unknown, config: RunnableConfig): Promise<unknown> {\n const writes = this.writes.map((write) => {\n if (_isChannelWriteTupleEntry(write) && _isPassthrough(write.value)) {\n return {\n mapper: write.mapper,\n value: input,\n };\n } else if (_isChannelWriteEntry(write) && _isPassthrough(write.value)) {\n return {\n channel: write.channel,\n value: input,\n skipNone: write.skipNone,\n mapper: write.mapper,\n };\n } else {\n return write;\n }\n });\n await ChannelWrite.doWrite(config, writes);\n return input;\n }\n\n // TODO: Support requireAtLeastOneOf\n static async doWrite(\n config: RunnableConfig,\n writes: (ChannelWriteEntry | ChannelWriteTupleEntry | Send)[]\n ): Promise<void> {\n // validate\n for (const w of writes) {\n if (_isChannelWriteEntry(w)) {\n if (w.channel === TASKS) {\n throw new InvalidUpdateError(\n \"Cannot write to the reserved channel TASKS\"\n );\n }\n if (_isPassthrough(w.value)) {\n throw new InvalidUpdateError(\"PASSTHROUGH value must be replaced\");\n }\n }\n if (_isChannelWriteTupleEntry(w)) {\n if (_isPassthrough(w.value)) {\n throw new InvalidUpdateError(\"PASSTHROUGH value must be replaced\");\n }\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const writeEntries: [string, any][] = [];\n for (const w of writes) {\n if (_isSend(w)) {\n writeEntries.push([TASKS, w]);\n } else if (_isChannelWriteTupleEntry(w)) {\n const mappedResult = await w.mapper.invoke(w.value, config);\n if (mappedResult != null && mappedResult.length > 0) {\n writeEntries.push(...mappedResult);\n }\n } else if (_isChannelWriteEntry(w)) {\n const mappedValue =\n w.mapper !== undefined\n ? await w.mapper.invoke(w.value, config)\n : w.value;\n if (_isSkipWrite(mappedValue)) {\n continue;\n }\n if (w.skipNone && mappedValue === undefined) {\n continue;\n }\n writeEntries.push([w.channel, mappedValue]);\n } else {\n throw new Error(`Invalid write entry: ${JSON.stringify(w)}`);\n }\n }\n const write: TYPE_SEND = config.configurable?.[CONFIG_KEY_SEND];\n write(writeEntries);\n }\n\n static isWriter(runnable: RunnableLike): runnable is ChannelWrite {\n return (\n // eslint-disable-next-line no-instanceof/no-instanceof\n runnable instanceof ChannelWrite ||\n (IS_WRITER in runnable && !!runnable[IS_WRITER])\n );\n }\n\n static registerWriter<T extends Runnable>(runnable: T): T {\n return Object.defineProperty(runnable, IS_WRITER, { value: true });\n }\n}\n\nexport interface ChannelWriteEntry {\n channel: string;\n value: unknown;\n skipNone?: boolean;\n mapper?: Runnable;\n}\n\nfunction _isChannelWriteEntry(x: unknown): x is ChannelWriteEntry {\n return (\n x !== undefined && typeof (x as ChannelWriteEntry).channel === \"string\"\n );\n}\n\nexport interface ChannelWriteTupleEntry {\n value: unknown;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n mapper: Runnable<any, [string, any][]>;\n}\n\nfunction _isChannelWriteTupleEntry(x: unknown): x is ChannelWriteTupleEntry {\n return (\n x !== undefined &&\n !_isChannelWriteEntry(x) &&\n Runnable.isRunnable((x as ChannelWriteTupleEntry).mapper)\n );\n}\n"],"mappings":";;;;AAeA,SAAS,aAAa,GAAY;AAChC,QACE,OAAO,MAAM,YAEZ,IAAY,OAAO,IAAI,gBAAgB,MAAM,KAAA;;AAIlD,MAAa,cAAc,GACxB,OAAO,IAAI,iBAAiB,GAAG,MACjC;AAED,SAAS,eAAe,GAAY;AAClC,QACE,OAAO,MAAM,YAEZ,IAAY,OAA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EAAE,CACZ,cAAa,KAAK,CAACE,kBAAAA,OAAO,EAAE,CAAC;WACpB,0BAA0B,EAAE,EAAE;GACvC,MAAM,eAAe,MAAM,EAAE,OAAO,OAAO,EAAE,OAAO,OAAO;AAC3D,OAAI,gBAAgB,QAAQ,aAAa,SAAS,EAChD,cAAa,KAAK,GAAG,aAAa;aAE3B,qBAAqB,EAAE,EAAE;GAClC,MAAM,cACJ,EAAE,WAAW,KAAA,IACT,MAAM,EAAE,OAAO,OAAO,EAAE,OAAO,OAAO,GACtC,EAAE;AACR,OAAI,aAAa,YAAY,CAC3B;AAEF,OAAI,EAAE,YAAY,gBAAgB,KAAA,EAChC;AAEF,gBAAa,KAAK,CAAC,EAAE,SAAS,YAAY,CAAC;QAE3C,OAAM,IAAI,MAAM,wBAAwB,KAAK,UAAU,EAAE,GAAG;EAGhE,MAAM,QAAmB,OAAO,eAAeC,kBAAAA;AAC/C,QAAM,aAAa;;CAGrB,OAAO,SAAS,UAAkD;AAChE,SAEE,oBAAoB,gBACnB,aAAa,YAAY,CAAC,CAAC,SAAS;;CAIzC,OAAO,eAAmC,UAAgB;AACxD,SAAO,OAAO,eAAe,UAAU,WAAW,EAAE,OAAO,MAAM,CAAC;;;AAWtE,SAAS,qBAAqB,GAAoC;AAChE,QACE,MAAM,KAAA,KAAa,OAAQ,EAAwB,YAAY;;AAUnE,SAAS,0BAA0B,GAAyC;AAC1E,QACE,MAAM,KAAA,KACN,CAAC,qBAAqB,EAAE,IACxBC,0BAAAA,SAAS,WAAY,EAA6B,OAAO"}
1
+ {"version":3,"file":"write.cjs","names":["RunnableCallable","_isSend","InvalidUpdateError","TASKS","CONFIG_KEY_SEND","Runnable"],"sources":["../../src/pregel/write.ts"],"sourcesContent":["import {\n Runnable,\n RunnableConfig,\n RunnableLike,\n} from \"@langchain/core/runnables\";\nimport { _isSend, CONFIG_KEY_SEND, Send, TASKS } from \"../constants.js\";\nimport { RunnableCallable } from \"../utils.js\";\nimport { InvalidUpdateError } from \"../errors.js\";\n\ntype TYPE_SEND = (values: Array<[string, unknown]>) => void;\n\nexport const SKIP_WRITE = {\n [Symbol.for(\"LG_SKIP_WRITE\")]: true,\n};\n\nfunction _isSkipWrite(x: unknown) {\n return (\n typeof x === \"object\" &&\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (x as any)?.[Symbol.for(\"LG_SKIP_WRITE\")] !== undefined\n );\n}\n\nexport const PASSTHROUGH = {\n [Symbol.for(\"LG_PASSTHROUGH\")]: true,\n};\n\nfunction _isPassthrough(x: unknown) {\n return (\n typeof x === \"object\" &&\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (x as any)?.[Symbol.for(\"LG_PASSTHROUGH\")] !== undefined\n );\n}\n\nconst IS_WRITER = Symbol(\"IS_WRITER\");\n\n/**\n * Mapping of write channels to Runnables that return the value to be written,\n * or None to skip writing.\n */\nexport class ChannelWrite<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunInput = any,\n> extends RunnableCallable<RunInput, RunInput> {\n writes: Array<ChannelWriteEntry | ChannelWriteTupleEntry | Send>;\n\n constructor(\n writes: Array<ChannelWriteEntry | ChannelWriteTupleEntry | Send>,\n tags?: string[]\n ) {\n const name = `ChannelWrite<${writes\n .map((packet) => {\n if (_isSend(packet)) {\n return packet.node;\n } else if (\"channel\" in packet) {\n return packet.channel;\n }\n return \"...\";\n })\n .join(\",\")}>`;\n super({\n ...{ writes, name, tags },\n trace: false,\n func: async (input: RunInput, config?: RunnableConfig) => {\n return this._write(input, config ?? {});\n },\n });\n\n this.writes = writes;\n }\n\n async _write(input: unknown, config: RunnableConfig): Promise<unknown> {\n const writes = this.writes.map((write) => {\n if (_isChannelWriteTupleEntry(write) && _isPassthrough(write.value)) {\n return {\n mapper: write.mapper,\n value: input,\n };\n } else if (_isChannelWriteEntry(write) && _isPassthrough(write.value)) {\n return {\n channel: write.channel,\n value: input,\n skipNone: write.skipNone,\n mapper: write.mapper,\n };\n } else {\n return write;\n }\n });\n await ChannelWrite.doWrite(config, writes);\n return input;\n }\n\n // TODO: Support requireAtLeastOneOf\n static async doWrite(\n config: RunnableConfig,\n writes: (ChannelWriteEntry | ChannelWriteTupleEntry | Send)[]\n ): Promise<void> {\n // validate\n for (const w of writes) {\n if (_isChannelWriteEntry(w)) {\n if (w.channel === TASKS) {\n throw new InvalidUpdateError(\n \"Cannot write to the reserved channel TASKS\"\n );\n }\n if (_isPassthrough(w.value)) {\n throw new InvalidUpdateError(\"PASSTHROUGH value must be replaced\");\n }\n }\n if (_isChannelWriteTupleEntry(w)) {\n if (_isPassthrough(w.value)) {\n throw new InvalidUpdateError(\"PASSTHROUGH value must be replaced\");\n }\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const writeEntries: [string, any][] = [];\n for (const w of writes) {\n if (_isSend(w)) {\n writeEntries.push([TASKS, w]);\n } else if (_isChannelWriteTupleEntry(w)) {\n const mappedResult = await w.mapper.invoke(w.value, config);\n if (mappedResult != null && mappedResult.length > 0) {\n writeEntries.push(...mappedResult);\n }\n } else if (_isChannelWriteEntry(w)) {\n const mappedValue =\n w.mapper !== undefined\n ? await w.mapper.invoke(w.value, config)\n : w.value;\n if (_isSkipWrite(mappedValue)) {\n continue;\n }\n if (w.skipNone && mappedValue === undefined) {\n continue;\n }\n writeEntries.push([w.channel, mappedValue]);\n } else {\n throw new Error(`Invalid write entry: ${JSON.stringify(w)}`);\n }\n }\n const write: TYPE_SEND = config.configurable?.[CONFIG_KEY_SEND];\n write(writeEntries);\n }\n\n static isWriter(runnable: RunnableLike): runnable is ChannelWrite {\n return (\n // eslint-disable-next-line no-instanceof/no-instanceof\n runnable instanceof ChannelWrite ||\n (IS_WRITER in runnable && !!runnable[IS_WRITER])\n );\n }\n\n static registerWriter<T extends Runnable>(runnable: T): T {\n return Object.defineProperty(runnable, IS_WRITER, { value: true });\n }\n}\n\nexport interface ChannelWriteEntry {\n channel: string;\n value: unknown;\n skipNone?: boolean;\n mapper?: Runnable;\n}\n\nfunction _isChannelWriteEntry(x: unknown): x is ChannelWriteEntry {\n return (\n x !== undefined && typeof (x as ChannelWriteEntry).channel === \"string\"\n );\n}\n\nexport interface ChannelWriteTupleEntry {\n value: unknown;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n mapper: Runnable<any, [string, any][]>;\n}\n\nfunction _isChannelWriteTupleEntry(x: unknown): x is ChannelWriteTupleEntry {\n return (\n x !== undefined &&\n !_isChannelWriteEntry(x) &&\n Runnable.isRunnable((x as ChannelWriteTupleEntry).mapper)\n );\n}\n"],"mappings":";;;;AAeA,SAAS,aAAa,GAAY;AAChC,QACE,OAAO,MAAM,YAEZ,IAAY,OAAO,IAAI,gBAAgB,MAAM,KAAA;;AAIlD,MAAa,cAAc,GACxB,OAAO,IAAI,iBAAiB,GAAG,MACjC;AAED,SAAS,eAAe,GAAY;AAClC,QACE,OAAO,MAAM,YAEZ,IAAY,OAAO,IAAI,iBAAiB,MAAM,KAAA;;AAInD,MAAM,YAAY,OAAO,YAAY;;;;;AAMrC,IAAa,eAAb,MAAa,qBAGHA,cAAAA,iBAAqC;CAC7C;CAEA,YACE,QACA,MACA;EACA,MAAM,OAAO,gBAAgB,OAC1B,KAAK,WAAW;AACf,OAAIC,kBAAAA,QAAQ,OAAO,CACjB,QAAO,OAAO;YACL,aAAa,OACtB,QAAO,OAAO;AAEhB,UAAO;IACP,CACD,KAAK,IAAI,CAAC;AACb,QAAM;GACC;GAAQ;GAAM;GACnB,OAAO;GACP,MAAM,OAAO,OAAiB,WAA4B;AACxD,WAAO,KAAK,OAAO,OAAO,UAAU,EAAE,CAAC;;GAE1C,CAAC;AAEF,OAAK,SAAS;;CAGhB,MAAM,OAAO,OAAgB,QAA0C;EACrE,MAAM,SAAS,KAAK,OAAO,KAAK,UAAU;AACxC,OAAI,0BAA0B,MAAM,IAAI,eAAe,MAAM,MAAM,CACjE,QAAO;IACL,QAAQ,MAAM;IACd,OAAO;IACR;YACQ,qBAAqB,MAAM,IAAI,eAAe,MAAM,MA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AAO,eAAmC,UAAgB;AACxD,SAAO,OAAO,eAAe,UAAU,WAAW,EAAE,OAAO,MAAM,CAAC;;;AAWtE,SAAS,qBAAqB,GAAoC;AAChE,QACE,MAAM,KAAA,KAAa,OAAQ,EAAwB,YAAY;;AAUnE,SAAS,0BAA0B,GAAyC;AAC1E,QACE,MAAM,KAAA,KACN,CAAC,qBAAqB,EAAE,IACxBC,0BAAAA,SAAS,WAAY,EAA6B,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"write.js","names":[],"sources":["../../src/pregel/write.ts"],"sourcesContent":["import {\n Runnable,\n RunnableConfig,\n RunnableLike,\n} from \"@langchain/core/runnables\";\nimport { _isSend, CONFIG_KEY_SEND, Send, TASKS } from \"../constants.js\";\nimport { RunnableCallable } from \"../utils.js\";\nimport { InvalidUpdateError } from \"../errors.js\";\n\ntype TYPE_SEND = (values: Array<[string, unknown]>) => void;\n\nexport const SKIP_WRITE = {\n [Symbol.for(\"LG_SKIP_WRITE\")]: true,\n};\n\nfunction _isSkipWrite(x: unknown) {\n return (\n typeof x === \"object\" &&\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (x as any)?.[Symbol.for(\"LG_SKIP_WRITE\")] !== undefined\n );\n}\n\nexport const PASSTHROUGH = {\n [Symbol.for(\"LG_PASSTHROUGH\")]: true,\n};\n\nfunction _isPassthrough(x: unknown) {\n return (\n typeof x === \"object\" &&\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (x as any)?.[Symbol.for(\"LG_PASSTHROUGH\")] !== undefined\n );\n}\n\nconst IS_WRITER = Symbol(\"IS_WRITER\");\n\n/**\n * Mapping of write channels to Runnables that return the value to be written,\n * or None to skip writing.\n */\nexport class ChannelWrite<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunInput = any\n> extends RunnableCallable<RunInput, RunInput> {\n writes: Array<ChannelWriteEntry | ChannelWriteTupleEntry | Send>;\n\n constructor(\n writes: Array<ChannelWriteEntry | ChannelWriteTupleEntry | Send>,\n tags?: string[]\n ) {\n const name = `ChannelWrite<${writes\n .map((packet) => {\n if (_isSend(packet)) {\n return packet.node;\n } else if (\"channel\" in packet) {\n return packet.channel;\n }\n return \"...\";\n })\n .join(\",\")}>`;\n super({\n ...{ writes, name, tags },\n trace: false,\n func: async (input: RunInput, config?: RunnableConfig) => {\n return this._write(input, config ?? {});\n },\n });\n\n this.writes = writes;\n }\n\n async _write(input: unknown, config: RunnableConfig): Promise<unknown> {\n const writes = this.writes.map((write) => {\n if (_isChannelWriteTupleEntry(write) && _isPassthrough(write.value)) {\n return {\n mapper: write.mapper,\n value: input,\n };\n } else if (_isChannelWriteEntry(write) && _isPassthrough(write.value)) {\n return {\n channel: write.channel,\n value: input,\n skipNone: write.skipNone,\n mapper: write.mapper,\n };\n } else {\n return write;\n }\n });\n await ChannelWrite.doWrite(config, writes);\n return input;\n }\n\n // TODO: Support requireAtLeastOneOf\n static async doWrite(\n config: RunnableConfig,\n writes: (ChannelWriteEntry | ChannelWriteTupleEntry | Send)[]\n ): Promise<void> {\n // validate\n for (const w of writes) {\n if (_isChannelWriteEntry(w)) {\n if (w.channel === TASKS) {\n throw new InvalidUpdateError(\n \"Cannot write to the reserved channel TASKS\"\n );\n }\n if (_isPassthrough(w.value)) {\n throw new InvalidUpdateError(\"PASSTHROUGH value must be replaced\");\n }\n }\n if (_isChannelWriteTupleEntry(w)) {\n if (_isPassthrough(w.value)) {\n throw new InvalidUpdateError(\"PASSTHROUGH value must be replaced\");\n }\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const writeEntries: [string, any][] = [];\n for (const w of writes) {\n if (_isSend(w)) {\n writeEntries.push([TASKS, w]);\n } else if (_isChannelWriteTupleEntry(w)) {\n const mappedResult = await w.mapper.invoke(w.value, config);\n if (mappedResult != null && mappedResult.length > 0) {\n writeEntries.push(...mappedResult);\n }\n } else if (_isChannelWriteEntry(w)) {\n const mappedValue =\n w.mapper !== undefined\n ? await w.mapper.invoke(w.value, config)\n : w.value;\n if (_isSkipWrite(mappedValue)) {\n continue;\n }\n if (w.skipNone && mappedValue === undefined) {\n continue;\n }\n writeEntries.push([w.channel, mappedValue]);\n } else {\n throw new Error(`Invalid write entry: ${JSON.stringify(w)}`);\n }\n }\n const write: TYPE_SEND = config.configurable?.[CONFIG_KEY_SEND];\n write(writeEntries);\n }\n\n static isWriter(runnable: RunnableLike): runnable is ChannelWrite {\n return (\n // eslint-disable-next-line no-instanceof/no-instanceof\n runnable instanceof ChannelWrite ||\n (IS_WRITER in runnable && !!runnable[IS_WRITER])\n );\n }\n\n static registerWriter<T extends Runnable>(runnable: T): T {\n return Object.defineProperty(runnable, IS_WRITER, { value: true });\n }\n}\n\nexport interface ChannelWriteEntry {\n channel: string;\n value: unknown;\n skipNone?: boolean;\n mapper?: Runnable;\n}\n\nfunction _isChannelWriteEntry(x: unknown): x is ChannelWriteEntry {\n return (\n x !== undefined && typeof (x as ChannelWriteEntry).channel === \"string\"\n );\n}\n\nexport interface ChannelWriteTupleEntry {\n value: unknown;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n mapper: Runnable<any, [string, any][]>;\n}\n\nfunction _isChannelWriteTupleEntry(x: unknown): x is ChannelWriteTupleEntry {\n return (\n x !== undefined &&\n !_isChannelWriteEntry(x) &&\n Runnable.isRunnable((x as ChannelWriteTupleEntry).mapper)\n );\n}\n"],"mappings":";;;;AAeA,SAAS,aAAa,GAAY;AAChC,QACE,OAAO,MAAM,YAEZ,IAAY,OAAO,IAAI,gBAAgB,MAAM,KAAA;;AAIlD,MAAa,cAAc,GACxB,OAAO,IAAI,iBAAiB,GAAG,MACjC;AAED,SAAS,eAAe,GAAY;AAClC,QACE,OAAO,MAAM,YAEZ,IAAY,OAAO,IAAI,iBAAiB,MAAM,KAAA;;AAInD,MAAM,YAAY,OAAO,YAAY;;;;;AAMrC,IAAa,eAAb,MAAa,qBAGH,iBAAqC;CAC7C;CAEA,YACE,QACA,MACA;EACA,MAAM,OAAO,gBAAgB,OAC1B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AqB,EAAE,EAAE;GAClC,MAAM,cACJ,EAAE,WAAW,KAAA,IACT,MAAM,EAAE,OAAO,OAAO,EAAE,OAAO,OAAO,GACtC,EAAE;AACR,OAAI,aAAa,YAAY,CAC3B;AAEF,OAAI,EAAE,YAAY,gBAAgB,KAAA,EAChC;AAEF,gBAAa,KAAK,CAAC,EAAE,SAAS,YAAY,CAAC;QAE3C,OAAM,IAAI,MAAM,wBAAwB,KAAK,UAAU,EAAE,GAAG;EAGhE,MAAM,QAAmB,OAAO,eAAe;AAC/C,QAAM,aAAa;;CAGrB,OAAO,SAAS,UAAkD;AAChE,SAEE,oBAAoB,gBACnB,aAAa,YAAY,CAAC,CAAC,SAAS;;CAIzC,OAAO,eAAmC,UAAgB;AACxD,SAAO,OAAO,eAAe,UAAU,WAAW,EAAE,OAAO,MAAM,CAAC;;;AAWtE,SAAS,qBAAqB,GAAoC;AAChE,QACE,MAAM,KAAA,KAAa,OAAQ,EAAwB,YAAY;;AAUnE,SAAS,0BAA0B,GAAyC;AAC1E,QACE,MAAM,KAAA,KACN,CAAC,qBAAqB,EAAE,IACxB,SAAS,WAAY,EAA6B,OAAO"}
1
+ {"version":3,"file":"write.js","names":[],"sources":["../../src/pregel/write.ts"],"sourcesContent":["import {\n Runnable,\n RunnableConfig,\n RunnableLike,\n} from \"@langchain/core/runnables\";\nimport { _isSend, CONFIG_KEY_SEND, Send, TASKS } from \"../constants.js\";\nimport { RunnableCallable } from \"../utils.js\";\nimport { InvalidUpdateError } from \"../errors.js\";\n\ntype TYPE_SEND = (values: Array<[string, unknown]>) => void;\n\nexport const SKIP_WRITE = {\n [Symbol.for(\"LG_SKIP_WRITE\")]: true,\n};\n\nfunction _isSkipWrite(x: unknown) {\n return (\n typeof x === \"object\" &&\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (x as any)?.[Symbol.for(\"LG_SKIP_WRITE\")] !== undefined\n );\n}\n\nexport const PASSTHROUGH = {\n [Symbol.for(\"LG_PASSTHROUGH\")]: true,\n};\n\nfunction _isPassthrough(x: unknown) {\n return (\n typeof x === \"object\" &&\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (x as any)?.[Symbol.for(\"LG_PASSTHROUGH\")] !== undefined\n );\n}\n\nconst IS_WRITER = Symbol(\"IS_WRITER\");\n\n/**\n * Mapping of write channels to Runnables that return the value to be written,\n * or None to skip writing.\n */\nexport class ChannelWrite<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunInput = any,\n> extends RunnableCallable<RunInput, RunInput> {\n writes: Array<ChannelWriteEntry | ChannelWriteTupleEntry | Send>;\n\n constructor(\n writes: Array<ChannelWriteEntry | ChannelWriteTupleEntry | Send>,\n tags?: string[]\n ) {\n const name = `ChannelWrite<${writes\n .map((packet) => {\n if (_isSend(packet)) {\n return packet.node;\n } else if (\"channel\" in packet) {\n return packet.channel;\n }\n return \"...\";\n })\n .join(\",\")}>`;\n super({\n ...{ writes, name, tags },\n trace: false,\n func: async (input: RunInput, config?: RunnableConfig) => {\n return this._write(input, config ?? {});\n },\n });\n\n this.writes = writes;\n }\n\n async _write(input: unknown, config: RunnableConfig): Promise<unknown> {\n const writes = this.writes.map((write) => {\n if (_isChannelWriteTupleEntry(write) && _isPassthrough(write.value)) {\n return {\n mapper: write.mapper,\n value: input,\n };\n } else if (_isChannelWriteEntry(write) && _isPassthrough(write.value)) {\n return {\n channel: write.channel,\n value: input,\n skipNone: write.skipNone,\n mapper: write.mapper,\n };\n } else {\n return write;\n }\n });\n await ChannelWrite.doWrite(config, writes);\n return input;\n }\n\n // TODO: Support requireAtLeastOneOf\n static async doWrite(\n config: RunnableConfig,\n writes: (ChannelWriteEntry | ChannelWriteTupleEntry | Send)[]\n ): Promise<void> {\n // validate\n for (const w of writes) {\n if (_isChannelWriteEntry(w)) {\n if (w.channel === TASKS) {\n throw new InvalidUpdateError(\n \"Cannot write to the reserved channel TASKS\"\n );\n }\n if (_isPassthrough(w.value)) {\n throw new InvalidUpdateError(\"PASSTHROUGH value must be replaced\");\n }\n }\n if (_isChannelWriteTupleEntry(w)) {\n if (_isPassthrough(w.value)) {\n throw new InvalidUpdateError(\"PASSTHROUGH value must be replaced\");\n }\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const writeEntries: [string, any][] = [];\n for (const w of writes) {\n if (_isSend(w)) {\n writeEntries.push([TASKS, w]);\n } else if (_isChannelWriteTupleEntry(w)) {\n const mappedResult = await w.mapper.invoke(w.value, config);\n if (mappedResult != null && mappedResult.length > 0) {\n writeEntries.push(...mappedResult);\n }\n } else if (_isChannelWriteEntry(w)) {\n const mappedValue =\n w.mapper !== undefined\n ? await w.mapper.invoke(w.value, config)\n : w.value;\n if (_isSkipWrite(mappedValue)) {\n continue;\n }\n if (w.skipNone && mappedValue === undefined) {\n continue;\n }\n writeEntries.push([w.channel, mappedValue]);\n } else {\n throw new Error(`Invalid write entry: ${JSON.stringify(w)}`);\n }\n }\n const write: TYPE_SEND = config.configurable?.[CONFIG_KEY_SEND];\n write(writeEntries);\n }\n\n static isWriter(runnable: RunnableLike): runnable is ChannelWrite {\n return (\n // eslint-disable-next-line no-instanceof/no-instanceof\n runnable instanceof ChannelWrite ||\n (IS_WRITER in runnable && !!runnable[IS_WRITER])\n );\n }\n\n static registerWriter<T extends Runnable>(runnable: T): T {\n return Object.defineProperty(runnable, IS_WRITER, { value: true });\n }\n}\n\nexport interface ChannelWriteEntry {\n channel: string;\n value: unknown;\n skipNone?: boolean;\n mapper?: Runnable;\n}\n\nfunction _isChannelWriteEntry(x: unknown): x is ChannelWriteEntry {\n return (\n x !== undefined && typeof (x as ChannelWriteEntry).channel === \"string\"\n );\n}\n\nexport interface ChannelWriteTupleEntry {\n value: unknown;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n mapper: Runnable<any, [string, any][]>;\n}\n\nfunction _isChannelWriteTupleEntry(x: unknown): x is ChannelWriteTupleEntry {\n return (\n x !== undefined &&\n !_isChannelWriteEntry(x) &&\n Runnable.isRunnable((x as Channel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Channel","isStandardSchema","LastValue","getJsonSchemaFromSchema"],"sources":["../../src/state/schema.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { JSONSchema } from \"@langchain/core/utils/json_schema\";\nimport type { StandardSchemaV1 } from \"@standard-schema/spec\";\n\nimport type { RunnableLike } from \"../pregel/runnable_types.js\";\nimport {\n BaseChannel,\n LastValue,\n BinaryOperatorAggregate,\n} from \"../channels/index.js\";\nimport { UntrackedValueChannel } from \"../channels/untracked_value.js\";\n\nimport type { SerializableSchema } from \"./types.js\";\nimport { isStandardSchema } from \"./types.js\";\nimport { getJsonSchemaFromSchema, getSchemaDefaultGetter } from \"./adapter.js\";\nimport type { OverwriteValue } from \"../constants.js\";\nimport { ReducedValue } from \"./values/reduced.js\";\nimport { UntrackedValue } from \"./values/untracked.js\";\n\nconst STATE_SCHEMA_SYMBOL = Symbol.for(\"langgraph.state.state_schema\");\n\n/**\n * Maps a single StateSchema field definition to its corresponding Channel type.\n *\n * This utility type inspects the type of the field and returns an appropriate\n * `BaseChannel` type, parameterized with the state \"value\" and \"input\" types according to the field's shape.\n *\n * Rules:\n * - If the field (`F`) is a `ReducedValue<V, I>`, the channel will store values of type `V`\n * and accept input of type `I`.\n * - If the field is a `UntrackedValue<V>`, the channel will store and accept values of type `V`.\n * - If the field is a `SerializableSchema<I, O>`, the channel will store values of type `O`\n * (the schema's output/validated value) and accept input of type `I`.\n * - For all other types, a generic `BaseChannel<unknown, unknown>` is used as fallback.\n *\n * @template F - The StateSchema field type to map to a Channel type.\n *\n * @example\n * ```typescript\n * type MyField = ReducedValue<number, string>;\n * type ChannelType = StateSchemaFieldToChannel<MyField>;\n * // ChannelType is BaseChannel<number, string>\n * ```\n */\nexport type StateSchemaFieldToChannel<F> = F extends ReducedValue<\n infer V,\n infer I\n>\n ? BaseChannel<V, OverwriteValue<V> | I>\n : F extends UntrackedValue<infer V>\n ? BaseChannel<V, V>\n : F extends SerializableSchema<infer I, infer O>\n ? BaseChannel<O, I>\n : BaseChannel<unknown, unknown>;\n\n/**\n * Converts StateSchema fields into a strongly-typed\n * State Definition object, where each field is mapped to its channel type.\n *\n * This utility type is used internally to create the shape of the state channels for a given schema,\n * substituting each field with the result of `StateSchemaFieldToChannel`.\n *\n * If you define a state schema as:\n * ```typescript\n * const fields = {\n * a: ReducedValue<number, string>(),\n * b: UntrackedValue<boolean>(),\n * c: SomeSerializableSchemaType, // SerializableSchema<in, out>\n * }\n * ```\n * then `StateSchemaFieldsToStateDefinition<typeof fields>` yields:\n * ```typescript\n * {\n * a: BaseChannel<number, string>;\n * b: BaseChannel<boolean, boolean>;\n * c: BaseChannel<typeof schema's output type, typeof schema's input type>;\n * }\n * ```\n *\n * @template TFields - The mapping of field names to StateSchema field types.\n * @returns An object type mapping field names to channel types.\n *\n * @see StateSchemaFieldToChannel\n */\nexport type StateSchemaFieldsToStateDefinition<\n TFields extends StateSchemaFields\n> = {\n [K in keyof TFields]: StateSchemaFieldToChannel<TFields[K]>;\n};\n\n/**\n * Valid field types for StateSchema.\n * Either a LangGraph state value type or a raw schema (e.g., Zod schema).\n */\nexport type StateSchemaField<Input = unknown, Output = Input> =\n | ReducedValue<Input, Output>\n | UntrackedValue<Output>\n | SerializableSchema<Input, Output>;\n\n/**\n * Init object for StateSchema constructor.\n * Uses `any` to allow variance in generic types (e.g., ReducedValue<string, string[]>).\n */\nexport type StateSchemaFields = {\n [key: string]: StateSchemaField<any, any>;\n};\n\n/**\n * Infer the State type from a StateSchemaFields.\n * This is the type of the full state object.\n *\n * - ReducedValue<Value, Input> → Value (the stored type)\n * - UntrackedValue<Value> → Value\n * - SerializableSchema<Input, Output> → Output (the validated type)\n */\nexport type InferStateSchemaValue<TFields extends StateSchemaFields> = {\n [K in keyof TFields]: TFields[K] extends ReducedValue<any, any>\n ? TFields[K][\"ValueType\"]\n : TFields[K] extends UntrackedValue<any>\n ? TFields[K][\"ValueType\"]\n : TFields[K] extends SerializableSchema<any, infer TOutput>\n ? TOutput\n : never;\n};\n\n/**\n * Infer the Update type from a StateSchemaFields.\n * This is the type for partial updates to state.\n *\n * - ReducedValue<Value, Input> → Input (the reducer input type)\n * - UntrackedValue<Value> → Value\n * - SerializableSchema<Input, Output> → Input (what you provide)\n */\nexport type InferStateSchemaUpdate<TFields extends StateSchemaFields> = {\n [K in keyof TFields]?: TFields[K] extends ReducedValue<infer V, infer I>\n ? OverwriteValue<V> | I\n : TFields[K] extends UntrackedValue<any>\n ? TFields[K][\"ValueType\"]\n : TFields[K] extends SerializableSchema<infer TInput, any>\n ? TInput\n : never;\n};\n\n/**\n * StateSchema provides a unified API for defining LangGraph state schemas.\n *\n * @example\n * ```ts\n * import { z } from \"zod\";\n * import { StateSchema, ReducedValue, MessagesValue } from \"@langchain/langgraph\";\n *\n * const AgentState = new StateSchema({\n * // Prebuilt messages value\n * messages: MessagesValue,\n * // Basic LastValue channel from any standard schema\n * currentStep: z.string(),\n * // LastValue with native default\n * count: z.number().default(0),\n * // ReducedValue for fields needing reducers\n * history: new ReducedValue(\n * z.array(z.string()).default(() => []),\n * {\n * inputSchema: z.string(),\n * reducer: (current, next) => [...current, next],\n * }\n * ),\n * });\n *\n * // Extract types\n * type State = typeof AgentState.State;\n * type Update = typeof AgentState.Update;\n *\n * // Use in StateGraph\n * const graph = new StateGraph(AgentState);\n * ```\n */\nexport class StateSchema<TFields extends StateSchemaFields> {\n /**\n * Symbol for runtime identification.\n * @internal Used by isInstance for runtime type checking\n */\n // @ts-expect-error - Symbol is read via `in` operator in isInstance\n private readonly [STATE_SCHEMA_SYMBOL] = true;\n\n /**\n * Type declaration for the full state type.\n * Use: `typeof myState.State`\n */\n declare State: InferStateSchemaValue<TFields>;\n\n /**\n * Type declaration for the update type.\n * Use: `typeof myState.Update`\n */\n declare Update: InferStateSchemaUpdate<TFields>;\n\n /**\n * Type declaration for node functions.\n * Use: `typeof myState.Node` to type node functions outside the graph builder.\n *\n * @example\n * ```typescript\n * const AgentState = new StateSchema({\n * count: z.number().default(0),\n * });\n *\n * const myNode: typeof AgentState.Node = (state) => {\n * return { count: state.count + 1 };\n * };\n * ```\n */\n declare Node: RunnableLike<\n InferStateSchemaValue<TFields>,\n InferStateSchemaUpdate<TFields>\n >;\n\n constructor(readonly fields: TFields) {}\n\n /**\n * Get the channel definitions for use with StateGraph.\n * This converts the StateSchema fields into BaseChannel instances.\n */\n getChannels(): Record<string, BaseChannel> {\n const channels: Record<string, BaseChannel> = {};\n\n for (const [key, value] of Object.entries(this.fields)) {\n if (ReducedValue.isInstance(value)) {\n // ReducedValue -> BinaryOperatorAggregate\n const defaultGetter = getSchemaDefaultGetter(value.valueSchema);\n channels[key] = new BinaryOperatorAggregate(\n value.reducer,\n defaultGetter\n );\n } else if (UntrackedValue.isInstance(value)) {\n // UntrackedValue -> UntrackedValueChannel\n const defaultGetter = value.schema\n ? getSchemaDefaultGetter(value.schema)\n : undefined;\n channels[key] = new UntrackedValueChannel({\n guard: value.guard,\n initialValueFactory: defaultGetter,\n });\n } else if (isStandardSchema(value)) {\n // Plain schema -> LastValue channel\n const defaultGetter = getSchemaDefaultGetter(value);\n channels[key] = new LastValue(defaultGetter);\n } else {\n throw new Error(\n `Invalid state field \"${key}\": must be a schema, ReducedValue, UntrackedValue, or ManagedValue`\n );\n }\n }\n\n return channels;\n }\n\n /**\n * Get the JSON schema for the full state type.\n * Used by Studio and API for schema introspection.\n */\n getJsonSchema(): JSONSchema {\n const properties: Record<string, JSONSchema> = {};\n const required: string[] = [];\n\n for (const [key, value] of Object.entries(this.fields)) {\n let fieldSchema: JSONSchema | undefined;\n\n if (ReducedValue.isInstance(value)) {\n fieldSchema = getJsonSchemaFromSchema(value.valueSchema) as JSONSchema;\n // Merge jsonSchemaExtra (e.g. langgraph_type) into the field schema,\n // even if base schema is undefined\n if (value.jsonSchemaExtra) {\n fieldSchema = { ...(fieldSchema ?? {}), ...value.jsonSchemaExtra };\n }\n } else if (UntrackedValue.isInstance(value)) {\n fieldSchema = value.schema\n ? (getJsonSchemaFromSchema(value.schema) as JSONSchema)\n : undefined;\n } else if (isStandardSchema(value)) {\n fieldSchema = getJsonSchemaFromSchema(value) as JSONSchema;\n }\n\n if (fieldSchema) {\n properties[key] = fieldSchema;\n\n // Field is required if it doesn't have a default\n let hasDefault = false;\n if (ReducedValue.isInstance(value)) {\n hasDefault = getSchemaDefaultGetter(value.valueSchema) !== undefined;\n } else if (UntrackedValue.isInstance(value)) {\n hasDefault = value.schema\n ? getSchemaDefaultGetter(value.schema) !== undefined\n : false;\n } else {\n hasDefault = getSchemaDefaultGetter(value) !== undefined;\n }\n\n if (!hasDefault) {\n required.push(key);\n }\n }\n }\n\n return {\n type: \"object\",\n properties,\n required: required.length > 0 ? required : undefined,\n };\n }\n\n /**\n * Get the JSON schema for the update/input type.\n * All fields are optional in updates.\n */\n getInputJsonSchema(): JSONSchema {\n const properties: Record<string, JSONSchema> = {};\n\n for (const [key, value] of Object.entries(this.fields)) {\n let fieldSchema: JSONSchema | undefined;\n\n if (ReducedValue.isInstance(value)) {\n // Use input schema for updates\n fieldSchema = getJsonSchemaFromSchema(value.inputSchema) as JSONSchema;\n // Merge jsonSchemaExtra (e.g. langgraph_type) into the field schema,\n // even if base schema is undefined\n if (value.jsonSchemaExtra) {\n fieldSchema = { ...(fieldSchema ?? {}), ...value.jsonSchemaExtra };\n }\n } else if (UntrackedValue.isInstance(value)) {\n fieldSchema = value.schema\n ? (getJsonSchemaFromSchema(value.schema) as JSONSchema)\n : undefined;\n } else if (isStandardSchema(value)) {\n fieldSchema = getJsonSchemaFromSchema(value) as JSONSchema;\n }\n\n if (fieldSchema) {\n properties[key] = fieldSchema;\n }\n }\n\n return {\n type: \"object\",\n properties,\n };\n }\n\n /**\n * Get the list of channel keys (excluding managed values).\n */\n getChannelKeys(): string[] {\n return Object.entries(this.fields).map(([key]) => key);\n }\n\n /**\n * Get all keys (channels + managed values).\n */\n getAllKeys(): string[] {\n return Object.keys(this.fields);\n }\n\n /**\n * Validate input data against the schema.\n * This validates each field using its corresponding schema.\n *\n * @param data - The input data to validate\n * @returns The validated data with coerced types\n */\n async validateInput<T>(data: T): Promise<T> {\n if (data == null || typeof data !== \"object\") {\n return data;\n }\n\n const result: Record<string, unknown> = {};\n\n for (const [key, value] of Object.entries(data)) {\n const fieldDef = this.fields[key];\n\n if (fieldDef === undefined) {\n // Unknown field, pass through\n result[key] = value;\n continue;\n }\n\n // Get the schema to use for validation\n let schema: StandardSchemaV1 | undefined;\n\n if (ReducedValue.isInstance(fieldDef)) {\n schema = fieldDef.inputSchema;\n } else if (UntrackedValue.isInstance(fieldDef)) {\n schema = fieldDef.schema;\n } else if (isStandardSchema(fieldDef)) {\n schema = fieldDef;\n }\n\n if (schema) {\n // Validate using standard schema\n const validationResult = await schema[\"~standard\"].validate(value);\n if (validationResult.issues) {\n throw new Error(\n `Validation failed for field \"${key}\": ${JSON.stringify(\n validationResult.issues\n )}`\n );\n }\n result[key] = validationResult.value;\n } else {\n // No schema or not a standard schema, pass through\n result[key] = value;\n }\n }\n\n return result as T;\n }\n\n /**\n * Type guard to check if a value is a StateSchema instance.\n *\n * @param value - The value to check.\n * @returns True if the value is a StateSchema instance with the correct runtime tag.\n */\n static isInstance<TFields extends StateSchemaFields>(\n value: StateSchema<TFields>\n ): value is StateSchema<TFields>;\n\n static isInstance(value: unknown): value is StateSchema<any>;\n\n static isInstance<TFields extends StateSchemaFields>(\n value: unknown\n ): value is StateSchema<TFields> {\n return (\n typeof value === \"object\" &&\n value !== null &&\n STATE_SCHEMA_SYMBOL in value &&\n value[STATE_SCHEMA_SYMBOL] === true\n );\n }\n}\n\nexport type AnyStateSchema = StateSchema<any>;\n"],"mappings":";;;;;;;;;AAmBA,MAAM,sBAAsB,OAAO,IAAI,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6JtE,IAAa,cAAb,MAA4D;;;;;CAM1D,CAAkB,uBAAuB;CAkCzC,YAAY,QAA0B;AAAjB,OAAA,SAAA;;;;;;CAMrB,cAA2C;EACz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BAAAA,aAAa,WAAW,SAAS,CACnC,UAAS,SAAS;YACTG,kBAAAA,eAAe,WAAW,SAAS,CAC5C,UAAS,SAAS;YACTE,cAAAA,iBAAiB,SAAS,CACnC,UAAS;AAGX,OAAI,QAAQ;IAEV,MAAM,mBAAmB,MAAM,OAAO,aAAa,SAAS,MAAM;AAClE,QAAI,iBAAiB,OACnB,OAAM,IAAI,MACR,gCAAgC,IAAI,KAAK,KAAK,UAC5C,iBAAiB,OAClB,GACF;AAEH,WAAO,OAAO,iBAAiB;SAG/B,QAAO,OAAO;;AAIlB,SAAO;;CAeT,OAAO,WACL,OAC+B;AAC/B,SACE,OAAO,UAAU,YACjB,UAAU,QACV,uBAAuB,SACvB,MAAM,yBAAyB"}
1
+ {"version":3,"file":"schema.cjs","names":["ReducedValue","getSchemaDefaultGetter","BinaryOperatorAggregate","UntrackedValue","UntrackedValueChannel","isStandardSchema","LastValue","getJsonSchemaFromSchema"],"sources":["../../src/state/schema.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { JSONSchema } from \"@langchain/core/utils/json_schema\";\nimport type { StandardSchemaV1 } from \"@standard-schema/spec\";\n\nimport type { RunnableLike } from \"../pregel/runnable_types.js\";\nimport {\n BaseChannel,\n LastValue,\n BinaryOperatorAggregate,\n} from \"../channels/index.js\";\nimport { UntrackedValueChannel } from \"../channels/untracked_value.js\";\n\nimport type { SerializableSchema } from \"./types.js\";\nimport { isStandardSchema } from \"./types.js\";\nimport { getJsonSchemaFromSchema, getSchemaDefaultGetter } from \"./adapter.js\";\nimport type { OverwriteValue } from \"../constants.js\";\nimport { ReducedValue } from \"./values/reduced.js\";\nimport { UntrackedValue } from \"./values/untracked.js\";\n\nconst STATE_SCHEMA_SYMBOL = Symbol.for(\"langgraph.state.state_schema\");\n\n/**\n * Maps a single StateSchema field definition to its corresponding Channel type.\n *\n * This utility type inspects the type of the field and returns an appropriate\n * `BaseChannel` type, parameterized with the state \"value\" and \"input\" types according to the field's shape.\n *\n * Rules:\n * - If the field (`F`) is a `ReducedValue<V, I>`, the channel will store values of type `V`\n * and accept input of type `I`.\n * - If the field is a `UntrackedValue<V>`, the channel will store and accept values of type `V`.\n * - If the field is a `SerializableSchema<I, O>`, the channel will store values of type `O`\n * (the schema's output/validated value) and accept input of type `I`.\n * - For all other types, a generic `BaseChannel<unknown, unknown>` is used as fallback.\n *\n * @template F - The StateSchema field type to map to a Channel type.\n *\n * @example\n * ```typescript\n * type MyField = ReducedValue<number, string>;\n * type ChannelType = StateSchemaFieldToChannel<MyField>;\n * // ChannelType is BaseChannel<number, string>\n * ```\n */\nexport type StateSchemaFieldToChannel<F> =\n F extends ReducedValue<infer V, infer I>\n ? BaseChannel<V, OverwriteValue<V> | I>\n : F extends UntrackedValue<infer V>\n ? BaseChannel<V, V>\n : F extends SerializableSchema<infer I, infer O>\n ? BaseChannel<O, I>\n : BaseChannel<unknown, unknown>;\n\n/**\n * Converts StateSchema fields into a strongly-typed\n * State Definition object, where each field is mapped to its channel type.\n *\n * This utility type is used internally to create the shape of the state channels for a given schema,\n * substituting each field with the result of `StateSchemaFieldToChannel`.\n *\n * If you define a state schema as:\n * ```typescript\n * const fields = {\n * a: ReducedValue<number, string>(),\n * b: UntrackedValue<boolean>(),\n * c: SomeSerializableSchemaType, // SerializableSchema<in, out>\n * }\n * ```\n * then `StateSchemaFieldsToStateDefinition<typeof fields>` yields:\n * ```typescript\n * {\n * a: BaseChannel<number, string>;\n * b: BaseChannel<boolean, boolean>;\n * c: BaseChannel<typeof schema's output type, typeof schema's input type>;\n * }\n * ```\n *\n * @template TFields - The mapping of field names to StateSchema field types.\n * @returns An object type mapping field names to channel types.\n *\n * @see StateSchemaFieldToChannel\n */\nexport type StateSchemaFieldsToStateDefinition<\n TFields extends StateSchemaFields,\n> = {\n [K in keyof TFields]: StateSchemaFieldToChannel<TFields[K]>;\n};\n\n/**\n * Valid field types for StateSchema.\n * Either a LangGraph state value type or a raw schema (e.g., Zod schema).\n */\nexport type StateSchemaField<Input = unknown, Output = Input> =\n | ReducedValue<Input, Output>\n | UntrackedValue<Output>\n | SerializableSchema<Input, Output>;\n\n/**\n * Init object for StateSchema constructor.\n * Uses `any` to allow variance in generic types (e.g., ReducedValue<string, string[]>).\n */\nexport type StateSchemaFields = {\n [key: string]: StateSchemaField<any, any>;\n};\n\n/**\n * Infer the State type from a StateSchemaFields.\n * This is the type of the full state object.\n *\n * - ReducedValue<Value, Input> → Value (the stored type)\n * - UntrackedValue<Value> → Value\n * - SerializableSchema<Input, Output> → Output (the validated type)\n */\nexport type InferStateSchemaValue<TFields extends StateSchemaFields> = {\n [K in keyof TFields]: TFields[K] extends ReducedValue<any, any>\n ? TFields[K][\"ValueType\"]\n : TFields[K] extends UntrackedValue<any>\n ? TFields[K][\"ValueType\"]\n : TFields[K] extends SerializableSchema<any, infer TOutput>\n ? TOutput\n : never;\n};\n\n/**\n * Infer the Update type from a StateSchemaFields.\n * This is the type for partial updates to state.\n *\n * - ReducedValue<Value, Input> → Input (the reducer input type)\n * - UntrackedValue<Value> → Value\n * - SerializableSchema<Input, Output> → Input (what you provide)\n */\nexport type InferStateSchemaUpdate<TFields extends StateSchemaFields> = {\n [K in keyof TFields]?: TFields[K] extends ReducedValue<infer V, infer I>\n ? OverwriteValue<V> | I\n : TFields[K] extends UntrackedValue<any>\n ? TFields[K][\"ValueType\"]\n : TFields[K] extends SerializableSchema<infer TInput, any>\n ? TInput\n : never;\n};\n\n/**\n * StateSchema provides a unified API for defining LangGraph state schemas.\n *\n * @example\n * ```ts\n * import { z } from \"zod\";\n * import { StateSchema, ReducedValue, MessagesValue } from \"@langchain/langgraph\";\n *\n * const AgentState = new StateSchema({\n * // Prebuilt messages value\n * messages: MessagesValue,\n * // Basic LastValue channel from any standard schema\n * currentStep: z.string(),\n * // LastValue with native default\n * count: z.number().default(0),\n * // ReducedValue for fields needing reducers\n * history: new ReducedValue(\n * z.array(z.string()).default(() => []),\n * {\n * inputSchema: z.string(),\n * reducer: (current, next) => [...current, next],\n * }\n * ),\n * });\n *\n * // Extract types\n * type State = typeof AgentState.State;\n * type Update = typeof AgentState.Update;\n *\n * // Use in StateGraph\n * const graph = new StateGraph(AgentState);\n * ```\n */\nexport class StateSchema<TFields extends StateSchemaFields> {\n /**\n * Symbol for runtime identification.\n * @internal Used by isInstance for runtime type checking\n */\n // @ts-expect-error - Symbol is read via `in` operator in isInstance\n private readonly [STATE_SCHEMA_SYMBOL] = true;\n\n /**\n * Type declaration for the full state type.\n * Use: `typeof myState.State`\n */\n declare State: InferStateSchemaValue<TFields>;\n\n /**\n * Type declaration for the update type.\n * Use: `typeof myState.Update`\n */\n declare Update: InferStateSchemaUpdate<TFields>;\n\n /**\n * Type declaration for node functions.\n * Use: `typeof myState.Node` to type node functions outside the graph builder.\n *\n * @example\n * ```typescript\n * const AgentState = new StateSchema({\n * count: z.number().default(0),\n * });\n *\n * const myNode: typeof AgentState.Node = (state) => {\n * return { count: state.count + 1 };\n * };\n * ```\n */\n declare Node: RunnableLike<\n InferStateSchemaValue<TFields>,\n InferStateSchemaUpdate<TFields>\n >;\n\n constructor(readonly fields: TFields) {}\n\n /**\n * Get the channel definitions for use with StateGraph.\n * This converts the StateSchema fields into BaseChannel instances.\n */\n getChannels(): Record<string, BaseChannel> {\n const channels: Record<string, BaseChannel> = {};\n\n for (const [key, value] of Object.entries(this.fields)) {\n if (ReducedValue.isInstance(value)) {\n // ReducedValue -> BinaryOperatorAggregate\n const defaultGetter = getSchemaDefaultGetter(value.valueSchema);\n channels[key] = new BinaryOperatorAggregate(\n value.reducer,\n defaultGetter\n );\n } else if (UntrackedValue.isInstance(value)) {\n // UntrackedValue -> UntrackedValueChannel\n const defaultGetter = value.schema\n ? getSchemaDefaultGetter(value.schema)\n : undefined;\n channels[key] = new UntrackedValueChannel({\n guard: value.guard,\n initialValueFactory: defaultGetter,\n });\n } else if (isStandardSchema(value)) {\n // Plain schema -> LastValue channel\n const defaultGetter = getSchemaDefaultGetter(value);\n channels[key] = new LastValue(defaultGetter);\n } else {\n throw new Error(\n `Invalid state field \"${key}\": must be a schema, ReducedValue, UntrackedValue, or ManagedValue`\n );\n }\n }\n\n return channels;\n }\n\n /**\n * Get the JSON schema for the full state type.\n * Used by Studio and API for schema introspection.\n */\n getJsonSchema(): JSONSchema {\n const properties: Record<string, JSONSchema> = {};\n const required: string[] = [];\n\n for (const [key, value] of Object.entries(this.fields)) {\n let fieldSchema: JSONSchema | undefined;\n\n if (ReducedValue.isInstance(value)) {\n fieldSchema = getJsonSchemaFromSchema(value.valueSchema) as JSONSchema;\n // Merge jsonSchemaExtra (e.g. langgraph_type) into the field schema,\n // even if base schema is undefined\n if (value.jsonSchemaExtra) {\n fieldSchema = { ...(fieldSchema ?? {}), ...value.jsonSchemaExtra };\n }\n } else if (UntrackedValue.isInstance(value)) {\n fieldSchema = value.schema\n ? (getJsonSchemaFromSchema(value.schema) as JSONSchema)\n : undefined;\n } else if (isStandardSchema(value)) {\n fieldSchema = getJsonSchemaFromSchema(value) as JSONSchema;\n }\n\n if (fieldSchema) {\n properties[key] = fieldSchema;\n\n // Field is required if it doesn't have a default\n let hasDefault = false;\n if (ReducedValue.isInstance(value)) {\n hasDefault = getSchemaDefaultGetter(value.valueSchema) !== undefined;\n } else if (UntrackedValue.isInstance(value)) {\n hasDefault = value.schema\n ? getSchemaDefaultGetter(value.schema) !== undefined\n : false;\n } else {\n hasDefault = getSchemaDefaultGetter(value) !== undefined;\n }\n\n if (!hasDefault) {\n required.push(key);\n }\n }\n }\n\n return {\n type: \"object\",\n properties,\n required: required.length > 0 ? required : undefined,\n };\n }\n\n /**\n * Get the JSON schema for the update/input type.\n * All fields are optional in updates.\n */\n getInputJsonSchema(): JSONSchema {\n const properties: Record<string, JSONSchema> = {};\n\n for (const [key, value] of Object.entries(this.fields)) {\n let fieldSchema: JSONSchema | undefined;\n\n if (ReducedValue.isInstance(value)) {\n // Use input schema for updates\n fieldSchema = getJsonSchemaFromSchema(value.inputSchema) as JSONSchema;\n // Merge jsonSchemaExtra (e.g. langgraph_type) into the field schema,\n // even if base schema is undefined\n if (value.jsonSchemaExtra) {\n fieldSchema = { ...(fieldSchema ?? {}), ...value.jsonSchemaExtra };\n }\n } else if (UntrackedValue.isInstance(value)) {\n fieldSchema = value.schema\n ? (getJsonSchemaFromSchema(value.schema) as JSONSchema)\n : undefined;\n } else if (isStandardSchema(value)) {\n fieldSchema = getJsonSchemaFromSchema(value) as JSONSchema;\n }\n\n if (fieldSchema) {\n properties[key] = fieldSchema;\n }\n }\n\n return {\n type: \"object\",\n properties,\n };\n }\n\n /**\n * Get the list of channel keys (excluding managed values).\n */\n getChannelKeys(): string[] {\n return Object.entries(this.fields).map(([key]) => key);\n }\n\n /**\n * Get all keys (channels + managed values).\n */\n getAllKeys(): string[] {\n return Object.keys(this.fields);\n }\n\n /**\n * Validate input data against the schema.\n * This validates each field using its corresponding schema.\n *\n * @param data - The input data to validate\n * @returns The validated data with coerced types\n */\n async validateInput<T>(data: T): Promise<T> {\n if (data == null || typeof data !== \"object\") {\n return data;\n }\n\n const result: Record<string, unknown> = {};\n\n for (const [key, value] of Object.entries(data)) {\n const fieldDef = this.fields[key];\n\n if (fieldDef === undefined) {\n // Unknown field, pass through\n result[key] = value;\n continue;\n }\n\n // Get the schema to use for validation\n let schema: StandardSchemaV1 | undefined;\n\n if (ReducedValue.isInstance(fieldDef)) {\n schema = fieldDef.inputSchema;\n } else if (UntrackedValue.isInstance(fieldDef)) {\n schema = fieldDef.schema;\n } else if (isStandardSchema(fieldDef)) {\n schema = fieldDef;\n }\n\n if (schema) {\n // Validate using standard schema\n const validationResult = await schema[\"~standard\"].validate(value);\n if (validationResult.issues) {\n throw new Error(\n `Validation failed for field \"${key}\": ${JSON.stringify(\n validationResult.issues\n )}`\n );\n }\n result[key] = validationResult.value;\n } else {\n // No schema or not a standard schema, pass through\n result[key] = value;\n }\n }\n\n return result as T;\n }\n\n /**\n * Type guard to check if a value is a StateSchema instance.\n *\n * @param value - The value to check.\n * @returns True if the value is a StateSchema instance with the correct runtime tag.\n */\n static isInstance<TFields extends StateSchemaFields>(\n value: StateSchema<TFields>\n ): value is StateSchema<TFields>;\n\n static isInstance(value: unknown): value is StateSchema<any>;\n\n static isInstance<TFields extends StateSchemaFields>(\n value: unknown\n ): value is StateSchema<TFields> {\n return (\n typeof value === \"object\" &&\n value !== null &&\n STATE_SCHEMA_SYMBOL in value &&\n value[STATE_SCHEMA_SYMBOL] === true\n );\n }\n}\n\nexport type AnyStateSchema = StateSchema<any>;\n"],"mappings":";;;;;;;;;AAmBA,MAAM,sBAAsB,OAAO,IAAI,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2JtE,IAAa,cAAb,MAA4D;;;;;CAM1D,CAAkB,uBAAuB;CAkCzC,YAAY,QAA0B;AAAjB,OAAA,SAAA;;;;;;CAMrB,cAA2C;EACzC,MAAM,WAAwC,EAAE;AAEhD,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,OAAO,CACpD,KAAIA,gBAAAA,aAAa,WAAW,MAAM,EAAE;GAElC,MAAM,gBAAgBC,gBAAAA,uBAAuB,MAAM,YAAY;AAC/D,YAAS,OAAO,IAAIC,cAAAA,wBAClB,MAAM,SACN,cACD;aACQC,kBAAAA,eAAe,WAAW,MAAM,EAAE;GAE3C,MAAM,gBAAgB,MAAM,SACxBF,gBAAAA,uBAAuB,MAAM,OAAO,GACpC,KAAA;AACJ,YAAS,OAAO,IAAIG,wBAAAA,sBAAsB;IACxC,OAAO,MAAM;IACb,qBAAqB;IACtB,CAAC;aACOC,cAAAA,iBAAiB,MAAM,CAGhC,UAAS,OAAO,IAAIC,mBAAAA,UADEL,gBAAAA,uBAAuB,MAAM,CACP;MAE5C,OAAM,IAAI,MACR,wBAAwB,IAAI,oEAC7B;AAIL,SAAO;;;;;;CAOT,gBAA4B;EAC1B,MAAM,aAAyC,EAAE;EACjD,MAAM,WAAqB,EAAE;AAE7B,OAAK,MAAM,CAAC,K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