@mastra/server 0.10.8 → 0.10.9-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/dist/_tsup-dts-rollup.d.cts +18 -3
- package/dist/_tsup-dts-rollup.d.ts +18 -3
- package/dist/{chunk-RQ2Z56EC.cjs → chunk-3DKDT264.cjs} +9 -9
- package/dist/{chunk-PMUATKV2.js → chunk-4QBIUKVY.js} +3 -3
- package/dist/{chunk-TO5U6HW3.cjs → chunk-7524QH7G.cjs} +76 -28
- package/dist/{chunk-N2YBMSO2.js → chunk-7GQJAMTA.js} +7 -7
- package/dist/{chunk-QLG2PFHE.js → chunk-BOXE6WSV.js} +1 -1
- package/dist/{chunk-BFOA2QQY.js → chunk-BP24Z4WG.js} +1 -1
- package/dist/{chunk-GKM45O24.cjs → chunk-BWHGBV3K.cjs} +12 -12
- package/dist/{chunk-IMBY5XUG.cjs → chunk-CNVDCLSY.cjs} +4 -4
- package/dist/{chunk-XR7VJOOP.js → chunk-DFJUGWNU.js} +2 -2
- package/dist/{chunk-VPNDC2DI.cjs → chunk-DPRB3R7Y.cjs} +5 -5
- package/dist/{chunk-CPPYMJX5.cjs → chunk-FGGMQCPP.cjs} +10 -10
- package/dist/{chunk-55DOQLP6.js → chunk-FVMGZKFD.js} +1 -1
- package/dist/{chunk-R5VGYBV6.js → chunk-G37NVEDX.js} +1 -1
- package/dist/{chunk-WJY57THV.cjs → chunk-L3N7ST2Z.cjs} +5 -5
- package/dist/{chunk-MN6F4D5A.cjs → chunk-LI436ITD.cjs} +107 -69
- package/dist/{chunk-XUIJ7WRT.js → chunk-LTJNMM2Y.js} +1 -1
- package/dist/{chunk-OSZM4EAY.js → chunk-MEGCYGBU.js} +108 -70
- package/dist/{chunk-64U3UDTH.cjs → chunk-MTR2B27E.cjs} +2 -1
- package/dist/{chunk-M5ABIP7D.js → chunk-QDOJJCS4.js} +2 -1
- package/dist/{chunk-4DTDPTQC.cjs → chunk-TGZIR6AK.cjs} +18 -18
- package/dist/{chunk-BNEY4P4P.cjs → chunk-TVBPFPTN.cjs} +7 -7
- package/dist/{chunk-B4MQFJ7G.cjs → chunk-ULFULEW4.cjs} +2 -2
- package/dist/{chunk-C7564HUT.js → chunk-VMXLEF54.js} +1 -1
- package/dist/{chunk-SOBBILUG.js → chunk-Z5TH5F35.js} +58 -11
- package/dist/server/handlers/agents.cjs +7 -7
- package/dist/server/handlers/agents.js +1 -1
- package/dist/server/handlers/error.cjs +2 -2
- package/dist/server/handlers/error.js +1 -1
- package/dist/server/handlers/legacyWorkflows.cjs +11 -11
- package/dist/server/handlers/legacyWorkflows.js +1 -1
- package/dist/server/handlers/logs.cjs +4 -4
- package/dist/server/handlers/logs.js +1 -1
- package/dist/server/handlers/memory.cjs +9 -9
- package/dist/server/handlers/memory.js +1 -1
- package/dist/server/handlers/network.cjs +5 -5
- package/dist/server/handlers/network.js +1 -1
- package/dist/server/handlers/telemetry.cjs +3 -3
- package/dist/server/handlers/telemetry.js +1 -1
- package/dist/server/handlers/tools.cjs +5 -5
- package/dist/server/handlers/tools.js +1 -1
- package/dist/server/handlers/vNextNetwork.cjs +30 -12
- package/dist/server/handlers/vNextNetwork.js +20 -2
- package/dist/server/handlers/vector.cjs +7 -7
- package/dist/server/handlers/vector.js +1 -1
- package/dist/server/handlers/voice.cjs +5 -5
- package/dist/server/handlers/voice.js +1 -1
- package/dist/server/handlers/workflows.cjs +17 -13
- package/dist/server/handlers/workflows.d.cts +1 -0
- package/dist/server/handlers/workflows.d.ts +1 -0
- package/dist/server/handlers/workflows.js +1 -1
- package/dist/server/handlers.cjs +20 -20
- package/dist/server/handlers.js +10 -10
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunk57CJTIPW_cjs = require('./chunk-57CJTIPW.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkMTR2B27E_cjs = require('./chunk-MTR2B27E.cjs');
|
|
5
5
|
var chunkOCWPVYNI_cjs = require('./chunk-OCWPVYNI.cjs');
|
|
6
6
|
var chunk75ZPJI57_cjs = require('./chunk-75ZPJI57.cjs');
|
|
7
7
|
|
|
@@ -47,7 +47,7 @@ async function getNetworksHandler({
|
|
|
47
47
|
);
|
|
48
48
|
return serializedNetworks;
|
|
49
49
|
} catch (error) {
|
|
50
|
-
return
|
|
50
|
+
return chunkMTR2B27E_cjs.handleError(error, "Error getting networks");
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
async function getNetworkByIdHandler({
|
|
@@ -88,7 +88,7 @@ async function getNetworkByIdHandler({
|
|
|
88
88
|
};
|
|
89
89
|
return serializedNetwork;
|
|
90
90
|
} catch (error) {
|
|
91
|
-
return
|
|
91
|
+
return chunkMTR2B27E_cjs.handleError(error, "Error getting network by ID");
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
async function generateHandler({
|
|
@@ -107,7 +107,7 @@ async function generateHandler({
|
|
|
107
107
|
const result = await network.generate(messages, { ...rest, runtimeContext });
|
|
108
108
|
return result;
|
|
109
109
|
} catch (error) {
|
|
110
|
-
return
|
|
110
|
+
return chunkMTR2B27E_cjs.handleError(error, "Error generating from network");
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
async function streamGenerateHandler({
|
|
@@ -137,7 +137,7 @@ async function streamGenerateHandler({
|
|
|
137
137
|
});
|
|
138
138
|
return streamResponse;
|
|
139
139
|
} catch (error) {
|
|
140
|
-
return
|
|
140
|
+
return chunkMTR2B27E_cjs.handleError(error, "Error streaming from network");
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkLI436ITD_cjs = require('./chunk-LI436ITD.cjs');
|
|
4
4
|
var chunk57CJTIPW_cjs = require('./chunk-57CJTIPW.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkMTR2B27E_cjs = require('./chunk-MTR2B27E.cjs');
|
|
6
6
|
var chunkOCWPVYNI_cjs = require('./chunk-OCWPVYNI.cjs');
|
|
7
7
|
var chunk75ZPJI57_cjs = require('./chunk-75ZPJI57.cjs');
|
|
8
8
|
var tools = require('@mastra/core/tools');
|
|
@@ -25,8 +25,8 @@ async function getToolsHandler({ tools }) {
|
|
|
25
25
|
const tool = _tool;
|
|
26
26
|
acc[id] = {
|
|
27
27
|
...tool,
|
|
28
|
-
inputSchema: tool.inputSchema ?
|
|
29
|
-
outputSchema: tool.outputSchema ?
|
|
28
|
+
inputSchema: tool.inputSchema ? chunkLI436ITD_cjs.stringify(chunkLI436ITD_cjs.esm_default(tool.inputSchema)) : void 0,
|
|
29
|
+
outputSchema: tool.outputSchema ? chunkLI436ITD_cjs.stringify(chunkLI436ITD_cjs.esm_default(tool.outputSchema)) : void 0
|
|
30
30
|
};
|
|
31
31
|
return acc;
|
|
32
32
|
},
|
|
@@ -34,7 +34,7 @@ async function getToolsHandler({ tools }) {
|
|
|
34
34
|
);
|
|
35
35
|
return serializedTools;
|
|
36
36
|
} catch (error) {
|
|
37
|
-
return
|
|
37
|
+
return chunkMTR2B27E_cjs.handleError(error, "Error getting tools");
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
async function getToolByIdHandler({ tools, toolId }) {
|
|
@@ -45,12 +45,12 @@ async function getToolByIdHandler({ tools, toolId }) {
|
|
|
45
45
|
}
|
|
46
46
|
const serializedTool = {
|
|
47
47
|
...tool,
|
|
48
|
-
inputSchema: tool.inputSchema ?
|
|
49
|
-
outputSchema: tool.outputSchema ?
|
|
48
|
+
inputSchema: tool.inputSchema ? chunkLI436ITD_cjs.stringify(chunkLI436ITD_cjs.esm_default(tool.inputSchema)) : void 0,
|
|
49
|
+
outputSchema: tool.outputSchema ? chunkLI436ITD_cjs.stringify(chunkLI436ITD_cjs.esm_default(tool.outputSchema)) : void 0
|
|
50
50
|
};
|
|
51
51
|
return serializedTool;
|
|
52
52
|
} catch (error) {
|
|
53
|
-
return
|
|
53
|
+
return chunkMTR2B27E_cjs.handleError(error, "Error getting tool");
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
function executeToolHandler(tools$1) {
|
|
@@ -85,7 +85,7 @@ function executeToolHandler(tools$1) {
|
|
|
85
85
|
});
|
|
86
86
|
return result;
|
|
87
87
|
} catch (error) {
|
|
88
|
-
return
|
|
88
|
+
return chunkMTR2B27E_cjs.handleError(error, "Error executing tool");
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
91
|
}
|
|
@@ -117,7 +117,7 @@ async function executeAgentToolHandler({
|
|
|
117
117
|
});
|
|
118
118
|
return result;
|
|
119
119
|
} catch (error) {
|
|
120
|
-
return
|
|
120
|
+
return chunkMTR2B27E_cjs.handleError(error, "Error executing tool");
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { validateBody } from './chunk-H5PTF3Y4.js';
|
|
2
|
-
import { handleError } from './chunk-
|
|
2
|
+
import { handleError } from './chunk-QDOJJCS4.js';
|
|
3
3
|
import { HTTPException } from './chunk-NYN7KFXL.js';
|
|
4
4
|
import { __export } from './chunk-MLKGABMK.js';
|
|
5
5
|
import { Readable } from 'stream';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunk57CJTIPW_cjs = require('./chunk-57CJTIPW.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkMTR2B27E_cjs = require('./chunk-MTR2B27E.cjs');
|
|
5
5
|
var chunkOCWPVYNI_cjs = require('./chunk-OCWPVYNI.cjs');
|
|
6
6
|
var chunk75ZPJI57_cjs = require('./chunk-75ZPJI57.cjs');
|
|
7
7
|
var stream = require('stream');
|
|
@@ -30,7 +30,7 @@ async function getSpeakersHandler({ mastra, agentId }) {
|
|
|
30
30
|
const speakers = await voice.getSpeakers();
|
|
31
31
|
return speakers;
|
|
32
32
|
} catch (error) {
|
|
33
|
-
return
|
|
33
|
+
return chunkMTR2B27E_cjs.handleError(error, "Error getting speakers");
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
async function generateSpeechHandler({
|
|
@@ -59,7 +59,7 @@ async function generateSpeechHandler({
|
|
|
59
59
|
}
|
|
60
60
|
return audioStream;
|
|
61
61
|
} catch (error) {
|
|
62
|
-
return
|
|
62
|
+
return chunkMTR2B27E_cjs.handleError(error, "Error generating speech");
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
async function transcribeSpeechHandler({
|
|
@@ -88,7 +88,7 @@ async function transcribeSpeechHandler({
|
|
|
88
88
|
const text = await voice.listen(audioStream, body.options);
|
|
89
89
|
return { text };
|
|
90
90
|
} catch (error) {
|
|
91
|
-
return
|
|
91
|
+
return chunkMTR2B27E_cjs.handleError(error, "Error transcribing speech");
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
async function getListenerHandler({ mastra, agentId }) {
|
|
@@ -107,7 +107,7 @@ async function getListenerHandler({ mastra, agentId }) {
|
|
|
107
107
|
const listeners = await voice.getListener();
|
|
108
108
|
return listeners;
|
|
109
109
|
} catch (error) {
|
|
110
|
-
return
|
|
110
|
+
return chunkMTR2B27E_cjs.handleError(error, "Error getting listeners");
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
|
|
@@ -766,7 +766,7 @@ SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJS
|
|
|
766
766
|
SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);
|
|
767
767
|
var stringify = SuperJSON.stringify;
|
|
768
768
|
|
|
769
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
769
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/Options.js
|
|
770
770
|
var ignoreOverride = Symbol("Let zodToJsonSchema decide on which parser to use");
|
|
771
771
|
var defaultOptions = {
|
|
772
772
|
name: void 0,
|
|
@@ -789,7 +789,8 @@ var defaultOptions = {
|
|
|
789
789
|
applyRegexFlags: false,
|
|
790
790
|
emailStrategy: "format:email",
|
|
791
791
|
base64Strategy: "contentEncoding:base64",
|
|
792
|
-
nameStrategy: "ref"
|
|
792
|
+
nameStrategy: "ref",
|
|
793
|
+
openAiAnyTypeName: "OpenAiAnyType"
|
|
793
794
|
};
|
|
794
795
|
var getDefaultOptions = (options) => typeof options === "string" ? {
|
|
795
796
|
...defaultOptions,
|
|
@@ -799,12 +800,13 @@ var getDefaultOptions = (options) => typeof options === "string" ? {
|
|
|
799
800
|
...options
|
|
800
801
|
};
|
|
801
802
|
|
|
802
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
803
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/Refs.js
|
|
803
804
|
var getRefs = (options) => {
|
|
804
805
|
const _options = getDefaultOptions(options);
|
|
805
806
|
const currentPath = _options.name !== void 0 ? [..._options.basePath, _options.definitionPath, _options.name] : _options.basePath;
|
|
806
807
|
return {
|
|
807
808
|
..._options,
|
|
809
|
+
flags: { hasReferencedOpenAiAnyType: false },
|
|
808
810
|
currentPath,
|
|
809
811
|
propertyPath: void 0,
|
|
810
812
|
seen: new Map(Object.entries(_options.definitions).map(([name, def]) => [
|
|
@@ -819,7 +821,7 @@ var getRefs = (options) => {
|
|
|
819
821
|
};
|
|
820
822
|
};
|
|
821
823
|
|
|
822
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
824
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/errorMessages.js
|
|
823
825
|
function addErrorMessage(res, key, errorMessage, refs) {
|
|
824
826
|
if (!refs?.errorMessages)
|
|
825
827
|
return;
|
|
@@ -835,9 +837,30 @@ function setResponseValueAndErrors(res, key, value, errorMessage, refs) {
|
|
|
835
837
|
addErrorMessage(res, key, errorMessage, refs);
|
|
836
838
|
}
|
|
837
839
|
|
|
838
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
839
|
-
|
|
840
|
-
|
|
840
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js
|
|
841
|
+
var getRelativePath = (pathA, pathB) => {
|
|
842
|
+
let i = 0;
|
|
843
|
+
for (; i < pathA.length && i < pathB.length; i++) {
|
|
844
|
+
if (pathA[i] !== pathB[i])
|
|
845
|
+
break;
|
|
846
|
+
}
|
|
847
|
+
return [(pathA.length - i).toString(), ...pathB.slice(i)].join("/");
|
|
848
|
+
};
|
|
849
|
+
|
|
850
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/any.js
|
|
851
|
+
function parseAnyDef(refs) {
|
|
852
|
+
if (refs.target !== "openAi") {
|
|
853
|
+
return {};
|
|
854
|
+
}
|
|
855
|
+
const anyDefinitionPath = [
|
|
856
|
+
...refs.basePath,
|
|
857
|
+
refs.definitionPath,
|
|
858
|
+
refs.openAiAnyTypeName
|
|
859
|
+
];
|
|
860
|
+
refs.flags.hasReferencedOpenAiAnyType = true;
|
|
861
|
+
return {
|
|
862
|
+
$ref: refs.$refStrategy === "relative" ? getRelativePath(anyDefinitionPath, refs.currentPath) : anyDefinitionPath.join("/")
|
|
863
|
+
};
|
|
841
864
|
}
|
|
842
865
|
function parseArrayDef(def, refs) {
|
|
843
866
|
const res = {
|
|
@@ -862,7 +885,7 @@ function parseArrayDef(def, refs) {
|
|
|
862
885
|
return res;
|
|
863
886
|
}
|
|
864
887
|
|
|
865
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
888
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
|
|
866
889
|
function parseBigintDef(def, refs) {
|
|
867
890
|
const res = {
|
|
868
891
|
type: "integer",
|
|
@@ -908,24 +931,24 @@ function parseBigintDef(def, refs) {
|
|
|
908
931
|
return res;
|
|
909
932
|
}
|
|
910
933
|
|
|
911
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
934
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
|
|
912
935
|
function parseBooleanDef() {
|
|
913
936
|
return {
|
|
914
937
|
type: "boolean"
|
|
915
938
|
};
|
|
916
939
|
}
|
|
917
940
|
|
|
918
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
941
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
|
|
919
942
|
function parseBrandedDef(_def, refs) {
|
|
920
943
|
return parseDef(_def.type._def, refs);
|
|
921
944
|
}
|
|
922
945
|
|
|
923
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
946
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
|
|
924
947
|
var parseCatchDef = (def, refs) => {
|
|
925
948
|
return parseDef(def.innerType._def, refs);
|
|
926
949
|
};
|
|
927
950
|
|
|
928
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
951
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/date.js
|
|
929
952
|
function parseDateDef(def, refs, overrideDateStrategy) {
|
|
930
953
|
const strategy = overrideDateStrategy ?? refs.dateStrategy;
|
|
931
954
|
if (Array.isArray(strategy)) {
|
|
@@ -984,7 +1007,7 @@ var integerDateParser = (def, refs) => {
|
|
|
984
1007
|
return res;
|
|
985
1008
|
};
|
|
986
1009
|
|
|
987
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1010
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/default.js
|
|
988
1011
|
function parseDefaultDef(_def, refs) {
|
|
989
1012
|
return {
|
|
990
1013
|
...parseDef(_def.innerType._def, refs),
|
|
@@ -992,12 +1015,12 @@ function parseDefaultDef(_def, refs) {
|
|
|
992
1015
|
};
|
|
993
1016
|
}
|
|
994
1017
|
|
|
995
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1018
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
|
|
996
1019
|
function parseEffectsDef(_def, refs) {
|
|
997
|
-
return refs.effectStrategy === "input" ? parseDef(_def.schema._def, refs) :
|
|
1020
|
+
return refs.effectStrategy === "input" ? parseDef(_def.schema._def, refs) : parseAnyDef(refs);
|
|
998
1021
|
}
|
|
999
1022
|
|
|
1000
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1023
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
|
|
1001
1024
|
function parseEnumDef(def) {
|
|
1002
1025
|
return {
|
|
1003
1026
|
type: "string",
|
|
@@ -1005,7 +1028,7 @@ function parseEnumDef(def) {
|
|
|
1005
1028
|
};
|
|
1006
1029
|
}
|
|
1007
1030
|
|
|
1008
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1031
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
|
|
1009
1032
|
var isJsonSchema7AllOfType = (type) => {
|
|
1010
1033
|
if ("type" in type && type.type === "string")
|
|
1011
1034
|
return false;
|
|
@@ -1047,7 +1070,7 @@ function parseIntersectionDef(def, refs) {
|
|
|
1047
1070
|
} : void 0;
|
|
1048
1071
|
}
|
|
1049
1072
|
|
|
1050
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1073
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
|
|
1051
1074
|
function parseLiteralDef(def, refs) {
|
|
1052
1075
|
const parsedType = typeof def.value;
|
|
1053
1076
|
if (parsedType !== "bigint" && parsedType !== "number" && parsedType !== "boolean" && parsedType !== "string") {
|
|
@@ -1067,7 +1090,7 @@ function parseLiteralDef(def, refs) {
|
|
|
1067
1090
|
};
|
|
1068
1091
|
}
|
|
1069
1092
|
|
|
1070
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1093
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
|
|
1071
1094
|
var emojiRegex = void 0;
|
|
1072
1095
|
var zodPatterns = {
|
|
1073
1096
|
/**
|
|
@@ -1379,7 +1402,7 @@ function stringifyRegExpWithFlags(regex, refs) {
|
|
|
1379
1402
|
return pattern;
|
|
1380
1403
|
}
|
|
1381
1404
|
|
|
1382
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1405
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
|
|
1383
1406
|
function parseRecordDef(def, refs) {
|
|
1384
1407
|
if (refs.target === "openAi") {
|
|
1385
1408
|
console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
|
|
@@ -1393,7 +1416,7 @@ function parseRecordDef(def, refs) {
|
|
|
1393
1416
|
[key]: parseDef(def.valueType._def, {
|
|
1394
1417
|
...refs,
|
|
1395
1418
|
currentPath: [...refs.currentPath, "properties", key]
|
|
1396
|
-
}) ??
|
|
1419
|
+
}) ?? parseAnyDef(refs)
|
|
1397
1420
|
}), {}),
|
|
1398
1421
|
additionalProperties: refs.rejectedAdditionalProperties
|
|
1399
1422
|
};
|
|
@@ -1431,7 +1454,7 @@ function parseRecordDef(def, refs) {
|
|
|
1431
1454
|
return schema;
|
|
1432
1455
|
}
|
|
1433
1456
|
|
|
1434
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1457
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/map.js
|
|
1435
1458
|
function parseMapDef(def, refs) {
|
|
1436
1459
|
if (refs.mapStrategy === "record") {
|
|
1437
1460
|
return parseRecordDef(def, refs);
|
|
@@ -1439,11 +1462,11 @@ function parseMapDef(def, refs) {
|
|
|
1439
1462
|
const keys = parseDef(def.keyType._def, {
|
|
1440
1463
|
...refs,
|
|
1441
1464
|
currentPath: [...refs.currentPath, "items", "items", "0"]
|
|
1442
|
-
}) ||
|
|
1465
|
+
}) || parseAnyDef(refs);
|
|
1443
1466
|
const values = parseDef(def.valueType._def, {
|
|
1444
1467
|
...refs,
|
|
1445
1468
|
currentPath: [...refs.currentPath, "items", "items", "1"]
|
|
1446
|
-
}) ||
|
|
1469
|
+
}) || parseAnyDef(refs);
|
|
1447
1470
|
return {
|
|
1448
1471
|
type: "array",
|
|
1449
1472
|
maxItems: 125,
|
|
@@ -1456,7 +1479,7 @@ function parseMapDef(def, refs) {
|
|
|
1456
1479
|
};
|
|
1457
1480
|
}
|
|
1458
1481
|
|
|
1459
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1482
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
|
|
1460
1483
|
function parseNativeEnumDef(def) {
|
|
1461
1484
|
const object = def.values;
|
|
1462
1485
|
const actualKeys = Object.keys(def.values).filter((key) => {
|
|
@@ -1470,14 +1493,17 @@ function parseNativeEnumDef(def) {
|
|
|
1470
1493
|
};
|
|
1471
1494
|
}
|
|
1472
1495
|
|
|
1473
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1474
|
-
function parseNeverDef() {
|
|
1475
|
-
return {
|
|
1476
|
-
not: {
|
|
1496
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/never.js
|
|
1497
|
+
function parseNeverDef(refs) {
|
|
1498
|
+
return refs.target === "openAi" ? void 0 : {
|
|
1499
|
+
not: parseAnyDef({
|
|
1500
|
+
...refs,
|
|
1501
|
+
currentPath: [...refs.currentPath, "not"]
|
|
1502
|
+
})
|
|
1477
1503
|
};
|
|
1478
1504
|
}
|
|
1479
1505
|
|
|
1480
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1506
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/null.js
|
|
1481
1507
|
function parseNullDef(refs) {
|
|
1482
1508
|
return refs.target === "openApi3" ? {
|
|
1483
1509
|
enum: ["null"],
|
|
@@ -1487,7 +1513,7 @@ function parseNullDef(refs) {
|
|
|
1487
1513
|
};
|
|
1488
1514
|
}
|
|
1489
1515
|
|
|
1490
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1516
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/union.js
|
|
1491
1517
|
var primitiveMappings = {
|
|
1492
1518
|
ZodString: "string",
|
|
1493
1519
|
ZodNumber: "number",
|
|
@@ -1555,7 +1581,7 @@ var asAnyOf = (def, refs) => {
|
|
|
1555
1581
|
return anyOf.length ? { anyOf } : void 0;
|
|
1556
1582
|
};
|
|
1557
1583
|
|
|
1558
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1584
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
|
|
1559
1585
|
function parseNullableDef(def, refs) {
|
|
1560
1586
|
if (["ZodString", "ZodNumber", "ZodBigInt", "ZodBoolean", "ZodNull"].includes(def.innerType._def.typeName) && (!def.innerType._def.checks || !def.innerType._def.checks.length)) {
|
|
1561
1587
|
if (refs.target === "openApi3") {
|
|
@@ -1587,7 +1613,7 @@ function parseNullableDef(def, refs) {
|
|
|
1587
1613
|
return base && { anyOf: [base, { type: "null" }] };
|
|
1588
1614
|
}
|
|
1589
1615
|
|
|
1590
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1616
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/number.js
|
|
1591
1617
|
function parseNumberDef(def, refs) {
|
|
1592
1618
|
const res = {
|
|
1593
1619
|
type: "number"
|
|
@@ -1635,6 +1661,8 @@ function parseNumberDef(def, refs) {
|
|
|
1635
1661
|
}
|
|
1636
1662
|
return res;
|
|
1637
1663
|
}
|
|
1664
|
+
|
|
1665
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/object.js
|
|
1638
1666
|
function parseObjectDef(def, refs) {
|
|
1639
1667
|
const forceOptionalIntoNullable = refs.target === "openAi";
|
|
1640
1668
|
const result = {
|
|
@@ -1650,7 +1678,7 @@ function parseObjectDef(def, refs) {
|
|
|
1650
1678
|
}
|
|
1651
1679
|
let propOptional = safeIsOptional(propDef);
|
|
1652
1680
|
if (propOptional && forceOptionalIntoNullable) {
|
|
1653
|
-
if (propDef
|
|
1681
|
+
if (propDef._def.typeName === "ZodOptional") {
|
|
1654
1682
|
propDef = propDef._def.innerType;
|
|
1655
1683
|
}
|
|
1656
1684
|
if (!propDef.isNullable()) {
|
|
@@ -1704,7 +1732,7 @@ function safeIsOptional(schema) {
|
|
|
1704
1732
|
}
|
|
1705
1733
|
}
|
|
1706
1734
|
|
|
1707
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1735
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
|
|
1708
1736
|
var parseOptionalDef = (def, refs) => {
|
|
1709
1737
|
if (refs.currentPath.toString() === refs.propertyPath?.toString()) {
|
|
1710
1738
|
return parseDef(def.innerType._def, refs);
|
|
@@ -1716,14 +1744,14 @@ var parseOptionalDef = (def, refs) => {
|
|
|
1716
1744
|
return innerSchema ? {
|
|
1717
1745
|
anyOf: [
|
|
1718
1746
|
{
|
|
1719
|
-
not:
|
|
1747
|
+
not: parseAnyDef(refs)
|
|
1720
1748
|
},
|
|
1721
1749
|
innerSchema
|
|
1722
1750
|
]
|
|
1723
|
-
} :
|
|
1751
|
+
} : parseAnyDef(refs);
|
|
1724
1752
|
};
|
|
1725
1753
|
|
|
1726
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1754
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js
|
|
1727
1755
|
var parsePipelineDef = (def, refs) => {
|
|
1728
1756
|
if (refs.pipeStrategy === "input") {
|
|
1729
1757
|
return parseDef(def.in._def, refs);
|
|
@@ -1743,12 +1771,12 @@ var parsePipelineDef = (def, refs) => {
|
|
|
1743
1771
|
};
|
|
1744
1772
|
};
|
|
1745
1773
|
|
|
1746
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1774
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
|
|
1747
1775
|
function parsePromiseDef(def, refs) {
|
|
1748
1776
|
return parseDef(def.type._def, refs);
|
|
1749
1777
|
}
|
|
1750
1778
|
|
|
1751
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1779
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/set.js
|
|
1752
1780
|
function parseSetDef(def, refs) {
|
|
1753
1781
|
const items = parseDef(def.valueType._def, {
|
|
1754
1782
|
...refs,
|
|
@@ -1768,7 +1796,7 @@ function parseSetDef(def, refs) {
|
|
|
1768
1796
|
return schema;
|
|
1769
1797
|
}
|
|
1770
1798
|
|
|
1771
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1799
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
|
|
1772
1800
|
function parseTupleDef(def, refs) {
|
|
1773
1801
|
if (def.rest) {
|
|
1774
1802
|
return {
|
|
@@ -1796,24 +1824,24 @@ function parseTupleDef(def, refs) {
|
|
|
1796
1824
|
}
|
|
1797
1825
|
}
|
|
1798
1826
|
|
|
1799
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1800
|
-
function parseUndefinedDef() {
|
|
1827
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
|
|
1828
|
+
function parseUndefinedDef(refs) {
|
|
1801
1829
|
return {
|
|
1802
|
-
not:
|
|
1830
|
+
not: parseAnyDef(refs)
|
|
1803
1831
|
};
|
|
1804
1832
|
}
|
|
1805
1833
|
|
|
1806
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1807
|
-
function parseUnknownDef() {
|
|
1808
|
-
return
|
|
1834
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
|
|
1835
|
+
function parseUnknownDef(refs) {
|
|
1836
|
+
return parseAnyDef(refs);
|
|
1809
1837
|
}
|
|
1810
1838
|
|
|
1811
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1839
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
|
|
1812
1840
|
var parseReadonlyDef = (def, refs) => {
|
|
1813
1841
|
return parseDef(def.innerType._def, refs);
|
|
1814
1842
|
};
|
|
1815
1843
|
|
|
1816
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1844
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/selectParser.js
|
|
1817
1845
|
var selectParser = (def, typeName, refs) => {
|
|
1818
1846
|
switch (typeName) {
|
|
1819
1847
|
case zod.ZodFirstPartyTypeKind.ZodString:
|
|
@@ -1829,7 +1857,7 @@ var selectParser = (def, typeName, refs) => {
|
|
|
1829
1857
|
case zod.ZodFirstPartyTypeKind.ZodDate:
|
|
1830
1858
|
return parseDateDef(def, refs);
|
|
1831
1859
|
case zod.ZodFirstPartyTypeKind.ZodUndefined:
|
|
1832
|
-
return parseUndefinedDef();
|
|
1860
|
+
return parseUndefinedDef(refs);
|
|
1833
1861
|
case zod.ZodFirstPartyTypeKind.ZodNull:
|
|
1834
1862
|
return parseNullDef(refs);
|
|
1835
1863
|
case zod.ZodFirstPartyTypeKind.ZodArray:
|
|
@@ -1863,13 +1891,13 @@ var selectParser = (def, typeName, refs) => {
|
|
|
1863
1891
|
return parsePromiseDef(def, refs);
|
|
1864
1892
|
case zod.ZodFirstPartyTypeKind.ZodNaN:
|
|
1865
1893
|
case zod.ZodFirstPartyTypeKind.ZodNever:
|
|
1866
|
-
return parseNeverDef();
|
|
1894
|
+
return parseNeverDef(refs);
|
|
1867
1895
|
case zod.ZodFirstPartyTypeKind.ZodEffects:
|
|
1868
1896
|
return parseEffectsDef(def, refs);
|
|
1869
1897
|
case zod.ZodFirstPartyTypeKind.ZodAny:
|
|
1870
|
-
return parseAnyDef();
|
|
1898
|
+
return parseAnyDef(refs);
|
|
1871
1899
|
case zod.ZodFirstPartyTypeKind.ZodUnknown:
|
|
1872
|
-
return parseUnknownDef();
|
|
1900
|
+
return parseUnknownDef(refs);
|
|
1873
1901
|
case zod.ZodFirstPartyTypeKind.ZodDefault:
|
|
1874
1902
|
return parseDefaultDef(def, refs);
|
|
1875
1903
|
case zod.ZodFirstPartyTypeKind.ZodBranded:
|
|
@@ -1889,7 +1917,7 @@ var selectParser = (def, typeName, refs) => {
|
|
|
1889
1917
|
}
|
|
1890
1918
|
};
|
|
1891
1919
|
|
|
1892
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1920
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parseDef.js
|
|
1893
1921
|
function parseDef(def, refs, forceResolution = false) {
|
|
1894
1922
|
const seenItem = refs.seen.get(def);
|
|
1895
1923
|
if (refs.override) {
|
|
@@ -1929,20 +1957,12 @@ var get$ref = (item, refs) => {
|
|
|
1929
1957
|
case "seen": {
|
|
1930
1958
|
if (item.path.length < refs.currentPath.length && item.path.every((value, index) => refs.currentPath[index] === value)) {
|
|
1931
1959
|
console.warn(`Recursive reference detected at ${refs.currentPath.join("/")}! Defaulting to any`);
|
|
1932
|
-
return
|
|
1960
|
+
return parseAnyDef(refs);
|
|
1933
1961
|
}
|
|
1934
|
-
return refs.$refStrategy === "seen" ?
|
|
1962
|
+
return refs.$refStrategy === "seen" ? parseAnyDef(refs) : void 0;
|
|
1935
1963
|
}
|
|
1936
1964
|
}
|
|
1937
1965
|
};
|
|
1938
|
-
var getRelativePath = (pathA, pathB) => {
|
|
1939
|
-
let i = 0;
|
|
1940
|
-
for (; i < pathA.length && i < pathB.length; i++) {
|
|
1941
|
-
if (pathA[i] !== pathB[i])
|
|
1942
|
-
break;
|
|
1943
|
-
}
|
|
1944
|
-
return [(pathA.length - i).toString(), ...pathB.slice(i)].join("/");
|
|
1945
|
-
};
|
|
1946
1966
|
var addMeta = (def, refs, jsonSchema) => {
|
|
1947
1967
|
if (def.description) {
|
|
1948
1968
|
jsonSchema.description = def.description;
|
|
@@ -1953,25 +1973,43 @@ var addMeta = (def, refs, jsonSchema) => {
|
|
|
1953
1973
|
return jsonSchema;
|
|
1954
1974
|
};
|
|
1955
1975
|
|
|
1956
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1976
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
|
|
1957
1977
|
var zodToJsonSchema = (schema, options) => {
|
|
1958
1978
|
const refs = getRefs(options);
|
|
1959
|
-
|
|
1979
|
+
let definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce((acc, [name2, schema2]) => ({
|
|
1960
1980
|
...acc,
|
|
1961
1981
|
[name2]: parseDef(schema2._def, {
|
|
1962
1982
|
...refs,
|
|
1963
1983
|
currentPath: [...refs.basePath, refs.definitionPath, name2]
|
|
1964
|
-
}, true) ??
|
|
1984
|
+
}, true) ?? parseAnyDef(refs)
|
|
1965
1985
|
}), {}) : void 0;
|
|
1966
1986
|
const name = typeof options === "string" ? options : options?.nameStrategy === "title" ? void 0 : options?.name;
|
|
1967
1987
|
const main = parseDef(schema._def, name === void 0 ? refs : {
|
|
1968
1988
|
...refs,
|
|
1969
1989
|
currentPath: [...refs.basePath, refs.definitionPath, name]
|
|
1970
|
-
}, false) ??
|
|
1990
|
+
}, false) ?? parseAnyDef(refs);
|
|
1971
1991
|
const title = typeof options === "object" && options.name !== void 0 && options.nameStrategy === "title" ? options.name : void 0;
|
|
1972
1992
|
if (title !== void 0) {
|
|
1973
1993
|
main.title = title;
|
|
1974
1994
|
}
|
|
1995
|
+
if (refs.flags.hasReferencedOpenAiAnyType) {
|
|
1996
|
+
if (!definitions) {
|
|
1997
|
+
definitions = {};
|
|
1998
|
+
}
|
|
1999
|
+
if (!definitions[refs.openAiAnyTypeName]) {
|
|
2000
|
+
definitions[refs.openAiAnyTypeName] = {
|
|
2001
|
+
// Skipping "object" as no properties can be defined and additionalProperties must be "false"
|
|
2002
|
+
type: ["string", "number", "integer", "boolean", "array", "null"],
|
|
2003
|
+
items: {
|
|
2004
|
+
$ref: refs.$refStrategy === "relative" ? "1" : [
|
|
2005
|
+
...refs.basePath,
|
|
2006
|
+
refs.definitionPath,
|
|
2007
|
+
refs.openAiAnyTypeName
|
|
2008
|
+
].join("/")
|
|
2009
|
+
}
|
|
2010
|
+
};
|
|
2011
|
+
}
|
|
2012
|
+
}
|
|
1975
2013
|
const combined = name === void 0 ? definitions ? {
|
|
1976
2014
|
...main,
|
|
1977
2015
|
[refs.definitionPath]: definitions
|
|
@@ -1997,7 +2035,7 @@ var zodToJsonSchema = (schema, options) => {
|
|
|
1997
2035
|
return combined;
|
|
1998
2036
|
};
|
|
1999
2037
|
|
|
2000
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
2038
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/index.js
|
|
2001
2039
|
var esm_default = zodToJsonSchema;
|
|
2002
2040
|
|
|
2003
2041
|
exports.esm_default = esm_default;
|