@mastra/deployer 1.79.0-alpha.1 → 1.79.0-alpha.3

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 (51) hide show
  1. package/dist/_types/@mastra_hono/dist/browser-stream/index.d.ts +54 -2
  2. package/dist/_types/@mastra_hono/dist/index.d.ts +1 -0
  3. package/dist/{analyze-CcyVW_jJ.cjs → analyze-CPVTLGuy.cjs} +168 -25
  4. package/dist/analyze-CPVTLGuy.cjs.map +1 -0
  5. package/dist/{analyze-BP0cLyWH.js → analyze-Dvzg7NFK.js} +165 -22
  6. package/dist/analyze-Dvzg7NFK.js.map +1 -0
  7. package/dist/build/analyze.cjs +1 -1
  8. package/dist/build/analyze.js +1 -1
  9. package/dist/build/fs-routing/discover.d.ts.map +1 -1
  10. package/dist/build/index.cjs +4 -4
  11. package/dist/build/index.js +4 -4
  12. package/dist/build/shared/extract-mastra-option.d.ts.map +1 -1
  13. package/dist/{build-DGJW5-aB.cjs → build-Bdncb817.cjs} +71 -9
  14. package/dist/build-Bdncb817.cjs.map +1 -0
  15. package/dist/{build-CNYwIKPG.js → build-C8gia-n5.js} +71 -8
  16. package/dist/build-C8gia-n5.js.map +1 -0
  17. package/dist/bundler/find-workspaces.d.ts +52 -0
  18. package/dist/bundler/find-workspaces.d.ts.map +1 -0
  19. package/dist/bundler/index.cjs +3 -3
  20. package/dist/bundler/index.js +3 -3
  21. package/dist/bundler/workspaceDependencies.d.ts.map +1 -1
  22. package/dist/{bundlerOptions-BtMp_x-T.cjs → bundlerOptions-BA9vxjZt.cjs} +51 -1
  23. package/dist/bundlerOptions-BA9vxjZt.cjs.map +1 -0
  24. package/dist/{bundlerOptions-ID9i-l8I.js → bundlerOptions-DpvO59QF.js} +49 -1
  25. package/dist/bundlerOptions-DpvO59QF.js.map +1 -0
  26. package/dist/docs/SKILL.md +1 -1
  27. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  28. package/dist/index.cjs +3 -3
  29. package/dist/index.js +3 -3
  30. package/dist/server/index.cjs +243 -4
  31. package/dist/server/index.cjs.map +1 -1
  32. package/dist/server/index.d.ts.map +1 -1
  33. package/dist/server/index.js +244 -5
  34. package/dist/server/index.js.map +1 -1
  35. package/dist/services/deps.d.ts +9 -0
  36. package/dist/services/deps.d.ts.map +1 -1
  37. package/dist/services/index.cjs +1 -1
  38. package/dist/services/index.js +1 -1
  39. package/dist/{services-D_V7afWX.cjs → services-BQNEW5XJ.cjs} +126 -1
  40. package/dist/services-BQNEW5XJ.cjs.map +1 -0
  41. package/dist/{services-DXqmEy8F.js → services-PUoAjxMD.js} +115 -2
  42. package/dist/services-PUoAjxMD.js.map +1 -0
  43. package/package.json +8 -9
  44. package/dist/analyze-BP0cLyWH.js.map +0 -1
  45. package/dist/analyze-CcyVW_jJ.cjs.map +0 -1
  46. package/dist/build-CNYwIKPG.js.map +0 -1
  47. package/dist/build-DGJW5-aB.cjs.map +0 -1
  48. package/dist/bundlerOptions-BtMp_x-T.cjs.map +0 -1
  49. package/dist/bundlerOptions-ID9i-l8I.js.map +0 -1
  50. package/dist/services-DXqmEy8F.js.map +0 -1
  51. package/dist/services-D_V7afWX.cjs.map +0 -1
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Monorepo workspace discovery.
3
+ *
4
+ * Replaces the `find-workspaces` package with the same API, so that the
5
+ * production dependency tree no longer carries `fast-glob` → `micromatch` →
6
+ * `braces` (GHSA-vfj7-8cjw-p6xm, no patched release). Globbing goes through
7
+ * `tinyglobby`, which the deployer already uses for bundling.
8
+ *
9
+ * Root detection order matches `find-workspaces`: `lerna.json`, then
10
+ * `pnpm-workspace.yaml`, then `package.json` (`workspaces` array,
11
+ * `workspaces.packages`, or `bolt.workspaces`).
12
+ */
13
+ export type WorkspacePackageJson = {
14
+ name: string;
15
+ version?: string;
16
+ dependencies?: Record<string, string>;
17
+ exports?: unknown;
18
+ [key: string]: unknown;
19
+ };
20
+ export type WorkspacesRoot = {
21
+ /** Slash-normalized absolute path of the workspace root. */
22
+ location: string;
23
+ /** Package globs as declared by the workspace manifest. */
24
+ globs: string[];
25
+ };
26
+ export type Workspace = {
27
+ /** Slash-normalized absolute path of the package directory. */
28
+ location: string;
29
+ package: WorkspacePackageJson;
30
+ };
31
+ export type WorkspacesCache = {
32
+ root: Map<string, WorkspacesRoot | null>;
33
+ workspaces: Map<string, Workspace[]>;
34
+ clear: () => void;
35
+ };
36
+ export type FindWorkspacesOptions = {
37
+ /** Directory at which the upward search stops. Defaults to the user's home directory. */
38
+ stopDir?: string;
39
+ cache?: WorkspacesCache;
40
+ };
41
+ export declare function createWorkspacesCache(): WorkspacesCache;
42
+ /**
43
+ * Walk up from `dirname` until a directory declaring workspace globs is found.
44
+ * Returns `null` when none is found before `stopDir`.
45
+ */
46
+ export declare function findWorkspacesRoot(dirname?: string, options?: FindWorkspacesOptions): WorkspacesRoot | null;
47
+ /**
48
+ * List every workspace package under the root that contains `dirname`.
49
+ * Returns `null` when `dirname` is not inside a workspace.
50
+ */
51
+ export declare function findWorkspaces(dirname?: string, options?: FindWorkspacesOptions): Promise<Workspace[] | null>;
52
+ //# sourceMappingURL=find-workspaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-workspaces.d.ts","sourceRoot":"","sources":["../../src/bundler/find-workspaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAQH,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,oBAAoB,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC,CAAC;IACzC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IACrC,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,yFAAyF;IACzF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB,CAAC;AAEF,wBAAgB,qBAAqB,IAAI,eAAe,CASvD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,GAAG,cAAc,GAAG,IAAI,CAY/G;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAClC,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,CA0B7B"}
@@ -1,10 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("../rolldown-runtime-emK7D4bc.cjs");
3
- const require_analyze = require("../analyze-CcyVW_jJ.cjs");
3
+ const require_analyze = require("../analyze-CPVTLGuy.cjs");
4
4
  const require_utils = require("../utils-Bsr_sEcH.cjs");
