@mastra/deployer 1.4.0 → 1.5.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var chunkYA6TH3CS_cjs = require('./chunk-YA6TH3CS.cjs');
3
+ var chunkSYOOUXQR_cjs = require('./chunk-SYOOUXQR.cjs');
4
4
  var chunkK7J2W7DJ_cjs = require('./chunk-K7J2W7DJ.cjs');
5
5
  var chunkJVBCN3RH_cjs = require('./chunk-JVBCN3RH.cjs');
6
6
 
7
7
  // src/deploy/base.ts
8
- var Deployer = class extends chunkYA6TH3CS_cjs.Bundler {
8
+ var Deployer = class extends chunkSYOOUXQR_cjs.Bundler {
9
9
  deps = new chunkJVBCN3RH_cjs.DepsService();
10
10
  constructor(args) {
11
11
  super(args.name, "DEPLOYER");
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Bundler } from './chunk-KNINPAM6.js';
1
+ import { Bundler } from './chunk-2ADDVHED.js';
2
2
  import { extractMastraOption } from './chunk-3WL6HPU3.js';
3
3
  import { DepsService, FileService } from './chunk-DPDWM7HQ.js';
4
4
  export { Deps, FileService, createChildProcessLogger, createPinoStream } from './chunk-DPDWM7HQ.js';
@@ -3250,9 +3250,16 @@ var MastraServer = class extends serverAdapter.MastraServer {
3250
3250
  };
3251
3251
  }
3252
3252
  async stream(route, res, result) {
3253
- res.header("Content-Type", "text/plain");
3254
- res.header("Transfer-Encoding", "chunked");
3255
3253
  const streamFormat = route.streamFormat || "stream";
3254
+ if (streamFormat === "sse") {
3255
+ res.header("Content-Type", "text/event-stream");
3256
+ res.header("Cache-Control", "no-cache");
3257
+ res.header("Connection", "keep-alive");
3258
+ res.header("X-Accel-Buffering", "no");
3259
+ } else {
3260
+ res.header("Content-Type", "text/plain");
3261
+ }
3262
+ res.header("Transfer-Encoding", "chunked");
3256
3263
  return stream(
3257
3264
  res,
3258
3265
  async (stream2) => {
@@ -3277,7 +3284,9 @@ var MastraServer = class extends serverAdapter.MastraServer {
3277
3284
  }
3278
3285
  }
3279
3286
  }
3280
- await stream2.write("data: [DONE]\n\n");
3287
+ if (streamFormat === "sse") {
3288
+ await stream2.write("data: [DONE]\n\n");
3289
+ }
3281
3290
  } catch (error) {
3282
3291
  this.mastra.getLogger()?.error("Error in stream processing", {
3283
3292
  error: error instanceof Error ? { message: error.message, stack: error.stack } : error
@@ -3505,7 +3514,21 @@ var MastraServer = class extends serverAdapter.MastraServer {
3505
3514
  if (error && typeof error === "object") {
3506
3515
  if ("status" in error) {
3507
3516
  const status = error.status;
3508
- return c.json({ error: error instanceof Error ? error.message : "Unknown error" }, status);
3517
+ let safeCause;
3518
+ try {
3519
+ const raw = error instanceof Error ? error.cause : void 0;
3520
+ if (raw && typeof raw === "object" && !Array.isArray(raw) && "failingItems" in raw && Array.isArray(raw.failingItems)) {
3521
+ safeCause = { failingItems: raw.failingItems };
3522
+ }
3523
+ } catch {
3524
+ }
3525
+ return c.json(
3526
+ {
3527
+ error: error instanceof Error ? error.message : "Unknown error",
3528
+ ...safeCause ? { cause: safeCause } : {}
3529
+ },
3530
+ status
3531
+ );
3509
3532
  }
3510
3533
  if ("details" in error && error.details && typeof error.details === "object" && "status" in error.details) {
3511
3534
  const status = error.details.status;
@@ -3545,7 +3568,7 @@ var MastraServer = class extends serverAdapter.MastraServer {
3545
3568
  }
3546
3569
  };
3547
3570
 
3548
- // ../../node_modules/.pnpm/hono-openapi@1.1.1_@hono+standard-validator@0.2.2_@standard-schema+spec@1.1.0_hono@4.11_3e74ff9abd3c579ae061185f8bb0e452/node_modules/hono-openapi/dist/index.js
3571
+ // ../../node_modules/.pnpm/hono-openapi@1.1.1_@hono+standard-validator@0.2.2_@standard-schema+spec@1.1.0_hono@4.11_47c1952dfbf16eace420b76a8c8f0ba3/node_modules/hono-openapi/dist/index.js
3549
3572
  var uniqueSymbol = /* @__PURE__ */ Symbol("openapi");
3550
3573
  function describeRoute(spec) {
3551
3574
  const middleware2 = async (_c, next) => {