@mastra/deployer 0.16.4-alpha.2 → 0.17.0-alpha.4

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 (87) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/dist/build/analyze/analyzeEntry.d.ts +33 -0
  3. package/dist/build/analyze/analyzeEntry.d.ts.map +1 -0
  4. package/dist/build/analyze/bundleExternals.d.ts +44 -0
  5. package/dist/build/analyze/bundleExternals.d.ts.map +1 -0
  6. package/dist/build/analyze/constants.d.ts +4 -0
  7. package/dist/build/analyze/constants.d.ts.map +1 -0
  8. package/dist/build/analyze.cjs +2 -6
  9. package/dist/build/analyze.d.ts +9 -24
  10. package/dist/build/analyze.d.ts.map +1 -1
  11. package/dist/build/analyze.js +1 -1
  12. package/dist/build/bundler.cjs +3 -3
  13. package/dist/build/bundler.d.ts +4 -3
  14. package/dist/build/bundler.d.ts.map +1 -1
  15. package/dist/build/bundler.js +1 -1
  16. package/dist/build/index.cjs +12 -12
  17. package/dist/build/index.d.ts +1 -1
  18. package/dist/build/index.js +4 -4
  19. package/dist/build/plugins/pino.d.ts.map +1 -1
  20. package/dist/build/watcher.d.ts +1 -2
  21. package/dist/build/watcher.d.ts.map +1 -1
  22. package/dist/bundler/index.cjs +2 -2
  23. package/dist/bundler/index.d.ts +9 -3
  24. package/dist/bundler/index.d.ts.map +1 -1
  25. package/dist/bundler/index.js +1 -1
  26. package/dist/bundler/workspaceDependencies.d.ts +21 -7
  27. package/dist/bundler/workspaceDependencies.d.ts.map +1 -1
  28. package/dist/{chunk-OUS376P4.cjs → chunk-2JXD2KJI.cjs} +72 -31
  29. package/dist/chunk-2JXD2KJI.cjs.map +1 -0
  30. package/dist/{chunk-PX6ZHD5K.cjs → chunk-4SIOF7ZD.cjs} +5 -5
  31. package/dist/{chunk-PX6ZHD5K.cjs.map → chunk-4SIOF7ZD.cjs.map} +1 -1
  32. package/dist/{chunk-LL2SXZRQ.js → chunk-J3J7AMBG.js} +3 -3
  33. package/dist/{chunk-LL2SXZRQ.js.map → chunk-J3J7AMBG.js.map} +1 -1
  34. package/dist/{chunk-T4L3WY7M.cjs → chunk-M54YPGM4.cjs} +582 -408
  35. package/dist/chunk-M54YPGM4.cjs.map +1 -0
  36. package/dist/{chunk-4CAKOUIN.js → chunk-MIQJS7XN.js} +30 -42
  37. package/dist/chunk-MIQJS7XN.js.map +1 -0
  38. package/dist/{chunk-O7OB4KG5.js → chunk-RZAGSFAM.js} +43 -21
  39. package/dist/chunk-RZAGSFAM.js.map +1 -0
  40. package/dist/{chunk-LN4WTW4C.js → chunk-TWABWFKL.js} +11 -16
  41. package/dist/chunk-TWABWFKL.js.map +1 -0
  42. package/dist/{chunk-ZQJDMTCN.cjs → chunk-YHISSTZJ.cjs} +55 -47
  43. package/dist/chunk-YHISSTZJ.cjs.map +1 -0
  44. package/dist/{chunk-5ZHIZCMJ.js → chunk-YJOKHEUC.js} +575 -401
  45. package/dist/chunk-YJOKHEUC.js.map +1 -0
  46. package/dist/{chunk-JOCAZKZ5.cjs → chunk-YKVNJVGJ.cjs} +15 -20
  47. package/dist/chunk-YKVNJVGJ.cjs.map +1 -0
  48. package/dist/index.cjs +5 -5
  49. package/dist/index.js +2 -2
  50. package/dist/server/handlers/root.d.ts +1 -1
  51. package/dist/server/handlers/root.d.ts.map +1 -1
  52. package/dist/server/index.cjs +154 -8
  53. package/dist/server/index.cjs.map +1 -1
  54. package/dist/server/index.d.ts.map +1 -1
  55. package/dist/server/index.js +135 -8
  56. package/dist/server/index.js.map +1 -1
  57. package/package.json +10 -9
  58. package/dist/build/__fixtures__/no-bundler.d.ts +0 -5
  59. package/dist/build/__fixtures__/no-bundler.d.ts.map +0 -1
  60. package/dist/build/__fixtures__/no-server.d.ts +0 -5
  61. package/dist/build/__fixtures__/no-server.d.ts.map +0 -1
  62. package/dist/build/__fixtures__/no-telemetry.d.ts +0 -5
  63. package/dist/build/__fixtures__/no-telemetry.d.ts.map +0 -1
  64. package/dist/build/plugins/__fixtures__/basic-with-bundler.d.ts +0 -5
  65. package/dist/build/plugins/__fixtures__/basic-with-bundler.d.ts.map +0 -1
  66. package/dist/build/plugins/__fixtures__/basic-with-const.d.ts +0 -5
  67. package/dist/build/plugins/__fixtures__/basic-with-const.d.ts.map +0 -1
  68. package/dist/build/plugins/__fixtures__/basic-with-function.d.ts +0 -5
  69. package/dist/build/plugins/__fixtures__/basic-with-function.d.ts.map +0 -1
  70. package/dist/build/plugins/__fixtures__/basic-with-import.d.ts +0 -5
  71. package/dist/build/plugins/__fixtures__/basic-with-import.d.ts.map +0 -1
  72. package/dist/build/plugins/__fixtures__/basic-with-json.d.ts +0 -3
  73. package/dist/build/plugins/__fixtures__/basic-with-json.d.ts.map +0 -1
  74. package/dist/build/plugins/__fixtures__/basic.d.ts +0 -5
  75. package/dist/build/plugins/__fixtures__/basic.d.ts.map +0 -1
  76. package/dist/build/plugins/__fixtures__/empty-mastra.d.ts +0 -3
  77. package/dist/build/plugins/__fixtures__/empty-mastra.d.ts.map +0 -1
  78. package/dist/build/plugins/__fixtures__/mastra-with-extra-code.d.ts +0 -13
  79. package/dist/build/plugins/__fixtures__/mastra-with-extra-code.d.ts.map +0 -1
  80. package/dist/chunk-4CAKOUIN.js.map +0 -1
  81. package/dist/chunk-5ZHIZCMJ.js.map +0 -1
  82. package/dist/chunk-JOCAZKZ5.cjs.map +0 -1
  83. package/dist/chunk-LN4WTW4C.js.map +0 -1
  84. package/dist/chunk-O7OB4KG5.js.map +0 -1
  85. package/dist/chunk-OUS376P4.cjs.map +0 -1
  86. package/dist/chunk-T4L3WY7M.cjs.map +0 -1
  87. package/dist/chunk-ZQJDMTCN.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,8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E7D,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAuB5B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAGnD,KAAK,QAAQ,GAAG,EAAE,CAAC;AAEnB,KAAK,SAAS,GAAG;IACf,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,cAAc,CAAC;IAC/B,OAAO,EAAE,GAAG,CAAC;QAAE,UAAU,EAAE,+BAA+B,CAAA;KAAE,CAAC,CAAC;IAC9D,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC5B,SAAS,EAAE,iBAAiB,CAAC;IAC7B,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,OAAO,CAAC;IACf,qBAAqB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC9C,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;2CAqgBhE;AAED,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAmC,mDAoDlG"}
