@langchain/langgraph 0.4.9 → 1.0.0-alpha.1

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 (505) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +1 -2
  3. package/dist/_virtual/rolldown_runtime.cjs +25 -0
  4. package/dist/channels/any_value.cjs +44 -63
  5. package/dist/channels/any_value.cjs.map +1 -0
  6. package/dist/channels/any_value.d.cts +24 -0
  7. package/dist/channels/any_value.d.cts.map +1 -0
  8. package/dist/channels/any_value.d.ts +16 -11
  9. package/dist/channels/any_value.d.ts.map +1 -0
  10. package/dist/channels/any_value.js +42 -57
  11. package/dist/channels/any_value.js.map +1 -1
  12. package/dist/channels/base.cjs +93 -133
  13. package/dist/channels/base.cjs.map +1 -0
  14. package/dist/channels/base.d.cts +79 -0
  15. package/dist/channels/base.d.cts.map +1 -0
  16. package/dist/channels/base.d.ts +77 -73
  17. package/dist/channels/base.d.ts.map +1 -0
  18. package/dist/channels/base.js +90 -127
  19. package/dist/channels/base.js.map +1 -1
  20. package/dist/channels/binop.cjs +47 -77
  21. package/dist/channels/binop.cjs.map +1 -0
  22. package/dist/channels/binop.d.cts +22 -0
  23. package/dist/channels/binop.d.cts.map +1 -0
  24. package/dist/channels/binop.d.ts +17 -12
  25. package/dist/channels/binop.d.ts.map +1 -0
  26. package/dist/channels/binop.js +45 -71
  27. package/dist/channels/binop.js.map +1 -1
  28. package/dist/channels/dynamic_barrier_value.cjs +72 -208
  29. package/dist/channels/dynamic_barrier_value.cjs.map +1 -0
  30. package/dist/channels/dynamic_barrier_value.d.cts +42 -0
  31. package/dist/channels/dynamic_barrier_value.d.cts.map +1 -0
  32. package/dist/channels/dynamic_barrier_value.d.ts +20 -35
  33. package/dist/channels/dynamic_barrier_value.d.ts.map +1 -0
  34. package/dist/channels/dynamic_barrier_value.js +69 -200
  35. package/dist/channels/dynamic_barrier_value.js.map +1 -1
  36. package/dist/channels/ephemeral_value.cjs +44 -70
  37. package/dist/channels/ephemeral_value.cjs.map +1 -0
  38. package/dist/channels/ephemeral_value.d.cts +22 -0
  39. package/dist/channels/ephemeral_value.d.cts.map +1 -0
  40. package/dist/channels/ephemeral_value.d.ts +18 -12
  41. package/dist/channels/ephemeral_value.d.ts.map +1 -0
  42. package/dist/channels/ephemeral_value.js +43 -65
  43. package/dist/channels/ephemeral_value.js.map +1 -1
  44. package/dist/channels/index.cjs +21 -10
  45. package/dist/channels/index.d.cts +9 -0
  46. package/dist/channels/index.d.ts +9 -7
  47. package/dist/channels/index.js +10 -3
  48. package/dist/channels/last_value.cjs +90 -140
  49. package/dist/channels/last_value.cjs.map +1 -0
  50. package/dist/channels/last_value.d.cts +42 -0
  51. package/dist/channels/last_value.d.cts.map +1 -0
  52. package/dist/channels/last_value.d.ts +27 -23
  53. package/dist/channels/last_value.d.ts.map +1 -0
  54. package/dist/channels/last_value.js +87 -133
  55. package/dist/channels/last_value.js.map +1 -1
  56. package/dist/channels/named_barrier_value.cjs +114 -170
  57. package/dist/channels/named_barrier_value.cjs.map +1 -0
  58. package/dist/channels/named_barrier_value.d.cts +46 -0
  59. package/dist/channels/named_barrier_value.d.cts.map +1 -0
  60. package/dist/channels/named_barrier_value.d.ts +32 -29
  61. package/dist/channels/named_barrier_value.d.ts.map +1 -0
  62. package/dist/channels/named_barrier_value.js +111 -163
  63. package/dist/channels/named_barrier_value.js.map +1 -1
  64. package/dist/channels/topic.cjs +63 -96
  65. package/dist/channels/topic.cjs.map +1 -0
  66. package/dist/channels/topic.d.cts +32 -0
  67. package/dist/channels/topic.d.cts.map +1 -0
  68. package/dist/channels/topic.d.ts +28 -19
  69. package/dist/channels/topic.d.ts.map +1 -0
  70. package/dist/channels/topic.js +61 -90
  71. package/dist/channels/topic.js.map +1 -1
  72. package/dist/constants.cjs +376 -452
  73. package/dist/constants.cjs.map +1 -0
  74. package/dist/constants.d.cts +285 -0
  75. package/dist/constants.d.cts.map +1 -0
  76. package/dist/constants.d.ts +113 -148
  77. package/dist/constants.d.ts.map +1 -0
  78. package/dist/constants.js +336 -444
  79. package/dist/constants.js.map +1 -1
  80. package/dist/errors.cjs +151 -179
  81. package/dist/errors.cjs.map +1 -0
  82. package/dist/errors.d.cts +81 -0
  83. package/dist/errors.d.cts.map +1 -0
  84. package/dist/errors.d.ts +56 -46
  85. package/dist/errors.d.ts.map +1 -0
  86. package/dist/errors.js +140 -165
  87. package/dist/errors.js.map +1 -1
  88. package/dist/func/index.cjs +292 -290
  89. package/dist/func/index.cjs.map +1 -0
  90. package/dist/func/index.d.cts +293 -0
  91. package/dist/func/index.d.cts.map +1 -0
  92. package/dist/func/index.d.ts +86 -72
  93. package/dist/func/index.d.ts.map +1 -0
  94. package/dist/func/index.js +288 -284
  95. package/dist/func/index.js.map +1 -1
  96. package/dist/func/types.d.cts +64 -0
  97. package/dist/func/types.d.cts.map +1 -0
  98. package/dist/func/types.d.ts +24 -19
  99. package/dist/func/types.d.ts.map +1 -0
  100. package/dist/graph/annotation.cjs +96 -120
  101. package/dist/graph/annotation.cjs.map +1 -0
  102. package/dist/graph/annotation.d.cts +116 -0
  103. package/dist/graph/annotation.d.cts.map +1 -0
  104. package/dist/graph/annotation.d.ts +33 -34
  105. package/dist/graph/annotation.d.ts.map +1 -0
  106. package/dist/graph/annotation.js +91 -112
  107. package/dist/graph/annotation.js.map +1 -1
  108. package/dist/graph/graph.cjs +419 -723
  109. package/dist/graph/graph.cjs.map +1 -0
  110. package/dist/graph/graph.d.cts +133 -0
  111. package/dist/graph/graph.d.cts.map +1 -0
  112. package/dist/graph/graph.d.ts +124 -91
  113. package/dist/graph/graph.d.ts.map +1 -0
  114. package/dist/graph/graph.js +412 -713
  115. package/dist/graph/graph.js.map +1 -1
  116. package/dist/graph/index.cjs +4 -17
  117. package/dist/graph/index.js +6 -5
  118. package/dist/graph/message.cjs +59 -104
  119. package/dist/graph/message.cjs.map +1 -0
  120. package/dist/graph/message.d.cts +19 -0
  121. package/dist/graph/message.d.cts.map +1 -0
  122. package/dist/graph/message.d.ts +11 -10
  123. package/dist/graph/message.d.ts.map +1 -0
  124. package/dist/graph/message.js +56 -98
  125. package/dist/graph/message.js.map +1 -1
  126. package/dist/graph/messages_annotation.cjs +106 -106
  127. package/dist/graph/messages_annotation.cjs.map +1 -0
  128. package/dist/graph/messages_annotation.d.cts +111 -0
  129. package/dist/graph/messages_annotation.d.cts.map +1 -0
  130. package/dist/graph/messages_annotation.d.ts +18 -9
  131. package/dist/graph/messages_annotation.d.ts.map +1 -0
  132. package/dist/graph/messages_annotation.js +100 -100
  133. package/dist/graph/messages_annotation.js.map +1 -1
  134. package/dist/graph/state.cjs +475 -779
  135. package/dist/graph/state.cjs.map +1 -0
  136. package/dist/graph/state.d.cts +231 -0
  137. package/dist/graph/state.d.cts.map +1 -0
  138. package/dist/graph/state.d.ts +148 -138
  139. package/dist/graph/state.d.ts.map +1 -0
  140. package/dist/graph/state.js +469 -769
  141. package/dist/graph/state.js.map +1 -1
  142. package/dist/graph/zod/index.cjs +10 -21
  143. package/dist/graph/zod/index.d.cts +3 -0
  144. package/dist/graph/zod/index.d.ts +3 -3
  145. package/dist/graph/zod/index.js +4 -4
  146. package/dist/graph/zod/meta.cjs +142 -177
  147. package/dist/graph/zod/meta.cjs.map +1 -0
  148. package/dist/graph/zod/meta.d.cts +116 -0
  149. package/dist/graph/zod/meta.d.cts.map +1 -0
  150. package/dist/graph/zod/meta.d.ts +99 -97
  151. package/dist/graph/zod/meta.d.ts.map +1 -0
  152. package/dist/graph/zod/meta.js +136 -170
  153. package/dist/graph/zod/meta.js.map +1 -1
  154. package/dist/graph/zod/plugin.cjs +36 -39
  155. package/dist/graph/zod/plugin.cjs.map +1 -0
  156. package/dist/graph/zod/plugin.js +34 -35
  157. package/dist/graph/zod/plugin.js.map +1 -1
  158. package/dist/graph/zod/schema.cjs +82 -110
  159. package/dist/graph/zod/schema.cjs.map +1 -0
  160. package/dist/graph/zod/schema.d.cts +38 -0
  161. package/dist/graph/zod/schema.d.cts.map +1 -0
  162. package/dist/graph/zod/schema.d.ts +12 -6
  163. package/dist/graph/zod/schema.d.ts.map +1 -0
  164. package/dist/graph/zod/schema.js +77 -103
  165. package/dist/graph/zod/schema.js.map +1 -1
  166. package/dist/graph/zod/zod-registry.cjs +41 -47
  167. package/dist/graph/zod/zod-registry.cjs.map +1 -0
  168. package/dist/graph/zod/zod-registry.d.cts +51 -0
  169. package/dist/graph/zod/zod-registry.d.cts.map +1 -0
  170. package/dist/graph/zod/zod-registry.d.ts +34 -26
  171. package/dist/graph/zod/zod-registry.d.ts.map +1 -0
  172. package/dist/graph/zod/zod-registry.js +37 -41
  173. package/dist/graph/zod/zod-registry.js.map +1 -1
  174. package/dist/hash.cjs +205 -267
  175. package/dist/hash.cjs.map +1 -0
  176. package/dist/hash.js +205 -265
  177. package/dist/hash.js.map +1 -1
  178. package/dist/index.cjs +111 -33
  179. package/dist/index.cjs.map +1 -0
  180. package/dist/index.d.cts +26 -0
  181. package/dist/index.d.ts +26 -5
  182. package/dist/index.js +19 -7
  183. package/dist/index.js.map +1 -1
  184. package/dist/interrupt.cjs +79 -85
  185. package/dist/interrupt.cjs.map +1 -0
  186. package/dist/interrupt.d.cts +49 -0
  187. package/dist/interrupt.d.cts.map +1 -0
  188. package/dist/interrupt.d.ts +6 -1
  189. package/dist/interrupt.d.ts.map +1 -0
  190. package/dist/interrupt.js +76 -80
  191. package/dist/interrupt.js.map +1 -1
  192. package/dist/prebuilt/agentName.cjs +139 -172
  193. package/dist/prebuilt/agentName.cjs.map +1 -0
  194. package/dist/prebuilt/agentName.d.cts +42 -0
  195. package/dist/prebuilt/agentName.d.cts.map +1 -0
  196. package/dist/prebuilt/agentName.d.ts +13 -21
  197. package/dist/prebuilt/agentName.d.ts.map +1 -0
  198. package/dist/prebuilt/agentName.js +139 -168
  199. package/dist/prebuilt/agentName.js.map +1 -1
  200. package/dist/prebuilt/agent_executor.cjs +42 -80
  201. package/dist/prebuilt/agent_executor.cjs.map +1 -0
  202. package/dist/prebuilt/agent_executor.d.cts +57 -0
  203. package/dist/prebuilt/agent_executor.d.cts.map +1 -0
  204. package/dist/prebuilt/agent_executor.d.ts +47 -38
  205. package/dist/prebuilt/agent_executor.d.ts.map +1 -0
  206. package/dist/prebuilt/agent_executor.js +40 -75
  207. package/dist/prebuilt/agent_executor.js.map +1 -1
  208. package/dist/prebuilt/chat_agent_executor.cjs +66 -128
  209. package/dist/prebuilt/chat_agent_executor.cjs.map +1 -0
  210. package/dist/prebuilt/chat_agent_executor.d.cts +23 -0
  211. package/dist/prebuilt/chat_agent_executor.d.cts.map +1 -0
  212. package/dist/prebuilt/chat_agent_executor.d.ts +18 -10
  213. package/dist/prebuilt/chat_agent_executor.d.ts.map +1 -0
  214. package/dist/prebuilt/chat_agent_executor.js +63 -123
  215. package/dist/prebuilt/chat_agent_executor.js.map +1 -1
  216. package/dist/prebuilt/index.cjs +15 -18
  217. package/dist/prebuilt/index.d.cts +8 -0
  218. package/dist/prebuilt/index.d.ts +8 -8
  219. package/dist/prebuilt/index.js +8 -7
  220. package/dist/prebuilt/interrupt.d.cts +73 -0
  221. package/dist/prebuilt/interrupt.d.cts.map +1 -0
  222. package/dist/prebuilt/interrupt.d.ts +32 -15
  223. package/dist/prebuilt/interrupt.d.ts.map +1 -0
  224. package/dist/prebuilt/react_agent_executor.cjs +317 -473
  225. package/dist/prebuilt/react_agent_executor.cjs.map +1 -0
  226. package/dist/prebuilt/react_agent_executor.d.cts +229 -0
  227. package/dist/prebuilt/react_agent_executor.d.cts.map +1 -0
  228. package/dist/prebuilt/react_agent_executor.d.ts +171 -143
  229. package/dist/prebuilt/react_agent_executor.d.ts.map +1 -0
  230. package/dist/prebuilt/react_agent_executor.js +315 -465
  231. package/dist/prebuilt/react_agent_executor.js.map +1 -1
  232. package/dist/prebuilt/tool_executor.cjs +45 -67
  233. package/dist/prebuilt/tool_executor.cjs.map +1 -0
  234. package/dist/prebuilt/tool_executor.d.cts +42 -0
  235. package/dist/prebuilt/tool_executor.d.cts.map +1 -0
  236. package/dist/prebuilt/tool_executor.d.ts +30 -24
  237. package/dist/prebuilt/tool_executor.d.ts.map +1 -0
  238. package/dist/prebuilt/tool_executor.js +44 -63
  239. package/dist/prebuilt/tool_executor.js.map +1 -1
  240. package/dist/prebuilt/tool_node.cjs +213 -275
  241. package/dist/prebuilt/tool_node.cjs.map +1 -0
  242. package/dist/prebuilt/tool_node.d.cts +151 -0
  243. package/dist/prebuilt/tool_node.d.cts.map +1 -0
  244. package/dist/prebuilt/tool_node.d.ts +30 -17
  245. package/dist/prebuilt/tool_node.d.ts.map +1 -0
  246. package/dist/prebuilt/tool_node.js +209 -268
  247. package/dist/prebuilt/tool_node.js.map +1 -1
  248. package/dist/pregel/algo.cjs +551 -692
  249. package/dist/pregel/algo.cjs.map +1 -0
  250. package/dist/pregel/algo.d.cts +13 -0
  251. package/dist/pregel/algo.d.cts.map +1 -0
  252. package/dist/pregel/algo.d.ts +8 -38
  253. package/dist/pregel/algo.d.ts.map +1 -0
  254. package/dist/pregel/algo.js +546 -683
  255. package/dist/pregel/algo.js.map +1 -1
  256. package/dist/pregel/call.cjs +46 -42
  257. package/dist/pregel/call.cjs.map +1 -0
  258. package/dist/pregel/call.js +43 -37
  259. package/dist/pregel/call.js.map +1 -1
  260. package/dist/pregel/debug.cjs +153 -223
  261. package/dist/pregel/debug.cjs.map +1 -0
  262. package/dist/pregel/debug.js +152 -215
  263. package/dist/pregel/debug.js.map +1 -1
  264. package/dist/pregel/index.cjs +1138 -1604
  265. package/dist/pregel/index.cjs.map +1 -0
  266. package/dist/pregel/index.d.cts +536 -0
  267. package/dist/pregel/index.d.cts.map +1 -0
  268. package/dist/pregel/index.d.ts +460 -422
  269. package/dist/pregel/index.d.ts.map +1 -0
  270. package/dist/pregel/index.js +1129 -1592
  271. package/dist/pregel/index.js.map +1 -1
  272. package/dist/pregel/io.cjs +127 -234
  273. package/dist/pregel/io.cjs.map +1 -0
  274. package/dist/pregel/io.js +122 -225
  275. package/dist/pregel/io.js.map +1 -1
  276. package/dist/pregel/loop.cjs +542 -954
  277. package/dist/pregel/loop.cjs.map +1 -0
  278. package/dist/pregel/loop.js +539 -948
  279. package/dist/pregel/loop.js.map +1 -1
  280. package/dist/pregel/messages.cjs +104 -196
  281. package/dist/pregel/messages.cjs.map +1 -0
  282. package/dist/pregel/messages.js +102 -191
  283. package/dist/pregel/messages.js.map +1 -1
  284. package/dist/pregel/read.cjs +150 -280
  285. package/dist/pregel/read.cjs.map +1 -0
  286. package/dist/pregel/read.d.cts +51 -0
  287. package/dist/pregel/read.d.cts.map +1 -0
  288. package/dist/pregel/read.d.ts +48 -46
  289. package/dist/pregel/read.d.ts.map +1 -0
  290. package/dist/pregel/read.js +147 -274
  291. package/dist/pregel/read.js.map +1 -1
  292. package/dist/pregel/remote.cjs +339 -458
  293. package/dist/pregel/remote.cjs.map +1 -0
  294. package/dist/pregel/remote.d.cts +121 -0
  295. package/dist/pregel/remote.d.cts.map +1 -0
  296. package/dist/pregel/remote.d.ts +79 -69
  297. package/dist/pregel/remote.d.ts.map +1 -0
  298. package/dist/pregel/remote.js +337 -453
  299. package/dist/pregel/remote.js.map +1 -1
  300. package/dist/pregel/retry.cjs +87 -138
  301. package/dist/pregel/retry.cjs.map +1 -0
  302. package/dist/pregel/retry.js +83 -130
  303. package/dist/pregel/retry.js.map +1 -1
  304. package/dist/pregel/runnable_types.d.cts +49 -0
  305. package/dist/pregel/runnable_types.d.cts.map +1 -0
  306. package/dist/pregel/runnable_types.d.ts +47 -17
  307. package/dist/pregel/runnable_types.d.ts.map +1 -0
  308. package/dist/pregel/runner.cjs +222 -315
  309. package/dist/pregel/runner.cjs.map +1 -0
  310. package/dist/pregel/runner.js +219 -308
  311. package/dist/pregel/runner.js.map +1 -1
  312. package/dist/pregel/stream.cjs +89 -130
  313. package/dist/pregel/stream.cjs.map +1 -0
  314. package/dist/pregel/stream.js +87 -125
  315. package/dist/pregel/stream.js.map +1 -1
  316. package/dist/pregel/types.cjs +25 -62
  317. package/dist/pregel/types.cjs.map +1 -0
  318. package/dist/pregel/types.d.cts +440 -0
  319. package/dist/pregel/types.d.cts.map +1 -0
  320. package/dist/pregel/types.d.ts +381 -432
  321. package/dist/pregel/types.d.ts.map +1 -0
  322. package/dist/pregel/types.js +23 -57
  323. package/dist/pregel/types.js.map +1 -1
  324. package/dist/pregel/utils/config.cjs +101 -147
  325. package/dist/pregel/utils/config.cjs.map +1 -0
  326. package/dist/pregel/utils/config.d.cts +36 -0
  327. package/dist/pregel/utils/config.d.cts.map +1 -0
  328. package/dist/pregel/utils/config.d.ts +12 -9
  329. package/dist/pregel/utils/config.d.ts.map +1 -0
  330. package/dist/pregel/utils/config.js +99 -143
  331. package/dist/pregel/utils/config.js.map +1 -1
  332. package/dist/pregel/utils/index.cjs +87 -125
  333. package/dist/pregel/utils/index.cjs.map +1 -0
  334. package/dist/pregel/utils/index.d.cts +51 -0
  335. package/dist/pregel/utils/index.d.cts.map +1 -0
  336. package/dist/pregel/utils/index.d.ts +45 -61
  337. package/dist/pregel/utils/index.d.ts.map +1 -0
  338. package/dist/pregel/utils/index.js +86 -120
  339. package/dist/pregel/utils/index.js.map +1 -1
  340. package/dist/pregel/utils/subgraph.cjs +15 -26
  341. package/dist/pregel/utils/subgraph.cjs.map +1 -0
  342. package/dist/pregel/utils/subgraph.js +12 -21
  343. package/dist/pregel/utils/subgraph.js.map +1 -1
  344. package/dist/pregel/validate.cjs +42 -92
  345. package/dist/pregel/validate.cjs.map +1 -0
  346. package/dist/pregel/validate.js +39 -84
  347. package/dist/pregel/validate.js.map +1 -1
  348. package/dist/pregel/write.cjs +87 -137
  349. package/dist/pregel/write.cjs.map +1 -0
  350. package/dist/pregel/write.d.cts +35 -0
  351. package/dist/pregel/write.d.cts.map +1 -0
  352. package/dist/pregel/write.d.ts +27 -23
  353. package/dist/pregel/write.d.ts.map +1 -0
  354. package/dist/pregel/write.js +83 -131
  355. package/dist/pregel/write.js.map +1 -1
  356. package/dist/remote.cjs +3 -6
  357. package/dist/remote.d.cts +2 -0
  358. package/dist/remote.d.ts +2 -1
  359. package/dist/remote.js +3 -2
  360. package/dist/setup/async_local_storage.cjs +10 -7
  361. package/dist/setup/async_local_storage.cjs.map +1 -0
  362. package/dist/setup/async_local_storage.js +7 -2
  363. package/dist/setup/async_local_storage.js.map +1 -1
  364. package/dist/ui/index.cjs +4 -0
  365. package/dist/ui/index.d.cts +5 -0
  366. package/dist/ui/index.d.ts +5 -0
  367. package/dist/ui/index.js +3 -0
  368. package/dist/ui/stream.cjs +145 -0
  369. package/dist/ui/stream.cjs.map +1 -0
  370. package/dist/ui/stream.d.cts +25 -0
  371. package/dist/ui/stream.d.cts.map +1 -0
  372. package/dist/ui/stream.d.ts +25 -0
  373. package/dist/ui/stream.d.ts.map +1 -0
  374. package/dist/ui/stream.js +143 -0
  375. package/dist/ui/stream.js.map +1 -0
  376. package/dist/ui/types.infer.d.cts +53 -0
  377. package/dist/ui/types.infer.d.cts.map +1 -0
  378. package/dist/ui/types.infer.d.ts +53 -0
  379. package/dist/ui/types.infer.d.ts.map +1 -0
  380. package/dist/ui/types.message.d.cts +95 -0
  381. package/dist/ui/types.message.d.cts.map +1 -0
  382. package/dist/ui/types.message.d.ts +95 -0
  383. package/dist/ui/types.message.d.ts.map +1 -0
  384. package/dist/ui/types.schema.d.cts +228 -0
  385. package/dist/ui/types.schema.d.cts.map +1 -0
  386. package/dist/ui/types.schema.d.ts +228 -0
  387. package/dist/ui/types.schema.d.ts.map +1 -0
  388. package/dist/utils.cjs +77 -147
  389. package/dist/utils.cjs.map +1 -0
  390. package/dist/utils.d.cts +32 -0
  391. package/dist/utils.d.cts.map +1 -0
  392. package/dist/utils.d.ts +29 -25
  393. package/dist/utils.d.ts.map +1 -0
  394. package/dist/utils.js +73 -140
  395. package/dist/utils.js.map +1 -1
  396. package/dist/web.cjs +96 -55
  397. package/dist/web.d.cts +23 -0
  398. package/dist/web.d.ts +23 -14
  399. package/dist/web.js +15 -8
  400. package/dist/writer.cjs +15 -0
  401. package/dist/writer.cjs.map +1 -0
  402. package/dist/writer.d.cts +5 -0
  403. package/dist/writer.d.cts.map +1 -0
  404. package/dist/writer.d.ts +5 -0
  405. package/dist/writer.d.ts.map +1 -0
  406. package/dist/writer.js +14 -0
  407. package/dist/writer.js.map +1 -0
  408. package/package.json +90 -83
  409. package/dist/channels/index.js.map +0 -1
  410. package/dist/func/types.cjs +0 -15
  411. package/dist/func/types.js +0 -12
  412. package/dist/func/types.js.map +0 -1
  413. package/dist/graph/index.d.ts +0 -4
  414. package/dist/graph/index.js.map +0 -1
  415. package/dist/graph/message.test.cjs +0 -196
  416. package/dist/graph/message.test.d.ts +0 -1
  417. package/dist/graph/message.test.js +0 -194
  418. package/dist/graph/message.test.js.map +0 -1
  419. package/dist/graph/zod/index.js.map +0 -1
  420. package/dist/graph/zod/plugin.d.ts +0 -28
  421. package/dist/hash.d.ts +0 -2
  422. package/dist/prebuilt/index.js.map +0 -1
  423. package/dist/prebuilt/interrupt.cjs +0 -3
  424. package/dist/prebuilt/interrupt.js +0 -2
  425. package/dist/prebuilt/interrupt.js.map +0 -1
  426. package/dist/pregel/call.d.ts +0 -16
  427. package/dist/pregel/debug.d.ts +0 -41
  428. package/dist/pregel/debug.test.cjs +0 -258
  429. package/dist/pregel/debug.test.d.ts +0 -1
  430. package/dist/pregel/debug.test.js +0 -256
  431. package/dist/pregel/debug.test.js.map +0 -1
  432. package/dist/pregel/io.d.ts +0 -30
  433. package/dist/pregel/io.mapCommand.test.cjs +0 -150
  434. package/dist/pregel/io.mapCommand.test.d.ts +0 -1
  435. package/dist/pregel/io.mapCommand.test.js +0 -148
  436. package/dist/pregel/io.mapCommand.test.js.map +0 -1
  437. package/dist/pregel/loop.d.ts +0 -147
  438. package/dist/pregel/messages.d.ts +0 -30
  439. package/dist/pregel/messages.test.cjs +0 -369
  440. package/dist/pregel/messages.test.d.ts +0 -1
  441. package/dist/pregel/messages.test.js +0 -367
  442. package/dist/pregel/messages.test.js.map +0 -1
  443. package/dist/pregel/read.test.cjs +0 -194
  444. package/dist/pregel/read.test.d.ts +0 -1
  445. package/dist/pregel/read.test.js +0 -192
  446. package/dist/pregel/read.test.js.map +0 -1
  447. package/dist/pregel/retry.d.ts +0 -17
  448. package/dist/pregel/runnable_types.cjs +0 -3
  449. package/dist/pregel/runnable_types.js +0 -2
  450. package/dist/pregel/runnable_types.js.map +0 -1
  451. package/dist/pregel/runner.d.ts +0 -79
  452. package/dist/pregel/runner.test.cjs +0 -66
  453. package/dist/pregel/runner.test.d.ts +0 -1
  454. package/dist/pregel/runner.test.js +0 -64
  455. package/dist/pregel/runner.test.js.map +0 -1
  456. package/dist/pregel/stream.d.ts +0 -40
  457. package/dist/pregel/utils/config.test.cjs +0 -214
  458. package/dist/pregel/utils/config.test.d.ts +0 -1
  459. package/dist/pregel/utils/config.test.js +0 -212
  460. package/dist/pregel/utils/config.test.js.map +0 -1
  461. package/dist/pregel/utils/subgraph.d.ts +0 -4
  462. package/dist/pregel/utils/subgraph.test.cjs +0 -83
  463. package/dist/pregel/utils/subgraph.test.d.ts +0 -1
  464. package/dist/pregel/utils/subgraph.test.js +0 -81
  465. package/dist/pregel/utils/subgraph.test.js.map +0 -1
  466. package/dist/pregel/validate.d.ts +0 -16
  467. package/dist/pregel/validate.test.cjs +0 -220
  468. package/dist/pregel/validate.test.d.ts +0 -1
  469. package/dist/pregel/validate.test.js +0 -218
  470. package/dist/pregel/validate.test.js.map +0 -1
  471. package/dist/pregel/write.test.cjs +0 -181
  472. package/dist/pregel/write.test.d.ts +0 -1
  473. package/dist/pregel/write.test.js +0 -179
  474. package/dist/pregel/write.test.js.map +0 -1
  475. package/dist/remote.js.map +0 -1
  476. package/dist/setup/async_local_storage.d.ts +0 -1
  477. package/dist/web.js.map +0 -1
  478. package/index.cjs +0 -1
  479. package/index.d.cts +0 -1
  480. package/index.d.ts +0 -1
  481. package/index.js +0 -1
  482. package/prebuilt.cjs +0 -1
  483. package/prebuilt.d.cts +0 -1
  484. package/prebuilt.d.ts +0 -1
  485. package/prebuilt.js +0 -1
  486. package/pregel.cjs +0 -1
  487. package/pregel.d.cts +0 -1
  488. package/pregel.d.ts +0 -1
  489. package/pregel.js +0 -1
  490. package/remote.cjs +0 -1
  491. package/remote.d.cts +0 -1
  492. package/remote.d.ts +0 -1
  493. package/remote.js +0 -1
  494. package/web.cjs +0 -1
  495. package/web.d.cts +0 -1
  496. package/web.d.ts +0 -1
  497. package/web.js +0 -1
  498. package/zod/schema.cjs +0 -1
  499. package/zod/schema.d.cts +0 -1
  500. package/zod/schema.d.ts +0 -1
  501. package/zod/schema.js +0 -1
  502. package/zod.cjs +0 -1
  503. package/zod.d.cts +0 -1
  504. package/zod.d.ts +0 -1
  505. package/zod.js +0 -1