5
- const require_services = require("../services-D_V7afWX.cjs");
5
+ const require_services = require("../services-BQNEW5XJ.cjs");
6
6
  const require_bundler = require("../bundler-CxslAqI_.cjs");
7
- const require_bundlerOptions = require("../bundlerOptions-BtMp_x-T.cjs");
7
+ const require_bundlerOptions = require("../bundlerOptions-BA9vxjZt.cjs");
8
8
  let fs = require("fs");
9
9
  let fs_promises = require("fs/promises");
10
10
  let path = require("path");
@@ -1,8 +1,8 @@
1
- import { c as packWorkspaceDependencies, o as collectTransitiveWorkspaceDependencies, s as getWorkspaceInformation, t as analyzeBundle } from "../analyze-BP0cLyWH.js";
1
+ import { c as packWorkspaceDependencies, o as collectTransitiveWorkspaceDependencies, s as getWorkspaceInformation, t as analyzeBundle } from "../analyze-Dvzg7NFK.js";
2
2
  import { a as getPackageName, m as slash, p as shouldSkipInstall, s as isBareModuleSpecifier } from "../utils-Bl3Lm7SI.js";
3
- import { i as DepsService, t as FileService } from "../services-DXqmEy8F.js";
3
+ import { i as DepsService, t as FileService } from "../services-PUoAjxMD.js";
4
4
  import { n as getInputOptions, r as getUnresolvedWorkspaceImport, t as createBundler } from "../bundler-DtMHSv5_.js";
5
- import { t as getBundlerOptions } from "../bundlerOptions-ID9i-l8I.js";
5
+ import { t as getBundlerOptions } from "../bundlerOptions-DpvO59QF.js";
6
6
  import { existsSync } from "fs";
7
7
  import { readFile, stat, writeFile } from "fs/promises";
8
8
  import { dirname, join, posix, relative, resolve } from "path";
