@langchain/langgraph 0.4.8 → 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 +7 -2
- 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 +83 -86
- 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/pregel/write.js
CHANGED
|
@@ -1,143 +1,95 @@
|
|
|
1
|
-
import { Runnable, } from "@langchain/core/runnables";
|
|
2
|
-
import { _isSend, CONFIG_KEY_SEND, TASKS } from "../constants.js";
|
|
3
|
-
import { RunnableCallable } from "../utils.js";
|
|
4
1
|
import { InvalidUpdateError } from "../errors.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
2
|
+
import { CONFIG_KEY_SEND, TASKS, _isSend } from "../constants.js";
|
|
3
|
+
import { RunnableCallable } from "../utils.js";
|
|
4
|
+
import { Runnable } from "@langchain/core/runnables";
|
|
5
|
+
|
|
6
|
+
//#region src/pregel/write.ts
|
|
7
|
+
const SKIP_WRITE = { [Symbol.for("LG_SKIP_WRITE")]: true };
|
|
8
8
|
function _isSkipWrite(x) {
|
|
9
|
-
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
-
x?.[Symbol.for("LG_SKIP_WRITE")] !== undefined);
|
|
9
|
+
return typeof x === "object" && x?.[Symbol.for("LG_SKIP_WRITE")] !== void 0;
|
|
12
10
|
}
|
|
13
|
-
|
|
14
|
-
[Symbol.for("LG_PASSTHROUGH")]: true,
|
|
15
|
-
};
|
|
11
|
+
const PASSTHROUGH = { [Symbol.for("LG_PASSTHROUGH")]: true };
|
|
16
12
|
function _isPassthrough(x) {
|
|
17
|
-
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
|
-
x?.[Symbol.for("LG_PASSTHROUGH")] !== undefined);
|
|
13
|
+
return typeof x === "object" && x?.[Symbol.for("LG_PASSTHROUGH")] !== void 0;
|
|
20
14
|
}
|
|
21
15
|
const IS_WRITER = Symbol("IS_WRITER");
|
|
22
16
|
/**
|
|
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
|
-
|
|
52
|
-
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
95
|
-
const writeEntries = [];
|
|
96
|
-
for (const w of writes) {
|
|
97
|
-
if (_isSend(w)) {
|
|
98
|
-
writeEntries.push([TASKS, w]);
|
|
99
|
-
}
|
|
100
|
-
else if (_isChannelWriteTupleEntry(w)) {
|
|
101
|
-
const mappedResult = await w.mapper.invoke(w.value, config);
|
|
102
|
-
if (mappedResult != null && mappedResult.length > 0) {
|
|
103
|
-
writeEntries.push(...mappedResult);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
else if (_isChannelWriteEntry(w)) {
|
|
107
|
-
const mappedValue = w.mapper !== undefined
|
|
108
|
-
? await w.mapper.invoke(w.value, config)
|
|
109
|
-
: w.value;
|
|
110
|
-
if (_isSkipWrite(mappedValue)) {
|
|
111
|
-
continue;
|
|
112
|
-
}
|
|
113
|
-
if (w.skipNone && mappedValue === undefined) {
|
|
114
|
-
continue;
|
|
115
|
-
}
|
|
116
|
-
writeEntries.push([w.channel, mappedValue]);
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
throw new Error(`Invalid write entry: ${JSON.stringify(w)}`);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
const write = config.configurable?.[CONFIG_KEY_SEND];
|
|
123
|
-
write(writeEntries);
|
|
124
|
-
}
|
|
125
|
-
static isWriter(runnable) {
|
|
126
|
-
return (
|
|
127
|
-
// eslint-disable-next-line no-instanceof/no-instanceof
|
|
128
|
-
runnable instanceof ChannelWrite ||
|
|
129
|
-
(IS_WRITER in runnable && !!runnable[IS_WRITER]));
|
|
130
|
-
}
|
|
131
|
-
static registerWriter(runnable) {
|
|
132
|
-
return Object.defineProperty(runnable, IS_WRITER, { value: true });
|
|
133
|
-
}
|
|
134
|
-
}
|
|
17
|
+
* Mapping of write channels to Runnables that return the value to be written,
|
|
18
|
+
* or None to skip writing.
|
|
19
|
+
*/
|
|
20
|
+
var ChannelWrite = class ChannelWrite extends RunnableCallable {
|
|
21
|
+
writes;
|
|
22
|
+
constructor(writes, tags) {
|
|
23
|
+
const name = `ChannelWrite<${writes.map((packet) => {
|
|
24
|
+
if (_isSend(packet)) return packet.node;
|
|
25
|
+
else if ("channel" in packet) return packet.channel;
|
|
26
|
+
return "...";
|
|
27
|
+
}).join(",")}>`;
|
|
28
|
+
super({
|
|
29
|
+
writes,
|
|
30
|
+
name,
|
|
31
|
+
tags,
|
|
32
|
+
func: async (input, config) => {
|
|
33
|
+
return this._write(input, config ?? {});
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
this.writes = writes;
|
|
37
|
+
}
|
|
38
|
+
async _write(input, config) {
|
|
39
|
+
const writes = this.writes.map((write) => {
|
|
40
|
+
if (_isChannelWriteTupleEntry(write) && _isPassthrough(write.value)) return {
|
|
41
|
+
mapper: write.mapper,
|
|
42
|
+
value: input
|
|
43
|
+
};
|
|
44
|
+
else if (_isChannelWriteEntry(write) && _isPassthrough(write.value)) return {
|
|
45
|
+
channel: write.channel,
|
|
46
|
+
value: input,
|
|
47
|
+
skipNone: write.skipNone,
|
|
48
|
+
mapper: write.mapper
|
|
49
|
+
};
|
|
50
|
+
else return write;
|
|
51
|
+
});
|
|
52
|
+
await ChannelWrite.doWrite(config, writes);
|
|
53
|
+
return input;
|
|
54
|
+
}
|
|
55
|
+
static async doWrite(config, writes) {
|
|
56
|
+
for (const w of writes) {
|
|
57
|
+
if (_isChannelWriteEntry(w)) {
|
|
58
|
+
if (w.channel === TASKS) throw new InvalidUpdateError("Cannot write to the reserved channel TASKS");
|
|
59
|
+
if (_isPassthrough(w.value)) throw new InvalidUpdateError("PASSTHROUGH value must be replaced");
|
|
60
|
+
}
|
|
61
|
+
if (_isChannelWriteTupleEntry(w)) {
|
|
62
|
+
if (_isPassthrough(w.value)) throw new InvalidUpdateError("PASSTHROUGH value must be replaced");
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const writeEntries = [];
|
|
66
|
+
for (const w of writes) if (_isSend(w)) writeEntries.push([TASKS, w]);
|
|
67
|
+
else if (_isChannelWriteTupleEntry(w)) {
|
|
68
|
+
const mappedResult = await w.mapper.invoke(w.value, config);
|
|
69
|
+
if (mappedResult != null && mappedResult.length > 0) writeEntries.push(...mappedResult);
|
|
70
|
+
} else if (_isChannelWriteEntry(w)) {
|
|
71
|
+
const mappedValue = w.mapper !== void 0 ? await w.mapper.invoke(w.value, config) : w.value;
|
|
72
|
+
if (_isSkipWrite(mappedValue)) continue;
|
|
73
|
+
if (w.skipNone && mappedValue === void 0) continue;
|
|
74
|
+
writeEntries.push([w.channel, mappedValue]);
|
|
75
|
+
} else throw new Error(`Invalid write entry: ${JSON.stringify(w)}`);
|
|
76
|
+
const write = config.configurable?.[CONFIG_KEY_SEND];
|
|
77
|
+
write(writeEntries);
|
|
78
|
+
}
|
|
79
|
+
static isWriter(runnable) {
|
|
80
|
+
return runnable instanceof ChannelWrite || IS_WRITER in runnable && !!runnable[IS_WRITER];
|
|
81
|
+
}
|
|
82
|
+
static registerWriter(runnable) {
|
|
83
|
+
return Object.defineProperty(runnable, IS_WRITER, { value: true });
|
|
84
|
+
}
|
|
85
|
+
};
|
|
135
86
|
function _isChannelWriteEntry(x) {
|
|
136
|
-
|
|
87
|
+
return x !== void 0 && typeof x.channel === "string";
|
|
137
88
|
}
|
|
138
89
|
function _isChannelWriteTupleEntry(x) {
|
|
139
|
-
|
|
140
|
-
!_isChannelWriteEntry(x) &&
|
|
141
|
-
Runnable.isRunnable(x.mapper));
|
|
90
|
+
return x !== void 0 && !_isChannelWriteEntry(x) && Runnable.isRunnable(x.mapper);
|
|
142
91
|
}
|
|
92
|
+
|
|
93
|
+
//#endregion
|
|
94
|
+
export { ChannelWrite, PASSTHROUGH };
|
|
143
95
|
//# sourceMappingURL=write.js.map
|
package/dist/pregel/write.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write.js","
|
|
1
|
+
{"version":3,"file":"write.js","names":["writeEntries: [string, any][]","write: TYPE_SEND"],"sources":["../../src/pregel/write.ts"],"sourcesContent":["import {\n Runnable,\n RunnableConfig,\n RunnableLike,\n} from \"@langchain/core/runnables\";\nimport { _isSend, CONFIG_KEY_SEND, Send, TASKS } from \"../constants.js\";\nimport { RunnableCallable } from \"../utils.js\";\nimport { InvalidUpdateError } from \"../errors.js\";\n\ntype TYPE_SEND = (values: Array<[string, unknown]>) => void;\n\nexport const SKIP_WRITE = {\n [Symbol.for(\"LG_SKIP_WRITE\")]: true,\n};\n\nfunction _isSkipWrite(x: unknown) {\n return (\n typeof x === \"object\" &&\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (x as any)?.[Symbol.for(\"LG_SKIP_WRITE\")] !== undefined\n );\n}\n\nexport const PASSTHROUGH = {\n [Symbol.for(\"LG_PASSTHROUGH\")]: true,\n};\n\nfunction _isPassthrough(x: unknown) {\n return (\n typeof x === \"object\" &&\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (x as any)?.[Symbol.for(\"LG_PASSTHROUGH\")] !== undefined\n );\n}\n\nconst IS_WRITER = Symbol(\"IS_WRITER\");\n\n/**\n * Mapping of write channels to Runnables that return the value to be written,\n * or None to skip writing.\n */\nexport class ChannelWrite<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunInput = any\n> extends RunnableCallable<RunInput, RunInput> {\n writes: Array<ChannelWriteEntry | ChannelWriteTupleEntry | Send>;\n\n constructor(\n writes: Array<ChannelWriteEntry | ChannelWriteTupleEntry | Send>,\n tags?: string[]\n ) {\n const name = `ChannelWrite<${writes\n .map((packet) => {\n if (_isSend(packet)) {\n return packet.node;\n } else if (\"channel\" in packet) {\n return packet.channel;\n }\n return \"...\";\n })\n .join(\",\")}>`;\n super({\n ...{ writes, name, tags },\n func: async (input: RunInput, config?: RunnableConfig) => {\n return this._write(input, config ?? {});\n },\n });\n\n this.writes = writes;\n }\n\n async _write(input: unknown, config: RunnableConfig): Promise<unknown> {\n const writes = this.writes.map((write) => {\n if (_isChannelWriteTupleEntry(write) && _isPassthrough(write.value)) {\n return {\n mapper: write.mapper,\n value: input,\n };\n } else if (_isChannelWriteEntry(write) && _isPassthrough(write.value)) {\n return {\n channel: write.channel,\n value: input,\n skipNone: write.skipNone,\n mapper: write.mapper,\n };\n } else {\n return write;\n }\n });\n await ChannelWrite.doWrite(config, writes);\n return input;\n }\n\n // TODO: Support requireAtLeastOneOf\n static async doWrite(\n config: RunnableConfig,\n writes: (ChannelWriteEntry | ChannelWriteTupleEntry | Send)[]\n ): Promise<void> {\n // validate\n for (const w of writes) {\n if (_isChannelWriteEntry(w)) {\n if (w.channel === TASKS) {\n throw new InvalidUpdateError(\n \"Cannot write to the reserved channel TASKS\"\n );\n }\n if (_isPassthrough(w.value)) {\n throw new InvalidUpdateError(\"PASSTHROUGH value must be replaced\");\n }\n }\n if (_isChannelWriteTupleEntry(w)) {\n if (_isPassthrough(w.value)) {\n throw new InvalidUpdateError(\"PASSTHROUGH value must be replaced\");\n }\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const writeEntries: [string, any][] = [];\n for (const w of writes) {\n if (_isSend(w)) {\n writeEntries.push([TASKS, w]);\n } else if (_isChannelWriteTupleEntry(w)) {\n const mappedResult = await w.mapper.invoke(w.value, config);\n if (mappedResult != null && mappedResult.length > 0) {\n writeEntries.push(...mappedResult);\n }\n } else if (_isChannelWriteEntry(w)) {\n const mappedValue =\n w.mapper !== undefined\n ? await w.mapper.invoke(w.value, config)\n : w.value;\n if (_isSkipWrite(mappedValue)) {\n continue;\n }\n if (w.skipNone && mappedValue === undefined) {\n continue;\n }\n writeEntries.push([w.channel, mappedValue]);\n } else {\n throw new Error(`Invalid write entry: ${JSON.stringify(w)}`);\n }\n }\n const write: TYPE_SEND = config.configurable?.[CONFIG_KEY_SEND];\n write(writeEntries);\n }\n\n static isWriter(runnable: RunnableLike): runnable is ChannelWrite {\n return (\n // eslint-disable-next-line no-instanceof/no-instanceof\n runnable instanceof ChannelWrite ||\n (IS_WRITER in runnable && !!runnable[IS_WRITER])\n );\n }\n\n static registerWriter<T extends Runnable>(runnable: T): T {\n return Object.defineProperty(runnable, IS_WRITER, { value: true });\n }\n}\n\nexport interface ChannelWriteEntry {\n channel: string;\n value: unknown;\n skipNone?: boolean;\n mapper?: Runnable;\n}\n\nfunction _isChannelWriteEntry(x: unknown): x is ChannelWriteEntry {\n return (\n x !== undefined && typeof (x as ChannelWriteEntry).channel === \"string\"\n );\n}\n\nexport interface ChannelWriteTupleEntry {\n value: unknown;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n mapper: Runnable<any, [string, any][]>;\n}\n\nfunction _isChannelWriteTupleEntry(x: unknown): x is ChannelWriteTupleEntry {\n return (\n x !== undefined &&\n !_isChannelWriteEntry(x) &&\n Runnable.isRunnable((x as ChannelWriteTupleEntry).mapper)\n );\n}\n"],"mappings":";;;;;;AAWA,MAAa,aAAa,GACvB,OAAO,IAAI,mBAAmB;AAGjC,SAAS,aAAa,GAAY;AAChC,QACE,OAAO,MAAM,YAEZ,IAAY,OAAO,IAAI,sBAAsB;;AAIlD,MAAa,cAAc,GACxB,OAAO,IAAI,oBAAoB;AAGlC,SAAS,eAAe,GAAY;AAClC,QACE,OAAO,MAAM,YAEZ,IAAY,OAAO,IAAI,uBAAuB;;AAInD,MAAM,YAAY,OAAO;;;;;AAMzB,IAAa,eAAb,MAAa,qBAGH,iBAAqC;CAC7C;CAEA,YACE,QACA,MACA;EACA,MAAM,OAAO,gBAAgB,OAC1B,KAAK,WAAW;AACf,OAAI,QAAQ,QACV,QAAO,OAAO;YACL,aAAa,OACtB,QAAO,OAAO;AAEhB,UAAO;KAER,KAAK,KAAK;AACb,QAAM;GACC;GAAQ;GAAM;GACnB,MAAM,OAAO,OAAiB,WAA4B;AACxD,WAAO,KAAK,OAAO,OAAO,UAAU;;;AAIxC,OAAK,SAAS;;CAGhB,MAAM,OAAO,OAAgB,QAA0C;EACrE,MAAM,SAAS,KAAK,OAAO,KAAK,UAAU;AACxC,OAAI,0BAA0B,UAAU,eAAe,MAAM,OAC3D,QAAO;IACL,QAAQ,MAAM;IACd,OAAO;;YAEA,qBAAqB,UAAU,eAAe,MAAM,OAC7D,QAAO;IACL,SAAS,MAAM;IACf,OAAO;IACP,UAAU,MAAM;IAChB,QAAQ,MAAM;;OAGhB,QAAO;;AAGX,QAAM,aAAa,QAAQ,QAAQ;AACnC,SAAO;;CAIT,aAAa,QACX,QACA,QACe;AAEf,OAAK,MAAM,KAAK,QAAQ;AACtB,OAAI,qBAAqB,IAAI;AAC3B,QAAI,EAAE,YAAY,MAChB,OAAM,IAAI,mBACR;AAGJ,QAAI,eAAe,EAAE,OACnB,OAAM,IAAI,mBAAmB;;AAGjC,OAAI,0BAA0B,IAC5B;QAAI,eAAe,EAAE,OACnB,OAAM,IAAI,mBAAmB;;;EAKnC,MAAMA,eAAgC;AACtC,OAAK,MAAM,KAAK,OACd,KAAI,QAAQ,GACV,cAAa,KAAK,CAAC,OAAO;WACjB,0BAA0B,IAAI;GACvC,MAAM,eAAe,MAAM,EAAE,OAAO,OAAO,EAAE,OAAO;AACpD,OAAI,gBAAgB,QAAQ,aAAa,SAAS,EAChD,cAAa,KAAK,GAAG;aAEd,qBAAqB,IAAI;GAClC,MAAM,cACJ,EAAE,WAAW,SACT,MAAM,EAAE,OAAO,OAAO,EAAE,OAAO,UAC/B,EAAE;AACR,OAAI,aAAa,aACf;AAEF,OAAI,EAAE,YAAY,gBAAgB,OAChC;AAEF,gBAAa,KAAK,CAAC,EAAE,SAAS;QAE9B,OAAM,IAAI,MAAM,wBAAwB,KAAK,UAAU;EAG3D,MAAMC,QAAmB,OAAO,eAAe;AAC/C,QAAM;;CAGR,OAAO,SAAS,UAAkD;AAChE,SAEE,oBAAoB,gBACnB,aAAa,YAAY,CAAC,CAAC,SAAS;;CAIzC,OAAO,eAAmC,UAAgB;AACxD,SAAO,OAAO,eAAe,UAAU,WAAW,EAAE,OAAO;;;AAW/D,SAAS,qBAAqB,GAAoC;AAChE,QACE,MAAM,UAAa,OAAQ,EAAwB,YAAY;;AAUnE,SAAS,0BAA0B,GAAyC;AAC1E,QACE,MAAM,UACN,CAAC,qBAAqB,MACtB,SAAS,WAAY,EAA6B"}
|
package/dist/remote.cjs
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.RemoteGraph =
|
|
4
|
-
var remote_js_1 = require("./pregel/remote.cjs");
|
|
5
|
-
Object.defineProperty(exports, "RemoteGraph", { enumerable: true, get: function () { return remote_js_1.RemoteGraph; } });
|
|
6
|
-
//# sourceMappingURL=remote.js.map
|
|
1
|
+
const require_remote = require('./pregel/remote.cjs');
|
|
2
|
+
|
|
3
|
+
exports.RemoteGraph = require_remote.RemoteGraph;
|
package/dist/remote.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { RemoteGraph, RemoteGraphParams } from "./pregel/remote.js";
|
|
2
|
+
export { RemoteGraph, type RemoteGraphParams };
|
package/dist/remote.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { RemoteGraph } from "./pregel/remote.js";
|
|
2
|
+
|
|
3
|
+
export { RemoteGraph };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const __langchain_core_singletons = require_rolldown_runtime.__toESM(require("@langchain/core/singletons"));
|
|
3
|
+
const node_async_hooks = require_rolldown_runtime.__toESM(require("node:async_hooks"));
|
|
4
|
+
|
|
5
|
+
//#region src/setup/async_local_storage.ts
|
|
6
6
|
function initializeAsyncLocalStorageSingleton() {
|
|
7
|
-
|
|
7
|
+
__langchain_core_singletons.AsyncLocalStorageProviderSingleton.initializeGlobalInstance(new node_async_hooks.AsyncLocalStorage());
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
exports.initializeAsyncLocalStorageSingleton = initializeAsyncLocalStorageSingleton;
|
|
12
|
+
//# sourceMappingURL=async_local_storage.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async_local_storage.cjs","names":["AsyncLocalStorage"],"sources":["../../src/setup/async_local_storage.ts"],"sourcesContent":["import { AsyncLocalStorageProviderSingleton } from \"@langchain/core/singletons\";\nimport { AsyncLocalStorage } from \"node:async_hooks\";\n\nexport function initializeAsyncLocalStorageSingleton() {\n AsyncLocalStorageProviderSingleton.initializeGlobalInstance(\n new AsyncLocalStorage()\n );\n}\n"],"mappings":";;;;;AAGA,SAAgB,uCAAuC;AACrD,gEAAmC,yBACjC,IAAIA"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { AsyncLocalStorageProviderSingleton } from "@langchain/core/singletons";
|
|
2
2
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
|
|
4
|
+
//#region src/setup/async_local_storage.ts
|
|
5
|
+
function initializeAsyncLocalStorageSingleton() {
|
|
6
|
+
AsyncLocalStorageProviderSingleton.initializeGlobalInstance(new AsyncLocalStorage());
|
|
5
7
|
}
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { initializeAsyncLocalStorageSingleton };
|
|
6
11
|
//# sourceMappingURL=async_local_storage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async_local_storage.js","
|
|
1
|
+
{"version":3,"file":"async_local_storage.js","names":[],"sources":["../../src/setup/async_local_storage.ts"],"sourcesContent":["import { AsyncLocalStorageProviderSingleton } from \"@langchain/core/singletons\";\nimport { AsyncLocalStorage } from \"node:async_hooks\";\n\nexport function initializeAsyncLocalStorageSingleton() {\n AsyncLocalStorageProviderSingleton.initializeGlobalInstance(\n new AsyncLocalStorage()\n );\n}\n"],"mappings":";;;;AAGA,SAAgB,uCAAuC;AACrD,oCAAmC,yBACjC,IAAI"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SerializedMessage } from "./types.message.cjs";
|
|
2
|
+
import { LangGraphEventStream } from "./types.schema.cjs";
|
|
3
|
+
import { ExtraTypeBag, InferLangGraphEventStream } from "./types.infer.cjs";
|
|
4
|
+
import { toLangGraphEventStream, toLangGraphEventStreamResponse } from "./stream.cjs";
|
|
5
|
+
export { type ExtraTypeBag, type InferLangGraphEventStream, type LangGraphEventStream, type SerializedMessage, toLangGraphEventStream, toLangGraphEventStreamResponse };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SerializedMessage } from "./types.message.js";
|
|
2
|
+
import { LangGraphEventStream } from "./types.schema.js";
|
|
3
|
+
import { ExtraTypeBag, InferLangGraphEventStream } from "./types.infer.js";
|
|
4
|
+
import { toLangGraphEventStream, toLangGraphEventStreamResponse } from "./stream.js";
|
|
5
|
+
export { type ExtraTypeBag, type InferLangGraphEventStream, type LangGraphEventStream, type SerializedMessage, toLangGraphEventStream, toLangGraphEventStreamResponse };
|
package/dist/ui/index.js
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/ui/stream.ts
|
|
3
|
+
const serialiseAsDict = (obj) => {
|
|
4
|
+
return JSON.parse(JSON.stringify(obj, function(key, value) {
|
|
5
|
+
const rawValue = this[key];
|
|
6
|
+
if (rawValue != null && typeof rawValue === "object" && "toDict" in rawValue && typeof rawValue.toDict === "function") {
|
|
7
|
+
const { type, data } = rawValue.toDict();
|
|
8
|
+
return {
|
|
9
|
+
...data,
|
|
10
|
+
type
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
return value;
|
|
14
|
+
}));
|
|
15
|
+
};
|
|
16
|
+
const serializeError = (error) => {
|
|
17
|
+
if (error instanceof Error) return {
|
|
18
|
+
error: error.name,
|
|
19
|
+
message: error.message
|
|
20
|
+
};
|
|
21
|
+
return {
|
|
22
|
+
error: "Error",
|
|
23
|
+
message: JSON.stringify(error)
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
const isRunnableConfig = (config) => {
|
|
27
|
+
if (typeof config !== "object" || config == null) return false;
|
|
28
|
+
return "configurable" in config && typeof config.configurable === "object" && config.configurable != null;
|
|
29
|
+
};
|
|
30
|
+
const extractCheckpointFromConfig = (config) => {
|
|
31
|
+
if (!isRunnableConfig(config) || !config.configurable.thread_id) return null;
|
|
32
|
+
return {
|
|
33
|
+
thread_id: config.configurable.thread_id,
|
|
34
|
+
checkpoint_ns: config.configurable.checkpoint_ns || "",
|
|
35
|
+
checkpoint_id: config.configurable.checkpoint_id || null,
|
|
36
|
+
checkpoint_map: config.configurable.checkpoint_map || null
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
const serializeConfig = (config) => {
|
|
40
|
+
if (isRunnableConfig(config)) {
|
|
41
|
+
const configurable = Object.fromEntries(Object.entries(config.configurable).filter(([key]) => !key.startsWith("__")));
|
|
42
|
+
const newConfig = {
|
|
43
|
+
...config,
|
|
44
|
+
configurable
|
|
45
|
+
};
|
|
46
|
+
delete newConfig.callbacks;
|
|
47
|
+
return newConfig;
|
|
48
|
+
}
|
|
49
|
+
return config;
|
|
50
|
+
};
|
|
51
|
+
function serializeCheckpoint(payload) {
|
|
52
|
+
const result = {
|
|
53
|
+
...payload,
|
|
54
|
+
checkpoint: extractCheckpointFromConfig(payload.config),
|
|
55
|
+
parent_checkpoint: extractCheckpointFromConfig(payload.parentConfig),
|
|
56
|
+
config: serializeConfig(payload.config),
|
|
57
|
+
parent_config: serializeConfig(payload.parentConfig),
|
|
58
|
+
tasks: payload.tasks.map((task) => {
|
|
59
|
+
if (isRunnableConfig(task.state)) {
|
|
60
|
+
const checkpoint = extractCheckpointFromConfig(task.state);
|
|
61
|
+
if (checkpoint != null) {
|
|
62
|
+
const cloneTask = {
|
|
63
|
+
...task,
|
|
64
|
+
checkpoint
|
|
65
|
+
};
|
|
66
|
+
delete cloneTask.state;
|
|
67
|
+
return cloneTask;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return task;
|
|
71
|
+
})
|
|
72
|
+
};
|
|
73
|
+
delete result.parentConfig;
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Converts a `graph.streamEvents()` output into a LangGraph Platform compatible event stream.
|
|
78
|
+
* @experimental Does not follow semver.
|
|
79
|
+
*
|
|
80
|
+
* @param events
|
|
81
|
+
*/
|
|
82
|
+
async function* toLangGraphEventStream(events) {
|
|
83
|
+
let rootRunId;
|
|
84
|
+
try {
|
|
85
|
+
for await (const event of await events) {
|
|
86
|
+
if (event.event === "on_chain_start" && rootRunId == null) rootRunId = event.run_id;
|
|
87
|
+
if (event.tags?.includes("langsmith:hidden")) continue;
|
|
88
|
+
if (event.event === "on_chain_stream" && event.run_id === rootRunId) {
|
|
89
|
+
if (!Array.isArray(event.data.chunk)) continue;
|
|
90
|
+
const [ns, mode, chunk] = event.data.chunk.length === 3 ? event.data.chunk : [null, ...event.data.chunk];
|
|
91
|
+
let data = chunk;
|
|
92
|
+
if (mode === "debug") {
|
|
93
|
+
const debugChunk = chunk;
|
|
94
|
+
if (debugChunk.type === "checkpoint") data = {
|
|
95
|
+
...debugChunk,
|
|
96
|
+
payload: serializeCheckpoint(debugChunk.payload)
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
if (mode === "checkpoints") data = serializeCheckpoint(chunk);
|
|
100
|
+
data = serialiseAsDict(data);
|
|
101
|
+
yield {
|
|
102
|
+
event: ns?.length ? `${mode}|${ns.join("|")}` : mode,
|
|
103
|
+
data
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
} catch (error) {
|
|
108
|
+
yield {
|
|
109
|
+
event: "error",
|
|
110
|
+
data: serializeError(error)
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Converts a `graph.streamEvents()` output into a LangGraph Platform compatible Web Response.
|
|
116
|
+
* @experimental Does not follow semver.
|
|
117
|
+
*/
|
|
118
|
+
function toLangGraphEventStreamResponse(options) {
|
|
119
|
+
const headers = new Headers({
|
|
120
|
+
"Content-Type": "text/event-stream",
|
|
121
|
+
"Cache-Control": "no-cache",
|
|
122
|
+
Connection: "keep-alive"
|
|
123
|
+
});
|
|
124
|
+
if (options.headers) if ("forEach" in options.headers && typeof options.headers.forEach === "function") options.headers.forEach((v, k) => headers.set(k, v));
|
|
125
|
+
else Object.entries(options.headers).map(([k, v]) => headers.set(k, v));
|
|
126
|
+
return new Response(new ReadableStream({ async start(controller) {
|
|
127
|
+
try {
|
|
128
|
+
for await (const { event, data } of toLangGraphEventStream(options.stream)) {
|
|
129
|
+
controller.enqueue(`event: ${event}\n`);
|
|
130
|
+
controller.enqueue(`data: ${JSON.stringify(data)}\n\n`);
|
|
131
|
+
}
|
|
132
|
+
} finally {
|
|
133
|
+
controller.close();
|
|
134
|
+
}
|
|
135
|
+
} }), {
|
|
136
|
+
headers,
|
|
137
|
+
status: options.status,
|
|
138
|
+
statusText: options.statusText
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
//#endregion
|
|
143
|
+
exports.toLangGraphEventStream = toLangGraphEventStream;
|
|
144
|
+
exports.toLangGraphEventStreamResponse = toLangGraphEventStreamResponse;
|
|
145
|
+
//# sourceMappingURL=stream.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream.cjs","names":["result: Record<string, unknown>","cloneTask: Record<string, unknown>","rootRunId: string | undefined","data: unknown"],"sources":["../../src/ui/stream.ts"],"sourcesContent":["import type { RunnableConfig } from \"@langchain/core/runnables\";\nimport type { StreamEvent } from \"@langchain/core/tracers/log_stream\";\nimport type { StreamMode, StreamOutputMap } from \"../pregel/types.js\";\nimport type {\n AnyPregelLike,\n ExtraTypeBag,\n InferLangGraphEventStream,\n} from \"./types.infer.js\";\n\ntype StreamCheckpointsOutput<StreamValues> = StreamOutputMap<\n \"checkpoints\",\n false,\n StreamValues,\n unknown,\n string,\n unknown\n>;\n\nconst serialiseAsDict = <T>(obj: T): T => {\n return JSON.parse(\n JSON.stringify(obj, function (key: string | number, value: unknown) {\n const rawValue = this[key];\n if (\n rawValue != null &&\n typeof rawValue === \"object\" &&\n \"toDict\" in rawValue &&\n typeof rawValue.toDict === \"function\"\n ) {\n const { type, data } = rawValue.toDict();\n return { ...data, type };\n }\n\n return value;\n })\n );\n};\n\nconst serializeError = (error: unknown) => {\n // eslint-disable-next-line no-instanceof/no-instanceof\n if (error instanceof Error) {\n return { error: error.name, message: error.message };\n }\n return { error: \"Error\", message: JSON.stringify(error) };\n};\n\nconst isRunnableConfig = (\n config: unknown\n): config is RunnableConfig & { configurable: Record<string, unknown> } => {\n if (typeof config !== \"object\" || config == null) return false;\n return (\n \"configurable\" in config &&\n typeof config.configurable === \"object\" &&\n config.configurable != null\n );\n};\n\nconst extractCheckpointFromConfig = (\n config: RunnableConfig | null | undefined\n) => {\n if (!isRunnableConfig(config) || !config.configurable.thread_id) {\n return null;\n }\n\n return {\n thread_id: config.configurable.thread_id,\n checkpoint_ns: config.configurable.checkpoint_ns || \"\",\n checkpoint_id: config.configurable.checkpoint_id || null,\n checkpoint_map: config.configurable.checkpoint_map || null,\n };\n};\n\nconst serializeConfig = (config: unknown) => {\n if (isRunnableConfig(config)) {\n const configurable = Object.fromEntries(\n Object.entries(config.configurable).filter(\n ([key]) => !key.startsWith(\"__\")\n )\n );\n\n const newConfig = { ...config, configurable };\n delete newConfig.callbacks;\n return newConfig;\n }\n\n return config;\n};\n\nfunction serializeCheckpoint(payload: StreamCheckpointsOutput<unknown>) {\n const result: Record<string, unknown> = {\n ...payload,\n checkpoint: extractCheckpointFromConfig(payload.config),\n parent_checkpoint: extractCheckpointFromConfig(payload.parentConfig),\n\n config: serializeConfig(payload.config),\n parent_config: serializeConfig(payload.parentConfig),\n\n tasks: payload.tasks.map((task) => {\n if (isRunnableConfig(task.state)) {\n const checkpoint = extractCheckpointFromConfig(task.state);\n if (checkpoint != null) {\n const cloneTask: Record<string, unknown> = { ...task, checkpoint };\n delete cloneTask.state;\n return cloneTask;\n }\n }\n\n return task;\n }),\n };\n\n delete result.parentConfig;\n return result;\n}\n\n/**\n * Converts a `graph.streamEvents()` output into a LangGraph Platform compatible event stream.\n * @experimental Does not follow semver.\n *\n * @param events\n */\nexport async function* toLangGraphEventStream<\n TGraph extends AnyPregelLike,\n TExtra extends ExtraTypeBag = ExtraTypeBag\n>(\n events: AsyncIterable<StreamEvent> | Promise<AsyncIterable<StreamEvent>>\n): AsyncGenerator<InferLangGraphEventStream<TGraph, TExtra>> {\n let rootRunId: string | undefined;\n\n try {\n for await (const event of await events) {\n if (event.event === \"on_chain_start\" && rootRunId == null) {\n rootRunId = event.run_id;\n }\n if (event.tags?.includes(\"langsmith:hidden\")) continue;\n if (event.event === \"on_chain_stream\" && event.run_id === rootRunId) {\n if (!Array.isArray(event.data.chunk)) {\n continue;\n }\n\n type AnyStreamOutput = StreamOutputMap<\n StreamMode[],\n true,\n unknown,\n unknown,\n string,\n unknown\n >;\n\n const [ns, mode, chunk] = (\n event.data.chunk.length === 3\n ? event.data.chunk\n : [null, ...event.data.chunk]\n ) as AnyStreamOutput;\n\n // Listen for debug events and capture checkpoint\n let data: unknown = chunk;\n if (mode === \"debug\") {\n const debugChunk = chunk;\n\n if (debugChunk.type === \"checkpoint\") {\n data = {\n ...debugChunk,\n payload: serializeCheckpoint(debugChunk.payload),\n };\n }\n }\n\n if (mode === \"checkpoints\") {\n data = serializeCheckpoint(chunk);\n }\n\n // This needs to be done for LC.js V0 messages, since they\n // by default serialize using the verbose Serializable protocol.\n data = serialiseAsDict(data);\n\n yield {\n event: ns?.length ? `${mode}|${ns.join(\"|\")}` : mode,\n data,\n } as InferLangGraphEventStream<TGraph, TExtra>;\n }\n }\n } catch (error) {\n yield { event: \"error\", data: serializeError(error) };\n }\n}\n\n/**\n * Converts a `graph.streamEvents()` output into a LangGraph Platform compatible Web Response.\n * @experimental Does not follow semver.\n */\nexport function toLangGraphEventStreamResponse(options: {\n status?: number;\n statusText?: string;\n headers?: Headers | Record<string, string>;\n stream: AsyncIterable<StreamEvent> | Promise<AsyncIterable<StreamEvent>>;\n}) {\n const headers = new Headers({\n \"Content-Type\": \"text/event-stream\",\n \"Cache-Control\": \"no-cache\",\n Connection: \"keep-alive\",\n });\n\n if (options.headers) {\n if (\n \"forEach\" in options.headers &&\n typeof options.headers.forEach === \"function\"\n ) {\n options.headers.forEach((v, k) => headers.set(k, v));\n } else {\n Object.entries(options.headers).map(([k, v]) => headers.set(k, v));\n }\n }\n\n return new Response(\n new ReadableStream({\n async start(controller) {\n try {\n for await (const { event, data } of toLangGraphEventStream(\n options.stream\n )) {\n controller.enqueue(`event: ${event}\\n`);\n controller.enqueue(`data: ${JSON.stringify(data)}\\n\\n`);\n }\n } finally {\n controller.close();\n }\n },\n }),\n { headers, status: options.status, statusText: options.statusText }\n );\n}\n"],"mappings":";;AAkBA,MAAM,mBAAsB,QAAc;AACxC,QAAO,KAAK,MACV,KAAK,UAAU,KAAK,SAAU,KAAsB,OAAgB;EAClE,MAAM,WAAW,KAAK;AACtB,MACE,YAAY,QACZ,OAAO,aAAa,YACpB,YAAY,YACZ,OAAO,SAAS,WAAW,YAC3B;GACA,MAAM,EAAE,MAAM,SAAS,SAAS;AAChC,UAAO;IAAE,GAAG;IAAM;;;AAGpB,SAAO;;;AAKb,MAAM,kBAAkB,UAAmB;AAEzC,KAAI,iBAAiB,MACnB,QAAO;EAAE,OAAO,MAAM;EAAM,SAAS,MAAM;;AAE7C,QAAO;EAAE,OAAO;EAAS,SAAS,KAAK,UAAU;;;AAGnD,MAAM,oBACJ,WACyE;AACzE,KAAI,OAAO,WAAW,YAAY,UAAU,KAAM,QAAO;AACzD,QACE,kBAAkB,UAClB,OAAO,OAAO,iBAAiB,YAC/B,OAAO,gBAAgB;;AAI3B,MAAM,+BACJ,WACG;AACH,KAAI,CAAC,iBAAiB,WAAW,CAAC,OAAO,aAAa,UACpD,QAAO;AAGT,QAAO;EACL,WAAW,OAAO,aAAa;EAC/B,eAAe,OAAO,aAAa,iBAAiB;EACpD,eAAe,OAAO,aAAa,iBAAiB;EACpD,gBAAgB,OAAO,aAAa,kBAAkB;;;AAI1D,MAAM,mBAAmB,WAAoB;AAC3C,KAAI,iBAAiB,SAAS;EAC5B,MAAM,eAAe,OAAO,YAC1B,OAAO,QAAQ,OAAO,cAAc,QACjC,CAAC,SAAS,CAAC,IAAI,WAAW;EAI/B,MAAM,YAAY;GAAE,GAAG;GAAQ;;AAC/B,SAAO,UAAU;AACjB,SAAO;;AAGT,QAAO;;AAGT,SAAS,oBAAoB,SAA2C;CACtE,MAAMA,SAAkC;EACtC,GAAG;EACH,YAAY,4BAA4B,QAAQ;EAChD,mBAAmB,4BAA4B,QAAQ;EAEvD,QAAQ,gBAAgB,QAAQ;EAChC,eAAe,gBAAgB,QAAQ;EAEvC,OAAO,QAAQ,MAAM,KAAK,SAAS;AACjC,OAAI,iBAAiB,KAAK,QAAQ;IAChC,MAAM,aAAa,4BAA4B,KAAK;AACpD,QAAI,cAAc,MAAM;KACtB,MAAMC,YAAqC;MAAE,GAAG;MAAM;;AACtD,YAAO,UAAU;AACjB,YAAO;;;AAIX,UAAO;;;AAIX,QAAO,OAAO;AACd,QAAO;;;;;;;;AAST,gBAAuB,uBAIrB,QAC2D;CAC3D,IAAIC;AAEJ,KAAI;AACF,aAAW,MAAM,SAAS,MAAM,QAAQ;AACtC,OAAI,MAAM,UAAU,oBAAoB,aAAa,KACnD,aAAY,MAAM;AAEpB,OAAI,MAAM,MAAM,SAAS,oBAAqB;AAC9C,OAAI,MAAM,UAAU,qBAAqB,MAAM,WAAW,WAAW;AACnE,QAAI,CAAC,MAAM,QAAQ,MAAM,KAAK,OAC5B;IAYF,MAAM,CAAC,IAAI,MAAM,SACf,MAAM,KAAK,MAAM,WAAW,IACxB,MAAM,KAAK,QACX,CAAC,MAAM,GAAG,MAAM,KAAK;IAI3B,IAAIC,OAAgB;AACpB,QAAI,SAAS,SAAS;KACpB,MAAM,aAAa;AAEnB,SAAI,WAAW,SAAS,aACtB,QAAO;MACL,GAAG;MACH,SAAS,oBAAoB,WAAW;;;AAK9C,QAAI,SAAS,cACX,QAAO,oBAAoB;AAK7B,WAAO,gBAAgB;AAEvB,UAAM;KACJ,OAAO,IAAI,SAAS,GAAG,KAAK,GAAG,GAAG,KAAK,SAAS;KAChD;;;;UAIC,OAAO;AACd,QAAM;GAAE,OAAO;GAAS,MAAM,eAAe;;;;;;;;AAQjD,SAAgB,+BAA+B,SAK5C;CACD,MAAM,UAAU,IAAI,QAAQ;EAC1B,gBAAgB;EAChB,iBAAiB;EACjB,YAAY;;AAGd,KAAI,QAAQ,QACV,KACE,aAAa,QAAQ,WACrB,OAAO,QAAQ,QAAQ,YAAY,WAEnC,SAAQ,QAAQ,SAAS,GAAG,MAAM,QAAQ,IAAI,GAAG;KAEjD,QAAO,QAAQ,QAAQ,SAAS,KAAK,CAAC,GAAG,OAAO,QAAQ,IAAI,GAAG;AAInE,QAAO,IAAI,SACT,IAAI,eAAe,EACjB,MAAM,MAAM,YAAY;AACtB,MAAI;AACF,cAAW,MAAM,EAAE,OAAO,UAAU,uBAClC,QAAQ,SACP;AACD,eAAW,QAAQ,UAAU,MAAM;AACnC,eAAW,QAAQ,SAAS,KAAK,UAAU,MAAM;;YAE3C;AACR,cAAW;;OAIjB;EAAE;EAAS,QAAQ,QAAQ;EAAQ,YAAY,QAAQ"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AnyPregelLike, ExtraTypeBag, InferLangGraphEventStream } from "./types.infer.cjs";
|
|
2
|
+
import { StreamEvent } from "@langchain/core/tracers/log_stream";
|
|
3
|
+
|
|
4
|
+
//#region src/ui/stream.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Converts a `graph.streamEvents()` output into a LangGraph Platform compatible event stream.
|
|
8
|
+
* @experimental Does not follow semver.
|
|
9
|
+
*
|
|
10
|
+
* @param events
|
|
11
|
+
*/
|
|
12
|
+
declare function toLangGraphEventStream<TGraph extends AnyPregelLike, TExtra extends ExtraTypeBag = ExtraTypeBag>(events: AsyncIterable<StreamEvent> | Promise<AsyncIterable<StreamEvent>>): AsyncGenerator<InferLangGraphEventStream<TGraph, TExtra>>;
|
|
13
|
+
/**
|
|
14
|
+
* Converts a `graph.streamEvents()` output into a LangGraph Platform compatible Web Response.
|
|
15
|
+
* @experimental Does not follow semver.
|
|
16
|
+
*/
|
|
17
|
+
declare function toLangGraphEventStreamResponse(options: {
|
|
18
|
+
status?: number;
|
|
19
|
+
statusText?: string;
|
|
20
|
+
headers?: Headers | Record<string, string>;
|
|
21
|
+
stream: AsyncIterable<StreamEvent> | Promise<AsyncIterable<StreamEvent>>;
|
|
22
|
+
}): Response;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { toLangGraphEventStream, toLangGraphEventStreamResponse };
|
|
25
|
+
//# sourceMappingURL=stream.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream.d.cts","names":["StreamEvent","AnyPregelLike","ExtraTypeBag","InferLangGraphEventStream","toLangGraphEventStream","AsyncIterable","Promise","TGraph","TExtra","AsyncGenerator","toLangGraphEventStreamResponse","Headers","Record","Response"],"sources":["../../src/ui/stream.d.ts"],"sourcesContent":["import type { StreamEvent } from \"@langchain/core/tracers/log_stream\";\nimport type { AnyPregelLike, ExtraTypeBag, InferLangGraphEventStream } from \"./types.infer.js\";\n/**\n * Converts a `graph.streamEvents()` output into a LangGraph Platform compatible event stream.\n * @experimental Does not follow semver.\n *\n * @param events\n */\nexport declare function toLangGraphEventStream<TGraph extends AnyPregelLike, TExtra extends ExtraTypeBag = ExtraTypeBag>(events: AsyncIterable<StreamEvent> | Promise<AsyncIterable<StreamEvent>>): AsyncGenerator<InferLangGraphEventStream<TGraph, TExtra>>;\n/**\n * Converts a `graph.streamEvents()` output into a LangGraph Platform compatible Web Response.\n * @experimental Does not follow semver.\n */\nexport declare function toLangGraphEventStreamResponse(options: {\n status?: number;\n statusText?: string;\n headers?: Headers | Record<string, string>;\n stream: AsyncIterable<StreamEvent> | Promise<AsyncIterable<StreamEvent>>;\n}): Response;\n"],"mappings":";;;;;;;AAQA;;;;AAA2GE,iBAAnFE,sBAAmFF,CAAAA,eAA7CD,aAA6CC,EAAAA,eAAfA,YAAeA,GAAAA,YAAAA,CAAAA,CAAAA,MAAAA,EAAsBG,aAAtBH,CAAoCF,WAApCE,CAAAA,GAAmDI,OAAnDJ,CAA2DG,aAA3DH,CAAyEF,WAAzEE,CAAAA,CAAAA,CAAAA,EAAyFO,cAAzFP,CAAwGC,yBAAxGD,CAAkIK,MAAlIL,EAA0IM,MAA1IN,CAAAA,CAAAA;;;;;AAAmDI,iBAKtII,8BAAAA,CALsIJ,OAAAA,EAAAA;QAA+EC,CAAAA,EAAAA,MAAAA;YAAQC,CAAAA,EAAAA,MAAAA;SAAlCL,CAAAA,EAQrMQ,OARqMR,GAQ3LS,MAR2LT,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;QAAfM,EASxLJ,aATwLI,CAS1KT,WAT0KS,CAAAA,GAS3JH,OAT2JG,CASnJJ,aATmJI,CASrIT,WATqIS,CAAAA,CAAAA;IAUhMI"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AnyPregelLike, ExtraTypeBag, InferLangGraphEventStream } from "./types.infer.js";
|
|
2
|
+
import { StreamEvent } from "@langchain/core/tracers/log_stream";
|
|
3
|
+
|
|
4
|
+
//#region src/ui/stream.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Converts a `graph.streamEvents()` output into a LangGraph Platform compatible event stream.
|
|
8
|
+
* @experimental Does not follow semver.
|
|
9
|
+
*
|
|
10
|
+
* @param events
|
|
11
|
+
*/
|
|
12
|
+
declare function toLangGraphEventStream<TGraph extends AnyPregelLike, TExtra extends ExtraTypeBag = ExtraTypeBag>(events: AsyncIterable<StreamEvent> | Promise<AsyncIterable<StreamEvent>>): AsyncGenerator<InferLangGraphEventStream<TGraph, TExtra>>;
|
|
13
|
+
/**
|
|
14
|
+
* Converts a `graph.streamEvents()` output into a LangGraph Platform compatible Web Response.
|
|
15
|
+
* @experimental Does not follow semver.
|
|
16
|
+
*/
|
|
17
|
+
declare function toLangGraphEventStreamResponse(options: {
|
|
18
|
+
status?: number;
|
|
19
|
+
statusText?: string;
|
|
20
|
+
headers?: Headers | Record<string, string>;
|
|
21
|
+
stream: AsyncIterable<StreamEvent> | Promise<AsyncIterable<StreamEvent>>;
|
|
22
|
+
}): Response;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { toLangGraphEventStream, toLangGraphEventStreamResponse };
|
|
25
|
+
//# sourceMappingURL=stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream.d.ts","names":["StreamEvent","AnyPregelLike","ExtraTypeBag","InferLangGraphEventStream","toLangGraphEventStream","AsyncIterable","Promise","TGraph","TExtra","AsyncGenerator","toLangGraphEventStreamResponse","Headers","Record","Response"],"sources":["../../src/ui/stream.d.ts"],"sourcesContent":["import type { StreamEvent } from \"@langchain/core/tracers/log_stream\";\nimport type { AnyPregelLike, ExtraTypeBag, InferLangGraphEventStream } from \"./types.infer.js\";\n/**\n * Converts a `graph.streamEvents()` output into a LangGraph Platform compatible event stream.\n * @experimental Does not follow semver.\n *\n * @param events\n */\nexport declare function toLangGraphEventStream<TGraph extends AnyPregelLike, TExtra extends ExtraTypeBag = ExtraTypeBag>(events: AsyncIterable<StreamEvent> | Promise<AsyncIterable<StreamEvent>>): AsyncGenerator<InferLangGraphEventStream<TGraph, TExtra>>;\n/**\n * Converts a `graph.streamEvents()` output into a LangGraph Platform compatible Web Response.\n * @experimental Does not follow semver.\n */\nexport declare function toLangGraphEventStreamResponse(options: {\n status?: number;\n statusText?: string;\n headers?: Headers | Record<string, string>;\n stream: AsyncIterable<StreamEvent> | Promise<AsyncIterable<StreamEvent>>;\n}): Response;\n"],"mappings":";;;;;;;AAQA;;;;AAA2GE,iBAAnFE,sBAAmFF,CAAAA,eAA7CD,aAA6CC,EAAAA,eAAfA,YAAeA,GAAAA,YAAAA,CAAAA,CAAAA,MAAAA,EAAsBG,aAAtBH,CAAoCF,WAApCE,CAAAA,GAAmDI,OAAnDJ,CAA2DG,aAA3DH,CAAyEF,WAAzEE,CAAAA,CAAAA,CAAAA,EAAyFO,cAAzFP,CAAwGC,yBAAxGD,CAAkIK,MAAlIL,EAA0IM,MAA1IN,CAAAA,CAAAA;;;;;AAAmDI,iBAKtII,8BAAAA,CALsIJ,OAAAA,EAAAA;QAA+EC,CAAAA,EAAAA,MAAAA;YAAQC,CAAAA,EAAAA,MAAAA;SAAlCL,CAAAA,EAQrMQ,OARqMR,GAQ3LS,MAR2LT,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;QAAfM,EASxLJ,aATwLI,CAS1KT,WAT0KS,CAAAA,GAS3JH,OAT2JG,CASnJJ,aATmJI,CASrIT,WATqIS,CAAAA,CAAAA;IAUhMI"}
|