@@ -0,0 +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","StreamOutputMap","TStreamMode","TStreamSubgraphs","NodeReturnType","K","StreamCustom","Multiple","Single","PregelOptions","StrRecord","ContextType","Channels","Array","TSubgraphs","T","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 StreamOutputMap<TStreamMode extends StreamMode | StreamMode[] | undefined, TStreamSubgraphs extends boolean, StreamUpdates, StreamValues, Nodes, NodeReturnType, StreamCustom> = (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> 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/**\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};\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,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AoMA6B,CAAAA,MApMY9B,QAoMZ8B,CAAAA;;;;;EAGzBI,cAAAA,CAAAA,EAlMSjC,KAkMK,CAAA,MAlMOd,KAkMP,CAAA,GAlMgBjC,GAkMhB;EACdiF;AACZ;;;iBAA6EvB,CAAAA,EA/LvDX,KA+LuDW,CAAAA,MA/L3CzB,KA+L2CyB,CAAAA,GA/LlC1D,GA+LkC0D;;;AAC7E;;gBAAuBsB,CAAAA,EAAAA,MA3LIlC,QA2LJkC,GA3LejC,KA2LfiC,CAAAA,MA3L2BlC,QA2L3BkC,CAAAA;;;;;;;;;;;;iBA/KJ7E;;;;gBAIDY;;;;WAILC;;;;UAIDZ;;;;UAIAE;;;;;mBAKSgB;;UAEJI,qBAAAA;;;;uBAIQb;mBACJG,0BAA0BsC;kBAC3BI;;;UAuBHJ,aAAAA;;;;;mBAKIhC;;;;iBAIFyB;;;;mBAIEhD;;;;sBAIGG;;;;;;;;;0BASIH;;;;kBAIR2B;;;;;KAKRsC,kCAAAA;;;;;;;;;KASAC,gCAAAA;;;;;;;;;;;;;;;KAeAC,eAAAA;;;;;;;;;;;;;KA0CAK,WAAAA;0CACgCpB;;;UAGhCrC;UACAC;;;cAGSyD,IAAAA;0CACuBrB;;;UAGhCpC;UACAD;;;;;;;;;;KAGoDyD;;KAGpDS,cAAAA;KACAC,gBAAAA;KACAC,YAAAA,oCAAgDV,iBAAiBd,kCAAkCc;KACnGd,QAAAA,GAAWsB,iBAAiBE,eAAeD"}
@@ -1,59 +1,25 @@
1
- export class Call {
2
- constructor({ func, name, input, retry, cache, callbacks }) {
3
- Object.defineProperty(this, "func", {
4
- enumerable: true,
5
- configurable: true,
6
- writable: true,
7
- value: void 0
8
- });
9
- Object.defineProperty(this, "name", {
10
- enumerable: true,
11
- configurable: true,
12
- writable: true,
13
- value: void 0
14
- });
15
- Object.defineProperty(this, "input", {
16
- enumerable: true,
17
- configurable: true,
18
- writable: true,
19
- value: void 0
20
- });
21
- Object.defineProperty(this, "retry", {
22
- enumerable: true,
23
- configurable: true,
24
- writable: true,
25
- value: void 0
26
- });
27
- Object.defineProperty(this, "cache", {
28
- enumerable: true,
29
- configurable: true,
30
- writable: true,
31
- value: void 0
32
- });
33
- Object.defineProperty(this, "callbacks", {
34
- enumerable: true,
35
- configurable: true,
36
- writable: true,
37
- value: void 0
38
- });
39
- Object.defineProperty(this, "__lg_type", {
40
- enumerable: true,
41
- configurable: true,
42
- writable: true,
43
- value: "call"
44
- });
45
- this.func = func;
46
- this.name = name;
47
- this.input = input;
48
- this.retry = retry;
49
- this.cache = cache;
50
- this.callbacks = callbacks;
51
- }
52
- }
53
- export function isCall(value) {
54
- return (typeof value === "object" &&
55
- value !== null &&
56
- "__lg_type" in value &&
57
- value.__lg_type === "call");
1
+ //#region src/pregel/types.ts
2
+ var Call = class {
3
+ func;
4
+ name;
5
+ input;
6
+ retry;
7
+ cache;
8
+ callbacks;
9
+ __lg_type = "call";
10
+ constructor({ func, name, input, retry, cache, callbacks }) {
11
+ this.func = func;
12
+ this.name = name;
13
+ this.input = input;
14
+ this.retry = retry;
15
+ this.cache = cache;
16
+ this.callbacks = callbacks;
17
+ }
18
+ };
19
+ function isCall(value) {
20
+ return typeof value === "object" && value !== null && "__lg_type" in value && value.__lg_type === "call";
58
21
  }
22
+
23
+ //#endregion
24
+ export { Call, isCall };
59
25
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/pregel/types.ts"],"names":[],"mappings":"AA+nBA,MAAM,OAAO,IAAI;IAef,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAe;QAdvE;;;;;WAAyD;QAEzD;;;;;WAAa;QAEb;;;;;WAAe;QAEf;;;;;WAAoB;QAEpB;;;;;WAAoB;QAEpB;;;;;WAAoB;QAEX;;;;mBAAY,MAAM;WAAC;QAG1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;CACF;AAED,MAAM,UAAU,MAAM,CAAC,KAAc;IACnC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,WAAW,IAAI,KAAK;QACpB,KAAK,CAAC,SAAS,KAAK,MAAM,CAC3B,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/pregel/types.ts"],"sourcesContent":["import type { Runnable, RunnableConfig } from \"@langchain/core/runnables\";\nimport type {\n All,\n PendingWrite,\n CheckpointMetadata,\n BaseCheckpointSaver,\n BaseStore,\n CheckpointListOptions,\n BaseCache,\n} from \"@langchain/langgraph-checkpoint\";\nimport { Graph as DrawableGraph } from \"@langchain/core/runnables/graph\";\nimport { IterableReadableStream } from \"@langchain/core/utils/stream\";\nimport type { BaseMessage } from \"@langchain/core/messages\";\nimport type { BaseChannel } from \"../channels/base.js\";\nimport type { PregelNode } from \"./read.js\";\nimport type { Interrupt } from \"../constants.js\";\nimport { CachePolicy, RetryPolicy } from \"./utils/index.js\";\nimport { LangGraphRunnableConfig } from \"./runnable_types.js\";\n\n/**\n * Selects the type of output you'll receive when streaming from the graph. See [Streaming](/langgraphjs/how-tos/#streaming) for more details.\n */\nexport type StreamMode =\n | \"values\"\n | \"updates\"\n | \"debug\"\n | \"messages\"\n | \"checkpoints\"\n | \"tasks\"\n | \"custom\";\n\nexport type Durability = \"exit\" | \"async\" | \"sync\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type PregelInputType = any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type PregelOutputType = any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype StreamMessageOutput = [BaseMessage, Record<string, any>];\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype StreamDebugOutput = Record<string, any>;\n\ntype StreamCheckpointsOutput<StreamValues> = {\n values: StreamValues;\n next: string[];\n config: RunnableConfig;\n metadata?: CheckpointMetadata;\n parentConfig?: RunnableConfig | undefined;\n tasks: PregelTaskDescription[];\n};\n\ninterface StreamTasksOutputBase {\n id: string;\n name: string;\n interrupts: Interrupt[];\n}\n\ninterface StreamTasksCreateOutput<StreamValues> extends StreamTasksOutputBase {\n input: StreamValues;\n triggers: string[];\n}\n\ninterface StreamTasksResultOutput<Keys, StreamUpdates>\n extends StreamTasksOutputBase {\n result: [Keys, StreamUpdates][];\n}\n\ntype StreamTasksOutput<StreamUpdates, StreamValues, Nodes = string> =\n | StreamTasksCreateOutput<StreamValues>\n | StreamTasksResultOutput<Nodes, StreamUpdates>;\n\ntype DefaultStreamMode = \"updates\";\n\nexport type StreamOutputMap<\n TStreamMode extends StreamMode | StreamMode[] | undefined,\n TStreamSubgraphs extends boolean,\n StreamUpdates,\n StreamValues,\n Nodes,\n NodeReturnType,\n StreamCustom\n> = (\n undefined extends TStreamMode\n ? []\n : StreamMode | StreamMode[] extends TStreamMode\n ? TStreamMode extends StreamMode[]\n ? TStreamMode[number]\n : TStreamMode\n : TStreamMode extends StreamMode[]\n ? TStreamMode[number]\n : []\n) extends infer Multiple extends StreamMode\n ? [TStreamSubgraphs] extends [true]\n ? {\n values: [string[], \"values\", StreamValues];\n updates: [\n string[],\n \"updates\",\n NodeReturnType extends Record<string, unknown>\n ? { [K in keyof NodeReturnType]?: NodeReturnType[K] }\n : Record<Nodes extends string ? Nodes : string, StreamUpdates>\n ];\n messages: [string[], \"messages\", StreamMessageOutput];\n custom: [string[], \"custom\", StreamCustom];\n checkpoints: [\n string[],\n \"checkpoints\",\n StreamCheckpointsOutput<StreamValues>\n ];\n tasks: [\n string[],\n \"tasks\",\n StreamTasksOutput<StreamUpdates, StreamValues>\n ];\n debug: [string[], \"debug\", StreamDebugOutput];\n }[Multiple]\n : {\n values: [\"values\", StreamValues];\n updates: [\n \"updates\",\n NodeReturnType extends Record<string, unknown>\n ? { [K in keyof NodeReturnType]?: NodeReturnType[K] }\n : Record<Nodes extends string ? Nodes : string, StreamUpdates>\n ];\n messages: [\"messages\", StreamMessageOutput];\n custom: [\"custom\", StreamCustom];\n checkpoints: [\"checkpoints\", StreamCheckpointsOutput<StreamValues>];\n tasks: [\"tasks\", StreamTasksOutput<StreamUpdates, StreamValues, Nodes>];\n debug: [\"debug\", StreamDebugOutput];\n }[Multiple]\n : (\n undefined extends TStreamMode ? DefaultStreamMode : TStreamMode\n ) extends infer Single extends StreamMode\n ? [TStreamSubgraphs] extends [true]\n ? {\n values: [string[], StreamValues];\n updates: [\n string[],\n NodeReturnType extends Record<string, unknown>\n ? { [K in keyof NodeReturnType]?: NodeReturnType[K] }\n : Record<Nodes extends string ? Nodes : string, StreamUpdates>\n ];\n messages: [string[], StreamMessageOutput];\n custom: [string[], StreamCustom];\n checkpoints: [string[], StreamCheckpointsOutput<StreamValues>];\n tasks: [\n string[],\n StreamTasksOutput<StreamUpdates, StreamValues, Nodes>\n ];\n debug: [string[], StreamDebugOutput];\n }[Single]\n : {\n values: StreamValues;\n updates: NodeReturnType extends Record<string, unknown>\n ? { [K in keyof NodeReturnType]?: NodeReturnType[K] }\n : Record<Nodes extends string ? Nodes : string, StreamUpdates>;\n messages: StreamMessageOutput;\n custom: StreamCustom;\n checkpoints: StreamCheckpointsOutput<StreamValues>;\n tasks: StreamTasksOutput<StreamUpdates, StreamValues, Nodes>;\n debug: StreamDebugOutput;\n }[Single]\n : never;\n\n/**\n * Configuration options for executing a Pregel graph.\n * These options control how the graph executes, what data is streamed, and how interrupts are handled.\n *\n * @typeParam Nodes - Mapping of node names to their {@link PregelNode} implementations\n * @typeParam Channels - Mapping of channel names to their {@link BaseChannel} implementations\n * @typeParam ContextType - Type of context that can be passed to the graph\n */\nexport interface PregelOptions<\n Nodes extends StrRecord<string, PregelNode>,\n Channels extends StrRecord<string, BaseChannel>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ContextType extends Record<string, any> = Record<string, any>,\n TStreamMode extends StreamMode | StreamMode[] | undefined =\n | StreamMode\n | StreamMode[]\n | undefined,\n TSubgraphs extends boolean = boolean\n> extends RunnableConfig<ContextType> {\n /**\n * Controls what information is streamed during graph execution.\n * Multiple modes can be enabled simultaneously.\n *\n * Supported modes:\n * - \"values\": Streams complete state after each step\n * - \"updates\": Streams only state changes after each step\n * - \"messages\": Streams messages from within nodes\n * - \"custom\": Streams custom events from within nodes\n * - \"debug\": Streams detailed execution events for tracing & debugging\n *\n * @example\n * ```typescript\n * // Stream only values\n * streamMode: \"values\"\n *\n * // Stream both values and debug info\n * streamMode: [\"values\", \"debug\"]\n * ```\n *\n * @default [\"values\"]\n */\n streamMode?: TStreamMode;\n\n /**\n * Specifies which channel keys to retrieve from the checkpoint when resuming execution.\n * This is an advanced option that you generally don't need to set manually.\n * The graph will automatically determine the appropriate input keys based on its configuration.\n */\n inputKeys?: keyof Channels | Array<keyof Channels>;\n\n /**\n * Specifies which channel keys to include in the output stream and final result.\n * Use this to filter which parts of the graph state you want to observe.\n *\n * @example\n * ```typescript\n * // Stream only the 'result' channel\n * outputKeys: \"result\"\n *\n * // Stream multiple channels\n * outputKeys: [\"result\", \"intermediateState\"]\n * ```\n */\n outputKeys?: keyof Channels | Array<keyof Channels>;\n\n /**\n * List of nodes where execution should be interrupted BEFORE the node runs.\n * Can be used for debugging and advanced state manipulation use cases. For\n * human-in-the-loop workflows, developers should prefer the\n * @link {interrupt} function instead.\n *\n * When interrupted, a resume @link {Command} must be provided to continue\n * execution.\n *\n * @example\n * ```typescript\n * // Interrupt before specific nodes\n * interruptBefore: [\"humanReview\", \"qualityCheck\"]\n *\n * // Interrupt before all nodes\n * interruptBefore: \"all\"\n * ```\n */\n interruptBefore?: All | Array<keyof Nodes>;\n\n /**\n * List of nodes where execution should be interrupted AFTER the node runs.\n * Similar to interruptBefore, but interrupts after node completion.\n * Useful when the node's output needs to be reviewed before proceeding.\n *\n * @example\n * ```typescript\n * // Interrupt after specific nodes\n * interruptAfter: [\"generateContent\", \"analyze\"]\n *\n * // Interrupt after all nodes\n * interruptAfter: \"all\"\n * ```\n */\n interruptAfter?: All | Array<keyof Nodes>;\n\n /**\n * Enables detailed debug logging during graph execution.\n * When enabled, prints information about:\n * - Task execution\n * - Channel updates\n * - Checkpoint writes\n *\n * @default false\n */\n debug?: boolean;\n\n /**\n * Whether to include subgraph execution details in the stream.\n * When true, state updates from nested graphs will also be streamed.\n *\n * @default false\n */\n subgraphs?: TSubgraphs;\n\n /**\n * Whether to checkpoint intermediate steps, defaults to `true`.\n * If `false`, only the final checkpoint is saved.\n * @deprecated Use `durability` instead.\n */\n checkpointDuring?: boolean;\n\n /**\n * Whether to checkpoint during the run (or only at the end/interruption).\n * - `\"async\"`: Save checkpoint asynchronously while the next step executes (default).\n * - `\"sync\"`: Save checkpoint synchronously before the next step starts.\n * - `\"exit\"`: Save checkpoint only when the graph exits.\n * @default \"async\"\n */\n durability?: Durability;\n\n /**\n * A shared value store that allows you to store and retrieve state across\n * threads. Useful for implementing long-term memory patterns.\n */\n store?: BaseStore;\n\n /**\n * Optional cache for the graph, useful for caching tasks.\n */\n cache?: BaseCache;\n\n /**\n * Static context for the graph run, like `userId`, `dbConnection` etc.\n */\n context?: ContextType;\n}\n\n/**\n * Construct a type with a set of properties K of type T\n */\ntype StrRecord<K extends string, T> = {\n [P in K]: T;\n};\n\nexport interface PregelInterface<\n Nodes extends StrRecord<string, PregelNode>,\n Channels extends StrRecord<string, BaseChannel>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ContextType extends Record<string, any> = StrRecord<string, any>\n> {\n lg_is_pregel: boolean;\n\n withConfig(config: RunnableConfig): PregelInterface<Nodes, Channels>;\n\n getGraphAsync(\n config: RunnableConfig & { xray?: boolean | number }\n ): Promise<DrawableGraph>;\n\n /** @deprecated Use getSubgraphsAsync instead. The async method will become the default in the next minor release. */\n getSubgraphs(\n namespace?: string,\n recurse?: boolean\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): Generator<[string, PregelInterface<any, any>]>;\n\n getSubgraphsAsync(\n namespace?: string,\n recurse?: boolean\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): AsyncGenerator<[string, PregelInterface<any, any>]>;\n\n getState(\n config: RunnableConfig,\n options?: { subgraphs?: boolean }\n ): Promise<StateSnapshot>;\n\n getStateHistory(\n config: RunnableConfig,\n options?: CheckpointListOptions\n ): AsyncIterableIterator<StateSnapshot>;\n\n updateState(\n inputConfig: LangGraphRunnableConfig,\n values: Record<string, unknown> | unknown,\n asNode?: keyof Nodes | string\n ): Promise<RunnableConfig>;\n\n stream(\n input: PregelInputType,\n options?: Partial<PregelOptions<Nodes, Channels, ContextType>>\n ): Promise<IterableReadableStream<PregelOutputType>>;\n\n invoke(\n input: PregelInputType,\n options?: Partial<PregelOptions<Nodes, Channels, ContextType>>\n ): Promise<PregelOutputType>;\n}\n\n/**\n * Parameters for creating a Pregel graph.\n * @internal\n */\nexport type PregelParams<\n Nodes extends StrRecord<string, PregelNode>,\n Channels extends StrRecord<string, BaseChannel>\n> = {\n /**\n * The name of the graph. @see {@link Runnable.name}\n */\n name?: string;\n\n /**\n * The nodes in the graph.\n */\n nodes: Nodes;\n\n /**\n * The channels in the graph.\n */\n channels: Channels;\n\n /**\n * Whether to validate the graph.\n *\n * @default true\n */\n autoValidate?: boolean;\n\n /**\n * The stream mode for the graph run. See [Streaming](/langgraphjs/how-tos/#streaming) for more details.\n *\n * @default [\"values\"]\n */\n streamMode?: StreamMode | StreamMode[];\n\n /**\n * The input channels for the graph run.\n */\n inputChannels: keyof Channels | Array<keyof Channels>;\n\n /**\n * The output channels for the graph run.\n */\n outputChannels: keyof Channels | Array<keyof Channels>;\n\n /**\n * After processing one of the nodes named in this list, the graph will be interrupted and a resume {@link Command} must be provided to proceed with the execution of this thread.\n * @default []\n */\n interruptAfter?: Array<keyof Nodes> | All;\n\n /**\n * Before processing one of the nodes named in this list, the graph will be interrupted and a resume {@link Command} must be provided to proceed with the execution of this thread.\n * @default []\n */\n interruptBefore?: Array<keyof Nodes> | All;\n\n /**\n * The channels to stream from the graph run.\n * @default []\n */\n streamChannels?: keyof Channels | Array<keyof Channels>;\n\n /**\n * @default undefined\n */\n stepTimeout?: number;\n\n /**\n * @default false\n */\n debug?: boolean;\n\n /**\n * The {@link BaseCheckpointSaver | checkpointer} to use for the graph run.\n */\n checkpointer?: BaseCheckpointSaver | boolean;\n\n /**\n * The default retry policy for this graph. For defaults, see {@link RetryPolicy}.\n */\n retryPolicy?: RetryPolicy;\n\n /**\n * The configuration for the graph run.\n */\n config?: LangGraphRunnableConfig;\n\n /**\n * External key-value store.\n */\n store?: BaseStore;\n\n /**\n * Storage used for node caching.\n */\n cache?: BaseCache;\n\n /**\n * The trigger to node mapping for the graph run.\n * @internal\n */\n triggerToNodes?: Record<string, string[]>;\n};\n\nexport interface PregelTaskDescription {\n readonly id: string;\n readonly name: string;\n readonly error?: unknown;\n readonly interrupts: Interrupt[];\n readonly state?: LangGraphRunnableConfig | StateSnapshot;\n readonly path?: TaskPath;\n readonly result?: unknown;\n}\n\ninterface CacheKey {\n ns: string[];\n key: string;\n ttl?: number;\n}\n\nexport interface PregelExecutableTask<\n NodeKey extends PropertyKey,\n ChannelKey extends PropertyKey\n> {\n readonly name: NodeKey;\n readonly input: unknown;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly proc: Runnable<any, any, LangGraphRunnableConfig>;\n readonly writes: PendingWrite<ChannelKey>[];\n readonly config?: LangGraphRunnableConfig;\n readonly triggers: Array<string>;\n readonly retry_policy?: RetryPolicy;\n readonly cache_key?: CacheKey;\n readonly id: string;\n readonly path?: TaskPath;\n readonly subgraphs?: Runnable[];\n readonly writers: Runnable[];\n}\n\nexport interface StateSnapshot {\n /**\n * Current values of channels\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly values: Record<string, any> | any;\n /**\n * Nodes to execute in the next step, if any\n */\n readonly next: Array<string>;\n /**\n * Config used to fetch this snapshot\n */\n readonly config: RunnableConfig;\n /**\n * Metadata about the checkpoint\n */\n readonly metadata?: CheckpointMetadata;\n /**\n * Time when the snapshot was created\n */\n readonly createdAt?: string;\n /**\n * Config used to fetch the parent snapshot, if any\n * @default undefined\n */\n readonly parentConfig?: RunnableConfig | undefined;\n /**\n * Tasks to execute in this step. If already attempted, may contain an error.\n */\n readonly tasks: PregelTaskDescription[];\n}\n\n/**\n * Options for subscribing to multiple channels.\n */\nexport type MultipleChannelSubscriptionOptions = {\n /**\n * Optional tags to associate with the subscription.\n */\n tags?: string[];\n};\n\n/**\n * Options for subscribing to a single channel.\n */\nexport type SingleChannelSubscriptionOptions = {\n /**\n * When specified, the channel mapping will be an object with this key pointing\n * to the array of channels to subscribe to. Otherwise, the channel mapping\n * will be an array of channels.\n */\n key?: string;\n /**\n * Optional tags to associate with the subscription.\n */\n tags?: string[];\n};\n\n/**\n * Options for getting the state of the graph.\n */\nexport type GetStateOptions = {\n /**\n * Whether to include subgraph states.\n * @default false\n */\n subgraphs?: boolean;\n};\n\n/**\n * Used for storing/retrieving internal execution state.\n *\n * @internal\n */\nexport type PregelScratchpad<Resume = unknown> = {\n /** Counter for tracking call invocations */\n callCounter: number;\n /** Counter for tracking interrupts */\n interruptCounter: number;\n /** List of resume values */\n resume: Resume[];\n /** Single resume value for null task ID */\n nullResume: Resume;\n\n consumeNullResume: () => Resume | undefined;\n /** Counter for tracking subgraph invocations */\n subgraphCounter: number;\n\n /** The input to the currently executing task */\n currentTaskInput: unknown;\n};\n\n/**\n * @internal\n */\nexport type PregelAbortSignals = {\n /** Aborts when the user calls `stream.cancel()` or aborts the {@link AbortSignal} that they passed in via the `signal` option */\n externalAbortSignal?: AbortSignal;\n\n /**\n * Aborts when the currently executing task throws any error other than a {@link GraphBubbleUp}\n */\n timeoutAbortSignal?: AbortSignal;\n\n /**\n * A reference to the AbortSignal that is passed to the node. Aborts on step timeout, stream cancel, or when an error is thrown.\n */\n composedAbortSignal?: AbortSignal;\n};\n\nexport type CallOptions = {\n func: (...args: unknown[]) => unknown | Promise<unknown>;\n name: string;\n input: unknown;\n cache?: CachePolicy;\n retry?: RetryPolicy;\n callbacks?: unknown;\n};\n\nexport class Call {\n func: (...args: unknown[]) => unknown | Promise<unknown>;\n\n name: string;\n\n input: unknown;\n\n retry?: RetryPolicy;\n\n cache?: CachePolicy;\n\n callbacks?: unknown;\n\n readonly __lg_type = \"call\";\n\n constructor({ func, name, input, retry, cache, callbacks }: CallOptions) {\n this.func = func;\n this.name = name;\n this.input = input;\n this.retry = retry;\n this.cache = cache;\n this.callbacks = callbacks;\n }\n}\n\nexport function isCall(value: unknown): value is Call {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"__lg_type\" in value &&\n value.__lg_type === \"call\"\n );\n}\n\nexport type SimpleTaskPath = [string, string | number];\nexport type VariadicTaskPath = [string, ...(string | number)[], boolean];\nexport type CallTaskPath =\n | [string, ...(string | number)[], Call]\n | [string, TaskPath, ...(string | number)[], Call];\nexport type TaskPath = SimpleTaskPath | CallTaskPath | VariadicTaskPath;\n"],"mappings":";AAmoBA,IAAa,OAAb,MAAkB;CAChB;CAEA;CAEA;CAEA;CAEA;CAEA;CAEA,AAAS,YAAY;CAErB,YAAY,EAAE,MAAM,MAAM,OAAO,OAAO,OAAO,aAA0B;AACvE,OAAK,OAAO;AACZ,OAAK,OAAO;AACZ,OAAK,QAAQ;AACb,OAAK,QAAQ;AACb,OAAK,QAAQ;AACb,OAAK,YAAY;;;AAIrB,SAAgB,OAAO,OAA+B;AACpD,QACE,OAAO,UAAU,YACjB,UAAU,QACV,eAAe,SACf,MAAM,cAAc"}
@@ -1,168 +1,122 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ensureLangGraphConfig = ensureLangGraphConfig;
4
- exports.getStore = getStore;
5
- exports.getWriter = getWriter;
6
- exports.getConfig = getConfig;
7
- exports.getCurrentTaskInput = getCurrentTaskInput;
8
- exports.recastCheckpointNamespace = recastCheckpointNamespace;
9
- exports.getParentCheckpointNamespace = getParentCheckpointNamespace;
10
- const singletons_1 = require("@langchain/core/singletons");
11
- const constants_js_1 = require("../../constants.cjs");
12
- const COPIABLE_KEYS = ["tags", "metadata", "callbacks", "configurable"];
1
+ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
+ const require_constants = require('../../constants.cjs');
3
+ const __langchain_core_singletons = require_rolldown_runtime.__toESM(require("@langchain/core/singletons"));
4
+
5
+ //#region src/pregel/utils/config.ts
6
+ const COPIABLE_KEYS = [
7
+ "tags",
8
+ "metadata",
9
+ "callbacks",
10
+ "configurable"
11
+ ];
13
12
  const CONFIG_KEYS = [
14
- "tags",
15
- "metadata",
16
- "callbacks",
17
- "runName",
18
- "maxConcurrency",
19
- "recursionLimit",
20
- "configurable",
21
- "runId",
22
- "outputKeys",
23
- "streamMode",
24
- "store",
25
- "writer",
26
- "context",
27
- "interruptBefore",
28
- "interruptAfter",
29
- "checkpointDuring",
30
- "durability",
31
- "signal",
13
+ "tags",
14
+ "metadata",
15
+ "callbacks",
16
+ "runName",
17
+ "maxConcurrency",
18
+ "recursionLimit",
19
+ "configurable",
20
+ "runId",
21
+ "outputKeys",
22
+ "streamMode",
23
+ "store",
24
+ "writer",
25
+ "interrupt",
26
+ "context",
27
+ "interruptBefore",
28
+ "interruptAfter",
29
+ "checkpointDuring",
30
+ "durability",
31
+ "signal"
32
32
  ];
