@mastra/server 0.0.0-fix-message-embedding-20250506021742 → 0.0.0-fix-generate-title-20250616171351

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.
Files changed (85) hide show
  1. package/README.md +48 -135
  2. package/dist/_tsup-dts-rollup.d.cts +296 -100
  3. package/dist/_tsup-dts-rollup.d.ts +296 -100
  4. package/dist/{chunk-5JNVY6DU.js → chunk-2HXKRRNS.js} +7 -5
  5. package/dist/{chunk-Y3SV5XK4.js → chunk-4O23XCE5.js} +94 -13
  6. package/dist/{chunk-4JINXASC.js → chunk-55DOQLP6.js} +5 -4
  7. package/dist/{chunk-QN4KF3BH.cjs → chunk-57CJTIPW.cjs} +2 -2
  8. package/dist/{chunk-ZLBRQFDD.cjs → chunk-64U3UDTH.cjs} +2 -2
  9. package/dist/{chunk-2FJURXCL.cjs → chunk-6TJSHFCJ.cjs} +44 -36
  10. package/dist/chunk-75ZPJI57.cjs +9 -0
  11. package/dist/chunk-ASKESBJW.cjs +2004 -0
  12. package/dist/{chunk-AMVOS7YB.cjs → chunk-B4MQFJ7G.cjs} +12 -8
  13. package/dist/{chunk-BPL2CBLV.js → chunk-BFOA2QQY.js} +8 -4
  14. package/dist/{chunk-M56ECCHK.cjs → chunk-BNEY4P4P.cjs} +20 -19
  15. package/dist/{chunk-QJ3AHN64.js → chunk-C7564HUT.js} +4 -3
  16. package/dist/chunk-C75ZRJKD.cjs +270 -0
  17. package/dist/{chunk-3XTEV33Q.js → chunk-CLYX4KLH.js} +54 -51
  18. package/dist/{chunk-55HTWX4C.cjs → chunk-CMMOIUFC.cjs} +40 -19
  19. package/dist/{chunk-Q6SHQECN.js → chunk-CP55EVBK.js} +24 -4
  20. package/dist/chunk-FRXZL32L.cjs +471 -0
  21. package/dist/chunk-GHC4YV6R.js +504 -0
  22. package/dist/{chunk-L7XE5QTW.js → chunk-H5PTF3Y4.js} +1 -1
  23. package/dist/{chunk-RBQASTUP.js → chunk-I7KJZNX5.js} +14 -6
  24. package/dist/chunk-IMBY5XUG.cjs +86 -0
  25. package/dist/{chunk-IQTNZSFP.js → chunk-JKTNRUKY.js} +194 -49
  26. package/dist/{chunk-3AHQ5RGN.js → chunk-M5ABIP7D.js} +1 -1
  27. package/dist/chunk-MLKGABMK.js +7 -0
  28. package/dist/{chunk-D3G23FP3.cjs → chunk-NGURCFEJ.cjs} +24 -22
  29. package/dist/{chunk-TRDNDNGQ.js → chunk-NYN7KFXL.js} +1 -7
  30. package/dist/{chunk-FV45V6WC.cjs → chunk-OCWPVYNI.cjs} +0 -7
  31. package/dist/chunk-QLG2PFHE.js +81 -0
  32. package/dist/chunk-SDPGVWQJ.cjs +512 -0
  33. package/dist/chunk-TGJMNUYJ.js +2001 -0
  34. package/dist/{chunk-5YGDYMRB.cjs → chunk-VPNDC2DI.cjs} +14 -13
  35. package/dist/chunk-WE32JG64.cjs +332 -0
  36. package/dist/server/handlers/a2a.cjs +30 -0
  37. package/dist/server/handlers/a2a.d.cts +6 -0
  38. package/dist/server/handlers/a2a.d.ts +6 -0
  39. package/dist/server/handlers/a2a.js +1 -0
  40. package/dist/server/handlers/agents.cjs +7 -7
  41. package/dist/server/handlers/agents.js +1 -1
  42. package/dist/server/handlers/error.cjs +2 -2
  43. package/dist/server/handlers/error.js +1 -1
  44. package/dist/server/handlers/legacyWorkflows.cjs +46 -0
  45. package/dist/server/handlers/legacyWorkflows.d.cts +10 -0
  46. package/dist/server/handlers/legacyWorkflows.d.ts +10 -0
  47. package/dist/server/handlers/legacyWorkflows.js +1 -0
  48. package/dist/server/handlers/logs.cjs +4 -4
  49. package/dist/server/handlers/logs.js +1 -1
  50. package/dist/server/handlers/memory.cjs +9 -9
  51. package/dist/server/handlers/memory.js +1 -1
  52. package/dist/server/handlers/network.cjs +5 -5
  53. package/dist/server/handlers/network.js +1 -1
  54. package/dist/server/handlers/telemetry.cjs +3 -3
  55. package/dist/server/handlers/telemetry.js +1 -1
  56. package/dist/server/handlers/tools.cjs +5 -5
  57. package/dist/server/handlers/tools.js +1 -1
  58. package/dist/server/handlers/utils.cjs +2 -2
  59. package/dist/server/handlers/utils.js +1 -1
  60. package/dist/server/handlers/vector.cjs +7 -7
  61. package/dist/server/handlers/vector.js +1 -1
  62. package/dist/server/handlers/voice.cjs +8 -4
  63. package/dist/server/handlers/voice.d.cts +1 -0
  64. package/dist/server/handlers/voice.d.ts +1 -0
  65. package/dist/server/handlers/voice.js +1 -1
  66. package/dist/server/handlers/workflows.cjs +21 -13
  67. package/dist/server/handlers/workflows.d.cts +4 -2
  68. package/dist/server/handlers/workflows.d.ts +4 -2
  69. package/dist/server/handlers/workflows.js +1 -1
  70. package/dist/server/handlers.cjs +32 -27
  71. package/dist/server/handlers.d.cts +2 -1
  72. package/dist/server/handlers.d.ts +2 -1
  73. package/dist/server/handlers.js +11 -10
  74. package/package.json +13 -12
  75. package/dist/chunk-3EJZQ6TQ.js +0 -49
  76. package/dist/chunk-4BIX6GMY.cjs +0 -189
  77. package/dist/chunk-5SWCVTNL.cjs +0 -5579
  78. package/dist/chunk-CHFORQ7J.cjs +0 -329
  79. package/dist/chunk-FOXHTOQZ.cjs +0 -324
  80. package/dist/chunk-OMN3UI6X.js +0 -5576
  81. package/dist/chunk-SKBVVI24.cjs +0 -54
  82. package/dist/server/handlers/vNextWorkflows.cjs +0 -46
  83. package/dist/server/handlers/vNextWorkflows.d.cts +0 -10
  84. package/dist/server/handlers/vNextWorkflows.d.ts +0 -10
  85. package/dist/server/handlers/vNextWorkflows.js +0 -1
