@mastra/deployer 1.0.0-beta.10 → 1.0.0-beta.13

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 (72) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/build/analyze/analyzeEntry.d.ts.map +1 -1
  3. package/dist/build/analyze/bundleExternals.d.ts +4 -5
  4. package/dist/build/analyze/bundleExternals.d.ts.map +1 -1
  5. package/dist/build/analyze.cjs +2 -2
  6. package/dist/build/analyze.d.ts +2 -2
  7. package/dist/build/analyze.d.ts.map +1 -1
  8. package/dist/build/analyze.js +1 -1
  9. package/dist/build/bundler.cjs +3 -3
  10. package/dist/build/bundler.d.ts +2 -1
  11. package/dist/build/bundler.d.ts.map +1 -1
  12. package/dist/build/bundler.js +1 -1
  13. package/dist/build/index.cjs +15 -10
  14. package/dist/build/index.d.ts +1 -0
  15. package/dist/build/index.d.ts.map +1 -1
  16. package/dist/build/index.js +4 -3
  17. package/dist/build/package-info.d.ts +9 -0
  18. package/dist/build/package-info.d.ts.map +1 -0
  19. package/dist/build/plugins/node-modules-extension-resolver.d.ts +7 -0
  20. package/dist/build/plugins/node-modules-extension-resolver.d.ts.map +1 -1
  21. package/dist/build/utils.d.ts +18 -4
  22. package/dist/build/utils.d.ts.map +1 -1
  23. package/dist/build/watcher.d.ts.map +1 -1
  24. package/dist/bundler/index.cjs +2 -2
  25. package/dist/bundler/index.d.ts +5 -5
  26. package/dist/bundler/index.d.ts.map +1 -1
  27. package/dist/bundler/index.js +1 -1
  28. package/dist/chunk-24GY667C.cjs +123 -0
  29. package/dist/chunk-24GY667C.cjs.map +1 -0
  30. package/dist/{chunk-SS22TD6R.cjs → chunk-3GOE3SL2.cjs} +27 -23
  31. package/dist/chunk-3GOE3SL2.cjs.map +1 -0
  32. package/dist/{chunk-5CWPEG6R.js → chunk-HHA2Y3AS.js} +23 -24
  33. package/dist/chunk-HHA2Y3AS.js.map +1 -0
  34. package/dist/{chunk-MUWNMVNL.cjs → chunk-KCGBR2X6.cjs} +130 -58
  35. package/dist/chunk-KCGBR2X6.cjs.map +1 -0
  36. package/dist/chunk-LENVOSFH.cjs +261 -0
  37. package/dist/chunk-LENVOSFH.cjs.map +1 -0
  38. package/dist/chunk-R6O3XWXM.js +249 -0
  39. package/dist/chunk-R6O3XWXM.js.map +1 -0
  40. package/dist/{chunk-TK2CCU7I.js → chunk-RGUNHE4Y.js} +111 -40
  41. package/dist/chunk-RGUNHE4Y.js.map +1 -0
  42. package/dist/{chunk-X5QU7B2W.js → chunk-SRPOHKWH.js} +6 -76
  43. package/dist/chunk-SRPOHKWH.js.map +1 -0
  44. package/dist/{chunk-2OTEFUER.cjs → chunk-VA2CSOKJ.cjs} +24 -24
  45. package/dist/chunk-VA2CSOKJ.cjs.map +1 -0
  46. package/dist/{chunk-RBPCXFN7.js → chunk-XTXGU6QF.js} +19 -15
  47. package/dist/chunk-XTXGU6QF.js.map +1 -0
  48. package/dist/index.cjs +5 -5
  49. package/dist/index.js +2 -2
  50. package/dist/server/index.cjs +40 -23
  51. package/dist/server/index.cjs.map +1 -1
  52. package/dist/server/index.d.ts.map +1 -1
  53. package/dist/server/index.js +40 -23
  54. package/dist/server/index.js.map +1 -1
  55. package/dist/validator/custom-resolver.cjs +2 -2
  56. package/dist/validator/custom-resolver.js +1 -1
  57. package/package.json +5 -6
  58. package/dist/chunk-2OTEFUER.cjs.map +0 -1
  59. package/dist/chunk-5CWPEG6R.js.map +0 -1
  60. package/dist/chunk-BFQ2S5UD.cjs +0 -157
  61. package/dist/chunk-BFQ2S5UD.cjs.map +0 -1
  62. package/dist/chunk-MUWNMVNL.cjs.map +0 -1
  63. package/dist/chunk-RBPCXFN7.js.map +0 -1
  64. package/dist/chunk-SS22TD6R.cjs.map +0 -1
  65. package/dist/chunk-TK2CCU7I.js.map +0 -1
  66. package/dist/chunk-UQZGTSBF.js +0 -147
  67. package/dist/chunk-UQZGTSBF.js.map +0 -1
  68. package/dist/chunk-X4TNUYQL.cjs +0 -196
  69. package/dist/chunk-X4TNUYQL.cjs.map +0 -1
  70. package/dist/chunk-X5QU7B2W.js.map +0 -1
  71. package/dist/server/handlers/prompt.d.ts +0 -3
  72. package/dist/server/handlers/prompt.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,41 @@
