@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
|
@@ -1,127 +1,99 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.getOutputTypeSchema = getOutputTypeSchema;
|
|
7
|
-
exports.getConfigTypeSchema = getConfigTypeSchema;
|
|
8
|
-
const json_schema_1 = require("@langchain/core/utils/json_schema");
|
|
9
|
-
const meta_js_1 = require("./meta.cjs");
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_meta = require('./meta.cjs');
|
|
3
|
+
const __langchain_core_utils_json_schema = require_rolldown_runtime.__toESM(require("@langchain/core/utils/json_schema"));
|
|
4
|
+
|
|
5
|
+
//#region src/graph/zod/schema.ts
|
|
10
6
|
const PartialStateSchema = Symbol.for("langgraph.state.partial");
|
|
11
7
|
function isGraphWithZodLike(graph) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
typeof graph.builder !== "object" ||
|
|
16
|
-
graph.builder == null) {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
return true;
|
|
8
|
+
if (!graph || typeof graph !== "object") return false;
|
|
9
|
+
if (!("builder" in graph) || typeof graph.builder !== "object" || graph.builder == null) return false;
|
|
10
|
+
return true;
|
|
20
11
|
}
|
|
21
12
|
function applyJsonSchemaExtrasFromDescription(schema) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const strMeta = output.description.slice(meta_js_1.META_EXTRAS_DESCRIPTION_PREFIX.length);
|
|
34
|
-
delete output.description;
|
|
35
|
-
Object.assign(output, JSON.parse(strMeta));
|
|
36
|
-
}
|
|
37
|
-
return output;
|
|
38
|
-
}
|
|
39
|
-
return schema;
|
|
13
|
+
if (Array.isArray(schema)) return schema.map(applyJsonSchemaExtrasFromDescription);
|
|
14
|
+
if (typeof schema === "object" && schema != null) {
|
|
15
|
+
const output = Object.fromEntries(Object.entries(schema).map(([key, value]) => [key, applyJsonSchemaExtrasFromDescription(value)]));
|
|
16
|
+
if ("description" in output && typeof output.description === "string" && output.description.startsWith(require_meta.META_EXTRAS_DESCRIPTION_PREFIX)) {
|
|
17
|
+
const strMeta = output.description.slice(require_meta.META_EXTRAS_DESCRIPTION_PREFIX.length);
|
|
18
|
+
delete output.description;
|
|
19
|
+
Object.assign(output, JSON.parse(strMeta));
|
|
20
|
+
}
|
|
21
|
+
return output;
|
|
22
|
+
}
|
|
23
|
+
return schema;
|
|
40
24
|
}
|
|
41
25
|
function toJsonSchema(schema) {
|
|
42
|
-
|
|
26
|
+
return applyJsonSchemaExtrasFromDescription((0, __langchain_core_utils_json_schema.toJsonSchema)(schema));
|
|
43
27
|
}
|
|
44
28
|
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
function getStateTypeSchema(graph, registry =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return undefined;
|
|
55
|
-
return toJsonSchema(registry.getExtendedChannelSchemas(schemaDef, {
|
|
56
|
-
withJsonSchemaExtrasAsDescription: true,
|
|
57
|
-
}));
|
|
29
|
+
* Get the state schema for a graph.
|
|
30
|
+
* @param graph - The graph to get the state schema for.
|
|
31
|
+
* @returns The state schema for the graph.
|
|
32
|
+
*/
|
|
33
|
+
function getStateTypeSchema(graph, registry = require_meta.schemaMetaRegistry) {
|
|
34
|
+
if (!isGraphWithZodLike(graph)) return void 0;
|
|
35
|
+
const schemaDef = graph.builder._schemaRuntimeDefinition;
|
|
36
|
+
if (!schemaDef) return void 0;
|
|
37
|
+
return toJsonSchema(registry.getExtendedChannelSchemas(schemaDef, { withJsonSchemaExtrasAsDescription: true }));
|
|
58
38
|
}
|
|
59
39
|
/**
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
function getUpdateTypeSchema(graph, registry =
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
asPartial: true,
|
|
74
|
-
}));
|
|
40
|
+
* Get the update schema for a graph.
|
|
41
|
+
* @param graph - The graph to get the update schema for.
|
|
42
|
+
* @returns The update schema for the graph.
|
|
43
|
+
*/
|
|
44
|
+
function getUpdateTypeSchema(graph, registry = require_meta.schemaMetaRegistry) {
|
|
45
|
+
if (!isGraphWithZodLike(graph)) return void 0;
|
|
46
|
+
const schemaDef = graph.builder._schemaRuntimeDefinition;
|
|
47
|
+
if (!schemaDef) return void 0;
|
|
48
|
+
return toJsonSchema(registry.getExtendedChannelSchemas(schemaDef, {
|
|
49
|
+
withReducerSchema: true,
|
|
50
|
+
withJsonSchemaExtrasAsDescription: true,
|
|
51
|
+
asPartial: true
|
|
52
|
+
}));
|
|
75
53
|
}
|
|
76
54
|
/**
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
function getInputTypeSchema(graph, registry =
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return toJsonSchema(registry.getExtendedChannelSchemas(schemaDef, {
|
|
92
|
-
withReducerSchema: true,
|
|
93
|
-
withJsonSchemaExtrasAsDescription: true,
|
|
94
|
-
asPartial: true,
|
|
95
|
-
}));
|
|
55
|
+
* Get the input schema for a graph.
|
|
56
|
+
* @param graph - The graph to get the input schema for.
|
|
57
|
+
* @returns The input schema for the graph.
|
|
58
|
+
*/
|
|
59
|
+
function getInputTypeSchema(graph, registry = require_meta.schemaMetaRegistry) {
|
|
60
|
+
if (!isGraphWithZodLike(graph)) return void 0;
|
|
61
|
+
let schemaDef = graph.builder._inputRuntimeDefinition;
|
|
62
|
+
if (schemaDef === PartialStateSchema) schemaDef = graph.builder._schemaRuntimeDefinition;
|
|
63
|
+
if (!schemaDef) return void 0;
|
|
64
|
+
return toJsonSchema(registry.getExtendedChannelSchemas(schemaDef, {
|
|
65
|
+
withReducerSchema: true,
|
|
66
|
+
withJsonSchemaExtrasAsDescription: true,
|
|
67
|
+
asPartial: true
|
|
68
|
+
}));
|
|
96
69
|
}
|
|
97
70
|
/**
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
function getOutputTypeSchema(graph, registry =
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
return undefined;
|
|
108
|
-
return toJsonSchema(registry.getExtendedChannelSchemas(schemaDef, {
|
|
109
|
-
withJsonSchemaExtrasAsDescription: true,
|
|
110
|
-
}));
|
|
71
|
+
* Get the output schema for a graph.
|
|
72
|
+
* @param graph - The graph to get the output schema for.
|
|
73
|
+
* @returns The output schema for the graph.
|
|
74
|
+
*/
|
|
75
|
+
function getOutputTypeSchema(graph, registry = require_meta.schemaMetaRegistry) {
|
|
76
|
+
if (!isGraphWithZodLike(graph)) return void 0;
|
|
77
|
+
const schemaDef = graph.builder._outputRuntimeDefinition;
|
|
78
|
+
if (!schemaDef) return void 0;
|
|
79
|
+
return toJsonSchema(registry.getExtendedChannelSchemas(schemaDef, { withJsonSchemaExtrasAsDescription: true }));
|
|
111
80
|
}
|
|
112
81
|
/**
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
function getConfigTypeSchema(graph, registry =
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
return undefined;
|
|
123
|
-
return toJsonSchema(registry.getExtendedChannelSchemas(configDef, {
|
|
124
|
-
withJsonSchemaExtrasAsDescription: true,
|
|
125
|
-
}));
|
|
82
|
+
* Get the config schema for a graph.
|
|
83
|
+
* @param graph - The graph to get the config schema for.
|
|
84
|
+
* @returns The config schema for the graph.
|
|
85
|
+
*/
|
|
86
|
+
function getConfigTypeSchema(graph, registry = require_meta.schemaMetaRegistry) {
|
|
87
|
+
if (!isGraphWithZodLike(graph)) return void 0;
|
|
88
|
+
const configDef = graph.builder._configRuntimeSchema;
|
|
89
|
+
if (!configDef) return void 0;
|
|
90
|
+
return toJsonSchema(registry.getExtendedChannelSchemas(configDef, { withJsonSchemaExtrasAsDescription: true }));
|
|
126
91
|
}
|
|
127
|
-
|
|
92
|
+
|
|
93
|
+
//#endregion
|
|
94
|
+
exports.getConfigTypeSchema = getConfigTypeSchema;
|
|
95
|
+
exports.getInputTypeSchema = getInputTypeSchema;
|
|
96
|
+
exports.getOutputTypeSchema = getOutputTypeSchema;
|
|
97
|
+
exports.getStateTypeSchema = getStateTypeSchema;
|
|
98
|
+
exports.getUpdateTypeSchema = getUpdateTypeSchema;
|
|
99
|
+
//# sourceMappingURL=schema.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.cjs","names":["META_EXTRAS_DESCRIPTION_PREFIX","schemaMetaRegistry"],"sources":["../../../src/graph/zod/schema.ts"],"sourcesContent":["import {\n type JSONSchema,\n toJsonSchema as interopToJsonSchema,\n} from \"@langchain/core/utils/json_schema\";\nimport { InteropZodObject } from \"@langchain/core/utils/types\";\nimport {\n META_EXTRAS_DESCRIPTION_PREFIX,\n SchemaMetaRegistry,\n schemaMetaRegistry,\n} from \"./meta.js\";\n\nconst PartialStateSchema = Symbol.for(\"langgraph.state.partial\");\ntype PartialStateSchema = typeof PartialStateSchema;\n\ninterface GraphWithZodLike {\n builder: {\n _schemaRuntimeDefinition: InteropZodObject | undefined;\n _inputRuntimeDefinition: InteropZodObject | PartialStateSchema | undefined;\n _outputRuntimeDefinition: InteropZodObject | undefined;\n _configRuntimeSchema: InteropZodObject | undefined;\n };\n}\n\nfunction isGraphWithZodLike(graph: unknown): graph is GraphWithZodLike {\n if (!graph || typeof graph !== \"object\") return false;\n if (\n !(\"builder\" in graph) ||\n typeof graph.builder !== \"object\" ||\n graph.builder == null\n ) {\n return false;\n }\n return true;\n}\n\nfunction applyJsonSchemaExtrasFromDescription<T>(schema: T): unknown {\n if (Array.isArray(schema)) {\n return schema.map(applyJsonSchemaExtrasFromDescription);\n }\n if (typeof schema === \"object\" && schema != null) {\n const output = Object.fromEntries(\n Object.entries(schema).map(([key, value]) => [\n key,\n applyJsonSchemaExtrasFromDescription(value),\n ])\n );\n\n if (\n \"description\" in output &&\n typeof output.description === \"string\" &&\n output.description.startsWith(META_EXTRAS_DESCRIPTION_PREFIX)\n ) {\n const strMeta = output.description.slice(\n META_EXTRAS_DESCRIPTION_PREFIX.length\n );\n delete output.description;\n Object.assign(output, JSON.parse(strMeta));\n }\n\n return output as T;\n }\n return schema;\n}\n\nfunction toJsonSchema(schema: InteropZodObject): JSONSchema {\n return applyJsonSchemaExtrasFromDescription(\n interopToJsonSchema(schema)\n ) as JSONSchema;\n}\n\n/**\n * Get the state schema for a graph.\n * @param graph - The graph to get the state schema for.\n * @returns The state schema for the graph.\n */\nexport function getStateTypeSchema(\n graph: unknown,\n registry: SchemaMetaRegistry = schemaMetaRegistry\n): JSONSchema | undefined {\n if (!isGraphWithZodLike(graph)) return undefined;\n const schemaDef = graph.builder._schemaRuntimeDefinition;\n if (!schemaDef) return undefined;\n\n return toJsonSchema(\n registry.getExtendedChannelSchemas(schemaDef, {\n withJsonSchemaExtrasAsDescription: true,\n })\n );\n}\n\n/**\n * Get the update schema for a graph.\n * @param graph - The graph to get the update schema for.\n * @returns The update schema for the graph.\n */\nexport function getUpdateTypeSchema(\n graph: unknown,\n registry: SchemaMetaRegistry = schemaMetaRegistry\n): JSONSchema | undefined {\n if (!isGraphWithZodLike(graph)) return undefined;\n const schemaDef = graph.builder._schemaRuntimeDefinition;\n if (!schemaDef) return undefined;\n\n return toJsonSchema(\n registry.getExtendedChannelSchemas(schemaDef, {\n withReducerSchema: true,\n withJsonSchemaExtrasAsDescription: true,\n asPartial: true,\n })\n );\n}\n\n/**\n * Get the input schema for a graph.\n * @param graph - The graph to get the input schema for.\n * @returns The input schema for the graph.\n */\nexport function getInputTypeSchema(\n graph: unknown,\n registry: SchemaMetaRegistry = schemaMetaRegistry\n): JSONSchema | undefined {\n if (!isGraphWithZodLike(graph)) return undefined;\n let schemaDef = graph.builder._inputRuntimeDefinition;\n if (schemaDef === PartialStateSchema) {\n // No need to pass `.partial()` here, that's being done by `applyPlugin`\n schemaDef = graph.builder._schemaRuntimeDefinition;\n }\n if (!schemaDef) return undefined;\n\n return toJsonSchema(\n registry.getExtendedChannelSchemas(schemaDef, {\n withReducerSchema: true,\n withJsonSchemaExtrasAsDescription: true,\n asPartial: true,\n })\n );\n}\n\n/**\n * Get the output schema for a graph.\n * @param graph - The graph to get the output schema for.\n * @returns The output schema for the graph.\n */\nexport function getOutputTypeSchema(\n graph: unknown,\n registry: SchemaMetaRegistry = schemaMetaRegistry\n): JSONSchema | undefined {\n if (!isGraphWithZodLike(graph)) return undefined;\n const schemaDef = graph.builder._outputRuntimeDefinition;\n if (!schemaDef) return undefined;\n\n return toJsonSchema(\n registry.getExtendedChannelSchemas(schemaDef, {\n withJsonSchemaExtrasAsDescription: true,\n })\n );\n}\n\n/**\n * Get the config schema for a graph.\n * @param graph - The graph to get the config schema for.\n * @returns The config schema for the graph.\n */\nexport function getConfigTypeSchema(\n graph: unknown,\n registry: SchemaMetaRegistry = schemaMetaRegistry\n): JSONSchema | undefined {\n if (!isGraphWithZodLike(graph)) return undefined;\n const configDef = graph.builder._configRuntimeSchema;\n if (!configDef) return undefined;\n\n return toJsonSchema(\n registry.getExtendedChannelSchemas(configDef, {\n withJsonSchemaExtrasAsDescription: true,\n })\n );\n}\n"],"mappings":";;;;;AAWA,MAAM,qBAAqB,OAAO,IAAI;AAYtC,SAAS,mBAAmB,OAA2C;AACrE,KAAI,CAAC,SAAS,OAAO,UAAU,SAAU,QAAO;AAChD,KACE,EAAE,aAAa,UACf,OAAO,MAAM,YAAY,YACzB,MAAM,WAAW,KAEjB,QAAO;AAET,QAAO;;AAGT,SAAS,qCAAwC,QAAoB;AACnE,KAAI,MAAM,QAAQ,QAChB,QAAO,OAAO,IAAI;AAEpB,KAAI,OAAO,WAAW,YAAY,UAAU,MAAM;EAChD,MAAM,SAAS,OAAO,YACpB,OAAO,QAAQ,QAAQ,KAAK,CAAC,KAAK,WAAW,CAC3C,KACA,qCAAqC;AAIzC,MACE,iBAAiB,UACjB,OAAO,OAAO,gBAAgB,YAC9B,OAAO,YAAY,WAAWA,8CAC9B;GACA,MAAM,UAAU,OAAO,YAAY,MACjCA,4CAA+B;AAEjC,UAAO,OAAO;AACd,UAAO,OAAO,QAAQ,KAAK,MAAM;;AAGnC,SAAO;;AAET,QAAO;;AAGT,SAAS,aAAa,QAAsC;AAC1D,QAAO,0FACe;;;;;;;AASxB,SAAgB,mBACd,OACA,WAA+BC,iCACP;AACxB,KAAI,CAAC,mBAAmB,OAAQ,QAAO;CACvC,MAAM,YAAY,MAAM,QAAQ;AAChC,KAAI,CAAC,UAAW,QAAO;AAEvB,QAAO,aACL,SAAS,0BAA0B,WAAW,EAC5C,mCAAmC;;;;;;;AAUzC,SAAgB,oBACd,OACA,WAA+BA,iCACP;AACxB,KAAI,CAAC,mBAAmB,OAAQ,QAAO;CACvC,MAAM,YAAY,MAAM,QAAQ;AAChC,KAAI,CAAC,UAAW,QAAO;AAEvB,QAAO,aACL,SAAS,0BAA0B,WAAW;EAC5C,mBAAmB;EACnB,mCAAmC;EACnC,WAAW;;;;;;;;AAUjB,SAAgB,mBACd,OACA,WAA+BA,iCACP;AACxB,KAAI,CAAC,mBAAmB,OAAQ,QAAO;CACvC,IAAI,YAAY,MAAM,QAAQ;AAC9B,KAAI,cAAc,mBAEhB,aAAY,MAAM,QAAQ;AAE5B,KAAI,CAAC,UAAW,QAAO;AAEvB,QAAO,aACL,SAAS,0BAA0B,WAAW;EAC5C,mBAAmB;EACnB,mCAAmC;EACnC,WAAW;;;;;;;;AAUjB,SAAgB,oBACd,OACA,WAA+BA,iCACP;AACxB,KAAI,CAAC,mBAAmB,OAAQ,QAAO;CACvC,MAAM,YAAY,MAAM,QAAQ;AAChC,KAAI,CAAC,UAAW,QAAO;AAEvB,QAAO,aACL,SAAS,0BAA0B,WAAW,EAC5C,mCAAmC;;;;;;;AAUzC,SAAgB,oBACd,OACA,WAA+BA,iCACP;AACxB,KAAI,CAAC,mBAAmB,OAAQ,QAAO;CACvC,MAAM,YAAY,MAAM,QAAQ;AAChC,KAAI,CAAC,UAAW,QAAO;AAEvB,QAAO,aACL,SAAS,0BAA0B,WAAW,EAC5C,mCAAmC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { SchemaMetaRegistry } from "./meta.cjs";
|
|
2
|
+
import { JSONSchema } from "@langchain/core/utils/json_schema";
|
|
3
|
+
|
|
4
|
+
//#region src/graph/zod/schema.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Get the state schema for a graph.
|
|
8
|
+
* @param graph - The graph to get the state schema for.
|
|
9
|
+
* @returns The state schema for the graph.
|
|
10
|
+
*/
|
|
11
|
+
declare function getStateTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Get the update schema for a graph.
|
|
14
|
+
* @param graph - The graph to get the update schema for.
|
|
15
|
+
* @returns The update schema for the graph.
|
|
16
|
+
*/
|
|
17
|
+
declare function getUpdateTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Get the input schema for a graph.
|
|
20
|
+
* @param graph - The graph to get the input schema for.
|
|
21
|
+
* @returns The input schema for the graph.
|
|
22
|
+
*/
|
|
23
|
+
declare function getInputTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Get the output schema for a graph.
|
|
26
|
+
* @param graph - The graph to get the output schema for.
|
|
27
|
+
* @returns The output schema for the graph.
|
|
28
|
+
*/
|
|
29
|
+
declare function getOutputTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Get the config schema for a graph.
|
|
32
|
+
* @param graph - The graph to get the config schema for.
|
|
33
|
+
* @returns The config schema for the graph.
|
|
34
|
+
*/
|
|
35
|
+
declare function getConfigTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;
|
|
36
|
+
//#endregion
|
|
37
|
+
export { getConfigTypeSchema, getInputTypeSchema, getOutputTypeSchema, getStateTypeSchema, getUpdateTypeSchema };
|
|
38
|
+
//# sourceMappingURL=schema.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.cts","names":["JSONSchema","SchemaMetaRegistry","getStateTypeSchema","getUpdateTypeSchema","getInputTypeSchema","getOutputTypeSchema","getConfigTypeSchema"],"sources":["../../../src/graph/zod/schema.d.ts"],"sourcesContent":["import { type JSONSchema } from \"@langchain/core/utils/json_schema\";\nimport { SchemaMetaRegistry } from \"./meta.js\";\n/**\n * Get the state schema for a graph.\n * @param graph - The graph to get the state schema for.\n * @returns The state schema for the graph.\n */\nexport declare function getStateTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;\n/**\n * Get the update schema for a graph.\n * @param graph - The graph to get the update schema for.\n * @returns The update schema for the graph.\n */\nexport declare function getUpdateTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;\n/**\n * Get the input schema for a graph.\n * @param graph - The graph to get the input schema for.\n * @returns The input schema for the graph.\n */\nexport declare function getInputTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;\n/**\n * Get the output schema for a graph.\n * @param graph - The graph to get the output schema for.\n * @returns The output schema for the graph.\n */\nexport declare function getOutputTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;\n/**\n * Get the config schema for a graph.\n * @param graph - The graph to get the config schema for.\n * @returns The config schema for the graph.\n */\nexport declare function getConfigTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;\n"],"mappings":";;;;;;;AAOA;;;AAA2FA,iBAAnEE,kBAAAA,CAAmEF,KAAAA,EAAAA,OAAAA,EAAAA,QAAAA,CAAAA,EAArBC,kBAAqBD,CAAAA,EAAAA,UAAAA,GAAAA,SAAAA;;AAM3F;;;;iBAAwBG,mBAAAA,4BAA+CF,qBAAqBD;AAM5F;;;;;AAMwBK,iBANAD,kBAAAA,CAMmB,KAAA,EAAA,OAAA,EAAA,QAAA,CAAA,EAN2BH,kBAM3B,CAAA,EANgDD,UAMhD,GAAA,SAAA;;;;;AAM3C;AAA2C,iBANnBK,mBAAAA,CAMmB,KAAA,EAAA,OAAA,EAAA,QAAA,CAAA,EAN4BJ,kBAM5B,CAAA,EANiDD,UAMjD,GAAA,SAAA;;;;;;iBAAnBM,mBAAAA,4BAA+CL,qBAAqBD"}
|
|
@@ -1,32 +1,38 @@
|
|
|
1
|
-
import { type JSONSchema } from "@langchain/core/utils/json_schema";
|
|
2
1
|
import { SchemaMetaRegistry } from "./meta.js";
|
|
2
|
+
import { JSONSchema } from "@langchain/core/utils/json_schema";
|
|
3
|
+
|
|
4
|
+
//#region src/graph/zod/schema.d.ts
|
|
5
|
+
|
|
3
6
|
/**
|
|
4
7
|
* Get the state schema for a graph.
|
|
5
8
|
* @param graph - The graph to get the state schema for.
|
|
6
9
|
* @returns The state schema for the graph.
|
|
7
10
|
*/
|
|
8
|
-
|
|
11
|
+
declare function getStateTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;
|
|
9
12
|
/**
|
|
10
13
|
* Get the update schema for a graph.
|
|
11
14
|
* @param graph - The graph to get the update schema for.
|
|
12
15
|
* @returns The update schema for the graph.
|
|
13
16
|
*/
|
|
14
|
-
|
|
17
|
+
declare function getUpdateTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;
|
|
15
18
|
/**
|
|
16
19
|
* Get the input schema for a graph.
|
|
17
20
|
* @param graph - The graph to get the input schema for.
|
|
18
21
|
* @returns The input schema for the graph.
|
|
19
22
|
*/
|
|
20
|
-
|
|
23
|
+
declare function getInputTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;
|
|
21
24
|
/**
|
|
22
25
|
* Get the output schema for a graph.
|
|
23
26
|
* @param graph - The graph to get the output schema for.
|
|
24
27
|
* @returns The output schema for the graph.
|
|
25
28
|
*/
|
|
26
|
-
|
|
29
|
+
declare function getOutputTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;
|
|
27
30
|
/**
|
|
28
31
|
* Get the config schema for a graph.
|
|
29
32
|
* @param graph - The graph to get the config schema for.
|
|
30
33
|
* @returns The config schema for the graph.
|
|
31
34
|
*/
|
|
32
|
-
|
|
35
|
+
declare function getConfigTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;
|
|
36
|
+
//#endregion
|
|
37
|
+
export { getConfigTypeSchema, getInputTypeSchema, getOutputTypeSchema, getStateTypeSchema, getUpdateTypeSchema };
|
|
38
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","names":["JSONSchema","SchemaMetaRegistry","getStateTypeSchema","getUpdateTypeSchema","getInputTypeSchema","getOutputTypeSchema","getConfigTypeSchema"],"sources":["../../../src/graph/zod/schema.d.ts"],"sourcesContent":["import { type JSONSchema } from \"@langchain/core/utils/json_schema\";\nimport { SchemaMetaRegistry } from \"./meta.js\";\n/**\n * Get the state schema for a graph.\n * @param graph - The graph to get the state schema for.\n * @returns The state schema for the graph.\n */\nexport declare function getStateTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;\n/**\n * Get the update schema for a graph.\n * @param graph - The graph to get the update schema for.\n * @returns The update schema for the graph.\n */\nexport declare function getUpdateTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;\n/**\n * Get the input schema for a graph.\n * @param graph - The graph to get the input schema for.\n * @returns The input schema for the graph.\n */\nexport declare function getInputTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;\n/**\n * Get the output schema for a graph.\n * @param graph - The graph to get the output schema for.\n * @returns The output schema for the graph.\n */\nexport declare function getOutputTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;\n/**\n * Get the config schema for a graph.\n * @param graph - The graph to get the config schema for.\n * @returns The config schema for the graph.\n */\nexport declare function getConfigTypeSchema(graph: unknown, registry?: SchemaMetaRegistry): JSONSchema | undefined;\n"],"mappings":";;;;;;;AAOA;;;AAA2FA,iBAAnEE,kBAAAA,CAAmEF,KAAAA,EAAAA,OAAAA,EAAAA,QAAAA,CAAAA,EAArBC,kBAAqBD,CAAAA,EAAAA,UAAAA,GAAAA,SAAAA;;AAM3F;;;;iBAAwBG,mBAAAA,4BAA+CF,qBAAqBD;AAM5F;;;;;AAMwBK,iBANAD,kBAAAA,CAMmB,KAAA,EAAA,OAAA,EAAA,QAAA,CAAA,EAN2BH,kBAM3B,CAAA,EANgDD,UAMhD,GAAA,SAAA;;;;;AAM3C;AAA2C,iBANnBK,mBAAAA,CAMmB,KAAA,EAAA,OAAA,EAAA,QAAA,CAAA,EAN4BJ,kBAM5B,CAAA,EANiDD,UAMjD,GAAA,SAAA;;;;;;iBAAnBM,mBAAAA,4BAA+CL,qBAAqBD"}
|
package/dist/graph/zod/schema.js
CHANGED
|
@@ -1,120 +1,94 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { META_EXTRAS_DESCRIPTION_PREFIX, schemaMetaRegistry } from "./meta.js";
|
|
2
|
+
import { toJsonSchema } from "@langchain/core/utils/json_schema";
|
|
3
|
+
|
|
4
|
+
//#region src/graph/zod/schema.ts
|
|
3
5
|
const PartialStateSchema = Symbol.for("langgraph.state.partial");
|
|
4
6
|
function isGraphWithZodLike(graph) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
typeof graph.builder !== "object" ||
|
|
9
|
-
graph.builder == null) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
return true;
|
|
7
|
+
if (!graph || typeof graph !== "object") return false;
|
|
8
|
+
if (!("builder" in graph) || typeof graph.builder !== "object" || graph.builder == null) return false;
|
|
9
|
+
return true;
|
|
13
10
|
}
|
|
14
11
|
function applyJsonSchemaExtrasFromDescription(schema) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const strMeta = output.description.slice(META_EXTRAS_DESCRIPTION_PREFIX.length);
|
|
27
|
-
delete output.description;
|
|
28
|
-
Object.assign(output, JSON.parse(strMeta));
|
|
29
|
-
}
|
|
30
|
-
return output;
|
|
31
|
-
}
|
|
32
|
-
return schema;
|
|
12
|
+
if (Array.isArray(schema)) return schema.map(applyJsonSchemaExtrasFromDescription);
|
|
13
|
+
if (typeof schema === "object" && schema != null) {
|
|
14
|
+
const output = Object.fromEntries(Object.entries(schema).map(([key, value]) => [key, applyJsonSchemaExtrasFromDescription(value)]));
|
|
15
|
+
if ("description" in output && typeof output.description === "string" && output.description.startsWith(META_EXTRAS_DESCRIPTION_PREFIX)) {
|
|
16
|
+
const strMeta = output.description.slice(META_EXTRAS_DESCRIPTION_PREFIX.length);
|
|
17
|
+
delete output.description;
|
|
18
|
+
Object.assign(output, JSON.parse(strMeta));
|
|
19
|
+
}
|
|
20
|
+
return output;
|
|
21
|
+
}
|
|
22
|
+
return schema;
|
|
33
23
|
}
|
|
34
|
-
function toJsonSchema(schema) {
|
|
35
|
-
|
|
24
|
+
function toJsonSchema$1(schema) {
|
|
25
|
+
return applyJsonSchemaExtrasFromDescription(toJsonSchema(schema));
|
|
36
26
|
}
|
|
37
27
|
/**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return undefined;
|
|
48
|
-
return toJsonSchema(registry.getExtendedChannelSchemas(schemaDef, {
|
|
49
|
-
withJsonSchemaExtrasAsDescription: true,
|
|
50
|
-
}));
|
|
28
|
+
* Get the state schema for a graph.
|
|
29
|
+
* @param graph - The graph to get the state schema for.
|
|
30
|
+
* @returns The state schema for the graph.
|
|
31
|
+
*/
|
|
32
|
+
function getStateTypeSchema(graph, registry = schemaMetaRegistry) {
|
|
33
|
+
if (!isGraphWithZodLike(graph)) return void 0;
|
|
34
|
+
const schemaDef = graph.builder._schemaRuntimeDefinition;
|
|
35
|
+
if (!schemaDef) return void 0;
|
|
36
|
+
return toJsonSchema$1(registry.getExtendedChannelSchemas(schemaDef, { withJsonSchemaExtrasAsDescription: true }));
|
|
51
37
|
}
|
|
52
38
|
/**
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
asPartial: true,
|
|
67
|
-
}));
|
|
39
|
+
* Get the update schema for a graph.
|
|
40
|
+
* @param graph - The graph to get the update schema for.
|
|
41
|
+
* @returns The update schema for the graph.
|
|
42
|
+
*/
|
|
43
|
+
function getUpdateTypeSchema(graph, registry = schemaMetaRegistry) {
|
|
44
|
+
if (!isGraphWithZodLike(graph)) return void 0;
|
|
45
|
+
const schemaDef = graph.builder._schemaRuntimeDefinition;
|
|
46
|
+
if (!schemaDef) return void 0;
|
|
47
|
+
return toJsonSchema$1(registry.getExtendedChannelSchemas(schemaDef, {
|
|
48
|
+
withReducerSchema: true,
|
|
49
|
+
withJsonSchemaExtrasAsDescription: true,
|
|
50
|
+
asPartial: true
|
|
51
|
+
}));
|
|
68
52
|
}
|
|
69
53
|
/**
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return toJsonSchema(registry.getExtendedChannelSchemas(schemaDef, {
|
|
85
|
-
withReducerSchema: true,
|
|
86
|
-
withJsonSchemaExtrasAsDescription: true,
|
|
87
|
-
asPartial: true,
|
|
88
|
-
}));
|
|
54
|
+
* Get the input schema for a graph.
|
|
55
|
+
* @param graph - The graph to get the input schema for.
|
|
56
|
+
* @returns The input schema for the graph.
|
|
57
|
+
*/
|
|
58
|
+
function getInputTypeSchema(graph, registry = schemaMetaRegistry) {
|
|
59
|
+
if (!isGraphWithZodLike(graph)) return void 0;
|
|
60
|
+
let schemaDef = graph.builder._inputRuntimeDefinition;
|
|
61
|
+
if (schemaDef === PartialStateSchema) schemaDef = graph.builder._schemaRuntimeDefinition;
|
|
62
|
+
if (!schemaDef) return void 0;
|
|
63
|
+
return toJsonSchema$1(registry.getExtendedChannelSchemas(schemaDef, {
|
|
64
|
+
withReducerSchema: true,
|
|
65
|
+
withJsonSchemaExtrasAsDescription: true,
|
|
66
|
+
asPartial: true
|
|
67
|
+
}));
|
|
89
68
|
}
|
|
90
69
|
/**
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return undefined;
|
|
101
|
-
return toJsonSchema(registry.getExtendedChannelSchemas(schemaDef, {
|
|
102
|
-
withJsonSchemaExtrasAsDescription: true,
|
|
103
|
-
}));
|
|
70
|
+
* Get the output schema for a graph.
|
|
71
|
+
* @param graph - The graph to get the output schema for.
|
|
72
|
+
* @returns The output schema for the graph.
|
|
73
|
+
*/
|
|
74
|
+
function getOutputTypeSchema(graph, registry = schemaMetaRegistry) {
|
|
75
|
+
if (!isGraphWithZodLike(graph)) return void 0;
|
|
76
|
+
const schemaDef = graph.builder._outputRuntimeDefinition;
|
|
77
|
+
if (!schemaDef) return void 0;
|
|
78
|
+
return toJsonSchema$1(registry.getExtendedChannelSchemas(schemaDef, { withJsonSchemaExtrasAsDescription: true }));
|
|
104
79
|
}
|
|
105
80
|
/**
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
return undefined;
|
|
116
|
-
return toJsonSchema(registry.getExtendedChannelSchemas(configDef, {
|
|
117
|
-
withJsonSchemaExtrasAsDescription: true,
|
|
118
|
-
}));
|
|
81
|
+
* Get the config schema for a graph.
|
|
82
|
+
* @param graph - The graph to get the config schema for.
|
|
83
|
+
* @returns The config schema for the graph.
|
|
84
|
+
*/
|
|
85
|
+
function getConfigTypeSchema(graph, registry = schemaMetaRegistry) {
|
|
86
|
+
if (!isGraphWithZodLike(graph)) return void 0;
|
|
87
|
+
const configDef = graph.builder._configRuntimeSchema;
|
|
88
|
+
if (!configDef) return void 0;
|
|
89
|
+
return toJsonSchema$1(registry.getExtendedChannelSchemas(configDef, { withJsonSchemaExtrasAsDescription: true }));
|
|
119
90
|
}
|
|
91
|
+
|
|
92
|
+
//#endregion
|
|
93
|
+
export { getConfigTypeSchema, getInputTypeSchema, getOutputTypeSchema, getStateTypeSchema, getUpdateTypeSchema };
|
|
120
94
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","
|
|
1
|
+
{"version":3,"file":"schema.js","names":["toJsonSchema","interopToJsonSchema"],"sources":["../../../src/graph/zod/schema.ts"],"sourcesContent":["import {\n type JSONSchema,\n toJsonSchema as interopToJsonSchema,\n} from \"@langchain/core/utils/json_schema\";\nimport { InteropZodObject } from \"@langchain/core/utils/types\";\nimport {\n META_EXTRAS_DESCRIPTION_PREFIX,\n SchemaMetaRegistry,\n schemaMetaRegistry,\n} from \"./meta.js\";\n\nconst PartialStateSchema = Symbol.for(\"langgraph.state.partial\");\ntype PartialStateSchema = typeof PartialStateSchema;\n\ninterface GraphWithZodLike {\n builder: {\n _schemaRuntimeDefinition: InteropZodObject | undefined;\n _inputRuntimeDefinition: InteropZodObject | PartialStateSchema | undefined;\n _outputRuntimeDefinition: InteropZodObject | undefined;\n _configRuntimeSchema: InteropZodObject | undefined;\n };\n}\n\nfunction isGraphWithZodLike(graph: unknown): graph is GraphWithZodLike {\n if (!graph || typeof graph !== \"object\") return false;\n if (\n !(\"builder\" in graph) ||\n typeof graph.builder !== \"object\" ||\n graph.builder == null\n ) {\n return false;\n }\n return true;\n}\n\nfunction applyJsonSchemaExtrasFromDescription<T>(schema: T): unknown {\n if (Array.isArray(schema)) {\n return schema.map(applyJsonSchemaExtrasFromDescription);\n }\n if (typeof schema === \"object\" && schema != null) {\n const output = Object.fromEntries(\n Object.entries(schema).map(([key, value]) => [\n key,\n applyJsonSchemaExtrasFromDescription(value),\n ])\n );\n\n if (\n \"description\" in output &&\n typeof output.description === \"string\" &&\n output.description.startsWith(META_EXTRAS_DESCRIPTION_PREFIX)\n ) {\n const strMeta = output.description.slice(\n META_EXTRAS_DESCRIPTION_PREFIX.length\n );\n delete output.description;\n Object.assign(output, JSON.parse(strMeta));\n }\n\n return output as T;\n }\n return schema;\n}\n\nfunction toJsonSchema(schema: InteropZodObject): JSONSchema {\n return applyJsonSchemaExtrasFromDescription(\n interopToJsonSchema(schema)\n ) as JSONSchema;\n}\n\n/**\n * Get the state schema for a graph.\n * @param graph - The graph to get the state schema for.\n * @returns The state schema for the graph.\n */\nexport function getStateTypeSchema(\n graph: unknown,\n registry: SchemaMetaRegistry = schemaMetaRegistry\n): JSONSchema | undefined {\n if (!isGraphWithZodLike(graph)) return undefined;\n const schemaDef = graph.builder._schemaRuntimeDefinition;\n if (!schemaDef) return undefined;\n\n return toJsonSchema(\n registry.getExtendedChannelSchemas(schemaDef, {\n withJsonSchemaExtrasAsDescription: true,\n })\n );\n}\n\n/**\n * Get the update schema for a graph.\n * @param graph - The graph to get the update schema for.\n * @returns The update schema for the graph.\n */\nexport function getUpdateTypeSchema(\n graph: unknown,\n registry: SchemaMetaRegistry = schemaMetaRegistry\n): JSONSchema | undefined {\n if (!isGraphWithZodLike(graph)) return undefined;\n const schemaDef = graph.builder._schemaRuntimeDefinition;\n if (!schemaDef) return undefined;\n\n return toJsonSchema(\n registry.getExtendedChannelSchemas(schemaDef, {\n withReducerSchema: true,\n withJsonSchemaExtrasAsDescription: true,\n asPartial: true,\n })\n );\n}\n\n/**\n * Get the input schema for a graph.\n * @param graph - The graph to get the input schema for.\n * @returns The input schema for the graph.\n */\nexport function getInputTypeSchema(\n graph: unknown,\n registry: SchemaMetaRegistry = schemaMetaRegistry\n): JSONSchema | undefined {\n if (!isGraphWithZodLike(graph)) return undefined;\n let schemaDef = graph.builder._inputRuntimeDefinition;\n if (schemaDef === PartialStateSchema) {\n // No need to pass `.partial()` here, that's being done by `applyPlugin`\n schemaDef = graph.builder._schemaRuntimeDefinition;\n }\n if (!schemaDef) return undefined;\n\n return toJsonSchema(\n registry.getExtendedChannelSchemas(schemaDef, {\n withReducerSchema: true,\n withJsonSchemaExtrasAsDescription: true,\n asPartial: true,\n })\n );\n}\n\n/**\n * Get the output schema for a graph.\n * @param graph - The graph to get the output schema for.\n * @returns The output schema for the graph.\n */\nexport function getOutputTypeSchema(\n graph: unknown,\n registry: SchemaMetaRegistry = schemaMetaRegistry\n): JSONSchema | undefined {\n if (!isGraphWithZodLike(graph)) return undefined;\n const schemaDef = graph.builder._outputRuntimeDefinition;\n if (!schemaDef) return undefined;\n\n return toJsonSchema(\n registry.getExtendedChannelSchemas(schemaDef, {\n withJsonSchemaExtrasAsDescription: true,\n })\n );\n}\n\n/**\n * Get the config schema for a graph.\n * @param graph - The graph to get the config schema for.\n * @returns The config schema for the graph.\n */\nexport function getConfigTypeSchema(\n graph: unknown,\n registry: SchemaMetaRegistry = schemaMetaRegistry\n): JSONSchema | undefined {\n if (!isGraphWithZodLike(graph)) return undefined;\n const configDef = graph.builder._configRuntimeSchema;\n if (!configDef) return undefined;\n\n return toJsonSchema(\n registry.getExtendedChannelSchemas(configDef, {\n withJsonSchemaExtrasAsDescription: true,\n })\n );\n}\n"],"mappings":";;;;AAWA,MAAM,qBAAqB,OAAO,IAAI;AAYtC,SAAS,mBAAmB,OAA2C;AACrE,KAAI,CAAC,SAAS,OAAO,UAAU,SAAU,QAAO;AAChD,KACE,EAAE,aAAa,UACf,OAAO,MAAM,YAAY,YACzB,MAAM,WAAW,KAEjB,QAAO;AAET,QAAO;;AAGT,SAAS,qCAAwC,QAAoB;AACnE,KAAI,MAAM,QAAQ,QAChB,QAAO,OAAO,IAAI;AAEpB,KAAI,OAAO,WAAW,YAAY,UAAU,MAAM;EAChD,MAAM,SAAS,OAAO,YACpB,OAAO,QAAQ,QAAQ,KAAK,CAAC,KAAK,WAAW,CAC3C,KACA,qCAAqC;AAIzC,MACE,iBAAiB,UACjB,OAAO,OAAO,gBAAgB,YAC9B,OAAO,YAAY,WAAW,iCAC9B;GACA,MAAM,UAAU,OAAO,YAAY,MACjC,+BAA+B;AAEjC,UAAO,OAAO;AACd,UAAO,OAAO,QAAQ,KAAK,MAAM;;AAGnC,SAAO;;AAET,QAAO;;AAGT,SAASA,eAAa,QAAsC;AAC1D,QAAO,qCACLC,aAAoB;;;;;;;AASxB,SAAgB,mBACd,OACA,WAA+B,oBACP;AACxB,KAAI,CAAC,mBAAmB,OAAQ,QAAO;CACvC,MAAM,YAAY,MAAM,QAAQ;AAChC,KAAI,CAAC,UAAW,QAAO;AAEvB,QAAOD,eACL,SAAS,0BAA0B,WAAW,EAC5C,mCAAmC;;;;;;;AAUzC,SAAgB,oBACd,OACA,WAA+B,oBACP;AACxB,KAAI,CAAC,mBAAmB,OAAQ,QAAO;CACvC,MAAM,YAAY,MAAM,QAAQ;AAChC,KAAI,CAAC,UAAW,QAAO;AAEvB,QAAOA,eACL,SAAS,0BAA0B,WAAW;EAC5C,mBAAmB;EACnB,mCAAmC;EACnC,WAAW;;;;;;;;AAUjB,SAAgB,mBACd,OACA,WAA+B,oBACP;AACxB,KAAI,CAAC,mBAAmB,OAAQ,QAAO;CACvC,IAAI,YAAY,MAAM,QAAQ;AAC9B,KAAI,cAAc,mBAEhB,aAAY,MAAM,QAAQ;AAE5B,KAAI,CAAC,UAAW,QAAO;AAEvB,QAAOA,eACL,SAAS,0BAA0B,WAAW;EAC5C,mBAAmB;EACnB,mCAAmC;EACnC,WAAW;;;;;;;;AAUjB,SAAgB,oBACd,OACA,WAA+B,oBACP;AACxB,KAAI,CAAC,mBAAmB,OAAQ,QAAO;CACvC,MAAM,YAAY,MAAM,QAAQ;AAChC,KAAI,CAAC,UAAW,QAAO;AAEvB,QAAOA,eACL,SAAS,0BAA0B,WAAW,EAC5C,mCAAmC;;;;;;;AAUzC,SAAgB,oBACd,OACA,WAA+B,oBACP;AACxB,KAAI,CAAC,mBAAmB,OAAQ,QAAO;CACvC,MAAM,YAAY,MAAM,QAAQ;AAChC,KAAI,CAAC,UAAW,QAAO;AAEvB,QAAOA,eACL,SAAS,0BAA0B,WAAW,EAC5C,mCAAmC"}
|