@langchain/langgraph 1.0.7 → 1.0.12
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/package.json +7 -7
- package/CHANGELOG.md +0 -286
- package/dist/_virtual/rolldown_runtime.cjs +0 -25
- package/dist/channels/any_value.cjs +0 -46
- package/dist/channels/any_value.cjs.map +0 -1
- package/dist/channels/any_value.d.cts +0 -24
- package/dist/channels/any_value.d.cts.map +0 -1
- package/dist/channels/any_value.d.ts +0 -24
- package/dist/channels/any_value.d.ts.map +0 -1
- package/dist/channels/any_value.js +0 -46
- package/dist/channels/any_value.js.map +0 -1
- package/dist/channels/base.cjs +0 -102
- package/dist/channels/base.cjs.map +0 -1
- package/dist/channels/base.d.cts +0 -79
- package/dist/channels/base.d.cts.map +0 -1
- package/dist/channels/base.d.ts +0 -79
- package/dist/channels/base.d.ts.map +0 -1
- package/dist/channels/base.js +0 -97
- package/dist/channels/base.js.map +0 -1
- package/dist/channels/binop.cjs +0 -49
- package/dist/channels/binop.cjs.map +0 -1
- package/dist/channels/binop.d.cts +0 -22
- package/dist/channels/binop.d.cts.map +0 -1
- package/dist/channels/binop.d.ts +0 -22
- package/dist/channels/binop.d.ts.map +0 -1
- package/dist/channels/binop.js +0 -49
- package/dist/channels/binop.js.map +0 -1
- package/dist/channels/dynamic_barrier_value.cjs +0 -76
- package/dist/channels/dynamic_barrier_value.cjs.map +0 -1
- package/dist/channels/dynamic_barrier_value.d.cts +0 -42
- package/dist/channels/dynamic_barrier_value.d.cts.map +0 -1
- package/dist/channels/dynamic_barrier_value.d.ts +0 -42
- package/dist/channels/dynamic_barrier_value.d.ts.map +0 -1
- package/dist/channels/dynamic_barrier_value.js +0 -76
- package/dist/channels/dynamic_barrier_value.js.map +0 -1
- package/dist/channels/ephemeral_value.cjs +0 -46
- package/dist/channels/ephemeral_value.cjs.map +0 -1
- package/dist/channels/ephemeral_value.d.cts +0 -22
- package/dist/channels/ephemeral_value.d.cts.map +0 -1
- package/dist/channels/ephemeral_value.d.ts +0 -22
- package/dist/channels/ephemeral_value.d.ts.map +0 -1
- package/dist/channels/ephemeral_value.js +0 -46
- package/dist/channels/ephemeral_value.js.map +0 -1
- package/dist/channels/index.cjs +0 -21
- package/dist/channels/index.d.cts +0 -9
- package/dist/channels/index.d.ts +0 -9
- package/dist/channels/index.js +0 -10
- package/dist/channels/last_value.cjs +0 -98
- package/dist/channels/last_value.cjs.map +0 -1
- package/dist/channels/last_value.d.cts +0 -44
- package/dist/channels/last_value.d.cts.map +0 -1
- package/dist/channels/last_value.d.ts +0 -44
- package/dist/channels/last_value.d.ts.map +0 -1
- package/dist/channels/last_value.js +0 -97
- package/dist/channels/last_value.js.map +0 -1
- package/dist/channels/named_barrier_value.cjs +0 -118
- package/dist/channels/named_barrier_value.cjs.map +0 -1
- package/dist/channels/named_barrier_value.d.cts +0 -46
- package/dist/channels/named_barrier_value.d.cts.map +0 -1
- package/dist/channels/named_barrier_value.d.ts +0 -46
- package/dist/channels/named_barrier_value.d.ts.map +0 -1
- package/dist/channels/named_barrier_value.js +0 -116
- package/dist/channels/named_barrier_value.js.map +0 -1
- package/dist/channels/topic.cjs +0 -65
- package/dist/channels/topic.cjs.map +0 -1
- package/dist/channels/topic.d.cts +0 -32
- package/dist/channels/topic.d.cts.map +0 -1
- package/dist/channels/topic.d.ts +0 -32
- package/dist/channels/topic.d.ts.map +0 -1
- package/dist/channels/topic.js +0 -65
- package/dist/channels/topic.js.map +0 -1
- package/dist/constants.cjs +0 -406
- package/dist/constants.cjs.map +0 -1
- package/dist/constants.d.cts +0 -285
- package/dist/constants.d.cts.map +0 -1
- package/dist/constants.d.ts +0 -285
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -362
- package/dist/constants.js.map +0 -1
- package/dist/errors.cjs +0 -163
- package/dist/errors.cjs.map +0 -1
- package/dist/errors.d.cts +0 -81
- package/dist/errors.d.cts.map +0 -1
- package/dist/errors.d.ts +0 -81
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -146
- package/dist/errors.js.map +0 -1
- package/dist/func/index.cjs +0 -301
- package/dist/func/index.cjs.map +0 -1
- package/dist/func/index.d.cts +0 -293
- package/dist/func/index.d.cts.map +0 -1
- package/dist/func/index.d.ts +0 -293
- package/dist/func/index.d.ts.map +0 -1
- package/dist/func/index.js +0 -298
- package/dist/func/index.js.map +0 -1
- package/dist/func/types.d.cts +0 -64
- package/dist/func/types.d.cts.map +0 -1
- package/dist/func/types.d.ts +0 -64
- package/dist/func/types.d.ts.map +0 -1
- package/dist/graph/annotation.cjs +0 -101
- package/dist/graph/annotation.cjs.map +0 -1
- package/dist/graph/annotation.d.cts +0 -116
- package/dist/graph/annotation.d.cts.map +0 -1
- package/dist/graph/annotation.d.ts +0 -116
- package/dist/graph/annotation.d.ts.map +0 -1
- package/dist/graph/annotation.js +0 -99
- package/dist/graph/annotation.js.map +0 -1
- package/dist/graph/graph.cjs +0 -423
- package/dist/graph/graph.cjs.map +0 -1
- package/dist/graph/graph.d.cts +0 -132
- package/dist/graph/graph.d.cts.map +0 -1
- package/dist/graph/graph.d.ts +0 -132
- package/dist/graph/graph.d.ts.map +0 -1
- package/dist/graph/graph.js +0 -420
- package/dist/graph/graph.js.map +0 -1
- package/dist/graph/index.cjs +0 -5
- package/dist/graph/index.js +0 -7
- package/dist/graph/message.cjs +0 -99
- package/dist/graph/message.cjs.map +0 -1
- package/dist/graph/message.d.cts +0 -40
- package/dist/graph/message.d.cts.map +0 -1
- package/dist/graph/message.d.ts +0 -40
- package/dist/graph/message.d.ts.map +0 -1
- package/dist/graph/message.js +0 -95
- package/dist/graph/message.js.map +0 -1
- package/dist/graph/messages_annotation.cjs +0 -110
- package/dist/graph/messages_annotation.cjs.map +0 -1
- package/dist/graph/messages_annotation.d.cts +0 -112
- package/dist/graph/messages_annotation.d.cts.map +0 -1
- package/dist/graph/messages_annotation.d.ts +0 -112
- package/dist/graph/messages_annotation.d.ts.map +0 -1
- package/dist/graph/messages_annotation.js +0 -107
- package/dist/graph/messages_annotation.js.map +0 -1
- package/dist/graph/state.cjs +0 -501
- package/dist/graph/state.cjs.map +0 -1
- package/dist/graph/state.d.cts +0 -236
- package/dist/graph/state.d.cts.map +0 -1
- package/dist/graph/state.d.ts +0 -236
- package/dist/graph/state.d.ts.map +0 -1
- package/dist/graph/state.js +0 -499
- package/dist/graph/state.js.map +0 -1
- package/dist/graph/zod/index.cjs +0 -10
- package/dist/graph/zod/index.d.cts +0 -3
- package/dist/graph/zod/index.d.ts +0 -3
- package/dist/graph/zod/index.js +0 -5
- package/dist/graph/zod/meta.cjs +0 -145
- package/dist/graph/zod/meta.cjs.map +0 -1
- package/dist/graph/zod/meta.d.cts +0 -116
- package/dist/graph/zod/meta.d.cts.map +0 -1
- package/dist/graph/zod/meta.d.ts +0 -116
- package/dist/graph/zod/meta.d.ts.map +0 -1
- package/dist/graph/zod/meta.js +0 -141
- package/dist/graph/zod/meta.js.map +0 -1
- package/dist/graph/zod/plugin.cjs +0 -41
- package/dist/graph/zod/plugin.cjs.map +0 -1
- package/dist/graph/zod/plugin.js +0 -41
- package/dist/graph/zod/plugin.js.map +0 -1
- package/dist/graph/zod/schema.cjs +0 -99
- package/dist/graph/zod/schema.cjs.map +0 -1
- package/dist/graph/zod/schema.d.cts +0 -38
- package/dist/graph/zod/schema.d.cts.map +0 -1
- package/dist/graph/zod/schema.d.ts +0 -38
- package/dist/graph/zod/schema.d.ts.map +0 -1
- package/dist/graph/zod/schema.js +0 -94
- package/dist/graph/zod/schema.js.map +0 -1
- package/dist/graph/zod/zod-registry.cjs +0 -43
- package/dist/graph/zod/zod-registry.cjs.map +0 -1
- package/dist/graph/zod/zod-registry.d.cts +0 -51
- package/dist/graph/zod/zod-registry.d.cts.map +0 -1
- package/dist/graph/zod/zod-registry.d.ts +0 -51
- package/dist/graph/zod/zod-registry.d.ts.map +0 -1
- package/dist/graph/zod/zod-registry.js +0 -41
- package/dist/graph/zod/zod-registry.js.map +0 -1
- package/dist/hash.cjs +0 -271
- package/dist/hash.cjs.map +0 -1
- package/dist/hash.js +0 -269
- package/dist/hash.js.map +0 -1
- package/dist/index.cjs +0 -112
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -26
- package/dist/index.d.ts +0 -26
- package/dist/index.js +0 -22
- package/dist/index.js.map +0 -1
- package/dist/interrupt.cjs +0 -82
- package/dist/interrupt.cjs.map +0 -1
- package/dist/interrupt.d.cts +0 -58
- package/dist/interrupt.d.cts.map +0 -1
- package/dist/interrupt.d.ts +0 -58
- package/dist/interrupt.d.ts.map +0 -1
- package/dist/interrupt.js +0 -81
- package/dist/interrupt.js.map +0 -1
- package/dist/prebuilt/agentName.cjs +0 -153
- package/dist/prebuilt/agentName.cjs.map +0 -1
- package/dist/prebuilt/agentName.d.cts +0 -42
- package/dist/prebuilt/agentName.d.cts.map +0 -1
- package/dist/prebuilt/agentName.d.ts +0 -42
- package/dist/prebuilt/agentName.d.ts.map +0 -1
- package/dist/prebuilt/agentName.js +0 -152
- package/dist/prebuilt/agentName.js.map +0 -1
- package/dist/prebuilt/agent_executor.cjs +0 -44
- package/dist/prebuilt/agent_executor.cjs.map +0 -1
- package/dist/prebuilt/agent_executor.d.cts +0 -58
- package/dist/prebuilt/agent_executor.d.cts.map +0 -1
- package/dist/prebuilt/agent_executor.d.ts +0 -58
- package/dist/prebuilt/agent_executor.d.ts.map +0 -1
- package/dist/prebuilt/agent_executor.js +0 -44
- package/dist/prebuilt/agent_executor.js.map +0 -1
- package/dist/prebuilt/chat_agent_executor.cjs +0 -68
- package/dist/prebuilt/chat_agent_executor.cjs.map +0 -1
- package/dist/prebuilt/chat_agent_executor.d.cts +0 -23
- package/dist/prebuilt/chat_agent_executor.d.cts.map +0 -1
- package/dist/prebuilt/chat_agent_executor.d.ts +0 -23
- package/dist/prebuilt/chat_agent_executor.d.ts.map +0 -1
- package/dist/prebuilt/chat_agent_executor.js +0 -67
- package/dist/prebuilt/chat_agent_executor.js.map +0 -1
- package/dist/prebuilt/index.cjs +0 -15
- package/dist/prebuilt/index.d.cts +0 -8
- package/dist/prebuilt/index.d.ts +0 -8
- package/dist/prebuilt/index.js +0 -8
- package/dist/prebuilt/interrupt.d.cts +0 -61
- package/dist/prebuilt/interrupt.d.cts.map +0 -1
- package/dist/prebuilt/interrupt.d.ts +0 -61
- package/dist/prebuilt/interrupt.d.ts.map +0 -1
- package/dist/prebuilt/react_agent_executor.cjs +0 -344
- package/dist/prebuilt/react_agent_executor.cjs.map +0 -1
- package/dist/prebuilt/react_agent_executor.d.cts +0 -230
- package/dist/prebuilt/react_agent_executor.d.cts.map +0 -1
- package/dist/prebuilt/react_agent_executor.d.ts +0 -230
- package/dist/prebuilt/react_agent_executor.d.ts.map +0 -1
- package/dist/prebuilt/react_agent_executor.js +0 -342
- package/dist/prebuilt/react_agent_executor.js.map +0 -1
- package/dist/prebuilt/tool_executor.cjs +0 -48
- package/dist/prebuilt/tool_executor.cjs.map +0 -1
- package/dist/prebuilt/tool_executor.d.cts +0 -42
- package/dist/prebuilt/tool_executor.d.cts.map +0 -1
- package/dist/prebuilt/tool_executor.d.ts +0 -42
- package/dist/prebuilt/tool_executor.d.ts.map +0 -1
- package/dist/prebuilt/tool_executor.js +0 -47
- package/dist/prebuilt/tool_executor.js.map +0 -1
- package/dist/prebuilt/tool_node.cjs +0 -248
- package/dist/prebuilt/tool_node.cjs.map +0 -1
- package/dist/prebuilt/tool_node.d.cts +0 -182
- package/dist/prebuilt/tool_node.d.cts.map +0 -1
- package/dist/prebuilt/tool_node.d.ts +0 -182
- package/dist/prebuilt/tool_node.d.ts.map +0 -1
- package/dist/prebuilt/tool_node.js +0 -246
- package/dist/prebuilt/tool_node.js.map +0 -1
- package/dist/pregel/algo.cjs +0 -573
- package/dist/pregel/algo.cjs.map +0 -1
- package/dist/pregel/algo.d.cts +0 -13
- package/dist/pregel/algo.d.cts.map +0 -1
- package/dist/pregel/algo.d.ts +0 -13
- package/dist/pregel/algo.d.ts.map +0 -1
- package/dist/pregel/algo.js +0 -567
- package/dist/pregel/algo.js.map +0 -1
- package/dist/pregel/call.cjs +0 -53
- package/dist/pregel/call.cjs.map +0 -1
- package/dist/pregel/call.js +0 -50
- package/dist/pregel/call.js.map +0 -1
- package/dist/pregel/debug.cjs +0 -175
- package/dist/pregel/debug.cjs.map +0 -1
- package/dist/pregel/debug.js +0 -169
- package/dist/pregel/debug.js.map +0 -1
- package/dist/pregel/index.cjs +0 -1170
- package/dist/pregel/index.cjs.map +0 -1
- package/dist/pregel/index.d.cts +0 -546
- package/dist/pregel/index.d.cts.map +0 -1
- package/dist/pregel/index.d.ts +0 -546
- package/dist/pregel/index.d.ts.map +0 -1
- package/dist/pregel/index.js +0 -1168
- package/dist/pregel/index.js.map +0 -1
- package/dist/pregel/io.cjs +0 -140
- package/dist/pregel/io.cjs.map +0 -1
- package/dist/pregel/io.js +0 -135
- package/dist/pregel/io.js.map +0 -1
- package/dist/pregel/loop.cjs +0 -548
- package/dist/pregel/loop.cjs.map +0 -1
- package/dist/pregel/loop.js +0 -547
- package/dist/pregel/loop.js.map +0 -1
- package/dist/pregel/messages.cjs +0 -108
- package/dist/pregel/messages.cjs.map +0 -1
- package/dist/pregel/messages.js +0 -107
- package/dist/pregel/messages.js.map +0 -1
- package/dist/pregel/read.cjs +0 -152
- package/dist/pregel/read.cjs.map +0 -1
- package/dist/pregel/read.d.cts +0 -51
- package/dist/pregel/read.d.cts.map +0 -1
- package/dist/pregel/read.d.ts +0 -51
- package/dist/pregel/read.d.ts.map +0 -1
- package/dist/pregel/read.js +0 -150
- package/dist/pregel/read.js.map +0 -1
- package/dist/pregel/remote.cjs +0 -349
- package/dist/pregel/remote.cjs.map +0 -1
- package/dist/pregel/remote.d.cts +0 -123
- package/dist/pregel/remote.d.cts.map +0 -1
- package/dist/pregel/remote.d.ts +0 -123
- package/dist/pregel/remote.d.ts.map +0 -1
- package/dist/pregel/remote.js +0 -348
- package/dist/pregel/remote.js.map +0 -1
- package/dist/pregel/retry.cjs +0 -92
- package/dist/pregel/retry.cjs.map +0 -1
- package/dist/pregel/retry.js +0 -92
- package/dist/pregel/retry.js.map +0 -1
- package/dist/pregel/runnable_types.d.cts +0 -49
- package/dist/pregel/runnable_types.d.cts.map +0 -1
- package/dist/pregel/runnable_types.d.ts +0 -49
- package/dist/pregel/runnable_types.d.ts.map +0 -1
- package/dist/pregel/runner.cjs +0 -228
- package/dist/pregel/runner.cjs.map +0 -1
- package/dist/pregel/runner.js +0 -228
- package/dist/pregel/runner.js.map +0 -1
- package/dist/pregel/stream.cjs +0 -199
- package/dist/pregel/stream.cjs.map +0 -1
- package/dist/pregel/stream.js +0 -196
- package/dist/pregel/stream.js.map +0 -1
- package/dist/pregel/types.cjs +0 -27
- package/dist/pregel/types.cjs.map +0 -1
- package/dist/pregel/types.d.cts +0 -453
- package/dist/pregel/types.d.cts.map +0 -1
- package/dist/pregel/types.d.ts +0 -453
- package/dist/pregel/types.d.ts.map +0 -1
- package/dist/pregel/types.js +0 -25
- package/dist/pregel/types.js.map +0 -1
- package/dist/pregel/utils/config.cjs +0 -122
- package/dist/pregel/utils/config.cjs.map +0 -1
- package/dist/pregel/utils/config.d.cts +0 -36
- package/dist/pregel/utils/config.d.cts.map +0 -1
- package/dist/pregel/utils/config.d.ts +0 -36
- package/dist/pregel/utils/config.d.ts.map +0 -1
- package/dist/pregel/utils/config.js +0 -115
- package/dist/pregel/utils/config.js.map +0 -1
- package/dist/pregel/utils/index.cjs +0 -103
- package/dist/pregel/utils/index.cjs.map +0 -1
- package/dist/pregel/utils/index.d.cts +0 -51
- package/dist/pregel/utils/index.d.cts.map +0 -1
- package/dist/pregel/utils/index.d.ts +0 -51
- package/dist/pregel/utils/index.d.ts.map +0 -1
- package/dist/pregel/utils/index.js +0 -97
- package/dist/pregel/utils/index.js.map +0 -1
- package/dist/pregel/utils/subgraph.cjs +0 -19
- package/dist/pregel/utils/subgraph.cjs.map +0 -1
- package/dist/pregel/utils/subgraph.js +0 -17
- package/dist/pregel/utils/subgraph.js.map +0 -1
- package/dist/pregel/validate.cjs +0 -45
- package/dist/pregel/validate.cjs.map +0 -1
- package/dist/pregel/validate.js +0 -44
- package/dist/pregel/validate.js.map +0 -1
- package/dist/pregel/write.cjs +0 -97
- package/dist/pregel/write.cjs.map +0 -1
- package/dist/pregel/write.d.cts +0 -35
- package/dist/pregel/write.d.cts.map +0 -1
- package/dist/pregel/write.d.ts +0 -35
- package/dist/pregel/write.d.ts.map +0 -1
- package/dist/pregel/write.js +0 -95
- package/dist/pregel/write.js.map +0 -1
- package/dist/remote.cjs +0 -3
- package/dist/remote.d.cts +0 -2
- package/dist/remote.d.ts +0 -2
- package/dist/remote.js +0 -3
- package/dist/setup/async_local_storage.cjs +0 -12
- package/dist/setup/async_local_storage.cjs.map +0 -1
- package/dist/setup/async_local_storage.js +0 -11
- package/dist/setup/async_local_storage.js.map +0 -1
- package/dist/utils.cjs +0 -88
- package/dist/utils.cjs.map +0 -1
- package/dist/utils.d.cts +0 -32
- package/dist/utils.d.cts.map +0 -1
- package/dist/utils.d.ts +0 -32
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -81
- package/dist/utils.js.map +0 -1
- package/dist/web.cjs +0 -96
- package/dist/web.d.cts +0 -23
- package/dist/web.d.ts +0 -23
- package/dist/web.js +0 -15
- package/dist/writer.cjs +0 -15
- package/dist/writer.cjs.map +0 -1
- package/dist/writer.d.cts +0 -7
- package/dist/writer.d.cts.map +0 -1
- package/dist/writer.d.ts +0 -7
- package/dist/writer.d.ts.map +0 -1
- package/dist/writer.js +0 -14
- package/dist/writer.js.map +0 -1
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_meta = require('./meta.cjs');
|
|
3
|
-
const __langchain_core_utils_types = require_rolldown_runtime.__toESM(require("@langchain/core/utils/types"));
|
|
4
|
-
const zod_v3 = require_rolldown_runtime.__toESM(require("zod/v3"));
|
|
5
|
-
const zod = require_rolldown_runtime.__toESM(require("zod"));
|
|
6
|
-
|
|
7
|
-
//#region src/graph/zod/plugin.ts
|
|
8
|
-
const metaSymbol = Symbol.for("langgraph-zod");
|
|
9
|
-
if (!(metaSymbol in globalThis)) globalThis[metaSymbol] = /* @__PURE__ */ new WeakSet();
|
|
10
|
-
function applyPluginPrototype(prototype) {
|
|
11
|
-
const cache = globalThis[metaSymbol];
|
|
12
|
-
if (cache.has(prototype)) return;
|
|
13
|
-
Object.defineProperty(prototype, "langgraph", { get() {
|
|
14
|
-
const zodThis = this;
|
|
15
|
-
return {
|
|
16
|
-
metadata(jsonSchemaExtra) {
|
|
17
|
-
return require_meta.withLangGraph(zodThis, { jsonSchemaExtra });
|
|
18
|
-
},
|
|
19
|
-
reducer(fn, schema) {
|
|
20
|
-
const defaultFn = (0, __langchain_core_utils_types.getInteropZodDefaultGetter)(zodThis);
|
|
21
|
-
return require_meta.withLangGraph(zodThis, {
|
|
22
|
-
default: defaultFn,
|
|
23
|
-
reducer: {
|
|
24
|
-
schema,
|
|
25
|
-
fn
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
} });
|
|
31
|
-
cache.add(prototype);
|
|
32
|
-
}
|
|
33
|
-
try {
|
|
34
|
-
applyPluginPrototype(zod_v3.z.ZodType.prototype);
|
|
35
|
-
applyPluginPrototype(zod.z.ZodType.prototype);
|
|
36
|
-
} catch (error) {
|
|
37
|
-
throw new Error("Failed to extend Zod with LangGraph-related methods. This is most likely a bug, consider opening an issue and/or using `withLangGraph` to augment your Zod schema.", { cause: error });
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
//#endregion
|
|
41
|
-
//# sourceMappingURL=plugin.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs","names":["withLangGraph","z3","zd"],"sources":["../../../src/graph/zod/plugin.ts"],"sourcesContent":["import { z as zd } from \"zod\";\nimport { z as z3 } from \"zod/v3\";\nimport { getInteropZodDefaultGetter } from \"@langchain/core/utils/types\";\nimport { SchemaMeta, withLangGraph } from \"./meta.js\";\n\nconst metaSymbol = Symbol.for(\"langgraph-zod\");\n\ninterface ZodLangGraphTypes<T extends zd.ZodTypeAny, Output> {\n reducer<Input = zd.output<T>>(\n transform: (a: Output, arg: Input) => Output,\n options?: zd.ZodType<Input>\n ): zd.ZodType<Output, zd.ZodEffectsDef<T>, Input>;\n\n metadata(payload: {\n langgraph_nodes?: string[];\n langgraph_type?: \"prompt\";\n\n [key: string]: unknown;\n }): T;\n}\n\ndeclare module \"zod\" {\n interface ZodType<Output> {\n /**\n * @deprecated Using the langgraph zod plugin is deprecated and will be removed in future versions\n * Consider upgrading to zod 4 and using the exported langgraph meta registry. {@link langgraphRegistry}\n */\n langgraph: ZodLangGraphTypes<this, Output>;\n }\n}\n\ndeclare module \"zod/v3\" {\n interface ZodType<Output> {\n /**\n * @deprecated Using the langgraph zod plugin is deprecated and will be removed in future versions\n * Consider upgrading to zod 4 and using the exported langgraph meta registry. {@link langgraphRegistry}\n */\n langgraph: ZodLangGraphTypes<this, Output>;\n }\n}\n\ninterface PluginGlobalType {\n [metaSymbol]?: WeakSet<object>;\n}\n\nif (!(metaSymbol in globalThis)) {\n (globalThis as PluginGlobalType)[metaSymbol] = new WeakSet();\n}\n\nfunction applyPluginPrototype<\n PrototypeToExtend extends\n | typeof zd.ZodType.prototype\n | typeof z3.ZodType.prototype\n>(prototype: PrototypeToExtend) {\n const cache = (globalThis as PluginGlobalType)[metaSymbol]!;\n if (cache.has(prototype)) {\n return; // Already applied\n }\n\n Object.defineProperty(\n prototype,\n \"langgraph\" satisfies keyof PrototypeToExtend,\n {\n get(): zd.ZodType[\"langgraph\"] {\n // Return type is any, actual type provided by module augmentation\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const zodThis = this as zd.ZodTypeAny;\n type Output = zd.infer<typeof zodThis>;\n\n return {\n metadata(\n jsonSchemaExtra: SchemaMeta<Output, Output>[\"jsonSchemaExtra\"]\n ) {\n return withLangGraph(zodThis, { jsonSchemaExtra });\n },\n reducer<Input>(\n fn: (a: Output, arg: Input) => Output,\n schema?: zd.ZodType<Input>\n ) {\n const defaultFn = getInteropZodDefaultGetter(zodThis);\n return withLangGraph(zodThis, {\n default: defaultFn,\n reducer: { schema, fn },\n });\n },\n };\n },\n }\n );\n cache.add(prototype);\n}\n\ntry {\n applyPluginPrototype(z3.ZodType.prototype);\n applyPluginPrototype(zd.ZodType.prototype);\n} catch (error) {\n throw new Error(\n \"Failed to extend Zod with LangGraph-related methods. This is most likely a bug, consider opening an issue and/or using `withLangGraph` to augment your Zod schema.\",\n { cause: error }\n );\n}\n"],"mappings":";;;;;;;AAKA,MAAM,aAAa,OAAO,IAAI;AAwC9B,IAAI,EAAE,cAAc,YAClB,CAAC,WAAgC,8BAAc,IAAI;AAGrD,SAAS,qBAIP,WAA8B;CAC9B,MAAM,QAAS,WAAgC;AAC/C,KAAI,MAAM,IAAI,WACZ;AAGF,QAAO,eACL,WACA,aACA,EACE,MAA+B;EAG7B,MAAM,UAAU;AAGhB,SAAO;GACL,SACE,iBACA;AACA,WAAOA,2BAAc,SAAS,EAAE;;GAElC,QACE,IACA,QACA;IACA,MAAM,yEAAuC;AAC7C,WAAOA,2BAAc,SAAS;KAC5B,SAAS;KACT,SAAS;MAAE;MAAQ;;;;;;AAO/B,OAAM,IAAI;;AAGZ,IAAI;AACF,sBAAqBC,SAAG,QAAQ;AAChC,sBAAqBC,MAAG,QAAQ;SACzB,OAAO;AACd,OAAM,IAAI,MACR,sKACA,EAAE,OAAO"}
|
package/dist/graph/zod/plugin.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { withLangGraph } from "./meta.js";
|
|
2
|
-
import { getInteropZodDefaultGetter } from "@langchain/core/utils/types";
|
|
3
|
-
import { z } from "zod/v3";
|
|
4
|
-
import { z as z$1 } from "zod";
|
|
5
|
-
|
|
6
|
-
//#region src/graph/zod/plugin.ts
|
|
7
|
-
const metaSymbol = Symbol.for("langgraph-zod");
|
|
8
|
-
if (!(metaSymbol in globalThis)) globalThis[metaSymbol] = /* @__PURE__ */ new WeakSet();
|
|
9
|
-
function applyPluginPrototype(prototype) {
|
|
10
|
-
const cache = globalThis[metaSymbol];
|
|
11
|
-
if (cache.has(prototype)) return;
|
|
12
|
-
Object.defineProperty(prototype, "langgraph", { get() {
|
|
13
|
-
const zodThis = this;
|
|
14
|
-
return {
|
|
15
|
-
metadata(jsonSchemaExtra) {
|
|
16
|
-
return withLangGraph(zodThis, { jsonSchemaExtra });
|
|
17
|
-
},
|
|
18
|
-
reducer(fn, schema) {
|
|
19
|
-
const defaultFn = getInteropZodDefaultGetter(zodThis);
|
|
20
|
-
return withLangGraph(zodThis, {
|
|
21
|
-
default: defaultFn,
|
|
22
|
-
reducer: {
|
|
23
|
-
schema,
|
|
24
|
-
fn
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
} });
|
|
30
|
-
cache.add(prototype);
|
|
31
|
-
}
|
|
32
|
-
try {
|
|
33
|
-
applyPluginPrototype(z.ZodType.prototype);
|
|
34
|
-
applyPluginPrototype(z$1.ZodType.prototype);
|
|
35
|
-
} catch (error) {
|
|
36
|
-
throw new Error("Failed to extend Zod with LangGraph-related methods. This is most likely a bug, consider opening an issue and/or using `withLangGraph` to augment your Zod schema.", { cause: error });
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
//#endregion
|
|
40
|
-
export { };
|
|
41
|
-
//# sourceMappingURL=plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","names":["z3","zd"],"sources":["../../../src/graph/zod/plugin.ts"],"sourcesContent":["import { z as zd } from \"zod\";\nimport { z as z3 } from \"zod/v3\";\nimport { getInteropZodDefaultGetter } from \"@langchain/core/utils/types\";\nimport { SchemaMeta, withLangGraph } from \"./meta.js\";\n\nconst metaSymbol = Symbol.for(\"langgraph-zod\");\n\ninterface ZodLangGraphTypes<T extends zd.ZodTypeAny, Output> {\n reducer<Input = zd.output<T>>(\n transform: (a: Output, arg: Input) => Output,\n options?: zd.ZodType<Input>\n ): zd.ZodType<Output, zd.ZodEffectsDef<T>, Input>;\n\n metadata(payload: {\n langgraph_nodes?: string[];\n langgraph_type?: \"prompt\";\n\n [key: string]: unknown;\n }): T;\n}\n\ndeclare module \"zod\" {\n interface ZodType<Output> {\n /**\n * @deprecated Using the langgraph zod plugin is deprecated and will be removed in future versions\n * Consider upgrading to zod 4 and using the exported langgraph meta registry. {@link langgraphRegistry}\n */\n langgraph: ZodLangGraphTypes<this, Output>;\n }\n}\n\ndeclare module \"zod/v3\" {\n interface ZodType<Output> {\n /**\n * @deprecated Using the langgraph zod plugin is deprecated and will be removed in future versions\n * Consider upgrading to zod 4 and using the exported langgraph meta registry. {@link langgraphRegistry}\n */\n langgraph: ZodLangGraphTypes<this, Output>;\n }\n}\n\ninterface PluginGlobalType {\n [metaSymbol]?: WeakSet<object>;\n}\n\nif (!(metaSymbol in globalThis)) {\n (globalThis as PluginGlobalType)[metaSymbol] = new WeakSet();\n}\n\nfunction applyPluginPrototype<\n PrototypeToExtend extends\n | typeof zd.ZodType.prototype\n | typeof z3.ZodType.prototype\n>(prototype: PrototypeToExtend) {\n const cache = (globalThis as PluginGlobalType)[metaSymbol]!;\n if (cache.has(prototype)) {\n return; // Already applied\n }\n\n Object.defineProperty(\n prototype,\n \"langgraph\" satisfies keyof PrototypeToExtend,\n {\n get(): zd.ZodType[\"langgraph\"] {\n // Return type is any, actual type provided by module augmentation\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const zodThis = this as zd.ZodTypeAny;\n type Output = zd.infer<typeof zodThis>;\n\n return {\n metadata(\n jsonSchemaExtra: SchemaMeta<Output, Output>[\"jsonSchemaExtra\"]\n ) {\n return withLangGraph(zodThis, { jsonSchemaExtra });\n },\n reducer<Input>(\n fn: (a: Output, arg: Input) => Output,\n schema?: zd.ZodType<Input>\n ) {\n const defaultFn = getInteropZodDefaultGetter(zodThis);\n return withLangGraph(zodThis, {\n default: defaultFn,\n reducer: { schema, fn },\n });\n },\n };\n },\n }\n );\n cache.add(prototype);\n}\n\ntry {\n applyPluginPrototype(z3.ZodType.prototype);\n applyPluginPrototype(zd.ZodType.prototype);\n} catch (error) {\n throw new Error(\n \"Failed to extend Zod with LangGraph-related methods. This is most likely a bug, consider opening an issue and/or using `withLangGraph` to augment your Zod schema.\",\n { cause: error }\n );\n}\n"],"mappings":";;;;;;AAKA,MAAM,aAAa,OAAO,IAAI;AAwC9B,IAAI,EAAE,cAAc,YAClB,CAAC,WAAgC,8BAAc,IAAI;AAGrD,SAAS,qBAIP,WAA8B;CAC9B,MAAM,QAAS,WAAgC;AAC/C,KAAI,MAAM,IAAI,WACZ;AAGF,QAAO,eACL,WACA,aACA,EACE,MAA+B;EAG7B,MAAM,UAAU;AAGhB,SAAO;GACL,SACE,iBACA;AACA,WAAO,cAAc,SAAS,EAAE;;GAElC,QACE,IACA,QACA;IACA,MAAM,YAAY,2BAA2B;AAC7C,WAAO,cAAc,SAAS;KAC5B,SAAS;KACT,SAAS;MAAE;MAAQ;;;;;;AAO/B,OAAM,IAAI;;AAGZ,IAAI;AACF,sBAAqBA,EAAG,QAAQ;AAChC,sBAAqBC,IAAG,QAAQ;SACzB,OAAO;AACd,OAAM,IAAI,MACR,sKACA,EAAE,OAAO"}
|
|
@@ -1,99 +0,0 @@
|
|
|
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
|
|
6
|
-
const PartialStateSchema = Symbol.for("langgraph.state.partial");
|
|
7
|
-
function isGraphWithZodLike(graph) {
|
|
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;
|
|
11
|
-
}
|
|
12
|
-
function applyJsonSchemaExtrasFromDescription(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;
|
|
24
|
-
}
|
|
25
|
-
function toJsonSchema(schema) {
|
|
26
|
-
return applyJsonSchemaExtrasFromDescription((0, __langchain_core_utils_json_schema.toJsonSchema)(schema));
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
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 }));
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
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
|
-
}));
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
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
|
-
}));
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
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 }));
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
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 }));
|
|
91
|
-
}
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,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O,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"}
|
|
@@ -1,38 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,38 +0,0 @@
|
|
|
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
|
-
|
|
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.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
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
|
|
5
|
-
const PartialStateSchema = Symbol.for("langgraph.state.partial");
|
|
6
|
-
function isGraphWithZodLike(graph) {
|
|
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;
|
|
10
|
-
}
|
|
11
|
-
function applyJsonSchemaExtrasFromDescription(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;
|
|
23
|
-
}
|
|
24
|
-
function toJsonSchema$1(schema) {
|
|
25
|
-
return applyJsonSchemaExtrasFromDescription(toJsonSchema(schema));
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
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 }));
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
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
|
-
}));
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
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
|
-
}));
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
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 }));
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
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 }));
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
//#endregion
|
|
93
|
-
export { getConfigTypeSchema, getInputTypeSchema, getOutputTypeSchema, getStateTypeSchema, getUpdateTypeSchema };
|
|
94
|
-
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,O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,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"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_meta = require('./meta.cjs');
|
|
3
|
-
const __langchain_core_utils_types = require_rolldown_runtime.__toESM(require("@langchain/core/utils/types"));
|
|
4
|
-
const zod_v4_core = require_rolldown_runtime.__toESM(require("zod/v4/core"));
|
|
5
|
-
|
|
6
|
-
//#region src/graph/zod/zod-registry.ts
|
|
7
|
-
/**
|
|
8
|
-
* A Zod v4-compatible meta registry that extends the base registry.
|
|
9
|
-
*
|
|
10
|
-
* This registry allows you to associate and retrieve metadata for Zod schemas,
|
|
11
|
-
* leveraging the base registry for storage. It is compatible with Zod v4 and
|
|
12
|
-
* interoperates with the base registry to ensure consistent metadata management
|
|
13
|
-
* across different Zod versions.
|
|
14
|
-
*
|
|
15
|
-
* @template Meta - The type of metadata associated with each schema.
|
|
16
|
-
* @template Schema - The Zod schema type.
|
|
17
|
-
*/
|
|
18
|
-
var LanggraphZodMetaRegistry = class extends zod_v4_core.$ZodRegistry {
|
|
19
|
-
/**
|
|
20
|
-
* Creates a new LanggraphZodMetaRegistry instance.
|
|
21
|
-
*
|
|
22
|
-
* @param parent - The base SchemaMetaRegistry to use for metadata storage.
|
|
23
|
-
*/
|
|
24
|
-
constructor(parent) {
|
|
25
|
-
super();
|
|
26
|
-
this.parent = parent;
|
|
27
|
-
this._map = this.parent._map;
|
|
28
|
-
}
|
|
29
|
-
add(schema, ..._meta) {
|
|
30
|
-
const firstMeta = _meta[0];
|
|
31
|
-
if (firstMeta && !firstMeta?.default) {
|
|
32
|
-
const defaultValueGetter = (0, __langchain_core_utils_types.getInteropZodDefaultGetter)(schema);
|
|
33
|
-
if (defaultValueGetter != null) firstMeta.default = defaultValueGetter;
|
|
34
|
-
}
|
|
35
|
-
return super.add(schema, ..._meta);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
const registry = new LanggraphZodMetaRegistry(require_meta.schemaMetaRegistry);
|
|
39
|
-
|
|
40
|
-
//#endregion
|
|
41
|
-
exports.LanggraphZodMetaRegistry = LanggraphZodMetaRegistry;
|
|
42
|
-
exports.registry = registry;
|
|
43
|
-
//# sourceMappingURL=zod-registry.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"zod-registry.cjs","names":["$ZodRegistry","parent: SchemaMetaRegistry","schemaMetaRegistry"],"sources":["../../../src/graph/zod/zod-registry.ts"],"sourcesContent":["// @ts-expect-error If zod/v4 is not imported, the module augmentation will fail in build\nimport type { ZodType } from \"zod/v4\"; // eslint-disable-line @typescript-eslint/no-unused-vars\n\n// @ts-expect-error If zod/v4-mini is not imported, the module augmentation will fail in build\nimport type { ZodMiniType } from \"zod/v4-mini\"; // eslint-disable-line @typescript-eslint/no-unused-vars\n\nimport type * as core from \"zod/v4/core\";\nimport { getInteropZodDefaultGetter } from \"@langchain/core/utils/types\";\nimport { $ZodType, $ZodRegistry, $replace } from \"zod/v4/core\";\nimport {\n type ReducedZodChannel,\n type SchemaMeta,\n type SchemaMetaRegistry,\n schemaMetaRegistry,\n} from \"./meta.js\";\n\n/**\n * A Zod v4-compatible meta registry that extends the base registry.\n *\n * This registry allows you to associate and retrieve metadata for Zod schemas,\n * leveraging the base registry for storage. It is compatible with Zod v4 and\n * interoperates with the base registry to ensure consistent metadata management\n * across different Zod versions.\n *\n * @template Meta - The type of metadata associated with each schema.\n * @template Schema - The Zod schema type.\n */\nexport class LanggraphZodMetaRegistry<\n Meta extends SchemaMeta = SchemaMeta,\n Schema extends $ZodType = $ZodType\n> extends $ZodRegistry<Meta & { [key: string]: unknown }, Schema> {\n /**\n * Creates a new LanggraphZodMetaRegistry instance.\n *\n * @param parent - The base SchemaMetaRegistry to use for metadata storage.\n */\n constructor(protected parent: SchemaMetaRegistry) {\n super();\n // Use the parent's map for metadata storage\n this._map = this.parent._map as Map<\n Schema,\n $replace<Meta & { [key: string]: unknown }, Schema>\n >;\n }\n\n add<S extends Schema>(\n schema: S,\n ..._meta: undefined extends Meta & { [key: string]: unknown }\n ? [$replace<Meta & { [key: string]: unknown }, S>?]\n : [$replace<Meta & { [key: string]: unknown }, S>]\n ): this {\n const firstMeta = _meta[0];\n if (firstMeta && !firstMeta?.default) {\n const defaultValueGetter = getInteropZodDefaultGetter(schema);\n if (defaultValueGetter != null) {\n // eslint-disable-next-line no-param-reassign\n firstMeta.default = defaultValueGetter;\n }\n }\n return super.add(schema, ..._meta);\n }\n}\n\n// Augment the zod/v4 module nudging the `register` method\n// to use the user provided input schema if specified.\ndeclare module \"zod/v4\" {\n export interface ZodType<\n out Output = unknown,\n out Input = unknown,\n out Internals extends core.$ZodTypeInternals<\n Output,\n Input\n > = core.$ZodTypeInternals<Output, Input>\n > extends core.$ZodType<Output, Input, Internals> {\n register<\n R extends LanggraphZodMetaRegistry,\n TOutput = core.output<this>,\n TInput = core.input<this>,\n TInternals extends core.$ZodTypeInternals<\n TOutput,\n TInput\n > = core.$ZodTypeInternals<TOutput, TInput>\n >(\n registry: R,\n meta: SchemaMeta<TOutput, TInput>\n ): ReducedZodChannel<this, ZodType<TOutput, TInput, TInternals>>;\n }\n}\n\ndeclare module \"zod/v4-mini\" {\n export interface ZodMiniType<\n out Output = unknown,\n out Input = unknown,\n out Internals extends core.$ZodTypeInternals<\n Output,\n Input\n > = core.$ZodTypeInternals<Output, Input>\n > extends core.$ZodType<Output, Input, Internals> {\n register<\n R extends LanggraphZodMetaRegistry,\n TOutput = core.output<this>,\n TInput = core.input<this>,\n TInternals extends core.$ZodTypeInternals<\n TOutput,\n TInput\n > = core.$ZodTypeInternals<TOutput, TInput>\n >(\n registry: R,\n meta: SchemaMeta<TOutput, TInput>\n ): ReducedZodChannel<this, ZodMiniType<TOutput, TInput, TInternals>>;\n }\n}\n\nexport const registry = new LanggraphZodMetaRegistry(schemaMetaRegistry);\n"],"mappings":";;;;;;;;;;;;;;;;;AA2BA,IAAa,2BAAb,cAGUA,yBAAwD;;;;;;CAMhE,YAAY,AAAUC,QAA4B;AAChD;EADoB;AAGpB,OAAK,OAAO,KAAK,OAAO;;CAM1B,IACE,QACA,GAAG,OAGG;EACN,MAAM,YAAY,MAAM;AACxB,MAAI,aAAa,CAAC,WAAW,SAAS;GACpC,MAAM,kFAAgD;AACtD,OAAI,sBAAsB,KAExB,WAAU,UAAU;;AAGxB,SAAO,MAAM,IAAI,QAAQ,GAAG;;;AAsDhC,MAAa,WAAW,IAAI,yBAAyBC"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { ReducedZodChannel, SchemaMeta, SchemaMetaRegistry } from "./meta.cjs";
|
|
2
|
-
import * as core from "zod/v4/core";
|
|
3
|
-
import { $ZodRegistry, $ZodType, $replace } from "zod/v4/core";
|
|
4
|
-
|
|
5
|
-
//#region src/graph/zod/zod-registry.d.ts
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* A Zod v4-compatible meta registry that extends the base registry.
|
|
9
|
-
*
|
|
10
|
-
* This registry allows you to associate and retrieve metadata for Zod schemas,
|
|
11
|
-
* leveraging the base registry for storage. It is compatible with Zod v4 and
|
|
12
|
-
* interoperates with the base registry to ensure consistent metadata management
|
|
13
|
-
* across different Zod versions.
|
|
14
|
-
*
|
|
15
|
-
* @template Meta - The type of metadata associated with each schema.
|
|
16
|
-
* @template Schema - The Zod schema type.
|
|
17
|
-
*/
|
|
18
|
-
declare class LanggraphZodMetaRegistry<Meta extends SchemaMeta = SchemaMeta, Schema extends $ZodType = $ZodType> extends $ZodRegistry<Meta & {
|
|
19
|
-
[key: string]: unknown;
|
|
20
|
-
}, Schema> {
|
|
21
|
-
protected parent: SchemaMetaRegistry;
|
|
22
|
-
/**
|
|
23
|
-
* Creates a new LanggraphZodMetaRegistry instance.
|
|
24
|
-
*
|
|
25
|
-
* @param parent - The base SchemaMetaRegistry to use for metadata storage.
|
|
26
|
-
*/
|
|
27
|
-
constructor(parent: SchemaMetaRegistry);
|
|
28
|
-
add<S extends Schema>(schema: S, ..._meta: undefined extends Meta & {
|
|
29
|
-
[key: string]: unknown;
|
|
30
|
-
} ? [$replace<Meta & {
|
|
31
|
-
[key: string]: unknown;
|
|
32
|
-
}, S>?] : [$replace<Meta & {
|
|
33
|
-
[key: string]: unknown;
|
|
34
|
-
}, S>]): this;
|
|
35
|
-
}
|
|
36
|
-
// Augment the zod/v4 module nudging the `register` method
|
|
37
|
-
// to use the user provided input schema if specified.
|
|
38
|
-
declare module "zod/v4" {
|
|
39
|
-
interface ZodType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> extends core.$ZodType<Output, Input, Internals> {
|
|
40
|
-
register<R extends LanggraphZodMetaRegistry, TOutput = core.output<this>, TInput = core.input<this>, TInternals extends core.$ZodTypeInternals<TOutput, TInput> = core.$ZodTypeInternals<TOutput, TInput>>(registry: R, meta: SchemaMeta<TOutput, TInput>): ReducedZodChannel<this, ZodType<TOutput, TInput, TInternals>>;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
declare module "zod/v4-mini" {
|
|
44
|
-
interface ZodMiniType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> extends core.$ZodType<Output, Input, Internals> {
|
|
45
|
-
register<R extends LanggraphZodMetaRegistry, TOutput = core.output<this>, TInput = core.input<this>, TInternals extends core.$ZodTypeInternals<TOutput, TInput> = core.$ZodTypeInternals<TOutput, TInput>>(registry: R, meta: SchemaMeta<TOutput, TInput>): ReducedZodChannel<this, ZodMiniType<TOutput, TInput, TInternals>>;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
declare const registry: LanggraphZodMetaRegistry<SchemaMeta<any, any>, $ZodType<unknown, unknown, core.$ZodTypeInternals<unknown, unknown>>>;
|
|
49
|
-
//#endregion
|
|
50
|
-
export { LanggraphZodMetaRegistry, registry };
|
|
51
|
-
//# sourceMappingURL=zod-registry.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"zod-registry.d.cts","names":["core","$ZodType","$ZodRegistry","$replace","ReducedZodChannel","SchemaMeta","SchemaMetaRegistry","LanggraphZodMetaRegistry","Meta","Schema","S","_1","Output","Input","$ZodTypeInternals","Internals","output","input","TOutput","TInput","R","TInternals","ZodType","sideEffect","_2","ZodMiniType","registry"],"sources":["../../../src/graph/zod/zod-registry.d.ts"],"sourcesContent":["import type * as core from \"zod/v4/core\";\nimport { $ZodType, $ZodRegistry, $replace } from \"zod/v4/core\";\nimport { type ReducedZodChannel, type SchemaMeta, type SchemaMetaRegistry } from \"./meta.js\";\n/**\n * A Zod v4-compatible meta registry that extends the base registry.\n *\n * This registry allows you to associate and retrieve metadata for Zod schemas,\n * leveraging the base registry for storage. It is compatible with Zod v4 and\n * interoperates with the base registry to ensure consistent metadata management\n * across different Zod versions.\n *\n * @template Meta - The type of metadata associated with each schema.\n * @template Schema - The Zod schema type.\n */\nexport declare class LanggraphZodMetaRegistry<Meta extends SchemaMeta = SchemaMeta, Schema extends $ZodType = $ZodType> extends $ZodRegistry<Meta & {\n [key: string]: unknown;\n}, Schema> {\n protected parent: SchemaMetaRegistry;\n /**\n * Creates a new LanggraphZodMetaRegistry instance.\n *\n * @param parent - The base SchemaMetaRegistry to use for metadata storage.\n */\n constructor(parent: SchemaMetaRegistry);\n add<S extends Schema>(schema: S, ..._meta: undefined extends Meta & {\n [key: string]: unknown;\n } ? [$replace<Meta & {\n [key: string]: unknown;\n }, S>?] : [$replace<Meta & {\n [key: string]: unknown;\n }, S>]): this;\n}\n// Augment the zod/v4 module nudging the `register` method\n// to use the user provided input schema if specified.\ndeclare module \"zod/v4\" {\n interface ZodType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> extends core.$ZodType<Output, Input, Internals> {\n register<R extends LanggraphZodMetaRegistry, TOutput = core.output<this>, TInput = core.input<this>, TInternals extends core.$ZodTypeInternals<TOutput, TInput> = core.$ZodTypeInternals<TOutput, TInput>>(registry: R, meta: SchemaMeta<TOutput, TInput>): ReducedZodChannel<this, ZodType<TOutput, TInput, TInternals>>;\n }\n}\ndeclare module \"zod/v4-mini\" {\n interface ZodMiniType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> extends core.$ZodType<Output, Input, Internals> {\n register<R extends LanggraphZodMetaRegistry, TOutput = core.output<this>, TInput = core.input<this>, TInternals extends core.$ZodTypeInternals<TOutput, TInput> = core.$ZodTypeInternals<TOutput, TInput>>(registry: R, meta: SchemaMeta<TOutput, TInput>): ReducedZodChannel<this, ZodMiniType<TOutput, TInput, TInternals>>;\n }\n}\nexport declare const registry: LanggraphZodMetaRegistry<SchemaMeta<any, any>, $ZodType<unknown, unknown, core.$ZodTypeInternals<unknown, unknown>>>;\n"],"mappings":";;;;;;;;AAcA;;;;;;;;;AASwBM,cATHC,wBASGD,CAAAA,aATmCD,UASnCC,GATgDD,UAShDC,EAAAA,eAT2EL,QAS3EK,GATsFL,QAStFK,CAAAA,SATwGJ,YASxGI,CATqHE,IASrHF,GAAAA;MACNG,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;GARfA,MAQ+BC,CAAAA,CAAAA;YAA+BF,MAAAA,EAP3CF,kBAO2CE;;;;;;aAIlDL,CAAAA,MAAAA,EALSG,kBAKTH;KAdiHD,CAAAA,UAU9GO,MAV8GP,CAAAA,CAAAA,MAAAA,EAU9FQ,CAV8FR,EAAAA,GAAAA,KAAAA,E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v4/core";
|
|
4
|
-
|
|
5
|
-
//#region src/graph/zod/zod-registry.d.ts
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* A Zod v4-compatible meta registry that extends the base registry.
|
|
9
|
-
*
|
|
10
|
-
* This registry allows you to associate and retrieve metadata for Zod schemas,
|
|
11
|
-
* leveraging the base registry for storage. It is compatible with Zod v4 and
|
|
12
|
-
* interoperates with the base registry to ensure consistent metadata management
|
|
13
|
-
* across different Zod versions.
|
|
14
|
-
*
|
|
15
|
-
* @template Meta - The type of metadata associated with each schema.
|
|
16
|
-
* @template Schema - The Zod schema type.
|
|
17
|
-
*/
|
|
18
|
-
declare class LanggraphZodMetaRegistry<Meta extends SchemaMeta = SchemaMeta, Schema extends $ZodType = $ZodType> extends $ZodRegistry<Meta & {
|
|
19
|
-
[key: string]: unknown;
|
|
20
|
-
}, Schema> {
|
|
21
|
-
protected parent: SchemaMetaRegistry;
|
|
22
|
-
/**
|
|
23
|
-
* Creates a new LanggraphZodMetaRegistry instance.
|
|
24
|
-
*
|
|
25
|
-
* @param parent - The base SchemaMetaRegistry to use for metadata storage.
|
|
26
|
-
*/
|
|
27
|
-
constructor(parent: SchemaMetaRegistry);
|
|
28
|
-
add<S extends Schema>(schema: S, ..._meta: undefined extends Meta & {
|
|
29
|
-
[key: string]: unknown;
|
|
30
|
-
} ? [$replace<Meta & {
|
|
31
|
-
[key: string]: unknown;
|
|
32
|
-
}, S>?] : [$replace<Meta & {
|
|
33
|
-
[key: string]: unknown;
|
|
34
|
-
}, S>]): this;
|
|
35
|
-
}
|
|
36
|
-
// Augment the zod/v4 module nudging the `register` method
|
|
37
|
-
// to use the user provided input schema if specified.
|
|
38
|
-
declare module "zod/v4" {
|
|
39
|
-
interface ZodType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> extends core.$ZodType<Output, Input, Internals> {
|
|
40
|
-
register<R extends LanggraphZodMetaRegistry, TOutput = core.output<this>, TInput = core.input<this>, TInternals extends core.$ZodTypeInternals<TOutput, TInput> = core.$ZodTypeInternals<TOutput, TInput>>(registry: R, meta: SchemaMeta<TOutput, TInput>): ReducedZodChannel<this, ZodType<TOutput, TInput, TInternals>>;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
declare module "zod/v4-mini" {
|
|
44
|
-
interface ZodMiniType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> extends core.$ZodType<Output, Input, Internals> {
|
|
45
|
-
register<R extends LanggraphZodMetaRegistry, TOutput = core.output<this>, TInput = core.input<this>, TInternals extends core.$ZodTypeInternals<TOutput, TInput> = core.$ZodTypeInternals<TOutput, TInput>>(registry: R, meta: SchemaMeta<TOutput, TInput>): ReducedZodChannel<this, ZodMiniType<TOutput, TInput, TInternals>>;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
declare const registry: LanggraphZodMetaRegistry<SchemaMeta<any, any>, $ZodType<unknown, unknown, core.$ZodTypeInternals<unknown, unknown>>>;
|
|
49
|
-
//#endregion
|
|
50
|
-
export { LanggraphZodMetaRegistry, registry };
|
|
51
|
-
//# sourceMappingURL=zod-registry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"zod-registry.d.ts","names":["core","$ZodType","$ZodRegistry","$replace","ReducedZodChannel","SchemaMeta","SchemaMetaRegistry","LanggraphZodMetaRegistry","Meta","Schema","S","_0","Output","Input","$ZodTypeInternals","Internals","output","input","TOutput","TInput","R","TInternals","ZodType","sideEffect","ZodMiniType","registry"],"sources":["../../../src/graph/zod/zod-registry.d.ts"],"sourcesContent":["import type * as core from \"zod/v4/core\";\nimport { $ZodType, $ZodRegistry, $replace } from \"zod/v4/core\";\nimport { type ReducedZodChannel, type SchemaMeta, type SchemaMetaRegistry } from \"./meta.js\";\n/**\n * A Zod v4-compatible meta registry that extends the base registry.\n *\n * This registry allows you to associate and retrieve metadata for Zod schemas,\n * leveraging the base registry for storage. It is compatible with Zod v4 and\n * interoperates with the base registry to ensure consistent metadata management\n * across different Zod versions.\n *\n * @template Meta - The type of metadata associated with each schema.\n * @template Schema - The Zod schema type.\n */\nexport declare class LanggraphZodMetaRegistry<Meta extends SchemaMeta = SchemaMeta, Schema extends $ZodType = $ZodType> extends $ZodRegistry<Meta & {\n [key: string]: unknown;\n}, Schema> {\n protected parent: SchemaMetaRegistry;\n /**\n * Creates a new LanggraphZodMetaRegistry instance.\n *\n * @param parent - The base SchemaMetaRegistry to use for metadata storage.\n */\n constructor(parent: SchemaMetaRegistry);\n add<S extends Schema>(schema: S, ..._meta: undefined extends Meta & {\n [key: string]: unknown;\n } ? [$replace<Meta & {\n [key: string]: unknown;\n }, S>?] : [$replace<Meta & {\n [key: string]: unknown;\n }, S>]): this;\n}\n// Augment the zod/v4 module nudging the `register` method\n// to use the user provided input schema if specified.\ndeclare module \"zod/v4\" {\n interface ZodType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> extends core.$ZodType<Output, Input, Internals> {\n register<R extends LanggraphZodMetaRegistry, TOutput = core.output<this>, TInput = core.input<this>, TInternals extends core.$ZodTypeInternals<TOutput, TInput> = core.$ZodTypeInternals<TOutput, TInput>>(registry: R, meta: SchemaMeta<TOutput, TInput>): ReducedZodChannel<this, ZodType<TOutput, TInput, TInternals>>;\n }\n}\ndeclare module \"zod/v4-mini\" {\n interface ZodMiniType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> extends core.$ZodType<Output, Input, Internals> {\n register<R extends LanggraphZodMetaRegistry, TOutput = core.output<this>, TInput = core.input<this>, TInternals extends core.$ZodTypeInternals<TOutput, TInput> = core.$ZodTypeInternals<TOutput, TInput>>(registry: R, meta: SchemaMeta<TOutput, TInput>): ReducedZodChannel<this, ZodMiniType<TOutput, TInput, TInternals>>;\n }\n}\n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