@mastra/deployer 1.33.1-alpha.0 → 1.33.1-alpha.1

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 (53) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/build/analyze.cjs +2 -2
  3. package/dist/build/analyze.js +1 -1
  4. package/dist/build/bundler.cjs +3 -3
  5. package/dist/build/bundler.js +1 -1
  6. package/dist/build/index.cjs +21 -21
  7. package/dist/build/index.js +5 -5
  8. package/dist/build/utils.d.ts +1 -0
  9. package/dist/build/utils.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-QTRSKNOJ.cjs → chunk-3T7FP546.cjs} +3 -2
  13. package/dist/chunk-3T7FP546.cjs.map +1 -0
  14. package/dist/{chunk-623NUWWK.js → chunk-4SSB2KSK.js} +3 -2
  15. package/dist/chunk-4SSB2KSK.js.map +1 -0
  16. package/dist/{chunk-D5QDTUSF.cjs → chunk-5TILMGJA.cjs} +49 -49
  17. package/dist/{chunk-D5QDTUSF.cjs.map → chunk-5TILMGJA.cjs.map} +1 -1
  18. package/dist/{chunk-BGHYAAUQ.cjs → chunk-AQL6MQFJ.cjs} +18 -18
  19. package/dist/{chunk-BGHYAAUQ.cjs.map → chunk-AQL6MQFJ.cjs.map} +1 -1
  20. package/dist/{chunk-R45J7TDH.js → chunk-FXJXKXAV.js} +3 -3
  21. package/dist/{chunk-R45J7TDH.js.map → chunk-FXJXKXAV.js.map} +1 -1
  22. package/dist/{chunk-JS4W622U.js → chunk-ISGGMBYN.js} +7 -7
  23. package/dist/{chunk-JS4W622U.js.map → chunk-ISGGMBYN.js.map} +1 -1
  24. package/dist/{chunk-5CIZPQD7.js → chunk-KAY3R5QX.js} +3 -3
  25. package/dist/{chunk-5CIZPQD7.js.map → chunk-KAY3R5QX.js.map} +1 -1
  26. package/dist/{chunk-7OOWEFCB.cjs → chunk-KBVOYAAL.cjs} +7 -7
  27. package/dist/{chunk-7OOWEFCB.cjs.map → chunk-KBVOYAAL.cjs.map} +1 -1
  28. package/dist/{chunk-AEFF4KNF.js → chunk-KTL22PW6.js} +7 -7
  29. package/dist/{chunk-AEFF4KNF.js.map → chunk-KTL22PW6.js.map} +1 -1
  30. package/dist/{chunk-KLSYVMVY.cjs → chunk-RJXYP6DA.cjs} +17 -17
  31. package/dist/{chunk-KLSYVMVY.cjs.map → chunk-RJXYP6DA.cjs.map} +1 -1
  32. package/dist/{chunk-QJIDGPHH.cjs → chunk-XABHWJ5U.cjs} +16 -16
  33. package/dist/{chunk-QJIDGPHH.cjs.map → chunk-XABHWJ5U.cjs.map} +1 -1
  34. package/dist/{chunk-WRKEX2X3.js → chunk-YHEVEEDG.js} +4 -4
  35. package/dist/{chunk-WRKEX2X3.js.map → chunk-YHEVEEDG.js.map} +1 -1
  36. package/dist/{chunk-4WS47OHX.cjs → chunk-YW7AIVNG.cjs} +5 -5
  37. package/dist/{chunk-4WS47OHX.cjs.map → chunk-YW7AIVNG.cjs.map} +1 -1
  38. package/dist/{chunk-MLMAPMI3.js → chunk-ZUJ4DO5D.js} +4 -4
  39. package/dist/{chunk-MLMAPMI3.js.map → chunk-ZUJ4DO5D.js.map} +1 -1
  40. package/dist/docs/SKILL.md +1 -1
  41. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  42. package/dist/index.cjs +4 -4
  43. package/dist/index.js +2 -2
  44. package/dist/server/index.cjs +6 -4
  45. package/dist/server/index.cjs.map +1 -1
  46. package/dist/server/index.d.ts.map +1 -1
  47. package/dist/server/index.js +3 -1
  48. package/dist/server/index.js.map +1 -1
  49. package/dist/validator/custom-resolver.cjs +3 -3
  50. package/dist/validator/custom-resolver.js +1 -1
  51. package/package.json +7 -7
  52. package/dist/chunk-623NUWWK.js.map +0 -1
  53. package/dist/chunk-QTRSKNOJ.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @mastra/deployer
2
2
 
