@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,1434 @@
1
+ const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.cjs");
2
+ const require_utils = require("./utils-O98BGdnP.cjs");
3
+ const require_services = require("./services-_ksvysL5.cjs");
4
+ const require_bundler = require("./bundler-u9WOUtpl.cjs");
5
+ let child_process = require("child_process");
6
+ let fs = require("fs");
7
+ let fs_promises = require("fs/promises");
8
+ let path = require("path");
9
+ path = require_rolldown_runtime.__toESM(path, 1);
10
+ let _mastra_core_error = require("@mastra/core/error");
11
+ let _rollup_plugin_virtual = require("@rollup/plugin-virtual");
12
+ _rollup_plugin_virtual = require_rolldown_runtime.__toESM(_rollup_plugin_virtual, 1);
13
+ let empathic_package = require("empathic/package");
14
+ empathic_package = require_rolldown_runtime.__toESM(empathic_package, 1);
15
+ let _babel_core = require("@babel/core");
16
+ let _sindresorhus_slugify = require("@sindresorhus/slugify");
17
+ _sindresorhus_slugify = require_rolldown_runtime.__toESM(_sindresorhus_slugify, 1);
18
+ let find_workspaces = require("find-workspaces");
19
+ let fs_extra = require("fs-extra");
20
+ let url = require("url");
21
+ let _rollup_plugin_commonjs = require("@rollup/plugin-commonjs");
22
+ _rollup_plugin_commonjs = require_rolldown_runtime.__toESM(_rollup_plugin_commonjs, 1);
23
+ let _rollup_plugin_json = require("@rollup/plugin-json");
24
+ _rollup_plugin_json = require_rolldown_runtime.__toESM(_rollup_plugin_json, 1);
25
+ let rollup = require("rollup");
26
+ let _optimize_lodash_rollup_plugin = require("@optimize-lodash/rollup-plugin");
27
+ let _rollup_plugin_node_resolve = require("@rollup/plugin-node-resolve");
28
+ _rollup_plugin_node_resolve = require_rolldown_runtime.__toESM(_rollup_plugin_node_resolve, 1);
29
+ let local_pkg = require("local-pkg");
30
+ let path_posix = require("path/posix");
31
+ let resolve_exports = require("resolve.exports");
32
+ resolve_exports = require_rolldown_runtime.__toESM(resolve_exports, 1);
33
+ //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/stacktrace-parser/0.1.11/63406bc765474556691ebd1b24eaa0c5b032f058a26bbaff13797a2780d98220/node_modules/stacktrace-parser/dist/stack-trace-parser.cjs.js
34
+ var require_stack_trace_parser_cjs = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports) => {
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ var UNKNOWN_FUNCTION = "<unknown>";
37
+ /**
38
+ * This parses the different stack traces and puts them into one format
39
+ * This borrows heavily from TraceKit (https://github.com/csnover/TraceKit)
40
+ */
41
+ function parse(stackString) {
42
+ return stackString.split("\n").reduce(function(stack, line) {
43
+ var parseResult = parseChrome(line) || parseWinjs(line) || parseGecko(line) || parseNode(line) || parseJSC(line);
44
+ if (parseResult) stack.push(parseResult);
45
+ return stack;
46
+ }, []);
47
+ }
48
+ var chromeRe = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|rsc|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i;
49
+ var chromeEvalRe = /\((\S*)(?::(\d+))(?::(\d+))\)/;
50
+ function parseChrome(line) {
51
+ var parts = chromeRe.exec(line);
52
+ if (!parts) return null;
53
+ var isNative = parts[2] && parts[2].indexOf("native") === 0;
54
+ var isEval = parts[2] && parts[2].indexOf("eval") === 0;
55
+ var submatch = chromeEvalRe.exec(parts[2]);
56
+ if (isEval && submatch != null) {
57
+ parts[2] = submatch[1];
58
+ parts[3] = submatch[2];
59
+ parts[4] = submatch[3];
60
+ }
61
+ return {
62
+ file: !isNative ? parts[2] : null,
63
+ methodName: parts[1] || UNKNOWN_FUNCTION,
64
+ arguments: isNative ? [parts[2]] : [],
65
+ lineNumber: parts[3] ? +parts[3] : null,
66
+ column: parts[4] ? +parts[4] : null
67
+ };
68
+ }
69
+ var winjsRe = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|rsc|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
70
+ function parseWinjs(line) {
71
+ var parts = winjsRe.exec(line);
72
+ if (!parts) return null;
73
+ return {
74
+ file: parts[2],
75
+ methodName: parts[1] || UNKNOWN_FUNCTION,
76
+ arguments: [],
77
+ lineNumber: +parts[3],
78
+ column: parts[4] ? +parts[4] : null
79
+ };
80
+ }
81
+ var geckoRe = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|rsc|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i;
82
+ var geckoEvalRe = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i;
83
+ function parseGecko(line) {
84
+ var parts = geckoRe.exec(line);
85
+ if (!parts) return null;
86
+ var isEval = parts[3] && parts[3].indexOf(" > eval") > -1;
87
+ var submatch = geckoEvalRe.exec(parts[3]);
88
+ if (isEval && submatch != null) {
89
+ parts[3] = submatch[1];
90
+ parts[4] = submatch[2];
91
+ parts[5] = null;
92
+ }
93
+ return {
94
+ file: parts[3],
95
+ methodName: parts[1] || UNKNOWN_FUNCTION,
96
+ arguments: parts[2] ? parts[2].split(",") : [],
97
+ lineNumber: parts[4] ? +parts[4] : null,
98
+ column: parts[5] ? +parts[5] : null
99
+ };
100
+ }
101
+ var javaScriptCoreRe = /^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;
102
+ function parseJSC(line) {
103
+ var parts = javaScriptCoreRe.exec(line);
104
+ if (!parts) return null;
105
+ return {
106
+ file: parts[3],
107
+ methodName: parts[1] || UNKNOWN_FUNCTION,
108
+ arguments: [],
109
+ lineNumber: +parts[4],
110
+ column: parts[5] ? +parts[5] : null
111
+ };
112
+ }
113
+ var nodeRe = /^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;
114
+ function parseNode(line) {
115
+ var parts = nodeRe.exec(line);
116
+ if (!parts) return null;
117
+ return {
118
+ file: parts[2],
119
+ methodName: parts[1] || UNKNOWN_FUNCTION,
120
+ arguments: [],
121
+ lineNumber: +parts[3],
122
+ column: parts[4] ? +parts[4] : null
123
+ };
124
+ }
125
+ exports.parse = parse;
126
+ }));
127
+ //#endregion
128
+ //#region src/bundler/workspaceDependencies.ts
129
+ var import_stack_trace_parser_cjs = /* @__PURE__ */ require_rolldown_runtime.__toESM(require_stack_trace_parser_cjs(), 1);
130
+ const isExportTargetImportable = (target) => {
131
+ if (!target) return false;
132
+ if (typeof target === "string") return true;
133
+ if (Array.isArray(target)) return target.some(isExportTargetImportable);
134
+ if (typeof target !== "object") return false;
135
+ return Object.values(target).some(isExportTargetImportable);
136
+ };
137
+ const hasRootExport = (exportsField) => {
138
+ if (exportsField === void 0) return true;
139
+ if (typeof exportsField === "string" || Array.isArray(exportsField)) return isExportTargetImportable(exportsField);
140
+ if (!exportsField || typeof exportsField !== "object") return false;
141
+ const exportMap = exportsField;
142
+ const exportKeys = Object.keys(exportMap);
143
+ if (exportKeys.length === 0) return false;
144
+ if (Object.prototype.hasOwnProperty.call(exportMap, ".")) return isExportTargetImportable(exportMap["."]);
145
+ if (exportKeys.some((key) => key.startsWith("./"))) return false;
146
+ return isExportTargetImportable(exportMap);
147
+ };
148
+ /**
149
+ * Create a shared cache for find-workspaces
150
+ */
151
+ const workspacesCache = (0, find_workspaces.createWorkspacesCache)();
152
+ /**
153
+ * A utility function around find-workspaces to get information about:
154
+ * - Which workspace packages are available in the project
155
+ * - What is the workspace root location
156
+ * - Is the current package a workspace package
157
+ *
158
+ * Because `findWorkspacesRoot` only traverses up until it finds workspace information, but doesn't check if the current package is even part of the workspace. We rather want to return `null` for these cases because in other code paths we use `workspaceRoot || projectRoot` to determine the root of the project.
159
+ *
160
+ * @params dir - The directory to start searching from (default: `process.cwd()`)
161
+ * @params location - The location of the current package (usually the directory containing the package.json)
162
+ */
163
+ async function getWorkspaceInformation({ dir = process.cwd(), mastraEntryFile }) {
164
+ const closestPkgJson = empathic_package.up({ cwd: (0, path.dirname)(mastraEntryFile) });
165
+ const location = closestPkgJson ? (0, path.dirname)(require_utils.slash(closestPkgJson)) : require_utils.slash(process.cwd());
166
+ const workspaces = await (0, find_workspaces.findWorkspaces)(dir, { cache: workspacesCache });
167
+ const _workspaceMap = new Map(workspaces?.map((workspace) => [workspace.package.name, {
168
+ location: workspace.location,
169
+ dependencies: workspace.package.dependencies,
170
+ version: workspace.package.version,
171
+ exports: workspace.package.exports
172
+ }]) ?? []);
173
+ const isWorkspacePackage = (workspaces ?? []).some((ws) => ws.location === location);
174
+ const workspaceRoot = isWorkspacePackage ? (0, find_workspaces.findWorkspacesRoot)(dir, { cache: workspacesCache })?.location : void 0;
175
+ return {
176
+ workspaceMap: isWorkspacePackage ? _workspaceMap : /* @__PURE__ */ new Map(),
177
+ workspaceRoot,
178
+ isWorkspacePackage
179
+ };
180
+ }
181
+ /**
182
+ * Collects all transitive workspace dependencies and their TGZ paths
183
+ */
184
+ const collectTransitiveWorkspaceDependencies = ({ workspaceMap, initialDependencies, logger }) => {
185
+ const usedWorkspacePackages = /* @__PURE__ */ new Set();
186
+ const queue = Array.from(initialDependencies);
187
+ const resolutions = {};
188
+ while (queue.length > 0) {
189
+ const len = queue.length;
190
+ for (let i = 0; i < len; i += 1) {
191
+ const pkgName = queue.shift();
192
+ if (!pkgName || usedWorkspacePackages.has(pkgName)) continue;
193
+ const dep = workspaceMap.get(pkgName);
194
+ if (!dep) continue;
195
+ const root = (0, find_workspaces.findWorkspacesRoot)();
196
+ if (!root) throw new Error("Could not find workspace root");
197
+ const depsService = new require_services.DepsService(root.location);
198
+ depsService.__setLogger(logger);
199
+ const sanitizedName = (0, _sindresorhus_slugify.default)(pkgName);
200
+ resolutions[pkgName] = depsService.getWorkspaceDependencyPath({
201
+ pkgName: sanitizedName,
202
+ version: dep.version
203
+ });
204
+ usedWorkspacePackages.add(pkgName);
205
+ for (const [depName, _depVersion] of Object.entries(dep?.dependencies ?? {})) if (!usedWorkspacePackages.has(depName) && workspaceMap.has(depName)) queue.push(depName);
206
+ }
207
+ }
208
+ return {
209
+ resolutions,
210
+ usedWorkspacePackages
211
+ };
212
+ };
213
+ /**
214
+ * Creates TGZ packages for workspace dependencies in the workspace-module directory
215
+ */
216
+ const packWorkspaceDependencies = async ({ workspaceMap, usedWorkspacePackages, bundleOutputDir, logger }) => {
217
+ const root = (0, find_workspaces.findWorkspacesRoot)();
218
+ if (!root) throw new Error("Could not find workspace root");
219
+ const depsService = new require_services.DepsService(root.location);
220
+ depsService.__setLogger(logger);
221
+ if (usedWorkspacePackages.size > 0) {
222
+ const workspaceDirPath = (0, path.join)(bundleOutputDir, "workspace-module");
223
+ await (0, fs_extra.ensureDir)(workspaceDirPath);
224
+ logger.info("Packaging workspace dependencies", { count: usedWorkspacePackages.size });
225
+ const batchSize = 5;
226
+ const packages = Array.from(usedWorkspacePackages.values());
227
+ for (let i = 0; i < packages.length; i += batchSize) {
228
+ const batch = packages.slice(i, i + batchSize);
229
+ logger.info(`Packaging batch ${Math.floor(i / batchSize) + 1}/${Math.ceil(packages.length / batchSize)}: ${batch.join(", ")}`);
230
+ await Promise.all(batch.map(async (pkgName) => {
231
+ const dep = workspaceMap.get(pkgName);
232
+ const sanitizedName = (0, _sindresorhus_slugify.default)(pkgName);
233
+ if (!dep) return;
234
+ await depsService.pack({
235
+ dir: dep.location,
236
+ destination: workspaceDirPath,
237
+ sanitizedName
238
+ });
239
+ }));
240
+ }
241
+ logger.info("Successfully packaged workspace dependencies", { count: usedWorkspacePackages.size });
242
+ }
243
+ };
244
+ //#endregion
245
+ //#region src/validator/validate.ts
246
+ var ValidationError = class extends Error {
247
+ type;
248
+ stack;
249
+ constructor(args) {
250
+ super(args.message);
251
+ this.type = args.type;
252
+ this.stack = args.stack;
253
+ }
254
+ };
255
+ /**
256
+ * Promisified version of Node.js spawn function
257
+ *
258
+ * @param command - The command to run
259
+ * @param args - List of string arguments
260
+ * @param options - Spawn options
261
+ * @returns Promise that resolves with the exit code when the process completes
262
+ */
263
+ function spawn(command, args = [], options = {}) {
264
+ return new Promise((resolve, reject) => {
265
+ let validationError = null;
266
+ const childProcess = (0, child_process.spawn)(command, args, {
267
+ stdio: [
268
+ "ignore",
269
+ "ignore",
270
+ "pipe"
271
+ ],
272
+ ...options
273
+ });
274
+ childProcess.on("error", (error) => {
275
+ reject(error);
276
+ });
277
+ let stderr = "";
278
+ childProcess.stderr?.on("data", (message) => {
279
+ try {
280
+ validationError = JSON.parse(message.toString());
281
+ } catch {
282
+ stderr += message;
283
+ }
284
+ });
285
+ childProcess.on("close", (code) => {
286
+ if (code === 0) resolve();
287
+ else if (validationError) reject(new ValidationError(validationError));
288
+ else reject(new Error(stderr));
289
+ });
290
+ });
291
+ }
292
+ function validate(file, { injectESMShim = false, moduleResolveMapLocation, stubbedExternals = [] }) {
293
+ let prefixCode = "";
294
+ if (injectESMShim) prefixCode = `import { fileURLToPath } from 'url';
295
+ import { dirname } from 'path';
296
+
297
+ globalThis.__filename = fileURLToPath(import.meta.url);
298
+ globalThis.__dirname = dirname(__filename);
299
+ `;
300
+ function errorHandler(err) {
301
+ console.error(JSON.stringify({
302
+ type: err.name,
303
+ message: err.message,
304
+ stack: err.stack
305
+ }));
306
+ process.exit(1);
307
+ }
308
+ return spawn(process.execPath, [
309
+ "--import",
310
+ {}.resolve("@mastra/deployer/loader"),
311
+ "--input-type=module",
312
+ "--enable-source-maps",
313
+ "-e",
314
+ `${prefixCode};import('${(0, url.pathToFileURL)(file).href}').catch(err => {
315
+ ${errorHandler.toString()}
316
+ errorHandler(err);
317
+ })`.replaceAll(/\n/g, "")
318
+ ], {
319
+ env: {
320
+ ...process.env,
321
+ MODULE_MAP: `${moduleResolveMapLocation}`,
322
+ STUBBED_EXTERNALS: JSON.stringify(stubbedExternals)
323
+ },
324
+ cwd: (0, path.dirname)(file)
325
+ });
326
+ }
327
+ //#endregion
328
+ //#region src/build/analyze/constants.ts
329
+ const DEPS_TO_IGNORE = [
330
+ "#tools",
331
+ "execa",
332
+ "effect",
333
+ "sury",
334
+ "@ast-grep/napi",
335
+ "@hono/node-ws"
336
+ ];
337
+ const GLOBAL_EXTERNALS = [
338
+ "pino",
339
+ "pino-pretty",
340
+ "@libsql/client",
341
+ "pg",
342
+ "libsql",
343
+ "#tools",
344
+ "typescript",
345
+ "undici",
346
+ "readable-stream",
347
+ "bufferutil",
348
+ "utf-8-validate",
349
+ "execa",
350
+ "@ast-grep/napi",
351
+ "@hono/node-ws"
352
+ ];
353
+ const DEPRECATED_EXTERNALS = [
354
+ "fastembed",
355
+ "nodemailer",
356
+ "jsdom",
357
+ "sqlite3"
358
+ ];
359
+ //#endregion
360
+ //#region src/build/analyze/analyzeEntry.ts
361
+ /**
362
+ * Configures and returns the Rollup plugins needed for analyzing entry files.
363
+ * Sets up module resolution, transpilation, and custom alias handling for Mastra-specific imports.
364
+ */
365
+ function getInputPlugins$1({ entry, isVirtualFile }, mastraEntry, { sourcemapEnabled }) {
366
+ let virtualPlugin = null;
367
+ if (isVirtualFile) {
368
+ virtualPlugin = (0, _rollup_plugin_virtual.default)({ "#entry": entry });
369
+ entry = "#entry";
370
+ }
371
+ const plugins = [];
372
+ if (virtualPlugin) plugins.push(virtualPlugin);
373
+ plugins.push(...[
374
+ require_bundler.protocolExternalResolver(),
375
+ require_bundler.mastraInternalAliasPlugin(mastraEntry),
376
+ require_bundler.mastraToolsAliasPlugin(),
377
+ require_bundler.tsConfigPaths(),
378
+ (0, _rollup_plugin_json.default)(),
379
+ require_bundler.esbuild(),
380
+ (0, _rollup_plugin_commonjs.default)({
381
+ strictRequires: "debug",
382
+ ignoreTryCatch: false,
383
+ transformMixedEsModules: true,
384
+ extensions: [".js", ".ts"]
385
+ }),
386
+ require_bundler.removeDeployer(mastraEntry, { sourcemap: sourcemapEnabled }),
387
+ require_bundler.esbuild()
388
+ ]);
389
+ return plugins;
390
+ }
391
+ /**
392
+ * Extracts and categorizes dependencies from Rollup output to determine which ones need optimization.
393
+ * Analyzes both static imports and dynamic imports while filtering out Node.js built-ins and ignored dependencies.
394
+ * Identifies workspace packages and resolves package root paths for proper bundling optimization.
395
+ */
396
+ async function captureDependenciesToOptimize(output, workspaceMap, projectRoot, { logger, shouldCheckTransitiveDependencies }) {
397
+ const depsToOptimize = /* @__PURE__ */ new Map();
398
+ if (!output.facadeModuleId) throw new Error("Something went wrong, we could not find the package name of the entry file. Please open an issue.");
399
+ let entryRootPath = projectRoot;
400
+ if (!output.facadeModuleId.startsWith("\0virtual:")) entryRootPath = await require_bundler.getPackageRootPath(output.facadeModuleId) || projectRoot;
401
+ for (const [dependency, bindings] of Object.entries(output.importedBindings)) {
402
+ if (!require_utils.isBareModuleSpecifier(dependency)) continue;
403
+ const pkgName = require_utils.getPackageName(dependency);
404
+ let rootPath = null;
405
+ let isWorkspace = false;
406
+ let version;
407
+ let packageSpec;
408
+ if (pkgName) {
409
+ const metadata = await require_bundler.getPackageMetadata(dependency, entryRootPath);
410
+ rootPath = metadata.rootPath;
411
+ version = metadata.version;
412
+ packageSpec = metadata.packageSpec;
413
+ isWorkspace = workspaceMap.has(pkgName);
414
+ }
415
+ const normalizedRootPath = rootPath ? require_utils.slash(rootPath) : null;
416
+ depsToOptimize.set(dependency, {
417
+ exports: bindings,
418
+ rootPath: normalizedRootPath,
419
+ isWorkspace,
420
+ version,
421
+ packageSpec
422
+ });
423
+ }
424
+ const processedWorkspaceDeps = /* @__PURE__ */ new Set();
425
+ /**
426
+ * Recursively discovers transitive workspace dependencies from package manifests.
427
+ */
428
+ function checkTransitiveDependencies(maxDepth = 10, currentDepth = 0) {
429
+ if (currentDepth >= maxDepth) {
430
+ logger.warn("Maximum dependency depth reached while checking transitive dependencies.");
431
+ return;
432
+ }
433
+ const depsSnapshot = new Map(depsToOptimize);
434
+ let hasAddedDeps = false;
435
+ for (const [dep, meta] of depsSnapshot) {
436
+ const pkgName = require_utils.getPackageName(dep);
437
+ if (!pkgName || !meta.isWorkspace || processedWorkspaceDeps.has(pkgName)) continue;
438
+ processedWorkspaceDeps.add(pkgName);
439
+ const workspaceInfo = workspaceMap.get(pkgName);
440
+ if (!workspaceInfo?.dependencies) continue;
441
+ for (const [innerDep, _innerDepVersion] of Object.entries(workspaceInfo.dependencies)) {
442
+ const innerWorkspaceInfo = workspaceMap.get(innerDep);
443
+ if (!innerWorkspaceInfo) continue;
444
+ if (!hasRootExport(innerWorkspaceInfo.exports)) continue;
445
+ const existingMeta = depsToOptimize.get(innerDep);
446
+ if (existingMeta) {
447
+ depsToOptimize.set(innerDep, {
448
+ ...existingMeta,
449
+ exports: existingMeta.exports.includes("*") ? existingMeta.exports : [...existingMeta.exports, "*"]
450
+ });
451
+ continue;
452
+ }
453
+ depsToOptimize.set(innerDep, {
454
+ exports: ["*"],
455
+ rootPath: require_utils.slash(innerWorkspaceInfo.location),
456
+ isWorkspace: true,
457
+ version: innerWorkspaceInfo.version
458
+ });
459
+ hasAddedDeps = true;
460
+ }
461
+ }
462
+ if (hasAddedDeps) checkTransitiveDependencies(maxDepth, currentDepth + 1);
463
+ }
464
+ if (shouldCheckTransitiveDependencies) checkTransitiveDependencies();
465
+ const dynamicImports = output.dynamicImports.filter((d) => !DEPS_TO_IGNORE.includes(d));
466
+ if (dynamicImports.length) {
467
+ for (const dynamicImport of dynamicImports) if (!depsToOptimize.has(dynamicImport) && require_utils.isBareModuleSpecifier(dynamicImport)) {
468
+ const pkgName = require_utils.getPackageName(dynamicImport);
469
+ let version;
470
+ let packageSpec;
471
+ let rootPath = null;
472
+ if (pkgName) {
473
+ const metadata = await require_bundler.getPackageMetadata(dynamicImport, entryRootPath);
474
+ rootPath = metadata.rootPath;
475
+ version = metadata.version;
476
+ packageSpec = metadata.packageSpec;
477
+ }
478
+ depsToOptimize.set(dynamicImport, {
479
+ exports: ["*"],
480
+ rootPath: rootPath ? require_utils.slash(rootPath) : null,
481
+ isWorkspace: false,
482
+ version,
483
+ packageSpec
484
+ });
485
+ }
486
+ }
487
+ return depsToOptimize;
488
+ }
489
+ async function analyzeEntry({ entry, isVirtualFile }, mastraEntry, { logger, sourcemapEnabled, workspaceMap, projectRoot, shouldCheckTransitiveDependencies = false, analyzeCache }) {
490
+ const cacheKey = isVirtualFile ? void 0 : require_utils.slash(entry);
491
+ if (cacheKey && analyzeCache?.has(cacheKey)) return analyzeCache.get(cacheKey);
492
+ const optimizerBundler = await (0, rollup.rollup)({
493
+ logLevel: process.env.MASTRA_BUNDLER_DEBUG === "true" ? "debug" : "silent",
494
+ input: isVirtualFile ? "#entry" : entry,
495
+ treeshake: false,
496
+ preserveSymlinks: true,
497
+ plugins: getInputPlugins$1({
498
+ entry,
499
+ isVirtualFile
500
+ }, mastraEntry, { sourcemapEnabled }),
501
+ external: DEPS_TO_IGNORE
502
+ });
503
+ const { output } = await optimizerBundler.generate({
504
+ format: "esm",
505
+ inlineDynamicImports: true
506
+ });
507
+ await optimizerBundler.close();
508
+ const result = {
509
+ dependencies: await captureDependenciesToOptimize(output[0], workspaceMap, projectRoot, {
510
+ logger,
511
+ shouldCheckTransitiveDependencies
512
+ }),
513
+ output: {
514
+ code: output[0].code,
515
+ map: output[0].map
516
+ }
517
+ };
518
+ if (cacheKey && analyzeCache) analyzeCache.set(cacheKey, result);
519
+ return result;
520
+ }
521
+ //#endregion
522
+ //#region src/build/plugins/hono-alias.ts
523
+ function aliasHono() {
524
+ return {
525
+ name: "hono-alias",
526
+ resolveId(id) {
527
+ if (!id.startsWith("@hono/") && !id.startsWith("hono/") && id !== "hono" && id !== "hono-openapi") return;
528
+ return (0, url.fileURLToPath)({}.resolve(id));
529
+ }
530
+ };
531
+ }
532
+ //#endregion
533
+ //#region src/build/plugins/module-resolve-map.ts
534
+ function moduleResolveMap(externals, projectRoot) {
535
+ const importMap = /* @__PURE__ */ new Map();
536
+ return {
537
+ name: "module-resolve-map",
538
+ moduleParsed(info) {
539
+ if (info.importedIds.length === 0 || !info.id) return;
540
+ for (const importedId of info.importedIds) for (const external of externals) if (require_utils.isDependencyPartOfPackage(importedId, external)) importMap.set(external, info.id);
541
+ },
542
+ async generateBundle(options, bundle) {
543
+ const resolveMap = /* @__PURE__ */ new Map();
544
+ for (const [fileName, chunk] of Object.entries(bundle)) if (chunk.type === "chunk") {
545
+ for (const [external, resolvedFrom] of importMap) if (chunk.moduleIds.includes(resolvedFrom)) {
546
+ const fullPath = (0, url.pathToFileURL)(require_utils.slash((0, path.join)(projectRoot, fileName))).toString();
547
+ const innerMap = resolveMap.get(fullPath) || /* @__PURE__ */ new Map();
548
+ innerMap.set(external, (0, url.pathToFileURL)(require_utils.slash(resolvedFrom)).toString());
549
+ resolveMap.set(fullPath, innerMap);
550
+ }
551
+ }
552
+ const resolveMapJson = Object.fromEntries(Array.from(resolveMap.entries()).map(([key, value]) => [key, Object.fromEntries(value.entries())]));
553
+ this.emitFile({
554
+ type: "asset",
555
+ name: "module-resolve-map.json",
556
+ source: `${JSON.stringify(resolveMapJson, null, 2)}`
557
+ });
558
+ }
559
+ };
560
+ }
561
+ //#endregion
562
+ //#region src/build/plugins/node-gyp-detector.ts
563
+ function nodeGypDetector() {
564
+ const modulesToTrack = /* @__PURE__ */ new Set();
565
+ const modulesToTrackPackageInfo = /* @__PURE__ */ new Map();
566
+ return {
567
+ name: "node-gyp-build-detector",
568
+ moduleParsed(info) {
569
+ if (!info.meta?.commonjs?.requires?.length) return;
570
+ if (!info.meta.commonjs.requires.some((m) => m?.resolved?.id.endsWith("node-gyp-build/index.js"))) return;
571
+ modulesToTrack.add(info.id);
572
+ modulesToTrackPackageInfo.set(info.id, (0, local_pkg.getPackageInfo)(info.id));
573
+ },
574
+ async generateBundle(options, bundle) {
575
+ const binaryMapByChunk = /* @__PURE__ */ new Map();
576
+ for (const [fileName, chunk] of Object.entries(bundle)) if (chunk.type === "chunk") {
577
+ for (const moduleId of chunk.moduleIds) if (modulesToTrackPackageInfo.has(moduleId)) {
578
+ const pkgInfo = await modulesToTrackPackageInfo.get(moduleId);
579
+ if (!binaryMapByChunk.has(fileName)) binaryMapByChunk.set(fileName, /* @__PURE__ */ new Set());
580
+ if (pkgInfo?.packageJson?.name) binaryMapByChunk.get(fileName).add(pkgInfo.packageJson.name);
581
+ }
582
+ }
583
+ const binaryMapJson = Object.fromEntries(Array.from(binaryMapByChunk.entries()).map(([key, value]) => [key, Array.from(value)]));
584
+ this.emitFile({
585
+ type: "asset",
586
+ name: "binary-map.json",
587
+ source: `${JSON.stringify(binaryMapJson, null, 2)}`
588
+ });
589
+ }
590
+ };
591
+ }
592
+ //#endregion
593
+ //#region src/build/analyze/bundleExternals.ts
594
+ function prepareEntryFileName(name, rootDir) {
595
+ return require_utils.rollupSafeName(name, rootDir);
596
+ }
597
+ /**
598
+ * Creates virtual dependency modules for optimized bundling by generating virtual entry points for each dependency with their specific exports and handling workspace package path resolution.
599
+ */
600
+ function createVirtualDependencies(depsToOptimize, { projectRoot, workspaceRoot, outputDir, bundlerOptions }) {
601
+ const { isDev = false, externalsPreset = false } = bundlerOptions || {};
602
+ const fileNameToDependencyMap = /* @__PURE__ */ new Map();
603
+ const optimizedDependencyEntries = /* @__PURE__ */ new Map();
604
+ const rootDir = workspaceRoot || projectRoot;
605
+ for (const [dep, { exports }] of depsToOptimize.entries()) {
606
+ const fileName = dep.replaceAll("/", "__");
607
+ const virtualFile = [];
608
+ const exportStringBuilder = [];
609
+ for (const local of exports) if (local === "*") {
610
+ virtualFile.push(`export * from '${dep}';`);
611
+ continue;
612
+ } else if (local === "default") exportStringBuilder.push("default");
613
+ else exportStringBuilder.push(local);
614
+ const chunks = [];
615
+ if (exportStringBuilder.length) chunks.push(`{ ${exportStringBuilder.join(", ")} }`);
616
+ if (chunks.length) virtualFile.push(`export ${chunks.join(", ")} from '${dep}';`);
617
+ let entryName = prepareEntryFileName(path.join(outputDir, fileName), rootDir);
618
+ fileNameToDependencyMap.set(entryName, dep);
619
+ optimizedDependencyEntries.set(dep, {
620
+ name: entryName,
621
+ virtual: virtualFile.join("\n")
622
+ });
623
+ }
624
+ if (isDev || externalsPreset) for (const [dep, { isWorkspace, rootPath }] of depsToOptimize.entries()) {
625
+ if (!isWorkspace || !rootPath || !workspaceRoot) continue;
626
+ const currentDepPath = optimizedDependencyEntries.get(dep);
627
+ if (!currentDepPath) continue;
628
+ const entryName = prepareEntryFileName(require_utils.getCompiledDepCachePath(rootPath, (0, path_posix.basename)(currentDepPath.name)), rootDir);
629
+ fileNameToDependencyMap.set(entryName, dep);
630
+ optimizedDependencyEntries.set(dep, {
631
+ ...currentDepPath,
632
+ name: entryName
633
+ });
634
+ }
635
+ return {
636
+ optimizedDependencyEntries,
637
+ fileNameToDependencyMap
638
+ };
639
+ }
640
+ /**
641
+ * Configures and returns Rollup plugins for bundling external dependencies.
642
+ * Sets up virtual modules, TypeScript compilation, CommonJS transformation, and workspace resolution.
643
+ */
644
+ async function getInputPlugins(virtualDependencies, { transpilePackages, workspaceMap, bundlerOptions, rootDir, externals, platform }) {
645
+ const transpilePackagesMap = /* @__PURE__ */ new Map();
646
+ for (const pkg of transpilePackages) {
647
+ const dir = await require_bundler.getPackageRootPath(pkg);
648
+ if (dir) transpilePackagesMap.set(pkg, require_utils.slash(dir));
649
+ else transpilePackagesMap.set(pkg, workspaceMap.get(pkg)?.location ?? pkg);
650
+ }
651
+ return [
652
+ (0, _rollup_plugin_virtual.default)(Array.from(virtualDependencies.entries()).reduce((acc, [dep, virtualDep]) => {
653
+ acc[`#virtual-${dep}`] = virtualDep.virtual;
654
+ return acc;
655
+ }, {})),
656
+ require_bundler.tsConfigPaths(),
657
+ require_bundler.protocolExternalResolver(),
658
+ require_bundler.subpathExternalsResolver(externals),
659
+ transpilePackagesMap.size ? require_bundler.esbuild({
660
+ format: "esm",
661
+ include: [...[...transpilePackagesMap.values()].map((p) => {
662
+ if (path.isAbsolute(p)) return new RegExp(`^${p.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}/(?!.*node_modules).*$`);
663
+ else return new RegExp(`\/${p.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}/(?!.*node_modules).*$`);
664
+ }), ...[...transpilePackagesMap.keys()].map((pkgName) => {
665
+ const escapedPkgName = pkgName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
666
+ return new RegExp(`/node_modules/${escapedPkgName}/(?!.*node_modules).*$`);
667
+ })],
668
+ exclude: []
669
+ }) : null,
670
+ bundlerOptions.noBundling ? {
671
+ name: "alias-optimized-deps",
672
+ async resolveId(id, importer, options) {
673
+ if (!virtualDependencies.has(id)) return null;
674
+ const info = virtualDependencies.get(id);
675
+ const packageRootPath = path.join(rootDir, path.dirname(path.dirname(path.dirname(info.name))));
676
+ const pkgJsonBuffer = await (0, fs_promises.readFile)(path.join(packageRootPath, "package.json"), "utf-8");
677
+ const pkgJson = JSON.parse(pkgJsonBuffer);
678
+ if (!pkgJson) return null;
679
+ const pkgName = pkgJson.name || "";
680
+ let resolvedPath = resolve_exports.exports(pkgJson, id.replace(pkgName, "."))?.[0];
681
+ if (!resolvedPath) resolvedPath = pkgJson.main ?? "index.js";
682
+ return await this.resolve(path.posix.join(packageRootPath, resolvedPath), importer, options);
683
+ }
684
+ } : null,
685
+ (0, _optimize_lodash_rollup_plugin.optimizeLodashImports)({ include: "**/*.{js,ts,mjs,cjs}" }),
686
+ (0, _rollup_plugin_commonjs.default)({
687
+ strictRequires: "strict",
688
+ transformMixedEsModules: true,
689
+ ignoreTryCatch: false
690
+ }),
691
+ bundlerOptions.noBundling ? null : (0, _rollup_plugin_node_resolve.default)(require_utils.getNodeResolveOptions(platform)),
692
+ bundlerOptions.noBundling ? require_bundler.esmShim() : null,
693
+ aliasHono(),
694
+ (0, _rollup_plugin_json.default)(),
695
+ nodeGypDetector(),
696
+ moduleResolveMap(externals, rootDir),
697
+ {
698
+ name: "not-found-resolver",
699
+ resolveId: {
700
+ order: "post",
701
+ async handler(id, importer) {
702
+ if (!importer) return null;
703
+ if (!id.endsWith(".node")) return null;
704
+ const packageName = (await (0, local_pkg.getPackageInfo)(importer))?.packageJson?.name || id;
705
+ throw new _mastra_core_error.MastraBaseError({
706
+ id: "DEPLOYER_BUNDLE_EXTERNALS_MISSING_NATIVE_BUILD",
707
+ domain: _mastra_core_error.ErrorDomain.DEPLOYER,
708
+ category: _mastra_core_error.ErrorCategory.USER,
709
+ details: {
710
+ importFile: importer,
711
+ packageName
712
+ },
713
+ text: `We found a possible binary dependency in your bundle. ${id} was not found when imported at ${importer}.
714
+
715
+ Please consider adding \`${packageName}\` to your externals, or updating this import to not end with ".node".
716
+
717
+ export const mastra = new Mastra({
718
+ bundler: {
719
+ externals: ["${packageName}"],
720
+ }
721
+ })`
722
+ });
723
+ }
724
+ }
725
+ }
726
+ ].filter(Boolean);
727
+ }
728
+ /**
729
+ * Executes the Rollup build process for virtual dependencies using configured plugins.
730
+ * Bundles all virtual dependency modules into optimized ESM files with proper external handling.
731
+ */
732
+ async function buildExternalDependencies(virtualDependencies, { externals, packagesToTranspile, workspaceMap, rootDir, outputDir, bundlerOptions, platform }) {
733
+ /**
734
+ * If there are no virtual dependencies to bundle, return an empty array to avoid Rollup errors.
735
+ */
736
+ if (virtualDependencies.size === 0) return [];
737
+ const noBundling = bundlerOptions.isDev || bundlerOptions.externalsPreset;
738
+ const plugins = await getInputPlugins(virtualDependencies, {
739
+ transpilePackages: packagesToTranspile,
740
+ workspaceMap,
741
+ bundlerOptions: { noBundling },
742
+ rootDir,
743
+ externals,
744
+ platform
745
+ });
746
+ const bundler = await (0, rollup.rollup)({
747
+ logLevel: process.env.MASTRA_BUNDLER_DEBUG === "true" ? "debug" : "silent",
748
+ input: Array.from(virtualDependencies.entries()).reduce((acc, [dep, virtualDep]) => {
749
+ acc[virtualDep.name] = `#virtual-${dep}`;
750
+ return acc;
751
+ }, {}),
752
+ external: externals,
753
+ treeshake: noBundling ? false : "safest",
754
+ plugins
755
+ });
756
+ const outputDirRelative = prepareEntryFileName(outputDir, rootDir);
757
+ const { output } = await bundler.write({
758
+ format: "esm",
759
+ dir: rootDir,
760
+ entryFileNames: "[name].mjs",
761
+ sourcemap: true,
762
+ /**
763
+ * Rollup creates chunks for common dependencies, but these chunks are by default written to the root directory instead of respecting the entryFileNames structure.
764
+ * So we want to write them to the `.mastra/output` folder as well.
765
+ */
766
+ chunkFileNames: (chunkInfo) => {
767
+ /**
768
+ * This whole bunch of logic directly below is for the edge case shown in the e2e-tests/monorepo with "tinyrainbow" package. It's used in multiple places in the package and as such Rollup creates a shared chunk for it. During 'mastra dev' / with externals: true, we don't want that chunk to show up in the '.mastra/output' folder (outputDirRelative) but inside <pkg>/node_modules/.cache instead.
769
+ * We only care about this for the "noBundling" case!
770
+ */
771
+ if (noBundling) {
772
+ const importedFromPackages = /* @__PURE__ */ new Set();
773
+ for (const moduleId of chunkInfo.moduleIds) {
774
+ const normalized = require_utils.slash(moduleId);
775
+ for (const [pkgName, pkgInfo] of workspaceMap.entries()) {
776
+ const location = require_utils.slash(pkgInfo.location);
777
+ if (normalized.startsWith(location)) {
778
+ importedFromPackages.add(pkgName);
779
+ break;
780
+ }
781
+ }
782
+ }
783
+ if (importedFromPackages.size > 1) throw new _mastra_core_error.MastraBaseError({
784
+ id: "DEPLOYER_BUNDLE_EXTERNALS_SHARED_CHUNK",
785
+ domain: _mastra_core_error.ErrorDomain.DEPLOYER,
786
+ category: _mastra_core_error.ErrorCategory.USER,
787
+ details: {
788
+ chunkName: chunkInfo.name,
789
+ packages: JSON.stringify(Array.from(importedFromPackages))
790
+ },
791
+ text: `Please open an issue. We found a shared chunk "${chunkInfo.name}" used by multiple workspace packages: ${Array.from(importedFromPackages).join(", ")}.`
792
+ });
793
+ if (importedFromPackages.size === 1) {
794
+ const [pkgName] = importedFromPackages;
795
+ const workspaceLocation = workspaceMap.get(pkgName).location;
796
+ return prepareEntryFileName(require_utils.getCompiledDepCachePath(workspaceLocation, "[name].mjs"), rootDir);
797
+ }
798
+ }
799
+ return `${outputDirRelative}/[name].mjs`;
800
+ },
801
+ assetFileNames: `${outputDirRelative}/[name][extname]`,
802
+ hoistTransitiveImports: false
803
+ });
804
+ await bundler.close();
805
+ return output;
806
+ }
807
+ /**
808
+ * Recursively searches through Rollup output chunks to find which module imports a specific external dependency.
809
+ * Used to build the module resolution map for proper external dependency tracking.
810
+ */
811
+ function findExternalImporter(module, external, allOutputs, visited = /* @__PURE__ */ new Set()) {
812
+ if (visited.has(module.fileName)) return null;
813
+ visited.add(module.fileName);
814
+ const capturedFiles = /* @__PURE__ */ new Set();
815
+ for (const id of [...module.imports, ...module.dynamicImports]) if (require_utils.isDependencyPartOfPackage(id, external)) return module;
816
+ else if (id.endsWith(".mjs")) capturedFiles.add(id);
817
+ for (const file of capturedFiles) {
818
+ const nextModule = allOutputs.find((o) => o.fileName === file);
819
+ if (nextModule) {
820
+ const importer = findExternalImporter(nextModule, external, allOutputs, visited);
821
+ if (importer) return importer;
822
+ }
823
+ }
824
+ return null;
825
+ }
826
+ /**
827
+ * Bundles vendor dependencies identified in the analysis step.
828
+ * Creates virtual modules for each dependency and bundles them using rollup.
829
+ *
830
+ * @param depsToOptimize - Map of dependencies to optimize with their metadata (exported bindings, rootPath, isWorkspace)
831
+ * @param outputDir - Directory where bundled files will be written
832
+ * @param logger - Logger instance for debugging
833
+ * @returns Object containing bundle output and reference map for validation
834
+ */
835
+ async function bundleExternals(depsToOptimize, outputDir, options) {
836
+ const { workspaceRoot = null, workspaceMap = /* @__PURE__ */ new Map(), projectRoot = outputDir, bundlerOptions = {}, platform = "node" } = options;
837
+ const { externals: customExternals = [], transpilePackages = [], isDev = false } = bundlerOptions || {};
838
+ /**
839
+ * A user can set `externals: true` to indicate they want to externalize all dependencies. In this case, we set `externalsPreset` to true to skip bundling any externals.
840
+ */
841
+ let externalsPreset = false;
842
+ if (customExternals === true) externalsPreset = true;
843
+ const externalsList = Array.isArray(customExternals) ? customExternals : [];
844
+ const allExternals = [
845
+ ...GLOBAL_EXTERNALS,
846
+ ...DEPRECATED_EXTERNALS,
847
+ ...externalsList
848
+ ];
849
+ const workspacePackagesNames = Array.from(workspaceMap.keys());
850
+ const packagesToTranspile = /* @__PURE__ */ new Set([...transpilePackages, ...workspacePackagesNames]);
851
+ /**
852
+ * When externals: true, we need to extract non-workspace deps from depsToOptimize
853
+ * and add them directly to usedExternals instead of bundling them.
854
+ */
855
+ const extractedExternals = /* @__PURE__ */ new Map();
856
+ if (externalsPreset) {
857
+ for (const [dep, metadata] of depsToOptimize.entries()) if (!metadata.isWorkspace) {
858
+ extractedExternals.set(dep, metadata.rootPath ?? dep);
859
+ depsToOptimize.delete(dep);
860
+ }
861
+ }
862
+ const { optimizedDependencyEntries, fileNameToDependencyMap } = createVirtualDependencies(depsToOptimize, {
863
+ workspaceRoot,
864
+ outputDir,
865
+ projectRoot,
866
+ bundlerOptions: {
867
+ isDev,
868
+ externalsPreset
869
+ }
870
+ });
871
+ const output = await buildExternalDependencies(optimizedDependencyEntries, {
872
+ externals: allExternals,
873
+ packagesToTranspile,
874
+ workspaceMap,
875
+ rootDir: workspaceRoot || projectRoot,
876
+ outputDir,
877
+ bundlerOptions: {
878
+ isDev,
879
+ externalsPreset
880
+ },
881
+ platform
882
+ });
883
+ const moduleResolveMap = /* @__PURE__ */ new Map();
884
+ const filteredChunks = output.filter((o) => o.type === "chunk");
885
+ for (const o of filteredChunks.filter((o) => o.isEntry || o.isDynamicEntry)) for (const external of allExternals) {
886
+ if (DEPS_TO_IGNORE.includes(external)) continue;
887
+ const importer = findExternalImporter(o, external, filteredChunks);
888
+ if (importer) {
889
+ const fullPath = path.join(workspaceRoot || projectRoot, importer.fileName);
890
+ let innerMap = moduleResolveMap.get(fullPath);
891
+ if (!innerMap) {
892
+ innerMap = /* @__PURE__ */ new Map();
893
+ moduleResolveMap.set(fullPath, innerMap);
894
+ }
895
+ if (importer.moduleIds.length) innerMap.set(external, importer.moduleIds[importer.moduleIds.length - 1]?.startsWith("\0virtual:#virtual") ? importer.moduleIds[importer.moduleIds.length - 2] : importer.moduleIds[importer.moduleIds.length - 1]);
896
+ }
897
+ }
898
+ /**
899
+ * Convert moduleResolveMap to a plain object with prototype-less objects
900
+ */
901
+ const usedExternals = Object.create(null);
902
+ for (const [fullPath, innerMap] of moduleResolveMap) {
903
+ const innerObj = Object.create(null);
904
+ for (const [external, value] of innerMap) innerObj[external] = value;
905
+ usedExternals[fullPath] = innerObj;
906
+ }
907
+ /**
908
+ * When externals: true, add the extracted non-workspace deps to usedExternals
909
+ * using a synthetic entry path to track them.
910
+ */
911
+ if (extractedExternals.size > 0) {
912
+ const syntheticPath = path.join(workspaceRoot || projectRoot, "__externals__");
913
+ const externalsObj = Object.create(null);
914
+ for (const [dep, rootPath] of extractedExternals) externalsObj[dep] = rootPath;
915
+ usedExternals[syntheticPath] = externalsObj;
916
+ }
917
+ return {
918
+ output,
919
+ fileNameToDependencyMap,
920
+ usedExternals
921
+ };
922
+ }
923
+ //#endregion
924
+ //#region src/build/babel/check-config-export.ts
925
+ function checkConfigExport(result) {
926
+ const mastraVars = /* @__PURE__ */ new Set();
927
+ return { visitor: {
928
+ NewExpression(path) {
929
+ if (!_babel_core.types.isIdentifier(path.node.callee)) return;
930
+ const binding = path.scope.getBinding(path.node.callee.name);
931
+ if (binding?.path.isImportSpecifier() && _babel_core.types.isIdentifier(binding.path.node.imported, { name: "MastraFactory" })) result.projectType = "factory";
932
+ },
933
+ ExportNamedDeclaration(path) {
934
+ const decl = path.node.declaration;
935
+ if (_babel_core.types.isVariableDeclaration(decl)) {
936
+ const varDecl = decl.declarations[0];
937
+ if (_babel_core.types.isIdentifier(varDecl?.id, { name: "mastra" }) && _babel_core.types.isNewExpression(varDecl.init) && _babel_core.types.isIdentifier(varDecl.init.callee, { name: "Mastra" })) result.hasValidConfig = true;
938
+ }
939
+ /**
940
+ * 2) export { foo as mastra }
941
+ * 3) export { mastra }
942
+ * 4) export { mastra, foo }
943
+ */
944
+ if (Array.isArray(path.node.specifiers)) {
945
+ for (const spec of path.node.specifiers) if (_babel_core.types.isExportSpecifier(spec) && _babel_core.types.isIdentifier(spec.exported, { name: "mastra" }) && _babel_core.types.isIdentifier(spec.local) && mastraVars.has(spec.local.name)) result.hasValidConfig = true;
946
+ }
947
+ },
948
+ VariableDeclaration(path) {
949
+ for (const decl of path.node.declarations) if (_babel_core.types.isIdentifier(decl.id) && _babel_core.types.isNewExpression(decl.init) && _babel_core.types.isIdentifier(decl.init.callee, { name: "Mastra" })) mastraVars.add(decl.id.name);
950
+ }
951
+ } };
952
+ }
953
+ //#endregion
954
+ //#region src/build/babel/detect-pino-transports.ts
955
+ /**
956
+ * Extract string value from a node (supports StringLiteral and TemplateLiteral without expressions)
957
+ */
958
+ function getStringValue(node) {
959
+ if (!node) return null;
960
+ if (_babel_core.types.isStringLiteral(node)) return node.value;
961
+ if (_babel_core.types.isTemplateLiteral(node) && node.expressions.length === 0 && node.quasis.length === 1) return node.quasis[0]?.value.cooked ?? null;
962
+ return null;
963
+ }
964
+ /**
965
+ * Extract target value from an object property
966
+ */
967
+ function extractTargetFromProperty(prop) {
968
+ if (!_babel_core.types.isObjectProperty(prop)) return null;
969
+ const key = prop.key;
970
+ if (_babel_core.types.isIdentifier(key, { name: "target" }) || _babel_core.types.isStringLiteral(key) && key.value === "target") return getStringValue(prop.value);
971
+ return null;
972
+ }
973
+ /**
974
+ * Check if a binding came from a pino import/require
975
+ */
976
+ function isBindingFromPino(path, identifierName) {
977
+ const binding = path.scope.getBinding(identifierName);
978
+ if (!binding) return identifierName === "pino";
979
+ const bindingPath = binding.path;
980
+ if (bindingPath.isImportDefaultSpecifier()) {
981
+ const importDecl = bindingPath.parentPath;
982
+ if (importDecl?.isImportDeclaration()) return importDecl.node.source.value === "pino";
983
+ }
984
+ if (bindingPath.isImportNamespaceSpecifier()) {
985
+ const importDecl = bindingPath.parentPath;
986
+ if (importDecl?.isImportDeclaration()) return importDecl.node.source.value === "pino";
987
+ }
988
+ if (bindingPath.isImportSpecifier()) {
989
+ const importDecl = bindingPath.parentPath;
990
+ if (importDecl?.isImportDeclaration() && importDecl.node.source.value === "pino") {
991
+ const imported = bindingPath.node.imported;
992
+ if (_babel_core.types.isIdentifier(imported) && imported.name === "default") return true;
993
+ if (_babel_core.types.isStringLiteral(imported) && imported.value === "default") return true;
994
+ }
995
+ return false;
996
+ }
997
+ if (bindingPath.isVariableDeclarator()) {
998
+ const init = bindingPath.node.init;
999
+ if (_babel_core.types.isCallExpression(init) && _babel_core.types.isIdentifier(init.callee, { name: "require" }) && init.arguments.length === 1 && _babel_core.types.isStringLiteral(init.arguments[0]) && init.arguments[0].value === "pino") return true;
1000
+ }
1001
+ return false;
1002
+ }
1003
+ /**
1004
+ * Check if a call expression is a pino.transport() call using scope analysis
1005
+ */
1006
+ function isPinoTransportCall(path) {
1007
+ const callee = path.node.callee;
1008
+ if (!_babel_core.types.isMemberExpression(callee)) return false;
1009
+ if (!_babel_core.types.isIdentifier(callee.property, { name: "transport" })) return false;
1010
+ if (_babel_core.types.isIdentifier(callee.object)) return isBindingFromPino(path, callee.object.name);
1011
+ if (_babel_core.types.isMemberExpression(callee.object) && _babel_core.types.isIdentifier(callee.object.object) && _babel_core.types.isIdentifier(callee.object.property, { name: "default" })) return isBindingFromPino(path, callee.object.object.name);
1012
+ return false;
1013
+ }
1014
+ /**
1015
+ * Extract transport targets from a pino.transport() argument
1016
+ */
1017
+ function extractTransportsFromArg(arg) {
1018
+ const targets = [];
1019
+ if (!_babel_core.types.isObjectExpression(arg)) return targets;
1020
+ for (const prop of arg.properties) {
1021
+ if (!_babel_core.types.isObjectProperty(prop)) continue;
1022
+ const key = prop.key;
1023
+ const keyName = _babel_core.types.isIdentifier(key) ? key.name : _babel_core.types.isStringLiteral(key) ? key.value : null;
1024
+ if (keyName === "target") {
1025
+ const value = getStringValue(prop.value);
1026
+ if (value) targets.push(value);
1027
+ } else if (keyName === "targets") {
1028
+ if (_babel_core.types.isArrayExpression(prop.value)) {
1029
+ for (const element of prop.value.elements) if (_babel_core.types.isObjectExpression(element)) for (const innerProp of element.properties) {
1030
+ const targetValue = extractTargetFromProperty(innerProp);
1031
+ if (targetValue) targets.push(targetValue);
1032
+ }
1033
+ }
1034
+ }
1035
+ }
1036
+ return targets;
1037
+ }
1038
+ /**
1039
+ * Babel plugin to detect pino transport targets in code.
1040
+ * Matches patterns like:
1041
+ * - pino.transport({ target: "package-name" })
1042
+ * - pino.transport({ targets: [{ target: "package-name" }] })
1043
+ * - variable.transport({ target: "..." }) where variable is assigned from pino import
1044
+ *
1045
+ * @param transports - Set to collect detected transport package names
1046
+ * @returns Babel plugin object
1047
+ */
1048
+ function detectPinoTransports(transports) {
1049
+ return {
1050
+ name: "detect-pino-transports",
1051
+ visitor: { CallExpression(path) {
1052
+ if (!isPinoTransportCall(path)) return;
1053
+ const firstArg = path.node.arguments[0];
1054
+ if (firstArg && !_babel_core.types.isSpreadElement(firstArg)) for (const target of extractTransportsFromArg(firstArg)) transports.add(target);
1055
+ } }
1056
+ };
1057
+ }
1058
+ //#endregion
1059
+ //#region src/build/analyze.ts
1060
+ function preferDependencyInfo(existing, incoming) {
1061
+ return {
1062
+ version: incoming.version ?? existing?.version,
1063
+ packageSpec: incoming.packageSpec ?? existing?.packageSpec
1064
+ };
1065
+ }
1066
+ async function resolveDependencyInfo(dep, existing, parentPaths) {
1067
+ if (existing?.version || existing?.packageSpec) return existing;
1068
+ const packageName = require_utils.getPackageName(dep);
1069
+ const packageNames = [...new Set([dep, packageName].filter(Boolean))];
1070
+ for (const parentPath of parentPaths) for (const name of packageNames) {
1071
+ const metadata = await require_bundler.getPackageMetadata(name, parentPath);
1072
+ if (metadata.version || metadata.packageSpec) return preferDependencyInfo(existing, metadata);
1073
+ }
1074
+ for (const name of packageNames) {
1075
+ const metadata = await require_bundler.getPackageMetadata(name);
1076
+ if (metadata.version || metadata.packageSpec) return preferDependencyInfo(existing, metadata);
1077
+ }
1078
+ return existing ?? {};
1079
+ }
1080
+ function importerParentPaths(importerId, base) {
1081
+ if (!importerId || importerId.startsWith("\0") || !(0, path.isAbsolute)(importerId)) return base;
1082
+ return [.../* @__PURE__ */ new Set([importerId, ...base])];
1083
+ }
1084
+ function getLastConcreteModuleId(moduleIds) {
1085
+ return moduleIds.findLast((id) => !id.startsWith("\0") && (0, path.isAbsolute)(id));
1086
+ }
1087
+ function throwExternalDependencyError({ errorId, moduleName, packageName, messagePrefix }) {
1088
+ throw new _mastra_core_error.MastraError({
1089
+ id: errorId,
1090
+ domain: _mastra_core_error.ErrorDomain.DEPLOYER,
1091
+ category: _mastra_core_error.ErrorCategory.USER,
1092
+ details: {
1093
+ importFile: moduleName,
1094
+ packageName
1095
+ },
1096
+ text: `${messagePrefix} \`${packageName}\` to your externals.
1097
+
1098
+ export const mastra = new Mastra({
1099
+ bundler: {
1100
+ externals: ["${packageName}"],
1101
+ }
1102
+ })`
1103
+ });
1104
+ }
1105
+ function getPackageNameFromBundledModuleName(moduleName) {
1106
+ if (moduleName.includes("__")) return moduleName.replaceAll("__", "/");
1107
+ const chunks = moduleName.split("-");
1108
+ if (!chunks.length) return moduleName;
1109
+ if (chunks[0]?.startsWith("@")) return chunks.slice(0, 2).join("/");
1110
+ return chunks[0];
1111
+ }
1112
+ function validateError(err, file, { binaryMapData, workspaceMap }) {
1113
+ let moduleName = null;
1114
+ let errorConfig = null;
1115
+ if (err instanceof ValidationError) {
1116
+ const parsedStack = import_stack_trace_parser_cjs.parse(err.stack);
1117
+ if (err.type === "TypeError") {
1118
+ const pkgNameRegex = /.*node_modules\/([^\/]+)\//;
1119
+ const stacktraceFrame = parsedStack.find((frame) => frame.file && pkgNameRegex.test(frame.file));
1120
+ if (stacktraceFrame) moduleName = stacktraceFrame.file.match(pkgNameRegex)?.[1] ?? getPackageNameFromBundledModuleName((0, path.basename)(file.name));
1121
+ else moduleName = getPackageNameFromBundledModuleName((0, path.basename)(file.name));
1122
+ errorConfig = {
1123
+ id: "DEPLOYER_ANALYZE_TYPE_ERROR",
1124
+ messagePrefix: `Mastra wasn't able to bundle "${moduleName}", might be an older commonJS module. Please add`
1125
+ };
1126
+ } else if (err.stack?.includes?.("[ERR_MODULE_NOT_FOUND]")) {
1127
+ moduleName = err.message.match(/Cannot find package '([^']+)'/)?.[1];
1128
+ const parentModuleName = getPackageNameFromBundledModuleName((0, path.basename)(file.name));
1129
+ errorConfig = {
1130
+ id: "DEPLOYER_ANALYZE_MODULE_NOT_FOUND",
1131
+ messagePrefix: `Mastra wasn't able to build your project, We couldn't load "${moduleName}" from "${parentModuleName}". Make sure "${moduleName}" is installed or add`
1132
+ };
1133
+ if (moduleName === parentModuleName) return;
1134
+ }
1135
+ }
1136
+ if (err.message.includes("No native build was found")) {
1137
+ const pkgName = getPackageNameFromBundledModuleName((0, path.basename)(file.name));
1138
+ moduleName = binaryMapData[file.fileName]?.[0] ?? pkgName;
1139
+ errorConfig = {
1140
+ id: "DEPLOYER_ANALYZE_MISSING_NATIVE_BUILD",
1141
+ messagePrefix: "We found a binary dependency in your bundle but we cannot bundle it yet. Please add"
1142
+ };
1143
+ }
1144
+ if (moduleName && workspaceMap.has(moduleName)) throw new _mastra_core_error.MastraError({
1145
+ id: "DEPLOYER_ANALYZE_ERROR_IN_WORKSPACE",
1146
+ domain: _mastra_core_error.ErrorDomain.DEPLOYER,
1147
+ category: _mastra_core_error.ErrorCategory.USER,
1148
+ details: { packageName: moduleName },
1149
+ text: `We found an error in the ${moduleName} workspace package. Please find the offending package and fix the error.
1150
+ Error: ${err.stack}`
1151
+ });
1152
+ if (errorConfig && moduleName) throwExternalDependencyError({
1153
+ errorId: errorConfig.id,
1154
+ moduleName,
1155
+ packageName: moduleName,
1156
+ messagePrefix: errorConfig.messagePrefix
1157
+ });
1158
+ }
1159
+ async function validateFile(root, file, { binaryMapData, moduleResolveMapLocation, logger, workspaceMap, stubbedExternals }) {
1160
+ try {
1161
+ if (!file.isDynamicEntry && file.isEntry) await validate((0, path.join)(root, file.fileName), {
1162
+ moduleResolveMapLocation,
1163
+ injectESMShim: false,
1164
+ stubbedExternals
1165
+ });
1166
+ } catch (err) {
1167
+ let errorToHandle = err;
1168
+ if (err instanceof ValidationError && err.type === "ReferenceError" && (err.message.startsWith("__dirname") || err.message.startsWith("__filename"))) try {
1169
+ await validate((0, path.join)(root, file.fileName), {
1170
+ moduleResolveMapLocation,
1171
+ injectESMShim: true,
1172
+ stubbedExternals
1173
+ });
1174
+ errorToHandle = null;
1175
+ } catch (err) {
1176
+ errorToHandle = err;
1177
+ }
1178
+ if (errorToHandle instanceof Error) validateError(errorToHandle, file, {
1179
+ binaryMapData,
1180
+ logger,
1181
+ workspaceMap
1182
+ });
1183
+ }
1184
+ }
1185
+ /**
1186
+ * Validates the bundled output by attempting to import each generated module.
1187
+ * Tracks external dependencies that couldn't be bundled.
1188
+ *
1189
+ * @param output - Bundle output from rollup
1190
+ * @param reverseVirtualReferenceMap - Map to resolve virtual module names back to original deps
1191
+ * @param outputDir - Directory containing the bundled files
1192
+ * @param logger - Logger instance for debugging
1193
+ * @param workspaceMap - Map of workspace packages that gets directly passed through for later consumption
1194
+ * @returns Analysis result containing dependency mappings
1195
+ */
1196
+ async function validateOutput({ output, reverseVirtualReferenceMap, usedExternals, userExternals, outputDir, projectRoot, workspaceMap, depsVersionInfo }, logger) {
1197
+ const result = {
1198
+ dependencies: /* @__PURE__ */ new Map(),
1199
+ externalDependencies: /* @__PURE__ */ new Map(),
1200
+ workspaceMap
1201
+ };
1202
+ const externalMetadataParentPaths = [projectRoot, ...Array.from(workspaceMap.values()).map((pkgInfo) => pkgInfo.location)];
1203
+ for (const deps of Object.values(usedExternals)) for (const [dep, importerId] of Object.entries(deps)) {
1204
+ if (require_utils.isExternalProtocolImport(dep)) continue;
1205
+ const pkgName = require_utils.getPackageName(dep);
1206
+ if (pkgName) {
1207
+ const dependencyInfo = await resolveDependencyInfo(dep, depsVersionInfo.get(dep) || depsVersionInfo.get(pkgName), importerParentPaths(importerId, externalMetadataParentPaths));
1208
+ result.externalDependencies.set(pkgName, preferDependencyInfo(result.externalDependencies.get(pkgName), dependencyInfo));
1209
+ }
1210
+ }
1211
+ let binaryMapData = {};
1212
+ if ((0, fs.existsSync)((0, path.join)(outputDir, "binary-map.json"))) {
1213
+ const binaryMap = await (0, fs_promises.readFile)((0, path.join)(outputDir, "binary-map.json"), "utf-8");
1214
+ binaryMapData = JSON.parse(binaryMap);
1215
+ }
1216
+ const stubbedExternals = [.../* @__PURE__ */ new Set([
1217
+ ...GLOBAL_EXTERNALS,
1218
+ ...DEPS_TO_IGNORE,
1219
+ ...userExternals,
1220
+ ...result.externalDependencies.keys()
1221
+ ])];
1222
+ for (const file of output) {
1223
+ if (file.type === "asset") continue;
1224
+ logger.debug("Validating module", { fileName: file.fileName });
1225
+ if (file.isEntry && reverseVirtualReferenceMap.has(file.name)) result.dependencies.set(reverseVirtualReferenceMap.get(file.name), file.fileName);
1226
+ await validateFile(projectRoot, file, {
1227
+ binaryMapData,
1228
+ moduleResolveMapLocation: (0, path.join)(outputDir, "module-resolve-map.json"),
1229
+ logger,
1230
+ workspaceMap,
1231
+ stubbedExternals
1232
+ });
1233
+ }
1234
+ return result;
1235
+ }
1236
+ /**
1237
+ * Main bundle analysis function that orchestrates the three-step process:
1238
+ * 1. Analyze dependencies
1239
+ * 2. Bundle dependencies modules
1240
+ * 3. Validate generated bundles
1241
+ *
1242
+ * This helps identify which dependencies need to be externalized vs bundled.
1243
+ */
1244
+ async function analyzeBundle(entries, mastraEntry, { outputDir, projectRoot, platform, isDev = false, bundlerOptions }, logger) {
1245
+ const mastraConfig = await (0, fs_promises.readFile)(mastraEntry, "utf-8");
1246
+ const mastraConfigResult = { hasValidConfig: false };
1247
+ await (0, _babel_core.transformAsync)(mastraConfig, {
1248
+ filename: mastraEntry,
1249
+ presets: [{}.resolve("@babel/preset-typescript")],
1250
+ plugins: [() => checkConfigExport(mastraConfigResult)]
1251
+ });
1252
+ if (!mastraConfigResult.hasValidConfig) logger.warn("Invalid Mastra config", { details: "Please make sure that your entry file looks like this:\nexport const mastra = new Mastra({\n // your options\n})\n\nIf you think your configuration is valid, please open an issue." });
1253
+ const { workspaceMap, workspaceRoot } = await getWorkspaceInformation({ mastraEntryFile: mastraEntry });
1254
+ let externalsPreset = false;
1255
+ const userExternals = Array.isArray(bundlerOptions?.externals) ? bundlerOptions?.externals : [];
1256
+ const userDynamicPackages = bundlerOptions?.dynamicPackages ?? [];
1257
+ if (bundlerOptions?.externals === true) externalsPreset = true;
1258
+ let index = 0;
1259
+ const depsToOptimize = /* @__PURE__ */ new Map();
1260
+ const allExternals = [...GLOBAL_EXTERNALS, ...userExternals].filter(Boolean);
1261
+ const detectedPinoTransports = /* @__PURE__ */ new Set();
1262
+ logger.info("Analyzing dependencies...");
1263
+ const allUsedExternals = /* @__PURE__ */ new Map();
1264
+ const analyzeCache = /* @__PURE__ */ new Map();
1265
+ for (const entry of entries) {
1266
+ const analyzeResult = await analyzeEntry({
1267
+ entry,
1268
+ isVirtualFile: entry.includes("\n") || !(0, fs.existsSync)(entry)
1269
+ }, mastraEntry, {
1270
+ logger,
1271
+ sourcemapEnabled: bundlerOptions?.enableSourcemap ?? false,
1272
+ workspaceMap,
1273
+ projectRoot,
1274
+ shouldCheckTransitiveDependencies: true,
1275
+ analyzeCache
1276
+ });
1277
+ (0, _babel_core.transformSync)(analyzeResult.output.code, {
1278
+ filename: "pino-detection.js",
1279
+ plugins: [() => detectPinoTransports(detectedPinoTransports)],
1280
+ configFile: false,
1281
+ babelrc: false,
1282
+ code: false
1283
+ });
1284
+ await (0, fs_promises.writeFile)((0, path.join)(outputDir, `entry-${index++}.mjs`), analyzeResult.output.code);
1285
+ for (const [dep, metadata] of analyzeResult.dependencies.entries()) {
1286
+ if (allExternals.some((external) => require_utils.isDependencyPartOfPackage(dep, external)) || externalsPreset && !metadata.isWorkspace) {
1287
+ const pkgName = require_utils.getPackageName(dep);
1288
+ if (pkgName) allUsedExternals.set(pkgName, preferDependencyInfo(allUsedExternals.get(pkgName), metadata));
1289
+ continue;
1290
+ }
1291
+ if (depsToOptimize.has(dep)) {
1292
+ const existingEntry = depsToOptimize.get(dep);
1293
+ depsToOptimize.set(dep, {
1294
+ ...existingEntry,
1295
+ version: metadata.version ?? existingEntry.version,
1296
+ packageSpec: metadata.packageSpec ?? existingEntry.packageSpec,
1297
+ exports: [.../* @__PURE__ */ new Set([...existingEntry.exports, ...metadata.exports])]
1298
+ });
1299
+ } else depsToOptimize.set(dep, metadata);
1300
+ }
1301
+ }
1302
+ const depsVersionInfo = /* @__PURE__ */ new Map();
1303
+ for (const [dep, metadata] of depsToOptimize.entries()) {
1304
+ const pkgName = require_utils.getPackageName(dep);
1305
+ if (pkgName && (metadata.version || metadata.packageSpec)) depsVersionInfo.set(pkgName, preferDependencyInfo(depsVersionInfo.get(pkgName), metadata));
1306
+ if (metadata.version || metadata.packageSpec) depsVersionInfo.set(dep, preferDependencyInfo(depsVersionInfo.get(dep), metadata));
1307
+ }
1308
+ /**
1309
+ * Only during `mastra dev` we want to optimize workspace packages. In previous steps we might have added dependencies that are not workspace packages, so we gotta remove them again.
1310
+ */
1311
+ if (isDev || externalsPreset) {
1312
+ for (const [dep, metadata] of depsToOptimize.entries()) if (!metadata.isWorkspace) depsToOptimize.delete(dep);
1313
+ }
1314
+ const sortedDeps = Array.from(depsToOptimize.keys()).sort();
1315
+ logger.info("Optimizing dependencies...");
1316
+ logger.debug("Sorted dependencies", { deps: sortedDeps });
1317
+ const { output, fileNameToDependencyMap, usedExternals } = await bundleExternals(depsToOptimize, outputDir, {
1318
+ bundlerOptions: {
1319
+ ...bundlerOptions,
1320
+ externals: bundlerOptions?.externals ?? allExternals,
1321
+ isDev
1322
+ },
1323
+ projectRoot,
1324
+ workspaceRoot,
1325
+ workspaceMap,
1326
+ platform
1327
+ });
1328
+ const relativeWorkspaceFolderPaths = Array.from(workspaceMap.values()).map((pkgInfo) => require_utils.slash((0, path.relative)(workspaceRoot || projectRoot, pkgInfo.location)));
1329
+ for (const o of output) {
1330
+ if (o.type === "asset") continue;
1331
+ const importerId = getLastConcreteModuleId(o.moduleIds);
1332
+ for (const i of o.imports) {
1333
+ if (require_utils.isBuiltinModule(i)) continue;
1334
+ if (i.startsWith(".") || i.startsWith("/")) continue;
1335
+ if (!require_utils.isBareModuleSpecifier(i) || require_utils.isExternalProtocolImport(i)) continue;
1336
+ if (relativeWorkspaceFolderPaths.some((workspacePath) => i.startsWith(workspacePath))) continue;
1337
+ const pkgName = require_utils.getPackageName(i);
1338
+ if (pkgName && workspaceMap.has(pkgName)) continue;
1339
+ if (pkgName) {
1340
+ const dependencyInfo = await resolveDependencyInfo(i, depsVersionInfo.get(i) || depsVersionInfo.get(pkgName), importerParentPaths(importerId, [projectRoot, ...Array.from(workspaceMap.values()).map((pkgInfo) => pkgInfo.location)]));
1341
+ allUsedExternals.set(pkgName, preferDependencyInfo(allUsedExternals.get(pkgName), dependencyInfo));
1342
+ }
1343
+ }
1344
+ }
1345
+ const result = await validateOutput({
1346
+ output,
1347
+ reverseVirtualReferenceMap: fileNameToDependencyMap,
1348
+ usedExternals,
1349
+ userExternals,
1350
+ outputDir,
1351
+ projectRoot: workspaceRoot || projectRoot,
1352
+ workspaceMap,
1353
+ depsVersionInfo
1354
+ }, logger);
1355
+ /**
1356
+ * Build the final set of external dependencies from four sources:
1357
+ * 1. result.externalDependencies - externals discovered during bundle validation
1358
+ * 2. allUsedExternals - packages detected via static analysis that matched the externals config
1359
+ * 3. detectedPinoTransports - pino transports detected by the plugin during bundling
1360
+ * 4. userDynamicPackages - user-specified packages loaded dynamically at runtime
1361
+ *
1362
+ * Prefer entries with version info over entries without
1363
+ */
1364
+ const mergedExternalDeps = new Map(result.externalDependencies);
1365
+ for (const [dep, info] of allUsedExternals) {
1366
+ if (require_utils.isExternalProtocolImport(dep)) continue;
1367
+ mergedExternalDeps.set(dep, preferDependencyInfo(mergedExternalDeps.get(dep), info));
1368
+ }
1369
+ const externalMetadataParentPaths = [
1370
+ projectRoot,
1371
+ ...Array.from(workspaceMap.values()).map((pkgInfo) => pkgInfo.location),
1372
+ __dirname
1373
+ ];
1374
+ for (const [dep, info] of mergedExternalDeps) if (!info.version && !info.packageSpec) mergedExternalDeps.set(dep, await resolveDependencyInfo(dep, info, externalMetadataParentPaths));
1375
+ for (const transport of detectedPinoTransports) if (!mergedExternalDeps.has(transport)) mergedExternalDeps.set(transport, await resolveDependencyInfo(transport, void 0, externalMetadataParentPaths));
1376
+ for (const pkg of userDynamicPackages) if (!mergedExternalDeps.has(pkg)) mergedExternalDeps.set(pkg, await resolveDependencyInfo(pkg, void 0, externalMetadataParentPaths));
1377
+ return {
1378
+ ...result,
1379
+ externalDependencies: mergedExternalDeps,
1380
+ /**
1381
+ * Workspace deps that were optimized (after isDev/externalsPreset pruning).
1382
+ * Used by the watcher to re-run optimization when workspace sources change.
1383
+ */
1384
+ depsToOptimize,
1385
+ workspaceRoot,
1386
+ outputDir,
1387
+ ...mastraConfigResult.projectType ? { projectType: mastraConfigResult.projectType } : {}
1388
+ };
1389
+ }
1390
+ //#endregion
1391
+ Object.defineProperty(exports, "aliasHono", {
1392
+ enumerable: true,
1393
+ get: function() {
1394
+ return aliasHono;
1395
+ }
1396
+ });
1397
+ Object.defineProperty(exports, "analyzeBundle", {
1398
+ enumerable: true,
1399
+ get: function() {
1400
+ return analyzeBundle;
1401
+ }
1402
+ });
1403
+ Object.defineProperty(exports, "bundleExternals", {
1404
+ enumerable: true,
1405
+ get: function() {
1406
+ return bundleExternals;
1407
+ }
1408
+ });
1409
+ Object.defineProperty(exports, "checkConfigExport", {
1410
+ enumerable: true,
1411
+ get: function() {
1412
+ return checkConfigExport;
1413
+ }
1414
+ });
1415
+ Object.defineProperty(exports, "collectTransitiveWorkspaceDependencies", {
1416
+ enumerable: true,
1417
+ get: function() {
1418
+ return collectTransitiveWorkspaceDependencies;
1419
+ }
1420
+ });
1421
+ Object.defineProperty(exports, "getWorkspaceInformation", {
1422
+ enumerable: true,
1423
+ get: function() {
1424
+ return getWorkspaceInformation;
1425
+ }
1426
+ });
1427
+ Object.defineProperty(exports, "packWorkspaceDependencies", {
1428
+ enumerable: true,
1429
+ get: function() {
1430
+ return packWorkspaceDependencies;
1431
+ }
1432
+ });
1433
+
1434
+ //# sourceMappingURL=analyze-D100622N.cjs.map