@mastra/server 0.10.5 → 0.10.6-alpha.0

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.
@@ -709,10 +709,10 @@ export declare function streamGenerateHandler_alias_1({ mastra, networkId, body,
709
709
  export declare function streamWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
710
710
  inputData?: unknown;
711
711
  runtimeContext?: RuntimeContext_2;
712
- }): {
712
+ }): Promise<{
713
713
  stream: globalThis.ReadableStream<StreamEvent>;
714
714
  getWorkflowState: () => Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
715
- };
715
+ }>;
716
716
 
717
717
  declare type SuccessStatusCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226;
718
718
 
@@ -709,10 +709,10 @@ export declare function streamGenerateHandler_alias_1({ mastra, networkId, body,
709
709
  export declare function streamWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
710
710
  inputData?: unknown;
711
711
  runtimeContext?: RuntimeContext_2;
712
- }): {
712
+ }): Promise<{
713
713
  stream: globalThis.ReadableStream<StreamEvent>;
714
714
  getWorkflowState: () => Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
715
- };
715
+ }>;
716
716
 
717
717
  declare type SuccessStatusCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226;
718
718
 
@@ -1,4 +1,4 @@
1
- import { stringify, esm_default } from './chunk-WKWHYFX4.js';
1
+ import { stringify, esm_default } from './chunk-TGJMNUYJ.js';
2
2
  import { validateBody } from './chunk-H5PTF3Y4.js';
3
3
  import { handleError } from './chunk-M5ABIP7D.js';
4
4
  import { HTTPException } from './chunk-NYN7KFXL.js';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkXUGQSVZ4_cjs = require('./chunk-XUGQSVZ4.cjs');
3
+ var chunkASKESBJW_cjs = require('./chunk-ASKESBJW.cjs');
4
4
  var chunk57CJTIPW_cjs = require('./chunk-57CJTIPW.cjs');
5
5
  var chunk64U3UDTH_cjs = require('./chunk-64U3UDTH.cjs');
6
6
  var chunkOCWPVYNI_cjs = require('./chunk-OCWPVYNI.cjs');
@@ -29,8 +29,8 @@ async function getAgentsHandler({ mastra, runtimeContext }) {
29
29
  const _tool = tool;
30
30
  acc[key] = {
31
31
  ..._tool,
32
- inputSchema: _tool.inputSchema ? chunkXUGQSVZ4_cjs.stringify(chunkXUGQSVZ4_cjs.esm_default(_tool.inputSchema)) : void 0,
33
- outputSchema: _tool.outputSchema ? chunkXUGQSVZ4_cjs.stringify(chunkXUGQSVZ4_cjs.esm_default(_tool.outputSchema)) : void 0
32
+ inputSchema: _tool.inputSchema ? chunkASKESBJW_cjs.stringify(chunkASKESBJW_cjs.esm_default(_tool.inputSchema)) : void 0,
33
+ outputSchema: _tool.outputSchema ? chunkASKESBJW_cjs.stringify(chunkASKESBJW_cjs.esm_default(_tool.outputSchema)) : void 0
34
34
  };
35
35
  return acc;
36
36
  }, {});
@@ -89,8 +89,8 @@ async function getAgentByIdHandler({
89
89
  const _tool = tool;
90
90
  acc[key] = {
91
91
  ..._tool,
92
- inputSchema: _tool.inputSchema ? chunkXUGQSVZ4_cjs.stringify(chunkXUGQSVZ4_cjs.esm_default(_tool.inputSchema)) : void 0,
93
- outputSchema: _tool.outputSchema ? chunkXUGQSVZ4_cjs.stringify(chunkXUGQSVZ4_cjs.esm_default(_tool.outputSchema)) : void 0
92
+ inputSchema: _tool.inputSchema ? chunkASKESBJW_cjs.stringify(chunkASKESBJW_cjs.esm_default(_tool.inputSchema)) : void 0,
93
+ outputSchema: _tool.outputSchema ? chunkASKESBJW_cjs.stringify(chunkASKESBJW_cjs.esm_default(_tool.outputSchema)) : void 0
94
94
  };
95
95
  return acc;
96
96
  }, {});
