@mastra/server 0.10.7-alpha.0 → 0.10.7-alpha.2

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 (31) hide show
  1. package/dist/_tsup-dts-rollup.d.cts +147 -19
  2. package/dist/_tsup-dts-rollup.d.ts +147 -19
  3. package/dist/{chunk-WE32JG64.cjs → chunk-4DTDPTQC.cjs} +7 -7
  4. package/dist/{chunk-GPRXMWEQ.js → chunk-5UV7XQ4G.js} +1 -1
  5. package/dist/{chunk-NGURCFEJ.cjs → chunk-CPPYMJX5.cjs} +5 -5
  6. package/dist/{chunk-FYCCJXBC.cjs → chunk-E5IRS3XH.cjs} +5 -5
  7. package/dist/{chunk-JKTNRUKY.js → chunk-GKLL733B.js} +6 -42
  8. package/dist/{chunk-ASKESBJW.cjs → chunk-MN6F4D5A.cjs} +35 -35
  9. package/dist/{chunk-CLYX4KLH.js → chunk-N2YBMSO2.js} +1 -1
  10. package/dist/{chunk-TGJMNUYJ.js → chunk-OSZM4EAY.js} +35 -35
  11. package/dist/{chunk-6TJSHFCJ.cjs → chunk-RQ2Z56EC.cjs} +50 -20
  12. package/dist/{chunk-2HXKRRNS.js → chunk-XR7VJOOP.js} +1 -1
  13. package/dist/{chunk-I7KJZNX5.js → chunk-XUIJ7WRT.js} +50 -20
  14. package/dist/{chunk-FRXZL32L.cjs → chunk-ZYCTFFDB.cjs} +18 -54
  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 +11 -11
  18. package/dist/server/handlers/legacyWorkflows.js +1 -1
  19. package/dist/server/handlers/memory.cjs +9 -9
  20. package/dist/server/handlers/memory.js +1 -1
  21. package/dist/server/handlers/tools.cjs +5 -5
  22. package/dist/server/handlers/tools.js +1 -1
  23. package/dist/server/handlers/vNextNetwork.cjs +175 -0
  24. package/dist/server/handlers/vNextNetwork.d.cts +5 -0
  25. package/dist/server/handlers/vNextNetwork.d.ts +5 -0
  26. package/dist/server/handlers/vNextNetwork.js +169 -0
  27. package/dist/server/handlers/workflows.cjs +13 -13
  28. package/dist/server/handlers/workflows.js +1 -1
  29. package/dist/server/handlers.cjs +10 -10
  30. package/dist/server/handlers.js +5 -5
  31. package/package.json +4 -4
@@ -764,7 +764,7 @@ SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJS
764
764
  SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);
765
765
  var stringify = SuperJSON.stringify;
766
766
 
767
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/Options.js
767
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/Options.js
768
768
  var ignoreOverride = Symbol("Let zodToJsonSchema decide on which parser to use");