@@ -1,5 +1,6 @@
1
1
  import crypto, { randomUUID } from 'crypto';
2
2
  import { readFile } from 'fs/promises';
3
+ import * as https from 'https';
3
4
  import { join } from 'path/posix';
4
5
  import { createServer } from 'http';
5
6
  import { Http2ServerRequest } from 'http2';
@@ -572,8 +573,8 @@ var createAdaptorServer = (options) => {
572
573
  overrideGlobalObjects: options.overrideGlobalObjects,
573
574
  autoCleanupIncoming: options.autoCleanupIncoming
574
575
  });
575
- const createServer$1 = options.createServer || createServer;
576
- const server = createServer$1(options.serverOptions || {}, requestListener);
576
+ const createServer2 = options.createServer || createServer;
577
+ const server = createServer2(options.serverOptions || {}, requestListener);
577
578
  return server;
578
579
  };
579
580
  var serve = (options, listeningListener) => {
@@ -818,7 +819,7 @@ var middleware = (options) => async (c2) => {
818
819
  );
819
820
  };
820
821
 
821
- // ../../node_modules/.pnpm/hono-openapi@0.4.8_hono@4.9.6_openapi-types@12.1.3_zod@3.25.76/node_modules/hono-openapi/utils.js
822
+ // ../../node_modules/.pnpm/hono-openapi@0.4.8_hono@4.9.7_openapi-types@12.1.3_zod@3.25.76/node_modules/hono-openapi/utils.js
822
823
  var e = Symbol("openapi");