@@ -1,12 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkQN4KF3BH_cjs = require('./chunk-QN4KF3BH.cjs');
4
- var chunkZLBRQFDD_cjs = require('./chunk-ZLBRQFDD.cjs');
5
- var chunkFV45V6WC_cjs = require('./chunk-FV45V6WC.cjs');
3
+ var chunk57CJTIPW_cjs = require('./chunk-57CJTIPW.cjs');
4
+ var chunk64U3UDTH_cjs = require('./chunk-64U3UDTH.cjs');
5
+ var chunkOCWPVYNI_cjs = require('./chunk-OCWPVYNI.cjs');
6
+ var chunk75ZPJI57_cjs = require('./chunk-75ZPJI57.cjs');
6
7
 
7
8
  // src/server/handlers/network.ts
8
9
  var network_exports = {};
9
- chunkFV45V6WC_cjs.__export(network_exports, {
10
+ chunk75ZPJI57_cjs.__export(network_exports, {
10
11
  generateHandler: () => generateHandler,
11
12
  getNetworkByIdHandler: () => getNetworkByIdHandler,
12
13
  getNetworksHandler: () => getNetworksHandler,
@@ -46,7 +47,7 @@ async function getNetworksHandler({
46
47
  );
47
48
  return serializedNetworks;
48
49
  } catch (error) {
49
- return chunkZLBRQFDD_cjs.handleError(error, "Error getting networks");
50
+ return chunk64U3UDTH_cjs.handleError(error, "Error getting networks");
50
51
  }
51
52
  }
52
53
  async function getNetworkByIdHandler({
@@ -61,7 +62,7 @@ async function getNetworkByIdHandler({
61
62
  return network2.formatAgentId(routingAgent2.name) === networkId;
62
63
  });
63
64
  if (!network) {
64
- throw new chunkFV45V6WC_cjs.HTTPException(404, { message: "Network not found" });
65
+ throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Network not found" });
65
66
  }
66
67
  const routingAgent = network.getRoutingAgent();
67
68
  const routingLLM = await routingAgent.getLLM({ runtimeContext });
@@ -87,7 +88,7 @@ async function getNetworkByIdHandler({
87
88
  };
88
89
  return serializedNetwork;
89
90
  } catch (error) {
90
- return chunkZLBRQFDD_cjs.handleError(error, "Error getting network by ID");
91
+ return chunk64U3UDTH_cjs.handleError(error, "Error getting network by ID");
91
92
  }
92
93
  }
93
94
  async function generateHandler({
@@ -99,14 +100,14 @@ async function generateHandler({
99
100
  try {
100
101
  const network = mastra.getNetwork(networkId);
101
102
  if (!network) {
102
- throw new chunkFV45V6WC_cjs.HTTPException(404, { message: "Network not found" });
103
+ throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Network not found" });
103
104
  }
104
- chunkQN4KF3BH_cjs.validateBody({ messages: body.messages });
105
+ chunk57CJTIPW_cjs.validateBody({ messages: body.messages });
105
106
  const { messages, ...rest } = body;
106
107
  const result = await network.generate(messages, { ...rest, runtimeContext });
107
108
  return result;
108
109
  } catch (error) {
109
- return chunkZLBRQFDD_cjs.handleError(error, "Error generating from network");
110
+ return chunk64U3UDTH_cjs.handleError(error, "Error generating from network");
110
111
  }
111
112
  }
112
113
  async function streamGenerateHandler({
@@ -118,9 +119,9 @@ async function streamGenerateHandler({
118
119
  try {
119
120
  const network = mastra.getNetwork(networkId);
120
121
  if (!network) {
121
- throw new chunkFV45V6WC_cjs.HTTPException(404, { message: "Network not found" });
122
+ throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Network not found" });
122
123
  }
123
- chunkQN4KF3BH_cjs.validateBody({ messages: body.messages });
124
+ chunk57CJTIPW_cjs.validateBody({ messages: body.messages });
124
125
  const { messages, output, ...rest } = body;
125
126
  const streamResult = await network.stream(messages, {
126
127
  output,
@@ -136,7 +137,7 @@ async function streamGenerateHandler({
136
137
  });
137
138
  return streamResponse;
138
139
  } catch (error) {
139
- return chunkZLBRQFDD_cjs.handleError(error, "Error streaming from network");
140
+ return chunk64U3UDTH_cjs.handleError(error, "Error streaming from network");
140
141
  }
141
142
  }
142
143
 
@@ -0,0 +1,332 @@
1
+ 'use strict';
2
+
3
+ var chunkASKESBJW_cjs = require('./chunk-ASKESBJW.cjs');
4
+ var chunk64U3UDTH_cjs = require('./chunk-64U3UDTH.cjs');
5
+ var chunkOCWPVYNI_cjs = require('./chunk-OCWPVYNI.cjs');
6
+ var chunk75ZPJI57_cjs = require('./chunk-75ZPJI57.cjs');
7
+ var web = require('stream/web');
8
+
9
+ // src/server/handlers/legacyWorkflows.ts
10
+ var legacyWorkflows_exports = {};
11
+ chunk75ZPJI57_cjs.__export(legacyWorkflows_exports, {
12
+ createLegacyWorkflowRunHandler: () => createLegacyWorkflowRunHandler,
13
+ getLegacyWorkflowByIdHandler: () => getLegacyWorkflowByIdHandler,
14
+ getLegacyWorkflowRunHandler: () => getLegacyWorkflowRunHandler,
15
+ getLegacyWorkflowRunsHandler: () => getLegacyWorkflowRunsHandler,
16
+ getLegacyWorkflowsHandler: () => getLegacyWorkflowsHandler,
17
+ resumeAsyncLegacyWorkflowHandler: () => resumeAsyncLegacyWorkflowHandler,
18
+ resumeLegacyWorkflowHandler: () => resumeLegacyWorkflowHandler,
19
+ startAsyncLegacyWorkflowHandler: () => startAsyncLegacyWorkflowHandler,
20
+ startLegacyWorkflowRunHandler: () => startLegacyWorkflowRunHandler,
21
+ watchLegacyWorkflowHandler: () => watchLegacyWorkflowHandler
22
+ });
23
+ async function getLegacyWorkflowsHandler({ mastra }) {
24
+ try {
25
+ const workflows = mastra.legacy_getWorkflows({ serialized: false });
26
+ const _workflows = Object.entries(workflows).reduce((acc, [key, workflow]) => {
27
+ if (workflow.isNested) return acc;
28
+ acc[key] = {
29
+ stepGraph: workflow.stepGraph,
30
+ stepSubscriberGraph: workflow.stepSubscriberGraph,
31
+ serializedStepGraph: workflow.serializedStepGraph,
32
+ serializedStepSubscriberGraph: workflow.serializedStepSubscriberGraph,
33
+ name: workflow.name,
34
+ triggerSchema: workflow.triggerSchema ? chunkASKESBJW_cjs.stringify(chunkASKESBJW_cjs.esm_default(workflow.triggerSchema)) : void 0,
35
+ steps: Object.entries(workflow.steps).reduce((acc2, [key2, step]) => {
36
+ const _step = step;
37
+ acc2[key2] = {
38
+ id: _step.id,
39
+ description: _step.description,
40
+ workflowId: _step.workflowId,
41
+ inputSchema: _step.inputSchema ? chunkASKESBJW_cjs.stringify(chunkASKESBJW_cjs.esm_default(_step.inputSchema)) : void 0,
42
+ outputSchema: _step.outputSchema ? chunkASKESBJW_cjs.stringify(chunkASKESBJW_cjs.esm_default(_step.outputSchema)) : void 0
43
+ };
44
+ return acc2;
45
+ }, {})
46
+ };
47
+ return acc;
48
+ }, {});
49
+ return _workflows;
50
+ } catch (error) {
51
+ throw new chunkOCWPVYNI_cjs.HTTPException(500, { message: error?.message || "Error getting workflows" });
52
+ }
53
+ }
54
+ async function getLegacyWorkflowByIdHandler({ mastra, workflowId }) {
55
+ try {
56
+ if (!workflowId) {
57
+ throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
58
+ }
59
+ const workflow = mastra.legacy_getWorkflow(workflowId);
60
+ if (!workflow) {
61
+ throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow not found" });
62
+ }
63
+ return {
64
+ stepGraph: workflow.stepGraph,
65
+ stepSubscriberGraph: workflow.stepSubscriberGraph,
66
+ serializedStepGraph: workflow.serializedStepGraph,
67
+ serializedStepSubscriberGraph: workflow.serializedStepSubscriberGraph,
68
+ name: workflow.name,
69
+ triggerSchema: workflow.triggerSchema ? chunkASKESBJW_cjs.stringify(chunkASKESBJW_cjs.esm_default(workflow.triggerSchema)) : void 0,
70
+ steps: Object.entries(workflow.steps).reduce((acc, [key, step]) => {
71
+ const _step = step;
72
+ acc[key] = {
73
+ id: _step.id,
74
+ description: _step.description,
75
+ workflowId: _step.workflowId,
76
+ inputSchema: _step.inputSchema ? chunkASKESBJW_cjs.stringify(chunkASKESBJW_cjs.esm_default(_step.inputSchema)) : void 0,
77
+ outputSchema: _step.outputSchema ? chunkASKESBJW_cjs.stringify(chunkASKESBJW_cjs.esm_default(_step.outputSchema)) : void 0
78
+ };
79
+ return acc;
80
+ }, {})
81
+ };
82
+ } catch (error) {
83
+ throw new chunkOCWPVYNI_cjs.HTTPException(500, { message: error?.message || "Error getting workflow" });
84
+ }
85
+ }
86
+ async function startAsyncLegacyWorkflowHandler({
87
+ mastra,
88
+ runtimeContext,
89
+ workflowId,
90
+ runId,
91
+ triggerData
92
+ }) {
93
+ try {
94
+ if (!workflowId) {
95
+ throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
96
+ }
97
+ const workflow = mastra.legacy_getWorkflow(workflowId);
98
+ if (!workflow) {
99
+ throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow not found" });
100
+ }
101
+ if (!runId) {
102
+ const newRun = workflow.createRun();
103
+ const result2 = await newRun.start({
104
+ triggerData,
105
+ runtimeContext
106
+ });
107
+ return result2;
108
+ }
109
+ const run = workflow.getMemoryRun(runId);
110
+ if (!run) {
111
+ throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow run not found" });
112
+ }
113
+ const result = await run.start({
114
+ triggerData,
115
+ runtimeContext
116
+ });
117
+ return result;
118
+ } catch (error) {
119
+ throw new chunkOCWPVYNI_cjs.HTTPException(500, { message: error?.message || "Error executing workflow" });
120
+ }
121
+ }
122
+ async function getLegacyWorkflowRunHandler({
123
+ mastra,
124
+ workflowId,
125
+ runId
126
+ }) {
127
+ try {
128
+ if (!workflowId) {
129
+ throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
130
+ }
131
+ if (!runId) {
132
+ throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Run ID is required" });
133
+ }
134
+ const workflow = mastra.legacy_getWorkflow(workflowId);
135
+ if (!workflow) {
136
+ throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow not found" });
137
+ }
138
+ const run = await workflow.getRun(runId);
139
+ if (!run) {
140
+ throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow run not found" });
141
+ }
142
+ return run;
143
+ } catch (error) {
144
+ throw new chunkOCWPVYNI_cjs.HTTPException(500, { message: error?.message || "Error getting workflow run" });
145
+ }
146
+ }
147
+ async function createLegacyWorkflowRunHandler({
148
+ mastra,
149
+ workflowId,
150
+ runId: prevRunId
151
+ }) {
152
+ try {
153
+ if (!workflowId) {
154
+ throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
155
+ }
156
+ const workflow = mastra.legacy_getWorkflow(workflowId);
157
+ if (!workflow) {
158
+ throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow not found" });
159
+ }
160
+ const newRun = workflow.createRun({ runId: prevRunId });
161
+ return { runId: newRun.runId };
162
+ } catch (error) {
163
+ throw new chunkOCWPVYNI_cjs.HTTPException(500, { message: error?.message || "Error creating workflow run" });
164
+ }
165
+ }
166
+ async function startLegacyWorkflowRunHandler({
167
+ mastra,
168
+ runtimeContext,
169
+ workflowId,
170
+ runId,
171
+ triggerData
172
+ }) {
173
+ try {
174
+ if (!workflowId) {
175
+ throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
176
+ }
177
+ if (!runId) {
178
+ throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "runId required to start run" });
179
+ }
180
+ const workflow = mastra.legacy_getWorkflow(workflowId);
181
+ const run = workflow.getMemoryRun(runId);
182
+ if (!run) {
183
+ throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow run not found" });
184
+ }
185
+ void run.start({
186
+ triggerData,
187
+ runtimeContext
188
+ });
189
+ return { message: "Workflow run started" };
190
+ } catch (e) {
191
+ return chunk64U3UDTH_cjs.handleError(e, "Error starting workflow run");
192
+ }
193
+ }
194
+ async function watchLegacyWorkflowHandler({
195
+ mastra,
196
+ workflowId,
197
+ runId
198
+ }) {
199
+ try {
200
+ if (!workflowId) {
201
+ throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
202
+ }
203
+ if (!runId) {
204
+ throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "runId required to watch workflow" });
205
+ }
206
+ const workflow = mastra.legacy_getWorkflow(workflowId);
207
+ const run = workflow.getMemoryRun(runId);
208
+ if (!run) {
209
+ throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow run not found" });
210
+ }
211
+ let unwatch;
212
+ let asyncRef = null;
213
+ const stream = new web.ReadableStream({
214
+ start(controller) {
215
+ unwatch = run.watch(({ activePaths, runId: runId2, timestamp, results }) => {
216
+ const activePathsObj = Object.fromEntries(activePaths);
217
+ controller.enqueue(JSON.stringify({ activePaths: activePathsObj, runId: runId2, timestamp, results }));
218
+ if (asyncRef) {
219
+ clearImmediate(asyncRef);
220
+ asyncRef = null;
221
+ }
222
+ asyncRef = setImmediate(() => {
223
+ const runDone = Object.values(activePathsObj).every((value) => value.status !== "executing");
224
+ if (runDone) {
225
+ controller.close();
226
+ unwatch?.();
227
+ }
228
+ });
229
+ });
230
+ },
231
+ cancel() {
232
+ unwatch?.();
233
+ }
234
+ });
235
+ return stream;
236
+ } catch (error) {
237
+ return chunk64U3UDTH_cjs.handleError(error, "Error watching workflow");
238
+ }
239
+ }
240
+ async function resumeAsyncLegacyWorkflowHandler({
241
+ mastra,
242
+ workflowId,
243
+ runId,
244
+ body,
245
+ runtimeContext
246
+ }) {
247
+ try {
248
+ if (!workflowId) {
249
+ throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
250
+ }
251
+ if (!runId) {
252
+ throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "runId required to resume workflow" });
253
+ }
254
+ const workflow = mastra.legacy_getWorkflow(workflowId);
255
+ const run = workflow.getMemoryRun(runId);
256
+ if (!run) {
257
+ throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow run not found" });
258
+ }
259
+ const result = await run.resume({
260
+ stepId: body.stepId,
261
+ context: body.context,
262
+ runtimeContext
263
+ });
264
+ return result;
265
+ } catch (error) {
266
+ return chunk64U3UDTH_cjs.handleError(error, "Error resuming workflow step");
267
+ }
268
+ }
269
+ async function resumeLegacyWorkflowHandler({
270
+ mastra,
271
+ workflowId,
272
+ runId,
273
+ body,
274
+ runtimeContext
275
+ }) {
276
+ try {
277
+ if (!workflowId) {
278
+ throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
279
+ }
280
+ if (!runId) {
281
+ throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "runId required to resume workflow" });
282
+ }
283
+ const workflow = mastra.legacy_getWorkflow(workflowId);
284
+ const run = workflow.getMemoryRun(runId);
285
+ if (!run) {
286
+ throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow run not found" });
287
+ }
288
+ void run.resume({
289
+ stepId: body.stepId,
290
+ context: body.context,
291
+ runtimeContext
292
+ });
293
+ return { message: "Workflow run resumed" };
294
+ } catch (error) {
295
+ return chunk64U3UDTH_cjs.handleError(error, "Error resuming workflow");
296
+ }
297
+ }
298
+ async function getLegacyWorkflowRunsHandler({
299
+ mastra,
300
+ workflowId,
301
+ fromDate,
302
+ toDate,
303
+ limit,
304
+ offset,
305
+ resourceId
306
+ }) {
307
+ try {
308
+ if (!workflowId) {
309
+ throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
310
+ }
311
+ const workflow = mastra.legacy_getWorkflow(workflowId);
312
+ const workflowRuns = await workflow.getWorkflowRuns({ fromDate, toDate, limit, offset, resourceId }) || {
313
+ runs: [],
314
+ total: 0
315
+ };
316
+ return workflowRuns;
317
+ } catch (error) {
318
+ return chunk64U3UDTH_cjs.handleError(error, "Error getting workflow runs");
319
+ }
320
+ }
321
+
322
+ exports.createLegacyWorkflowRunHandler = createLegacyWorkflowRunHandler;
323
+ exports.getLegacyWorkflowByIdHandler = getLegacyWorkflowByIdHandler;
324
+ exports.getLegacyWorkflowRunHandler = getLegacyWorkflowRunHandler;
325
+ exports.getLegacyWorkflowRunsHandler = getLegacyWorkflowRunsHandler;
326
+ exports.getLegacyWorkflowsHandler = getLegacyWorkflowsHandler;
327
+ exports.legacyWorkflows_exports = legacyWorkflows_exports;
328
+ exports.resumeAsyncLegacyWorkflowHandler = resumeAsyncLegacyWorkflowHandler;
329
+ exports.resumeLegacyWorkflowHandler = resumeLegacyWorkflowHandler;
330
+ exports.startAsyncLegacyWorkflowHandler = startAsyncLegacyWorkflowHandler;
331
+ exports.startLegacyWorkflowRunHandler = startLegacyWorkflowRunHandler;
332
+ exports.watchLegacyWorkflowHandler = watchLegacyWorkflowHandler;
@@ -0,0 +1,30 @@
1
+ 'use strict';
2
+
3
+ var chunkSDPGVWQJ_cjs = require('../../chunk-SDPGVWQJ.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "getAgentCardByIdHandler", {
8
+ enumerable: true,
9
+ get: function () { return chunkSDPGVWQJ_cjs.getAgentCardByIdHandler; }
10
+ });
11
+ Object.defineProperty(exports, "getAgentExecutionHandler", {
12
+ enumerable: true,
13
+ get: function () { return chunkSDPGVWQJ_cjs.getAgentExecutionHandler; }
14
+ });
15
+ Object.defineProperty(exports, "handleTaskCancel", {
16
+ enumerable: true,
17
+ get: function () { return chunkSDPGVWQJ_cjs.handleTaskCancel; }
18
+ });
19
+ Object.defineProperty(exports, "handleTaskGet", {
20
+ enumerable: true,
21
+ get: function () { return chunkSDPGVWQJ_cjs.handleTaskGet; }
22
+ });
23
+ Object.defineProperty(exports, "handleTaskSend", {
24
+ enumerable: true,
25
+ get: function () { return chunkSDPGVWQJ_cjs.handleTaskSend; }
26
+ });
27
+ Object.defineProperty(exports, "handleTaskSendSubscribe", {
28
+ enumerable: true,
29
+ get: function () { return chunkSDPGVWQJ_cjs.handleTaskSendSubscribe; }
30
+ });
@@ -0,0 +1,6 @@
1
+ export { getAgentCardByIdHandler } from '../../_tsup-dts-rollup.cjs';
2
+ export { handleTaskSend } from '../../_tsup-dts-rollup.cjs';
3
+ export { handleTaskGet } from '../../_tsup-dts-rollup.cjs';
4
+ export { handleTaskSendSubscribe } from '../../_tsup-dts-rollup.cjs';
5
+ export { handleTaskCancel } from '../../_tsup-dts-rollup.cjs';
6
+ export { getAgentExecutionHandler } from '../../_tsup-dts-rollup.cjs';
@@ -0,0 +1,6 @@
1
+ export { getAgentCardByIdHandler } from '../../_tsup-dts-rollup.js';
2
+ export { handleTaskSend } from '../../_tsup-dts-rollup.js';
3
+ export { handleTaskGet } from '../../_tsup-dts-rollup.js';
4
+ export { handleTaskSendSubscribe } from '../../_tsup-dts-rollup.js';
5
+ export { handleTaskCancel } from '../../_tsup-dts-rollup.js';
6
+ export { getAgentExecutionHandler } from '../../_tsup-dts-rollup.js';
@@ -0,0 +1 @@
1
+ export { getAgentCardByIdHandler, getAgentExecutionHandler, handleTaskCancel, handleTaskGet, handleTaskSend, handleTaskSendSubscribe } from '../../chunk-GHC4YV6R.js';
@@ -1,30 +1,30 @@
1
1
  'use strict';
2
2
 
3
- var chunk4BIX6GMY_cjs = require('../../chunk-4BIX6GMY.cjs');
3
+ var chunkC75ZRJKD_cjs = require('../../chunk-C75ZRJKD.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "generateHandler", {
8
8
  enumerable: true,
9
- get: function () { return chunk4BIX6GMY_cjs.generateHandler; }
9
+ get: function () { return chunkC75ZRJKD_cjs.generateHandler; }
10
10
  });
11
11
  Object.defineProperty(exports, "getAgentByIdHandler", {
12
12
  enumerable: true,
13
- get: function () { return chunk4BIX6GMY_cjs.getAgentByIdHandler; }
13
+ get: function () { return chunkC75ZRJKD_cjs.getAgentByIdHandler; }
14
14
  });
15
15
  Object.defineProperty(exports, "getAgentsHandler", {
16
16
  enumerable: true,
17
- get: function () { return chunk4BIX6GMY_cjs.getAgentsHandler; }
17
+ get: function () { return chunkC75ZRJKD_cjs.getAgentsHandler; }
18
18
  });
19
19
  Object.defineProperty(exports, "getEvalsByAgentIdHandler", {
20
20
  enumerable: true,
21
- get: function () { return chunk4BIX6GMY_cjs.getEvalsByAgentIdHandler; }
21
+ get: function () { return chunkC75ZRJKD_cjs.getEvalsByAgentIdHandler; }
22
22
  });
23
23
  Object.defineProperty(exports, "getLiveEvalsByAgentIdHandler", {
24
24
  enumerable: true,
25
- get: function () { return chunk4BIX6GMY_cjs.getLiveEvalsByAgentIdHandler; }
25
+ get: function () { return chunkC75ZRJKD_cjs.getLiveEvalsByAgentIdHandler; }
26
26
  });
27
27
  Object.defineProperty(exports, "streamGenerateHandler", {
28
28
  enumerable: true,
29
- get: function () { return chunk4BIX6GMY_cjs.streamGenerateHandler; }
29
+ get: function () { return chunkC75ZRJKD_cjs.streamGenerateHandler; }
30
30
  });
@@ -1 +1 @@
1
- export { generateHandler, getAgentByIdHandler, getAgentsHandler, getEvalsByAgentIdHandler, getLiveEvalsByAgentIdHandler, streamGenerateHandler } from '../../chunk-Y3SV5XK4.js';
1
+ export { generateHandler, getAgentByIdHandler, getAgentsHandler, getEvalsByAgentIdHandler, getLiveEvalsByAgentIdHandler, streamGenerateHandler } from '../../chunk-4O23XCE5.js';
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var chunkZLBRQFDD_cjs = require('../../chunk-ZLBRQFDD.cjs');
3
+ var chunk64U3UDTH_cjs = require('../../chunk-64U3UDTH.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "handleError", {
8
8
  enumerable: true,
9
- get: function () { return chunkZLBRQFDD_cjs.handleError; }
9
+ get: function () { return chunk64U3UDTH_cjs.handleError; }
10
10
  });
@@ -1 +1 @@
1
- export { handleError } from '../../chunk-3AHQ5RGN.js';
1
+ export { handleError } from '../../chunk-M5ABIP7D.js';
@@ -0,0 +1,46 @@
1
+ 'use strict';
2
+
3
+ var chunkWE32JG64_cjs = require('../../chunk-WE32JG64.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "createLegacyWorkflowRunHandler", {
8
+ enumerable: true,
9
+ get: function () { return chunkWE32JG64_cjs.createLegacyWorkflowRunHandler; }
10
+ });
11
+ Object.defineProperty(exports, "getLegacyWorkflowByIdHandler", {
12
+ enumerable: true,
13
+ get: function () { return chunkWE32JG64_cjs.getLegacyWorkflowByIdHandler; }
14
+ });
15
+ Object.defineProperty(exports, "getLegacyWorkflowRunHandler", {
16
+ enumerable: true,
17
+ get: function () { return chunkWE32JG64_cjs.getLegacyWorkflowRunHandler; }
18
+ });
19
+ Object.defineProperty(exports, "getLegacyWorkflowRunsHandler", {
20
+ enumerable: true,
21
+ get: function () { return chunkWE32JG64_cjs.getLegacyWorkflowRunsHandler; }
22
+ });
23
+ Object.defineProperty(exports, "getLegacyWorkflowsHandler", {
24
+ enumerable: true,
25
+ get: function () { return chunkWE32JG64_cjs.getLegacyWorkflowsHandler; }
26
+ });
27
+ Object.defineProperty(exports, "resumeAsyncLegacyWorkflowHandler", {
28
+ enumerable: true,
29
+ get: function () { return chunkWE32JG64_cjs.resumeAsyncLegacyWorkflowHandler; }
30
+ });
31
+ Object.defineProperty(exports, "resumeLegacyWorkflowHandler", {
32
+ enumerable: true,
33
+ get: function () { return chunkWE32JG64_cjs.resumeLegacyWorkflowHandler; }
34
+ });
35
+ Object.defineProperty(exports, "startAsyncLegacyWorkflowHandler", {
36
+ enumerable: true,
37
+ get: function () { return chunkWE32JG64_cjs.startAsyncLegacyWorkflowHandler; }
38
+ });
39
+ Object.defineProperty(exports, "startLegacyWorkflowRunHandler", {
40
+ enumerable: true,
41
+ get: function () { return chunkWE32JG64_cjs.startLegacyWorkflowRunHandler; }
42
+ });
43
+ Object.defineProperty(exports, "watchLegacyWorkflowHandler", {
44
+ enumerable: true,
45
+ get: function () { return chunkWE32JG64_cjs.watchLegacyWorkflowHandler; }
46
+ });
@@ -0,0 +1,10 @@
1
+ export { getLegacyWorkflowsHandler } from '../../_tsup-dts-rollup.cjs';
2
+ export { getLegacyWorkflowByIdHandler } from '../../_tsup-dts-rollup.cjs';
3
+ export { startAsyncLegacyWorkflowHandler } from '../../_tsup-dts-rollup.cjs';
4
+ export { getLegacyWorkflowRunHandler } from '../../_tsup-dts-rollup.cjs';
5
+ export { createLegacyWorkflowRunHandler } from '../../_tsup-dts-rollup.cjs';
6
+ export { startLegacyWorkflowRunHandler } from '../../_tsup-dts-rollup.cjs';
7
+ export { watchLegacyWorkflowHandler } from '../../_tsup-dts-rollup.cjs';
8
+ export { resumeAsyncLegacyWorkflowHandler } from '../../_tsup-dts-rollup.cjs';
9
+ export { resumeLegacyWorkflowHandler } from '../../_tsup-dts-rollup.cjs';
10
+ export { getLegacyWorkflowRunsHandler } from '../../_tsup-dts-rollup.cjs';
@@ -0,0 +1,10 @@
1
+ export { getLegacyWorkflowsHandler } from '../../_tsup-dts-rollup.js';
2
+ export { getLegacyWorkflowByIdHandler } from '../../_tsup-dts-rollup.js';
3
+ export { startAsyncLegacyWorkflowHandler } from '../../_tsup-dts-rollup.js';
4
+ export { getLegacyWorkflowRunHandler } from '../../_tsup-dts-rollup.js';
5
+ export { createLegacyWorkflowRunHandler } from '../../_tsup-dts-rollup.js';
6
+ export { startLegacyWorkflowRunHandler } from '../../_tsup-dts-rollup.js';
7
+ export { watchLegacyWorkflowHandler } from '../../_tsup-dts-rollup.js';
8
+ export { resumeAsyncLegacyWorkflowHandler } from '../../_tsup-dts-rollup.js';
9
+ export { resumeLegacyWorkflowHandler } from '../../_tsup-dts-rollup.js';
10
+ export { getLegacyWorkflowRunsHandler } from '../../_tsup-dts-rollup.js';
@@ -0,0 +1 @@
1
+ export { createLegacyWorkflowRunHandler, getLegacyWorkflowByIdHandler, getLegacyWorkflowRunHandler, getLegacyWorkflowRunsHandler, getLegacyWorkflowsHandler, resumeAsyncLegacyWorkflowHandler, resumeLegacyWorkflowHandler, startAsyncLegacyWorkflowHandler, startLegacyWorkflowRunHandler, watchLegacyWorkflowHandler } from '../../chunk-CLYX4KLH.js';
@@ -1,18 +1,18 @@
1
1
  'use strict';
