@mastra/deployer 1.54.0-alpha.0 → 1.54.0-alpha.2

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 (211) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/analyze-C2q7jxbN.js +1308 -0
  3. package/dist/analyze-C2q7jxbN.js.map +1 -0
  4. package/dist/analyze-DhDZW9TS.cjs +1318 -0
  5. package/dist/analyze-DhDZW9TS.cjs.map +1 -0
  6. package/dist/arktype-aI7TBD0R-BsgjPZ4a.cjs +8 -0
  7. package/dist/arktype-aI7TBD0R-BsgjPZ4a.cjs.map +1 -0
  8. package/dist/arktype-aI7TBD0R-_UZl-wsH.js +8 -0
  9. package/dist/arktype-aI7TBD0R-_UZl-wsH.js.map +1 -0
  10. package/dist/build/analyze/constants.d.ts.map +1 -1
  11. package/dist/build/analyze.cjs +3 -12
  12. package/dist/build/analyze.js +2 -3
  13. package/dist/build/bundler.cjs +6 -24
  14. package/dist/build/bundler.js +2 -3
  15. package/dist/build/index.cjs +29 -101
  16. package/dist/build/index.js +7 -8
  17. package/dist/build-De4AZhfJ.cjs +908 -0
  18. package/dist/build-De4AZhfJ.cjs.map +1 -0
  19. package/dist/build-KCOeHd4N.js +834 -0
  20. package/dist/build-KCOeHd4N.js.map +1 -0
  21. package/dist/bundler/index.cjs +318 -13
  22. package/dist/bundler/index.cjs.map +1 -1
  23. package/dist/bundler/index.js +314 -2
  24. package/dist/bundler/index.js.map +1 -1
  25. package/dist/bundler-BqrDXofn.cjs +792 -0
  26. package/dist/bundler-BqrDXofn.cjs.map +1 -0
  27. package/dist/bundler-D86rFu2J.js +705 -0
  28. package/dist/bundler-D86rFu2J.js.map +1 -0
  29. package/dist/bundlerOptions-aFsEi86t.js +180 -0
  30. package/dist/bundlerOptions-aFsEi86t.js.map +1 -0
  31. package/dist/bundlerOptions-rBmtSyGe.cjs +194 -0
  32. package/dist/bundlerOptions-rBmtSyGe.cjs.map +1 -0
  33. package/dist/core-D0wEgdn3.cjs +790 -0
  34. package/dist/core-D0wEgdn3.cjs.map +1 -0
  35. package/dist/core-DF65PJXc.js +790 -0
  36. package/dist/core-DF65PJXc.js.map +1 -0
  37. package/dist/dist-BauTimif.js +532 -0
  38. package/dist/dist-BauTimif.js.map +1 -0
  39. package/dist/dist-Cv-mAEtr.cjs +532 -0
  40. package/dist/dist-Cv-mAEtr.cjs.map +1 -0
  41. package/dist/docs/SKILL.md +1 -1
  42. package/dist/docs/assets/SOURCE_MAP.json +2 -23
  43. package/dist/docs/references/docs-deployment-cloud-providers.md +1 -0
  44. package/dist/docs/references/docs-deployment-overview.md +1 -0
  45. package/dist/effect-QlVUlMFu-CwFnyS-g.cjs +14 -0
  46. package/dist/effect-QlVUlMFu-CwFnyS-g.cjs.map +1 -0
  47. package/dist/effect-QlVUlMFu-gyLQRCtQ.js +14 -0
  48. package/dist/effect-QlVUlMFu-gyLQRCtQ.js.map +1 -0
  49. package/dist/esm-BX-weMyC.js +4634 -0
  50. package/dist/esm-BX-weMyC.js.map +1 -0
  51. package/dist/esm-D81PZ_wJ.cjs +4634 -0
  52. package/dist/esm-D81PZ_wJ.cjs.map +1 -0
  53. package/dist/index-CLddUTqr-B5mOP6DC.cjs +145 -0
  54. package/dist/index-CLddUTqr-B5mOP6DC.cjs.map +1 -0
  55. package/dist/index-CLddUTqr-CkS6Y_hA.js +140 -0
  56. package/dist/index-CLddUTqr-CkS6Y_hA.js.map +1 -0
  57. package/dist/index.cjs +35 -48
  58. package/dist/index.cjs.map +1 -1
  59. package/dist/index.js +29 -30
  60. package/dist/index.js.map +1 -1
  61. package/dist/rolldown-runtime-emK7D4bc.cjs +35 -0
  62. package/dist/server/index.cjs +3141 -3874
  63. package/dist/server/index.cjs.map +1 -1
  64. package/dist/server/index.d.ts.map +1 -1
  65. package/dist/server/index.js +3131 -3842
  66. package/dist/server/index.js.map +1 -1
  67. package/dist/server/types.d.ts +1 -0
  68. package/dist/server/types.d.ts.map +1 -1
  69. package/dist/services/index.cjs +5 -20
  70. package/dist/services/index.js +2 -3
  71. package/dist/services-BxYMLS9-.cjs +430 -0
  72. package/dist/services-BxYMLS9-.cjs.map +1 -0
  73. package/dist/services-CLi56qqe.js +391 -0
  74. package/dist/services-CLi56qqe.js.map +1 -0
  75. package/dist/sury-CWZTCd75-B85M6878.js +14 -0
  76. package/dist/sury-CWZTCd75-B85M6878.js.map +1 -0
  77. package/dist/sury-CWZTCd75-DTj5HlK_.cjs +14 -0
  78. package/dist/sury-CWZTCd75-DTj5HlK_.cjs.map +1 -0
  79. package/dist/typebox-Dei93FPO-BeuT13_G.cjs +8 -0
  80. package/dist/typebox-Dei93FPO-BeuT13_G.cjs.map +1 -0
  81. package/dist/typebox-Dei93FPO-DovwMlVl.js +8 -0
  82. package/dist/typebox-Dei93FPO-DovwMlVl.js.map +1 -0
  83. package/dist/utils-FVOUvj-I.js +190 -0
  84. package/dist/utils-FVOUvj-I.js.map +1 -0
  85. package/dist/utils-O98BGdnP.cjs +267 -0
  86. package/dist/utils-O98BGdnP.cjs.map +1 -0
  87. package/dist/valibot--1zFm7rT-BqJHja5B.cjs +14 -0
  88. package/dist/valibot--1zFm7rT-BqJHja5B.cjs.map +1 -0
  89. package/dist/valibot--1zFm7rT-Y4Fhea0w.js +14 -0
  90. package/dist/valibot--1zFm7rT-Y4Fhea0w.js.map +1 -0
  91. package/dist/validator/custom-resolver.cjs +71 -73
  92. package/dist/validator/custom-resolver.cjs.map +1 -1
  93. package/dist/validator/custom-resolver.js +70 -71
  94. package/dist/validator/custom-resolver.js.map +1 -1
  95. package/dist/validator/loader.cjs +6 -7
  96. package/dist/validator/loader.cjs.map +1 -1
  97. package/dist/validator/loader.js +8 -4
  98. package/dist/validator/loader.js.map +1 -1
  99. package/dist/zod-Bwrt9trS-2JL6_UI_.cjs +23 -0
  100. package/dist/zod-Bwrt9trS-2JL6_UI_.cjs.map +1 -0
  101. package/dist/zod-Bwrt9trS-rVHICsmp.js +23 -0
  102. package/dist/zod-Bwrt9trS-rVHICsmp.js.map +1 -0
  103. package/package.json +7 -7
  104. package/dist/arktype-aI7TBD0R-K3QZAVE2.js +0 -8
  105. package/dist/arktype-aI7TBD0R-K3QZAVE2.js.map +0 -1
  106. package/dist/arktype-aI7TBD0R-WK5AZZMC.cjs +0 -10
  107. package/dist/arktype-aI7TBD0R-WK5AZZMC.cjs.map +0 -1
  108. package/dist/build/analyze.cjs.map +0 -1
  109. package/dist/build/analyze.js.map +0 -1
  110. package/dist/build/bundler.cjs.map +0 -1
  111. package/dist/build/bundler.js.map +0 -1
  112. package/dist/build/index.cjs.map +0 -1
  113. package/dist/build/index.js.map +0 -1
  114. package/dist/chunk-36AWZH7Z.cjs +0 -252
  115. package/dist/chunk-36AWZH7Z.cjs.map +0 -1
  116. package/dist/chunk-3XIMK24X.cjs +0 -765
  117. package/dist/chunk-3XIMK24X.cjs.map +0 -1
  118. package/dist/chunk-46M65MQG.cjs +0 -95
  119. package/dist/chunk-46M65MQG.cjs.map +0 -1
  120. package/dist/chunk-4ZNTNJ6T.js +0 -6
  121. package/dist/chunk-4ZNTNJ6T.js.map +0 -1
  122. package/dist/chunk-5PORNUPF.js +0 -739
  123. package/dist/chunk-5PORNUPF.js.map +0 -1
  124. package/dist/chunk-743HRNWT.cjs +0 -1546
  125. package/dist/chunk-743HRNWT.cjs.map +0 -1
  126. package/dist/chunk-AEQ7JHDB.cjs +0 -412
  127. package/dist/chunk-AEQ7JHDB.cjs.map +0 -1
  128. package/dist/chunk-E5SBYHQK.js +0 -244
  129. package/dist/chunk-E5SBYHQK.js.map +0 -1
  130. package/dist/chunk-FKKJQUGR.cjs +0 -497
  131. package/dist/chunk-FKKJQUGR.cjs.map +0 -1
  132. package/dist/chunk-FQHUOYYL.js +0 -1514
  133. package/dist/chunk-FQHUOYYL.js.map +0 -1
  134. package/dist/chunk-G7MIMGMX.js +0 -14
  135. package/dist/chunk-G7MIMGMX.js.map +0 -1
  136. package/dist/chunk-HZC3PTK2.cjs +0 -16
  137. package/dist/chunk-HZC3PTK2.cjs.map +0 -1
  138. package/dist/chunk-JZRFRUGM.cjs +0 -158
  139. package/dist/chunk-JZRFRUGM.cjs.map +0 -1
  140. package/dist/chunk-L45X3DJX.js +0 -385
  141. package/dist/chunk-L45X3DJX.js.map +0 -1
  142. package/dist/chunk-PC25XSK7.cjs +0 -8
  143. package/dist/chunk-PC25XSK7.cjs.map +0 -1
  144. package/dist/chunk-PZ5AY32C.js +0 -9
  145. package/dist/chunk-PZ5AY32C.js.map +0 -1
  146. package/dist/chunk-Q7SFCCGT.cjs +0 -11
  147. package/dist/chunk-Q7SFCCGT.cjs.map +0 -1
  148. package/dist/chunk-T4UT2QX7.js +0 -3
  149. package/dist/chunk-T4UT2QX7.js.map +0 -1
  150. package/dist/chunk-UBIDJOJA.js +0 -93
  151. package/dist/chunk-UBIDJOJA.js.map +0 -1
  152. package/dist/chunk-V3EKV6QB.cjs +0 -162
  153. package/dist/chunk-V3EKV6QB.cjs.map +0 -1
  154. package/dist/chunk-WHD2QQ3N.js +0 -783
  155. package/dist/chunk-WHD2QQ3N.js.map +0 -1
  156. package/dist/chunk-WP65JQAT.js +0 -144
  157. package/dist/chunk-WP65JQAT.js.map +0 -1
  158. package/dist/chunk-YO5OFXPN.cjs +0 -819
  159. package/dist/chunk-YO5OFXPN.cjs.map +0 -1
  160. package/dist/chunk-YUBKHO52.js +0 -465
  161. package/dist/chunk-YUBKHO52.js.map +0 -1
  162. package/dist/chunk-YWMYXUHX.cjs +0 -4
  163. package/dist/chunk-YWMYXUHX.cjs.map +0 -1
  164. package/dist/chunk-ZKZOVNT4.js +0 -159
  165. package/dist/chunk-ZKZOVNT4.js.map +0 -1
  166. package/dist/core-XIDAXLRB.js +0 -11866
  167. package/dist/core-XIDAXLRB.js.map +0 -1
  168. package/dist/core-XJNQ4AY6.cjs +0 -12141
  169. package/dist/core-XJNQ4AY6.cjs.map +0 -1
  170. package/dist/default-u_dwuiYb-HGUAHA6N.cjs +0 -9
  171. package/dist/default-u_dwuiYb-HGUAHA6N.cjs.map +0 -1
  172. package/dist/default-u_dwuiYb-MVPTVDCE.js +0 -3
  173. package/dist/default-u_dwuiYb-MVPTVDCE.js.map +0 -1
  174. package/dist/dist-UEE5OLII.cjs +0 -521
  175. package/dist/dist-UEE5OLII.cjs.map +0 -1
  176. package/dist/dist-X75F2Q36.js +0 -515
  177. package/dist/dist-X75F2Q36.js.map +0 -1
  178. package/dist/effect-QlVUlMFu-QNLZLGWO.js +0 -15
  179. package/dist/effect-QlVUlMFu-QNLZLGWO.js.map +0 -1
  180. package/dist/effect-QlVUlMFu-XUD6EH23.cjs +0 -17
  181. package/dist/effect-QlVUlMFu-XUD6EH23.cjs.map +0 -1
  182. package/dist/esm-DFCHSIJZ.cjs +0 -1589
  183. package/dist/esm-DFCHSIJZ.cjs.map +0 -1
  184. package/dist/esm-PXGQ5WB4.js +0 -1542
  185. package/dist/esm-PXGQ5WB4.js.map +0 -1
  186. package/dist/services/index.cjs.map +0 -1
  187. package/dist/services/index.js.map +0 -1
  188. package/dist/sury-CWZTCd75-3KQQJ22C.cjs +0 -17
  189. package/dist/sury-CWZTCd75-3KQQJ22C.cjs.map +0 -1
  190. package/dist/sury-CWZTCd75-DZQHKAZF.js +0 -15
  191. package/dist/sury-CWZTCd75-DZQHKAZF.js.map +0 -1
  192. package/dist/typebox-Dei93FPO-GOYJ5OUT.js +0 -8
  193. package/dist/typebox-Dei93FPO-GOYJ5OUT.js.map +0 -1
  194. package/dist/typebox-Dei93FPO-M7J7E57W.cjs +0 -10
  195. package/dist/typebox-Dei93FPO-M7J7E57W.cjs.map +0 -1
  196. package/dist/valibot--1zFm7rT-NVM3G3TI.cjs +0 -17
  197. package/dist/valibot--1zFm7rT-NVM3G3TI.cjs.map +0 -1
  198. package/dist/valibot--1zFm7rT-ZVGQI7WV.js +0 -15
  199. package/dist/valibot--1zFm7rT-ZVGQI7WV.js.map +0 -1
  200. package/dist/valibot-D_HTw1Gn-UCPEGDL7.cjs +0 -45
  201. package/dist/valibot-D_HTw1Gn-UCPEGDL7.cjs.map +0 -1
  202. package/dist/valibot-D_HTw1Gn-XPR4F6VS.js +0 -43
  203. package/dist/valibot-D_HTw1Gn-XPR4F6VS.js.map +0 -1
  204. package/dist/zod-Bwrt9trS-GN7ZXBMN.js +0 -29
  205. package/dist/zod-Bwrt9trS-GN7ZXBMN.js.map +0 -1
  206. package/dist/zod-Bwrt9trS-OVKARV6W.cjs +0 -31
  207. package/dist/zod-Bwrt9trS-OVKARV6W.cjs.map +0 -1
  208. package/dist/zod-DSgpEGAE-E7YZZ7VC.js +0 -37
  209. package/dist/zod-DSgpEGAE-E7YZZ7VC.js.map +0 -1
  210. package/dist/zod-DSgpEGAE-UNQNGL2W.cjs +0 -39
  211. package/dist/zod-DSgpEGAE-UNQNGL2W.cjs.map +0 -1
