@mastra/server 0.0.0-message-ordering-20250415215612 → 0.0.0-remove-cloud-span-transform-20250425214156
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 +99 -24
- package/dist/_tsup-dts-rollup.d.ts +99 -24
- 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-CWSDZEZG.cjs → chunk-7IWQE76Z.cjs} +2 -2
- package/dist/chunk-B66WVPGJ.js +297 -0
- package/dist/{chunk-PDC4ZBQW.cjs → chunk-D3G23FP3.cjs} +9 -9
- package/dist/{chunk-JLDXUWK7.cjs → chunk-FPIWDH5Y.cjs} +4 -4
- package/dist/{chunk-Z46X3YCB.cjs → chunk-HCOPJZ4A.cjs} +11 -11
- package/dist/{chunk-OPP7H5TW.js → chunk-LFOBHRFO.js} +10 -10
- package/dist/{chunk-VK6FX47H.js → chunk-OMN3UI6X.js} +38 -38
- package/dist/{chunk-3RVHWGWO.js → chunk-Q6SHQECN.js} +2 -9
- package/dist/{chunk-67WTHYAV.js → chunk-R4J7XQYU.js} +7 -7
- package/dist/{chunk-YANVFOYA.js → chunk-RE6YL32K.js} +4 -4
- package/dist/{chunk-B64YROKU.cjs → chunk-TZK63M5N.cjs} +16 -16
- package/dist/{chunk-DVPP5S6I.js → chunk-WTHDCRMY.js} +2 -2
- package/dist/chunk-ZHNKYTNS.cjs +309 -0
- 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/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/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 +17 -12
- package/dist/server/handlers.d.cts +1 -0
- package/dist/server/handlers.d.ts +1 -0
- package/dist/server/handlers.js +7 -6
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk5SWCVTNL_cjs = require('./chunk-5SWCVTNL.cjs');
|
|
4
4
|
var chunkQN4KF3BH_cjs = require('./chunk-QN4KF3BH.cjs');
|
|
5
5
|
var chunkZLBRQFDD_cjs = require('./chunk-ZLBRQFDD.cjs');
|
|
6
6
|
var chunkFV45V6WC_cjs = require('./chunk-FV45V6WC.cjs');
|
|
@@ -24,8 +24,8 @@ async function getToolsHandler({ tools }) {
|
|
|
24
24
|
const tool = _tool;
|
|
25
25
|
acc[id] = {
|
|
26
26
|
...tool,
|
|
27
|
-
inputSchema: tool.inputSchema ?
|
|
28
|
-
outputSchema: tool.outputSchema ?
|
|
27
|
+
inputSchema: tool.inputSchema ? chunk5SWCVTNL_cjs.stringify(chunk5SWCVTNL_cjs.esm_default(tool.inputSchema)) : void 0,
|
|
28
|
+
outputSchema: tool.outputSchema ? chunk5SWCVTNL_cjs.stringify(chunk5SWCVTNL_cjs.esm_default(tool.outputSchema)) : void 0
|
|
29
29
|
};
|
|
30
30
|
return acc;
|
|
31
31
|
},
|
|
@@ -44,8 +44,8 @@ async function getToolByIdHandler({ tools, toolId }) {
|
|
|
44
44
|
}
|
|
45
45
|
const serializedTool = {
|
|
46
46
|
...tool,
|
|
47
|
-
inputSchema: tool.inputSchema ?
|
|
48
|
-
outputSchema: tool.outputSchema ?
|
|
47
|
+
inputSchema: tool.inputSchema ? chunk5SWCVTNL_cjs.stringify(chunk5SWCVTNL_cjs.esm_default(tool.inputSchema)) : void 0,
|
|
48
|
+
outputSchema: tool.outputSchema ? chunk5SWCVTNL_cjs.stringify(chunk5SWCVTNL_cjs.esm_default(tool.outputSchema)) : void 0
|
|
49
49
|
};
|
|
50
50
|
return serializedTool;
|
|
51
51
|
} catch (error) {
|
|
@@ -58,7 +58,7 @@ function executeToolHandler(tools$1) {
|
|
|
58
58
|
runId,
|
|
59
59
|
toolId,
|
|
60
60
|
data,
|
|
61
|
-
|
|
61
|
+
runtimeContext
|
|
62
62
|
}) => {
|
|
63
63
|
try {
|
|
64
64
|
if (!toolId) {
|
|
@@ -80,7 +80,7 @@ function executeToolHandler(tools$1) {
|
|
|
80
80
|
context: data,
|
|
81
81
|
mastra,
|
|
82
82
|
runId,
|
|
83
|
-
|
|
83
|
+
runtimeContext
|
|
84
84
|
});
|
|
85
85
|
return result;
|
|
86
86
|
} catch (error) {
|
|
@@ -93,7 +93,7 @@ async function executeAgentToolHandler({
|
|
|
93
93
|
agentId,
|
|
94
94
|
toolId,
|
|
95
95
|
data,
|
|
96
|
-
|
|
96
|
+
runtimeContext
|
|
97
97
|
}) {
|
|
98
98
|
try {
|
|
99
99
|
const agent = agentId ? mastra.getAgent(agentId) : null;
|
|
@@ -109,7 +109,7 @@ async function executeAgentToolHandler({
|
|
|
109
109
|
}
|
|
110
110
|
const result = await tool.execute({
|
|
111
111
|
context: data,
|
|
112
|
-
|
|
112
|
+
runtimeContext,
|
|
113
113
|
mastra,
|
|
114
114
|
runId: agentId
|
|
115
115
|
});
|
|
@@ -71,7 +71,7 @@ async function getNetworkByIdHandler({ mastra, networkId }) {
|
|
|
71
71
|
}
|
|
72
72
|
async function generateHandler({
|
|
73
73
|
mastra,
|
|
74
|
-
|
|
74
|
+
runtimeContext,
|
|
75
75
|
networkId,
|
|
76
76
|
body
|
|
77
77
|
}) {
|
|
@@ -82,7 +82,7 @@ async function generateHandler({
|
|
|
82
82
|
}
|
|
83
83
|
chunkQN4KF3BH_cjs.validateBody({ messages: body.messages });
|
|
84
84
|
const { messages, ...rest } = body;
|
|
85
|
-
const result = await network.generate(messages, { ...rest,
|
|
85
|
+
const result = await network.generate(messages, { ...rest, runtimeContext });
|
|
86
86
|
return result;
|
|
87
87
|
} catch (error) {
|
|
88
88
|
return chunkZLBRQFDD_cjs.handleError(error, "Error generating from network");
|
|
@@ -92,7 +92,7 @@ async function streamGenerateHandler({
|
|
|
92
92
|
mastra,
|
|
93
93
|
networkId,
|
|
94
94
|
body,
|
|
95
|
-
|
|
95
|
+
runtimeContext
|
|
96
96
|
}) {
|
|
97
97
|
try {
|
|
98
98
|
const network = mastra.getNetwork(networkId);
|
|
@@ -104,7 +104,7 @@ async function streamGenerateHandler({
|
|
|
104
104
|
const streamResult = await network.stream(messages, {
|
|
105
105
|
output,
|
|
106
106
|
...rest,
|
|
107
|
-
|
|
107
|
+
runtimeContext
|
|
108
108
|
});
|
|
109
109
|
const streamResponse = output ? streamResult.toTextStreamResponse() : streamResult.toDataStreamResponse({
|
|
110
110
|
sendUsage: true,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk5SWCVTNL_cjs = require('./chunk-5SWCVTNL.cjs');
|
|
4
4
|
var chunkQN4KF3BH_cjs = require('./chunk-QN4KF3BH.cjs');
|
|
5
5
|
var chunkZLBRQFDD_cjs = require('./chunk-ZLBRQFDD.cjs');
|
|
6
6
|
var chunkFV45V6WC_cjs = require('./chunk-FV45V6WC.cjs');
|
|
@@ -24,8 +24,8 @@ async function getAgentsHandler({ mastra }) {
|
|
|
24
24
|
const _tool = tool;
|
|
25
25
|
acc2[key] = {
|
|
26
26
|
..._tool,
|
|
27
|
-
inputSchema: _tool.inputSchema ?
|
|
28
|
-
outputSchema: _tool.outputSchema ?
|
|
27
|
+
inputSchema: _tool.inputSchema ? chunk5SWCVTNL_cjs.stringify(chunk5SWCVTNL_cjs.esm_default(_tool.inputSchema)) : void 0,
|
|
28
|
+
outputSchema: _tool.outputSchema ? chunk5SWCVTNL_cjs.stringify(chunk5SWCVTNL_cjs.esm_default(_tool.outputSchema)) : void 0
|
|
29
29
|
};
|
|
30
30
|
return acc2;
|
|
31
31
|
}, {});
|
|
@@ -53,8 +53,8 @@ async function getAgentByIdHandler({ mastra, agentId }) {
|
|
|
53
53
|
const _tool = tool;
|
|
54
54
|
acc[key] = {
|
|
55
55
|
..._tool,
|
|
56
|
-
inputSchema: _tool.inputSchema ?
|
|
57
|
-
outputSchema: _tool.outputSchema ?
|
|
56
|
+
inputSchema: _tool.inputSchema ? chunk5SWCVTNL_cjs.stringify(chunk5SWCVTNL_cjs.esm_default(_tool.inputSchema)) : void 0,
|
|
57
|
+
outputSchema: _tool.outputSchema ? chunk5SWCVTNL_cjs.stringify(chunk5SWCVTNL_cjs.esm_default(_tool.outputSchema)) : void 0
|
|
58
58
|
};
|
|
59
59
|
return acc;
|
|
60
60
|
}, {});
|
|
@@ -72,7 +72,7 @@ async function getAgentByIdHandler({ mastra, agentId }) {
|
|
|
72
72
|
async function getEvalsByAgentIdHandler({ mastra, agentId }) {
|
|
73
73
|
try {
|
|
74
74
|
const agent = mastra.getAgent(agentId);
|
|
75
|
-
const evals = await mastra.getStorage()?.
|
|
75
|
+
const evals = await mastra.getStorage()?.getEvalsByAgentName?.(agent.name, "test") || [];
|
|
76
76
|
return {
|
|
77
77
|
id: agentId,
|
|
78
78
|
name: agent.name,
|
|
@@ -86,7 +86,7 @@ async function getEvalsByAgentIdHandler({ mastra, agentId }) {
|
|
|
86
86
|
async function getLiveEvalsByAgentIdHandler({ mastra, agentId }) {
|
|
87
87
|
try {
|
|
88
88
|
const agent = mastra.getAgent(agentId);
|
|
89
|
-
const evals = await mastra.getStorage()?.
|
|
89
|
+
const evals = await mastra.getStorage()?.getEvalsByAgentName?.(agent.name, "live") || [];
|
|
90
90
|
return {
|
|
91
91
|
id: agentId,
|
|
92
92
|
name: agent.name,
|
|
@@ -99,7 +99,7 @@ async function getLiveEvalsByAgentIdHandler({ mastra, agentId }) {
|
|
|
99
99
|
}
|
|
100
100
|
async function generateHandler({
|
|
101
101
|
mastra,
|
|
102
|
-
|
|
102
|
+
runtimeContext,
|
|
103
103
|
agentId,
|
|
104
104
|
body
|
|
105
105
|
}) {
|
|
@@ -115,7 +115,7 @@ async function generateHandler({
|
|
|
115
115
|
...rest,
|
|
116
116
|
// @ts-expect-error TODO fix types
|
|
117
117
|
resourceId: finalResourceId,
|
|
118
|
-
|
|
118
|
+
runtimeContext
|
|
119
119
|
});
|
|
120
120
|
return result;
|
|
121
121
|
} catch (error) {
|
|
@@ -124,7 +124,7 @@ async function generateHandler({
|
|
|
124
124
|
}
|
|
125
125
|
async function streamGenerateHandler({
|
|
126
126
|
mastra,
|
|
127
|
-
|
|
127
|
+
runtimeContext,
|
|
128
128
|
agentId,
|
|
129
129
|
body
|
|
130
130
|
}) {
|
|
@@ -140,7 +140,7 @@ async function streamGenerateHandler({
|
|
|
140
140
|
...rest,
|
|
141
141
|
// @ts-expect-error TODO fix types
|
|
142
142
|
resourceId: finalResourceId,
|
|
143
|
-
|
|
143
|
+
runtimeContext
|
|
144
144
|
});
|
|
145
145
|
const streamResponse = rest.output ? streamResult.toTextStreamResponse() : streamResult.toDataStreamResponse({
|
|
146
146
|
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 { handleError } from './chunk-3AHQ5RGN.js';
|
|
3
3
|
import { __export, HTTPException } from './chunk-TRDNDNGQ.js';
|
|
4
4
|
import { ReadableStream } from 'node:stream/web';
|
|
@@ -78,7 +78,7 @@ async function getWorkflowByIdHandler({ mastra, workflowId }) {
|
|
|
78
78
|
}
|
|
79
79
|
async function startAsyncWorkflowHandler({
|
|
80
80
|
mastra,
|
|
81
|
-
|
|
81
|
+
runtimeContext,
|
|
82
82
|
workflowId,
|
|
83
83
|
runId,
|
|
84
84
|
triggerData
|
|
@@ -95,7 +95,7 @@ async function startAsyncWorkflowHandler({
|
|
|
95
95
|
const { start } = workflow.createRun();
|
|
96
96
|
const result2 = await start({
|
|
97
97
|
triggerData,
|
|
98
|
-
|
|
98
|
+
runtimeContext
|
|
99
99
|
});
|
|
100
100
|
return result2;
|
|
101
101
|
}
|
|
@@ -105,7 +105,7 @@ async function startAsyncWorkflowHandler({
|
|
|
105
105
|
}
|
|
106
106
|
const result = await run.start({
|
|
107
107
|
triggerData,
|
|
108
|
-
|
|
108
|
+
runtimeContext
|
|
109
109
|
});
|
|
110
110
|
return result;
|
|
111
111
|
} catch (error) {
|
|
@@ -158,7 +158,7 @@ async function createRunHandler({
|
|
|
158
158
|
}
|
|
159
159
|
async function startWorkflowRunHandler({
|
|
160
160
|
mastra,
|
|
161
|
-
|
|
161
|
+
runtimeContext,
|
|
162
162
|
workflowId,
|
|
163
163
|
runId,
|
|
164
164
|
triggerData
|
|
@@ -177,7 +177,7 @@ async function startWorkflowRunHandler({
|
|
|
177
177
|
}
|
|
178
178
|
await run.start({
|
|
179
179
|
triggerData,
|
|
180
|
-
|
|
180
|
+
runtimeContext
|
|
181
181
|
});
|
|
182
182
|
return { message: "Workflow run started" };
|
|
183
183
|
} catch (e) {
|
|
@@ -233,7 +233,7 @@ async function resumeAsyncWorkflowHandler({
|
|
|
233
233
|
workflowId,
|
|
234
234
|
runId,
|
|
235
235
|
body,
|
|
236
|
-
|
|
236
|
+
runtimeContext
|
|
237
237
|
}) {
|
|
238
238
|
try {
|
|
239
239
|
if (!workflowId) {
|
|
@@ -250,7 +250,7 @@ async function resumeAsyncWorkflowHandler({
|
|
|
250
250
|
const result = await run.resume({
|
|
251
251
|
stepId: body.stepId,
|
|
252
252
|
context: body.context,
|
|
253
|
-
|
|
253
|
+
runtimeContext
|
|
254
254
|
});
|
|
255
255
|
return result;
|
|
256
256
|
} catch (error) {
|
|
@@ -262,7 +262,7 @@ async function resumeWorkflowHandler({
|
|
|
262
262
|
workflowId,
|
|
263
263
|
runId,
|
|
264
264
|
body,
|
|
265
|
-
|
|
265
|
+
runtimeContext
|
|
266
266
|
}) {
|
|
267
267
|
try {
|
|
268
268
|
if (!workflowId) {
|
|
@@ -279,7 +279,7 @@ async function resumeWorkflowHandler({
|
|
|
279
279
|
await run.resume({
|
|
280
280
|
stepId: body.stepId,
|
|
281
281
|
context: body.context,
|
|
282
|
-
|
|
282
|
+
runtimeContext
|
|
283
283
|
});
|
|
284
284
|
return { message: "Workflow run resumed" };
|
|
285
285
|
} catch (error) {
|
|
@@ -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
|
}
|
|
@@ -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';
|
|
@@ -70,7 +70,7 @@ async function getAgentByIdHandler({ mastra, agentId }) {
|
|
|
70
70
|
async function getEvalsByAgentIdHandler({ mastra, agentId }) {
|
|
71
71
|
try {
|
|
72
72
|
const agent = mastra.getAgent(agentId);
|
|
73
|
-
const evals = await mastra.getStorage()?.
|
|
73
|
+
const evals = await mastra.getStorage()?.getEvalsByAgentName?.(agent.name, "test") || [];
|
|
74
74
|
return {
|
|
75
75
|
id: agentId,
|
|
76
76
|
name: agent.name,
|
|
@@ -84,7 +84,7 @@ async function getEvalsByAgentIdHandler({ mastra, agentId }) {
|
|
|
84
84
|
async function getLiveEvalsByAgentIdHandler({ mastra, agentId }) {
|
|
85
85
|
try {
|
|
86
86
|
const agent = mastra.getAgent(agentId);
|
|
87
|
-
const evals = await mastra.getStorage()?.
|
|
87
|
+
const evals = await mastra.getStorage()?.getEvalsByAgentName?.(agent.name, "live") || [];
|
|
88
88
|
return {
|
|
89
89
|
id: agentId,
|
|
90
90
|
name: agent.name,
|
|
@@ -97,7 +97,7 @@ async function getLiveEvalsByAgentIdHandler({ mastra, agentId }) {
|
|
|
97
97
|
}
|
|
98
98
|
async function generateHandler({
|
|
99
99
|
mastra,
|
|
100
|
-
|
|
100
|
+
runtimeContext,
|
|
101
101
|
agentId,
|
|
102
102
|
body
|
|
103
103
|
}) {
|
|
@@ -113,7 +113,7 @@ async function generateHandler({
|
|
|
113
113
|
...rest,
|
|
114
114
|
// @ts-expect-error TODO fix types
|
|
115
115
|
resourceId: finalResourceId,
|
|
116
|
-
|
|
116
|
+
runtimeContext
|
|
117
117
|
});
|
|
118
118
|
return result;
|
|
119
119
|
} catch (error) {
|
|
@@ -122,7 +122,7 @@ async function generateHandler({
|
|
|
122
122
|
}
|
|
123
123
|
async function streamGenerateHandler({
|
|
124
124
|
mastra,
|
|
125
|
-
|
|
125
|
+
runtimeContext,
|
|
126
126
|
agentId,
|
|
127
127
|
body
|
|
128
128
|
}) {
|
|
@@ -138,7 +138,7 @@ async function streamGenerateHandler({
|
|
|
138
138
|
...rest,
|
|
139
139
|
// @ts-expect-error TODO fix types
|
|
140
140
|
resourceId: finalResourceId,
|
|
141
|
-
|
|
141
|
+
runtimeContext
|
|
142
142
|
});
|
|
143
143
|
const streamResponse = rest.output ? streamResult.toTextStreamResponse() : streamResult.toDataStreamResponse({
|
|
144
144
|
sendUsage: true,
|