@mastra/deployer 1.37.0-alpha.5 → 1.37.0-alpha.8

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 (89) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/arktype-aI7TBD0R-3P5RF7MP.js +8 -0
  3. package/dist/{arktype-aI7TBD0R-FXOAT7L5.js.map → arktype-aI7TBD0R-3P5RF7MP.js.map} +1 -1
  4. package/dist/{arktype-aI7TBD0R-CH6FW6SC.cjs → arktype-aI7TBD0R-MM5ZQA7T.cjs} +3 -3
  5. package/dist/{arktype-aI7TBD0R-CH6FW6SC.cjs.map → arktype-aI7TBD0R-MM5ZQA7T.cjs.map} +1 -1
  6. package/dist/chunk-25FDH34P.cjs +4 -0
  7. package/dist/{chunk-PJRU3FAS.cjs.map → chunk-25FDH34P.cjs.map} +1 -1
  8. package/dist/{chunk-GJADEAFP.cjs → chunk-3BPH376H.cjs} +3 -3
  9. package/dist/{chunk-GJADEAFP.cjs.map → chunk-3BPH376H.cjs.map} +1 -1
  10. package/dist/chunk-5AW6ZK5L.js +3 -0
  11. package/dist/{chunk-4MQB32L7.js.map → chunk-5AW6ZK5L.js.map} +1 -1
  12. package/dist/{chunk-N22YZ2SO.js → chunk-7S5IH2W7.js} +3 -3
  13. package/dist/{chunk-N22YZ2SO.js.map → chunk-7S5IH2W7.js.map} +1 -1
  14. package/dist/{chunk-B5MDFOOY.js → chunk-H3XBG3TG.js} +9 -9
  15. package/dist/{chunk-B5MDFOOY.js.map → chunk-H3XBG3TG.js.map} +1 -1
  16. package/dist/chunk-I5QGSZ76.cjs +16 -0
  17. package/dist/{chunk-UDZGL4UX.cjs.map → chunk-I5QGSZ76.cjs.map} +1 -1
  18. package/dist/{chunk-QHAPK6PL.cjs → chunk-O3MMPMLF.cjs} +9 -9
  19. package/dist/{chunk-QHAPK6PL.cjs.map → chunk-O3MMPMLF.cjs.map} +1 -1
  20. package/dist/{chunk-Z7S7UHLW.cjs → chunk-PUO4FNLE.cjs} +3 -3
  21. package/dist/{chunk-Z7S7UHLW.cjs.map → chunk-PUO4FNLE.cjs.map} +1 -1
  22. package/dist/chunk-QEZZJA2G.js +6 -0
  23. package/dist/{chunk-SMZZ3IKP.js.map → chunk-QEZZJA2G.js.map} +1 -1
  24. package/dist/chunk-SQEAL6BL.js +14 -0
  25. package/dist/{chunk-OM4GXHMV.js.map → chunk-SQEAL6BL.js.map} +1 -1
  26. package/dist/core-6CQRSKZJ.js +11866 -0
  27. package/dist/core-6CQRSKZJ.js.map +1 -0
  28. package/dist/core-AU3VAW4X.cjs +12141 -0
  29. package/dist/core-AU3VAW4X.cjs.map +1 -0
  30. package/dist/default-u_dwuiYb-EC2X54LJ.cjs +9 -0
  31. package/dist/{default-u_dwuiYb-ZN3QN5Z7.cjs.map → default-u_dwuiYb-EC2X54LJ.cjs.map} +1 -1
  32. package/dist/default-u_dwuiYb-LP5TT3QO.js +3 -0
  33. package/dist/{default-u_dwuiYb-4FNEQAC4.js.map → default-u_dwuiYb-LP5TT3QO.js.map} +1 -1
  34. package/dist/docs/SKILL.md +1 -1
  35. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  36. package/dist/effect-QlVUlMFu-AG2UGFDX.cjs +17 -0
  37. package/dist/{effect-QlVUlMFu-7FMSB45N.cjs.map → effect-QlVUlMFu-AG2UGFDX.cjs.map} +1 -1
  38. package/dist/{effect-QlVUlMFu-H6SA273U.js → effect-QlVUlMFu-CMIANNDJ.js} +4 -4
  39. package/dist/{effect-QlVUlMFu-H6SA273U.js.map → effect-QlVUlMFu-CMIANNDJ.js.map} +1 -1
  40. package/dist/{esm-QZXXQQYB.js → esm-O6BGW5O2.js} +298 -45
  41. package/dist/esm-O6BGW5O2.js.map +1 -0
  42. package/dist/{esm-O5U7FUQQ.cjs → esm-XCKJ5Z6I.cjs} +339 -86
  43. package/dist/esm-XCKJ5Z6I.cjs.map +1 -0
  44. package/dist/server/index.cjs +56 -88
  45. package/dist/server/index.cjs.map +1 -1
  46. package/dist/server/index.js +56 -88
  47. package/dist/server/index.js.map +1 -1
  48. package/dist/{sury-CWZTCd75-SAXXZQP6.js → sury-CWZTCd75-3I5DBBFO.js} +4 -4
  49. package/dist/{sury-CWZTCd75-SAXXZQP6.js.map → sury-CWZTCd75-3I5DBBFO.js.map} +1 -1
  50. package/dist/sury-CWZTCd75-KWZ5SP6R.cjs +17 -0
  51. package/dist/{sury-CWZTCd75-TSCANIKB.cjs.map → sury-CWZTCd75-KWZ5SP6R.cjs.map} +1 -1
  52. package/dist/{typebox-Dei93FPO-V6KUC6LS.cjs → typebox-Dei93FPO-PLRBZ6HI.cjs} +3 -3
  53. package/dist/{typebox-Dei93FPO-V6KUC6LS.cjs.map → typebox-Dei93FPO-PLRBZ6HI.cjs.map} +1 -1
  54. package/dist/typebox-Dei93FPO-QYPV4NRU.js +8 -0
  55. package/dist/{typebox-Dei93FPO-Z2PFIK65.js.map → typebox-Dei93FPO-QYPV4NRU.js.map} +1 -1
  56. package/dist/{valibot--1zFm7rT-OWIZ7TCZ.js → valibot--1zFm7rT-C7A7FGJ2.js} +4 -4
  57. package/dist/{valibot--1zFm7rT-OWIZ7TCZ.js.map → valibot--1zFm7rT-C7A7FGJ2.js.map} +1 -1
  58. package/dist/valibot--1zFm7rT-KMUXFXU5.cjs +17 -0
  59. package/dist/{valibot--1zFm7rT-OFSJWS3O.cjs.map → valibot--1zFm7rT-KMUXFXU5.cjs.map} +1 -1
  60. package/dist/{valibot-D_HTw1Gn-FOK7YYT6.js → valibot-D_HTw1Gn-Q6P44V54.js} +5 -5
  61. package/dist/{valibot-D_HTw1Gn-FOK7YYT6.js.map → valibot-D_HTw1Gn-Q6P44V54.js.map} +1 -1
  62. package/dist/{valibot-D_HTw1Gn-CTPUDOX5.cjs → valibot-D_HTw1Gn-U6IRYYPK.cjs} +7 -7
  63. package/dist/{valibot-D_HTw1Gn-CTPUDOX5.cjs.map → valibot-D_HTw1Gn-U6IRYYPK.cjs.map} +1 -1
  64. package/dist/zod-Bwrt9trS-7ZKFPQIW.cjs +31 -0
  65. package/dist/zod-Bwrt9trS-7ZKFPQIW.cjs.map +1 -0
  66. package/dist/{zod-Bwrt9trS-6WLQRJO3.js → zod-Bwrt9trS-KSTCMD4H.js} +6 -6
  67. package/dist/zod-Bwrt9trS-KSTCMD4H.js.map +1 -0
  68. package/dist/{zod-DSgpEGAE-Z7XWMQKD.cjs → zod-DSgpEGAE-AWAPWX2N.cjs} +7 -7
  69. package/dist/{zod-DSgpEGAE-Z7XWMQKD.cjs.map → zod-DSgpEGAE-AWAPWX2N.cjs.map} +1 -1
  70. package/dist/{zod-DSgpEGAE-EQIA3EQN.js → zod-DSgpEGAE-HGCVPPB4.js} +5 -5
  71. package/dist/{zod-DSgpEGAE-EQIA3EQN.js.map → zod-DSgpEGAE-HGCVPPB4.js.map} +1 -1
  72. package/package.json +8 -9
  73. package/dist/arktype-aI7TBD0R-FXOAT7L5.js +0 -8
  74. package/dist/chunk-4MQB32L7.js +0 -3
  75. package/dist/chunk-OM4GXHMV.js +0 -14
  76. package/dist/chunk-PJRU3FAS.cjs +0 -4
  77. package/dist/chunk-SMZZ3IKP.js +0 -6
  78. package/dist/chunk-UDZGL4UX.cjs +0 -16
  79. package/dist/default-u_dwuiYb-4FNEQAC4.js +0 -3
  80. package/dist/default-u_dwuiYb-ZN3QN5Z7.cjs +0 -9
  81. package/dist/effect-QlVUlMFu-7FMSB45N.cjs +0 -17
  82. package/dist/esm-O5U7FUQQ.cjs.map +0 -1
  83. package/dist/esm-QZXXQQYB.js.map +0 -1
  84. package/dist/sury-CWZTCd75-TSCANIKB.cjs +0 -17
  85. package/dist/typebox-Dei93FPO-Z2PFIK65.js +0 -8
  86. package/dist/valibot--1zFm7rT-OFSJWS3O.cjs +0 -17
  87. package/dist/zod-Bwrt9trS-6WLQRJO3.js.map +0 -1
  88. package/dist/zod-Bwrt9trS-OH7I5GXF.cjs +0 -31
  89. package/dist/zod-Bwrt9trS-OH7I5GXF.cjs.map +0 -1