769
769
  var defaultOptions = {
770
770
  name: void 0,
@@ -797,7 +797,7 @@ var getDefaultOptions = (options) => typeof options === "string" ? {
797
797
  ...options
798
798
  };
799
799
 
800
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/Refs.js
800
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/Refs.js
801
801
  var getRefs = (options) => {
802
802
  const _options = getDefaultOptions(options);
803
803
  const currentPath = _options.name !== void 0 ? [..._options.basePath, _options.definitionPath, _options.name] : _options.basePath;
@@ -817,7 +817,7 @@ var getRefs = (options) => {
817
817
  };
818
818
  };
819
819
 
820
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/errorMessages.js
820
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/errorMessages.js
821
821
  function addErrorMessage(res, key, errorMessage, refs) {
822
822
  if (!refs?.errorMessages)
823
823
  return;
@@ -833,7 +833,7 @@ function setResponseValueAndErrors(res, key, value, errorMessage, refs) {
833
833
  addErrorMessage(res, key, errorMessage, refs);
834
834
  }
835
835
 
836
- // ../../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
836
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/any.js
837
837
  function parseAnyDef() {
838
838
  return {};
839
839
  }
@@ -860,7 +860,7 @@ function parseArrayDef(def, refs) {
860
860
  return res;
861
861
  }
862
862
 
863
- // ../../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
863
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
864
864
  function parseBigintDef(def, refs) {
865
865
  const res = {
866
866
  type: "integer",
@@ -906,24 +906,24 @@ function parseBigintDef(def, refs) {
906
906
  return res;
907
907
  }
908
908
 
909
- // ../../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
909
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
910
910
  function parseBooleanDef() {
911
911
  return {
912
912
  type: "boolean"
913
913
  };
914
914
  }
915
915
 
916
- // ../../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
916
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
917
917
  function parseBrandedDef(_def, refs) {
918
918
  return parseDef(_def.type._def, refs);
919
919
  }
920
920
 
921
- // ../../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
921
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
922
922
  var parseCatchDef = (def, refs) => {
923
923
  return parseDef(def.innerType._def, refs);
924
924
  };
925
925
 
926
- // ../../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
926
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/date.js
927
927
  function parseDateDef(def, refs, overrideDateStrategy) {
928
928
  const strategy = overrideDateStrategy ?? refs.dateStrategy;
929
929
  if (Array.isArray(strategy)) {
@@ -982,7 +982,7 @@ var integerDateParser = (def, refs) => {
982
982
  return res;
983
983
  };
984
984
 
985
- // ../../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
985
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/default.js
986
986
  function parseDefaultDef(_def, refs) {
987
987
  return {
988
988
  ...parseDef(_def.innerType._def, refs),
@@ -990,12 +990,12 @@ function parseDefaultDef(_def, refs) {
990
990
  };
991
991
  }
992
992
 
993
- // ../../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
993
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
994
994
  function parseEffectsDef(_def, refs) {
995
995
  return refs.effectStrategy === "input" ? parseDef(_def.schema._def, refs) : {};
996
996
  }
997
997
 
998
- // ../../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
998
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
999
999
  function parseEnumDef(def) {
1000
1000
  return {
1001
1001
  type: "string",
@@ -1003,7 +1003,7 @@ function parseEnumDef(def) {
1003
1003
  };
1004
1004
  }
1005
1005
 
1006
- // ../../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
1006
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
1007
1007
  var isJsonSchema7AllOfType = (type) => {
1008
1008
  if ("type" in type && type.type === "string")
1009
1009
  return false;
@@ -1045,7 +1045,7 @@ function parseIntersectionDef(def, refs) {
1045
1045
  } : void 0;
1046
1046
  }
1047
1047
 
1048
- // ../../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
1048
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
1049
1049
  function parseLiteralDef(def, refs) {
1050
1050
  const parsedType = typeof def.value;
1051
1051
  if (parsedType !== "bigint" && parsedType !== "number" && parsedType !== "boolean" && parsedType !== "string") {
@@ -1065,7 +1065,7 @@ function parseLiteralDef(def, refs) {
1065
1065
  };
1066
1066
  }
1067
1067
 
1068
- // ../../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
1068
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
1069
1069
  var emojiRegex = void 0;
1070
1070
  var zodPatterns = {
1071
1071
  /**
@@ -1377,7 +1377,7 @@ function stringifyRegExpWithFlags(regex, refs) {
1377
1377
  return pattern;
1378
1378
  }
1379
1379
 
1380
- // ../../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
1380
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
1381
1381
  function parseRecordDef(def, refs) {
1382
1382
  if (refs.target === "openAi") {
1383
1383
  console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
@@ -1429,7 +1429,7 @@ function parseRecordDef(def, refs) {
1429
1429
  return schema;
1430
1430
  }
1431
1431
 
1432
- // ../../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
1432
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/map.js
1433
1433
  function parseMapDef(def, refs) {
1434
1434
  if (refs.mapStrategy === "record") {
1435
1435
  return parseRecordDef(def, refs);
@@ -1454,7 +1454,7 @@ function parseMapDef(def, refs) {
1454
1454
  };
1455
1455
  }
1456
1456
 
1457
- // ../../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
1457
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
1458
1458
  function parseNativeEnumDef(def) {
1459
1459
  const object = def.values;
1460
1460
  const actualKeys = Object.keys(def.values).filter((key) => {
@@ -1468,14 +1468,14 @@ function parseNativeEnumDef(def) {
1468
1468
  };
1469
1469
  }
1470
1470
 
1471
- // ../../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
1471
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/never.js
1472
1472
  function parseNeverDef() {
1473
1473
  return {
1474
1474
  not: {}
1475
1475
  };
1476
1476
  }
1477
1477
 
1478
- // ../../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
1478
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/null.js
1479
1479
  function parseNullDef(refs) {
1480
1480
  return refs.target === "openApi3" ? {
1481
1481
  enum: ["null"],
@@ -1485,7 +1485,7 @@ function parseNullDef(refs) {
1485
1485
  };
1486
1486
  }
1487
1487
 
1488
- // ../../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
1488
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/union.js
1489
1489
  var primitiveMappings = {
1490
1490
  ZodString: "string",
1491
1491
  ZodNumber: "number",
@@ -1553,7 +1553,7 @@ var asAnyOf = (def, refs) => {
1553
1553
  return anyOf.length ? { anyOf } : void 0;
1554
1554
  };
1555
1555
 
1556
- // ../../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
1556
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
1557
1557
  function parseNullableDef(def, refs) {
1558
1558
  if (["ZodString", "ZodNumber", "ZodBigInt", "ZodBoolean", "ZodNull"].includes(def.innerType._def.typeName) && (!def.innerType._def.checks || !def.innerType._def.checks.length)) {
1559
1559
  if (refs.target === "openApi3") {
@@ -1585,7 +1585,7 @@ function parseNullableDef(def, refs) {
1585
1585
  return base && { anyOf: [base, { type: "null" }] };
1586
1586
  }
1587
1587
 
1588
- // ../../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
1588
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/number.js
1589
1589
  function parseNumberDef(def, refs) {
1590
1590
  const res = {
1591
1591
  type: "number"
@@ -1702,7 +1702,7 @@ function safeIsOptional(schema) {
1702
1702
  }
1703
1703
  }
1704
1704
 
1705
- // ../../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
1705
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
1706
1706
  var parseOptionalDef = (def, refs) => {
1707
1707
  if (refs.currentPath.toString() === refs.propertyPath?.toString()) {
1708
1708
  return parseDef(def.innerType._def, refs);
@@ -1721,7 +1721,7 @@ var parseOptionalDef = (def, refs) => {
1721
1721
  } : {};
1722
1722
  };
1723
1723
 
1724
- // ../../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
1724
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js
1725
1725
  var parsePipelineDef = (def, refs) => {
1726
1726
  if (refs.pipeStrategy === "input") {
1727
1727
  return parseDef(def.in._def, refs);
@@ -1741,12 +1741,12 @@ var parsePipelineDef = (def, refs) => {
1741
1741
  };
1742
1742
  };
1743
1743
 
1744
- // ../../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
1744
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
1745
1745
  function parsePromiseDef(def, refs) {
1746
1746
  return parseDef(def.type._def, refs);
1747
1747
  }
1748
1748
 
1749
- // ../../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
1749
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/set.js
1750
1750
  function parseSetDef(def, refs) {
1751
1751
  const items = parseDef(def.valueType._def, {
1752
1752
  ...refs,
@@ -1766,7 +1766,7 @@ function parseSetDef(def, refs) {
1766
1766
  return schema;
1767
1767
  }
1768
1768
 
1769
- // ../../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
1769
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
1770
1770
  function parseTupleDef(def, refs) {
1771
1771
  if (def.rest) {
1772
1772
  return {
@@ -1794,24 +1794,24 @@ function parseTupleDef(def, refs) {
1794
1794
  }
1795
1795
  }
1796
1796
 
1797
- // ../../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
1797
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
1798
1798
  function parseUndefinedDef() {
1799
1799
  return {
1800
1800
  not: {}
1801
1801
  };
1802
1802
  }
1803
1803
 
1804
- // ../../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
1804
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
1805
1805
  function parseUnknownDef() {
1806
1806
  return {};
1807
1807
  }
1808
1808
 
1809
- // ../../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
1809
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
1810
1810
  var parseReadonlyDef = (def, refs) => {
1811
1811
  return parseDef(def.innerType._def, refs);
1812
1812
  };
1813
1813
 
1814
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/selectParser.js
1814
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/selectParser.js
1815
1815
  var selectParser = (def, typeName, refs) => {
1816
1816
  switch (typeName) {
1817
1817
  case ZodFirstPartyTypeKind.ZodString:
@@ -1887,7 +1887,7 @@ var selectParser = (def, typeName, refs) => {
1887
1887
  }
1888
1888
  };
1889
1889
 
1890
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/parseDef.js
1890
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/parseDef.js
1891
1891
  function parseDef(def, refs, forceResolution = false) {
1892
1892
  const seenItem = refs.seen.get(def);
1893
1893
  if (refs.override) {
@@ -1951,7 +1951,7 @@ var addMeta = (def, refs, jsonSchema) => {
1951
1951
  return jsonSchema;
1952
1952
  };
1953
1953
 
1954
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
1954
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
1955
1955
  var zodToJsonSchema = (schema, options) => {
1956
1956
  const refs = getRefs(options);
1957
1957
  const definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce((acc, [name2, schema2]) => ({
@@ -1995,7 +1995,7 @@ var zodToJsonSchema = (schema, options) => {
1995
1995
  return combined;
1996
1996
  };
1997
1997
 
1998
- // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.57/node_modules/zod-to-json-schema/dist/esm/index.js
1998
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.67/node_modules/zod-to-json-schema/dist/esm/index.js
1999
1999
  var esm_default = zodToJsonSchema;
2000
2000
 
2001
2001
  export { esm_default, stringify };
@@ -17,20 +17,36 @@ chunk75ZPJI57_cjs.__export(memory_exports, {
17
17
  saveMessagesHandler: () => saveMessagesHandler,
18
18
  updateThreadHandler: () => updateThreadHandler
19
19
  });
20
- function getMemoryFromContext({
20
+ async function getMemoryFromContext({
21
21
  mastra,
22
- agentId
22
+ agentId,
23
+ networkId,
24
+ runtimeContext
23
25
  }) {
24
26
  const agent = agentId ? mastra.getAgent(agentId) : null;
25
27
  if (agentId && !agent) {
26
28
  throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Agent not found" });
27
29
  }
28
- const memory = agent?.getMemory?.() || mastra.getMemory();
29
- return memory;
30
+ const network = networkId ? mastra.vnext_getNetwork(networkId) : null;
31
+ if (networkId && !network) {
32
+ throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Network not found" });
33
+ }
34
+ if (agent) {
35
+ return agent?.getMemory() || mastra.getMemory();
36
+ }
37
+ if (network) {
38
+ return await network?.getMemory({ runtimeContext }) || mastra.getMemory();
39
+ }
40
+ return mastra.getMemory();
30
41
  }
31
- async function getMemoryStatusHandler({ mastra, agentId }) {
42
+ async function getMemoryStatusHandler({
43
+ mastra,
44
+ agentId,
45
+ networkId,
46
+ runtimeContext
47
+ }) {
32
48
  try {
33
- const memory = getMemoryFromContext({ mastra, agentId });
49
+ const memory = await getMemoryFromContext({ mastra, agentId, networkId, runtimeContext });
34
50
  if (!memory) {
35
51
  return { result: false };
36
52
  }
@@ -42,10 +58,12 @@ async function getMemoryStatusHandler({ mastra, agentId }) {
42
58
  async function getThreadsHandler({
43
59
  mastra,
44
60
  agentId,
45
- resourceId
61
+ resourceId,
62
+ networkId,
63
+ runtimeContext
46
64
  }) {
47
65
  try {
48
- const memory = getMemoryFromContext({ mastra, agentId });
66
+ const memory = await getMemoryFromContext({ mastra, agentId, networkId, runtimeContext });
49
67
  if (!memory) {
50
68
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Memory is not initialized" });
51
69
  }
@@ -59,11 +77,13 @@ async function getThreadsHandler({
59
77
  async function getThreadByIdHandler({
60
78
  mastra,
61
79
  agentId,
62
- threadId
80
+ threadId,
81
+ networkId,
82
+ runtimeContext
63
83
  }) {
64
84
  try {
65
85
  chunk57CJTIPW_cjs.validateBody({ threadId });
66
- const memory = getMemoryFromContext({ mastra, agentId });
86
+ const memory = await getMemoryFromContext({ mastra, agentId, networkId, runtimeContext });
67
87
  if (!memory) {
68
88
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Memory is not initialized" });
69
89
  }
@@ -79,10 +99,12 @@ async function getThreadByIdHandler({
79
99
  async function saveMessagesHandler({
80
100
  mastra,
81
101
  agentId,
82
- body
102
+ body,
103
+ networkId,
104
+ runtimeContext
83
105
  }) {
84
106
  try {
85
- const memory = getMemoryFromContext({ mastra, agentId });
107
+ const memory = await getMemoryFromContext({ mastra, agentId, networkId, runtimeContext });
86
108
  if (!memory) {
87
109
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Memory is not initialized" });
88
110
  }
@@ -106,10 +128,12 @@ async function saveMessagesHandler({
106
128
  async function createThreadHandler({
107
129
  mastra,
108
130
  agentId,
109
- body
131
+ body,
132
+ networkId,
133
+ runtimeContext
110
134
  }) {
111
135
  try {
112
- const memory = getMemoryFromContext({ mastra, agentId });
136
+ const memory = await getMemoryFromContext({ mastra, agentId, networkId, runtimeContext });
113
137
  if (!memory) {
114
138
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Memory is not initialized" });
115
139
  }
@@ -129,10 +153,12 @@ async function updateThreadHandler({
129
153
  mastra,
130
154
  agentId,
131
155
  threadId,
132
- body
156
+ body,
157
+ networkId,
158
+ runtimeContext
133
159
  }) {
134
160
  try {
135
- const memory = getMemoryFromContext({ mastra, agentId });
161
+ const memory = await getMemoryFromContext({ mastra, agentId, networkId, runtimeContext });
136
162
  if (!body) {
137
163
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Body is required" });
138
164
  }
@@ -163,11 +189,13 @@ async function updateThreadHandler({
163
189
  async function deleteThreadHandler({
164
190
  mastra,
165
191
  agentId,
166
- threadId
192
+ threadId,
193
+ networkId,
194
+ runtimeContext
167
195
  }) {
168
196
  try {
169
197
  chunk57CJTIPW_cjs.validateBody({ threadId });
170
- const memory = getMemoryFromContext({ mastra, agentId });
198
+ const memory = await getMemoryFromContext({ mastra, agentId, networkId, runtimeContext });
171
199
  if (!memory) {
172
200
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Memory is not initialized" });
173
201
  }
@@ -185,14 +213,16 @@ async function getMessagesHandler({
185
213
  mastra,
186
214
  agentId,
187
215
  threadId,
188
- limit
216
+ limit,
217
+ networkId,
218
+ runtimeContext
189
219
  }) {
190
220
  if (limit !== void 0 && (!Number.isInteger(limit) || limit <= 0)) {
191
221
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Invalid limit: must be a positive integer" });
192
222
  }
193
223
  try {
194
224
  chunk57CJTIPW_cjs.validateBody({ threadId });
195
- const memory = getMemoryFromContext({ mastra, agentId });
225
+ const memory = await getMemoryFromContext({ mastra, agentId, networkId, runtimeContext });
196
226
  if (!memory) {
197
227
  throw new chunkOCWPVYNI_cjs.HTTPException(400, { message: "Memory is not initialized" });
198
228
  }
@@ -1,4 +1,4 @@
1
- import { stringify, esm_default } from './chunk-TGJMNUYJ.js';
1
+ import { stringify, esm_default } from './chunk-OSZM4EAY.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';
@@ -15,20 +15,36 @@ __export(memory_exports, {
15
15
  saveMessagesHandler: () => saveMessagesHandler,
16
16
  updateThreadHandler: () => updateThreadHandler
17
17
  });
18
- function getMemoryFromContext({
18
+ async function getMemoryFromContext({
19
19
  mastra,
20
- agentId
20
+ agentId,
21
+ networkId,
22
+ runtimeContext
21
23
  }) {
22
24
  const agent = agentId ? mastra.getAgent(agentId) : null;
23
25
  if (agentId && !agent) {
24
26
  throw new HTTPException(404, { message: "Agent not found" });
25
27
  }
26
- const memory = agent?.getMemory?.() || mastra.getMemory();
27
- return memory;
28
+ const network = networkId ? mastra.vnext_getNetwork(networkId) : null;
29
+ if (networkId && !network) {
30
+ throw new HTTPException(404, { message: "Network not found" });
31
+ }
32
+ if (agent) {
33
+ return agent?.getMemory() || mastra.getMemory();
34
+ }
35
+ if (network) {
36
+ return await network?.getMemory({ runtimeContext }) || mastra.getMemory();
37
+ }
38
+ return mastra.getMemory();
28
39
  }
29
- async function getMemoryStatusHandler({ mastra, agentId }) {
40
+ async function getMemoryStatusHandler({
41
+ mastra,
42
+ agentId,
43
+ networkId,
44
+ runtimeContext
45
+ }) {
30
46
  try {
31
- const memory = getMemoryFromContext({ mastra, agentId });
47
+ const memory = await getMemoryFromContext({ mastra, agentId, networkId, runtimeContext });
32
48
  if (!memory) {
33
49
  return { result: false };
34
50
  }
@@ -40,10 +56,12 @@ async function getMemoryStatusHandler({ mastra, agentId }) {
40
56
  async function getThreadsHandler({
41
57
  mastra,
42
58
  agentId,
43
- resourceId
59
+ resourceId,
60
+ networkId,
61
+ runtimeContext
44
62
  }) {
45
63
  try {
46
- const memory = getMemoryFromContext({ mastra, agentId });
64
+ const memory = await getMemoryFromContext({ mastra, agentId, networkId, runtimeContext });
47
65
  if (!memory) {
48
66
  throw new HTTPException(400, { message: "Memory is not initialized" });
49
67
  }
@@ -57,11 +75,13 @@ async function getThreadsHandler({
57
75
  async function getThreadByIdHandler({
58
76
  mastra,
59
77
  agentId,
60
- threadId
78
+ threadId,
79
+ networkId,
80
+ runtimeContext
61
81
  }) {
62
82
  try {
63
83
  validateBody({ threadId });
64
- const memory = getMemoryFromContext({ mastra, agentId });
84
+ const memory = await getMemoryFromContext({ mastra, agentId, networkId, runtimeContext });
65
85
  if (!memory) {
66
86
  throw new HTTPException(400, { message: "Memory is not initialized" });
67
87
  }
@@ -77,10 +97,12 @@ async function getThreadByIdHandler({
77
97
  async function saveMessagesHandler({
78
98
  mastra,
79
99
  agentId,
80
- body
100
+ body,
101
+ networkId,
102
+ runtimeContext
81
103
  }) {
82
104
  try {
83
- const memory = getMemoryFromContext({ mastra, agentId });
105
+ const memory = await getMemoryFromContext({ mastra, agentId, networkId, runtimeContext });
84
106
  if (!memory) {
85
107
  throw new HTTPException(400, { message: "Memory is not initialized" });
86
108
  }
@@ -104,10 +126,12 @@ async function saveMessagesHandler({
104
126
  async function createThreadHandler({
105
127
  mastra,
106
128
  agentId,
107
- body
129
+ body,
130
+ networkId,
131
+ runtimeContext
108
132
  }) {
109
133
  try {
110
- const memory = getMemoryFromContext({ mastra, agentId });
134
+ const memory = await getMemoryFromContext({ mastra, agentId, networkId, runtimeContext });
111
135
  if (!memory) {
112
136
  throw new HTTPException(400, { message: "Memory is not initialized" });
113
137
  }
@@ -127,10 +151,12 @@ async function updateThreadHandler({
127
151
  mastra,
128
152
  agentId,
129
153
  threadId,
130
- body
154
+ body,
155
+ networkId,
156
+ runtimeContext
131
157
  }) {
132
158
  try {
133
- const memory = getMemoryFromContext({ mastra, agentId });
159
+ const memory = await getMemoryFromContext({ mastra, agentId, networkId, runtimeContext });
134
160
  if (!body) {
135
161
  throw new HTTPException(400, { message: "Body is required" });
136
162
  }
@@ -161,11 +187,13 @@ async function updateThreadHandler({
161
187
  async function deleteThreadHandler({
162
188
  mastra,
163
189
  agentId,
164
- threadId
190
+ threadId,
191
+ networkId,
192
+ runtimeContext
165
193
  }) {
166
194
  try {
167
195
  validateBody({ threadId });
168
- const memory = getMemoryFromContext({ mastra, agentId });
196
+ const memory = await getMemoryFromContext({ mastra, agentId, networkId, runtimeContext });
169
197
  if (!memory) {
170
198
  throw new HTTPException(400, { message: "Memory is not initialized" });
171
199
  }
@@ -183,14 +211,16 @@ async function getMessagesHandler({
183
211
  mastra,
184
212
  agentId,
185
213
  threadId,
186
- limit
214
+ limit,
215
+ networkId,
216
+ runtimeContext
187
217
  }) {
188
218
  if (limit !== void 0 && (!Number.isInteger(limit) || limit <= 0)) {
189
219
  throw new HTTPException(400, { message: "Invalid limit: must be a positive integer" });
190
220
  }
191
221
  try {
192
222
  validateBody({ threadId });
193
- const memory = getMemoryFromContext({ mastra, agentId });
223
+ const memory = await getMemoryFromContext({ mastra, agentId, networkId, runtimeContext });
194
224
  if (!memory) {
195
225
  throw new HTTPException(400, { message: "Memory is not initialized" });
196
226
  }