@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,4 +1,4 @@
|
|
|
1
|
-
import { ZodFirstPartyTypeKind
|
|
1
|
+
import { ZodFirstPartyTypeKind } from 'zod';
|
|
2
2
|
|
|
3
3
|
// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/double-indexed-kv.js
|
|
4
4
|
var DoubleIndexedKV = class {
|
|
@@ -764,7 +764,7 @@ SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJS
|
|
|
764
764
|
SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);
|
|
765
765
|
var stringify = SuperJSON.stringify;
|
|
766
766
|
|
|
767
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
767
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/Options.js
|
|
768
768
|
var ignoreOverride = Symbol("Let zodToJsonSchema decide on which parser to use");
|
|
769
769
|
var defaultOptions = {
|
|
770
770
|
name: void 0,
|
|
@@ -787,7 +787,8 @@ var defaultOptions = {
|
|
|
787
787
|
applyRegexFlags: false,
|
|
788
788
|
emailStrategy: "format:email",
|
|
789
789
|
base64Strategy: "contentEncoding:base64",
|
|
790
|
-
nameStrategy: "ref"
|
|
790
|
+
nameStrategy: "ref",
|
|
791
|
+
openAiAnyTypeName: "OpenAiAnyType"
|
|
791
792
|
};
|
|
792
793
|
var getDefaultOptions = (options) => typeof options === "string" ? {
|
|
793
794
|
...defaultOptions,
|
|
@@ -797,12 +798,13 @@ var getDefaultOptions = (options) => typeof options === "string" ? {
|
|
|
797
798
|
...options
|
|
798
799
|
};
|
|
799
800
|
|
|
800
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
801
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/Refs.js
|
|
801
802
|
var getRefs = (options) => {
|
|
802
803
|
const _options = getDefaultOptions(options);
|
|
803
804
|
const currentPath = _options.name !== void 0 ? [..._options.basePath, _options.definitionPath, _options.name] : _options.basePath;
|
|
804
805
|
return {
|
|
805
806
|
..._options,
|
|
807
|
+
flags: { hasReferencedOpenAiAnyType: false },
|
|
806
808
|
currentPath,
|
|
807
809
|
propertyPath: void 0,
|
|
808
810
|
seen: new Map(Object.entries(_options.definitions).map(([name, def]) => [
|
|
@@ -817,7 +819,7 @@ var getRefs = (options) => {
|
|
|
817
819
|
};
|
|
818
820
|
};
|
|
819
821
|
|
|
820
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
822
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/errorMessages.js
|
|
821
823
|
function addErrorMessage(res, key, errorMessage, refs) {
|
|
822
824
|
if (!refs?.errorMessages)
|
|
823
825
|
return;
|
|
@@ -833,9 +835,30 @@ function setResponseValueAndErrors(res, key, value, errorMessage, refs) {
|
|
|
833
835
|
addErrorMessage(res, key, errorMessage, refs);
|
|
834
836
|
}
|
|
835
837
|
|
|
836
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
837
|
-
|
|
838
|
-
|
|
838
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js
|
|
839
|
+
var getRelativePath = (pathA, pathB) => {
|
|
840
|
+
let i = 0;
|
|
841
|
+
for (; i < pathA.length && i < pathB.length; i++) {
|
|
842
|
+
if (pathA[i] !== pathB[i])
|
|
843
|
+
break;
|
|
844
|
+
}
|
|
845
|
+
return [(pathA.length - i).toString(), ...pathB.slice(i)].join("/");
|
|
846
|
+
};
|
|
847
|
+
|
|
848
|
+
// ../../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
|
|
849
|
+
function parseAnyDef(refs) {
|
|
850
|
+
if (refs.target !== "openAi") {
|
|
851
|
+
return {};
|
|
852
|
+
}
|
|
853
|
+
const anyDefinitionPath = [
|
|
854
|
+
...refs.basePath,
|
|
855
|
+
refs.definitionPath,
|
|
856
|
+
refs.openAiAnyTypeName
|
|
857
|
+
];
|
|
858
|
+
refs.flags.hasReferencedOpenAiAnyType = true;
|
|
859
|
+
return {
|
|
860
|
+
$ref: refs.$refStrategy === "relative" ? getRelativePath(anyDefinitionPath, refs.currentPath) : anyDefinitionPath.join("/")
|
|
861
|
+
};
|
|
839
862
|
}
|
|
840
863
|
function parseArrayDef(def, refs) {
|
|
841
864
|
const res = {
|
|
@@ -860,7 +883,7 @@ function parseArrayDef(def, refs) {
|
|
|
860
883
|
return res;
|
|
861
884
|
}
|
|
862
885
|
|
|
863
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
886
|
+
// ../../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
|
|
864
887
|
function parseBigintDef(def, refs) {
|
|
865
888
|
const res = {
|
|
866
889
|
type: "integer",
|
|
@@ -906,24 +929,24 @@ function parseBigintDef(def, refs) {
|
|
|
906
929
|
return res;
|
|
907
930
|
}
|
|
908
931
|
|
|
909
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
932
|
+
// ../../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
|
|
910
933
|
function parseBooleanDef() {
|
|
911
934
|
return {
|
|
912
935
|
type: "boolean"
|
|
913
936
|
};
|
|
914
937
|
}
|
|
915
938
|
|
|
916
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
939
|
+
// ../../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
|
|
917
940
|
function parseBrandedDef(_def, refs) {
|
|
918
941
|
return parseDef(_def.type._def, refs);
|
|
919
942
|
}
|
|
920
943
|
|
|
921
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
944
|
+
// ../../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
|
|
922
945
|
var parseCatchDef = (def, refs) => {
|
|
923
946
|
return parseDef(def.innerType._def, refs);
|
|
924
947
|
};
|
|
925
948
|
|
|
926
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
949
|
+
// ../../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
|
|
927
950
|
function parseDateDef(def, refs, overrideDateStrategy) {
|
|
928
951
|
const strategy = overrideDateStrategy ?? refs.dateStrategy;
|
|
929
952
|
if (Array.isArray(strategy)) {
|
|
@@ -982,7 +1005,7 @@ var integerDateParser = (def, refs) => {
|
|
|
982
1005
|
return res;
|
|
983
1006
|
};
|
|
984
1007
|
|
|
985
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1008
|
+
// ../../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
|
|
986
1009
|
function parseDefaultDef(_def, refs) {
|
|
987
1010
|
return {
|
|
988
1011
|
...parseDef(_def.innerType._def, refs),
|
|
@@ -990,12 +1013,12 @@ function parseDefaultDef(_def, refs) {
|
|
|
990
1013
|
};
|
|
991
1014
|
}
|
|
992
1015
|
|
|
993
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1016
|
+
// ../../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
|
|
994
1017
|
function parseEffectsDef(_def, refs) {
|
|
995
|
-
return refs.effectStrategy === "input" ? parseDef(_def.schema._def, refs) :
|
|
1018
|
+
return refs.effectStrategy === "input" ? parseDef(_def.schema._def, refs) : parseAnyDef(refs);
|
|
996
1019
|
}
|
|
997
1020
|
|
|
998
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1021
|
+
// ../../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
|
|
999
1022
|
function parseEnumDef(def) {
|
|
1000
1023
|
return {
|
|
1001
1024
|
type: "string",
|
|
@@ -1003,7 +1026,7 @@ function parseEnumDef(def) {
|
|
|
1003
1026
|
};
|
|
1004
1027
|
}
|
|
1005
1028
|
|
|
1006
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1029
|
+
// ../../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
|
|
1007
1030
|
var isJsonSchema7AllOfType = (type) => {
|
|
1008
1031
|
if ("type" in type && type.type === "string")
|
|
1009
1032
|
return false;
|
|
@@ -1045,7 +1068,7 @@ function parseIntersectionDef(def, refs) {
|
|
|
1045
1068
|
} : void 0;
|
|
1046
1069
|
}
|
|
1047
1070
|
|
|
1048
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1071
|
+
// ../../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
|
|
1049
1072
|
function parseLiteralDef(def, refs) {
|
|
1050
1073
|
const parsedType = typeof def.value;
|
|
1051
1074
|
if (parsedType !== "bigint" && parsedType !== "number" && parsedType !== "boolean" && parsedType !== "string") {
|
|
@@ -1065,7 +1088,7 @@ function parseLiteralDef(def, refs) {
|
|
|
1065
1088
|
};
|
|
1066
1089
|
}
|
|
1067
1090
|
|
|
1068
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1091
|
+
// ../../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
|
|
1069
1092
|
var emojiRegex = void 0;
|
|
1070
1093
|
var zodPatterns = {
|
|
1071
1094
|
/**
|
|
@@ -1377,7 +1400,7 @@ function stringifyRegExpWithFlags(regex, refs) {
|
|
|
1377
1400
|
return pattern;
|
|
1378
1401
|
}
|
|
1379
1402
|
|
|
1380
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1403
|
+
// ../../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
|
|
1381
1404
|
function parseRecordDef(def, refs) {
|
|
1382
1405
|
if (refs.target === "openAi") {
|
|
1383
1406
|
console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
|
|
@@ -1391,7 +1414,7 @@ function parseRecordDef(def, refs) {
|
|
|
1391
1414
|
[key]: parseDef(def.valueType._def, {
|
|
1392
1415
|
...refs,
|
|
1393
1416
|
currentPath: [...refs.currentPath, "properties", key]
|
|
1394
|
-
}) ??
|
|
1417
|
+
}) ?? parseAnyDef(refs)
|
|
1395
1418
|
}), {}),
|
|
1396
1419
|
additionalProperties: refs.rejectedAdditionalProperties
|
|
1397
1420
|
};
|
|
@@ -1429,7 +1452,7 @@ function parseRecordDef(def, refs) {
|
|
|
1429
1452
|
return schema;
|
|
1430
1453
|
}
|
|
1431
1454
|
|
|
1432
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1455
|
+
// ../../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
|
|
1433
1456
|
function parseMapDef(def, refs) {
|
|
1434
1457
|
if (refs.mapStrategy === "record") {
|
|
1435
1458
|
return parseRecordDef(def, refs);
|
|
@@ -1437,11 +1460,11 @@ function parseMapDef(def, refs) {
|
|
|
1437
1460
|
const keys = parseDef(def.keyType._def, {
|
|
1438
1461
|
...refs,
|
|
1439
1462
|
currentPath: [...refs.currentPath, "items", "items", "0"]
|
|
1440
|
-
}) ||
|
|
1463
|
+
}) || parseAnyDef(refs);
|
|
1441
1464
|
const values = parseDef(def.valueType._def, {
|
|
1442
1465
|
...refs,
|
|
1443
1466
|
currentPath: [...refs.currentPath, "items", "items", "1"]
|
|
1444
|
-
}) ||
|
|
1467
|
+
}) || parseAnyDef(refs);
|
|
1445
1468
|
return {
|
|
1446
1469
|
type: "array",
|
|
1447
1470
|
maxItems: 125,
|
|
@@ -1454,7 +1477,7 @@ function parseMapDef(def, refs) {
|
|
|
1454
1477
|
};
|
|
1455
1478
|
}
|
|
1456
1479
|
|
|
1457
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1480
|
+
// ../../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
|
|
1458
1481
|
function parseNativeEnumDef(def) {
|
|
1459
1482
|
const object = def.values;
|
|
1460
1483
|
const actualKeys = Object.keys(def.values).filter((key) => {
|
|
@@ -1468,14 +1491,17 @@ function parseNativeEnumDef(def) {
|
|
|
1468
1491
|
};
|
|
1469
1492
|
}
|
|
1470
1493
|
|
|
1471
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1472
|
-
function parseNeverDef() {
|
|
1473
|
-
return {
|
|
1474
|
-
not: {
|
|
1494
|
+
// ../../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
|
|
1495
|
+
function parseNeverDef(refs) {
|
|
1496
|
+
return refs.target === "openAi" ? void 0 : {
|
|
1497
|
+
not: parseAnyDef({
|
|
1498
|
+
...refs,
|
|
1499
|
+
currentPath: [...refs.currentPath, "not"]
|
|
1500
|
+
})
|
|
1475
1501
|
};
|
|
1476
1502
|
}
|
|
1477
1503
|
|
|
1478
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1504
|
+
// ../../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
|
|
1479
1505
|
function parseNullDef(refs) {
|
|
1480
1506
|
return refs.target === "openApi3" ? {
|
|
1481
1507
|
enum: ["null"],
|
|
@@ -1485,7 +1511,7 @@ function parseNullDef(refs) {
|
|
|
1485
1511
|
};
|
|
1486
1512
|
}
|
|
1487
1513
|
|
|
1488
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1514
|
+
// ../../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
|
|
1489
1515
|
var primitiveMappings = {
|
|
1490
1516
|
ZodString: "string",
|
|
1491
1517
|
ZodNumber: "number",
|
|
@@ -1553,7 +1579,7 @@ var asAnyOf = (def, refs) => {
|
|
|
1553
1579
|
return anyOf.length ? { anyOf } : void 0;
|
|
1554
1580
|
};
|
|
1555
1581
|
|
|
1556
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1582
|
+
// ../../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
|
|
1557
1583
|
function parseNullableDef(def, refs) {
|
|
1558
1584
|
if (["ZodString", "ZodNumber", "ZodBigInt", "ZodBoolean", "ZodNull"].includes(def.innerType._def.typeName) && (!def.innerType._def.checks || !def.innerType._def.checks.length)) {
|
|
1559
1585
|
if (refs.target === "openApi3") {
|
|
@@ -1585,7 +1611,7 @@ function parseNullableDef(def, refs) {
|
|
|
1585
1611
|
return base && { anyOf: [base, { type: "null" }] };
|
|
1586
1612
|
}
|
|
1587
1613
|
|
|
1588
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1614
|
+
// ../../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
|
|
1589
1615
|
function parseNumberDef(def, refs) {
|
|
1590
1616
|
const res = {
|
|
1591
1617
|
type: "number"
|
|
@@ -1633,6 +1659,8 @@ function parseNumberDef(def, refs) {
|
|
|
1633
1659
|
}
|
|
1634
1660
|
return res;
|
|
1635
1661
|
}
|
|
1662
|
+
|
|
1663
|
+
// ../../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
|
|
1636
1664
|
function parseObjectDef(def, refs) {
|
|
1637
1665
|
const forceOptionalIntoNullable = refs.target === "openAi";
|
|
1638
1666
|
const result = {
|
|
@@ -1648,7 +1676,7 @@ function parseObjectDef(def, refs) {
|
|
|
1648
1676
|
}
|
|
1649
1677
|
let propOptional = safeIsOptional(propDef);
|
|
1650
1678
|
if (propOptional && forceOptionalIntoNullable) {
|
|
1651
|
-
if (propDef
|
|
1679
|
+
if (propDef._def.typeName === "ZodOptional") {
|
|
1652
1680
|
propDef = propDef._def.innerType;
|
|
1653
1681
|
}
|
|
1654
1682
|
if (!propDef.isNullable()) {
|
|
@@ -1702,7 +1730,7 @@ function safeIsOptional(schema) {
|
|
|
1702
1730
|
}
|
|
1703
1731
|
}
|
|
1704
1732
|
|
|
1705
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1733
|
+
// ../../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
|
|
1706
1734
|
var parseOptionalDef = (def, refs) => {
|
|
1707
1735
|
if (refs.currentPath.toString() === refs.propertyPath?.toString()) {
|
|
1708
1736
|
return parseDef(def.innerType._def, refs);
|
|
@@ -1714,14 +1742,14 @@ var parseOptionalDef = (def, refs) => {
|
|
|
1714
1742
|
return innerSchema ? {
|
|
1715
1743
|
anyOf: [
|
|
1716
1744
|
{
|
|
1717
|
-
not:
|
|
1745
|
+
not: parseAnyDef(refs)
|
|
1718
1746
|
},
|
|
1719
1747
|
innerSchema
|
|
1720
1748
|
]
|
|
1721
|
-
} :
|
|
1749
|
+
} : parseAnyDef(refs);
|
|
1722
1750
|
};
|
|
1723
1751
|
|
|
1724
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1752
|
+
// ../../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
|
|
1725
1753
|
var parsePipelineDef = (def, refs) => {
|
|
1726
1754
|
if (refs.pipeStrategy === "input") {
|
|
1727
1755
|
return parseDef(def.in._def, refs);
|
|
@@ -1741,12 +1769,12 @@ var parsePipelineDef = (def, refs) => {
|
|
|
1741
1769
|
};
|
|
1742
1770
|
};
|
|
1743
1771
|
|
|
1744
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1772
|
+
// ../../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
|
|
1745
1773
|
function parsePromiseDef(def, refs) {
|
|
1746
1774
|
return parseDef(def.type._def, refs);
|
|
1747
1775
|
}
|
|
1748
1776
|
|
|
1749
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1777
|
+
// ../../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
|
|
1750
1778
|
function parseSetDef(def, refs) {
|
|
1751
1779
|
const items = parseDef(def.valueType._def, {
|
|
1752
1780
|
...refs,
|
|
@@ -1766,7 +1794,7 @@ function parseSetDef(def, refs) {
|
|
|
1766
1794
|
return schema;
|
|
1767
1795
|
}
|
|
1768
1796
|
|
|
1769
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1797
|
+
// ../../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
|
|
1770
1798
|
function parseTupleDef(def, refs) {
|
|
1771
1799
|
if (def.rest) {
|
|
1772
1800
|
return {
|
|
@@ -1794,24 +1822,24 @@ function parseTupleDef(def, refs) {
|
|
|
1794
1822
|
}
|
|
1795
1823
|
}
|
|
1796
1824
|
|
|
1797
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1798
|
-
function parseUndefinedDef() {
|
|
1825
|
+
// ../../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
|
|
1826
|
+
function parseUndefinedDef(refs) {
|
|
1799
1827
|
return {
|
|
1800
|
-
not:
|
|
1828
|
+
not: parseAnyDef(refs)
|
|
1801
1829
|
};
|
|
1802
1830
|
}
|
|
1803
1831
|
|
|
1804
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1805
|
-
function parseUnknownDef() {
|
|
1806
|
-
return
|
|
1832
|
+
// ../../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
|
|
1833
|
+
function parseUnknownDef(refs) {
|
|
1834
|
+
return parseAnyDef(refs);
|
|
1807
1835
|
}
|
|
1808
1836
|
|
|
1809
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1837
|
+
// ../../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
|
|
1810
1838
|
var parseReadonlyDef = (def, refs) => {
|
|
1811
1839
|
return parseDef(def.innerType._def, refs);
|
|
1812
1840
|
};
|
|
1813
1841
|
|
|
1814
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1842
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/selectParser.js
|
|
1815
1843
|
var selectParser = (def, typeName, refs) => {
|
|
1816
1844
|
switch (typeName) {
|
|
1817
1845
|
case ZodFirstPartyTypeKind.ZodString:
|
|
@@ -1827,7 +1855,7 @@ var selectParser = (def, typeName, refs) => {
|
|
|
1827
1855
|
case ZodFirstPartyTypeKind.ZodDate:
|
|
1828
1856
|
return parseDateDef(def, refs);
|
|
1829
1857
|
case ZodFirstPartyTypeKind.ZodUndefined:
|
|
1830
|
-
return parseUndefinedDef();
|
|
1858
|
+
return parseUndefinedDef(refs);
|
|
1831
1859
|
case ZodFirstPartyTypeKind.ZodNull:
|
|
1832
1860
|
return parseNullDef(refs);
|
|
1833
1861
|
case ZodFirstPartyTypeKind.ZodArray:
|
|
@@ -1861,13 +1889,13 @@ var selectParser = (def, typeName, refs) => {
|
|
|
1861
1889
|
return parsePromiseDef(def, refs);
|
|
1862
1890
|
case ZodFirstPartyTypeKind.ZodNaN:
|
|
1863
1891
|
case ZodFirstPartyTypeKind.ZodNever:
|
|
1864
|
-
return parseNeverDef();
|
|
1892
|
+
return parseNeverDef(refs);
|
|
1865
1893
|
case ZodFirstPartyTypeKind.ZodEffects:
|
|
1866
1894
|
return parseEffectsDef(def, refs);
|
|
1867
1895
|
case ZodFirstPartyTypeKind.ZodAny:
|
|
1868
|
-
return parseAnyDef();
|
|
1896
|
+
return parseAnyDef(refs);
|
|
1869
1897
|
case ZodFirstPartyTypeKind.ZodUnknown:
|
|
1870
|
-
return parseUnknownDef();
|
|
1898
|
+
return parseUnknownDef(refs);
|
|
1871
1899
|
case ZodFirstPartyTypeKind.ZodDefault:
|
|
1872
1900
|
return parseDefaultDef(def, refs);
|
|
1873
1901
|
case ZodFirstPartyTypeKind.ZodBranded:
|
|
@@ -1887,7 +1915,7 @@ var selectParser = (def, typeName, refs) => {
|
|
|
1887
1915
|
}
|
|
1888
1916
|
};
|
|
1889
1917
|
|
|
1890
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1918
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parseDef.js
|
|
1891
1919
|
function parseDef(def, refs, forceResolution = false) {
|
|
1892
1920
|
const seenItem = refs.seen.get(def);
|
|
1893
1921
|
if (refs.override) {
|
|
@@ -1927,20 +1955,12 @@ var get$ref = (item, refs) => {
|
|
|
1927
1955
|
case "seen": {
|
|
1928
1956
|
if (item.path.length < refs.currentPath.length && item.path.every((value, index) => refs.currentPath[index] === value)) {
|
|
1929
1957
|
console.warn(`Recursive reference detected at ${refs.currentPath.join("/")}! Defaulting to any`);
|
|
1930
|
-
return
|
|
1958
|
+
return parseAnyDef(refs);
|
|
1931
1959
|
}
|
|
1932
|
-
return refs.$refStrategy === "seen" ?
|
|
1960
|
+
return refs.$refStrategy === "seen" ? parseAnyDef(refs) : void 0;
|
|
1933
1961
|
}
|
|
1934
1962
|
}
|
|
1935
1963
|
};
|
|
1936
|
-
var getRelativePath = (pathA, pathB) => {
|
|
1937
|
-
let i = 0;
|
|
1938
|
-
for (; i < pathA.length && i < pathB.length; i++) {
|
|
1939
|
-
if (pathA[i] !== pathB[i])
|
|
1940
|
-
break;
|
|
1941
|
-
}
|
|
1942
|
-
return [(pathA.length - i).toString(), ...pathB.slice(i)].join("/");
|
|
1943
|
-
};
|
|
1944
1964
|
var addMeta = (def, refs, jsonSchema) => {
|
|
1945
1965
|
if (def.description) {
|
|
1946
1966
|
jsonSchema.description = def.description;
|
|
@@ -1951,25 +1971,43 @@ var addMeta = (def, refs, jsonSchema) => {
|
|
|
1951
1971
|
return jsonSchema;
|
|
1952
1972
|
};
|
|
1953
1973
|
|
|
1954
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
1974
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
|
|
1955
1975
|
var zodToJsonSchema = (schema, options) => {
|
|
1956
1976
|
const refs = getRefs(options);
|
|
1957
|
-
|
|
1977
|
+
let definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce((acc, [name2, schema2]) => ({
|
|
1958
1978
|
...acc,
|
|
1959
1979
|
[name2]: parseDef(schema2._def, {
|
|
1960
1980
|
...refs,
|
|
1961
1981
|
currentPath: [...refs.basePath, refs.definitionPath, name2]
|
|
1962
|
-
}, true) ??
|
|
1982
|
+
}, true) ?? parseAnyDef(refs)
|
|
1963
1983
|
}), {}) : void 0;
|
|
1964
1984
|
const name = typeof options === "string" ? options : options?.nameStrategy === "title" ? void 0 : options?.name;
|
|
1965
1985
|
const main = parseDef(schema._def, name === void 0 ? refs : {
|
|
1966
1986
|
...refs,
|
|
1967
1987
|
currentPath: [...refs.basePath, refs.definitionPath, name]
|
|
1968
|
-
}, false) ??
|
|
1988
|
+
}, false) ?? parseAnyDef(refs);
|
|
1969
1989
|
const title = typeof options === "object" && options.name !== void 0 && options.nameStrategy === "title" ? options.name : void 0;
|
|
1970
1990
|
if (title !== void 0) {
|
|
1971
1991
|
main.title = title;
|
|
1972
1992
|
}
|
|
1993
|
+
if (refs.flags.hasReferencedOpenAiAnyType) {
|
|
1994
|
+
if (!definitions) {
|
|
1995
|
+
definitions = {};
|
|
1996
|
+
}
|
|
1997
|
+
if (!definitions[refs.openAiAnyTypeName]) {
|
|
1998
|
+
definitions[refs.openAiAnyTypeName] = {
|
|
1999
|
+
// Skipping "object" as no properties can be defined and additionalProperties must be "false"
|
|
2000
|
+
type: ["string", "number", "integer", "boolean", "array", "null"],
|
|
2001
|
+
items: {
|
|
2002
|
+
$ref: refs.$refStrategy === "relative" ? "1" : [
|
|
2003
|
+
...refs.basePath,
|
|
2004
|
+
refs.definitionPath,
|
|
2005
|
+
refs.openAiAnyTypeName
|
|
2006
|
+
].join("/")
|
|
2007
|
+
}
|
|
2008
|
+
};
|
|
2009
|
+
}
|
|
2010
|
+
}
|
|
1973
2011
|
const combined = name === void 0 ? definitions ? {
|
|
1974
2012
|
...main,
|
|
1975
2013
|
[refs.definitionPath]: definitions
|
|
@@ -1995,7 +2033,7 @@ var zodToJsonSchema = (schema, options) => {
|
|
|
1995
2033
|
return combined;
|
|
1996
2034
|
};
|
|
1997
2035
|
|
|
1998
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.
|
|
2036
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/index.js
|
|
1999
2037
|
var esm_default = zodToJsonSchema;
|
|
2000
2038
|
|
|
2001
2039
|
export { esm_default, stringify };
|
|
@@ -5,7 +5,8 @@ var chunkOCWPVYNI_cjs = require('./chunk-OCWPVYNI.cjs');
|
|
|
5
5
|
// src/server/handlers/error.ts
|
|
6
6
|
function handleError(error, defaultMessage) {
|
|
7
7
|
const apiError = error;
|
|
8
|
-
|
|
8
|
+
const apiErrorStatus = apiError.status || apiError.details?.status || 500;
|
|
9
|
+
throw new chunkOCWPVYNI_cjs.HTTPException(apiErrorStatus, {
|
|
9
10
|
message: apiError.message || defaultMessage
|
|
10
11
|
});
|
|
11
12
|
}
|
|
@@ -3,7 +3,8 @@ import { HTTPException } from './chunk-NYN7KFXL.js';
|
|
|
3
3
|
// src/server/handlers/error.ts
|
|
4
4
|
function handleError(error, defaultMessage) {
|
|
5
5
|
const apiError = error;
|
|
6
|
-
|
|
6
|
+
const apiErrorStatus = apiError.status || apiError.details?.status || 500;
|
|
7
|
+
throw new HTTPException(apiErrorStatus, {
|
|
7
8
|
message: apiError.message || defaultMessage
|
|
8
9
|
});
|
|
9
10
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkLI436ITD_cjs = require('./chunk-LI436ITD.cjs');
|
|
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 web = require('stream/web');
|
|
@@ -31,15 +31,15 @@ async function getLegacyWorkflowsHandler({ mastra }) {
|
|
|
31
31
|
serializedStepGraph: workflow.serializedStepGraph,
|
|
32
32
|
serializedStepSubscriberGraph: workflow.serializedStepSubscriberGraph,
|
|
33
33
|
name: workflow.name,
|
|
34
|
-
triggerSchema: workflow.triggerSchema ?
|
|
34
|
+
triggerSchema: workflow.triggerSchema ? chunkLI436ITD_cjs.stringify(chunkLI436ITD_cjs.esm_default(workflow.triggerSchema)) : void 0,
|
|
35
35
|
steps: Object.entries(workflow.steps).reduce((acc2, [key2, step]) => {
|
|
36
36
|
const _step = step;
|
|
37
37
|
acc2[key2] = {
|
|
38
38
|
id: _step.id,
|
|
39
39
|
description: _step.description,
|
|
40
40
|
workflowId: _step.workflowId,
|
|
41
|
-
inputSchema: _step.inputSchema ?
|
|
42
|
-
outputSchema: _step.outputSchema ?
|
|
41
|
+
inputSchema: _step.inputSchema ? chunkLI436ITD_cjs.stringify(chunkLI436ITD_cjs.esm_default(_step.inputSchema)) : void 0,
|
|
42
|
+
outputSchema: _step.outputSchema ? chunkLI436ITD_cjs.stringify(chunkLI436ITD_cjs.esm_default(_step.outputSchema)) : void 0
|
|
43
43
|
};
|
|
44
44
|
return acc2;
|
|
45
45
|
}, {})
|
|
@@ -48,7 +48,7 @@ async function getLegacyWorkflowsHandler({ mastra }) {
|
|
|
48
48
|
}, {});
|
|
49
49
|
return _workflows;
|
|
50
50
|
} catch (error) {
|
|
51
|
-
|
|
51
|
+
return chunkMTR2B27E_cjs.handleError(error, "error getting workflows");
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
async function getLegacyWorkflowByIdHandler({ mastra, workflowId }) {
|
|
@@ -66,21 +66,21 @@ async function getLegacyWorkflowByIdHandler({ mastra, workflowId }) {
|
|
|
66
66
|
serializedStepGraph: workflow.serializedStepGraph,
|
|
67
67
|
serializedStepSubscriberGraph: workflow.serializedStepSubscriberGraph,
|
|
68
68
|
name: workflow.name,
|
|
69
|
-
triggerSchema: workflow.triggerSchema ?
|
|
69
|
+
triggerSchema: workflow.triggerSchema ? chunkLI436ITD_cjs.stringify(chunkLI436ITD_cjs.esm_default(workflow.triggerSchema)) : void 0,
|
|
70
70
|
steps: Object.entries(workflow.steps).reduce((acc, [key, step]) => {
|
|
71
71
|
const _step = step;
|
|
72
72
|
acc[key] = {
|
|
73
73
|
id: _step.id,
|
|
74
74
|
description: _step.description,
|
|
75
75
|
workflowId: _step.workflowId,
|
|
76
|
-
inputSchema: _step.inputSchema ?
|
|
77
|
-
outputSchema: _step.outputSchema ?
|
|
76
|
+
inputSchema: _step.inputSchema ? chunkLI436ITD_cjs.stringify(chunkLI436ITD_cjs.esm_default(_step.inputSchema)) : void 0,
|
|
77
|
+
outputSchema: _step.outputSchema ? chunkLI436ITD_cjs.stringify(chunkLI436ITD_cjs.esm_default(_step.outputSchema)) : void 0
|
|
78
78
|
};
|
|
79
79
|
return acc;
|
|
80
80
|
}, {})
|
|
81
81
|
};
|
|
82
82
|
} catch (error) {
|
|
83
|
-
|
|
83
|
+
return chunkMTR2B27E_cjs.handleError(error, "error getting workflow by id");
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
async function startAsyncLegacyWorkflowHandler({
|
|
@@ -116,7 +116,7 @@ async function startAsyncLegacyWorkflowHandler({
|
|
|
116
116
|
});
|
|
117
117
|
return result;
|
|
118
118
|
} catch (error) {
|
|
119
|
-
|
|
119
|
+
return chunkMTR2B27E_cjs.handleError(error, "error starting workflow");
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
async function getLegacyWorkflowRunHandler({
|
|
@@ -141,7 +141,7 @@ async function getLegacyWorkflowRunHandler({
|
|
|
141
141
|
}
|
|
142
142
|
return run;
|
|
143
143
|
} catch (error) {
|
|
144
|
-
|
|
144
|
+
return chunkMTR2B27E_cjs.handleError(error, "error getting workflow run");
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
async function createLegacyWorkflowRunHandler({
|
|
@@ -160,7 +160,7 @@ async function createLegacyWorkflowRunHandler({
|
|
|
160
160
|
const newRun = workflow.createRun({ runId: prevRunId });
|
|
161
161
|
return { runId: newRun.runId };
|
|
162
162
|
} catch (error) {
|
|
163
|
-
|
|
163
|
+
return chunkMTR2B27E_cjs.handleError(error, "error creating workflow run");
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
async function startLegacyWorkflowRunHandler({
|
|
@@ -188,7 +188,7 @@ async function startLegacyWorkflowRunHandler({
|
|
|
188
188
|
});
|
|
189
189
|
return { message: "Workflow run started" };
|
|
190
190
|
} catch (e) {
|
|
191
|
-
return
|
|
191
|
+
return chunkMTR2B27E_cjs.handleError(e, "Error starting workflow run");
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
async function watchLegacyWorkflowHandler({
|
|
@@ -234,7 +234,7 @@ async function watchLegacyWorkflowHandler({
|
|
|
234
234
|
});
|
|
235
235
|
return stream;
|
|
236
236
|
} catch (error) {
|
|
237
|
-
return
|
|
237
|
+
return chunkMTR2B27E_cjs.handleError(error, "Error watching workflow");
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
async function resumeAsyncLegacyWorkflowHandler({
|
|
@@ -263,7 +263,7 @@ async function resumeAsyncLegacyWorkflowHandler({
|
|
|
263
263
|
});
|
|
264
264
|
return result;
|
|
265
265
|
} catch (error) {
|
|
266
|
-
return
|
|
266
|
+
return chunkMTR2B27E_cjs.handleError(error, "Error resuming workflow step");
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
async function resumeLegacyWorkflowHandler({
|
|
@@ -292,7 +292,7 @@ async function resumeLegacyWorkflowHandler({
|
|
|
292
292
|
});
|
|
293
293
|
return { message: "Workflow run resumed" };
|
|
294
294
|
} catch (error) {
|
|
295
|
-
return
|
|
295
|
+
return chunkMTR2B27E_cjs.handleError(error, "Error resuming workflow");
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
298
|
async function getLegacyWorkflowRunsHandler({
|
|
@@ -315,7 +315,7 @@ async function getLegacyWorkflowRunsHandler({
|
|
|
315
315
|
};
|
|
316
316
|
return workflowRuns;
|
|
317
317
|
} catch (error) {
|
|
318
|
-
return
|
|
318
|
+
return chunkMTR2B27E_cjs.handleError(error, "Error getting workflow runs");
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
321
|
|