@mastra/server 0.0.0-generate-message-id-20250512171942 → 0.0.0-inject-middleware-20250528213451

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 (39) hide show
  1. package/dist/_tsup-dts-rollup.d.cts +114 -96
  2. package/dist/_tsup-dts-rollup.d.ts +114 -96
  3. package/dist/{chunk-IU5VO2I2.js → chunk-55DOQLP6.js} +2 -2
  4. package/dist/{chunk-3HQNCTZ2.cjs → chunk-A3KDUGS7.cjs} +42 -2
  5. package/dist/{chunk-4YZ3U35L.cjs → chunk-BNEY4P4P.cjs} +2 -2
  6. package/dist/{chunk-X3ZDCS52.js → chunk-DJJIUEL2.js} +9 -2
  7. package/dist/{chunk-HWZVAG3H.js → chunk-DQLE3DVM.js} +2 -2
  8. package/dist/{chunk-Q6KMBIAN.js → chunk-J3PKLB3A.js} +42 -2
  9. package/dist/{chunk-MIQYDLLM.js → chunk-KUNQFY2W.js} +70 -34
  10. package/dist/{chunk-UCTEMO2Q.cjs → chunk-MMO2HDM6.cjs} +81 -44
  11. package/dist/{chunk-OGCNNUHF.cjs → chunk-NEOOQUKW.cjs} +2 -2
  12. package/dist/{chunk-EJO45KYT.js → chunk-W7VCKPAD.js} +34 -34
  13. package/dist/{chunk-24EGIVT7.cjs → chunk-Y7UWRW5X.cjs} +9 -2
  14. package/dist/{chunk-I2B73Y4I.cjs → chunk-YIOVBYZH.cjs} +44 -44
  15. package/dist/server/handlers/agents.cjs +7 -7
  16. package/dist/server/handlers/agents.js +1 -1
  17. package/dist/server/handlers/legacyWorkflows.cjs +46 -0
  18. package/dist/server/handlers/legacyWorkflows.d.cts +10 -0
  19. package/dist/server/handlers/legacyWorkflows.d.ts +10 -0
  20. package/dist/server/handlers/legacyWorkflows.js +1 -0
  21. package/dist/server/handlers/logs.cjs +4 -4
  22. package/dist/server/handlers/logs.js +1 -1
  23. package/dist/server/handlers/memory.cjs +9 -9
  24. package/dist/server/handlers/memory.js +1 -1
  25. package/dist/server/handlers/vector.cjs +7 -7
  26. package/dist/server/handlers/vector.js +1 -1
  27. package/dist/server/handlers/workflows.cjs +17 -13
  28. package/dist/server/handlers/workflows.d.cts +3 -2
  29. package/dist/server/handlers/workflows.d.ts +3 -2
  30. package/dist/server/handlers/workflows.js +1 -1
  31. package/dist/server/handlers.cjs +20 -20
  32. package/dist/server/handlers.d.cts +1 -1
  33. package/dist/server/handlers.d.ts +1 -1
  34. package/dist/server/handlers.js +7 -7
  35. package/package.json +5 -5
  36. package/dist/server/handlers/vNextWorkflows.cjs +0 -46
  37. package/dist/server/handlers/vNextWorkflows.d.cts +0 -10
  38. package/dist/server/handlers/vNextWorkflows.d.ts +0 -10
  39. package/dist/server/handlers/vNextWorkflows.js +0 -1
@@ -4,23 +4,23 @@ import { HTTPException } from './chunk-NYN7KFXL.js';
4
4
  import { __export } from './chunk-MLKGABMK.js';
5
5
  import { ReadableStream } from 'node:stream/web';
6
6
 
7
- // src/server/handlers/workflows.ts
8
- var workflows_exports = {};
9
- __export(workflows_exports, {
10
- createRunHandler: () => createRunHandler,
11
- getWorkflowByIdHandler: () => getWorkflowByIdHandler,
12
- getWorkflowRunHandler: () => getWorkflowRunHandler,
13
- getWorkflowRunsHandler: () => getWorkflowRunsHandler,
14
- getWorkflowsHandler: () => getWorkflowsHandler,
15
- resumeAsyncWorkflowHandler: () => resumeAsyncWorkflowHandler,
16
- resumeWorkflowHandler: () => resumeWorkflowHandler,
17
- startAsyncWorkflowHandler: () => startAsyncWorkflowHandler,
18
- startWorkflowRunHandler: () => startWorkflowRunHandler,
19
- watchWorkflowHandler: () => watchWorkflowHandler
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
20
20
  });
