@langchain/langgraph 0.4.7 → 1.0.0-alpha.0

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 (494) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +1 -2
  3. package/dist/_virtual/rolldown_runtime.cjs +25 -0
  4. package/dist/channels/any_value.d.cts +26 -0
  5. package/dist/channels/any_value.d.cts.map +1 -0
  6. package/dist/channels/any_value.d.ts +16 -9
  7. package/dist/channels/any_value.d.ts.map +1 -0
  8. package/dist/channels/base.cjs +97 -133
  9. package/dist/channels/base.cjs.map +1 -0
  10. package/dist/channels/base.d.cts +73 -0
  11. package/dist/channels/base.d.cts.map +1 -0
  12. package/dist/channels/base.d.ts +73 -74
  13. package/dist/channels/base.d.ts.map +1 -0
  14. package/dist/channels/base.js +94 -127
  15. package/dist/channels/base.js.map +1 -1
  16. package/dist/channels/binop.cjs +47 -77
  17. package/dist/channels/binop.cjs.map +1 -0
  18. package/dist/channels/binop.d.cts +22 -0
  19. package/dist/channels/binop.d.cts.map +1 -0
  20. package/dist/channels/binop.d.ts +17 -12
  21. package/dist/channels/binop.d.ts.map +1 -0
  22. package/dist/channels/binop.js +45 -71
  23. package/dist/channels/binop.js.map +1 -1
  24. package/dist/channels/dynamic_barrier_value.d.cts +43 -0
  25. package/dist/channels/dynamic_barrier_value.d.cts.map +1 -0
  26. package/dist/channels/dynamic_barrier_value.d.ts +20 -34
  27. package/dist/channels/dynamic_barrier_value.d.ts.map +1 -0
  28. package/dist/channels/ephemeral_value.cjs +46 -70
  29. package/dist/channels/ephemeral_value.cjs.map +1 -0
  30. package/dist/channels/ephemeral_value.d.cts +23 -0
  31. package/dist/channels/ephemeral_value.d.cts.map +1 -0
  32. package/dist/channels/ephemeral_value.d.ts +18 -11
  33. package/dist/channels/ephemeral_value.d.ts.map +1 -0
  34. package/dist/channels/ephemeral_value.js +45 -65
  35. package/dist/channels/ephemeral_value.js.map +1 -1
  36. package/dist/channels/index.cjs +2 -10
  37. package/dist/channels/index.js +4 -3
  38. package/dist/channels/last_value.cjs +91 -140
  39. package/dist/channels/last_value.cjs.map +1 -0
  40. package/dist/channels/last_value.d.cts +30 -0
  41. package/dist/channels/last_value.d.cts.map +1 -0
  42. package/dist/channels/last_value.d.ts +15 -23
  43. package/dist/channels/last_value.d.ts.map +1 -0
  44. package/dist/channels/last_value.js +88 -133
  45. package/dist/channels/last_value.js.map +1 -1
  46. package/dist/channels/named_barrier_value.cjs +114 -170
  47. package/dist/channels/named_barrier_value.cjs.map +1 -0
  48. package/dist/channels/named_barrier_value.d.cts +33 -0
  49. package/dist/channels/named_barrier_value.d.cts.map +1 -0
  50. package/dist/channels/named_barrier_value.d.ts +19 -29
  51. package/dist/channels/named_barrier_value.d.ts.map +1 -0
  52. package/dist/channels/named_barrier_value.js +112 -163
  53. package/dist/channels/named_barrier_value.js.map +1 -1
  54. package/dist/channels/topic.cjs +63 -96
  55. package/dist/channels/topic.cjs.map +1 -0
  56. package/dist/channels/topic.d.cts +26 -0
  57. package/dist/channels/topic.d.cts.map +1 -0
  58. package/dist/channels/topic.d.ts +21 -18
  59. package/dist/channels/topic.d.ts.map +1 -0
  60. package/dist/channels/topic.js +61 -90
  61. package/dist/channels/topic.js.map +1 -1
  62. package/dist/constants.cjs +373 -452
  63. package/dist/constants.cjs.map +1 -0
  64. package/dist/constants.d.cts +284 -0
  65. package/dist/constants.d.cts.map +1 -0
  66. package/dist/constants.d.ts +112 -148
  67. package/dist/constants.d.ts.map +1 -0
  68. package/dist/constants.js +333 -444
  69. package/dist/constants.js.map +1 -1
  70. package/dist/errors.cjs +150 -179
  71. package/dist/errors.cjs.map +1 -0
  72. package/dist/errors.d.cts +80 -0
  73. package/dist/errors.d.cts.map +1 -0
  74. package/dist/errors.d.ts +55 -46
  75. package/dist/errors.d.ts.map +1 -0
  76. package/dist/errors.js +139 -165
  77. package/dist/errors.js.map +1 -1
  78. package/dist/func/index.cjs +289 -290
  79. package/dist/func/index.cjs.map +1 -0
  80. package/dist/func/index.d.cts +289 -0
  81. package/dist/func/index.d.cts.map +1 -0
  82. package/dist/func/index.d.ts +81 -71
  83. package/dist/func/index.d.ts.map +1 -0
  84. package/dist/func/index.js +285 -284
  85. package/dist/func/index.js.map +1 -1
  86. package/dist/func/types.d.cts +64 -0
  87. package/dist/func/types.d.cts.map +1 -0
  88. package/dist/func/types.d.ts +24 -19
  89. package/dist/func/types.d.ts.map +1 -0
  90. package/dist/graph/annotation.cjs +96 -120
  91. package/dist/graph/annotation.cjs.map +1 -0
  92. package/dist/graph/annotation.d.cts +116 -0
  93. package/dist/graph/annotation.d.cts.map +1 -0
  94. package/dist/graph/annotation.d.ts +33 -34
  95. package/dist/graph/annotation.d.ts.map +1 -0
  96. package/dist/graph/annotation.js +91 -112
  97. package/dist/graph/annotation.js.map +1 -1
  98. package/dist/graph/graph.cjs +419 -723
  99. package/dist/graph/graph.cjs.map +1 -0
  100. package/dist/graph/graph.d.cts +131 -0
  101. package/dist/graph/graph.d.cts.map +1 -0
  102. package/dist/graph/graph.d.ts +122 -91
  103. package/dist/graph/graph.d.ts.map +1 -0
  104. package/dist/graph/graph.js +412 -713
  105. package/dist/graph/graph.js.map +1 -1
  106. package/dist/graph/index.cjs +4 -17
  107. package/dist/graph/index.js +6 -5
  108. package/dist/graph/message.cjs +59 -104
  109. package/dist/graph/message.cjs.map +1 -0
  110. package/dist/graph/message.d.cts +19 -0
  111. package/dist/graph/message.d.cts.map +1 -0
  112. package/dist/graph/message.d.ts +11 -10
  113. package/dist/graph/message.d.ts.map +1 -0
  114. package/dist/graph/message.js +56 -98
  115. package/dist/graph/message.js.map +1 -1
  116. package/dist/graph/messages_annotation.cjs +106 -106
  117. package/dist/graph/messages_annotation.cjs.map +1 -0
  118. package/dist/graph/messages_annotation.d.cts +111 -0
  119. package/dist/graph/messages_annotation.d.cts.map +1 -0
  120. package/dist/graph/messages_annotation.d.ts +18 -9
  121. package/dist/graph/messages_annotation.d.ts.map +1 -0
  122. package/dist/graph/messages_annotation.js +100 -100
  123. package/dist/graph/messages_annotation.js.map +1 -1
  124. package/dist/graph/state.cjs +476 -777
  125. package/dist/graph/state.cjs.map +1 -0
  126. package/dist/graph/state.d.cts +216 -0
  127. package/dist/graph/state.d.cts.map +1 -0
  128. package/dist/graph/state.d.ts +129 -134
  129. package/dist/graph/state.d.ts.map +1 -0
  130. package/dist/graph/state.js +470 -768
  131. package/dist/graph/state.js.map +1 -1
  132. package/dist/graph/zod/index.cjs +10 -21
  133. package/dist/graph/zod/index.d.cts +3 -0
  134. package/dist/graph/zod/index.d.ts +3 -3
  135. package/dist/graph/zod/index.js +4 -4
  136. package/dist/graph/zod/meta.cjs +142 -177
  137. package/dist/graph/zod/meta.cjs.map +1 -0
  138. package/dist/graph/zod/meta.d.cts +116 -0
  139. package/dist/graph/zod/meta.d.cts.map +1 -0
  140. package/dist/graph/zod/meta.d.ts +99 -97
  141. package/dist/graph/zod/meta.d.ts.map +1 -0
  142. package/dist/graph/zod/meta.js +136 -170
  143. package/dist/graph/zod/meta.js.map +1 -1
  144. package/dist/graph/zod/plugin.cjs +36 -39
  145. package/dist/graph/zod/plugin.cjs.map +1 -0
  146. package/dist/graph/zod/plugin.js +34 -35
  147. package/dist/graph/zod/plugin.js.map +1 -1
  148. package/dist/graph/zod/schema.cjs +82 -110
  149. package/dist/graph/zod/schema.cjs.map +1 -0
  150. package/dist/graph/zod/schema.d.cts +38 -0
  151. package/dist/graph/zod/schema.d.cts.map +1 -0
  152. package/dist/graph/zod/schema.d.ts +12 -6
  153. package/dist/graph/zod/schema.d.ts.map +1 -0
  154. package/dist/graph/zod/schema.js +77 -103
  155. package/dist/graph/zod/schema.js.map +1 -1
  156. package/dist/graph/zod/zod-registry.cjs +41 -47
  157. package/dist/graph/zod/zod-registry.cjs.map +1 -0
  158. package/dist/graph/zod/zod-registry.d.cts +51 -0
  159. package/dist/graph/zod/zod-registry.d.cts.map +1 -0
  160. package/dist/graph/zod/zod-registry.d.ts +34 -26
  161. package/dist/graph/zod/zod-registry.d.ts.map +1 -0
  162. package/dist/graph/zod/zod-registry.js +37 -41
  163. package/dist/graph/zod/zod-registry.js.map +1 -1
  164. package/dist/hash.cjs +205 -267
  165. package/dist/hash.cjs.map +1 -0
  166. package/dist/hash.js +205 -265
  167. package/dist/hash.js.map +1 -1
  168. package/dist/index.cjs +110 -33
  169. package/dist/index.cjs.map +1 -0
  170. package/dist/index.d.cts +25 -0
  171. package/dist/index.d.ts +25 -5
  172. package/dist/index.js +18 -7
  173. package/dist/index.js.map +1 -1
  174. package/dist/interrupt.cjs +79 -85
  175. package/dist/interrupt.cjs.map +1 -0
  176. package/dist/interrupt.d.cts +49 -0
  177. package/dist/interrupt.d.cts.map +1 -0
  178. package/dist/interrupt.d.ts +6 -1
  179. package/dist/interrupt.d.ts.map +1 -0
  180. package/dist/interrupt.js +76 -80
  181. package/dist/interrupt.js.map +1 -1
  182. package/dist/prebuilt/agentName.cjs +139 -172
  183. package/dist/prebuilt/agentName.cjs.map +1 -0
  184. package/dist/prebuilt/agentName.d.cts +42 -0
  185. package/dist/prebuilt/agentName.d.cts.map +1 -0
  186. package/dist/prebuilt/agentName.d.ts +13 -21
  187. package/dist/prebuilt/agentName.d.ts.map +1 -0
  188. package/dist/prebuilt/agentName.js +139 -168
  189. package/dist/prebuilt/agentName.js.map +1 -1
  190. package/dist/prebuilt/agent_executor.cjs +42 -80
  191. package/dist/prebuilt/agent_executor.cjs.map +1 -0
  192. package/dist/prebuilt/agent_executor.d.cts +57 -0
  193. package/dist/prebuilt/agent_executor.d.cts.map +1 -0
  194. package/dist/prebuilt/agent_executor.d.ts +46 -37
  195. package/dist/prebuilt/agent_executor.d.ts.map +1 -0
  196. package/dist/prebuilt/agent_executor.js +40 -75
  197. package/dist/prebuilt/agent_executor.js.map +1 -1
  198. package/dist/prebuilt/chat_agent_executor.cjs +66 -128
  199. package/dist/prebuilt/chat_agent_executor.cjs.map +1 -0
  200. package/dist/prebuilt/chat_agent_executor.d.cts +23 -0
  201. package/dist/prebuilt/chat_agent_executor.d.cts.map +1 -0
  202. package/dist/prebuilt/chat_agent_executor.d.ts +18 -10
  203. package/dist/prebuilt/chat_agent_executor.d.ts.map +1 -0
  204. package/dist/prebuilt/chat_agent_executor.js +63 -123
  205. package/dist/prebuilt/chat_agent_executor.js.map +1 -1
  206. package/dist/prebuilt/index.cjs +15 -18
  207. package/dist/prebuilt/index.d.cts +8 -0
  208. package/dist/prebuilt/index.d.ts +8 -8
  209. package/dist/prebuilt/index.js +8 -7
  210. package/dist/prebuilt/interrupt.d.cts +73 -0
  211. package/dist/prebuilt/interrupt.d.cts.map +1 -0
  212. package/dist/prebuilt/interrupt.d.ts +32 -15
  213. package/dist/prebuilt/interrupt.d.ts.map +1 -0
  214. package/dist/prebuilt/react_agent_executor.cjs +317 -473
  215. package/dist/prebuilt/react_agent_executor.cjs.map +1 -0
  216. package/dist/prebuilt/react_agent_executor.d.cts +229 -0
  217. package/dist/prebuilt/react_agent_executor.d.cts.map +1 -0
  218. package/dist/prebuilt/react_agent_executor.d.ts +171 -143
  219. package/dist/prebuilt/react_agent_executor.d.ts.map +1 -0
  220. package/dist/prebuilt/react_agent_executor.js +315 -465
  221. package/dist/prebuilt/react_agent_executor.js.map +1 -1
  222. package/dist/prebuilt/tool_executor.cjs +45 -67
  223. package/dist/prebuilt/tool_executor.cjs.map +1 -0
  224. package/dist/prebuilt/tool_executor.d.cts +42 -0
  225. package/dist/prebuilt/tool_executor.d.cts.map +1 -0
  226. package/dist/prebuilt/tool_executor.d.ts +30 -24
  227. package/dist/prebuilt/tool_executor.d.ts.map +1 -0
  228. package/dist/prebuilt/tool_executor.js +44 -63
  229. package/dist/prebuilt/tool_executor.js.map +1 -1
  230. package/dist/prebuilt/tool_node.cjs +213 -275
  231. package/dist/prebuilt/tool_node.cjs.map +1 -0
  232. package/dist/prebuilt/tool_node.d.cts +151 -0
  233. package/dist/prebuilt/tool_node.d.cts.map +1 -0
  234. package/dist/prebuilt/tool_node.d.ts +30 -17
  235. package/dist/prebuilt/tool_node.d.ts.map +1 -0
  236. package/dist/prebuilt/tool_node.js +209 -268
  237. package/dist/prebuilt/tool_node.js.map +1 -1
  238. package/dist/pregel/algo.cjs +521 -692
  239. package/dist/pregel/algo.cjs.map +1 -0
  240. package/dist/pregel/algo.d.cts +13 -0
  241. package/dist/pregel/algo.d.cts.map +1 -0
  242. package/dist/pregel/algo.d.ts +8 -38
  243. package/dist/pregel/algo.d.ts.map +1 -0
  244. package/dist/pregel/algo.js +516 -683
  245. package/dist/pregel/algo.js.map +1 -1
  246. package/dist/pregel/call.cjs +46 -42
  247. package/dist/pregel/call.cjs.map +1 -0
  248. package/dist/pregel/call.js +43 -37
  249. package/dist/pregel/call.js.map +1 -1
  250. package/dist/pregel/debug.cjs +153 -223
  251. package/dist/pregel/debug.cjs.map +1 -0
  252. package/dist/pregel/debug.js +152 -215
  253. package/dist/pregel/debug.js.map +1 -1
  254. package/dist/pregel/index.cjs +1134 -1604
  255. package/dist/pregel/index.cjs.map +1 -0
  256. package/dist/pregel/index.d.cts +534 -0
  257. package/dist/pregel/index.d.cts.map +1 -0
  258. package/dist/pregel/index.d.ts +458 -422
  259. package/dist/pregel/index.d.ts.map +1 -0
  260. package/dist/pregel/index.js +1125 -1592
  261. package/dist/pregel/index.js.map +1 -1
  262. package/dist/pregel/io.cjs +127 -234
  263. package/dist/pregel/io.cjs.map +1 -0
  264. package/dist/pregel/io.js +122 -225
  265. package/dist/pregel/io.js.map +1 -1
  266. package/dist/pregel/loop.cjs +539 -954
  267. package/dist/pregel/loop.cjs.map +1 -0
  268. package/dist/pregel/loop.js +536 -948
  269. package/dist/pregel/loop.js.map +1 -1
  270. package/dist/pregel/messages.cjs +104 -196
  271. package/dist/pregel/messages.cjs.map +1 -0
  272. package/dist/pregel/messages.js +102 -191
  273. package/dist/pregel/messages.js.map +1 -1
  274. package/dist/pregel/read.cjs +150 -280
  275. package/dist/pregel/read.cjs.map +1 -0
  276. package/dist/pregel/read.d.cts +51 -0
  277. package/dist/pregel/read.d.cts.map +1 -0
  278. package/dist/pregel/read.d.ts +48 -46
  279. package/dist/pregel/read.d.ts.map +1 -0
  280. package/dist/pregel/read.js +147 -274
  281. package/dist/pregel/read.js.map +1 -1
  282. package/dist/pregel/remote.cjs +339 -458
  283. package/dist/pregel/remote.cjs.map +1 -0
  284. package/dist/pregel/remote.d.cts +121 -0
  285. package/dist/pregel/remote.d.cts.map +1 -0
  286. package/dist/pregel/remote.d.ts +79 -69
  287. package/dist/pregel/remote.d.ts.map +1 -0
  288. package/dist/pregel/remote.js +337 -453
  289. package/dist/pregel/remote.js.map +1 -1
  290. package/dist/pregel/retry.cjs +87 -138
  291. package/dist/pregel/retry.cjs.map +1 -0
  292. package/dist/pregel/retry.js +83 -130
  293. package/dist/pregel/retry.js.map +1 -1
  294. package/dist/pregel/runnable_types.d.cts +25 -0
  295. package/dist/pregel/runnable_types.d.cts.map +1 -0
  296. package/dist/pregel/runnable_types.d.ts +22 -16
  297. package/dist/pregel/runnable_types.d.ts.map +1 -0
  298. package/dist/pregel/runner.cjs +222 -315
  299. package/dist/pregel/runner.cjs.map +1 -0
  300. package/dist/pregel/runner.js +219 -308
  301. package/dist/pregel/runner.js.map +1 -1
  302. package/dist/pregel/stream.cjs +89 -130
  303. package/dist/pregel/stream.cjs.map +1 -0
  304. package/dist/pregel/stream.js +87 -125
  305. package/dist/pregel/stream.js.map +1 -1
  306. package/dist/pregel/types.cjs +25 -62
  307. package/dist/pregel/types.cjs.map +1 -0
  308. package/dist/pregel/types.d.cts +437 -0
  309. package/dist/pregel/types.d.cts.map +1 -0
  310. package/dist/pregel/types.d.ts +377 -431
  311. package/dist/pregel/types.d.ts.map +1 -0
  312. package/dist/pregel/types.js +23 -57
  313. package/dist/pregel/types.js.map +1 -1
  314. package/dist/pregel/utils/config.cjs +100 -147
  315. package/dist/pregel/utils/config.cjs.map +1 -0
  316. package/dist/pregel/utils/config.d.cts +36 -0
  317. package/dist/pregel/utils/config.d.cts.map +1 -0
  318. package/dist/pregel/utils/config.d.ts +12 -9
  319. package/dist/pregel/utils/config.d.ts.map +1 -0
  320. package/dist/pregel/utils/config.js +98 -143
  321. package/dist/pregel/utils/config.js.map +1 -1
  322. package/dist/pregel/utils/index.cjs +87 -125
  323. package/dist/pregel/utils/index.cjs.map +1 -0
  324. package/dist/pregel/utils/index.d.cts +51 -0
  325. package/dist/pregel/utils/index.d.cts.map +1 -0
  326. package/dist/pregel/utils/index.d.ts +45 -61
  327. package/dist/pregel/utils/index.d.ts.map +1 -0
  328. package/dist/pregel/utils/index.js +86 -120
  329. package/dist/pregel/utils/index.js.map +1 -1
  330. package/dist/pregel/utils/subgraph.cjs +15 -26
  331. package/dist/pregel/utils/subgraph.cjs.map +1 -0
  332. package/dist/pregel/utils/subgraph.js +12 -21
  333. package/dist/pregel/utils/subgraph.js.map +1 -1
  334. package/dist/pregel/validate.cjs +42 -92
  335. package/dist/pregel/validate.cjs.map +1 -0
  336. package/dist/pregel/validate.js +39 -84
  337. package/dist/pregel/validate.js.map +1 -1
  338. package/dist/pregel/write.cjs +87 -137
  339. package/dist/pregel/write.cjs.map +1 -0
  340. package/dist/pregel/write.d.cts +35 -0
  341. package/dist/pregel/write.d.cts.map +1 -0
  342. package/dist/pregel/write.d.ts +27 -23
  343. package/dist/pregel/write.d.ts.map +1 -0
  344. package/dist/pregel/write.js +83 -131
  345. package/dist/pregel/write.js.map +1 -1
  346. package/dist/remote.cjs +3 -6
  347. package/dist/remote.d.cts +2 -0
  348. package/dist/remote.d.ts +2 -1
  349. package/dist/remote.js +3 -2
  350. package/dist/setup/async_local_storage.cjs +10 -7
  351. package/dist/setup/async_local_storage.cjs.map +1 -0
  352. package/dist/setup/async_local_storage.js +7 -2
  353. package/dist/setup/async_local_storage.js.map +1 -1
  354. package/dist/ui/index.cjs +4 -0
  355. package/dist/ui/index.d.cts +5 -0
  356. package/dist/ui/index.d.ts +5 -0
  357. package/dist/ui/index.js +3 -0
  358. package/dist/ui/stream.cjs +145 -0
  359. package/dist/ui/stream.cjs.map +1 -0
  360. package/dist/ui/stream.d.cts +25 -0
  361. package/dist/ui/stream.d.cts.map +1 -0
  362. package/dist/ui/stream.d.ts +25 -0
  363. package/dist/ui/stream.d.ts.map +1 -0
  364. package/dist/ui/stream.js +143 -0
  365. package/dist/ui/stream.js.map +1 -0
  366. package/dist/ui/types.infer.d.cts +53 -0
  367. package/dist/ui/types.infer.d.cts.map +1 -0
  368. package/dist/ui/types.infer.d.ts +53 -0
  369. package/dist/ui/types.infer.d.ts.map +1 -0
  370. package/dist/ui/types.message.d.cts +95 -0
  371. package/dist/ui/types.message.d.cts.map +1 -0
  372. package/dist/ui/types.message.d.ts +95 -0
  373. package/dist/ui/types.message.d.ts.map +1 -0
  374. package/dist/ui/types.schema.d.cts +228 -0
  375. package/dist/ui/types.schema.d.cts.map +1 -0
  376. package/dist/ui/types.schema.d.ts +228 -0
  377. package/dist/ui/types.schema.d.ts.map +1 -0
  378. package/dist/utils.cjs +77 -147
  379. package/dist/utils.cjs.map +1 -0
  380. package/dist/utils.d.cts +32 -0
  381. package/dist/utils.d.cts.map +1 -0
  382. package/dist/utils.d.ts +29 -25
  383. package/dist/utils.d.ts.map +1 -0
  384. package/dist/utils.js +73 -140
  385. package/dist/utils.js.map +1 -1
  386. package/dist/web.cjs +97 -55
  387. package/dist/web.d.cts +23 -0
  388. package/dist/web.d.ts +23 -14
  389. package/dist/web.js +15 -8
  390. package/package.json +77 -80
  391. package/dist/channels/any_value.cjs +0 -65
  392. package/dist/channels/any_value.js +0 -61
  393. package/dist/channels/any_value.js.map +0 -1
  394. package/dist/channels/dynamic_barrier_value.cjs +0 -212
  395. package/dist/channels/dynamic_barrier_value.js +0 -207
  396. package/dist/channels/dynamic_barrier_value.js.map +0 -1
  397. package/dist/channels/index.d.ts +0 -7
  398. package/dist/channels/index.js.map +0 -1
  399. package/dist/func/types.cjs +0 -15
  400. package/dist/func/types.js +0 -12
  401. package/dist/func/types.js.map +0 -1
  402. package/dist/graph/index.d.ts +0 -4
  403. package/dist/graph/index.js.map +0 -1
  404. package/dist/graph/message.test.cjs +0 -196
  405. package/dist/graph/message.test.d.ts +0 -1
  406. package/dist/graph/message.test.js +0 -194
  407. package/dist/graph/message.test.js.map +0 -1
  408. package/dist/graph/zod/index.js.map +0 -1
  409. package/dist/graph/zod/plugin.d.ts +0 -28
  410. package/dist/hash.d.ts +0 -2
  411. package/dist/prebuilt/index.js.map +0 -1
  412. package/dist/prebuilt/interrupt.cjs +0 -3
  413. package/dist/prebuilt/interrupt.js +0 -2
  414. package/dist/prebuilt/interrupt.js.map +0 -1
  415. package/dist/pregel/call.d.ts +0 -16
  416. package/dist/pregel/debug.d.ts +0 -41
  417. package/dist/pregel/debug.test.cjs +0 -258
  418. package/dist/pregel/debug.test.d.ts +0 -1
  419. package/dist/pregel/debug.test.js +0 -256
  420. package/dist/pregel/debug.test.js.map +0 -1
  421. package/dist/pregel/io.d.ts +0 -30
  422. package/dist/pregel/io.mapCommand.test.cjs +0 -150
  423. package/dist/pregel/io.mapCommand.test.d.ts +0 -1
  424. package/dist/pregel/io.mapCommand.test.js +0 -148
  425. package/dist/pregel/io.mapCommand.test.js.map +0 -1
  426. package/dist/pregel/loop.d.ts +0 -147
  427. package/dist/pregel/messages.d.ts +0 -30
  428. package/dist/pregel/messages.test.cjs +0 -369
  429. package/dist/pregel/messages.test.d.ts +0 -1
  430. package/dist/pregel/messages.test.js +0 -367
  431. package/dist/pregel/messages.test.js.map +0 -1
  432. package/dist/pregel/read.test.cjs +0 -194
  433. package/dist/pregel/read.test.d.ts +0 -1
  434. package/dist/pregel/read.test.js +0 -192
  435. package/dist/pregel/read.test.js.map +0 -1
  436. package/dist/pregel/retry.d.ts +0 -17
  437. package/dist/pregel/runnable_types.cjs +0 -3
  438. package/dist/pregel/runnable_types.js +0 -2
  439. package/dist/pregel/runnable_types.js.map +0 -1
  440. package/dist/pregel/runner.d.ts +0 -79
  441. package/dist/pregel/runner.test.cjs +0 -66
  442. package/dist/pregel/runner.test.d.ts +0 -1
  443. package/dist/pregel/runner.test.js +0 -64
  444. package/dist/pregel/runner.test.js.map +0 -1
  445. package/dist/pregel/stream.d.ts +0 -40
  446. package/dist/pregel/utils/config.test.cjs +0 -214
  447. package/dist/pregel/utils/config.test.d.ts +0 -1
  448. package/dist/pregel/utils/config.test.js +0 -212
  449. package/dist/pregel/utils/config.test.js.map +0 -1
  450. package/dist/pregel/utils/subgraph.d.ts +0 -4
  451. package/dist/pregel/utils/subgraph.test.cjs +0 -83
  452. package/dist/pregel/utils/subgraph.test.d.ts +0 -1
  453. package/dist/pregel/utils/subgraph.test.js +0 -81
  454. package/dist/pregel/utils/subgraph.test.js.map +0 -1
  455. package/dist/pregel/validate.d.ts +0 -16
  456. package/dist/pregel/validate.test.cjs +0 -220
  457. package/dist/pregel/validate.test.d.ts +0 -1
  458. package/dist/pregel/validate.test.js +0 -218
  459. package/dist/pregel/validate.test.js.map +0 -1
  460. package/dist/pregel/write.test.cjs +0 -181
  461. package/dist/pregel/write.test.d.ts +0 -1
  462. package/dist/pregel/write.test.js +0 -179
  463. package/dist/pregel/write.test.js.map +0 -1
  464. package/dist/remote.js.map +0 -1
  465. package/dist/setup/async_local_storage.d.ts +0 -1
  466. package/dist/web.js.map +0 -1
  467. package/index.cjs +0 -1
  468. package/index.d.cts +0 -1
  469. package/index.d.ts +0 -1
  470. package/index.js +0 -1
  471. package/prebuilt.cjs +0 -1
  472. package/prebuilt.d.cts +0 -1
  473. package/prebuilt.d.ts +0 -1
  474. package/prebuilt.js +0 -1
  475. package/pregel.cjs +0 -1
  476. package/pregel.d.cts +0 -1
  477. package/pregel.d.ts +0 -1
  478. package/pregel.js +0 -1
  479. package/remote.cjs +0 -1
  480. package/remote.d.cts +0 -1
  481. package/remote.d.ts +0 -1
  482. package/remote.js +0 -1
  483. package/web.cjs +0 -1
  484. package/web.d.cts +0 -1
  485. package/web.d.ts +0 -1
  486. package/web.js +0 -1
  487. package/zod/schema.cjs +0 -1
  488. package/zod/schema.d.cts +0 -1
  489. package/zod/schema.d.ts +0 -1
  490. package/zod/schema.js +0 -1
  491. package/zod.cjs +0 -1
  492. package/zod.d.cts +0 -1
  493. package/zod.d.ts +0 -1
  494. 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","StreamCustomOutput","StreamDebugOutput","StreamCheckpointsOutput","StreamValues","PregelTaskDescription","StreamTasksOutputBase","StreamTasksCreateOutput","StreamTasksResultOutput","Keys","StreamUpdates","StreamTasksOutput","Nodes","DefaultStreamMode","StreamOutputMap","TStreamMode","TStreamSubgraphs","NodeReturnType","K","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 StreamCustomOutput = 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> = (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\", StreamCustomOutput];\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\", StreamCustomOutput];\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[], StreamCustomOutput];\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: StreamCustomOutput;\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};\nexport interface PregelTaskDescription {\n readonly id: string;\n readonly name: string;\n readonly error?: unknown;\n readonly interrupts: Interrupt[];\n readonly state?: LangGraphRunnableConfig | StateSnapshot;\n readonly path?: TaskPath;\n readonly result?: unknown;\n}\ninterface CacheKey {\n ns: string[];\n key: string;\n ttl?: number;\n}\nexport interface PregelExecutableTask<NodeKey extends PropertyKey, ChannelKey extends PropertyKey> {\n readonly name: NodeKey;\n readonly input: unknown;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly proc: Runnable<any, any, LangGraphRunnableConfig>;\n readonly writes: PendingWrite<ChannelKey>[];\n readonly config?: LangGraphRunnableConfig;\n readonly triggers: Array<string>;\n readonly retry_policy?: RetryPolicy;\n readonly cache_key?: CacheKey;\n readonly id: string;\n readonly path?: TaskPath;\n readonly subgraphs?: Runnable[];\n readonly writers: Runnable[];\n}\nexport interface StateSnapshot {\n /**\n * Current values of channels\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly values: Record<string, any> | any;\n /**\n * Nodes to execute in the next step, if any\n */\n readonly next: Array<string>;\n /**\n * Config used to fetch this snapshot\n */\n readonly config: RunnableConfig;\n /**\n * Metadata about the checkpoint\n */\n readonly metadata?: CheckpointMetadata;\n /**\n * Time when the snapshot was created\n */\n readonly createdAt?: string;\n /**\n * Config used to fetch the parent snapshot, if any\n * @default undefined\n */\n readonly parentConfig?: RunnableConfig | undefined;\n /**\n * Tasks to execute in this step. If already attempted, may contain an error.\n */\n readonly tasks: PregelTaskDescription[];\n}\n/**\n * Options for subscribing to multiple channels.\n */\nexport type MultipleChannelSubscriptionOptions = {\n /**\n * Optional tags to associate with the subscription.\n */\n tags?: string[];\n};\n/**\n * Options for subscribing to a single channel.\n */\nexport type SingleChannelSubscriptionOptions = {\n /**\n * When specified, the channel mapping will be an object with this key pointing\n * to the array of channels to subscribe to. Otherwise, the channel mapping\n * will be an array of channels.\n */\n key?: string;\n /**\n * Optional tags to associate with the subscription.\n */\n tags?: string[];\n};\n/**\n * Options for getting the state of the graph.\n */\nexport type GetStateOptions = {\n /**\n * Whether to include subgraph states.\n * @default false\n */\n subgraphs?: boolean;\n};\n/**\n * Used for storing/retrieving internal execution state.\n *\n * @internal\n */\nexport type PregelScratchpad<Resume = unknown> = {\n /** Counter for tracking call invocations */\n callCounter: number;\n /** Counter for tracking interrupts */\n interruptCounter: number;\n /** List of resume values */\n resume: Resume[];\n /** Single resume value for null task ID */\n nullResume: Resume;\n consumeNullResume: () => Resume | undefined;\n /** Counter for tracking subgraph invocations */\n subgraphCounter: number;\n /** The input to the currently executing task */\n currentTaskInput: unknown;\n};\n/**\n * @internal\n */\nexport type PregelAbortSignals = {\n /** Aborts when the user calls `stream.cancel()` or aborts the {@link AbortSignal} that they passed in via the `signal` option */\n externalAbortSignal?: AbortSignal;\n /**\n * Aborts when the currently executing task throws any error other than a {@link GraphBubbleUp}\n */\n timeoutAbortSignal?: AbortSignal;\n /**\n * A reference to the AbortSignal that is passed to the node. Aborts on step timeout, stream cancel, or when an error is thrown.\n */\n composedAbortSignal?: AbortSignal;\n};\nexport type CallOptions = {\n func: (...args: unknown[]) => unknown | Promise<unknown>;\n name: string;\n input: unknown;\n cache?: CachePolicy;\n retry?: RetryPolicy;\n callbacks?: unknown;\n};\nexport declare class Call {\n func: (...args: unknown[]) => unknown | Promise<unknown>;\n name: string;\n input: unknown;\n retry?: RetryPolicy;\n cache?: CachePolicy;\n callbacks?: unknown;\n readonly __lg_type: string;\n constructor({ func, name, input, retry, cache, callbacks }: CallOptions);\n}\nexport declare function isCall(value: unknown): value is Call;\nexport type SimpleTaskPath = [string, string | number];\nexport type VariadicTaskPath = [string, ...(string | number)[], boolean];\nexport type CallTaskPath = [string, ...(string | number)[], Call] | [string, TaskPath, ...(string | number)[], Call];\nexport type TaskPath = SimpleTaskPath | CallTaskPath | VariadicTaskPath;\nexport {};\n"],"mappings":";;;;;;;;;;;;;;;AAaA;AACYoB,KADAD,UAAAA,GACU,QAAA,GAAA,SAAA,GAAA,OAAA,GAAA,UAAA,GAAA,aAAA,GAAA,OAAA,GAAA,QAAA;AAEVE,KAFAD,UAAAA,GAEe,MAAA,GAAA,OAAA,GAAA,MAAA;AAE3B;AAEKG,KAJOF,eAAAA,GAIY,GAAA;;AAAIT,KAFhBU,gBAAAA,GAEgBV,GAAAA;;KAAvBW,mBAAAA,IAAuBX,aAAaY;AAAM;AAExB,KAAlBC,kBAAAA,GAEiB,GAAA;AAAS;KAA1BC,iBAAAA,GAAoBF,MACG,CAAA,MAAA,EAAA,GAAA,CAAA;KAAvBG,uBACOC,CAAAA,YAAAA,CAAAA,GAAAA;Q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1KpC9E;;;;gBAIDY;;;;WAILC;;;;UAIDZ;;;;UAIAE;;UAEKqB,qBAAAA;;;;uBAIQd;mBACJG,0BAA0BsC;kBAC3BI;;;UAuBHJ,aAAAA;;;;;mBAKIhC;;;;iBAIFyB;;;;mBAIEhD;;;;sBAIGG;;;;;;;;;0BASIH;;;;kBAIR4B;;;;;KAKRqC,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 StreamCustomOutput = 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> = (\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\", StreamCustomOutput];\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\", StreamCustomOutput];\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[], StreamCustomOutput];\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: StreamCustomOutput;\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\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":";AA+nBA,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,121 @@
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
+ "context",
26
+ "interruptBefore",
27
+ "interruptAfter",
28
+ "checkpointDuring",
29
+ "durability",
30
+ "signal"
32
31
  ];
