@mastra/deployer 0.24.7-alpha.4 → 0.24.8-alpha.0

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 (34) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/dist/build/analyze.cjs +2 -2
  3. package/dist/build/analyze.js +1 -1
  4. package/dist/build/bundler.cjs +3 -3
  5. package/dist/build/bundler.js +1 -1
  6. package/dist/build/index.cjs +12 -12
  7. package/dist/build/index.js +4 -4
  8. package/dist/bundler/index.cjs +2 -2
  9. package/dist/bundler/index.js +1 -1
  10. package/dist/{chunk-XJ42VWDB.cjs → chunk-4BZNZFZN.cjs} +5 -5
  11. package/dist/{chunk-XJ42VWDB.cjs.map → chunk-4BZNZFZN.cjs.map} +1 -1
  12. package/dist/{chunk-VQLBK6M5.cjs → chunk-62BMSTRF.cjs} +11 -11
  13. package/dist/{chunk-VQLBK6M5.cjs.map → chunk-62BMSTRF.cjs.map} +1 -1
  14. package/dist/{chunk-D2YCDWUL.cjs → chunk-BYJ5P75V.cjs} +14 -14
  15. package/dist/{chunk-D2YCDWUL.cjs.map → chunk-BYJ5P75V.cjs.map} +1 -1
  16. package/dist/{chunk-X5SEG2FP.js → chunk-C3343ELD.js} +4 -4
  17. package/dist/chunk-C3343ELD.js.map +1 -0
  18. package/dist/{chunk-FHL5J54L.js → chunk-E5MVIUAD.js} +4 -4
  19. package/dist/{chunk-FHL5J54L.js.map → chunk-E5MVIUAD.js.map} +1 -1
  20. package/dist/{chunk-RVBHN7SB.js → chunk-FIVDPLGU.js} +5 -5
  21. package/dist/{chunk-RVBHN7SB.js.map → chunk-FIVDPLGU.js.map} +1 -1
  22. package/dist/{chunk-Q5FR6PUS.cjs → chunk-IMZH6M7G.cjs} +4 -4
  23. package/dist/chunk-IMZH6M7G.cjs.map +1 -0
  24. package/dist/{chunk-ZFUUBCEJ.js → chunk-IN6YCLG2.js} +3 -3
  25. package/dist/{chunk-ZFUUBCEJ.js.map → chunk-IN6YCLG2.js.map} +1 -1
  26. package/dist/{chunk-7US52JKZ.js → chunk-QPQ6DGHM.js} +3 -3
  27. package/dist/{chunk-7US52JKZ.js.map → chunk-QPQ6DGHM.js.map} +1 -1
  28. package/dist/{chunk-3EKA4UZF.cjs → chunk-UHRSJYRY.cjs} +9 -9
  29. package/dist/{chunk-3EKA4UZF.cjs.map → chunk-UHRSJYRY.cjs.map} +1 -1
  30. package/dist/index.cjs +5 -5
  31. package/dist/index.js +2 -2
  32. package/package.json +6 -6
  33. package/dist/chunk-Q5FR6PUS.cjs.map +0 -1
  34. package/dist/chunk-X5SEG2FP.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,54 @@
1
1
  # @mastra/deployer
2
2
 
