@mastra/deployer 0.10.6-alpha.0 → 0.10.6-alpha.1

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.
@@ -572,6 +572,10 @@ export declare const getVector: (c: Context, vectorName: string) => MastraVector
572
572
 
573
573
  export declare function getWorkflowByIdHandler(c: Context): Promise<Response>;
574
574
 
575
+ export declare function getWorkflowRunByIdHandler(c: Context): Promise<Response>;
576
+
577
+ export declare function getWorkflowRunExecutionResultHandler(c: Context): Promise<Response>;
578
+
575
579
  export declare function getWorkflowRunsHandler(c: Context): Promise<Response>;
576
580
 
577
581
  export declare function getWorkflowsHandler(c: Context): Promise<Response>;
@@ -572,6 +572,10 @@ export declare const getVector: (c: Context, vectorName: string) => MastraVector
572
572
 
573
573
  export declare function getWorkflowByIdHandler(c: Context): Promise<Response>;
574
574
 
575
+ export declare function getWorkflowRunByIdHandler(c: Context): Promise<Response>;
576
+
577
+ export declare function getWorkflowRunExecutionResultHandler(c: Context): Promise<Response>;
578
+
575
579
  export declare function getWorkflowRunsHandler(c: Context): Promise<Response>;
576
580
 
577
581
  export declare function getWorkflowsHandler(c: Context): Promise<Response>;
