@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.
- package/CHANGELOG.md +11 -0
- package/README.md +1 -2
- package/dist/_virtual/rolldown_runtime.cjs +25 -0
- package/dist/channels/any_value.d.cts +26 -0
- package/dist/channels/any_value.d.cts.map +1 -0
- package/dist/channels/any_value.d.ts +16 -9
- package/dist/channels/any_value.d.ts.map +1 -0
- package/dist/channels/base.cjs +97 -133
- package/dist/channels/base.cjs.map +1 -0
- package/dist/channels/base.d.cts +73 -0
- package/dist/channels/base.d.cts.map +1 -0
- package/dist/channels/base.d.ts +73 -74
- package/dist/channels/base.d.ts.map +1 -0
- package/dist/channels/base.js +94 -127
- package/dist/channels/base.js.map +1 -1
- package/dist/channels/binop.cjs +47 -77
- package/dist/channels/binop.cjs.map +1 -0
- package/dist/channels/binop.d.cts +22 -0
- package/dist/channels/binop.d.cts.map +1 -0
- package/dist/channels/binop.d.ts +17 -12
- package/dist/channels/binop.d.ts.map +1 -0
- package/dist/channels/binop.js +45 -71
- package/dist/channels/binop.js.map +1 -1
- package/dist/channels/dynamic_barrier_value.d.cts +43 -0
- package/dist/channels/dynamic_barrier_value.d.cts.map +1 -0
- package/dist/channels/dynamic_barrier_value.d.ts +20 -34
- package/dist/channels/dynamic_barrier_value.d.ts.map +1 -0
- package/dist/channels/ephemeral_value.cjs +46 -70
- package/dist/channels/ephemeral_value.cjs.map +1 -0
- package/dist/channels/ephemeral_value.d.cts +23 -0
- package/dist/channels/ephemeral_value.d.cts.map +1 -0
- package/dist/channels/ephemeral_value.d.ts +18 -11
- package/dist/channels/ephemeral_value.d.ts.map +1 -0
- package/dist/channels/ephemeral_value.js +45 -65
- package/dist/channels/ephemeral_value.js.map +1 -1
- package/dist/channels/index.cjs +2 -10
- package/dist/channels/index.js +4 -3
- package/dist/channels/last_value.cjs +91 -140
- package/dist/channels/last_value.cjs.map +1 -0
- package/dist/channels/last_value.d.cts +30 -0
- package/dist/channels/last_value.d.cts.map +1 -0
- package/dist/channels/last_value.d.ts +15 -23
- package/dist/channels/last_value.d.ts.map +1 -0
- package/dist/channels/last_value.js +88 -133
- package/dist/channels/last_value.js.map +1 -1
- package/dist/channels/named_barrier_value.cjs +114 -170
- package/dist/channels/named_barrier_value.cjs.map +1 -0
- package/dist/channels/named_barrier_value.d.cts +33 -0
- package/dist/channels/named_barrier_value.d.cts.map +1 -0
- package/dist/channels/named_barrier_value.d.ts +19 -29
- package/dist/channels/named_barrier_value.d.ts.map +1 -0
- package/dist/channels/named_barrier_value.js +112 -163
- package/dist/channels/named_barrier_value.js.map +1 -1
- package/dist/channels/topic.cjs +63 -96
- package/dist/channels/topic.cjs.map +1 -0
- package/dist/channels/topic.d.cts +26 -0
- package/dist/channels/topic.d.cts.map +1 -0
- package/dist/channels/topic.d.ts +21 -18
- package/dist/channels/topic.d.ts.map +1 -0
- package/dist/channels/topic.js +61 -90
- package/dist/channels/topic.js.map +1 -1
- package/dist/constants.cjs +373 -452
- package/dist/constants.cjs.map +1 -0
- package/dist/constants.d.cts +284 -0
- package/dist/constants.d.cts.map +1 -0
- package/dist/constants.d.ts +112 -148
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +333 -444
- package/dist/constants.js.map +1 -1
- package/dist/errors.cjs +150 -179
- package/dist/errors.cjs.map +1 -0
- package/dist/errors.d.cts +80 -0
- package/dist/errors.d.cts.map +1 -0
- package/dist/errors.d.ts +55 -46
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +139 -165
- package/dist/errors.js.map +1 -1
- package/dist/func/index.cjs +289 -290
- package/dist/func/index.cjs.map +1 -0
- package/dist/func/index.d.cts +289 -0
- package/dist/func/index.d.cts.map +1 -0
- package/dist/func/index.d.ts +81 -71
- package/dist/func/index.d.ts.map +1 -0
- package/dist/func/index.js +285 -284
- package/dist/func/index.js.map +1 -1
- package/dist/func/types.d.cts +64 -0
- package/dist/func/types.d.cts.map +1 -0
- package/dist/func/types.d.ts +24 -19
- package/dist/func/types.d.ts.map +1 -0
- package/dist/graph/annotation.cjs +96 -120
- package/dist/graph/annotation.cjs.map +1 -0
- package/dist/graph/annotation.d.cts +116 -0
- package/dist/graph/annotation.d.cts.map +1 -0
- package/dist/graph/annotation.d.ts +33 -34
- package/dist/graph/annotation.d.ts.map +1 -0
- package/dist/graph/annotation.js +91 -112
- package/dist/graph/annotation.js.map +1 -1
- package/dist/graph/graph.cjs +419 -723
- package/dist/graph/graph.cjs.map +1 -0
- package/dist/graph/graph.d.cts +131 -0
- package/dist/graph/graph.d.cts.map +1 -0
- package/dist/graph/graph.d.ts +122 -91
- package/dist/graph/graph.d.ts.map +1 -0
- package/dist/graph/graph.js +412 -713
- package/dist/graph/graph.js.map +1 -1
- package/dist/graph/index.cjs +4 -17
- package/dist/graph/index.js +6 -5
- package/dist/graph/message.cjs +59 -104
- package/dist/graph/message.cjs.map +1 -0
- package/dist/graph/message.d.cts +19 -0
- package/dist/graph/message.d.cts.map +1 -0
- package/dist/graph/message.d.ts +11 -10
- package/dist/graph/message.d.ts.map +1 -0
- package/dist/graph/message.js +56 -98
- package/dist/graph/message.js.map +1 -1
- package/dist/graph/messages_annotation.cjs +106 -106
- package/dist/graph/messages_annotation.cjs.map +1 -0
- package/dist/graph/messages_annotation.d.cts +111 -0
- package/dist/graph/messages_annotation.d.cts.map +1 -0
- package/dist/graph/messages_annotation.d.ts +18 -9
- package/dist/graph/messages_annotation.d.ts.map +1 -0
- package/dist/graph/messages_annotation.js +100 -100
- package/dist/graph/messages_annotation.js.map +1 -1
- package/dist/graph/state.cjs +476 -777
- package/dist/graph/state.cjs.map +1 -0
- package/dist/graph/state.d.cts +216 -0
- package/dist/graph/state.d.cts.map +1 -0
- package/dist/graph/state.d.ts +129 -134
- package/dist/graph/state.d.ts.map +1 -0
- package/dist/graph/state.js +470 -768
- package/dist/graph/state.js.map +1 -1
- package/dist/graph/zod/index.cjs +10 -21
- package/dist/graph/zod/index.d.cts +3 -0
- package/dist/graph/zod/index.d.ts +3 -3
- package/dist/graph/zod/index.js +4 -4
- package/dist/graph/zod/meta.cjs +142 -177
- package/dist/graph/zod/meta.cjs.map +1 -0
- package/dist/graph/zod/meta.d.cts +116 -0
- package/dist/graph/zod/meta.d.cts.map +1 -0
- package/dist/graph/zod/meta.d.ts +99 -97
- package/dist/graph/zod/meta.d.ts.map +1 -0
- package/dist/graph/zod/meta.js +136 -170
- package/dist/graph/zod/meta.js.map +1 -1
- package/dist/graph/zod/plugin.cjs +36 -39
- package/dist/graph/zod/plugin.cjs.map +1 -0
- package/dist/graph/zod/plugin.js +34 -35
- package/dist/graph/zod/plugin.js.map +1 -1
- package/dist/graph/zod/schema.cjs +82 -110
- package/dist/graph/zod/schema.cjs.map +1 -0
- package/dist/graph/zod/schema.d.cts +38 -0
- package/dist/graph/zod/schema.d.cts.map +1 -0
- package/dist/graph/zod/schema.d.ts +12 -6
- package/dist/graph/zod/schema.d.ts.map +1 -0
- package/dist/graph/zod/schema.js +77 -103
- package/dist/graph/zod/schema.js.map +1 -1
- package/dist/graph/zod/zod-registry.cjs +41 -47
- package/dist/graph/zod/zod-registry.cjs.map +1 -0
- package/dist/graph/zod/zod-registry.d.cts +51 -0
- package/dist/graph/zod/zod-registry.d.cts.map +1 -0
- package/dist/graph/zod/zod-registry.d.ts +34 -26
- package/dist/graph/zod/zod-registry.d.ts.map +1 -0
- package/dist/graph/zod/zod-registry.js +37 -41
- package/dist/graph/zod/zod-registry.js.map +1 -1
- package/dist/hash.cjs +205 -267
- package/dist/hash.cjs.map +1 -0
- package/dist/hash.js +205 -265
- package/dist/hash.js.map +1 -1
- package/dist/index.cjs +110 -33
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +25 -0
- package/dist/index.d.ts +25 -5
- package/dist/index.js +18 -7
- package/dist/index.js.map +1 -1
- package/dist/interrupt.cjs +79 -85
- package/dist/interrupt.cjs.map +1 -0
- package/dist/interrupt.d.cts +49 -0
- package/dist/interrupt.d.cts.map +1 -0
- package/dist/interrupt.d.ts +6 -1
- package/dist/interrupt.d.ts.map +1 -0
- package/dist/interrupt.js +76 -80
- package/dist/interrupt.js.map +1 -1
- package/dist/prebuilt/agentName.cjs +139 -172
- package/dist/prebuilt/agentName.cjs.map +1 -0
- package/dist/prebuilt/agentName.d.cts +42 -0
- package/dist/prebuilt/agentName.d.cts.map +1 -0
- package/dist/prebuilt/agentName.d.ts +13 -21
- package/dist/prebuilt/agentName.d.ts.map +1 -0
- package/dist/prebuilt/agentName.js +139 -168
- package/dist/prebuilt/agentName.js.map +1 -1
- package/dist/prebuilt/agent_executor.cjs +42 -80
- package/dist/prebuilt/agent_executor.cjs.map +1 -0
- package/dist/prebuilt/agent_executor.d.cts +57 -0
- package/dist/prebuilt/agent_executor.d.cts.map +1 -0
- package/dist/prebuilt/agent_executor.d.ts +46 -37
- package/dist/prebuilt/agent_executor.d.ts.map +1 -0
- package/dist/prebuilt/agent_executor.js +40 -75
- package/dist/prebuilt/agent_executor.js.map +1 -1
- package/dist/prebuilt/chat_agent_executor.cjs +66 -128
- package/dist/prebuilt/chat_agent_executor.cjs.map +1 -0
- package/dist/prebuilt/chat_agent_executor.d.cts +23 -0
- package/dist/prebuilt/chat_agent_executor.d.cts.map +1 -0
- package/dist/prebuilt/chat_agent_executor.d.ts +18 -10
- package/dist/prebuilt/chat_agent_executor.d.ts.map +1 -0
- package/dist/prebuilt/chat_agent_executor.js +63 -123
- package/dist/prebuilt/chat_agent_executor.js.map +1 -1
- package/dist/prebuilt/index.cjs +15 -18
- package/dist/prebuilt/index.d.cts +8 -0
- package/dist/prebuilt/index.d.ts +8 -8
- package/dist/prebuilt/index.js +8 -7
- package/dist/prebuilt/interrupt.d.cts +73 -0
- package/dist/prebuilt/interrupt.d.cts.map +1 -0
- package/dist/prebuilt/interrupt.d.ts +32 -15
- package/dist/prebuilt/interrupt.d.ts.map +1 -0
- package/dist/prebuilt/react_agent_executor.cjs +317 -473
- package/dist/prebuilt/react_agent_executor.cjs.map +1 -0
- package/dist/prebuilt/react_agent_executor.d.cts +229 -0
- package/dist/prebuilt/react_agent_executor.d.cts.map +1 -0
- package/dist/prebuilt/react_agent_executor.d.ts +171 -143
- package/dist/prebuilt/react_agent_executor.d.ts.map +1 -0
- package/dist/prebuilt/react_agent_executor.js +315 -465
- package/dist/prebuilt/react_agent_executor.js.map +1 -1
- package/dist/prebuilt/tool_executor.cjs +45 -67
- package/dist/prebuilt/tool_executor.cjs.map +1 -0
- package/dist/prebuilt/tool_executor.d.cts +42 -0
- package/dist/prebuilt/tool_executor.d.cts.map +1 -0
- package/dist/prebuilt/tool_executor.d.ts +30 -24
- package/dist/prebuilt/tool_executor.d.ts.map +1 -0
- package/dist/prebuilt/tool_executor.js +44 -63
- package/dist/prebuilt/tool_executor.js.map +1 -1
- package/dist/prebuilt/tool_node.cjs +213 -275
- package/dist/prebuilt/tool_node.cjs.map +1 -0
- package/dist/prebuilt/tool_node.d.cts +151 -0
- package/dist/prebuilt/tool_node.d.cts.map +1 -0
- package/dist/prebuilt/tool_node.d.ts +30 -17
- package/dist/prebuilt/tool_node.d.ts.map +1 -0
- package/dist/prebuilt/tool_node.js +209 -268
- package/dist/prebuilt/tool_node.js.map +1 -1
- package/dist/pregel/algo.cjs +521 -692
- package/dist/pregel/algo.cjs.map +1 -0
- package/dist/pregel/algo.d.cts +13 -0
- package/dist/pregel/algo.d.cts.map +1 -0
- package/dist/pregel/algo.d.ts +8 -38
- package/dist/pregel/algo.d.ts.map +1 -0
- package/dist/pregel/algo.js +516 -683
- package/dist/pregel/algo.js.map +1 -1
- package/dist/pregel/call.cjs +46 -42
- package/dist/pregel/call.cjs.map +1 -0
- package/dist/pregel/call.js +43 -37
- package/dist/pregel/call.js.map +1 -1
- package/dist/pregel/debug.cjs +153 -223
- package/dist/pregel/debug.cjs.map +1 -0
- package/dist/pregel/debug.js +152 -215
- package/dist/pregel/debug.js.map +1 -1
- package/dist/pregel/index.cjs +1134 -1604
- package/dist/pregel/index.cjs.map +1 -0
- package/dist/pregel/index.d.cts +534 -0
- package/dist/pregel/index.d.cts.map +1 -0
- package/dist/pregel/index.d.ts +458 -422
- package/dist/pregel/index.d.ts.map +1 -0
- package/dist/pregel/index.js +1125 -1592
- package/dist/pregel/index.js.map +1 -1
- package/dist/pregel/io.cjs +127 -234
- package/dist/pregel/io.cjs.map +1 -0
- package/dist/pregel/io.js +122 -225
- package/dist/pregel/io.js.map +1 -1
- package/dist/pregel/loop.cjs +539 -954
- package/dist/pregel/loop.cjs.map +1 -0
- package/dist/pregel/loop.js +536 -948
- package/dist/pregel/loop.js.map +1 -1
- package/dist/pregel/messages.cjs +104 -196
- package/dist/pregel/messages.cjs.map +1 -0
- package/dist/pregel/messages.js +102 -191
- package/dist/pregel/messages.js.map +1 -1
- package/dist/pregel/read.cjs +150 -280
- package/dist/pregel/read.cjs.map +1 -0
- package/dist/pregel/read.d.cts +51 -0
- package/dist/pregel/read.d.cts.map +1 -0
- package/dist/pregel/read.d.ts +48 -46
- package/dist/pregel/read.d.ts.map +1 -0
- package/dist/pregel/read.js +147 -274
- package/dist/pregel/read.js.map +1 -1
- package/dist/pregel/remote.cjs +339 -458
- package/dist/pregel/remote.cjs.map +1 -0
- package/dist/pregel/remote.d.cts +121 -0
- package/dist/pregel/remote.d.cts.map +1 -0
- package/dist/pregel/remote.d.ts +79 -69
- package/dist/pregel/remote.d.ts.map +1 -0
- package/dist/pregel/remote.js +337 -453
- package/dist/pregel/remote.js.map +1 -1
- package/dist/pregel/retry.cjs +87 -138
- package/dist/pregel/retry.cjs.map +1 -0
- package/dist/pregel/retry.js +83 -130
- package/dist/pregel/retry.js.map +1 -1
- package/dist/pregel/runnable_types.d.cts +25 -0
- package/dist/pregel/runnable_types.d.cts.map +1 -0
- package/dist/pregel/runnable_types.d.ts +22 -16
- package/dist/pregel/runnable_types.d.ts.map +1 -0
- package/dist/pregel/runner.cjs +222 -315
- package/dist/pregel/runner.cjs.map +1 -0
- package/dist/pregel/runner.js +219 -308
- package/dist/pregel/runner.js.map +1 -1
- package/dist/pregel/stream.cjs +89 -130
- package/dist/pregel/stream.cjs.map +1 -0
- package/dist/pregel/stream.js +87 -125
- package/dist/pregel/stream.js.map +1 -1
- package/dist/pregel/types.cjs +25 -62
- package/dist/pregel/types.cjs.map +1 -0
- package/dist/pregel/types.d.cts +437 -0
- package/dist/pregel/types.d.cts.map +1 -0
- package/dist/pregel/types.d.ts +377 -431
- package/dist/pregel/types.d.ts.map +1 -0
- package/dist/pregel/types.js +23 -57
- package/dist/pregel/types.js.map +1 -1
- package/dist/pregel/utils/config.cjs +100 -147
- package/dist/pregel/utils/config.cjs.map +1 -0
- package/dist/pregel/utils/config.d.cts +36 -0
- package/dist/pregel/utils/config.d.cts.map +1 -0
- package/dist/pregel/utils/config.d.ts +12 -9
- package/dist/pregel/utils/config.d.ts.map +1 -0
- package/dist/pregel/utils/config.js +98 -143
- package/dist/pregel/utils/config.js.map +1 -1
- package/dist/pregel/utils/index.cjs +87 -125
- package/dist/pregel/utils/index.cjs.map +1 -0
- package/dist/pregel/utils/index.d.cts +51 -0
- package/dist/pregel/utils/index.d.cts.map +1 -0
- package/dist/pregel/utils/index.d.ts +45 -61
- package/dist/pregel/utils/index.d.ts.map +1 -0
- package/dist/pregel/utils/index.js +86 -120
- package/dist/pregel/utils/index.js.map +1 -1
- package/dist/pregel/utils/subgraph.cjs +15 -26
- package/dist/pregel/utils/subgraph.cjs.map +1 -0
- package/dist/pregel/utils/subgraph.js +12 -21
- package/dist/pregel/utils/subgraph.js.map +1 -1
- package/dist/pregel/validate.cjs +42 -92
- package/dist/pregel/validate.cjs.map +1 -0
- package/dist/pregel/validate.js +39 -84
- package/dist/pregel/validate.js.map +1 -1
- package/dist/pregel/write.cjs +87 -137
- package/dist/pregel/write.cjs.map +1 -0
- package/dist/pregel/write.d.cts +35 -0
- package/dist/pregel/write.d.cts.map +1 -0
- package/dist/pregel/write.d.ts +27 -23
- package/dist/pregel/write.d.ts.map +1 -0
- package/dist/pregel/write.js +83 -131
- package/dist/pregel/write.js.map +1 -1
- package/dist/remote.cjs +3 -6
- package/dist/remote.d.cts +2 -0
- package/dist/remote.d.ts +2 -1
- package/dist/remote.js +3 -2
- package/dist/setup/async_local_storage.cjs +10 -7
- package/dist/setup/async_local_storage.cjs.map +1 -0
- package/dist/setup/async_local_storage.js +7 -2
- package/dist/setup/async_local_storage.js.map +1 -1
- package/dist/ui/index.cjs +4 -0
- package/dist/ui/index.d.cts +5 -0
- package/dist/ui/index.d.ts +5 -0
- package/dist/ui/index.js +3 -0
- package/dist/ui/stream.cjs +145 -0
- package/dist/ui/stream.cjs.map +1 -0
- package/dist/ui/stream.d.cts +25 -0
- package/dist/ui/stream.d.cts.map +1 -0
- package/dist/ui/stream.d.ts +25 -0
- package/dist/ui/stream.d.ts.map +1 -0
- package/dist/ui/stream.js +143 -0
- package/dist/ui/stream.js.map +1 -0
- package/dist/ui/types.infer.d.cts +53 -0
- package/dist/ui/types.infer.d.cts.map +1 -0
- package/dist/ui/types.infer.d.ts +53 -0
- package/dist/ui/types.infer.d.ts.map +1 -0
- package/dist/ui/types.message.d.cts +95 -0
- package/dist/ui/types.message.d.cts.map +1 -0
- package/dist/ui/types.message.d.ts +95 -0
- package/dist/ui/types.message.d.ts.map +1 -0
- package/dist/ui/types.schema.d.cts +228 -0
- package/dist/ui/types.schema.d.cts.map +1 -0
- package/dist/ui/types.schema.d.ts +228 -0
- package/dist/ui/types.schema.d.ts.map +1 -0
- package/dist/utils.cjs +77 -147
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.cts +32 -0
- package/dist/utils.d.cts.map +1 -0
- package/dist/utils.d.ts +29 -25
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +73 -140
- package/dist/utils.js.map +1 -1
- package/dist/web.cjs +97 -55
- package/dist/web.d.cts +23 -0
- package/dist/web.d.ts +23 -14
- package/dist/web.js +15 -8
- package/package.json +77 -80
- package/dist/channels/any_value.cjs +0 -65
- package/dist/channels/any_value.js +0 -61
- package/dist/channels/any_value.js.map +0 -1
- package/dist/channels/dynamic_barrier_value.cjs +0 -212
- package/dist/channels/dynamic_barrier_value.js +0 -207
- package/dist/channels/dynamic_barrier_value.js.map +0 -1
- package/dist/channels/index.d.ts +0 -7
- package/dist/channels/index.js.map +0 -1
- package/dist/func/types.cjs +0 -15
- package/dist/func/types.js +0 -12
- package/dist/func/types.js.map +0 -1
- package/dist/graph/index.d.ts +0 -4
- package/dist/graph/index.js.map +0 -1
- package/dist/graph/message.test.cjs +0 -196
- package/dist/graph/message.test.d.ts +0 -1
- package/dist/graph/message.test.js +0 -194
- package/dist/graph/message.test.js.map +0 -1
- package/dist/graph/zod/index.js.map +0 -1
- package/dist/graph/zod/plugin.d.ts +0 -28
- package/dist/hash.d.ts +0 -2
- package/dist/prebuilt/index.js.map +0 -1
- package/dist/prebuilt/interrupt.cjs +0 -3
- package/dist/prebuilt/interrupt.js +0 -2
- package/dist/prebuilt/interrupt.js.map +0 -1
- package/dist/pregel/call.d.ts +0 -16
- package/dist/pregel/debug.d.ts +0 -41
- package/dist/pregel/debug.test.cjs +0 -258
- package/dist/pregel/debug.test.d.ts +0 -1
- package/dist/pregel/debug.test.js +0 -256
- package/dist/pregel/debug.test.js.map +0 -1
- package/dist/pregel/io.d.ts +0 -30
- package/dist/pregel/io.mapCommand.test.cjs +0 -150
- package/dist/pregel/io.mapCommand.test.d.ts +0 -1
- package/dist/pregel/io.mapCommand.test.js +0 -148
- package/dist/pregel/io.mapCommand.test.js.map +0 -1
- package/dist/pregel/loop.d.ts +0 -147
- package/dist/pregel/messages.d.ts +0 -30
- package/dist/pregel/messages.test.cjs +0 -369
- package/dist/pregel/messages.test.d.ts +0 -1
- package/dist/pregel/messages.test.js +0 -367
- package/dist/pregel/messages.test.js.map +0 -1
- package/dist/pregel/read.test.cjs +0 -194
- package/dist/pregel/read.test.d.ts +0 -1
- package/dist/pregel/read.test.js +0 -192
- package/dist/pregel/read.test.js.map +0 -1
- package/dist/pregel/retry.d.ts +0 -17
- package/dist/pregel/runnable_types.cjs +0 -3
- package/dist/pregel/runnable_types.js +0 -2
- package/dist/pregel/runnable_types.js.map +0 -1
- package/dist/pregel/runner.d.ts +0 -79
- package/dist/pregel/runner.test.cjs +0 -66
- package/dist/pregel/runner.test.d.ts +0 -1
- package/dist/pregel/runner.test.js +0 -64
- package/dist/pregel/runner.test.js.map +0 -1
- package/dist/pregel/stream.d.ts +0 -40
- package/dist/pregel/utils/config.test.cjs +0 -214
- package/dist/pregel/utils/config.test.d.ts +0 -1
- package/dist/pregel/utils/config.test.js +0 -212
- package/dist/pregel/utils/config.test.js.map +0 -1
- package/dist/pregel/utils/subgraph.d.ts +0 -4
- package/dist/pregel/utils/subgraph.test.cjs +0 -83
- package/dist/pregel/utils/subgraph.test.d.ts +0 -1
- package/dist/pregel/utils/subgraph.test.js +0 -81
- package/dist/pregel/utils/subgraph.test.js.map +0 -1
- package/dist/pregel/validate.d.ts +0 -16
- package/dist/pregel/validate.test.cjs +0 -220
- package/dist/pregel/validate.test.d.ts +0 -1
- package/dist/pregel/validate.test.js +0 -218
- package/dist/pregel/validate.test.js.map +0 -1
- package/dist/pregel/write.test.cjs +0 -181
- package/dist/pregel/write.test.d.ts +0 -1
- package/dist/pregel/write.test.js +0 -179
- package/dist/pregel/write.test.js.map +0 -1
- package/dist/remote.js.map +0 -1
- package/dist/setup/async_local_storage.d.ts +0 -1
- package/dist/web.js.map +0 -1
- package/index.cjs +0 -1
- package/index.d.cts +0 -1
- package/index.d.ts +0 -1
- package/index.js +0 -1
- package/prebuilt.cjs +0 -1
- package/prebuilt.d.cts +0 -1
- package/prebuilt.d.ts +0 -1
- package/prebuilt.js +0 -1
- package/pregel.cjs +0 -1
- package/pregel.d.cts +0 -1
- package/pregel.d.ts +0 -1
- package/pregel.js +0 -1
- package/remote.cjs +0 -1
- package/remote.d.cts +0 -1
- package/remote.d.ts +0 -1
- package/remote.js +0 -1
- package/web.cjs +0 -1
- package/web.d.cts +0 -1
- package/web.d.ts +0 -1
- package/web.js +0 -1
- package/zod/schema.cjs +0 -1
- package/zod/schema.d.cts +0 -1
- package/zod/schema.d.ts +0 -1
- package/zod/schema.js +0 -1
- package/zod.cjs +0 -1
- package/zod.d.cts +0 -1
- package/zod.d.ts +0 -1
- package/zod.js +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,33 +1,110 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
Object.defineProperty(exports,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_async_local_storage = require('./setup/async_local_storage.cjs');
|
|
3
|
+
const require_errors = require('./errors.cjs');
|
|
4
|
+
const require_base = require('./channels/base.cjs');
|
|
5
|
+
const require_binop = require('./channels/binop.cjs');
|
|
6
|
+
const require_annotation = require('./graph/annotation.cjs');
|
|
7
|
+
const require_constants = require('./constants.cjs');
|
|
8
|
+
const require_config = require('./pregel/utils/config.cjs');
|
|
9
|
+
const require_graph = require('./graph/graph.cjs');
|
|
10
|
+
const require_state = require('./graph/state.cjs');
|
|
11
|
+
const require_message = require('./graph/message.cjs');
|
|
12
|
+
const require_index = require('./func/index.cjs');
|
|
13
|
+
const require_messages_annotation = require('./graph/messages_annotation.cjs');
|
|
14
|
+
require('./web.cjs');
|
|
15
|
+
const require_interrupt = require('./interrupt.cjs');
|
|
16
|
+
const __langchain_langgraph_checkpoint = require_rolldown_runtime.__toESM(require("@langchain/langgraph-checkpoint"));
|
|
17
|
+
|
|
18
|
+
//#region src/index.ts
|
|
19
|
+
require_async_local_storage.initializeAsyncLocalStorageSingleton();
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
exports.Annotation = require_annotation.Annotation;
|
|
23
|
+
Object.defineProperty(exports, 'AsyncBatchedStore', {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () {
|
|
26
|
+
return __langchain_langgraph_checkpoint.AsyncBatchedStore;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
exports.BaseChannel = require_base.BaseChannel;
|
|
30
|
+
Object.defineProperty(exports, 'BaseCheckpointSaver', {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return __langchain_langgraph_checkpoint.BaseCheckpointSaver;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
exports.BaseLangGraphError = require_errors.BaseLangGraphError;
|
|
37
|
+
Object.defineProperty(exports, 'BaseStore', {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function () {
|
|
40
|
+
return __langchain_langgraph_checkpoint.BaseStore;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
exports.BinaryOperatorAggregate = require_binop.BinaryOperatorAggregate;
|
|
44
|
+
exports.Command = require_constants.Command;
|
|
45
|
+
exports.CompiledStateGraph = require_state.CompiledStateGraph;
|
|
46
|
+
exports.END = require_constants.END;
|
|
47
|
+
exports.EmptyChannelError = require_errors.EmptyChannelError;
|
|
48
|
+
exports.EmptyInputError = require_errors.EmptyInputError;
|
|
49
|
+
exports.Graph = require_graph.Graph;
|
|
50
|
+
exports.GraphBubbleUp = require_errors.GraphBubbleUp;
|
|
51
|
+
exports.GraphInterrupt = require_errors.GraphInterrupt;
|
|
52
|
+
exports.GraphRecursionError = require_errors.GraphRecursionError;
|
|
53
|
+
exports.GraphValueError = require_errors.GraphValueError;
|
|
54
|
+
exports.INTERRUPT = require_constants.INTERRUPT;
|
|
55
|
+
Object.defineProperty(exports, 'InMemoryStore', {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function () {
|
|
58
|
+
return __langchain_langgraph_checkpoint.InMemoryStore;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
exports.InvalidUpdateError = require_errors.InvalidUpdateError;
|
|
62
|
+
Object.defineProperty(exports, 'MemorySaver', {
|
|
63
|
+
enumerable: true,
|
|
64
|
+
get: function () {
|
|
65
|
+
return __langchain_langgraph_checkpoint.MemorySaver;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
exports.MessageGraph = require_message.MessageGraph;
|
|
69
|
+
exports.MessagesAnnotation = require_messages_annotation.MessagesAnnotation;
|
|
70
|
+
exports.MessagesZodMeta = require_messages_annotation.MessagesZodMeta;
|
|
71
|
+
exports.MessagesZodState = require_messages_annotation.MessagesZodState;
|
|
72
|
+
exports.MultipleSubgraphsError = require_errors.MultipleSubgraphsError;
|
|
73
|
+
exports.NodeInterrupt = require_errors.NodeInterrupt;
|
|
74
|
+
exports.ParentCommand = require_errors.ParentCommand;
|
|
75
|
+
exports.REMOVE_ALL_MESSAGES = require_message.REMOVE_ALL_MESSAGES;
|
|
76
|
+
exports.RemoteException = require_errors.RemoteException;
|
|
77
|
+
exports.START = require_constants.START;
|
|
78
|
+
exports.Send = require_constants.Send;
|
|
79
|
+
exports.StateGraph = require_state.StateGraph;
|
|
80
|
+
exports.UnreachableNodeError = require_errors.UnreachableNodeError;
|
|
81
|
+
exports.addMessages = require_message.messagesStateReducer;
|
|
82
|
+
Object.defineProperty(exports, 'copyCheckpoint', {
|
|
83
|
+
enumerable: true,
|
|
84
|
+
get: function () {
|
|
85
|
+
return __langchain_langgraph_checkpoint.copyCheckpoint;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
Object.defineProperty(exports, 'emptyCheckpoint', {
|
|
89
|
+
enumerable: true,
|
|
90
|
+
get: function () {
|
|
91
|
+
return __langchain_langgraph_checkpoint.emptyCheckpoint;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
exports.entrypoint = require_index.entrypoint;
|
|
95
|
+
exports.getConfig = require_config.getConfig;
|
|
96
|
+
exports.getCurrentTaskInput = require_config.getCurrentTaskInput;
|
|
97
|
+
exports.getPreviousState = require_index.getPreviousState;
|
|
98
|
+
exports.getStore = require_config.getStore;
|
|
99
|
+
exports.getSubgraphsSeenSet = require_errors.getSubgraphsSeenSet;
|
|
100
|
+
exports.getWriter = require_config.getWriter;
|
|
101
|
+
exports.interrupt = require_interrupt.interrupt;
|
|
102
|
+
exports.isCommand = require_constants.isCommand;
|
|
103
|
+
exports.isGraphBubbleUp = require_errors.isGraphBubbleUp;
|
|
104
|
+
exports.isGraphInterrupt = require_errors.isGraphInterrupt;
|
|
105
|
+
exports.isInterrupted = require_constants.isInterrupted;
|
|
106
|
+
exports.isParentCommand = require_errors.isParentCommand;
|
|
107
|
+
exports.messagesStateReducer = require_message.messagesStateReducer;
|
|
108
|
+
exports.task = require_index.task;
|
|
109
|
+
exports.typedNode = require_state.typedNode;
|
|
110
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["initializeAsyncLocalStorageSingleton"],"sources":["../src/index.ts"],"sourcesContent":["/* __LC_ALLOW_ENTRYPOINT_SIDE_EFFECTS__ */\n\nimport { initializeAsyncLocalStorageSingleton } from \"./setup/async_local_storage.js\";\n\n// Initialize global async local storage instance for tracing\ninitializeAsyncLocalStorageSingleton();\n\nexport * from \"./web.js\";\n\nexport { interrupt } from \"./interrupt.js\";\nexport { getStore, getWriter, getConfig } from \"./pregel/utils/config.js\";\nexport { getPreviousState } from \"./func/index.js\";\nexport { getCurrentTaskInput } from \"./pregel/utils/config.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AAKAA"}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BaseChannel } from "./channels/base.cjs";
|
|
2
|
+
import { LangGraphRunnableConfig, Runtime } from "./pregel/runnable_types.cjs";
|
|
3
|
+
import { BinaryOperator, BinaryOperatorAggregate } from "./channels/binop.cjs";
|
|
4
|
+
import { LastValue } from "./channels/last_value.cjs";
|
|
5
|
+
import { Annotation, AnnotationRoot, NodeType, SingleReducer, StateDefinition, StateType, UpdateType } from "./graph/annotation.cjs";
|
|
6
|
+
import { RetryPolicy } from "./pregel/utils/index.cjs";
|
|
7
|
+
import { PregelNode } from "./pregel/read.cjs";
|
|
8
|
+
import { Command, CommandParams, END, INTERRUPT, Interrupt, START, Send, isCommand, isInterrupted } from "./constants.cjs";
|
|
9
|
+
import { GetStateOptions, MultipleChannelSubscriptionOptions, PregelOptions, PregelParams, SingleChannelSubscriptionOptions, StateSnapshot, StreamMode, StreamOutputMap } from "./pregel/types.cjs";
|
|
10
|
+
import { Pregel } from "./pregel/index.cjs";
|
|
11
|
+
import { CompiledGraph, Graph } from "./graph/graph.cjs";
|
|
12
|
+
import { CompiledStateGraph, StateGraph, StateGraphArgs, typedNode } from "./graph/state.cjs";
|
|
13
|
+
import { MessageGraph, Messages, REMOVE_ALL_MESSAGES, messagesStateReducer } from "./graph/message.cjs";
|
|
14
|
+
import { BaseLangGraphError, BaseLangGraphErrorFields, EmptyChannelError, EmptyInputError, GraphBubbleUp, GraphInterrupt, GraphRecursionError, GraphValueError, InvalidUpdateError, MultipleSubgraphsError, NodeInterrupt, ParentCommand, RemoteException, UnreachableNodeError, getSubgraphsSeenSet, isGraphBubbleUp, isGraphInterrupt, isParentCommand } from "./errors.cjs";
|
|
15
|
+
import { AnyValue } from "./channels/any_value.cjs";
|
|
16
|
+
import { DynamicBarrierValue, WaitForNames } from "./channels/dynamic_barrier_value.cjs";
|
|
17
|
+
import { NamedBarrierValue } from "./channels/named_barrier_value.cjs";
|
|
18
|
+
import { Topic } from "./channels/topic.cjs";
|
|
19
|
+
import { EphemeralValue } from "./channels/ephemeral_value.cjs";
|
|
20
|
+
import { EntrypointOptions, TaskOptions, entrypoint, getPreviousState, task } from "./func/index.cjs";
|
|
21
|
+
import { MessagesAnnotation, MessagesZodMeta, MessagesZodState } from "./graph/messages_annotation.cjs";
|
|
22
|
+
import { AsyncBatchedStore, BaseCheckpointSaver, BaseStore, Checkpoint, CheckpointMetadata, CheckpointTuple, GetOperation, InMemoryStore, Item, ListNamespacesOperation, MatchCondition, MemorySaver, NameSpacePath, NamespaceMatchType, Operation, OperationResults, PutOperation, SearchOperation, copyCheckpoint, emptyCheckpoint } from "./web.cjs";
|
|
23
|
+
import { interrupt } from "./interrupt.cjs";
|
|
24
|
+
import { getConfig, getCurrentTaskInput, getStore, getWriter } from "./pregel/utils/config.cjs";
|
|
25
|
+
export { Annotation, AnnotationRoot, AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, BinaryOperator, BinaryOperatorAggregate, Checkpoint, CheckpointMetadata, CheckpointTuple, Command, CommandParams, CompiledGraph, CompiledStateGraph, DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, EntrypointOptions, EphemeralValue, GetOperation, GetStateOptions, Graph, GraphBubbleUp, GraphInterrupt, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, Interrupt, InvalidUpdateError, Item, LangGraphRunnableConfig, LastValue, ListNamespacesOperation, MatchCondition, MemorySaver, MessageGraph, Messages, MessagesAnnotation, MessagesZodMeta, MessagesZodState, MultipleChannelSubscriptionOptions, MultipleSubgraphsError, NameSpacePath, NamedBarrierValue, NamespaceMatchType, NodeInterrupt, NodeType, Operation, OperationResults, ParentCommand, Pregel, PregelNode, PregelOptions, PregelParams, PutOperation, REMOVE_ALL_MESSAGES, RemoteException, RetryPolicy, Runtime, START, SearchOperation, Send, SingleChannelSubscriptionOptions, SingleReducer, StateDefinition, StateGraph, StateGraphArgs, StateSnapshot, StateType, StreamMode, StreamOutputMap, TaskOptions, Topic, UnreachableNodeError, UpdateType, WaitForNames, messagesStateReducer as addMessages, copyCheckpoint, emptyCheckpoint, entrypoint, getConfig, getCurrentTaskInput, getPreviousState, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isParentCommand, messagesStateReducer, task, typedNode };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { BaseChannel } from "./channels/base.js";
|
|
2
|
+
import { LangGraphRunnableConfig, Runtime } from "./pregel/runnable_types.js";
|
|
3
|
+
import { BinaryOperator, BinaryOperatorAggregate } from "./channels/binop.js";
|
|
4
|
+
import { LastValue } from "./channels/last_value.js";
|
|
5
|
+
import { Annotation, AnnotationRoot, NodeType, SingleReducer, StateDefinition, StateType, UpdateType } from "./graph/annotation.js";
|
|
6
|
+
import { RetryPolicy } from "./pregel/utils/index.js";
|
|
7
|
+
import { PregelNode } from "./pregel/read.js";
|
|
8
|
+
import { Command, CommandParams, END, INTERRUPT, Interrupt, START, Send, isCommand, isInterrupted } from "./constants.js";
|
|
9
|
+
import { GetStateOptions, MultipleChannelSubscriptionOptions, PregelOptions, PregelParams, SingleChannelSubscriptionOptions, StateSnapshot, StreamMode, StreamOutputMap } from "./pregel/types.js";
|
|
10
|
+
import { Pregel } from "./pregel/index.js";
|
|
11
|
+
import { CompiledGraph, Graph } from "./graph/graph.js";
|
|
12
|
+
import { CompiledStateGraph, StateGraph, StateGraphArgs, typedNode } from "./graph/state.js";
|
|
13
|
+
import { MessageGraph, Messages, REMOVE_ALL_MESSAGES, messagesStateReducer } from "./graph/message.js";
|
|
14
|
+
import { BaseLangGraphError, BaseLangGraphErrorFields, EmptyChannelError, EmptyInputError, GraphBubbleUp, GraphInterrupt, GraphRecursionError, GraphValueError, InvalidUpdateError, MultipleSubgraphsError, NodeInterrupt, ParentCommand, RemoteException, UnreachableNodeError, getSubgraphsSeenSet, isGraphBubbleUp, isGraphInterrupt, isParentCommand } from "./errors.js";
|
|
15
|
+
import { AnyValue } from "./channels/any_value.js";
|
|
16
|
+
import { DynamicBarrierValue, WaitForNames } from "./channels/dynamic_barrier_value.js";
|
|
17
|
+
import { NamedBarrierValue } from "./channels/named_barrier_value.js";
|
|
18
|
+
import { Topic } from "./channels/topic.js";
|
|
19
|
+
import { EphemeralValue } from "./channels/ephemeral_value.js";
|
|
20
|
+
import { EntrypointOptions, TaskOptions, entrypoint, getPreviousState, task } from "./func/index.js";
|
|
21
|
+
import { MessagesAnnotation, MessagesZodMeta, MessagesZodState } from "./graph/messages_annotation.js";
|
|
22
|
+
import { AsyncBatchedStore, BaseCheckpointSaver, BaseStore, Checkpoint, CheckpointMetadata, CheckpointTuple, GetOperation, InMemoryStore, Item, ListNamespacesOperation, MatchCondition, MemorySaver, NameSpacePath, NamespaceMatchType, Operation, OperationResults, PutOperation, SearchOperation, copyCheckpoint, emptyCheckpoint } from "./web.js";
|
|
23
|
+
import { interrupt } from "./interrupt.js";
|
|
24
|
+
import { getConfig, getCurrentTaskInput, getStore, getWriter } from "./pregel/utils/config.js";
|
|
25
|
+
export { Annotation, AnnotationRoot, AnyValue, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseLangGraphErrorFields, BaseStore, BinaryOperator, BinaryOperatorAggregate, Checkpoint, CheckpointMetadata, CheckpointTuple, Command, CommandParams, CompiledGraph, CompiledStateGraph, DynamicBarrierValue, END, EmptyChannelError, EmptyInputError, EntrypointOptions, EphemeralValue, GetOperation, GetStateOptions, Graph, GraphBubbleUp, GraphInterrupt, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, Interrupt, InvalidUpdateError, Item, LangGraphRunnableConfig, LastValue, ListNamespacesOperation, MatchCondition, MemorySaver, MessageGraph, Messages, MessagesAnnotation, MessagesZodMeta, MessagesZodState, MultipleChannelSubscriptionOptions, MultipleSubgraphsError, NameSpacePath, NamedBarrierValue, NamespaceMatchType, NodeInterrupt, NodeType, Operation, OperationResults, ParentCommand, Pregel, PregelNode, PregelOptions, PregelParams, PutOperation, REMOVE_ALL_MESSAGES, RemoteException, RetryPolicy, Runtime, START, SearchOperation, Send, SingleChannelSubscriptionOptions, SingleReducer, StateDefinition, StateGraph, StateGraphArgs, StateSnapshot, StateType, StreamMode, StreamOutputMap, TaskOptions, Topic, UnreachableNodeError, UpdateType, WaitForNames, messagesStateReducer as addMessages, copyCheckpoint, emptyCheckpoint, entrypoint, getConfig, getCurrentTaskInput, getPreviousState, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isParentCommand, messagesStateReducer, task, typedNode };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
/* __LC_ALLOW_ENTRYPOINT_SIDE_EFFECTS__ */
|
|
2
1
|
import { initializeAsyncLocalStorageSingleton } from "./setup/async_local_storage.js";
|
|
3
|
-
|
|
2
|
+
import { BaseLangGraphError, EmptyChannelError, EmptyInputError, GraphBubbleUp, GraphInterrupt, GraphRecursionError, GraphValueError, InvalidUpdateError, MultipleSubgraphsError, NodeInterrupt, ParentCommand, RemoteException, UnreachableNodeError, getSubgraphsSeenSet, isGraphBubbleUp, isGraphInterrupt, isParentCommand } from "./errors.js";
|
|
3
|
+
import { BaseChannel } from "./channels/base.js";
|
|
4
|
+
import { BinaryOperatorAggregate } from "./channels/binop.js";
|
|
5
|
+
import { Annotation } from "./graph/annotation.js";
|
|
6
|
+
import { Command, END, INTERRUPT, START, Send, isCommand, isInterrupted } from "./constants.js";
|
|
7
|
+
import { getConfig, getCurrentTaskInput, getStore, getWriter } from "./pregel/utils/config.js";
|
|
8
|
+
import { Graph } from "./graph/graph.js";
|
|
9
|
+
import { CompiledStateGraph, StateGraph, typedNode } from "./graph/state.js";
|
|
10
|
+
import { MessageGraph, REMOVE_ALL_MESSAGES, messagesStateReducer } from "./graph/message.js";
|
|
11
|
+
import { entrypoint, getPreviousState, task } from "./func/index.js";
|
|
12
|
+
import { MessagesAnnotation, MessagesZodMeta, MessagesZodState } from "./graph/messages_annotation.js";
|
|
13
|
+
import { AsyncBatchedStore, BaseCheckpointSaver, BaseStore, InMemoryStore, MemorySaver, copyCheckpoint, emptyCheckpoint } from "./web.js";
|
|
14
|
+
import { interrupt } from "./interrupt.js";
|
|
15
|
+
|
|
16
|
+
//#region src/index.ts
|
|
4
17
|
initializeAsyncLocalStorageSingleton();
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export { getStore, getWriter,
|
|
8
|
-
export { getPreviousState } from "./func/index.js";
|
|
9
|
-
export { getCurrentTaskInput } from "./pregel/utils/config.js";
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { Annotation, AsyncBatchedStore, BaseChannel, BaseCheckpointSaver, BaseLangGraphError, BaseStore, BinaryOperatorAggregate, Command, CompiledStateGraph, END, EmptyChannelError, EmptyInputError, Graph, GraphBubbleUp, GraphInterrupt, GraphRecursionError, GraphValueError, INTERRUPT, InMemoryStore, InvalidUpdateError, MemorySaver, MessageGraph, MessagesAnnotation, MessagesZodMeta, MessagesZodState, MultipleSubgraphsError, NodeInterrupt, ParentCommand, REMOVE_ALL_MESSAGES, RemoteException, START, Send, StateGraph, UnreachableNodeError, messagesStateReducer as addMessages, copyCheckpoint, emptyCheckpoint, entrypoint, getConfig, getCurrentTaskInput, getPreviousState, getStore, getSubgraphsSeenSet, getWriter, interrupt, isCommand, isGraphBubbleUp, isGraphInterrupt, isInterrupted, isParentCommand, messagesStateReducer, task, typedNode };
|
|
10
21
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* __LC_ALLOW_ENTRYPOINT_SIDE_EFFECTS__ */\n\nimport { initializeAsyncLocalStorageSingleton } from \"./setup/async_local_storage.js\";\n\n// Initialize global async local storage instance for tracing\ninitializeAsyncLocalStorageSingleton();\n\nexport * from \"./web.js\";\n\nexport { interrupt } from \"./interrupt.js\";\nexport { getStore, getWriter, getConfig } from \"./pregel/utils/config.js\";\nexport { getPreviousState } from \"./func/index.js\";\nexport { getCurrentTaskInput } from \"./pregel/utils/config.js\";\n"],"mappings":";;;;;;;;;;;;;;;;AAKA"}
|
package/dist/interrupt.cjs
CHANGED
|
@@ -1,88 +1,82 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_errors = require('./errors.cjs');
|
|
3
|
+
const require_constants = require('./constants.cjs');
|
|
4
|
+
const require_hash = require('./hash.cjs');
|
|
5
|
+
const __langchain_core_singletons = require_rolldown_runtime.__toESM(require("@langchain/core/singletons"));
|
|
6
|
+
|
|
7
|
+
//#region src/interrupt.ts
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
|
+
* Interrupts the execution of a graph node.
|
|
10
|
+
* This function can be used to pause execution of a node, and return the value of the `resume`
|
|
11
|
+
* input when the graph is re-invoked using `Command`.
|
|
12
|
+
* Multiple interrupts can be called within a single node, and each will be handled sequentially.
|
|
13
|
+
*
|
|
14
|
+
* When an interrupt is called:
|
|
15
|
+
* 1. If there's a `resume` value available (from a previous `Command`), it returns that value.
|
|
16
|
+
* 2. Otherwise, it throws a `GraphInterrupt` with the provided value
|
|
17
|
+
* 3. The graph can be resumed by passing a `Command` with a `resume` value
|
|
18
|
+
*
|
|
19
|
+
* Because the `interrupt` function propagates by throwing a special `GraphInterrupt` error,
|
|
20
|
+
* you should avoid using `try/catch` blocks around the `interrupt` function,
|
|
21
|
+
* or if you do, ensure that the `GraphInterrupt` error is thrown again within your `catch` block.
|
|
22
|
+
*
|
|
23
|
+
* @param value - The value to include in the interrupt. This will be available in task.interrupts[].value
|
|
24
|
+
* @returns The `resume` value provided when the graph is re-invoked with a Command
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* // Define a node that uses multiple interrupts
|
|
29
|
+
* const nodeWithInterrupts = () => {
|
|
30
|
+
* // First interrupt - will pause execution and include {value: 1} in task values
|
|
31
|
+
* const answer1 = interrupt({ value: 1 });
|
|
32
|
+
*
|
|
33
|
+
* // Second interrupt - only called after first interrupt is resumed
|
|
34
|
+
* const answer2 = interrupt({ value: 2 });
|
|
35
|
+
*
|
|
36
|
+
* // Use the resume values
|
|
37
|
+
* return { myKey: answer1 + " " + answer2 };
|
|
38
|
+
* };
|
|
39
|
+
*
|
|
40
|
+
* // Resume the graph after first interrupt
|
|
41
|
+
* await graph.stream(new Command({ resume: "answer 1" }));
|
|
42
|
+
*
|
|
43
|
+
* // Resume the graph after second interrupt
|
|
44
|
+
* await graph.stream(new Command({ resume: "answer 2" }));
|
|
45
|
+
* // Final result: { myKey: "answer 1 answer 2" }
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @throws {Error} If called outside the context of a graph
|
|
49
|
+
* @throws {GraphInterrupt} When no resume value is available
|
|
50
|
+
*/
|
|
52
51
|
function interrupt(value) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
scratchpad.resume.push(v);
|
|
80
|
-
conf[constants_js_1.CONFIG_KEY_SEND]?.([[constants_js_1.RESUME, scratchpad.resume]]);
|
|
81
|
-
return v;
|
|
82
|
-
}
|
|
83
|
-
// No resume value found
|
|
84
|
-
const ns = conf[constants_js_1.CONFIG_KEY_CHECKPOINT_NS]?.split(constants_js_1.CHECKPOINT_NAMESPACE_SEPARATOR);
|
|
85
|
-
const id = ns ? (0, hash_js_1.XXH3)(ns.join(constants_js_1.CHECKPOINT_NAMESPACE_SEPARATOR)) : undefined;
|
|
86
|
-
throw new errors_js_1.GraphInterrupt([{ id, value }]);
|
|
52
|
+
const config = __langchain_core_singletons.AsyncLocalStorageProviderSingleton.getRunnableConfig();
|
|
53
|
+
if (!config) throw new Error("Called interrupt() outside the context of a graph.");
|
|
54
|
+
const conf = config.configurable;
|
|
55
|
+
if (!conf) throw new Error("No configurable found in config");
|
|
56
|
+
const checkpointer = conf[require_constants.CONFIG_KEY_CHECKPOINTER];
|
|
57
|
+
if (!checkpointer) throw new require_errors.GraphValueError("No checkpointer set");
|
|
58
|
+
const scratchpad = conf[require_constants.CONFIG_KEY_SCRATCHPAD];
|
|
59
|
+
scratchpad.interruptCounter += 1;
|
|
60
|
+
const idx = scratchpad.interruptCounter;
|
|
61
|
+
if (scratchpad.resume.length > 0 && idx < scratchpad.resume.length) {
|
|
62
|
+
conf[require_constants.CONFIG_KEY_SEND]?.([[require_constants.RESUME, scratchpad.resume]]);
|
|
63
|
+
return scratchpad.resume[idx];
|
|
64
|
+
}
|
|
65
|
+
if (scratchpad.nullResume !== void 0) {
|
|
66
|
+
if (scratchpad.resume.length !== idx) throw new Error(`Resume length mismatch: ${scratchpad.resume.length} !== ${idx}`);
|
|
67
|
+
const v = scratchpad.consumeNullResume();
|
|
68
|
+
scratchpad.resume.push(v);
|
|
69
|
+
conf[require_constants.CONFIG_KEY_SEND]?.([[require_constants.RESUME, scratchpad.resume]]);
|
|
70
|
+
return v;
|
|
71
|
+
}
|
|
72
|
+
const ns = conf[require_constants.CONFIG_KEY_CHECKPOINT_NS]?.split(require_constants.CHECKPOINT_NAMESPACE_SEPARATOR);
|
|
73
|
+
const id = ns ? require_hash.XXH3(ns.join(require_constants.CHECKPOINT_NAMESPACE_SEPARATOR)) : void 0;
|
|
74
|
+
throw new require_errors.GraphInterrupt([{
|
|
75
|
+
id,
|
|
76
|
+
value
|
|
77
|
+
}]);
|
|
87
78
|
}
|
|
88
|
-
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
exports.interrupt = interrupt;
|
|
82
|
+
//# sourceMappingURL=interrupt.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interrupt.cjs","names":["config: RunnableConfig | undefined","AsyncLocalStorageProviderSingleton","checkpointer: BaseCheckpointSaver","CONFIG_KEY_CHECKPOINTER","GraphValueError","scratchpad: PregelScratchpad","CONFIG_KEY_SCRATCHPAD","CONFIG_KEY_SEND","RESUME","ns: string[] | undefined","CONFIG_KEY_CHECKPOINT_NS","CHECKPOINT_NAMESPACE_SEPARATOR","XXH3","GraphInterrupt"],"sources":["../src/interrupt.ts"],"sourcesContent":["import { AsyncLocalStorageProviderSingleton } from \"@langchain/core/singletons\";\nimport { RunnableConfig } from \"@langchain/core/runnables\";\nimport {\n BaseCheckpointSaver,\n type PendingWrite,\n} from \"@langchain/langgraph-checkpoint\";\nimport { GraphInterrupt, GraphValueError } from \"./errors.js\";\nimport {\n CONFIG_KEY_CHECKPOINT_NS,\n CONFIG_KEY_SCRATCHPAD,\n CONFIG_KEY_SEND,\n CONFIG_KEY_CHECKPOINTER,\n CHECKPOINT_NAMESPACE_SEPARATOR,\n RESUME,\n} from \"./constants.js\";\nimport { PregelScratchpad } from \"./pregel/types.js\";\nimport { XXH3 } from \"./hash.js\";\n\n/**\n * Interrupts the execution of a graph node.\n * This function can be used to pause execution of a node, and return the value of the `resume`\n * input when the graph is re-invoked using `Command`.\n * Multiple interrupts can be called within a single node, and each will be handled sequentially.\n *\n * When an interrupt is called:\n * 1. If there's a `resume` value available (from a previous `Command`), it returns that value.\n * 2. Otherwise, it throws a `GraphInterrupt` with the provided value\n * 3. The graph can be resumed by passing a `Command` with a `resume` value\n *\n * Because the `interrupt` function propagates by throwing a special `GraphInterrupt` error,\n * you should avoid using `try/catch` blocks around the `interrupt` function,\n * or if you do, ensure that the `GraphInterrupt` error is thrown again within your `catch` block.\n *\n * @param value - The value to include in the interrupt. This will be available in task.interrupts[].value\n * @returns The `resume` value provided when the graph is re-invoked with a Command\n *\n * @example\n * ```typescript\n * // Define a node that uses multiple interrupts\n * const nodeWithInterrupts = () => {\n * // First interrupt - will pause execution and include {value: 1} in task values\n * const answer1 = interrupt({ value: 1 });\n *\n * // Second interrupt - only called after first interrupt is resumed\n * const answer2 = interrupt({ value: 2 });\n *\n * // Use the resume values\n * return { myKey: answer1 + \" \" + answer2 };\n * };\n *\n * // Resume the graph after first interrupt\n * await graph.stream(new Command({ resume: \"answer 1\" }));\n *\n * // Resume the graph after second interrupt\n * await graph.stream(new Command({ resume: \"answer 2\" }));\n * // Final result: { myKey: \"answer 1 answer 2\" }\n * ```\n *\n * @throws {Error} If called outside the context of a graph\n * @throws {GraphInterrupt} When no resume value is available\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function interrupt<I = unknown, R = any>(value: I): R {\n const config: RunnableConfig | undefined =\n AsyncLocalStorageProviderSingleton.getRunnableConfig();\n if (!config) {\n throw new Error(\"Called interrupt() outside the context of a graph.\");\n }\n\n const conf = config.configurable;\n if (!conf) {\n throw new Error(\"No configurable found in config\");\n }\n\n const checkpointer: BaseCheckpointSaver = conf[CONFIG_KEY_CHECKPOINTER];\n if (!checkpointer) throw new GraphValueError(\"No checkpointer set\");\n\n // Track interrupt index\n const scratchpad: PregelScratchpad = conf[CONFIG_KEY_SCRATCHPAD];\n scratchpad.interruptCounter += 1;\n const idx = scratchpad.interruptCounter;\n\n // Find previous resume values\n if (scratchpad.resume.length > 0 && idx < scratchpad.resume.length) {\n conf[CONFIG_KEY_SEND]?.([[RESUME, scratchpad.resume] as PendingWrite]);\n return scratchpad.resume[idx] as R;\n }\n\n // Find current resume value\n if (scratchpad.nullResume !== undefined) {\n if (scratchpad.resume.length !== idx) {\n throw new Error(\n `Resume length mismatch: ${scratchpad.resume.length} !== ${idx}`\n );\n }\n const v = scratchpad.consumeNullResume();\n scratchpad.resume.push(v);\n conf[CONFIG_KEY_SEND]?.([[RESUME, scratchpad.resume] as PendingWrite]);\n return v as R;\n }\n\n // No resume value found\n const ns: string[] | undefined = conf[CONFIG_KEY_CHECKPOINT_NS]?.split(\n CHECKPOINT_NAMESPACE_SEPARATOR\n );\n\n const id = ns ? XXH3(ns.join(CHECKPOINT_NAMESPACE_SEPARATOR)) : undefined;\n throw new GraphInterrupt([{ id, value }]);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DA,SAAgB,UAAgC,OAAa;CAC3D,MAAMA,SACJC,+DAAmC;AACrC,KAAI,CAAC,OACH,OAAM,IAAI,MAAM;CAGlB,MAAM,OAAO,OAAO;AACpB,KAAI,CAAC,KACH,OAAM,IAAI,MAAM;CAGlB,MAAMC,eAAoC,KAAKC;AAC/C,KAAI,CAAC,aAAc,OAAM,IAAIC,+BAAgB;CAG7C,MAAMC,aAA+B,KAAKC;AAC1C,YAAW,oBAAoB;CAC/B,MAAM,MAAM,WAAW;AAGvB,KAAI,WAAW,OAAO,SAAS,KAAK,MAAM,WAAW,OAAO,QAAQ;AAClE,OAAKC,qCAAmB,CAAC,CAACC,0BAAQ,WAAW;AAC7C,SAAO,WAAW,OAAO;;AAI3B,KAAI,WAAW,eAAe,QAAW;AACvC,MAAI,WAAW,OAAO,WAAW,IAC/B,OAAM,IAAI,MACR,2BAA2B,WAAW,OAAO,OAAO,OAAO;EAG/D,MAAM,IAAI,WAAW;AACrB,aAAW,OAAO,KAAK;AACvB,OAAKD,qCAAmB,CAAC,CAACC,0BAAQ,WAAW;AAC7C,SAAO;;CAIT,MAAMC,KAA2B,KAAKC,6CAA2B,MAC/DC;CAGF,MAAM,KAAK,KAAKC,kBAAK,GAAG,KAAKD,qDAAmC;AAChE,OAAM,IAAIE,8BAAe,CAAC;EAAE;EAAI"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
//#region src/interrupt.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Interrupts the execution of a graph node.
|
|
4
|
+
* This function can be used to pause execution of a node, and return the value of the `resume`
|
|
5
|
+
* input when the graph is re-invoked using `Command`.
|
|
6
|
+
* Multiple interrupts can be called within a single node, and each will be handled sequentially.
|
|
7
|
+
*
|
|
8
|
+
* When an interrupt is called:
|
|
9
|
+
* 1. If there's a `resume` value available (from a previous `Command`), it returns that value.
|
|
10
|
+
* 2. Otherwise, it throws a `GraphInterrupt` with the provided value
|
|
11
|
+
* 3. The graph can be resumed by passing a `Command` with a `resume` value
|
|
12
|
+
*
|
|
13
|
+
* Because the `interrupt` function propagates by throwing a special `GraphInterrupt` error,
|
|
14
|
+
* you should avoid using `try/catch` blocks around the `interrupt` function,
|
|
15
|
+
* or if you do, ensure that the `GraphInterrupt` error is thrown again within your `catch` block.
|
|
16
|
+
*
|
|
17
|
+
* @param value - The value to include in the interrupt. This will be available in task.interrupts[].value
|
|
18
|
+
* @returns The `resume` value provided when the graph is re-invoked with a Command
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* // Define a node that uses multiple interrupts
|
|
23
|
+
* const nodeWithInterrupts = () => {
|
|
24
|
+
* // First interrupt - will pause execution and include {value: 1} in task values
|
|
25
|
+
* const answer1 = interrupt({ value: 1 });
|
|
26
|
+
*
|
|
27
|
+
* // Second interrupt - only called after first interrupt is resumed
|
|
28
|
+
* const answer2 = interrupt({ value: 2 });
|
|
29
|
+
*
|
|
30
|
+
* // Use the resume values
|
|
31
|
+
* return { myKey: answer1 + " " + answer2 };
|
|
32
|
+
* };
|
|
33
|
+
*
|
|
34
|
+
* // Resume the graph after first interrupt
|
|
35
|
+
* await graph.stream(new Command({ resume: "answer 1" }));
|
|
36
|
+
*
|
|
37
|
+
* // Resume the graph after second interrupt
|
|
38
|
+
* await graph.stream(new Command({ resume: "answer 2" }));
|
|
39
|
+
* // Final result: { myKey: "answer 1 answer 2" }
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @throws {Error} If called outside the context of a graph
|
|
43
|
+
* @throws {GraphInterrupt} When no resume value is available
|
|
44
|
+
*/
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
46
|
+
declare function interrupt<I = unknown, R = any>(value: I): R;
|
|
47
|
+
//#endregion
|
|
48
|
+
export { interrupt };
|
|
49
|
+
//# sourceMappingURL=interrupt.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interrupt.d.cts","names":["interrupt","I","R"],"sources":["../src/interrupt.d.ts"],"sourcesContent":["/**\n * Interrupts the execution of a graph node.\n * This function can be used to pause execution of a node, and return the value of the `resume`\n * input when the graph is re-invoked using `Command`.\n * Multiple interrupts can be called within a single node, and each will be handled sequentially.\n *\n * When an interrupt is called:\n * 1. If there's a `resume` value available (from a previous `Command`), it returns that value.\n * 2. Otherwise, it throws a `GraphInterrupt` with the provided value\n * 3. The graph can be resumed by passing a `Command` with a `resume` value\n *\n * Because the `interrupt` function propagates by throwing a special `GraphInterrupt` error,\n * you should avoid using `try/catch` blocks around the `interrupt` function,\n * or if you do, ensure that the `GraphInterrupt` error is thrown again within your `catch` block.\n *\n * @param value - The value to include in the interrupt. This will be available in task.interrupts[].value\n * @returns The `resume` value provided when the graph is re-invoked with a Command\n *\n * @example\n * ```typescript\n * // Define a node that uses multiple interrupts\n * const nodeWithInterrupts = () => {\n * // First interrupt - will pause execution and include {value: 1} in task values\n * const answer1 = interrupt({ value: 1 });\n *\n * // Second interrupt - only called after first interrupt is resumed\n * const answer2 = interrupt({ value: 2 });\n *\n * // Use the resume values\n * return { myKey: answer1 + \" \" + answer2 };\n * };\n *\n * // Resume the graph after first interrupt\n * await graph.stream(new Command({ resume: \"answer 1\" }));\n *\n * // Resume the graph after second interrupt\n * await graph.stream(new Command({ resume: \"answer 2\" }));\n * // Final result: { myKey: \"answer 1 answer 2\" }\n * ```\n *\n * @throws {Error} If called outside the context of a graph\n * @throws {GraphInterrupt} When no resume value is available\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport declare function interrupt<I = unknown, R = any>(value: I): R;\n"],"mappings":";;AA4CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAwBA,uCAAuCC,IAAIC"}
|
package/dist/interrupt.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//#region src/interrupt.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* Interrupts the execution of a graph node.
|
|
3
4
|
* This function can be used to pause execution of a node, and return the value of the `resume`
|
|
@@ -41,4 +42,8 @@
|
|
|
41
42
|
* @throws {Error} If called outside the context of a graph
|
|
42
43
|
* @throws {GraphInterrupt} When no resume value is available
|
|
43
44
|
*/
|
|
44
|
-
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
46
|
+
declare function interrupt<I = unknown, R = any>(value: I): R;
|
|
47
|
+
//#endregion
|
|
48
|
+
export { interrupt };
|
|
49
|
+
//# sourceMappingURL=interrupt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interrupt.d.ts","names":["interrupt","I","R"],"sources":["../src/interrupt.d.ts"],"sourcesContent":["/**\n * Interrupts the execution of a graph node.\n * This function can be used to pause execution of a node, and return the value of the `resume`\n * input when the graph is re-invoked using `Command`.\n * Multiple interrupts can be called within a single node, and each will be handled sequentially.\n *\n * When an interrupt is called:\n * 1. If there's a `resume` value available (from a previous `Command`), it returns that value.\n * 2. Otherwise, it throws a `GraphInterrupt` with the provided value\n * 3. The graph can be resumed by passing a `Command` with a `resume` value\n *\n * Because the `interrupt` function propagates by throwing a special `GraphInterrupt` error,\n * you should avoid using `try/catch` blocks around the `interrupt` function,\n * or if you do, ensure that the `GraphInterrupt` error is thrown again within your `catch` block.\n *\n * @param value - The value to include in the interrupt. This will be available in task.interrupts[].value\n * @returns The `resume` value provided when the graph is re-invoked with a Command\n *\n * @example\n * ```typescript\n * // Define a node that uses multiple interrupts\n * const nodeWithInterrupts = () => {\n * // First interrupt - will pause execution and include {value: 1} in task values\n * const answer1 = interrupt({ value: 1 });\n *\n * // Second interrupt - only called after first interrupt is resumed\n * const answer2 = interrupt({ value: 2 });\n *\n * // Use the resume values\n * return { myKey: answer1 + \" \" + answer2 };\n * };\n *\n * // Resume the graph after first interrupt\n * await graph.stream(new Command({ resume: \"answer 1\" }));\n *\n * // Resume the graph after second interrupt\n * await graph.stream(new Command({ resume: \"answer 2\" }));\n * // Final result: { myKey: \"answer 1 answer 2\" }\n * ```\n *\n * @throws {Error} If called outside the context of a graph\n * @throws {GraphInterrupt} When no resume value is available\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport declare function interrupt<I = unknown, R = any>(value: I): R;\n"],"mappings":";;AA4CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAwBA,uCAAuCC,IAAIC"}
|