3
+ ## 0.24.8-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Add simple virtual check for tsconfigpaths plugin, misbehaves on CI ([#11072](https://github.com/mastra-ai/mastra/pull/11072))
8
+
9
+ - Updated dependencies []:
10
+ - @mastra/core@0.24.8-alpha.0
11
+ - @mastra/server@0.24.8-alpha.0
12
+
13
+ ## 0.24.7
14
+
15
+ ### Patch Changes
16
+
17
+ - Improve nested ts-config paths resolution for NX users ([#10766](https://github.com/mastra-ai/mastra/pull/10766))
18
+
19
+ - Fix dev playground auth to allow non-protected paths to bypass authentication when `MASTRA_DEV=true`, while still requiring the `x-mastra-dev-playground` header for protected endpoints ([#10723](https://github.com/mastra-ai/mastra/pull/10723))
20
+
21
+ - Fixed a bug where ESM shims were incorrectly injected even when the user had already declared `__filename` or `__dirname` ([#10823](https://github.com/mastra-ai/mastra/pull/10823))
22
+
23
+ - Fix tsconfig.json parsing when file contains JSONC comments ([#11040](https://github.com/mastra-ai/mastra/pull/11040))
24
+
25
+ The `hasPaths()` function now uses `strip-json-comments` to properly parse tsconfig.json files that contain comments. Previously, `JSON.parse()` would fail silently on JSONC comments, causing path aliases like `@src/*` to be incorrectly treated as npm scoped packages.
26
+
27
+ - Fixed module not found errors during production builds by skipping transitive dependency validation. Production builds now only bundle direct dependencies, which also results in faster deployment times. ([#10589](https://github.com/mastra-ai/mastra/pull/10589))
28
+
29
+ Fixes #10116
30
+ Fixes #10055
31
+ Fixes #9951
32
+
33
+ - Add restart method to workflow run that allows restarting an active workflow run ([#10703](https://github.com/mastra-ai/mastra/pull/10703))
34
+ Add status filter to `getWorkflowRuns`
35
+ Add automatic restart to restart active workflow runs when server starts
36
+
37
+ - Fixed bundling to correctly exclude subpath imports of external packages. Previously, when a package like `lodash` was marked as external, subpath imports such as `lodash/merge` were still being bundled incorrectly. Now all subpaths are properly excluded. ([#10596](https://github.com/mastra-ai/mastra/pull/10596))
38
+
39
+ Fixes #10055
40
+
41
+ - Improved error messages when bundling fails during deployment. ([#10997](https://github.com/mastra-ai/mastra/pull/10997))
42
+
43
+ **What changed:**
44
+ - Build errors now show clearer messages that identify the problematic package
45
+ - Added detection for common issues like missing native builds and unresolved modules
46
+ - Errors in workspace packages are now properly identified with actionable guidance
47
+
48
+ - Updated dependencies [[`5cc85aa`](https://github.com/mastra-ai/mastra/commit/5cc85aa4329773cac8314f3aa0146227b6b158e4), [`c53f8e6`](https://github.com/mastra-ai/mastra/commit/c53f8e68df42464935f9a63eb0fc765a65aacb83), [`386ab43`](https://github.com/mastra-ai/mastra/commit/386ab4350cf2a814fb4ac0a5fc6983ca93158ffe), [`2b62302`](https://github.com/mastra-ai/mastra/commit/2b623027a9d65c1dbc963bf651e9e6a9d09da1fa), [`7d85da4`](https://github.com/mastra-ai/mastra/commit/7d85da42a5fab56009a959a9c20328558d14f4b5), [`3d7c5bd`](https://github.com/mastra-ai/mastra/commit/3d7c5bdbee1b2693cd45bf207b960dd9b7277680), [`31b381e`](https://github.com/mastra-ai/mastra/commit/31b381efb48e031c0ecc46bc6e410ae6e67b88e5), [`54cc99c`](https://github.com/mastra-ai/mastra/commit/54cc99cb99483b9e08ec41fa1502f43b71b4c351), [`e77a5f9`](https://github.com/mastra-ai/mastra/commit/e77a5f9718dc418e29e3c8a389299ed6dc0a6401), [`b685c9c`](https://github.com/mastra-ai/mastra/commit/b685c9c0b89f49e0d4542c4ac72569682db69794), [`b069af5`](https://github.com/mastra-ai/mastra/commit/b069af514c4dcfc4fdcb164303569bfff1c26e3d), [`ce01a90`](https://github.com/mastra-ai/mastra/commit/ce01a90ac4c32314c2f0cb4e4d0cf973afda11ec), [`7dc8304`](https://github.com/mastra-ai/mastra/commit/7dc830420296db516b86dcec663e54d0309b8fb8), [`6942109`](https://github.com/mastra-ai/mastra/commit/694210903c70e3c26b5ce8ca4f4637ca2d9eb369), [`62d13f4`](https://github.com/mastra-ai/mastra/commit/62d13f4d1db1c16742831f210fe4c2caf8a26d57), [`358ab98`](https://github.com/mastra-ai/mastra/commit/358ab98024c388e383aca15616e8988bf4a5b66e)]:
49
+ - @mastra/core@0.24.7
50
+ - @mastra/server@0.24.7
51
+
3
52
  ## 0.24.7-alpha.4
4
53
 
5
54
  ### Patch Changes
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkQ5FR6PUS_cjs = require('../chunk-Q5FR6PUS.cjs');
3
+ var chunkIMZH6M7G_cjs = require('../chunk-IMZH6M7G.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "analyzeBundle", {
8
8
  enumerable: true,
9
- get: function () { return chunkQ5FR6PUS_cjs.analyzeBundle; }
9
+ get: function () { return chunkIMZH6M7G_cjs.analyzeBundle; }
10
10
  });
11
11
  //# sourceMappingURL=analyze.cjs.map
12
12
  //# sourceMappingURL=analyze.cjs.map
@@ -1,3 +1,3 @@
1
- export { analyzeBundle } from '../chunk-X5SEG2FP.js';
1
+ export { analyzeBundle } from '../chunk-C3343ELD.js';
2
2
  //# sourceMappingURL=analyze.js.map
3
3
  //# sourceMappingURL=analyze.js.map
@@ -1,16 +1,16 @@
1
1
  'use strict';
2
2
 
3
- var chunk3EKA4UZF_cjs = require('../chunk-3EKA4UZF.cjs');
3
+ var chunkUHRSJYRY_cjs = require('../chunk-UHRSJYRY.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "createBundler", {
8
8
  enumerable: true,
9
- get: function () { return chunk3EKA4UZF_cjs.createBundler; }
9
+ get: function () { return chunkUHRSJYRY_cjs.createBundler; }
10
10
  });
11
11
  Object.defineProperty(exports, "getInputOptions", {
12
12
  enumerable: true,
13
- get: function () { return chunk3EKA4UZF_cjs.getInputOptions; }
13
+ get: function () { return chunkUHRSJYRY_cjs.getInputOptions; }
14
14
  });
15
15
  //# sourceMappingURL=bundler.cjs.map
16
16
  //# sourceMappingURL=bundler.cjs.map
@@ -1,3 +1,3 @@
1
- export { createBundler, getInputOptions } from '../chunk-7US52JKZ.js';
1
+ export { createBundler, getInputOptions } from '../chunk-QPQ6DGHM.js';
2
2
  //# sourceMappingURL=bundler.js.map
3
3
  //# sourceMappingURL=bundler.js.map
@@ -1,44 +1,44 @@
1
1
  'use strict';
2
2
 
3
- var chunkVQLBK6M5_cjs = require('../chunk-VQLBK6M5.cjs');
4
- var chunkXJ42VWDB_cjs = require('../chunk-XJ42VWDB.cjs');
5
- var chunk3EKA4UZF_cjs = require('../chunk-3EKA4UZF.cjs');
6
- var chunkQ5FR6PUS_cjs = require('../chunk-Q5FR6PUS.cjs');
3
+ var chunk62BMSTRF_cjs = require('../chunk-62BMSTRF.cjs');
4
+ var chunk4BZNZFZN_cjs = require('../chunk-4BZNZFZN.cjs');
5
+ var chunkUHRSJYRY_cjs = require('../chunk-UHRSJYRY.cjs');
6
+ var chunkIMZH6M7G_cjs = require('../chunk-IMZH6M7G.cjs');
7
7
  var chunk3JYRSECU_cjs = require('../chunk-3JYRSECU.cjs');
8
8
 
9
9
 
10
10
 
11
11
  Object.defineProperty(exports, "createWatcher", {
12
12
  enumerable: true,
13
- get: function () { return chunkVQLBK6M5_cjs.createWatcher; }
13
+ get: function () { return chunk62BMSTRF_cjs.createWatcher; }
14
14
  });
15
15
  Object.defineProperty(exports, "getServerOptions", {
16
16
  enumerable: true,
17
- get: function () { return chunkVQLBK6M5_cjs.getServerOptions; }
17
+ get: function () { return chunk62BMSTRF_cjs.getServerOptions; }
18
18
  });
19
19
  Object.defineProperty(exports, "getWatcherInputOptions", {
20
20
  enumerable: true,
21
- get: function () { return chunkVQLBK6M5_cjs.getInputOptions; }
21
+ get: function () { return chunk62BMSTRF_cjs.getInputOptions; }
22
22
  });
23
23
  Object.defineProperty(exports, "writeTelemetryConfig", {
24
24
  enumerable: true,
25
- get: function () { return chunkXJ42VWDB_cjs.writeTelemetryConfig; }
25
+ get: function () { return chunk4BZNZFZN_cjs.writeTelemetryConfig; }
26
26
  });
27
27
  Object.defineProperty(exports, "createBundler", {
28
28
  enumerable: true,
29
- get: function () { return chunk3EKA4UZF_cjs.createBundler; }
29
+ get: function () { return chunkUHRSJYRY_cjs.createBundler; }
30
30
  });
31
31
  Object.defineProperty(exports, "getBundlerInputOptions", {
32
32
  enumerable: true,
33
- get: function () { return chunk3EKA4UZF_cjs.getInputOptions; }
33
+ get: function () { return chunkUHRSJYRY_cjs.getInputOptions; }
34
34
  });
35
35
  Object.defineProperty(exports, "analyzeBundle", {
36
36
  enumerable: true,
37
- get: function () { return chunkQ5FR6PUS_cjs.analyzeBundle; }
37
+ get: function () { return chunkIMZH6M7G_cjs.analyzeBundle; }
38
38
  });
39
39
  Object.defineProperty(exports, "getBundlerOptions", {
40
40
  enumerable: true,
41
- get: function () { return chunkQ5FR6PUS_cjs.getBundlerOptions; }
41
+ get: function () { return chunkIMZH6M7G_cjs.getBundlerOptions; }
42
42
  });
43
43
  Object.defineProperty(exports, "Deps", {
44
44
  enumerable: true,
@@ -1,7 +1,7 @@
1
- export { createWatcher, getServerOptions, getInputOptions as getWatcherInputOptions } from '../chunk-FHL5J54L.js';
2
- export { writeTelemetryConfig } from '../chunk-ZFUUBCEJ.js';
3
- export { createBundler, getInputOptions as getBundlerInputOptions } from '../chunk-7US52JKZ.js';
4
- export { analyzeBundle, getBundlerOptions } from '../chunk-X5SEG2FP.js';
1
+ export { createWatcher, getServerOptions, getInputOptions as getWatcherInputOptions } from '../chunk-E5MVIUAD.js';
2
+ export { writeTelemetryConfig } from '../chunk-IN6YCLG2.js';
3
+ export { createBundler, getInputOptions as getBundlerInputOptions } from '../chunk-QPQ6DGHM.js';
4
+ export { analyzeBundle, getBundlerOptions } from '../chunk-C3343ELD.js';
5
5
  export { Deps, FileService } from '../chunk-5QFG6SCM.js';
6
6
  //# sourceMappingURL=index.js.map
7
7
  //# sourceMappingURL=index.js.map
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkD2YCDWUL_cjs = require('../chunk-D2YCDWUL.cjs');
3
+ var chunkBYJ5P75V_cjs = require('../chunk-BYJ5P75V.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "Bundler", {
8
8
  enumerable: true,
9
- get: function () { return chunkD2YCDWUL_cjs.Bundler; }
9
+ get: function () { return chunkBYJ5P75V_cjs.Bundler; }
10
10
  });
11
11
  //# sourceMappingURL=index.cjs.map
12
12
  //# sourceMappingURL=index.cjs.map
@@ -1,3 +1,3 @@
1
- export { Bundler } from '../chunk-RVBHN7SB.js';
1
+ export { Bundler } from '../chunk-FIVDPLGU.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
@@ -1,15 +1,15 @@
1
1
  'use strict';
2
2
 
3
- var chunkQ5FR6PUS_cjs = require('./chunk-Q5FR6PUS.cjs');
3
+ var chunkIMZH6M7G_cjs = require('./chunk-IMZH6M7G.cjs');
4
4
 
5
5
  // src/build/babel/remove-all-options-telemetry.ts
6
6
  function removeAllOptionsExceptTelemetry(result, logger) {
7
- return chunkQ5FR6PUS_cjs.removeAllOptionsFromMastraExcept(result, "telemetry", logger);
7
+ return chunkIMZH6M7G_cjs.removeAllOptionsFromMastraExcept(result, "telemetry", logger);
8
8
  }
9
9
 
10
10
  // src/build/telemetry.ts
11
11
  async function writeTelemetryConfig(entryFile, outputDir, logger) {
12
- const result = await chunkQ5FR6PUS_cjs.extractMastraOption(
12
+ const result = await chunkIMZH6M7G_cjs.extractMastraOption(
13
13
  "telemetry",
14
14
  entryFile,
15
15
  removeAllOptionsExceptTelemetry,
@@ -24,5 +24,5 @@ async function writeTelemetryConfig(entryFile, outputDir, logger) {
24
24
  }
25
25
 
26
26
  exports.writeTelemetryConfig = writeTelemetryConfig;
27
- //# sourceMappingURL=chunk-XJ42VWDB.cjs.map
28
- //# sourceMappingURL=chunk-XJ42VWDB.cjs.map
27
+ //# sourceMappingURL=chunk-4BZNZFZN.cjs.map
28
+ //# sourceMappingURL=chunk-4BZNZFZN.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/build/babel/remove-all-options-telemetry.ts","../src/build/telemetry.ts"],"names":["removeAllOptionsFromMastraExcept","extractMastraOption"],"mappings":";;;;;AAGO,SAAS,+BAAA,CAAgC,QAAsC,MAAA,EAAwB;AAC5G,EAAA,OAAOA,kDAAA,CAAiC,MAAA,EAAQ,WAAA,EAAa,MAAM,CAAA;AACrE;;;ACSA,eAAsB,oBAAA,CACpB,SAAA,EACA,SAAA,EACA,MAAA,EACoD;AACpD,EAAA,MAAM,SAAS,MAAMC,qCAAA;AAAA,IACnB,WAAA;AAAA,IACA,SAAA;AAAA,IACA,+BAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,MAAM,SAAA,GAAY,MAAA,CAAO,YAAA,CAAa,MAAA,CAAO,CAAC,CAAA,CAAE,OAAA,CAAQ,MAAA,CAAO,CAAA,CAAA,KAAK,CAAC,CAAA,CAAE,UAAA,CAAW,IAAI,CAAC,CAAA;AAEvF,EAAA,OAAO,EAAE,sBAAsB,SAAA,EAAU;AAC3C","file":"chunk-XJ42VWDB.cjs","sourcesContent":["import { removeAllOptionsFromMastraExcept } from './remove-all-options-except';\nimport type { IMastraLogger } from '@mastra/core/logger';\n\nexport function removeAllOptionsExceptTelemetry(result: { hasCustomConfig: boolean }, logger?: IMastraLogger) {\n return removeAllOptionsFromMastraExcept(result, 'telemetry', logger);\n}\n","import { removeAllOptionsExceptTelemetry } from './babel/remove-all-options-telemetry';\nimport type { Config } from '@mastra/core/mastra';\nimport { extractMastraOption, extractMastraOptionBundler } from './shared/extract-mastra-option';\nimport type { IMastraLogger } from '@mastra/core/logger';\n\nexport function getTelemetryBundler(\n entryFile: string,\n result: {\n hasCustomConfig: false;\n },\n) {\n return extractMastraOptionBundler('telemetry', entryFile, removeAllOptionsExceptTelemetry, result);\n}\n\nexport async function writeTelemetryConfig(\n entryFile: string,\n outputDir: string,\n logger?: IMastraLogger,\n): Promise<{ externalDependencies: string[] } | null> {\n const result = await extractMastraOption<Config['telemetry']>(\n 'telemetry',\n entryFile,\n removeAllOptionsExceptTelemetry,\n outputDir,\n logger,\n );\n\n if (!result) {\n return null;\n }\n\n const externals = result.bundleOutput.output[0].imports.filter(x => !x.startsWith('./'));\n\n return { externalDependencies: externals };\n}\n"]}
1
+ {"version":3,"sources":["../src/build/babel/remove-all-options-telemetry.ts","../src/build/telemetry.ts"],"names":["removeAllOptionsFromMastraExcept","extractMastraOption"],"mappings":";;;;;AAGO,SAAS,+BAAA,CAAgC,QAAsC,MAAA,EAAwB;AAC5G,EAAA,OAAOA,kDAAA,CAAiC,MAAA,EAAQ,WAAA,EAAa,MAAM,CAAA;AACrE;;;ACSA,eAAsB,oBAAA,CACpB,SAAA,EACA,SAAA,EACA,MAAA,EACoD;AACpD,EAAA,MAAM,SAAS,MAAMC,qCAAA;AAAA,IACnB,WAAA;AAAA,IACA,SAAA;AAAA,IACA,+BAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,MAAM,SAAA,GAAY,MAAA,CAAO,YAAA,CAAa,MAAA,CAAO,CAAC,CAAA,CAAE,OAAA,CAAQ,MAAA,CAAO,CAAA,CAAA,KAAK,CAAC,CAAA,CAAE,UAAA,CAAW,IAAI,CAAC,CAAA;AAEvF,EAAA,OAAO,EAAE,sBAAsB,SAAA,EAAU;AAC3C","file":"chunk-4BZNZFZN.cjs","sourcesContent":["import { removeAllOptionsFromMastraExcept } from './remove-all-options-except';\nimport type { IMastraLogger } from '@mastra/core/logger';\n\nexport function removeAllOptionsExceptTelemetry(result: { hasCustomConfig: boolean }, logger?: IMastraLogger) {\n return removeAllOptionsFromMastraExcept(result, 'telemetry', logger);\n}\n","import { removeAllOptionsExceptTelemetry } from './babel/remove-all-options-telemetry';\nimport type { Config } from '@mastra/core/mastra';\nimport { extractMastraOption, extractMastraOptionBundler } from './shared/extract-mastra-option';\nimport type { IMastraLogger } from '@mastra/core/logger';\n\nexport function getTelemetryBundler(\n entryFile: string,\n result: {\n hasCustomConfig: false;\n },\n) {\n return extractMastraOptionBundler('telemetry', entryFile, removeAllOptionsExceptTelemetry, result);\n}\n\nexport async function writeTelemetryConfig(\n entryFile: string,\n outputDir: string,\n logger?: IMastraLogger,\n): Promise<{ externalDependencies: string[] } | null> {\n const result = await extractMastraOption<Config['telemetry']>(\n 'telemetry',\n entryFile,\n removeAllOptionsExceptTelemetry,\n outputDir,\n logger,\n );\n\n if (!result) {\n return null;\n }\n\n const externals = result.bundleOutput.output[0].imports.filter(x => !x.startsWith('./'));\n\n return { externalDependencies: externals };\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunk3EKA4UZF_cjs = require('./chunk-3EKA4UZF.cjs');
4
- var chunkQ5FR6PUS_cjs = require('./chunk-Q5FR6PUS.cjs');
3
+ var chunkUHRSJYRY_cjs = require('./chunk-UHRSJYRY.cjs');
4
+ var chunkIMZH6M7G_cjs = require('./chunk-IMZH6M7G.cjs');
5
5
  var chunk3GJSIS6L_cjs = require('./chunk-3GJSIS6L.cjs');
6
6
  var rollup = require('rollup');
7
7
  var path = require('path');
@@ -104,8 +104,8 @@ function nodeModulesExtensionResolver() {
104
104
  async function getInputOptions2(entryFile, platform, env, { sourcemap = false } = {}) {
105
105
  const closestPkgJson = pkg__namespace.up({ cwd: path.dirname(entryFile) });
106
106
  const projectRoot = closestPkgJson ? path.dirname(chunk3GJSIS6L_cjs.slash(closestPkgJson)) : chunk3GJSIS6L_cjs.slash(process.cwd());
107
- const { workspaceMap, workspaceRoot } = await chunkQ5FR6PUS_cjs.getWorkspaceInformation({ mastraEntryFile: entryFile });
108
- const analyzeEntryResult = await chunkQ5FR6PUS_cjs.analyzeBundle(
107
+ const { workspaceMap, workspaceRoot } = await chunkIMZH6M7G_cjs.getWorkspaceInformation({ mastraEntryFile: entryFile });
108
+ const analyzeEntryResult = await chunkIMZH6M7G_cjs.analyzeBundle(
109
109
  [entryFile],
110
110
  entryFile,
111
111
  {
@@ -123,7 +123,7 @@ async function getInputOptions2(entryFile, platform, env, { sourcemap = false }
123
123
  deps.set(dep, metadata);
124
124
  }
125
125
  }
126
- const inputOptions = await chunk3EKA4UZF_cjs.getInputOptions(
126
+ const inputOptions = await chunkUHRSJYRY_cjs.getInputOptions(
127
127
  entryFile,
128
128
  {
129
129
  dependencies: deps,
@@ -142,7 +142,7 @@ async function getInputOptions2(entryFile, platform, env, { sourcemap = false }
142
142
  }
143
143
  if (plugin?.name === "tsconfig-paths") {
144
144
  plugins.push(
145
- chunkQ5FR6PUS_cjs.tsConfigPaths({
145
+ chunkIMZH6M7G_cjs.tsConfigPaths({
146
146
  localResolve: true
147
147
  })
148
148
  );
@@ -151,7 +151,7 @@ async function getInputOptions2(entryFile, platform, env, { sourcemap = false }
151
151
  plugins.push(plugin);
152
152
  });
153
153
  inputOptions.plugins = plugins;
154
- inputOptions.plugins.push(chunkQ5FR6PUS_cjs.aliasHono());
154
+ inputOptions.plugins.push(chunkIMZH6M7G_cjs.aliasHono());
155
155
  inputOptions.plugins.push(nodeModulesExtensionResolver());
156
156
  }
157
157
  return inputOptions;
@@ -171,12 +171,12 @@ async function createWatcher(inputOptions, outputOptions) {
171
171
 
172
172
  // src/build/babel/remove-all-options-server.ts
173
173
  function removeAllOptionsExceptServer(result, logger) {
174
- return chunkQ5FR6PUS_cjs.removeAllOptionsFromMastraExcept(result, "server", logger);
174
+ return chunkIMZH6M7G_cjs.removeAllOptionsFromMastraExcept(result, "server", logger);
175
175
  }
176
176
 
177
177
  // src/build/serverOptions.ts
178
178
  async function getServerOptions(entryFile, outputDir, logger) {
179
- const result = await chunkQ5FR6PUS_cjs.extractMastraOption(
179
+ const result = await chunkIMZH6M7G_cjs.extractMastraOption(
180
180
  "server",
181
181
  entryFile,
182
182
  removeAllOptionsExceptServer,
@@ -192,5 +192,5 @@ async function getServerOptions(entryFile, outputDir, logger) {
192
192
  exports.createWatcher = createWatcher;
193
193
  exports.getInputOptions = getInputOptions2;
194
194
  exports.getServerOptions = getServerOptions;
195
- //# sourceMappingURL=chunk-VQLBK6M5.cjs.map
196
- //# sourceMappingURL=chunk-VQLBK6M5.cjs.map
195
+ //# sourceMappingURL=chunk-62BMSTRF.cjs.map
196
+ //# sourceMappingURL=chunk-62BMSTRF.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/build/plugins/node-modules-extension-resolver.ts","../src/build/watcher.ts","../src/build/babel/remove-all-options-server.ts","../src/build/serverOptions.ts"],"names":["builtinModules","resolveFrom","extname","pathToFileURL","resolved","getPackageName","dirname","getInputOptions","pkg","slash","getWorkspaceInformation","analyzeBundle","posix","noopLogger","tsConfigPaths","aliasHono","watch","removeAllOptionsFromMastraExcept","extractMastraOption"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,SAAS,gBAAgB,SAAA,EAA4B;AACnD,EAAA,OACEA,uBAAA,CAAe,QAAA,CAAS,SAAS,CAAA,IACjC,UAAU,UAAA,CAAW,OAAO,CAAA,IAC5BA,uBAAA,CAAe,QAAA,CAAS,SAAA,CAAU,OAAA,CAAQ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A;AAAA,IACnB,QAAA;AAAA,IACA,SAAA;AAAA,IACA,4BAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,OAAO,OAAO,SAAA,EAAU;AAC1B","file":"chunk-VQLBK6M5.cjs","sourcesContent":["import { dirname, extname } from 'path';\nimport { pathToFileURL } from 'node:url';\nimport resolveFrom from 'resolve-from';\nimport type { Plugin } from 'rollup';\nimport { builtinModules } from 'node:module';\nimport { getPackageName } from '../utils';\n\n/**\n * Check if a module is a Node.js builtin module\n * @param specifier - Module specifier\n * @returns True if it's a builtin module\n */\nfunction isBuiltinModule(specifier: string): boolean {\n return (\n builtinModules.includes(specifier) ||\n specifier.startsWith('node:') ||\n builtinModules.includes(specifier.replace(/^node:/, ''))\n );\n}\n\nfunction safeResolve(id: string, importer: string) {\n try {\n return resolveFrom(importer, id);\n } catch {\n return null;\n }\n}\n\n// we only need this for dev, so we can resolve the js extension of the module as we do not use node-resolve\nexport function nodeModulesExtensionResolver(): Plugin {\n return {\n name: 'node-modules-extension-resolver',\n resolveId(id, importer) {\n // if is relative, skip\n if (id.startsWith('.') || id.startsWith('/') || !importer) {\n return null;\n }\n\n if (isBuiltinModule(id)) {\n return null;\n }\n\n // if it's a scoped direct import skip\n if (id.startsWith('@') && id.split('/').length === 2) {\n return null;\n }\n\n // if it's a direct import, skip\n if (!id.startsWith('@') && id.split('/').length === 1) {\n return null;\n }\n\n const foundExt = extname(id);\n if (foundExt) {\n return null;\n }\n\n try {\n // if we cannot resolve it, it means it's a legacy module\n const resolved = import.meta.resolve(id);\n\n if (!extname(resolved)) {\n throw new Error(`Cannot resolve ${id} from ${importer}`);\n }\n\n return null;\n } catch (e) {\n // try to do a node like resolve first\n const resolved = safeResolve(id, importer);\n if (resolved) {\n return {\n id: pathToFileURL(resolved).href,\n external: true,\n };\n }\n\n for (const ext of ['.mjs', '.js', '.cjs']) {\n const resolved = safeResolve(id + ext, importer);\n if (resolved) {\n const pkgName = getPackageName(id);\n if (!pkgName) {\n return null;\n }\n\n const pkgJsonPath = safeResolve(`${pkgName}/package.json`, importer);\n if (!pkgJsonPath) {\n return null;\n }\n\n const newImportWithExtension = resolved.replace(dirname(pkgJsonPath), pkgName);\n\n return {\n id: pathToFileURL(newImportWithExtension).href,\n external: true,\n };\n }\n }\n }\n\n return null;\n },\n } satisfies Plugin;\n}\n","import type { InputOptions, OutputOptions, Plugin } from 'rollup';\nimport { watch } from 'rollup';\nimport { dirname, posix } from 'node:path';\nimport * as pkg from 'empathic/package';\nimport { getInputOptions as getBundlerInputOptions } from './bundler';\nimport { aliasHono } from './plugins/hono-alias';\nimport { nodeModulesExtensionResolver } from './plugins/node-modules-extension-resolver';\nimport { tsConfigPaths } from './plugins/tsconfig-paths';\nimport { noopLogger } from '@mastra/core/logger';\nimport { getWorkspaceInformation } from '../bundler/workspaceDependencies';\nimport { analyzeBundle } from './analyze';\nimport { getPackageName, slash } from './utils';\n\nexport async function getInputOptions(\n entryFile: string,\n platform: 'node' | 'browser',\n env?: Record<string, string>,\n { sourcemap = false }: { sourcemap?: boolean } = {},\n) {\n const closestPkgJson = pkg.up({ cwd: dirname(entryFile) });\n const projectRoot = closestPkgJson ? dirname(slash(closestPkgJson)) : slash(process.cwd());\n const { workspaceMap, workspaceRoot } = await getWorkspaceInformation({ mastraEntryFile: entryFile });\n\n const analyzeEntryResult = await analyzeBundle(\n [entryFile],\n entryFile,\n {\n outputDir: posix.join(process.cwd(), '.mastra', '.build'),\n projectRoot: workspaceRoot || process.cwd(),\n platform: 'node',\n isDev: true,\n },\n noopLogger,\n );\n\n const deps = /* @__PURE__ */ new Map();\n for (const [dep, metadata] of analyzeEntryResult.dependencies.entries()) {\n const pkgName = getPackageName(dep);\n if (pkgName && workspaceMap.has(pkgName)) {\n deps.set(dep, metadata);\n }\n }\n\n // In `analyzeBundle` we output this file and we want to use that instead of the original entry file\n //const analyzedEntryFile = posix.join(process.cwd(), '.mastra', '.build', 'entry-0.mjs');\n\n const inputOptions = await getBundlerInputOptions(\n entryFile,\n {\n dependencies: deps,\n externalDependencies: new Set(),\n workspaceMap,\n },\n platform,\n env,\n { sourcemap, isDev: true, workspaceRoot, projectRoot },\n );\n\n if (Array.isArray(inputOptions.plugins)) {\n // filter out node-resolve plugin so all node_modules are external\n // and tsconfig-paths plugin as we are injection a custom one\n const plugins = [] as Plugin[];\n inputOptions.plugins.forEach(plugin => {\n if ((plugin as Plugin | undefined)?.name === 'node-resolve') {\n return;\n }\n\n if ((plugin as Plugin | undefined)?.name === 'tsconfig-paths') {\n plugins.push(\n tsConfigPaths({\n localResolve: true,\n }),\n );\n return;\n }\n\n plugins.push(plugin as Plugin);\n });\n\n inputOptions.plugins = plugins;\n inputOptions.plugins.push(aliasHono());\n // fixes imports like lodash/fp/get\n inputOptions.plugins.push(nodeModulesExtensionResolver());\n }\n\n return inputOptions;\n}\n\nexport async function createWatcher(inputOptions: InputOptions, outputOptions: OutputOptions) {\n const watcher = await watch({\n ...inputOptions,\n output: {\n ...outputOptions,\n format: 'esm',\n entryFileNames: '[name].mjs',\n chunkFileNames: '[name].mjs',\n },\n });\n\n return watcher;\n}\n","import { removeAllOptionsFromMastraExcept } from './remove-all-options-except';\nimport type { IMastraLogger } from '@mastra/core/logger';\n\nexport function removeAllOptionsExceptServer(result: { hasCustomConfig: boolean }, logger?: IMastraLogger) {\n return removeAllOptionsFromMastraExcept(result, 'server', logger);\n}\n","import { removeAllOptionsExceptServer } from './babel/remove-all-options-server';\nimport type { Config } from '@mastra/core/mastra';\nimport { extractMastraOption, extractMastraOptionBundler } from './shared/extract-mastra-option';\nimport type { IMastraLogger } from '@mastra/core/logger';\n\nexport function getServerOptionsBundler(\n entryFile: string,\n result: {\n hasCustomConfig: false;\n },\n) {\n return extractMastraOptionBundler('server', entryFile, removeAllOptionsExceptServer, result);\n}\n\nexport async function getServerOptions(\n entryFile: string,\n outputDir: string,\n logger?: IMastraLogger,\n): Promise<Config['server'] | null> {\n const result = await extractMastraOption<Config['server']>(\n 'server',\n entryFile,\n removeAllOptionsExceptServer,\n outputDir,\n logger,\n );\n if (!result) {\n return null;\n }\n\n return result.getConfig();\n}\n"]}
1
+ {"version":3,"sources":["../src/build/plugins/node-modules-extension-resolver.ts","../src/build/watcher.ts","../src/build/babel/remove-all-options-server.ts","../src/build/serverOptions.ts"],"names":["builtinModules","resolveFrom","extname","pathToFileURL","resolved","getPackageName","dirname","getInputOptions","pkg","slash","getWorkspaceInformation","analyzeBundle","posix","noopLogger","tsConfigPaths","aliasHono","watch","removeAllOptionsFromMastraExcept","extractMastraOption"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,SAAS,gBAAgB,SAAA,EAA4B;AACnD,EAAA,OACEA,uBAAA,CAAe,QAAA,CAAS,SAAS,CAAA,IACjC,UAAU,UAAA,CAAW,OAAO,CAAA,IAC5BA,uBAAA,CAAe,QAAA,CAAS,SAAA,CAAU,OAAA,CAAQ,QAAA,EAAU,EAAE,CAAC,CAAA;AAE3D;AAEA,SAAS,WAAA,CAAY,IAAY,QAAA,EAAkB;AACjD,EAAA,IAAI;AACF,IAAA,OAAOC,4BAAA,CAAY,UAAU,EAAE,CAAA;AAAA,EACjC,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,IAAA;AAAA,EACT;AACF;AAGO,SAAS,4BAAA,GAAuC;AACrD,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,iCAAA;AAAA,IACN,SAAA,CAAU,IAAI,QAAA,EAAU;AAEtB,MAAA,IAAI,EAAA,CAAG,WAAW,GAAG,CAAA,IAAK,GAAG,UAAA,CAAW,GAAG,CAAA,IAAK,CAAC,QAAA,EAAU;AACzD,QAAA,OAAO,IAAA;AAAA,MACT;AAEA,MAAA,IAAI,eAAA,CAAgB,EAAE,CAAA,EAAG;AACvB,QAAA,OAAO,IAAA;AAAA,MACT;AAGA,MAAA,IAAI,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,CAAA;AAErC,IAAA,YAAA,CAAa,OAAA,CAAQ,IAAA,CAAK,4BAAA,EAA8B,CAAA;AAAA,EAC1D;AAEA,EAAA,OAAO,YAAA;AACT;AAEA,eAAsB,aAAA,CAAc,cAA4B,aAAA,EAA8B;AAC5F,EAAA,MAAM,OAAA,GAAU,MAAMC,YAAA,CAAM;AAAA,IAC1B,GAAG,YAAA;AAAA,IACH,MAAA,EAAQ;AAAA,MACN,GAAG,aAAA;AAAA,MACH,MAAA,EAAQ,KAAA;AAAA,MACR,cAAA,EAAgB,YAAA;AAAA,MAChB,cAAA,EAAgB;AAAA;AAClB,GACD,CAAA;AAED,EAAA,OAAO,OAAA;AACT;;;ACjGO,SAAS,4BAAA,CAA6B,QAAsC,MAAA,EAAwB;AACzG,EAAA,OAAOC,kDAAA,CAAiC,MAAA,EAAQ,QAAA,EAAU,MAAM,CAAA;AAClE;;;ACSA,eAAsB,gBAAA,CACpB,SAAA,EACA,SAAA,EACA,MAAA,EACkC;AAClC,EAAA,MAAM,SAAS,MAAMC,qCAAA;AAAA,IACnB,QAAA;AAAA,IACA,SAAA;AAAA,IACA,4BAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,OAAO,OAAO,SAAA,EAAU;AAC1B","file":"chunk-62BMSTRF.cjs","sourcesContent":["import { dirname, extname } from 'path';\nimport { pathToFileURL } from 'node:url';\nimport resolveFrom from 'resolve-from';\nimport type { Plugin } from 'rollup';\nimport { builtinModules } from 'node:module';\nimport { getPackageName } from '../utils';\n\n/**\n * Check if a module is a Node.js builtin module\n * @param specifier - Module specifier\n * @returns True if it's a builtin module\n */\nfunction isBuiltinModule(specifier: string): boolean {\n return (\n builtinModules.includes(specifier) ||\n specifier.startsWith('node:') ||\n builtinModules.includes(specifier.replace(/^node:/, ''))\n );\n}\n\nfunction safeResolve(id: string, importer: string) {\n try {\n return resolveFrom(importer, id);\n } catch {\n return null;\n }\n}\n\n// we only need this for dev, so we can resolve the js extension of the module as we do not use node-resolve\nexport function nodeModulesExtensionResolver(): Plugin {\n return {\n name: 'node-modules-extension-resolver',\n resolveId(id, importer) {\n // if is relative, skip\n if (id.startsWith('.') || id.startsWith('/') || !importer) {\n return null;\n }\n\n if (isBuiltinModule(id)) {\n return null;\n }\n\n // if it's a scoped direct import skip\n if (id.startsWith('@') && id.split('/').length === 2) {\n return null;\n }\n\n // if it's a direct import, skip\n if (!id.startsWith('@') && id.split('/').length === 1) {\n return null;\n }\n\n const foundExt = extname(id);\n if (foundExt) {\n return null;\n }\n\n try {\n // if we cannot resolve it, it means it's a legacy module\n const resolved = import.meta.resolve(id);\n\n if (!extname(resolved)) {\n throw new Error(`Cannot resolve ${id} from ${importer}`);\n }\n\n return null;\n } catch (e) {\n // try to do a node like resolve first\n const resolved = safeResolve(id, importer);\n if (resolved) {\n return {\n id: pathToFileURL(resolved).href,\n external: true,\n };\n }\n\n for (const ext of ['.mjs', '.js', '.cjs']) {\n const resolved = safeResolve(id + ext, importer);\n if (resolved) {\n const pkgName = getPackageName(id);\n if (!pkgName) {\n return null;\n }\n\n const pkgJsonPath = safeResolve(`${pkgName}/package.json`, importer);\n if (!pkgJsonPath) {\n return null;\n }\n\n const newImportWithExtension = resolved.replace(dirname(pkgJsonPath), pkgName);\n\n return {\n id: pathToFileURL(newImportWithExtension).href,\n external: true,\n };\n }\n }\n }\n\n return null;\n },\n } satisfies Plugin;\n}\n","import type { InputOptions, OutputOptions, Plugin } from 'rollup';\nimport { watch } from 'rollup';\nimport { dirname, posix } from 'node:path';\nimport * as pkg from 'empathic/package';\nimport { getInputOptions as getBundlerInputOptions } from './bundler';\nimport { aliasHono } from './plugins/hono-alias';\nimport { nodeModulesExtensionResolver } from './plugins/node-modules-extension-resolver';\nimport { tsConfigPaths } from './plugins/tsconfig-paths';\nimport { noopLogger } from '@mastra/core/logger';\nimport { getWorkspaceInformation } from '../bundler/workspaceDependencies';\nimport { analyzeBundle } from './analyze';\nimport { getPackageName, slash } from './utils';\n\nexport async function getInputOptions(\n entryFile: string,\n platform: 'node' | 'browser',\n env?: Record<string, string>,\n { sourcemap = false }: { sourcemap?: boolean } = {},\n) {\n const closestPkgJson = pkg.up({ cwd: dirname(entryFile) });\n const projectRoot = closestPkgJson ? dirname(slash(closestPkgJson)) : slash(process.cwd());\n const { workspaceMap, workspaceRoot } = await getWorkspaceInformation({ mastraEntryFile: entryFile });\n\n const analyzeEntryResult = await analyzeBundle(\n [entryFile],\n entryFile,\n {\n outputDir: posix.join(process.cwd(), '.mastra', '.build'),\n projectRoot: workspaceRoot || process.cwd(),\n platform: 'node',\n isDev: true,\n },\n noopLogger,\n );\n\n const deps = /* @__PURE__ */ new Map();\n for (const [dep, metadata] of analyzeEntryResult.dependencies.entries()) {\n const pkgName = getPackageName(dep);\n if (pkgName && workspaceMap.has(pkgName)) {\n deps.set(dep, metadata);\n }\n }\n\n // In `analyzeBundle` we output this file and we want to use that instead of the original entry file\n //const analyzedEntryFile = posix.join(process.cwd(), '.mastra', '.build', 'entry-0.mjs');\n\n const inputOptions = await getBundlerInputOptions(\n entryFile,\n {\n dependencies: deps,\n externalDependencies: new Set(),\n workspaceMap,\n },\n platform,\n env,\n { sourcemap, isDev: true, workspaceRoot, projectRoot },\n );\n\n if (Array.isArray(inputOptions.plugins)) {\n // filter out node-resolve plugin so all node_modules are external\n // and tsconfig-paths plugin as we are injection a custom one\n const plugins = [] as Plugin[];\n inputOptions.plugins.forEach(plugin => {\n if ((plugin as Plugin | undefined)?.name === 'node-resolve') {\n return;\n }\n\n if ((plugin as Plugin | undefined)?.name === 'tsconfig-paths') {\n plugins.push(\n tsConfigPaths({\n localResolve: true,\n }),\n );\n return;\n }\n\n plugins.push(plugin as Plugin);\n });\n\n inputOptions.plugins = plugins;\n inputOptions.plugins.push(aliasHono());\n // fixes imports like lodash/fp/get\n inputOptions.plugins.push(nodeModulesExtensionResolver());\n }\n\n return inputOptions;\n}\n\nexport async function createWatcher(inputOptions: InputOptions, outputOptions: OutputOptions) {\n const watcher = await watch({\n ...inputOptions,\n output: {\n ...outputOptions,\n format: 'esm',\n entryFileNames: '[name].mjs',\n chunkFileNames: '[name].mjs',\n },\n });\n\n return watcher;\n}\n","import { removeAllOptionsFromMastraExcept } from './remove-all-options-except';\nimport type { IMastraLogger } from '@mastra/core/logger';\n\nexport function removeAllOptionsExceptServer(result: { hasCustomConfig: boolean }, logger?: IMastraLogger) {\n return removeAllOptionsFromMastraExcept(result, 'server', logger);\n}\n","import { removeAllOptionsExceptServer } from './babel/remove-all-options-server';\nimport type { Config } from '@mastra/core/mastra';\nimport { extractMastraOption, extractMastraOptionBundler } from './shared/extract-mastra-option';\nimport type { IMastraLogger } from '@mastra/core/logger';\n\nexport function getServerOptionsBundler(\n entryFile: string,\n result: {\n hasCustomConfig: false;\n },\n) {\n return extractMastraOptionBundler('server', entryFile, removeAllOptionsExceptServer, result);\n}\n\nexport async function getServerOptions(\n entryFile: string,\n outputDir: string,\n logger?: IMastraLogger,\n): Promise<Config['server'] | null> {\n const result = await extractMastraOption<Config['server']>(\n 'server',\n entryFile,\n removeAllOptionsExceptServer,\n outputDir,\n logger,\n );\n if (!result) {\n return null;\n }\n\n return result.getConfig();\n}\n"]}
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkXJ42VWDB_cjs = require('./chunk-XJ42VWDB.cjs');
4
- var chunk3EKA4UZF_cjs = require('./chunk-3EKA4UZF.cjs');
5
- var chunkQ5FR6PUS_cjs = require('./chunk-Q5FR6PUS.cjs');
3
+ var chunk4BZNZFZN_cjs = require('./chunk-4BZNZFZN.cjs');
4
+ var chunkUHRSJYRY_cjs = require('./chunk-UHRSJYRY.cjs');
5
+ var chunkIMZH6M7G_cjs = require('./chunk-IMZH6M7G.cjs');
6
6
  var chunk3JYRSECU_cjs = require('./chunk-3JYRSECU.cjs');
7
7
  var chunk3GJSIS6L_cjs = require('./chunk-3GJSIS6L.cjs');
8
8
  var fs = require('fs');
@@ -53,7 +53,7 @@ function getCustomInstrumentationBundler(entryFile, result) {
53
53
  treeshake: false,
54
54
  plugins: [
55
55
  // transpile typescript to something we understand
56
- chunkQ5FR6PUS_cjs.esbuild(),
56
+ chunkIMZH6M7G_cjs.esbuild(),
57
57
  commonjs__default.default({
58
58
  extensions: [".js", ".ts"],
59
59
  strictRequires: "strict",
@@ -92,7 +92,7 @@ var Bundler = class extends bundler.MastraBundler {
92
92
  }
93
93
  async writeInstrumentationFile(outputDirectory, customInstrumentationFile) {
94
94
  const instrumentationFile = path.join(outputDirectory, "instrumentation.mjs");
95
- const __dirname = path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-D2YCDWUL.cjs', document.baseURI).href))));
95
+ const __dirname = path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-BYJ5P75V.cjs', document.baseURI).href))));
96
96
  if (customInstrumentationFile) {
97
97
  await fsExtra.copy(customInstrumentationFile, instrumentationFile);
98
98
  } else {
@@ -149,10 +149,10 @@ var Bundler = class extends bundler.MastraBundler {
149
149
  );
150
150
  }
151
151
  createBundler(inputOptions, outputOptions) {
152
- return chunk3EKA4UZF_cjs.createBundler(inputOptions, outputOptions);
152
+ return chunkUHRSJYRY_cjs.createBundler(inputOptions, outputOptions);
153
153
  }
154
154
  async analyze(entry, mastraFile, outputDirectory, { enableEsmShim = true } = {}) {
155
- return await chunkQ5FR6PUS_cjs.analyzeBundle(
155
+ return await chunkIMZH6M7G_cjs.analyzeBundle(
156
156
  [].concat(entry),
157
157
  mastraFile,
158
158
  {
@@ -194,10 +194,10 @@ var Bundler = class extends bundler.MastraBundler {
194
194
  }
195
195
  }
196
196
  async getBundlerOptions(serverFile, mastraEntryFile, analyzedBundleInfo, toolsPaths, { enableSourcemap = false, enableEsmShim = true } = {}) {
197
- const { workspaceRoot } = await chunkQ5FR6PUS_cjs.getWorkspaceInformation({ mastraEntryFile });
197
+ const { workspaceRoot } = await chunkIMZH6M7G_cjs.getWorkspaceInformation({ mastraEntryFile });
198
198
  const closestPkgJson = pkg__namespace.up({ cwd: path.dirname(mastraEntryFile) });
199
199
  const projectRoot = closestPkgJson ? path.dirname(closestPkgJson) : process.cwd();
200
- const inputOptions = await chunk3EKA4UZF_cjs.getInputOptions(
200
+ const inputOptions = await chunkUHRSJYRY_cjs.getInputOptions(
201
201
  mastraEntryFile,
202
202
  analyzedBundleInfo,
203
203
  "node",
@@ -271,7 +271,7 @@ var Bundler = class extends bundler.MastraBundler {
271
271
  const analyzeDir = path.join(outputDirectory, this.analyzeOutputDir);
272
272
  let sourcemap = false;
273
273
  try {
274
- const bundlerOptions = await chunkQ5FR6PUS_cjs.getBundlerOptions(mastraEntryFile, analyzeDir);
274
+ const bundlerOptions = await chunkIMZH6M7G_cjs.getBundlerOptions(mastraEntryFile, analyzeDir);
275
275
  sourcemap = !!bundlerOptions?.sourcemap;
276
276
  } catch (error) {
277
277
  this.logger.debug("Failed to get bundler options, sourcemap will be disabled", { error });
@@ -279,7 +279,7 @@ var Bundler = class extends bundler.MastraBundler {
279
279
  let analyzedBundleInfo;
280
280
  try {
281
281
  const resolvedToolsPaths = await this.getToolsInputOptions(toolsPaths);
282
- analyzedBundleInfo = await chunkQ5FR6PUS_cjs.analyzeBundle(
282
+ analyzedBundleInfo = await chunkIMZH6M7G_cjs.analyzeBundle(
283
283
  [serverFile, ...Object.values(resolvedToolsPaths)],
284
284
  mastraEntryFile,
285
285
  {
@@ -309,7 +309,7 @@ var Bundler = class extends bundler.MastraBundler {
309
309
  }
310
310
  let externalDependencies;
311
311
  try {
312
- const result = await chunkXJ42VWDB_cjs.writeTelemetryConfig(mastraEntryFile, path.join(outputDirectory, this.outputDir));
312
+ const result = await chunk4BZNZFZN_cjs.writeTelemetryConfig(mastraEntryFile, path.join(outputDirectory, this.outputDir));
313
313
  externalDependencies = result?.externalDependencies ?? [];
314
314
  } catch (error$1) {
315
315
  const message = error$1 instanceof Error ? error$1.message : String(error$1);
@@ -447,5 +447,5 @@ export const tools = [${toolsExports.join(", ")}]`
447
447
  };
448
448
 
449
449
  exports.Bundler = Bundler;
450
- //# sourceMappingURL=chunk-D2YCDWUL.cjs.map
451
- //# sourceMappingURL=chunk-D2YCDWUL.cjs.map
450
+ //# sourceMappingURL=chunk-BYJ5P75V.cjs.map
451
+ //# sourceMappingURL=chunk-BYJ5P75V.cjs.map