33
33
  const DEFAULT_RECURSION_LIMIT = 25;
34
34
  function ensureLangGraphConfig(...configs) {
35
- const empty = {
36
- tags: [],
37
- metadata: {},
38
- callbacks: undefined,
39
- recursionLimit: DEFAULT_RECURSION_LIMIT,
40
- configurable: {},
41
- };
42
- const implicitConfig = singletons_1.AsyncLocalStorageProviderSingleton.getRunnableConfig();
43
- if (implicitConfig !== undefined) {
44
- for (const [k, v] of Object.entries(implicitConfig)) {
45
- if (v !== undefined) {
46
- if (COPIABLE_KEYS.includes(k)) {
47
- let copiedValue;
48
- if (Array.isArray(v)) {
49
- copiedValue = [...v];
50
- }
51
- else if (typeof v === "object") {
52
- if (k === "callbacks" &&
53
- "copy" in v &&
54
- typeof v.copy === "function") {
55
- copiedValue = v.copy();
56
- }
57
- else {
58
- copiedValue = { ...v };
59
- }
60
- }
61
- else {
62
- copiedValue = v;
63
- }
64
- empty[k] = copiedValue;
65
- }
66
- else {
67
- empty[k] = v;
68
- }
69
- }
70
- }
71
- }
72
- for (const config of configs) {
73
- if (config === undefined) {
74
- continue;
75
- }
76
- for (const [k, v] of Object.entries(config)) {
77
- if (v !== undefined && CONFIG_KEYS.includes(k)) {
78
- empty[k] = v;
79
- }
80
- }
81
- }
82
- for (const [key, value] of Object.entries(empty.configurable)) {
83
- empty.metadata = empty.metadata ?? {};
84
- if (!key.startsWith("__") &&
85
- (typeof value === "string" ||
86
- typeof value === "number" ||
87
- typeof value === "boolean") &&
88
- !(key in empty.metadata)) {
89
- empty.metadata[key] = value;
90
- }
91
- }
92
- return empty;
35
+ const empty = {
36
+ tags: [],
37
+ metadata: {},
38
+ callbacks: void 0,
39
+ recursionLimit: DEFAULT_RECURSION_LIMIT,
40
+ configurable: {}
41
+ };
42
+ const implicitConfig = __langchain_core_singletons.AsyncLocalStorageProviderSingleton.getRunnableConfig();
43
+ if (implicitConfig !== void 0) {
44
+ for (const [k, v] of Object.entries(implicitConfig)) if (v !== void 0) if (COPIABLE_KEYS.includes(k)) {
45
+ let copiedValue;
46
+ if (Array.isArray(v)) copiedValue = [...v];
47
+ else if (typeof v === "object") if (k === "callbacks" && "copy" in v && typeof v.copy === "function") copiedValue = v.copy();
48
+ else copiedValue = { ...v };
49
+ else copiedValue = v;
50
+ empty[k] = copiedValue;
51
+ } else empty[k] = v;
52
+ }
53
+ for (const config of configs) {
54
+ if (config === void 0) continue;
55
+ for (const [k, v] of Object.entries(config)) if (v !== void 0 && CONFIG_KEYS.includes(k)) empty[k] = v;
56
+ }
57
+ for (const [key, value] of Object.entries(empty.configurable)) {
58
+ empty.metadata = empty.metadata ?? {};
59
+ if (!key.startsWith("__") && (typeof value === "string" || typeof value === "number" || typeof value === "boolean") && !(key in empty.metadata)) empty.metadata[key] = value;
60
+ }
61
+ return empty;
93
62
  }
