@mastra/deployer 0.0.0-error-handler-fix-20251020202607 → 0.0.0-esbuild-bundle-worker-20260807182016

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 (319) hide show
  1. package/CHANGELOG.md +5691 -5
  2. package/LICENSE.md +15 -0
  3. package/dist/_types/@hono_node-server/dist/index.d.mts +101 -0
  4. package/dist/_types/@mastra_hono/dist/auth-middleware.d.ts +8 -0
  5. package/dist/_types/@mastra_hono/dist/browser-stream/index.d.ts +35 -0
  6. package/dist/_types/@mastra_hono/dist/index.d.ts +59 -0
  7. package/dist/analyze-7xxwhB5F.js +1405 -0
  8. package/dist/analyze-7xxwhB5F.js.map +1 -0
  9. package/dist/analyze-D100622N.cjs +1434 -0
  10. package/dist/analyze-D100622N.cjs.map +1 -0
  11. package/dist/arktype-aI7TBD0R-BWucI7hY.cjs +8 -0
  12. package/dist/arktype-aI7TBD0R-BWucI7hY.cjs.map +1 -0
  13. package/dist/arktype-aI7TBD0R-D06--n84.js +8 -0
  14. package/dist/arktype-aI7TBD0R-D06--n84.js.map +1 -0
  15. package/dist/build/analyze/analyzeEntry.d.ts +17 -11
  16. package/dist/build/analyze/analyzeEntry.d.ts.map +1 -1
  17. package/dist/build/analyze/bundleExternals.d.ts +8 -7
  18. package/dist/build/analyze/bundleExternals.d.ts.map +1 -1
  19. package/dist/build/analyze/constants.d.ts.map +1 -1
  20. package/dist/build/analyze.cjs +3 -12
  21. package/dist/build/analyze.d.ts +15 -7
  22. package/dist/build/analyze.d.ts.map +1 -1
  23. package/dist/build/analyze.js +2 -3
  24. package/dist/build/analyzeEntryProjectType.d.ts +12 -0
  25. package/dist/build/analyzeEntryProjectType.d.ts.map +1 -0
  26. package/dist/build/babel/check-config-export.d.ts +3 -2
  27. package/dist/build/babel/check-config-export.d.ts.map +1 -1
  28. package/dist/build/babel/detect-pino-transports.d.ts +13 -0
  29. package/dist/build/babel/detect-pino-transports.d.ts.map +1 -0
  30. package/dist/build/babel/remove-all-options-except.d.ts +3 -3
  31. package/dist/build/babel/remove-all-options-except.d.ts.map +1 -1
  32. package/dist/build/babel/remove-deployer.d.ts +6 -2
  33. package/dist/build/babel/remove-deployer.d.ts.map +1 -1
  34. package/dist/build/babel/remove-non-referenced-nodes.d.ts +2 -2
  35. package/dist/build/babel/remove-non-referenced-nodes.d.ts.map +1 -1
  36. package/dist/build/bundler.cjs +6 -16
  37. package/dist/build/bundler.d.ts +13 -3
  38. package/dist/build/bundler.d.ts.map +1 -1
  39. package/dist/build/bundler.js +2 -3
  40. package/dist/build/bundlerOptions.d.ts +1 -1
  41. package/dist/build/bundlerOptions.d.ts.map +1 -1
  42. package/dist/build/deployer.d.ts +1 -1
  43. package/dist/build/deployer.d.ts.map +1 -1
  44. package/dist/build/fs-routing/codegen.d.ts +42 -0
  45. package/dist/build/fs-routing/codegen.d.ts.map +1 -0
  46. package/dist/build/fs-routing/discover.d.ts +178 -0
  47. package/dist/build/fs-routing/discover.d.ts.map +1 -0
  48. package/dist/build/fs-routing/mirror.d.ts +16 -0
  49. package/dist/build/fs-routing/mirror.d.ts.map +1 -0
  50. package/dist/build/fs-routing/prepare.d.ts +67 -0
  51. package/dist/build/fs-routing/prepare.d.ts.map +1 -0
  52. package/dist/build/index.cjs +29 -52
  53. package/dist/build/index.d.ts +9 -1
  54. package/dist/build/index.d.ts.map +1 -1
  55. package/dist/build/index.js +7 -7
  56. package/dist/build/package-info.d.ts +14 -0
  57. package/dist/build/package-info.d.ts.map +1 -0
  58. package/dist/build/plugins/esm-shim.d.ts +14 -0
  59. package/dist/build/plugins/esm-shim.d.ts.map +1 -0
  60. package/dist/build/plugins/local-storage-detector.d.ts +50 -0
  61. package/dist/build/plugins/local-storage-detector.d.ts.map +1 -0
  62. package/dist/build/plugins/module-resolve-map.d.ts +3 -0
  63. package/dist/build/plugins/module-resolve-map.d.ts.map +1 -0
  64. package/dist/build/plugins/node-gyp-detector.d.ts +3 -0
  65. package/dist/build/plugins/node-gyp-detector.d.ts.map +1 -0
  66. package/dist/build/plugins/node-modules-extension-resolver.d.ts +7 -0
  67. package/dist/build/plugins/node-modules-extension-resolver.d.ts.map +1 -1
  68. package/dist/build/plugins/pino.d.ts.map +1 -1
  69. package/dist/build/plugins/protocol-external-resolver.d.ts +5 -0
  70. package/dist/build/plugins/protocol-external-resolver.d.ts.map +1 -0
  71. package/dist/build/plugins/remove-all-except.d.ts +10 -0
  72. package/dist/build/plugins/remove-all-except.d.ts.map +1 -0
  73. package/dist/build/plugins/remove-deployer.d.ts.map +1 -1
  74. package/dist/build/plugins/remove-unused-references.d.ts.map +1 -1
  75. package/dist/build/plugins/subpath-externals-resolver.d.ts +3 -0
  76. package/dist/build/plugins/subpath-externals-resolver.d.ts.map +1 -0
  77. package/dist/build/plugins/tsconfig-paths.d.ts +8 -0
  78. package/dist/build/plugins/tsconfig-paths.d.ts.map +1 -1
  79. package/dist/build/plugins/workspace-deps-watcher.d.ts +33 -0
  80. package/dist/build/plugins/workspace-deps-watcher.d.ts.map +1 -0
  81. package/dist/build/serverOptions.d.ts +1 -1
  82. package/dist/build/serverOptions.d.ts.map +1 -1
  83. package/dist/build/shared/extract-mastra-option.d.ts +5 -9
  84. package/dist/build/shared/extract-mastra-option.d.ts.map +1 -1
  85. package/dist/build/types.d.ts +35 -0
  86. package/dist/build/types.d.ts.map +1 -1
  87. package/dist/build/utils.d.ts +106 -2
  88. package/dist/build/utils.d.ts.map +1 -1
  89. package/dist/build/watcher.d.ts +5 -1
  90. package/dist/build/watcher.d.ts.map +1 -1
  91. package/dist/build-DEie1huB.js +1084 -0
  92. package/dist/build-DEie1huB.js.map +1 -0
  93. package/dist/build-YV8-9zZy.cjs +1158 -0
  94. package/dist/build-YV8-9zZy.cjs.map +1 -0
  95. package/dist/bundler/entries.d.ts +12 -0
  96. package/dist/bundler/entries.d.ts.map +1 -0
  97. package/dist/bundler/index.cjs +7 -12
  98. package/dist/bundler/index.d.ts +85 -12
  99. package/dist/bundler/index.d.ts.map +1 -1
  100. package/dist/bundler/index.js +2 -3
  101. package/dist/bundler/workspaceDependencies.d.ts +3 -5
  102. package/dist/bundler/workspaceDependencies.d.ts.map +1 -1
  103. package/dist/bundler-CD-PSWRS.cjs +591 -0
  104. package/dist/bundler-CD-PSWRS.cjs.map +1 -0
  105. package/dist/bundler-NdSt2FYG.js +558 -0
  106. package/dist/bundler-NdSt2FYG.js.map +1 -0
  107. package/dist/bundler-U9F2---r.js +704 -0
  108. package/dist/bundler-U9F2---r.js.map +1 -0
  109. package/dist/bundler-u9WOUtpl.cjs +791 -0
  110. package/dist/bundler-u9WOUtpl.cjs.map +1 -0
  111. package/dist/bundlerOptions-9DigsVhY.js +180 -0
  112. package/dist/bundlerOptions-9DigsVhY.js.map +1 -0
  113. package/dist/bundlerOptions-CYRir4LE.cjs +194 -0
  114. package/dist/bundlerOptions-CYRir4LE.cjs.map +1 -0
  115. package/dist/core-D0wEgdn3.cjs +790 -0
  116. package/dist/core-D0wEgdn3.cjs.map +1 -0
  117. package/dist/core-DF65PJXc.js +790 -0
  118. package/dist/core-DF65PJXc.js.map +1 -0
  119. package/dist/deploy/log.d.ts +2 -2
  120. package/dist/deploy/log.d.ts.map +1 -1
  121. package/dist/dist-BauTimif.js +532 -0
  122. package/dist/dist-BauTimif.js.map +1 -0
  123. package/dist/dist-Cv-mAEtr.cjs +532 -0
  124. package/dist/dist-Cv-mAEtr.cjs.map +1 -0
  125. package/dist/docs/SKILL.md +31 -0
  126. package/dist/docs/assets/SOURCE_MAP.json +6 -0
  127. package/dist/docs/references/docs-deployment-cloud-providers.md +23 -0
  128. package/dist/docs/references/docs-deployment-mastra-server.md +157 -0
  129. package/dist/docs/references/docs-deployment-monorepo.md +140 -0
  130. package/dist/docs/references/docs-deployment-overview.md +79 -0
  131. package/dist/docs/references/docs-deployment-web-framework.md +54 -0
  132. package/dist/docs/references/docs-deployment-workflow-runners.md +17 -0
  133. package/dist/docs/references/reference-deployer.md +102 -0
  134. package/dist/effect-QlVUlMFu-CWx-dnsz.cjs +14 -0
  135. package/dist/effect-QlVUlMFu-CWx-dnsz.cjs.map +1 -0
  136. package/dist/effect-QlVUlMFu-CovUzKO9.js +14 -0
  137. package/dist/effect-QlVUlMFu-CovUzKO9.js.map +1 -0
  138. package/dist/esm-B51vJPGv.js +4634 -0
  139. package/dist/esm-B51vJPGv.js.map +1 -0
  140. package/dist/esm-DZ1Siz1C.cjs +4634 -0
  141. package/dist/esm-DZ1Siz1C.cjs.map +1 -0
  142. package/dist/index-CLddUTqr-Btqs8t-3.js +140 -0
  143. package/dist/index-CLddUTqr-Btqs8t-3.js.map +1 -0
  144. package/dist/index-CLddUTqr-C8lMvBz9.cjs +145 -0
  145. package/dist/index-CLddUTqr-C8lMvBz9.cjs.map +1 -0
  146. package/dist/index.cjs +35 -59
  147. package/dist/index.cjs.map +1 -1
  148. package/dist/index.js +29 -41
  149. package/dist/index.js.map +1 -1
  150. package/dist/rolldown-runtime-emK7D4bc.cjs +35 -0
  151. package/dist/server/handlers/a2a.d.ts +28 -3
  152. package/dist/server/handlers/a2a.d.ts.map +1 -1
  153. package/dist/server/handlers/agent-learning.d.ts +3 -0
  154. package/dist/server/handlers/agent-learning.d.ts.map +1 -0
  155. package/dist/server/handlers/health.d.ts +5 -0
  156. package/dist/server/handlers/health.d.ts.map +1 -0
  157. package/dist/server/handlers/restart-active-runs.d.ts +3 -0
  158. package/dist/server/handlers/restart-active-runs.d.ts.map +1 -0
  159. package/dist/server/handlers/utils/query-parsers.d.ts +15 -0
  160. package/dist/server/handlers/utils/query-parsers.d.ts.map +1 -1
  161. package/dist/server/handlers/utils.d.ts +0 -7
  162. package/dist/server/handlers/utils.d.ts.map +1 -1
  163. package/dist/server/index.cjs +4375 -11856
  164. package/dist/server/index.cjs.map +1 -1
  165. package/dist/server/index.d.ts +4 -13
  166. package/dist/server/index.d.ts.map +1 -1
  167. package/dist/server/index.js +4370 -11830
  168. package/dist/server/index.js.map +1 -1
  169. package/dist/server/types.d.ts +2 -1
  170. package/dist/server/types.d.ts.map +1 -1
  171. package/dist/server/welcome.d.ts +1 -1
  172. package/dist/server/welcome.d.ts.map +1 -1
  173. package/dist/services/deps.d.ts +9 -1
  174. package/dist/services/deps.d.ts.map +1 -1
  175. package/dist/services/env.d.ts.map +1 -1
  176. package/dist/services/index.cjs +5 -20
  177. package/dist/services/index.js +2 -3
  178. package/dist/services-BRF1RRXB.js +430 -0
  179. package/dist/services-BRF1RRXB.js.map +1 -0
  180. package/dist/services-_ksvysL5.cjs +469 -0
  181. package/dist/services-_ksvysL5.cjs.map +1 -0
  182. package/dist/sury-CWZTCd75-Bbjr0vWq.cjs +14 -0
  183. package/dist/sury-CWZTCd75-Bbjr0vWq.cjs.map +1 -0
  184. package/dist/sury-CWZTCd75-C3LyvnOp.js +14 -0
  185. package/dist/sury-CWZTCd75-C3LyvnOp.js.map +1 -0
  186. package/dist/typebox-Dei93FPO-EcvSqxpn.js +8 -0
  187. package/dist/typebox-Dei93FPO-EcvSqxpn.js.map +1 -0
  188. package/dist/typebox-Dei93FPO-n37w7tHC.cjs +8 -0
  189. package/dist/typebox-Dei93FPO-n37w7tHC.cjs.map +1 -0
  190. package/dist/utils-FVOUvj-I.js +190 -0
  191. package/dist/utils-FVOUvj-I.js.map +1 -0
  192. package/dist/utils-O98BGdnP.cjs +267 -0
  193. package/dist/utils-O98BGdnP.cjs.map +1 -0
  194. package/dist/valibot--1zFm7rT-BN2-Xy7Y.cjs +14 -0
  195. package/dist/valibot--1zFm7rT-BN2-Xy7Y.cjs.map +1 -0
  196. package/dist/valibot--1zFm7rT-DLXBDt2x.js +14 -0
  197. package/dist/valibot--1zFm7rT-DLXBDt2x.js.map +1 -0
  198. package/dist/validator/custom-resolver.cjs +77 -45
  199. package/dist/validator/custom-resolver.cjs.map +1 -1
  200. package/dist/validator/custom-resolver.d.ts +15 -1
  201. package/dist/validator/custom-resolver.d.ts.map +1 -1
  202. package/dist/validator/custom-resolver.js +74 -42
  203. package/dist/validator/custom-resolver.js.map +1 -1
  204. package/dist/validator/loader.cjs +6 -7
  205. package/dist/validator/loader.cjs.map +1 -1
  206. package/dist/validator/loader.js +8 -4
  207. package/dist/validator/loader.js.map +1 -1
  208. package/dist/validator/validate.d.ts +16 -1
  209. package/dist/validator/validate.d.ts.map +1 -1
  210. package/dist/zod-Bwrt9trS-Cbwhu5Zl.cjs +23 -0
  211. package/dist/zod-Bwrt9trS-Cbwhu5Zl.cjs.map +1 -0
  212. package/dist/zod-Bwrt9trS-Si3ZkB_H.js +23 -0
  213. package/dist/zod-Bwrt9trS-Si3ZkB_H.js.map +1 -0
  214. package/package.json +50 -45
  215. package/dist/build/analyze.cjs.map +0 -1
  216. package/dist/build/analyze.js.map +0 -1
  217. package/dist/build/babel/get-deployer.d.ts +0 -3
  218. package/dist/build/babel/get-deployer.d.ts.map +0 -1
  219. package/dist/build/babel/remove-all-options-bundler.d.ts +0 -5
  220. package/dist/build/babel/remove-all-options-bundler.d.ts.map +0 -1
  221. package/dist/build/babel/remove-all-options-deployer.d.ts +0 -5
  222. package/dist/build/babel/remove-all-options-deployer.d.ts.map +0 -1
  223. package/dist/build/babel/remove-all-options-server.d.ts +0 -5
  224. package/dist/build/babel/remove-all-options-server.d.ts.map +0 -1
  225. package/dist/build/babel/remove-all-options-telemetry.d.ts +0 -5
  226. package/dist/build/babel/remove-all-options-telemetry.d.ts.map +0 -1
  227. package/dist/build/bundler.cjs.map +0 -1
  228. package/dist/build/bundler.js.map +0 -1
  229. package/dist/build/customInstrumentation.d.ts +0 -10
  230. package/dist/build/customInstrumentation.d.ts.map +0 -1
  231. package/dist/build/index.cjs.map +0 -1
  232. package/dist/build/index.js.map +0 -1
  233. package/dist/build/telemetry.d.ts +0 -8
  234. package/dist/build/telemetry.d.ts.map +0 -1
  235. package/dist/bundler/index.cjs.map +0 -1
  236. package/dist/bundler/index.js.map +0 -1
  237. package/dist/chunk-3JYRSECU.cjs +0 -430
  238. package/dist/chunk-3JYRSECU.cjs.map +0 -1
  239. package/dist/chunk-465ZVXAK.js +0 -409
  240. package/dist/chunk-465ZVXAK.js.map +0 -1
  241. package/dist/chunk-5QFG6SCM.js +0 -398
  242. package/dist/chunk-5QFG6SCM.js.map +0 -1
  243. package/dist/chunk-CEXVMFUD.js +0 -1265
  244. package/dist/chunk-CEXVMFUD.js.map +0 -1
  245. package/dist/chunk-CKUCDCGI.js +0 -168
  246. package/dist/chunk-CKUCDCGI.js.map +0 -1
  247. package/dist/chunk-HMMDNIEQ.cjs +0 -167
  248. package/dist/chunk-HMMDNIEQ.cjs.map +0 -1
  249. package/dist/chunk-LGC3GUMR.cjs +0 -437
  250. package/dist/chunk-LGC3GUMR.cjs.map +0 -1
  251. package/dist/chunk-MCDDO4WY.cjs +0 -1309
  252. package/dist/chunk-MCDDO4WY.cjs.map +0 -1
  253. package/dist/chunk-OYO2MJED.cjs +0 -195
  254. package/dist/chunk-OYO2MJED.cjs.map +0 -1
  255. package/dist/chunk-SBTEIZ3B.js +0 -26
  256. package/dist/chunk-SBTEIZ3B.js.map +0 -1
  257. package/dist/chunk-WAWEQ3DP.js +0 -156
  258. package/dist/chunk-WAWEQ3DP.js.map +0 -1
  259. package/dist/chunk-WIQEFIRX.cjs +0 -28
  260. package/dist/chunk-WIQEFIRX.cjs.map +0 -1
  261. package/dist/server/handlers/auth/defaults.d.ts +0 -3
  262. package/dist/server/handlers/auth/defaults.d.ts.map +0 -1
  263. package/dist/server/handlers/auth/helpers.d.ts +0 -11
  264. package/dist/server/handlers/auth/helpers.d.ts.map +0 -1
  265. package/dist/server/handlers/auth/index.d.ts +0 -11
  266. package/dist/server/handlers/auth/index.d.ts.map +0 -1
  267. package/dist/server/handlers/prompt.d.ts +0 -3
  268. package/dist/server/handlers/prompt.d.ts.map +0 -1
  269. package/dist/server/handlers/routes/agent-builder/handlers.d.ts +0 -17
  270. package/dist/server/handlers/routes/agent-builder/handlers.d.ts.map +0 -1
  271. package/dist/server/handlers/routes/agent-builder/router.d.ts +0 -4
  272. package/dist/server/handlers/routes/agent-builder/router.d.ts.map +0 -1
  273. package/dist/server/handlers/routes/agents/handlers.d.ts +0 -363
  274. package/dist/server/handlers/routes/agents/handlers.d.ts.map +0 -1
  275. package/dist/server/handlers/routes/agents/router.d.ts +0 -5
  276. package/dist/server/handlers/routes/agents/router.d.ts.map +0 -1
  277. package/dist/server/handlers/routes/agents/voice.d.ts +0 -18
  278. package/dist/server/handlers/routes/agents/voice.d.ts.map +0 -1
  279. package/dist/server/handlers/routes/logs/handlers.d.ts +0 -5
  280. package/dist/server/handlers/routes/logs/handlers.d.ts.map +0 -1
  281. package/dist/server/handlers/routes/logs/router.d.ts +0 -3
  282. package/dist/server/handlers/routes/logs/router.d.ts.map +0 -1
  283. package/dist/server/handlers/routes/mcp/handlers.d.ts +0 -139
  284. package/dist/server/handlers/routes/mcp/handlers.d.ts.map +0 -1
  285. package/dist/server/handlers/routes/mcp/router.d.ts +0 -4
  286. package/dist/server/handlers/routes/mcp/router.d.ts.map +0 -1
  287. package/dist/server/handlers/routes/memory/handlers.d.ts +0 -17
  288. package/dist/server/handlers/routes/memory/handlers.d.ts.map +0 -1
  289. package/dist/server/handlers/routes/memory/router.d.ts +0 -4
  290. package/dist/server/handlers/routes/memory/router.d.ts.map +0 -1
  291. package/dist/server/handlers/routes/observability/handlers.d.ts +0 -6
  292. package/dist/server/handlers/routes/observability/handlers.d.ts.map +0 -1
  293. package/dist/server/handlers/routes/observability/router.d.ts +0 -3
  294. package/dist/server/handlers/routes/observability/router.d.ts.map +0 -1
  295. package/dist/server/handlers/routes/scores/handlers.d.ts +0 -300
  296. package/dist/server/handlers/routes/scores/handlers.d.ts.map +0 -1
  297. package/dist/server/handlers/routes/scores/router.d.ts +0 -4
  298. package/dist/server/handlers/routes/scores/router.d.ts.map +0 -1
  299. package/dist/server/handlers/routes/telemetry/handlers.d.ts +0 -4
  300. package/dist/server/handlers/routes/telemetry/handlers.d.ts.map +0 -1
  301. package/dist/server/handlers/routes/telemetry/router.d.ts +0 -3
  302. package/dist/server/handlers/routes/telemetry/router.d.ts.map +0 -1
  303. package/dist/server/handlers/routes/tools/handlers.d.ts +0 -7
  304. package/dist/server/handlers/routes/tools/handlers.d.ts.map +0 -1
  305. package/dist/server/handlers/routes/tools/router.d.ts +0 -4
  306. package/dist/server/handlers/routes/tools/router.d.ts.map +0 -1
  307. package/dist/server/handlers/routes/vector/handlers.d.ts +0 -10
  308. package/dist/server/handlers/routes/vector/handlers.d.ts.map +0 -1
  309. package/dist/server/handlers/routes/vector/router.d.ts +0 -4
  310. package/dist/server/handlers/routes/vector/router.d.ts.map +0 -1
  311. package/dist/server/handlers/routes/workflows/handlers.d.ts +0 -20
  312. package/dist/server/handlers/routes/workflows/handlers.d.ts.map +0 -1
  313. package/dist/server/handlers/routes/workflows/legacyWorkflows.d.ts +0 -11
  314. package/dist/server/handlers/routes/workflows/legacyWorkflows.d.ts.map +0 -1
  315. package/dist/server/handlers/routes/workflows/router.d.ts +0 -4
  316. package/dist/server/handlers/routes/workflows/router.d.ts.map +0 -1
  317. package/dist/services/index.cjs.map +0 -1
  318. package/dist/services/index.js.map +0 -1
  319. package/dist/templates/instrumentation-template.js +0 -172