33
32
  const DEFAULT_RECURSION_LIMIT = 25;
34
33
  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;
34
+ const empty = {
35
+ tags: [],
36
+ metadata: {},
37
+ callbacks: void 0,
38
+ recursionLimit: DEFAULT_RECURSION_LIMIT,
39
+ configurable: {}
40
+ };
41
+ const implicitConfig = __langchain_core_singletons.AsyncLocalStorageProviderSingleton.getRunnableConfig();
42
+ if (implicitConfig !== void 0) {
43
+ for (const [k, v] of Object.entries(implicitConfig)) if (v !== void 0) if (COPIABLE_KEYS.includes(k)) {
44
+ let copiedValue;
45
+ if (Array.isArray(v)) copiedValue = [...v];
46
+ else if (typeof v === "object") if (k === "callbacks" && "copy" in v && typeof v.copy === "function") copiedValue = v.copy();
47
+ else copiedValue = { ...v };
48
+ else copiedValue = v;
49
+ empty[k] = copiedValue;
50
+ } else empty[k] = v;
51
+ }
52
+ for (const config of configs) {
53
+ if (config === void 0) continue;
54
+ for (const [k, v] of Object.entries(config)) if (v !== void 0 && CONFIG_KEYS.includes(k)) empty[k] = v;
55
+ }
56
+ for (const [key, value] of Object.entries(empty.configurable)) {
57
+ empty.metadata = empty.metadata ?? {};
58
+ if (!key.startsWith("__") && (typeof value === "string" || typeof value === "number" || typeof value === "boolean") && !(key in empty.metadata)) empty.metadata[key] = value;
59
+ }
60
+ return empty;
93
61
  }
