@mastra/server 1.0.0-beta.11 → 1.0.0-beta.14
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/CHANGELOG.md +121 -0
- package/dist/{chunk-K3ELPJS3.js → chunk-3BXS37TQ.js} +54 -12
- package/dist/chunk-3BXS37TQ.js.map +1 -0
- package/dist/{chunk-7N3PD4SV.js → chunk-6V57U52D.js} +3 -3
- package/dist/{chunk-7N3PD4SV.js.map → chunk-6V57U52D.js.map} +1 -1
- package/dist/{chunk-WI3X62RJ.cjs → chunk-7KOS32XA.cjs} +175 -57
- package/dist/chunk-7KOS32XA.cjs.map +1 -0
- package/dist/chunk-AZIH2QEC.js +83 -0
- package/dist/chunk-AZIH2QEC.js.map +1 -0
- package/dist/{chunk-GN2LFMET.cjs → chunk-BGSW46W5.cjs} +22718 -18417
- package/dist/chunk-BGSW46W5.cjs.map +1 -0
- package/dist/{chunk-LPM6BBAX.cjs → chunk-BMLUV4BH.cjs} +2 -53
- package/dist/chunk-BMLUV4BH.cjs.map +1 -0
- package/dist/{chunk-X4QMPCTP.cjs → chunk-BMYZ4DO6.cjs} +12 -2
- package/dist/chunk-BMYZ4DO6.cjs.map +1 -0
- package/dist/{chunk-DHWPHLGF.cjs → chunk-BNGT3NIC.cjs} +14 -14
- package/dist/{chunk-DHWPHLGF.cjs.map → chunk-BNGT3NIC.cjs.map} +1 -1
- package/dist/{chunk-YP34EWWK.js → chunk-DVSCJECS.js} +11 -14
- package/dist/chunk-DVSCJECS.js.map +1 -0
- package/dist/{chunk-4W2SM6CG.js → chunk-DW3WE4M4.js} +14 -58
- package/dist/chunk-DW3WE4M4.js.map +1 -0
- package/dist/{chunk-RQK4FQUD.js → chunk-E646Y4FQ.js} +3 -45
- package/dist/chunk-E646Y4FQ.js.map +1 -0
- package/dist/chunk-EUBTCHQC.js +83 -0
- package/dist/chunk-EUBTCHQC.js.map +1 -0
- package/dist/chunk-FWSKVWS7.cjs +88 -0
- package/dist/chunk-FWSKVWS7.cjs.map +1 -0
- package/dist/{chunk-7O3KPUJ4.cjs → chunk-JUYWLFVT.cjs} +13 -4
- package/dist/chunk-JUYWLFVT.cjs.map +1 -0
- package/dist/{chunk-2PLXW4ZX.cjs → chunk-K73YS7YB.cjs} +74 -74
- package/dist/{chunk-2PLXW4ZX.cjs.map → chunk-K73YS7YB.cjs.map} +1 -1
- package/dist/{chunk-WE4USCF3.js → chunk-KPSSRYGH.js} +11 -3
- package/dist/{chunk-X4QMPCTP.cjs.map → chunk-KPSSRYGH.js.map} +1 -1
- package/dist/{chunk-V272B7RM.cjs → chunk-LKTCAPBD.cjs} +15 -18
- package/dist/chunk-LKTCAPBD.cjs.map +1 -0
- package/dist/{chunk-US6Y5RLR.cjs → chunk-LQSZ4FJJ.cjs} +21 -21
- package/dist/{chunk-US6Y5RLR.cjs.map → chunk-LQSZ4FJJ.cjs.map} +1 -1
- package/dist/{chunk-FPCGLPLJ.cjs → chunk-P3H4AZKI.cjs} +17 -62
- package/dist/chunk-P3H4AZKI.cjs.map +1 -0
- package/dist/{chunk-ZN5R6OZB.cjs → chunk-P6S2HIVE.cjs} +59 -17
- package/dist/chunk-P6S2HIVE.cjs.map +1 -0
- package/dist/chunk-Q7NPRJRV.cjs +88 -0
- package/dist/chunk-Q7NPRJRV.cjs.map +1 -0
- package/dist/{chunk-KEXR53KI.js → chunk-S5XBFHJL.js} +13 -4
- package/dist/chunk-S5XBFHJL.js.map +1 -0
- package/dist/{chunk-QNVYGEJ4.js → chunk-SRQY5IWD.js} +3 -3
- package/dist/{chunk-QNVYGEJ4.js.map → chunk-SRQY5IWD.js.map} +1 -1
- package/dist/{chunk-ZULZ2752.js → chunk-SV4AUWGY.js} +3 -3
- package/dist/{chunk-ZULZ2752.js.map → chunk-SV4AUWGY.js.map} +1 -1
- package/dist/{chunk-HFQGXVIE.js → chunk-UWRAKVAJ.js} +124 -7
- package/dist/chunk-UWRAKVAJ.js.map +1 -0
- package/dist/{chunk-CDRVS35Y.js → chunk-YBYNF4PS.js} +22372 -18071
- package/dist/chunk-YBYNF4PS.js.map +1 -0
- package/dist/dist-2J26LQO2.cjs +16 -0
- package/dist/{dist-P4MXBQ3U.cjs.map → dist-2J26LQO2.cjs.map} +1 -1
- package/dist/{dist-X7XR3M3Z.js → dist-4CMHRWC4.js} +3 -3
- package/dist/{dist-X7XR3M3Z.js.map → dist-4CMHRWC4.js.map} +1 -1
- package/dist/{dist-PQZUVLPC.js → dist-AEJONJSS.js} +3 -3
- package/dist/{dist-PQZUVLPC.js.map → dist-AEJONJSS.js.map} +1 -1
- package/dist/{dist-G2BYZJOC.cjs → dist-AF7EUPXA.cjs} +28 -28
- package/dist/{dist-G2BYZJOC.cjs.map → dist-AF7EUPXA.cjs.map} +1 -1
- package/dist/dist-MEN73GGI.js +3 -0
- package/dist/{dist-YREX2TJT.js.map → dist-MEN73GGI.js.map} +1 -1
- package/dist/{dist-FZYCV3VB.cjs → dist-NVXXJWBO.cjs} +26 -26
- package/dist/{dist-FZYCV3VB.cjs.map → dist-NVXXJWBO.cjs.map} +1 -1
- package/dist/{dist-RFMYFILX.cjs → dist-Q2ST4SUQ.cjs} +30 -30
- package/dist/{dist-RFMYFILX.cjs.map → dist-Q2ST4SUQ.cjs.map} +1 -1
- package/dist/{dist-XVBSOGFK.js → dist-TE7XRSWH.js} +3 -3
- package/dist/{dist-XVBSOGFK.js.map → dist-TE7XRSWH.js.map} +1 -1
- package/dist/{dist-R7WYX6LC.js → dist-VPYZNWNG.js} +3 -3
- package/dist/{dist-R7WYX6LC.js.map → dist-VPYZNWNG.js.map} +1 -1
- package/dist/{dist-4MVGNSRL.cjs → dist-Y5SYUVLY.cjs} +20 -20
- package/dist/{dist-4MVGNSRL.cjs.map → dist-Y5SYUVLY.cjs.map} +1 -1
- package/dist/server/handlers/a2a.cjs +9 -9
- package/dist/server/handlers/a2a.d.ts.map +1 -1
- package/dist/server/handlers/a2a.js +1 -1
- package/dist/server/handlers/agent-builder.cjs +19 -19
- package/dist/server/handlers/agent-builder.d.ts +36 -3
- package/dist/server/handlers/agent-builder.d.ts.map +1 -1
- package/dist/server/handlers/agent-builder.js +1 -1
- package/dist/server/handlers/agents.cjs +27 -23
- package/dist/server/handlers/agents.d.ts +21 -1
- package/dist/server/handlers/agents.d.ts.map +1 -1
- package/dist/server/handlers/agents.js +1 -1
- package/dist/server/handlers/tools.cjs +6 -6
- package/dist/server/handlers/tools.js +1 -1
- package/dist/server/handlers/voice.cjs +8 -8
- package/dist/server/handlers/voice.js +1 -1
- package/dist/server/handlers/workflows.cjs +27 -27
- package/dist/server/handlers/workflows.d.ts +77 -7
- package/dist/server/handlers/workflows.d.ts.map +1 -1
- package/dist/server/handlers/workflows.js +1 -1
- package/dist/server/handlers.cjs +12 -12
- package/dist/server/handlers.js +6 -6
- package/dist/server/schemas/agent-builder.d.ts +9 -0
- package/dist/server/schemas/agent-builder.d.ts.map +1 -1
- package/dist/server/schemas/agents.d.ts +26 -0
- package/dist/server/schemas/agents.d.ts.map +1 -1
- package/dist/server/schemas/workflows.d.ts +63 -3
- package/dist/server/schemas/workflows.d.ts.map +1 -1
- package/dist/server/server-adapter/index.cjs +84 -80
- package/dist/server/server-adapter/index.cjs.map +1 -1
- package/dist/server/server-adapter/index.d.ts +3 -3
- package/dist/server/server-adapter/index.d.ts.map +1 -1
- package/dist/server/server-adapter/index.js +10 -6
- package/dist/server/server-adapter/index.js.map +1 -1
- package/dist/server/server-adapter/routes/agents.d.ts.map +1 -1
- package/dist/server/server-adapter/routes/index.d.ts +2 -2
- package/dist/server/server-adapter/routes/index.d.ts.map +1 -1
- package/dist/{token-VFONFWVS.cjs → token-6GSAFR2W-KVDFAJ2M-EPLMGMHT.cjs} +11 -12
- package/dist/token-6GSAFR2W-KVDFAJ2M-EPLMGMHT.cjs.map +1 -0
- package/dist/{token-JGA3ZWAN.js → token-6GSAFR2W-KVDFAJ2M-LNX5VF3I.js} +8 -8
- package/dist/token-6GSAFR2W-KVDFAJ2M-LNX5VF3I.js.map +1 -0
- package/dist/{token-ZOD6YIQ3.cjs → token-6GSAFR2W-KVDFAJ2M-SDYXODLX.cjs} +11 -11
- package/dist/token-6GSAFR2W-KVDFAJ2M-SDYXODLX.cjs.map +1 -0
- package/dist/{token-GVZ7HRD7.js → token-6GSAFR2W-KVDFAJ2M-VW443KIA.js} +8 -9
- package/dist/token-6GSAFR2W-KVDFAJ2M-VW443KIA.js.map +1 -0
- package/dist/token-util-NEHG7TUY-DJYRKLRD-6TH3ODCN.cjs +10 -0
- package/dist/token-util-NEHG7TUY-DJYRKLRD-6TH3ODCN.cjs.map +1 -0
- package/dist/token-util-NEHG7TUY-DJYRKLRD-BSQMRUEW.js +8 -0
- package/dist/token-util-NEHG7TUY-DJYRKLRD-BSQMRUEW.js.map +1 -0
- package/dist/token-util-NEHG7TUY-DJYRKLRD-EACKYD4V.js +8 -0
- package/dist/token-util-NEHG7TUY-DJYRKLRD-EACKYD4V.js.map +1 -0
- package/dist/token-util-NEHG7TUY-DJYRKLRD-MFJRDVVF.cjs +10 -0
- package/dist/token-util-NEHG7TUY-DJYRKLRD-MFJRDVVF.cjs.map +1 -0
- package/package.json +5 -6
- package/dist/chunk-4W2SM6CG.js.map +0 -1
- package/dist/chunk-7O3KPUJ4.cjs.map +0 -1
- package/dist/chunk-CDRVS35Y.js.map +0 -1
- package/dist/chunk-ER3QM7DD.js +0 -46
- package/dist/chunk-ER3QM7DD.js.map +0 -1
- package/dist/chunk-FPCGLPLJ.cjs.map +0 -1
- package/dist/chunk-GN2LFMET.cjs.map +0 -1
- package/dist/chunk-HFQGXVIE.js.map +0 -1
- package/dist/chunk-K3ELPJS3.js.map +0 -1
- package/dist/chunk-KEXR53KI.js.map +0 -1
- package/dist/chunk-LPM6BBAX.cjs.map +0 -1
- package/dist/chunk-RQK4FQUD.js.map +0 -1
- package/dist/chunk-V272B7RM.cjs.map +0 -1
- package/dist/chunk-WE4USCF3.js.map +0 -1
- package/dist/chunk-WI3X62RJ.cjs.map +0 -1
- package/dist/chunk-XQPJ63ZD.cjs +0 -48
- package/dist/chunk-XQPJ63ZD.cjs.map +0 -1
- package/dist/chunk-YP34EWWK.js.map +0 -1
- package/dist/chunk-ZN5R6OZB.cjs.map +0 -1
- package/dist/dist-P4MXBQ3U.cjs +0 -16
- package/dist/dist-YREX2TJT.js +0 -3
- package/dist/token-GVZ7HRD7.js.map +0 -1
- package/dist/token-JGA3ZWAN.js.map +0 -1
- package/dist/token-VFONFWVS.cjs.map +0 -1
- package/dist/token-ZOD6YIQ3.cjs.map +0 -1
- package/dist/token-util-7R2ZFIXO.js +0 -7
- package/dist/token-util-7R2ZFIXO.js.map +0 -1
- package/dist/token-util-BLJZJDBZ.cjs +0 -9
- package/dist/token-util-BLJZJDBZ.cjs.map +0 -1
- package/dist/token-util-VGZUWSNR.cjs +0 -9
- package/dist/token-util-VGZUWSNR.cjs.map +0 -1
- package/dist/token-util-VKTPZLSE.js +0 -7
- package/dist/token-util-VKTPZLSE.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunk3XI22UQR_cjs = require('./chunk-3XI22UQR.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkBMYZ4DO6_cjs = require('./chunk-BMYZ4DO6.cjs');
|
|
5
5
|
var chunkMCYD5LW7_cjs = require('./chunk-MCYD5LW7.cjs');
|
|
6
6
|
var chunkH2RMXG2Q_cjs = require('./chunk-H2RMXG2Q.cjs');
|
|
7
7
|
var chunkV5WWQN7P_cjs = require('./chunk-V5WWQN7P.cjs');
|
|
@@ -100,6 +100,7 @@ var listWorkflowRunsQuerySchema = chunkMCYD5LW7_cjs.createCombinedPaginationSche
|
|
|
100
100
|
status: workflowRunStatusSchema.optional()
|
|
101
101
|
});
|
|
102
102
|
var workflowExecutionBodySchema = z__default.default.object({
|
|
103
|
+
resourceId: z__default.default.string().optional(),
|
|
103
104
|
inputData: z__default.default.unknown().optional(),
|
|
104
105
|
initialState: z__default.default.unknown().optional(),
|
|
105
106
|
requestContext: z__default.default.record(z__default.default.string(), z__default.default.unknown()).optional(),
|
|
@@ -135,15 +136,49 @@ z__default.default.object({
|
|
|
135
136
|
event: z__default.default.string(),
|
|
136
137
|
data: z__default.default.unknown()
|
|
137
138
|
});
|
|
139
|
+
var workflowExecutionResultQuerySchema = z__default.default.object({
|
|
140
|
+
fields: z__default.default.string().optional().refine(
|
|
141
|
+
(value) => {
|
|
142
|
+
if (!value) return true;
|
|
143
|
+
const validFields = /* @__PURE__ */ new Set([
|
|
144
|
+
"status",
|
|
145
|
+
"result",
|
|
146
|
+
"error",
|
|
147
|
+
"payload",
|
|
148
|
+
"steps",
|
|
149
|
+
"activeStepsPath",
|
|
150
|
+
"serializedStepGraph"
|
|
151
|
+
]);
|
|
152
|
+
const requestedFields = value.split(",").map((f) => f.trim());
|
|
153
|
+
return requestedFields.every((field) => validFields.has(field));
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
message: "Invalid field name. Available fields: status, result, error, payload, steps, activeStepsPath, serializedStepGraph"
|
|
157
|
+
}
|
|
158
|
+
).describe(
|
|
159
|
+
"Comma-separated list of fields to return. Available fields: status, result, error, payload, steps, activeStepsPath, serializedStepGraph. If not provided, returns all fields."
|
|
160
|
+
),
|
|
161
|
+
withNestedWorkflows: z__default.default.enum(["true", "false"]).optional().describe(
|
|
162
|
+
"Whether to include nested workflow data in steps. Defaults to true. Set to false for better performance."
|
|
163
|
+
)
|
|
164
|
+
});
|
|
138
165
|
var workflowExecutionResultSchema = z__default.default.object({
|
|
139
|
-
status: workflowRunStatusSchema,
|
|
166
|
+
status: workflowRunStatusSchema.optional(),
|
|
140
167
|
result: z__default.default.unknown().optional(),
|
|
141
|
-
error: z__default.default.unknown().optional()
|
|
168
|
+
error: z__default.default.unknown().optional(),
|
|
169
|
+
payload: z__default.default.unknown().optional(),
|
|
170
|
+
steps: z__default.default.record(z__default.default.string(), z__default.default.any()).optional(),
|
|
171
|
+
activeStepsPath: z__default.default.record(z__default.default.string(), z__default.default.array(z__default.default.number())).optional(),
|
|
172
|
+
serializedStepGraph: z__default.default.array(serializedStepFlowEntrySchema).optional()
|
|
142
173
|
});
|
|
143
174
|
var workflowControlResponseSchema = chunkMCYD5LW7_cjs.messageResponseSchema;
|
|
144
175
|
var createWorkflowRunResponseSchema = z__default.default.object({
|
|
145
176
|
runId: z__default.default.string()
|
|
146
177
|
});
|
|
178
|
+
var createWorkflowRunBodySchema = z__default.default.object({
|
|
179
|
+
resourceId: z__default.default.string().optional(),
|
|
180
|
+
disableScorers: z__default.default.boolean().optional()
|
|
181
|
+
});
|
|
147
182
|
|
|
148
183
|
// src/server/handlers/workflows.ts
|
|
149
184
|
async function listWorkflowsFromSystem({ mastra, workflowId }) {
|
|
@@ -344,11 +379,12 @@ var CREATE_WORKFLOW_RUN_ROUTE = chunkH2RMXG2Q_cjs.createRoute({
|
|
|
344
379
|
responseType: "json",
|
|
345
380
|
pathParamSchema: workflowIdPathParams,
|
|
346
381
|
queryParamSchema: chunkMCYD5LW7_cjs.optionalRunIdSchema,
|
|
382
|
+
bodySchema: createWorkflowRunBodySchema,
|
|
347
383
|
responseSchema: createWorkflowRunResponseSchema,
|
|
348
384
|
summary: "Create workflow run",
|
|
349
385
|
description: "Creates a new workflow execution instance with an optional custom run ID",
|
|
350
386
|
tags: ["Workflows"],
|
|
351
|
-
handler: async ({ mastra, workflowId, runId }) => {
|
|
387
|
+
handler: async ({ mastra, workflowId, runId, resourceId, disableScorers }) => {
|
|
352
388
|
try {
|
|
353
389
|
if (!workflowId) {
|
|
354
390
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
@@ -357,7 +393,7 @@ var CREATE_WORKFLOW_RUN_ROUTE = chunkH2RMXG2Q_cjs.createRoute({
|
|
|
357
393
|
if (!workflow) {
|
|
358
394
|
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Workflow not found" });
|
|
359
395
|
}
|
|
360
|
-
const run = await workflow.createRun({ runId });
|
|
396
|
+
const run = await workflow.createRun({ runId, resourceId, disableScorers });
|
|
361
397
|
return { runId: run.runId };
|
|
362
398
|
} catch (error) {
|
|
363
399
|
return chunkV5WWQN7P_cjs.handleError(error, "Error creating workflow run");
|
|
@@ -374,7 +410,7 @@ var STREAM_WORKFLOW_ROUTE = chunkH2RMXG2Q_cjs.createRoute({
|
|
|
374
410
|
summary: "Stream workflow execution",
|
|
375
411
|
description: "Executes a workflow and streams the results in real-time",
|
|
376
412
|
tags: ["Workflows"],
|
|
377
|
-
handler: async ({ mastra, workflowId, runId, ...params }) => {
|
|
413
|
+
handler: async ({ mastra, workflowId, runId, resourceId, ...params }) => {
|
|
378
414
|
try {
|
|
379
415
|
if (!workflowId) {
|
|
380
416
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
@@ -387,7 +423,7 @@ var STREAM_WORKFLOW_ROUTE = chunkH2RMXG2Q_cjs.createRoute({
|
|
|
387
423
|
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Workflow not found" });
|
|
388
424
|
}
|
|
389
425
|
const serverCache = mastra.getServerCache();
|
|
390
|
-
const run = await workflow.createRun({ runId });
|
|
426
|
+
const run = await workflow.createRun({ runId, resourceId });
|
|
391
427
|
const result = run.stream(params);
|
|
392
428
|
return result.fullStream.pipeThrough(
|
|
393
429
|
new web.TransformStream({
|
|
@@ -425,7 +461,7 @@ var RESUME_STREAM_WORKFLOW_ROUTE = chunkH2RMXG2Q_cjs.createRoute({
|
|
|
425
461
|
pathParamSchema: workflowIdPathParams,
|
|
426
462
|
queryParamSchema: chunkMCYD5LW7_cjs.runIdSchema,
|
|
427
463
|
bodySchema: resumeBodySchema,
|
|
428
|
-
responseSchema:
|
|
464
|
+
responseSchema: chunkBMYZ4DO6_cjs.streamResponseSchema,
|
|
429
465
|
summary: "Resume workflow stream",
|
|
430
466
|
description: "Resumes a suspended workflow execution and continues streaming results",
|
|
431
467
|
tags: ["Workflows"],
|
|
@@ -470,11 +506,12 @@ var GET_WORKFLOW_RUN_EXECUTION_RESULT_ROUTE = chunkH2RMXG2Q_cjs.createRoute({
|
|
|
470
506
|
path: "/api/workflows/:workflowId/runs/:runId/execution-result",
|
|
471
507
|
responseType: "json",
|
|
472
508
|
pathParamSchema: workflowRunPathParams,
|
|
509
|
+
queryParamSchema: workflowExecutionResultQuerySchema,
|
|
473
510
|
responseSchema: workflowExecutionResultSchema,
|
|
474
511
|
summary: "Get workflow execution result",
|
|
475
|
-
description: "Returns the final execution result of a completed workflow run",
|
|
512
|
+
description: "Returns the final execution result of a completed workflow run. Use the fields query parameter to reduce payload size by requesting only specific fields (e.g., ?fields=status,result)",
|
|
476
513
|
tags: ["Workflows"],
|
|
477
|
-
handler: async ({ mastra, workflowId, runId }) => {
|
|
514
|
+
handler: async ({ mastra, workflowId, runId, fields, withNestedWorkflows }) => {
|
|
478
515
|
try {
|
|
479
516
|
if (!workflowId) {
|
|
480
517
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
@@ -486,7 +523,12 @@ var GET_WORKFLOW_RUN_EXECUTION_RESULT_ROUTE = chunkH2RMXG2Q_cjs.createRoute({
|
|
|
486
523
|
if (!workflow) {
|
|
487
524
|
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Workflow not found" });
|
|
488
525
|
}
|
|
489
|
-
const
|
|
526
|
+
const fieldList = fields ? fields.split(",").map((f) => f.trim()) : void 0;
|
|
527
|
+
const executionResult = await workflow.getWorkflowRunExecutionResult(runId, {
|
|
528
|
+
withNestedWorkflows: withNestedWorkflows !== "false",
|
|
529
|
+
// Default to true unless explicitly 'false'
|
|
530
|
+
fields: fieldList
|
|
531
|
+
});
|
|
490
532
|
if (!executionResult) {
|
|
491
533
|
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Workflow run execution result not found" });
|
|
492
534
|
}
|
|
@@ -567,7 +609,7 @@ var OBSERVE_STREAM_WORKFLOW_ROUTE = chunkH2RMXG2Q_cjs.createRoute({
|
|
|
567
609
|
responseType: "stream",
|
|
568
610
|
pathParamSchema: workflowIdPathParams,
|
|
569
611
|
queryParamSchema: chunkMCYD5LW7_cjs.runIdSchema,
|
|
570
|
-
responseSchema:
|
|
612
|
+
responseSchema: chunkBMYZ4DO6_cjs.streamResponseSchema,
|
|
571
613
|
summary: "Observe workflow stream",
|
|
572
614
|
description: "Observes and streams updates from an already running workflow execution",
|
|
573
615
|
tags: ["Workflows"],
|
|
@@ -637,7 +679,7 @@ var OBSERVE_STREAM_VNEXT_WORKFLOW_ROUTE = chunkH2RMXG2Q_cjs.createRoute({
|
|
|
637
679
|
responseType: "stream",
|
|
638
680
|
pathParamSchema: workflowIdPathParams,
|
|
639
681
|
queryParamSchema: chunkMCYD5LW7_cjs.runIdSchema,
|
|
640
|
-
responseSchema:
|
|
682
|
+
responseSchema: chunkBMYZ4DO6_cjs.streamResponseSchema,
|
|
641
683
|
summary: "Observe workflow stream (v2)",
|
|
642
684
|
description: "Observes and streams updates from an already running workflow execution using v2 streaming API",
|
|
643
685
|
tags: ["Workflows"],
|
|
@@ -985,7 +1027,7 @@ var STREAM_LEGACY_WORKFLOW_ROUTE = chunkH2RMXG2Q_cjs.createRoute({
|
|
|
985
1027
|
pathParamSchema: workflowIdPathParams,
|
|
986
1028
|
queryParamSchema: chunkMCYD5LW7_cjs.runIdSchema,
|
|
987
1029
|
bodySchema: streamWorkflowBodySchema,
|
|
988
|
-
responseSchema:
|
|
1030
|
+
responseSchema: chunkBMYZ4DO6_cjs.streamResponseSchema,
|
|
989
1031
|
summary: "[DEPRECATED] Stream workflow with legacy format",
|
|
990
1032
|
description: "Legacy endpoint for streaming workflow execution. Use /api/workflows/:workflowId/stream instead.",
|
|
991
1033
|
tags: ["Workflows", "Legacy"],
|
|
@@ -1024,7 +1066,7 @@ var OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE = chunkH2RMXG2Q_cjs.createRoute({
|
|
|
1024
1066
|
responseType: "stream",
|
|
1025
1067
|
pathParamSchema: workflowIdPathParams,
|
|
1026
1068
|
queryParamSchema: chunkMCYD5LW7_cjs.runIdSchema,
|
|
1027
|
-
responseSchema:
|
|
1069
|
+
responseSchema: chunkBMYZ4DO6_cjs.streamResponseSchema,
|
|
1028
1070
|
summary: "[DEPRECATED] Observe workflow stream with legacy format",
|
|
1029
1071
|
description: "Legacy endpoint for observing workflow stream. Use /api/workflows/:workflowId/observe instead.",
|
|
1030
1072
|
tags: ["Workflows", "Legacy"],
|
|
@@ -1103,5 +1145,5 @@ exports.workflowInfoSchema = workflowInfoSchema;
|
|
|
1103
1145
|
exports.workflowRunResponseSchema = workflowRunResponseSchema;
|
|
1104
1146
|
exports.workflowRunsResponseSchema = workflowRunsResponseSchema;
|
|
1105
1147
|
exports.workflows_exports = workflows_exports;
|
|
1106
|
-
//# sourceMappingURL=chunk-
|
|
1107
|
-
//# sourceMappingURL=chunk-
|
|
1148
|
+
//# sourceMappingURL=chunk-P6S2HIVE.cjs.map
|
|
1149
|
+
//# sourceMappingURL=chunk-P6S2HIVE.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/server/handlers/workflows.ts","../src/server/schemas/workflows.ts"],"names":["__export","z","createCombinedPaginationSchema","tracingOptionsSchema","messageResponseSchema","HTTPException","WorkflowRegistry","createRoute","getWorkflowInfo","handleError","optionalRunIdSchema","runIdSchema","TransformStream","streamResponseSchema","ReadableStream"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAA,iBAAA,GAAA;AAAAA,0BAAA,CAAA,iBAAA,EAAA;AAAA,EAAA,yBAAA,EAAA,MAAA,yBAAA;AAAA,EAAA,yBAAA,EAAA,MAAA,yBAAA;AAAA,EAAA,+BAAA,EAAA,MAAA,+BAAA;AAAA,EAAA,wBAAA,EAAA,MAAA,wBAAA;AAAA,EAAA,4BAAA,EAAA,MAAA,4BAAA;AAAA,EAAA,uCAAA,EAAA,MAAA,uCAAA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A,IAC7D;AAAA,EACF;AACF,CAAC","file":"chunk-P6S2HIVE.cjs","sourcesContent":["import { ReadableStream, TransformStream } from 'node:stream/web';\nimport type { WorkflowInfo, ChunkType, StreamEvent } from '@mastra/core/workflows';\nimport { z } from 'zod';\nimport { HTTPException } from '../http-exception';\nimport { streamResponseSchema } from '../schemas/agents';\nimport { optionalRunIdSchema, runIdSchema } from '../schemas/common';\nimport {\n createWorkflowRunBodySchema,\n createWorkflowRunResponseSchema,\n listWorkflowRunsQuerySchema,\n listWorkflowsResponseSchema,\n restartBodySchema,\n timeTravelBodySchema,\n resumeBodySchema,\n startAsyncWorkflowBodySchema,\n streamWorkflowBodySchema,\n workflowControlResponseSchema,\n workflowExecutionResultQuerySchema,\n workflowExecutionResultSchema,\n workflowIdPathParams,\n workflowInfoSchema,\n workflowRunPathParams,\n workflowRunResponseSchema,\n workflowRunsResponseSchema,\n} from '../schemas/workflows';\nimport { createRoute } from '../server-adapter/routes/route-builder';\nimport type { Context } from '../types';\nimport { getWorkflowInfo, WorkflowRegistry } from '../utils';\nimport { handleError } from './error';\n\nexport interface WorkflowContext extends Context {\n workflowId?: string;\n runId?: string;\n}\n\nasync function listWorkflowsFromSystem({ mastra, workflowId }: WorkflowContext) {\n const logger = mastra.getLogger();\n\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n let workflow;\n\n // First check registry for temporary workflows\n workflow = WorkflowRegistry.getWorkflow(workflowId);\n\n if (!workflow) {\n try {\n workflow = mastra.getWorkflowById(workflowId);\n } catch (error) {\n logger.debug('Error getting workflow, searching agents for workflow', error);\n }\n }\n\n if (!workflow) {\n logger.debug('Workflow not found, searching agents for workflow', { workflowId });\n const agents = mastra.listAgents();\n\n if (Object.keys(agents || {}).length) {\n for (const [_, agent] of Object.entries(agents)) {\n try {\n const workflows = await agent.listWorkflows();\n\n if (workflows[workflowId]) {\n workflow = workflows[workflowId];\n break;\n }\n break;\n } catch (error) {\n logger.debug('Error getting workflow from agent', error);\n }\n }\n }\n }\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n return { workflow };\n}\n\n// ============================================================================\n// Route Definitions (new pattern - handlers defined inline with createRoute)\n// ============================================================================\n\nexport const LIST_WORKFLOWS_ROUTE = createRoute({\n method: 'GET',\n path: '/api/workflows',\n responseType: 'json',\n queryParamSchema: z.object({\n partial: z.string().optional(),\n }),\n responseSchema: listWorkflowsResponseSchema,\n summary: 'List all workflows',\n description: 'Returns a list of all available workflows in the system',\n tags: ['Workflows'],\n handler: async ({ mastra, partial }) => {\n try {\n const workflows = mastra.listWorkflows({ serialized: false });\n const isPartial = partial === 'true';\n const _workflows = Object.entries(workflows).reduce<Record<string, WorkflowInfo>>((acc, [key, workflow]) => {\n acc[key] = getWorkflowInfo(workflow, isPartial);\n return acc;\n }, {});\n return _workflows;\n } catch (error) {\n return handleError(error, 'Error getting workflows');\n }\n },\n});\n\nexport const GET_WORKFLOW_BY_ID_ROUTE = createRoute({\n method: 'GET',\n path: '/api/workflows/:workflowId',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n responseSchema: workflowInfoSchema,\n summary: 'Get workflow by ID',\n description: 'Returns details for a specific workflow',\n tags: ['Workflows'],\n handler: async ({ mastra, workflowId }) => {\n try {\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n return getWorkflowInfo(workflow);\n } catch (error) {\n return handleError(error, 'Error getting workflow');\n }\n },\n});\n\nexport const LIST_WORKFLOW_RUNS_ROUTE = createRoute({\n method: 'GET',\n path: '/api/workflows/:workflowId/runs',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: listWorkflowRunsQuerySchema,\n responseSchema: workflowRunsResponseSchema,\n summary: 'List workflow runs',\n description: 'Returns a paginated list of execution runs for the specified workflow',\n tags: ['Workflows'],\n handler: async ({ mastra, workflowId, fromDate, toDate, page, perPage, limit, offset, resourceId, status }) => {\n try {\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n // Support both page/perPage and limit/offset for backwards compatibility\n // If page/perPage provided, use directly; otherwise convert from limit/offset\n let finalPage = page;\n let finalPerPage = perPage;\n\n if (finalPerPage === undefined && limit !== undefined) {\n finalPerPage = limit;\n }\n if (finalPage === undefined && offset !== undefined && finalPerPage !== undefined && finalPerPage > 0) {\n finalPage = Math.floor(offset / finalPerPage);\n }\n\n if (\n finalPerPage !== undefined &&\n (typeof finalPerPage !== 'number' || !Number.isInteger(finalPerPage) || finalPerPage <= 0)\n ) {\n throw new HTTPException(400, { message: 'perPage must be a positive integer' });\n }\n if (finalPage !== undefined && (!Number.isInteger(finalPage) || finalPage < 0)) {\n throw new HTTPException(400, { message: 'page must be a non-negative integer' });\n }\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n const workflowRuns = (await workflow.listWorkflowRuns({\n fromDate: fromDate ? (typeof fromDate === 'string' ? new Date(fromDate) : fromDate) : undefined,\n toDate: toDate ? (typeof toDate === 'string' ? new Date(toDate) : toDate) : undefined,\n perPage: finalPerPage,\n page: finalPage,\n resourceId,\n status,\n })) || {\n runs: [],\n total: 0,\n };\n return workflowRuns;\n } catch (error) {\n return handleError(error, 'Error getting workflow runs');\n }\n },\n});\n\nexport const GET_WORKFLOW_RUN_BY_ID_ROUTE = createRoute({\n method: 'GET',\n path: '/api/workflows/:workflowId/runs/:runId',\n responseType: 'json',\n pathParamSchema: workflowRunPathParams,\n responseSchema: workflowRunResponseSchema,\n summary: 'Get workflow run by ID',\n description: 'Returns details for a specific workflow run',\n tags: ['Workflows'],\n handler: async ({ mastra, workflowId, runId }) => {\n try {\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'Run ID is required' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const run = await workflow.getWorkflowRunById(runId);\n\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n\n return run;\n } catch (error) {\n return handleError(error, 'Error getting workflow run');\n }\n },\n});\n\nexport const DELETE_WORKFLOW_RUN_BY_ID_ROUTE = createRoute({\n method: 'DELETE',\n path: '/api/workflows/:workflowId/runs/:runId',\n responseType: 'json',\n pathParamSchema: workflowRunPathParams,\n responseSchema: workflowControlResponseSchema,\n summary: 'Delete workflow run by ID',\n description: 'Deletes a specific workflow run by ID',\n tags: ['Workflows'],\n handler: async ({ mastra, workflowId, runId }) => {\n try {\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'Run ID is required' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n await workflow.deleteWorkflowRunById(runId);\n\n return { message: 'Workflow run deleted' };\n } catch (error) {\n return handleError(error, 'Error deleting workflow run');\n }\n },\n});\n\nexport const CREATE_WORKFLOW_RUN_ROUTE = createRoute({\n method: 'POST',\n path: '/api/workflows/:workflowId/create-run',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: optionalRunIdSchema,\n bodySchema: createWorkflowRunBodySchema,\n responseSchema: createWorkflowRunResponseSchema,\n summary: 'Create workflow run',\n description: 'Creates a new workflow execution instance with an optional custom run ID',\n tags: ['Workflows'],\n handler: async ({ mastra, workflowId, runId, resourceId, disableScorers }) => {\n try {\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const run = await workflow.createRun({ runId, resourceId, disableScorers });\n\n return { runId: run.runId };\n } catch (error) {\n return handleError(error, 'Error creating workflow run');\n }\n },\n});\n\nexport const STREAM_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/api/workflows/:workflowId/stream',\n responseType: 'stream',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: streamWorkflowBodySchema,\n summary: 'Stream workflow execution',\n description: 'Executes a workflow and streams the results in real-time',\n tags: ['Workflows'],\n handler: async ({ mastra, workflowId, runId, resourceId, ...params }) => {\n try {\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to stream workflow' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n const serverCache = mastra.getServerCache();\n\n const run = await workflow.createRun({ runId, resourceId });\n const result = run.stream(params);\n return result.fullStream.pipeThrough(\n new TransformStream<ChunkType, ChunkType>({\n transform(chunk, controller) {\n if (serverCache) {\n const cacheKey = runId;\n serverCache.listPush(cacheKey, chunk).catch(() => {});\n }\n controller.enqueue(chunk);\n },\n }),\n );\n } catch (error) {\n return handleError(error, 'Error streaming workflow');\n }\n },\n});\n\nexport const STREAM_VNEXT_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/api/workflows/:workflowId/streamVNext',\n responseType: 'stream',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: streamWorkflowBodySchema,\n summary: 'Stream workflow execution (v2)',\n description: 'Executes a workflow using the v2 streaming API and streams the results in real-time',\n tags: ['Workflows'],\n handler: STREAM_WORKFLOW_ROUTE.handler,\n});\n\nexport const RESUME_STREAM_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/api/workflows/:workflowId/resume-stream',\n responseType: 'stream',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: resumeBodySchema,\n responseSchema: streamResponseSchema,\n summary: 'Resume workflow stream',\n description: 'Resumes a suspended workflow execution and continues streaming results',\n tags: ['Workflows'],\n handler: async ({ mastra, workflowId, runId, ...params }) => {\n try {\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to resume workflow' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const run = await workflow.getWorkflowRunById(runId);\n\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n\n const _run = await workflow.createRun({ runId, resourceId: run.resourceId });\n const serverCache = mastra.getServerCache();\n\n const stream = _run.resumeStream(params).fullStream.pipeThrough(\n new TransformStream<ChunkType, ChunkType>({\n transform(chunk, controller) {\n if (serverCache) {\n const cacheKey = runId;\n serverCache.listPush(cacheKey, chunk).catch(() => {});\n }\n\n controller.enqueue(chunk);\n },\n }),\n );\n\n return stream;\n } catch (error) {\n return handleError(error, 'Error resuming workflow');\n }\n },\n});\n\nexport const GET_WORKFLOW_RUN_EXECUTION_RESULT_ROUTE = createRoute({\n method: 'GET',\n path: '/api/workflows/:workflowId/runs/:runId/execution-result',\n responseType: 'json',\n pathParamSchema: workflowRunPathParams,\n queryParamSchema: workflowExecutionResultQuerySchema,\n responseSchema: workflowExecutionResultSchema,\n summary: 'Get workflow execution result',\n description:\n 'Returns the final execution result of a completed workflow run. Use the fields query parameter to reduce payload size by requesting only specific fields (e.g., ?fields=status,result)',\n tags: ['Workflows'],\n handler: async ({ mastra, workflowId, runId, fields, withNestedWorkflows }) => {\n try {\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'Run ID is required' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n // Parse fields parameter (comma-separated string)\n const fieldList = fields ? fields.split(',').map((f: string) => f.trim()) : undefined;\n\n const executionResult = await workflow.getWorkflowRunExecutionResult(runId, {\n withNestedWorkflows: withNestedWorkflows !== 'false', // Default to true unless explicitly 'false'\n fields: fieldList,\n });\n\n if (!executionResult) {\n throw new HTTPException(404, { message: 'Workflow run execution result not found' });\n }\n\n return executionResult;\n } catch (error) {\n return handleError(error, 'Error getting workflow run execution result');\n }\n },\n});\n\nexport const START_ASYNC_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/api/workflows/:workflowId/start-async',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: optionalRunIdSchema,\n bodySchema: startAsyncWorkflowBodySchema,\n responseSchema: workflowExecutionResultSchema,\n summary: 'Start workflow asynchronously',\n description: 'Starts a workflow execution asynchronously without streaming results',\n tags: ['Workflows'],\n handler: async ({ mastra, workflowId, runId, ...params }) => {\n try {\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const _run = await workflow.createRun({ runId });\n const result = await _run.start(params);\n return result;\n } catch (error) {\n return handleError(error, 'Error starting async workflow');\n }\n },\n});\n\nexport const START_WORKFLOW_RUN_ROUTE = createRoute({\n method: 'POST',\n path: '/api/workflows/:workflowId/start',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: startAsyncWorkflowBodySchema,\n responseSchema: workflowControlResponseSchema,\n summary: 'Start specific workflow run',\n description: 'Starts execution of a specific workflow run by ID',\n tags: ['Workflows'],\n handler: async ({ mastra, workflowId, runId, ...params }) => {\n try {\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to start run' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const run = await workflow.getWorkflowRunById(runId);\n\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n\n const _run = await workflow.createRun({ runId, resourceId: run.resourceId });\n void _run.start({\n ...params,\n });\n\n return { message: 'Workflow run started' };\n } catch (e) {\n return handleError(e, 'Error starting workflow run');\n }\n },\n});\n\nexport const OBSERVE_STREAM_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/api/workflows/:workflowId/observe',\n responseType: 'stream',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n responseSchema: streamResponseSchema,\n summary: 'Observe workflow stream',\n description: 'Observes and streams updates from an already running workflow execution',\n tags: ['Workflows'],\n handler: async ({ mastra, workflowId, runId }) => {\n try {\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to observe workflow stream' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const run = await workflow.getWorkflowRunById(runId);\n\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n\n const _run = await workflow.createRun({ runId, resourceId: run.resourceId });\n const serverCache = mastra.getServerCache();\n if (!serverCache) {\n throw new HTTPException(500, { message: 'Server cache not found' });\n }\n\n // Get cached chunks first\n const cachedRunChunks = await serverCache.listFromTo(runId, 0);\n\n // Create a readable stream that first emits cached chunks, then the live stream\n const combinedStream = new ReadableStream<ChunkType>({\n start(controller) {\n // First, emit all cached chunks\n const emitCachedChunks = async () => {\n for (const chunk of cachedRunChunks) {\n controller.enqueue(chunk as ChunkType);\n }\n };\n\n // Then, pipe the live stream\n const liveStream = _run.observeStream();\n const reader = liveStream.getReader();\n\n const pump = async () => {\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) {\n controller.close();\n break;\n }\n controller.enqueue(value);\n }\n } catch (error) {\n controller.error(error);\n } finally {\n reader.releaseLock();\n }\n };\n\n // Start with cached chunks, then live stream\n void emitCachedChunks()\n .then(() => {\n void pump();\n })\n .catch(error => {\n controller.error(error);\n });\n },\n });\n\n return combinedStream;\n } catch (error) {\n return handleError(error, 'Error observing workflow stream');\n }\n },\n});\n\nexport const OBSERVE_STREAM_VNEXT_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/api/workflows/:workflowId/observe-streamVNext',\n responseType: 'stream',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n responseSchema: streamResponseSchema,\n summary: 'Observe workflow stream (v2)',\n description: 'Observes and streams updates from an already running workflow execution using v2 streaming API',\n tags: ['Workflows'],\n handler: OBSERVE_STREAM_WORKFLOW_ROUTE.handler,\n});\n\nexport const RESUME_ASYNC_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/api/workflows/:workflowId/resume-async',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: resumeBodySchema,\n responseSchema: workflowExecutionResultSchema,\n summary: 'Resume workflow asynchronously',\n description: 'Resumes a suspended workflow execution asynchronously without streaming',\n tags: ['Workflows'],\n handler: async ({ mastra, workflowId, runId, ...params }) => {\n try {\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to resume workflow' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const run = await workflow.getWorkflowRunById(runId);\n\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n\n const _run = await workflow.createRun({ runId, resourceId: run.resourceId });\n const result = await _run.resume(params);\n\n return result;\n } catch (error) {\n return handleError(error, 'Error resuming workflow step');\n }\n },\n});\n\nexport const RESUME_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/api/workflows/:workflowId/resume',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: resumeBodySchema,\n responseSchema: workflowControlResponseSchema,\n summary: 'Resume workflow',\n description: 'Resumes a suspended workflow execution from a specific step',\n tags: ['Workflows'],\n handler: async ({ mastra, workflowId, runId, ...params }) => {\n try {\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to resume workflow' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const run = await workflow.getWorkflowRunById(runId);\n\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n\n const _run = await workflow.createRun({ runId, resourceId: run.resourceId });\n\n void _run.resume(params);\n\n return { message: 'Workflow run resumed' };\n } catch (error) {\n return handleError(error, 'Error resuming workflow');\n }\n },\n});\n\nexport const RESTART_ASYNC_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/api/workflows/:workflowId/restart-async',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: restartBodySchema,\n responseSchema: workflowExecutionResultSchema,\n summary: 'Restart workflow asynchronously',\n description: 'Restarts an active workflow execution asynchronously',\n tags: ['Workflows'],\n handler: async ({ mastra, workflowId, runId, ...params }) => {\n try {\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to restart workflow' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const run = await workflow.getWorkflowRunById(runId);\n\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n\n const _run = await workflow.createRun({ runId, resourceId: run.resourceId });\n const result = await _run.restart(params);\n\n return result;\n } catch (error) {\n return handleError(error, 'Error restarting workflow');\n }\n },\n});\n\nexport const RESTART_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/api/workflows/:workflowId/restart',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: restartBodySchema,\n responseSchema: workflowControlResponseSchema,\n summary: 'Restart workflow',\n description: 'Restarts an active workflow execution',\n tags: ['Workflows'],\n handler: async ({ mastra, workflowId, runId, ...params }) => {\n try {\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to restart workflow' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const run = await workflow.getWorkflowRunById(runId);\n\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n\n const _run = await workflow.createRun({ runId, resourceId: run.resourceId });\n\n void _run.restart(params);\n\n return { message: 'Workflow run restarted' };\n } catch (error) {\n return handleError(error, 'Error restarting workflow');\n }\n },\n});\n\nexport const RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ASYNC_ROUTE = createRoute({\n method: 'POST',\n path: '/api/workflows/:workflowId/restart-all-active-workflow-runs-async',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n responseSchema: workflowControlResponseSchema,\n summary: 'Restart all active workflow runs asynchronously',\n description: 'Restarts all active workflow runs asynchronously',\n tags: ['Workflows'],\n handler: async ({ mastra, workflowId }) => {\n try {\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n await workflow.restartAllActiveWorkflowRuns();\n\n return { message: 'All active workflow runs restarted' };\n } catch (error) {\n return handleError(error, 'Error restarting workflow');\n }\n },\n});\n\nexport const RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ROUTE = createRoute({\n method: 'POST',\n path: '/api/workflows/:workflowId/restart-all-active-workflow-runs',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n responseSchema: workflowControlResponseSchema,\n summary: 'Restart all active workflow runs',\n description: 'Restarts all active workflow runs',\n tags: ['Workflows'],\n handler: async ({ mastra, workflowId }) => {\n try {\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n void workflow.restartAllActiveWorkflowRuns();\n\n return { message: 'All active workflow runs restarted' };\n } catch (error) {\n return handleError(error, 'Error restarting workflow');\n }\n },\n});\n\nexport const TIME_TRAVEL_ASYNC_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/api/workflows/:workflowId/time-travel-async',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: timeTravelBodySchema,\n responseSchema: workflowExecutionResultSchema,\n summary: 'Time travel workflow asynchronously',\n description: 'Time travels a workflow run asynchronously without streaming',\n tags: ['Workflows'],\n handler: async ({ mastra, workflowId, runId, ...params }) => {\n try {\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to time travel workflow' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const run = await workflow.getWorkflowRunById(runId);\n\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n\n const _run = await workflow.createRun({ runId, resourceId: run.resourceId });\n const result = await _run.timeTravel(params);\n\n return result;\n } catch (error) {\n return handleError(error, 'Error time traveling workflow');\n }\n },\n});\n\nexport const TIME_TRAVEL_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/api/workflows/:workflowId/time-travel',\n responseType: 'json',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: timeTravelBodySchema,\n responseSchema: workflowControlResponseSchema,\n summary: 'Time travel workflow',\n description: 'Time travels a workflow run, starting from a specific step',\n tags: ['Workflows'],\n handler: async ({ mastra, workflowId, runId, ...params }) => {\n try {\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to time travel workflow' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const run = await workflow.getWorkflowRunById(runId);\n\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n\n const _run = await workflow.createRun({ runId, resourceId: run.resourceId });\n\n void _run.timeTravel(params);\n\n return { message: 'Workflow run time travel started' };\n } catch (error) {\n return handleError(error, 'Error time traveling workflow');\n }\n },\n});\n\nexport const TIME_TRAVEL_STREAM_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/api/workflows/:workflowId/time-travel-stream',\n responseType: 'stream',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: timeTravelBodySchema,\n summary: 'Time travel workflow stream',\n description: 'Time travels a workflow run, starting from a specific step, and streams the results in real-time',\n tags: ['Workflows'],\n handler: async ({ mastra, workflowId, runId, ...params }) => {\n try {\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to time travel workflow stream' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n const serverCache = mastra.getServerCache();\n\n const run = await workflow.createRun({ runId });\n const result = run.timeTravelStream(params);\n return result.fullStream.pipeThrough(\n new TransformStream<ChunkType, ChunkType>({\n transform(chunk, controller) {\n if (serverCache) {\n const cacheKey = runId;\n serverCache.listPush(cacheKey, chunk).catch(() => {});\n }\n controller.enqueue(chunk);\n },\n }),\n );\n } catch (error) {\n return handleError(error, 'Error time traveling workflow stream');\n }\n },\n});\n\nexport const CANCEL_WORKFLOW_RUN_ROUTE = createRoute({\n method: 'POST',\n path: '/api/workflows/:workflowId/runs/:runId/cancel',\n responseType: 'json',\n pathParamSchema: workflowRunPathParams,\n responseSchema: workflowControlResponseSchema,\n summary: 'Cancel workflow run',\n description: 'Cancels an in-progress workflow execution',\n tags: ['Workflows'],\n handler: async ({ mastra, workflowId, runId }) => {\n try {\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to cancel workflow run' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const run = await workflow.getWorkflowRunById(runId);\n\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n\n const _run = await workflow.createRun({ runId, resourceId: run.resourceId });\n\n await _run.cancel();\n\n return { message: 'Workflow run cancelled' };\n } catch (error) {\n return handleError(error, 'Error canceling workflow run');\n }\n },\n});\n\n// Legacy routes (deprecated)\nexport const STREAM_LEGACY_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/api/workflows/:workflowId/stream-legacy',\n responseType: 'stream',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n bodySchema: streamWorkflowBodySchema,\n responseSchema: streamResponseSchema,\n summary: '[DEPRECATED] Stream workflow with legacy format',\n description: 'Legacy endpoint for streaming workflow execution. Use /api/workflows/:workflowId/stream instead.',\n tags: ['Workflows', 'Legacy'],\n handler: async ({ mastra, workflowId, runId, ...params }) => {\n try {\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to resume workflow' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const serverCache = mastra.getServerCache();\n\n const run = await workflow.createRun({ runId });\n const result = run.streamLegacy({\n ...params,\n onChunk: async chunk => {\n if (serverCache) {\n const cacheKey = runId;\n await serverCache.listPush(cacheKey, chunk);\n }\n },\n });\n\n return result.stream;\n } catch (error) {\n return handleError(error, 'Error executing workflow');\n }\n },\n});\n\nexport const OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE = createRoute({\n method: 'POST',\n path: '/api/workflows/:workflowId/observe-stream-legacy',\n responseType: 'stream',\n pathParamSchema: workflowIdPathParams,\n queryParamSchema: runIdSchema,\n responseSchema: streamResponseSchema,\n summary: '[DEPRECATED] Observe workflow stream with legacy format',\n description: 'Legacy endpoint for observing workflow stream. Use /api/workflows/:workflowId/observe instead.',\n tags: ['Workflows', 'Legacy'],\n handler: async ({ mastra, workflowId, runId }) => {\n try {\n if (!workflowId) {\n throw new HTTPException(400, { message: 'Workflow ID is required' });\n }\n\n if (!runId) {\n throw new HTTPException(400, { message: 'runId required to observe workflow stream' });\n }\n\n const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });\n\n if (!workflow) {\n throw new HTTPException(404, { message: 'Workflow not found' });\n }\n\n const run = await workflow.getWorkflowRunById(runId);\n\n if (!run) {\n throw new HTTPException(404, { message: 'Workflow run not found' });\n }\n\n const _run = await workflow.createRun({ runId, resourceId: run.resourceId });\n const serverCache = mastra.getServerCache();\n if (!serverCache) {\n throw new HTTPException(500, { message: 'Server cache not found' });\n }\n\n const transformStream = new TransformStream<StreamEvent, StreamEvent>();\n\n const writer = transformStream.writable.getWriter();\n\n const cachedRunChunks = await serverCache.listFromTo(runId, 0);\n\n for (const chunk of cachedRunChunks) {\n await writer.write(chunk as any);\n }\n\n writer.releaseLock();\n\n const result = _run.observeStreamLegacy();\n return result.stream?.pipeThrough(transformStream);\n } catch (error) {\n return handleError(error, 'Error observing workflow stream');\n }\n },\n});\n","import z from 'zod';\nimport { createCombinedPaginationSchema, tracingOptionsSchema, messageResponseSchema } from './common';\n\nexport const workflowRunStatusSchema = z.enum([\n 'running',\n 'waiting',\n 'suspended',\n 'success',\n 'failed',\n 'canceled',\n 'pending',\n 'bailed',\n 'tripwire',\n]);\n\n// Path parameter schemas\nexport const workflowIdPathParams = z.object({\n workflowId: z.string().describe('Unique identifier for the workflow'),\n});\n\nexport const workflowRunPathParams = workflowIdPathParams.extend({\n runId: z.string().describe('Unique identifier for the workflow run'),\n});\n\n/**\n * Schema for serialized step\n * Uses passthrough() to allow step-specific fields\n */\nconst serializedStepSchema = z.object({\n id: z.string(),\n description: z.string().optional(),\n});\n\n/**\n * Schema for serialized step flow entry\n * Represents different step flow types in the workflow graph\n */\nconst serializedStepFlowEntrySchema = z.object({\n type: z.enum(['step', 'sleep', 'sleepUntil', 'waitForEvent', 'parallel', 'conditional', 'loop', 'foreach']),\n});\n\n/**\n * Schema for workflow information\n * Returned by getWorkflowByIdHandler and listWorkflowsHandler\n */\nexport const workflowInfoSchema = z.object({\n steps: z.record(z.string(), serializedStepSchema),\n allSteps: z.record(z.string(), serializedStepSchema),\n name: z.string().optional(),\n description: z.string().optional(),\n stepGraph: z.array(serializedStepFlowEntrySchema),\n inputSchema: z.string().optional(),\n outputSchema: z.string().optional(),\n options: z.object({}).optional(),\n isProcessorWorkflow: z.boolean().optional(),\n});\n\n/**\n * Schema for list workflows endpoint response\n * Returns a record of workflow ID to workflow info\n */\nexport const listWorkflowsResponseSchema = z.record(z.string(), workflowInfoSchema);\n\n/**\n * Schema for workflow run object\n */\nconst workflowRunSchema = z.object({\n workflowName: z.string(),\n runId: z.string(),\n snapshot: z.union([z.object({}), z.string()]),\n createdAt: z.date(),\n updatedAt: z.date(),\n resourceId: z.string().optional(),\n});\n\n/**\n * Schema for workflow runs response (paginated)\n * Includes runs array and total count\n */\nexport const workflowRunsResponseSchema = z.object({\n runs: z.array(workflowRunSchema),\n total: z.number(),\n});\n\n/**\n * Schema for single workflow run response\n */\nexport const workflowRunResponseSchema = workflowRunSchema;\n\n/**\n * Schema for query parameters when listing workflow runs\n * Supports both page/perPage and limit/offset for backwards compatibility\n * If page/perPage provided, use directly; otherwise convert from limit/offset\n */\nexport const listWorkflowRunsQuerySchema = createCombinedPaginationSchema().extend({\n fromDate: z.coerce.date().optional(),\n toDate: z.coerce.date().optional(),\n resourceId: z.string().optional(),\n status: workflowRunStatusSchema.optional(),\n});\n\n/**\n * Base schema for workflow execution with input data and tracing\n */\nconst workflowExecutionBodySchema = z.object({\n resourceId: z.string().optional(),\n inputData: z.unknown().optional(),\n initialState: z.unknown().optional(),\n requestContext: z.record(z.string(), z.unknown()).optional(),\n tracingOptions: tracingOptionsSchema.optional(),\n});\n\n/**\n * Schema for legacy stream workflow body (no closeOnSuspend support)\n * Used by /stream-legacy endpoints\n */\nexport const streamLegacyWorkflowBodySchema = workflowExecutionBodySchema;\n\n/**\n * Schema for stream workflow body\n * Used by both /stream and /streamVNext endpoints\n */\nexport const streamWorkflowBodySchema = workflowExecutionBodySchema.extend({\n closeOnSuspend: z.boolean().optional(),\n});\n\n/**\n * Schema for resume workflow body\n * Used by resume-stream, resume-async and resume endpoints\n */\nexport const resumeBodySchema = z.object({\n step: z.union([z.string(), z.array(z.string())]).optional(), // Optional - workflow can auto-resume all suspended steps\n resumeData: z.unknown().optional(),\n requestContext: z.record(z.string(), z.unknown()).optional(),\n tracingOptions: tracingOptionsSchema.optional(),\n});\n\n/**\n * Schema for restart workflow body\n * Used by restart-async and restart endpoints\n */\nexport const restartBodySchema = z.object({\n requestContext: z.record(z.string(), z.unknown()).optional(),\n tracingOptions: tracingOptionsSchema.optional(),\n});\n\n/**\n * Schema for time travel workflow body\n * Used by time-travel-stream, time-travel-async and time-travel endpoints\n */\nexport const timeTravelBodySchema = z.object({\n inputData: z.unknown().optional(),\n resumeData: z.unknown().optional(),\n initialState: z.unknown().optional(),\n step: z.union([z.string(), z.array(z.string())]),\n context: z.record(z.string(), z.any()).optional(),\n nestedStepsContext: z.record(z.string(), z.record(z.string(), z.any())).optional(),\n requestContext: z.record(z.string(), z.unknown()).optional(),\n tracingOptions: tracingOptionsSchema.optional(),\n});\n\n/**\n * Schema for start async workflow body\n */\nexport const startAsyncWorkflowBodySchema = workflowExecutionBodySchema;\n\n/**\n * Schema for send workflow run event body\n */\nexport const sendWorkflowRunEventBodySchema = z.object({\n event: z.string(),\n data: z.unknown(),\n});\n\n/**\n * Schema for workflow execution result query parameters\n * Allows filtering which fields to return to reduce payload size\n */\nexport const workflowExecutionResultQuerySchema = z.object({\n fields: z\n .string()\n .optional()\n .refine(\n value => {\n if (!value) return true;\n const validFields = new Set([\n 'status',\n 'result',\n 'error',\n 'payload',\n 'steps',\n 'activeStepsPath',\n 'serializedStepGraph',\n ]);\n const requestedFields = value.split(',').map(f => f.trim());\n return requestedFields.every(field => validFields.has(field));\n },\n {\n message:\n 'Invalid field name. Available fields: status, result, error, payload, steps, activeStepsPath, serializedStepGraph',\n },\n )\n .describe(\n 'Comma-separated list of fields to return. Available fields: status, result, error, payload, steps, activeStepsPath, serializedStepGraph. If not provided, returns all fields.',\n ),\n withNestedWorkflows: z\n .enum(['true', 'false'])\n .optional()\n .describe(\n 'Whether to include nested workflow data in steps. Defaults to true. Set to false for better performance.',\n ),\n});\n\n/**\n * Schema for workflow execution result\n * All fields are optional since field filtering allows requesting specific fields only\n */\nexport const workflowExecutionResultSchema = z.object({\n status: workflowRunStatusSchema.optional(),\n result: z.unknown().optional(),\n error: z.unknown().optional(),\n payload: z.unknown().optional(),\n steps: z.record(z.string(), z.any()).optional(),\n activeStepsPath: z.record(z.string(), z.array(z.number())).optional(),\n serializedStepGraph: z.array(serializedStepFlowEntrySchema).optional(),\n});\n\n/**\n * Response schema for workflow control operations\n */\nexport const workflowControlResponseSchema = messageResponseSchema;\n\n/**\n * Response schema for create workflow run operation\n * Returns only the runId after creating a run\n */\nexport const createWorkflowRunResponseSchema = z.object({\n runId: z.string(),\n});\n\n/**\n * Schema for create workflow run body\n * Used by /create-run endpoint\n */\nexport const createWorkflowRunBodySchema = z.object({\n resourceId: z.string().optional(),\n disableScorers: z.boolean().optional(),\n});\n"]}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkO7I5CWRX_cjs = require('./chunk-O7I5CWRX.cjs');
|
|
4
|
+
|
|
5
|
+
// ../memory/dist/chunk-E53QBCQN.js
|
|
6
|
+
var __require2 = /* @__PURE__ */ ((x) => typeof chunkO7I5CWRX_cjs.__require !== "undefined" ? chunkO7I5CWRX_cjs.__require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
7
|
+
get: (a, b) => (typeof chunkO7I5CWRX_cjs.__require !== "undefined" ? chunkO7I5CWRX_cjs.__require : a)[b]
|
|
8
|
+
}) : x)(function(x) {
|
|
9
|
+
if (typeof chunkO7I5CWRX_cjs.__require !== "undefined") return chunkO7I5CWRX_cjs.__require.apply(this, arguments);
|
|
10
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
11
|
+
});
|
|
12
|
+
var __create = Object.create;
|
|
13
|
+
var __defProp = Object.defineProperty;
|
|
14
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
15
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
16
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
17
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
18
|
+
var __require22 = /* @__PURE__ */ ((x) => typeof __require2 !== "undefined" ? __require2 : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
19
|
+
get: (a, b) => (typeof __require2 !== "undefined" ? __require2 : a)[b]
|
|
20
|
+
}) : x)(function(x) {
|
|
21
|
+
if (typeof __require2 !== "undefined") return __require2.apply(this, arguments);
|
|
22
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
23
|
+
});
|
|
24
|
+
var __commonJS = (cb, mod) => function __require222() {
|
|
25
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
26
|
+
};
|
|
27
|
+
var __copyProps = (to, from, except, desc) => {
|
|
28
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
29
|
+
for (let key of __getOwnPropNames(from))
|
|
30
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
31
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
32
|
+
}
|
|
33
|
+
return to;
|
|
34
|
+
};
|
|
35
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
36
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
37
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
38
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
39
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
40
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
41
|
+
mod
|
|
42
|
+
));
|
|
43
|
+
var require_token_error = __commonJS({
|
|
44
|
+
"../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/token-error.js"(exports, module) {
|
|
45
|
+
var __defProp2 = Object.defineProperty;
|
|
46
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
47
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
48
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
49
|
+
var __export = (target, all) => {
|
|
50
|
+
for (var name in all)
|
|
51
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
52
|
+
};
|
|
53
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
54
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
55
|
+
for (let key of __getOwnPropNames2(from))
|
|
56
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
57
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
58
|
+
}
|
|
59
|
+
return to;
|
|
60
|
+
};
|
|
61
|
+
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
62
|
+
var token_error_exports = {};
|
|
63
|
+
__export(token_error_exports, {
|
|
64
|
+
VercelOidcTokenError: () => VercelOidcTokenError
|
|
65
|
+
});
|
|
66
|
+
module.exports = __toCommonJS(token_error_exports);
|
|
67
|
+
var VercelOidcTokenError = class extends Error {
|
|
68
|
+
constructor(message, cause) {
|
|
69
|
+
super(message);
|
|
70
|
+
this.name = "VercelOidcTokenError";
|
|
71
|
+
this.cause = cause;
|
|
72
|
+
}
|
|
73
|
+
toString() {
|
|
74
|
+
if (this.cause) {
|
|
75
|
+
return `${this.name}: ${this.message}: ${this.cause}`;
|
|
76
|
+
}
|
|
77
|
+
return `${this.name}: ${this.message}`;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
exports.__commonJS = __commonJS;
|
|
84
|
+
exports.__require2 = __require22;
|
|
85
|
+
exports.__toESM = __toESM;
|
|
86
|
+
exports.require_token_error = require_token_error;
|
|
87
|
+
//# sourceMappingURL=chunk-Q7NPRJRV.cjs.map
|
|
88
|
+
//# sourceMappingURL=chunk-Q7NPRJRV.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../_vendored/ai_v5/dist/chunk-7D4SUZUM.js","../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/token-error.js"],"names":["__require","__require2","__defProp","__getOwnPropDesc","__getOwnPropNames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KAAK,KAAK,CAAA,CAAA;AACrD,QAAA;AACA,QAAA,OAAO,CAAA,EAAG,IAAA,CAAK,IAAI,CAAA,EAAA,EAAK,KAAK,OAAO,CAAA,CAAA;AACtC,MAAA;AAAA,KAAA;AACF,EAAA;AAAA,CAAA","file":"chunk-Q7NPRJRV.cjs","sourcesContent":["var __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __require = /* @__PURE__ */ ((x) => typeof require !== \"undefined\" ? require : typeof Proxy !== \"undefined\" ? new Proxy(x, {\n get: (a, b) => (typeof require !== \"undefined\" ? require : a)[b]\n}) : x)(function(x) {\n if (typeof require !== \"undefined\") return require.apply(this, arguments);\n throw Error('Dynamic require of \"' + x + '\" is not supported');\n});\nvar __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\n\nexport { __commonJS, __require, __toESM };\n//# sourceMappingURL=chunk-7D4SUZUM.js.map\n//# sourceMappingURL=chunk-7D4SUZUM.js.map","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_error_exports = {};\n__export(token_error_exports, {\n VercelOidcTokenError: () => VercelOidcTokenError\n});\nmodule.exports = __toCommonJS(token_error_exports);\nclass VercelOidcTokenError extends Error {\n constructor(message, cause) {\n super(message);\n this.name = \"VercelOidcTokenError\";\n this.cause = cause;\n }\n toString() {\n if (this.cause) {\n return `${this.name}: ${this.message}: ${this.cause}`;\n }\n return `${this.name}: ${this.message}`;\n }\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n VercelOidcTokenError\n});\n"]}
|
|
@@ -398,7 +398,7 @@ async function handleMessageSend({
|
|
|
398
398
|
});
|
|
399
399
|
try {
|
|
400
400
|
const resourceId = metadata?.resourceId ?? message.metadata?.resourceId ?? agentId;
|
|
401
|
-
const
|
|
401
|
+
const result = await agent.generate([convertToCoreMessage(message)], {
|
|
402
402
|
runId: taskId,
|
|
403
403
|
requestContext,
|
|
404
404
|
...contextId ? { threadId: contextId, resourceId } : {}
|
|
@@ -411,12 +411,21 @@ async function handleMessageSend({
|
|
|
411
411
|
parts: [
|
|
412
412
|
{
|
|
413
413
|
kind: "text",
|
|
414
|
-
text
|
|
414
|
+
text: result.text
|
|
415
415
|
}
|
|
416
416
|
],
|
|
417
417
|
kind: "message"
|
|
418
418
|
}
|
|
419
419
|
});
|
|
420
|
+
currentData.metadata = {
|
|
421
|
+
...currentData.metadata,
|
|
422
|
+
execution: {
|
|
423
|
+
toolCalls: result.toolCalls,
|
|
424
|
+
toolResults: result.toolResults,
|
|
425
|
+
usage: result.usage,
|
|
426
|
+
finishReason: result.finishReason
|
|
427
|
+
}
|
|
428
|
+
};
|
|
420
429
|
await taskStore.save({ agentId, data: currentData });
|
|
421
430
|
} catch (handlerError) {
|
|
422
431
|
const failureStatusUpdate = {
|
|
@@ -662,5 +671,5 @@ var AGENT_EXECUTION_ROUTE = createRoute({
|
|
|
662
671
|
});
|
|
663
672
|
|
|
664
673
|
export { AGENT_EXECUTION_ROUTE, GET_AGENT_CARD_ROUTE, a2a_exports, getAgentCardByIdHandler, getAgentExecutionHandler, handleMessageSend, handleMessageStream, handleTaskCancel, handleTaskGet };
|
|
665
|
-
//# sourceMappingURL=chunk-
|
|
666
|
-
//# sourceMappingURL=chunk-
|
|
674
|
+
//# sourceMappingURL=chunk-S5XBFHJL.js.map
|
|
675
|
+
//# sourceMappingURL=chunk-S5XBFHJL.js.map
|