@@ -766,7 +766,7 @@ SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJS
766
766
  SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);
767
767
  var stringify = SuperJSON.stringify;
768
768
 
769
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/Options.js
769
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/Options.js
770
770
  var ignoreOverride = Symbol("Let zodToJsonSchema decide on which parser to use");
771
771
  var defaultOptions = {
772
772
  name: void 0,
@@ -799,7 +799,7 @@ var getDefaultOptions = (options) => typeof options === "string" ? {
799
799
  ...options
800
800
  };
801
801
 
802
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/Refs.js
802
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/Refs.js
803
803
  var getRefs = (options) => {
804
804
  const _options = getDefaultOptions(options);
805
805
  const currentPath = _options.name !== void 0 ? [..._options.basePath, _options.definitionPath, _options.name] : _options.basePath;
@@ -819,7 +819,7 @@ var getRefs = (options) => {
819
819
  };
820
820
  };
821
821
 
822
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/errorMessages.js
822
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/errorMessages.js
823
823
  function addErrorMessage(res, key, errorMessage, refs) {
824
824
  if (!refs?.errorMessages)
825
825
  return;
@@ -835,7 +835,7 @@ function setResponseValueAndErrors(res, key, value, errorMessage, refs) {
835
835
  addErrorMessage(res, key, errorMessage, refs);
836
836
  }
837
837
 
838
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/any.js
838
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/any.js
839
839
  function parseAnyDef() {
840
840
  return {};
841
841
  }
@@ -862,7 +862,7 @@ function parseArrayDef(def, refs) {
862
862
  return res;
863
863
  }
864
864
 
865
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
865
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
866
866
  function parseBigintDef(def, refs) {
867
867
  const res = {
868
868
  type: "integer",
@@ -908,24 +908,24 @@ function parseBigintDef(def, refs) {
908
908
  return res;
909
909
  }
910
910
 
911
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
911
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
912
912
  function parseBooleanDef() {
913
913
  return {
914
914
  type: "boolean"
915
915
  };
916
916
  }
917
917
 
918
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
918
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
919
919
  function parseBrandedDef(_def, refs) {
920
920
  return parseDef(_def.type._def, refs);
921
921
  }
922
922
 
923
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
923
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
924
924
  var parseCatchDef = (def, refs) => {
925
925
  return parseDef(def.innerType._def, refs);
926
926
  };
927
927
 
928
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/date.js
928
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/date.js
929
929
  function parseDateDef(def, refs, overrideDateStrategy) {
930
930
  const strategy = overrideDateStrategy ?? refs.dateStrategy;
931
931
  if (Array.isArray(strategy)) {
@@ -984,7 +984,7 @@ var integerDateParser = (def, refs) => {
984
984
  return res;
985
985
  };
986
986
 
987
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/default.js
987
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/default.js
988
988
  function parseDefaultDef(_def, refs) {
989
989
  return {
990
990
  ...parseDef(_def.innerType._def, refs),
@@ -992,12 +992,12 @@ function parseDefaultDef(_def, refs) {
992
992
  };
993
993
  }
994
994
 
995
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
995
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
996
996
  function parseEffectsDef(_def, refs) {
997
997
  return refs.effectStrategy === "input" ? parseDef(_def.schema._def, refs) : {};
998
998
  }
999
999
 
1000
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
1000
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
1001
1001
  function parseEnumDef(def) {
1002
1002
  return {
1003
1003
  type: "string",
@@ -1005,7 +1005,7 @@ function parseEnumDef(def) {
1005
1005
  };
1006
1006
  }
1007
1007
 
1008
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
1008
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
1009
1009
  var isJsonSchema7AllOfType = (type) => {
1010
1010
  if ("type" in type && type.type === "string")
1011
1011
  return false;
@@ -1047,7 +1047,7 @@ function parseIntersectionDef(def, refs) {
1047
1047
  } : void 0;
1048
1048
  }
1049
1049
 
1050
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
1050
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
1051
1051
  function parseLiteralDef(def, refs) {
1052
1052
  const parsedType = typeof def.value;
1053
1053
  if (parsedType !== "bigint" && parsedType !== "number" && parsedType !== "boolean" && parsedType !== "string") {
@@ -1067,7 +1067,7 @@ function parseLiteralDef(def, refs) {
1067
1067
  };
1068
1068
  }
1069
1069
 
1070
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
1070
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
1071
1071
  var emojiRegex = void 0;
1072
1072
  var zodPatterns = {
1073
1073
  /**
@@ -1379,7 +1379,7 @@ function stringifyRegExpWithFlags(regex, refs) {
1379
1379
  return pattern;
1380
1380
  }
1381
1381
 
1382
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
1382
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
1383
1383
  function parseRecordDef(def, refs) {
1384
1384
  if (refs.target === "openAi") {
1385
1385
  console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
@@ -1431,7 +1431,7 @@ function parseRecordDef(def, refs) {
1431
1431
  return schema;
1432
1432
  }
1433
1433
 
1434
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/map.js
1434
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/map.js
1435
1435
  function parseMapDef(def, refs) {
1436
1436
  if (refs.mapStrategy === "record") {
1437
1437
  return parseRecordDef(def, refs);
@@ -1456,7 +1456,7 @@ function parseMapDef(def, refs) {
1456
1456
  };
1457
1457
  }
1458
1458
 
1459
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
1459
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
1460
1460
  function parseNativeEnumDef(def) {
1461
1461
  const object = def.values;
1462
1462
  const actualKeys = Object.keys(def.values).filter((key) => {
@@ -1470,14 +1470,14 @@ function parseNativeEnumDef(def) {
1470
1470
  };
1471
1471
  }
1472
1472
 
1473
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/never.js
1473
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/never.js
1474
1474
  function parseNeverDef() {
1475
1475
  return {
1476
1476
  not: {}
1477
1477
  };
1478
1478
  }
1479
1479
 
1480
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/null.js
1480
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/null.js
1481
1481
  function parseNullDef(refs) {
1482
1482
  return refs.target === "openApi3" ? {
1483
1483
  enum: ["null"],
@@ -1487,7 +1487,7 @@ function parseNullDef(refs) {
1487
1487
  };
1488
1488
  }
1489
1489
 
1490
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/union.js
1490
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/union.js
1491
1491
  var primitiveMappings = {
1492
1492
  ZodString: "string",
1493
1493
  ZodNumber: "number",
@@ -1555,7 +1555,7 @@ var asAnyOf = (def, refs) => {
1555
1555
  return anyOf.length ? { anyOf } : void 0;
1556
1556
  };
1557
1557
 
1558
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
1558
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
1559
1559
  function parseNullableDef(def, refs) {
1560
1560
  if (["ZodString", "ZodNumber", "ZodBigInt", "ZodBoolean", "ZodNull"].includes(def.innerType._def.typeName) && (!def.innerType._def.checks || !def.innerType._def.checks.length)) {
1561
1561
  if (refs.target === "openApi3") {
@@ -1587,7 +1587,7 @@ function parseNullableDef(def, refs) {
1587
1587
  return base && { anyOf: [base, { type: "null" }] };
1588
1588
  }
1589
1589
 
1590
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/number.js
1590
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/number.js
1591
1591
  function parseNumberDef(def, refs) {
1592
1592
  const res = {
1593
1593
  type: "number"
@@ -1704,7 +1704,7 @@ function safeIsOptional(schema) {
1704
1704
  }
1705
1705
  }
1706
1706
 
1707
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
1707
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
1708
1708
  var parseOptionalDef = (def, refs) => {
1709
1709
  if (refs.currentPath.toString() === refs.propertyPath?.toString()) {
1710
1710
  return parseDef(def.innerType._def, refs);
@@ -1723,7 +1723,7 @@ var parseOptionalDef = (def, refs) => {
1723
1723
  } : {};
1724
1724
  };
1725
1725
 
1726
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js
1726
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js
1727
1727
  var parsePipelineDef = (def, refs) => {
1728
1728
  if (refs.pipeStrategy === "input") {
1729
1729
  return parseDef(def.in._def, refs);
@@ -1743,12 +1743,12 @@ var parsePipelineDef = (def, refs) => {
1743
1743
  };
1744
1744
  };
1745
1745
 
1746
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
1746
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
1747
1747
  function parsePromiseDef(def, refs) {
1748
1748
  return parseDef(def.type._def, refs);
1749
1749
  }
1750
1750
 
1751
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/set.js
1751
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/set.js
1752
1752
  function parseSetDef(def, refs) {
1753
1753
  const items = parseDef(def.valueType._def, {
1754
1754
  ...refs,
@@ -1768,7 +1768,7 @@ function parseSetDef(def, refs) {
1768
1768
  return schema;
1769
1769
  }
1770
1770
 
1771
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
1771
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
1772
1772
  function parseTupleDef(def, refs) {
1773
1773
  if (def.rest) {
1774
1774
  return {
@@ -1796,24 +1796,24 @@ function parseTupleDef(def, refs) {
1796
1796
  }
1797
1797
  }
1798
1798
 
1799
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
1799
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
1800
1800
  function parseUndefinedDef() {
1801
1801
  return {
1802
1802
  not: {}
1803
1803
  };
1804
1804
  }
1805
1805
 
1806
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
1806
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
1807
1807
  function parseUnknownDef() {
1808
1808
  return {};
1809
1809
  }
1810
1810
 
1811
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
1811
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
1812
1812
  var parseReadonlyDef = (def, refs) => {
1813
1813
  return parseDef(def.innerType._def, refs);
1814
1814
  };
1815
1815
 
1816
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/selectParser.js
1816
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/selectParser.js
1817
1817
  var selectParser = (def, typeName, refs) => {
1818
1818
  switch (typeName) {
1819
1819
  case zod.ZodFirstPartyTypeKind.ZodString:
@@ -1889,7 +1889,7 @@ var selectParser = (def, typeName, refs) => {
1889
1889
  }
1890
1890
  };
1891
1891
 
1892
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/parseDef.js
1892
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parseDef.js
1893
1893
  function parseDef(def, refs, forceResolution = false) {
1894
1894
  const seenItem = refs.seen.get(def);
1895
1895
  if (refs.override) {
@@ -1953,7 +1953,7 @@ var addMeta = (def, refs, jsonSchema) => {
1953
1953
  return jsonSchema;
1954
1954
  };
1955
1955
 
1956
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
1956
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
1957
1957
  var zodToJsonSchema = (schema, options) => {
1958
1958
  const refs = getRefs(options);
1959
1959
  const definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce((acc, [name2, schema2]) => ({
@@ -1997,7 +1997,7 @@ var zodToJsonSchema = (schema, options) => {
1997
1997
  return combined;
1998
1998
  };
1999
1999
 
2000
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.56/node_modules/zod-to-json-schema/dist/esm/index.js
2000
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/index.js
2001
2001
  var esm_default = zodToJsonSchema;
2002
2002
 
2003
2003
  exports.esm_default = esm_default;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkXUGQSVZ4_cjs = require('./chunk-XUGQSVZ4.cjs');
3
+ var chunkASKESBJW_cjs = require('./chunk-ASKESBJW.cjs');
4
4
  var chunk64U3UDTH_cjs = require('./chunk-64U3UDTH.cjs');
5
5
  var chunkOCWPVYNI_cjs = require('./chunk-OCWPVYNI.cjs');
6
6
  var chunk75ZPJI57_cjs = require('./chunk-75ZPJI57.cjs');
@@ -32,16 +32,16 @@ async function getWorkflowsHandler({ mastra }) {
32
32
  acc2[key2] = {
33
33
  id: step.id,
34
34
  description: step.description,
35
- inputSchema: step.inputSchema ? chunkXUGQSVZ4_cjs.stringify(chunkXUGQSVZ4_cjs.esm_default(step.inputSchema)) : void 0,
36
- outputSchema: step.outputSchema ? chunkXUGQSVZ4_cjs.stringify(chunkXUGQSVZ4_cjs.esm_default(step.outputSchema)) : void 0,
37
- resumeSchema: step.resumeSchema ? chunkXUGQSVZ4_cjs.stringify(chunkXUGQSVZ4_cjs.esm_default(step.resumeSchema)) : void 0,
38
- suspendSchema: step.suspendSchema ? chunkXUGQSVZ4_cjs.stringify(chunkXUGQSVZ4_cjs.esm_default(step.suspendSchema)) : void 0
35
+ inputSchema: step.inputSchema ? chunkASKESBJW_cjs.stringify(chunkASKESBJW_cjs.esm_default(step.inputSchema)) : void 0,
36
+ outputSchema: step.outputSchema ? chunkASKESBJW_cjs.stringify(chunkASKESBJW_cjs.esm_default(step.outputSchema)) : void 0,
37
+ resumeSchema: step.resumeSchema ? chunkASKESBJW_cjs.stringify(chunkASKESBJW_cjs.esm_default(step.resumeSchema)) : void 0,
38
+ suspendSchema: step.suspendSchema ? chunkASKESBJW_cjs.stringify(chunkASKESBJW_cjs.esm_default(step.suspendSchema)) : void 0
39
39
  };
40
40
  return acc2;
41
41
  }, {}),
42
42
  stepGraph: workflow.serializedStepGraph,
43
- inputSchema: workflow.inputSchema ? chunkXUGQSVZ4_cjs.stringify(chunkXUGQSVZ4_cjs.esm_default(workflow.inputSchema)) : void 0,
44
- outputSchema: workflow.outputSchema ? chunkXUGQSVZ4_cjs.stringify(chunkXUGQSVZ4_cjs.esm_default(workflow.outputSchema)) : void 0
43
+ inputSchema: workflow.inputSchema ? chunkASKESBJW_cjs.stringify(chunkASKESBJW_cjs.esm_default(workflow.inputSchema)) : void 0,
44
+ outputSchema: workflow.outputSchema ? chunkASKESBJW_cjs.stringify(chunkASKESBJW_cjs.esm_default(workflow.outputSchema)) : void 0
45
45
  };
46
46
  return acc;
47
47
  }, {});
@@ -50,12 +50,46 @@ async function getWorkflowsHandler({ mastra }) {
50
50
  throw new chunkOCWPVYNI_cjs.HTTPException(500, { message: error?.message || "Error getting workflows" });
51
51
  }
52
52
  }
53
+ async function getWorkflowsFromSystem({ mastra, workflowId }) {
54
+ const logger = mastra.getLogger();
55
+ if (!workflowId) {
56
+ throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
57
+ }
58
+ let workflow;
59
+ try {
60
+ workflow = mastra.getWorkflow(workflowId);
61
+ } catch (error) {
62
+ logger.debug("Error getting workflow, searching agents for workflow", error);
63
+ }
64
+ if (!workflow) {
65
+ logger.debug("Workflow not found, searching agents for workflow", { workflowId });
66
+ const agents = mastra.getAgents();
67
+ if (Object.keys(agents || {}).length) {
68
+ for (const [_, agent] of Object.entries(agents)) {
69
+ try {
70
+ const workflows = await agent.getWorkflows();
71
+ if (workflows[workflowId]) {
72
+ workflow = workflows[workflowId];
73
+ break;
74
+ }
75
+ break;
76
+ } catch (error) {
77
+ logger.debug("Error getting workflow from agent", error);
78
+ }
79
+ }
80
+ }
81
+ }
82
+ if (!workflow) {
83
+ throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow not found" });
84
+ }
85
+ return { workflow };
86
+ }
53
87
  async function getWorkflowByIdHandler({ mastra, workflowId }) {
54
88
  try {
55
89
  if (!workflowId) {
56
90
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
57
91
  }
58
- const workflow = mastra.getWorkflow(workflowId);
92
+ const { workflow } = await getWorkflowsFromSystem({ mastra, workflowId });
59
93
  if (!workflow) {
60
94
  throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow not found" });
61
95
  }
@@ -64,18 +98,18 @@ async function getWorkflowByIdHandler({ mastra, workflowId }) {
64
98
  acc[key] = {
65
99
  id: step.id,
66
100
  description: step.description,
67
- inputSchema: step.inputSchema ? chunkXUGQSVZ4_cjs.stringify(chunkXUGQSVZ4_cjs.esm_default(step.inputSchema)) : void 0,
68
- outputSchema: step.outputSchema ? chunkXUGQSVZ4_cjs.stringify(chunkXUGQSVZ4_cjs.esm_default(step.outputSchema)) : void 0,
69
- resumeSchema: step.resumeSchema ? chunkXUGQSVZ4_cjs.stringify(chunkXUGQSVZ4_cjs.esm_default(step.resumeSchema)) : void 0,
70
- suspendSchema: step.suspendSchema ? chunkXUGQSVZ4_cjs.stringify(chunkXUGQSVZ4_cjs.esm_default(step.suspendSchema)) : void 0
101
+ inputSchema: step.inputSchema ? chunkASKESBJW_cjs.stringify(chunkASKESBJW_cjs.esm_default(step.inputSchema)) : void 0,
102
+ outputSchema: step.outputSchema ? chunkASKESBJW_cjs.stringify(chunkASKESBJW_cjs.esm_default(step.outputSchema)) : void 0,
103
+ resumeSchema: step.resumeSchema ? chunkASKESBJW_cjs.stringify(chunkASKESBJW_cjs.esm_default(step.resumeSchema)) : void 0,
104
+ suspendSchema: step.suspendSchema ? chunkASKESBJW_cjs.stringify(chunkASKESBJW_cjs.esm_default(step.suspendSchema)) : void 0
71
105
  };
72
106
  return acc;
73
107
  }, {}),
74
108
  name: workflow.name,
75
109
  description: workflow.description,
76
110
  stepGraph: workflow.serializedStepGraph,
77
- inputSchema: workflow.inputSchema ? chunkXUGQSVZ4_cjs.stringify(chunkXUGQSVZ4_cjs.esm_default(workflow.inputSchema)) : void 0,
78
- outputSchema: workflow.outputSchema ? chunkXUGQSVZ4_cjs.stringify(chunkXUGQSVZ4_cjs.esm_default(workflow.outputSchema)) : void 0
111
+ inputSchema: workflow.inputSchema ? chunkASKESBJW_cjs.stringify(chunkASKESBJW_cjs.esm_default(workflow.inputSchema)) : void 0,
112
+ outputSchema: workflow.outputSchema ? chunkASKESBJW_cjs.stringify(chunkASKESBJW_cjs.esm_default(workflow.outputSchema)) : void 0
79
113
  };
80
114
  } catch (error) {
81
115
  throw new chunkOCWPVYNI_cjs.HTTPException(500, { message: error?.message || "Error getting workflow" });
@@ -93,7 +127,7 @@ async function getWorkflowRunByIdHandler({
93
127
  if (!runId) {
94
128
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Run ID is required" });
95
129
  }
96
- const workflow = mastra.getWorkflow(workflowId);
130
+ const { workflow } = await getWorkflowsFromSystem({ mastra, workflowId });
97
131
  if (!workflow) {
98
132
  throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow not found" });
99
133
  }
@@ -115,7 +149,7 @@ async function createWorkflowRunHandler({
115
149
  if (!workflowId) {
116
150
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
117
151
  }
118
- const workflow = mastra.getWorkflow(workflowId);
152
+ const { workflow } = await getWorkflowsFromSystem({ mastra, workflowId });
119
153
  if (!workflow) {
120
154
  throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow not found" });
121
155
  }
@@ -136,7 +170,7 @@ async function startAsyncWorkflowHandler({
136
170
  if (!workflowId) {
137
171
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
138
172
  }
139
- const workflow = mastra.getWorkflow(workflowId);
173
+ const { workflow } = await getWorkflowsFromSystem({ mastra, workflowId });
140
174
  if (!workflow) {
141
175
  throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow not found" });
142
176
  }
@@ -164,7 +198,10 @@ async function startWorkflowRunHandler({
164
198
  if (!runId) {
165
199
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "runId required to start run" });
166
200
  }
167
- const workflow = mastra.getWorkflow(workflowId);
201
+ const { workflow } = await getWorkflowsFromSystem({ mastra, workflowId });
202
+ if (!workflow) {
203
+ throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow not found" });
204
+ }
168
205
  const run = await workflow.getWorkflowRunById(runId);
169
206
  if (!run) {
170
207
  throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow run not found" });
@@ -191,7 +228,10 @@ async function watchWorkflowHandler({
191
228
  if (!runId) {
192
229
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "runId required to watch workflow" });
193
230
  }
194
- const workflow = mastra.getWorkflow(workflowId);
231
+ const { workflow } = await getWorkflowsFromSystem({ mastra, workflowId });
232
+ if (!workflow) {
233
+ throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow not found" });
234
+ }
195
235
  const run = await workflow.getWorkflowRunById(runId);
196
236
  if (!run) {
197
237
  throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow run not found" });
@@ -225,7 +265,7 @@ async function watchWorkflowHandler({
225
265
  return chunk64U3UDTH_cjs.handleError(error, "Error watching workflow");
226
266
  }
227
267
  }
228
- function streamWorkflowHandler({
268
+ async function streamWorkflowHandler({
229
269
  mastra,
230
270
  runtimeContext,
231
271
  workflowId,
@@ -239,7 +279,7 @@ function streamWorkflowHandler({
239
279
  if (!runId) {
240
280
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "runId required to resume workflow" });
241
281
  }
242
- const workflow = mastra.getWorkflow(workflowId);
282
+ const { workflow } = await getWorkflowsFromSystem({ mastra, workflowId });
243
283
  if (!workflow) {
244
284
  throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow not found" });
245
285
  }
@@ -270,7 +310,10 @@ async function resumeAsyncWorkflowHandler({
270
310
  if (!body.step) {
271
311
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "step required to resume workflow" });
272
312
  }
273
- const workflow = mastra.getWorkflow(workflowId);
313
+ const { workflow } = await getWorkflowsFromSystem({ mastra, workflowId });
314
+ if (!workflow) {
315
+ throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow not found" });
316
+ }
274
317
  const run = await workflow.getWorkflowRunById(runId);
275
318
  if (!run) {
276
319
  throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow run not found" });
@@ -303,7 +346,10 @@ async function resumeWorkflowHandler({
303
346
  if (!body.step) {
304
347
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "step required to resume workflow" });
305
348
  }
306
- const workflow = mastra.getWorkflow(workflowId);
349
+ const { workflow } = await getWorkflowsFromSystem({ mastra, workflowId });
350
+ if (!workflow) {
351
+ throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow not found" });
352
+ }
307
353
  const run = await workflow.getWorkflowRunById(runId);
308
354
  if (!run) {
309
355
  throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow run not found" });
@@ -332,7 +378,10 @@ async function getWorkflowRunsHandler({
332
378
  if (!workflowId) {
333
379
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Workflow ID is required" });
334
380
  }
335
- const workflow = mastra.getWorkflow(workflowId);
381
+ const { workflow } = await getWorkflowsFromSystem({ mastra, workflowId });
382
+ if (!workflow) {
383
+ throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Workflow not found" });
384
+ }
336
385
  const workflowRuns = await workflow.getWorkflowRuns({ fromDate, toDate, limit, offset, resourceId }) || {
337
386
  runs: [],
338
387
  total: 0
@@ -1,4 +1,4 @@
1
- import { stringify, esm_default } from './chunk-WKWHYFX4.js';
1
+ import { stringify, esm_default } from './chunk-TGJMNUYJ.js';
2
2
  import { handleError } from './chunk-M5ABIP7D.js';
3
3
  import { HTTPException } from './chunk-NYN7KFXL.js';
4
4
  import { __export } from './chunk-MLKGABMK.js';