94
62
  /**
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
- */
63
+ * A helper utility function that returns the {@link BaseStore} that was set when the graph was initialized
64
+ *
65
+ * @returns a reference to the {@link BaseStore} that was set when the graph was initialized
66
+ */
99
67
  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;
68
+ const runConfig = config ?? __langchain_core_singletons.AsyncLocalStorageProviderSingleton.getRunnableConfig();
69
+ if (runConfig === void 0) throw new Error(["Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.", "If you're running `getStore` in such environment, pass the `config` from the node function directly."].join("\n"));
70
+ return runConfig?.store;
108
71
  }
109
72
  /**
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
- */
73
+ * A helper utility function that returns the {@link LangGraphRunnableConfig#writer} if "custom" stream mode is enabled, otherwise undefined.
74
+ *
75
+ * @returns a reference to the {@link LangGraphRunnableConfig#writer} if "custom" stream mode is enabled, otherwise undefined
76
+ */
114
77
  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;
78
+ const runConfig = config ?? __langchain_core_singletons.AsyncLocalStorageProviderSingleton.getRunnableConfig();
79
+ if (runConfig === void 0) throw new Error(["Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.", "If you're running `getWriter` in such environment, pass the `config` from the node function directly."].join("\n"));
80
+ return runConfig?.writer || runConfig?.configurable?.writer;
123
81
  }
124
82
  /**
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
- */
83
+ * A helper utility function that returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized.
84
+ *
85
+ * Note: This only works when running in an environment that supports node:async_hooks and AsyncLocalStorage. If you're running this in a
86
+ * web environment, access the LangGraphRunnableConfig from the node function directly.
87
+ *
88
+ * @returns the {@link LangGraphRunnableConfig} that was set when the graph was initialized
89
+ */
132
90
  function getConfig() {
133
- return singletons_1.AsyncLocalStorageProviderSingleton.getRunnableConfig();
91
+ return __langchain_core_singletons.AsyncLocalStorageProviderSingleton.getRunnableConfig();
134
92
  }
135
93
  /**
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
- */
94
+ * A helper utility function that returns the input for the currently executing task
95
+ *
96
+ * @returns the input for the currently executing task
97
+ */
140
98
  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;
99
+ const runConfig = config ?? __langchain_core_singletons.AsyncLocalStorageProviderSingleton.getRunnableConfig();
100
+ if (runConfig === void 0) throw new Error(["Config not retrievable. This is likely because you are running in an environment without support for AsyncLocalStorage.", "If you're running `getCurrentTaskInput` in such environment, pass the `config` from the node function directly."].join("\n"));
101
+ if (runConfig.configurable?.[require_constants.CONFIG_KEY_SCRATCHPAD]?.currentTaskInput === void 0) throw new Error("BUG: internal scratchpad not initialized.");
102
+ return runConfig.configurable[require_constants.CONFIG_KEY_SCRATCHPAD].currentTaskInput;
153
103
  }
