@mastra/server 0.0.0-fix-message-embedding-20250506021742 → 0.0.0-fix-fetch-workflow-runs-20250624231457
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/README.md +48 -135
- package/dist/_tsup-dts-rollup.d.cts +444 -108
- package/dist/_tsup-dts-rollup.d.ts +444 -108
- package/dist/chunk-4DTDPTQC.cjs +332 -0
- package/dist/{chunk-4JINXASC.js → chunk-55DOQLP6.js} +5 -4
- package/dist/{chunk-QN4KF3BH.cjs → chunk-57CJTIPW.cjs} +2 -2
- package/dist/{chunk-ZLBRQFDD.cjs → chunk-64U3UDTH.cjs} +2 -2
- package/dist/chunk-75ZPJI57.cjs +9 -0
- package/dist/{chunk-AMVOS7YB.cjs → chunk-B4MQFJ7G.cjs} +12 -8
- package/dist/{chunk-BPL2CBLV.js → chunk-BFOA2QQY.js} +8 -4
- package/dist/{chunk-M56ECCHK.cjs → chunk-BNEY4P4P.cjs} +20 -19
- package/dist/{chunk-QJ3AHN64.js → chunk-C7564HUT.js} +4 -3
- package/dist/{chunk-D3G23FP3.cjs → chunk-CPPYMJX5.cjs} +24 -22
- package/dist/chunk-GHC4YV6R.js +504 -0
- package/dist/chunk-GKM45O24.cjs +278 -0
- package/dist/{chunk-L7XE5QTW.js → chunk-H5PTF3Y4.js} +1 -1
- package/dist/chunk-IMBY5XUG.cjs +86 -0
- package/dist/{chunk-3AHQ5RGN.js → chunk-M5ABIP7D.js} +1 -1
- package/dist/chunk-MLKGABMK.js +7 -0
- package/dist/chunk-MN6F4D5A.cjs +2004 -0
- package/dist/{chunk-3XTEV33Q.js → chunk-N2YBMSO2.js} +54 -51
- package/dist/{chunk-TRDNDNGQ.js → chunk-NYN7KFXL.js} +1 -7
- package/dist/{chunk-FV45V6WC.cjs → chunk-OCWPVYNI.cjs} +0 -7
- package/dist/chunk-OSZM4EAY.js +2001 -0
- package/dist/{chunk-Y3SV5XK4.js → chunk-PMUATKV2.js} +104 -15
- package/dist/chunk-QLG2PFHE.js +81 -0
- package/dist/{chunk-Q6SHQECN.js → chunk-R5VGYBV6.js} +34 -10
- package/dist/{chunk-2FJURXCL.cjs → chunk-RQ2Z56EC.cjs} +93 -55
- package/dist/chunk-SDPGVWQJ.cjs +512 -0
- package/dist/{chunk-IQTNZSFP.js → chunk-SOBBILUG.js} +160 -51
- package/dist/chunk-TO5U6HW3.cjs +435 -0
- package/dist/{chunk-5YGDYMRB.cjs → chunk-VPNDC2DI.cjs} +14 -13
- package/dist/chunk-WJY57THV.cjs +118 -0
- package/dist/{chunk-5JNVY6DU.js → chunk-XR7VJOOP.js} +7 -5
- package/dist/{chunk-RBQASTUP.js → chunk-XUIJ7WRT.js} +63 -25
- package/dist/server/handlers/a2a.cjs +30 -0
- package/dist/server/handlers/a2a.d.cts +6 -0
- package/dist/server/handlers/a2a.d.ts +6 -0
- package/dist/server/handlers/a2a.js +1 -0
- package/dist/server/handlers/agents.cjs +7 -7
- package/dist/server/handlers/agents.js +1 -1
- package/dist/server/handlers/error.cjs +2 -2
- package/dist/server/handlers/error.js +1 -1
- package/dist/server/handlers/legacyWorkflows.cjs +46 -0
- package/dist/server/handlers/legacyWorkflows.d.cts +10 -0
- package/dist/server/handlers/legacyWorkflows.d.ts +10 -0
- package/dist/server/handlers/legacyWorkflows.js +1 -0
- package/dist/server/handlers/logs.cjs +4 -4
- package/dist/server/handlers/logs.js +1 -1
- package/dist/server/handlers/memory.cjs +9 -9
- package/dist/server/handlers/memory.js +1 -1
- package/dist/server/handlers/network.cjs +5 -5
- package/dist/server/handlers/network.js +1 -1
- package/dist/server/handlers/telemetry.cjs +3 -3
- package/dist/server/handlers/telemetry.js +1 -1
- package/dist/server/handlers/tools.cjs +5 -5
- package/dist/server/handlers/tools.js +1 -1
- package/dist/server/handlers/utils.cjs +2 -2
- package/dist/server/handlers/utils.js +1 -1
- package/dist/server/handlers/vNextNetwork.cjs +175 -0
- package/dist/server/handlers/vNextNetwork.d.cts +5 -0
- package/dist/server/handlers/vNextNetwork.d.ts +5 -0
- package/dist/server/handlers/vNextNetwork.js +169 -0
- package/dist/server/handlers/vector.cjs +7 -7
- package/dist/server/handlers/vector.js +1 -1
- package/dist/server/handlers/voice.cjs +8 -4
- package/dist/server/handlers/voice.d.cts +1 -0
- package/dist/server/handlers/voice.d.ts +1 -0
- package/dist/server/handlers/voice.js +1 -1
- package/dist/server/handlers/workflows.cjs +21 -13
- package/dist/server/handlers/workflows.d.cts +4 -2
- package/dist/server/handlers/workflows.d.ts +4 -2
- package/dist/server/handlers/workflows.js +1 -1
- package/dist/server/handlers.cjs +32 -27
- package/dist/server/handlers.d.cts +2 -1
- package/dist/server/handlers.d.ts +2 -1
- package/dist/server/handlers.js +11 -10
- package/package.json +13 -12
- package/dist/chunk-3EJZQ6TQ.js +0 -49
- package/dist/chunk-4BIX6GMY.cjs +0 -189
- package/dist/chunk-55HTWX4C.cjs +0 -93
- package/dist/chunk-5SWCVTNL.cjs +0 -5579
- package/dist/chunk-CHFORQ7J.cjs +0 -329
- package/dist/chunk-FOXHTOQZ.cjs +0 -324
- package/dist/chunk-OMN3UI6X.js +0 -5576
- package/dist/chunk-SKBVVI24.cjs +0 -54
- package/dist/server/handlers/vNextWorkflows.cjs +0 -46
- package/dist/server/handlers/vNextWorkflows.d.cts +0 -10
- package/dist/server/handlers/vNextWorkflows.d.ts +0 -10
- package/dist/server/handlers/vNextWorkflows.js +0 -1
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { stringify, esm_default } from './chunk-
|
|
2
|
-
import { handleError } from './chunk-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { stringify, esm_default } from './chunk-OSZM4EAY.js';
|
|
2
|
+
import { handleError } from './chunk-M5ABIP7D.js';
|
|
3
|
+
import { HTTPException } from './chunk-NYN7KFXL.js';
|
|
4
|
+
import { __export } from './chunk-MLKGABMK.js';
|
|
5
|
+
import { ReadableStream } from 'stream/web';
|
|
5
6
|
|
|
6
|
-
// src/server/handlers/
|
|
7
|
-
var
|
|
8
|
-
__export(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
// src/server/handlers/legacyWorkflows.ts
|
|
8
|
+
var legacyWorkflows_exports = {};
|
|
9
|
+
__export(legacyWorkflows_exports, {
|
|
10
|
+
createLegacyWorkflowRunHandler: () => createLegacyWorkflowRunHandler,
|
|
11
|
+
getLegacyWorkflowByIdHandler: () => getLegacyWorkflowByIdHandler,
|
|
12
|
+
getLegacyWorkflowRunHandler: () => getLegacyWorkflowRunHandler,
|
|
13
|
+
getLegacyWorkflowRunsHandler: () => getLegacyWorkflowRunsHandler,
|
|
14
|
+
getLegacyWorkflowsHandler: () => getLegacyWorkflowsHandler,
|
|
15
|
+
resumeAsyncLegacyWorkflowHandler: () => resumeAsyncLegacyWorkflowHandler,
|
|
16
|
+
resumeLegacyWorkflowHandler: () => resumeLegacyWorkflowHandler,
|
|
17
|
+
startAsyncLegacyWorkflowHandler: () => startAsyncLegacyWorkflowHandler,
|
|
18
|
+
startLegacyWorkflowRunHandler: () => startLegacyWorkflowRunHandler,
|
|
19
|
+
watchLegacyWorkflowHandler: () => watchLegacyWorkflowHandler
|
|
19
20
|
});
|
|
20
|
-
async function
|
|
21
|
+
async function getLegacyWorkflowsHandler({ mastra }) {
|
|
21
22
|
try {
|
|
22
|
-
const workflows = mastra.
|
|
23
|
+
const workflows = mastra.legacy_getWorkflows({ serialized: false });
|
|
23
24
|
const _workflows = Object.entries(workflows).reduce((acc, [key, workflow]) => {
|
|
24
25
|
if (workflow.isNested) return acc;
|
|
25
26
|
acc[key] = {
|
|
@@ -48,12 +49,12 @@ async function getWorkflowsHandler({ mastra }) {
|
|
|
48
49
|
throw new HTTPException(500, { message: error?.message || "Error getting workflows" });
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
|
-
async function
|
|
52
|
+
async function getLegacyWorkflowByIdHandler({ mastra, workflowId }) {
|
|
52
53
|
try {
|
|
53
54
|
if (!workflowId) {
|
|
54
55
|
throw new HTTPException(400, { message: "Workflow ID is required" });
|
|
55
56
|
}
|
|
56
|
-
const workflow = mastra.
|
|
57
|
+
const workflow = mastra.legacy_getWorkflow(workflowId);
|
|
57
58
|
if (!workflow) {
|
|
58
59
|
throw new HTTPException(404, { message: "Workflow not found" });
|
|
59
60
|
}
|
|
@@ -80,7 +81,7 @@ async function getWorkflowByIdHandler({ mastra, workflowId }) {
|
|
|
80
81
|
throw new HTTPException(500, { message: error?.message || "Error getting workflow" });
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
|
-
async function
|
|
84
|
+
async function startAsyncLegacyWorkflowHandler({
|
|
84
85
|
mastra,
|
|
85
86
|
runtimeContext,
|
|
86
87
|
workflowId,
|
|
@@ -91,19 +92,19 @@ async function startAsyncWorkflowHandler({
|
|
|
91
92
|
if (!workflowId) {
|
|
92
93
|
throw new HTTPException(400, { message: "Workflow ID is required" });
|
|
93
94
|
}
|
|
94
|
-
const workflow = mastra.
|
|
95
|
+
const workflow = mastra.legacy_getWorkflow(workflowId);
|
|
95
96
|
if (!workflow) {
|
|
96
97
|
throw new HTTPException(404, { message: "Workflow not found" });
|
|
97
98
|
}
|
|
98
99
|
if (!runId) {
|
|
99
|
-
const
|
|
100
|
-
const result2 = await start({
|
|
100
|
+
const newRun = workflow.createRun();
|
|
101
|
+
const result2 = await newRun.start({
|
|
101
102
|
triggerData,
|
|
102
103
|
runtimeContext
|
|
103
104
|
});
|
|
104
105
|
return result2;
|
|
105
106
|
}
|
|
106
|
-
const run = workflow.
|
|
107
|
+
const run = workflow.getMemoryRun(runId);
|
|
107
108
|
if (!run) {
|
|
108
109
|
throw new HTTPException(404, { message: "Workflow run not found" });
|
|
109
110
|
}
|
|
@@ -116,7 +117,7 @@ async function startAsyncWorkflowHandler({
|
|
|
116
117
|
throw new HTTPException(500, { message: error?.message || "Error executing workflow" });
|
|
117
118
|
}
|
|
118
119
|
}
|
|
119
|
-
async function
|
|
120
|
+
async function getLegacyWorkflowRunHandler({
|
|
120
121
|
mastra,
|
|
121
122
|
workflowId,
|
|
122
123
|
runId
|
|
@@ -128,11 +129,11 @@ async function getWorkflowRunHandler({
|
|
|
128
129
|
if (!runId) {
|
|
129
130
|
throw new HTTPException(400, { message: "Run ID is required" });
|
|
130
131
|
}
|
|
131
|
-
const workflow = mastra.
|
|
132
|
+
const workflow = mastra.legacy_getWorkflow(workflowId);
|
|
132
133
|
if (!workflow) {
|
|
133
134
|
throw new HTTPException(404, { message: "Workflow not found" });
|
|
134
135
|
}
|
|
135
|
-
const run = workflow.getRun(runId);
|
|
136
|
+
const run = await workflow.getRun(runId);
|
|
136
137
|
if (!run) {
|
|
137
138
|
throw new HTTPException(404, { message: "Workflow run not found" });
|
|
138
139
|
}
|
|
@@ -141,7 +142,7 @@ async function getWorkflowRunHandler({
|
|
|
141
142
|
throw new HTTPException(500, { message: error?.message || "Error getting workflow run" });
|
|
142
143
|
}
|
|
143
144
|
}
|
|
144
|
-
async function
|
|
145
|
+
async function createLegacyWorkflowRunHandler({
|
|
145
146
|
mastra,
|
|
146
147
|
workflowId,
|
|
147
148
|
runId: prevRunId
|
|
@@ -150,17 +151,17 @@ async function createRunHandler({
|
|
|
150
151
|
if (!workflowId) {
|
|
151
152
|
throw new HTTPException(400, { message: "Workflow ID is required" });
|
|
152
153
|
}
|
|
153
|
-
const workflow = mastra.
|
|
154
|
+
const workflow = mastra.legacy_getWorkflow(workflowId);
|
|
154
155
|
if (!workflow) {
|
|
155
156
|
throw new HTTPException(404, { message: "Workflow not found" });
|
|
156
157
|
}
|
|
157
|
-
const
|
|
158
|
-
return { runId };
|
|
158
|
+
const newRun = workflow.createRun({ runId: prevRunId });
|
|
159
|
+
return { runId: newRun.runId };
|
|
159
160
|
} catch (error) {
|
|
160
161
|
throw new HTTPException(500, { message: error?.message || "Error creating workflow run" });
|
|
161
162
|
}
|
|
162
163
|
}
|
|
163
|
-
async function
|
|
164
|
+
async function startLegacyWorkflowRunHandler({
|
|
164
165
|
mastra,
|
|
165
166
|
runtimeContext,
|
|
166
167
|
workflowId,
|
|
@@ -174,12 +175,12 @@ async function startWorkflowRunHandler({
|
|
|
174
175
|
if (!runId) {
|
|
175
176
|
throw new HTTPException(400, { message: "runId required to start run" });
|
|
176
177
|
}
|
|
177
|
-
const workflow = mastra.
|
|
178
|
-
const run = workflow.
|
|
178
|
+
const workflow = mastra.legacy_getWorkflow(workflowId);
|
|
179
|
+
const run = workflow.getMemoryRun(runId);
|
|
179
180
|
if (!run) {
|
|
180
181
|
throw new HTTPException(404, { message: "Workflow run not found" });
|
|
181
182
|
}
|
|
182
|
-
|
|
183
|
+
void run.start({
|
|
183
184
|
triggerData,
|
|
184
185
|
runtimeContext
|
|
185
186
|
});
|
|
@@ -188,7 +189,7 @@ async function startWorkflowRunHandler({
|
|
|
188
189
|
return handleError(e, "Error starting workflow run");
|
|
189
190
|
}
|
|
190
191
|
}
|
|
191
|
-
async function
|
|
192
|
+
async function watchLegacyWorkflowHandler({
|
|
192
193
|
mastra,
|
|
193
194
|
workflowId,
|
|
194
195
|
runId
|
|
@@ -200,8 +201,8 @@ async function watchWorkflowHandler({
|
|
|
200
201
|
if (!runId) {
|
|
201
202
|
throw new HTTPException(400, { message: "runId required to watch workflow" });
|
|
202
203
|
}
|
|
203
|
-
const workflow = mastra.
|
|
204
|
-
const run = workflow.
|
|
204
|
+
const workflow = mastra.legacy_getWorkflow(workflowId);
|
|
205
|
+
const run = workflow.getMemoryRun(runId);
|
|
205
206
|
if (!run) {
|
|
206
207
|
throw new HTTPException(404, { message: "Workflow run not found" });
|
|
207
208
|
}
|
|
@@ -217,8 +218,10 @@ async function watchWorkflowHandler({
|
|
|
217
218
|
asyncRef = null;
|
|
218
219
|
}
|
|
219
220
|
asyncRef = setImmediate(() => {
|
|
220
|
-
|
|
221
|
+
const runDone = Object.values(activePathsObj).every((value) => value.status !== "executing");
|
|
222
|
+
if (runDone) {
|
|
221
223
|
controller.close();
|
|
224
|
+
unwatch?.();
|
|
222
225
|
}
|
|
223
226
|
});
|
|
224
227
|
});
|
|
@@ -232,7 +235,7 @@ async function watchWorkflowHandler({
|
|
|
232
235
|
return handleError(error, "Error watching workflow");
|
|
233
236
|
}
|
|
234
237
|
}
|
|
235
|
-
async function
|
|
238
|
+
async function resumeAsyncLegacyWorkflowHandler({
|
|
236
239
|
mastra,
|
|
237
240
|
workflowId,
|
|
238
241
|
runId,
|
|
@@ -246,8 +249,8 @@ async function resumeAsyncWorkflowHandler({
|
|
|
246
249
|
if (!runId) {
|
|
247
250
|
throw new HTTPException(400, { message: "runId required to resume workflow" });
|
|
248
251
|
}
|
|
249
|
-
const workflow = mastra.
|
|
250
|
-
const run = workflow.
|
|
252
|
+
const workflow = mastra.legacy_getWorkflow(workflowId);
|
|
253
|
+
const run = workflow.getMemoryRun(runId);
|
|
251
254
|
if (!run) {
|
|
252
255
|
throw new HTTPException(404, { message: "Workflow run not found" });
|
|
253
256
|
}
|
|
@@ -261,7 +264,7 @@ async function resumeAsyncWorkflowHandler({
|
|
|
261
264
|
return handleError(error, "Error resuming workflow step");
|
|
262
265
|
}
|
|
263
266
|
}
|
|
264
|
-
async function
|
|
267
|
+
async function resumeLegacyWorkflowHandler({
|
|
265
268
|
mastra,
|
|
266
269
|
workflowId,
|
|
267
270
|
runId,
|
|
@@ -275,12 +278,12 @@ async function resumeWorkflowHandler({
|
|
|
275
278
|
if (!runId) {
|
|
276
279
|
throw new HTTPException(400, { message: "runId required to resume workflow" });
|
|
277
280
|
}
|
|
278
|
-
const workflow = mastra.
|
|
279
|
-
const run = workflow.
|
|
281
|
+
const workflow = mastra.legacy_getWorkflow(workflowId);
|
|
282
|
+
const run = workflow.getMemoryRun(runId);
|
|
280
283
|
if (!run) {
|
|
281
284
|
throw new HTTPException(404, { message: "Workflow run not found" });
|
|
282
285
|
}
|
|
283
|
-
|
|
286
|
+
void run.resume({
|
|
284
287
|
stepId: body.stepId,
|
|
285
288
|
context: body.context,
|
|
286
289
|
runtimeContext
|
|
@@ -290,7 +293,7 @@ async function resumeWorkflowHandler({
|
|
|
290
293
|
return handleError(error, "Error resuming workflow");
|
|
291
294
|
}
|
|
292
295
|
}
|
|
293
|
-
async function
|
|
296
|
+
async function getLegacyWorkflowRunsHandler({
|
|
294
297
|
mastra,
|
|
295
298
|
workflowId,
|
|
296
299
|
fromDate,
|
|
@@ -303,7 +306,7 @@ async function getWorkflowRunsHandler({
|
|
|
303
306
|
if (!workflowId) {
|
|
304
307
|
throw new HTTPException(400, { message: "Workflow ID is required" });
|
|
305
308
|
}
|
|
306
|
-
const workflow = mastra.
|
|
309
|
+
const workflow = mastra.legacy_getWorkflow(workflowId);
|
|
307
310
|
const workflowRuns = await workflow.getWorkflowRuns({ fromDate, toDate, limit, offset, resourceId }) || {
|
|
308
311
|
runs: [],
|
|
309
312
|
total: 0
|
|
@@ -314,4 +317,4 @@ async function getWorkflowRunsHandler({
|
|
|
314
317
|
}
|
|
315
318
|
}
|
|
316
319
|
|
|
317
|
-
export {
|
|
320
|
+
export { createLegacyWorkflowRunHandler, getLegacyWorkflowByIdHandler, getLegacyWorkflowRunHandler, getLegacyWorkflowRunsHandler, getLegacyWorkflowsHandler, legacyWorkflows_exports, resumeAsyncLegacyWorkflowHandler, resumeLegacyWorkflowHandler, startAsyncLegacyWorkflowHandler, startLegacyWorkflowRunHandler, watchLegacyWorkflowHandler };
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __export = (target, all) => {
|
|
3
|
-
for (var name in all)
|
|
4
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
-
};
|
|
6
|
-
|
|
7
1
|
// src/server/http-exception.ts
|
|
8
2
|
var HTTPException = class extends Error {
|
|
9
3
|
res;
|
|
@@ -37,4 +31,4 @@ var HTTPException = class extends Error {
|
|
|
37
31
|
}
|
|
38
32
|
};
|
|
39
33
|
|
|
40
|
-
export { HTTPException
|
|
34
|
+
export { HTTPException };
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __export = (target, all) => {
|
|
5
|
-
for (var name in all)
|
|
6
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
7
|
-
};
|
|
8
|
-
|
|
9
3
|
// src/server/http-exception.ts
|
|
10
4
|
var HTTPException = class extends Error {
|
|
11
5
|
res;
|
|
@@ -40,4 +34,3 @@ var HTTPException = class extends Error {
|
|
|
40
34
|
};
|
|
41
35
|
|
|
42
36
|
exports.HTTPException = HTTPException;
|
|
43
|
-
exports.__export = __export;
|