@mastra/deployer 0.0.0-bundle-studio-cloud-20251222034739 → 0.0.0-bundle-version-20260121091645

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 (125) hide show
  1. package/CHANGELOG.md +312 -5
  2. package/dist/build/analyze/analyzeEntry.d.ts.map +1 -1
  3. package/dist/build/analyze.cjs +2 -2
  4. package/dist/build/analyze.d.ts +4 -3
  5. package/dist/build/analyze.d.ts.map +1 -1
  6. package/dist/build/analyze.js +1 -1
  7. package/dist/build/bundler.cjs +3 -3
  8. package/dist/build/bundler.d.ts +2 -1
  9. package/dist/build/bundler.d.ts.map +1 -1
  10. package/dist/build/bundler.js +1 -1
  11. package/dist/build/index.cjs +16 -12
  12. package/dist/build/index.d.ts +2 -1
  13. package/dist/build/index.d.ts.map +1 -1
  14. package/dist/build/index.js +4 -4
  15. package/dist/build/plugins/node-modules-extension-resolver.d.ts.map +1 -1
  16. package/dist/build/plugins/tsconfig-paths.d.ts +1 -1
  17. package/dist/build/plugins/tsconfig-paths.d.ts.map +1 -1
  18. package/dist/build/types.d.ts +13 -0
  19. package/dist/build/types.d.ts.map +1 -1
  20. package/dist/build/utils.d.ts +17 -0
  21. package/dist/build/utils.d.ts.map +1 -1
  22. package/dist/build/watcher.d.ts +2 -1
  23. package/dist/build/watcher.d.ts.map +1 -1
  24. package/dist/bundler/index.cjs +3 -3
  25. package/dist/bundler/index.d.ts +4 -1
  26. package/dist/bundler/index.d.ts.map +1 -1
  27. package/dist/bundler/index.js +1 -1
  28. package/dist/{chunk-HRCR6OKC.cjs → chunk-5IFGGF2Q.cjs} +16 -16
  29. package/dist/chunk-5IFGGF2Q.cjs.map +1 -0
  30. package/dist/{chunk-VA2CSOKJ.cjs → chunk-5TYVF4KJ.cjs} +9 -2
  31. package/dist/chunk-5TYVF4KJ.cjs.map +1 -0
  32. package/dist/{chunk-OVVUJ46G.cjs → chunk-6ITQIDNC.cjs} +18 -20
  33. package/dist/chunk-6ITQIDNC.cjs.map +1 -0
  34. package/dist/{chunk-ONWHS3PA.js → chunk-6VRWO5WR.js} +8 -10
  35. package/dist/chunk-6VRWO5WR.js.map +1 -0
  36. package/dist/{chunk-CRIOGWZD.cjs → chunk-AS55XT3Y.cjs} +93 -37
  37. package/dist/chunk-AS55XT3Y.cjs.map +1 -0
  38. package/dist/{chunk-5HTKP372.js → chunk-DBXWQ2CA.js} +7 -7
  39. package/dist/chunk-DBXWQ2CA.js.map +1 -0
  40. package/dist/{chunk-ESR6AK5N.js → chunk-FH3CFNNS.js} +29 -23
  41. package/dist/chunk-FH3CFNNS.js.map +1 -0
  42. package/dist/{chunk-BDA7RMRF.js → chunk-GX3DPJAT.js} +74 -18
  43. package/dist/chunk-GX3DPJAT.js.map +1 -0
  44. package/dist/{chunk-DMISJICL.cjs → chunk-JRUJ546M.cjs} +7 -7
  45. package/dist/chunk-JRUJ546M.cjs.map +1 -0
  46. package/dist/{chunk-4P2LYC33.js → chunk-MCWU6IKS.js} +3 -3
  47. package/dist/{chunk-4P2LYC33.js.map → chunk-MCWU6IKS.js.map} +1 -1
  48. package/dist/{chunk-HHA2Y3AS.js → chunk-QAOUDKHK.js} +9 -3
  49. package/dist/chunk-QAOUDKHK.js.map +1 -0
  50. package/dist/{chunk-7F6JKGX4.cjs → chunk-RZIZWYXY.cjs} +37 -31
  51. package/dist/chunk-RZIZWYXY.cjs.map +1 -0
  52. package/dist/{chunk-WFIG7I5C.js → chunk-ZJA5AK4R.js} +7 -7
  53. package/dist/chunk-ZJA5AK4R.js.map +1 -0
  54. package/dist/{chunk-54PQDTM3.cjs → chunk-ZXQ7DOYU.cjs} +4 -4
  55. package/dist/{chunk-54PQDTM3.cjs.map → chunk-ZXQ7DOYU.cjs.map} +1 -1
  56. package/dist/default-u_dwuiYb-JPNIZQKK.cjs +9 -0
  57. package/dist/{default-u_dwuiYb-ZNEZWEPC.cjs.map → default-u_dwuiYb-JPNIZQKK.cjs.map} +1 -1
  58. package/dist/default-u_dwuiYb-RK5OD4MY.js +3 -0
  59. package/dist/{default-u_dwuiYb-IKALPRLV.js.map → default-u_dwuiYb-RK5OD4MY.js.map} +1 -1
  60. package/dist/docs/README.md +32 -0
  61. package/dist/docs/SKILL.md +36 -0
  62. package/dist/docs/SOURCE_MAP.json +27 -0
  63. package/dist/docs/deployer/01-reference.md +93 -0
  64. package/dist/docs/deployment/01-overview.md +64 -0
  65. package/dist/docs/deployment/02-mastra-server.md +129 -0
  66. package/dist/docs/deployment/03-monorepo.md +142 -0
  67. package/dist/docs/deployment/04-cloud-providers.md +17 -0
  68. package/dist/docs/deployment/05-web-framework.md +55 -0
  69. package/dist/docs/deployment/06-workflow-runners.md +11 -0
  70. package/dist/{effect-QlVUlMFu-2KN4AWBH.cjs → effect-QlVUlMFu-HN3LWZSQ.cjs} +4 -4
  71. package/dist/{effect-QlVUlMFu-2KN4AWBH.cjs.map → effect-QlVUlMFu-HN3LWZSQ.cjs.map} +1 -1
  72. package/dist/{effect-QlVUlMFu-MWXQUT6S.js → effect-QlVUlMFu-XOJ2F4UA.js} +3 -3
  73. package/dist/{effect-QlVUlMFu-MWXQUT6S.js.map → effect-QlVUlMFu-XOJ2F4UA.js.map} +1 -1
  74. package/dist/{esm-BLVTLTJW.js → esm-6TGK2CUM.js} +3 -3
  75. package/dist/esm-6TGK2CUM.js.map +1 -0
  76. package/dist/{esm-E3NUCNVN.cjs → esm-SQKX5ABS.cjs} +3 -3
  77. package/dist/esm-SQKX5ABS.cjs.map +1 -0
  78. package/dist/index.cjs +4 -4
  79. package/dist/index.js +2 -2
  80. package/dist/server/index.cjs +488 -68
  81. package/dist/server/index.cjs.map +1 -1
  82. package/dist/server/index.d.ts.map +1 -1
  83. package/dist/server/index.js +483 -64
  84. package/dist/server/index.js.map +1 -1
  85. package/dist/server/types.d.ts +1 -1
  86. package/dist/server/types.d.ts.map +1 -1
  87. package/dist/{sury-CWZTCd75-6QYFZXZY.cjs → sury-CWZTCd75-KEHKUXG7.cjs} +4 -4
  88. package/dist/{sury-CWZTCd75-6QYFZXZY.cjs.map → sury-CWZTCd75-KEHKUXG7.cjs.map} +1 -1
  89. package/dist/{sury-CWZTCd75-DAPFEZIA.js → sury-CWZTCd75-L2D76L25.js} +3 -3
  90. package/dist/{sury-CWZTCd75-DAPFEZIA.js.map → sury-CWZTCd75-L2D76L25.js.map} +1 -1
  91. package/dist/{valibot--1zFm7rT-OOWNQW47.cjs → valibot--1zFm7rT-NVADAEQI.cjs} +4 -4
  92. package/dist/{valibot--1zFm7rT-OOWNQW47.cjs.map → valibot--1zFm7rT-NVADAEQI.cjs.map} +1 -1
  93. package/dist/{valibot--1zFm7rT-AASENK42.js → valibot--1zFm7rT-R2UKWLZC.js} +3 -3
  94. package/dist/{valibot--1zFm7rT-AASENK42.js.map → valibot--1zFm7rT-R2UKWLZC.js.map} +1 -1
  95. package/dist/{valibot-D_HTw1Gn-PBXMZJWR.cjs → valibot-D_HTw1Gn-DSFFOUBW.cjs} +4 -4
  96. package/dist/{valibot-D_HTw1Gn-PBXMZJWR.cjs.map → valibot-D_HTw1Gn-DSFFOUBW.cjs.map} +1 -1
  97. package/dist/{valibot-D_HTw1Gn-PCY2UTIB.js → valibot-D_HTw1Gn-KWXWP2TJ.js} +3 -3
  98. package/dist/{valibot-D_HTw1Gn-PCY2UTIB.js.map → valibot-D_HTw1Gn-KWXWP2TJ.js.map} +1 -1
  99. package/dist/validator/custom-resolver.cjs +2 -2
  100. package/dist/validator/custom-resolver.js +1 -1
  101. package/dist/{zod-Bwrt9trS-MTR3E2QO.js → zod-Bwrt9trS-GCUGPBJX.js} +4 -4
  102. package/dist/{zod-Bwrt9trS-MTR3E2QO.js.map → zod-Bwrt9trS-GCUGPBJX.js.map} +1 -1
  103. package/dist/{zod-Bwrt9trS-OXQA54TZ.cjs → zod-Bwrt9trS-ZZHFZ7YQ.cjs} +6 -6
  104. package/dist/{zod-Bwrt9trS-OXQA54TZ.cjs.map → zod-Bwrt9trS-ZZHFZ7YQ.cjs.map} +1 -1
  105. package/dist/{zod-DSgpEGAE-7BIIMWZW.cjs → zod-DSgpEGAE-3CMS4FSB.cjs} +4 -4
  106. package/dist/{zod-DSgpEGAE-7BIIMWZW.cjs.map → zod-DSgpEGAE-3CMS4FSB.cjs.map} +1 -1
  107. package/dist/{zod-DSgpEGAE-UO7OP3J6.js → zod-DSgpEGAE-IPE3O2NQ.js} +3 -3
  108. package/dist/{zod-DSgpEGAE-UO7OP3J6.js.map → zod-DSgpEGAE-IPE3O2NQ.js.map} +1 -1
  109. package/package.json +16 -15
  110. package/dist/chunk-5HTKP372.js.map +0 -1
  111. package/dist/chunk-7F6JKGX4.cjs.map +0 -1
  112. package/dist/chunk-BDA7RMRF.js.map +0 -1
  113. package/dist/chunk-CRIOGWZD.cjs.map +0 -1
  114. package/dist/chunk-DMISJICL.cjs.map +0 -1
  115. package/dist/chunk-ESR6AK5N.js.map +0 -1
  116. package/dist/chunk-HHA2Y3AS.js.map +0 -1
  117. package/dist/chunk-HRCR6OKC.cjs.map +0 -1
  118. package/dist/chunk-ONWHS3PA.js.map +0 -1
  119. package/dist/chunk-OVVUJ46G.cjs.map +0 -1
  120. package/dist/chunk-VA2CSOKJ.cjs.map +0 -1
  121. package/dist/chunk-WFIG7I5C.js.map +0 -1
  122. package/dist/default-u_dwuiYb-IKALPRLV.js +0 -3
  123. package/dist/default-u_dwuiYb-ZNEZWEPC.cjs +0 -9
  124. package/dist/esm-BLVTLTJW.js.map +0 -1
  125. package/dist/esm-E3NUCNVN.cjs.map +0 -1