1
1
  # @mastra/deployer
2
2
 
3
+ ## 1.0.0-beta.13
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`919a22b`](https://github.com/mastra-ai/mastra/commit/919a22b25876f9ed5891efe5facbe682c30ff497)]:
8
+ - @mastra/core@1.0.0-beta.13
9
+ - @mastra/server@1.0.0-beta.13
10
+
11
+ ## 1.0.0-beta.12
12
+
13
+ ### Patch Changes
14
+
15
+ - Remove deprecated playground-only prompt generation handler (functionality moved to @mastra/server) ([#11074](https://github.com/mastra-ai/mastra/pull/11074))
16
+
17
+ Improve prompt enhancement UX: show toast errors when enhancement fails, disable button when no model has a configured API key, and prevent users from disabling all models in the model list
18
+
19
+ Add missing `/api/agents/:agentId/instructions/enhance` endpoint that was referenced by `@mastra/client-js` and `@mastra/playground-ui`
20
+
21
+ - Allow for `bundler.externals: true` to be set. ([#10218](https://github.com/mastra-ai/mastra/pull/10218))
22
+
23
+ With this configuration during `mastra build` all dependencies (except workspace dependencies) will be treated as "external" and not bundled. Instead they will be added to the `.mastra/output/package.json` file.
24
+
25
+ - Updated dependencies [[`d5ed981`](https://github.com/mastra-ai/mastra/commit/d5ed981c8701c1b8a27a5f35a9a2f7d9244e695f), [`9650cce`](https://github.com/mastra-ai/mastra/commit/9650cce52a1d917ff9114653398e2a0f5c3ba808), [`932d63d`](https://github.com/mastra-ai/mastra/commit/932d63dd51be9c8bf1e00e3671fe65606c6fb9cd), [`b760b73`](https://github.com/mastra-ai/mastra/commit/b760b731aca7c8a3f041f61d57a7f125ae9cb215), [`695a621`](https://github.com/mastra-ai/mastra/commit/695a621528bdabeb87f83c2277cf2bb084c7f2b4), [`2b459f4`](https://github.com/mastra-ai/mastra/commit/2b459f466fd91688eeb2a44801dc23f7f8a887ab), [`486352b`](https://github.com/mastra-ai/mastra/commit/486352b66c746602b68a95839f830de14c7fb8c0), [`09e4bae`](https://github.com/mastra-ai/mastra/commit/09e4bae18dd5357d2ae078a4a95a2af32168ab08), [`24b76d8`](https://github.com/mastra-ai/mastra/commit/24b76d8e17656269c8ed09a0c038adb9cc2ae95a), [`243a823`](https://github.com/mastra-ai/mastra/commit/243a8239c5906f5c94e4f78b54676793f7510ae3), [`486352b`](https://github.com/mastra-ai/mastra/commit/486352b66c746602b68a95839f830de14c7fb8c0), [`c61fac3`](https://github.com/mastra-ai/mastra/commit/c61fac3add96f0dcce0208c07415279e2537eb62), [`6f14f70`](https://github.com/mastra-ai/mastra/commit/6f14f706ccaaf81b69544b6c1b75ab66a41e5317), [`5118f38`](https://github.com/mastra-ai/mastra/commit/5118f384a70b1166012fde3b901f3227870b1009), [`09e4bae`](https://github.com/mastra-ai/mastra/commit/09e4bae18dd5357d2ae078a4a95a2af32168ab08), [`6375f52`](https://github.com/mastra-ai/mastra/commit/6375f52c219305abef6f2026b4eaf8ac2fa5f1c0), [`4524734`](https://github.com/mastra-ai/mastra/commit/45247343e384717a7c8404296275c56201d6470f), [`2a53598`](https://github.com/mastra-ai/mastra/commit/2a53598c6d8cfeb904a7fc74e57e526d751c8fa6), [`c7cd3c7`](https://github.com/mastra-ai/mastra/commit/c7cd3c7a187d7aaf79e2ca139de328bf609a14b4), [`847c212`](https://github.com/mastra-ai/mastra/commit/847c212caba7df0d6f2fc756b494ac3c75c3720d), [`6f941c4`](https://github.com/mastra-ai/mastra/commit/6f941c438ca5f578619788acc7608fc2e23bd176)]:
26
+ - @mastra/core@1.0.0-beta.12
27
+ - @mastra/server@1.0.0-beta.12
28
+
29
+ ## 1.0.0-beta.11
30
+
31
+ ### Patch Changes
32
+
33
+ - Internal changes to enable a custom base path for Mastra Studio ([#10441](https://github.com/mastra-ai/mastra/pull/10441))
34
+
35
+ - Updated dependencies [[`38380b6`](https://github.com/mastra-ai/mastra/commit/38380b60fca905824bdf6b43df307a58efb1aa15), [`798d0c7`](https://github.com/mastra-ai/mastra/commit/798d0c740232653b1d754870e6b43a55c364ffe2), [`ffe84d5`](https://github.com/mastra-ai/mastra/commit/ffe84d54f3b0f85167fe977efd027dba027eb998), [`2c212e7`](https://github.com/mastra-ai/mastra/commit/2c212e704c90e2db83d4109e62c03f0f6ebd2667), [`4ca4306`](https://github.com/mastra-ai/mastra/commit/4ca430614daa5fa04730205a302a43bf4accfe9f), [`3bf6c5f`](https://github.com/mastra-ai/mastra/commit/3bf6c5f104c25226cd84e0c77f9dec15f2cac2db), [`3bf6c5f`](https://github.com/mastra-ai/mastra/commit/3bf6c5f104c25226cd84e0c77f9dec15f2cac2db)]:
36
+ - @mastra/server@1.0.0-beta.11
37
+ - @mastra/core@1.0.0-beta.11
38
+
3
39
  ## 1.0.0-beta.10
4
40
 
5
41
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"analyzeEntry.d.ts","sourceRoot":"","sources":["../../../src/build/analyze/analyzeEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAKrE,OAAO,EAAyC,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAO/E,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AA2MnD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,YAAY,CAChC,EACE,KAAK,EACL,aAAa,GACd,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;CACxB,EACD,WAAW,EAAE,MAAM,EACnB,EACE,MAAM,EACN,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,qBAAiC,EAAE,mCAAmC;AACtE,iCAAyC,GAC1C,EAAE;IACD,MAAM,EAA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AAC,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACxD,iCAAiC,CAAC,EAAE,OAAO,CAAC;CAC7C,GACA,OAAO,CAAC;IACT,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAC9C,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,SAAS,GAAG,IAAI,CAAC;KACvB,CAAC;CACH,CAAC,CAmCD"}
@@ -1,3 +1,4 @@
1
+ import type { Config } from '@mastra/core/mastra';
1
2
  import { type OutputChunk, type OutputAsset } from 'rollup';
2
3
  import { type WorkspacePackageInfo } from '../../bundler/workspaceDependencies.js';
3
4
  import type { DependencyMetadata } from '../types.js';
@@ -14,6 +15,7 @@ export declare function createVirtualDependencies(depsToOptimize: Map<string, De
14
15
  outputDir: string;
15
16
  bundlerOptions?: {
16
17
  isDev?: boolean;
18
+ externalsPreset?: boolean;
17
19
  };
18
20
  }): {
19
21
  optimizedDependencyEntries: Map<string, VirtualDependency>;
@@ -29,12 +31,9 @@ export declare function createVirtualDependencies(depsToOptimize: Map<string, De
29
31
  * @returns Object containing bundle output and reference map for validation
30
32
  */
31
33
  export declare function bundleExternals(depsToOptimize: Map<string, DependencyMetadata>, outputDir: string, options: {
32
- bundlerOptions?: {
33
- externals?: string[];
34
- transpilePackages?: string[];
34
+ bundlerOptions?: ({
35
35
  isDev?: boolean;
36
- enableEsmShim?: boolean;
37
- } | null;
36
+ } & Config['bundler']) | null;
38
37
  projectRoot?: string;
39
38
  workspaceRoot?: string;
40
39
  workspaceMap?: Map<string, WorkspacePackageInfo>;
@@ -1 +1 @@
1
- {"version":3,"file":"bundleExternals.d.ts","sourceRoot":"","sources":["../../../src/build/analyze/bundleExternals.ts"],"names":[],"mappings":"AAOA,OAAO,EAAU,KAAK,WAAW,EAAE,KAAK,WAAW,EAAe,MAAM,QAAQ,CAAC;AAUjF,OAAO,EAAE,KAAK,oBAAoB,EAAE,MA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E,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;CAClD;;;;GAoHF"}
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkMUWNMVNL_cjs = require('../chunk-MUWNMVNL.cjs');
3
+ var chunkKCGBR2X6_cjs = require('../chunk-KCGBR2X6.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "analyzeBundle", {
8
8
  enumerable: true,
9
- get: function () { return chunkMUWNMVNL_cjs.analyzeBundle; }
9
+ get: function () { return chunkKCGBR2X6_cjs.analyzeBundle; }
10
10
  });
11
11
  //# sourceMappingURL=analyze.cjs.map
12
12
  //# sourceMappingURL=analyze.cjs.map
@@ -8,13 +8,13 @@ import { type WorkspacePackageInfo } from '../bundler/workspaceDependencies.js';
8
8
  *
9
9
  * This helps identify which dependencies need to be externalized vs bundled.
10
10
  */
11
- export declare function analyzeBundle(entries: string[], mastraEntry: string, { outputDir, projectRoot, isDev, bundlerOptions: _bundlerOptions, }: {
11
+ export declare function analyzeBundle(entries: string[], mastraEntry: string, { outputDir, projectRoot, isDev, bundlerOptions: internalBundlerOptions, }: {
12
12
  outputDir: string;
13
13
  projectRoot: string;
14
14
  platform: 'node' | 'browser';
15
15
  isDev?: boolean;
16
16
  bundlerOptions?: {
17
- enableEsmShim?: boolean;
17
+ externals?: boolean | string[];
18
18
  } | null;
19
19
  }, logger: IMastraLogger): Promise<{
20
20
  externalDependencies: Set<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../src/build/analyze.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AASzD,OAAO,EAA2B,KAAK,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAmQtG;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EAAE,EACjB,WAAW,EAAE,MAAM,EACnB,EACE,SAAS,EACT,WAAW,EACX,KAAa,EACb,cAAc,EAAE,eAAe,GAChC,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,cAAc,CAAC,EAAE;QACf,aAAa,CAAC,EAAE,OAAO,CAAC;KACzB,GAAG,IAAI,CAAC;CACV,EACD,MAAM,EAAE,aAAa;;;;GAgHtB"}
1
+ {"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../src/build/analyze.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AASzD,OAAO,EAA2B,KAAK,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAmQtG;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EAAE,EACjB,WAAW,EAAE,MAAM,EACnB,EACE,SAAS,EACT,WAAW,EACX,KAAa,EACb,cAAc,EAAE,sBAAsB,GACvC,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,cAAc,CAAC,EAAE;QACf,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAC;KAChC,GAAG,IAAI,CAAC;CACV,EACD,MAAM,EAAE,aAAa;;;;GAuJtB"}
@@ -1,3 +1,3 @@
1
- export { analyzeBundle } from '../chunk-TK2CCU7I.js';
1
+ export { analyzeBundle } from '../chunk-RGUNHE4Y.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 chunkBFQ2S5UD_cjs = require('../chunk-BFQ2S5UD.cjs');
3
+ var chunkLENVOSFH_cjs = require('../chunk-LENVOSFH.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "createBundler", {
8
8
  enumerable: true,
9
- get: function () { return chunkBFQ2S5UD_cjs.createBundler; }
9
+ get: function () { return chunkLENVOSFH_cjs.createBundler; }
10
10
  });
11
11
  Object.defineProperty(exports, "getInputOptions", {
12
12
  enumerable: true,
13
- get: function () { return chunkBFQ2S5UD_cjs.getInputOptions; }
13
+ get: function () { return chunkLENVOSFH_cjs.getInputOptions; }
14
14
  });
15
15
  //# sourceMappingURL=bundler.cjs.map
16
16
  //# sourceMappingURL=bundler.cjs.map
@@ -1,11 +1,12 @@
1
1
  import { type InputOptions, type OutputOptions } from 'rollup';
2
2
  import { analyzeBundle } from './analyze/index.js';
3
- export declare function getInputOptions(entryFile: string, analyzedBundleInfo: Awaited<ReturnType<typeof analyzeBundle>>, platform: 'node' | 'browser', env: Record<string, string> | undefined, { sourcemap, isDev, projectRoot, workspaceRoot, enableEsmShim, }: {
3
+ export declare function getInputOptions(entryFile: string, analyzedBundleInfo: Awaited<ReturnType<typeof analyzeBundle>>, platform: 'node' | 'browser', env: Record<string, string> | undefined, { sourcemap, isDev, projectRoot, workspaceRoot, enableEsmShim, externalsPreset, }: {
4
4
  sourcemap?: boolean;
5
5
  isDev?: boolean;
6
6
  workspaceRoot?: string;
7
7
  projectRoot: string;
8
8
  enableEsmShim?: boolean;
9
+ externalsPreset?: boolean;
9
10
  }): Promise<InputOptions>;
10
11
  export declare function createBundler(inputOptions: InputOptions, outputOptions: Partial<OutputOptions> & {
11
12
  dir: string;
@@ -1 +1 @@
1
- {"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../src/build/bundler.ts"],"names":[],"mappings":"AAMA,OAAO,EAAU,KAAK,YAAY,EAAE,KAAK,aAAa,EAAe,MAAM,QAAQ,CAAC;AAGpF,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAO1C,wBAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,EACjB,kB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,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GACA,OAAO,CAAC,YAAY,CAAC,CAuHvB;AAED,wBAAsB,aAAa,CACjC,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE;;;GAiBxD"}
@@ -1,3 +1,3 @@
1
- export { createBundler, getInputOptions } from '../chunk-UQZGTSBF.js';
1
+ export { createBundler, getInputOptions } from '../chunk-R6O3XWXM.js';
2
2
  //# sourceMappingURL=bundler.js.map
3
3
  //# sourceMappingURL=bundler.js.map
@@ -1,39 +1,40 @@
1
1
  'use strict';
2
2
 
3
- var chunkX4TNUYQL_cjs = require('../chunk-X4TNUYQL.cjs');
4
- var chunkBFQ2S5UD_cjs = require('../chunk-BFQ2S5UD.cjs');
5
- var chunkMUWNMVNL_cjs = require('../chunk-MUWNMVNL.cjs');
3
+ var chunk24GY667C_cjs = require('../chunk-24GY667C.cjs');
4
+ var chunkLENVOSFH_cjs = require('../chunk-LENVOSFH.cjs');
5
+ var chunkKCGBR2X6_cjs = require('../chunk-KCGBR2X6.cjs');
6
6
  var chunkJVBCN3RH_cjs = require('../chunk-JVBCN3RH.cjs');
7
+ var chunkVA2CSOKJ_cjs = require('../chunk-VA2CSOKJ.cjs');
7
8
 
8
9
 
9
10
 
10
11
  Object.defineProperty(exports, "createWatcher", {
11
12
  enumerable: true,
12
- get: function () { return chunkX4TNUYQL_cjs.createWatcher; }
13
+ get: function () { return chunk24GY667C_cjs.createWatcher; }
13
14
  });
14
15
  Object.defineProperty(exports, "getServerOptions", {
15
16
  enumerable: true,
16
- get: function () { return chunkX4TNUYQL_cjs.getServerOptions; }
17
+ get: function () { return chunk24GY667C_cjs.getServerOptions; }
17
18
  });
18
19
  Object.defineProperty(exports, "getWatcherInputOptions", {
19
20
  enumerable: true,
20
- get: function () { return chunkX4TNUYQL_cjs.getInputOptions; }
21
+ get: function () { return chunk24GY667C_cjs.getInputOptions; }
21
22
  });
22
23
  Object.defineProperty(exports, "createBundler", {
23
24
  enumerable: true,
24
- get: function () { return chunkBFQ2S5UD_cjs.createBundler; }
25
+ get: function () { return chunkLENVOSFH_cjs.createBundler; }
25
26
  });
26
27
  Object.defineProperty(exports, "getBundlerInputOptions", {
27
28
  enumerable: true,
28
- get: function () { return chunkBFQ2S5UD_cjs.getInputOptions; }
29
+ get: function () { return chunkLENVOSFH_cjs.getInputOptions; }
29
30
  });
30
31
  Object.defineProperty(exports, "analyzeBundle", {
31
32
  enumerable: true,
32
- get: function () { return chunkMUWNMVNL_cjs.analyzeBundle; }
33
+ get: function () { return chunkKCGBR2X6_cjs.analyzeBundle; }
33
34
  });
34
35
  Object.defineProperty(exports, "getBundlerOptions", {
35
36
  enumerable: true,
36
- get: function () { return chunkMUWNMVNL_cjs.getBundlerOptions; }
37
+ get: function () { return chunkKCGBR2X6_cjs.getBundlerOptions; }
37
38
  });
38
39
  Object.defineProperty(exports, "Deps", {
39
40
  enumerable: true,
@@ -43,5 +44,9 @@ Object.defineProperty(exports, "FileService", {
43
44
  enumerable: true,
44
45
  get: function () { return chunkJVBCN3RH_cjs.FileService; }
45
46
  });
47
+ Object.defineProperty(exports, "normalizeStudioBase", {
48
+ enumerable: true,
49
+ get: function () { return chunkVA2CSOKJ_cjs.normalizeStudioBase; }
50
+ });
46
51
  //# sourceMappingURL=index.cjs.map
47
52
  //# sourceMappingURL=index.cjs.map
@@ -5,4 +5,5 @@ export { FileService } from '../services/fs.js';
5
5
  export { Deps } from '../services/deps.js';
6
6
  export { getServerOptions } from './serverOptions.js';
7
7
  export { getBundlerOptions } from './bundlerOptions.js';
8
+ export { normalizeStudioBase } from './utils.js';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/build/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,IAAI,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,eAAe,IAAI,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/build/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,IAAI,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,eAAe,IAAI,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC"}
@@ -1,6 +1,7 @@
1
- export { createWatcher, getServerOptions, getInputOptions as getWatcherInputOptions } from '../chunk-X5QU7B2W.js';
2
- export { createBundler, getInputOptions as getBundlerInputOptions } from '../chunk-UQZGTSBF.js';
3
- export { analyzeBundle, getBundlerOptions } from '../chunk-TK2CCU7I.js';
1
+ export { createWatcher, getServerOptions, getInputOptions as getWatcherInputOptions } from '../chunk-SRPOHKWH.js';
2
+ export { createBundler, getInputOptions as getBundlerInputOptions } from '../chunk-R6O3XWXM.js';
3
+ export { analyzeBundle, getBundlerOptions } from '../chunk-RGUNHE4Y.js';
4
4
  export { Deps, FileService } from '../chunk-DPDWM7HQ.js';
5
+ export { normalizeStudioBase } from '../chunk-HHA2Y3AS.js';
5
6
  //# sourceMappingURL=index.js.map
6
7
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Note: This function depends on local-pkg and should only be used at build-time.
3
+ * It is in a separate file to avoid including local-pkg in runtime code.
4
+ */
5
+ /**
6
+ * Get package root path
7
+ */
8
+ export declare function getPackageRootPath(packageName: string, parentPath?: string): Promise<string | null>;
9
+ //# sourceMappingURL=package-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-info.d.ts","sourceRoot":"","sources":["../../src/build/package-info.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAsBzG"}
@@ -1,3 +1,10 @@
1
1
  import type { Plugin } from 'rollup';
2
+ /**
3
+ * Rollup plugin that resolves module extensions for external dependencies.
4
+ *
5
+ * This plugin handles ESM compatibility for external imports when node-resolve is not used:
6
+ * - Packages WITH exports field (e.g., hono, date-fns): Keep imports as-is or strip redundant extensions
7
+ * - Packages WITHOUT exports field (e.g., lodash): Add .js extension for direct file imports
8
+ */
2
9
  export declare function nodeModulesExtensionResolver(): Plugin;
3
10
  //# sourceMappingURL=node-modules-extension-resolver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"node-modules-extension-resolver.d.ts","sourceRoot":"","sources":["../../../src/build/plugins/node-modules-extension-resolver.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AA0BrC,wBAAgB,4BAA4B,IAAI,MAAM,CAyErD"}
1
+ {"version":3,"file":"node-modules-extension-resolver.d.ts","sourceRoot":"","sources":["../../../src/build/plugins/node-modules-extension-resolver.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAqDrC;;;;;;GAMG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,CAwFrD"}
@@ -6,10 +6,6 @@ export declare function isDependencyPartOfPackage(dep: string, packageName: stri
6
6
  * Get the package name from a module ID
7
7
  */
8
8
  export declare function getPackageName(id: string): string | undefined;
9
- /**
10
- * Get package root path
11
- */
12
- export declare function getPackageRootPath(packageName: string, parentPath?: string): Promise<string | null>;
13
9
  /**
14
10
  * During `mastra dev` we are compiling TS files to JS (inside workspaces) so that users can just their workspace packages.
15
11
  * We store these compiled files inside `node_modules/.cache` for each workspace package.
@@ -43,4 +39,22 @@ export declare function rollupSafeName(name: string, rootDir: string): string;
43
39
  * findNativePackageModule(moduleIds); // Returns '/path/node_modules/bcrypt/bcrypt.js'
44
40
  */
45
41
  export declare function findNativePackageModule(moduleIds: string[]): string | undefined;
42
+ /**
43
+ * Ensures that server.studioBase is normalized.
44
+ *
45
+ * - If server.studioBase is '/' or empty, returns empty string
46
+ * - Normalizes multiple slashes to single slash (e.g., '//' → '/')
47
+ * - Removes trailing slashes (e.g., '/admin/' → '/admin')
48
+ * - Adds leading slash if missing (e.g., 'admin' → '/admin')
49
+ *
50
+ * @param studioBase - The studioBase path to normalize
51
+ * @returns Normalized studioBase path string
52
+ */
53
+ export declare function normalizeStudioBase(studioBase: string): string;
54
+ /**
55
+ * Check if a module is a Node.js builtin module
56
+ * @param specifier - Module specifier
57
+ * @returns True if it's a builtin module
58
+ */
59
+ export declare function isBuiltinModule(specifier: string): boolean;
46
60
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/build/utils.ts"],"names":[],"mappings":"AAMA,wBAAgB,eAAe,CAAC,EAAE,GAAmB,EAAE,EAAE;IAAE,GAAG,CAAC,EAA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;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAqB/E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAyB9D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAM1D"}
@@ -1 +1 @@
1
- {"version":3,"file":"watcher.d.ts","sourceRoot":"","sources":["../../src/build/watcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAU,MAAM,QAAQ,CAAC;AAalE,wBAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,EAAE,SAAiB,EAAE,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAO,yBAqEpD;AAED,wBAAsB,aAAa,CAAC,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,2CAY3F"}
1
+ {"version":3,"file":"watcher.d.ts","sourceRoot":"","sources":["../../src/build/watcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAU,MAAM,QAAQ,CAAC;AAalE,wBAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,EAAE,SAAiB,EAAE,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAO,yBAkEpD;AAED,wBAAsB,aAAa,CAAC,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,2CAY3F"}
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkSS22TD6R_cjs = require('../chunk-SS22TD6R.cjs');
3
+ var chunk3GOE3SL2_cjs = require('../chunk-3GOE3SL2.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "Bundler", {
8
8
  enumerable: true,
9
- get: function () { return chunkSS22TD6R_cjs.Bundler; }
9
+ get: function () { return chunk3GOE3SL2_cjs.Bundler; }
10
10
  });
11
11
  //# sourceMappingURL=index.cjs.map
12
12
  //# sourceMappingURL=index.cjs.map
@@ -13,9 +13,7 @@ export declare abstract class Bundler extends MastraBundler {
13
13
  write: () => Promise<import("rollup").RollupOutput>;
14
14
  close: () => Promise<void>;
15
15
  }>;
16
- protected analyze(entry: string | string[], mastraFile: string, outputDirectory: string, { enableEsmShim }?: {
17
- enableEsmShim?: boolean;
18
- }): Promise<{
16
+ protected analyze(entry: string | string[], mastraFile: string, outputDirectory: string): Promise<{
19
17
  externalDependencies: Set<string>;
20
18
  dependencies: Map<string, string>;
21
19
  workspaceMap: Map<string, import("./workspaceDependencies").WorkspacePackageInfo>;
@@ -26,16 +24,18 @@ export declare abstract class Bundler extends MastraBundler {
26
24
  rootDir?: string;
27
25
  outputDirectory: string;
28
26
  }): Promise<void>;
29
- protected getBundlerOptions(serverFile: string, mastraEntryFile: string, analyzedBundleInfo: Awaited<ReturnType<typeof analyzeBundle>>, toolsPaths: (string | string[])[], { enableSourcemap, enableEsmShim }?: {
27
+ protected getBundlerOptions(serverFile: string, mastraEntryFile: string, analyzedBundleInfo: Awaited<ReturnType<typeof analyzeBundle>>, toolsPaths: (string | string[])[], { enableSourcemap, enableEsmShim, externalsPreset, }?: {
30
28
  enableSourcemap?: boolean;
31
29
  enableEsmShim?: boolean;
30
+ externalsPreset?: boolean;
32
31
  }): Promise<InputOptions>;
33
32
  getAllToolPaths(mastraDir: string, toolsPaths?: (string | string[])[]): (string | string[])[];
34
33
  listToolsInputOptions(toolsPaths: (string | string[])[]): Promise<Record<string, string>>;
35
- protected _bundle(serverFile: string, mastraEntryFile: string, { projectRoot, outputDirectory, enableEsmShim, }: {
34
+ protected _bundle(serverFile: string, mastraEntryFile: string, { projectRoot, outputDirectory, enableEsmShim, externals, }: {
36
35
  projectRoot: string;
37
36
  outputDirectory: string;
38
37
  enableEsmShim?: boolean;
38
+ externals?: boolean | string[];
39
39
  }, toolsPaths?: (string | string[])[], bundleLocation?: string): Promise<void>;
40
40
  lint(_entryFile: string, _outputDirectory: string, toolsPaths: (string | string[])[]): Promise<void>;
41
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundler/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAKrD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAQjD,8BAAsB,OAAQ,SAAQ,aAAa;IACjD,SAAS,CAAC,gBAAgB,SAAY;IACtC,SAAS,CAAC,SAAS,SAAY;gBAEnB,IAAI,EAAE,MAAM,EAAE,SAAS,GAAE,SAAS,GAAG,UAAsB;IAIjE,OAAO,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ/C,gBAAgB,CACpB,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACjC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IA8CtC,SAAS,CAAC,aAAa,CAAC,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE;;;;cAI3F,OAAO,CACrB,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EACxB,UAAU,EAAE,MAAM,EAClB,eAAe,EAAE,MAAM,EACvB,EAAE,aAAoB,EAAE,GAAE;QAAE,aAAa,CAAC,EAAE,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.map
3
3
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,123 @@
1
+ 'use strict';
2
+
3
+ var chunkLENVOSFH_cjs = require('./chunk-LENVOSFH.cjs');
4
+ var chunkKCGBR2X6_cjs = require('./chunk-KCGBR2X6.cjs');
5
+ var chunkVA2CSOKJ_cjs = require('./chunk-VA2CSOKJ.cjs');
6
+ var rollup = require('rollup');
7
+ var path = require('path');
8
+ var pkg = require('empathic/package');
9
+ var logger = require('@mastra/core/logger');
10
+
11
+ function _interopNamespace(e) {
12
+ if (e && e.__esModule) return e;
13
+ var n = Object.create(null);
14
+ if (e) {
15
+ Object.keys(e).forEach(function (k) {
16
+ if (k !== 'default') {
17
+ var d = Object.getOwnPropertyDescriptor(e, k);
18
+ Object.defineProperty(n, k, d.get ? d : {
19
+ enumerable: true,
20
+ get: function () { return e[k]; }
21
+ });
22
+ }
23
+ });
24
+ }
25
+ n.default = e;
26
+ return Object.freeze(n);
27
+ }
28
+
29
+ var pkg__namespace = /*#__PURE__*/_interopNamespace(pkg);
30
+
31
+ async function getInputOptions2(entryFile, platform, env, { sourcemap = false } = {}) {
32
+ const closestPkgJson = pkg__namespace.up({ cwd: path.dirname(entryFile) });
33
+ const projectRoot = closestPkgJson ? path.dirname(chunkVA2CSOKJ_cjs.slash(closestPkgJson)) : chunkVA2CSOKJ_cjs.slash(process.cwd());
34
+ const { workspaceMap, workspaceRoot } = await chunkKCGBR2X6_cjs.getWorkspaceInformation({ mastraEntryFile: entryFile });
35
+ const analyzeEntryResult = await chunkKCGBR2X6_cjs.analyzeBundle(
36
+ [entryFile],
37
+ entryFile,
38
+ {
39
+ outputDir: path.posix.join(process.cwd(), ".mastra", ".build"),
40
+ projectRoot: workspaceRoot || process.cwd(),
41
+ platform: "node",
42
+ isDev: true
43
+ },
44
+ logger.noopLogger
45
+ );
46
+ const deps = /* @__PURE__ */ new Map();
47
+ for (const [dep, metadata] of analyzeEntryResult.dependencies.entries()) {
48
+ const pkgName = chunkVA2CSOKJ_cjs.getPackageName(dep);
49
+ if (pkgName && workspaceMap.has(pkgName)) {
50
+ deps.set(dep, metadata);
51
+ }
52
+ }
53
+ const inputOptions = await chunkLENVOSFH_cjs.getInputOptions(
54
+ entryFile,
55
+ {
56
+ dependencies: deps,
57
+ externalDependencies: /* @__PURE__ */ new Set(),
58
+ workspaceMap
59
+ },
60
+ platform,
61
+ env,
62
+ { sourcemap, isDev: true, workspaceRoot, projectRoot }
63
+ );
64
+ if (Array.isArray(inputOptions.plugins)) {
65
+ const plugins = [];
66
+ inputOptions.plugins.forEach((plugin) => {
67
+ if (plugin?.name === "node-resolve") {
68
+ return;
69
+ }
70
+ if (plugin?.name === "tsconfig-paths") {
71
+ plugins.push(
72
+ chunkKCGBR2X6_cjs.tsConfigPaths({
73
+ localResolve: true
74
+ })
75
+ );
76
+ return;
77
+ }
78
+ plugins.push(plugin);
79
+ });
80
+ inputOptions.plugins = plugins;
81
+ inputOptions.plugins.push(chunkKCGBR2X6_cjs.aliasHono());
82
+ inputOptions.plugins.push(chunkLENVOSFH_cjs.nodeModulesExtensionResolver());
83
+ }
84
+ return inputOptions;
85
+ }
86
+ async function createWatcher(inputOptions, outputOptions) {
87
+ const watcher = await rollup.watch({
88
+ ...inputOptions,
89
+ output: {
90
+ ...outputOptions,
91
+ format: "esm",
92
+ entryFileNames: "[name].mjs",
93
+ chunkFileNames: "[name].mjs"
94
+ }
95
+ });
96
+ return watcher;
97
+ }
98
+
99
+ // src/build/babel/remove-all-options-server.ts
100
+ function removeAllOptionsExceptServer(result, logger) {
101
+ return chunkKCGBR2X6_cjs.removeAllOptionsFromMastraExcept(result, "server", logger);
102
+ }
103
+
104
+ // src/build/serverOptions.ts
105
+ async function getServerOptions(entryFile, outputDir, logger) {
106
+ const result = await chunkKCGBR2X6_cjs.extractMastraOption(
107
+ "server",
108
+ entryFile,
109
+ removeAllOptionsExceptServer,
110
+ outputDir,
111
+ logger
112
+ );
113
+ if (!result) {
114
+ return null;
115
+ }
116
+ return result.getConfig();
117
+ }
118
+
119
+ exports.createWatcher = createWatcher;
120
+ exports.getInputOptions = getInputOptions2;
121
+ exports.getServerOptions = getServerOptions;
122
+ //# sourceMappingURL=chunk-24GY667C.cjs.map
123
+ //# sourceMappingURL=chunk-24GY667C.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/build/watcher.ts","../src/build/babel/remove-all-options-server.ts","../src/build/serverOptions.ts"],"names":["getInputOptions","pkg","dirname","slash","getWorkspaceInformation","analyzeBundle","posix","noopLogger","getPackageName","tsConfigPaths","aliasHono","nodeModulesExtensionResolver","watch","removeAllOptionsFromMastraExcept","extractMastraOption"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,eAAsBA,gBAAAA,CACpB,WACA,QAAA,EACA,GAAA,EACA,EAAE,SAAA,GAAY,KAAA,EAAM,GAA6B,EAAC,EAClD;AACA,EAAA,MAAM,iBAAqBC,cAAA,CAAA,EAAA,CAAG,EAAE,KAAKC,YAAA,CAAQ,SAAS,GAAG,CAAA;AACzD,EAAA,MAAM,WAAA,GAAc,cAAA,GAAiBA,YAAA,CAAQC,uBAAA,CAAM,cAAc,CAAC,CAAA,GAAIA,uBAAA,CAAM,OAAA,CAAQ,GAAA,EAAK,CAAA;AACzF,EAAA,MAAM,EAAE,cAAc,aAAA,EAAc,GAAI,MAAMC,yCAAA,CAAwB,EAAE,eAAA,EAAiB,SAAA,EAAW,CAAA;AAEpG,EAAA,MAAM,qBAAqB,MAAMC,+BAAA;AAAA,IAC/B,CAAC,SAAS,CAAA;AAAA,IACV,SAAA;AAAA,IACA;AAAA,MACE,WAAWC,UAAA,CAAM,IAAA,CAAK,QAAQ,GAAA,EAAI,EAAG,WAAW,QAAQ,CAAA;AAAA,MACxD,WAAA,EAAa,aAAA,IAAiB,OAAA,CAAQ,GAAA,EAAI;AAAA,MAC1C,QAAA,EAAU,MAAA;AAAA,MACV,KAAA,EAAO;AAAA,KACT;AAAA,IACAC;AAAA,GACF;AAEA,E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CAAQ,IAAA,CAAKC,8CAAA,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;;;AC9FO,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-24GY667C.cjs","sourcesContent":["import type { InputOptions, OutputOptions, Plugin } from 'rollup';\nimport { watch } from 'rollup';\nimport { dirname, posix } from 'node:path';\nimport * as pkg from 'empathic/package';\nimport { getInputOptions as getBundlerInputOptions } from './bundler';\nimport { aliasHono } from './plugins/hono-alias';\nimport { nodeModulesExtensionResolver } from './plugins/node-modules-extension-resolver';\nimport { tsConfigPaths } from './plugins/tsconfig-paths';\nimport { noopLogger } from '@mastra/core/logger';\nimport { getWorkspaceInformation } from '../bundler/workspaceDependencies';\nimport { analyzeBundle } from './analyze';\nimport { getPackageName, slash } 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 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"]}