@mastra/deployer 0.0.0-bundle-recursion-20251030002519 → 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 (250) hide show
  1. package/CHANGELOG.md +1261 -5
  2. package/dist/arktype-aI7TBD0R-CCZH3EYK.js +8 -0
  3. package/dist/arktype-aI7TBD0R-CCZH3EYK.js.map +1 -0
  4. package/dist/arktype-aI7TBD0R-XHBHUL3T.cjs +10 -0
  5. package/dist/arktype-aI7TBD0R-XHBHUL3T.cjs.map +1 -0
  6. package/dist/build/analyze/analyzeEntry.d.ts +4 -1
  7. package/dist/build/analyze/analyzeEntry.d.ts.map +1 -1
  8. package/dist/build/analyze/bundleExternals.d.ts +4 -5
  9. package/dist/build/analyze/bundleExternals.d.ts.map +1 -1
  10. package/dist/build/analyze/constants.d.ts.map +1 -1
  11. package/dist/build/analyze.cjs +2 -2
  12. package/dist/build/analyze.d.ts +6 -6
  13. package/dist/build/analyze.d.ts.map +1 -1
  14. package/dist/build/analyze.js +1 -1
  15. package/dist/build/babel/remove-deployer.d.ts.map +1 -1
  16. package/dist/build/bundler.cjs +3 -3
  17. package/dist/build/bundler.d.ts +3 -1
  18. package/dist/build/bundler.d.ts.map +1 -1
  19. package/dist/build/bundler.js +1 -1
  20. package/dist/build/bundlerOptions.d.ts.map +1 -1
  21. package/dist/build/deployer.d.ts.map +1 -1
  22. package/dist/build/index.cjs +22 -13
  23. package/dist/build/index.d.ts +2 -0
  24. package/dist/build/index.d.ts.map +1 -1
  25. package/dist/build/index.js +5 -4
  26. package/dist/build/package-info.d.ts +9 -0
  27. package/dist/build/package-info.d.ts.map +1 -0
  28. package/dist/build/plugins/esm-shim.d.ts +14 -0
  29. package/dist/build/plugins/esm-shim.d.ts.map +1 -0
  30. package/dist/build/plugins/module-resolve-map.d.ts +3 -0
  31. package/dist/build/plugins/module-resolve-map.d.ts.map +1 -0
  32. package/dist/build/plugins/node-gyp-detector.d.ts +3 -0
  33. package/dist/build/plugins/node-gyp-detector.d.ts.map +1 -0
  34. package/dist/build/plugins/node-modules-extension-resolver.d.ts +7 -0
  35. package/dist/build/plugins/node-modules-extension-resolver.d.ts.map +1 -1
  36. package/dist/build/plugins/remove-all-except.d.ts +10 -0
  37. package/dist/build/plugins/remove-all-except.d.ts.map +1 -0
  38. package/dist/build/plugins/subpath-externals-resolver.d.ts +3 -0
  39. package/dist/build/plugins/subpath-externals-resolver.d.ts.map +1 -0
  40. package/dist/build/plugins/tsconfig-paths.d.ts +8 -0
  41. package/dist/build/plugins/tsconfig-paths.d.ts.map +1 -1
  42. package/dist/build/serverOptions.d.ts.map +1 -1
  43. package/dist/build/shared/extract-mastra-option.d.ts +4 -8
  44. package/dist/build/shared/extract-mastra-option.d.ts.map +1 -1
  45. package/dist/build/types.d.ts +18 -0
  46. package/dist/build/types.d.ts.map +1 -1
  47. package/dist/build/utils.d.ts +36 -4
  48. package/dist/build/utils.d.ts.map +1 -1
  49. package/dist/build/watcher.d.ts +2 -1
  50. package/dist/build/watcher.d.ts.map +1 -1
  51. package/dist/bundler/index.cjs +6 -2
  52. package/dist/bundler/index.d.ts +13 -9
  53. package/dist/bundler/index.d.ts.map +1 -1
  54. package/dist/bundler/index.js +1 -1
  55. package/dist/chunk-2VG357HT.cjs +4 -0
  56. package/dist/chunk-2VG357HT.cjs.map +1 -0
  57. package/dist/chunk-5IFGGF2Q.cjs +112 -0
  58. package/dist/chunk-5IFGGF2Q.cjs.map +1 -0
  59. package/dist/chunk-5TYVF4KJ.cjs +76 -0
  60. package/dist/chunk-5TYVF4KJ.cjs.map +1 -0
  61. package/dist/{chunk-QOMQKAKY.cjs → chunk-6ITQIDNC.cjs} +77 -31
  62. package/dist/chunk-6ITQIDNC.cjs.map +1 -0
  63. package/dist/{chunk-ZIBSZS2J.js → chunk-6VRWO5WR.js} +70 -24
  64. package/dist/chunk-6VRWO5WR.js.map +1 -0
  65. package/dist/{chunk-JCACPNJQ.cjs → chunk-AS55XT3Y.cjs} +886 -365
  66. package/dist/chunk-AS55XT3Y.cjs.map +1 -0
  67. package/dist/chunk-DBXWQ2CA.js +159 -0
  68. package/dist/chunk-DBXWQ2CA.js.map +1 -0
  69. package/dist/{chunk-5QFG6SCM.js → chunk-DPDWM7HQ.js} +2 -2
  70. package/dist/chunk-DPDWM7HQ.js.map +1 -0
  71. package/dist/{chunk-L6Z4LACC.js → chunk-FH3CFNNS.js} +77 -39
  72. package/dist/chunk-FH3CFNNS.js.map +1 -0
  73. package/dist/chunk-G6GFAPPU.js +6 -0
  74. package/dist/chunk-G6GFAPPU.js.map +1 -0
  75. package/dist/{chunk-65RQUN2A.js → chunk-GX3DPJAT.js} +873 -352
  76. package/dist/chunk-GX3DPJAT.js.map +1 -0
  77. package/dist/chunk-HPGDVJAZ.js +3 -0
  78. package/dist/chunk-HPGDVJAZ.js.map +1 -0
  79. package/dist/chunk-JBE6KM7R.cjs +95 -0
  80. package/dist/chunk-JBE6KM7R.cjs.map +1 -0
  81. package/dist/chunk-JRUJ546M.cjs +162 -0
  82. package/dist/chunk-JRUJ546M.cjs.map +1 -0
  83. package/dist/{chunk-3JYRSECU.cjs → chunk-JVBCN3RH.cjs} +4 -4
  84. package/dist/chunk-JVBCN3RH.cjs.map +1 -0
  85. package/dist/chunk-KE4NVPI4.cjs +8 -0
  86. package/dist/chunk-KE4NVPI4.cjs.map +1 -0
  87. package/dist/chunk-MCWU6IKS.js +14 -0
  88. package/dist/chunk-MCWU6IKS.js.map +1 -0
  89. package/dist/chunk-QAOUDKHK.js +67 -0
  90. package/dist/chunk-QAOUDKHK.js.map +1 -0
  91. package/dist/{chunk-HS4XRPI7.cjs → chunk-RZIZWYXY.cjs} +83 -44
  92. package/dist/chunk-RZIZWYXY.cjs.map +1 -0
  93. package/dist/chunk-V4HCIN6G.js +93 -0
  94. package/dist/chunk-V4HCIN6G.js.map +1 -0
  95. package/dist/chunk-ZJA5AK4R.js +88 -0
  96. package/dist/chunk-ZJA5AK4R.js.map +1 -0
  97. package/dist/chunk-ZXQ7DOYU.cjs +16 -0
  98. package/dist/chunk-ZXQ7DOYU.cjs.map +1 -0
  99. package/dist/default-u_dwuiYb-JPNIZQKK.cjs +9 -0
  100. package/dist/default-u_dwuiYb-JPNIZQKK.cjs.map +1 -0
  101. package/dist/default-u_dwuiYb-RK5OD4MY.js +3 -0
  102. package/dist/default-u_dwuiYb-RK5OD4MY.js.map +1 -0
  103. package/dist/deploy/log.d.ts +1 -1
  104. package/dist/deploy/log.d.ts.map +1 -1
  105. package/dist/docs/README.md +32 -0
  106. package/dist/docs/SKILL.md +36 -0
  107. package/dist/docs/SOURCE_MAP.json +27 -0
  108. package/dist/docs/deployer/01-reference.md +93 -0
  109. package/dist/docs/deployment/01-overview.md +64 -0
  110. package/dist/docs/deployment/02-mastra-server.md +129 -0
  111. package/dist/docs/deployment/03-monorepo.md +142 -0
  112. package/dist/docs/deployment/04-cloud-providers.md +17 -0
  113. package/dist/docs/deployment/05-web-framework.md +55 -0
  114. package/dist/docs/deployment/06-workflow-runners.md +11 -0
  115. package/dist/effect-QlVUlMFu-HN3LWZSQ.cjs +17 -0
  116. package/dist/effect-QlVUlMFu-HN3LWZSQ.cjs.map +1 -0
  117. package/dist/effect-QlVUlMFu-XOJ2F4UA.js +15 -0
  118. package/dist/effect-QlVUlMFu-XOJ2F4UA.js.map +1 -0
  119. package/dist/esm-6TGK2CUM.js +1289 -0
  120. package/dist/esm-6TGK2CUM.js.map +1 -0
  121. package/dist/esm-SQKX5ABS.cjs +1336 -0
  122. package/dist/esm-SQKX5ABS.cjs.map +1 -0
  123. package/dist/index.cjs +11 -22
  124. package/dist/index.cjs.map +1 -1
  125. package/dist/index.js +5 -16
  126. package/dist/index.js.map +1 -1
  127. package/dist/server/handlers/health.d.ts +5 -0
  128. package/dist/server/handlers/health.d.ts.map +1 -0
  129. package/dist/server/handlers/restart-active-runs.d.ts +3 -0
  130. package/dist/server/handlers/restart-active-runs.d.ts.map +1 -0
  131. package/dist/server/handlers/utils/query-parsers.d.ts +15 -0
  132. package/dist/server/handlers/utils/query-parsers.d.ts.map +1 -1
  133. package/dist/server/handlers/utils.d.ts +0 -7
  134. package/dist/server/handlers/utils.d.ts.map +1 -1
  135. package/dist/server/index.cjs +2813 -11309
  136. package/dist/server/index.cjs.map +1 -1
  137. package/dist/server/index.d.ts +3 -12
  138. package/dist/server/index.d.ts.map +1 -1
  139. package/dist/server/index.js +2813 -11310
  140. package/dist/server/index.js.map +1 -1
  141. package/dist/server/types.d.ts +1 -1
  142. package/dist/server/types.d.ts.map +1 -1
  143. package/dist/server/welcome.d.ts +1 -1
  144. package/dist/server/welcome.d.ts.map +1 -1
  145. package/dist/services/index.cjs +4 -4
  146. package/dist/services/index.js +1 -1
  147. package/dist/sury-CWZTCd75-KEHKUXG7.cjs +17 -0
  148. package/dist/sury-CWZTCd75-KEHKUXG7.cjs.map +1 -0
  149. package/dist/sury-CWZTCd75-L2D76L25.js +15 -0
  150. package/dist/sury-CWZTCd75-L2D76L25.js.map +1 -0
  151. package/dist/typebox-Dei93FPO-LBLFC3RD.js +8 -0
  152. package/dist/typebox-Dei93FPO-LBLFC3RD.js.map +1 -0
  153. package/dist/typebox-Dei93FPO-RDSW6DFA.cjs +10 -0
  154. package/dist/typebox-Dei93FPO-RDSW6DFA.cjs.map +1 -0
  155. package/dist/valibot--1zFm7rT-NVADAEQI.cjs +17 -0
  156. package/dist/valibot--1zFm7rT-NVADAEQI.cjs.map +1 -0
  157. package/dist/valibot--1zFm7rT-R2UKWLZC.js +15 -0
  158. package/dist/valibot--1zFm7rT-R2UKWLZC.js.map +1 -0
  159. package/dist/valibot-D_HTw1Gn-DSFFOUBW.cjs +45 -0
  160. package/dist/valibot-D_HTw1Gn-DSFFOUBW.cjs.map +1 -0
  161. package/dist/valibot-D_HTw1Gn-KWXWP2TJ.js +43 -0
  162. package/dist/valibot-D_HTw1Gn-KWXWP2TJ.js.map +1 -0
  163. package/dist/validator/custom-resolver.cjs +20 -12
  164. package/dist/validator/custom-resolver.cjs.map +1 -1
  165. package/dist/validator/custom-resolver.d.ts.map +1 -1
  166. package/dist/validator/custom-resolver.js +18 -10
  167. package/dist/validator/custom-resolver.js.map +1 -1
  168. package/dist/validator/validate.d.ts +15 -1
  169. package/dist/validator/validate.d.ts.map +1 -1
  170. package/dist/zod-Bwrt9trS-GCUGPBJX.js +29 -0
  171. package/dist/zod-Bwrt9trS-GCUGPBJX.js.map +1 -0
  172. package/dist/zod-Bwrt9trS-ZZHFZ7YQ.cjs +31 -0
  173. package/dist/zod-Bwrt9trS-ZZHFZ7YQ.cjs.map +1 -0
  174. package/dist/zod-DSgpEGAE-3CMS4FSB.cjs +39 -0
  175. package/dist/zod-DSgpEGAE-3CMS4FSB.cjs.map +1 -0
  176. package/dist/zod-DSgpEGAE-IPE3O2NQ.js +37 -0
  177. package/dist/zod-DSgpEGAE-IPE3O2NQ.js.map +1 -0
  178. package/package.json +30 -30
  179. package/dist/build/babel/get-deployer.d.ts +0 -3
  180. package/dist/build/babel/get-deployer.d.ts.map +0 -1
  181. package/dist/build/babel/remove-all-options-bundler.d.ts +0 -5
  182. package/dist/build/babel/remove-all-options-bundler.d.ts.map +0 -1
  183. package/dist/build/babel/remove-all-options-deployer.d.ts +0 -5
  184. package/dist/build/babel/remove-all-options-deployer.d.ts.map +0 -1
  185. package/dist/build/babel/remove-all-options-server.d.ts +0 -5
  186. package/dist/build/babel/remove-all-options-server.d.ts.map +0 -1
  187. package/dist/chunk-3JYRSECU.cjs.map +0 -1
  188. package/dist/chunk-5QFG6SCM.js.map +0 -1
  189. package/dist/chunk-65RQUN2A.js.map +0 -1
  190. package/dist/chunk-6OU6DT6H.js +0 -168
  191. package/dist/chunk-6OU6DT6H.js.map +0 -1
  192. package/dist/chunk-HS4XRPI7.cjs.map +0 -1
  193. package/dist/chunk-JAY7OZFT.cjs +0 -195
  194. package/dist/chunk-JAY7OZFT.cjs.map +0 -1
  195. package/dist/chunk-JCACPNJQ.cjs.map +0 -1
  196. package/dist/chunk-L6Z4LACC.js.map +0 -1
  197. package/dist/chunk-QOMQKAKY.cjs.map +0 -1
  198. package/dist/chunk-ZIBSZS2J.js.map +0 -1
  199. package/dist/server/handlers/auth/defaults.d.ts +0 -3
  200. package/dist/server/handlers/auth/defaults.d.ts.map +0 -1
  201. package/dist/server/handlers/auth/helpers.d.ts +0 -11
  202. package/dist/server/handlers/auth/helpers.d.ts.map +0 -1
  203. package/dist/server/handlers/auth/index.d.ts +0 -11
  204. package/dist/server/handlers/auth/index.d.ts.map +0 -1
  205. package/dist/server/handlers/prompt.d.ts +0 -3
  206. package/dist/server/handlers/prompt.d.ts.map +0 -1
  207. package/dist/server/handlers/routes/agent-builder/handlers.d.ts +0 -22
  208. package/dist/server/handlers/routes/agent-builder/handlers.d.ts.map +0 -1
  209. package/dist/server/handlers/routes/agent-builder/router.d.ts +0 -4
  210. package/dist/server/handlers/routes/agent-builder/router.d.ts.map +0 -1
  211. package/dist/server/handlers/routes/agents/handlers.d.ts +0 -363
  212. package/dist/server/handlers/routes/agents/handlers.d.ts.map +0 -1
  213. package/dist/server/handlers/routes/agents/router.d.ts +0 -5
  214. package/dist/server/handlers/routes/agents/router.d.ts.map +0 -1
  215. package/dist/server/handlers/routes/agents/voice.d.ts +0 -18
  216. package/dist/server/handlers/routes/agents/voice.d.ts.map +0 -1
  217. package/dist/server/handlers/routes/logs/handlers.d.ts +0 -5
  218. package/dist/server/handlers/routes/logs/handlers.d.ts.map +0 -1
  219. package/dist/server/handlers/routes/logs/router.d.ts +0 -3
  220. package/dist/server/handlers/routes/logs/router.d.ts.map +0 -1
  221. package/dist/server/handlers/routes/mcp/handlers.d.ts +0 -139
  222. package/dist/server/handlers/routes/mcp/handlers.d.ts.map +0 -1
  223. package/dist/server/handlers/routes/mcp/router.d.ts +0 -4
  224. package/dist/server/handlers/routes/mcp/router.d.ts.map +0 -1
  225. package/dist/server/handlers/routes/memory/handlers.d.ts +0 -17
  226. package/dist/server/handlers/routes/memory/handlers.d.ts.map +0 -1
  227. package/dist/server/handlers/routes/memory/router.d.ts +0 -4
  228. package/dist/server/handlers/routes/memory/router.d.ts.map +0 -1
  229. package/dist/server/handlers/routes/observability/handlers.d.ts +0 -6
  230. package/dist/server/handlers/routes/observability/handlers.d.ts.map +0 -1
  231. package/dist/server/handlers/routes/observability/router.d.ts +0 -3
  232. package/dist/server/handlers/routes/observability/router.d.ts.map +0 -1
  233. package/dist/server/handlers/routes/scores/handlers.d.ts +0 -300
  234. package/dist/server/handlers/routes/scores/handlers.d.ts.map +0 -1
  235. package/dist/server/handlers/routes/scores/router.d.ts +0 -4
  236. package/dist/server/handlers/routes/scores/router.d.ts.map +0 -1
  237. package/dist/server/handlers/routes/tools/handlers.d.ts +0 -7
  238. package/dist/server/handlers/routes/tools/handlers.d.ts.map +0 -1
  239. package/dist/server/handlers/routes/tools/router.d.ts +0 -4
  240. package/dist/server/handlers/routes/tools/router.d.ts.map +0 -1
  241. package/dist/server/handlers/routes/vector/handlers.d.ts +0 -10
  242. package/dist/server/handlers/routes/vector/handlers.d.ts.map +0 -1
  243. package/dist/server/handlers/routes/vector/router.d.ts +0 -4
  244. package/dist/server/handlers/routes/vector/router.d.ts.map +0 -1
  245. package/dist/server/handlers/routes/workflows/handlers.d.ts +0 -22
  246. package/dist/server/handlers/routes/workflows/handlers.d.ts.map +0 -1
  247. package/dist/server/handlers/routes/workflows/legacyWorkflows.d.ts +0 -11
  248. package/dist/server/handlers/routes/workflows/legacyWorkflows.d.ts.map +0 -1
  249. package/dist/server/handlers/routes/workflows/router.d.ts +0 -4
  250. package/dist/server/handlers/routes/workflows/router.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/bundler/index.ts"],"names":["MastraBundler","emptyDir","ensureDir","join","writeFile","createBundler","getBundlerOptions","analyzeBundle","DepsService","stat","copy","getWorkspaceInformation","pkg","dirname","getInputOptions","existsSync","virtual","slash","posix","glob","path","fsExtra","FileService","error","MastraError","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AK,mBAAA,CAAoB,eAAA,EAAiB,WAAW,CAAA;AAE3D,MAAA,IAAA,CAAK,MAAA,CAAO,KAAK,8BAA8B,CAAA;AAAA,IACjD,SAASU,OAAA,EAAO;AACd,MAAA,MAAM,UAAUA,OAAA,YAAiB,KAAA,GAAQA,OAAA,CAAM,OAAA,GAAU,OAAOA,OAAK,CAAA;AACrE,MAAA,MAAM,IAAIC,iBAAA;AAAA,QACR;AAAA,UACE,EAAA,EAAI,sCAAA;AAAA,UACJ,IAAA,EAAM,uCAAuC,OAAO,CAAA,CAAA;AAAA,UACpD,QAAQC,iBAAA,CAAY,QAAA;AAAA,UACpB,UAAUC,mBAAA,CAAc;AAAA,SAC1B;AAAA,QACAH;AAAA,OACF;AAAA,IACF;AAAA,EACF;AAAA,EAEA,MAAM,IAAA,CAAK,UAAA,EAAoB,gBAAA,EAA0B,UAAA,EAAkD;AACzG,IAAA,MAAM,iBAAA,GAAoB,MAAM,IAAA,CAAK,qBAAA,CAAsB,UAAU,CAAA;AACrE,IAAA,MAAM,WAAA,GAAc,MAAA,CAAO,IAAA,CAAK,iBAAiB,CAAA,CAAE,MAAA;AACnD,IAAA,IAAI,cAAc,CAAA,EAAG;AACnB,MAAA,IAAA,CAAK,MAAA,CAAO,KAAK,CAAA,MAAA,EAAS,WAAW,IAAI,WAAA,KAAgB,CAAA,GAAI,MAAA,GAAS,OAAO,CAAA,CAAE,CAAA;AAAA,IACjF;AAAA,EACF;AACF","file":"chunk-RZIZWYXY.cjs","sourcesContent":["import { existsSync } from 'node:fs';\nimport { stat, writeFile } from 'node:fs/promises';\nimport { dirname, join, posix } from 'node:path';\nimport { MastraBundler } from '@mastra/core/bundler';\nimport { MastraError, ErrorDomain, ErrorCategory } from '@mastra/core/error';\nimport type { Config } from '@mastra/core/mastra';\nimport virtual from '@rollup/plugin-virtual';\nimport * as pkg from 'empathic/package';\nimport fsExtra, { copy, ensureDir, readJSON, emptyDir } from 'fs-extra/esm';\nimport type { InputOptions, OutputOptions } from 'rollup';\nimport { glob } from 'tinyglobby';\nimport { analyzeBundle } from '../build/analyze';\nimport { createBundler as createBundlerUtil, getInputOptions } from '../build/bundler';\nimport { getBundlerOptions } from '../build/bundlerOptions';\nimport { getPackageRootPath } from '../build/package-info';\nimport type { BundlerOptions } from '../build/types';\nimport type { BundlerPlatform } from '../build/utils';\nimport { getPackageName, slash } from '../build/utils';\nimport { DepsService } from '../services/deps';\nimport { FileService } from '../services/fs';\nimport { getWorkspaceInformation } from './workspaceDependencies';\n\nexport type { BundlerOptions } from '../build/types';\nexport type { BundlerPlatform } from '../build/utils';\n\nexport const IS_DEFAULT = Symbol('IS_DEFAULT');\n\nexport abstract class Bundler extends MastraBundler {\n protected analyzeOutputDir = '.build';\n protected outputDir = 'output';\n protected platform: BundlerPlatform = 'node';\n\n constructor(name: string, component: 'BUNDLER' | 'DEPLOYER' = 'BUNDLER') {\n super({ name, component });\n }\n\n async prepare(outputDirectory: string): Promise<void> {\n // Clean up the output directory first\n await emptyDir(outputDirectory);\n\n await ensureDir(join(outputDirectory, this.analyzeOutputDir));\n await ensureDir(join(outputDirectory, this.outputDir));\n }\n\n async writePackageJson(\n outputDirectory: string,\n dependencies: Map<string, string>,\n resolutions?: Record<string, string>,\n ) {\n this.logger.debug(`Writing project's package.json`);\n\n await ensureDir(outputDirectory);\n const pkgPath = join(outputDirectory, 'package.json');\n\n const dependenciesMap = new Map();\n for (const [key, value] of dependencies.entries()) {\n if (key.startsWith('@')) {\n // Handle scoped packages (e.g. @org/package)\n const pkgChunks = key.split('/');\n dependenciesMap.set(`${pkgChunks[0]}/${pkgChunks[1]}`, value);\n } else {\n // For non-scoped packages, take only the first part before any slash\n const pkgName = key.split('/')[0] || key;\n dependenciesMap.set(pkgName, value);\n }\n }\n\n await writeFile(\n pkgPath,\n JSON.stringify(\n {\n name: 'server',\n version: '1.0.0',\n description: '',\n type: 'module',\n main: 'index.mjs',\n scripts: {\n start: 'node ./index.mjs',\n },\n author: 'Mastra',\n license: 'ISC',\n dependencies: Object.fromEntries(dependenciesMap.entries()),\n ...(Object.keys(resolutions ?? {}).length > 0 && { resolutions }),\n pnpm: {\n neverBuiltDependencies: [],\n },\n },\n null,\n 2,\n ),\n );\n }\n\n protected createBundler(inputOptions: InputOptions, outputOptions: Partial<OutputOptions> & { dir: string }) {\n return createBundlerUtil(inputOptions, outputOptions);\n }\n\n protected async getUserBundlerOptions(\n mastraEntryFile: string,\n outputDirectory: string,\n ): Promise<NonNullable<Config['bundler']>> {\n const defaultBundlerOptions: Config['bundler'] = {\n externals: [],\n sourcemap: false,\n transpilePackages: [],\n [IS_DEFAULT]: true,\n } as const;\n\n try {\n const bundlerOptions = await getBundlerOptions(mastraEntryFile, outputDirectory);\n\n return bundlerOptions ?? defaultBundlerOptions;\n } catch (error) {\n this.logger.debug('Failed to get bundler options, sourcemap will be disabled', { error });\n }\n\n return defaultBundlerOptions;\n }\n\n protected async analyze(entry: string | string[], mastraFile: string, outputDirectory: string) {\n return await analyzeBundle(\n ([] as string[]).concat(entry),\n mastraFile,\n {\n outputDir: join(outputDirectory, this.analyzeOutputDir),\n projectRoot: outputDirectory,\n platform: this.platform,\n },\n this.logger,\n );\n }\n\n protected async installDependencies(outputDirectory: string, rootDir = process.cwd()) {\n const deps = new DepsService(rootDir);\n deps.__setLogger(this.logger);\n\n await deps.install({ dir: join(outputDirectory, this.outputDir) });\n }\n\n protected async copyPublic(mastraDir: string, outputDirectory: string) {\n const publicDir = join(mastraDir, 'public');\n\n try {\n await stat(publicDir);\n } catch {\n return;\n }\n\n await copy(publicDir, join(outputDirectory, this.outputDir));\n }\n\n protected async copyDOTNPMRC({\n rootDir = process.cwd(),\n outputDirectory,\n }: {\n rootDir?: string;\n outputDirectory: string;\n }) {\n const sourceDotNpmRcPath = join(rootDir, '.npmrc');\n const targetDotNpmRcPath = join(outputDirectory, this.outputDir, '.npmrc');\n\n try {\n await stat(sourceDotNpmRcPath);\n await copy(sourceDotNpmRcPath, targetDotNpmRcPath);\n } catch {\n return;\n }\n }\n\n protected async getBundlerOptions(\n serverFile: string,\n mastraEntryFile: string,\n analyzedBundleInfo: Awaited<ReturnType<typeof analyzeBundle>>,\n toolsPaths: (string | string[])[],\n { enableSourcemap, enableEsmShim, externals }: BundlerOptions,\n ) {\n const { workspaceRoot } = await getWorkspaceInformation({ mastraEntryFile });\n const closestPkgJson = pkg.up({ cwd: dirname(mastraEntryFile) });\n const projectRoot = closestPkgJson ? dirname(closestPkgJson) : process.cwd();\n\n const inputOptions: InputOptions = await getInputOptions(\n mastraEntryFile,\n analyzedBundleInfo,\n this.platform,\n {\n 'process.env.NODE_ENV': JSON.stringify('production'),\n },\n { sourcemap: enableSourcemap, workspaceRoot, projectRoot, enableEsmShim, externalsPreset: externals === true },\n );\n const isVirtual = serverFile.includes('\\n') || existsSync(serverFile);\n\n const toolsInputOptions = await this.listToolsInputOptions(toolsPaths);\n\n if (isVirtual) {\n inputOptions.input = { index: '#entry', ...toolsInputOptions };\n\n if (Array.isArray(inputOptions.plugins)) {\n inputOptions.plugins.unshift(virtual({ '#entry': serverFile }));\n } else {\n inputOptions.plugins = [virtual({ '#entry': serverFile })];\n }\n } else {\n inputOptions.input = { index: serverFile, ...toolsInputOptions };\n }\n\n return inputOptions;\n }\n\n getAllToolPaths(mastraDir: string, toolsPaths: (string | string[])[] = []): (string | string[])[] {\n // Normalize Windows paths to forward slashes for consistent handling\n const normalizedMastraDir = slash(mastraDir);\n\n // Prepare default tools paths with glob patterns\n const defaultToolsPath = posix.join(normalizedMastraDir, 'tools/**/*.{js,ts}');\n const defaultToolsIgnorePaths = [\n `!${posix.join(normalizedMastraDir, 'tools/**/*.{test,spec}.{js,ts}')}`,\n `!${posix.join(normalizedMastraDir, 'tools/**/__tests__/**')}`,\n ];\n\n // Combine default path with ignore patterns\n const defaultPaths = [defaultToolsPath, ...defaultToolsIgnorePaths];\n\n // If no tools paths provided, use only the default paths\n if (toolsPaths.length === 0) {\n return [defaultPaths];\n }\n\n // If tools paths are provided, add the default paths to ensure standard tools are always included\n return [...toolsPaths, defaultPaths];\n }\n\n async listToolsInputOptions(toolsPaths: (string | string[])[]) {\n const inputs: Record<string, string> = {};\n\n for (const toolPath of toolsPaths) {\n const expandedPaths = await glob(toolPath, {\n absolute: true,\n expandDirectories: false,\n });\n\n for (const path of expandedPaths) {\n if (await fsExtra.pathExists(path)) {\n const fileService = new FileService();\n const entryFile = fileService.getFirstExistingFile([\n join(path, 'index.ts'),\n join(path, 'index.js'),\n path, // if path itself is a file\n ]);\n\n // if it doesn't exist or is a dir skip it. using a dir as a tool will crash the process\n if (!entryFile || (await stat(entryFile)).isDirectory()) {\n this.logger.warn(`No entry file found in ${path}, skipping...`);\n continue;\n }\n\n const uniqueToolID = crypto.randomUUID();\n // Normalize Windows paths to forward slashes for consistent handling\n const normalizedEntryFile = entryFile.replaceAll('\\\\', '/');\n inputs[`tools/${uniqueToolID}`] = normalizedEntryFile;\n } else {\n this.logger.warn(`Tool path ${path} does not exist, skipping...`);\n }\n }\n }\n\n return inputs;\n }\n\n protected async _bundle(\n serverFile: string,\n mastraEntryFile: string,\n {\n projectRoot,\n outputDirectory,\n enableEsmShim = true,\n }: {\n projectRoot: string;\n outputDirectory: string;\n enableEsmShim?: boolean;\n },\n toolsPaths: (string | string[])[] = [],\n bundleLocation: string = join(outputDirectory, this.outputDir),\n ): Promise<void> {\n const analyzeDir = join(outputDirectory, this.analyzeOutputDir);\n\n const bundlerOptions = await this.getUserBundlerOptions(mastraEntryFile, outputDirectory);\n const internalBundlerOptions: BundlerOptions = {\n enableSourcemap: !!bundlerOptions.sourcemap,\n externals: bundlerOptions.externals ?? [],\n enableEsmShim,\n };\n\n let analyzedBundleInfo;\n try {\n const resolvedToolsPaths = await this.listToolsInputOptions(toolsPaths);\n analyzedBundleInfo = await analyzeBundle(\n [serverFile, ...Object.values(resolvedToolsPaths)],\n mastraEntryFile,\n {\n outputDir: analyzeDir,\n projectRoot,\n platform: this.platform,\n bundlerOptions: internalBundlerOptions,\n },\n this.logger,\n );\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n\n if (error instanceof MastraError) {\n throw error;\n }\n\n throw new MastraError(\n {\n id: 'DEPLOYER_BUNDLER_ANALYZE_FAILED',\n text: `Failed to analyze Mastra application: ${message}`,\n domain: ErrorDomain.DEPLOYER,\n category: ErrorCategory.SYSTEM,\n },\n error,\n );\n }\n\n const dependenciesToInstall = new Map<string, string>();\n for (const [dep, depInfo] of analyzedBundleInfo.externalDependencies) {\n if (analyzedBundleInfo.workspaceMap.has(dep)) {\n continue;\n }\n\n let version = depInfo.version;\n let actualPackageName: string | undefined;\n\n // Read package.json to get actual package name (for alias detection) and version if not pre-resolved\n try {\n const rootPath = await getPackageRootPath(dep);\n if (rootPath) {\n const pkg = await readJSON(`${rootPath}/package.json`);\n actualPackageName = pkg.name;\n // Use pre-resolved version if available, otherwise use from package.json\n if (!version) {\n version = pkg.version;\n }\n }\n } catch {\n // Resolution failed, will use 'latest' for version\n }\n\n // Default to 'latest' if still no version\n version = version || 'latest';\n\n // Check if this is an npm alias (import name differs from actual package name)\n // e.g., importing \"ai-v5\" which resolves to package \"ai\"\n // or importing \"@ai-sdk/openai-v5\" which resolves to \"@ai-sdk/openai\"\n // In this case, write npm alias syntax: \"ai-v5\": \"npm:ai@5.0.93\"\n const isAlias = actualPackageName && dep !== actualPackageName;\n\n if (isAlias) {\n dependenciesToInstall.set(dep, `npm:${actualPackageName}@${version}`);\n } else {\n dependenciesToInstall.set(dep, version);\n }\n }\n\n try {\n await this.writePackageJson(join(outputDirectory, this.outputDir), dependenciesToInstall);\n\n this.logger.info('Bundling Mastra application');\n\n const inputOptions: InputOptions = await this.getBundlerOptions(\n serverFile,\n mastraEntryFile,\n analyzedBundleInfo,\n toolsPaths,\n internalBundlerOptions,\n );\n\n const bundler = await this.createBundler(\n {\n ...inputOptions,\n logLevel: inputOptions.logLevel === 'silent' ? 'warn' : inputOptions.logLevel,\n onwarn: warning => {\n if (warning.code === 'CIRCULAR_DEPENDENCY') {\n if (warning.ids?.[0]?.includes('node_modules')) {\n return;\n }\n\n this.logger.warn(`Circular dependency found:\n\\t${warning.message.replace('Circular dependency: ', '')}`);\n }\n },\n },\n {\n dir: bundleLocation,\n manualChunks: {\n mastra: ['#mastra'],\n },\n sourcemap: internalBundlerOptions.enableSourcemap,\n },\n );\n\n await bundler.write();\n const toolImports: string[] = [];\n const toolsExports: string[] = [];\n Array.from(Object.keys(inputOptions.input || {}))\n .filter(key => key.startsWith('tools/'))\n .forEach((key, index) => {\n const toolExport = `tool${index}`;\n toolImports.push(`import * as ${toolExport} from './${key}.mjs';`);\n toolsExports.push(toolExport);\n });\n\n await writeFile(\n join(bundleLocation, 'tools.mjs'),\n `${toolImports.join('\\n')}\n\nexport const tools = [${toolsExports.join(', ')}]`,\n );\n this.logger.info('Bundling Mastra done');\n\n this.logger.info('Copying public files');\n await this.copyPublic(dirname(mastraEntryFile), outputDirectory);\n this.logger.info('Done copying public files');\n\n this.logger.info('Copying .npmrc file');\n await this.copyDOTNPMRC({ outputDirectory, rootDir: projectRoot });\n\n this.logger.info('Done copying .npmrc file');\n\n this.logger.info('Installing dependencies');\n await this.installDependencies(outputDirectory, projectRoot);\n\n this.logger.info('Done installing dependencies');\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new MastraError(\n {\n id: 'DEPLOYER_BUNDLER_BUNDLE_STAGE_FAILED',\n text: `Failed during bundler bundle stage: ${message}`,\n domain: ErrorDomain.DEPLOYER,\n category: ErrorCategory.SYSTEM,\n },\n error,\n );\n }\n }\n\n async lint(_entryFile: string, _outputDirectory: string, toolsPaths: (string | string[])[]): Promise<void> {\n const toolsInputOptions = await this.listToolsInputOptions(toolsPaths);\n const toolsLength = Object.keys(toolsInputOptions).length;\n if (toolsLength > 0) {\n this.logger.info(`Found ${toolsLength} ${toolsLength === 1 ? 'tool' : 'tools'}`);\n }\n }\n}\n"]}
@@ -0,0 +1,93 @@
1
+ // ../../node_modules/.pnpm/@standard-community+standard-openapi@0.2.9_@standard-community+standard-json@0.3.5_@sta_54b5e515d9ef28e1ec1313d6d3effba2/node_modules/@standard-community/standard-openapi/dist/vendors/convert.js
2
+ function convertToOpenAPISchema(jsonSchema, context) {
3
+ const _jsonSchema = JSON.parse(JSON.stringify(jsonSchema));
4
+ if ("nullable" in _jsonSchema && _jsonSchema.nullable === true) {
5
+ if (_jsonSchema.type) {
6
+ if (Array.isArray(_jsonSchema.type)) {
7
+ if (!_jsonSchema.type.includes("null")) {
8
+ _jsonSchema.type.push("null");
9
+ }
10
+ } else {
11
+ _jsonSchema.type = [_jsonSchema.type, "null"];
12
+ }
13
+ } else {
14
+ _jsonSchema.type = ["null"];
15
+ }
16
+ delete _jsonSchema.nullable;
17
+ }
18
+ if (_jsonSchema.$schema) {
19
+ delete _jsonSchema.$schema;
20
+ }
21
+ const nestedSchemaKeys = [
22
+ "properties",
23
+ "additionalProperties",
24
+ "items",
25
+ "additionalItems",
26
+ "allOf",
27
+ "anyOf",
28
+ "oneOf",
29
+ "not",
30
+ "if",
31
+ "then",
32
+ "else",
33
+ "definitions",
34
+ "$defs",
35
+ "patternProperties",
36
+ "propertyNames",
37
+ "contains"
38
+ // "unevaluatedProperties",
39
+ // "unevaluatedItems",
40
+ ];
41
+ nestedSchemaKeys.forEach((key) => {
42
+ if (_jsonSchema[key] && (typeof _jsonSchema[key] === "object" || Array.isArray(_jsonSchema[key]))) {
43
+ if (key === "properties" || key === "definitions" || key === "$defs" || key === "patternProperties") {
44
+ for (const subKey in _jsonSchema[key]) {
45
+ _jsonSchema[key][subKey] = convertToOpenAPISchema(
46
+ _jsonSchema[key][subKey],
47
+ context
48
+ );
49
+ }
50
+ } else if (key === "allOf" || key === "anyOf" || key === "oneOf") {
51
+ _jsonSchema[key] = _jsonSchema[key].map(
52
+ (item) => convertToOpenAPISchema(item, context)
53
+ );
54
+ } else if (key === "items") {
55
+ if (Array.isArray(_jsonSchema[key])) {
56
+ _jsonSchema[key] = _jsonSchema[key].map(
57
+ (item) => convertToOpenAPISchema(item, context)
58
+ );
59
+ } else {
60
+ _jsonSchema[key] = convertToOpenAPISchema(_jsonSchema[key], context);
61
+ }
62
+ } else {
63
+ _jsonSchema[key] = convertToOpenAPISchema(_jsonSchema[key], context);
64
+ }
65
+ }
66
+ });
67
+ if (_jsonSchema.ref || _jsonSchema.$id) {
68
+ const { ref, $id, ...component } = _jsonSchema;
69
+ const id = ref || $id;
70
+ context.components.schemas = {
71
+ ...context.components.schemas,
72
+ [id]: component
73
+ };
74
+ return {
75
+ $ref: `#/components/schemas/${id}`
76
+ };
77
+ } else if (_jsonSchema.$ref) {
78
+ const { $ref, $defs } = _jsonSchema;
79
+ const ref = $ref.split("/").pop();
80
+ context.components.schemas = {
81
+ ...context.components.schemas,
82
+ ...$defs
83
+ };
84
+ return {
85
+ $ref: `#/components/schemas/${ref}`
86
+ };
87
+ }
88
+ return _jsonSchema;
89
+ }
90
+
91
+ export { convertToOpenAPISchema };
92
+ //# sourceMappingURL=chunk-V4HCIN6G.js.map
93
+ //# sourceMappingURL=chunk-V4HCIN6G.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../node_modules/.pnpm/@standard-community+standard-openapi@0.2.9_@standard-community+standard-json@0.3.5_@sta_54b5e515d9ef28e1ec1313d6d3effba2/node_modules/@standard-community/standard-openapi/dist/vendors/convert.js"],"names":[],"mappings":";AAAA,SAAS,sBAAA,CAAuB,YAAY,OAAA,EAAS;AACnD,EAAA,MAAM,cAAc,IAAA,CAAK,KAAA,CAAM,IAAA,CAAK,SAAA,CAAU,UAAU,CAAC,CAAA;AACzD,EAAA,IAAI,UAAA,IAAc,WAAA,IAAe,WAAA,CAAY,QAAA,KAAa,IAAA,EAAM;AAC9D,IAAA,IAAI,YAAY,IAAA,EAAM;AACpB,MAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,WAAA,CAAY,IAAI,CAAA,EAAG;AACnC,QAAA,IAAI,CAAC,WAAA,CAAY,IAAA,CAAK,QAAA,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E,CAAA;AAAA,KAClC;AAAA,EACF,CAAA,MAAA,IAAW,YAAY,IAAA,EAAM;AAC3B,IAAA,MAAM,EAAE,IAAA,EAAM,KAAA,EAAM,GAAI,WAAA;AACxB,IAAA,MAAM,GAAA,GAAM,IAAA,CAAK,KAAA,CAAM,GAAG,EAAE,GAAA,EAAI;AAChC,IAAA,OAAA,CAAQ,WAAW,OAAA,GAAU;AAAA,MAC3B,GAAG,QAAQ,UAAA,CAAW,OAAA;AAAA,MACtB,GAAG;AAAA,KACL;AACA,IAAA,OAAO;AAAA,MACL,IAAA,EAAM,wBAAwB,GAAG,CAAA;AAAA,KACnC;AAAA,EACF;AACA,EAAA,OAAO,WAAA;AACT","file":"chunk-V4HCIN6G.js","sourcesContent":["function convertToOpenAPISchema(jsonSchema, context) {\n const _jsonSchema = JSON.parse(JSON.stringify(jsonSchema));\n if (\"nullable\" in _jsonSchema && _jsonSchema.nullable === true) {\n if (_jsonSchema.type) {\n if (Array.isArray(_jsonSchema.type)) {\n if (!_jsonSchema.type.includes(\"null\")) {\n _jsonSchema.type.push(\"null\");\n }\n } else {\n _jsonSchema.type = [_jsonSchema.type, \"null\"];\n }\n } else {\n _jsonSchema.type = [\"null\"];\n }\n delete _jsonSchema.nullable;\n }\n if (_jsonSchema.$schema) {\n delete _jsonSchema.$schema;\n }\n const nestedSchemaKeys = [\n \"properties\",\n \"additionalProperties\",\n \"items\",\n \"additionalItems\",\n \"allOf\",\n \"anyOf\",\n \"oneOf\",\n \"not\",\n \"if\",\n \"then\",\n \"else\",\n \"definitions\",\n \"$defs\",\n \"patternProperties\",\n \"propertyNames\",\n \"contains\"\n // \"unevaluatedProperties\",\n // \"unevaluatedItems\",\n ];\n nestedSchemaKeys.forEach((key) => {\n if (_jsonSchema[key] && (typeof _jsonSchema[key] === \"object\" || Array.isArray(_jsonSchema[key]))) {\n if (key === \"properties\" || key === \"definitions\" || key === \"$defs\" || key === \"patternProperties\") {\n for (const subKey in _jsonSchema[key]) {\n _jsonSchema[key][subKey] = convertToOpenAPISchema(\n _jsonSchema[key][subKey],\n context\n );\n }\n } else if (key === \"allOf\" || key === \"anyOf\" || key === \"oneOf\") {\n _jsonSchema[key] = _jsonSchema[key].map(\n (item) => convertToOpenAPISchema(item, context)\n );\n } else if (key === \"items\") {\n if (Array.isArray(_jsonSchema[key])) {\n _jsonSchema[key] = _jsonSchema[key].map(\n (item) => convertToOpenAPISchema(item, context)\n );\n } else {\n _jsonSchema[key] = convertToOpenAPISchema(_jsonSchema[key], context);\n }\n } else {\n _jsonSchema[key] = convertToOpenAPISchema(_jsonSchema[key], context);\n }\n }\n });\n if (_jsonSchema.ref || _jsonSchema.$id) {\n const { ref, $id, ...component } = _jsonSchema;\n const id = ref || $id;\n context.components.schemas = {\n ...context.components.schemas,\n [id]: component\n };\n return {\n $ref: `#/components/schemas/${id}`\n };\n } else if (_jsonSchema.$ref) {\n const { $ref, $defs } = _jsonSchema;\n const ref = $ref.split(\"/\").pop();\n context.components.schemas = {\n ...context.components.schemas,\n ...$defs\n };\n return {\n $ref: `#/components/schemas/${ref}`\n };\n }\n return _jsonSchema;\n}\n\nexport { convertToOpenAPISchema };\n"]}
@@ -0,0 +1,88 @@
1
+ import { getInputOptions, nodeModulesExtensionResolver } from './chunk-6VRWO5WR.js';
2
+ import { getWorkspaceInformation, analyzeBundle, tsConfigPaths, aliasHono, extractMastraOption } from './chunk-GX3DPJAT.js';
3
+ import { slash, getPackageName } from './chunk-QAOUDKHK.js';
4
+ import { watch } from 'rollup';
5
+ import { dirname, posix } from 'path';
6
+ import * as pkg from 'empathic/package';
7
+ import { noopLogger } from '@mastra/core/logger';
8
+
9
+ async function getInputOptions2(entryFile, platform, env, { sourcemap = false } = {}) {
10
+ const closestPkgJson = pkg.up({ cwd: dirname(entryFile) });
11
+ const projectRoot = closestPkgJson ? dirname(slash(closestPkgJson)) : slash(process.cwd());
12
+ const { workspaceMap, workspaceRoot } = await getWorkspaceInformation({ mastraEntryFile: entryFile });
13
+ const analyzeEntryResult = await analyzeBundle(
14
+ [entryFile],
15
+ entryFile,
16
+ {
17
+ outputDir: posix.join(process.cwd(), ".mastra", ".build"),
18
+ projectRoot: workspaceRoot || process.cwd(),
19
+ platform,
20
+ isDev: true
21
+ },
22
+ noopLogger
23
+ );
24
+ const deps = /* @__PURE__ */ new Map();
25
+ for (const [dep, metadata] of analyzeEntryResult.dependencies.entries()) {
26
+ const pkgName = getPackageName(dep);
27
+ if (pkgName && workspaceMap.has(pkgName)) {
28
+ deps.set(dep, metadata);
29
+ }
30
+ }
31
+ const inputOptions = await getInputOptions(
32
+ entryFile,
33
+ {
34
+ dependencies: deps,
35
+ externalDependencies: /* @__PURE__ */ new Map(),
36
+ workspaceMap
37
+ },
38
+ platform,
39
+ env,
40
+ { sourcemap, isDev: true, workspaceRoot, projectRoot }
41
+ );
42
+ if (Array.isArray(inputOptions.plugins)) {
43
+ const plugins = [];
44
+ inputOptions.plugins.forEach((plugin) => {
45
+ if (plugin?.name === "node-resolve") {
46
+ return;
47
+ }
48
+ if (plugin?.name === "tsconfig-paths") {
49
+ plugins.push(
50
+ tsConfigPaths({
51
+ localResolve: true
52
+ })
53
+ );
54
+ return;
55
+ }
56
+ plugins.push(plugin);
57
+ });
58
+ inputOptions.plugins = plugins;
59
+ inputOptions.plugins.push(aliasHono());
60
+ inputOptions.plugins.push(nodeModulesExtensionResolver());
61
+ }
62
+ return inputOptions;
63
+ }
64
+ async function createWatcher(inputOptions, outputOptions) {
65
+ const watcher = await watch({
66
+ ...inputOptions,
67
+ output: {
68
+ ...outputOptions,
69
+ format: "esm",
70
+ entryFileNames: "[name].mjs",
71
+ chunkFileNames: "[name].mjs"
72
+ }
73
+ });
74
+ return watcher;
75
+ }
76
+
77
+ // src/build/serverOptions.ts
78
+ async function getServerOptions(entryFile, outputDir, logger) {
79
+ const result = await extractMastraOption("server", entryFile, outputDir, logger);
80
+ if (!result) {
81
+ return null;
82
+ }
83
+ return result.getConfig();
84
+ }
85
+
86
+ export { createWatcher, getInputOptions2 as getInputOptions, getServerOptions };
87
+ //# sourceMappingURL=chunk-ZJA5AK4R.js.map
88
+ //# sourceMappingURL=chunk-ZJA5AK4R.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/build/watcher.ts","../src/build/serverOptions.ts"],"names":["getInputOptions"],"mappings":";;;;;;;;AAaA,eAAsBA,gBAAAA,CACpB,WACA,QAAA,EACA,GAAA,EACA,EAAE,SAAA,GAAY,KAAA,EAAM,GAA6B,EAAC,EAClD;AACA,EAAA,MAAM,iBAAqB,GAAA,CAAA,EAAA,CAAG,EAAE,KAAK,OAAA,CAAQ,SAAS,GAAG,CAAA;AACzD,EAAA,MAAM,WAAA,GAAc,cAAA,GAAiB,OAAA,CAAQ,KAAA,CAAM,cAAc,CAAC,CAAA,GAAI,KAAA,CAAM,OAAA,CAAQ,GAAA,EAAK,CAAA;AACzF,EAAA,MAAM,EAAE,cAAc,aAAA,EAAc,GAAI,MAAM,uBAAA,CAAwB,EAAE,eAAA,EAAiB,SAAA,EAAW,CAAA;AAEpG,EAAA,MAAM,qBAAqB,MAAM,aAAA;AAAA,IAC/B,CAAC,SAAS,CAAA;AAAA,IACV,SAAA;AAAA,IACA;AAAA,MACE,WAAW,KAAA,CAAM,IAAA,CAAK,QAAQ,GAAA,EAAI,EAAG,WAAW,QAAQ,CAAA;AAAA,MACxD,WAAA,EAAa,aAAA,IAAiB,OAAA,CAAQ,GAAA,EAAI;AAAA,MAC1C,QAAA;AAAA,MACA,KAAA,EAAO;AAAA,KACT;AAAA,IACA;AAAA,GACF;AAEA,EAAA,MAAM,IAAA,uBAA2B,GAAA,EAAI;AACrC,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,QAAQ,KAAK,kBAAA,CAAmB,YAAA,CAAa,SAAQ,EAAG;AACvE,IAAA,MAAM,OAAA,GAAU,eAAe,GAAG,CAAA;AAClC,IAAA,IAAI,OAAA,IAAW,YAAA,CAAa,GAAA,CAAI,OAAO,CAAA,EAAG;AAC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,EAAQ,KAAA;AAAA,MACR,cAAA,EAAgB,YAAA;AAAA,MAChB,cAAA,EAAgB;AAAA;AAClB,GACD,CAAA;AAED,EAAA,OAAO,OAAA;AACT;;;ACpFA,eAAsB,gBAAA,CACpB,SAAA,EACA,SAAA,EACA,MAAA,EACkC;AAClC,EAAA,MAAM,SAAS,MAAM,mBAAA,CAAoB,QAAA,EAAU,SAAA,EAAW,WAAW,MAAM,CAAA;AAC/E,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,OAAO,OAAO,SAAA,EAAU;AAC1B","file":"chunk-ZJA5AK4R.js","sourcesContent":["import type { InputOptions, OutputOptions, Plugin } from 'rollup';\nimport { watch } from 'rollup';\nimport { dirname, posix } from 'node:path';\nimport * as pkg from 'empathic/package';\nimport { getInputOptions as getBundlerInputOptions } from './bundler';\nimport { aliasHono } from './plugins/hono-alias';\nimport { nodeModulesExtensionResolver } from './plugins/node-modules-extension-resolver';\nimport { tsConfigPaths } from './plugins/tsconfig-paths';\nimport { noopLogger } from '@mastra/core/logger';\nimport { getWorkspaceInformation } from '../bundler/workspaceDependencies';\nimport { analyzeBundle } from './analyze';\nimport { getPackageName, slash, type BundlerPlatform } from './utils';\n\nexport async function getInputOptions(\n entryFile: string,\n platform: BundlerPlatform,\n env?: Record<string, string>,\n { sourcemap = false }: { sourcemap?: boolean } = {},\n) {\n const closestPkgJson = pkg.up({ cwd: dirname(entryFile) });\n const projectRoot = closestPkgJson ? dirname(slash(closestPkgJson)) : slash(process.cwd());\n const { workspaceMap, workspaceRoot } = await getWorkspaceInformation({ mastraEntryFile: entryFile });\n\n const analyzeEntryResult = await analyzeBundle(\n [entryFile],\n entryFile,\n {\n outputDir: posix.join(process.cwd(), '.mastra', '.build'),\n projectRoot: workspaceRoot || process.cwd(),\n platform,\n isDev: true,\n },\n noopLogger,\n );\n\n const deps = /* @__PURE__ */ new Map();\n for (const [dep, metadata] of analyzeEntryResult.dependencies.entries()) {\n const pkgName = getPackageName(dep);\n if (pkgName && workspaceMap.has(pkgName)) {\n deps.set(dep, metadata);\n }\n }\n\n const inputOptions = await getBundlerInputOptions(\n entryFile,\n {\n dependencies: deps,\n externalDependencies: new Map(),\n workspaceMap,\n },\n platform,\n env,\n { sourcemap, isDev: true, workspaceRoot, projectRoot },\n );\n\n if (Array.isArray(inputOptions.plugins)) {\n // filter out node-resolve plugin so all node_modules are external\n // and tsconfig-paths plugin as we are injection a custom one\n const plugins = [] as Plugin[];\n inputOptions.plugins.forEach(plugin => {\n if ((plugin as Plugin | undefined)?.name === 'node-resolve') {\n return;\n }\n\n if ((plugin as Plugin | undefined)?.name === 'tsconfig-paths') {\n plugins.push(\n tsConfigPaths({\n localResolve: true,\n }),\n );\n return;\n }\n\n plugins.push(plugin as Plugin);\n });\n\n inputOptions.plugins = plugins;\n inputOptions.plugins.push(aliasHono());\n // fixes imports like lodash/fp/get\n inputOptions.plugins.push(nodeModulesExtensionResolver());\n }\n\n return inputOptions;\n}\n\nexport async function createWatcher(inputOptions: InputOptions, outputOptions: OutputOptions) {\n const watcher = await watch({\n ...inputOptions,\n output: {\n ...outputOptions,\n format: 'esm',\n entryFileNames: '[name].mjs',\n chunkFileNames: '[name].mjs',\n },\n });\n\n return watcher;\n}\n","import type { Config } from '@mastra/core/mastra';\nimport { extractMastraOption, extractMastraOptionBundler } from './shared/extract-mastra-option';\nimport type { IMastraLogger } from '@mastra/core/logger';\n\nexport function getServerOptionsBundler(\n entryFile: string,\n result: {\n hasCustomConfig: false;\n },\n) {\n return extractMastraOptionBundler('server', entryFile, result);\n}\n\nexport async function getServerOptions(\n entryFile: string,\n outputDir: string,\n logger?: IMastraLogger,\n): Promise<Config['server'] | null> {\n const result = await extractMastraOption('server', entryFile, outputDir, logger);\n if (!result) {\n return null;\n }\n\n return result.getConfig();\n}\n"]}
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ var chunkJBE6KM7R_cjs = require('./chunk-JBE6KM7R.cjs');
4
+ var chunkJRUJ546M_cjs = require('./chunk-JRUJ546M.cjs');
5
+
6
+ // ../../node_modules/.pnpm/@standard-community+standard-openapi@0.2.9_@standard-community+standard-json@0.3.5_@sta_54b5e515d9ef28e1ec1313d6d3effba2/node_modules/@standard-community/standard-openapi/dist/default-u_dwuiYb.js
7
+ function getToOpenAPISchemaFn() {
8
+ return async (schema, context) => chunkJBE6KM7R_cjs.convertToOpenAPISchema(
9
+ await chunkJRUJ546M_cjs.toJsonSchema(schema, context.options),
10
+ context
11
+ );
12
+ }
13
+
14
+ exports.getToOpenAPISchemaFn = getToOpenAPISchemaFn;
15
+ //# sourceMappingURL=chunk-ZXQ7DOYU.cjs.map
16
+ //# sourceMappingURL=chunk-ZXQ7DOYU.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../node_modules/.pnpm/@standard-community+standard-openapi@0.2.9_@standard-community+standard-json@0.3.5_@sta_54b5e515d9ef28e1ec1313d6d3effba2/node_modules/@standard-community/standard-openapi/dist/default-u_dwuiYb.js"],"names":["convertToOpenAPISchema","toJsonSchema"],"mappings":";;;;;;AAGA,SAAS,oBAAA,GAAuB;AAC9B,EAAA,OAAO,OAAO,QAAQ,OAAA,KAAYA,wCAAA;AAAA,IAChC,MAAMC,8BAAA,CAAa,MAAA,EAAQ,OAAA,CAAQ,OAAO,CAAA;AAAA,IAC1C;AAAA,GACF;AACF","file":"chunk-ZXQ7DOYU.cjs","sourcesContent":["import { toJsonSchema } from '@standard-community/standard-json';\nimport { convertToOpenAPISchema } from './vendors/convert.js';\n\nfunction getToOpenAPISchemaFn() {\n return async (schema, context) => convertToOpenAPISchema(\n await toJsonSchema(schema, context.options),\n context\n );\n}\n\nexport { getToOpenAPISchemaFn as default };\n"]}
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var chunkZXQ7DOYU_cjs = require('./chunk-ZXQ7DOYU.cjs');
4
+
5
+
6
+
7
+ module.exports = chunkZXQ7DOYU_cjs.getToOpenAPISchemaFn;
8
+ //# sourceMappingURL=default-u_dwuiYb-JPNIZQKK.cjs.map
9
+ //# sourceMappingURL=default-u_dwuiYb-JPNIZQKK.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"default-u_dwuiYb-JPNIZQKK.cjs"}
@@ -0,0 +1,3 @@
1
+ export { getToOpenAPISchemaFn as default } from './chunk-MCWU6IKS.js';
2
+ //# sourceMappingURL=default-u_dwuiYb-RK5OD4MY.js.map
3
+ //# sourceMappingURL=default-u_dwuiYb-RK5OD4MY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"default-u_dwuiYb-RK5OD4MY.js"}
@@ -1,4 +1,4 @@
1
- import { Transform } from 'stream';
1
+ import { Transform } from 'node:stream';
2
2
  import type { IMastraLogger } from '@mastra/core/logger';
3
3
  export declare const createPinoStream: (logger: IMastraLogger) => Transform;
4
4
  export declare function createChildProcessLogger({ logger, root }: {
@@ -1 +1 @@
1
- {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/deploy/log.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,eAAO,MAAM,gBAAgB,GAAI,QAAQ,aAAa,cAgBrD,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,IAElF,oBAAoB;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,sBAoC/F"}
1
+ {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/deploy/log.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,eAAO,MAAM,gBAAgB,GAAI,QAAQ,aAAa,cAgBrD,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,IAElF,oBAAoB;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,sBAoC/F"}
@@ -0,0 +1,32 @@
1
+ # @mastra/deployer Documentation
2
+
3
+ > Embedded documentation for coding agents
4
+
5
+ ## Quick Start
6
+
7
+ ```bash
8
+ # Read the skill overview
9
+ cat docs/SKILL.md
10
+
11
+ # Get the source map
12
+ cat docs/SOURCE_MAP.json
13
+
14
+ # Read topic documentation
15
+ cat docs/<topic>/01-overview.md
16
+ ```
17
+
18
+ ## Structure
19
+
20
+ ```
21
+ docs/
22
+ ├── SKILL.md # Entry point
23
+ ├── README.md # This file
24
+ ├── SOURCE_MAP.json # Export index
25
+ ├── deployer/ (1 files)
26
+ ├── deployment/ (6 files)
27
+ ```
28
+
29
+ ## Version
30
+
31
+ Package: @mastra/deployer
32
+ Version: 1.0.4
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: mastra-deployer-docs
3
+ description: Documentation for @mastra/deployer. Includes links to type definitions and readable implementation code in dist/.
4
+ ---
5
+
6
+ # @mastra/deployer Documentation
7
+
8
+ > **Version**: 1.0.4
9
+ > **Package**: @mastra/deployer
10
+
11
+ ## Quick Navigation
12
+
13
+ Use SOURCE_MAP.json to find any export:
14
+
15
+ ```bash
16
+ cat docs/SOURCE_MAP.json
17
+ ```
18
+
19
+ Each export maps to:
20
+ - **types**: `.d.ts` file with JSDoc and API signatures
21
+ - **implementation**: `.js` chunk file with readable source
22
+ - **docs**: Conceptual documentation in `docs/`
23
+
24
+ ## Top Exports
25
+
26
+ - Deps: dist/index.d.ts
27
+ - FileService: dist/index.d.ts
28
+ - createChildProcessLogger: dist/index.d.ts
29
+ - createPinoStream: dist/index.d.ts
30
+
31
+ See SOURCE_MAP.json for the complete list.
32
+
33
+ ## Available Topics
34
+
35
+ - [Deployer](deployer/) - 1 file(s)
36
+ - [Deployment](deployment/) - 6 file(s)
@@ -0,0 +1,27 @@
1
+ {
2
+ "version": "1.0.4",
3
+ "package": "@mastra/deployer",
4
+ "exports": {
5
+ "Deps": {
6
+ "types": "dist/index.d.ts",
7
+ "implementation": "dist/chunk-DPDWM7HQ.js",
8
+ "line": 60
9
+ },
10
+ "FileService": {
11
+ "types": "dist/index.d.ts",
12
+ "implementation": "dist/chunk-DPDWM7HQ.js",
13
+ "line": 337
14
+ },
15
+ "createChildProcessLogger": {
16
+ "types": "dist/index.d.ts",
17
+ "implementation": "dist/chunk-DPDWM7HQ.js",
18
+ "line": 24
19
+ },
20
+ "createPinoStream": {
21
+ "types": "dist/index.d.ts",
22
+ "implementation": "dist/chunk-DPDWM7HQ.js",
23
+ "line": 12
24
+ }
25
+ },
26
+ "modules": {}
27
+ }
@@ -0,0 +1,93 @@
1
+ # Deployer API Reference
2
+
3
+ > API reference for deployer - 1 entries
4
+
5
+
6
+ ---
7
+
8
+ ## Reference: Deployer
9
+
10
+ > Documentation for the Deployer abstract class, which handles packaging and deployment of Mastra applications.
11
+
12
+ The Deployer handles the deployment of standalone Mastra applications by packaging code, managing environment files, and serving applications using the Hono framework. Concrete implementations must define the deploy method for specific deployment targets.
13
+
14
+ ## Usage Example
15
+
16
+ ```typescript
17
+ import { Deployer } from "@mastra/deployer";
18
+
19
+ // Create a custom deployer by extending the abstract Deployer class
20
+ class CustomDeployer extends Deployer {
21
+ constructor() {
22
+ super({ name: "custom-deployer" });
23
+ }
24
+
25
+ // Implement the abstract deploy method
26
+ async deploy(outputDirectory: string): Promise<void> {
27
+ // Prepare the output directory
28
+ await this.prepare(outputDirectory);
29
+
30
+ // Bundle the application
31
+ await this._bundle("server.ts", "mastra.ts", outputDirectory);
32
+
33
+ // Custom deployment logic
34
+ }
35
+ }
36
+ ```
37
+
38
+ ## Parameters
39
+
40
+ ### Constructor Parameters
41
+
42
+ ### deploy Parameters
43
+
44
+ ## Methods
45
+
46
+ ## Inherited Methods from Bundler
47
+
48
+ The Deployer class inherits the following key methods from the Bundler class:
49
+
50
+ ## Core Concepts
51
+
52
+ ### Deployment Lifecycle
53
+
54
+ The Deployer abstract class implements a structured deployment lifecycle:
55
+
56
+ 1. **Initialization**: The deployer is initialized with a name and creates a Deps instance for dependency management.
57
+ 2. **Environment Setup**: The `getEnvFiles` method identifies environment files (.env.production, .env) to be used during deployment.
58
+ 3. **Preparation**: The `prepare` method (inherited from Bundler) cleans the output directory and creates necessary subdirectories.
59
+ 4. **Bundling**: The `_bundle` method (inherited from Bundler) packages the application code and its dependencies.
60
+ 5. **Deployment**: The abstract `deploy` method is implemented by subclasses to handle the actual deployment process.
61
+
62
+ ### Environment File Management
63
+
64
+ The Deployer class includes built-in support for environment file management through the `getEnvFiles` method. This method:
65
+
66
+ - Looks for environment files in a predefined order (.env.production, .env)
67
+ - Uses the FileService to find the first existing file
68
+ - Returns an array of found environment files
69
+ - Returns an empty array if no environment files are found
70
+
71
+ ```typescript
72
+ getEnvFiles(): Promise<string[]> {
73
+ const possibleFiles = ['.env.production', '.env.local', '.env'];
74
+
75
+ try {
76
+ const fileService = new FileService();
77
+ const envFile = fileService.getFirstExistingFile(possibleFiles);
78
+
79
+ return Promise.resolve([envFile]);
80
+ } catch {}
81
+
82
+ return Promise.resolve([]);
83
+ }
84
+ ```
85
+
86
+ ### Bundling and Deployment Relationship
87
+
88
+ The Deployer class extends the Bundler class, establishing a clear relationship between bundling and deployment:
89
+
90
+ 1. **Bundling as a Prerequisite**: Bundling is a prerequisite step for deployment, where the application code is packaged into a deployable format.
91
+ 2. **Shared Infrastructure**: Both bundling and deployment share common infrastructure like dependency management and file system operations.
92
+ 3. **Specialized Deployment Logic**: While bundling focuses on code packaging, deployment adds environment-specific logic for deploying the bundled code.
93
+ 4. **Extensibility**: The abstract `deploy` method allows for creating specialized deployers for different target environments.
@@ -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.