823
824
  var n = ["GET", "PUT", "POST", "DELETE", "OPTIONS", "HEAD", "PATCH", "TRACE"];
824
825
  var s2 = (e2) => e2.charAt(0).toUpperCase() + e2.slice(1);
@@ -1310,7 +1311,122 @@ function errorHandler(err, c2, isDev) {
1310
1311
 
1311
1312
  // src/server/handlers/root.ts
1312
1313
  async function rootHandler(c2) {
1313
- return c2.text("Hello to the Mastra API!");
1314
+ const baseUrl = new URL(c2.req.url).origin;
1315
+ return c2.html(
1316
+ /* html */
1317
+ `
1318
+ <!doctype html>
1319
+ <html lang="en">
1320
+ <head>
1321
+ <meta charset="UTF-8" />
1322
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1323
+ <title>Mastra API</title>
1324
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/inter-ui/3.19.3/inter.min.css" />
1325
+ <style>
1326
+ body {
1327
+ margin: 0;
1328
+ padding: 0;
1329
+ background-color: #0d0d0d;
1330
+ color: #ffffff;
1331
+ font-family:
1332
+ 'Inter',
1333
+ -apple-system,
1334
+ BlinkMacSystemFont,
1335
+ system-ui,
1336
+ sans-serif;
1337
+ min-height: 100vh;
1338
+ display: flex;
1339
+ flex-direction: column;
1340
+ }
1341
+
1342
+ main {
1343
+ flex: 1;
1344
+ display: flex;
1345
+ flex-direction: column;
1346
+ align-items: center;
1347
+ justify-content: center;
1348
+ padding: 2rem;
1349
+ text-align: center;
1350
+ }
1351
+
1352
+ h1 {
1353
+ font-size: 4rem;
1354
+ font-weight: 600;
1355
+ margin: 0 0 1rem 0;
1356
+ background: linear-gradient(to right, #fff, #ccc);
1357
+ -webkit-background-clip: text;
1358
+ -webkit-text-fill-color: transparent;
1359
+ line-height: 1.2;
1360
+ }
1361
+
1362
+ .subtitle {
1363
+ color: #9ca3af;
1364
+ font-size: 1.25rem;
1365
+ max-width: 600px;
1366
+ margin: 0 auto 3rem auto;
1367
+ line-height: 1.6;
1368
+ }
1369
+
1370
+ .link {
1371
+ color: #ffffff;
1372
+ }
1373
+
1374
+ .link:hover {
1375
+ text-decoration: none;
1376
+ }
1377
+
1378
+ .docs-link {
1379
+ background-color: #1a1a1a;
1380
+ padding: 1rem 2rem;
1381
+ border-radius: 0.5rem;
1382
+ display: flex;
1383
+ align-items: center;
1384
+ gap: 1rem;
1385
+ font-family: monospace;
1386
+ font-size: 1rem;
1387
+ color: #ffffff;
1388
+ text-decoration: none;
1389
+ transition: background-color 0.2s;
1390
+ }
1391
+
1392
+ .docs-link:hover {
1393
+ background-color: #252525;
1394
+ }
1395
+
1396
+ .arrow-icon {
1397
+ transition: transform 0.2s;
1398
+ }
1399
+
1400
+ .docs-link:hover .arrow-icon {
1401
+ transform: translateX(4px);
1402
+ }
1403
+ </style>
1404
+ </head>
1405
+ <body>
1406
+ <main>
1407
+ <h1>Welcome to the Mastra API</h1>
1408
+ <p class="subtitle">
1409
+ 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>.
1410
+ </p>
1411
+ <a href="${baseUrl}/swagger-ui" target="_blank" class="docs-link">
1412
+ Browse Swagger UI
1413
+ <svg
1414
+ class="arrow-icon"
1415
+ width="20"
1416
+ height="20"
1417
+ viewBox="0 0 24 24"
1418
+ fill="none"
1419
+ stroke="currentColor"
1420
+ strokeWidth="2"
1421
+ >
1422
+ <path d="M5 12h14M12 5l7 7-7 7" />
1423
+ </svg>
1424
+ </a>
1425
+ </main>
1426
+ </body>
1427
+ </html>
1428
+ `
1429
+ );
1314
1430
  }
1315
1431
  async function getAgentBuilderActionsHandler(c2) {
1316
1432
  try {
@@ -11454,19 +11570,30 @@ async function createHonoServer(mastra, options = {
11454
11570
  async function createNodeServer(mastra, options = { tools: {} }) {
11455
11571
  const app = await createHonoServer(mastra, options);
11456
11572
  const serverOptions = mastra.getServer();
11573
+ const key = serverOptions?.https?.key ?? (process.env.MASTRA_HTTPS_KEY ? Buffer.from(process.env.MASTRA_HTTPS_KEY, "base64") : void 0);
11574
+ const cert = serverOptions?.https?.cert ?? (process.env.MASTRA_HTTPS_CERT ? Buffer.from(process.env.MASTRA_HTTPS_CERT, "base64") : void 0);
11575
+ const isHttpsEnabled = Boolean(key && cert);
11576
+ const host = serverOptions?.host ?? "localhost";
11457
11577
  const port = serverOptions?.port ?? (Number(process.env.PORT) || 4111);
11578
+ const protocol = isHttpsEnabled ? "https" : "http";
11458
11579
  const server = serve(
11459
11580
  {
11460
11581
  fetch: app.fetch,
11461
11582
  port,
11462
- hostname: serverOptions?.host
11583
+ hostname: serverOptions?.host,
11584
+ ...isHttpsEnabled ? {
11585
+ createServer: https.createServer,
11586
+ serverOptions: {
11587
+ key,
11588
+ cert
11589
+ }
11590
+ } : {}
11463
11591
  },
11464
11592
  () => {
11465
11593
  const logger2 = mastra.getLogger();
11466
- const host = serverOptions?.host ?? "localhost";
11467
- logger2.info(` Mastra API running on port http://${host}:${port}/api`);
11594
+ logger2.info(` Mastra API running on port ${protocol}://${host}:${port}/api`);
11468
11595
  if (options?.playground) {
11469
- const playgroundUrl = `http://${host}:${port}`;
11596
+ const playgroundUrl = `${protocol}://${host}:${port}`;
11470
11597
  logger2.info(`\u{1F468}\u200D\u{1F4BB} Playground available at ${playgroundUrl}`);
11471
11598
  }
11472
11599
  if (process.send) {