154
104
  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);
105
+ 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
106
  }
161
107
  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);
108
+ const parts = namespace.split(require_constants.CHECKPOINT_NAMESPACE_SEPARATOR);
109
+ while (parts.length > 1 && parts[parts.length - 1].match(/^\d+$/)) parts.pop();
110
+ return parts.slice(0, -1).join(require_constants.CHECKPOINT_NAMESPACE_SEPARATOR);
167
111
  }
168
- //# sourceMappingURL=config.js.map
112
+
113
+ //#endregion
114
+ exports.ensureLangGraphConfig = ensureLangGraphConfig;
115
+ exports.getConfig = getConfig;
116
+ exports.getCurrentTaskInput = getCurrentTaskInput;
117
+ exports.getParentCheckpointNamespace = getParentCheckpointNamespace;
118
+ exports.getStore = getStore;
119
+ exports.getWriter = getWriter;
120
+ exports.recastCheckpointNamespace = recastCheckpointNamespace;
121
+ //# 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 \"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.sl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R,CACE,2HACA,wGACA,KAAK;AAIX,QAAO,WAAW;;;;;;;AAQpB,SAAgB,UACd,QACwC;CACxC,MAAMC,YACJ,UAAUD,+DAAmC;AAE/C,KAAI,cAAc,OAChB,OAAM,IAAI,MACR,CACE,2HACA,yGACA,KAAK;AAIX,QAAO,WAAW,UAAU,WAAW,cAAc;;;;;;;;;;AAWvD,SAAgB,YAAqC;AACnD,QAAOA,+DAAmC;;;;;;;AAQ5C,SAAgB,oBACd,QACG;CACH,MAAMC,YACJ,UAAUD,+DAAmC;AAE/C,KAAI,cAAc,OAChB,OAAM,IAAI,MACR,CACE,2HACA,mHACA,KAAK;AAIX,KACE,UAAU,eAAeE,0CAAwB,qBACjD,OAEA,OAAM,IAAI,MAAM;AAGlB,QAAO,UAAW,aAAcA,yCAAwB;;AAG1D,SAAgB,0BAA0B,WAA2B;AACnE,QAAO,UACJ,MAAMC,kDACN,QAAQ,SAAS,CAAC,KAAK,MAAM,UAC7B,KAAK,SAAS,KAAK,MAAMC,4CAA0B,IACnD,KAAKD;;AAGV,SAAgB,6BAA6B,WAA2B;CACtE,MAAM,QAAQ,UAAU,MAAMA;AAC9B,QAAO,MAAM,SAAS,KAAK,MAAM,MAAM,SAAS,GAAG,MAAM,SACvD,OAAM;AAER,QAAO,MAAM,MAAM,GAAG,IAAI,KAAKA"}
@@ -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"}