2
2
 
3
- var chunkSKBVVI24_cjs = require('../../chunk-SKBVVI24.cjs');
3
+ var chunkIMBY5XUG_cjs = require('../../chunk-IMBY5XUG.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "getLogTransports", {
8
8
  enumerable: true,
9
- get: function () { return chunkSKBVVI24_cjs.getLogTransports; }
9
+ get: function () { return chunkIMBY5XUG_cjs.getLogTransports; }
10
10
  });
11
11
  Object.defineProperty(exports, "getLogsByRunIdHandler", {
12
12
  enumerable: true,
13
- get: function () { return chunkSKBVVI24_cjs.getLogsByRunIdHandler; }
13
+ get: function () { return chunkIMBY5XUG_cjs.getLogsByRunIdHandler; }
14
14
  });
15
15
  Object.defineProperty(exports, "getLogsHandler", {
16
16
  enumerable: true,
17
- get: function () { return chunkSKBVVI24_cjs.getLogsHandler; }
17
+ get: function () { return chunkIMBY5XUG_cjs.getLogsHandler; }
18
18
  });
@@ -1 +1 @@
1
- export { getLogTransports, getLogsByRunIdHandler, getLogsHandler } from '../../chunk-3EJZQ6TQ.js';
1
+ export { getLogTransports, getLogsByRunIdHandler, getLogsHandler } from '../../chunk-QLG2PFHE.js';