@mastra/deployer 1.50.2-alpha.1 → 1.51.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/build/analyze.cjs +2 -2
  3. package/dist/build/analyze.js +1 -1
  4. package/dist/build/bundler.cjs +5 -5
  5. package/dist/build/bundler.js +1 -1
  6. package/dist/build/index.cjs +19 -19
  7. package/dist/build/index.js +4 -4
  8. package/dist/build/plugins/local-storage-detector.d.ts +34 -6
  9. package/dist/build/plugins/local-storage-detector.d.ts.map +1 -1
  10. package/dist/bundler/index.cjs +3 -3
  11. package/dist/bundler/index.js +1 -1
  12. package/dist/{chunk-WIOL4WMZ.js → chunk-2P62SP4K.js} +3 -3
  13. package/dist/{chunk-WIOL4WMZ.js.map → chunk-2P62SP4K.js.map} +1 -1
  14. package/dist/{chunk-6ARGMWNC.js → chunk-B3NI3FBK.js} +116 -10
  15. package/dist/chunk-B3NI3FBK.js.map +1 -0
  16. package/dist/{chunk-R7M4BT5P.cjs → chunk-ETXDK7YK.cjs} +21 -21
  17. package/dist/{chunk-R7M4BT5P.cjs.map → chunk-ETXDK7YK.cjs.map} +1 -1
  18. package/dist/{chunk-ILNCPWNL.cjs → chunk-ICEWJMSM.cjs} +7 -7
  19. package/dist/{chunk-ILNCPWNL.cjs.map → chunk-ICEWJMSM.cjs.map} +1 -1
  20. package/dist/{chunk-YODVBOD3.cjs → chunk-JQLVR7F7.cjs} +12 -12
  21. package/dist/{chunk-YODVBOD3.cjs.map → chunk-JQLVR7F7.cjs.map} +1 -1
  22. package/dist/{chunk-GGNUZ2A6.js → chunk-OAWAFG4V.js} +5 -5
  23. package/dist/{chunk-GGNUZ2A6.js.map → chunk-OAWAFG4V.js.map} +1 -1
  24. package/dist/{chunk-JODIXW4D.js → chunk-RJWPICH3.js} +5 -5
  25. package/dist/{chunk-JODIXW4D.js.map → chunk-RJWPICH3.js.map} +1 -1
  26. package/dist/{chunk-2GJY6H6M.cjs → chunk-RVRIXED5.cjs} +116 -10
  27. package/dist/chunk-RVRIXED5.cjs.map +1 -0
  28. package/dist/{chunk-VQGZXTOJ.cjs → chunk-TPS3GZO7.cjs} +11 -11
  29. package/dist/{chunk-VQGZXTOJ.cjs.map → chunk-TPS3GZO7.cjs.map} +1 -1
  30. package/dist/{chunk-UA2DJWFT.js → chunk-WCHVXVD5.js} +3 -3
  31. package/dist/{chunk-UA2DJWFT.js.map → chunk-WCHVXVD5.js.map} +1 -1
  32. package/dist/docs/SKILL.md +1 -1
  33. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  34. package/dist/index.cjs +4 -4
  35. package/dist/index.js +2 -2
  36. package/package.json +8 -8
  37. package/dist/chunk-2GJY6H6M.cjs.map +0 -1
  38. package/dist/chunk-6ARGMWNC.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @mastra/deployer
2
2
 