@@ -0,0 +1,50 @@
1
+ import type { Plugin } from 'rollup';
2
+ export interface LocalStorageDetection {
3
+ value: string;
4
+ hint: string;
5
+ module: string;
6
+ /**
7
+ * Name of the env var that guards this literal at runtime, when the
8
+ * literal is the fallback arm of a `process.env.X || literal` (or `??`)
9
+ * expression. The CLI preflight uses this to suppress or soften the
10
+ * error when the guarding var is present in the deploy env.
11
+ */
12
+ guardedBy?: string;
13
+ }
14
+ /**
15
+ * Unified preflight metadata emitted as `preflight-metadata.json`.
16
+ * Superset of the legacy `preflight-local-paths.json` (which stays emitted
17
+ * for one release so older CLIs keep working with newer deployers).
18
+ */
19
+ export interface PreflightMetadata {
20
+ version: 1;
21
+ localPaths: LocalStorageDetection[];
22
+ userEnvRefs: string[];
23
+ }
24
+ /**
25
+ * Rollup plugin that detects host-local storage URLs (e.g. `file:./mastra.db`,
26
+ * `postgres://localhost`) in **user source modules** during bundling, and
27
+ * collects the env vars user code reads via `process.env.X`.
28
+ *
29
+ * Only modules outside `node_modules` (and the deployer's own
30
+ * `.mastra/.build/` pre-bundled files) are inspected, so library code
31
+ * (like Agent Builder prompt templates or JSDoc examples in `@mastra/core`)
32
+ * is naturally excluded. When `rootDir` is given, modules outside it are
33
+ * also excluded — symlinked dependencies (pnpm `link:`/`file:`) resolve to
34
+ * real paths that never contain `node_modules`. Tree-shaken modules are
35
+ * excluded via
36
+ * `generateBundle` — only modules that actually contribute rendered code to
37
+ * the output are reported.
38
+ *
39
+ * When a detected literal is the fallback arm of a `process.env.X || literal`
40
+ * expression, `guardedBy: "X"` is recorded so the CLI preflight can apply
41
+ * deploy-time env context instead of hard-erroring on a dead fallback.
42
+ *
43
+ * Two assets are emitted into the output directory for the CLI preflight:
44
+ * - `preflight-metadata.json` — unified metadata (local paths + user env refs)
45
+ * - `preflight-local-paths.json` — legacy shape, kept for one release so an
46
+ * older globally-installed CLI paired with a newer project-local deployer
47
+ * doesn't lose the LOCAL_STORAGE_PATH check.
48
+ */
49
+ export declare function localStorageDetector(rootDir?: string): Plugin;
50
+ //# sourceMappingURL=local-storage-detector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-storage-detector.d.ts","sourceRoot":"","sources":["../../../src/build/plugins/local-storage-detector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAqBrC,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,EAAE,qBAAqB,EAAE,CAAC;IACpC,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAgID;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAuG7D"}
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from 'rollup';
2
+ export declare function moduleResolveMap(externals: string[], projectRoot: string): Plugin;
3
+ //# sourceMappingURL=module-resolve-map.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-resolve-map.d.ts","sourceRoot":"","sources":["../../../src/build/plugins/module-resolve-map.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAiDjF"}
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from 'rollup';
2
+ export declare function nodeGypDetector(): Plugin;
3
+ //# sourceMappingURL=node-gyp-detector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-gyp-detector.d.ts","sourceRoot":"","sources":["../../../src/build/plugins/node-gyp-detector.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,wBAAgB,eAAe,IAAI,MAAM,CAwDxC"}
@@ -1,3 +1,10 @@
1
1
  import type { Plugin } from 'rollup';
