@mastra/deployer 1.0.0-beta.23 → 1.0.0-beta.25

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGhE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAU5B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAoBnD,KAAK,QAAQ,GAAG,YAAY,CAAC;AAE7B,KAAK,SAAS,GAAG,aAAa,GAAG;IAC/B,OAAO,EAAE,GAAG,CAAC;QAAE,UAAU,EAAE,+BAA+B,CAAA;KAAE,CAAC,CAAC;CAC/D,CAAC;AAEF,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,wCAmB/D;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,mBAER;cAGgC,QAAQ;eAAa,SAAS;2CA2ShE;AAED,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAmC,mDAqDlG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGhE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAW5B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAoBnD,KAAK,QAAQ,GAAG,YAAY,CAAC;AAE7B,KAAK,SAAS,GAAG,aAAa,GAAG;IAC/B,OAAO,EAAE,GAAG,CAAC;QAAE,UAAU,EAAE,+BAA+B,CAAA;KAAE,CAAC,CAAC;CAC/D,CAAC;AAEF,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,wCAmB/D;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,mBAER;cAGgC,QAAQ;eAAa,SAAS;2CAuUhE;AAED,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAmC,mDAqDlG"}
@@ -3526,6 +3526,126 @@ async function restartAllActiveWorkflowRunsHandler(c) {
3526
3526
  }
3527
3527
  }
3528
3528
 
3529
+ // src/server/handlers/root.ts
3530
+ async function rootHandler(c) {
3531
+ const baseUrl = new URL(c.req.url).origin;
3532
+ return c.html(
3533
+ /* html */
3534
+ `
3535
+ <!doctype html>
3536
+ <html lang="en">
3537
+ <head>
3538
+ <meta charset="UTF-8" />
3539
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
3540
+ <title>Mastra API</title>
3541
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/inter-ui/3.19.3/inter.min.css" />
3542
+ <style>
3543
+ body {
3544
+ margin: 0;
3545
+ padding: 0;
3546
+ background-color: #0d0d0d;
3547
+ color: #ffffff;
3548
+ font-family:
3549
+ 'Inter',
3550
+ -apple-system,
3551
+ BlinkMacSystemFont,
3552
+ system-ui,
3553
+ sans-serif;
3554
+ min-height: 100vh;
3555
+ display: flex;
3556
+ flex-direction: column;
3557
+ }
3558
+
3559
+ main {
3560
+ flex: 1;
3561
+ display: flex;
3562
+ flex-direction: column;
3563
+ align-items: center;
3564
+ justify-content: center;
3565
+ padding: 2rem;
3566
+ text-align: center;
3567
+ }
3568
+
3569
+ h1 {
3570
+ font-size: 4rem;
3571
+ font-weight: 600;
3572
+ margin: 0 0 1rem 0;
3573
+ background: linear-gradient(to right, #fff, #ccc);
3574
+ -webkit-background-clip: text;
3575
+ -webkit-text-fill-color: transparent;
3576
+ line-height: 1.2;
3577
+ }
3578
+
3579
+ .subtitle {
3580
+ color: #9ca3af;
3581
+ font-size: 1.25rem;
3582
+ max-width: 600px;
3583
+ margin: 0 auto 3rem auto;
3584
+ line-height: 1.6;
3585
+ }
3586
+
3587
+ .link {
3588
+ color: #ffffff;
3589
+ }
3590
+
3591
+ .link:hover {
3592
+ text-decoration: none;
3593
+ }
3594
+
3595
+ .docs-link {
3596
+ background-color: #1a1a1a;
3597
+ padding: 1rem 2rem;
3598
+ border-radius: 0.5rem;
3599
+ display: flex;
3600
+ align-items: center;
3601
+ gap: 1rem;
3602
+ font-family: monospace;
3603
+ font-size: 1rem;
3604
+ color: #ffffff;
3605
+ text-decoration: none;
3606
+ transition: background-color 0.2s;
3607
+ }
3608
+
3609
+ .docs-link:hover {
3610
+ background-color: #252525;
3611
+ }
3612
+
3613
+ .arrow-icon {
3614
+ transition: transform 0.2s;
3615
+ }
3616
+
3617
+ .docs-link:hover .arrow-icon {
3618
+ transform: translateX(4px);
3619
+ }
3620
+ </style>
3621
+ </head>
3622
+ <body>
3623
+ <main>
3624
+ <h1>Welcome to the Mastra API</h1>
3625
+ <p class="subtitle">
3626
+ Discover all available endpoints through Swagger UI. You can also define your own <a href="https://mastra.ai/docs/server-db/custom-api-routes" target="_blank" class="link">API routes</a>.
3627
+ </p>
3628
+ <a href="${baseUrl}/swagger-ui" target="_blank" class="docs-link">
3629
+ Browse Swagger UI
3630
+ <svg
3631
+ class="arrow-icon"
3632
+ width="20"
3633
+ height="20"
3634
+ viewBox="0 0 24 24"
3635
+ fill="none"
3636
+ stroke="currentColor"
3637
+ strokeWidth="2"
3638
+ >
3639
+ <path d="M5 12h14M12 5l7 7-7 7" />
3640
+ </svg>
3641
+ </a>
3642
+ </main>
3643
+ </body>
3644
+ </html>
3645
+ `
3646
+ );
3647
+ }
3648
+
3529
3649
  // src/server/welcome.ts