@@ -0,0 +1,792 @@
1
+ const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.cjs");
2
+ const require_utils = require("./utils-O98BGdnP.cjs");
3
+ let fs = require("fs");
4
+ fs = require_rolldown_runtime.__toESM(fs, 1);
5
+ let fs_promises = require("fs/promises");
6
+ let path = require("path");
7
+ path = require_rolldown_runtime.__toESM(path, 1);
8
+ let fs_extra_esm = require("fs-extra/esm");
9
+ let _babel_core = require("@babel/core");
10
+ let url = require("url");
11
+ let _rollup_plugin_commonjs = require("@rollup/plugin-commonjs");
12
+ _rollup_plugin_commonjs = require_rolldown_runtime.__toESM(_rollup_plugin_commonjs, 1);
13
+ let _rollup_plugin_json = require("@rollup/plugin-json");
14
+ _rollup_plugin_json = require_rolldown_runtime.__toESM(_rollup_plugin_json, 1);
15
+ let rollup = require("rollup");
16
+ let _optimize_lodash_rollup_plugin = require("@optimize-lodash/rollup-plugin");
17
+ let _rollup_plugin_alias = require("@rollup/plugin-alias");
18
+ _rollup_plugin_alias = require_rolldown_runtime.__toESM(_rollup_plugin_alias, 1);
19
+ let _rollup_plugin_node_resolve = require("@rollup/plugin-node-resolve");
20
+ _rollup_plugin_node_resolve = require_rolldown_runtime.__toESM(_rollup_plugin_node_resolve, 1);
21
+ let rollup_plugin_esbuild = require("rollup-plugin-esbuild");
22
+ rollup_plugin_esbuild = require_rolldown_runtime.__toESM(rollup_plugin_esbuild, 1);
23
+ let _rollup_plugin_esm_shim = require("@rollup/plugin-esm-shim");
24
+ _rollup_plugin_esm_shim = require_rolldown_runtime.__toESM(_rollup_plugin_esm_shim, 1);
25
+ let local_pkg = require("local-pkg");
26
+ let strip_json_comments = require("strip-json-comments");
27
+ strip_json_comments = require_rolldown_runtime.__toESM(strip_json_comments, 1);
28
+ let typescript_paths = require("typescript-paths");
29
+ //#region src/build/plugins/esbuild.ts
30
+ function esbuild(options = {}) {
31
+ return (0, rollup_plugin_esbuild.default)({
32
+ target: "node20",
33
+ platform: "node",
34
+ minify: false,
35
+ ...options
36
+ });
37
+ }
38
+ //#endregion
39
+ //#region src/build/plugins/esm-shim.ts
40
+ const FilenameDeclarationRegex = /(?:const|let|var)\s+__filename/;
41
+ const DirnameDeclarationRegex = /(?:const|let|var)\s+__dirname/;
42
+ /**
43
+ * Custom ESM shim plugin wrapper that respects user-declared __filename/__dirname variables.
44
+ *
45
+ * The original @rollup/plugin-esm-shim would inject shims even when users had already declared
46
+ * their own __filename/__dirname, causing "Identifier '__filename' has already been declared" errors.
47
+ *
48
+ * This wrapper checks if the user has already declared these variables and skips the shim injection
49
+ * if so. If either variable is declared, we skip the shim entirely since the original plugin injects
50
+ * both together and we assume users who declare one will also handle the other if needed.
51
+ */
52
+ function esmShim() {
53
+ const original = (0, _rollup_plugin_esm_shim.default)();
54
+ return {
55
+ name: "esm-shim",
56
+ renderChunk(code, chunk, opts, meta) {
57
+ const hasFilename = code.includes("__filename");
58
+ const hasDirname = code.includes("__dirname");
59
+ const userDeclaredFilename = hasFilename && FilenameDeclarationRegex.test(code);
60
+ const userDeclaredDirname = hasDirname && DirnameDeclarationRegex.test(code);
61
+ if (userDeclaredFilename || userDeclaredDirname) return null;
62
+ if (typeof original.renderChunk === "function") return original.renderChunk.call(this, code, chunk, opts, meta);
63
+ return null;
64
+ }
65
+ };
66
+ }
67
+ //#endregion
68
+ //#region src/build/plugins/local-storage-detector.ts
69
+ /**
70
+ * Connection-string-shaped patterns that resolve to the build host and will
71
+ * never work inside the deploy container.
72
+ */
73
+ const LOCAL_HOST_PATTERNS = [
74
+ {
75
+ pattern: /\bfile:\.{1,2}\/[^\s'"`]+\.(?:db|sqlite)\b/gi,
76
+ hint: "LibSQL/SQLite file path relative to the build host"
77
+ },
78
+ {
79
+ pattern: /\b(?:postgres(?:ql)?|mysql|mongodb|redis|libsql):\/\/[^/\s'"`]*localhost\b/gi,
80
+ hint: "localhost in a connection string"
81
+ },
82
+ {
83
+ pattern: /\b(?:postgres(?:ql)?|mysql|mongodb|redis|libsql):\/\/[^/\s'"`]*127\.0\.0\.1\b/g,
84
+ hint: "127.0.0.1 in a connection string"
85
+ }
86
+ ];
87
+ /**
88
+ * Everything under `.mastra/.build/` is deployer-generated pre-bundled
89
+ * dependency code (`@mastra__*.mjs` shims and their shared `chunk-*.mjs`
90
+ * files), never user-authored. These preserve JSDoc examples from the
91
+ * original library source (e.g. `LibSQLStore({ url: 'file:./data.db' })`)
92
+ * which would otherwise trip the host-local detector, and their env var
93
+ * reads are library refs that must not count as user references.
94
+ */
95
+ const MASTRA_BUILD_DIR = /[\\/]\.mastra[\\/]\.build[\\/]/;
96
+ const PROCESS_ENV_DOT = /\bprocess\.env\.([A-Z_][A-Z0-9_]*)\b/g;
97
+ const PROCESS_ENV_BRACKET = /\bprocess\.env\[['"]([A-Z_][A-Z0-9_]*)['"]\]/g;
98
+ /** Names of the metadata assets emitted into the output dir. */
99
+ const LEGACY_LOCAL_PATHS_FILE = "preflight-local-paths.json";
100
+ const PREFLIGHT_METADATA_FILE = "preflight-metadata.json";
101
+ function collectEnvRefs(code) {
102
+ const refs = /* @__PURE__ */ new Set();
103
+ for (const m of code.matchAll(PROCESS_ENV_DOT)) refs.add(m[1]);
104
+ for (const m of code.matchAll(PROCESS_ENV_BRACKET)) refs.add(m[1]);
105
+ return refs;
106
+ }
107
+ function isAstNode(v) {
108
+ return typeof v === "object" && v !== null && typeof v.type === "string";
109
+ }
110
+ function walkAst(node, visit) {
111
+ visit(node);
112
+ for (const value of Object.values(node)) if (Array.isArray(value)) {
113
+ for (const item of value) if (isAstNode(item)) walkAst(item, visit);
114
+ } else if (isAstNode(value)) walkAst(value, visit);
115
+ }
116
+ /** Find the first `process.env.X` / `process.env['X']` read inside an expression. */
117
+ function findFirstEnvRef(node) {
118
+ let found;
119
+ walkAst(node, (n) => {
120
+ if (found !== void 0) return;
121
+ if (n.type !== "MemberExpression") return;
122
+ const object = n.object;
123
+ if (!object || object.type !== "MemberExpression" || object.object?.type !== "Identifier" || object.object.name !== "process" || object.property?.type !== "Identifier" || object.property.name !== "env") return;
124
+ const property = n.property;
125
+ if (property?.type === "Identifier" && !n.computed) found = property.name;
126
+ else if (property?.type === "Literal" && typeof property.value === "string") found = property.value;
127
+ });
128
+ return found;
129
+ }
130
+ /**
131
+ * Parse a module and figure out, for each detected local-path value, whether
132
+ * every string literal containing it is the fallback arm of a
133
+ * `process.env.X || <literal>` / `??` expression. Returns a map from
134
+ * detected value to guarding env var name. Values with any unguarded
135
+ * occurrence (or inconsistent guards) are absent — the CLI then errors as
136
+ * before, which is the safe default.
137
+ */
138
+ function findGuardedValues(ast, values) {
139
+ const stringLiterals = [];
140
+ const guardedLiterals = /* @__PURE__ */ new Map();
141
+ walkAst(ast, (node) => {
142
+ if (node.type === "Literal" && typeof node.value === "string") {
143
+ stringLiterals.push(node);
144
+ return;
145
+ }
146
+ if (node.type === "LogicalExpression" && (node.operator === "||" || node.operator === "??")) {
147
+ const right = node.right;
148
+ if (right?.type === "Literal" && typeof right.value === "string") {
149
+ const envName = findFirstEnvRef(node.left);
150
+ if (envName) guardedLiterals.set(right, envName);
151
+ }
152
+ }
153
+ });
154
+ const result = /* @__PURE__ */ new Map();
155
+ for (const value of values) {
156
+ const containing = stringLiterals.filter((lit) => lit.value.includes(value));
157
+ if (containing.length === 0) continue;
158
+ const guards = containing.map((lit) => guardedLiterals.get(lit));
159
+ const first = guards[0];
160
+ if (first !== void 0 && guards.every((g) => g === first)) result.set(value, first);
161
+ }
162
+ return result;
163
+ }
164
+ /**
165
+ * Rollup plugin that detects host-local storage URLs (e.g. `file:./mastra.db`,
166
+ * `postgres://localhost`) in **user source modules** during bundling, and
167
+ * collects the env vars user code reads via `process.env.X`.
168
+ *
169
+ * Only modules outside `node_modules` (and the deployer's own
170
+ * `.mastra/.build/` pre-bundled files) are inspected, so library code
171
+ * (like Agent Builder prompt templates or JSDoc examples in `@mastra/core`)
172
+ * is naturally excluded. When `rootDir` is given, modules outside it are
173
+ * also excluded — symlinked dependencies (pnpm `link:`/`file:`) resolve to
174
+ * real paths that never contain `node_modules`. Tree-shaken modules are
175
+ * excluded via
176
+ * `generateBundle` — only modules that actually contribute rendered code to
177
+ * the output are reported.
178
+ *
179
+ * When a detected literal is the fallback arm of a `process.env.X || literal`
180
+ * expression, `guardedBy: "X"` is recorded so the CLI preflight can apply
181
+ * deploy-time env context instead of hard-erroring on a dead fallback.
182
+ *
183
+ * Two assets are emitted into the output directory for the CLI preflight:
184
+ * - `preflight-metadata.json` — unified metadata (local paths + user env refs)
185
+ * - `preflight-local-paths.json` — legacy shape, kept for one release so an
186
+ * older globally-installed CLI paired with a newer project-local deployer
187
+ * doesn't lose the LOCAL_STORAGE_PATH check.
188
+ */
189
+ function localStorageDetector(rootDir) {
190
+ const userModuleMatches = /* @__PURE__ */ new Map();
191
+ const userModuleEnvRefs = /* @__PURE__ */ new Map();
192
+ let normalizedRoot;
193
+ if (rootDir) {
194
+ let root = rootDir.replace(/\\/g, "/");
195
+ while (root.endsWith("/")) root = root.slice(0, -1);
196
+ normalizedRoot = root + "/";
197
+ }
198
+ return {
199
+ name: "mastra-local-storage-detector",
200
+ transform(_code, id) {
201
+ if (id.includes("node_modules")) return null;
202
+ if (MASTRA_BUILD_DIR.test(id)) return null;
203
+ if (normalizedRoot && !id.replace(/\\/g, "/").startsWith(normalizedRoot)) return null;
204
+ const refs = collectEnvRefs(_code);
205
+ if (refs.size > 0) userModuleEnvRefs.set(id, refs);
206
+ const matches = [];
207
+ for (const { pattern, hint } of LOCAL_HOST_PATTERNS) {
208
+ const re = new RegExp(pattern.source, pattern.flags.includes("g") ? pattern.flags : pattern.flags + "g");
209
+ for (const m of _code.matchAll(re)) matches.push({
210
+ value: m[0],
211
+ hint
212
+ });
213
+ }
214
+ if (matches.length > 0) {
215
+ try {
216
+ const guarded = findGuardedValues(this.parse(_code), new Set(matches.map((m) => m.value)));
217
+ for (const match of matches) {
218
+ const guardedBy = guarded.get(match.value);
219
+ if (guardedBy) match.guardedBy = guardedBy;
220
+ }
221
+ } catch {}
222
+ userModuleMatches.set(id, matches);
223
+ }
224
+ return null;
225
+ },
226
+ generateBundle(_, bundle) {
227
+ const detections = [];
228
+ const seen = /* @__PURE__ */ new Set();
229
+ const userEnvRefs = /* @__PURE__ */ new Set();
230
+ for (const chunk of Object.values(bundle)) {
231
+ if (chunk.type !== "chunk") continue;
232
+ for (const [moduleId, moduleInfo] of Object.entries(chunk.modules)) {
233
+ if (moduleInfo.renderedLength === 0) continue;
234
+ for (const ref of userModuleEnvRefs.get(moduleId) ?? []) userEnvRefs.add(ref);
235
+ const matches = userModuleMatches.get(moduleId);
236
+ if (!matches) continue;
237
+ for (const { value, hint, guardedBy } of matches) {
238
+ const key = `${hint}::${value}`;
239
+ if (seen.has(key)) continue;
240
+ seen.add(key);
241
+ detections.push({
242
+ value,
243
+ hint,
244
+ module: moduleId,
245
+ ...guardedBy ? { guardedBy } : {}
246
+ });
247
+ }
248
+ }
249
+ }
250
+ const metadata = {
251
+ version: 1,
252
+ localPaths: detections,
253
+ userEnvRefs: [...userEnvRefs].sort()
254
+ };
255
+ this.emitFile({
256
+ type: "asset",
257
+ fileName: PREFLIGHT_METADATA_FILE,
258
+ source: JSON.stringify(metadata)
259
+ });
260
+ this.emitFile({
261
+ type: "asset",
262
+ fileName: LEGACY_LOCAL_PATHS_FILE,
263
+ source: JSON.stringify(detections.map(({ value, hint, module }) => ({
264
+ value,
265
+ hint,
266
+ module
267
+ })))
268
+ });
269
+ }
270
+ };
271
+ }
272
+ //#endregion
273
+ //#region src/build/package-info.ts
274
+ /**
275
+ * Note: This function depends on local-pkg and should only be used at build-time.
276
+ * It is in a separate file to avoid including local-pkg in runtime code.
277
+ */
278
+ /**
279
+ * Normalize a resolution base path to a directory file URL.
280
+ *
281
+ * Callers often pass a module file path (e.g. a rollup module id like
282
+ * `node_modules/@mastra/core/dist/chunk-XYZ.js`) as the parent path. mlly (used by local-pkg)
283
+ * also treats each resolution base as a directory candidate (`<base>/_index.js`), which makes it
284
+ * try to read `<file>/package.json`. That fails with ENOTDIR, which mlly does not tolerate
285
+ * (only ENOENT) and local-pkg then logs the raw error to the console. Using the file's directory
286
+ * as the base avoids this while resolving identically.
287
+ */
288
+ function toParentDirectoryUrl(parentPath) {
289
+ let fsPath = parentPath.startsWith("file://") ? (0, url.fileURLToPath)(parentPath) : parentPath;
290
+ try {
291
+ if ((0, fs.statSync)(fsPath).isFile()) fsPath = (0, path.dirname)(fsPath);
292
+ } catch {}
293
+ return (0, url.pathToFileURL)(fsPath).href;
294
+ }
295
+ /**
296
+ * Get package root path
297
+ */
298
+ async function getPackageRootPath(packageName, parentPath) {
299
+ let rootPath;
300
+ try {
301
+ let options = void 0;
302
+ if (parentPath) options = { paths: [toParentDirectoryUrl(parentPath)] };
303
+ rootPath = (await (0, local_pkg.getPackageInfo)(packageName, options))?.rootPath ?? null;
304
+ } catch {
305
+ rootPath = null;
306
+ }
307
+ return rootPath;
308
+ }
309
+ async function readPackageMetadata(rootPath, requestedPackageName) {
310
+ try {
311
+ const pkgJson = await (0, fs_extra_esm.readJSON)(`${rootPath}/package.json`);
312
+ const version = pkgJson.version;
313
+ const actualPackageName = pkgJson.name;
314
+ return {
315
+ rootPath,
316
+ version,
317
+ packageSpec: version && actualPackageName && requestedPackageName && requestedPackageName !== actualPackageName ? `npm:${actualPackageName}@${version}` : void 0
318
+ };
319
+ } catch {
320
+ return { rootPath };
321
+ }
322
+ }
323
+ async function getPackageMetadata(packageName, parentPath) {
324
+ const requestedPackageName = require_utils.getPackageName(packageName);
325
+ const packageNames = [...new Set([packageName, requestedPackageName].filter(Boolean))];
326
+ let firstRootPath = null;
327
+ for (const name of packageNames) {
328
+ const rootPath = await getPackageRootPath(name, parentPath);
329
+ firstRootPath ??= rootPath;
330
+ if (!rootPath) continue;
331
+ const metadata = await readPackageMetadata(rootPath, requestedPackageName ?? null);
332
+ if (metadata.version || metadata.packageSpec) return metadata;
333
+ }
334
+ return { rootPath: firstRootPath };
335
+ }
336
+ //#endregion
337
+ //#region src/build/plugins/node-modules-extension-resolver.ts
338
+ /**
339
+ * Check if a package has an exports field in its package.json.
340
+ * Results are cached to avoid repeated filesystem reads.
341
+ */
342
+ async function getPackageJSON(pkgName, importer) {
343
+ const pkgRoot = await getPackageRootPath(pkgName, importer);
344
+ if (!pkgRoot) throw new Error(`Package ${pkgName} not found`);
345
+ return JSON.parse(await (0, fs_promises.readFile)((0, path.join)(pkgRoot, "package.json"), "utf-8"));
346
+ }
347
+ /**
348
+ * Rollup plugin that resolves module extensions for external dependencies.
349
+ *
350
+ * This plugin handles ESM compatibility for external imports when node-resolve is not used:
351
+ * - Packages WITH exports field (e.g., hono, date-fns): Keep imports as-is or strip redundant extensions
352
+ * - Packages WITHOUT exports field (e.g., lodash): Add .js extension for direct file imports
353
+ */
354
+ function nodeModulesExtensionResolver() {
355
+ const nodeResolvePlugin = (0, _rollup_plugin_node_resolve.default)();
356
+ return {
357
+ name: "node-modules-extension-resolver",
358
+ async resolveId(id, importer, options) {
359
+ if (!importer || !require_utils.isBareModuleSpecifier(id) || require_utils.isExternalProtocolImport(id) || (0, path.isAbsolute)(id)) return null;
360
+ const parts = id.split("/");
361
+ const isScoped = id.startsWith("@");
362
+ if (isScoped && parts.length === 2 || !isScoped && parts.length === 1) return null;
363
+ const pkgName = require_utils.getPackageName(id);
364
+ if (!pkgName) return null;
365
+ try {
366
+ if (!!(await getPackageJSON(pkgName, importer)).exports) return null;
367
+ const packageRoot = await getPackageRootPath(pkgName, importer);
368
+ const nodeResolved = await nodeResolvePlugin.resolveId?.handler?.call(this, id, importer, options);
369
+ if (!nodeResolved?.id) return null;
370
+ let filePath = nodeResolved.id;
371
+ if (nodeResolved.resolvedBy === "commonjs--resolver") filePath = filePath.substring(1).split("?")[0];
372
+ return {
373
+ id: filePath.replace(packageRoot, pkgName),
374
+ external: true
375
+ };
376
+ } catch (err) {
377
+ console.error(err);
378
+ return null;
379
+ }
380
+ }
381
+ };
382
+ }
383
+ //#endregion
384
+ //#region src/build/plugins/protocol-external-resolver.ts
385
+ function protocolExternalResolver({ exclude = ["node:"] } = {}) {
386
+ return {
387
+ name: "protocol-external-resolver",
388
+ resolveId(id) {
389
+ if (!require_utils.isExternalProtocolImport(id, exclude)) return null;
390
+ return {
391
+ id,
392
+ external: true
393
+ };
394
+ }
395
+ };
396
+ }
397
+ //#endregion
398
+ //#region src/build/babel/remove-deployer.ts
399
+ function removeDeployer$1() {
400
+ function removeDeployerFromObject(objectExpr, scope) {
401
+ const deployerProp = objectExpr.properties.find((prop) => _babel_core.types.isObjectProperty(prop) && _babel_core.types.isIdentifier(prop.key) && prop.key.name === "deployer");
402
+ if (deployerProp) {
403
+ objectExpr.properties = objectExpr.properties.filter((prop) => prop !== deployerProp);
404
+ if (_babel_core.types.isIdentifier(deployerProp.value)) {
405
+ const deployerBinding = scope.getBinding(deployerProp.value.name);
406
+ if (deployerBinding) deployerBinding.path?.parentPath?.remove();
407
+ }
408
+ }
409
+ return deployerProp;
410
+ }
411
+ return {
412
+ name: "remove-deployer",
413
+ visitor: { NewExpression(path, state) {
414
+ if (!path.findParent((path) => _babel_core.types.isVariableDeclarator(path.node))) return;
415
+ const parentNode = path.parentPath.node;
416
+ if (!_babel_core.types.isVariableDeclarator(parentNode) || !_babel_core.types.isIdentifier(parentNode.id) || parentNode.id.name !== "mastra") return;
417
+ if (!state.hasReplaced) {
418
+ state.hasReplaced = true;
419
+ const newMastraObj = _babel_core.types.cloneNode(path.node);
420
+ if (_babel_core.types.isObjectExpression(newMastraObj.arguments[0]) && newMastraObj.arguments[0].properties?.length) {
421
+ const objectArg = newMastraObj.arguments[0];
422
+ let foundDeployer = false;
423
+ if (removeDeployerFromObject(objectArg, state.file.scope)) foundDeployer = true;
424
+ for (const prop of objectArg.properties) if (_babel_core.types.isSpreadElement(prop) && _babel_core.types.isIdentifier(prop.argument)) {
425
+ const spreadBinding = state.file.scope.getBinding(prop.argument.name);
426
+ if (spreadBinding?.path && _babel_core.types.isVariableDeclarator(spreadBinding.path.node)) {
427
+ const init = spreadBinding.path.node.init;
428
+ if (_babel_core.types.isObjectExpression(init)) {
429
+ if (removeDeployerFromObject(init, state.file.scope)) foundDeployer = true;
430
+ }
431
+ }
432
+ }
433
+ if (foundDeployer) path.replaceWith(newMastraObj);
434
+ }
435
+ }
436
+ } }
437
+ };
438
+ }
439
+ //#endregion
440
+ //#region src/build/plugins/remove-deployer.ts
441
+ function removeDeployer(mastraEntry, options) {
442
+ return {
443
+ name: "remove-deployer",
444
+ transform(code, id) {
445
+ if (id !== mastraEntry) return;
446
+ return (0, _babel_core.transformAsync)(code, {
447
+ babelrc: false,
448
+ configFile: false,
449
+ filename: id,
450
+ plugins: [removeDeployer$1],
451
+ sourceMaps: options?.sourcemap
452
+ }).then((result) => ({
453
+ code: result.code,
454
+ map: result.map
455
+ }));
456
+ }
457
+ };
458
+ }
459
+ //#endregion
460
+ //#region src/build/plugins/subpath-externals-resolver.ts
461
+ function subpathExternalsResolver(externals) {
462
+ return {
463
+ name: "subpath-externals-resolver",
464
+ resolveId(id) {
465
+ if (id.startsWith(".") || id.startsWith("/")) return null;
466
+ if (externals.some((external) => require_utils.isDependencyPartOfPackage(id, external))) return {
467
+ id,
468
+ external: true
469
+ };
470
+ }
471
+ };
472
+ }
473
+ //#endregion
474
+ //#region src/build/plugins/tsconfig-paths.ts
475
+ const PLUGIN_NAME = "tsconfig-paths";
476
+ const JS_IMPORT_SOURCE_EXTENSIONS = [
477
+ ".ts",
478
+ ".tsx",
479
+ ".js",
480
+ ".jsx"
481
+ ];
482
+ /**
483
+ * Check if a tsconfig file has path mappings configured.
484
+ * Exported for testing purposes.
485
+ *
486
+ * @param tsConfigPath - Path to the tsconfig.json file
487
+ * @returns true if the tsconfig has paths configured or extends another config, false otherwise
488
+ */
489
+ function hasPaths(tsConfigPath) {
490
+ try {
491
+ const content = fs.default.readFileSync(tsConfigPath, "utf8");
492
+ const config = JSON.parse((0, strip_json_comments.default)(content));
493
+ return !!(config.compilerOptions?.paths && Object.keys(config.compilerOptions.paths).length > 0 || typeof config.extends === "string" && config.extends.length > 0 || Array.isArray(config.extends) && config.extends.length > 0);
494
+ } catch {
495
+ return false;
496
+ }
497
+ }
498
+ function tsConfigPaths({ tsConfigPath, respectCoreModule, localResolve } = {}) {
499
+ const handlerCache = /* @__PURE__ */ new Map();
500
+ function resolveJsImportToSourceFile(moduleName) {
501
+ if (fs.default.existsSync(moduleName)) return moduleName;
502
+ const parsed = path.default.parse(moduleName);
503
+ if (parsed.ext !== ".js") return moduleName;
504
+ for (const extension of JS_IMPORT_SOURCE_EXTENSIONS) {
505
+ const candidate = path.default.join(parsed.dir, `${parsed.name}${extension}`);
506
+ if (fs.default.existsSync(candidate)) return candidate;
507
+ }
508
+ return moduleName;
509
+ }
510
+ function findTsConfigForFile(filePath) {
511
+ let currentDir = path.default.dirname(filePath);
512
+ const root = path.default.parse(currentDir).root;
513
+ while (currentDir !== root) {
514
+ const tsConfigPath = path.default.join(currentDir, "tsconfig.json");
515
+ if (fs.default.existsSync(tsConfigPath)) {
516
+ if (hasPaths(tsConfigPath)) return tsConfigPath;
517
+ }
518
+ const tsConfigBasePath = path.default.join(currentDir, "tsconfig.base.json");
519
+ if (fs.default.existsSync(tsConfigBasePath)) {
520
+ if (hasPaths(tsConfigBasePath)) return tsConfigBasePath;
521
+ }
522
+ currentDir = path.default.dirname(currentDir);
523
+ }
524
+ return null;
525
+ }
526
+ function getHandlerForFile(filePath) {
527
+ if (tsConfigPath && typeof tsConfigPath === "string") {
528
+ if (!handlerCache.has(tsConfigPath)) handlerCache.set(tsConfigPath, (0, typescript_paths.createHandler)({
529
+ log: () => {},
530
+ tsConfigPath,
531
+ respectCoreModule,
532
+ falllback: (moduleName) => fs.default.existsSync(moduleName)
533
+ }));
534
+ return handlerCache.get(tsConfigPath);
535
+ }
536
+ const configPath = findTsConfigForFile(filePath);
537
+ if (!configPath) return null;
538
+ if (!handlerCache.has(configPath)) handlerCache.set(configPath, (0, typescript_paths.createHandler)({
539
+ log: () => {},
540
+ tsConfigPath: configPath,
541
+ respectCoreModule,
542
+ falllback: (moduleName) => fs.default.existsSync(moduleName)
543
+ }));
544
+ return handlerCache.get(configPath);
545
+ }
546
+ function resolveAlias(request, importer) {
547
+ const dynamicHandler = getHandlerForFile(importer);
548
+ if (!dynamicHandler) return null;
549
+ return dynamicHandler(request, (0, path.normalize)(importer));
550
+ }
551
+ return {
552
+ name: PLUGIN_NAME,
553
+ resolveId: {
554
+ order: "pre",
555
+ async handler(request, importer, options) {
556
+ if (!importer || request.startsWith("\0") || importer.charCodeAt(0) === 0) return null;
557
+ if (!path.default.isAbsolute(importer)) importer = path.default.resolve(process.cwd(), importer);
558
+ const moduleName = resolveAlias(request, importer);
559
+ if (!moduleName) {
560
+ const resolved = await this.resolve(request, importer, {
561
+ skipSelf: true,
562
+ ...options
563
+ });
564
+ if (!resolved) return null;
565
+ if (localResolve) {
566
+ const importerPluginMeta = this.getModuleInfo(importer)?.meta?.[PLUGIN_NAME];
567
+ if (!request.startsWith("./") && !request.startsWith("../") && importerPluginMeta?.resolved) return {
568
+ ...resolved,
569
+ external: !request.startsWith("hono/") && request !== "hono"
570
+ };
571
+ }
572
+ return {
573
+ ...resolved,
574
+ meta: { ...resolved.meta || {} }
575
+ };
576
+ }
577
+ const resolvedModuleName = resolveJsImportToSourceFile(moduleName);
578
+ if (!path.default.extname(resolvedModuleName)) {
579
+ const resolved = await this.resolve(resolvedModuleName, importer, {
580
+ skipSelf: true,
581
+ ...options
582
+ });
583
+ if (!resolved) return null;
584
+ return {
585
+ ...resolved,
586
+ meta: {
587
+ ...resolved.meta,
588
+ [PLUGIN_NAME]: { resolved: true }
589
+ }
590
+ };
591
+ }
592
+ const resolved = await this.resolve(resolvedModuleName, importer, {
593
+ skipSelf: true,
594
+ ...options
595
+ });
596
+ if (!resolved) return null;
597
+ return {
598
+ ...resolved,
599
+ meta: {
600
+ ...resolved.meta,
601
+ [PLUGIN_NAME]: { resolved: true }
602
+ }
603
+ };
604
+ }
605
+ }
606
+ };
607
+ }
608
+ //#endregion
609
+ //#region src/build/bundler.ts
610
+ function mastraInternalAliasPlugin(entryFile) {
611
+ const normalizedEntryFile = require_utils.slash(entryFile);
612
+ return (0, _rollup_plugin_alias.default)({ entries: [
613
+ {
614
+ find: /^\#server$/,
615
+ replacement: require_utils.slash((0, url.fileURLToPath)({}.resolve("@mastra/deployer/server")))
616
+ },
617
+ {
618
+ find: /^\@mastra\/server\/(.*)/,
619
+ replacement: `@mastra/server/$1`,
620
+ customResolver: (id) => {
621
+ if (id.startsWith("@mastra/server")) return { id: (0, url.fileURLToPath)({}.resolve(id)) };
622
+ }
623
+ },
624
+ {
625
+ find: /^\#mastra$/,
626
+ replacement: normalizedEntryFile
627
+ }
628
+ ] });
629
+ }
630
+ function mastraToolsAliasPlugin() {
631
+ return {
632
+ name: "tools-rewriter",
633
+ resolveId(id) {
634
+ if (id === "#tools") return {
635
+ id: "./tools.mjs",
636
+ external: true
637
+ };
638
+ }
639
+ };
640
+ }
641
+ async function getInputOptions(entryFile, analyzedBundleInfo, platform, env = { "process.env.NODE_ENV": JSON.stringify("production") }, { sourcemap = false, isDev = false, projectRoot, workspaceRoot = void 0, enableEsmShim = true, externalsPreset = false }) {
642
+ const nodeResolvePlugin = (0, _rollup_plugin_node_resolve.default)(require_utils.getNodeResolveOptions(platform));
643
+ const externalsCopy = new Set(analyzedBundleInfo.externalDependencies.keys());
644
+ const externals = externalsPreset ? [] : Array.from(externalsCopy);
645
+ return {
646
+ logLevel: process.env.MASTRA_BUNDLER_DEBUG === "true" ? "debug" : "silent",
647
+ treeshake: "smallest",
648
+ preserveSymlinks: true,
649
+ external: externals,
650
+ plugins: [
651
+ protocolExternalResolver(),
652
+ subpathExternalsResolver(externals),
653
+ {
654
+ name: "alias-optimized-deps",
655
+ resolveId(id) {
656
+ if (!analyzedBundleInfo.dependencies.has(id)) return null;
657
+ const filename = analyzedBundleInfo.dependencies.get(id);
658
+ const absolutePath = (0, path.join)(workspaceRoot || projectRoot, filename);
659
+ if (isDev) return {
660
+ id: process.platform === "win32" ? (0, url.pathToFileURL)(absolutePath).href : absolutePath,
661
+ external: true
662
+ };
663
+ return {
664
+ id: absolutePath,
665
+ external: false
666
+ };
667
+ }
668
+ },
669
+ mastraInternalAliasPlugin(entryFile),
670
+ tsConfigPaths(),
671
+ mastraToolsAliasPlugin(),
672
+ esbuild({
673
+ platform,
674
+ define: env
675
+ }),
676
+ (0, _optimize_lodash_rollup_plugin.optimizeLodashImports)({ include: "**/*.{js,ts,mjs,cjs}" }),
677
+ externalsPreset ? null : (0, _rollup_plugin_commonjs.default)({
678
+ extensions: [".js", ".ts"],
679
+ transformMixedEsModules: true,
680
+ esmExternals(id) {
681
+ return externals.includes(id);
682
+ }
683
+ }),
684
+ enableEsmShim ? esmShim() : void 0,
685
+ externalsPreset ? nodeModulesExtensionResolver() : nodeResolvePlugin,
686
+ (0, _rollup_plugin_json.default)(),
687
+ localStorageDetector(workspaceRoot || projectRoot),
688
+ removeDeployer(entryFile, { sourcemap }),
689
+ esbuild({
690
+ include: entryFile,
691
+ platform
692
+ })
693
+ ].filter(Boolean)
694
+ };
695
+ }
696
+ async function createBundler(inputOptions, outputOptions) {
697
+ const bundler = await (0, rollup.rollup)(inputOptions);
698
+ return {
699
+ write: () => {
700
+ return bundler.write({
701
+ ...outputOptions,
702
+ format: "esm",
703
+ entryFileNames: "[name].mjs",
704
+ chunkFileNames: "[name].mjs"
705
+ });
706
+ },
707
+ close: () => {
708
+ return bundler.close();
709
+ }
710
+ };
711
+ }
712
+ //#endregion
713
+ Object.defineProperty(exports, "createBundler", {
714
+ enumerable: true,
715
+ get: function() {
716
+ return createBundler;
717
+ }
718
+ });
719
+ Object.defineProperty(exports, "esbuild", {
720
+ enumerable: true,
721
+ get: function() {
722
+ return esbuild;
723
+ }
724
+ });
725
+ Object.defineProperty(exports, "esmShim", {
726
+ enumerable: true,
727
+ get: function() {
728
+ return esmShim;
729
+ }
730
+ });
731
+ Object.defineProperty(exports, "getInputOptions", {
732
+ enumerable: true,
733
+ get: function() {
734
+ return getInputOptions;
735
+ }
736
+ });
737
+ Object.defineProperty(exports, "getPackageMetadata", {
738
+ enumerable: true,
739
+ get: function() {
740
+ return getPackageMetadata;
741
+ }
742
+ });
743
+ Object.defineProperty(exports, "getPackageRootPath", {
744
+ enumerable: true,
745
+ get: function() {
746
+ return getPackageRootPath;
747
+ }
748
+ });
749
+ Object.defineProperty(exports, "mastraInternalAliasPlugin", {
750
+ enumerable: true,
751
+ get: function() {
752
+ return mastraInternalAliasPlugin;
753
+ }
754
+ });
755
+ Object.defineProperty(exports, "mastraToolsAliasPlugin", {
756
+ enumerable: true,
757
+ get: function() {
758
+ return mastraToolsAliasPlugin;
759
+ }
760
+ });
761
+ Object.defineProperty(exports, "nodeModulesExtensionResolver", {
762
+ enumerable: true,
763
+ get: function() {
764
+ return nodeModulesExtensionResolver;
765
+ }
766
+ });
767
+ Object.defineProperty(exports, "protocolExternalResolver", {
768
+ enumerable: true,
769
+ get: function() {
770
+ return protocolExternalResolver;
771
+ }
772
+ });
773
+ Object.defineProperty(exports, "removeDeployer", {
774
+ enumerable: true,
775
+ get: function() {
776
+ return removeDeployer;
777
+ }
778
+ });
779
+ Object.defineProperty(exports, "subpathExternalsResolver", {
780
+ enumerable: true,
781
+ get: function() {
782
+ return subpathExternalsResolver;
783
+ }
784
+ });
785
+ Object.defineProperty(exports, "tsConfigPaths", {
786
+ enumerable: true,
787
+ get: function() {
788
+ return tsConfigPaths;
789
+ }
790
+ });
791
+
792
+ //# sourceMappingURL=bundler-BqrDXofn.cjs.map