@langchain/langgraph 1.0.7 → 1.0.13

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 (304) hide show
  1. package/dist/channels/any_value.cjs.map +1 -1
  2. package/dist/channels/any_value.d.cts +0 -1
  3. package/dist/channels/any_value.d.cts.map +1 -1
  4. package/dist/channels/any_value.d.ts +0 -1
  5. package/dist/channels/any_value.d.ts.map +1 -1
  6. package/dist/channels/any_value.js.map +1 -1
  7. package/dist/channels/base.cjs +2 -3
  8. package/dist/channels/base.cjs.map +1 -1
  9. package/dist/channels/base.d.cts.map +1 -1
  10. package/dist/channels/base.d.ts.map +1 -1
  11. package/dist/channels/base.js.map +1 -1
  12. package/dist/channels/binop.cjs.map +1 -1
  13. package/dist/channels/binop.d.cts.map +1 -1
  14. package/dist/channels/binop.d.ts.map +1 -1
  15. package/dist/channels/binop.js.map +1 -1
  16. package/dist/channels/dynamic_barrier_value.cjs +0 -1
  17. package/dist/channels/dynamic_barrier_value.cjs.map +1 -1
  18. package/dist/channels/dynamic_barrier_value.d.cts +1 -3
  19. package/dist/channels/dynamic_barrier_value.d.cts.map +1 -1
  20. package/dist/channels/dynamic_barrier_value.d.ts +1 -3
  21. package/dist/channels/dynamic_barrier_value.d.ts.map +1 -1
  22. package/dist/channels/dynamic_barrier_value.js +0 -1
  23. package/dist/channels/dynamic_barrier_value.js.map +1 -1
  24. package/dist/channels/ephemeral_value.cjs.map +1 -1
  25. package/dist/channels/ephemeral_value.d.cts +0 -1
  26. package/dist/channels/ephemeral_value.d.cts.map +1 -1
  27. package/dist/channels/ephemeral_value.d.ts +0 -1
  28. package/dist/channels/ephemeral_value.d.ts.map +1 -1
  29. package/dist/channels/ephemeral_value.js.map +1 -1
  30. package/dist/channels/last_value.cjs.map +1 -1
  31. package/dist/channels/last_value.d.cts +0 -2
  32. package/dist/channels/last_value.d.cts.map +1 -1
  33. package/dist/channels/last_value.d.ts +0 -2
  34. package/dist/channels/last_value.d.ts.map +1 -1
  35. package/dist/channels/last_value.js.map +1 -1
  36. package/dist/channels/named_barrier_value.cjs +0 -2
  37. package/dist/channels/named_barrier_value.cjs.map +1 -1
  38. package/dist/channels/named_barrier_value.d.cts +2 -4
  39. package/dist/channels/named_barrier_value.d.cts.map +1 -1
  40. package/dist/channels/named_barrier_value.d.ts +2 -4
  41. package/dist/channels/named_barrier_value.d.ts.map +1 -1
  42. package/dist/channels/named_barrier_value.js +0 -2
  43. package/dist/channels/named_barrier_value.js.map +1 -1
  44. package/dist/channels/topic.cjs.map +1 -1
  45. package/dist/channels/topic.d.cts.map +1 -1
  46. package/dist/channels/topic.d.ts.map +1 -1
  47. package/dist/channels/topic.js.map +1 -1
  48. package/dist/constants.cjs.map +1 -1
  49. package/dist/constants.d.cts +2 -6
  50. package/dist/constants.d.cts.map +1 -1
  51. package/dist/constants.d.ts +2 -6
  52. package/dist/constants.d.ts.map +1 -1
  53. package/dist/constants.js.map +1 -1
  54. package/dist/errors.cjs.map +1 -1
  55. package/dist/errors.d.cts +0 -4
  56. package/dist/errors.d.cts.map +1 -1
  57. package/dist/errors.d.ts +0 -4
  58. package/dist/errors.d.ts.map +1 -1
  59. package/dist/errors.js.map +1 -1
  60. package/dist/func/index.cjs +2 -4
  61. package/dist/func/index.cjs.map +1 -1
  62. package/dist/func/index.d.cts +1 -6
  63. package/dist/func/index.d.cts.map +1 -1
  64. package/dist/func/index.d.ts +1 -6
  65. package/dist/func/index.d.ts.map +1 -1
  66. package/dist/func/index.js +1 -2
  67. package/dist/func/index.js.map +1 -1
  68. package/dist/func/types.d.cts +2 -4
  69. package/dist/func/types.d.cts.map +1 -1
  70. package/dist/func/types.d.ts +2 -4
  71. package/dist/func/types.d.ts.map +1 -1
  72. package/dist/graph/annotation.cjs.map +1 -1
  73. package/dist/graph/annotation.d.cts.map +1 -1
  74. package/dist/graph/annotation.d.ts.map +1 -1
  75. package/dist/graph/annotation.js.map +1 -1
  76. package/dist/graph/graph.cjs +15 -18
  77. package/dist/graph/graph.cjs.map +1 -1
  78. package/dist/graph/graph.d.cts +4 -28
  79. package/dist/graph/graph.d.cts.map +1 -1
  80. package/dist/graph/graph.d.ts +4 -28
  81. package/dist/graph/graph.d.ts.map +1 -1
  82. package/dist/graph/graph.js +4 -6
  83. package/dist/graph/graph.js.map +1 -1
  84. package/dist/graph/message.cjs +8 -10
  85. package/dist/graph/message.cjs.map +1 -1
  86. package/dist/graph/message.d.cts +2 -2
  87. package/dist/graph/message.d.cts.map +1 -1
  88. package/dist/graph/message.d.ts +2 -2
  89. package/dist/graph/message.d.ts.map +1 -1
  90. package/dist/graph/message.js +3 -4
  91. package/dist/graph/message.js.map +1 -1
  92. package/dist/graph/messages_annotation.cjs +1 -2
  93. package/dist/graph/messages_annotation.cjs.map +1 -1
  94. package/dist/graph/messages_annotation.d.cts +5 -5
  95. package/dist/graph/messages_annotation.d.cts.map +1 -1
  96. package/dist/graph/messages_annotation.d.ts +5 -5
  97. package/dist/graph/messages_annotation.d.ts.map +1 -1
  98. package/dist/graph/messages_annotation.js.map +1 -1
  99. package/dist/graph/state.cjs +23 -30
  100. package/dist/graph/state.cjs.map +1 -1
  101. package/dist/graph/state.d.cts +2 -9
  102. package/dist/graph/state.d.cts.map +1 -1
  103. package/dist/graph/state.d.ts +2 -9
  104. package/dist/graph/state.d.ts.map +1 -1
  105. package/dist/graph/state.js +6 -12
  106. package/dist/graph/state.js.map +1 -1
  107. package/dist/graph/zod/meta.cjs +8 -9
  108. package/dist/graph/zod/meta.cjs.map +1 -1
  109. package/dist/graph/zod/meta.d.cts +0 -1
  110. package/dist/graph/zod/meta.d.cts.map +1 -1
  111. package/dist/graph/zod/meta.d.ts +0 -1
  112. package/dist/graph/zod/meta.d.ts.map +1 -1
  113. package/dist/graph/zod/meta.js.map +1 -1
  114. package/dist/graph/zod/plugin.cjs +4 -6
  115. package/dist/graph/zod/plugin.cjs.map +1 -1
  116. package/dist/graph/zod/plugin.js +1 -2
  117. package/dist/graph/zod/plugin.js.map +1 -1
  118. package/dist/graph/zod/schema.cjs +2 -3
  119. package/dist/graph/zod/schema.cjs.map +1 -1
  120. package/dist/graph/zod/schema.d.cts.map +1 -1
  121. package/dist/graph/zod/schema.d.ts.map +1 -1
  122. package/dist/graph/zod/schema.js.map +1 -1
  123. package/dist/graph/zod/zod-registry.cjs +3 -4
  124. package/dist/graph/zod/zod-registry.cjs.map +1 -1
  125. package/dist/graph/zod/zod-registry.d.cts +0 -2
  126. package/dist/graph/zod/zod-registry.d.cts.map +1 -1
  127. package/dist/graph/zod/zod-registry.d.ts +0 -2
  128. package/dist/graph/zod/zod-registry.d.ts.map +1 -1
  129. package/dist/graph/zod/zod-registry.js.map +1 -1
  130. package/dist/hash.cjs +4 -10
  131. package/dist/hash.cjs.map +1 -1
  132. package/dist/hash.js +4 -10
  133. package/dist/hash.js.map +1 -1
  134. package/dist/index.cjs +8 -9
  135. package/dist/index.cjs.map +1 -1
  136. package/dist/index.js.map +1 -1
  137. package/dist/interrupt.cjs +4 -7
  138. package/dist/interrupt.cjs.map +1 -1
  139. package/dist/interrupt.d.cts +1 -4
  140. package/dist/interrupt.d.cts.map +1 -1
  141. package/dist/interrupt.d.ts +1 -4
  142. package/dist/interrupt.d.ts.map +1 -1
  143. package/dist/interrupt.js +2 -4
  144. package/dist/interrupt.js.map +1 -1
  145. package/dist/prebuilt/agentName.cjs +14 -19
  146. package/dist/prebuilt/agentName.cjs.map +1 -1
  147. package/dist/prebuilt/agentName.js +6 -10
  148. package/dist/prebuilt/agentName.js.map +1 -1
  149. package/dist/prebuilt/agent_executor.cjs +4 -7
  150. package/dist/prebuilt/agent_executor.cjs.map +1 -1
  151. package/dist/prebuilt/agent_executor.d.cts +5 -5
  152. package/dist/prebuilt/agent_executor.d.cts.map +1 -1
  153. package/dist/prebuilt/agent_executor.d.ts +5 -5
  154. package/dist/prebuilt/agent_executor.d.ts.map +1 -1
  155. package/dist/prebuilt/agent_executor.js +4 -7
  156. package/dist/prebuilt/agent_executor.js.map +1 -1
  157. package/dist/prebuilt/chat_agent_executor.cjs +11 -17
  158. package/dist/prebuilt/chat_agent_executor.cjs.map +1 -1
  159. package/dist/prebuilt/chat_agent_executor.d.cts.map +1 -1
  160. package/dist/prebuilt/chat_agent_executor.d.ts.map +1 -1
  161. package/dist/prebuilt/chat_agent_executor.js +7 -12
  162. package/dist/prebuilt/chat_agent_executor.js.map +1 -1
  163. package/dist/prebuilt/interrupt.d.cts +0 -1
  164. package/dist/prebuilt/interrupt.d.cts.map +1 -1
  165. package/dist/prebuilt/interrupt.d.ts +0 -1
  166. package/dist/prebuilt/interrupt.d.ts.map +1 -1
  167. package/dist/prebuilt/react_agent_executor.cjs +35 -40
  168. package/dist/prebuilt/react_agent_executor.cjs.map +1 -1
  169. package/dist/prebuilt/react_agent_executor.d.cts +8 -27
  170. package/dist/prebuilt/react_agent_executor.d.cts.map +1 -1
  171. package/dist/prebuilt/react_agent_executor.d.ts +8 -27
  172. package/dist/prebuilt/react_agent_executor.d.ts.map +1 -1
  173. package/dist/prebuilt/react_agent_executor.js +8 -12
  174. package/dist/prebuilt/react_agent_executor.js.map +1 -1
  175. package/dist/prebuilt/tool_executor.cjs +4 -9
  176. package/dist/prebuilt/tool_executor.cjs.map +1 -1
  177. package/dist/prebuilt/tool_executor.d.cts +0 -2
  178. package/dist/prebuilt/tool_executor.d.cts.map +1 -1
  179. package/dist/prebuilt/tool_executor.d.ts +0 -2
  180. package/dist/prebuilt/tool_executor.d.ts.map +1 -1
  181. package/dist/prebuilt/tool_executor.js +1 -5
  182. package/dist/prebuilt/tool_executor.js.map +1 -1
  183. package/dist/prebuilt/tool_node.cjs +7 -8
  184. package/dist/prebuilt/tool_node.cjs.map +1 -1
  185. package/dist/prebuilt/tool_node.d.cts +0 -2
  186. package/dist/prebuilt/tool_node.d.cts.map +1 -1
  187. package/dist/prebuilt/tool_node.d.ts +0 -2
  188. package/dist/prebuilt/tool_node.d.ts.map +1 -1
  189. package/dist/prebuilt/tool_node.js.map +1 -1
  190. package/dist/pregel/algo.cjs +33 -41
  191. package/dist/pregel/algo.cjs.map +1 -1
  192. package/dist/pregel/algo.d.cts.map +1 -1
  193. package/dist/pregel/algo.d.ts.map +1 -1
  194. package/dist/pregel/algo.js +22 -29
  195. package/dist/pregel/algo.js.map +1 -1
  196. package/dist/pregel/call.cjs +11 -14
  197. package/dist/pregel/call.cjs.map +1 -1
  198. package/dist/pregel/call.js +7 -9
  199. package/dist/pregel/call.js.map +1 -1
  200. package/dist/pregel/debug.cjs +6 -9
  201. package/dist/pregel/debug.cjs.map +1 -1
  202. package/dist/pregel/debug.js +6 -9
  203. package/dist/pregel/debug.js.map +1 -1
  204. package/dist/pregel/index.cjs +28 -35
  205. package/dist/pregel/index.cjs.map +1 -1
  206. package/dist/pregel/index.d.cts +6 -54
  207. package/dist/pregel/index.d.cts.map +1 -1
  208. package/dist/pregel/index.d.ts +6 -54
  209. package/dist/pregel/index.d.ts.map +1 -1
  210. package/dist/pregel/index.js +10 -16
  211. package/dist/pregel/index.js.map +1 -1
  212. package/dist/pregel/io.cjs.map +1 -1
  213. package/dist/pregel/io.js.map +1 -1
  214. package/dist/pregel/loop.cjs +9 -12
  215. package/dist/pregel/loop.cjs.map +1 -1
  216. package/dist/pregel/loop.js +2 -4
  217. package/dist/pregel/loop.js.map +1 -1
  218. package/dist/pregel/messages.cjs +13 -14
  219. package/dist/pregel/messages.cjs.map +1 -1
  220. package/dist/pregel/messages.js.map +1 -1
  221. package/dist/pregel/read.cjs +7 -8
  222. package/dist/pregel/read.cjs.map +1 -1
  223. package/dist/pregel/read.d.cts +0 -6
  224. package/dist/pregel/read.d.cts.map +1 -1
  225. package/dist/pregel/read.d.ts +0 -6
  226. package/dist/pregel/read.d.ts.map +1 -1
  227. package/dist/pregel/read.js +1 -1
  228. package/dist/pregel/read.js.map +1 -1
  229. package/dist/pregel/remote.cjs +24 -32
  230. package/dist/pregel/remote.cjs.map +1 -1
  231. package/dist/pregel/remote.d.cts +1 -6
  232. package/dist/pregel/remote.d.cts.map +1 -1
  233. package/dist/pregel/remote.d.ts +1 -6
  234. package/dist/pregel/remote.d.ts.map +1 -1
  235. package/dist/pregel/remote.js +12 -19
  236. package/dist/pregel/remote.js.map +1 -1
  237. package/dist/pregel/retry.cjs +1 -2
  238. package/dist/pregel/retry.cjs.map +1 -1
  239. package/dist/pregel/retry.js +1 -2
  240. package/dist/pregel/retry.js.map +1 -1
  241. package/dist/pregel/runnable_types.d.cts +2 -8
  242. package/dist/pregel/runnable_types.d.cts.map +1 -1
  243. package/dist/pregel/runnable_types.d.ts +2 -8
  244. package/dist/pregel/runnable_types.d.ts.map +1 -1
  245. package/dist/pregel/runner.cjs +1 -1
  246. package/dist/pregel/runner.cjs.map +1 -1
  247. package/dist/pregel/runner.js +1 -1
  248. package/dist/pregel/runner.js.map +1 -1
  249. package/dist/pregel/stream.cjs +4 -6
  250. package/dist/pregel/stream.cjs.map +1 -1
  251. package/dist/pregel/stream.js +1 -2
  252. package/dist/pregel/stream.js.map +1 -1
  253. package/dist/pregel/types.d.cts +5 -18
  254. package/dist/pregel/types.d.cts.map +1 -1
  255. package/dist/pregel/types.d.ts +5 -18
  256. package/dist/pregel/types.d.ts.map +1 -1
  257. package/dist/pregel/utils/config.cjs +6 -7
  258. package/dist/pregel/utils/config.cjs.map +1 -1
  259. package/dist/pregel/utils/config.d.cts.map +1 -1
  260. package/dist/pregel/utils/config.d.ts.map +1 -1
  261. package/dist/pregel/utils/config.js.map +1 -1
  262. package/dist/pregel/utils/index.cjs +1 -2
  263. package/dist/pregel/utils/index.cjs.map +1 -1
  264. package/dist/pregel/utils/index.d.cts +1 -1
  265. package/dist/pregel/utils/index.d.cts.map +1 -1
  266. package/dist/pregel/utils/index.d.ts +1 -1
  267. package/dist/pregel/utils/index.d.ts.map +1 -1
  268. package/dist/pregel/utils/index.js +1 -2
  269. package/dist/pregel/utils/index.js.map +1 -1
  270. package/dist/pregel/utils/subgraph.cjs +0 -1
  271. package/dist/pregel/utils/subgraph.cjs.map +1 -1
  272. package/dist/pregel/utils/subgraph.js +0 -1
  273. package/dist/pregel/utils/subgraph.js.map +1 -1
  274. package/dist/pregel/validate.cjs.map +1 -1
  275. package/dist/pregel/validate.js.map +1 -1
  276. package/dist/pregel/write.cjs +2 -3
  277. package/dist/pregel/write.cjs.map +1 -1
  278. package/dist/pregel/write.d.cts +1 -5
  279. package/dist/pregel/write.d.cts.map +1 -1
  280. package/dist/pregel/write.d.ts +1 -5
  281. package/dist/pregel/write.d.ts.map +1 -1
  282. package/dist/pregel/write.js.map +1 -1
  283. package/dist/setup/async_local_storage.cjs +3 -4
  284. package/dist/setup/async_local_storage.cjs.map +1 -1
  285. package/dist/setup/async_local_storage.js.map +1 -1
  286. package/dist/utils.cjs +9 -11
  287. package/dist/utils.cjs.map +1 -1
  288. package/dist/utils.d.cts +1 -8
  289. package/dist/utils.d.cts.map +1 -1
  290. package/dist/utils.d.ts +1 -8
  291. package/dist/utils.d.ts.map +1 -1
  292. package/dist/utils.js +1 -2
  293. package/dist/utils.js.map +1 -1
  294. package/dist/web.cjs +8 -9
  295. package/dist/writer.cjs +2 -3
  296. package/dist/writer.cjs.map +1 -1
  297. package/dist/writer.d.cts +1 -2
  298. package/dist/writer.d.cts.map +1 -1
  299. package/dist/writer.d.ts +1 -2
  300. package/dist/writer.d.ts.map +1 -1
  301. package/dist/writer.js.map +1 -1
  302. package/package.json +7 -7
  303. package/CHANGELOG.md +0 -286
  304. package/dist/_virtual/rolldown_runtime.cjs +0 -25
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","names":["Runnable","RunnableConfig","All","PendingWrite","CheckpointMetadata","BaseCheckpointSaver","BaseStore","CheckpointListOptions","BaseCache","Graph","DrawableGraph","IterableReadableStream","BaseMessage","BaseChannel","PregelNode","Interrupt","CachePolicy","RetryPolicy","LangGraphRunnableConfig","StreamMode","Durability","PregelInputType","PregelOutputType","StreamMessageOutput","Record","StreamDebugOutput","StreamCheckpointsOutput","StreamValues","PregelTaskDescription","StreamTasksOutputBase","StreamTasksCreateOutput","StreamTasksResultOutput","Keys","StreamUpdates","StreamTasksOutput","Nodes","DefaultStreamMode","IsEventStream","T","StreamOutputMap","TEncoding","Uint8Array","TStreamMode","TStreamSubgraphs","NodeReturnType","K","StreamCustom","Multiple","Single","PregelOptions","StrRecord","ContextType","Channels","Array","TSubgraphs","PregelInterface","Promise","Generator","AsyncGenerator","StateSnapshot","AsyncIterableIterator","Partial","PregelParams","TaskPath","CacheKey","PregelExecutableTask","PropertyKey","NodeKey","ChannelKey","MultipleChannelSubscriptionOptions","SingleChannelSubscriptionOptions","GetStateOptions","PregelScratchpad","Resume","PregelAbortSignals","AbortSignal","CallOptions","Call","func","name","input","retry","cache","callbacks","isCall","SimpleTaskPath","VariadicTaskPath","CallTaskPath"],"sources":["../../src/pregel/types.d.ts"],"sourcesContent":["import type { Runnable, RunnableConfig } from \"@langchain/core/runnables\";\nimport type { All, PendingWrite, CheckpointMetadata, BaseCheckpointSaver, BaseStore, CheckpointListOptions, BaseCache } 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 * 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 = \"values\" | \"updates\" | \"debug\" | \"messages\" | \"checkpoints\" | \"tasks\" | \"custom\";\nexport type Durability = \"exit\" | \"async\" | \"sync\";\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type PregelInputType = any;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type PregelOutputType = any;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype StreamMessageOutput = [BaseMessage, Record<string, any>];\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype StreamDebugOutput = Record<string, any>;\ntype StreamCheckpointsOutput<StreamValues> = {\n values: StreamValues;\n next: string[];\n config: RunnableConfig;\n metadata?: CheckpointMetadata;\n parentConfig?: RunnableConfig | undefined;\n tasks: PregelTaskDescription[];\n};\ninterface StreamTasksOutputBase {\n id: string;\n name: string;\n interrupts: Interrupt[];\n}\ninterface StreamTasksCreateOutput<StreamValues> extends StreamTasksOutputBase {\n input: StreamValues;\n triggers: string[];\n}\ninterface StreamTasksResultOutput<Keys, StreamUpdates> extends StreamTasksOutputBase {\n result: [Keys, StreamUpdates][];\n}\ntype StreamTasksOutput<StreamUpdates, StreamValues, Nodes = string> = StreamTasksCreateOutput<StreamValues> | StreamTasksResultOutput<Nodes, StreamUpdates>;\ntype DefaultStreamMode = \"updates\";\nexport type IsEventStream<T> = [T] extends [\"text/event-stream\"] ? [\"text/event-stream\"] extends [T] ? true : false : false;\nexport type StreamOutputMap<TStreamMode extends StreamMode | StreamMode[] | undefined, TStreamSubgraphs extends boolean, StreamUpdates, StreamValues, Nodes, NodeReturnType, StreamCustom, TEncoding extends \"text/event-stream\" | undefined> = IsEventStream<TEncoding> extends true ? Uint8Array : (undefined extends TStreamMode ? [] : StreamMode | StreamMode[] extends TStreamMode ? TStreamMode extends StreamMode[] ? TStreamMode[number] : TStreamMode : TStreamMode extends StreamMode[] ? TStreamMode[number] : []) extends infer Multiple extends StreamMode ? [TStreamSubgraphs] extends [true] ? {\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 debug: [string[], \"debug\", StreamDebugOutput];\n}[Multiple] : {\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 debug: [\"debug\", StreamDebugOutput];\n}[Multiple] : (undefined extends TStreamMode ? DefaultStreamMode : TStreamMode) extends infer Single extends StreamMode ? [TStreamSubgraphs] extends [true] ? {\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 debug: [string[], StreamDebugOutput];\n}[Single] : {\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 debug: StreamDebugOutput;\n}[Single] : never;\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<Nodes extends StrRecord<string, PregelNode>, Channels extends StrRecord<string, BaseChannel>, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nContextType extends Record<string, any> = Record<string, any>, TStreamMode extends StreamMode | StreamMode[] | undefined = StreamMode | StreamMode[] | undefined, TSubgraphs extends boolean = boolean, TEncoding extends \"text/event-stream\" | undefined = \"text/event-stream\" | undefined> 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 * 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 * 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 * 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 * 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 * 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 * 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 * 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 * 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 * 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 * Optional cache for the graph, useful for caching tasks.\n */\n cache?: BaseCache;\n /**\n * Static context for the graph run, like `userId`, `dbConnection` etc.\n */\n context?: ContextType;\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 * 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};\nexport interface PregelInterface<Nodes extends StrRecord<string, PregelNode>, Channels extends StrRecord<string, BaseChannel>, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nContextType extends Record<string, any> = StrRecord<string, any>> {\n lg_is_pregel: boolean;\n withConfig(config: RunnableConfig): PregelInterface<Nodes, Channels>;\n getGraphAsync(config: RunnableConfig & {\n xray?: boolean | number;\n }): Promise<DrawableGraph>;\n /** @deprecated Use getSubgraphsAsync instead. The async method will become the default in the next minor release. */\n getSubgraphs(namespace?: string, recurse?: boolean\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): Generator<[string, PregelInterface<any, any>]>;\n getSubgraphsAsync(namespace?: string, recurse?: boolean\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): AsyncGenerator<[string, PregelInterface<any, any>]>;\n getState(config: RunnableConfig, options?: {\n subgraphs?: boolean;\n }): Promise<StateSnapshot>;\n getStateHistory(config: RunnableConfig, options?: CheckpointListOptions): AsyncIterableIterator<StateSnapshot>;\n updateState(inputConfig: LangGraphRunnableConfig, values: Record<string, unknown> | unknown, asNode?: keyof Nodes | string): Promise<RunnableConfig>;\n stream(input: PregelInputType, options?: Partial<PregelOptions<Nodes, Channels, ContextType>>): Promise<IterableReadableStream<PregelOutputType>>;\n invoke(input: PregelInputType, options?: Partial<PregelOptions<Nodes, Channels, ContextType>>): Promise<PregelOutputType>;\n}\n/**\n * Parameters for creating a Pregel graph.\n * @internal\n */\nexport type PregelParams<Nodes extends StrRecord<string, PregelNode>, Channels extends StrRecord<string, BaseChannel>> = {\n /**\n * The name of the graph. @see {@link Runnable.name}\n */\n name?: string;\n /**\n * The nodes in the graph.\n */\n nodes: Nodes;\n /**\n * The channels in the graph.\n */\n channels: Channels;\n /**\n * Whether to validate the graph.\n *\n * @default true\n */\n autoValidate?: boolean;\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 * The input channels for the graph run.\n */\n inputChannels: keyof Channels | Array<keyof Channels>;\n /**\n * The output channels for the graph run.\n */\n outputChannels: keyof Channels | Array<keyof Channels>;\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 * 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 * The channels to stream from the graph run.\n * @default []\n */\n streamChannels?: keyof Channels | Array<keyof Channels>;\n /**\n * @default undefined\n */\n stepTimeout?: number;\n /**\n * @default false\n */\n debug?: boolean;\n /**\n * The {@link BaseCheckpointSaver | checkpointer} to use for the graph run.\n */\n checkpointer?: BaseCheckpointSaver | boolean;\n /**\n * The default retry policy for this graph. For defaults, see {@link RetryPolicy}.\n */\n retryPolicy?: RetryPolicy;\n /**\n * The configuration for the graph run.\n */\n config?: LangGraphRunnableConfig;\n /**\n * External key-value store.\n */\n store?: BaseStore;\n /**\n * Storage used for node caching.\n */\n cache?: BaseCache;\n /**\n * The trigger to node mapping for the graph run.\n * @internal\n */\n triggerToNodes?: Record<string, string[]>;\n /**\n * Interrupt helper function.\n * @internal\n */\n userInterrupt?: unknown;\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}\ninterface CacheKey {\n ns: string[];\n key: string;\n ttl?: number;\n}\nexport interface PregelExecutableTask<NodeKey extends PropertyKey, ChannelKey extends PropertyKey> {\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}\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 * 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 * 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 * 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 * 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 consumeNullResume: () => Resume | undefined;\n /** Counter for tracking subgraph invocations */\n subgraphCounter: number;\n /** The input to the currently executing task */\n currentTaskInput: unknown;\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 * Aborts when the currently executing task throws any error other than a {@link GraphBubbleUp}\n */\n timeoutAbortSignal?: AbortSignal;\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};\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};\nexport declare class Call {\n func: (...args: unknown[]) => unknown | Promise<unknown>;\n name: string;\n input: unknown;\n retry?: RetryPolicy;\n cache?: CachePolicy;\n callbacks?: unknown;\n readonly __lg_type: string;\n constructor({ func, name, input, retry, cache, callbacks }: CallOptions);\n}\nexport declare function isCall(value: unknown): value is Call;\nexport type SimpleTaskPath = [string, string | number];\nexport type VariadicTaskPath = [string, ...(string | number)[], boolean];\nexport type CallTaskPath = [string, ...(string | number)[], Call] | [string, TaskPath, ...(string | number)[], Call];\nexport type TaskPath = SimpleTaskPath | CallTaskPath | VariadicTaskPath;\nexport {};\n"],"mappings":";;;;;;;;;;;;;;;AAaA;AACYoB,KADAD,UAAAA,GACU,QAAA,GAAA,SAAA,GAAA,OAAA,GAAA,UAAA,GAAA,aAAA,GAAA,OAAA,GAAA,QAAA;AAEVE,KAFAD,UAAAA,GAEe,MAAA,GAAA,OAAA,GAAA,MAAA;AAE3B;AAEKG,KAJOF,eAAAA,GAIY,GAAA;;AAAIT,KAFhBU,gBAAAA,GAEgBV,GAAAA;;KAAvBW,mBAAAA,IAAuBX,aAAaY;AAAM;AAEhB,KAA1BC,iBAAAA,GAAoBD,MACG,CAAA,MAAA,EAAA,GAAA,CAAA;KAAvBE,uBAAuB,CAAA,YAAA,CAAA,GAAA;QAChBC,EAAAA,YAAAA;MAEA1B,EAAAA,MAAAA,EAAAA;QACGG,EADHH,cACGG;UACIH,CAAAA,EADJG,kBACIH;cACR2B,CAAAA,EADQ3B,cACR2B,GAAAA,SAAAA;SAAAA;AAAqB,CAAA;AAKP,UA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AAAA;;;;;mBApMT3B,YAAYlB,SAASjC;EAuM9BmF;AACZ;AACA;;iBAA4DR,CAAAA,EApMtCxB,KAoMsCwB,CAAAA,MApM1B1C,KAoM0B0C,CAAAA,GApMjB3E,GAoMiB2E;;;;AAC5D;EAAoB,cAAA,CAAA,EAAA,MAhMOzB,QAgMP,GAhMkBC,KAgMlB,CAAA,MAhM8BD,QAgM9B,CAAA;;;;;;;;;;;;iBApLD/C;;;;gBAIDY;;;;WAILC;;;;UAIDZ;;;;UAIAE;;;;;mBAKSgB;;;;;;;UAOJI,qBAAAA;;;;uBAIQb;mBACJG,0BAA0ByC;kBAC3BI;;;UAuBHJ,aAAAA;;;;;mBAKInC;;;;iBAIF6B;;;;mBAIEpD;;;;sBAIGG;;;;;;;;;0BASIH;;;;kBAIR2B;;;;;KAKRyC,kCAAAA;;;;;;;;;KASAC,gCAAAA;;;;;;;;;;;;;;;KAeAC,eAAAA;;;;;;;;;;;;;KA0CAK,WAAAA;0CACgCpB;;;UAGhCxC;UACAC;;;cAGS4D,IAAAA;0CACuBrB;;;UAGhCvC;UACAD;;;;;;;;;;KAGoD4D;;KAGpDS,cAAAA;KACAC,gBAAAA;KACAC,YAAAA,oCAAgDV,iBAAiBd,kCAAkCc;KACnGd,QAAAA,GAAWsB,iBAAiBE,eAAeD"}
1
+ {"version":3,"file":"types.d.ts","names":["Runnable","RunnableConfig","All","PendingWrite","CheckpointMetadata","BaseCheckpointSaver","BaseStore","CheckpointListOptions","BaseCache","Graph","DrawableGraph","IterableReadableStream","BaseMessage","BaseChannel","PregelNode","Interrupt","CachePolicy","RetryPolicy","LangGraphRunnableConfig","StreamMode","Durability","PregelInputType","PregelOutputType","StreamMessageOutput","Record","StreamDebugOutput","StreamCheckpointsOutput","StreamValues","PregelTaskDescription","StreamTasksOutputBase","StreamTasksCreateOutput","StreamTasksResultOutput","Keys","StreamUpdates","StreamTasksOutput","Nodes","DefaultStreamMode","IsEventStream","T","StreamOutputMap","TEncoding","Uint8Array","TStreamMode","TStreamSubgraphs","NodeReturnType","K","StreamCustom","Multiple","Single","PregelOptions","StrRecord","ContextType","Channels","Array","TSubgraphs","PregelInterface","Promise","Generator","AsyncGenerator","StateSnapshot","AsyncIterableIterator","Partial","PregelParams","TaskPath","CacheKey","PregelExecutableTask","PropertyKey","NodeKey","ChannelKey","MultipleChannelSubscriptionOptions","SingleChannelSubscriptionOptions","GetStateOptions","PregelScratchpad","Resume","PregelAbortSignals","AbortSignal","CallOptions","Call","func","name","input","retry","cache","callbacks","isCall","SimpleTaskPath","VariadicTaskPath","CallTaskPath"],"sources":["../../src/pregel/types.d.ts"],"sourcesContent":["import type { Runnable, RunnableConfig } from \"@langchain/core/runnables\";\nimport type { All, PendingWrite, CheckpointMetadata, BaseCheckpointSaver, BaseStore, CheckpointListOptions, BaseCache } 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 * 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 = \"values\" | \"updates\" | \"debug\" | \"messages\" | \"checkpoints\" | \"tasks\" | \"custom\";\nexport type Durability = \"exit\" | \"async\" | \"sync\";\nexport type PregelInputType = any;\nexport type PregelOutputType = any;\ntype StreamMessageOutput = [BaseMessage, Record<string, any>];\ntype StreamDebugOutput = Record<string, any>;\ntype StreamCheckpointsOutput<StreamValues> = {\n values: StreamValues;\n next: string[];\n config: RunnableConfig;\n metadata?: CheckpointMetadata;\n parentConfig?: RunnableConfig | undefined;\n tasks: PregelTaskDescription[];\n};\ninterface StreamTasksOutputBase {\n id: string;\n name: string;\n interrupts: Interrupt[];\n}\ninterface StreamTasksCreateOutput<StreamValues> extends StreamTasksOutputBase {\n input: StreamValues;\n triggers: string[];\n}\ninterface StreamTasksResultOutput<Keys, StreamUpdates> extends StreamTasksOutputBase {\n result: [Keys, StreamUpdates][];\n}\ntype StreamTasksOutput<StreamUpdates, StreamValues, Nodes = string> = StreamTasksCreateOutput<StreamValues> | StreamTasksResultOutput<Nodes, StreamUpdates>;\ntype DefaultStreamMode = \"updates\";\nexport type IsEventStream<T> = [T] extends [\"text/event-stream\"] ? [\"text/event-stream\"] extends [T] ? true : false : false;\nexport type StreamOutputMap<TStreamMode extends StreamMode | StreamMode[] | undefined, TStreamSubgraphs extends boolean, StreamUpdates, StreamValues, Nodes, NodeReturnType, StreamCustom, TEncoding extends \"text/event-stream\" | undefined> = IsEventStream<TEncoding> extends true ? Uint8Array : (undefined extends TStreamMode ? [] : StreamMode | StreamMode[] extends TStreamMode ? TStreamMode extends StreamMode[] ? TStreamMode[number] : TStreamMode : TStreamMode extends StreamMode[] ? TStreamMode[number] : []) extends infer Multiple extends StreamMode ? [TStreamSubgraphs] extends [true] ? {\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 debug: [string[], \"debug\", StreamDebugOutput];\n}[Multiple] : {\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 debug: [\"debug\", StreamDebugOutput];\n}[Multiple] : (undefined extends TStreamMode ? DefaultStreamMode : TStreamMode) extends infer Single extends StreamMode ? [TStreamSubgraphs] extends [true] ? {\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 debug: [string[], StreamDebugOutput];\n}[Single] : {\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 debug: StreamDebugOutput;\n}[Single] : never;\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<Nodes extends StrRecord<string, PregelNode>, Channels extends StrRecord<string, BaseChannel>, ContextType extends Record<string, any> = Record<string, any>, TStreamMode extends StreamMode | StreamMode[] | undefined = StreamMode | StreamMode[] | undefined, TSubgraphs extends boolean = boolean, TEncoding extends \"text/event-stream\" | undefined = \"text/event-stream\" | undefined> 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 * 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 * 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 * 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 * 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 * 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 * 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 * 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 * 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 * 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 * Optional cache for the graph, useful for caching tasks.\n */\n cache?: BaseCache;\n /**\n * Static context for the graph run, like `userId`, `dbConnection` etc.\n */\n context?: ContextType;\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 * 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};\nexport interface PregelInterface<Nodes extends StrRecord<string, PregelNode>, Channels extends StrRecord<string, BaseChannel>, ContextType extends Record<string, any> = StrRecord<string, any>> {\n lg_is_pregel: boolean;\n withConfig(config: RunnableConfig): PregelInterface<Nodes, Channels>;\n getGraphAsync(config: RunnableConfig & {\n xray?: boolean | number;\n }): Promise<DrawableGraph>;\n /** @deprecated Use getSubgraphsAsync instead. The async method will become the default in the next minor release. */\n getSubgraphs(namespace?: string, recurse?: boolean): Generator<[string, PregelInterface<any, any>]>;\n getSubgraphsAsync(namespace?: string, recurse?: boolean): AsyncGenerator<[string, PregelInterface<any, any>]>;\n getState(config: RunnableConfig, options?: {\n subgraphs?: boolean;\n }): Promise<StateSnapshot>;\n getStateHistory(config: RunnableConfig, options?: CheckpointListOptions): AsyncIterableIterator<StateSnapshot>;\n updateState(inputConfig: LangGraphRunnableConfig, values: Record<string, unknown> | unknown, asNode?: keyof Nodes | string): Promise<RunnableConfig>;\n stream(input: PregelInputType, options?: Partial<PregelOptions<Nodes, Channels, ContextType>>): Promise<IterableReadableStream<PregelOutputType>>;\n invoke(input: PregelInputType, options?: Partial<PregelOptions<Nodes, Channels, ContextType>>): Promise<PregelOutputType>;\n}\n/**\n * Parameters for creating a Pregel graph.\n * @internal\n */\nexport type PregelParams<Nodes extends StrRecord<string, PregelNode>, Channels extends StrRecord<string, BaseChannel>> = {\n /**\n * The name of the graph. @see {@link Runnable.name}\n */\n name?: string;\n /**\n * The nodes in the graph.\n */\n nodes: Nodes;\n /**\n * The channels in the graph.\n */\n channels: Channels;\n /**\n * Whether to validate the graph.\n *\n * @default true\n */\n autoValidate?: boolean;\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 * The input channels for the graph run.\n */\n inputChannels: keyof Channels | Array<keyof Channels>;\n /**\n * The output channels for the graph run.\n */\n outputChannels: keyof Channels | Array<keyof Channels>;\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 * 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 * The channels to stream from the graph run.\n * @default []\n */\n streamChannels?: keyof Channels | Array<keyof Channels>;\n /**\n * @default undefined\n */\n stepTimeout?: number;\n /**\n * @default false\n */\n debug?: boolean;\n /**\n * The {@link BaseCheckpointSaver | checkpointer} to use for the graph run.\n */\n checkpointer?: BaseCheckpointSaver | boolean;\n /**\n * The default retry policy for this graph. For defaults, see {@link RetryPolicy}.\n */\n retryPolicy?: RetryPolicy;\n /**\n * The configuration for the graph run.\n */\n config?: LangGraphRunnableConfig;\n /**\n * External key-value store.\n */\n store?: BaseStore;\n /**\n * Storage used for node caching.\n */\n cache?: BaseCache;\n /**\n * The trigger to node mapping for the graph run.\n * @internal\n */\n triggerToNodes?: Record<string, string[]>;\n /**\n * Interrupt helper function.\n * @internal\n */\n userInterrupt?: unknown;\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}\ninterface CacheKey {\n ns: string[];\n key: string;\n ttl?: number;\n}\nexport interface PregelExecutableTask<NodeKey extends PropertyKey, ChannelKey extends PropertyKey> {\n readonly name: NodeKey;\n readonly input: unknown;\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}\nexport interface StateSnapshot {\n /**\n * Current values of channels\n */\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 * 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 * 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 * 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 * 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 consumeNullResume: () => Resume | undefined;\n /** Counter for tracking subgraph invocations */\n subgraphCounter: number;\n /** The input to the currently executing task */\n currentTaskInput: unknown;\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 * Aborts when the currently executing task throws any error other than a {@link GraphBubbleUp}\n */\n timeoutAbortSignal?: AbortSignal;\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};\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};\nexport declare class Call {\n func: (...args: unknown[]) => unknown | Promise<unknown>;\n name: string;\n input: unknown;\n retry?: RetryPolicy;\n cache?: CachePolicy;\n callbacks?: unknown;\n readonly __lg_type = \"call\";\n constructor({ func, name, input, retry, cache, callbacks }: CallOptions);\n}\nexport declare function isCall(value: unknown): value is Call;\nexport type SimpleTaskPath = [string, string | number];\nexport type VariadicTaskPath = [string, ...(string | number)[], boolean];\nexport type CallTaskPath = [string, ...(string | number)[], Call] | [string, TaskPath, ...(string | number)[], Call];\nexport type TaskPath = SimpleTaskPath | CallTaskPath | VariadicTaskPath;\nexport {};\n"],"mappings":";;;;;;;;;;;;;;;AAaA;AACYoB,KADAD,UAAAA,GACU,QAAA,GAAA,SAAA,GAAA,OAAA,GAAA,UAAA,GAAA,aAAA,GAAA,OAAA,GAAA,QAAA;AACVE,KADAD,UAAAA,GACe,MAAA,GAAA,OAAA,GAAA,MAAA;AACfE,KADAD,eAAAA,GACgB,GAAA;AACvBE,KADOD,gBAAAA,GACY,GAAA;KAAnBC,mBAAAA,GAAmB,CAAIX,WAAJ,EAAiBY,MAAjB,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA;KACnBC,iBAAAA,GAAoBD,MADGZ,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA;KAEvBc,uBAFoCF,CAAAA,YAAAA,CAAAA,GAAAA;EAAM,MAAA,EAGnCG,YAHmC;EAC1CF,IAAAA,EAAAA,MAAAA,EAAAA;EACAC,MAAAA,EAGOzB,cAHPyB;EAAuB,QAAA,CAAA,EAIbtB,kBAJa;cAChBuB,CAAAA,EAIO1B,cAJP0B,GAAAA,SAAAA;OAEA1B,EAGD2B,qBAHC3B,EAAAA;;UAKF4B,qBAAAA,CAHS5B;MACR2B,MAAAA;EAAqB,IAAA,EAAA,MAAA;EAEtBC,UAAAA,EAGMd,SAHNc,EAAAA;AAGe;UAEfC,uBAAuB,CAAA,YAAA,CAAA,SAAuBD,qBAAvB,CAAA;OACtBF,EAAAA,YAAAA;UAD6CE,EAAAA,MAAAA,EAAAA;;AAAqB,UAInEE,uBAAuB,CAAA,IAAA,EAAA,aAAA,CAAA,SAA8BF,qBAA9B,CAAA;EAAA,MAAA,EAAA,CACpBG,IADoB,EACdC,aADc,CAAA,EAAA;;KAG5BC,iBAFcD,CAAAA,aAAAA,EAAAA,YAAAA,EAAAA,QAAAA,MAAAA,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AAAA,OAAAA;;;AAC7E;EAAoB,YAAA,CAAA,EAlLD1D,mBAkLC,GAAA,OAAA;;;;EAAmD,WAAA,CAAA,EA9KrDY,WA8KqD;;;;WA1K1DC;;;;UAIDZ;;;;UAIAE;;;;;mBAKSgB;;;;;;;UAOJI,qBAAAA;;;;uBAIQb;mBACJG,0BAA0ByC;kBAC3BI;;;UAsBHJ,aAAAA;;;;mBAIInC;;;;iBAIF6B;;;;mBAIEpD;;;;sBAIGG;;;;;;;;;0BASIH;;;;kBAIR2B;;;;;KAKRyC,kCAAAA;;;;;;;;;KASAC,gCAAAA;;;;;;;;;;;;;;;KAeAC,eAAAA;;;;;;;;;;;;;KA0CAK,WAAAA;0CACgCpB;;;UAGhCxC;UACAC;;;cAGS4D,IAAAA;0CACuBrB;;;UAGhCvC;UACAD;;;;;;;;;;KAGoD4D;;KAGpDS,cAAAA;KACAC,gBAAAA;KACAC,YAAAA,oCAAgDV,iBAAiBd,kCAAkCc;KACnGd,QAAAA,GAAWsB,iBAAiBE,eAAeD"}
@@ -1,6 +1,5 @@
1
- const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
1
  const require_constants = require('../../constants.cjs');