3530
3650
  var html2 = `
3531
3651
  <!doctype html>
@@ -3699,7 +3819,7 @@ async function createHonoServer(mastra, options = {
3699
3819
  tools: options.tools,
3700
3820
  taskStore: a2aTaskStore,
3701
3821
  bodyLimitOptions,
3702
- openapiPath: "/openapi.json",
3822
+ openapiPath: options?.isDev || server?.build?.openAPIDocs ? "/openapi.json" : void 0,
3703
3823
  customRouteAuthConfig
3704
3824
  });
3705
3825
  honoServerAdapter.registerContextMiddleware();
@@ -3736,6 +3856,21 @@ async function createHonoServer(mastra, options = {
3736
3856
  }),
3737
3857
  healthHandler
3738
3858
  );
3859
+ if (options?.isDev || server?.build?.swaggerUI) {
3860
+ app.get(
3861
+ "/api",
3862
+ describeRoute({
3863
+ description: "API Welcome Page",
3864
+ tags: ["system"],
3865
+ responses: {
3866
+ 200: {
3867
+ description: "Success"
3868
+ }
3869
+ }
3870
+ }),
3871
+ rootHandler
3872
+ );
3873
+ }
3739
3874
  honoServerAdapter.registerAuthMiddleware();
3740
3875
  if (server?.middleware) {
3741
3876
  const normalizedMiddlewares = Array.isArray(server.middleware) ? server.middleware : [server.middleware];
@@ -3775,6 +3910,12 @@ async function createHonoServer(mastra, options = {
3775
3910
  }
3776
3911
  await honoServerAdapter.registerRoutes();
3777
3912
  if (options?.isDev || server?.build?.swaggerUI) {
3913
+ if (!options?.isDev && server?.build?.swaggerUI && !server?.build?.openAPIDocs) {
3914
+ const logger2 = mastra.getLogger();
3915
+ logger2.warn(
3916
+ "Swagger UI is enabled but OpenAPI documentation is disabled. The Swagger UI will not function properly without the OpenAPI endpoint. Please enable openAPIDocs in your server.build configuration:\n server: { build: { swaggerUI: true, openAPIDocs: true } }"
3917
+ );
3918
+ }
3778
3919
  app.get(
3779
3920
  "/swagger-ui",
3780
3921
  describeRoute({
@@ -3841,7 +3982,7 @@ async function createHonoServer(mastra, options = {
3841
3982
  }
3842
3983
  app.get("*", async (c, next) => {
3843
3984
  const requestPath = c.req.path;
3844
- if (requestPath.startsWith("/api/") || requestPath.startsWith("/swagger-ui") || requestPath.startsWith("/openapi.json")) {
3985
+ if (requestPath === "/api" || requestPath.startsWith("/api/") || requestPath.startsWith("/swagger-ui") || requestPath.startsWith("/openapi.json")) {
3845
3986
  return await next();
3846
3987
  }
3847
3988
  if (requestPath.includes(".") && !requestPath.endsWith(".html")) {