2
+ /**
3
+ * Rollup plugin that resolves module extensions for external dependencies.
4
+ *
5
+ * This plugin handles ESM compatibility for external imports when node-resolve is not used:
6
+ * - Packages WITH exports field (e.g., hono, date-fns): Keep imports as-is or strip redundant extensions
7
+ * - Packages WITHOUT exports field (e.g., lodash): Add .js extension for direct file imports
8
+ */
2
9
  export declare function nodeModulesExtensionResolver(): Plugin;
3
10
  //# sourceMappingURL=node-modules-extension-resolver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"node-modules-extension-resolver.d.ts","sourceRoot":"","sources":["../../../src/build/plugins/node-modules-extension-resolver.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AA0BrC,wBAAgB,4BAA4B,IAAI,MAAM,CAyErD"}
1
+ {"version":3,"file":"node-modules-extension-resolver.d.ts","sourceRoot":"","sources":["../../../src/build/plugins/node-modules-extension-resolver.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAmBrC;;;;;;GAMG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,CAuDrD"}
@@ -1 +1 @@
1
- {"version":3,"file":"pino.d.ts","sourceRoot":"","sources":["../../../src/build/plugins/pino.ts"],"names":[],"mappings":"AAGA,wBAAgB,IAAI;;;;;;;;;;;EAkGnB"}
1
+ {"version":3,"file":"pino.d.ts","sourceRoot":"","sources":["../../../src/build/plugins/pino.ts"],"names":[],"mappings":"AAEA,wBAAgB,IAAI;;;;;;;;;;;EAgGnB"}
@@ -0,0 +1,5 @@
1
+ import type { Plugin } from 'rollup';
2
+ export declare function protocolExternalResolver({ exclude }?: {
3
+ exclude?: readonly string[];
4
+ }): Plugin;
5
+ //# sourceMappingURL=protocol-external-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol-external-resolver.d.ts","sourceRoot":"","sources":["../../../src/build/plugins/protocol-external-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,wBAAgB,wBAAwB,CAAC,EAAE,OAAmB,EAAE,GAAE;IAAE,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAO,GAAG,MAAM,CAc9G"}
@@ -0,0 +1,10 @@
1
+ import type { IMastraLogger } from '@mastra/core/logger';
2
+ import type { Config as MastraConfig } from '@mastra/core/mastra';
3
+ import type { Plugin } from 'rollup';
4
+ export declare function removeAllOptionsFromMastraExceptPlugin(mastraEntry: string, name: keyof MastraConfig, result: {
5
+ hasCustomConfig: boolean;
6
+ }, options?: {
7
+ sourcemap?: boolean;
8
+ logger?: IMastraLogger;
9
+ }): Plugin;
10
+ //# sourceMappingURL=remove-all-except.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-all-except.d.ts","sourceRoot":"","sources":["../../../src/build/plugins/remove-all-except.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,QAAQ,CAAC;AAGrD,wBAAgB,sCAAsC,CACpD,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,YAAY,EACxB,MAAM,EAAE;IAAE,eAAe,EAAE,OAAO,CAAA;CAAE,EACpC,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,aAAa,CAAA;CAAE,GACxD,MAAM,CAoBR"}
@@ -1 +1 @@
1
- {"version":3,"file":"remove-deployer.d.ts","sourceRoot":"","sources":["../../../src/build/plugins/remove-deployer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIrC,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAgC7F"}
1
+ {"version":3,"file":"remove-deployer.d.ts","sourceRoot":"","sources":["../../../src/build/plugins/remove-deployer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,QAAQ,CAAC;AAIrD,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAoB7F"}
@@ -1 +1 @@
1
- {"version":3,"file":"remove-unused-references.d.ts","sourceRoot":"","sources":["../../../src/build/plugins/remove-unused-references.ts"],"names":[],"mappings":"AAGA,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,MAAM;UACjC,MAAM;SAAO,GAAG;GAyB5C"}
1
+ {"version":3,"file":"remove-unused-references.d.ts","sourceRoot":"","sources":["../../../src/build/plugins/remove-unused-references.ts"],"names":[],"mappings":"AAGA,wBAAsB,iCAAiC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,GAAG,CAAA;CAAE,CAAC,CAgBzG"}
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from 'rollup';
2
+ export declare function subpathExternalsResolver(externals: string[]): Plugin;
3
+ //# sourceMappingURL=subpath-externals-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subpath-externals-resolver.d.ts","sourceRoot":"","sources":["../../../src/build/plugins/subpath-externals-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,CAiBpE"}
@@ -3,5 +3,13 @@ import type { RegisterOptions } from 'typescript-paths';
3
3
  export type PluginOptions = Omit<RegisterOptions, 'loggerID'> & {
4
4
  localResolve?: boolean;
5
5
  };
6
+ /**
7
+ * Check if a tsconfig file has path mappings configured.
8
+ * Exported for testing purposes.
9
+ *
10
+ * @param tsConfigPath - Path to the tsconfig.json file
11
+ * @returns true if the tsconfig has paths configured or extends another config, false otherwise
12
+ */
13
+ export declare function hasPaths(tsConfigPath: string): boolean;
6
14
  export declare function tsConfigPaths({ tsConfigPath, respectCoreModule, localResolve }?: PluginOptions): Plugin;
7
15
  //# sourceMappingURL=tsconfig-paths.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tsconfig-paths.d.ts","sourceRoot":"","sources":["../../../src/build/plugins/tsconfig-paths.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAKxD,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG;IAAE,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE3F,wBAAgB,aAAa,CAAC,EAAE,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,GAAE,aAAkB,GAAG,MAAM,CAgF3G"}
1
+ {"version":3,"file":"tsconfig-paths.d.ts","sourceRoot":"","sources":["../../../src/build/plugins/tsconfig-paths.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAMxD,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG;IAAE,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE3F;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAYtD;AAED,wBAAgB,aAAa,CAAC,EAAE,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,GAAE,aAAkB,GAAG,MAAM,CA6L3G"}
@@ -0,0 +1,33 @@
1
+ import type { Plugin } from 'rollup';
2
+ import type { WorkspacePackageInfo } from '../../bundler/workspaceDependencies.js';
3
+ import type { BundlerOptions, DependencyMetadata } from '../types.js';
4
+ import type { BundlerPlatform } from '../utils.js';
5
+ export type WorkspaceDepsWatcherOptions = {
6
+ depsToOptimize: Map<string, DependencyMetadata>;
7
+ /**
8
+ * Optimized dependency → relative cache file path (from analyzeBundle.dependencies).
9
+ * Used to detect missing cache files that must be regenerated.
10
+ */
11
+ optimizedDependencyFiles: Map<string, string>;
12
+ workspaceMap: Map<string, WorkspacePackageInfo>;
13
+ workspaceRoot: string;
14
+ outputDir: string;
15
+ platform: BundlerPlatform;
16
+ bundlerOptions?: Pick<BundlerOptions, 'externals' | 'enableSourcemap' | 'dynamicPackages'> | null;
17
+ };
18
+ /**
19
+ * During `mastra dev`, workspace packages are pre-transpiled into
20
+ * `<pkg>/node_modules/.cache/*.mjs` and marked external in the main Rollup
21
+ * watch graph. This plugin:
22
+ * 1. Watches the original workspace package sources so edits trigger rebuilds.
23
+ * 2. Regenerates the optimized `.cache` outputs when those sources change (or
24
+ * when cache files are missing) before the rebuild finishes — so a later
25
+ * server restart loads fresh package code.
26
+ */
27
+ export declare function workspaceDepsWatcher(options: WorkspaceDepsWatcherOptions): Plugin;
28
+ /**
29
+ * On-disk cache entry path for a workspace dependency after optimization.
30
+ * Naming matches createVirtualDependencies: dep.replaceAll('/', '__').
31
+ */
32
+ export declare function getWorkspaceDepCacheEntryPath(rootPath: string, dep: string): string;
33
+ //# sourceMappingURL=workspace-deps-watcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-deps-watcher.d.ts","sourceRoot":"","sources":["../../../src/build/plugins/workspace-deps-watcher.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAEhF,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAMhD,MAAM,MAAM,2BAA2B,GAAG;IACxC,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAChD;;;OAGG;IACH,wBAAwB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAChD,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,eAAe,CAAC;IAC1B,cAAc,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,WAAW,GAAG,iBAAiB,GAAG,iBAAiB,CAAC,GAAG,IAAI,CAAC;CACnG,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,GAAG,MAAM,CA8CjF;AAqGD;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAGnF"}
@@ -1,5 +1,5 @@
1
- import type { Config } from '@mastra/core/mastra';
2
1
  import type { IMastraLogger } from '@mastra/core/logger';
2
+ import type { Config } from '@mastra/core/mastra';
3
3
  export declare function getServerOptionsBundler(entryFile: string, result: {
4
4
  hasCustomConfig: false;
5
5
  }): Promise<import("rollup").RollupBuild>;
@@ -1 +1 @@
1
- {"version":3,"file":"serverOptions.d.ts","sourceRoot":"","sources":["../../src/build/serverOptions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE;IACN,eAAe,EAAE,KAAK,CAAC;CACxB,yCAGF;AAED,wBAAsB,gBAAgB,CACpC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,aAAa,GACrB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAalC"}
1
+ {"version":3,"file":"serverOptions.d.ts","sourceRoot":"","sources":["../../src/build/serverOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGlD,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE;IACN,eAAe,EAAE,KAAK,CAAC;CACxB,yCAGF;AAED,wBAAsB,gBAAgB,CACpC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,aAAa,GACrB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAOlC"}
@@ -1,15 +1,11 @@
1
- import { type RollupOutput } from 'rollup';
2
- import { removeAllOptionsFromMastraExcept } from '../babel/remove-all-options-except.js';
3
1
  import type { IMastraLogger } from '@mastra/core/logger';
4
- type Transformer = (result: {
2
+ import type { Config as MastraConfig } from '@mastra/core/mastra';
3
+ import type { RollupOutput } from 'rollup';
4
+ export declare function extractMastraOptionBundler(name: keyof MastraConfig, entryFile: string, result: {
5
5
  hasCustomConfig: boolean;
6
- }, logger?: IMastraLogger) => ReturnType<typeof removeAllOptionsFromMastraExcept>;
7
- export declare function extractMastraOptionBundler(name: string, entryFile: string, transformer: Transformer, result: {
8
- hasCustomConfig: false;
9
6
  }, logger?: IMastraLogger): Promise<import("rollup").RollupBuild>;
10
- export declare function extractMastraOption<T>(name: string, entryFile: string, transformer: Transformer, outputDir: string, logger?: IMastraLogger): Promise<{
7
+ export declare function extractMastraOption<T extends keyof MastraConfig>(name: T, entryFile: string, outputDir: string, logger?: IMastraLogger): Promise<{
11
8
  bundleOutput: RollupOutput;
12
- getConfig: () => Promise<T>;
9
+ getConfig: () => Promise<MastraConfig[T]>;
13
10
  } | null>;
14
- export {};
15
11
  //# sourceMappingURL=extract-mastra-option.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extract-mastra-option.d.ts","sourceRoot":"","sources":["../../../src/build/shared/extract-mastra-option.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AAMnD,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AAEtF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,KAAK,WAAW,GAAG,CACjB,MAAM,EAAE;IAAE,eAAe,EAAE,OAAO,CAAA;CAAE,EACpC,MAAM,CAAC,EAAE,aAAa,KACnB,UAAU,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAEzD,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE;IACN,eAAe,EAAE,KAAK,CAAC;CACxB,EACD,MAAM,CAAC,EAAE,aAAa,yCAoEvB;AAED,wBAAsB,mBAAmB,CAAC,CAAC,EACzC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,aAAa,GACrB,OAAO,CAAC;IACT,YAAY,EAAE,YAAY,CAAC;IAC3B,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;CAC7B,GAAG,IAAI,CAAC,CAsBR"}
1
+ {"version":3,"file":"extract-mastra-option.d.ts","sourceRoot":"","sources":["../../../src/build/shared/extract-mastra-option.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAKlE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAM3C,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,MAAM,YAAY,EACxB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE;IACN,eAAe,EAAE,OAAO,CAAC;CAC1B,EACD,MAAM,CAAC,EAAE,aAAa,yCAuCvB;AAED,wBAAsB,mBAAmB,CAAC,CAAC,SAAS,MAAM,YAAY,EACpE,IAAI,EAAE,CAAC,EACP,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,aAAa,GACrB,OAAO,CAAC;IACT,YAAY,EAAE,YAAY,CAAC;IAC3B,SAAS,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;CAC3C,GAAG,IAAI,CAAC,CAuBR"}
@@ -14,5 +14,40 @@ export interface DependencyMetadata {
14
14
  * Whether the dependency is a workspace package
15
15
  */
16
16
  isWorkspace: boolean;
17
+ /**
18
+ * The resolved version of the dependency (exact version from package.json)
19
+ */
20
+ version?: string;
21
+ /**
22
+ * The package.json dependency value to install when it differs from the resolved version.
23
+ * For npm aliases, this uses npm alias syntax (e.g. npm:actual-package@1.0.0).
24
+ */
25
+ packageSpec?: string;
26
+ }
27
+ export interface BundlerOptions {
28
+ enableSourcemap: boolean;
29
+ enableEsmShim: boolean;
30
+ externals: boolean | string[];
31
+ dynamicPackages?: string[];
32
+ /**
33
+ * Extra process entries to emit beside the server bundle, as output name ->
34
+ * absolute source path. Already resolved and validated against the user's
35
+ * `bundler.entries` config; see `resolveExtraEntries`.
36
+ */
37
+ entries?: Record<string, string>;
38
+ }
39
+ /**
40
+ * Version information for an external dependency
41
+ */
42
+ export interface ExternalDependencyInfo {
43
+ /**
44
+ * The resolved version of the dependency (exact version from package.json)
45
+ */
46
+ version?: string;
47
+ /**
48
+ * The package.json dependency value to install when it differs from the resolved version.
49
+ * For npm aliases, this uses npm alias syntax (e.g. npm:actual-package@1.0.0).
50
+ */
51
+ packageSpec?: string;
17
52
  }
18
53
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/build/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;CACtB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/build/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,eAAe,EAAE,OAAO,CAAC;IACzB,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,OAAO,GAAG,MAAM,EAAE,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
@@ -1,14 +1,49 @@
1
+ import type { RollupNodeResolveOptions } from '@rollup/plugin-node-resolve';
2
+ /** The detected JavaScript runtime environment */
3
+ export type RuntimePlatform = 'node' | 'bun';
4
+ /**
5
+ * The esbuild/bundler platform setting.
6
+ * - 'node': Assumes Node.js environment, externalizes built-in modules
7
+ * - 'browser': Assumes browser environment, polyfills Node APIs
8
+ * - 'neutral': Runtime-agnostic, preserves all globals as-is (used for Bun)
9
+ */
10
+ export type BundlerPlatform = 'node' | 'browser' | 'neutral';
11
+ /**
12
+ * Get nodeResolve plugin options based on the target platform.
13
+ *
14
+ * For 'browser' platform (e.g., Cloudflare Workers), uses browser-compatible
15
+ * export conditions so packages like the Cloudflare SDK resolve to their
16
+ * web runtime instead of Node.js-specific code.
17
+ *
18
+ * For 'node' and 'neutral' (Bun) platforms, uses Node.js module resolution.
19
+ */
20
+ export declare function getNodeResolveOptions(platform: BundlerPlatform): RollupNodeResolveOptions;
21
+ /**
22
+ * Detect the current JavaScript runtime environment.
23
+ *
24
+ * This is used by the bundler to determine the appropriate esbuild platform
25
+ * setting. When running under Bun, we need to use 'neutral' platform to
26
+ * preserve Bun-specific globals (like Bun.s3).
27
+ */
28
+ export declare function detectRuntime(): RuntimePlatform;
1
29
  export declare function upsertMastraDir({ dir }: {
2
30
  dir?: string;
3
31
  }): void;
32
+ export declare function isDependencyPartOfPackage(dep: string, packageName: string): boolean;
4
33
  /**
5
34
  * Get the package name from a module ID
6
35
  */
7
36
  export declare function getPackageName(id: string): string | undefined;
8
37
  /**
9
- * Get package root path
38
+ * Check if an import specifier uses a protocol scheme rather than a package name.
39
+ * Examples: `cloudflare:workers`, `data:text/javascript,...`, `node:fs`.
40
+ */
41
+ export declare function hasImportProtocol(specifier: string): boolean;
42
+ /**
43
+ * Check if a specifier uses a non-builtin protocol that should be preserved at
44
+ * runtime instead of being treated as an installable dependency.
10
45
  */
11
- export declare function getPackageRootPath(packageName: string, parentPath?: string): Promise<string | null>;
46
+ export declare function isExternalProtocolImport(specifier: string, excludeList?: readonly string[]): boolean;
12
47
  /**
13
48
  * During `mastra dev` we are compiling TS files to JS (inside workspaces) so that users can just their workspace packages.
14
49
  * We store these compiled files inside `node_modules/.cache` for each workspace package.
@@ -42,4 +77,73 @@ export declare function rollupSafeName(name: string, rootDir: string): string;
42
77
  * findNativePackageModule(moduleIds); // Returns '/path/node_modules/bcrypt/bcrypt.js'
43
78
  */
44
79
  export declare function findNativePackageModule(moduleIds: string[]): string | undefined;
80
+ /**
81
+ * Ensures that server.studioBase is normalized:
82
+ * - Adds leading slash if missing (e.g., 'admin' → '/admin')
83
+ * - Removes trailing slashes (e.g., '/admin/' → '/admin')
84
+ * - Normalizes multiple slashes to single slash (e.g., '//api' → '/api')
85
+ * - Returns empty string for root paths ('/' or '')
86
+ *
87
+ * @param studioBase - The studioBase path to normalize
88
+ * @returns Normalized studioBase path string
89
+ * @throws Error if path contains invalid characters ('..', '?', '#')
90
+ */
91
+ export declare function normalizeStudioBase(studioBase: string): string;
92
+ /**
93
+ * Configuration values for Studio's index.html placeholder injection.
94
+ *
95
+ * Each value is the **exact JavaScript expression** that replaces the
96
+ * corresponding `'%%PLACEHOLDER%%'` token (including surrounding quotes).
97
+ *
98
+ * For literal strings pass `"'value'"` (quoted).
99
+ * For runtime expressions pass the raw JS, e.g. `"window.location.hostname"`.
100
+ */
101
+ export interface StudioInjectionConfig {
102
+ host: string;
103
+ port: string;
104
+ protocol: string;
105
+ apiPrefix: string;
106
+ basePath: string;
107
+ hideCloudCta: string;
108
+ cloudApiEndpoint: string;
109
+ experimentalFeatures: string;
110
+ templates: string;
111
+ telemetryDisabled: string;
112
+ requestContextPresets: string;
113
+ experimentalUI: string;
114
+ agentSignals: string;
115
+ signalsUI: string;
116
+ organizationId: string;
117
+ platformProjectId: string;
118
+ platformObservabilityEndpoint: string;
119
+ autoDetectUrl?: string;
120
+ }
121
+ /**
122
+ * Replace all `%%MASTRA_*%%` placeholders in the Studio `index.html` with the
123
+ * supplied configuration values.
124
+ *
125
+ * The `<base href>` tag and the `window.MASTRA_STUDIO_BASE_PATH` assignment
126
+ * use `basePath` as a plain string (no surrounding quotes), while all other
127
+ * placeholders replace `'%%TOKEN%%'` (with surrounding single-quotes in the
128
+ * source HTML) with the provided expression verbatim.
129
+ */
130
+ export declare function injectStudioHtmlConfig(html: string, config: StudioInjectionConfig): string;
131
+ /**
132
+ * Escape a dynamic value for embedding inside a single-quoted JavaScript
133
+ * string literal in the Studio `index.html` (e.g. `window.X = '<value>'`).
134
+ * Without it, an env-derived value containing `'` or `</script>` breaks out
135
+ * of the literal and corrupts (or injects into) the served page.
136
+ */
137
+ export declare function escapeStudioHtmlValue(value: string): string;
138
+ /**
139
+ * Check if a module is a Node.js builtin module
140
+ * @param specifier - Module specifier
141
+ * @returns True if it's a builtin module
142
+ */
143
+ export declare function isBuiltinModule(specifier: string): boolean;
144
+ /**
145
+ * Check whether a module specifier is a bare module import rather than a path,
146
+ * virtual module, or Node builtin.
147
+ */
148
+ export declare function isBareModuleSpecifier(specifier: string): boolean;
45
149
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/build/utils.ts"],"names":[],"mappings":"AAMA,wBAAgB,eAAe,CAAC,EAAE,GAAmB,EAAE,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,QAOxE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,sBAQxC;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAsBzG;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,UAE5E;AAED;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,UAQjC;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAU3D;AAcD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAqB/E"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/build/utils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAE5E,kDAAkD;AAClD,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,KAAK,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;AAE7D;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,eAAe,GAAG,wBAAwB,CAYzF;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,IAAI,eAAe,CAK/C;AAED,wBAAgB,eAAe,CAAC,EAAE,GAAmB,EAAE,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,QAOxE;AAED,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,WAMzE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,sBAQxC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAO5D;AAID;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,MAAM,EACjB,WAAW,GAAE,SAAS,MAAM,EAAyC,GACpE,OAAO,CAMT;AAUD;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,UAE5E;AAED;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,UAQjC;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAU3D;AAcD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAqB/E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CA2B9D;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,6BAA6B,EAAE,MAAM,CAAC;IACtC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,qBAAqB,GAAG,MAAM,CA+B1F;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAU3D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAM1D;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAkBhE"}
@@ -1,6 +1,10 @@
1
1
  import type { InputOptions, OutputOptions } from 'rollup';
2
- export declare function getInputOptions(entryFile: string, platform: 'node' | 'browser', env?: Record<string, string>, { sourcemap }?: {
2
+ import type { BundlerOptions } from './types.js';
3
+ import type { BundlerPlatform } from './utils.js';
4
+ export declare function getInputOptions(entryFile: string, platform: BundlerPlatform, env?: Record<string, string>, { sourcemap, bundlerOptions, analysisEntries, }?: {
3
5
  sourcemap?: boolean;
6
+ bundlerOptions?: BundlerOptions;
7
+ analysisEntries?: string[];
4
8
  }): Promise<InputOptions>;
5
9
  export declare function createWatcher(inputOptions: InputOptions, outputOptions: OutputOptions): Promise<import("rollup").RollupWatcher>;
6
10
  //# sourceMappingURL=watcher.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"watcher.d.ts","sourceRoot":"","sources":["../../src/build/watcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAU,MAAM,QAAQ,CAAC;AAalE,wBAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,EAAE,SAAiB,EAAE,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAO,yBAqEpD;AAED,wBAAsB,aAAa,CAAC,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,2CAY3F"}
1
+ {"version":3,"file":"watcher.d.ts","sourceRoot":"","sources":["../../src/build/watcher.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAU,MAAM,QAAQ,CAAC;AASlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,wBAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,eAAe,EACzB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,EACE,SAAiB,EACjB,cAIC,EACD,eAA6B,GAC9B,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,cAAc,CAAC,EAAE,cAAc,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAAO,yBAqF7F;AAED,wBAAsB,aAAa,CAAC,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,2CAY3F"}