@mastra/server 0.0.0-revert-schema-20250416221206 → 0.0.0-separate-trace-data-from-component-20250501042644
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 +111 -30
- package/dist/_tsup-dts-rollup.d.ts +111 -30
- package/dist/{chunk-UE27Q3XD.cjs → chunk-4BIX6GMY.cjs} +59 -34
- package/dist/{chunk-A7DF4ETD.cjs → chunk-55HTWX4C.cjs} +2 -9
- package/dist/{chunk-UV4WTEH4.js → chunk-5JNVY6DU.js} +5 -5
- package/dist/{chunk-QH6XWSXP.cjs → chunk-5SWCVTNL.cjs} +38 -38
- package/dist/{chunk-JLDXUWK7.cjs → chunk-5YGDYMRB.cjs} +52 -31
- package/dist/chunk-AELYAUEE.cjs +316 -0
- package/dist/{chunk-PDC4ZBQW.cjs → chunk-D3G23FP3.cjs} +9 -9
- package/dist/{chunk-B64YROKU.cjs → chunk-EVCC233P.cjs} +22 -18
- package/dist/chunk-JPB6RPGB.js +304 -0
- package/dist/{chunk-OPP7H5TW.js → chunk-M3YJLWTU.js} +16 -12
- package/dist/{chunk-VK6FX47H.js → chunk-OMN3UI6X.js} +38 -38
- package/dist/{chunk-3RVHWGWO.js → chunk-Q6SHQECN.js} +2 -9
- package/dist/{chunk-YANVFOYA.js → chunk-QJ3AHN64.js} +52 -31
- package/dist/{chunk-I6MBOQTH.js → chunk-Y3SV5XK4.js} +57 -32
- package/dist/server/handlers/agents.cjs +7 -7
- package/dist/server/handlers/agents.js +1 -1
- package/dist/server/handlers/network.cjs +5 -5
- package/dist/server/handlers/network.js +1 -1
- package/dist/server/handlers/tools.cjs +5 -5
- package/dist/server/handlers/tools.js +1 -1
- package/dist/server/handlers/vNextWorkflows.cjs +46 -0
- package/dist/server/handlers/vNextWorkflows.d.cts +10 -0
- package/dist/server/handlers/vNextWorkflows.d.ts +10 -0
- package/dist/server/handlers/vNextWorkflows.js +1 -0
- package/dist/server/handlers/voice.cjs +4 -4
- package/dist/server/handlers/voice.js +1 -1
- package/dist/server/handlers/workflows.cjs +11 -11
- package/dist/server/handlers/workflows.js +1 -1
- package/dist/server/handlers.cjs +15 -10
- package/dist/server/handlers.d.cts +1 -0
- package/dist/server/handlers.d.ts +1 -0
- package/dist/server/handlers.js +6 -5
- package/package.json +5 -5
|
@@ -762,7 +762,7 @@ SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJS
|
|
|
762
762
|
SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);
|
|
763
763
|
var stringify = SuperJSON.stringify;
|
|
764
764
|
|
|
765
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
765
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/Options.js
|
|
766
766
|
var ignoreOverride = Symbol("Let zodToJsonSchema decide on which parser to use");
|
|
767
767
|
var defaultOptions = {
|
|
768
768
|
name: void 0,
|
|
@@ -795,7 +795,7 @@ var getDefaultOptions = (options) => typeof options === "string" ? {
|
|
|
795
795
|
...options
|
|
796
796
|
};
|
|
797
797
|
|
|
798
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
798
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/Refs.js
|
|
799
799
|
var getRefs = (options) => {
|
|
800
800
|
const _options = getDefaultOptions(options);
|
|
801
801
|
const currentPath = _options.name !== void 0 ? [..._options.basePath, _options.definitionPath, _options.name] : _options.basePath;
|
|
@@ -815,7 +815,7 @@ var getRefs = (options) => {
|
|
|
815
815
|
};
|
|
816
816
|
};
|
|
817
817
|
|
|
818
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
818
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/errorMessages.js
|
|
819
819
|
function addErrorMessage(res, key, errorMessage, refs) {
|
|
820
820
|
if (!refs?.errorMessages)
|
|
821
821
|
return;
|
|
@@ -831,7 +831,7 @@ function setResponseValueAndErrors(res, key, value, errorMessage, refs) {
|
|
|
831
831
|
addErrorMessage(res, key, errorMessage, refs);
|
|
832
832
|
}
|
|
833
833
|
|
|
834
|
-
// ../../node_modules/.pnpm/zod@3.24.
|
|
834
|
+
// ../../node_modules/.pnpm/zod@3.24.3/node_modules/zod/lib/index.mjs
|
|
835
835
|
var util;
|
|
836
836
|
(function(util2) {
|
|
837
837
|
util2.assertEqual = (val) => val;
|
|
@@ -4404,12 +4404,12 @@ var ZodFirstPartyTypeKind;
|
|
|
4404
4404
|
ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly";
|
|
4405
4405
|
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
|
4406
4406
|
|
|
4407
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
4407
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/any.js
|
|
4408
4408
|
function parseAnyDef() {
|
|
4409
4409
|
return {};
|
|
4410
4410
|
}
|
|
4411
4411
|
|
|
4412
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
4412
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/array.js
|
|
4413
4413
|
function parseArrayDef(def, refs) {
|
|
4414
4414
|
const res = {
|
|
4415
4415
|
type: "array"
|
|
@@ -4433,7 +4433,7 @@ function parseArrayDef(def, refs) {
|
|
|
4433
4433
|
return res;
|
|
4434
4434
|
}
|
|
4435
4435
|
|
|
4436
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
4436
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
|
|
4437
4437
|
function parseBigintDef(def, refs) {
|
|
4438
4438
|
const res = {
|
|
4439
4439
|
type: "integer",
|
|
@@ -4479,24 +4479,24 @@ function parseBigintDef(def, refs) {
|
|
|
4479
4479
|
return res;
|
|
4480
4480
|
}
|
|
4481
4481
|
|
|
4482
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
4482
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
|
|
4483
4483
|
function parseBooleanDef() {
|
|
4484
4484
|
return {
|
|
4485
4485
|
type: "boolean"
|
|
4486
4486
|
};
|
|
4487
4487
|
}
|
|
4488
4488
|
|
|
4489
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
4489
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
|
|
4490
4490
|
function parseBrandedDef(_def, refs) {
|
|
4491
4491
|
return parseDef(_def.type._def, refs);
|
|
4492
4492
|
}
|
|
4493
4493
|
|
|
4494
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
4494
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
|
|
4495
4495
|
var parseCatchDef = (def, refs) => {
|
|
4496
4496
|
return parseDef(def.innerType._def, refs);
|
|
4497
4497
|
};
|
|
4498
4498
|
|
|
4499
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
4499
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/date.js
|
|
4500
4500
|
function parseDateDef(def, refs, overrideDateStrategy) {
|
|
4501
4501
|
const strategy = overrideDateStrategy ?? refs.dateStrategy;
|
|
4502
4502
|
if (Array.isArray(strategy)) {
|
|
@@ -4555,7 +4555,7 @@ var integerDateParser = (def, refs) => {
|
|
|
4555
4555
|
return res;
|
|
4556
4556
|
};
|
|
4557
4557
|
|
|
4558
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
4558
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/default.js
|
|
4559
4559
|
function parseDefaultDef(_def, refs) {
|
|
4560
4560
|
return {
|
|
4561
4561
|
...parseDef(_def.innerType._def, refs),
|
|
@@ -4563,12 +4563,12 @@ function parseDefaultDef(_def, refs) {
|
|
|
4563
4563
|
};
|
|
4564
4564
|
}
|
|
4565
4565
|
|
|
4566
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
4566
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
|
|
4567
4567
|
function parseEffectsDef(_def, refs) {
|
|
4568
4568
|
return refs.effectStrategy === "input" ? parseDef(_def.schema._def, refs) : {};
|
|
4569
4569
|
}
|
|
4570
4570
|
|
|
4571
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
4571
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
|
|
4572
4572
|
function parseEnumDef(def) {
|
|
4573
4573
|
return {
|
|
4574
4574
|
type: "string",
|
|
@@ -4576,7 +4576,7 @@ function parseEnumDef(def) {
|
|
|
4576
4576
|
};
|
|
4577
4577
|
}
|
|
4578
4578
|
|
|
4579
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
4579
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
|
|
4580
4580
|
var isJsonSchema7AllOfType = (type) => {
|
|
4581
4581
|
if ("type" in type && type.type === "string")
|
|
4582
4582
|
return false;
|
|
@@ -4618,7 +4618,7 @@ function parseIntersectionDef(def, refs) {
|
|
|
4618
4618
|
} : void 0;
|
|
4619
4619
|
}
|
|
4620
4620
|
|
|
4621
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
4621
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
|
|
4622
4622
|
function parseLiteralDef(def, refs) {
|
|
4623
4623
|
const parsedType = typeof def.value;
|
|
4624
4624
|
if (parsedType !== "bigint" && parsedType !== "number" && parsedType !== "boolean" && parsedType !== "string") {
|
|
@@ -4638,7 +4638,7 @@ function parseLiteralDef(def, refs) {
|
|
|
4638
4638
|
};
|
|
4639
4639
|
}
|
|
4640
4640
|
|
|
4641
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
4641
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
|
|
4642
4642
|
var emojiRegex2 = void 0;
|
|
4643
4643
|
var zodPatterns = {
|
|
4644
4644
|
/**
|
|
@@ -4950,7 +4950,7 @@ function stringifyRegExpWithFlags(regex, refs) {
|
|
|
4950
4950
|
return pattern;
|
|
4951
4951
|
}
|
|
4952
4952
|
|
|
4953
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
4953
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
|
|
4954
4954
|
function parseRecordDef(def, refs) {
|
|
4955
4955
|
if (refs.target === "openAi") {
|
|
4956
4956
|
console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
|
|
@@ -5002,7 +5002,7 @@ function parseRecordDef(def, refs) {
|
|
|
5002
5002
|
return schema;
|
|
5003
5003
|
}
|
|
5004
5004
|
|
|
5005
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
5005
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/map.js
|
|
5006
5006
|
function parseMapDef(def, refs) {
|
|
5007
5007
|
if (refs.mapStrategy === "record") {
|
|
5008
5008
|
return parseRecordDef(def, refs);
|
|
@@ -5027,7 +5027,7 @@ function parseMapDef(def, refs) {
|
|
|
5027
5027
|
};
|
|
5028
5028
|
}
|
|
5029
5029
|
|
|
5030
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
5030
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
|
|
5031
5031
|
function parseNativeEnumDef(def) {
|
|
5032
5032
|
const object = def.values;
|
|
5033
5033
|
const actualKeys = Object.keys(def.values).filter((key) => {
|
|
@@ -5041,14 +5041,14 @@ function parseNativeEnumDef(def) {
|
|
|
5041
5041
|
};
|
|
5042
5042
|
}
|
|
5043
5043
|
|
|
5044
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
5044
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/never.js
|
|
5045
5045
|
function parseNeverDef() {
|
|
5046
5046
|
return {
|
|
5047
5047
|
not: {}
|
|
5048
5048
|
};
|
|
5049
5049
|
}
|
|
5050
5050
|
|
|
5051
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
5051
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/null.js
|
|
5052
5052
|
function parseNullDef(refs) {
|
|
5053
5053
|
return refs.target === "openApi3" ? {
|
|
5054
5054
|
enum: ["null"],
|
|
@@ -5058,7 +5058,7 @@ function parseNullDef(refs) {
|
|
|
5058
5058
|
};
|
|
5059
5059
|
}
|
|
5060
5060
|
|
|
5061
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
5061
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/union.js
|
|
5062
5062
|
var primitiveMappings = {
|
|
5063
5063
|
ZodString: "string",
|
|
5064
5064
|
ZodNumber: "number",
|
|
@@ -5126,7 +5126,7 @@ var asAnyOf = (def, refs) => {
|
|
|
5126
5126
|
return anyOf.length ? { anyOf } : void 0;
|
|
5127
5127
|
};
|
|
5128
5128
|
|
|
5129
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
5129
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
|
|
5130
5130
|
function parseNullableDef(def, refs) {
|
|
5131
5131
|
if (["ZodString", "ZodNumber", "ZodBigInt", "ZodBoolean", "ZodNull"].includes(def.innerType._def.typeName) && (!def.innerType._def.checks || !def.innerType._def.checks.length)) {
|
|
5132
5132
|
if (refs.target === "openApi3") {
|
|
@@ -5158,7 +5158,7 @@ function parseNullableDef(def, refs) {
|
|
|
5158
5158
|
return base && { anyOf: [base, { type: "null" }] };
|
|
5159
5159
|
}
|
|
5160
5160
|
|
|
5161
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
5161
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/number.js
|
|
5162
5162
|
function parseNumberDef(def, refs) {
|
|
5163
5163
|
const res = {
|
|
5164
5164
|
type: "number"
|
|
@@ -5207,7 +5207,7 @@ function parseNumberDef(def, refs) {
|
|
|
5207
5207
|
return res;
|
|
5208
5208
|
}
|
|
5209
5209
|
|
|
5210
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
5210
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/object.js
|
|
5211
5211
|
function parseObjectDef(def, refs) {
|
|
5212
5212
|
const forceOptionalIntoNullable = refs.target === "openAi";
|
|
5213
5213
|
const result = {
|
|
@@ -5277,7 +5277,7 @@ function safeIsOptional(schema) {
|
|
|
5277
5277
|
}
|
|
5278
5278
|
}
|
|
5279
5279
|
|
|
5280
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
5280
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
|
|
5281
5281
|
var parseOptionalDef = (def, refs) => {
|
|
5282
5282
|
if (refs.currentPath.toString() === refs.propertyPath?.toString()) {
|
|
5283
5283
|
return parseDef(def.innerType._def, refs);
|
|
@@ -5296,7 +5296,7 @@ var parseOptionalDef = (def, refs) => {
|
|
|
5296
5296
|
} : {};
|
|
5297
5297
|
};
|
|
5298
5298
|
|
|
5299
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
5299
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js
|
|
5300
5300
|
var parsePipelineDef = (def, refs) => {
|
|
5301
5301
|
if (refs.pipeStrategy === "input") {
|
|
5302
5302
|
return parseDef(def.in._def, refs);
|
|
@@ -5316,12 +5316,12 @@ var parsePipelineDef = (def, refs) => {
|
|
|
5316
5316
|
};
|
|
5317
5317
|
};
|
|
5318
5318
|
|
|
5319
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
5319
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
|
|
5320
5320
|
function parsePromiseDef(def, refs) {
|
|
5321
5321
|
return parseDef(def.type._def, refs);
|
|
5322
5322
|
}
|
|
5323
5323
|
|
|
5324
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
5324
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/set.js
|
|
5325
5325
|
function parseSetDef(def, refs) {
|
|
5326
5326
|
const items = parseDef(def.valueType._def, {
|
|
5327
5327
|
...refs,
|
|
@@ -5341,7 +5341,7 @@ function parseSetDef(def, refs) {
|
|
|
5341
5341
|
return schema;
|
|
5342
5342
|
}
|
|
5343
5343
|
|
|
5344
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
5344
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
|
|
5345
5345
|
function parseTupleDef(def, refs) {
|
|
5346
5346
|
if (def.rest) {
|
|
5347
5347
|
return {
|
|
@@ -5369,24 +5369,24 @@ function parseTupleDef(def, refs) {
|
|
|
5369
5369
|
}
|
|
5370
5370
|
}
|
|
5371
5371
|
|
|
5372
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
5372
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
|
|
5373
5373
|
function parseUndefinedDef() {
|
|
5374
5374
|
return {
|
|
5375
5375
|
not: {}
|
|
5376
5376
|
};
|
|
5377
5377
|
}
|
|
5378
5378
|
|
|
5379
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
5379
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
|
|
5380
5380
|
function parseUnknownDef() {
|
|
5381
5381
|
return {};
|
|
5382
5382
|
}
|
|
5383
5383
|
|
|
5384
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
5384
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
|
|
5385
5385
|
var parseReadonlyDef = (def, refs) => {
|
|
5386
5386
|
return parseDef(def.innerType._def, refs);
|
|
5387
5387
|
};
|
|
5388
5388
|
|
|
5389
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
5389
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/selectParser.js
|
|
5390
5390
|
var selectParser = (def, typeName, refs) => {
|
|
5391
5391
|
switch (typeName) {
|
|
5392
5392
|
case ZodFirstPartyTypeKind.ZodString:
|
|
@@ -5462,7 +5462,7 @@ var selectParser = (def, typeName, refs) => {
|
|
|
5462
5462
|
}
|
|
5463
5463
|
};
|
|
5464
5464
|
|
|
5465
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
5465
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/parseDef.js
|
|
5466
5466
|
function parseDef(def, refs, forceResolution = false) {
|
|
5467
5467
|
const seenItem = refs.seen.get(def);
|
|
5468
5468
|
if (refs.override) {
|
|
@@ -5526,7 +5526,7 @@ var addMeta = (def, refs, jsonSchema) => {
|
|
|
5526
5526
|
return jsonSchema;
|
|
5527
5527
|
};
|
|
5528
5528
|
|
|
5529
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
5529
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
|
|
5530
5530
|
var zodToJsonSchema = (schema, options) => {
|
|
5531
5531
|
const refs = getRefs(options);
|
|
5532
5532
|
const definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce((acc, [name2, schema2]) => ({
|
|
@@ -5570,7 +5570,7 @@ var zodToJsonSchema = (schema, options) => {
|
|
|
5570
5570
|
return combined;
|
|
5571
5571
|
};
|
|
5572
5572
|
|
|
5573
|
-
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.
|
|
5573
|
+
// ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.3/node_modules/zod-to-json-schema/dist/esm/index.js
|
|
5574
5574
|
var esm_default = zodToJsonSchema;
|
|
5575
5575
|
|
|
5576
5576
|
export { esm_default, stringify };
|
|
@@ -38,9 +38,7 @@ async function generateSpeechHandler({
|
|
|
38
38
|
throw new HTTPException(400, { message: "Agent ID is required" });
|
|
39
39
|
}
|
|
40
40
|
validateBody({
|
|
41
|
-
text:
|
|
42
|
-
speakerId: void 0,
|
|
43
|
-
...body
|
|
41
|
+
text: body?.text
|
|
44
42
|
});
|
|
45
43
|
const agent = mastra.getAgent(agentId);
|
|
46
44
|
if (!agent) {
|
|
@@ -53,12 +51,7 @@ async function generateSpeechHandler({
|
|
|
53
51
|
if (!audioStream) {
|
|
54
52
|
throw new HTTPException(500, { message: "Failed to generate speech" });
|
|
55
53
|
}
|
|
56
|
-
|
|
57
|
-
for await (const chunk of audioStream) {
|
|
58
|
-
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
59
|
-
}
|
|
60
|
-
const audioData = Buffer.concat(chunks);
|
|
61
|
-
return { audioData };
|
|
54
|
+
return audioStream;
|
|
62
55
|
} catch (error) {
|
|
63
56
|
return handleError(error, "Error generating speech");
|
|
64
57
|
}
|
|
@@ -10,33 +10,48 @@ __export(network_exports, {
|
|
|
10
10
|
getNetworksHandler: () => getNetworksHandler,
|
|
11
11
|
streamGenerateHandler: () => streamGenerateHandler
|
|
12
12
|
});
|
|
13
|
-
async function getNetworksHandler({
|
|
13
|
+
async function getNetworksHandler({
|
|
14
|
+
mastra,
|
|
15
|
+
runtimeContext
|
|
16
|
+
}) {
|
|
14
17
|
try {
|
|
15
18
|
const networks = mastra.getNetworks();
|
|
16
|
-
const serializedNetworks =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
const serializedNetworks = await Promise.all(
|
|
20
|
+
networks.map(async (network) => {
|
|
21
|
+
const routingAgent = network.getRoutingAgent();
|
|
22
|
+
const routingLLM = await routingAgent.getLLM({ runtimeContext });
|
|
23
|
+
const agents = network.getAgents();
|
|
24
|
+
return {
|
|
25
|
+
id: network.formatAgentId(routingAgent.name),
|
|
26
|
+
name: routingAgent.name,
|
|
27
|
+
instructions: routingAgent.instructions,
|
|
28
|
+
agents: await Promise.all(
|
|
29
|
+
agents.map(async (agent) => {
|
|
30
|
+
const llm = await agent.getLLM({ runtimeContext });
|
|
31
|
+
return {
|
|
32
|
+
name: agent.name,
|
|
33
|
+
provider: llm?.getProvider(),
|
|
34
|
+
modelId: llm?.getModelId()
|
|
35
|
+
};
|
|
36
|
+
})
|
|
37
|
+
),
|
|
38
|
+
routingModel: {
|
|
39
|
+
provider: routingLLM?.getProvider(),
|
|
40
|
+
modelId: routingLLM?.getModelId()
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
})
|
|
44
|
+
);
|
|
34
45
|
return serializedNetworks;
|
|
35
46
|
} catch (error) {
|
|
36
47
|
return handleError(error, "Error getting networks");
|
|
37
48
|
}
|
|
38
49
|
}
|
|
39
|
-
async function getNetworkByIdHandler({
|
|
50
|
+
async function getNetworkByIdHandler({
|
|
51
|
+
mastra,
|
|
52
|
+
networkId,
|
|
53
|
+
runtimeContext
|
|
54
|
+
}) {
|
|
40
55
|
try {
|
|
41
56
|
const networks = mastra.getNetworks();
|
|
42
57
|
const network = networks.find((network2) => {
|
|
@@ -47,19 +62,25 @@ async function getNetworkByIdHandler({ mastra, networkId }) {
|
|
|
47
62
|
throw new HTTPException(404, { message: "Network not found" });
|
|
48
63
|
}
|
|
49
64
|
const routingAgent = network.getRoutingAgent();
|
|
65
|
+
const routingLLM = await routingAgent.getLLM({ runtimeContext });
|
|
50
66
|
const agents = network.getAgents();
|
|
51
67
|
const serializedNetwork = {
|
|
52
68
|
id: network.formatAgentId(routingAgent.name),
|
|
53
69
|
name: routingAgent.name,
|
|
54
70
|
instructions: routingAgent.instructions,
|
|
55
|
-
agents:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
71
|
+
agents: await Promise.all(
|
|
72
|
+
agents.map(async (agent) => {
|
|
73
|
+
const llm = await agent.getLLM({ runtimeContext });
|
|
74
|
+
return {
|
|
75
|
+
name: agent.name,
|
|
76
|
+
provider: llm?.getProvider(),
|
|
77
|
+
modelId: llm?.getModelId()
|
|
78
|
+
};
|
|
79
|
+
})
|
|
80
|
+
),
|
|
60
81
|
routingModel: {
|
|
61
|
-
provider:
|
|
62
|
-
modelId:
|
|
82
|
+
provider: routingLLM?.getProvider(),
|
|
83
|
+
modelId: routingLLM?.getModelId()
|
|
63
84
|
}
|
|
64
85
|
};
|
|
65
86
|
return serializedNetwork;
|
|
@@ -69,7 +90,7 @@ async function getNetworkByIdHandler({ mastra, networkId }) {
|
|
|
69
90
|
}
|
|
70
91
|
async function generateHandler({
|
|
71
92
|
mastra,
|
|
72
|
-
|
|
93
|
+
runtimeContext,
|
|
73
94
|
networkId,
|
|
74
95
|
body
|
|
75
96
|
}) {
|
|
@@ -80,7 +101,7 @@ async function generateHandler({
|
|
|
80
101
|
}
|
|
81
102
|
validateBody({ messages: body.messages });
|
|
82
103
|
const { messages, ...rest } = body;
|
|
83
|
-
const result = await network.generate(messages, { ...rest,
|
|
104
|
+
const result = await network.generate(messages, { ...rest, runtimeContext });
|
|
84
105
|
return result;
|
|
85
106
|
} catch (error) {
|
|
86
107
|
return handleError(error, "Error generating from network");
|
|
@@ -90,7 +111,7 @@ async function streamGenerateHandler({
|
|
|
90
111
|
mastra,
|
|
91
112
|
networkId,
|
|
92
113
|
body,
|
|
93
|
-
|
|
114
|
+
runtimeContext
|
|
94
115
|
}) {
|
|
95
116
|
try {
|
|
96
117
|
const network = mastra.getNetwork(networkId);
|
|
@@ -102,7 +123,7 @@ async function streamGenerateHandler({
|
|
|
102
123
|
const streamResult = await network.stream(messages, {
|
|
103
124
|
output,
|
|
104
125
|
...rest,
|
|
105
|
-
|
|
126
|
+
runtimeContext
|
|
106
127
|
});
|
|
107
128
|
const streamResponse = output ? streamResult.toTextStreamResponse() : streamResult.toDataStreamResponse({
|
|
108
129
|
sendUsage: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { stringify, esm_default } from './chunk-
|
|
1
|
+
import { stringify, esm_default } from './chunk-OMN3UI6X.js';
|
|
2
2
|
import { validateBody } from './chunk-L7XE5QTW.js';
|
|
3
3
|
import { handleError } from './chunk-3AHQ5RGN.js';
|
|
4
4
|
import { __export, HTTPException } from './chunk-TRDNDNGQ.js';
|
|
@@ -13,27 +13,35 @@ __export(agents_exports, {
|
|
|
13
13
|
getLiveEvalsByAgentIdHandler: () => getLiveEvalsByAgentIdHandler,
|
|
14
14
|
streamGenerateHandler: () => streamGenerateHandler
|
|
15
15
|
});
|
|
16
|
-
async function getAgentsHandler({ mastra }) {
|
|
16
|
+
async function getAgentsHandler({ mastra, runtimeContext }) {
|
|
17
17
|
try {
|
|
18
18
|
const agents = mastra.getAgents();
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
const serializedAgentsMap = await Promise.all(
|
|
20
|
+
Object.entries(agents).map(async ([id, agent]) => {
|
|
21
|
+
const instructions = await agent.getInstructions({ runtimeContext });
|
|
22
|
+
const tools = await agent.getTools({ runtimeContext });
|
|
23
|
+
const llm = await agent.getLLM({ runtimeContext });
|
|
24
|
+
const serializedAgentTools = Object.entries(tools || {}).reduce((acc, [key, tool]) => {
|
|
25
|
+
const _tool = tool;
|
|
26
|
+
acc[key] = {
|
|
27
|
+
..._tool,
|
|
28
|
+
inputSchema: _tool.inputSchema ? stringify(esm_default(_tool.inputSchema)) : void 0,
|
|
29
|
+
outputSchema: _tool.outputSchema ? stringify(esm_default(_tool.outputSchema)) : void 0
|
|
30
|
+
};
|
|
31
|
+
return acc;
|
|
32
|
+
}, {});
|
|
33
|
+
return {
|
|
34
|
+
id,
|
|
35
|
+
name: agent.name,
|
|
36
|
+
instructions,
|
|
37
|
+
tools: serializedAgentTools,
|
|
38
|
+
provider: llm?.getProvider(),
|
|
39
|
+
modelId: llm?.getModelId()
|
|
27
40
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
instructions: agent.instructions,
|
|
33
|
-
tools: serializedAgentTools,
|
|
34
|
-
provider: agent.llm?.getProvider(),
|
|
35
|
-
modelId: agent.llm?.getModelId()
|
|
36
|
-
};
|
|
41
|
+
})
|
|
42
|
+
);
|
|
43
|
+
const serializedAgents = serializedAgentsMap.reduce((acc, { id, ...rest }) => {
|
|
44
|
+
acc[id] = rest;
|
|
37
45
|
return acc;
|
|
38
46
|
}, {});
|
|
39
47
|
return serializedAgents;
|
|
@@ -41,13 +49,18 @@ async function getAgentsHandler({ mastra }) {
|
|
|
41
49
|
return handleError(error, "Error getting agents");
|
|
42
50
|
}
|
|
43
51
|
}
|
|
44
|
-
async function getAgentByIdHandler({
|
|
52
|
+
async function getAgentByIdHandler({
|
|
53
|
+
mastra,
|
|
54
|
+
runtimeContext,
|
|
55
|
+
agentId
|
|
56
|
+
}) {
|
|
45
57
|
try {
|
|
46
58
|
const agent = mastra.getAgent(agentId);
|
|
47
59
|
if (!agent) {
|
|
48
60
|
throw new HTTPException(404, { message: "Agent not found" });
|
|
49
61
|
}
|
|
50
|
-
const
|
|
62
|
+
const tools = await agent.getTools({ runtimeContext });
|
|
63
|
+
const serializedAgentTools = Object.entries(tools || {}).reduce((acc, [key, tool]) => {
|
|
51
64
|
const _tool = tool;
|
|
52
65
|
acc[key] = {
|
|
53
66
|
..._tool,
|
|
@@ -56,39 +69,51 @@ async function getAgentByIdHandler({ mastra, agentId }) {
|
|
|
56
69
|
};
|
|
57
70
|
return acc;
|
|
58
71
|
}, {});
|
|
72
|
+
const instructions = await agent.getInstructions({ runtimeContext });
|
|
73
|
+
const llm = await agent.getLLM({ runtimeContext });
|
|
59
74
|
return {
|
|
60
75
|
name: agent.name,
|
|
61
|
-
instructions
|
|
76
|
+
instructions,
|
|
62
77
|
tools: serializedAgentTools,
|
|
63
|
-
provider:
|
|
64
|
-
modelId:
|
|
78
|
+
provider: llm?.getProvider(),
|
|
79
|
+
modelId: llm?.getModelId()
|
|
65
80
|
};
|
|
66
81
|
} catch (error) {
|
|
67
82
|
return handleError(error, "Error getting agent");
|
|
68
83
|
}
|
|
69
84
|
}
|
|
70
|
-
async function getEvalsByAgentIdHandler({
|
|
85
|
+
async function getEvalsByAgentIdHandler({
|
|
86
|
+
mastra,
|
|
87
|
+
runtimeContext,
|
|
88
|
+
agentId
|
|
89
|
+
}) {
|
|
71
90
|
try {
|
|
72
91
|
const agent = mastra.getAgent(agentId);
|
|
73
92
|
const evals = await mastra.getStorage()?.getEvalsByAgentName?.(agent.name, "test") || [];
|
|
93
|
+
const instructions = await agent.getInstructions({ runtimeContext });
|
|
74
94
|
return {
|
|
75
95
|
id: agentId,
|
|
76
96
|
name: agent.name,
|
|
77
|
-
instructions
|
|
97
|
+
instructions,
|
|
78
98
|
evals
|
|
79
99
|
};
|
|
80
100
|
} catch (error) {
|
|
81
101
|
return handleError(error, "Error getting test evals");
|
|
82
102
|
}
|
|
83
103
|
}
|
|
84
|
-
async function getLiveEvalsByAgentIdHandler({
|
|
104
|
+
async function getLiveEvalsByAgentIdHandler({
|
|
105
|
+
mastra,
|
|
106
|
+
runtimeContext,
|
|
107
|
+
agentId
|
|
108
|
+
}) {
|
|
85
109
|
try {
|
|
86
110
|
const agent = mastra.getAgent(agentId);
|
|
87
111
|
const evals = await mastra.getStorage()?.getEvalsByAgentName?.(agent.name, "live") || [];
|
|
112
|
+
const instructions = await agent.getInstructions({ runtimeContext });
|
|
88
113
|
return {
|
|
89
114
|
id: agentId,
|
|
90
115
|
name: agent.name,
|
|
91
|
-
instructions
|
|
116
|
+
instructions,
|
|
92
117
|
evals
|
|
93
118
|
};
|
|
94
119
|
} catch (error) {
|
|
@@ -97,7 +122,7 @@ async function getLiveEvalsByAgentIdHandler({ mastra, agentId }) {
|
|
|
97
122
|
}
|
|
98
123
|
async function generateHandler({
|
|
99
124
|
mastra,
|
|
100
|
-
|
|
125
|
+
runtimeContext,
|
|
101
126
|
agentId,
|
|
102
127
|
body
|
|
103
128
|
}) {
|
|
@@ -113,7 +138,7 @@ async function generateHandler({
|
|
|
113
138
|
...rest,
|
|
114
139
|
// @ts-expect-error TODO fix types
|
|
115
140
|
resourceId: finalResourceId,
|
|
116
|
-
|
|
141
|
+
runtimeContext
|
|
117
142
|
});
|
|
118
143
|
return result;
|
|
119
144
|
} catch (error) {
|
|
@@ -122,7 +147,7 @@ async function generateHandler({
|
|
|
122
147
|
}
|
|
123
148
|
async function streamGenerateHandler({
|
|
124
149
|
mastra,
|
|
125
|
-
|
|
150
|
+
runtimeContext,
|
|
126
151
|
agentId,
|
|
127
152
|
body
|
|
128
153
|
}) {
|
|
@@ -138,7 +163,7 @@ async function streamGenerateHandler({
|
|
|
138
163
|
...rest,
|
|
139
164
|
// @ts-expect-error TODO fix types
|
|
140
165
|
resourceId: finalResourceId,
|
|
141
|
-
|
|
166
|
+
runtimeContext
|
|
142
167
|
});
|
|
143
168
|
const streamResponse = rest.output ? streamResult.toTextStreamResponse() : streamResult.toDataStreamResponse({
|
|
144
169
|
sendUsage: true,
|