3
- const __langchain_core_singletons = require_rolldown_runtime.__toESM(require("@langchain/core/singletons"));
2
+ let _langchain_core_singletons = require("@langchain/core/singletons");
4
3
 
5
4
  //#region src/pregel/utils/config.ts
6
5
  const COPIABLE_KEYS = [
@@ -39,7 +38,7 @@ function ensureLangGraphConfig(...configs) {
39
38
  recursionLimit: DEFAULT_RECURSION_LIMIT,
40
39
  configurable: {}
41
40
  };
42
- const implicitConfig = __langchain_core_singletons.AsyncLocalStorageProviderSingleton.getRunnableConfig();
41
+ const implicitConfig = _langchain_core_singletons.AsyncLocalStorageProviderSingleton.getRunnableConfig();
43
42
  if (implicitConfig !== void 0) {
44
43
  for (const [k, v] of Object.entries(implicitConfig)) if (v !== void 0) if (COPIABLE_KEYS.includes(k)) {
45
44
  let copiedValue;
@@ -66,7 +65,7 @@ function ensureLangGraphConfig(...configs) {
66
65
  * @returns a reference to the {@link BaseStore} that was set when the graph was initialized
67
66
  */
68
67
  function getStore(config) {
69
- const runConfig = config ?? __langchain_core_singletons.AsyncLocalStorageProviderSingleton.getRunnableConfig();
68
+ const runConfig = config ?? _langchain_core_singletons.AsyncLocalStorageProviderSingleton.getRunnableConfig();
70
69
  if (runConfig === void 0) throw new Error(["Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.", "If you're running `getStore` in such environment, pass the `config` from the node function directly."].join("\n"));
71
70
  return runConfig?.store;
72
71
  }
@@ -76,7 +75,7 @@ function getStore(config) {
76
75
  * @returns a reference to the {@link LangGraphRunnableConfig#writer} if "custom" stream mode is enabled, otherwise undefined
77
76
  */
78
77
  function getWriter(config) {
79
- const runConfig = config ?? __langchain_core_singletons.AsyncLocalStorageProviderSingleton.getRunnableConfig();
78
+ const runConfig = config ?? _langchain_core_singletons.AsyncLocalStorageProviderSingleton.getRunnableConfig();
80
79
  if (runConfig === void 0) throw new Error(["Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.", "If you're running `getWriter` in such environment, pass the `config` from the node function directly."].join("\n"));
81
80
  return runConfig?.writer || runConfig?.configurable?.writer;
82
81
  }
@@ -89,7 +88,7 @@ function getWriter(config) {
89
88
  * @returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized
90
89
  */
91
90
  function getConfig() {
92
- return __langchain_core_singletons.AsyncLocalStorageProviderSingleton.getRunnableConfig();
91
+ return _langchain_core_singletons.AsyncLocalStorageProviderSingleton.getRunnableConfig();
93
92
  }
94
93
  /**
95
94
  * A helper utility function that returns the input for the currently executing task
@@ -97,7 +96,7 @@ function getConfig() {
97
96
  * @returns the input for the currently executing task
98
97
  */
99
98
  function getCurrentTaskInput(config) {
100
- const runConfig = config ?? __langchain_core_singletons.AsyncLocalStorageProviderSingleton.getRunnableConfig();
99
+ const runConfig = config ?? _langchain_core_singletons.AsyncLocalStorageProviderSingleton.getRunnableConfig();
101
100
  if (runConfig === void 0) throw new Error(["Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.", "If you're running `getCurrentTaskInput` in such environment, pass the `config` from the node function directly."].join("\n"));
102
101
  if (runConfig.configurable?.[require_constants.CONFIG_KEY_SCRATCHPAD]?.currentTaskInput === void 0) throw new Error("BUG: internal scratchpad not initialized.");
103
102
  return runConfig.configurable[require_constants.CONFIG_KEY_SCRATCHPAD].currentTaskInput;
@@ -1 +1 @@
1
- {"version":3,"file":"config.cjs","names":["empty: LangGraphRunnableConfig","implicitConfig: RunnableConfig","AsyncLocalStorageProviderSingleton","runConfig: LangGraphRunnableConfig","CONFIG_KEY_SCRATCHPAD","CHECKPOINT_NAMESPACE_SEPARATOR","CHECKPOINT_NAMESPACE_END"],"sources":["../../../src/pregel/utils/config.ts"],"sourcesContent":["import { RunnableConfig } from \"@langchain/core/runnables\";\nimport { AsyncLocalStorageProviderSingleton } from \"@langchain/core/singletons\";\nimport { BaseStore } from \"@langchain/langgraph-checkpoint\";\nimport { LangGraphRunnableConfig } from \"../runnable_types.js\";\nimport {\n CHECKPOINT_NAMESPACE_END,\n CHECKPOINT_NAMESPACE_SEPARATOR,\n CONFIG_KEY_SCRATCHPAD,\n} from \"../../constants.js\";\n\nconst COPIABLE_KEYS = [\"tags\", \"metadata\", \"callbacks\", \"configurable\"];\n\nconst CONFIG_KEYS = [\n \"tags\",\n \"metadata\",\n \"callbacks\",\n \"runName\",\n \"maxConcurrency\",\n \"recursionLimit\",\n \"configurable\",\n \"runId\",\n \"outputKeys\",\n \"streamMode\",\n \"store\",\n \"writer\",\n \"interrupt\",\n \"context\",\n \"interruptBefore\",\n \"interruptAfter\",\n \"checkpointDuring\",\n \"durability\",\n \"signal\",\n];\n\nconst DEFAULT_RECURSION_LIMIT = 25;\n\nexport function ensureLangGraphConfig(\n ...configs: (LangGraphRunnableConfig | undefined)[]\n): RunnableConfig {\n const empty: LangGraphRunnableConfig = {\n tags: [],\n metadata: {},\n callbacks: undefined,\n recursionLimit: DEFAULT_RECURSION_LIMIT,\n configurable: {},\n };\n\n const implicitConfig: RunnableConfig =\n AsyncLocalStorageProviderSingleton.getRunnableConfig();\n if (implicitConfig !== undefined) {\n for (const [k, v] of Object.entries(implicitConfig)) {\n if (v !== undefined) {\n if (COPIABLE_KEYS.includes(k)) {\n let copiedValue;\n if (Array.isArray(v)) {\n copiedValue = [...v];\n } else if (typeof v === \"object\") {\n if (\n k === \"callbacks\" &&\n \"copy\" in v &&\n typeof v.copy === \"function\"\n ) {\n copiedValue = v.copy();\n } else {\n copiedValue = { ...v };\n }\n } else {\n copiedValue = v;\n }\n empty[k as keyof RunnableConfig] = copiedValue;\n } else {\n empty[k as keyof RunnableConfig] = v;\n }\n }\n }\n }\n\n for (const config of configs) {\n if (config === undefined) {\n continue;\n }\n\n for (const [k, v] of Object.entries(config)) {\n if (v !== undefined && CONFIG_KEYS.includes(k)) {\n empty[k as keyof LangGraphRunnableConfig] = v;\n }\n }\n }\n\n for (const [key, value] of Object.entries(empty.configurable!)) {\n empty.metadata = empty.metadata ?? {};\n if (\n !key.startsWith(\"__\") &&\n (typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\") &&\n !(key in empty.metadata!)\n ) {\n empty.metadata[key] = value;\n }\n }\n\n return empty;\n}\n\n/**\n * A helper utility function that returns the {@link BaseStore} that was set when the graph was initialized\n *\n * @returns a reference to the {@link BaseStore} that was set when the graph was initialized\n */\nexport function getStore(\n config?: LangGraphRunnableConfig\n): BaseStore | undefined {\n const runConfig: LangGraphRunnableConfig =\n config ?? AsyncLocalStorageProviderSingleton.getRunnableConfig();\n\n if (runConfig === undefined) {\n throw new Error(\n [\n \"Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.\",\n \"If you're running `getStore` in such environment, pass the `config` from the node function directly.\",\n ].join(\"\\n\")\n );\n }\n\n return runConfig?.store;\n}\n\n/**\n * A helper utility function that returns the {@link LangGraphRunnableConfig#writer} if \"custom\" stream mode is enabled, otherwise undefined.\n *\n * @returns a reference to the {@link LangGraphRunnableConfig#writer} if \"custom\" stream mode is enabled, otherwise undefined\n */\nexport function getWriter(\n config?: LangGraphRunnableConfig\n): ((chunk: unknown) => void) | undefined {\n const runConfig: LangGraphRunnableConfig =\n config ?? AsyncLocalStorageProviderSingleton.getRunnableConfig();\n\n if (runConfig === undefined) {\n throw new Error(\n [\n \"Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.\",\n \"If you're running `getWriter` in such environment, pass the `config` from the node function directly.\",\n ].join(\"\\n\")\n );\n }\n\n return runConfig?.writer || runConfig?.configurable?.writer;\n}\n\n/**\n * A helper utility function that returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized.\n *\n * Note: This only works when running in an environment that supports node:async_hooks and AsyncLocalStorage. If you're running this in a\n * web environment, access the LangGraphRunnableConfig from the node function directly.\n *\n * @returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized\n */\nexport function getConfig(): LangGraphRunnableConfig {\n return AsyncLocalStorageProviderSingleton.getRunnableConfig();\n}\n\n/**\n * A helper utility function that returns the input for the currently executing task\n *\n * @returns the input for the currently executing task\n */\nexport function getCurrentTaskInput<T = unknown>(\n config?: LangGraphRunnableConfig\n): T {\n const runConfig: LangGraphRunnableConfig =\n config ?? AsyncLocalStorageProviderSingleton.getRunnableConfig();\n\n if (runConfig === undefined) {\n throw new Error(\n [\n \"Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.\",\n \"If you're running `getCurrentTaskInput` in such environment, pass the `config` from the node function directly.\",\n ].join(\"\\n\")\n );\n }\n\n if (\n runConfig.configurable?.[CONFIG_KEY_SCRATCHPAD]?.currentTaskInput ===\n undefined\n ) {\n throw new Error(\"BUG: internal scratchpad not initialized.\");\n }\n\n return runConfig!.configurable![CONFIG_KEY_SCRATCHPAD]!.currentTaskInput as T;\n}\n\nexport function recastCheckpointNamespace(namespace: string): string {\n return namespace\n .split(CHECKPOINT_NAMESPACE_SEPARATOR)\n .filter((part) => !part.match(/^\\d+$/))\n .map((part) => part.split(CHECKPOINT_NAMESPACE_END)[0])\n .join(CHECKPOINT_NAMESPACE_SEPARATOR);\n}\n\nexport function getParentCheckpointNamespace(namespace: string): string {\n const parts = namespace.split(CHECKPOINT_NAMESPACE_SEPARATOR);\n while (parts.length > 1 && parts[parts.length - 1].match(/^\\d+$/)) {\n parts.pop();\n }\n return parts.slice(0, -1).join(CHECKPOINT_NAMESPACE_SEPARATOR);\n}\n"],"mappings":";;;;;AAUA,MAAM,gBAAgB;CAAC;CAAQ;CAAY;CAAa;;AAExD,MAAM,cAAc;CAClB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;AAGF,MAAM,0BAA0B;AAEhC,SAAgB,sBACd,GAAG,SACa;CAChB,MAAMA,QAAiC;EACrC,MAAM;EACN,UAAU;EACV,WAAW;EACX,gBAAgB;EAChB,cAAc;;CAGhB,MAAMC,iBACJC,+DAAmC;AACrC,KAAI,mBAAmB,QACrB;OAAK,MAAM,CAAC,GAAG,MAAM,OAAO,QAAQ,gBAClC,KAAI,MAAM,OACR,KAAI,cAAc,SAAS,IAAI;GAC7B,IAAI;AACJ,OAAI,MAAM,QAAQ,GAChB,eAAc,CAAC,GAAG;YACT,OAAO,MAAM,SACtB,KACE,MAAM,eACN,UAAU,KACV,OAAO,EAAE,SAAS,WAElB,eAAc,EAAE;OAEhB,eAAc,EAAE,GAAG;OAGrB,eAAc;AAEhB,SAAM,KAA6B;QAEnC,OAAM,KAA6B;;AAM3C,MAAK,MAAM,UAAU,SAAS;AAC5B,MAAI,WAAW,OACb;AAGF,OAAK,MAAM,CAAC,GAAG,MAAM,OAAO,QAAQ,QAClC,KAAI,MAAM,UAAa,YAAY,SAAS,GAC1C,OAAM,KAAsC;;AAKlD,MAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,eAAgB;AAC9D,QAAM,WAAW,MAAM,YAAY;AACnC,MACE,CAAC,IAAI,WAAW,UACf,OAAO,UAAU,YAChB,OAAO,UAAU,YACjB,OAAO,UAAU,cACnB,EAAE,OAAO,MAAM,UAEf,OAAM,SAAS,OAAO;;AAI1B,QAAO;;;;;;;AAQT,SAAgB,SACd,QACuB;CACvB,MAAMC,YACJ,UAAUD,+DAAmC;AAE/C,KAAI,cAAc,OAChB,OAAM,IAAI,MACR,CACE,2HACA,wGACA,KAAK;AAIX,QAAO,WAAW;;;;;;;AAQpB,SAAgB,UACd,QACwC;CACxC,MAAMC,YACJ,UAAUD,+DAAmC;AAE/C,KAAI,cAAc,OAChB,OAAM,IAAI,MACR,CACE,2HACA,yGACA,KAAK;AAIX,QAAO,WAAW,UAAU,WAAW,cAAc;;;;;;;;;;AAWvD,SAAgB,YAAqC;AACnD,QAAOA,+DAAmC;;;;;;;AAQ5C,SAAgB,oBACd,QACG;CACH,MAAMC,YACJ,UAAUD,+DAAmC;AAE/C,KAAI,cAAc,OAChB,OAAM,IAAI,MACR,CACE,2HACA,mHACA,KAAK;AAIX,KACE,UAAU,eAAeE,0CAAwB,qBACjD,OAEA,OAAM,IAAI,MAAM;AAGlB,QAAO,UAAW,aAAcA,yCAAwB;;AAG1D,SAAgB,0BAA0B,WAA2B;AACnE,QAAO,UACJ,MAAMC,kDACN,QAAQ,SAAS,CAAC,KAAK,MAAM,UAC7B,KAAK,SAAS,KAAK,MAAMC,4CAA0B,IACnD,KAAKD;;AAGV,SAAgB,6BAA6B,WAA2B;CACtE,MAAM,QAAQ,UAAU,MAAMA;AAC9B,QAAO,MAAM,SAAS,KAAK,MAAM,MAAM,SAAS,GAAG,MAAM,SACvD,OAAM;AAER,QAAO,MAAM,MAAM,GAAG,IAAI,KAAKA"}
1
+ {"version":3,"file":"config.cjs","names":["AsyncLocalStorageProviderSingleton","CONFIG_KEY_SCRATCHPAD","CHECKPOINT_NAMESPACE_SEPARATOR","CHECKPOINT_NAMESPACE_END"],"sources":["../../../src/pregel/utils/config.ts"],"sourcesContent":["import { RunnableConfig } from \"@langchain/core/runnables\";\nimport { AsyncLocalStorageProviderSingleton } from \"@langchain/core/singletons\";\nimport { BaseStore } from \"@langchain/langgraph-checkpoint\";\nimport { LangGraphRunnableConfig } from \"../runnable_types.js\";\nimport {\n CHECKPOINT_NAMESPACE_END,\n CHECKPOINT_NAMESPACE_SEPARATOR,\n CONFIG_KEY_SCRATCHPAD,\n} from \"../../constants.js\";\n\nconst COPIABLE_KEYS = [\"tags\", \"metadata\", \"callbacks\", \"configurable\"];\n\nconst CONFIG_KEYS = [\n \"tags\",\n \"metadata\",\n \"callbacks\",\n \"runName\",\n \"maxConcurrency\",\n \"recursionLimit\",\n \"configurable\",\n \"runId\",\n \"outputKeys\",\n \"streamMode\",\n \"store\",\n \"writer\",\n \"interrupt\",\n \"context\",\n \"interruptBefore\",\n \"interruptAfter\",\n \"checkpointDuring\",\n \"durability\",\n \"signal\",\n];\n\nconst DEFAULT_RECURSION_LIMIT = 25;\n\nexport function ensureLangGraphConfig(\n ...configs: (LangGraphRunnableConfig | undefined)[]\n): RunnableConfig {\n const empty: LangGraphRunnableConfig = {\n tags: [],\n metadata: {},\n callbacks: undefined,\n recursionLimit: DEFAULT_RECURSION_LIMIT,\n configurable: {},\n };\n\n const implicitConfig: RunnableConfig =\n AsyncLocalStorageProviderSingleton.getRunnableConfig();\n if (implicitConfig !== undefined) {\n for (const [k, v] of Object.entries(implicitConfig)) {\n if (v !== undefined) {\n if (COPIABLE_KEYS.includes(k)) {\n let copiedValue;\n if (Array.isArray(v)) {\n copiedValue = [...v];\n } else if (typeof v === \"object\") {\n if (\n k === \"callbacks\" &&\n \"copy\" in v &&\n typeof v.copy === \"function\"\n ) {\n copiedValue = v.copy();\n } else {\n copiedValue = { ...v };\n }\n } else {\n copiedValue = v;\n }\n empty[k as keyof RunnableConfig] = copiedValue;\n } else {\n empty[k as keyof RunnableConfig] = v;\n }\n }\n }\n }\n\n for (const config of configs) {\n if (config === undefined) {\n continue;\n }\n\n for (const [k, v] of Object.entries(config)) {\n if (v !== undefined && CONFIG_KEYS.includes(k)) {\n empty[k as keyof LangGraphRunnableConfig] = v;\n }\n }\n }\n\n for (const [key, value] of Object.entries(empty.configurable!)) {\n empty.metadata = empty.metadata ?? {};\n if (\n !key.startsWith(\"__\") &&\n (typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\") &&\n !(key in empty.metadata!)\n ) {\n empty.metadata[key] = value;\n }\n }\n\n return empty;\n}\n\n/**\n * A helper utility function that returns the {@link BaseStore} that was set when the graph was initialized\n *\n * @returns a reference to the {@link BaseStore} that was set when the graph was initialized\n */\nexport function getStore(\n config?: LangGraphRunnableConfig\n): BaseStore | undefined {\n const runConfig: LangGraphRunnableConfig =\n config ?? AsyncLocalStorageProviderSingleton.getRunnableConfig();\n\n if (runConfig === undefined) {\n throw new Error(\n [\n \"Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.\",\n \"If you're running `getStore` in such environment, pass the `config` from the node function directly.\",\n ].join(\"\\n\")\n );\n }\n\n return runConfig?.store;\n}\n\n/**\n * A helper utility function that returns the {@link LangGraphRunnableConfig#writer} if \"custom\" stream mode is enabled, otherwise undefined.\n *\n * @returns a reference to the {@link LangGraphRunnableConfig#writer} if \"custom\" stream mode is enabled, otherwise undefined\n */\nexport function getWriter(\n config?: LangGraphRunnableConfig\n): ((chunk: unknown) => void) | undefined {\n const runConfig: LangGraphRunnableConfig =\n config ?? AsyncLocalStorageProviderSingleton.getRunnableConfig();\n\n if (runConfig === undefined) {\n throw new Error(\n [\n \"Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.\",\n \"If you're running `getWriter` in such environment, pass the `config` from the node function directly.\",\n ].join(\"\\n\")\n );\n }\n\n return runConfig?.writer || runConfig?.configurable?.writer;\n}\n\n/**\n * A helper utility function that returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized.\n *\n * Note: This only works when running in an environment that supports node:async_hooks and AsyncLocalStorage. If you're running this in a\n * web environment, access the LangGraphRunnableConfig from the node function directly.\n *\n * @returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized\n */\nexport function getConfig(): LangGraphRunnableConfig {\n return AsyncLocalStorageProviderSingleton.getRunnableConfig();\n}\n\n/**\n * A helper utility function that returns the input for the currently executing task\n *\n * @returns the input for the currently executing task\n */\nexport function getCurrentTaskInput<T = unknown>(\n config?: LangGraphRunnableConfig\n): T {\n const runConfig: LangGraphRunnableConfig =\n config ?? AsyncLocalStorageProviderSingleton.getRunnableConfig();\n\n if (runConfig === undefined) {\n throw new Error(\n [\n \"Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.\",\n \"If you're running `getCurrentTaskInput` in such environment, pass the `config` from the node function directly.\",\n ].join(\"\\n\")\n );\n }\n\n if (\n runConfig.configurable?.[CONFIG_KEY_SCRATCHPAD]?.currentTaskInput ===\n undefined\n ) {\n throw new Error(\"BUG: internal scratchpad not initialized.\");\n }\n\n return runConfig!.configurable![CONFIG_KEY_SCRATCHPAD]!.currentTaskInput as T;\n}\n\nexport function recastCheckpointNamespace(namespace: string): string {\n return namespace\n .split(CHECKPOINT_NAMESPACE_SEPARATOR)\n .filter((part) => !part.match(/^\\d+$/))\n .map((part) => part.split(CHECKPOINT_NAMESPACE_END)[0])\n .join(CHECKPOINT_NAMESPACE_SEPARATOR);\n}\n\nexport function getParentCheckpointNamespace(namespace: string): string {\n const parts = namespace.split(CHECKPOINT_NAMESPACE_SEPARATOR);\n while (parts.length > 1 && parts[parts.length - 1].match(/^\\d+$/)) {\n parts.pop();\n }\n return parts.slice(0, -1).join(CHECKPOINT_NAMESPACE_SEPARATOR);\n}\n"],"mappings":";;;;AAUA,MAAM,gBAAgB;CAAC;CAAQ;CAAY;CAAa;CAAe;AAEvE,MAAM,cAAc;CAClB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAM,0BAA0B;AA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,KAAI,cAAc,OAChB,OAAM,IAAI,MACR,CACE,2HACA,wGACD,CAAC,KAAK,KAAK,CACb;AAGH,QAAO,WAAW,UAAU,WAAW,cAAc;;;;;;;;;;AAWvD,SAAgB,YAAqC;AACnD,QAAOA,8DAAmC,mBAAmB;;;;;;;AAQ/D,SAAgB,oBACd,QACG;CACH,MAAM,YACJ,UAAUA,8DAAmC,mBAAmB;AAElE,KAAI,cAAc,OAChB,OAAM,IAAI,MACR,CACE,2HACA,kHACD,CAAC,KAAK,KAAK,CACb;AAGH,KACE,UAAU,eAAeC,0CAAwB,qBACjD,OAEA,OAAM,IAAI,MAAM,4CAA4C;AAG9D,QAAO,UAAW,aAAcA,yCAAwB;;AAG1D,SAAgB,0BAA0B,WAA2B;AACnE,QAAO,UACJ,MAAMC,iDAA+B,CACrC,QAAQ,SAAS,CAAC,KAAK,MAAM,QAAQ,CAAC,CACtC,KAAK,SAAS,KAAK,MAAMC,2CAAyB,CAAC,GAAG,CACtD,KAAKD,iDAA+B;;AAGzC,SAAgB,6BAA6B,WAA2B;CACtE,MAAM,QAAQ,UAAU,MAAMA,iDAA+B;AAC7D,QAAO,MAAM,SAAS,KAAK,MAAM,MAAM,SAAS,GAAG,MAAM,QAAQ,CAC/D,OAAM,KAAK;AAEb,QAAO,MAAM,MAAM,GAAG,GAAG,CAAC,KAAKA,iDAA+B"}
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.cts","names":["RunnableConfig","BaseStore","LangGraphRunnableConfig","ensureLangGraphConfig","getStore","getWriter","getConfig","getCurrentTaskInput","T","recastCheckpointNamespace","getParentCheckpointNamespace"],"sources":["../../../src/pregel/utils/config.d.ts"],"sourcesContent":["import { RunnableConfig } from \"@langchain/core/runnables\";\nimport { BaseStore } from \"@langchain/langgraph-checkpoint\";\nimport { LangGraphRunnableConfig } from \"../runnable_types.js\";\nexport declare function ensureLangGraphConfig(...configs: (LangGraphRunnableConfig | undefined)[]): RunnableConfig;\n/**\n * A helper utility function that returns the {@link BaseStore} that was set when the graph was initialized\n *\n * @returns a reference to the {@link BaseStore} that was set when the graph was initialized\n */\nexport declare function getStore(config?: LangGraphRunnableConfig): BaseStore | undefined;\n/**\n * A helper utility function that returns the {@link LangGraphRunnableConfig#writer} if \"custom\" stream mode is enabled, otherwise undefined.\n *\n * @returns a reference to the {@link LangGraphRunnableConfig#writer} if \"custom\" stream mode is enabled, otherwise undefined\n */\nexport declare function getWriter(config?: LangGraphRunnableConfig): ((chunk: unknown) => void) | undefined;\n/**\n * A helper utility function that returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized.\n *\n * Note: This only works when running in an environment that supports node:async_hooks and AsyncLocalStorage. If you're running this in a\n * web environment, access the LangGraphRunnableConfig from the node function directly.\n *\n * @returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized\n */\nexport declare function getConfig(): LangGraphRunnableConfig;\n/**\n * A helper utility function that returns the input for the currently executing task\n *\n * @returns the input for the currently executing task\n */\nexport declare function getCurrentTaskInput<T = unknown>(config?: LangGraphRunnableConfig): T;\nexport declare function recastCheckpointNamespace(namespace: string): string;\nexport declare function getParentCheckpointNamespace(namespace: string): string;\n"],"mappings":";;;;;;;AASA;;;;iBAAwBI,QAAAA,UAAkBF,0BAA0BD;AAMpE;AASA;AAMA;;;AAA4FO,iBAfpEH,SAAAA,CAeoEG,MAAAA,CAAAA,EAfjDN,uBAeiDM,CAAAA,EAAAA,CAAAA,CAAAA,KAAAA,EAAAA,OAAAA,EAAAA,GAAAA,IAAAA,CAAAA,GAAAA,SAAAA;;;;;;;;;iBANpEF,SAAAA,CAAAA,GAAaJ;;;;;;iBAMbK,0CAA0CL,0BAA0BM"}
1
+ {"version":3,"file":"config.d.cts","names":["RunnableConfig","BaseStore","LangGraphRunnableConfig","ensureLangGraphConfig","getStore","getWriter","getConfig","getCurrentTaskInput","T","recastCheckpointNamespace","getParentCheckpointNamespace"],"sources":["../../../src/pregel/utils/config.d.ts"],"sourcesContent":["import { RunnableConfig } from \"@langchain/core/runnables\";\nimport { BaseStore } from \"@langchain/langgraph-checkpoint\";\nimport { LangGraphRunnableConfig } from \"../runnable_types.js\";\nexport declare function ensureLangGraphConfig(...configs: (LangGraphRunnableConfig | undefined)[]): RunnableConfig;\n/**\n * A helper utility function that returns the {@link BaseStore} that was set when the graph was initialized\n *\n * @returns a reference to the {@link BaseStore} that was set when the graph was initialized\n */\nexport declare function getStore(config?: LangGraphRunnableConfig): BaseStore | undefined;\n/**\n * A helper utility function that returns the {@link LangGraphRunnableConfig#writer} if \"custom\" stream mode is enabled, otherwise undefined.\n *\n * @returns a reference to the {@link LangGraphRunnableConfig#writer} if \"custom\" stream mode is enabled, otherwise undefined\n */\nexport declare function getWriter(config?: LangGraphRunnableConfig): ((chunk: unknown) => void) | undefined;\n/**\n * A helper utility function that returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized.\n *\n * Note: This only works when running in an environment that supports node:async_hooks and AsyncLocalStorage. If you're running this in a\n * web environment, access the LangGraphRunnableConfig from the node function directly.\n *\n * @returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized\n */\nexport declare function getConfig(): LangGraphRunnableConfig;\n/**\n * A helper utility function that returns the input for the currently executing task\n *\n * @returns the input for the currently executing task\n */\nexport declare function getCurrentTaskInput<T = unknown>(config?: LangGraphRunnableConfig): T;\nexport declare function recastCheckpointNamespace(namespace: string): string;\nexport declare function getParentCheckpointNamespace(namespace: string): string;\n"],"mappings":";;;;;;;AASA;;;;AAA6E,iBAArDI,QAAAA,CAAqD,MAAA,CAAA,EAAnCF,uBAAmC,CAAA,EAATD,SAAS,GAAA,SAAA;AAM7E;AASA;AAMA;;;AAA4FO,iBAfpEH,SAAAA,CAeoEG,MAAAA,CAAAA,EAfjDN,uBAeiDM,CAAAA,EAAAA,CAAAA,CAAAA,KAAAA,EAAAA,OAAAA,EAAAA,GAAAA,IAAAA,CAAAA,GAAAA,SAAAA;;;;;;;;;iBANpEF,SAAAA,CAAAA,GAAaJ;;;;;;iBAMbK,0CAA0CL,0BAA0BM"}
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","names":["RunnableConfig","BaseStore","LangGraphRunnableConfig","ensureLangGraphConfig","getStore","getWriter","getConfig","getCurrentTaskInput","T","recastCheckpointNamespace","getParentCheckpointNamespace"],"sources":["../../../src/pregel/utils/config.d.ts"],"sourcesContent":["import { RunnableConfig } from \"@langchain/core/runnables\";\nimport { BaseStore } from \"@langchain/langgraph-checkpoint\";\nimport { LangGraphRunnableConfig } from \"../runnable_types.js\";\nexport declare function ensureLangGraphConfig(...configs: (LangGraphRunnableConfig | undefined)[]): RunnableConfig;\n/**\n * A helper utility function that returns the {@link BaseStore} that was set when the graph was initialized\n *\n * @returns a reference to the {@link BaseStore} that was set when the graph was initialized\n */\nexport declare function getStore(config?: LangGraphRunnableConfig): BaseStore | undefined;\n/**\n * A helper utility function that returns the {@link LangGraphRunnableConfig#writer} if \"custom\" stream mode is enabled, otherwise undefined.\n *\n * @returns a reference to the {@link LangGraphRunnableConfig#writer} if \"custom\" stream mode is enabled, otherwise undefined\n */\nexport declare function getWriter(config?: LangGraphRunnableConfig): ((chunk: unknown) => void) | undefined;\n/**\n * A helper utility function that returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized.\n *\n * Note: This only works when running in an environment that supports node:async_hooks and AsyncLocalStorage. If you're running this in a\n * web environment, access the LangGraphRunnableConfig from the node function directly.\n *\n * @returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized\n */\nexport declare function getConfig(): LangGraphRunnableConfig;\n/**\n * A helper utility function that returns the input for the currently executing task\n *\n * @returns the input for the currently executing task\n */\nexport declare function getCurrentTaskInput<T = unknown>(config?: LangGraphRunnableConfig): T;\nexport declare function recastCheckpointNamespace(namespace: string): string;\nexport declare function getParentCheckpointNamespace(namespace: string): string;\n"],"mappings":";;;;;;;AASA;;;;iBAAwBI,QAAAA,UAAkBF,0BAA0BD;AAMpE;AASA;AAMA;;;AAA4FO,iBAfpEH,SAAAA,CAeoEG,MAAAA,CAAAA,EAfjDN,uBAeiDM,CAAAA,EAAAA,CAAAA,CAAAA,KAAAA,EAAAA,OAAAA,EAAAA,GAAAA,IAAAA,CAAAA,GAAAA,SAAAA;;;;;;;;;iBANpEF,SAAAA,CAAAA,GAAaJ;;;;;;iBAMbK,0CAA0CL,0BAA0BM"}
1
+ {"version":3,"file":"config.d.ts","names":["RunnableConfig","BaseStore","LangGraphRunnableConfig","ensureLangGraphConfig","getStore","getWriter","getConfig","getCurrentTaskInput","T","recastCheckpointNamespace","getParentCheckpointNamespace"],"sources":["../../../src/pregel/utils/config.d.ts"],"sourcesContent":["import { RunnableConfig } from \"@langchain/core/runnables\";\nimport { BaseStore } from \"@langchain/langgraph-checkpoint\";\nimport { LangGraphRunnableConfig } from \"../runnable_types.js\";\nexport declare function ensureLangGraphConfig(...configs: (LangGraphRunnableConfig | undefined)[]): RunnableConfig;\n/**\n * A helper utility function that returns the {@link BaseStore} that was set when the graph was initialized\n *\n * @returns a reference to the {@link BaseStore} that was set when the graph was initialized\n */\nexport declare function getStore(config?: LangGraphRunnableConfig): BaseStore | undefined;\n/**\n * A helper utility function that returns the {@link LangGraphRunnableConfig#writer} if \"custom\" stream mode is enabled, otherwise undefined.\n *\n * @returns a reference to the {@link LangGraphRunnableConfig#writer} if \"custom\" stream mode is enabled, otherwise undefined\n */\nexport declare function getWriter(config?: LangGraphRunnableConfig): ((chunk: unknown) => void) | undefined;\n/**\n * A helper utility function that returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized.\n *\n * Note: This only works when running in an environment that supports node:async_hooks and AsyncLocalStorage. If you're running this in a\n * web environment, access the LangGraphRunnableConfig from the node function directly.\n *\n * @returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized\n */\nexport declare function getConfig(): LangGraphRunnableConfig;\n/**\n * A helper utility function that returns the input for the currently executing task\n *\n * @returns the input for the currently executing task\n */\nexport declare function getCurrentTaskInput<T = unknown>(config?: LangGraphRunnableConfig): T;\nexport declare function recastCheckpointNamespace(namespace: string): string;\nexport declare function getParentCheckpointNamespace(namespace: string): string;\n"],"mappings":";;;;;;;AASA;;;;AAA6E,iBAArDI,QAAAA,CAAqD,MAAA,CAAA,EAAnCF,uBAAmC,CAAA,EAATD,SAAS,GAAA,SAAA;AAM7E;AASA;AAMA;;;AAA4FO,iBAfpEH,SAAAA,CAeoEG,MAAAA,CAAAA,EAfjDN,uBAeiDM,CAAAA,EAAAA,CAAAA,CAAAA,KAAAA,EAAAA,OAAAA,EAAAA,GAAAA,IAAAA,CAAAA,GAAAA,SAAAA;;;;;;;;;iBANpEF,SAAAA,CAAAA,GAAaJ;;;;;;iBAMbK,0CAA0CL,0BAA0BM"}
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","names":["empty: LangGraphRunnableConfig","implicitConfig: RunnableConfig","runConfig: LangGraphRunnableConfig"],"sources":["../../../src/pregel/utils/config.ts"],"sourcesContent":["import { RunnableConfig } from \"@langchain/core/runnables\";\nimport { AsyncLocalStorageProviderSingleton } from \"@langchain/core/singletons\";\nimport { BaseStore } from \"@langchain/langgraph-checkpoint\";\nimport { LangGraphRunnableConfig } from \"../runnable_types.js\";\nimport {\n CHECKPOINT_NAMESPACE_END,\n CHECKPOINT_NAMESPACE_SEPARATOR,\n CONFIG_KEY_SCRATCHPAD,\n} from \"../../constants.js\";\n\nconst COPIABLE_KEYS = [\"tags\", \"metadata\", \"callbacks\", \"configurable\"];\n\nconst CONFIG_KEYS = [\n \"tags\",\n \"metadata\",\n \"callbacks\",\n \"runName\",\n \"maxConcurrency\",\n \"recursionLimit\",\n \"configurable\",\n \"runId\",\n \"outputKeys\",\n \"streamMode\",\n \"store\",\n \"writer\",\n \"interrupt\",\n \"context\",\n \"interruptBefore\",\n \"interruptAfter\",\n \"checkpointDuring\",\n \"durability\",\n \"signal\",\n];\n\nconst DEFAULT_RECURSION_LIMIT = 25;\n\nexport function ensureLangGraphConfig(\n ...configs: (LangGraphRunnableConfig | undefined)[]\n): RunnableConfig {\n const empty: LangGraphRunnableConfig = {\n tags: [],\n metadata: {},\n callbacks: undefined,\n recursionLimit: DEFAULT_RECURSION_LIMIT,\n configurable: {},\n };\n\n const implicitConfig: RunnableConfig =\n AsyncLocalStorageProviderSingleton.getRunnableConfig();\n if (implicitConfig !== undefined) {\n for (const [k, v] of Object.entries(implicitConfig)) {\n if (v !== undefined) {\n if (COPIABLE_KEYS.includes(k)) {\n let copiedValue;\n if (Array.isArray(v)) {\n copiedValue = [...v];\n } else if (typeof v === \"object\") {\n if (\n k === \"callbacks\" &&\n \"copy\" in v &&\n typeof v.copy === \"function\"\n ) {\n copiedValue = v.copy();\n } else {\n copiedValue = { ...v };\n }\n } else {\n copiedValue = v;\n }\n empty[k as keyof RunnableConfig] = copiedValue;\n } else {\n empty[k as keyof RunnableConfig] = v;\n }\n }\n }\n }\n\n for (const config of configs) {\n if (config === undefined) {\n continue;\n }\n\n for (const [k, v] of Object.entries(config)) {\n if (v !== undefined && CONFIG_KEYS.includes(k)) {\n empty[k as keyof LangGraphRunnableConfig] = v;\n }\n }\n }\n\n for (const [key, value] of Object.entries(empty.configurable!)) {\n empty.metadata = empty.metadata ?? {};\n if (\n !key.startsWith(\"__\") &&\n (typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\") &&\n !(key in empty.metadata!)\n ) {\n empty.metadata[key] = value;\n }\n }\n\n return empty;\n}\n\n/**\n * A helper utility function that returns the {@link BaseStore} that was set when the graph was initialized\n *\n * @returns a reference to the {@link BaseStore} that was set when the graph was initialized\n */\nexport function getStore(\n config?: LangGraphRunnableConfig\n): BaseStore | undefined {\n const runConfig: LangGraphRunnableConfig =\n config ?? AsyncLocalStorageProviderSingleton.getRunnableConfig();\n\n if (runConfig === undefined) {\n throw new Error(\n [\n \"Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.\",\n \"If you're running `getStore` in such environment, pass the `config` from the node function directly.\",\n ].join(\"\\n\")\n );\n }\n\n return runConfig?.store;\n}\n\n/**\n * A helper utility function that returns the {@link LangGraphRunnableConfig#writer} if \"custom\" stream mode is enabled, otherwise undefined.\n *\n * @returns a reference to the {@link LangGraphRunnableConfig#writer} if \"custom\" stream mode is enabled, otherwise undefined\n */\nexport function getWriter(\n config?: LangGraphRunnableConfig\n): ((chunk: unknown) => void) | undefined {\n const runConfig: LangGraphRunnableConfig =\n config ?? AsyncLocalStorageProviderSingleton.getRunnableConfig();\n\n if (runConfig === undefined) {\n throw new Error(\n [\n \"Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.\",\n \"If you're running `getWriter` in such environment, pass the `config` from the node function directly.\",\n ].join(\"\\n\")\n );\n }\n\n return runConfig?.writer || runConfig?.configurable?.writer;\n}\n\n/**\n * A helper utility function that returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized.\n *\n * Note: This only works when running in an environment that supports node:async_hooks and AsyncLocalStorage. If you're running this in a\n * web environment, access the LangGraphRunnableConfig from the node function directly.\n *\n * @returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized\n */\nexport function getConfig(): LangGraphRunnableConfig {\n return AsyncLocalStorageProviderSingleton.getRunnableConfig();\n}\n\n/**\n * A helper utility function that returns the input for the currently executing task\n *\n * @returns the input for the currently executing task\n */\nexport function getCurrentTaskInput<T = unknown>(\n config?: LangGraphRunnableConfig\n): T {\n const runConfig: LangGraphRunnableConfig =\n config ?? AsyncLocalStorageProviderSingleton.getRunnableConfig();\n\n if (runConfig === undefined) {\n throw new Error(\n [\n \"Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.\",\n \"If you're running `getCurrentTaskInput` in such environment, pass the `config` from the node function directly.\",\n ].join(\"\\n\")\n );\n }\n\n if (\n runConfig.configurable?.[CONFIG_KEY_SCRATCHPAD]?.currentTaskInput ===\n undefined\n ) {\n throw new Error(\"BUG: internal scratchpad not initialized.\");\n }\n\n return runConfig!.configurable![CONFIG_KEY_SCRATCHPAD]!.currentTaskInput as T;\n}\n\nexport function recastCheckpointNamespace(namespace: string): string {\n return namespace\n .split(CHECKPOINT_NAMESPACE_SEPARATOR)\n .filter((part) => !part.match(/^\\d+$/))\n .map((part) => part.split(CHECKPOINT_NAMESPACE_END)[0])\n .join(CHECKPOINT_NAMESPACE_SEPARATOR);\n}\n\nexport function getParentCheckpointNamespace(namespace: string): string {\n const parts = namespace.split(CHECKPOINT_NAMESPACE_SEPARATOR);\n while (parts.length > 1 && parts[parts.length - 1].match(/^\\d+$/)) {\n parts.pop();\n }\n return parts.slice(0, -1).join(CHECKPOINT_NAMESPACE_SEPARATOR);\n}\n"],"mappings":";;;;AAUA,MAAM,gBAAgB;CAAC;CAAQ;CAAY;CAAa;;AAExD,MAAM,cAAc;CAClB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;AAGF,MAAM,0BAA0B;AAEhC,SAAgB,sBACd,GAAG,SACa;CAChB,MAAMA,QAAiC;EACrC,MAAM;EACN,UAAU;EACV,WAAW;EACX,gBAAgB;EAChB,cAAc;;CAGhB,MAAMC,iBACJ,mCAAmC;AACrC,KAAI,mBAAmB,QACrB;OAAK,MAAM,CAAC,GAAG,MAAM,OAAO,QAAQ,gBAClC,KAAI,MAAM,OACR,KAAI,cAAc,SAAS,IAAI;GAC7B,IAAI;AACJ,OAAI,MAAM,QAAQ,GAChB,eAAc,CAAC,GAAG;YACT,OAAO,MAAM,SACtB,KACE,MAAM,eACN,UAAU,KACV,OAAO,EAAE,SAAS,WAElB,eAAc,EAAE;OAEhB,eAAc,EAAE,GAAG;OAGrB,eAAc;AAEhB,SAAM,KAA6B;QAEnC,OAAM,KAA6B;;AAM3C,MAAK,MAAM,UAAU,SAAS;AAC5B,MAAI,WAAW,OACb;AAGF,OAAK,MAAM,CAAC,GAAG,MAAM,OAAO,QAAQ,QAClC,KAAI,MAAM,UAAa,YAAY,SAAS,GAC1C,OAAM,KAAsC;;AAKlD,MAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,eAAgB;AAC9D,QAAM,WAAW,MAAM,YAAY;AACnC,MACE,CAAC,IAAI,WAAW,UACf,OAAO,UAAU,YAChB,OAAO,UAAU,YACjB,OAAO,UAAU,cACnB,EAAE,OAAO,MAAM,UAEf,OAAM,SAAS,OAAO;;AAI1B,QAAO;;;;;;;AAQT,SAAgB,SACd,QACuB;CACvB,MAAMC,YACJ,UAAU,mCAAmC;AAE/C,KAAI,cAAc,OAChB,OAAM,IAAI,MACR,CACE,2HACA,wGACA,KAAK;AAIX,QAAO,WAAW;;;;;;;AAQpB,SAAgB,UACd,QACwC;CACxC,MAAMA,YACJ,UAAU,mCAAmC;AAE/C,KAAI,cAAc,OAChB,OAAM,IAAI,MACR,CACE,2HACA,yGACA,KAAK;AAIX,QAAO,WAAW,UAAU,WAAW,cAAc;;;;;;;;;;AAWvD,SAAgB,YAAqC;AACnD,QAAO,mCAAmC;;;;;;;AAQ5C,SAAgB,oBACd,QACG;CACH,MAAMA,YACJ,UAAU,mCAAmC;AAE/C,KAAI,cAAc,OAChB,OAAM,IAAI,MACR,CACE,2HACA,mHACA,KAAK;AAIX,KACE,UAAU,eAAe,wBAAwB,qBACjD,OAEA,OAAM,IAAI,MAAM;AAGlB,QAAO,UAAW,aAAc,uBAAwB;;AAG1D,SAAgB,0BAA0B,WAA2B;AACnE,QAAO,UACJ,MAAM,gCACN,QAAQ,SAAS,CAAC,KAAK,MAAM,UAC7B,KAAK,SAAS,KAAK,MAAM,0BAA0B,IACnD,KAAK;;AAGV,SAAgB,6BAA6B,WAA2B;CACtE,MAAM,QAAQ,UAAU,MAAM;AAC9B,QAAO,MAAM,SAAS,KAAK,MAAM,MAAM,SAAS,GAAG,MAAM,SACvD,OAAM;AAER,QAAO,MAAM,MAAM,GAAG,IAAI,KAAK"}
1
+ {"version":3,"file":"config.js","names":[],"sources":["../../../src/pregel/utils/config.ts"],"sourcesContent":["import { RunnableConfig } from \"@langchain/core/runnables\";\nimport { AsyncLocalStorageProviderSingleton } from \"@langchain/core/singletons\";\nimport { BaseStore } from \"@langchain/langgraph-checkpoint\";\nimport { LangGraphRunnableConfig } from \"../runnable_types.js\";\nimport {\n CHECKPOINT_NAMESPACE_END,\n CHECKPOINT_NAMESPACE_SEPARATOR,\n CONFIG_KEY_SCRATCHPAD,\n} from \"../../constants.js\";\n\nconst COPIABLE_KEYS = [\"tags\", \"metadata\", \"callbacks\", \"configurable\"];\n\nconst CONFIG_KEYS = [\n \"tags\",\n \"metadata\",\n \"callbacks\",\n \"runName\",\n \"maxConcurrency\",\n \"recursionLimit\",\n \"configurable\",\n \"runId\",\n \"outputKeys\",\n \"streamMode\",\n \"store\",\n \"writer\",\n \"interrupt\",\n \"context\",\n \"interruptBefore\",\n \"interruptAfter\",\n \"checkpointDuring\",\n \"durability\",\n \"signal\",\n];\n\nconst DEFAULT_RECURSION_LIMIT = 25;\n\nexport function ensureLangGraphConfig(\n ...configs: (LangGraphRunnableConfig | undefined)[]\n): RunnableConfig {\n const empty: LangGraphRunnableConfig = {\n tags: [],\n metadata: {},\n callbacks: undefined,\n recursionLimit: DEFAULT_RECURSION_LIMIT,\n configurable: {},\n };\n\n const implicitConfig: RunnableConfig =\n AsyncLocalStorageProviderSingleton.getRunnableConfig();\n if (implicitConfig !== undefined) {\n for (const [k, v] of Object.entries(implicitConfig)) {\n if (v !== undefined) {\n if (COPIABLE_KEYS.includes(k)) {\n let copiedValue;\n if (Array.isArray(v)) {\n copiedValue = [...v];\n } else if (typeof v === \"object\") {\n if (\n k === \"callbacks\" &&\n \"copy\" in v &&\n typeof v.copy === \"function\"\n ) {\n copiedValue = v.copy();\n } else {\n copiedValue = { ...v };\n }\n } else {\n copiedValue = v;\n }\n empty[k as keyof RunnableConfig] = copiedValue;\n } else {\n empty[k as keyof RunnableConfig] = v;\n }\n }\n }\n }\n\n for (const config of configs) {\n if (config === undefined) {\n continue;\n }\n\n for (const [k, v] of Object.entries(config)) {\n if (v !== undefined && CONFIG_KEYS.includes(k)) {\n empty[k as keyof LangGraphRunnableConfig] = v;\n }\n }\n }\n\n for (const [key, value] of Object.entries(empty.configurable!)) {\n empty.metadata = empty.metadata ?? {};\n if (\n !key.startsWith(\"__\") &&\n (typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\") &&\n !(key in empty.metadata!)\n ) {\n empty.metadata[key] = value;\n }\n }\n\n return empty;\n}\n\n/**\n * A helper utility function that returns the {@link BaseStore} that was set when the graph was initialized\n *\n * @returns a reference to the {@link BaseStore} that was set when the graph was initialized\n */\nexport function getStore(\n config?: LangGraphRunnableConfig\n): BaseStore | undefined {\n const runConfig: LangGraphRunnableConfig =\n config ?? AsyncLocalStorageProviderSingleton.getRunnableConfig();\n\n if (runConfig === undefined) {\n throw new Error(\n [\n \"Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.\",\n \"If you're running `getStore` in such environment, pass the `config` from the node function directly.\",\n ].join(\"\\n\")\n );\n }\n\n return runConfig?.store;\n}\n\n/**\n * A helper utility function that returns the {@link LangGraphRunnableConfig#writer} if \"custom\" stream mode is enabled, otherwise undefined.\n *\n * @returns a reference to the {@link LangGraphRunnableConfig#writer} if \"custom\" stream mode is enabled, otherwise undefined\n */\nexport function getWriter(\n config?: LangGraphRunnableConfig\n): ((chunk: unknown) => void) | undefined {\n const runConfig: LangGraphRunnableConfig =\n config ?? AsyncLocalStorageProviderSingleton.getRunnableConfig();\n\n if (runConfig === undefined) {\n throw new Error(\n [\n \"Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.\",\n \"If you're running `getWriter` in such environment, pass the `config` from the node function directly.\",\n ].join(\"\\n\")\n );\n }\n\n return runConfig?.writer || runConfig?.configurable?.writer;\n}\n\n/**\n * A helper utility function that returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized.\n *\n * Note: This only works when running in an environment that supports node:async_hooks and AsyncLocalStorage. If you're running this in a\n * web environment, access the LangGraphRunnableConfig from the node function directly.\n *\n * @returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized\n */\nexport function getConfig(): LangGraphRunnableConfig {\n return AsyncLocalStorageProviderSingleton.getRunnableConfig();\n}\n\n/**\n * A helper utility function that returns the input for the currently executing task\n *\n * @returns the input for the currently executing task\n */\nexport function getCurrentTaskInput<T = unknown>(\n config?: LangGraphRunnableConfig\n): T {\n const runConfig: LangGraphRunnableConfig =\n config ?? AsyncLocalStorageProviderSingleton.getRunnableConfig();\n\n if (runConfig === undefined) {\n throw new Error(\n [\n \"Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.\",\n \"If you're running `getCurrentTaskInput` in such environment, pass the `config` from the node function directly.\",\n ].join(\"\\n\")\n );\n }\n\n if (\n runConfig.configurable?.[CONFIG_KEY_SCRATCHPAD]?.currentTaskInput ===\n undefined\n ) {\n throw new Error(\"BUG: internal scratchpad not initialized.\");\n }\n\n return runConfig!.configurable![CONFIG_KEY_SCRATCHPAD]!.currentTaskInput as T;\n}\n\nexport function recastCheckpointNamespace(namespace: string): string {\n return namespace\n .split(CHECKPOINT_NAMESPACE_SEPARATOR)\n .filter((part) => !part.match(/^\\d+$/))\n .map((part) => part.split(CHECKPOINT_NAMESPACE_END)[0])\n .join(CHECKPOINT_NAMESPACE_SEPARATOR);\n}\n\nexport function getParentCheckpointNamespace(namespace: string): string {\n const parts = namespace.split(CHECKPOINT_NAMESPACE_SEPARATOR);\n while (parts.length > 1 && parts[parts.length - 1].match(/^\\d+$/)) {\n parts.pop();\n }\n return parts.slice(0, -1).join(CHECKPOINT_NAMESPACE_SEPARATOR);\n}\n"],"mappings":";;;;AAUA,MAAM,gBAAgB;CAAC;CAAQ;CAAY;CAAa;CAAe;AAEvE,MAAM,cAAc;CAClB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAM,0BAA0B;AAEhC,SAAgB,sBACd,GAAG,SACa;CAChB,MAAM,QAAiC;EACrC,MAAM,EAAE;EACR,UAAU,EAAE;EACZ,WAA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AAU,WAAW,cAAc;;;;;;;;;;AAWvD,SAAgB,YAAqC;AACnD,QAAO,mCAAmC,mBAAmB;;;;;;;AAQ/D,SAAgB,oBACd,QACG;CACH,MAAM,YACJ,UAAU,mCAAmC,mBAAmB;AAElE,KAAI,cAAc,OAChB,OAAM,IAAI,MACR,CACE,2HACA,kHACD,CAAC,KAAK,KAAK,CACb;AAGH,KACE,UAAU,eAAe,wBAAwB,qBACjD,OAEA,OAAM,IAAI,MAAM,4CAA4C;AAG9D,QAAO,UAAW,aAAc,uBAAwB;;AAG1D,SAAgB,0BAA0B,WAA2B;AACnE,QAAO,UACJ,MAAM,+BAA+B,CACrC,QAAQ,SAAS,CAAC,KAAK,MAAM,QAAQ,CAAC,CACtC,KAAK,SAAS,KAAK,MAAM,yBAAyB,CAAC,GAAG,CACtD,KAAK,+BAA+B;;AAGzC,SAAgB,6BAA6B,WAA2B;CACtE,MAAM,QAAQ,UAAU,MAAM,+BAA+B;AAC7D,QAAO,MAAM,SAAS,KAAK,MAAM,MAAM,SAAS,GAAG,MAAM,QAAQ,CAC/D,OAAM,KAAK;AAEb,QAAO,MAAM,MAAM,GAAG,GAAG,CAAC,KAAK,+BAA+B"}
@@ -12,7 +12,6 @@ function getNullChannelVersion(currentVersions) {
12
12
  if (versionType === "string") return "";
13
13
  break;
14
14
  }
15
- return void 0;
16
15
  }
17
16
  function getNewChannelVersions(previousVersions, currentVersions) {
18
17
  if (Object.keys(previousVersions).length > 0) {
@@ -83,7 +82,7 @@ function combineAbortSignals(...x) {
83
82
  * @returns A single callback that is a combination of the input callbacks.
84
83
  */
85
84
  const combineCallbacks = (callback1, callback2) => {
86
- if (!callback1 && !callback2) return void 0;
85
+ if (!callback1 && !callback2) return;
87
86
  if (!callback1) return callback2;
88
87
  if (!callback2) return callback1;
89
88
  if (Array.isArray(callback1) && Array.isArray(callback2)) return [...callback1, ...callback2];
@@ -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 * @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;AAC5C,KAAI,iBAAiB,SAAU,QAAO;AACtC,KAAI,iBAAiB,SAAU,QAAO;AAGtC,MAAK,MAAM,OAAO,iBAAiB;AACjC,MAAI,CAAC,OAAO,UAAU,eAAe,KAAK,iBAAiB,KAAM;EACjE,MAAM,cAAc,OAAO,gBAAgB;AAC3C,MAAI,gBAAgB,SAAU,QAAO;AACrC,MAAI,gBAAgB,SAAU,QAAO;AACrC;;AAGF,QAAO;;AAGT,SAAgB,sBACd,kBACA,iBACiB;AAEjB,KAAI,OAAO,KAAK,kBAAkB,SAAS,GAAG;EAC5C,MAAM,cAAc,sBAAsB;AAC1C,SAAO,OAAO,YACZ,OAAO,QAAQ,iBAAiB,QAC7B,CAAC,GAAG,OAAO,KAAK,iBAAiB,MAAM;OAI5C,QAAO;;AAKX,S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,CAAC,aAAa,CAAC,UACjB,QAAO;AAGT,KAAI,CAAC,UACH,QAAO;AAGT,KAAI,CAAC,UACH,QAAO;AAET,KAAI,MAAM,QAAQ,cAAc,MAAM,QAAQ,WAC5C,QAAO,CAAC,GAAG,WAAW,GAAG;AAE3B,KAAI,MAAM,QAAQ,WAChB,QAAO,CAAC,GAAG,WAAW;AAExB,KAAI,MAAM,QAAQ,WAChB,QAAO,CAAC,WAAW,GAAG;AAExB,QAAO,CAAC,WAAW"}
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;AAC5C,KAAI,iBAAiB,SAAU,QAAO;AACtC,KAAI,iBAAiB,SAAU,QAAO;AAGtC,MAAK,MAAM,OAAO,iBAAiB;AACjC,MAAI,CAAC,OAAO,UAAU,eAAe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,SAAS;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"}
@@ -27,7 +27,7 @@ type RetryPolicy = {
27
27
  /** Whether to add random jitter to the interval between retries. */
28
28
  jitter?: boolean;
29
29
  /** A function that returns True for exceptions that should trigger a retry. */
30
- retryOn?: (e: any) => boolean; // eslint-disable-line @typescript-eslint/no-explicit-any
30
+ retryOn?: (e: any) => boolean;
31
31
  /** Whether to log a warning when a retry is attempted. Defaults to true. */
32
32
  logWarning?: boolean;
33
33
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":["Callbacks","RunnableConfig","ChannelVersions","CheckpointMetadata","getNullChannelVersion","getNewChannelVersions","_coerceToDict","RetryPolicy","CachePolicy","patchConfigurable","Record","patchCheckpointMap","combineAbortSignals","AbortSignal","combineCallbacks"],"sources":["../../../src/pregel/utils/index.d.ts"],"sourcesContent":["import { Callbacks } from \"@langchain/core/callbacks/manager\";\nimport { RunnableConfig } from \"@langchain/core/runnables\";\nimport type { ChannelVersions, CheckpointMetadata } from \"@langchain/langgraph-checkpoint\";\nexport declare function getNullChannelVersion(currentVersions: ChannelVersions): \"\" | 0 | undefined;\nexport declare function getNewChannelVersions(previousVersions: ChannelVersions, currentVersions: ChannelVersions): ChannelVersions;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport declare function _coerceToDict(value: any, defaultKey: string): any;\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 * Multiplier by which the interval increases after each retry.\n * @default 2\n */\n backoffFactor?: number;\n /**\n * Maximum amount of time that may elapse between retries in milliseconds.\n * @default 128000\n */\n maxInterval?: number;\n /**\n * Maximum amount of time that may elapse between retries.\n * @default 3\n */\n maxAttempts?: number;\n /** Whether to add random jitter to the interval between retries. */\n jitter?: boolean;\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 /** Whether to log a warning when a retry is attempted. Defaults to true. */\n logWarning?: boolean;\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 * The time to live for the cache in seconds.\n * If not defined, the entry will never expire.\n */\n ttl?: number;\n};\nexport declare function patchConfigurable(config: RunnableConfig | undefined, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\npatch: Record<string, any>): RunnableConfig;\nexport declare function patchCheckpointMap(config: RunnableConfig, metadata?: CheckpointMetadata): RunnableConfig;\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 declare function combineAbortSignals(...x: (AbortSignal | undefined)[]): {\n signal: AbortSignal | undefined;\n dispose?: () => void;\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 declare const combineCallbacks: (callback1?: Callbacks | undefined, callback2?: Callbacks | undefined) => Callbacks | undefined;\n"],"mappings":";;;;;KAOYO,WAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+BAC,WAAAA"}
1
+ {"version":3,"file":"index.d.cts","names":["Callbacks","RunnableConfig","ChannelVersions","CheckpointMetadata","getNullChannelVersion","getNewChannelVersions","_coerceToDict","RetryPolicy","CachePolicy","patchConfigurable","Record","patchCheckpointMap","combineAbortSignals","AbortSignal","combineCallbacks"],"sources":["../../../src/pregel/utils/index.d.ts"],"sourcesContent":["import { Callbacks } from \"@langchain/core/callbacks/manager\";\nimport { RunnableConfig } from \"@langchain/core/runnables\";\nimport type { ChannelVersions, CheckpointMetadata } from \"@langchain/langgraph-checkpoint\";\nexport declare function getNullChannelVersion(currentVersions: ChannelVersions): \"\" | 0 | undefined;\nexport declare function getNewChannelVersions(previousVersions: ChannelVersions, currentVersions: ChannelVersions): ChannelVersions;\nexport declare function _coerceToDict(value: any, defaultKey: string): any;\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 * Multiplier by which the interval increases after each retry.\n * @default 2\n */\n backoffFactor?: number;\n /**\n * Maximum amount of time that may elapse between retries in milliseconds.\n * @default 128000\n */\n maxInterval?: number;\n /**\n * Maximum amount of time that may elapse between retries.\n * @default 3\n */\n maxAttempts?: number;\n /** Whether to add random jitter to the interval between retries. */\n jitter?: boolean;\n /** A function that returns True for exceptions that should trigger a retry. */\n retryOn?: (e: any) => boolean;\n /** Whether to log a warning when a retry is attempted. Defaults to true. */\n logWarning?: boolean;\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 * The time to live for the cache in seconds.\n * If not defined, the entry will never expire.\n */\n ttl?: number;\n};\nexport declare function patchConfigurable(config: RunnableConfig | undefined, patch: Record<string, any>): RunnableConfig;\nexport declare function patchCheckpointMap(config: RunnableConfig, metadata?: CheckpointMetadata): RunnableConfig;\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 declare function combineAbortSignals(...x: (AbortSignal | undefined)[]): {\n signal: AbortSignal | undefined;\n dispose?: () => void;\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 declare const combineCallbacks: (callback1?: Callbacks | undefined, callback2?: Callbacks | undefined) => Callbacks | undefined;\n"],"mappings":";;;;;KAMYO,WAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+BAC,WAAAA"}
@@ -27,7 +27,7 @@ type RetryPolicy = {
27
27
  /** Whether to add random jitter to the interval between retries. */
28
28
  jitter?: boolean;
29
29
  /** A function that returns True for exceptions that should trigger a retry. */
30
- retryOn?: (e: any) => boolean; // eslint-disable-line @typescript-eslint/no-explicit-any
30
+ retryOn?: (e: any) => boolean;
31
31
  /** Whether to log a warning when a retry is attempted. Defaults to true. */
32
32
  logWarning?: boolean;
33
33
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["Callbacks","RunnableConfig","ChannelVersions","CheckpointMetadata","getNullChannelVersion","getNewChannelVersions","_coerceToDict","RetryPolicy","CachePolicy","patchConfigurable","Record","patchCheckpointMap","combineAbortSignals","AbortSignal","combineCallbacks"],"sources":["../../../src/pregel/utils/index.d.ts"],"sourcesContent":["import { Callbacks } from \"@langchain/core/callbacks/manager\";\nimport { RunnableConfig } from \"@langchain/core/runnables\";\nimport type { ChannelVersions, CheckpointMetadata } from \"@langchain/langgraph-checkpoint\";\nexport declare function getNullChannelVersion(currentVersions: ChannelVersions): \"\" | 0 | undefined;\nexport declare function getNewChannelVersions(previousVersions: ChannelVersions, currentVersions: ChannelVersions): ChannelVersions;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport declare function _coerceToDict(value: any, defaultKey: string): any;\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 * Multiplier by which the interval increases after each retry.\n * @default 2\n */\n backoffFactor?: number;\n /**\n * Maximum amount of time that may elapse between retries in milliseconds.\n * @default 128000\n */\n maxInterval?: number;\n /**\n * Maximum amount of time that may elapse between retries.\n * @default 3\n */\n maxAttempts?: number;\n /** Whether to add random jitter to the interval between retries. */\n jitter?: boolean;\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 /** Whether to log a warning when a retry is attempted. Defaults to true. */\n logWarning?: boolean;\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 * The time to live for the cache in seconds.\n * If not defined, the entry will never expire.\n */\n ttl?: number;\n};\nexport declare function patchConfigurable(config: RunnableConfig | undefined, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\npatch: Record<string, any>): RunnableConfig;\nexport declare function patchCheckpointMap(config: RunnableConfig, metadata?: CheckpointMetadata): RunnableConfig;\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 declare function combineAbortSignals(...x: (AbortSignal | undefined)[]): {\n signal: AbortSignal | undefined;\n dispose?: () => void;\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 declare const combineCallbacks: (callback1?: Callbacks | undefined, callback2?: Callbacks | undefined) => Callbacks | undefined;\n"],"mappings":";;;;;KAOYO,WAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+BAC,WAAAA"}
1
+ {"version":3,"file":"index.d.ts","names":["Callbacks","RunnableConfig","ChannelVersions","CheckpointMetadata","getNullChannelVersion","getNewChannelVersions","_coerceToDict","RetryPolicy","CachePolicy","patchConfigurable","Record","patchCheckpointMap","combineAbortSignals","AbortSignal","combineCallbacks"],"sources":["../../../src/pregel/utils/index.d.ts"],"sourcesContent":["import { Callbacks } from \"@langchain/core/callbacks/manager\";\nimport { RunnableConfig } from \"@langchain/core/runnables\";\nimport type { ChannelVersions, CheckpointMetadata } from \"@langchain/langgraph-checkpoint\";\nexport declare function getNullChannelVersion(currentVersions: ChannelVersions): \"\" | 0 | undefined;\nexport declare function getNewChannelVersions(previousVersions: ChannelVersions, currentVersions: ChannelVersions): ChannelVersions;\nexport declare function _coerceToDict(value: any, defaultKey: string): any;\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 * Multiplier by which the interval increases after each retry.\n * @default 2\n */\n backoffFactor?: number;\n /**\n * Maximum amount of time that may elapse between retries in milliseconds.\n * @default 128000\n */\n maxInterval?: number;\n /**\n * Maximum amount of time that may elapse between retries.\n * @default 3\n */\n maxAttempts?: number;\n /** Whether to add random jitter to the interval between retries. */\n jitter?: boolean;\n /** A function that returns True for exceptions that should trigger a retry. */\n retryOn?: (e: any) => boolean;\n /** Whether to log a warning when a retry is attempted. Defaults to true. */\n logWarning?: boolean;\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 * The time to live for the cache in seconds.\n * If not defined, the entry will never expire.\n */\n ttl?: number;\n};\nexport declare function patchConfigurable(config: RunnableConfig | undefined, patch: Record<string, any>): RunnableConfig;\nexport declare function patchCheckpointMap(config: RunnableConfig, metadata?: CheckpointMetadata): RunnableConfig;\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 declare function combineAbortSignals(...x: (AbortSignal | undefined)[]): {\n signal: AbortSignal | undefined;\n dispose?: () => void;\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 declare const combineCallbacks: (callback1?: Callbacks | undefined, callback2?: Callbacks | undefined) => Callbacks | undefined;\n"],"mappings":";;;;;KAMYO,WAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+BAC,WAAAA"}
@@ -12,7 +12,6 @@ function getNullChannelVersion(currentVersions) {
12
12
  if (versionType === "string") return "";
13
13
  break;
14
14
  }
15
- return void 0;
16
15
  }
17
16
  function getNewChannelVersions(previousVersions, currentVersions) {
18
17
  if (Object.keys(previousVersions).length > 0) {
@@ -83,7 +82,7 @@ function combineAbortSignals(...x) {
83
82
  * @returns A single callback that is a combination of the input callbacks.
84
83
  */
85
84
  const combineCallbacks = (callback1, callback2) => {
86
- if (!callback1 && !callback2) return void 0;
85
+ if (!callback1 && !callback2) return;
87
86
  if (!callback1) return callback2;
88
87
  if (!callback2) return callback1;
89
88
  if (Array.isArray(callback1) && Array.isArray(callback2)) return [...callback1, ...callback2];
@@ -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 * @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,gBAAgB;AAC5C,KAAI,iBAAiB,SAAU,QAAO;AACtC,KAAI,iBAAiB,SAAU,QAAO;AAGtC,MAAK,MAAM,OAAO,iBAAiB;AACjC,MAAI,CAAC,OAAO,UAAU,eAAe,KAAK,iBAAiB,KAAM;EACjE,MAAM,cAAc,OAAO,gBAAgB;AAC3C,MAAI,gBAAgB,SAAU,QAAO;AACrC,MAAI,gBAAgB,SAAU,QAAO;AACrC;;AAGF,QAAO;;AAGT,SAAgB,sBACd,kBACA,iBACiB;AAEjB,KAAI,OAAO,KAAK,kBAAkB,SAAS,GAAG;EAC5C,MAAM,cAAc,sBAAsB;AAC1C,SAAO,OAAO,YACZ,OAAO,QAAQ,iBAAiB,QAC7B,CAAC,GAAG,OAAO,KAAK,iBAAiB,MAAM;OAI5C,QAAO;;AAKX,SAAgB,cAAc,OAAY,YAAoB;AAC5D,QAAO,SACL,CAAC,MAAM,QAAQ,UAEf,EAAE,iBAAiB,SACnB,OAA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KAAI,MAAM,QAAQ,cAAc,MAAM,QAAQ,WAC5C,QAAO,CAAC,GAAG,WAAW,GAAG;AAE3B,KAAI,MAAM,QAAQ,WAChB,QAAO,CAAC,GAAG,WAAW;AAExB,KAAI,MAAM,QAAQ,WAChB,QAAO,CAAC,WAAW,GAAG;AAExB,QAAO,CAAC,WAAW"}
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,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;A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C/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"}
@@ -10,7 +10,6 @@ function findSubgraphPregel(candidate) {
10
10
  const candidates = [candidate];
11
11
  for (const candidate$1 of candidates) if (isPregelLike(candidate$1)) return candidate$1;
12
12
  else if (isRunnableSequence(candidate$1)) candidates.push(...candidate$1.steps);
13
- return void 0;
14
13
  }
15
14
 
16
15
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"subgraph.cjs","names":["candidate"],"sources":["../../../src/pregel/utils/subgraph.ts"],"sourcesContent":["import {\n RunnableSequence,\n Runnable,\n RunnableLike,\n} from \"@langchain/core/runnables\";\nimport type { PregelInterface } from \"../types.js\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction isRunnableSequence(\n x: RunnableSequence | Runnable\n): x is RunnableSequence {\n return \"steps\" in x && Array.isArray(x.steps);\n}\n\nexport function isPregelLike(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n x: PregelInterface<any, any> | RunnableLike<any, any, any>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): x is PregelInterface<any, any> {\n return \"lg_is_pregel\" in x && x.lg_is_pregel === true;\n}\n\nexport function findSubgraphPregel(\n candidate: Runnable\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): PregelInterface<any, any> | undefined {\n const candidates = [candidate];\n for (const candidate of candidates) {\n if (isPregelLike(candidate)) {\n return candidate;\n } else if (isRunnableSequence(candidate)) {\n candidates.push(...candidate.steps);\n }\n }\n return undefined;\n}\n"],"mappings":";;AAQA,SAAS,mBACP,GACuB;AACvB,QAAO,WAAW,KAAK,MAAM,QAAQ,EAAE;;AAGzC,SAAgB,aAEd,GAEgC;AAChC,QAAO,kBAAkB,KAAK,EAAE,iBAAiB;;AAGnD,SAAgB,mBACd,WAEuC;CACvC,MAAM,aAAa,CAAC;AACpB,MAAK,MAAMA,eAAa,WACtB,KAAI,aAAaA,aACf,QAAOA;UACE,mBAAmBA,aAC5B,YAAW,KAAK,GAAGA,YAAU;AAGjC,QAAO"}
1
+ {"version":3,"file":"subgraph.cjs","names":["candidate"],"sources":["../../../src/pregel/utils/subgraph.ts"],"sourcesContent":["import {\n RunnableSequence,\n Runnable,\n RunnableLike,\n} from \"@langchain/core/runnables\";\nimport type { PregelInterface } from \"../types.js\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction isRunnableSequence(\n x: RunnableSequence | Runnable\n): x is RunnableSequence {\n return \"steps\" in x && Array.isArray(x.steps);\n}\n\nexport function isPregelLike(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n x: PregelInterface<any, any> | RunnableLike<any, any, any>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): x is PregelInterface<any, any> {\n return \"lg_is_pregel\" in x && x.lg_is_pregel === true;\n}\n\nexport function findSubgraphPregel(\n candidate: Runnable\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): PregelInterface<any, any> | undefined {\n const candidates = [candidate];\n for (const candidate of candidates) {\n if (isPregelLike(candidate)) {\n return candidate;\n } else if (isRunnableSequence(candidate)) {\n candidates.push(...candidate.steps);\n }\n }\n return undefined;\n}\n"],"mappings":";;AAQA,SAAS,mBACP,GACuB;AACvB,QAAO,WAAW,KAAK,MAAM,QAAQ,EAAE,MAAM;;AAG/C,SAAgB,aAEd,GAEgC;AAChC,QAAO,kBAAkB,KAAK,EAAE,iBAAiB;;AAGnD,SAAgB,mBACd,WAEuC;CACvC,MAAM,aAAa,CAAC,UAAU;AAC9B,MAAK,MAAMA,eAAa,WACtB,KAAI,aAAaA,YAAU,CACzB,QAAOA;UACE,mBAAmBA,YAAU,CACtC,YAAW,KAAK,GAAGA,YAAU,MAAM"}
@@ -9,7 +9,6 @@ function findSubgraphPregel(candidate) {
9
9
  const candidates = [candidate];
10
10
  for (const candidate$1 of candidates) if (isPregelLike(candidate$1)) return candidate$1;
11
11
  else if (isRunnableSequence(candidate$1)) candidates.push(...candidate$1.steps);
12
- return void 0;
13
12
  }
14
13
 
15
14
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"subgraph.js","names":["candidate"],"sources":["../../../src/pregel/utils/subgraph.ts"],"sourcesContent":["import {\n RunnableSequence,\n Runnable,\n RunnableLike,\n} from \"@langchain/core/runnables\";\nimport type { PregelInterface } from \"../types.js\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction isRunnableSequence(\n x: RunnableSequence | Runnable\n): x is RunnableSequence {\n return \"steps\" in x && Array.isArray(x.steps);\n}\n\nexport function isPregelLike(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n x: PregelInterface<any, any> | RunnableLike<any, any, any>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): x is PregelInterface<any, any> {\n return \"lg_is_pregel\" in x && x.lg_is_pregel === true;\n}\n\nexport function findSubgraphPregel(\n candidate: Runnable\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): PregelInterface<any, any> | undefined {\n const candidates = [candidate];\n for (const candidate of candidates) {\n if (isPregelLike(candidate)) {\n return candidate;\n } else if (isRunnableSequence(candidate)) {\n candidates.push(...candidate.steps);\n }\n }\n return undefined;\n}\n"],"mappings":";AAQA,SAAS,mBACP,GACuB;AACvB,QAAO,WAAW,KAAK,MAAM,QAAQ,EAAE;;AAGzC,SAAgB,aAEd,GAEgC;AAChC,QAAO,kBAAkB,KAAK,EAAE,iBAAiB;;AAGnD,SAAgB,mBACd,WAEuC;CACvC,MAAM,aAAa,CAAC;AACpB,MAAK,MAAMA,eAAa,WACtB,KAAI,aAAaA,aACf,QAAOA;UACE,mBAAmBA,aAC5B,YAAW,KAAK,GAAGA,YAAU;AAGjC,QAAO"}
1
+ {"version":3,"file":"subgraph.js","names":["candidate"],"sources":["../../../src/pregel/utils/subgraph.ts"],"sourcesContent":["import {\n RunnableSequence,\n Runnable,\n RunnableLike,\n} from \"@langchain/core/runnables\";\nimport type { PregelInterface } from \"../types.js\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction isRunnableSequence(\n x: RunnableSequence | Runnable\n): x is RunnableSequence {\n return \"steps\" in x && Array.isArray(x.steps);\n}\n\nexport function isPregelLike(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n x: PregelInterface<any, any> | RunnableLike<any, any, any>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): x is PregelInterface<any, any> {\n return \"lg_is_pregel\" in x && x.lg_is_pregel === true;\n}\n\nexport function findSubgraphPregel(\n candidate: Runnable\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): PregelInterface<any, any> | undefined {\n const candidates = [candidate];\n for (const candidate of candidates) {\n if (isPregelLike(candidate)) {\n return candidate;\n } else if (isRunnableSequence(candidate)) {\n candidates.push(...candidate.steps);\n }\n }\n return undefined;\n}\n"],"mappings":";AAQA,SAAS,mBACP,GACuB;AACvB,QAAO,WAAW,KAAK,MAAM,QAAQ,EAAE,MAAM;;AAG/C,SAAgB,aAEd,GAEgC;AAChC,QAAO,kBAAkB,KAAK,EAAE,iBAAiB;;AAGnD,SAAgB,mBACd,WAEuC;CACvC,MAAM,aAAa,CAAC,UAAU;AAC9B,MAAK,MAAMA,eAAa,WACtB,KAAI,aAAaA,YAAU,CACzB,QAAOA;UACE,mBAAmBA,YAAU,CACtC,YAAW,KAAK,GAAGA,YAAU,MAAM"}