@@ -1 +1 @@
1
- {"version":3,"file":"workspaceDependencies.d.ts","sourceRoot":"","sources":["../../src/bundler/workspaceDependencies.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAOzD,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IACjD,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAWF,eAAO,MAAM,aAAa,GAAI,cAAc,OAAO,KAAG,OAYrD,CAAC;AAEF,KAAK,0BAA0B,GAAG;IAChC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;I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,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,qBAAqB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACpC,CAAC;AAOF;;;;;;;;;;GAUG;AACH,wBAAsB,uBAAuB,CAAC,EAC5C,GAAmB,EACnB,eAAe,GAChB,EAAE;IACD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;CACzB;;;;GA+BA;AAED;;GAEG;AACH,eAAO,MAAM,sCAAsC,GAAU,gDAI1D;IACD,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAChD,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACjC,MAAM,EAAE,aAAa,CAAC;CACvB,KAAG,OAAO,CAAC,0BAA0B,CA2CrC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,GAAU,mEAK7C;IACD,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAChD,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,aAAa,CAAC;IACtB,qBAAqB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACpC,KAAG,OAAO,CAAC,IAAI,CAiDf,CAAC"}
@@ -1,5 +1,10 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.cjs");
2
+ const require_utils = require("./utils-Bsr_sEcH.cjs");
2
3
  const require_bundler = require("./bundler-CxslAqI_.cjs");
4
+ let fs = require("fs");
5
+ let path = require("path");
6
+ let empathic_package = require("empathic/package");
7
+ empathic_package = require_rolldown_runtime.__toESM(empathic_package, 1);
3
8
  let _babel_core = require("@babel/core");
4
9
  let url = require("url");
5
10
  let _rollup_plugin_commonjs = require("@rollup/plugin-commonjs");
@@ -8,6 +13,8 @@ let _rollup_plugin_json = require("@rollup/plugin-json");
8
13
  _rollup_plugin_json = require_rolldown_runtime.__toESM(_rollup_plugin_json, 1);
9
14
  let rollup = require("rollup");
10
15
  let _optimize_lodash_rollup_plugin = require("@optimize-lodash/rollup-plugin");
16
+ let _rollup_plugin_node_resolve = require("@rollup/plugin-node-resolve");
17
+ _rollup_plugin_node_resolve = require_rolldown_runtime.__toESM(_rollup_plugin_node_resolve, 1);
11
18
  //#region src/build/babel/remove-all-options-except.ts
12
19
  function removeAllOptionsFromMastraExcept(result, option, logger) {
13
20
  return {
@@ -125,6 +132,48 @@ async function recursiveRemoveNonReferencedNodes(code) {
125
132
  }
126
133
  //#endregion
127
134
  //#region src/build/shared/extract-mastra-option.ts
135
+ const TS_SOURCE = /\.tsx?$/;
136
+ const NODE_MODULES = `${path.sep}node_modules${path.sep}`;
137
+ /**
138
+ * Packages outside node_modules, such as workspace packages, may ship raw TypeScript (e.g. `exports` pointing to
139
+ * `src/index.ts`), which Node cannot load from the extracted config. Inline those so esbuild transpiles them. Bare
140
+ * imports made from inlined sources stay external but are pinned to the file they resolve to from that source: the
141
+ * extracted config lives in `.mastra/output` and can't see the package's own `node_modules` (e.g. pnpm isolated
142
+ * installs). The app's own imports keep resolving by name.
143
+ */
144
+ function typescriptSourcesResolver(entryFile) {
145
+ const appPackageJson = empathic_package.up({ cwd: (0, path.dirname)(entryFile) });
146
+ const appDir = appPackageJson ? (0, path.dirname)(appPackageJson) : (0, path.dirname)(entryFile);
147
+ const appRoots = [appDir + path.sep, (0, fs.realpathSync)(appDir) + path.sep];
148
+ const isInlinedSource = (file) => (0, path.isAbsolute)(file) && !file.includes(NODE_MODULES) && !appRoots.some((root) => file.startsWith(root));
149
+ const resolver = (0, _rollup_plugin_node_resolve.default)({
150
+ ...require_utils.getNodeResolveOptions("node"),
151
+ extensions: [
152
+ ".mjs",
153
+ ".js",
154
+ ".json",
155
+ ".node",
156
+ ".ts",
157
+ ".tsx"
158
+ ]
159
+ });
160
+ const resolveHook = resolver.resolveId;
161
+ const resolve = typeof resolveHook === "function" ? resolveHook : resolveHook.handler;
162
+ return {
163
+ ...resolver,
164
+ name: "typescript-sources-resolver",
165
+ async resolveId(id, importer, options) {
166
+ if (!importer || !require_utils.isBareModuleSpecifier(id)) return null;
167
+ const resolved = await resolve.call(this, id, importer, options);
168
+ if (!resolved || typeof resolved !== "object" || resolved.external) return null;
169
+ if (TS_SOURCE.test(resolved.id) && !resolved.id.includes(NODE_MODULES)) return resolved.id;
170
+ return isInlinedSource(importer) ? {
171
+ id: (0, url.pathToFileURL)(resolved.id).href,
172
+ external: true
173
+ } : null;
174
+ }
175
+ };
176
+ }
128
177
  function extractMastraOptionBundler(name, entryFile, result, logger) {
129
178
  return (0, rollup.rollup)({
130
179
  logLevel: "silent",
@@ -132,6 +181,7 @@ function extractMastraOptionBundler(name, entryFile, result, logger) {
132
181
  treeshake: "smallest",
133
182
  plugins: [
134
183
  require_bundler.tsConfigPaths(),
184
+ typescriptSourcesResolver(entryFile),
135
185
  require_bundler.esbuild(),
136
186
  (0, _optimize_lodash_rollup_plugin.optimizeLodashImports)({ include: "**/*.{js,ts,mjs,cjs}" }),
137
187
  (0, _rollup_plugin_commonjs.default)({
@@ -191,4 +241,4 @@ Object.defineProperty(exports, "getBundlerOptions", {
191
241
  }
192
242
  });
193
243
 
194
- //# sourceMappingURL=bundlerOptions-BtMp_x-T.cjs.map
244
+ //# sourceMappingURL=bundlerOptions-BA9vxjZt.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundlerOptions-BA9vxjZt.cjs","names":["t","t","sep","pkg","getNodeResolveOptions","isBareModuleSpecifier","tsConfigPaths","esbuild"],"sources":["../src/build/babel/remove-all-options-except.ts","../src/build/plugins/remove-all-except.ts","../src/build/babel/remove-non-referenced-nodes.ts","../src/build/plugins/remove-unused-references.ts","../src/build/shared/extract-mastra-option.ts","../src/build/bundlerOptions.ts"],"sourcesContent":["import { types as t } from '@babel/core';\nimport type { NodePath, PluginObject, types } from '@babel/core';\nimport type { IMastraLogger } from '@mastra/core/logger';\nimport type { Config as MastraConfig } from '@mastra/core/mastra';\n\nexport function removeAllOptionsFromMastraExcept(\n result: { hasCustomConfig: boolean },\n option: keyof MastraConfig,\n logger?: IMastraLogger,\n): PluginObject {\n return {\n name: 'remove-all-except-' + option + '-config',\n visitor: {\n ExportNamedDeclaration: {\n // remove all exports, but keep the underlying declarations — the\n // extracted option may reference them (e.g. `export const deployer = ...`\n // used as `new Mastra({ deployer })`). Unreferenced declarations are\n // dropped by the cleanup pass afterwards.\n exit(path) {\n if (path.node.declaration) {\n const [declaration] = path.replaceWith(path.node.declaration);\n // Already traversed — don't requeue, or the NewExpression visitor\n // would append the extracted export a second time.\n declaration.skip();\n } else {\n path.remove();\n }\n },\n },\n\n NewExpression(path, state) {\n // is a variable declaration\n const varDeclaratorPath = path.findParent(path => t.isVariableDeclarator(path.node));\n if (!varDeclaratorPath) {\n return;\n }\n\n const parentNode = path.parentPath.node;\n // check if it's a const of mastra\n if (!t.isVariableDeclarator(parentNode) || !t.isIdentifier(parentNode.id) || parentNode.id.name !== 'mastra') {\n return;\n }\n\n let mastraArgs = t.objectExpression([]);\n if (t.isObjectExpression(path.node.arguments[0])) {\n mastraArgs = path.node.arguments[0];\n }\n\n // Find the config property, skipping SpreadElement nodes\n let configProperty = mastraArgs.properties.find(\n prop => t.isObjectProperty(prop) && t.isIdentifier(prop.key) && prop.key.name === option,\n );\n let configValue: types.Expression = t.objectExpression([]);\n\n const programPath = path.scope.getProgramParent().path as NodePath<types.Program> | undefined;\n if (!programPath) {\n return;\n }\n\n if (configProperty && t.isObjectProperty(configProperty) && t.isExpression(configProperty.value)) {\n result.hasCustomConfig = true;\n configValue = configProperty.value;\n\n if (t.isIdentifier(configProperty.value) && configProperty.value.name === option) {\n const configBinding = state.file.scope.getBinding(option)!;\n\n if (configBinding && t.isVariableDeclarator(configBinding.path.node)) {\n const id = path.scope.generateUidIdentifier(option);\n\n configBinding.path.replaceWith(t.variableDeclarator(id, configBinding.path.node.init!));\n configValue = id;\n }\n }\n }\n\n // add the deployer export\n const exportDeclaration = t.exportNamedDeclaration(\n t.variableDeclaration('const', [t.variableDeclarator(t.identifier(option), configValue)]),\n [],\n );\n\n programPath.node.body.push(exportDeclaration);\n },\n\n Program: {\n exit(path) {\n // Add a fallback export if no mastra configuration was found\n const hasExport = path.node.body.some(\n node => node.type === 'ExportNamedDeclaration' || node.type === 'ExportDefaultDeclaration',\n );\n\n if (!hasExport) {\n if (logger) {\n logger.warn('Mastra config could not be extracted', {\n option,\n details:\n 'Please make sure your entry file looks like this:\\nexport const mastra = new Mastra({\\n <option>: <value>\\n})',\n });\n }\n\n const fallbackExportDeclaration = t.exportNamedDeclaration(\n t.variableDeclaration('const', [t.variableDeclarator(t.identifier(option), t.objectExpression([]))]),\n [],\n );\n path.node.body.push(fallbackExportDeclaration);\n }\n },\n },\n },\n } satisfies PluginObject;\n}\n","import { transformAsync } from '@babel/core';\nimport type { IMastraLogger } from '@mastra/core/logger';\nimport type { Config as MastraConfig } from '@mastra/core/mastra';\nimport type { Plugin, SourceMapInput } from 'rollup';\nimport { removeAllOptionsFromMastraExcept } from '../babel/remove-all-options-except';\n\nexport function removeAllOptionsFromMastraExceptPlugin(\n mastraEntry: string,\n name: keyof MastraConfig,\n result: { hasCustomConfig: boolean },\n options?: { sourcemap?: boolean; logger?: IMastraLogger },\n): Plugin {\n return {\n name: `remove-${name}`,\n transform(code, id) {\n if (id !== mastraEntry) {\n return;\n }\n\n return transformAsync(code, {\n babelrc: false,\n configFile: false,\n filename: id,\n plugins: [() => removeAllOptionsFromMastraExcept(result, name, options?.logger)],\n sourceMaps: options?.sourcemap,\n }).then(result => ({\n code: result!.code!,\n map: result!.map! as SourceMapInput,\n }));\n },\n } satisfies Plugin;\n}\n","import { types as t } from '@babel/core';\nimport type { PluginObject } from '@babel/core';\n\nexport function removeNonReferencedNodes() {\n return {\n name: 'remove-non-referenced-nodes',\n visitor: {\n Program(path) {\n // Get the scope information\n const scope = path.scope;\n\n // Filter body to keep only referenced nodes\n const currentBody = path.get('body');\n const filteredBody = currentBody.filter(childPath => {\n if (childPath.isExportDeclaration()) {\n return true;\n }\n\n // For variable declarations, check if any declared variables are referenced\n if (childPath.isVariableDeclaration()) {\n return childPath.node.declarations.some(decl => {\n if (!t.isIdentifier(decl.id)) {\n return false;\n }\n\n const name = decl.id.name;\n const binding = scope.getBinding(name);\n // Keep if it has references or is exported\n return binding && (binding.referenced || binding.referencePaths.length > 0);\n });\n }\n\n // For function/class declarations, check if they're referenced\n if (childPath.isFunctionDeclaration() || childPath.isClassDeclaration()) {\n if (!t.isIdentifier(childPath.node.id)) {\n return false;\n }\n\n const name = childPath.node.id.name;\n const binding = scope.getBinding(name);\n return binding && (binding.referenced || binding.referencePaths.length > 0);\n }\n\n // For imports, check if any imported items are referenced\n if (childPath.isImportDeclaration()) {\n return childPath.node.specifiers.some(specifier => {\n const importedName = specifier.local.name;\n const binding = scope.getBinding(importedName);\n return binding && (binding.referenced || binding.referencePaths.length > 0);\n });\n }\n\n // Default to keeping other node types\n return false;\n });\n\n // Replace the program body with filtered nodes\n path.set(\n 'body',\n filteredBody.map(p => p.node),\n );\n },\n },\n } as PluginObject;\n}\n","import { transformAsync } from '@babel/core';\nimport { removeNonReferencedNodes } from '../babel/remove-non-referenced-nodes';\n\nexport async function recursiveRemoveNonReferencedNodes(code: string): Promise<{ code: string; map: any }> {\n const result = await transformAsync(code, {\n babelrc: false,\n configFile: false,\n plugins: [removeNonReferencedNodes],\n });\n\n // keep looping until the code is not changed\n if (result && result.code! !== code) {\n return recursiveRemoveNonReferencedNodes(result!.code!);\n }\n\n return {\n code: result!.code!,\n map: result!.map!,\n };\n}\n","import { realpathSync } from 'node:fs';\nimport { dirname, isAbsolute, sep } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport type { IMastraLogger } from '@mastra/core/logger';\nimport type { Config as MastraConfig } from '@mastra/core/mastra';\nimport { optimizeLodashImports } from '@optimize-lodash/rollup-plugin';\nimport commonjs from '@rollup/plugin-commonjs';\nimport json from '@rollup/plugin-json';\nimport nodeResolve from '@rollup/plugin-node-resolve';\nimport * as pkg from 'empathic/package';\nimport { rollup } from 'rollup';\nimport type { Plugin, RollupOutput } from 'rollup';\nimport { esbuild } from '../plugins/esbuild';\nimport { removeAllOptionsFromMastraExceptPlugin } from '../plugins/remove-all-except';\nimport { recursiveRemoveNonReferencedNodes } from '../plugins/remove-unused-references';\nimport { tsConfigPaths } from '../plugins/tsconfig-paths';\nimport { getNodeResolveOptions, isBareModuleSpecifier } from '../utils';\n\nconst TS_SOURCE = /\\.tsx?$/;\nconst NODE_MODULES = `${sep}node_modules${sep}`;\n\n/**\n * Packages outside node_modules, such as workspace packages, may ship raw TypeScript (e.g. `exports` pointing to\n * `src/index.ts`), which Node cannot load from the extracted config. Inline those so esbuild transpiles them. Bare\n * imports made from inlined sources stay external but are pinned to the file they resolve to from that source: the\n * extracted config lives in `.mastra/output` and can't see the package's own `node_modules` (e.g. pnpm isolated\n * installs). The app's own imports keep resolving by name.\n */\nfunction typescriptSourcesResolver(entryFile: string): Plugin {\n const appPackageJson = pkg.up({ cwd: dirname(entryFile) });\n const appDir = appPackageJson ? dirname(appPackageJson) : dirname(entryFile);\n // App files keep the entry's path, files resolved by node-resolve are real paths\n const appRoots = [appDir + sep, realpathSync(appDir) + sep];\n const isInlinedSource = (file: string) =>\n isAbsolute(file) && !file.includes(NODE_MODULES) && !appRoots.some(root => file.startsWith(root));\n\n const resolver = nodeResolve({\n ...getNodeResolveOptions('node'),\n extensions: ['.mjs', '.js', '.json', '.node', '.ts', '.tsx'],\n });\n const resolveHook = resolver.resolveId!;\n const resolve = typeof resolveHook === 'function' ? resolveHook : resolveHook.handler;\n\n return {\n ...resolver,\n name: 'typescript-sources-resolver',\n async resolveId(id, importer, options) {\n if (!importer || !isBareModuleSpecifier(id)) {\n return null;\n }\n\n const resolved = await resolve.call(this, id, importer, options);\n if (!resolved || typeof resolved !== 'object' || resolved.external) {\n return null;\n }\n\n if (TS_SOURCE.test(resolved.id) && !resolved.id.includes(NODE_MODULES)) {\n return resolved.id;\n }\n\n return isInlinedSource(importer) ? { id: pathToFileURL(resolved.id).href, external: true } : null;\n },\n };\n}\n\nexport function extractMastraOptionBundler(\n name: keyof MastraConfig,\n entryFile: string,\n result: {\n hasCustomConfig: boolean;\n },\n logger?: IMastraLogger,\n) {\n return rollup({\n logLevel: 'silent',\n input: {\n [`${name}-config`]: entryFile,\n },\n treeshake: 'smallest',\n plugins: [\n tsConfigPaths(),\n typescriptSourcesResolver(entryFile),\n // transpile typescript to something we understand\n esbuild(),\n optimizeLodashImports({\n include: '**/*.{js,ts,mjs,cjs}',\n }),\n commonjs({\n extensions: ['.js', '.ts'],\n strictRequires: 'strict',\n transformMixedEsModules: true,\n ignoreTryCatch: false,\n }),\n json(),\n removeAllOptionsFromMastraExceptPlugin(entryFile, name, result, { logger }),\n // let esbuild remove all unused imports\n esbuild(),\n {\n name: 'cleanup',\n transform(code, id) {\n if (id !== entryFile) {\n return;\n }\n\n return recursiveRemoveNonReferencedNodes(code);\n },\n },\n // let esbuild remove it once more\n esbuild(),\n ],\n });\n}\n\nexport async function extractMastraOption<T extends keyof MastraConfig>(\n name: T,\n entryFile: string,\n outputDir: string,\n logger?: IMastraLogger,\n): Promise<{\n bundleOutput: RollupOutput;\n getConfig: () => Promise<MastraConfig[T]>;\n} | null> {\n const result = {\n hasCustomConfig: false,\n };\n\n const bundler = await extractMastraOptionBundler(name, entryFile, result, logger);\n\n const output = await bundler.write({\n dir: outputDir,\n format: 'es',\n entryFileNames: '[name].mjs',\n });\n\n if (result.hasCustomConfig) {\n const configPath = `${outputDir}/${name}-config.mjs`;\n\n return {\n bundleOutput: output,\n getConfig: () => import(pathToFileURL(configPath).href).then(m => m[name] as MastraConfig[T]),\n };\n }\n\n return null;\n}\n","import type { IMastraLogger } from '@mastra/core/logger';\nimport type { Config } from '@mastra/core/mastra';\nimport { extractMastraOption, extractMastraOptionBundler } from './shared/extract-mastra-option';\n\nexport function getBundlerOptionsBundler(\n entryFile: string,\n result: {\n hasCustomConfig: false;\n },\n) {\n return extractMastraOptionBundler('bundler', entryFile, result);\n}\n\nexport async function getBundlerOptions(\n entryFile: string,\n outputDir: string,\n logger?: IMastraLogger,\n): Promise<Config['bundler'] | null> {\n const result = await extractMastraOption('bundler', entryFile, outputDir, logger);\n\n if (!result) {\n return null;\n }\n\n return result.getConfig();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAKA,SAAgB,iCACd,QACA,QACA,QACc;CACd,OAAO;EACL,MAAM,uBAAuB,SAAS;EACtC,SAAS;GACP,wBAAwB,EAKtB,KAAK,MAAM;IACT,IAAI,KAAK,KAAK,aAAa;KACzB,MAAM,CAAC,eAAe,KAAK,YAAY,KAAK,KAAK,WAAW;KAG5D,YAAY,KAAK;IACnB,OACE,KAAK,OAAO;GAEhB,EACF;GAEA,cAAc,MAAM,OAAO;IAGzB,IAAI,CADsB,KAAK,YAAW,SAAQA,YAAAA,MAAE,qBAAqB,KAAK,IAAI,CAC7D,GACnB;IAGF,MAAM,aAAa,KAAK,WAAW;IAEnC,IAAI,CAACA,YAAAA,MAAE,qBAAqB,UAAU,KAAK,CAACA,YAAAA,MAAE,aAAa,WAAW,EAAE,KAAK,WAAW,GAAG,SAAS,UAClG;IAGF,IAAI,aAAaA,YAAAA,MAAE,iBAAiB,CAAC,CAAC;IACtC,IAAIA,YAAAA,MAAE,mBAAmB,KAAK,KAAK,UAAU,EAAE,GAC7C,aAAa,KAAK,KAAK,UAAU;IAInC,IAAI,iBAAiB,WAAW,WAAW,MACzC,SAAQA,YAAAA,MAAE,iBAAiB,IAAI,KAAKA,YAAAA,MAAE,aAAa,KAAK,GAAG,KAAK,KAAK,IAAI,SAAS,MACpF;IACA,IAAI,cAAgCA,YAAAA,MAAE,iBAAiB,CAAC,CAAC;IAEzD,MAAM,cAAc,KAAK,MAAM,iBAAiB,CAAC,CAAC;IAClD,IAAI,CAAC,aACH;IAGF,IAAI,kBAAkBA,YAAAA,MAAE,iBAAiB,cAAc,KAAKA,YAAAA,MAAE,aAAa,eAAe,KAAK,GA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A,IAAA,cAAA,CAAqB,UAAU,CAAC,CAAC,KAAK,CAAC,MAAK,MAAK,EAAE,KAAwB;EAC9F;CACF;CAEA,OAAO;AACT;;;ACnIA,eAAsB,kBACpB,WACA,WACA,QACmC;CACnC,MAAM,SAAS,MAAM,oBAAoB,WAAW,WAAW,WAAW,MAAM;CAEhF,IAAI,CAAC,QACH,OAAO;CAGT,OAAO,OAAO,UAAU;AAC1B"}
@@ -1,10 +1,15 @@
1
+ import { i as getNodeResolveOptions, s as isBareModuleSpecifier } from "./utils-Bl3Lm7SI.js";
1
2
  import { g as esbuild, o as tsConfigPaths } from "./bundler-DtMHSv5_.js";
3
+ import { realpathSync } from "fs";
4
+ import { dirname, isAbsolute, sep } from "path";
5
+ import * as pkg from "empathic/package";
2
6
  import { transformAsync, types } from "@babel/core";
3
7
  import { pathToFileURL } from "url";
4
8
  import commonjs from "@rollup/plugin-commonjs";
5
9
  import json from "@rollup/plugin-json";
6
10
  import { rollup } from "rollup";
7
11
  import { optimizeLodashImports } from "@optimize-lodash/rollup-plugin";
12
+ import nodeResolve from "@rollup/plugin-node-resolve";
8
13
  //#region src/build/babel/remove-all-options-except.ts
9
14
  function removeAllOptionsFromMastraExcept(result, option, logger) {
10
15
  return {
@@ -122,6 +127,48 @@ async function recursiveRemoveNonReferencedNodes(code) {
122
127
  }
123
128
  //#endregion
124
129
  //#region src/build/shared/extract-mastra-option.ts
130
+ const TS_SOURCE = /\.tsx?$/;
131
+ const NODE_MODULES = `${sep}node_modules${sep}`;
132
+ /**
133
+ * Packages outside node_modules, such as workspace packages, may ship raw TypeScript (e.g. `exports` pointing to
134
+ * `src/index.ts`), which Node cannot load from the extracted config. Inline those so esbuild transpiles them. Bare
135
+ * imports made from inlined sources stay external but are pinned to the file they resolve to from that source: the
136
+ * extracted config lives in `.mastra/output` and can't see the package's own `node_modules` (e.g. pnpm isolated
137
+ * installs). The app's own imports keep resolving by name.
138
+ */
139
+ function typescriptSourcesResolver(entryFile) {
140
+ const appPackageJson = pkg.up({ cwd: dirname(entryFile) });
141
+ const appDir = appPackageJson ? dirname(appPackageJson) : dirname(entryFile);
142
+ const appRoots = [appDir + sep, realpathSync(appDir) + sep];
143
+ const isInlinedSource = (file) => isAbsolute(file) && !file.includes(NODE_MODULES) && !appRoots.some((root) => file.startsWith(root));
144
+ const resolver = nodeResolve({
145
+ ...getNodeResolveOptions("node"),
146
+ extensions: [
147
+ ".mjs",
148
+ ".js",
149
+ ".json",
150
+ ".node",
151
+ ".ts",
152
+ ".tsx"
153
+ ]
154
+ });
155
+ const resolveHook = resolver.resolveId;
156
+ const resolve = typeof resolveHook === "function" ? resolveHook : resolveHook.handler;
157
+ return {
158
+ ...resolver,
159
+ name: "typescript-sources-resolver",
160
+ async resolveId(id, importer, options) {
161
+ if (!importer || !isBareModuleSpecifier(id)) return null;
162
+ const resolved = await resolve.call(this, id, importer, options);
163
+ if (!resolved || typeof resolved !== "object" || resolved.external) return null;
164
+ if (TS_SOURCE.test(resolved.id) && !resolved.id.includes(NODE_MODULES)) return resolved.id;
165
+ return isInlinedSource(importer) ? {
166
+ id: pathToFileURL(resolved.id).href,
167
+ external: true
168
+ } : null;
169
+ }
170
+ };
171
+ }
125
172
  function extractMastraOptionBundler(name, entryFile, result, logger) {
126
173
  return rollup({
127
174
  logLevel: "silent",
@@ -129,6 +176,7 @@ function extractMastraOptionBundler(name, entryFile, result, logger) {
129
176
  treeshake: "smallest",
130
177
  plugins: [
131
178
  tsConfigPaths(),
179
+ typescriptSourcesResolver(entryFile),
132
180
  esbuild(),
133
181
  optimizeLodashImports({ include: "**/*.{js,ts,mjs,cjs}" }),
134
182
  commonjs({
@@ -177,4 +225,4 @@ async function getBundlerOptions(entryFile, outputDir, logger) {
177
225
  //#endregion
178
226
  export { extractMastraOption as n, getBundlerOptions as t };
179
227
 
180
- //# sourceMappingURL=bundlerOptions-ID9i-l8I.js.map
228
+ //# sourceMappingURL=bundlerOptions-DpvO59QF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundlerOptions-DpvO59QF.js","names":["t","t"],"sources":["../src/build/babel/remove-all-options-except.ts","../src/build/plugins/remove-all-except.ts","../src/build/babel/remove-non-referenced-nodes.ts","../src/build/plugins/remove-unused-references.ts","../src/build/shared/extract-mastra-option.ts","../src/build/bundlerOptions.ts"],"sourcesContent":["import { types as t } from '@babel/core';\nimport type { NodePath, PluginObject, types } from '@babel/core';\nimport type { IMastraLogger } from '@mastra/core/logger';\nimport type { Config as MastraConfig } from '@mastra/core/mastra';\n\nexport function removeAllOptionsFromMastraExcept(\n result: { hasCustomConfig: boolean },\n option: keyof MastraConfig,\n logger?: IMastraLogger,\n): PluginObject {\n return {\n name: 'remove-all-except-' + option + '-config',\n visitor: {\n ExportNamedDeclaration: {\n // remove all exports, but keep the underlying declarations — the\n // extracted option may reference them (e.g. `export const deployer = ...`\n // used as `new Mastra({ deployer })`). Unreferenced declarations are\n // dropped by the cleanup pass afterwards.\n exit(path) {\n if (path.node.declaration) {\n const [declaration] = path.replaceWith(path.node.declaration);\n // Already traversed — don't requeue, or the NewExpression visitor\n // would append the extracted export a second time.\n declaration.skip();\n } else {\n path.remove();\n }\n },\n },\n\n NewExpression(path, state) {\n // is a variable declaration\n const varDeclaratorPath = path.findParent(path => t.isVariableDeclarator(path.node));\n if (!varDeclaratorPath) {\n return;\n }\n\n const parentNode = path.parentPath.node;\n // check if it's a const of mastra\n if (!t.isVariableDeclarator(parentNode) || !t.isIdentifier(parentNode.id) || parentNode.id.name !== 'mastra') {\n return;\n }\n\n let mastraArgs = t.objectExpression([]);\n if (t.isObjectExpression(path.node.arguments[0])) {\n mastraArgs = path.node.arguments[0];\n }\n\n // Find the config property, skipping SpreadElement nodes\n let configProperty = mastraArgs.properties.find(\n prop => t.isObjectProperty(prop) && t.isIdentifier(prop.key) && prop.key.name === option,\n );\n let configValue: types.Expression = t.objectExpression([]);\n\n const programPath = path.scope.getProgramParent().path as NodePath<types.Program> | undefined;\n if (!programPath) {\n return;\n }\n\n if (configProperty && t.isObjectProperty(configProperty) && t.isExpression(configProperty.value)) {\n result.hasCustomConfig = true;\n configValue = configProperty.value;\n\n if (t.isIdentifier(configProperty.value) && configProperty.value.name === option) {\n const configBinding = state.file.scope.getBinding(option)!;\n\n if (configBinding && t.isVariableDeclarator(configBinding.path.node)) {\n const id = path.scope.generateUidIdentifier(option);\n\n configBinding.path.replaceWith(t.variableDeclarator(id, configBinding.path.node.init!));\n configValue = id;\n }\n }\n }\n\n // add the deployer export\n const exportDeclaration = t.exportNamedDeclaration(\n t.variableDeclaration('const', [t.variableDeclarator(t.identifier(option), configValue)]),\n [],\n );\n\n programPath.node.body.push(exportDeclaration);\n },\n\n Program: {\n exit(path) {\n // Add a fallback export if no mastra configuration was found\n const hasExport = path.node.body.some(\n node => node.type === 'ExportNamedDeclaration' || node.type === 'ExportDefaultDeclaration',\n );\n\n if (!hasExport) {\n if (logger) {\n logger.warn('Mastra config could not be extracted', {\n option,\n details:\n 'Please make sure your entry file looks like this:\\nexport const mastra = new Mastra({\\n <option>: <value>\\n})',\n });\n }\n\n const fallbackExportDeclaration = t.exportNamedDeclaration(\n t.variableDeclaration('const', [t.variableDeclarator(t.identifier(option), t.objectExpression([]))]),\n [],\n );\n path.node.body.push(fallbackExportDeclaration);\n }\n },\n },\n },\n } satisfies PluginObject;\n}\n","import { transformAsync } from '@babel/core';\nimport type { IMastraLogger } from '@mastra/core/logger';\nimport type { Config as MastraConfig } from '@mastra/core/mastra';\nimport type { Plugin, SourceMapInput } from 'rollup';\nimport { removeAllOptionsFromMastraExcept } from '../babel/remove-all-options-except';\n\nexport function removeAllOptionsFromMastraExceptPlugin(\n mastraEntry: string,\n name: keyof MastraConfig,\n result: { hasCustomConfig: boolean },\n options?: { sourcemap?: boolean; logger?: IMastraLogger },\n): Plugin {\n return {\n name: `remove-${name}`,\n transform(code, id) {\n if (id !== mastraEntry) {\n return;\n }\n\n return transformAsync(code, {\n babelrc: false,\n configFile: false,\n filename: id,\n plugins: [() => removeAllOptionsFromMastraExcept(result, name, options?.logger)],\n sourceMaps: options?.sourcemap,\n }).then(result => ({\n code: result!.code!,\n map: result!.map! as SourceMapInput,\n }));\n },\n } satisfies Plugin;\n}\n","import { types as t } from '@babel/core';\nimport type { PluginObject } from '@babel/core';\n\nexport function removeNonReferencedNodes() {\n return {\n name: 'remove-non-referenced-nodes',\n visitor: {\n Program(path) {\n // Get the scope information\n const scope = path.scope;\n\n // Filter body to keep only referenced nodes\n const currentBody = path.get('body');\n const filteredBody = currentBody.filter(childPath => {\n if (childPath.isExportDeclaration()) {\n return true;\n }\n\n // For variable declarations, check if any declared variables are referenced\n if (childPath.isVariableDeclaration()) {\n return childPath.node.declarations.some(decl => {\n if (!t.isIdentifier(decl.id)) {\n return false;\n }\n\n const name = decl.id.name;\n const binding = scope.getBinding(name);\n // Keep if it has references or is exported\n return binding && (binding.referenced || binding.referencePaths.length > 0);\n });\n }\n\n // For function/class declarations, check if they're referenced\n if (childPath.isFunctionDeclaration() || childPath.isClassDeclaration()) {\n if (!t.isIdentifier(childPath.node.id)) {\n return false;\n }\n\n const name = childPath.node.id.name;\n const binding = scope.getBinding(name);\n return binding && (binding.referenced || binding.referencePaths.length > 0);\n }\n\n // For imports, check if any imported items are referenced\n if (childPath.isImportDeclaration()) {\n return childPath.node.specifiers.some(specifier => {\n const importedName = specifier.local.name;\n const binding = scope.getBinding(importedName);\n return binding && (binding.referenced || binding.referencePaths.length > 0);\n });\n }\n\n // Default to keeping other node types\n return false;\n });\n\n // Replace the program body with filtered nodes\n path.set(\n 'body',\n filteredBody.map(p => p.node),\n );\n },\n },\n } as PluginObject;\n}\n","import { transformAsync } from '@babel/core';\nimport { removeNonReferencedNodes } from '../babel/remove-non-referenced-nodes';\n\nexport async function recursiveRemoveNonReferencedNodes(code: string): Promise<{ code: string; map: any }> {\n const result = await transformAsync(code, {\n babelrc: false,\n configFile: false,\n plugins: [removeNonReferencedNodes],\n });\n\n // keep looping until the code is not changed\n if (result && result.code! !== code) {\n return recursiveRemoveNonReferencedNodes(result!.code!);\n }\n\n return {\n code: result!.code!,\n map: result!.map!,\n };\n}\n","import { realpathSync } from 'node:fs';\nimport { dirname, isAbsolute, sep } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport type { IMastraLogger } from '@mastra/core/logger';\nimport type { Config as MastraConfig } from '@mastra/core/mastra';\nimport { optimizeLodashImports } from '@optimize-lodash/rollup-plugin';\nimport commonjs from '@rollup/plugin-commonjs';\nimport json from '@rollup/plugin-json';\nimport nodeResolve from '@rollup/plugin-node-resolve';\nimport * as pkg from 'empathic/package';\nimport { rollup } from 'rollup';\nimport type { Plugin, RollupOutput } from 'rollup';\nimport { esbuild } from '../plugins/esbuild';\nimport { removeAllOptionsFromMastraExceptPlugin } from '../plugins/remove-all-except';\nimport { recursiveRemoveNonReferencedNodes } from '../plugins/remove-unused-references';\nimport { tsConfigPaths } from '../plugins/tsconfig-paths';\nimport { getNodeResolveOptions, isBareModuleSpecifier } from '../utils';\n\nconst TS_SOURCE = /\\.tsx?$/;\nconst NODE_MODULES = `${sep}node_modules${sep}`;\n\n/**\n * Packages outside node_modules, such as workspace packages, may ship raw TypeScript (e.g. `exports` pointing to\n * `src/index.ts`), which Node cannot load from the extracted config. Inline those so esbuild transpiles them. Bare\n * imports made from inlined sources stay external but are pinned to the file they resolve to from that source: the\n * extracted config lives in `.mastra/output` and can't see the package's own `node_modules` (e.g. pnpm isolated\n * installs). The app's own imports keep resolving by name.\n */\nfunction typescriptSourcesResolver(entryFile: string): Plugin {\n const appPackageJson = pkg.up({ cwd: dirname(entryFile) });\n const appDir = appPackageJson ? dirname(appPackageJson) : dirname(entryFile);\n // App files keep the entry's path, files resolved by node-resolve are real paths\n const appRoots = [appDir + sep, realpathSync(appDir) + sep];\n const isInlinedSource = (file: string) =>\n isAbsolute(file) && !file.includes(NODE_MODULES) && !appRoots.some(root => file.startsWith(root));\n\n const resolver = nodeResolve({\n ...getNodeResolveOptions('node'),\n extensions: ['.mjs', '.js', '.json', '.node', '.ts', '.tsx'],\n });\n const resolveHook = resolver.resolveId!;\n const resolve = typeof resolveHook === 'function' ? resolveHook : resolveHook.handler;\n\n return {\n ...resolver,\n name: 'typescript-sources-resolver',\n async resolveId(id, importer, options) {\n if (!importer || !isBareModuleSpecifier(id)) {\n return null;\n }\n\n const resolved = await resolve.call(this, id, importer, options);\n if (!resolved || typeof resolved !== 'object' || resolved.external) {\n return null;\n }\n\n if (TS_SOURCE.test(resolved.id) && !resolved.id.includes(NODE_MODULES)) {\n return resolved.id;\n }\n\n return isInlinedSource(importer) ? { id: pathToFileURL(resolved.id).href, external: true } : null;\n },\n };\n}\n\nexport function extractMastraOptionBundler(\n name: keyof MastraConfig,\n entryFile: string,\n result: {\n hasCustomConfig: boolean;\n },\n logger?: IMastraLogger,\n) {\n return rollup({\n logLevel: 'silent',\n input: {\n [`${name}-config`]: entryFile,\n },\n treeshake: 'smallest',\n plugins: [\n tsConfigPaths(),\n typescriptSourcesResolver(entryFile),\n // transpile typescript to something we understand\n esbuild(),\n optimizeLodashImports({\n include: '**/*.{js,ts,mjs,cjs}',\n }),\n commonjs({\n extensions: ['.js', '.ts'],\n strictRequires: 'strict',\n transformMixedEsModules: true,\n ignoreTryCatch: false,\n }),\n json(),\n removeAllOptionsFromMastraExceptPlugin(entryFile, name, result, { logger }),\n // let esbuild remove all unused imports\n esbuild(),\n {\n name: 'cleanup',\n transform(code, id) {\n if (id !== entryFile) {\n return;\n }\n\n return recursiveRemoveNonReferencedNodes(code);\n },\n },\n // let esbuild remove it once more\n esbuild(),\n ],\n });\n}\n\nexport async function extractMastraOption<T extends keyof MastraConfig>(\n name: T,\n entryFile: string,\n outputDir: string,\n logger?: IMastraLogger,\n): Promise<{\n bundleOutput: RollupOutput;\n getConfig: () => Promise<MastraConfig[T]>;\n} | null> {\n const result = {\n hasCustomConfig: false,\n };\n\n const bundler = await extractMastraOptionBundler(name, entryFile, result, logger);\n\n const output = await bundler.write({\n dir: outputDir,\n format: 'es',\n entryFileNames: '[name].mjs',\n });\n\n if (result.hasCustomConfig) {\n const configPath = `${outputDir}/${name}-config.mjs`;\n\n return {\n bundleOutput: output,\n getConfig: () => import(pathToFileURL(configPath).href).then(m => m[name] as MastraConfig[T]),\n };\n }\n\n return null;\n}\n","import type { IMastraLogger } from '@mastra/core/logger';\nimport type { Config } from '@mastra/core/mastra';\nimport { extractMastraOption, extractMastraOptionBundler } from './shared/extract-mastra-option';\n\nexport function getBundlerOptionsBundler(\n entryFile: string,\n result: {\n hasCustomConfig: false;\n },\n) {\n return extractMastraOptionBundler('bundler', entryFile, result);\n}\n\nexport async function getBundlerOptions(\n entryFile: string,\n outputDir: string,\n logger?: IMastraLogger,\n): Promise<Config['bundler'] | null> {\n const result = await extractMastraOption('bundler', entryFile, outputDir, logger);\n\n if (!result) {\n return null;\n }\n\n return result.getConfig();\n}\n"],"mappings":";;;;;;;;;;;;;AAKA,SAAgB,iCACd,QACA,QACA,QACc;CACd,OAAO;EACL,MAAM,uBAAuB,SAAS;EACtC,SAAS;GACP,wBAAwB,EAKtB,KAAK,MAAM;IACT,IAAI,KAAK,KAAK,aAAa;KACzB,MAAM,CAAC,eAAe,KAAK,YAAY,KAAK,KAAK,WAAW;KAG5D,YAAY,KAAK;IACnB,OACE,KAAK,OAAO;GAEhB,EACF;GAEA,cAAc,MAAM,OAAO;IAGzB,IAAI,CADsB,KAAK,YAAW,SAAQA,MAAE,qBAAqB,KAAK,IAAI,CAC7D,GACnB;IAGF,MAAM,aAAa,KAAK,WAAW;IAEnC,IAAI,CAACA,MAAE,qBAAqB,UAAU,KAAK,CAACA,MAAE,aAAa,WAAW,EAAE,KAAK,WAAW,GAAG,SAAS,UAClG;IAGF,IAAI,aAAaA,MAAE,iBAAiB,CAAC,CAAC;IACtC,IAAIA,MAAE,mBAAmB,KAAK,KAAK,UAAU,EAAE,GAC7C,aAAa,KAAK,KAAK,UAAU;IAInC,IAAI,iBAAiB,WAAW,WAAW,MACzC,SAAQA,MAAE,iBAAi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WAAW,MAAM;CAEhF,IAAI,CAAC,QACH,OAAO;CAGT,OAAO,OAAO,UAAU;AAC1B"}
@@ -3,7 +3,7 @@ name: mastra-deployer
3
3
  description: Documentation for @mastra/deployer. Use when working with @mastra/deployer APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/deployer"
6
- version: "1.79.0-alpha.1"
6
+ version: "1.79.0-alpha.3"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.79.0-alpha.1",
2
+ "version": "1.79.0-alpha.3",
3
3
  "package": "@mastra/deployer",
4
4
  "exports": {},
5
5
  "modules": {}
package/dist/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_services = require("./services-D_V7afWX.cjs");
3
- const require_bundlerOptions = require("./bundlerOptions-BtMp_x-T.cjs");
2
+ const require_services = require("./services-BQNEW5XJ.cjs");
3
+ const require_bundlerOptions = require("./bundlerOptions-BA9vxjZt.cjs");
4
4
  const require_bundler_index = require("./bundler/index.cjs");
5
- require("./build-DGJW5-aB.cjs");
5
+ require("./build-Bdncb817.cjs");
6
6
  //#region src/deploy/base.ts
7
7
  var Deployer = class extends require_bundler_index.Bundler {
8
8
  deps = new require_services.DepsService();
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { a as createChildProcessLogger, i as DepsService, o as createPinoStream, r as Deps, t as FileService } from "./services-DXqmEy8F.js";
2
- import { n as extractMastraOption } from "./bundlerOptions-ID9i-l8I.js";
1
+ import { c as createPinoStream, i as DepsService, r as Deps, s as createChildProcessLogger, t as FileService } from "./services-PUoAjxMD.js";
2
+ import { n as extractMastraOption } from "./bundlerOptions-DpvO59QF.js";
3
3
  import { Bundler } from "./bundler/index.js";
4
- import "./build-CNYwIKPG.js";
4
+ import "./build-C8gia-n5.js";
5
5
  //#region src/deploy/base.ts
6
6
  var Deployer = class extends Bundler {
7
7
  deps = new DepsService();