3
+ ## 1.33.1-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Make the playground/Studio chat runtime opt into the agent-signals streaming path (`sendSignal` + `subscribeToThread`) via the `MASTRA_AGENT_SIGNALS` environment variable. When unset (the default), Studio falls back to the existing `streamUntilIdle` route — this restores the pre-signals behavior while issues with tool approvals and dropped signal/UI messages are fixed. ([#16551](https://github.com/mastra-ai/mastra/pull/16551))
8
+
9
+ - Updated dependencies [[`3e63fca`](https://github.com/mastra-ai/mastra/commit/3e63fca7aa41269b2a9518effdd09b8ab8f1ff04), [`bc386e0`](https://github.com/mastra-ai/mastra/commit/bc386e08249dd30f3e66cf59de0c151a8dc26afb)]:
10
+ - @mastra/core@1.33.1-alpha.1
11
+ - @mastra/server@1.33.1-alpha.1
12
+
3
13
  ## 1.33.1-alpha.0
4
14
 
5
15
  ### Patch Changes
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkD5QDTUSF_cjs = require('../chunk-D5QDTUSF.cjs');
3
+ var chunk5TILMGJA_cjs = require('../chunk-5TILMGJA.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "analyzeBundle", {
8
8
  enumerable: true,
9
- get: function () { return chunkD5QDTUSF_cjs.analyzeBundle; }
9
+ get: function () { return chunk5TILMGJA_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-MLMAPMI3.js';
1
+ export { analyzeBundle } from '../chunk-ZUJ4DO5D.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 chunkBGHYAAUQ_cjs = require('../chunk-BGHYAAUQ.cjs');
3
+ var chunkAQL6MQFJ_cjs = require('../chunk-AQL6MQFJ.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "createBundler", {
8
8
  enumerable: true,
9
- get: function () { return chunkBGHYAAUQ_cjs.createBundler; }
9
+ get: function () { return chunkAQL6MQFJ_cjs.createBundler; }
10
10
  });
11
11
  Object.defineProperty(exports, "getInputOptions", {
12
12
  enumerable: true,
13
- get: function () { return chunkBGHYAAUQ_cjs.getInputOptions; }
13
+ get: function () { return chunkAQL6MQFJ_cjs.getInputOptions; }
14
14
  });
15
15
  //# sourceMappingURL=bundler.cjs.map
16
16
  //# sourceMappingURL=bundler.cjs.map
@@ -1,3 +1,3 @@
1
- export { createBundler, getInputOptions } from '../chunk-WRKEX2X3.js';
1
+ export { createBundler, getInputOptions } from '../chunk-YHEVEEDG.js';
2
2
  //# sourceMappingURL=bundler.js.map
3
3
  //# sourceMappingURL=bundler.js.map
@@ -1,61 +1,61 @@
1
1
  'use strict';
2
2
 
3
- var chunkQJIDGPHH_cjs = require('../chunk-QJIDGPHH.cjs');
4
- var chunk7OOWEFCB_cjs = require('../chunk-7OOWEFCB.cjs');
5
- var chunkD5QDTUSF_cjs = require('../chunk-D5QDTUSF.cjs');
3
+ var chunkXABHWJ5U_cjs = require('../chunk-XABHWJ5U.cjs');
4
+ var chunkKBVOYAAL_cjs = require('../chunk-KBVOYAAL.cjs');
5
+ var chunk5TILMGJA_cjs = require('../chunk-5TILMGJA.cjs');
6
+ var chunkAQL6MQFJ_cjs = require('../chunk-AQL6MQFJ.cjs');
6
7
  var chunkQJGW77MV_cjs = require('../chunk-QJGW77MV.cjs');
7
- var chunkBGHYAAUQ_cjs = require('../chunk-BGHYAAUQ.cjs');
8
- var chunkQTRSKNOJ_cjs = require('../chunk-QTRSKNOJ.cjs');
8
+ var chunk3T7FP546_cjs = require('../chunk-3T7FP546.cjs');
9
9
 
10
10
 
11
11
 
12
12
  Object.defineProperty(exports, "createWatcher", {
13
13
  enumerable: true,
14
- get: function () { return chunkQJIDGPHH_cjs.createWatcher; }
14
+ get: function () { return chunkXABHWJ5U_cjs.createWatcher; }
15
15
  });
16
16
  Object.defineProperty(exports, "getServerOptions", {
17
17
  enumerable: true,
18
- get: function () { return chunkQJIDGPHH_cjs.getServerOptions; }
18
+ get: function () { return chunkXABHWJ5U_cjs.getServerOptions; }
19
19
  });
20
20
  Object.defineProperty(exports, "getWatcherInputOptions", {
21
21
  enumerable: true,
22
- get: function () { return chunkQJIDGPHH_cjs.getInputOptions; }
22
+ get: function () { return chunkXABHWJ5U_cjs.getInputOptions; }
23
23
  });
24
24
  Object.defineProperty(exports, "getBundlerOptions", {
25
25
  enumerable: true,
26
- get: function () { return chunk7OOWEFCB_cjs.getBundlerOptions; }
26
+ get: function () { return chunkKBVOYAAL_cjs.getBundlerOptions; }
27
27
  });
28
28
  Object.defineProperty(exports, "analyzeBundle", {
29
29
  enumerable: true,
30
- get: function () { return chunkD5QDTUSF_cjs.analyzeBundle; }
30
+ get: function () { return chunk5TILMGJA_cjs.analyzeBundle; }
31
31
  });
32
- Object.defineProperty(exports, "Deps", {
32
+ Object.defineProperty(exports, "createBundler", {
33
33
  enumerable: true,
34
- get: function () { return chunkQJGW77MV_cjs.Deps; }
34
+ get: function () { return chunkAQL6MQFJ_cjs.createBundler; }
35
35
  });
36
- Object.defineProperty(exports, "FileService", {
36
+ Object.defineProperty(exports, "getBundlerInputOptions", {
37
37
  enumerable: true,
38
- get: function () { return chunkQJGW77MV_cjs.FileService; }
38
+ get: function () { return chunkAQL6MQFJ_cjs.getInputOptions; }
39
39
  });
40
- Object.defineProperty(exports, "createBundler", {
40
+ Object.defineProperty(exports, "Deps", {
41
41
  enumerable: true,
42
- get: function () { return chunkBGHYAAUQ_cjs.createBundler; }
42
+ get: function () { return chunkQJGW77MV_cjs.Deps; }
43
43
  });
44
- Object.defineProperty(exports, "getBundlerInputOptions", {
44
+ Object.defineProperty(exports, "FileService", {
45
45
  enumerable: true,
46
- get: function () { return chunkBGHYAAUQ_cjs.getInputOptions; }
46
+ get: function () { return chunkQJGW77MV_cjs.FileService; }
47
47
  });
48
48
  Object.defineProperty(exports, "detectRuntime", {
49
49
  enumerable: true,
50
- get: function () { return chunkQTRSKNOJ_cjs.detectRuntime; }
50
+ get: function () { return chunk3T7FP546_cjs.detectRuntime; }
51
51
  });
52
52
  Object.defineProperty(exports, "injectStudioHtmlConfig", {
53
53
  enumerable: true,
54
- get: function () { return chunkQTRSKNOJ_cjs.injectStudioHtmlConfig; }
54
+ get: function () { return chunk3T7FP546_cjs.injectStudioHtmlConfig; }
55
55
  });
56
56
  Object.defineProperty(exports, "normalizeStudioBase", {
57
57
  enumerable: true,
58
- get: function () { return chunkQTRSKNOJ_cjs.normalizeStudioBase; }
58
+ get: function () { return chunk3T7FP546_cjs.normalizeStudioBase; }
59
59
  });
60
60
  //# sourceMappingURL=index.cjs.map
61
61
  //# sourceMappingURL=index.cjs.map
@@ -1,8 +1,8 @@
1
- export { createWatcher, getServerOptions, getInputOptions as getWatcherInputOptions } from '../chunk-AEFF4KNF.js';
2
- export { getBundlerOptions } from '../chunk-R45J7TDH.js';
3
- export { analyzeBundle } from '../chunk-MLMAPMI3.js';
1
+ export { createWatcher, getServerOptions, getInputOptions as getWatcherInputOptions } from '../chunk-KTL22PW6.js';
2
+ export { getBundlerOptions } from '../chunk-FXJXKXAV.js';
3
+ export { analyzeBundle } from '../chunk-ZUJ4DO5D.js';
4
+ export { createBundler, getInputOptions as getBundlerInputOptions } from '../chunk-YHEVEEDG.js';
4
5
  export { Deps, FileService } from '../chunk-I7JM5EHU.js';
5
- export { createBundler, getInputOptions as getBundlerInputOptions } from '../chunk-WRKEX2X3.js';
6
- export { detectRuntime, injectStudioHtmlConfig, normalizeStudioBase } from '../chunk-623NUWWK.js';
6
+ export { detectRuntime, injectStudioHtmlConfig, normalizeStudioBase } from '../chunk-4SSB2KSK.js';
7
7
  //# sourceMappingURL=index.js.map
8
8
  //# sourceMappingURL=index.js.map
@@ -111,6 +111,7 @@ export interface StudioInjectionConfig {
111
111
  telemetryDisabled: string;
112
112
  requestContextPresets: string;
113
113
  experimentalUI: string;
114
+ agentSignals: string;
114
115
  autoDetectUrl?: string;
115
116
  }
116
117
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/build/utils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAE5E,kDAAkD;AAClD,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,KAAK,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;AAE7D;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,eAAe,GAAG,wBAAwB,CAYzF;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,IAAI,eAAe,CAK/C;AAED,wBAAgB,eAAe,CAAC,EAAE,GAAmB,EAAE,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,QAOxE;AAED,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,WAMzE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,sBAQxC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAO5D;AAID;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,MAAM,EACjB,WAAW,GAAE,SAAS,MAAM,EAAyC,GACpE,OAAO,CAMT;AAUD;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,UAE5E;AAED;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,UAQjC;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAU3D;AAcD;;;;;;;;;;;;;GAaG;AACH,wBAAg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oBAAoB,EAAE,MAAM,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,qBAAqB,GAAG,MAAM,CAmB1F;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAM1D;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAkBhE"}
@@ -1,16 +1,16 @@
1
1
  'use strict';
2
2
 
3
- var chunkKLSYVMVY_cjs = require('../chunk-KLSYVMVY.cjs');
3
+ var chunkRJXYP6DA_cjs = require('../chunk-RJXYP6DA.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "Bundler", {
8
8
  enumerable: true,
9
- get: function () { return chunkKLSYVMVY_cjs.Bundler; }
9
+ get: function () { return chunkRJXYP6DA_cjs.Bundler; }
10
10
  });
11
11
  Object.defineProperty(exports, "IS_DEFAULT", {
12
12
  enumerable: true,
13
- get: function () { return chunkKLSYVMVY_cjs.IS_DEFAULT; }
13
+ get: function () { return chunkRJXYP6DA_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-JS4W622U.js';
1
+ export { Bundler, IS_DEFAULT } from '../chunk-ISGGMBYN.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
@@ -105,6 +105,7 @@ function injectStudioHtmlConfig(html, config) {
105
105
  html = html.replace(`'%%MASTRA_TELEMETRY_DISABLED%%'`, config.telemetryDisabled);
106
106
  html = html.replace(`'%%MASTRA_REQUEST_CONTEXT_PRESETS%%'`, config.requestContextPresets);
107
107
  html = html.replace(`'%%MASTRA_EXPERIMENTAL_UI%%'`, config.experimentalUI);
108
+ html = html.replace(`'%%MASTRA_AGENT_SIGNALS%%'`, config.agentSignals);
108
109
  if (config.autoDetectUrl) {
109
110
  html = html.replace(`'%%MASTRA_AUTO_DETECT_URL%%'`, config.autoDetectUrl);
110
111
  }
@@ -142,5 +143,5 @@ exports.isExternalProtocolImport = isExternalProtocolImport;
142
143
  exports.normalizeStudioBase = normalizeStudioBase;
143
144
  exports.rollupSafeName = rollupSafeName;
144
145
  exports.slash = slash;
145
- //# sourceMappingURL=chunk-QTRSKNOJ.cjs.map
146
- //# sourceMappingURL=chunk-QTRSKNOJ.cjs.map
146
+ //# sourceMappingURL=chunk-3T7FP546.cjs.map
147
+ //# sourceMappingURL=chunk-3T7FP546.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/build/utils.ts"],"names":["join","relative","basename","builtinModules"],"mappings":";;;;;;AA0BO,SAAS,sBAAsB,QAAA,EAAqD;AACzF,EAAA,IAAI,aAAa,SAAA,EAAW;AAC1B,IAAA,OAAO;AAAA,MACL,cAAA,EAAgB,KAAA;AAAA,MAChB,OAAA,EAAS,IAAA;AAAA,MACT,gBAAA,EAAkB,CAAC,SAAA,EAAW,QAAA,EAAU,SAAS;AAAA,KACnD;AAAA,EACF;AACA,EAAA,OAAO;AAAA,IACL,cAAA,EAAgB,IAAA;AAAA,IAChB,gBAAA,EAAkB,CAAC,MAAM;AAAA,GAC3B;AACF;AASO,SAAS,aAAA,GAAiC;AAC/C,EAAA,IAAI,OAAA,CAAQ,UAAU,GAAA,EAAK;AACzB,IAAA,OAAO,KAAA;AAAA,EACT;AACA,EAAA,OAAO,MAAA;AACT;AAWO,SAAS,yBAAA,CAA0B,KAAa,WAAA,EAAqB;AAC1E,EAAA,IAAI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I,yBAAA,CAA0B,SAAS,CAAA,IAAK,uBAAA,CAAwB,SAAS,CAAA,EAAG;AAC9E,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,IAAI,eAAA,CAAgB,SAAS,CAAA,EAAG;AAC9B,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,IAAI,wBAAA,CAAyB,SAAS,CAAA,EAAG;AACvC,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,OAAO,IAAA;AACT","file":"chunk-3T7FP546.cjs","sourcesContent":["import { execSync } from 'node:child_process';\nimport { existsSync, mkdirSync } from 'node:fs';\nimport { builtinModules } from 'node:module';\nimport { basename, join, relative } from 'node:path';\nimport type { RollupNodeResolveOptions } from '@rollup/plugin-node-resolve';\n\n/** The detected JavaScript runtime environment */\nexport type RuntimePlatform = 'node' | 'bun';\n\n/**\n * The esbuild/bundler platform setting.\n * - 'node': Assumes Node.js environment, externalizes built-in modules\n * - 'browser': Assumes browser environment, polyfills Node APIs\n * - 'neutral': Runtime-agnostic, preserves all globals as-is (used for Bun)\n */\nexport type BundlerPlatform = 'node' | 'browser' | 'neutral';\n\n/**\n * Get nodeResolve plugin options based on the target platform.\n *\n * For 'browser' platform (e.g., Cloudflare Workers), uses browser-compatible\n * export conditions so packages like the Cloudflare SDK resolve to their\n * web runtime instead of Node.js-specific code.\n *\n * For 'node' and 'neutral' (Bun) platforms, uses Node.js module resolution.\n */\nexport function getNodeResolveOptions(platform: BundlerPlatform): RollupNodeResolveOptions {\n if (platform === 'browser') {\n return {\n preferBuiltins: false,\n browser: true,\n exportConditions: ['browser', 'worker', 'default'],\n };\n }\n return {\n preferBuiltins: true,\n exportConditions: ['node'],\n };\n}\n\n/**\n * Detect the current JavaScript runtime environment.\n *\n * This is used by the bundler to determine the appropriate esbuild platform\n * setting. When running under Bun, we need to use 'neutral' platform to\n * preserve Bun-specific globals (like Bun.s3).\n */\nexport function detectRuntime(): RuntimePlatform {\n if (process.versions?.bun) {\n return 'bun';\n }\n return 'node';\n}\n\nexport function upsertMastraDir({ dir = process.cwd() }: { dir?: string }) {\n const dirPath = join(dir, '.mastra');\n\n if (!existsSync(dirPath)) {\n mkdirSync(dirPath, { recursive: true });\n execSync(`echo \".mastra\" >> .gitignore`);\n }\n}\n\nexport function isDependencyPartOfPackage(dep: string, packageName: string) {\n if (dep === packageName) {\n return true;\n }\n\n return dep.startsWith(`${packageName}/`);\n}\n\n/**\n * Get the package name from a module ID\n */\nexport function getPackageName(id: string) {\n const parts = id.split('/');\n\n if (id.startsWith('@')) {\n return parts.slice(0, 2).join('/');\n }\n\n return parts[0];\n}\n\n/**\n * Check if an import specifier uses a protocol scheme rather than a package name.\n * Examples: `cloudflare:workers`, `data:text/javascript,...`, `node:fs`.\n */\nexport function hasImportProtocol(specifier: string): boolean {\n // Avoid treating Windows absolute paths like `C:\\foo` as protocol imports.\n if (/^[A-Za-z]:[\\\\/]/.test(specifier)) {\n return false;\n }\n\n return /^[A-Za-z][A-Za-z\\d+.-]*:/.test(specifier);\n}\n\nconst DEFAULT_PROTOCOL_IMPORT_EXCLUDE_LIST = ['node:'] as const;\n\n/**\n * Check if a specifier uses a non-builtin protocol that should be preserved at\n * runtime instead of being treated as an installable dependency.\n */\nexport function isExternalProtocolImport(\n specifier: string,\n excludeList: readonly string[] = DEFAULT_PROTOCOL_IMPORT_EXCLUDE_LIST,\n): boolean {\n if (!hasImportProtocol(specifier)) {\n return false;\n }\n\n return !excludeList.some(prefix => specifier.startsWith(prefix));\n}\n\nfunction isRelativeImportSpecifier(specifier: string): boolean {\n return specifier === '.' || specifier === '..' || specifier.startsWith('./') || specifier.startsWith('../');\n}\n\nfunction isAbsolutePathSpecifier(specifier: string): boolean {\n return specifier.startsWith('/') || specifier.startsWith('\\\\\\\\') || /^[A-Za-z]:[\\\\/]/.test(specifier);\n}\n\n/**\n * During `mastra dev` we are compiling TS files to JS (inside workspaces) so that users can just their workspace packages.\n * We store these compiled files inside `node_modules/.cache` for each workspace package.\n */\nexport function getCompiledDepCachePath(rootPath: string, packageName: string) {\n return slash(join(rootPath, 'node_modules', '.cache', packageName));\n}\n\n/**\n * Convert windows backslashes to posix slashes\n *\n * @example\n * ```ts\n * slash('C:\\\\Users\\\\user\\\\code\\\\mastra') // 'C:/Users/user/code/mastra'\n * ```\n */\nexport function slash(path: string) {\n const isExtendedLengthPath = path.startsWith('\\\\\\\\?\\\\');\n\n if (isExtendedLengthPath) {\n return path;\n }\n\n return path.replaceAll('\\\\', '/');\n}\n\n/**\n * Make a Rollup-safe name: pathless, POSIX, and without parent/absolute segments\n */\nexport function rollupSafeName(name: string, rootDir: string) {\n const rel = relative(rootDir, name);\n let entry = slash(rel);\n entry = entry.replace(/^(\\.\\.\\/)+/, '');\n entry = entry.replace(/^\\/+/, '');\n entry = entry.replace(/^[A-Za-z]:\\//, '');\n if (!entry) {\n entry = slash(basename(name));\n }\n return entry;\n}\n\n/**\n * Native binding loaders and infrastructure packages that should be ignored when identifying the actual package that requires native bindings\n */\nconst NATIVE_BINDING_LOADERS = [\n 'node-gyp-build',\n 'prebuild-install',\n 'bindings',\n 'node-addon-api',\n 'node-pre-gyp',\n 'nan', // Native Abstractions for Node.js\n] as const;\n\n/**\n * Finds the first real package from node_modules that likely contains native bindings, filtering out virtual modules and native binding loader infrastructure.\n *\n * @param moduleIds - Array of module IDs from a Rollup chunk\n * @returns The module ID of the actual native package, or undefined if not found\n *\n * @example\n * const moduleIds = [\n * '\\x00/path/node_modules/bcrypt/bcrypt.js?commonjs-module',\n * '/path/node_modules/node-gyp-build/index.js',\n * '/path/node_modules/bcrypt/bcrypt.js',\n * ];\n * findNativePackageModule(moduleIds); // Returns '/path/node_modules/bcrypt/bcrypt.js'\n */\nexport function findNativePackageModule(moduleIds: string[]): string | undefined {\n return moduleIds.find(id => {\n // Skip virtual modules (Rollup plugin-generated)\n if (id.startsWith('\\x00')) {\n return false;\n }\n\n // Must be from node_modules\n if (!id.includes('/node_modules/')) {\n return false;\n }\n\n // Skip native binding loader infrastructure\n for (const loader of NATIVE_BINDING_LOADERS) {\n if (id.includes(`/${loader}/`) || id.includes(`/${loader}@`)) {\n return false;\n }\n }\n\n return true;\n });\n}\n\n/**\n * Ensures that server.studioBase is normalized:\n * - Adds leading slash if missing (e.g., 'admin' → '/admin')\n * - Removes trailing slashes (e.g., '/admin/' → '/admin')\n * - Normalizes multiple slashes to single slash (e.g., '//api' → '/api')\n * - Returns empty string for root paths ('/' or '')\n *\n * @param studioBase - The studioBase path to normalize\n * @returns Normalized studioBase path string\n * @throws Error if path contains invalid characters ('..', '?', '#')\n */\nexport function normalizeStudioBase(studioBase: string): string {\n studioBase = studioBase.trim();\n\n // Validate: no path traversal, no query params, no special chars\n if (studioBase.includes('..') || studioBase.includes('?') || studioBase.includes('#')) {\n throw new Error(`Invalid base path: \"${studioBase}\". Base path cannot contain '..', '?', or '#'`);\n }\n\n // Normalize multiple slashes to single slash\n studioBase = studioBase.replace(/\\/+/g, '/');\n\n // Handle default value cases\n if (studioBase === '/' || studioBase === '') {\n return '';\n }\n\n // Remove trailing slash\n if (studioBase.endsWith('/')) {\n studioBase = studioBase.slice(0, -1);\n }\n\n // Add leading slash if missing\n if (!studioBase.startsWith('/')) {\n studioBase = `/${studioBase}`;\n }\n\n return studioBase;\n}\n\n/**\n * Configuration values for Studio's index.html placeholder injection.\n *\n * Each value is the **exact JavaScript expression** that replaces the\n * corresponding `'%%PLACEHOLDER%%'` token (including surrounding quotes).\n *\n * For literal strings pass `\"'value'\"` (quoted).\n * For runtime expressions pass the raw JS, e.g. `\"window.location.hostname\"`.\n */\nexport interface StudioInjectionConfig {\n host: string;\n port: string;\n protocol: string;\n apiPrefix: string;\n basePath: string;\n hideCloudCta: string;\n cloudApiEndpoint: string;\n experimentalFeatures: string;\n templates: string;\n telemetryDisabled: string;\n requestContextPresets: string;\n experimentalUI: string;\n agentSignals: string;\n autoDetectUrl?: string;\n}\n\n/**\n * Replace all `%%MASTRA_*%%` placeholders in the Studio `index.html` with the\n * supplied configuration values.\n *\n * The `<base href>` tag and the `window.MASTRA_STUDIO_BASE_PATH` assignment\n * use `basePath` as a plain string (no surrounding quotes), while all other\n * placeholders replace `'%%TOKEN%%'` (with surrounding single-quotes in the\n * source HTML) with the provided expression verbatim.\n */\nexport function injectStudioHtmlConfig(html: string, config: StudioInjectionConfig): string {\n html = html.replace(`'%%MASTRA_SERVER_HOST%%'`, config.host);\n html = html.replace(`'%%MASTRA_SERVER_PORT%%'`, config.port);\n html = html.replace(`'%%MASTRA_SERVER_PROTOCOL%%'`, config.protocol);\n html = html.replace(`'%%MASTRA_API_PREFIX%%'`, config.apiPrefix);\n html = html.replace(`'%%MASTRA_HIDE_CLOUD_CTA%%'`, config.hideCloudCta);\n html = html.replace(`'%%MASTRA_CLOUD_API_ENDPOINT%%'`, config.cloudApiEndpoint);\n html = html.replace(`'%%MASTRA_EXPERIMENTAL_FEATURES%%'`, config.experimentalFeatures);\n html = html.replace(`'%%MASTRA_TEMPLATES%%'`, config.templates);\n html = html.replace(`'%%MASTRA_TELEMETRY_DISABLED%%'`, config.telemetryDisabled);\n html = html.replace(`'%%MASTRA_REQUEST_CONTEXT_PRESETS%%'`, config.requestContextPresets);\n html = html.replace(`'%%MASTRA_EXPERIMENTAL_UI%%'`, config.experimentalUI);\n html = html.replace(`'%%MASTRA_AGENT_SIGNALS%%'`, config.agentSignals);\n if (config.autoDetectUrl) {\n html = html.replace(`'%%MASTRA_AUTO_DETECT_URL%%'`, config.autoDetectUrl);\n }\n html = html.replaceAll('%%MASTRA_STUDIO_BASE_PATH%%', config.basePath);\n\n return html;\n}\n\n/**\n * Check if a module is a Node.js builtin module\n * @param specifier - Module specifier\n * @returns True if it's a builtin module\n */\nexport function isBuiltinModule(specifier: string): boolean {\n return (\n builtinModules.includes(specifier) ||\n specifier.startsWith('node:') ||\n builtinModules.includes(specifier.replace(/^node:/, ''))\n );\n}\n\n/**\n * Check whether a module specifier is a bare module import rather than a path,\n * virtual module, or Node builtin.\n */\nexport function isBareModuleSpecifier(specifier: string): boolean {\n if (!specifier || specifier.startsWith('#')) {\n return false;\n }\n\n if (isRelativeImportSpecifier(specifier) || isAbsolutePathSpecifier(specifier)) {\n return false;\n }\n\n if (isBuiltinModule(specifier)) {\n return false;\n }\n\n if (isExternalProtocolImport(specifier)) {\n return false;\n }\n\n return true;\n}\n"]}
@@ -103,6 +103,7 @@ function injectStudioHtmlConfig(html, config) {
103
103
  html = html.replace(`'%%MASTRA_TELEMETRY_DISABLED%%'`, config.telemetryDisabled);
104
104
  html = html.replace(`'%%MASTRA_REQUEST_CONTEXT_PRESETS%%'`, config.requestContextPresets);
105
105
  html = html.replace(`'%%MASTRA_EXPERIMENTAL_UI%%'`, config.experimentalUI);
106
+ html = html.replace(`'%%MASTRA_AGENT_SIGNALS%%'`, config.agentSignals);
106
107
  if (config.autoDetectUrl) {
107
108
  html = html.replace(`'%%MASTRA_AUTO_DETECT_URL%%'`, config.autoDetectUrl);
108
109
  }
@@ -129,5 +130,5 @@ function isBareModuleSpecifier(specifier) {
129
130
  }
130
131
 
131
132
  export { detectRuntime, getCompiledDepCachePath, getNodeResolveOptions, getPackageName, injectStudioHtmlConfig, isBareModuleSpecifier, isBuiltinModule, isDependencyPartOfPackage, isExternalProtocolImport, normalizeStudioBase, rollupSafeName, slash };
132
- //# sourceMappingURL=chunk-623NUWWK.js.map
133
- //# sourceMappingURL=chunk-623NUWWK.js.map
133
+ //# sourceMappingURL=chunk-4SSB2KSK.js.map
134
+ //# sourceMappingURL=chunk-4SSB2KSK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/build/utils.ts"],"names":[],"mappings":";;;;AA0BO,SAAS,sBAAsB,QAAA,EAAqD;AACzF,EAAA,IAAI,aAAa,SAAA,EAAW;AAC1B,IAAA,OAAO;AAAA,MACL,cAAA,EAAgB,KAAA;AAAA,MAChB,OAAA,EAAS,IAAA;AAAA,MACT,gBAAA,EAAkB,CAAC,SAAA,EAAW,QAAA,EAAU,SAAS;AAAA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A,CAAS,SAAS,CAAA,IACjC,UAAU,UAAA,CAAW,OAAO,CAAA,IAC5B,cAAA,CAAe,QAAA,CAAS,SAAA,CAAU,OAAA,CAAQ,QAAA,EAAU,EAAE,CAAC,CAAA;AAE3D;AAMO,SAAS,sBAAsB,SAAA,EAA4B;AAChE,EAAA,IAAI,CAAC,SAAA,IAAa,SAAA,CAAU,UAAA,CAAW,GAAG,CAAA,EAAG;AAC3C,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,IAAI,yBAAA,CAA0B,SAAS,CAAA,IAAK,uBAAA,CAAwB,SAAS,CAAA,EAAG;AAC9E,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,IAAI,eAAA,CAAgB,SAAS,CAAA,EAAG;AAC9B,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,IAAI,wBAAA,CAAyB,SAAS,CAAA,EAAG;AACvC,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,OAAO,IAAA;AACT","file":"chunk-4SSB2KSK.js","sourcesContent":["import { execSync } from 'node:child_process';\nimport { existsSync, mkdirSync } from 'node:fs';\nimport { builtinModules } from 'node:module';\nimport { basename, join, relative } from 'node:path';\nimport type { RollupNodeResolveOptions } from '@rollup/plugin-node-resolve';\n\n/** The detected JavaScript runtime environment */\nexport type RuntimePlatform = 'node' | 'bun';\n\n/**\n * The esbuild/bundler platform setting.\n * - 'node': Assumes Node.js environment, externalizes built-in modules\n * - 'browser': Assumes browser environment, polyfills Node APIs\n * - 'neutral': Runtime-agnostic, preserves all globals as-is (used for Bun)\n */\nexport type BundlerPlatform = 'node' | 'browser' | 'neutral';\n\n/**\n * Get nodeResolve plugin options based on the target platform.\n *\n * For 'browser' platform (e.g., Cloudflare Workers), uses browser-compatible\n * export conditions so packages like the Cloudflare SDK resolve to their\n * web runtime instead of Node.js-specific code.\n *\n * For 'node' and 'neutral' (Bun) platforms, uses Node.js module resolution.\n */\nexport function getNodeResolveOptions(platform: BundlerPlatform): RollupNodeResolveOptions {\n if (platform === 'browser') {\n return {\n preferBuiltins: false,\n browser: true,\n exportConditions: ['browser', 'worker', 'default'],\n };\n }\n return {\n preferBuiltins: true,\n exportConditions: ['node'],\n };\n}\n\n/**\n * Detect the current JavaScript runtime environment.\n *\n * This is used by the bundler to determine the appropriate esbuild platform\n * setting. When running under Bun, we need to use 'neutral' platform to\n * preserve Bun-specific globals (like Bun.s3).\n */\nexport function detectRuntime(): RuntimePlatform {\n if (process.versions?.bun) {\n return 'bun';\n }\n return 'node';\n}\n\nexport function upsertMastraDir({ dir = process.cwd() }: { dir?: string }) {\n const dirPath = join(dir, '.mastra');\n\n if (!existsSync(dirPath)) {\n mkdirSync(dirPath, { recursive: true });\n execSync(`echo \".mastra\" >> .gitignore`);\n }\n}\n\nexport function isDependencyPartOfPackage(dep: string, packageName: string) {\n if (dep === packageName) {\n return true;\n }\n\n return dep.startsWith(`${packageName}/`);\n}\n\n/**\n * Get the package name from a module ID\n */\nexport function getPackageName(id: string) {\n const parts = id.split('/');\n\n if (id.startsWith('@')) {\n return parts.slice(0, 2).join('/');\n }\n\n return parts[0];\n}\n\n/**\n * Check if an import specifier uses a protocol scheme rather than a package name.\n * Examples: `cloudflare:workers`, `data:text/javascript,...`, `node:fs`.\n */\nexport function hasImportProtocol(specifier: string): boolean {\n // Avoid treating Windows absolute paths like `C:\\foo` as protocol imports.\n if (/^[A-Za-z]:[\\\\/]/.test(specifier)) {\n return false;\n }\n\n return /^[A-Za-z][A-Za-z\\d+.-]*:/.test(specifier);\n}\n\nconst DEFAULT_PROTOCOL_IMPORT_EXCLUDE_LIST = ['node:'] as const;\n\n/**\n * Check if a specifier uses a non-builtin protocol that should be preserved at\n * runtime instead of being treated as an installable dependency.\n */\nexport function isExternalProtocolImport(\n specifier: string,\n excludeList: readonly string[] = DEFAULT_PROTOCOL_IMPORT_EXCLUDE_LIST,\n): boolean {\n if (!hasImportProtocol(specifier)) {\n return false;\n }\n\n return !excludeList.some(prefix => specifier.startsWith(prefix));\n}\n\nfunction isRelativeImportSpecifier(specifier: string): boolean {\n return specifier === '.' || specifier === '..' || specifier.startsWith('./') || specifier.startsWith('../');\n}\n\nfunction isAbsolutePathSpecifier(specifier: string): boolean {\n return specifier.startsWith('/') || specifier.startsWith('\\\\\\\\') || /^[A-Za-z]:[\\\\/]/.test(specifier);\n}\n\n/**\n * During `mastra dev` we are compiling TS files to JS (inside workspaces) so that users can just their workspace packages.\n * We store these compiled files inside `node_modules/.cache` for each workspace package.\n */\nexport function getCompiledDepCachePath(rootPath: string, packageName: string) {\n return slash(join(rootPath, 'node_modules', '.cache', packageName));\n}\n\n/**\n * Convert windows backslashes to posix slashes\n *\n * @example\n * ```ts\n * slash('C:\\\\Users\\\\user\\\\code\\\\mastra') // 'C:/Users/user/code/mastra'\n * ```\n */\nexport function slash(path: string) {\n const isExtendedLengthPath = path.startsWith('\\\\\\\\?\\\\');\n\n if (isExtendedLengthPath) {\n return path;\n }\n\n return path.replaceAll('\\\\', '/');\n}\n\n/**\n * Make a Rollup-safe name: pathless, POSIX, and without parent/absolute segments\n */\nexport function rollupSafeName(name: string, rootDir: string) {\n const rel = relative(rootDir, name);\n let entry = slash(rel);\n entry = entry.replace(/^(\\.\\.\\/)+/, '');\n entry = entry.replace(/^\\/+/, '');\n entry = entry.replace(/^[A-Za-z]:\\//, '');\n if (!entry) {\n entry = slash(basename(name));\n }\n return entry;\n}\n\n/**\n * Native binding loaders and infrastructure packages that should be ignored when identifying the actual package that requires native bindings\n */\nconst NATIVE_BINDING_LOADERS = [\n 'node-gyp-build',\n 'prebuild-install',\n 'bindings',\n 'node-addon-api',\n 'node-pre-gyp',\n 'nan', // Native Abstractions for Node.js\n] as const;\n\n/**\n * Finds the first real package from node_modules that likely contains native bindings, filtering out virtual modules and native binding loader infrastructure.\n *\n * @param moduleIds - Array of module IDs from a Rollup chunk\n * @returns The module ID of the actual native package, or undefined if not found\n *\n * @example\n * const moduleIds = [\n * '\\x00/path/node_modules/bcrypt/bcrypt.js?commonjs-module',\n * '/path/node_modules/node-gyp-build/index.js',\n * '/path/node_modules/bcrypt/bcrypt.js',\n * ];\n * findNativePackageModule(moduleIds); // Returns '/path/node_modules/bcrypt/bcrypt.js'\n */\nexport function findNativePackageModule(moduleIds: string[]): string | undefined {\n return moduleIds.find(id => {\n // Skip virtual modules (Rollup plugin-generated)\n if (id.startsWith('\\x00')) {\n return false;\n }\n\n // Must be from node_modules\n if (!id.includes('/node_modules/')) {\n return false;\n }\n\n // Skip native binding loader infrastructure\n for (const loader of NATIVE_BINDING_LOADERS) {\n if (id.includes(`/${loader}/`) || id.includes(`/${loader}@`)) {\n return false;\n }\n }\n\n return true;\n });\n}\n\n/**\n * Ensures that server.studioBase is normalized:\n * - Adds leading slash if missing (e.g., 'admin' → '/admin')\n * - Removes trailing slashes (e.g., '/admin/' → '/admin')\n * - Normalizes multiple slashes to single slash (e.g., '//api' → '/api')\n * - Returns empty string for root paths ('/' or '')\n *\n * @param studioBase - The studioBase path to normalize\n * @returns Normalized studioBase path string\n * @throws Error if path contains invalid characters ('..', '?', '#')\n */\nexport function normalizeStudioBase(studioBase: string): string {\n studioBase = studioBase.trim();\n\n // Validate: no path traversal, no query params, no special chars\n if (studioBase.includes('..') || studioBase.includes('?') || studioBase.includes('#')) {\n throw new Error(`Invalid base path: \"${studioBase}\". Base path cannot contain '..', '?', or '#'`);\n }\n\n // Normalize multiple slashes to single slash\n studioBase = studioBase.replace(/\\/+/g, '/');\n\n // Handle default value cases\n if (studioBase === '/' || studioBase === '') {\n return '';\n }\n\n // Remove trailing slash\n if (studioBase.endsWith('/')) {\n studioBase = studioBase.slice(0, -1);\n }\n\n // Add leading slash if missing\n if (!studioBase.startsWith('/')) {\n studioBase = `/${studioBase}`;\n }\n\n return studioBase;\n}\n\n/**\n * Configuration values for Studio's index.html placeholder injection.\n *\n * Each value is the **exact JavaScript expression** that replaces the\n * corresponding `'%%PLACEHOLDER%%'` token (including surrounding quotes).\n *\n * For literal strings pass `\"'value'\"` (quoted).\n * For runtime expressions pass the raw JS, e.g. `\"window.location.hostname\"`.\n */\nexport interface StudioInjectionConfig {\n host: string;\n port: string;\n protocol: string;\n apiPrefix: string;\n basePath: string;\n hideCloudCta: string;\n cloudApiEndpoint: string;\n experimentalFeatures: string;\n templates: string;\n telemetryDisabled: string;\n requestContextPresets: string;\n experimentalUI: string;\n agentSignals: string;\n autoDetectUrl?: string;\n}\n\n/**\n * Replace all `%%MASTRA_*%%` placeholders in the Studio `index.html` with the\n * supplied configuration values.\n *\n * The `<base href>` tag and the `window.MASTRA_STUDIO_BASE_PATH` assignment\n * use `basePath` as a plain string (no surrounding quotes), while all other\n * placeholders replace `'%%TOKEN%%'` (with surrounding single-quotes in the\n * source HTML) with the provided expression verbatim.\n */\nexport function injectStudioHtmlConfig(html: string, config: StudioInjectionConfig): string {\n html = html.replace(`'%%MASTRA_SERVER_HOST%%'`, config.host);\n html = html.replace(`'%%MASTRA_SERVER_PORT%%'`, config.port);\n html = html.replace(`'%%MASTRA_SERVER_PROTOCOL%%'`, config.protocol);\n html = html.replace(`'%%MASTRA_API_PREFIX%%'`, config.apiPrefix);\n html = html.replace(`'%%MASTRA_HIDE_CLOUD_CTA%%'`, config.hideCloudCta);\n html = html.replace(`'%%MASTRA_CLOUD_API_ENDPOINT%%'`, config.cloudApiEndpoint);\n html = html.replace(`'%%MASTRA_EXPERIMENTAL_FEATURES%%'`, config.experimentalFeatures);\n html = html.replace(`'%%MASTRA_TEMPLATES%%'`, config.templates);\n html = html.replace(`'%%MASTRA_TELEMETRY_DISABLED%%'`, config.telemetryDisabled);\n html = html.replace(`'%%MASTRA_REQUEST_CONTEXT_PRESETS%%'`, config.requestContextPresets);\n html = html.replace(`'%%MASTRA_EXPERIMENTAL_UI%%'`, config.experimentalUI);\n html = html.replace(`'%%MASTRA_AGENT_SIGNALS%%'`, config.agentSignals);\n if (config.autoDetectUrl) {\n html = html.replace(`'%%MASTRA_AUTO_DETECT_URL%%'`, config.autoDetectUrl);\n }\n html = html.replaceAll('%%MASTRA_STUDIO_BASE_PATH%%', config.basePath);\n\n return html;\n}\n\n/**\n * Check if a module is a Node.js builtin module\n * @param specifier - Module specifier\n * @returns True if it's a builtin module\n */\nexport function isBuiltinModule(specifier: string): boolean {\n return (\n builtinModules.includes(specifier) ||\n specifier.startsWith('node:') ||\n builtinModules.includes(specifier.replace(/^node:/, ''))\n );\n}\n\n/**\n * Check whether a module specifier is a bare module import rather than a path,\n * virtual module, or Node builtin.\n */\nexport function isBareModuleSpecifier(specifier: string): boolean {\n if (!specifier || specifier.startsWith('#')) {\n return false;\n }\n\n if (isRelativeImportSpecifier(specifier) || isAbsolutePathSpecifier(specifier)) {\n return false;\n }\n\n if (isBuiltinModule(specifier)) {\n return false;\n }\n\n if (isExternalProtocolImport(specifier)) {\n return false;\n }\n\n return true;\n}\n"]}