94
63
  /**
95
- * A helper utility function that returns the {@link BaseStore} that was set when the graph was initialized
96
- *
97
- * @returns a reference to the {@link BaseStore} that was set when the graph was initialized
98
- */
64
+ * A helper utility function that returns the {@link BaseStore} that was set when the graph was initialized
65
+ *
66
+ * @returns a reference to the {@link BaseStore} that was set when the graph was initialized
67
+ */
99
68
  function getStore(config) {
100
- const runConfig = config ?? singletons_1.AsyncLocalStorageProviderSingleton.getRunnableConfig();
101
- if (runConfig === undefined) {
102
- throw new Error([
103
- "Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.",
104
- "If you're running `getStore` in such environment, pass the `config` from the node function directly.",
105
- ].join("\n"));
106
- }
107
- return runConfig?.store;
69
+ const runConfig = config ?? __langchain_core_singletons.AsyncLocalStorageProviderSingleton.getRunnableConfig();
70
+ 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
+ return runConfig?.store;
108
72
  }
109
73
  /**
110
- * A helper utility function that returns the {@link LangGraphRunnableConfig#writer} if "custom" stream mode is enabled, otherwise undefined.
111
- *
112
- * @returns a reference to the {@link LangGraphRunnableConfig#writer} if "custom" stream mode is enabled, otherwise undefined
113
- */
74
+ * A helper utility function that returns the {@link LangGraphRunnableConfig#writer} if "custom" stream mode is enabled, otherwise undefined.
75
+ *
76
+ * @returns a reference to the {@link LangGraphRunnableConfig#writer} if "custom" stream mode is enabled, otherwise undefined
77
+ */
114
78
  function getWriter(config) {
115
- const runConfig = config ?? singletons_1.AsyncLocalStorageProviderSingleton.getRunnableConfig();
116
- if (runConfig === undefined) {
117
- throw new Error([
118
- "Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.",
119
- "If you're running `getWriter` in such environment, pass the `config` from the node function directly.",
120
- ].join("\n"));
121
- }
122
- return runConfig?.writer || runConfig?.configurable?.writer;
79
+ const runConfig = config ?? __langchain_core_singletons.AsyncLocalStorageProviderSingleton.getRunnableConfig();
80
+ 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
+ return runConfig?.writer || runConfig?.configurable?.writer;
123
82
  }
124
83
  /**
125
- * A helper utility function that returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized.
126
- *
127
- * Note: This only works when running in an environment that supports node:async_hooks and AsyncLocalStorage. If you're running this in a
128
- * web environment, access the LangGraphRunnableConfig from the node function directly.
129
- *
130
- * @returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized
131
- */
84
+ * A helper utility function that returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized.
85
+ *
86
+ * Note: This only works when running in an environment that supports node:async_hooks and AsyncLocalStorage. If you're running this in a
87
+ * web environment, access the LangGraphRunnableConfig from the node function directly.
88
+ *
89
+ * @returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized
90
+ */
132
91
  function getConfig() {
133
- return singletons_1.AsyncLocalStorageProviderSingleton.getRunnableConfig();
92
+ return __langchain_core_singletons.AsyncLocalStorageProviderSingleton.getRunnableConfig();
134
93
  }
135
94
  /**
136
- * A helper utility function that returns the input for the currently executing task
137
- *
138
- * @returns the input for the currently executing task
139
- */
95
+ * A helper utility function that returns the input for the currently executing task
96
+ *
97
+ * @returns the input for the currently executing task
98
+ */
140
99
  function getCurrentTaskInput(config) {
141
- const runConfig = config ?? singletons_1.AsyncLocalStorageProviderSingleton.getRunnableConfig();
142
- if (runConfig === undefined) {
143
- throw new Error([
144
- "Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.",
145
- "If you're running `getCurrentTaskInput` in such environment, pass the `config` from the node function directly.",
146
- ].join("\n"));
147
- }
148
- if (runConfig.configurable?.[constants_js_1.CONFIG_KEY_SCRATCHPAD]?.currentTaskInput ===
149
- undefined) {
150
- throw new Error("BUG: internal scratchpad not initialized.");
151
- }
152
- return runConfig.configurable[constants_js_1.CONFIG_KEY_SCRATCHPAD].currentTaskInput;
100
+ const runConfig = config ?? __langchain_core_singletons.AsyncLocalStorageProviderSingleton.getRunnableConfig();
101
+ 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
+ if (runConfig.configurable?.[require_constants.CONFIG_KEY_SCRATCHPAD]?.currentTaskInput === void 0) throw new Error("BUG: internal scratchpad not initialized.");
103
+ return runConfig.configurable[require_constants.CONFIG_KEY_SCRATCHPAD].currentTaskInput;
153
104
  }
154
105
  function recastCheckpointNamespace(namespace) {
155
- return namespace
156
- .split(constants_js_1.CHECKPOINT_NAMESPACE_SEPARATOR)
157
- .filter((part) => !part.match(/^\d+$/))
158
- .map((part) => part.split(constants_js_1.CHECKPOINT_NAMESPACE_END)[0])
159
- .join(constants_js_1.CHECKPOINT_NAMESPACE_SEPARATOR);
106
+ return namespace.split(require_constants.CHECKPOINT_NAMESPACE_SEPARATOR).filter((part) => !part.match(/^\d+$/)).map((part) => part.split(require_constants.CHECKPOINT_NAMESPACE_END)[0]).join(require_constants.CHECKPOINT_NAMESPACE_SEPARATOR);
160
107
  }
161
108
  function getParentCheckpointNamespace(namespace) {
162
- const parts = namespace.split(constants_js_1.CHECKPOINT_NAMESPACE_SEPARATOR);
163
- while (parts.length > 1 && parts[parts.length - 1].match(/^\d+$/)) {
164
- parts.pop();
165
- }
166
- return parts.slice(0, -1).join(constants_js_1.CHECKPOINT_NAMESPACE_SEPARATOR);
109
+ const parts = namespace.split(require_constants.CHECKPOINT_NAMESPACE_SEPARATOR);
110
+ while (parts.length > 1 && parts[parts.length - 1].match(/^\d+$/)) parts.pop();
111
+ return parts.slice(0, -1).join(require_constants.CHECKPOINT_NAMESPACE_SEPARATOR);
167
112
  }
168
- //# sourceMappingURL=config.js.map
113
+
114
+ //#endregion
115
+ exports.ensureLangGraphConfig = ensureLangGraphConfig;
116
+ exports.getConfig = getConfig;
117
+ exports.getCurrentTaskInput = getCurrentTaskInput;
118
+ exports.getParentCheckpointNamespace = getParentCheckpointNamespace;
119
+ exports.getStore = getStore;
120
+ exports.getWriter = getWriter;
121
+ exports.recastCheckpointNamespace = recastCheckpointNamespace;
122
+ //# sourceMappingURL=config.cjs.map
@@ -0,0 +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,MAA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I,KAAKA"}
@@ -0,0 +1,36 @@
1
+ import { LangGraphRunnableConfig } from "../runnable_types.cjs";
2
+ import { BaseStore } from "@langchain/langgraph-checkpoint";
3
+ import { RunnableConfig } from "@langchain/core/runnables";
4
+
5
+ //#region src/pregel/utils/config.d.ts
6
+
7
+ /**
8
+ * A helper utility function that returns the {@link BaseStore} that was set when the graph was initialized
9
+ *
10
+ * @returns a reference to the {@link BaseStore} that was set when the graph was initialized
11
+ */
12
+ declare function getStore(config?: LangGraphRunnableConfig): BaseStore | undefined;
13
+ /**
14
+ * A helper utility function that returns the {@link LangGraphRunnableConfig#writer} if "custom" stream mode is enabled, otherwise undefined.
15
+ *
16
+ * @returns a reference to the {@link LangGraphRunnableConfig#writer} if "custom" stream mode is enabled, otherwise undefined
17
+ */
18
+ declare function getWriter(config?: LangGraphRunnableConfig): ((chunk: unknown) => void) | undefined;
19
+ /**
20
+ * A helper utility function that returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized.
21
+ *
22
+ * Note: This only works when running in an environment that supports node:async_hooks and AsyncLocalStorage. If you're running this in a
23
+ * web environment, access the LangGraphRunnableConfig from the node function directly.
24
+ *
25
+ * @returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized
26
+ */
27
+ declare function getConfig(): LangGraphRunnableConfig;
28
+ /**
29
+ * A helper utility function that returns the input for the currently executing task
30
+ *
31
+ * @returns the input for the currently executing task
32
+ */
33
+ declare function getCurrentTaskInput<T = unknown>(config?: LangGraphRunnableConfig): T;
34
+ //#endregion
35
+ export { getConfig, getCurrentTaskInput, getStore, getWriter };
36
+ //# sourceMappingURL=config.d.cts.map
@@ -0,0 +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,19 +1,21 @@
1
- import { RunnableConfig } from "@langchain/core/runnables";
2
- import { BaseStore } from "@langchain/langgraph-checkpoint";
3
1
  import { LangGraphRunnableConfig } from "../runnable_types.js";
4
- export declare function ensureLangGraphConfig(...configs: (LangGraphRunnableConfig | undefined)[]): RunnableConfig;
2
+ import { BaseStore } from "@langchain/langgraph-checkpoint";
3
+ import { RunnableConfig } from "@langchain/core/runnables";
4
+
5
+ //#region src/pregel/utils/config.d.ts
6
+
5
7
  /**
6
8
  * A helper utility function that returns the {@link BaseStore} that was set when the graph was initialized
7
9
  *
8
10
  * @returns a reference to the {@link BaseStore} that was set when the graph was initialized
9
11
  */
10
- export declare function getStore(config?: LangGraphRunnableConfig): BaseStore | undefined;
12
+ declare function getStore(config?: LangGraphRunnableConfig): BaseStore | undefined;
11
13
  /**
12
14
  * A helper utility function that returns the {@link LangGraphRunnableConfig#writer} if "custom" stream mode is enabled, otherwise undefined.
13
15
  *
14
16
  * @returns a reference to the {@link LangGraphRunnableConfig#writer} if "custom" stream mode is enabled, otherwise undefined
15
17
  */
16
- export declare function getWriter(config?: LangGraphRunnableConfig): ((chunk: unknown) => void) | undefined;
18
+ declare function getWriter(config?: LangGraphRunnableConfig): ((chunk: unknown) => void) | undefined;
17
19
  /**
18
20
  * A helper utility function that returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized.
19
21
  *
@@ -22,12 +24,13 @@ export declare function getWriter(config?: LangGraphRunnableConfig): ((chunk: un
22
24
  *
23
25
  * @returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized
24
26
  */
25
- export declare function getConfig(): LangGraphRunnableConfig;
27
+ declare function getConfig(): LangGraphRunnableConfig;
26
28
  /**
27
29
  * A helper utility function that returns the input for the currently executing task
28
30
  *
29
31
  * @returns the input for the currently executing task
30
32
  */
31
- export declare function getCurrentTaskInput<T = unknown>(config?: LangGraphRunnableConfig): T;
32
- export declare function recastCheckpointNamespace(namespace: string): string;
33
- export declare function getParentCheckpointNamespace(namespace: string): string;
33
+ declare function getCurrentTaskInput<T = unknown>(config?: LangGraphRunnableConfig): T;
34
+ //#endregion
35
+ export { getConfig, getCurrentTaskInput, getStore, getWriter };
36
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +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"}