21
- async function getWorkflowsHandler({ mastra }) {
21
+ async function getLegacyWorkflowsHandler({ mastra }) {
22
22
  try {
23
- const workflows = mastra.getWorkflows({ serialized: false });
23
+ const workflows = mastra.legacy_getWorkflows({ serialized: false });
24
24
  const _workflows = Object.entries(workflows).reduce((acc, [key, workflow]) => {
25
25
  if (workflow.isNested) return acc;
26
26
  acc[key] = {
@@ -49,12 +49,12 @@ async function getWorkflowsHandler({ mastra }) {
49
49
  throw new HTTPException(500, { message: error?.message || "Error getting workflows" });
50
50
  }
51
51
  }
52
- async function getWorkflowByIdHandler({ mastra, workflowId }) {
52
+ async function getLegacyWorkflowByIdHandler({ mastra, workflowId }) {
53
53
  try {
54
54
  if (!workflowId) {
55
55
  throw new HTTPException(400, { message: "Workflow ID is required" });
56
56
  }
57
- const workflow = mastra.getWorkflow(workflowId);
57
+ const workflow = mastra.legacy_getWorkflow(workflowId);
58
58
  if (!workflow) {
59
59
  throw new HTTPException(404, { message: "Workflow not found" });
60
60
  }
@@ -81,7 +81,7 @@ async function getWorkflowByIdHandler({ mastra, workflowId }) {
81
81
  throw new HTTPException(500, { message: error?.message || "Error getting workflow" });
82
82
  }
83
83
  }
84
- async function startAsyncWorkflowHandler({
84
+ async function startAsyncLegacyWorkflowHandler({
85
85
  mastra,
86
86
  runtimeContext,
87
87
  workflowId,
@@ -92,7 +92,7 @@ async function startAsyncWorkflowHandler({
92
92
  if (!workflowId) {
93
93
  throw new HTTPException(400, { message: "Workflow ID is required" });
94
94
  }
95
- const workflow = mastra.getWorkflow(workflowId);
95
+ const workflow = mastra.legacy_getWorkflow(workflowId);
96
96
  if (!workflow) {
97
97
  throw new HTTPException(404, { message: "Workflow not found" });
98
98
  }
@@ -117,7 +117,7 @@ async function startAsyncWorkflowHandler({
117
117
  throw new HTTPException(500, { message: error?.message || "Error executing workflow" });
118
118
  }
119
119
  }
120
- async function getWorkflowRunHandler({
120
+ async function getLegacyWorkflowRunHandler({
121
121
  mastra,
122
122
  workflowId,
123
123
  runId
@@ -129,7 +129,7 @@ async function getWorkflowRunHandler({
129
129
  if (!runId) {
130
130
  throw new HTTPException(400, { message: "Run ID is required" });
131
131
  }
132
- const workflow = mastra.getWorkflow(workflowId);
132
+ const workflow = mastra.legacy_getWorkflow(workflowId);
133
133
  if (!workflow) {
134
134
  throw new HTTPException(404, { message: "Workflow not found" });
135
135
  }
@@ -142,7 +142,7 @@ async function getWorkflowRunHandler({
142
142
  throw new HTTPException(500, { message: error?.message || "Error getting workflow run" });
143
143
  }
144
144
  }
145
- async function createRunHandler({
145
+ async function createLegacyWorkflowRunHandler({
146
146
  mastra,
147
147
  workflowId,
148
148
  runId: prevRunId
@@ -151,7 +151,7 @@ async function createRunHandler({
151
151
  if (!workflowId) {
152
152
  throw new HTTPException(400, { message: "Workflow ID is required" });
153
153
  }
154
- const workflow = mastra.getWorkflow(workflowId);
154
+ const workflow = mastra.legacy_getWorkflow(workflowId);
155
155
  if (!workflow) {
156
156
  throw new HTTPException(404, { message: "Workflow not found" });
157
157
  }
@@ -161,7 +161,7 @@ async function createRunHandler({
161
161
  throw new HTTPException(500, { message: error?.message || "Error creating workflow run" });
162
162
  }
163
163
  }
164
- async function startWorkflowRunHandler({
164
+ async function startLegacyWorkflowRunHandler({
165
165
  mastra,
166
166
  runtimeContext,
167
167
  workflowId,
@@ -175,7 +175,7 @@ async function startWorkflowRunHandler({
175
175
  if (!runId) {
176
176
  throw new HTTPException(400, { message: "runId required to start run" });
177
177
  }
178
- const workflow = mastra.getWorkflow(workflowId);
178
+ const workflow = mastra.legacy_getWorkflow(workflowId);
179
179
  const run = workflow.getMemoryRun(runId);
180
180
  if (!run) {
181
181
  throw new HTTPException(404, { message: "Workflow run not found" });
@@ -189,7 +189,7 @@ async function startWorkflowRunHandler({
189
189
  return handleError(e, "Error starting workflow run");
190
190
  }
191
191
  }
192
- async function watchWorkflowHandler({
192
+ async function watchLegacyWorkflowHandler({
193
193
  mastra,
194
194
  workflowId,
195
195
  runId
@@ -201,7 +201,7 @@ async function watchWorkflowHandler({
201
201
  if (!runId) {
202
202
  throw new HTTPException(400, { message: "runId required to watch workflow" });
203
203
  }
204
- const workflow = mastra.getWorkflow(workflowId);
204
+ const workflow = mastra.legacy_getWorkflow(workflowId);
205
205
  const run = workflow.getMemoryRun(runId);
206
206
  if (!run) {
207
207
  throw new HTTPException(404, { message: "Workflow run not found" });
@@ -235,7 +235,7 @@ async function watchWorkflowHandler({
235
235
  return handleError(error, "Error watching workflow");
236
236
  }
237
237
  }
238
- async function resumeAsyncWorkflowHandler({
238
+ async function resumeAsyncLegacyWorkflowHandler({
239
239
  mastra,
240
240
  workflowId,
241
241
  runId,
@@ -249,7 +249,7 @@ async function resumeAsyncWorkflowHandler({
249
249
  if (!runId) {
250
250
  throw new HTTPException(400, { message: "runId required to resume workflow" });
251
251
  }
252
- const workflow = mastra.getWorkflow(workflowId);
252
+ const workflow = mastra.legacy_getWorkflow(workflowId);
253
253
  const run = workflow.getMemoryRun(runId);
254
254
  if (!run) {
255
255
  throw new HTTPException(404, { message: "Workflow run not found" });
@@ -264,7 +264,7 @@ async function resumeAsyncWorkflowHandler({
264
264
  return handleError(error, "Error resuming workflow step");
265
265
  }
266
266
  }
267
- async function resumeWorkflowHandler({
267
+ async function resumeLegacyWorkflowHandler({
268
268
  mastra,
269
269
  workflowId,
270
270
  runId,
@@ -278,7 +278,7 @@ async function resumeWorkflowHandler({
278
278
  if (!runId) {
279
279
  throw new HTTPException(400, { message: "runId required to resume workflow" });
280
280
  }
281
- const workflow = mastra.getWorkflow(workflowId);
281
+ const workflow = mastra.legacy_getWorkflow(workflowId);
282
282
  const run = workflow.getMemoryRun(runId);
283
283
  if (!run) {
284
284
  throw new HTTPException(404, { message: "Workflow run not found" });
@@ -293,7 +293,7 @@ async function resumeWorkflowHandler({
293
293
  return handleError(error, "Error resuming workflow");
294
294
  }
295
295
  }
296
- async function getWorkflowRunsHandler({
296
+ async function getLegacyWorkflowRunsHandler({
297
297
  mastra,
298
298
  workflowId,
299
299
  fromDate,
@@ -306,7 +306,7 @@ async function getWorkflowRunsHandler({
306
306
  if (!workflowId) {
307
307
  throw new HTTPException(400, { message: "Workflow ID is required" });
308
308
  }
309
- const workflow = mastra.getWorkflow(workflowId);
309
+ const workflow = mastra.legacy_getWorkflow(workflowId);
310
310
  const workflowRuns = await workflow.getWorkflowRuns({ fromDate, toDate, limit, offset, resourceId }) || {
311
311
  runs: [],
312
312
  total: 0
@@ -317,4 +317,4 @@ async function getWorkflowRunsHandler({
317
317
  }
318
318
  }
319
319
 
320
- export { createRunHandler, getWorkflowByIdHandler, getWorkflowRunHandler, getWorkflowRunsHandler, getWorkflowsHandler, resumeAsyncWorkflowHandler, resumeWorkflowHandler, startAsyncWorkflowHandler, startWorkflowRunHandler, watchWorkflowHandler, workflows_exports };
320
+ export { createLegacyWorkflowRunHandler, getLegacyWorkflowByIdHandler, getLegacyWorkflowRunHandler, getLegacyWorkflowRunsHandler, getLegacyWorkflowsHandler, legacyWorkflows_exports, resumeAsyncLegacyWorkflowHandler, resumeLegacyWorkflowHandler, startAsyncLegacyWorkflowHandler, startLegacyWorkflowRunHandler, watchLegacyWorkflowHandler };
@@ -184,8 +184,12 @@ async function deleteThreadHandler({
184
184
  async function getMessagesHandler({
185
185
  mastra,
186
186
  agentId,
187
- threadId
187
+ threadId,
188
+ limit
188
189
  }) {
190
+ if (limit !== void 0 && (!Number.isInteger(limit) || limit <= 0)) {
191
+ throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Invalid limit: must be a positive integer" });
192
+ }
189
193
  try {
190
194
  chunk57CJTIPW_cjs.validateBody({ threadId });
191
195
  const memory = getMemoryFromContext({ mastra, agentId });
@@ -196,7 +200,10 @@ async function getMessagesHandler({
196
200
  if (!thread) {
197
201
  throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Thread not found" });
198
202
  }
199
- const result = await memory.query({ threadId });
203
+ const result = await memory.query({
204
+ threadId,
205
+ ...limit && { selectBy: { last: limit } }
206
+ });
200
207
  return result;
201
208
  } catch (error) {
202
209
  return chunk64U3UDTH_cjs.handleError(error, "Error getting messages");
@@ -6,23 +6,23 @@ var chunkOCWPVYNI_cjs = require('./chunk-OCWPVYNI.cjs');
6
6
  var chunk75ZPJI57_cjs = require('./chunk-75ZPJI57.cjs');
7
7
  var web = require('stream/web');
8
8
 
9
- // src/server/handlers/workflows.ts
10
- var workflows_exports = {};
11
- chunk75ZPJI57_cjs.__export(workflows_exports, {
12
- createRunHandler: () => createRunHandler,
13
- getWorkflowByIdHandler: () => getWorkflowByIdHandler,
14
- getWorkflowRunHandler: () => getWorkflowRunHandler,
15
- getWorkflowRunsHandler: () => getWorkflowRunsHandler,
16
- getWorkflowsHandler: () => getWorkflowsHandler,
17
- resumeAsyncWorkflowHandler: () => resumeAsyncWorkflowHandler,
18
- resumeWorkflowHandler: () => resumeWorkflowHandler,
19
- startAsyncWorkflowHandler: () => startAsyncWorkflowHandler,
20
- startWorkflowRunHandler: () => startWorkflowRunHandler,
21
- watchWorkflowHandler: () => watchWorkflowHandler
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
22
  });
23
- async function getWorkflowsHandler({ mastra }) {
23
+ async function getLegacyWorkflowsHandler({ mastra }) {
24
24
  try {
25
- const workflows = mastra.getWorkflows({ serialized: false });
25
+ const workflows = mastra.legacy_getWorkflows({ serialized: false });
26
26
  const _workflows = Object.entries(workflows).reduce((acc, [key, workflow]) => {
27
27
  if (workflow.isNested) return acc;
28
28
  acc[key] = {
@@ -51,12 +51,12 @@ async function getWorkflowsHandler({ mastra }) {
51
51
  throw new chunkOCWPVYNI_cjs.HTTPException(500, { message: error?.message || "Error getting workflows" });
52
52
  }
53
53
  }
54
- async function getWorkflowByIdHandler({ mastra, workflowId }) {
54
+ async function getLegacyWorkflowByIdHandler({ mastra, workflowId }) {
55
55
  try {
56
56
  if (!workflowId) {
57
57
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
58
58
  }
59
- const workflow = mastra.getWorkflow(workflowId);
59
+ const workflow = mastra.legacy_getWorkflow(workflowId);
60
60
  if (!workflow) {
61
61
  throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow not found" });
62
62
  }
@@ -83,7 +83,7 @@ async function getWorkflowByIdHandler({ mastra, workflowId }) {
83
83
  throw new chunkOCWPVYNI_cjs.HTTPException(500, { message: error?.message || "Error getting workflow" });
84
84
  }
85
85
  }
86
- async function startAsyncWorkflowHandler({
86
+ async function startAsyncLegacyWorkflowHandler({
87
87
  mastra,
88
88
  runtimeContext,
89
89
  workflowId,
@@ -94,7 +94,7 @@ async function startAsyncWorkflowHandler({
94
94
  if (!workflowId) {
95
95
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
96
96
  }
97
- const workflow = mastra.getWorkflow(workflowId);
97
+ const workflow = mastra.legacy_getWorkflow(workflowId);
98
98
  if (!workflow) {
99
99
  throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow not found" });
100
100
  }
@@ -119,7 +119,7 @@ async function startAsyncWorkflowHandler({
119
119
  throw new chunkOCWPVYNI_cjs.HTTPException(500, { message: error?.message || "Error executing workflow" });
120
120
  }
121
121
  }
122
- async function getWorkflowRunHandler({
122
+ async function getLegacyWorkflowRunHandler({
123
123
  mastra,
124
124
  workflowId,
125
125
  runId
@@ -131,7 +131,7 @@ async function getWorkflowRunHandler({
131
131
  if (!runId) {
132
132
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Run ID is required" });
133
133
  }
134
- const workflow = mastra.getWorkflow(workflowId);
134
+ const workflow = mastra.legacy_getWorkflow(workflowId);
135
135
  if (!workflow) {
136
136
  throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow not found" });
137
137
  }
@@ -144,7 +144,7 @@ async function getWorkflowRunHandler({
144
144
  throw new chunkOCWPVYNI_cjs.HTTPException(500, { message: error?.message || "Error getting workflow run" });
145
145
  }
146
146
  }
147
- async function createRunHandler({
147
+ async function createLegacyWorkflowRunHandler({
148
148
  mastra,
149
149
  workflowId,
150
150
  runId: prevRunId
@@ -153,7 +153,7 @@ async function createRunHandler({
153
153
  if (!workflowId) {
154
154
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
155
155
  }
156
- const workflow = mastra.getWorkflow(workflowId);
156
+ const workflow = mastra.legacy_getWorkflow(workflowId);
157
157
  if (!workflow) {
158
158
  throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow not found" });
159
159
  }
@@ -163,7 +163,7 @@ async function createRunHandler({
163
163
  throw new chunkOCWPVYNI_cjs.HTTPException(500, { message: error?.message || "Error creating workflow run" });
164
164
  }
165
165
  }
166
- async function startWorkflowRunHandler({
166
+ async function startLegacyWorkflowRunHandler({
167
167
  mastra,
168
168
  runtimeContext,
169
169
  workflowId,
@@ -177,7 +177,7 @@ async function startWorkflowRunHandler({
177
177
  if (!runId) {
178
178
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "runId required to start run" });
179
179
  }
180
- const workflow = mastra.getWorkflow(workflowId);
180
+ const workflow = mastra.legacy_getWorkflow(workflowId);
181
181
  const run = workflow.getMemoryRun(runId);
182
182
  if (!run) {
183
183
  throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow run not found" });
@@ -191,7 +191,7 @@ async function startWorkflowRunHandler({
191
191
  return chunk64U3UDTH_cjs.handleError(e, "Error starting workflow run");
192
192
  }
193
193
  }
194
- async function watchWorkflowHandler({
194
+ async function watchLegacyWorkflowHandler({
195
195
  mastra,
196
196
  workflowId,
197
197
  runId
@@ -203,7 +203,7 @@ async function watchWorkflowHandler({
203
203
  if (!runId) {
204
204
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "runId required to watch workflow" });
205
205
  }
206
- const workflow = mastra.getWorkflow(workflowId);
206
+ const workflow = mastra.legacy_getWorkflow(workflowId);
207
207
  const run = workflow.getMemoryRun(runId);
208
208
  if (!run) {
209
209
  throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow run not found" });
@@ -237,7 +237,7 @@ async function watchWorkflowHandler({
237
237
  return chunk64U3UDTH_cjs.handleError(error, "Error watching workflow");
238
238
  }
239
239
  }
240
- async function resumeAsyncWorkflowHandler({
240
+ async function resumeAsyncLegacyWorkflowHandler({
241
241
  mastra,
242
242
  workflowId,
243
243
  runId,
@@ -251,7 +251,7 @@ async function resumeAsyncWorkflowHandler({
251
251
  if (!runId) {
252
252
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "runId required to resume workflow" });
253
253
  }
254
- const workflow = mastra.getWorkflow(workflowId);
254
+ const workflow = mastra.legacy_getWorkflow(workflowId);
255
255
  const run = workflow.getMemoryRun(runId);
256
256
  if (!run) {
257
257
  throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow run not found" });
@@ -266,7 +266,7 @@ async function resumeAsyncWorkflowHandler({
266
266
  return chunk64U3UDTH_cjs.handleError(error, "Error resuming workflow step");
267
267
  }
268
268
  }
269
- async function resumeWorkflowHandler({
269
+ async function resumeLegacyWorkflowHandler({
270
270
  mastra,
271
271
  workflowId,
272
272
  runId,
@@ -280,7 +280,7 @@ async function resumeWorkflowHandler({
280
280
  if (!runId) {
281
281
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "runId required to resume workflow" });
282
282
  }
283
- const workflow = mastra.getWorkflow(workflowId);
283
+ const workflow = mastra.legacy_getWorkflow(workflowId);
284
284
  const run = workflow.getMemoryRun(runId);
285
285
  if (!run) {
286
286
  throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow run not found" });
@@ -295,7 +295,7 @@ async function resumeWorkflowHandler({
295
295
  return chunk64U3UDTH_cjs.handleError(error, "Error resuming workflow");
296
296
  }
297
297
  }
298
- async function getWorkflowRunsHandler({
298
+ async function getLegacyWorkflowRunsHandler({
299
299
  mastra,
300
300
  workflowId,
301
301
  fromDate,
@@ -308,7 +308,7 @@ async function getWorkflowRunsHandler({
308
308
  if (!workflowId) {
309
309
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
310
310
  }
311
- const workflow = mastra.getWorkflow(workflowId);
311
+ const workflow = mastra.legacy_getWorkflow(workflowId);
312
312
  const workflowRuns = await workflow.getWorkflowRuns({ fromDate, toDate, limit, offset, resourceId }) || {
313
313
  runs: [],
314
314
  total: 0
@@ -319,14 +319,14 @@ async function getWorkflowRunsHandler({
319
319
  }
320
320
  }
321
321
 
322
- exports.createRunHandler = createRunHandler;
323
- exports.getWorkflowByIdHandler = getWorkflowByIdHandler;
324
- exports.getWorkflowRunHandler = getWorkflowRunHandler;
325
- exports.getWorkflowRunsHandler = getWorkflowRunsHandler;
326
- exports.getWorkflowsHandler = getWorkflowsHandler;
327
- exports.resumeAsyncWorkflowHandler = resumeAsyncWorkflowHandler;
328
- exports.resumeWorkflowHandler = resumeWorkflowHandler;
329
- exports.startAsyncWorkflowHandler = startAsyncWorkflowHandler;
330
- exports.startWorkflowRunHandler = startWorkflowRunHandler;
331
- exports.watchWorkflowHandler = watchWorkflowHandler;
332
- exports.workflows_exports = workflows_exports;
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;
@@ -1,30 +1,30 @@
1
1
  'use strict';
2
2
 
3
- var chunk3HQNCTZ2_cjs = require('../../chunk-3HQNCTZ2.cjs');
3
+ var chunkA3KDUGS7_cjs = require('../../chunk-A3KDUGS7.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "generateHandler", {
8
8
  enumerable: true,
9
- get: function () { return chunk3HQNCTZ2_cjs.generateHandler; }
9
+ get: function () { return chunkA3KDUGS7_cjs.generateHandler; }
10
10
  });
11
11
  Object.defineProperty(exports, "getAgentByIdHandler", {
12
12
  enumerable: true,
13
- get: function () { return chunk3HQNCTZ2_cjs.getAgentByIdHandler; }
13
+ get: function () { return chunkA3KDUGS7_cjs.getAgentByIdHandler; }
14
14
  });
15
15
  Object.defineProperty(exports, "getAgentsHandler", {
16
16
  enumerable: true,
17
- get: function () { return chunk3HQNCTZ2_cjs.getAgentsHandler; }
17
+ get: function () { return chunkA3KDUGS7_cjs.getAgentsHandler; }
18
18
  });
19
19
  Object.defineProperty(exports, "getEvalsByAgentIdHandler", {
20
20
  enumerable: true,
21
- get: function () { return chunk3HQNCTZ2_cjs.getEvalsByAgentIdHandler; }
21
+ get: function () { return chunkA3KDUGS7_cjs.getEvalsByAgentIdHandler; }
22
22
  });
23
23
  Object.defineProperty(exports, "getLiveEvalsByAgentIdHandler", {
24
24
  enumerable: true,
25
- get: function () { return chunk3HQNCTZ2_cjs.getLiveEvalsByAgentIdHandler; }
25
+ get: function () { return chunkA3KDUGS7_cjs.getLiveEvalsByAgentIdHandler; }
26
26
  });
27
27
  Object.defineProperty(exports, "streamGenerateHandler", {
28
28
  enumerable: true,
29
- get: function () { return chunk3HQNCTZ2_cjs.streamGenerateHandler; }
29
+ get: function () { return chunkA3KDUGS7_cjs.streamGenerateHandler; }
30
30
  });
@@ -1 +1 @@
1
- export { generateHandler, getAgentByIdHandler, getAgentsHandler, getEvalsByAgentIdHandler, getLiveEvalsByAgentIdHandler, streamGenerateHandler } from '../../chunk-Q6KMBIAN.js';
1
+ export { generateHandler, getAgentByIdHandler, getAgentsHandler, getEvalsByAgentIdHandler, getLiveEvalsByAgentIdHandler, streamGenerateHandler } from '../../chunk-J3PKLB3A.js';
@@ -0,0 +1,46 @@
1
+ 'use strict';
2
+
3
+ var chunkYIOVBYZH_cjs = require('../../chunk-YIOVBYZH.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "createLegacyWorkflowRunHandler", {
8
+ enumerable: true,
9
+ get: function () { return chunkYIOVBYZH_cjs.createLegacyWorkflowRunHandler; }
10
+ });
11
+ Object.defineProperty(exports, "getLegacyWorkflowByIdHandler", {
12
+ enumerable: true,
13
+ get: function () { return chunkYIOVBYZH_cjs.getLegacyWorkflowByIdHandler; }
14
+ });
15
+ Object.defineProperty(exports, "getLegacyWorkflowRunHandler", {
16
+ enumerable: true,
17
+ get: function () { return chunkYIOVBYZH_cjs.getLegacyWorkflowRunHandler; }
18
+ });
19
+ Object.defineProperty(exports, "getLegacyWorkflowRunsHandler", {
20
+ enumerable: true,
21
+ get: function () { return chunkYIOVBYZH_cjs.getLegacyWorkflowRunsHandler; }
22
+ });
23
+ Object.defineProperty(exports, "getLegacyWorkflowsHandler", {
24
+ enumerable: true,
25
+ get: function () { return chunkYIOVBYZH_cjs.getLegacyWorkflowsHandler; }
26
+ });
27
+ Object.defineProperty(exports, "resumeAsyncLegacyWorkflowHandler", {
28
+ enumerable: true,
29
+ get: function () { return chunkYIOVBYZH_cjs.resumeAsyncLegacyWorkflowHandler; }
30
+ });
31
+ Object.defineProperty(exports, "resumeLegacyWorkflowHandler", {
32
+ enumerable: true,
33
+ get: function () { return chunkYIOVBYZH_cjs.resumeLegacyWorkflowHandler; }
34
+ });
35
+ Object.defineProperty(exports, "startAsyncLegacyWorkflowHandler", {
36
+ enumerable: true,
37
+ get: function () { return chunkYIOVBYZH_cjs.startAsyncLegacyWorkflowHandler; }
38
+ });
39
+ Object.defineProperty(exports, "startLegacyWorkflowRunHandler", {
40
+ enumerable: true,
41
+ get: function () { return chunkYIOVBYZH_cjs.startLegacyWorkflowRunHandler; }
42
+ });
43
+ Object.defineProperty(exports, "watchLegacyWorkflowHandler", {
44
+ enumerable: true,
45
+ get: function () { return chunkYIOVBYZH_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-W7VCKPAD.js';
@@ -1,18 +1,18 @@
1
1
  'use strict';
2
2
 
3
- var chunkOGCNNUHF_cjs = require('../../chunk-OGCNNUHF.cjs');
3
+ var chunkNEOOQUKW_cjs = require('../../chunk-NEOOQUKW.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "getLogTransports", {
8
8
  enumerable: true,
9
- get: function () { return chunkOGCNNUHF_cjs.getLogTransports; }
9
+ get: function () { return chunkNEOOQUKW_cjs.getLogTransports; }
10
10
  });
11
11
  Object.defineProperty(exports, "getLogsByRunIdHandler", {
12
12
  enumerable: true,
13
- get: function () { return chunkOGCNNUHF_cjs.getLogsByRunIdHandler; }
13
+ get: function () { return chunkNEOOQUKW_cjs.getLogsByRunIdHandler; }
14
14
  });
15
15
  Object.defineProperty(exports, "getLogsHandler", {
16
16
  enumerable: true,
17
- get: function () { return chunkOGCNNUHF_cjs.getLogsHandler; }
17
+ get: function () { return chunkNEOOQUKW_cjs.getLogsHandler; }
18
18
  });
@@ -1 +1 @@
1
- export { getLogTransports, getLogsByRunIdHandler, getLogsHandler } from '../../chunk-HWZVAG3H.js';
1
+ export { getLogTransports, getLogsByRunIdHandler, getLogsHandler } from '../../chunk-DQLE3DVM.js';
@@ -1,38 +1,38 @@
1
1
  'use strict';
2
2
 
3
- var chunk24EGIVT7_cjs = require('../../chunk-24EGIVT7.cjs');
3
+ var chunkY7UWRW5X_cjs = require('../../chunk-Y7UWRW5X.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "createThreadHandler", {
8
8
  enumerable: true,
9
- get: function () { return chunk24EGIVT7_cjs.createThreadHandler; }
9
+ get: function () { return chunkY7UWRW5X_cjs.createThreadHandler; }
10
10
  });
11
11
  Object.defineProperty(exports, "deleteThreadHandler", {
12
12
  enumerable: true,
13
- get: function () { return chunk24EGIVT7_cjs.deleteThreadHandler; }
13
+ get: function () { return chunkY7UWRW5X_cjs.deleteThreadHandler; }
14
14
  });
15
15
  Object.defineProperty(exports, "getMemoryStatusHandler", {
16
16
  enumerable: true,
17
- get: function () { return chunk24EGIVT7_cjs.getMemoryStatusHandler; }
17
+ get: function () { return chunkY7UWRW5X_cjs.getMemoryStatusHandler; }
18
18
  });
19
19
  Object.defineProperty(exports, "getMessagesHandler", {
20
20
  enumerable: true,
21
- get: function () { return chunk24EGIVT7_cjs.getMessagesHandler; }
21
+ get: function () { return chunkY7UWRW5X_cjs.getMessagesHandler; }
22
22
  });
23
23
  Object.defineProperty(exports, "getThreadByIdHandler", {
24
24
  enumerable: true,
25
- get: function () { return chunk24EGIVT7_cjs.getThreadByIdHandler; }
25
+ get: function () { return chunkY7UWRW5X_cjs.getThreadByIdHandler; }
26
26
  });
27
27
  Object.defineProperty(exports, "getThreadsHandler", {
28
28
  enumerable: true,
29
- get: function () { return chunk24EGIVT7_cjs.getThreadsHandler; }
29
+ get: function () { return chunkY7UWRW5X_cjs.getThreadsHandler; }
30
30
  });
31
31
  Object.defineProperty(exports, "saveMessagesHandler", {
32
32
  enumerable: true,
33
- get: function () { return chunk24EGIVT7_cjs.saveMessagesHandler; }
33
+ get: function () { return chunkY7UWRW5X_cjs.saveMessagesHandler; }
34
34
  });
35
35
  Object.defineProperty(exports, "updateThreadHandler", {
36
36
  enumerable: true,
37
- get: function () { return chunk24EGIVT7_cjs.updateThreadHandler; }
37
+ get: function () { return chunkY7UWRW5X_cjs.updateThreadHandler; }
38
38
  });
@@ -1 +1 @@
1
- export { createThreadHandler, deleteThreadHandler, getMemoryStatusHandler, getMessagesHandler, getThreadByIdHandler, getThreadsHandler, saveMessagesHandler, updateThreadHandler } from '../../chunk-X3ZDCS52.js';
1
+ export { createThreadHandler, deleteThreadHandler, getMemoryStatusHandler, getMessagesHandler, getThreadByIdHandler, getThreadsHandler, saveMessagesHandler, updateThreadHandler } from '../../chunk-DJJIUEL2.js';