@mastra/deployer 1.37.1 → 1.38.0-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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # @mastra/deployer
2
2
 
3
+ ## 1.38.0-alpha.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixed Studio playground browser telemetry not respecting `MASTRA_TELEMETRY_DISABLED`. The dev server was hardcoding an empty value into the served `index.html`, so `window.MASTRA_TELEMETRY_DISABLED` was always falsy in the browser and the playground React app initialized PostHog regardless of the user's `.env`. The dev server now propagates `process.env.MASTRA_TELEMETRY_DISABLED` to the browser, where the playground applies the same canonical opt-out parsing as the rest of the framework. ([#16990](https://github.com/mastra-ai/mastra/pull/16990))
8
+
9
+ **Before:** Setting `MASTRA_TELEMETRY_DISABLED=true` in `.env` had no effect on playground network requests to PostHog.
10
+
11
+ **After:**
12
+
13
+ ```bash
14
+ # .env
15
+ MASTRA_TELEMETRY_DISABLED=true
16
+ ```
17
+
18
+ Playground analytics are now disabled.
19
+
20
+ - Updated dependencies [[`d779de3`](https://github.com/mastra-ai/mastra/commit/d779de3cd9d2e7ed8110547190e2f15e786a0e41), [`1750c97`](https://github.com/mastra-ai/mastra/commit/1750c975d6179fbf6db2813b15229d4f8f23fc55), [`09972fe`](https://github.com/mastra-ai/mastra/commit/09972fe6b7b92ade32d70deda7094af2e52b2676), [`0e32507`](https://github.com/mastra-ai/mastra/commit/0e32507962cdfa5569b7bda5bc6fb3dd34e40b03), [`3a081c1`](https://github.com/mastra-ai/mastra/commit/3a081c1255c5ae8c99f6dad91cc612934ef6f2bd), [`fe9eacd`](https://github.com/mastra-ai/mastra/commit/fe9eacd9545a0a9d64aad31c9fa90294a425289e), [`db79c86`](https://github.com/mastra-ai/mastra/commit/db79c86c60723d57e02f9636ca2611bd4515f194)]:
21
+ - @mastra/core@1.38.0-alpha.2
22
+ - @mastra/server@1.38.0-alpha.2
23
+
24
+ ## 1.37.2-alpha.1
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies [[`9d87d68`](https://github.com/mastra-ai/mastra/commit/9d87d688371f5d1252ebb18d96890b51ade7de7c), [`49f8abc`](https://github.com/mastra-ai/mastra/commit/49f8abce8258e4f2f87bd326acfbdb641264a47c), [`9d87d68`](https://github.com/mastra-ai/mastra/commit/9d87d688371f5d1252ebb18d96890b51ade7de7c)]:
29
+ - @mastra/server@1.37.2-alpha.1
30
+ - @mastra/core@1.37.2-alpha.1
31
+
32
+ ## 1.37.2-alpha.0
33
+
34
+ ### Patch Changes
35
+
36
+ - Updated dependencies [[`07c3de7`](https://github.com/mastra-ai/mastra/commit/07c3de7f7bc418beccaea3b5e6b7f7cdda79d492)]:
37
+ - @mastra/core@1.37.2-alpha.0
38
+ - @mastra/server@1.37.2-alpha.0
39
+
3
40
  ## 1.37.1
4
41
 
5
42
  ### Patch Changes
@@ -3,7 +3,7 @@ name: mastra-deployer
3
3
  description: Documentation for @mastra/deployer. Use when working with @mastra/deployer APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/deployer"
6
- version: "1.37.1"
6
+ version: "1.38.0-alpha.2"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.37.1",
2
+ "version": "1.38.0-alpha.2",
3
3
  "package": "@mastra/deployer",
4
4
  "exports": {
5
5
  "Deps": {
@@ -2786,160 +2786,6 @@ function toFetchResponse(res) {
2786
2786
  }
2787
2787
  return res.fetchResponse;
2788
2788
  }
2789
- var _a;
2790
- // @__NO_SIDE_EFFECTS__
2791
- function $constructor(name, initializer3, params) {
2792
- function init(inst, def) {
2793
- if (!inst._zod) {
2794
- Object.defineProperty(inst, "_zod", {
2795
- value: {
2796
- def,
2797
- constr: _,
2798
- traits: /* @__PURE__ */ new Set()
2799
- },
2800
- enumerable: false
2801
- });
2802
- }
2803
- if (inst._zod.traits.has(name)) {
2804
- return;
2805
- }
2806
- inst._zod.traits.add(name);
2807
- initializer3(inst, def);
2808
- const proto = _.prototype;
2809
- const keys = Object.keys(proto);
2810
- for (let i = 0; i < keys.length; i++) {
2811
- const k = keys[i];
2812
- if (!(k in inst)) {
2813
- inst[k] = proto[k].bind(inst);
2814
- }
2815
- }
2816
- }
2817
- function _(def) {
2818
- var _a2;
2819
- const inst = this;
2820
- init(inst, def);
2821
- (_a2 = inst._zod).deferred ?? (_a2.deferred = []);
2822
- for (const fn of inst._zod.deferred) {
2823
- fn();
2824
- }
2825
- return inst;
2826
- }
2827
- Object.defineProperty(_, "init", { value: init });
2828
- Object.defineProperty(_, Symbol.hasInstance, {
2829
- value: (inst) => {
2830
- return inst?._zod?.traits?.has(name);
2831
- }
2832
- });
2833
- Object.defineProperty(_, "name", { value: name });
2834
- return _;
2835
- }
2836
- (_a = globalThis).__zod_globalConfig ?? (_a.__zod_globalConfig = {});
2837
- function jsonStringifyReplacer(_, value) {
2838
- if (typeof value === "bigint")
2839
- return value.toString();
2840
- return value;
2841
- }
2842
- var initializer = (inst, def) => {
2843
- inst.name = "$ZodError";
2844
- Object.defineProperty(inst, "_zod", {
2845
- value: inst._zod,
2846
- enumerable: false
2847
- });
2848
- Object.defineProperty(inst, "issues", {
2849
- value: def,
2850
- enumerable: false
2851
- });
2852
- inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
2853
- Object.defineProperty(inst, "toString", {
2854
- value: () => inst.message,
2855
- enumerable: false
2856
- });
2857
- };
2858
- var $ZodError = /* @__PURE__ */ $constructor("$ZodError", initializer);
2859
- function flattenError(error, mapper = (issue) => issue.message) {
2860
- const fieldErrors = {};
2861
- const formErrors = [];
2862
- for (const sub of error.issues) {
2863
- if (sub.path.length > 0) {
2864
- fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
2865
- fieldErrors[sub.path[0]].push(mapper(sub));
2866
- } else {
2867
- formErrors.push(mapper(sub));
2868
- }
2869
- }
2870
- return { formErrors, fieldErrors };
2871
- }
2872
- function formatError(error, mapper = (issue) => issue.message) {
2873
- const fieldErrors = { _errors: [] };
2874
- const processError = (error2, path = []) => {
2875
- for (const issue of error2.issues) {
2876
- if (issue.code === "invalid_union" && issue.errors.length) {
2877
- issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path]));
2878
- } else if (issue.code === "invalid_key") {
2879
- processError({ issues: issue.issues }, [...path, ...issue.path]);
2880
- } else if (issue.code === "invalid_element") {
2881
- processError({ issues: issue.issues }, [...path, ...issue.path]);
2882
- } else {
2883
- const fullpath = [...path, ...issue.path];
2884
- if (fullpath.length === 0) {
2885
- fieldErrors._errors.push(mapper(issue));
2886
- } else {
2887
- let curr = fieldErrors;
2888
- let i = 0;
2889
- while (i < fullpath.length) {
2890
- const el = fullpath[i];
2891
- const terminal = i === fullpath.length - 1;
2892
- if (!terminal) {
2893
- curr[el] = curr[el] || { _errors: [] };
2894
- } else {
2895
- curr[el] = curr[el] || { _errors: [] };
2896
- curr[el]._errors.push(mapper(issue));
2897
- }
2898
- curr = curr[el];
2899
- i++;
2900
- }
2901
- }
2902
- }
2903
- }
2904
- };
2905
- processError(error);
2906
- return fieldErrors;
2907
- }
2908
- var initializer2 = (inst, issues) => {
2909
- $ZodError.init(inst, issues);
2910
- inst.name = "ZodError";
2911
- Object.defineProperties(inst, {
2912
- format: {
2913
- value: (mapper) => formatError(inst, mapper)
2914
- // enumerable: false,
2915
- },
2916
- flatten: {
2917
- value: (mapper) => flattenError(inst, mapper)
2918
- // enumerable: false,
2919
- },
2920
- addIssue: {
2921
- value: (issue) => {
2922
- inst.issues.push(issue);
2923
- inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
2924
- }
2925
- // enumerable: false,
2926
- },
2927
- addIssues: {
2928
- value: (issues2) => {
2929
- inst.issues.push(...issues2);
2930
- inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
2931
- }
2932
- // enumerable: false,
2933
- },
2934
- isEmpty: {
2935
- get() {
2936
- return inst.issues.length === 0;
2937
- }
2938
- // enumerable: false,
2939
- }
2940
- });
2941
- };
2942
- var ZodError = /* @__PURE__ */ $constructor("ZodError", initializer2);
2943
2789
  async function setupBrowserStream(app, config) {
2944
2790
  let createNodeWebSocket;
2945
2791
  try {
@@ -3119,7 +2965,7 @@ var MastraServer = class extends serverAdapter.MastraServer {
3119
2965
  return streaming.stream(
3120
2966
  res,
3121
2967
  async (stream2) => {
3122
- if (streamFormat === "sse") {
2968
+ if (streamFormat === "sse" && route.sseFlushOnConnect) {
3123
2969
  await stream2.write(": connected\n\n");
3124
2970
  }
3125
2971
  const readableStream = result instanceof ReadableStream ? result : result.fullStream;
@@ -3341,7 +3187,7 @@ var MastraServer = class extends serverAdapter.MastraServer {
3341
3187
  this.mastra.getLogger()?.error("Error parsing query params", {
3342
3188
  error: error instanceof Error ? { message: error.message, stack: error.stack } : error
3343
3189
  });
3344
- if (error instanceof ZodError) {
3190
+ if (serverAdapter.isZodError(error)) {
3345
3191
  const { status, body } = this.resolveValidationError(route, error, "query");
3346
3192
  return c.json(body, status);
3347
3193
  }
@@ -3361,7 +3207,7 @@ var MastraServer = class extends serverAdapter.MastraServer {
3361
3207
  this.mastra.getLogger()?.error("Error parsing body", {
3362
3208
  error: error instanceof Error ? { message: error.message, stack: error.stack } : error
3363
3209
  });
3364
- if (error instanceof ZodError) {
3210
+ if (serverAdapter.isZodError(error)) {
3365
3211
  const { status, body } = this.resolveValidationError(route, error, "body");
3366
3212
  return c.json(body, status);
3367
3213
  }
@@ -3381,7 +3227,7 @@ var MastraServer = class extends serverAdapter.MastraServer {
3381
3227
  this.mastra.getLogger()?.error("Error parsing path params", {
3382
3228
  error: error instanceof Error ? { message: error.message, stack: error.stack } : error
3383
3229
  });
3384
- if (error instanceof ZodError) {
3230
+ if (serverAdapter.isZodError(error)) {
3385
3231
  const { status, body } = this.resolveValidationError(route, error, "path");
3386
3232
  return c.json(body, status);
3387
3233
  }
@@ -4545,7 +4391,7 @@ async function createHonoServer(mastra, options = {
4545
4391
  cloudApiEndpoint: `'${cloudApiEndpoint}'`,
4546
4392
  experimentalFeatures: `'${experimentalFeatures}'`,
4547
4393
  templates: `'${templatesEnabled}'`,
4548
- telemetryDisabled: `''`,
4394
+ telemetryDisabled: `'${process.env.MASTRA_TELEMETRY_DISABLED ?? ""}'`,
4549
4395
  requestContextPresets: `'${escapeForHtml(requestContextPresets)}'`,
4550
4396
  experimentalUI: `'${experimentalUI}'`,
4551
4397
  agentSignals: `'${agentSignals}'`,