@mastra/deployer 1.0.0-beta.10 → 1.0.0-beta.13
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 +36 -0
- package/dist/build/analyze/analyzeEntry.d.ts.map +1 -1
- package/dist/build/analyze/bundleExternals.d.ts +4 -5
- package/dist/build/analyze/bundleExternals.d.ts.map +1 -1
- package/dist/build/analyze.cjs +2 -2
- package/dist/build/analyze.d.ts +2 -2
- package/dist/build/analyze.d.ts.map +1 -1
- package/dist/build/analyze.js +1 -1
- package/dist/build/bundler.cjs +3 -3
- package/dist/build/bundler.d.ts +2 -1
- package/dist/build/bundler.d.ts.map +1 -1
- package/dist/build/bundler.js +1 -1
- package/dist/build/index.cjs +15 -10
- package/dist/build/index.d.ts +1 -0
- package/dist/build/index.d.ts.map +1 -1
- package/dist/build/index.js +4 -3
- package/dist/build/package-info.d.ts +9 -0
- package/dist/build/package-info.d.ts.map +1 -0
- package/dist/build/plugins/node-modules-extension-resolver.d.ts +7 -0
- package/dist/build/plugins/node-modules-extension-resolver.d.ts.map +1 -1
- package/dist/build/utils.d.ts +18 -4
- package/dist/build/utils.d.ts.map +1 -1
- package/dist/build/watcher.d.ts.map +1 -1
- package/dist/bundler/index.cjs +2 -2
- package/dist/bundler/index.d.ts +5 -5
- package/dist/bundler/index.d.ts.map +1 -1
- package/dist/bundler/index.js +1 -1
- package/dist/chunk-24GY667C.cjs +123 -0
- package/dist/chunk-24GY667C.cjs.map +1 -0
- package/dist/{chunk-SS22TD6R.cjs → chunk-3GOE3SL2.cjs} +27 -23
- package/dist/chunk-3GOE3SL2.cjs.map +1 -0
- package/dist/{chunk-5CWPEG6R.js → chunk-HHA2Y3AS.js} +23 -24
- package/dist/chunk-HHA2Y3AS.js.map +1 -0
- package/dist/{chunk-MUWNMVNL.cjs → chunk-KCGBR2X6.cjs} +130 -58
- package/dist/chunk-KCGBR2X6.cjs.map +1 -0
- package/dist/chunk-LENVOSFH.cjs +261 -0
- package/dist/chunk-LENVOSFH.cjs.map +1 -0
- package/dist/chunk-R6O3XWXM.js +249 -0
- package/dist/chunk-R6O3XWXM.js.map +1 -0
- package/dist/{chunk-TK2CCU7I.js → chunk-RGUNHE4Y.js} +111 -40
- package/dist/chunk-RGUNHE4Y.js.map +1 -0
- package/dist/{chunk-X5QU7B2W.js → chunk-SRPOHKWH.js} +6 -76
- package/dist/chunk-SRPOHKWH.js.map +1 -0
- package/dist/{chunk-2OTEFUER.cjs → chunk-VA2CSOKJ.cjs} +24 -24
- package/dist/chunk-VA2CSOKJ.cjs.map +1 -0
- package/dist/{chunk-RBPCXFN7.js → chunk-XTXGU6QF.js} +19 -15
- package/dist/chunk-XTXGU6QF.js.map +1 -0
- package/dist/index.cjs +5 -5
- package/dist/index.js +2 -2
- package/dist/server/index.cjs +40 -23
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +40 -23
- package/dist/server/index.js.map +1 -1
- package/dist/validator/custom-resolver.cjs +2 -2
- package/dist/validator/custom-resolver.js +1 -1
- package/package.json +5 -6
- package/dist/chunk-2OTEFUER.cjs.map +0 -1
- package/dist/chunk-5CWPEG6R.js.map +0 -1
- package/dist/chunk-BFQ2S5UD.cjs +0 -157
- package/dist/chunk-BFQ2S5UD.cjs.map +0 -1
- package/dist/chunk-MUWNMVNL.cjs.map +0 -1
- package/dist/chunk-RBPCXFN7.js.map +0 -1
- package/dist/chunk-SS22TD6R.cjs.map +0 -1
- package/dist/chunk-TK2CCU7I.js.map +0 -1
- package/dist/chunk-UQZGTSBF.js +0 -147
- package/dist/chunk-UQZGTSBF.js.map +0 -1
- package/dist/chunk-X4TNUYQL.cjs +0 -196
- package/dist/chunk-X4TNUYQL.cjs.map +0 -1
- package/dist/chunk-X5QU7B2W.js.map +0 -1
- package/dist/server/handlers/prompt.d.ts +0 -3
- package/dist/server/handlers/prompt.d.ts.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;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGhE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAMA,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;AAInD,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;2CAiShE;AAED,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAmC,mDAqDlG"}
|
package/dist/server/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { normalizeStudioBase } from '../chunk-HHA2Y3AS.js';
|
|
1
2
|
import { readFile } from 'fs/promises';
|
|
2
3
|
import * as https from 'https';
|
|
3
4
|
import { join } from 'path/posix';
|
|
@@ -3515,23 +3516,25 @@ async function createHonoServer(mastra, options = {
|
|
|
3515
3516
|
restartAllActiveWorkflowRunsHandler
|
|
3516
3517
|
);
|
|
3517
3518
|
}
|
|
3519
|
+
const serverOptions = mastra.getServer();
|
|
3520
|
+
const studioBasePath = normalizeStudioBase(serverOptions?.studioBase ?? "/");
|
|
3518
3521
|
if (options?.playground) {
|
|
3519
3522
|
app.get(
|
|
3520
|
-
|
|
3523
|
+
`${studioBasePath}/refresh-events`,
|
|
3521
3524
|
describeRoute({
|
|
3522
3525
|
hide: true
|
|
3523
3526
|
}),
|
|
3524
3527
|
handleClientsRefresh
|
|
3525
3528
|
);
|
|
3526
3529
|
app.post(
|
|
3527
|
-
|
|
3530
|
+
`${studioBasePath}/__refresh`,
|
|
3528
3531
|
describeRoute({
|
|
3529
3532
|
hide: true
|
|
3530
3533
|
}),
|
|
3531
3534
|
handleTriggerClientsRefresh
|
|
3532
3535
|
);
|
|
3533
3536
|
app.get(
|
|
3534
|
-
|
|
3537
|
+
`${studioBasePath}/__hot-reload-status`,
|
|
3535
3538
|
describeRoute({
|
|
3536
3539
|
hide: true
|
|
3537
3540
|
}),
|
|
@@ -3542,48 +3545,61 @@ async function createHonoServer(mastra, options = {
|
|
|
3542
3545
|
});
|
|
3543
3546
|
}
|
|
3544
3547
|
);
|
|
3545
|
-
app.use("/assets/*", async (c, next) => {
|
|
3546
|
-
const path = c.req.path;
|
|
3547
|
-
if (path.endsWith(".js")) {
|
|
3548
|
-
c.header("Content-Type", "application/javascript");
|
|
3549
|
-
} else if (path.endsWith(".css")) {
|
|
3550
|
-
c.header("Content-Type", "text/css");
|
|
3551
|
-
}
|
|
3552
|
-
await next();
|
|
3553
|
-
});
|
|
3554
3548
|
app.use(
|
|
3555
|
-
|
|
3549
|
+
`${studioBasePath}/assets/*`,
|
|
3556
3550
|
serveStatic({
|
|
3557
|
-
root: "./playground/assets"
|
|
3551
|
+
root: "./playground/assets",
|
|
3552
|
+
rewriteRequestPath: (path) => {
|
|
3553
|
+
let rewritten = path;
|
|
3554
|
+
if (studioBasePath && rewritten.startsWith(studioBasePath)) {
|
|
3555
|
+
rewritten = rewritten.slice(studioBasePath.length);
|
|
3556
|
+
}
|
|
3557
|
+
if (rewritten.startsWith("/assets")) {
|
|
3558
|
+
rewritten = rewritten.slice("/assets".length);
|
|
3559
|
+
}
|
|
3560
|
+
return rewritten;
|
|
3561
|
+
}
|
|
3558
3562
|
})
|
|
3559
3563
|
);
|
|
3560
3564
|
}
|
|
3561
3565
|
app.get("*", async (c, next) => {
|
|
3562
|
-
|
|
3566
|
+
const requestPath = c.req.path;
|
|
3567
|
+
if (requestPath.startsWith("/api/") || requestPath.startsWith("/swagger-ui") || requestPath.startsWith("/openapi.json")) {
|
|
3563
3568
|
return await next();
|
|
3564
3569
|
}
|
|
3565
|
-
|
|
3566
|
-
if (path.includes(".") && !path.endsWith(".html")) {
|
|
3570
|
+
if (requestPath.includes(".") && !requestPath.endsWith(".html")) {
|
|
3567
3571
|
return await next();
|
|
3568
3572
|
}
|
|
3569
|
-
|
|
3573
|
+
const isPlaygroundRoute = studioBasePath === "" || requestPath === studioBasePath || requestPath.startsWith(`${studioBasePath}/`);
|
|
3574
|
+
if (options?.playground && isPlaygroundRoute) {
|
|
3570
3575
|
let indexHtml = await readFile(join(process.cwd(), "./playground/index.html"), "utf-8");
|
|
3571
|
-
const serverOptions = mastra.getServer();
|
|
3572
3576
|
const port = serverOptions?.port ?? (Number(process.env.PORT) || 4111);
|
|
3573
3577
|
const hideCloudCta = process.env.MASTRA_HIDE_CLOUD_CTA === "true";
|
|
3574
3578
|
const host = serverOptions?.host ?? "localhost";
|
|
3579
|
+
const key = serverOptions?.https?.key ?? (process.env.MASTRA_HTTPS_KEY ? Buffer.from(process.env.MASTRA_HTTPS_KEY, "base64") : void 0);
|
|
3580
|
+
const cert = serverOptions?.https?.cert ?? (process.env.MASTRA_HTTPS_CERT ? Buffer.from(process.env.MASTRA_HTTPS_CERT, "base64") : void 0);
|
|
3581
|
+
const protocol = key && cert ? "https" : "http";
|
|
3575
3582
|
indexHtml = indexHtml.replace(`'%%MASTRA_SERVER_HOST%%'`, `'${host}'`);
|
|
3576
3583
|
indexHtml = indexHtml.replace(`'%%MASTRA_SERVER_PORT%%'`, `'${port}'`);
|
|
3577
3584
|
indexHtml = indexHtml.replace(`'%%MASTRA_HIDE_CLOUD_CTA%%'`, `'${hideCloudCta}'`);
|
|
3585
|
+
indexHtml = indexHtml.replace(`'%%MASTRA_SERVER_PROTOCOL%%'`, `'${protocol}'`);
|
|
3586
|
+
indexHtml = indexHtml.replaceAll("%%MASTRA_STUDIO_BASE_PATH%%", studioBasePath);
|
|
3578
3587
|
return c.newResponse(indexHtml, 200, { "Content-Type": "text/html" });
|
|
3579
3588
|
}
|
|
3580
3589
|
return c.newResponse(html2, 200, { "Content-Type": "text/html" });
|
|
3581
3590
|
});
|
|
3582
3591
|
if (options?.playground) {
|
|
3592
|
+
const playgroundPath = studioBasePath ? `${studioBasePath}/*` : "*";
|
|
3583
3593
|
app.use(
|
|
3584
|
-
|
|
3594
|
+
playgroundPath,
|
|
3585
3595
|
serveStatic({
|
|
3586
|
-
root: "./playground"
|
|
3596
|
+
root: "./playground",
|
|
3597
|
+
rewriteRequestPath: (path) => {
|
|
3598
|
+
if (studioBasePath && path.startsWith(studioBasePath)) {
|
|
3599
|
+
return path.slice(studioBasePath.length);
|
|
3600
|
+
}
|
|
3601
|
+
return path;
|
|
3602
|
+
}
|
|
3587
3603
|
})
|
|
3588
3604
|
);
|
|
3589
3605
|
}
|
|
@@ -3613,9 +3629,10 @@ async function createNodeServer(mastra, options = { tools: {} }) {
|
|
|
3613
3629
|
},
|
|
3614
3630
|
() => {
|
|
3615
3631
|
const logger2 = mastra.getLogger();
|
|
3616
|
-
logger2.info(` Mastra API running on
|
|
3632
|
+
logger2.info(` Mastra API running on ${protocol}://${host}:${port}/api`);
|
|
3617
3633
|
if (options?.playground) {
|
|
3618
|
-
const
|
|
3634
|
+
const studioBasePath = normalizeStudioBase(serverOptions?.studioBase ?? "/");
|
|
3635
|
+
const studioUrl = `${protocol}://${host}:${port}${studioBasePath}`;
|
|
3619
3636
|
logger2.info(`\u{1F468}\u200D\u{1F4BB} Studio available at ${studioUrl}`);
|
|
3620
3637
|
}
|
|
3621
3638
|
if (process.send) {
|