3
+ ## 1.51.0-alpha.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixed a false-positive LOCAL_STORAGE_PATH preflight error that flagged storage paths like `file:./data.db` that don't exist in your project. The deploy bundler's local-storage detector now excludes everything under `.mastra/.build/` (deployer-generated intermediate chunks), not just `@mastra__*` shim files. Those chunks can carry JSDoc examples from library code (for example `LibSQLStore({ url: 'file:./data.db' })` from `@mastra/core`), which previously blocked `mastra server deploy` and forced `--skip-preflight` even though the user's code had no local storage paths. Local storage paths in your own source files are still detected. ([#19071](https://github.com/mastra-ai/mastra/pull/19071))
8
+
9
+ - Fixed deploy preflight false positives for env-guarded storage fallbacks. The build now records when a local storage path like `file:./.mastra-demo.db` is only used as a fallback behind an environment variable (for example `process.env.TURSO_DATABASE_URL || "file:./.mastra-demo.db"`), and which environment variables your own code reads, so the deploy preflight can tell dead fallbacks and library-internal variables apart from real problems. ([#19071](https://github.com/mastra-ai/mastra/pull/19071))
10
+
11
+ Also fixed another source of false `LOCAL_STORAGE_PATH` errors: dependencies installed via symlinks (pnpm `link:`/`file:`) resolve to paths outside `node_modules` and are no longer treated as your code.
12
+
13
+ - Updated dependencies [[`e955965`](https://github.com/mastra-ai/mastra/commit/e955965dce575a903e37cf054d28ea99aa48785e), [`860ef7e`](https://github.com/mastra-ai/mastra/commit/860ef7e77d92b63469cbe5857aa1e626197e43e9), [`17e818c`](https://github.com/mastra-ai/mastra/commit/17e818c51a958ba90641b1a959dc38faf8c034e9), [`4451dfe`](https://github.com/mastra-ai/mastra/commit/4451dfe857428e7abcc0261a507a2e186dae6d47), [`1d39058`](https://github.com/mastra-ai/mastra/commit/1d39058e548efd691799985d5c8af2737f1c3bd2)]:
14
+ - @mastra/core@1.51.0-alpha.2
15
+ - @mastra/server@1.51.0-alpha.2
16
+
3
17
  ## 1.50.2-alpha.1
4
18
 
5
19
  ### Patch Changes
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkR7M4BT5P_cjs = require('../chunk-R7M4BT5P.cjs');
3
+ var chunkETXDK7YK_cjs = require('../chunk-ETXDK7YK.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "analyzeBundle", {
8
8
  enumerable: true,
9
- get: function () { return chunkR7M4BT5P_cjs.analyzeBundle; }
9
+ get: function () { return chunkETXDK7YK_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-WIOL4WMZ.js';
1
+ export { analyzeBundle } from '../chunk-2P62SP4K.js';
2
2
  //# sourceMappingURL=analyze.js.map
3
3
  //# sourceMappingURL=analyze.js.map
@@ -1,24 +1,24 @@
1
1
  'use strict';
2
2
 
3
- var chunk2GJY6H6M_cjs = require('../chunk-2GJY6H6M.cjs');
3
+ var chunkRVRIXED5_cjs = require('../chunk-RVRIXED5.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "createBundler", {
8
8
  enumerable: true,
9
- get: function () { return chunk2GJY6H6M_cjs.createBundler; }
9
+ get: function () { return chunkRVRIXED5_cjs.createBundler; }
10
10
  });
11
11
  Object.defineProperty(exports, "getInputOptions", {
12
12
  enumerable: true,
13
- get: function () { return chunk2GJY6H6M_cjs.getInputOptions; }
13
+ get: function () { return chunkRVRIXED5_cjs.getInputOptions; }
14
14
  });
15
15
  Object.defineProperty(exports, "mastraInternalAliasPlugin", {
16
16
  enumerable: true,
17
- get: function () { return chunk2GJY6H6M_cjs.mastraInternalAliasPlugin; }
17
+ get: function () { return chunkRVRIXED5_cjs.mastraInternalAliasPlugin; }
18
18
  });
19
19
  Object.defineProperty(exports, "mastraToolsAliasPlugin", {
20
20
  enumerable: true,
21
- get: function () { return chunk2GJY6H6M_cjs.mastraToolsAliasPlugin; }
21
+ get: function () { return chunkRVRIXED5_cjs.mastraToolsAliasPlugin; }
22
22
  });
23
23
  //# sourceMappingURL=bundler.cjs.map
24
24
  //# sourceMappingURL=bundler.cjs.map
@@ -1,3 +1,3 @@
1
- export { createBundler, getInputOptions, mastraInternalAliasPlugin, mastraToolsAliasPlugin } from '../chunk-6ARGMWNC.js';
1
+ export { createBundler, getInputOptions, mastraInternalAliasPlugin, mastraToolsAliasPlugin } from '../chunk-B3NI3FBK.js';
2
2
  //# sourceMappingURL=bundler.js.map
3
3
  //# sourceMappingURL=bundler.js.map
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkYODVBOD3_cjs = require('../chunk-YODVBOD3.cjs');
4
- var chunkILNCPWNL_cjs = require('../chunk-ILNCPWNL.cjs');
5
- var chunkR7M4BT5P_cjs = require('../chunk-R7M4BT5P.cjs');
6
- var chunk2GJY6H6M_cjs = require('../chunk-2GJY6H6M.cjs');
3
+ var chunkJQLVR7F7_cjs = require('../chunk-JQLVR7F7.cjs');
4
+ var chunkICEWJMSM_cjs = require('../chunk-ICEWJMSM.cjs');
5
+ var chunkETXDK7YK_cjs = require('../chunk-ETXDK7YK.cjs');
6
+ var chunkRVRIXED5_cjs = require('../chunk-RVRIXED5.cjs');
7
7
  var chunkVKAFARW6_cjs = require('../chunk-VKAFARW6.cjs');
8
8
  var chunkJZRFRUGM_cjs = require('../chunk-JZRFRUGM.cjs');
9
9
 
@@ -11,63 +11,63 @@ var chunkJZRFRUGM_cjs = require('../chunk-JZRFRUGM.cjs');
11
11
 
12
12
  Object.defineProperty(exports, "createWatcher", {
13
13
  enumerable: true,
14
- get: function () { return chunkYODVBOD3_cjs.createWatcher; }
14
+ get: function () { return chunkJQLVR7F7_cjs.createWatcher; }
15
15
  });
16
16
  Object.defineProperty(exports, "discoverFsAgents", {
17
17
  enumerable: true,
18
- get: function () { return chunkYODVBOD3_cjs.discoverFsAgents; }
18
+ get: function () { return chunkJQLVR7F7_cjs.discoverFsAgents; }
19
19
  });
20
20
  Object.defineProperty(exports, "discoverFsSingleton", {
21
21
  enumerable: true,
22
- get: function () { return chunkYODVBOD3_cjs.discoverFsSingleton; }
22
+ get: function () { return chunkJQLVR7F7_cjs.discoverFsSingleton; }
23
23
  });
24
24
  Object.defineProperty(exports, "discoverFsWorkflows", {
25
25
  enumerable: true,
26
- get: function () { return chunkYODVBOD3_cjs.discoverFsWorkflows; }
26
+ get: function () { return chunkJQLVR7F7_cjs.discoverFsWorkflows; }
27
27
  });
28
28
  Object.defineProperty(exports, "generateFsAgentsModule", {
29
29
  enumerable: true,
30
- get: function () { return chunkYODVBOD3_cjs.generateFsAgentsModule; }
30
+ get: function () { return chunkJQLVR7F7_cjs.generateFsAgentsModule; }
31
31
  });
32
32
  Object.defineProperty(exports, "generateFsWorkflowsCodegen", {
33
33
  enumerable: true,
34
- get: function () { return chunkYODVBOD3_cjs.generateFsWorkflowsCodegen; }
34
+ get: function () { return chunkJQLVR7F7_cjs.generateFsWorkflowsCodegen; }
35
35
  });
36
36
  Object.defineProperty(exports, "getServerOptions", {
37
37
  enumerable: true,
38
- get: function () { return chunkYODVBOD3_cjs.getServerOptions; }
38
+ get: function () { return chunkJQLVR7F7_cjs.getServerOptions; }
39
39
  });
40
40
  Object.defineProperty(exports, "getWatcherInputOptions", {
41
41
  enumerable: true,
42
- get: function () { return chunkYODVBOD3_cjs.getInputOptions; }
42
+ get: function () { return chunkJQLVR7F7_cjs.getInputOptions; }
43
43
  });
44
44
  Object.defineProperty(exports, "mirrorFsAgentWorkspaces", {
45
45
  enumerable: true,
46
- get: function () { return chunkYODVBOD3_cjs.mirrorFsAgentWorkspaces; }
46
+ get: function () { return chunkJQLVR7F7_cjs.mirrorFsAgentWorkspaces; }
47
47
  });
48
48
  Object.defineProperty(exports, "prepareFsAgentsEntry", {
49
49
  enumerable: true,
50
- get: function () { return chunkYODVBOD3_cjs.prepareFsAgentsEntry; }
50
+ get: function () { return chunkJQLVR7F7_cjs.prepareFsAgentsEntry; }
51
51
  });
52
52
  Object.defineProperty(exports, "writeFsAgentsEntry", {
53
53
  enumerable: true,
54
- get: function () { return chunkYODVBOD3_cjs.writeFsAgentsEntry; }
54
+ get: function () { return chunkJQLVR7F7_cjs.writeFsAgentsEntry; }
55
55
  });
56
56
  Object.defineProperty(exports, "getBundlerOptions", {
57
57
  enumerable: true,
58
- get: function () { return chunkILNCPWNL_cjs.getBundlerOptions; }
58
+ get: function () { return chunkICEWJMSM_cjs.getBundlerOptions; }
59
59
  });
60
60
  Object.defineProperty(exports, "analyzeBundle", {
61
61
  enumerable: true,
62
- get: function () { return chunkR7M4BT5P_cjs.analyzeBundle; }
62
+ get: function () { return chunkETXDK7YK_cjs.analyzeBundle; }
63
63
  });
64
64
  Object.defineProperty(exports, "createBundler", {
65
65
  enumerable: true,
66
- get: function () { return chunk2GJY6H6M_cjs.createBundler; }
66
+ get: function () { return chunkRVRIXED5_cjs.createBundler; }
67
67
  });
68
68
  Object.defineProperty(exports, "getBundlerInputOptions", {
69
69
  enumerable: true,
70
- get: function () { return chunk2GJY6H6M_cjs.getInputOptions; }
70
+ get: function () { return chunkRVRIXED5_cjs.getInputOptions; }
71
71
  });
72
72
  Object.defineProperty(exports, "Deps", {
73
73
  enumerable: true,
@@ -1,7 +1,7 @@
1
- export { createWatcher, discoverFsAgents, discoverFsSingleton, discoverFsWorkflows, generateFsAgentsModule, generateFsWorkflowsCodegen, getServerOptions, getInputOptions as getWatcherInputOptions, mirrorFsAgentWorkspaces, prepareFsAgentsEntry, writeFsAgentsEntry } from '../chunk-GGNUZ2A6.js';
2
- export { getBundlerOptions } from '../chunk-UA2DJWFT.js';
3
- export { analyzeBundle } from '../chunk-WIOL4WMZ.js';
4
- export { createBundler, getInputOptions as getBundlerInputOptions } from '../chunk-6ARGMWNC.js';
1
+ export { createWatcher, discoverFsAgents, discoverFsSingleton, discoverFsWorkflows, generateFsAgentsModule, generateFsWorkflowsCodegen, getServerOptions, getInputOptions as getWatcherInputOptions, mirrorFsAgentWorkspaces, prepareFsAgentsEntry, writeFsAgentsEntry } from '../chunk-OAWAFG4V.js';
2
+ export { getBundlerOptions } from '../chunk-WCHVXVD5.js';
3
+ export { analyzeBundle } from '../chunk-2P62SP4K.js';
4
+ export { createBundler, getInputOptions as getBundlerInputOptions } from '../chunk-B3NI3FBK.js';
5
5
  export { Deps, FileService } from '../chunk-ZL66GDLP.js';
6
6
  export { detectRuntime, escapeStudioHtmlValue, injectStudioHtmlConfig, normalizeStudioBase } from '../chunk-WP65JQAT.js';
7
7
  //# sourceMappingURL=index.js.map
@@ -3,20 +3,48 @@ export interface LocalStorageDetection {
3
3
  value: string;
4
4
  hint: string;
5
5
  module: string;
6
+ /**
7
+ * Name of the env var that guards this literal at runtime, when the
8
+ * literal is the fallback arm of a `process.env.X || literal` (or `??`)
9
+ * expression. The CLI preflight uses this to suppress or soften the
10
+ * error when the guarding var is present in the deploy env.
11
+ */
12
+ guardedBy?: string;
13
+ }
14
+ /**
15
+ * Unified preflight metadata emitted as `preflight-metadata.json`.
16
+ * Superset of the legacy `preflight-local-paths.json` (which stays emitted
17
+ * for one release so older CLIs keep working with newer deployers).
18
+ */
19
+ export interface PreflightMetadata {
20
+ version: 1;
21
+ localPaths: LocalStorageDetection[];
22
+ userEnvRefs: string[];
6
23
  }
7
24
  /**
8
25
  * Rollup plugin that detects host-local storage URLs (e.g. `file:./mastra.db`,
9
- * `postgres://localhost`) in **user source modules** during bundling.
26
+ * `postgres://localhost`) in **user source modules** during bundling, and
27
+ * collects the env vars user code reads via `process.env.X`.
10
28
  *
11
29
  * Only modules outside `node_modules` (and the deployer's own
12
- * `.mastra/.build/@mastra__*` shim files) are inspected, so library code
30
+ * `.mastra/.build/` pre-bundled files) are inspected, so library code
13
31
  * (like Agent Builder prompt templates or JSDoc examples in `@mastra/core`)
14
- * is naturally excluded. Tree-shaken modules are excluded via
32
+ * is naturally excluded. When `rootDir` is given, modules outside it are
33
+ * also excluded — symlinked dependencies (pnpm `link:`/`file:`) resolve to
34
+ * real paths that never contain `node_modules`. Tree-shaken modules are
35
+ * excluded via
15
36
  * `generateBundle` — only modules that actually contribute rendered code to
16
37
  * the output are reported.
17
38
  *
18
- * Detected paths are emitted as `preflight-local-paths.json` in the output
19
- * directory for the CLI preflight check to consume.
39
+ * When a detected literal is the fallback arm of a `process.env.X || literal`
40
+ * expression, `guardedBy: "X"` is recorded so the CLI preflight can apply
41
+ * deploy-time env context instead of hard-erroring on a dead fallback.
42
+ *
43
+ * Two assets are emitted into the output directory for the CLI preflight:
44
+ * - `preflight-metadata.json` — unified metadata (local paths + user env refs)
45
+ * - `preflight-local-paths.json` — legacy shape, kept for one release so an
46
+ * older globally-installed CLI paired with a newer project-local deployer
47
+ * doesn't lose the LOCAL_STORAGE_PATH check.
20
48
  */
21
- export declare function localStorageDetector(): Plugin;
49
+ export declare function localStorageDetector(rootDir?: string): Plugin;
22
50
  //# sourceMappingURL=local-storage-detector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"local-storage-detector.d.ts","sourceRoot":"","sources":["../../../src/build/plugins/local-storage-detector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAqBrC,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAWD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAuD7C"}
1
+ {"version":3,"file":"local-storage-detector.d.ts","sourceRoot":"","sources":["../../../src/build/plugins/local-storage-detector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAqBrC,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,EAAE,qBAAqB,EAAE,CAAC;IACpC,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAgID;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAuG7D"}
@@ -1,16 +1,16 @@
1
1
  'use strict';
2
2
 
3
- var chunkVQGZXTOJ_cjs = require('../chunk-VQGZXTOJ.cjs');
3
+ var chunkTPS3GZO7_cjs = require('../chunk-TPS3GZO7.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "Bundler", {
8
8
  enumerable: true,
9
- get: function () { return chunkVQGZXTOJ_cjs.Bundler; }
9
+ get: function () { return chunkTPS3GZO7_cjs.Bundler; }
10
10
  });
11
11
  Object.defineProperty(exports, "IS_DEFAULT", {
12
12
  enumerable: true,
13
- get: function () { return chunkVQGZXTOJ_cjs.IS_DEFAULT; }
13
+ get: function () { return chunkTPS3GZO7_cjs.IS_DEFAULT; }
14
14
  });
15
15
  //# sourceMappingURL=index.cjs.map
16
16
  //# sourceMappingURL=index.cjs.map
@@ -1,3 +1,3 @@
1
- export { Bundler, IS_DEFAULT } from '../chunk-JODIXW4D.js';
1
+ export { Bundler, IS_DEFAULT } from '../chunk-RJWPICH3.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { getPackageMetadata, protocolExternalResolver, mastraInternalAliasPlugin, mastraToolsAliasPlugin, tsConfigPaths, esbuild, removeDeployer, getPackageRootPath, subpathExternalsResolver, esmShim } from './chunk-6ARGMWNC.js';
1
+ import { getPackageMetadata, protocolExternalResolver, mastraInternalAliasPlugin, mastraToolsAliasPlugin, tsConfigPaths, esbuild, removeDeployer, getPackageRootPath, subpathExternalsResolver, esmShim } from './chunk-B3NI3FBK.js';
2
2
  import { slash, isDependencyPartOfPackage, getPackageName, isBuiltinModule, isBareModuleSpecifier, isExternalProtocolImport, getCompiledDepCachePath, rollupSafeName, getNodeResolveOptions } from './chunk-WP65JQAT.js';
3
3
  import { existsSync } from 'fs';
4
4
  import { readFile, writeFile } from 'fs/promises';
@@ -1504,5 +1504,5 @@ async function analyzeBundle(entries, mastraEntry, {
1504
1504
  }
1505
1505
 
1506
1506
  export { aliasHono, analyzeBundle, getWorkspaceInformation };
1507
- //# sourceMappingURL=chunk-WIOL4WMZ.js.map
1508
- //# sourceMappingURL=chunk-WIOL4WMZ.js.map
1507
+ //# sourceMappingURL=chunk-2P62SP4K.js.map
1508
+ //# sourceMappingURL=chunk-2P62SP4K.js.map