@@ -0,0 +1,64 @@
1
+ > Learn about different deployment options for your Mastra applications
2
+
3
+ # Deployment Overview
4
+
5
+ Mastra applications can be deployed to any Node.js-compatible environment. You can deploy a Mastra server, integrate with an existing web framework, deploy to cloud providers, or use Mastra Cloud for managed hosting.
6
+
7
+ ## Runtime support
8
+
9
+ Mastra can run against any of these runtime environments:
10
+
11
+ - Node.js `v22.13.0` or later
12
+ - Bun
13
+ - Deno
14
+ - Cloudflare
15
+
16
+ ## Deployment Options
17
+
18
+ ### Mastra Server
19
+
20
+ Mastra provides a [server](https://mastra.ai/docs/server/mastra-server) powered by Hono that can be deployed independently. Use the `mastra build` command to build your application and deploy the output to your preferred VM, container, or PaaS platform.
21
+
22
+ Use this option when you need full control over your infrastructure, long-running processes, or WebSocket connections. The [Mastra server deployment guide](https://mastra.ai/docs/deployment/mastra-server) provides more details.
23
+
24
+ ### Monorepo
25
+
26
+ Deploy a Mastra server as part of a monorepo setup, following the same approach as standalone deployment.
27
+
28
+ Read about [monorepo deployment](https://mastra.ai/docs/deployment/monorepo).
29
+
30
+ ### Cloud Providers
31
+
32
+ Mastra applications can be deployed to cloud providers and serverless platforms. Mastra includes optional built-in deployers for Vercel, Netlify, and Cloudflare to automate the build and deployment process.
33
+
34
+ Use this option for auto-scaling, minimal infrastructure management, or when you're already using one of these platforms.
35
+
36
+ - [Amazon EC2](https://mastra.ai/guides/deployment/amazon-ec2)
37
+ - [AWS Lambda](https://mastra.ai/guides/deployment/aws-lambda)
38
+ - [Azure App Services](https://mastra.ai/guides/deployment/azure-app-services)
39
+ - [Cloudflare](https://mastra.ai/guides/deployment/cloudflare-deployer)
40
+ - [Digital Ocean](https://mastra.ai/guides/deployment/digital-ocean)
41
+ - [Netlify](https://mastra.ai/guides/deployment/netlify-deployer)
42
+ - [Vercel](https://mastra.ai/guides/deployment/vercel-deployer)
43
+
44
+ ### Web Framework
45
+
46
+ When Mastra is integrated with a web framework, it deploys alongside your application using the framework's standard deployment process. The guides below cover framework-specific configuration requirements for deployment.
47
+
48
+ Use these guides when adding Mastra to an existing Next.js or Astro application.
49
+
50
+ - [With Next.js on Vercel](https://mastra.ai/docs/deployment/web-framework#with-nextjs-on-vercel)
51
+ - [With Astro on Vercel](https://mastra.ai/docs/deployment/web-framework#with-astro-on-vercel)
52
+ - [With Astro on Netlify](https://mastra.ai/docs/deployment/web-framework#with-astro-on-netlify)
53
+
54
+ ### Mastra Cloud
55
+
56
+ We're building Mastra Cloud to be the easiest place to deploy and observe your Mastra agents. It's currently in beta.
57
+
58
+ Learn more in the [Mastra Cloud docs](https://mastra.ai/docs/mastra-cloud/overview).
59
+
60
+ ## Workflow Runners
61
+
62
+ Mastra workflows run using the built-in execution engine by default. For production workloads requiring managed infrastructure, workflows can also be deployed to specialized platforms like [Inngest](https://www.inngest.com) that provide step memoization, automatic retries, and real-time monitoring.
63
+
64
+ Visit the [Workflow Runners guide](https://mastra.ai/docs/deployment/workflow-runners) for execution options and the [Inngest deployment guide](https://mastra.ai/guides/deployment/inngest) for setup instructions.
@@ -0,0 +1,129 @@
1
+ > Learn how to build and deploy a Mastra server.
2
+
3
+ # Deploy a Mastra Server
4
+
5
+ Mastra compiles your application into a standalone Node.js server that can run on any platform supporting Node.js, Bun, or Deno.
6
+
7
+ > **Note:**
8
+
9
+ This guide covers deploying the standalone server generated by `mastra build`. If you need to integrate Mastra into an existing Express or Hono application, see [Server Adapters](https://mastra.ai/docs/server/server-adapters) instead.
10
+
11
+ ## Building your application
12
+
13
+ Run the build command from your project root:
14
+
15
+ ```bash
16
+ mastra build
17
+ ```
18
+
19
+ This creates a `.mastra` directory containing your production-ready server.
20
+
21
+ > **Note:**
22
+
23
+ Read the [`mastra build`](https://mastra.ai/reference/cli/mastra#mastra-build) reference for all available flags.
24
+
25
+ ## Build output
26
+
27
+ After building, Mastra creates the following structure:
28
+
29
+ ```
30
+ .mastra/
31
+ ├── .build/ # Intermediate build artifacts (module maps, analysis)
32
+ └── output/
33
+ ├── index.mjs # Server entry point
34
+ ├── mastra.mjs # Your bundled Mastra configuration
35
+ ├── tools.mjs # Aggregated tool exports
36
+ ├── tools/ # Individual tool bundles
37
+ ├── package.json # Production dependencies
38
+ ├── node_modules/ # Installed dependencies
39
+ ├── .npmrc # Copied from your project (if present)
40
+ ├── public/ # Static assets (if src/mastra/public exists)
41
+ └── playground/ # Studio UI (if --studio flag used)
42
+ ```
43
+
44
+ The `output` directory is self-contained. You can copy it to any server and run it directly.
45
+
46
+ ## Running the server
47
+
48
+ Start the server using the Mastra CLI:
49
+
50
+ ```bash
51
+ mastra start
52
+ ```
53
+
54
+ Or run directly with Node.js:
55
+
56
+ ```bash
57
+ node .mastra/output/index.mjs
58
+ ```
59
+
60
+ The `mastra start` command provides additional features:
61
+ - Loads environment variables from `.env.production` and `.env`
62
+ - Provides helpful error messages for missing modules
63
+ - Handles process signals for graceful shutdown
64
+
65
+ > **Note:**
66
+
67
+ Read the [`mastra start`](https://mastra.ai/reference/cli/mastra#mastra-start) reference for all available flags.
68
+
69
+ ## Build configuration
70
+
71
+ ### Public folder
72
+
73
+ If a `public` folder exists in your Mastra directory (`src/mastra/public`), its contents are copied to the output directory during build. These files are served as static assets by the server.
74
+
75
+ ### Mastra configuration
76
+
77
+ The build process respects configuration in your Mastra instance. For server behavior like CORS, timeouts, and middleware, see [server overview](https://mastra.ai/docs/server/mastra-server). For all available options, see the [configuration reference](https://mastra.ai/reference/configuration).
78
+
79
+ ## Build process
80
+
81
+ The build follows these steps:
82
+
83
+ 1. **Locates entry file**: Finds `index.ts` or `index.js` in your Mastra directory.
84
+ 2. **Discovers tools**: Scans for tool files matching `{mastraDir}/tools/**/*.{js,ts}`, excluding test files.
85
+ 3. **Analyzes dependencies**: Determines which packages to bundle vs. install externally.
86
+ 4. **Bundles code**: Uses Rollup with tree-shaking and optional source maps.
87
+ 5. **Generates server**: Creates a Hono-based HTTP server as `index.mjs`.
88
+ 6. **Installs dependencies**: Runs `npm install` in the output directory.
89
+ 7. **Copies assets**: Copies `public` folder and `.npmrc` if present.
90
+
91
+ ## Environment variables
92
+
93
+ | Variable | Description |
94
+ |----------|-------------|
95
+ | `PORT` | Server port (default: `4111`) |
96
+ | `MASTRA_STUDIO_PATH` | Path to Studio build directory (default: `./playground`) |
97
+ | `MASTRA_SKIP_DOTENV` | Skip loading `.env` files when set |
98
+ | `NODE_OPTIONS` | Node.js options (e.g., `--max-old-space-size=4096` for build memory issues) |
99
+
100
+ ## Server endpoints
101
+
102
+ The built server exposes endpoints for health checks, agents, workflows, and more:
103
+
104
+ | Endpoint | Description |
105
+ |----------|-------------|
106
+ | `GET /health` | Health check endpoint, returns `200 OK` |
107
+ | `GET /openapi.json` | OpenAPI specification (if `server.build.openAPIDocs` is enabled) |
108
+ | `GET /swagger-ui` | Interactive API documentation (if `server.build.swaggerUI` is enabled) |
109
+
110
+ This list is not exhaustive. To view all endpoints, run `mastra dev` and visit `http://localhost:4111/swagger-ui`.
111
+
112
+ To add your own endpoints, see [Custom API Routes](https://mastra.ai/docs/server/custom-api-routes).
113
+
114
+ ## Troubleshooting
115
+
116
+ ### Memory errors during build
117
+
118
+ If you encounter `JavaScript heap out of memory` errors:
119
+
120
+ ```bash
121
+ NODE_OPTIONS="--max-old-space-size=4096" mastra build
122
+ ```
123
+
124
+ ## Related
125
+
126
+ - [Server Overview](https://mastra.ai/docs/server/mastra-server) - Configure server behavior, middleware, and authentication
127
+ - [Server Adapters](https://mastra.ai/docs/server/server-adapters) - Use Express or Hono instead of `mastra build`
128
+ - [Custom API Routes](https://mastra.ai/docs/server/custom-api-routes) - Add custom HTTP endpoints
129
+ - [Configuration Reference](https://mastra.ai/reference/configuration) - Full configuration options
@@ -0,0 +1,142 @@
1
+ > Learn how to deploy Mastra applications that are part of a monorepo setup
2
+
3
+ # Deploy in a Monorepo
4
+
5
+ Deploying Mastra in a monorepo follows the same process as a standalone application. This guide covers monorepo-specific considerations. For the core build and deployment steps, see [Deploy a Mastra Server](https://mastra.ai/docs/deployment/mastra-server).
6
+
7
+ ## Supported monorepos
8
+
9
+ Mastra works with:
10
+
11
+ - npm workspaces
12
+ - pnpm workspaces
13
+ - Yarn workspaces
14
+ - Turborepo
15
+
16
+ Known limitations:
17
+
18
+ - Bun workspaces - partial support; known issues
19
+ - Nx - You can use Nx's [supported dependency strategies](https://nx.dev/concepts/decisions/dependency-management) but you need to have `package.json` files inside your workspace packages
20
+
21
+ ## Example structure
22
+
23
+ In this example, the Mastra application is located at `apps/api`:
24
+
25
+ ```
26
+ apps/
27
+ ├── api/
28
+ │ ├── src/
29
+ │ │ └── mastra/
30
+ │ │ ├── agents/
31
+ │ │ ├── tools/
32
+ │ │ ├── workflows/
33
+ │ │ └── index.ts
34
+ │ ├── package.json
35
+ │ └── tsconfig.json
36
+ └── web/
37
+ packages/
38
+ ├── ui/
39
+ └── utils/
40
+ package.json
41
+ ```
42
+
43
+ ## Building from a monorepo
44
+
45
+ Use your monorepo tool to run the build command from the correct package. There's no need for special flags.
46
+
47
+ Examples:
48
+
49
+ **npm:**
50
+
51
+ ```bash
52
+ npm run build --workspace=apps/api
53
+ ```
54
+
55
+ **pnpm:**
56
+
57
+ ```bash
58
+ pnpm --filter api run build
59
+ ```
60
+
61
+ **yarn:**
62
+
63
+ ```bash
64
+ yarn workspace api build
65
+ ```
66
+
67
+ **turborepo:**
68
+
69
+ ```bash
70
+ turbo run build --filter=api
71
+ ```
72
+
73
+ Your package's `build` script should run `mastra build`:
74
+
75
+ ```json title="apps/api/package.json"
76
+ {
77
+ "scripts": {
78
+ "build": "mastra build"
79
+ }
80
+ }
81
+ ```
82
+
83
+ ## Workspace packages
84
+
85
+ When your Mastra application imports from other workspace packages, Mastra handles this automatically:
86
+
87
+ - If the package is pre-compiled (e.g., built with `tsc` or `tsdown`), Mastra imports the compiled JavaScript
88
+ - If the package contains uncompiled TypeScript, Mastra transpiles it during the build
89
+
90
+ For most setups, this works without configuration. If you encounter issues with workspace package imports, add the package to [`transpilePackages`](https://mastra.ai/reference/configuration#bundlertranspilepackages):
91
+
92
+ ```typescript title="src/mastra/index.ts"
93
+ export const mastra = new Mastra({
94
+ bundler: {
95
+ transpilePackages: ["@my-org/utils"],
96
+ },
97
+ });
98
+ ```
99
+
100
+ ## Environment variables
101
+
102
+ Store `.env` files in the Mastra application directory (e.g., `apps/api/.env`), not the monorepo root.
103
+
104
+ ## Deployment configuration
105
+
106
+ When deploying to cloud providers, ensure the correct package is selected as the deploy target. Selecting the monorepo root instead of the application directory (e.g., `apps/api`) is a common mistake.
107
+
108
+ Most providers let you specify the root directory in their dashboard or configuration file.
109
+
110
+ ### Mastra Cloud
111
+
112
+ The image below shows how to select `apps/api` as the project root when deploying to [Mastra Cloud](https://mastra.ai/docs/mastra-cloud/overview). While the interface may differ between providers, the configuration remains the same.
113
+
114
+ ![Deployment configuration](/img/monorepo/monorepo-mastra-cloud.jpg)
115
+
116
+ ## Dependency management
117
+
118
+ Keep dependencies consistent to avoid version conflicts and build errors:
119
+
120
+ - Use a **single lockfile** at the monorepo root so all packages resolve the same versions
121
+ - Align versions of **shared libraries** (like Mastra or frameworks) to prevent duplicates
122
+
123
+ ## Troubleshooting
124
+
125
+ ### Workspace package not found
126
+
127
+ If Mastra can't resolve a workspace package, ensure:
128
+ - The package is listed in your `package.json` dependencies
129
+ - Your lockfile is up to date (`pnpm install`, `npm install`, etc.)
130
+ - The package has a valid `main` or `exports` field in its `package.json`
131
+
132
+ ### TypeScript errors from workspace packages
133
+
134
+ If you see type errors from uncompiled workspace packages, either:
135
+ - Build the package first (recommended for faster Mastra builds)
136
+ - Add the package to [`transpilePackages`](https://mastra.ai/reference/configuration#bundlertranspilepackages) in your Mastra config
137
+
138
+ ## Related
139
+
140
+ - [Deploy a Mastra Server](https://mastra.ai/docs/deployment/mastra-server) - Core build and deployment guide
141
+ - [Configuration Reference](https://mastra.ai/reference/configuration) - `bundler.transpilePackages` and other options
142
+ - [CLI Reference](https://mastra.ai/reference/cli/mastra) - Build command flags
@@ -0,0 +1,17 @@
1
+ > Deploy your Mastra applications to cloud providers
2
+
3
+ # Deploy to Cloud Providers
4
+
5
+ Mastra applications can be deployed to cloud providers and serverless platforms. Mastra includes optional built-in deployers for Vercel, Netlify, and Cloudflare to automate the deployment process.
6
+
7
+ ## Supported Cloud Providers
8
+
9
+ The following guides show how to deploy Mastra to specific cloud providers:
10
+
11
+ - [Amazon EC2](https://mastra.ai/guides/deployment/amazon-ec2)
12
+ - [AWS Lambda](https://mastra.ai/guides/deployment/aws-lambda)
13
+ - [Azure App Services](https://mastra.ai/guides/deployment/azure-app-services)
14
+ - [Cloudflare](https://mastra.ai/guides/deployment/cloudflare-deployer)
15
+ - [Digital Ocean](https://mastra.ai/guides/deployment/digital-ocean)
16
+ - [Netlify](https://mastra.ai/guides/deployment/netlify-deployer)
17
+ - [Vercel](https://mastra.ai/guides/deployment/vercel-deployer)
@@ -0,0 +1,55 @@
1
+ > Learn how Mastra can be deployed when integrated with a Web Framework
2
+
3
+ # Deploy with a Web Framework
4
+
5
+ When Mastra is integrated with a web framework, it deploys alongside your application using the framework's standard deployment process. Follow the instructions below to ensure your Mastra integration deploys correctly.
6
+
7
+ > **Note:**
8
+ If you're deploying to a cloud provider, remove any usage of [LibSQLStore](https://mastra.ai/reference/storage/libsql) from your Mastra configuration. LibSQLStore requires filesystem access and is not compatible with serverless platforms.
9
+
10
+ Integration guides:
11
+
12
+ - [With Next.js](https://mastra.ai/guides/getting-started/next-js)
13
+ - [With Astro](https://mastra.ai/guides/getting-started/astro)
14
+
15
+ ## With Next.js on Vercel
16
+
17
+ If you've integrated Mastra with Next.js [by following our guide](https://mastra.ai/guides/getting-started/next-js) and plan to deploy to Vercel, add `serverExternalPackages: ["@mastra/*"]` to your `next.config.ts`:
18
+
19
+ ```typescript {4} title="next.config.ts"
20
+ import type { NextConfig } from "next";
21
+
22
+ const nextConfig: NextConfig = {
23
+ serverExternalPackages: ["@mastra/*"],
24
+ };
25
+
26
+ export default nextConfig;
27
+ ```
28
+
29
+ ## With Astro on Vercel
30
+
31
+ If you've integrated Mastra with Astro [by following our guide](https://mastra.ai/guides/getting-started/astro) and plan to deploy to Vercel, add the Vercel adapter and server output to your `astro.config.mjs`:
32
+
33
+ ```javascript {2,5-6} title="astro.config.mjs"
34
+ import { defineConfig } from "astro/config";
35
+ import vercel from "@astrojs/vercel";
36
+
37
+ export default defineConfig({
38
+ adapter: vercel(),
39
+ output: "server",
40
+ });
41
+ ```
42
+
43
+ ## With Astro on Netlify
44
+
45
+ If you've integrated Mastra with Astro [by following our guide](https://mastra.ai/guides/getting-started/astro) and plan to deploy to Netlify, add the Netlify adapter and server output to your `astro.config.mjs`:
46
+
47
+ ```javascript {2,5-6} title="astro.config.mjs"
48
+ import { defineConfig } from "astro/config";
49
+ import netlify from "@astrojs/netlify";
50
+
51
+ export default defineConfig({
52
+ adapter: netlify(),
53
+ output: "server",
54
+ });
55
+ ```
@@ -0,0 +1,11 @@
1
+ > Deploy Mastra workflows to specialized workflow execution platforms
2
+
3
+ # Workflow Runners
4
+
5
+ Mastra [workflows](../workflows/overview.mdx) can be executed using the built-in workflow runner or deployed to specialized workflow execution platforms that handle orchestration, monitoring, and reliability.
6
+
7
+ ## Inngest
8
+
9
+ Inngest is a developer platform for running background workflows without managing infrastructure. Mastra workflows can be deployed to Inngest, which provides step memoization, automatic retries, real-time monitoring, and suspend/resume capabilities.
10
+
11
+ Visit the [Inngest deployment guide](https://mastra.ai/guides/deployment/inngest) for setup instructions and the [Inngest workflow example](https://github.com/mastra-ai/mastra/tree/main/examples/inngest) for a complete implementation.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkDMISJICL_cjs = require('./chunk-DMISJICL.cjs');
3
+ var chunkJRUJ546M_cjs = require('./chunk-JRUJ546M.cjs');
4
4
 
5
5
  // ../../node_modules/.pnpm/@standard-community+standard-json@0.3.5_@standard-schema+spec@1.1.0_@types+json-schema@_d6df1f0b22bbb764c4c0abc17f6c5d32/node_modules/@standard-community/standard-json/dist/effect-QlVUlMFu.js
6
6
  async function getToJsonSchemaFn() {
@@ -8,10 +8,10 @@ async function getToJsonSchemaFn() {
8
8
  const { JSONSchema } = await import('effect');
9
9
  return (schema) => JSONSchema.make(schema);
10
10
  } catch {
11
- throw new chunkDMISJICL_cjs.MissingDependencyError("effect");
11
+ throw new chunkJRUJ546M_cjs.MissingDependencyError("effect");
12
12
  }
13
13
  }
14
14
 
15
15
  module.exports = getToJsonSchemaFn;
16
- //# sourceMappingURL=effect-QlVUlMFu-2KN4AWBH.cjs.map
17
- //# sourceMappingURL=effect-QlVUlMFu-2KN4AWBH.cjs.map
16
+ //# sourceMappingURL=effect-QlVUlMFu-HN3LWZSQ.cjs.map
17
+ //# sourceMappingURL=effect-QlVUlMFu-HN3LWZSQ.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../node_modules/.pnpm/@standard-community+standard-json@0.3.5_@standard-schema+spec@1.1.0_@types+json-schema@_d6df1f0b22bbb764c4c0abc17f6c5d32/node_modules/@standard-community/standard-json/dist/effect-QlVUlMFu.js"],"names":["MissingDependencyError"],"mappings":";;;;;AAGA,eAAe,iBAAA,GAAoB;AACjC,EAAA,IAAI;AACF,IAAA,MAAM,EAAE,UAAA,EAAW,GAAI,MAAM,OAAO,QAAQ,CAAA;AAC5C,IAAA,OAAO,CAAC,MAAA,KAAW,UAAA,CAAW,IAAA,CAAK,MAAM,CAAA;AAAA,EAC3C,CAAA,CAAA,MAAQ;AACN,IAAA,MAAM,IAAIA,yCAAuB,QAAQ,CAAA;AAAA,EAC3C;AACF","file":"effect-QlVUlMFu-2KN4AWBH.cjs","sourcesContent":["import { M as MissingDependencyError } from './index-CLddUTqr.js';\nimport 'quansync';\n\nasync function getToJsonSchemaFn() {\n try {\n const { JSONSchema } = await import('effect');\n return (schema) => JSONSchema.make(schema);\n } catch {\n throw new MissingDependencyError(\"effect\");\n }\n}\n\nexport { getToJsonSchemaFn as default };\n"]}
1
+ {"version":3,"sources":["../../../node_modules/.pnpm/@standard-community+standard-json@0.3.5_@standard-schema+spec@1.1.0_@types+json-schema@_d6df1f0b22bbb764c4c0abc17f6c5d32/node_modules/@standard-community/standard-json/dist/effect-QlVUlMFu.js"],"names":["MissingDependencyError"],"mappings":";;;;;AAGA,eAAe,iBAAA,GAAoB;AACjC,EAAA,IAAI;AACF,IAAA,MAAM,EAAE,UAAA,EAAW,GAAI,MAAM,OAAO,QAAQ,CAAA;AAC5C,IAAA,OAAO,CAAC,MAAA,KAAW,UAAA,CAAW,IAAA,CAAK,MAAM,CAAA;AAAA,EAC3C,CAAA,CAAA,MAAQ;AACN,IAAA,MAAM,IAAIA,yCAAuB,QAAQ,CAAA;AAAA,EAC3C;AACF","file":"effect-QlVUlMFu-HN3LWZSQ.cjs","sourcesContent":["import { M as MissingDependencyError } from './index-CLddUTqr.js';\nimport 'quansync';\n\nasync function getToJsonSchemaFn() {\n try {\n const { JSONSchema } = await import('effect');\n return (schema) => JSONSchema.make(schema);\n } catch {\n throw new MissingDependencyError(\"effect\");\n }\n}\n\nexport { getToJsonSchemaFn as default };\n"]}
@@ -1,4 +1,4 @@
1
- import { MissingDependencyError } from './chunk-5HTKP372.js';
1
+ import { MissingDependencyError } from './chunk-DBXWQ2CA.js';
2
2
 
3
3
  // ../../node_modules/.pnpm/@standard-community+standard-json@0.3.5_@standard-schema+spec@1.1.0_@types+json-schema@_d6df1f0b22bbb764c4c0abc17f6c5d32/node_modules/@standard-community/standard-json/dist/effect-QlVUlMFu.js
4
4
  async function getToJsonSchemaFn() {
@@ -11,5 +11,5 @@ async function getToJsonSchemaFn() {
11
11
  }
12
12
 
13
13
  export { getToJsonSchemaFn as default };
14
- //# sourceMappingURL=effect-QlVUlMFu-MWXQUT6S.js.map
15
- //# sourceMappingURL=effect-QlVUlMFu-MWXQUT6S.js.map
14
+ //# sourceMappingURL=effect-QlVUlMFu-XOJ2F4UA.js.map
15
+ //# sourceMappingURL=effect-QlVUlMFu-XOJ2F4UA.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../node_modules/.pnpm/@standard-community+standard-json@0.3.5_@standard-schema+spec@1.1.0_@types+json-schema@_d6df1f0b22bbb764c4c0abc17f6c5d32/node_modules/@standard-community/standard-json/dist/effect-QlVUlMFu.js"],"names":[],"mappings":";;;AAGA,eAAe,iBAAA,GAAoB;AACjC,EAAA,IAAI;AACF,IAAA,MAAM,EAAE,UAAA,EAAW,GAAI,MAAM,OAAO,QAAQ,CAAA;AAC5C,IAAA,OAAO,CAAC,MAAA,KAAW,UAAA,CAAW,IAAA,CAAK,MAAM,CAAA;AAAA,EAC3C,CAAA,CAAA,MAAQ;AACN,IAAA,MAAM,IAAI,uBAAuB,QAAQ,CAAA;AAAA,EAC3C;AACF","file":"effect-QlVUlMFu-MWXQUT6S.js","sourcesContent":["import { M as MissingDependencyError } from './index-CLddUTqr.js';\nimport 'quansync';\n\nasync function getToJsonSchemaFn() {\n try {\n const { JSONSchema } = await import('effect');\n return (schema) => JSONSchema.make(schema);\n } catch {\n throw new MissingDependencyError(\"effect\");\n }\n}\n\nexport { getToJsonSchemaFn as default };\n"]}
1
+ {"version":3,"sources":["../../../node_modules/.pnpm/@standard-community+standard-json@0.3.5_@standard-schema+spec@1.1.0_@types+json-schema@_d6df1f0b22bbb764c4c0abc17f6c5d32/node_modules/@standard-community/standard-json/dist/effect-QlVUlMFu.js"],"names":[],"mappings":";;;AAGA,eAAe,iBAAA,GAAoB;AACjC,EAAA,IAAI;AACF,IAAA,MAAM,EAAE,UAAA,EAAW,GAAI,MAAM,OAAO,QAAQ,CAAA;AAC5C,IAAA,OAAO,CAAC,MAAA,KAAW,UAAA,CAAW,IAAA,CAAK,MAAM,CAAA;AAAA,EAC3C,CAAA,CAAA,MAAQ;AACN,IAAA,MAAM,IAAI,uBAAuB,QAAQ,CAAA;AAAA,EAC3C;AACF","file":"effect-QlVUlMFu-XOJ2F4UA.js","sourcesContent":["import { M as MissingDependencyError } from './index-CLddUTqr.js';\nimport 'quansync';\n\nasync function getToJsonSchemaFn() {\n try {\n const { JSONSchema } = await import('effect');\n return (schema) => JSONSchema.make(schema);\n } catch {\n throw new MissingDependencyError(\"effect\");\n }\n}\n\nexport { getToJsonSchemaFn as default };\n"]}
@@ -1,7 +1,7 @@
1
1
  import { ZodFirstPartyTypeKind } from 'zod';
2
2
 
3
3
  // ../../node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Options.js
4
- var ignoreOverride = Symbol("Let zodToJsonSchema decide on which parser to use");
4
+ var ignoreOverride = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use");
5
5
  var jsonDescription = (jsonSchema, def) => {
6
6
  if (def.description) {
7
7
  try {
@@ -1285,5 +1285,5 @@ var zodToJsonSchema = (schema, options) => {
1285
1285
  var esm_default = zodToJsonSchema;
1286
1286
 
1287
1287
  export { addErrorMessage, esm_default as default, defaultOptions, getDefaultOptions, getRefs, getRelativePath, ignoreOverride, jsonDescription, parseAnyDef, parseArrayDef, parseBigintDef, parseBooleanDef, parseBrandedDef, parseCatchDef, parseDateDef, parseDef, parseDefaultDef, parseEffectsDef, parseEnumDef, parseIntersectionDef, parseLiteralDef, parseMapDef, parseNativeEnumDef, parseNeverDef, parseNullDef, parseNullableDef, parseNumberDef, parseObjectDef, parseOptionalDef, parsePipelineDef, parsePromiseDef, parseReadonlyDef, parseRecordDef, parseSetDef, parseStringDef, parseTupleDef, parseUndefinedDef, parseUnionDef, parseUnknownDef, primitiveMappings, selectParser, setResponseValueAndErrors, zodPatterns, zodToJsonSchema };
1288
- //# sourceMappingURL=esm-BLVTLTJW.js.map
1289
- //# sourceMappingURL=esm-BLVTLTJW.js.map
1288
+ //# sourceMappingURL=esm-6TGK2CUM.js.map
1289
+ //# sourceMappingURL=esm-6TGK2CUM.js.map