@@ -4190,8 +4190,7 @@ async function startAsyncWorkflowHandler(c2) {
4190
4190
  try {
4191
4191
  const mastra = c2.get("mastra");
4192
4192
  const workflowId = c2.req.param("workflowId");
4193
- const runtimeContext = c2.get("runtimeContext");
4194
- const { inputData } = await c2.req.json();
4193
+ const { inputData, runtimeContext } = await c2.req.json();
4195
4194
  const runId = c2.req.query("runId");
4196
4195
  const result = await workflows.startAsyncWorkflowHandler({
4197
4196
  mastra,
@@ -4209,8 +4208,7 @@ async function startWorkflowRunHandler(c2) {
4209
4208
  try {
4210
4209
  const mastra = c2.get("mastra");
4211
4210
  const workflowId = c2.req.param("workflowId");
4212
- const runtimeContext = c2.get("runtimeContext");
4213
- const { inputData } = await c2.req.json();
4211
+ const { inputData, runtimeContext } = await c2.req.json();
4214
4212
  const runId = c2.req.query("runId");
4215
4213
  await workflows.startWorkflowRunHandler({
4216
4214
  mastra,
@@ -4267,8 +4265,7 @@ async function streamWorkflowHandler(c2) {
4267
4265
  const mastra = c2.get("mastra");
4268
4266
  const logger2 = mastra.getLogger();
4269
4267
  const workflowId = c2.req.param("workflowId");
4270
- const runtimeContext = c2.get("runtimeContext");
4271
- const { inputData } = await c2.req.json();
4268
+ const { inputData, runtimeContext } = await c2.req.json();
4272
4269
  const runId = c2.req.query("runId");
4273
4270
  return streaming.stream(
4274
4271
  c2,
@@ -4306,8 +4303,7 @@ async function resumeAsyncWorkflowHandler(c2) {
4306
4303
  const mastra = c2.get("mastra");
4307
4304
  const workflowId = c2.req.param("workflowId");
4308
4305
  const runId = c2.req.query("runId");
4309
- const runtimeContext = c2.get("runtimeContext");
4310
- const { step, resumeData } = await c2.req.json();
4306
+ const { step, resumeData, runtimeContext } = await c2.req.json();
4311
4307
  if (!runId) {
4312
4308
  throw new httpException.HTTPException(400, { message: "runId required to resume workflow" });
4313
4309
  }
@@ -4363,6 +4359,36 @@ async function getWorkflowRunsHandler(c2) {
4363
4359
  return handleError(error, "Error getting workflow runs");
4364
4360
  }
4365
4361
  }
4362
+ async function getWorkflowRunByIdHandler(c2) {
4363
+ try {
4364
+ const mastra = c2.get("mastra");
4365
+ const workflowId = c2.req.param("workflowId");
4366
+ const runId = c2.req.param("runId");
4367
+ const workflowRun = await workflows.getWorkflowRunByIdHandler({
4368
+ mastra,
4369
+ workflowId,
4370
+ runId
4371
+ });
4372
+ return c2.json(workflowRun);
4373
+ } catch (error) {
4374
+ return handleError(error, "Error getting workflow run");
4375
+ }
4376
+ }
4377
+ async function getWorkflowRunExecutionResultHandler(c2) {
4378
+ try {
4379
+ const mastra = c2.get("mastra");
4380
+ const workflowId = c2.req.param("workflowId");
4381
+ const runId = c2.req.param("runId");
4382
+ const workflowRunExecutionResult = await workflows.getWorkflowRunExecutionResultHandler({
4383
+ mastra,
4384
+ workflowId,
4385
+ runId
4386
+ });
4387
+ return c2.json(workflowRunExecutionResult);
4388
+ } catch (error) {
4389
+ return handleError(error, "Error getting workflow run execution result");
4390
+ }
4391
+ }
4366
4392
 
4367
4393
  // src/server/welcome.ts
4368
4394
  var html2 = `
@@ -6611,53 +6637,6 @@ ${err.stack.split("\n").slice(1).join("\n")}
6611
6637
  }),
6612
6638
  watchLegacyWorkflowHandler
6613
6639
  );
6614
- app.post(
6615
- "/api/workflows/:workflowId/stream",
6616
- w({
6617
- description: "Stream workflow in real-time",
6618
- parameters: [
6619
- {
6620
- name: "workflowId",
6621
- in: "path",
6622
- required: true,
6623
- schema: { type: "string" }
6624
- },
6625
- {
6626
- name: "runId",
6627
- in: "query",
6628
- required: false,
6629
- schema: { type: "string" }
6630
- }
6631
- ],
6632
- requestBody: {
6633
- required: true,
6634
- content: {
6635
- "application/json": {
6636
- schema: {
6637
- type: "object",
6638
- properties: {
6639
- inputData: { type: "object" },
6640
- runtimeContext: {
6641
- type: "object",
6642
- description: "Runtime context for the workflow execution"
6643
- }
6644
- }
6645
- }
6646
- }
6647
- }
6648
- },
6649
- responses: {
6650
- 200: {
6651
- description: "vNext workflow run started"
6652
- },
6653
- 404: {
6654
- description: "vNext workflow not found"
6655
- }
6656
- },
6657
- tags: ["vNextWorkflows"]
6658
- }),
6659
- streamWorkflowHandler
6660
- );
6661
6640
  app.get(
6662
6641
  "/api/workflows",
6663
6642
  w({
@@ -6721,6 +6700,66 @@ ${err.stack.split("\n").slice(1).join("\n")}
6721
6700
  }),
6722
6701
  getWorkflowRunsHandler
6723
6702
  );
6703
+ app.get(
6704
+ "/api/workflows/:workflowId/runs/:runId/execution-result",
6705
+ w({
6706
+ description: "Get execution result for a workflow run",
6707
+ tags: ["workflows"],
6708
+ parameters: [
6709
+ {
6710
+ name: "workflowId",
6711
+ in: "path",
6712
+ required: true,
6713
+ schema: { type: "string" }
6714
+ },
6715
+ {
6716
+ name: "runId",
6717
+ in: "path",
6718
+ required: true,
6719
+ schema: { type: "string" }
6720
+ }
6721
+ ],
6722
+ responses: {
6723
+ 200: {
6724
+ description: "Workflow run execution result"
6725
+ },
6726
+ 404: {
6727
+ description: "Workflow run execution result not found"
6728
+ }
6729
+ }
6730
+ }),
6731
+ getWorkflowRunExecutionResultHandler
6732
+ );
6733
+ app.get(
6734
+ "/api/workflows/:workflowId/runs/:runId",
6735
+ w({
6736
+ description: "Get workflow run by ID",
6737
+ tags: ["workflows"],
6738
+ parameters: [
6739
+ {
6740
+ name: "workflowId",
6741
+ in: "path",
6742
+ required: true,
6743
+ schema: { type: "string" }
6744
+ },
6745
+ {
6746
+ name: "runId",
6747
+ in: "path",
6748
+ required: true,
6749
+ schema: { type: "string" }
6750
+ }
6751
+ ],
6752
+ responses: {
6753
+ 200: {
6754
+ description: "Workflow run by ID"
6755
+ },
6756
+ 404: {
6757
+ description: "Workflow run not found"
6758
+ }
6759
+ }
6760
+ }),
6761
+ getWorkflowRunByIdHandler
6762
+ );
6724
6763
  app.post(
6725
6764
  "/api/workflows/:workflowId/resume",
6726
6765
  w({
@@ -6808,6 +6847,53 @@ ${err.stack.split("\n").slice(1).join("\n")}
6808
6847
  }),
6809
6848
  resumeAsyncWorkflowHandler
6810
6849
  );
6850
+ app.post(
6851
+ "/api/workflows/:workflowId/stream",
6852
+ w({
6853
+ description: "Stream workflow in real-time",
6854
+ parameters: [
6855
+ {
6856
+ name: "workflowId",
6857
+ in: "path",
6858
+ required: true,
6859
+ schema: { type: "string" }
6860
+ },
6861
+ {
6862
+ name: "runId",
6863
+ in: "query",
6864
+ required: false,
6865
+ schema: { type: "string" }
6866
+ }
6867
+ ],
6868
+ requestBody: {
6869
+ required: true,
6870
+ content: {
6871
+ "application/json": {
6872
+ schema: {
6873
+ type: "object",
6874
+ properties: {
6875
+ inputData: { type: "object" },
6876
+ runtimeContext: {
6877
+ type: "object",
6878
+ description: "Runtime context for the workflow execution"
6879
+ }
6880
+ }
6881
+ }
6882
+ }
6883
+ }
6884
+ },
6885
+ responses: {
6886
+ 200: {
6887
+ description: "workflow run started"
6888
+ },
6889
+ 404: {
6890
+ description: "workflow not found"
6891
+ }
6892
+ },
6893
+ tags: ["workflows"]
6894
+ }),
6895
+ streamWorkflowHandler
6896
+ );
6811
6897
  app.post(
6812
6898
  "/api/workflows/:workflowId/create-run",
6813
6899
  bodyLimit.bodyLimit(bodyLimitOptions),
@@ -31,7 +31,7 @@ import { getTelemetryHandler as getTelemetryHandler$1, storeTelemetryHandler as
31
31
  import { executeAgentToolHandler as executeAgentToolHandler$1, getToolsHandler as getToolsHandler$1, getToolByIdHandler as getToolByIdHandler$1, executeToolHandler as executeToolHandler$1 } from '@mastra/server/handlers/tools';
32
32
  import { upsertVectors as upsertVectors$1, createIndex as createIndex$1, queryVectors as queryVectors$1, listIndexes as listIndexes$1, describeIndex as describeIndex$1, deleteIndex as deleteIndex$1 } from '@mastra/server/handlers/vector';
33
33
  import { getSpeakersHandler as getSpeakersHandler$1, generateSpeechHandler, getListenerHandler as getListenerHandler$1, transcribeSpeechHandler } from '@mastra/server/handlers/voice';
34
- import { streamWorkflowHandler as streamWorkflowHandler$1, getWorkflowsHandler as getWorkflowsHandler$1, getWorkflowByIdHandler as getWorkflowByIdHandler$1, getWorkflowRunsHandler as getWorkflowRunsHandler$1, resumeWorkflowHandler as resumeWorkflowHandler$1, resumeAsyncWorkflowHandler as resumeAsyncWorkflowHandler$1, createWorkflowRunHandler as createWorkflowRunHandler$1, startAsyncWorkflowHandler as startAsyncWorkflowHandler$1, startWorkflowRunHandler as startWorkflowRunHandler$1, watchWorkflowHandler as watchWorkflowHandler$1 } from '@mastra/server/handlers/workflows';
34
+ import { getWorkflowsHandler as getWorkflowsHandler$1, getWorkflowByIdHandler as getWorkflowByIdHandler$1, getWorkflowRunsHandler as getWorkflowRunsHandler$1, getWorkflowRunExecutionResultHandler as getWorkflowRunExecutionResultHandler$1, getWorkflowRunByIdHandler as getWorkflowRunByIdHandler$1, resumeWorkflowHandler as resumeWorkflowHandler$1, resumeAsyncWorkflowHandler as resumeAsyncWorkflowHandler$1, streamWorkflowHandler as streamWorkflowHandler$1, createWorkflowRunHandler as createWorkflowRunHandler$1, startAsyncWorkflowHandler as startAsyncWorkflowHandler$1, startWorkflowRunHandler as startWorkflowRunHandler$1, watchWorkflowHandler as watchWorkflowHandler$1 } from '@mastra/server/handlers/workflows';
35
35
 
36
36
  // src/server/index.ts
37
37
  var RequestError = class extends Error {
@@ -4183,8 +4183,7 @@ async function startAsyncWorkflowHandler(c2) {
4183
4183
  try {
4184
4184
  const mastra = c2.get("mastra");
4185
4185
  const workflowId = c2.req.param("workflowId");
4186
- const runtimeContext = c2.get("runtimeContext");
4187
- const { inputData } = await c2.req.json();
4186
+ const { inputData, runtimeContext } = await c2.req.json();
4188
4187
  const runId = c2.req.query("runId");
4189
4188
  const result = await startAsyncWorkflowHandler$1({
4190
4189
  mastra,
@@ -4202,8 +4201,7 @@ async function startWorkflowRunHandler(c2) {
4202
4201
  try {
4203
4202
  const mastra = c2.get("mastra");
4204
4203
  const workflowId = c2.req.param("workflowId");
4205
- const runtimeContext = c2.get("runtimeContext");
4206
- const { inputData } = await c2.req.json();
4204
+ const { inputData, runtimeContext } = await c2.req.json();
4207
4205
  const runId = c2.req.query("runId");
4208
4206
  await startWorkflowRunHandler$1({
4209
4207
  mastra,
@@ -4260,8 +4258,7 @@ async function streamWorkflowHandler(c2) {
4260
4258
  const mastra = c2.get("mastra");
4261
4259
  const logger2 = mastra.getLogger();
4262
4260
  const workflowId = c2.req.param("workflowId");
4263
- const runtimeContext = c2.get("runtimeContext");
4264
- const { inputData } = await c2.req.json();
4261
+ const { inputData, runtimeContext } = await c2.req.json();
4265
4262
  const runId = c2.req.query("runId");
4266
4263
  return stream(
4267
4264
  c2,
@@ -4299,8 +4296,7 @@ async function resumeAsyncWorkflowHandler(c2) {
4299
4296
  const mastra = c2.get("mastra");
4300
4297
  const workflowId = c2.req.param("workflowId");
4301
4298
  const runId = c2.req.query("runId");
4302
- const runtimeContext = c2.get("runtimeContext");
4303
- const { step, resumeData } = await c2.req.json();
4299
+ const { step, resumeData, runtimeContext } = await c2.req.json();
4304
4300
  if (!runId) {
4305
4301
  throw new HTTPException(400, { message: "runId required to resume workflow" });
4306
4302
  }
@@ -4356,6 +4352,36 @@ async function getWorkflowRunsHandler(c2) {
4356
4352
  return handleError(error, "Error getting workflow runs");
4357
4353
  }
4358
4354
  }
4355
+ async function getWorkflowRunByIdHandler(c2) {
4356
+ try {
4357
+ const mastra = c2.get("mastra");
4358
+ const workflowId = c2.req.param("workflowId");
4359
+ const runId = c2.req.param("runId");
4360
+ const workflowRun = await getWorkflowRunByIdHandler$1({
4361
+ mastra,
4362
+ workflowId,
4363
+ runId
4364
+ });
4365
+ return c2.json(workflowRun);
4366
+ } catch (error) {
4367
+ return handleError(error, "Error getting workflow run");
4368
+ }
4369
+ }
4370
+ async function getWorkflowRunExecutionResultHandler(c2) {
4371
+ try {
4372
+ const mastra = c2.get("mastra");
4373
+ const workflowId = c2.req.param("workflowId");
4374
+ const runId = c2.req.param("runId");
4375
+ const workflowRunExecutionResult = await getWorkflowRunExecutionResultHandler$1({
4376
+ mastra,
4377
+ workflowId,
4378
+ runId
4379
+ });
4380
+ return c2.json(workflowRunExecutionResult);
4381
+ } catch (error) {
4382
+ return handleError(error, "Error getting workflow run execution result");
4383
+ }
4384
+ }
4359
4385
 
4360
4386
  // src/server/welcome.ts
4361
4387
  var html2 = `
@@ -6604,53 +6630,6 @@ ${err.stack.split("\n").slice(1).join("\n")}
6604
6630
  }),
6605
6631
  watchLegacyWorkflowHandler
6606
6632
  );
6607
- app.post(
6608
- "/api/workflows/:workflowId/stream",
6609
- w({
6610
- description: "Stream workflow in real-time",
6611
- parameters: [
6612
- {
6613
- name: "workflowId",
6614
- in: "path",
6615
- required: true,
6616
- schema: { type: "string" }
6617
- },
6618
- {
6619
- name: "runId",
6620
- in: "query",
6621
- required: false,
6622
- schema: { type: "string" }
6623
- }
6624
- ],
6625
- requestBody: {
6626
- required: true,
6627
- content: {
6628
- "application/json": {
6629
- schema: {
6630
- type: "object",
6631
- properties: {
6632
- inputData: { type: "object" },
6633
- runtimeContext: {
6634
- type: "object",
6635
- description: "Runtime context for the workflow execution"
6636
- }
6637
- }
6638
- }
6639
- }
6640
- }
6641
- },
6642
- responses: {
6643
- 200: {
6644
- description: "vNext workflow run started"
6645
- },
6646
- 404: {
6647
- description: "vNext workflow not found"
6648
- }
6649
- },
6650
- tags: ["vNextWorkflows"]
6651
- }),
6652
- streamWorkflowHandler
6653
- );
6654
6633
  app.get(
6655
6634
  "/api/workflows",
6656
6635
  w({
@@ -6714,6 +6693,66 @@ ${err.stack.split("\n").slice(1).join("\n")}
6714
6693
  }),
6715
6694
  getWorkflowRunsHandler
6716
6695
  );
6696
+ app.get(
6697
+ "/api/workflows/:workflowId/runs/:runId/execution-result",
6698
+ w({
6699
+ description: "Get execution result for a workflow run",
6700
+ tags: ["workflows"],
6701
+ parameters: [
6702
+ {
6703
+ name: "workflowId",
6704
+ in: "path",
6705
+ required: true,
6706
+ schema: { type: "string" }
6707
+ },
6708
+ {
6709
+ name: "runId",
6710
+ in: "path",
6711
+ required: true,
6712
+ schema: { type: "string" }
6713
+ }
6714
+ ],
6715
+ responses: {
6716
+ 200: {
6717
+ description: "Workflow run execution result"
6718
+ },
6719
+ 404: {
6720
+ description: "Workflow run execution result not found"
6721
+ }
6722
+ }
6723
+ }),
6724
+ getWorkflowRunExecutionResultHandler
6725
+ );
6726
+ app.get(
6727
+ "/api/workflows/:workflowId/runs/:runId",
6728
+ w({
6729
+ description: "Get workflow run by ID",
6730
+ tags: ["workflows"],
6731
+ parameters: [
6732
+ {
6733
+ name: "workflowId",
6734
+ in: "path",
6735
+ required: true,
6736
+ schema: { type: "string" }
6737
+ },
6738
+ {
6739
+ name: "runId",
6740
+ in: "path",
6741
+ required: true,
6742
+ schema: { type: "string" }
6743
+ }
6744
+ ],
6745
+ responses: {
6746
+ 200: {
6747
+ description: "Workflow run by ID"
6748
+ },
6749
+ 404: {
6750
+ description: "Workflow run not found"
6751
+ }
6752
+ }
6753
+ }),
6754
+ getWorkflowRunByIdHandler
6755
+ );
6717
6756
  app.post(
6718
6757
  "/api/workflows/:workflowId/resume",
6719
6758
  w({
@@ -6801,6 +6840,53 @@ ${err.stack.split("\n").slice(1).join("\n")}
6801
6840
  }),
6802
6841
  resumeAsyncWorkflowHandler
6803
6842
  );
6843
+ app.post(
6844
+ "/api/workflows/:workflowId/stream",
6845
+ w({
6846
+ description: "Stream workflow in real-time",
6847
+ parameters: [
6848
+ {
6849
+ name: "workflowId",
6850
+ in: "path",
6851
+ required: true,
6852
+ schema: { type: "string" }
6853
+ },
6854
+ {
6855
+ name: "runId",
6856
+ in: "query",
6857
+ required: false,
6858
+ schema: { type: "string" }
6859
+ }
6860
+ ],
6861
+ requestBody: {
6862
+ required: true,
6863
+ content: {
6864
+ "application/json": {
6865
+ schema: {
6866
+ type: "object",
6867
+ properties: {
6868
+ inputData: { type: "object" },
6869
+ runtimeContext: {
6870
+ type: "object",
6871
+ description: "Runtime context for the workflow execution"
6872
+ }
6873
+ }
6874
+ }
6875
+ }
6876
+ }
6877
+ },
6878
+ responses: {
6879
+ 200: {
6880
+ description: "workflow run started"
6881
+ },
6882
+ 404: {
6883
+ description: "workflow not found"
6884
+ }
6885
+ },
6886
+ tags: ["workflows"]
6887
+ }),
6888
+ streamWorkflowHandler
6889
+ );
6804
6890
  app.post(
6805
6891
  "/api/workflows/:workflowId/create-run",
6806
6892
  bodyLimit(bodyLimitOptions),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/deployer",
3
- "version": "0.10.6-alpha.0",
3
+ "version": "0.10.6-alpha.1",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "files": [
@@ -108,7 +108,7 @@
108
108
  "rollup-plugin-node-externals": "^8.0.0",
109
109
  "typescript-paths": "^1.5.1",
110
110
  "zod": "^3.25.57",
111
- "@mastra/server": "^0.10.6-alpha.0"
111
+ "@mastra/server": "^0.10.6-alpha.1"
112
112
  },
113
113
  "devDependencies": {
114
114
  "@hono/node-server": "^1.14.4",
@@ -127,9 +127,9 @@
127
127
  "type-fest": "^4.41.0",
128
128
  "typescript": "^5.8.3",
129
129
  "vitest": "^2.1.9",
130
- "@internal/lint": "0.0.12",
131
- "@mastra/core": "0.10.6-alpha.0",
132
- "@mastra/mcp": "^0.10.4-alpha.0"
130
+ "@mastra/core": "0.10.6-alpha.1",
131
+ "@mastra/mcp": "^0.10.4-alpha.0",
132
+ "@internal/lint": "0.0.12"
133
133
  },
134
134
  "peerDependencies": {
135
135
  "@mastra/core": "^0.10.2-alpha.0"