@@ -2759,6 +2759,7 @@ function toFetchResponse(res) {
2759
2759
  }
2760
2760
  return res.fetchResponse;
2761
2761
  }
2762
+ var _a;
2762
2763
  // @__NO_SIDE_EFFECTS__
2763
2764
  function $constructor(name, initializer3, params) {
2764
2765
  function init(inst, def) {
@@ -2805,6 +2806,7 @@ function $constructor(name, initializer3, params) {
2805
2806
  Object.defineProperty(_, "name", { value: name });
2806
2807
  return _;
2807
2808
  }
2809
+ (_a = globalThis).__zod_globalConfig ?? (_a.__zod_globalConfig = {});
2808
2810
  function jsonStringifyReplacer(_, value) {
2809
2811
  if (typeof value === "bigint")
2810
2812
  return value.toString();
@@ -2827,7 +2829,7 @@ var initializer = (inst, def) => {
2827
2829
  });
2828
2830
  };
2829
2831
  var $ZodError = /* @__PURE__ */ $constructor("$ZodError", initializer);
2830
- function flattenError(error, mapper = (issue2) => issue2.message) {
2832
+ function flattenError(error, mapper = (issue) => issue.message) {
2831
2833
  const fieldErrors = {};
2832
2834
  const formErrors = [];
2833
2835
  for (const sub of error.issues) {
@@ -2840,32 +2842,35 @@ function flattenError(error, mapper = (issue2) => issue2.message) {
2840
2842
  }
2841
2843
  return { formErrors, fieldErrors };
2842
2844
  }
2843
- function formatError(error, mapper = (issue2) => issue2.message) {
2845
+ function formatError(error, mapper = (issue) => issue.message) {
2844
2846
  const fieldErrors = { _errors: [] };
2845
- const processError = (error2) => {
2846
- for (const issue2 of error2.issues) {
2847
- if (issue2.code === "invalid_union" && issue2.errors.length) {
2848
- issue2.errors.map((issues) => processError({ issues }));
2849
- } else if (issue2.code === "invalid_key") {
2850
- processError({ issues: issue2.issues });
2851
- } else if (issue2.code === "invalid_element") {
2852
- processError({ issues: issue2.issues });
2853
- } else if (issue2.path.length === 0) {
2854
- fieldErrors._errors.push(mapper(issue2));
2847
+ const processError = (error2, path = []) => {
2848
+ for (const issue of error2.issues) {
2849
+ if (issue.code === "invalid_union" && issue.errors.length) {
2850
+ issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path]));
2851
+ } else if (issue.code === "invalid_key") {
2852
+ processError({ issues: issue.issues }, [...path, ...issue.path]);
2853
+ } else if (issue.code === "invalid_element") {
2854
+ processError({ issues: issue.issues }, [...path, ...issue.path]);
2855
2855
  } else {
2856
- let curr = fieldErrors;
2857
- let i = 0;
2858
- while (i < issue2.path.length) {
2859
- const el = issue2.path[i];
2860
- const terminal = i === issue2.path.length - 1;
2861
- if (!terminal) {
2862
- curr[el] = curr[el] || { _errors: [] };
2863
- } else {
2864
- curr[el] = curr[el] || { _errors: [] };
2865
- curr[el]._errors.push(mapper(issue2));
2856
+ const fullpath = [...path, ...issue.path];
2857
+ if (fullpath.length === 0) {
2858
+ fieldErrors._errors.push(mapper(issue));
2859
+ } else {
2860
+ let curr = fieldErrors;
2861
+ let i = 0;
2862
+ while (i < fullpath.length) {
2863
+ const el = fullpath[i];
2864
+ const terminal = i === fullpath.length - 1;
2865
+ if (!terminal) {
2866
+ curr[el] = curr[el] || { _errors: [] };
2867
+ } else {
2868
+ curr[el] = curr[el] || { _errors: [] };
2869
+ curr[el]._errors.push(mapper(issue));
2870
+ }
2871
+ curr = curr[el];
2872
+ i++;
2866
2873
  }
2867
- curr = curr[el];
2868
- i++;
2869
2874
  }
2870
2875
  }
2871
2876
  }
@@ -2873,51 +2878,6 @@ function formatError(error, mapper = (issue2) => issue2.message) {
2873
2878
  processError(error);
2874
2879
  return fieldErrors;
2875
2880
  }
2876
- var _a;
2877
- var $ZodRegistry = class {
2878
- constructor() {
2879
- this._map = /* @__PURE__ */ new WeakMap();
2880
- this._idmap = /* @__PURE__ */ new Map();
2881
- }
2882
- add(schema, ..._meta) {
2883
- const meta = _meta[0];
2884
- this._map.set(schema, meta);
2885
- if (meta && typeof meta === "object" && "id" in meta) {
2886
- this._idmap.set(meta.id, schema);
2887
- }
2888
- return this;
2889
- }
2890
- clear() {
2891
- this._map = /* @__PURE__ */ new WeakMap();
2892
- this._idmap = /* @__PURE__ */ new Map();
2893
- return this;
2894
- }
2895
- remove(schema) {
2896
- const meta = this._map.get(schema);
2897
- if (meta && typeof meta === "object" && "id" in meta) {
2898
- this._idmap.delete(meta.id);
2899
- }
2900
- this._map.delete(schema);
2901
- return this;
2902
- }
2903
- get(schema) {
2904
- const p = schema._zod.parent;
2905
- if (p) {
2906
- const pm = { ...this.get(p) ?? {} };
2907
- delete pm.id;
2908
- const f = { ...pm, ...this._map.get(schema) };
2909
- return Object.keys(f).length ? f : void 0;
2910
- }
2911
- return this._map.get(schema);
2912
- }
2913
- has(schema) {
2914
- return this._map.has(schema);
2915
- }
2916
- };
2917
- function registry() {
2918
- return new $ZodRegistry();
2919
- }
2920
- (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
2921
2881
  var initializer2 = (inst, issues) => {
2922
2882
  $ZodError.init(inst, issues);
2923
2883
  inst.name = "ZodError";
@@ -2931,8 +2891,8 @@ var initializer2 = (inst, issues) => {
2931
2891
  // enumerable: false,
2932
2892
  },
2933
2893
  addIssue: {
2934
- value: (issue2) => {
2935
- inst.issues.push(issue2);
2894
+ value: (issue) => {
2895
+ inst.issues.push(issue);
2936
2896
  inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
2937
2897
  }
2938
2898
  // enumerable: false,
@@ -2953,7 +2913,7 @@ var initializer2 = (inst, issues) => {
2953
2913
  });
2954
2914
  };
2955
2915
  var ZodError = /* @__PURE__ */ $constructor("ZodError", initializer2);
2956
- async function setupBrowserStream(app, config2) {
2916
+ async function setupBrowserStream(app, config) {
2957
2917
  let createNodeWebSocket;
2958
2918
  try {
2959
2919
  const mod = "@hono/node-ws";
@@ -2967,8 +2927,8 @@ async function setupBrowserStream(app, config2) {
2967
2927
  return null;
2968
2928
  }
2969
2929
  const { injectWebSocket, upgradeWebSocket } = createNodeWebSocket({ app });
2970
- const registry2 = new ViewerRegistry();
2971
- const rawPrefix = config2.apiPrefix ?? "/api";
2930
+ const registry = new ViewerRegistry();
2931
+ const rawPrefix = config.apiPrefix ?? "/api";
2972
2932
  const trimmed = rawPrefix.endsWith("/") ? rawPrefix.slice(0, -1) : rawPrefix;
2973
2933
  const apiPrefix = trimmed || "/api";
2974
2934
  app.get(
@@ -2980,20 +2940,20 @@ async function setupBrowserStream(app, config2) {
2980
2940
  return {
2981
2941
  onOpen(_event, ws) {
2982
2942
  ws.send(JSON.stringify({ status: "connected" }));
2983
- void registry2.addViewer(viewerKey, ws, config2.getToolset, agentId, threadId);
2943
+ void registry.addViewer(viewerKey, ws, config.getToolset, agentId, threadId);
2984
2944
  },
2985
2945
  onMessage(event, _ws) {
2986
2946
  const data = typeof event.data === "string" ? event.data : null;
2987
2947
  if (data) {
2988
- void handleInputMessage(data, config2.getToolset, agentId, threadId);
2948
+ void handleInputMessage(data, config.getToolset, agentId, threadId);
2989
2949
  }
2990
2950
  },
2991
2951
  onClose(_event, ws) {
2992
- void registry2.removeViewer(viewerKey, ws);
2952
+ void registry.removeViewer(viewerKey, ws);
2993
2953
  },
2994
2954
  onError(event, ws) {
2995
2955
  console.error("[BrowserStream] WebSocket error:", event);
2996
- void registry2.removeViewer(viewerKey, ws);
2956
+ void registry.removeViewer(viewerKey, ws);
2997
2957
  }
2998
2958
  };
2999
2959
  })
@@ -3004,7 +2964,7 @@ async function setupBrowserStream(app, config2) {
3004
2964
  return c.json({ error: "Agent ID is required" }, 400);
3005
2965
  }
3006
2966
  const threadId = c.req.query("threadId");
3007
- const toolset = await config2.getToolset(agentId);
2967
+ const toolset = await config.getToolset(agentId);
3008
2968
  if (!toolset) {
3009
2969
  return c.json({ hasSession: false, screencastAvailable: true });
3010
2970
  }
@@ -3016,7 +2976,7 @@ async function setupBrowserStream(app, config2) {
3016
2976
  if (!agentId) {
3017
2977
  return c.json({ error: "Agent ID is required" }, 400);
3018
2978
  }
3019
- const toolset = await config2.getToolset(agentId);
2979
+ const toolset = await config.getToolset(agentId);
3020
2980
  if (!toolset) {
3021
2981
  return c.json({ error: "No browser session for this agent" }, 404);
3022
2982
  }
@@ -3030,12 +2990,12 @@ async function setupBrowserStream(app, config2) {
3030
2990
  const scope = toolset.getScope();
3031
2991
  const viewerKey = threadId ? `${agentId}:${threadId}` : agentId;
3032
2992
  if (scope === "thread" && threadId) {
3033
- await registry2.closeBrowserSession(viewerKey);
2993
+ await registry.closeBrowserSession(viewerKey);
3034
2994
  if ("closeThreadSession" in toolset && typeof toolset.closeThreadSession === "function") {
3035
2995
  await toolset.closeThreadSession(threadId);
3036
2996
  }
3037
2997
  } else {
3038
- await registry2.closeBrowserSession(viewerKey);
2998
+ await registry.closeBrowserSession(viewerKey);
3039
2999
  await toolset.close();
3040
3000
  }
3041
3001
  return c.json({ success: true });
@@ -3044,7 +3004,7 @@ async function setupBrowserStream(app, config2) {
3044
3004
  return c.json({ error: "Failed to close browser" }, 500);
3045
3005
  }
3046
3006
  });
3047
- return { injectWebSocket, registry: registry2 };
3007
+ return { injectWebSocket, registry };
3048
3008
  }
3049
3009
  var _hasPermissionPromise;
3050
3010
  function loadHasPermission() {
@@ -3132,6 +3092,9 @@ var MastraServer = class extends MastraServer$1 {
3132
3092
  return stream(
3133
3093
  res,
3134
3094
  async (stream2) => {
3095
+ if (streamFormat === "sse") {
3096
+ await stream2.write(": connected\n\n");
3097
+ }
3135
3098
  const readableStream = result instanceof ReadableStream ? result : result.fullStream;
3136
3099
  const reader = readableStream.getReader();
3137
3100
  stream2.onAbort(() => {
@@ -3142,6 +3105,10 @@ var MastraServer = class extends MastraServer$1 {
3142
3105
  const { done, value } = await reader.read();
3143
3106
  if (done) break;
3144
3107
  if (value) {
3108
+ if (streamFormat === "sse" && typeof value === "string" && value.startsWith(":")) {
3109
+ await stream2.write(value);
3110
+ continue;
3111
+ }
3145
3112
  const shouldRedact = this.streamOptions?.redact ?? true;
3146
3113
  const outputValue = shouldRedact ? redactStreamChunk(value) : value;
3147
3114
  if (streamFormat === "sse") {
@@ -3559,7 +3526,8 @@ var MastraServer = class extends MastraServer$1 {
3559
3526
  c.req.method,
3560
3527
  reqHeaders,
3561
3528
  c.req.raw.body,
3562
- c.get("requestContext")
3529
+ c.get("requestContext"),
3530
+ c.req.raw.signal
3563
3531
  );
3564
3532
  if (!response) {
3565
3533
  return c.json({ error: "Not Found" }, 404);
@@ -3587,14 +3555,14 @@ var MastraServer = class extends MastraServer$1 {
3587
3555
  const method = c.req.method;
3588
3556
  const path = c.req.path;
3589
3557
  await next();
3590
- const duration2 = Date.now() - start;
3558
+ const duration = Date.now() - start;
3591
3559
  const status = c.res.status;
3592
3560
  const level = this.httpLoggingConfig?.level || "info";
3593
3561
  const logData = {
3594
3562
  method,
3595
3563
  path,
3596
3564
  status,
3597
- duration: `${duration2}ms`
3565
+ duration: `${duration}ms`
3598
3566
  };
3599
3567
  if (this.httpLoggingConfig?.includeQueryParams) {
3600
3568
  logData.query = c.req.query();
@@ -3610,12 +3578,12 @@ var MastraServer = class extends MastraServer$1 {
3610
3578
  });
3611
3579
  logData.headers = headers;
3612
3580
  }
3613
- this.logger[level](`${method} ${path} ${status} ${duration2}ms`, logData);
3581
+ this.logger[level](`${method} ${path} ${status} ${duration}ms`, logData);
3614
3582
  });
3615
3583
  }
3616
3584
  };
3617
3585
 
3618
- // ../../node_modules/.pnpm/hono-openapi@1.3.0_@hono+standard-validator@0.2.2_@standard-schema+spec@1.1.0_hono@4.12_ffb0c0c04f958ac4a0a7414297b2bdbb/node_modules/hono-openapi/dist/index.js
3586
+ // ../../node_modules/.pnpm/hono-openapi@1.3.0_@hono+standard-validator@0.2.2_@standard-schema+spec@1.1.0_hono@4.12_b1000b1a50a50f0c591a048e49a065cb/node_modules/hono-openapi/dist/index.js
3619
3587
  var uniqueSymbol = /* @__PURE__ */ Symbol("openapi");
3620
3588
  function describeRoute(spec) {
3621
3589
  const middleware2 = async (_c, next) => {