@mastra/deployer 1.68.0-alpha.0 → 1.68.0-alpha.6

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 (115) hide show
  1. package/dist/_types/@hono_node-server/package.json +1 -0
  2. package/dist/_types/@mastra_hono/package.json +1 -0
  3. package/dist/{analyze-hp4aHpms.cjs → analyze-BC22OIkc.cjs} +109 -94
  4. package/dist/analyze-BC22OIkc.cjs.map +1 -0
  5. package/dist/{analyze-B5HY26Tt.js → analyze-D3eRdXC9.js} +107 -91
  6. package/dist/analyze-D3eRdXC9.js.map +1 -0
  7. package/dist/{arktype-aI7TBD0R-S0daSmHG.js → arktype-aI7TBD0R-BGjyzmsj.js} +2 -2
  8. package/dist/{arktype-aI7TBD0R-S0daSmHG.js.map → arktype-aI7TBD0R-BGjyzmsj.js.map} +1 -1
  9. package/dist/{arktype-aI7TBD0R-BuTX_Phx.cjs → arktype-aI7TBD0R-DCxjN6oF.cjs} +2 -2
  10. package/dist/{arktype-aI7TBD0R-BuTX_Phx.cjs.map → arktype-aI7TBD0R-DCxjN6oF.cjs.map} +1 -1
  11. package/dist/build/analyze/analyzeEntry.d.ts +3 -1
  12. package/dist/build/analyze/analyzeEntry.d.ts.map +1 -1
  13. package/dist/build/analyze/bundleExternals.d.ts.map +1 -1
  14. package/dist/build/analyze.cjs +1 -1
  15. package/dist/build/analyze.d.ts.map +1 -1
  16. package/dist/build/analyze.js +1 -1
  17. package/dist/build/bundler.cjs +2 -1
  18. package/dist/build/bundler.d.ts +10 -0
  19. package/dist/build/bundler.d.ts.map +1 -1
  20. package/dist/build/bundler.js +2 -2
  21. package/dist/build/index.cjs +6 -6
  22. package/dist/build/index.js +6 -6
  23. package/dist/build/package-info.d.ts +4 -0
  24. package/dist/build/package-info.d.ts.map +1 -1
  25. package/dist/build/plugins/tsconfig-paths.d.ts +2 -1
  26. package/dist/build/plugins/tsconfig-paths.d.ts.map +1 -1
  27. package/dist/{build-Boe3fe3L.js → build-C5eBQq1A.js} +6 -6
  28. package/dist/{build-Boe3fe3L.js.map → build-C5eBQq1A.js.map} +1 -1
  29. package/dist/{build-Dit9VFE2.cjs → build-D-GPvP7A.cjs} +6 -6
  30. package/dist/{build-Dit9VFE2.cjs.map → build-D-GPvP7A.cjs.map} +1 -1
  31. package/dist/bundler/index.cjs +29 -62
  32. package/dist/bundler/index.cjs.map +1 -1
  33. package/dist/bundler/index.d.ts +1 -11
  34. package/dist/bundler/index.d.ts.map +1 -1
  35. package/dist/bundler/index.js +30 -63
  36. package/dist/bundler/index.js.map +1 -1
  37. package/dist/bundler/workspaceDependencies.d.ts +1 -1
  38. package/dist/bundler/workspaceDependencies.d.ts.map +1 -1
  39. package/dist/{bundler-CzQiVHzN.js → bundler-CNFQP4Qm.js} +45 -10
  40. package/dist/bundler-CNFQP4Qm.js.map +1 -0
  41. package/dist/{bundler-BKf2S2r_.cjs → bundler-I4HUeik1.cjs} +55 -8
  42. package/dist/bundler-I4HUeik1.cjs.map +1 -0
  43. package/dist/{bundlerOptions-I2E5y2Wp.cjs → bundlerOptions-CkFbsVoE.cjs} +2 -2
  44. package/dist/{bundlerOptions-I2E5y2Wp.cjs.map → bundlerOptions-CkFbsVoE.cjs.map} +1 -1
  45. package/dist/{bundlerOptions-BSySFLb3.js → bundlerOptions-Dg4pdJsM.js} +2 -2
  46. package/dist/{bundlerOptions-BSySFLb3.js.map → bundlerOptions-Dg4pdJsM.js.map} +1 -1
  47. package/dist/core-D3wM1JKp.js +1159 -0
  48. package/dist/core-D3wM1JKp.js.map +1 -0
  49. package/dist/core-QL_X0T4Y.cjs +1159 -0
  50. package/dist/core-QL_X0T4Y.cjs.map +1 -0
  51. package/dist/docs/SKILL.md +1 -1
  52. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  53. package/dist/docs/references/docs-deployment-monorepo.md +2 -2
  54. package/dist/{effect-QlVUlMFu-tf02PTZR.cjs → effect-QlVUlMFu-B2nZ842E.cjs} +3 -3
  55. package/dist/{effect-QlVUlMFu-tf02PTZR.cjs.map → effect-QlVUlMFu-B2nZ842E.cjs.map} +1 -1
  56. package/dist/{effect-QlVUlMFu-BN-VJnMF.js → effect-QlVUlMFu-DbWuPaWV.js} +3 -3
  57. package/dist/{effect-QlVUlMFu-BN-VJnMF.js.map → effect-QlVUlMFu-DbWuPaWV.js.map} +1 -1
  58. package/dist/{esm-DZ1Siz1C.cjs → esm-Ai6osZ1a.cjs} +61 -50
  59. package/dist/esm-Ai6osZ1a.cjs.map +1 -0
  60. package/dist/{esm-B51vJPGv.js → esm-D-wYOO-S.js} +61 -50
  61. package/dist/esm-D-wYOO-S.js.map +1 -0
  62. package/dist/{index-CLddUTqr-eO-ae7Sx.js → index-CLddUTqr-BXqo9et4.js} +8 -8
  63. package/dist/{index-CLddUTqr-eO-ae7Sx.js.map → index-CLddUTqr-BXqo9et4.js.map} +1 -1
  64. package/dist/{index-CLddUTqr-DS5tJ3WV.cjs → index-CLddUTqr-DsGkVS-W.cjs} +8 -8
  65. package/dist/{index-CLddUTqr-DS5tJ3WV.cjs.map → index-CLddUTqr-DsGkVS-W.cjs.map} +1 -1
  66. package/dist/index.cjs +3 -3
  67. package/dist/index.js +3 -3
  68. package/dist/server/index.cjs +8 -8
  69. package/dist/server/index.cjs.map +1 -1
  70. package/dist/server/index.d.ts +2 -2
  71. package/dist/server/index.js +8 -8
  72. package/dist/server/index.js.map +1 -1
  73. package/dist/services/deps.d.ts +1 -1
  74. package/dist/services/deps.d.ts.map +1 -1
  75. package/dist/services/index.cjs +1 -1
  76. package/dist/services/index.js +1 -1
  77. package/dist/{services-BLvNG7v7.cjs → services-Beob47UW.cjs} +42 -23
  78. package/dist/services-Beob47UW.cjs.map +1 -0
  79. package/dist/{services-B9KRKBT-.js → services-Lm6PRS4D.js} +42 -23
  80. package/dist/services-Lm6PRS4D.js.map +1 -0
  81. package/dist/{sury-CWZTCd75-YUPbTtKO.cjs → sury-CWZTCd75-ChXu4j-p.cjs} +3 -3
  82. package/dist/{sury-CWZTCd75-YUPbTtKO.cjs.map → sury-CWZTCd75-ChXu4j-p.cjs.map} +1 -1
  83. package/dist/{sury-CWZTCd75-ClSNrMWF.js → sury-CWZTCd75-OKz7uWLi.js} +3 -3
  84. package/dist/{sury-CWZTCd75-ClSNrMWF.js.map → sury-CWZTCd75-OKz7uWLi.js.map} +1 -1
  85. package/dist/{typebox-Dei93FPO-CVSJ3SAf.js → typebox-Dei93FPO-C5ACKU09.js} +2 -2
  86. package/dist/{typebox-Dei93FPO-CVSJ3SAf.js.map → typebox-Dei93FPO-C5ACKU09.js.map} +1 -1
  87. package/dist/{typebox-Dei93FPO-BTBshlGz.cjs → typebox-Dei93FPO-KTtPU745.cjs} +2 -2
  88. package/dist/{typebox-Dei93FPO-BTBshlGz.cjs.map → typebox-Dei93FPO-KTtPU745.cjs.map} +1 -1
  89. package/dist/{utils-DYi43Kp4.js → utils-Bl3Lm7SI.js} +1 -2
  90. package/dist/{utils-DYi43Kp4.js.map → utils-Bl3Lm7SI.js.map} +1 -1
  91. package/dist/{utils-7WDNT3Ca.cjs → utils-Bsr_sEcH.cjs} +2 -2
  92. package/dist/{utils-7WDNT3Ca.cjs.map → utils-Bsr_sEcH.cjs.map} +1 -1
  93. package/dist/{valibot--1zFm7rT-Dn5WqdyK.cjs → valibot--1zFm7rT-BeX3W1HK.cjs} +3 -3
  94. package/dist/{valibot--1zFm7rT-Dn5WqdyK.cjs.map → valibot--1zFm7rT-BeX3W1HK.cjs.map} +1 -1
  95. package/dist/{valibot--1zFm7rT-BxcEC3Pu.js → valibot--1zFm7rT-BuVb-6oJ.js} +3 -3
  96. package/dist/{valibot--1zFm7rT-BxcEC3Pu.js.map → valibot--1zFm7rT-BuVb-6oJ.js.map} +1 -1
  97. package/dist/validator/custom-resolver.cjs +1 -1
  98. package/dist/validator/custom-resolver.js +1 -1
  99. package/dist/{zod-Bwrt9trS-Bd40XYOT.js → zod-Bwrt9trS-D5b1oyiT.js} +5 -5
  100. package/dist/{zod-Bwrt9trS-Bd40XYOT.js.map → zod-Bwrt9trS-D5b1oyiT.js.map} +1 -1
  101. package/dist/{zod-Bwrt9trS-Bi11nE9Q.cjs → zod-Bwrt9trS-DGQs9DWc.cjs} +5 -5
  102. package/dist/{zod-Bwrt9trS-Bi11nE9Q.cjs.map → zod-Bwrt9trS-DGQs9DWc.cjs.map} +1 -1
  103. package/package.json +15 -14
  104. package/dist/analyze-B5HY26Tt.js.map +0 -1
  105. package/dist/analyze-hp4aHpms.cjs.map +0 -1
  106. package/dist/bundler-BKf2S2r_.cjs.map +0 -1
  107. package/dist/bundler-CzQiVHzN.js.map +0 -1
  108. package/dist/core-D0wEgdn3.cjs +0 -790
  109. package/dist/core-D0wEgdn3.cjs.map +0 -1
  110. package/dist/core-DF65PJXc.js +0 -790
  111. package/dist/core-DF65PJXc.js.map +0 -1
  112. package/dist/esm-B51vJPGv.js.map +0 -1
  113. package/dist/esm-DZ1Siz1C.cjs.map +0 -1
  114. package/dist/services-B9KRKBT-.js.map +0 -1
  115. package/dist/services-BLvNG7v7.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"utils-DYi43Kp4.js","names":[],"sources":["../src/build/utils.ts"],"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\n/**\n * Whether the deployer should skip installing dependencies (and lockfile\n * generation) in the build output directory. Enabled by setting\n * MASTRA_BUILD_SKIP_INSTALL to \"true\" or \"1\". Useful for hermetic build\n * systems (e.g. Bazel) that supply node_modules externally and run in a\n * network-less sandbox where the output install would be redundant and fatal.\n */\nexport function shouldSkipInstall(): boolean {\n const value = process.env.MASTRA_BUILD_SKIP_INSTALL;\n return value === 'true' || value === '1';\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 signalsUI: string;\n organizationId: string;\n platformProjectId: string;\n platformObservabilityEndpoint: string;\n autoDetectUrl?: string;\n devServerInstanceId?: 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 // `String.prototype.replace`/`replaceAll` treat `$` sequences ($$, $&, $`,\n // $', $n) in the replacement string as special patterns. Config values are\n // dynamic (e.g. request context presets), so use a replacement function to\n // insert them verbatim.\n const replace = (token: string, value: string) => {\n html = html.replace(token, () => value);\n };\n\n replace(`'%%MASTRA_DEV_SERVER_INSTANCE_ID%%'`, config.devServerInstanceId ?? \"''\");\n replace(`'%%MASTRA_SERVER_HOST%%'`, config.host);\n replace(`'%%MASTRA_SERVER_PORT%%'`, config.port);\n replace(`'%%MASTRA_SERVER_PROTOCOL%%'`, config.protocol);\n replace(`'%%MASTRA_API_PREFIX%%'`, config.apiPrefix);\n replace(`'%%MASTRA_HIDE_CLOUD_CTA%%'`, config.hideCloudCta);\n replace(`'%%MASTRA_CLOUD_API_ENDPOINT%%'`, config.cloudApiEndpoint);\n replace(`'%%MASTRA_EXPERIMENTAL_FEATURES%%'`, config.experimentalFeatures);\n replace(`'%%MASTRA_TEMPLATES%%'`, config.templates);\n replace(`'%%MASTRA_TELEMETRY_DISABLED%%'`, config.telemetryDisabled);\n replace(`'%%MASTRA_REQUEST_CONTEXT_PRESETS%%'`, config.requestContextPresets);\n replace(`'%%MASTRA_EXPERIMENTAL_UI%%'`, config.experimentalUI);\n replace(`'%%MASTRA_AGENT_SIGNALS%%'`, config.agentSignals);\n replace(`'%%MASTRA_SIGNALS_UI%%'`, config.signalsUI);\n replace(`'%%MASTRA_ORGANIZATION_ID%%'`, config.organizationId);\n replace(`'%%MASTRA_PLATFORM_PROJECT_ID%%'`, config.platformProjectId);\n replace(`'%%MASTRA_PLATFORM_OBSERVABILITY_ENDPOINT%%'`, config.platformObservabilityEndpoint);\n if (config.autoDetectUrl) {\n 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 * Escape a dynamic value for embedding inside a single-quoted JavaScript\n * string literal in the Studio `index.html` (e.g. `window.X = '<value>'`).\n * Without it, an env-derived value containing `'` or `</script>` breaks out\n * of the literal and corrupts (or injects into) the served page.\n */\nexport function escapeStudioHtmlValue(value: string): string {\n return value\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/</g, '\\\\u003c')\n .replace(/>/g, '\\\\u003e')\n .replace(/\\u2028/g, '\\\\u2028')\n .replace(/\\u2029/g, '\\\\u2029');\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"],"mappings":";;;;;;;;;;;;;;AA0BA,SAAgB,sBAAsB,UAAqD;CACzF,IAAI,aAAa,WACf,OAAO;EACL,gBAAgB;EAChB,SAAS;EACT,kBAAkB;GAAC;GAAW;GAAU;EAAS;CACnD;CAEF,OAAO;EACL,gBAAgB;EAChB,kBAAkB,CAAC,MAAM;CAC3B;AACF;;;;;;;;AASA,SAAgB,gBAAiC;CAC/C,IAAI,QAAQ,UAAU,KACpB,OAAO;CAET,OAAO;AACT;;;;;;;;AASA,SAAgB,oBAA6B;CAC3C,MAAM,QAAQ,QAAQ,IAAI;CAC1B,OAAO,UAAU,UAAU,UAAU;AACvC;AAWA,SAAgB,0BAA0B,KAAa,aAAqB;CAC1E,IAAI,QAAQ,aACV,OAAO;CAGT,OAAO,IAAI,WAAW,GAAG,YAAY,EAAE;AACzC;;;;AAKA,SAAgB,eAAe,IAAY;CACzC,MAAM,QAAQ,GAAG,MAAM,GAAG;CAE1B,IAAI,GAAG,WAAW,GAAG,GACnB,OAAO,MAAM,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG;CAGnC,OAAO,MAAM;AACf;;;;;AAMA,SAAgB,kBAA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,MAAM,SAAS,CAAC,CACxB,QAAQ,MAAM,SAAS,CAAC,CACxB,QAAQ,WAAW,SAAS,CAAC,CAC7B,QAAQ,WAAW,SAAS;AACjC;;;;;;AAOA,SAAgB,gBAAgB,WAA4B;CAC1D,OACE,eAAe,SAAS,SAAS,KACjC,UAAU,WAAW,OAAO,KAC5B,eAAe,SAAS,UAAU,QAAQ,UAAU,EAAE,CAAC;AAE3D;;;;;AAMA,SAAgB,sBAAsB,WAA4B;CAChE,IAAI,CAAC,aAAa,UAAU,WAAW,GAAG,GACxC,OAAO;CAGT,IAAI,0BAA0B,SAAS,KAAK,wBAAwB,SAAS,GAC3E,OAAO;CAGT,IAAI,gBAAgB,SAAS,GAC3B,OAAO;CAGT,IAAI,yBAAyB,SAAS,GACpC,OAAO;CAGT,OAAO;AACT"}
1
+ {"version":3,"file":"utils-Bl3Lm7SI.js","names":[],"sources":["../src/build/utils.ts"],"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\n/**\n * Whether the deployer should skip installing dependencies (and lockfile\n * generation) in the build output directory. Enabled by setting\n * MASTRA_BUILD_SKIP_INSTALL to \"true\" or \"1\". Useful for hermetic build\n * systems (e.g. Bazel) that supply node_modules externally and run in a\n * network-less sandbox where the output install would be redundant and fatal.\n */\nexport function shouldSkipInstall(): boolean {\n const value = process.env.MASTRA_BUILD_SKIP_INSTALL;\n return value === 'true' || value === '1';\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 signalsUI: string;\n organizationId: string;\n platformProjectId: string;\n platformObservabilityEndpoint: string;\n autoDetectUrl?: string;\n devServerInstanceId?: 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 // `String.prototype.replace`/`replaceAll` treat `$` sequences ($$, $&, $`,\n // $', $n) in the replacement string as special patterns. Config values are\n // dynamic (e.g. request context presets), so use a replacement function to\n // insert them verbatim.\n const replace = (token: string, value: string) => {\n html = html.replace(token, () => value);\n };\n\n replace(`'%%MASTRA_DEV_SERVER_INSTANCE_ID%%'`, config.devServerInstanceId ?? \"''\");\n replace(`'%%MASTRA_SERVER_HOST%%'`, config.host);\n replace(`'%%MASTRA_SERVER_PORT%%'`, config.port);\n replace(`'%%MASTRA_SERVER_PROTOCOL%%'`, config.protocol);\n replace(`'%%MASTRA_API_PREFIX%%'`, config.apiPrefix);\n replace(`'%%MASTRA_HIDE_CLOUD_CTA%%'`, config.hideCloudCta);\n replace(`'%%MASTRA_CLOUD_API_ENDPOINT%%'`, config.cloudApiEndpoint);\n replace(`'%%MASTRA_EXPERIMENTAL_FEATURES%%'`, config.experimentalFeatures);\n replace(`'%%MASTRA_TEMPLATES%%'`, config.templates);\n replace(`'%%MASTRA_TELEMETRY_DISABLED%%'`, config.telemetryDisabled);\n replace(`'%%MASTRA_REQUEST_CONTEXT_PRESETS%%'`, config.requestContextPresets);\n replace(`'%%MASTRA_EXPERIMENTAL_UI%%'`, config.experimentalUI);\n replace(`'%%MASTRA_AGENT_SIGNALS%%'`, config.agentSignals);\n replace(`'%%MASTRA_SIGNALS_UI%%'`, config.signalsUI);\n replace(`'%%MASTRA_ORGANIZATION_ID%%'`, config.organizationId);\n replace(`'%%MASTRA_PLATFORM_PROJECT_ID%%'`, config.platformProjectId);\n replace(`'%%MASTRA_PLATFORM_OBSERVABILITY_ENDPOINT%%'`, config.platformObservabilityEndpoint);\n if (config.autoDetectUrl) {\n 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 * Escape a dynamic value for embedding inside a single-quoted JavaScript\n * string literal in the Studio `index.html` (e.g. `window.X = '<value>'`).\n * Without it, an env-derived value containing `'` or `</script>` breaks out\n * of the literal and corrupts (or injects into) the served page.\n */\nexport function escapeStudioHtmlValue(value: string): string {\n return value\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/</g, '\\\\u003c')\n .replace(/>/g, '\\\\u003e')\n .replace(/\\u2028/g, '\\\\u2028')\n .replace(/\\u2029/g, '\\\\u2029');\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"],"mappings":";;;;;;;;;;;;;AA0BA,SAAgB,sBAAsB,UAAqD;CACzF,IAAI,aAAa,WACf,OAAO;EACL,gBAAgB;EAChB,SAAS;EACT,kBAAkB;GAAC;GAAW;GAAU;EAAS;CACnD;CAEF,OAAO;EACL,gBAAgB;EAChB,kBAAkB,CAAC,MAAM;CAC3B;AACF;;;;;;;;AASA,SAAgB,gBAAiC;CAC/C,IAAI,QAAQ,UAAU,KACpB,OAAO;CAET,OAAO;AACT;;;;;;;;AASA,SAAgB,oBAA6B;CAC3C,MAAM,QAAQ,QAAQ,IAAI;CAC1B,OAAO,UAAU,UAAU,UAAU;AACvC;AAWA,SAAgB,0BAA0B,KAAa,aAAqB;CAC1E,IAAI,QAAQ,aACV,OAAO;CAGT,OAAO,IAAI,WAAW,GAAG,YAAY,EAAE;AACzC;;;;AAKA,SAAgB,eAAe,IAAY;CACzC,MAAM,QAAQ,GAAG,MAAM,GAAG;CAE1B,IAAI,GAAG,WAAW,GAAG,GACnB,OAAO,MAAM,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG;CAGnC,OAAO,MAAM;AACf;;;;;AAMA,SAAgB,kBAAkB,WAA4B;CAE5D,IAAI,kBAAkB,KAAK,SAAS,GAClC,OAAO;CAGT,OAAO,2BAA2B,KAAK,SAAS;AAClD;AAEA,MAAM,uCAAuC,CAAC,OAAO;;;;;AAMrD,SAAgB,yBACd,WACA,cAAiC,sCACxB;CACT,IAA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KACjC,UAAU,WAAW,OAAO,KAC5B,eAAe,SAAS,UAAU,QAAQ,UAAU,EAAE,CAAC;AAE3D;;;;;AAMA,SAAgB,sBAAsB,WAA4B;CAChE,IAAI,CAAC,aAAa,UAAU,WAAW,GAAG,GACxC,OAAO;CAGT,IAAI,0BAA0B,SAAS,KAAK,wBAAwB,SAAS,GAC3E,OAAO;CAGT,IAAI,gBAAgB,SAAS,GAC3B,OAAO;CAGT,IAAI,yBAAyB,SAAS,GACpC,OAAO;CAGT,OAAO;AACT"}
@@ -1,6 +1,6 @@
1
- require("child_process");
2
1
  require("fs");
3
2
  let path = require("path");
3
+ require("child_process");
4
4
  let module$1 = require("module");
5
5
  //#region src/build/utils.ts
6
6
  /**
@@ -282,4 +282,4 @@ Object.defineProperty(exports, "slash", {
282
282
  }
283
283
  });
284
284
 
285
- //# sourceMappingURL=utils-7WDNT3Ca.cjs.map
285
+ //# sourceMappingURL=utils-Bsr_sEcH.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils-7WDNT3Ca.cjs","names":["path","builtinModules"],"sources":["../src/build/utils.ts"],"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\n/**\n * Whether the deployer should skip installing dependencies (and lockfile\n * generation) in the build output directory. Enabled by setting\n * MASTRA_BUILD_SKIP_INSTALL to \"true\" or \"1\". Useful for hermetic build\n * systems (e.g. Bazel) that supply node_modules externally and run in a\n * network-less sandbox where the output install would be redundant and fatal.\n */\nexport function shouldSkipInstall(): boolean {\n const value = process.env.MASTRA_BUILD_SKIP_INSTALL;\n return value === 'true' || value === '1';\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 signalsUI: string;\n organizationId: string;\n platformProjectId: string;\n platformObservabilityEndpoint: string;\n autoDetectUrl?: string;\n devServerInstanceId?: 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 // `String.prototype.replace`/`replaceAll` treat `$` sequences ($$, $&, $`,\n // $', $n) in the replacement string as special patterns. Config values are\n // dynamic (e.g. request context presets), so use a replacement function to\n // insert them verbatim.\n const replace = (token: string, value: string) => {\n html = html.replace(token, () => value);\n };\n\n replace(`'%%MASTRA_DEV_SERVER_INSTANCE_ID%%'`, config.devServerInstanceId ?? \"''\");\n replace(`'%%MASTRA_SERVER_HOST%%'`, config.host);\n replace(`'%%MASTRA_SERVER_PORT%%'`, config.port);\n replace(`'%%MASTRA_SERVER_PROTOCOL%%'`, config.protocol);\n replace(`'%%MASTRA_API_PREFIX%%'`, config.apiPrefix);\n replace(`'%%MASTRA_HIDE_CLOUD_CTA%%'`, config.hideCloudCta);\n replace(`'%%MASTRA_CLOUD_API_ENDPOINT%%'`, config.cloudApiEndpoint);\n replace(`'%%MASTRA_EXPERIMENTAL_FEATURES%%'`, config.experimentalFeatures);\n replace(`'%%MASTRA_TEMPLATES%%'`, config.templates);\n replace(`'%%MASTRA_TELEMETRY_DISABLED%%'`, config.telemetryDisabled);\n replace(`'%%MASTRA_REQUEST_CONTEXT_PRESETS%%'`, config.requestContextPresets);\n replace(`'%%MASTRA_EXPERIMENTAL_UI%%'`, config.experimentalUI);\n replace(`'%%MASTRA_AGENT_SIGNALS%%'`, config.agentSignals);\n replace(`'%%MASTRA_SIGNALS_UI%%'`, config.signalsUI);\n replace(`'%%MASTRA_ORGANIZATION_ID%%'`, config.organizationId);\n replace(`'%%MASTRA_PLATFORM_PROJECT_ID%%'`, config.platformProjectId);\n replace(`'%%MASTRA_PLATFORM_OBSERVABILITY_ENDPOINT%%'`, config.platformObservabilityEndpoint);\n if (config.autoDetectUrl) {\n 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 * Escape a dynamic value for embedding inside a single-quoted JavaScript\n * string literal in the Studio `index.html` (e.g. `window.X = '<value>'`).\n * Without it, an env-derived value containing `'` or `</script>` breaks out\n * of the literal and corrupts (or injects into) the served page.\n */\nexport function escapeStudioHtmlValue(value: string): string {\n return value\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/</g, '\\\\u003c')\n .replace(/>/g, '\\\\u003e')\n .replace(/\\u2028/g, '\\\\u2028')\n .replace(/\\u2029/g, '\\\\u2029');\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"],"mappings":";;;;;;;;;;;;;;AA0BA,SAAgB,sBAAsB,UAAqD;CACzF,IAAI,aAAa,WACf,OAAO;EACL,gBAAgB;EAChB,SAAS;EACT,kBAAkB;GAAC;GAAW;GAAU;EAAS;CACnD;CAEF,OAAO;EACL,gBAAgB;EAChB,kBAAkB,CAAC,MAAM;CAC3B;AACF;;;;;;;;AASA,SAAgB,gBAAiC;CAC/C,IAAI,QAAQ,UAAU,KACpB,OAAO;CAET,OAAO;AACT;;;;;;;;AASA,SAAgB,oBAA6B;CAC3C,MAAM,QAAQ,QAAQ,IAAI;CAC1B,OAAO,UAAU,UAAU,UAAU;AACvC;AAWA,SAAgB,0BAA0B,KAAa,aAAqB;CAC1E,IAAI,QAAQ,aACV,OAAO;CAGT,OAAO,IAAI,WAAW,GAAG,YAAY,EAAE;AACzC;;;;AAKA,SAAgB,eAAe,IAAY;CACzC,MAAM,QAAQ,GAAG,MAAM,GAAG;CAE1B,IAAI,GAAG,WAAW,GAAG,GACnB,OAAO,MAAM,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG;CAGnC,OAAO,MAAM;AACf;;;;;AAMA,SAAgB,kBAAkB,WAA4B;CAE5D,IAAI,kBAAkB,KAAK,SAAS,GAClC,OAAO;CAGT,OAA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SAAS,CAAC,CACxB,QAAQ,MAAM,SAAS,CAAC,CACxB,QAAQ,WAAW,SAAS,CAAC,CAC7B,QAAQ,WAAW,SAAS;AACjC;;;;;;AAOA,SAAgB,gBAAgB,WAA4B;CAC1D,OACEC,SAAAA,eAAe,SAAS,SAAS,KACjC,UAAU,WAAW,OAAO,KAC5BA,SAAAA,eAAe,SAAS,UAAU,QAAQ,UAAU,EAAE,CAAC;AAE3D;;;;;AAMA,SAAgB,sBAAsB,WAA4B;CAChE,IAAI,CAAC,aAAa,UAAU,WAAW,GAAG,GACxC,OAAO;CAGT,IAAI,0BAA0B,SAAS,KAAK,wBAAwB,SAAS,GAC3E,OAAO;CAGT,IAAI,gBAAgB,SAAS,GAC3B,OAAO;CAGT,IAAI,yBAAyB,SAAS,GACpC,OAAO;CAGT,OAAO;AACT"}
1
+ {"version":3,"file":"utils-Bsr_sEcH.cjs","names":["path","builtinModules"],"sources":["../src/build/utils.ts"],"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\n/**\n * Whether the deployer should skip installing dependencies (and lockfile\n * generation) in the build output directory. Enabled by setting\n * MASTRA_BUILD_SKIP_INSTALL to \"true\" or \"1\". Useful for hermetic build\n * systems (e.g. Bazel) that supply node_modules externally and run in a\n * network-less sandbox where the output install would be redundant and fatal.\n */\nexport function shouldSkipInstall(): boolean {\n const value = process.env.MASTRA_BUILD_SKIP_INSTALL;\n return value === 'true' || value === '1';\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 signalsUI: string;\n organizationId: string;\n platformProjectId: string;\n platformObservabilityEndpoint: string;\n autoDetectUrl?: string;\n devServerInstanceId?: 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 // `String.prototype.replace`/`replaceAll` treat `$` sequences ($$, $&, $`,\n // $', $n) in the replacement string as special patterns. Config values are\n // dynamic (e.g. request context presets), so use a replacement function to\n // insert them verbatim.\n const replace = (token: string, value: string) => {\n html = html.replace(token, () => value);\n };\n\n replace(`'%%MASTRA_DEV_SERVER_INSTANCE_ID%%'`, config.devServerInstanceId ?? \"''\");\n replace(`'%%MASTRA_SERVER_HOST%%'`, config.host);\n replace(`'%%MASTRA_SERVER_PORT%%'`, config.port);\n replace(`'%%MASTRA_SERVER_PROTOCOL%%'`, config.protocol);\n replace(`'%%MASTRA_API_PREFIX%%'`, config.apiPrefix);\n replace(`'%%MASTRA_HIDE_CLOUD_CTA%%'`, config.hideCloudCta);\n replace(`'%%MASTRA_CLOUD_API_ENDPOINT%%'`, config.cloudApiEndpoint);\n replace(`'%%MASTRA_EXPERIMENTAL_FEATURES%%'`, config.experimentalFeatures);\n replace(`'%%MASTRA_TEMPLATES%%'`, config.templates);\n replace(`'%%MASTRA_TELEMETRY_DISABLED%%'`, config.telemetryDisabled);\n replace(`'%%MASTRA_REQUEST_CONTEXT_PRESETS%%'`, config.requestContextPresets);\n replace(`'%%MASTRA_EXPERIMENTAL_UI%%'`, config.experimentalUI);\n replace(`'%%MASTRA_AGENT_SIGNALS%%'`, config.agentSignals);\n replace(`'%%MASTRA_SIGNALS_UI%%'`, config.signalsUI);\n replace(`'%%MASTRA_ORGANIZATION_ID%%'`, config.organizationId);\n replace(`'%%MASTRA_PLATFORM_PROJECT_ID%%'`, config.platformProjectId);\n replace(`'%%MASTRA_PLATFORM_OBSERVABILITY_ENDPOINT%%'`, config.platformObservabilityEndpoint);\n if (config.autoDetectUrl) {\n 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 * Escape a dynamic value for embedding inside a single-quoted JavaScript\n * string literal in the Studio `index.html` (e.g. `window.X = '<value>'`).\n * Without it, an env-derived value containing `'` or `</script>` breaks out\n * of the literal and corrupts (or injects into) the served page.\n */\nexport function escapeStudioHtmlValue(value: string): string {\n return value\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/</g, '\\\\u003c')\n .replace(/>/g, '\\\\u003e')\n .replace(/\\u2028/g, '\\\\u2028')\n .replace(/\\u2029/g, '\\\\u2029');\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"],"mappings":";;;;;;;;;;;;;;AA0BA,SAAgB,sBAAsB,UAAqD;CACzF,IAAI,aAAa,WACf,OAAO;EACL,gBAAgB;EAChB,SAAS;EACT,kBAAkB;GAAC;GAAW;GAAU;EAAS;CACnD;CAEF,OAAO;EACL,gBAAgB;EAChB,kBAAkB,CAAC,MAAM;CAC3B;AACF;;;;;;;;AASA,SAAgB,gBAAiC;CAC/C,IAAI,QAAQ,UAAU,KACpB,OAAO;CAET,OAAO;AACT;;;;;;;;AASA,SAAgB,oBAA6B;CAC3C,MAAM,QAAQ,QAAQ,IAAI;CAC1B,OAAO,UAAU,UAAU,UAAU;AACvC;AAWA,SAAgB,0BAA0B,KAAa,aAAqB;CAC1E,IAAI,QAAQ,aACV,OAAO;CAGT,OAAO,IAAI,WAAW,GAAG,YAAY,EAAE;AACzC;;;;AAKA,SAAgB,eAAe,IAAY;CACzC,MAAM,QAAQ,GAAG,MAAM,GAAG;CAE1B,IAAI,GAAG,WAAW,GAAG,GACnB,OAAO,MAAM,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG;CAGnC,OAAO,MAAM;AACf;;;;;AAMA,SAAgB,kBAAkB,WAA4B;CAE5D,IAAI,kBAAkB,KAAK,SAAS,GAClC,OAAO;CAGT,OAAO,2BAA2B,KAAK,SAAS;AAClD;AAEA,MAAM,uCAAuC,CAAC,OAAO;;;;;AAMrD,SAAgB,yBACd,WACA,cA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,SAAS;AACjC;;;;;;AAOA,SAAgB,gBAAgB,WAA4B;CAC1D,OACEC,SAAAA,eAAe,SAAS,SAAS,KACjC,UAAU,WAAW,OAAO,KAC5BA,SAAAA,eAAe,SAAS,UAAU,QAAQ,UAAU,EAAE,CAAC;AAE3D;;;;;AAMA,SAAgB,sBAAsB,WAA4B;CAChE,IAAI,CAAC,aAAa,UAAU,WAAW,GAAG,GACxC,OAAO;CAGT,IAAI,0BAA0B,SAAS,KAAK,wBAAwB,SAAS,GAC3E,OAAO;CAGT,IAAI,gBAAgB,SAAS,GAC3B,OAAO;CAGT,IAAI,yBAAyB,SAAS,GACpC,OAAO;CAGT,OAAO;AACT"}
@@ -1,5 +1,5 @@
1
- const require_index_CLddUTqr = require("./index-CLddUTqr-DS5tJ3WV.cjs");
2
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@standard-community/standard-json/0.3.5/1c9f0f61b390ad3f38476964121204ef02e35ff267c2b3f61b718f5f544716d2/node_modules/@standard-community/standard-json/dist/valibot--1zFm7rT.js
1
+ const require_index_CLddUTqr = require("./index-CLddUTqr-DsGkVS-W.cjs");
2
+ //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@standard-community/standard-json/0.3.5/51aed048de3b19fc603080fe95a6465a0f7208b9be56abfbffac914316d9d07e/node_modules/@standard-community/standard-json/dist/valibot--1zFm7rT.js
3
3
  async function getToJsonSchemaFn() {
4
4
  try {
5
5
  const { toJsonSchema } = await Promise.resolve().then(() => require("./dist-twPJIvYf.cjs"));
@@ -11,4 +11,4 @@ async function getToJsonSchemaFn() {
11
11
  //#endregion
12
12
  exports.default = getToJsonSchemaFn;
13
13
 
14
- //# sourceMappingURL=valibot--1zFm7rT-Dn5WqdyK.cjs.map
14
+ //# sourceMappingURL=valibot--1zFm7rT-BeX3W1HK.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"valibot--1zFm7rT-Dn5WqdyK.cjs","names":["MissingDependencyError"],"sources":["../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@standard-community/standard-json/0.3.5/1c9f0f61b390ad3f38476964121204ef02e35ff267c2b3f61b718f5f544716d2/node_modules/@standard-community/standard-json/dist/valibot--1zFm7rT.js"],"sourcesContent":["import { M as MissingDependencyError } from './index-CLddUTqr.js';\nimport 'quansync';\n\nasync function getToJsonSchemaFn() {\n try {\n const { toJsonSchema } = await import('@valibot/to-json-schema');\n return toJsonSchema;\n } catch {\n throw new MissingDependencyError(\"@valibot/to-json-schema\");\n }\n}\n\nexport { getToJsonSchemaFn as default };\n"],"x_google_ignoreList":[0],"mappings":";;AAGA,eAAe,oBAAoB;CACjC,IAAI;EACF,MAAM,EAAE,iBAAiB,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,qBAAA,CAAA;EAC/B,OAAO;CACT,QAAQ;EACN,MAAM,IAAIA,uBAAAA,uBAAuB,yBAAyB;CAC5D;AACF"}
1
+ {"version":3,"file":"valibot--1zFm7rT-BeX3W1HK.cjs","names":["MissingDependencyError"],"sources":["../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@standard-community/standard-json/0.3.5/51aed048de3b19fc603080fe95a6465a0f7208b9be56abfbffac914316d9d07e/node_modules/@standard-community/standard-json/dist/valibot--1zFm7rT.js"],"sourcesContent":["import { M as MissingDependencyError } from './index-CLddUTqr.js';\nimport 'quansync';\n\nasync function getToJsonSchemaFn() {\n try {\n const { toJsonSchema } = await import('@valibot/to-json-schema');\n return toJsonSchema;\n } catch {\n throw new MissingDependencyError(\"@valibot/to-json-schema\");\n }\n}\n\nexport { getToJsonSchemaFn as default };\n"],"x_google_ignoreList":[0],"mappings":";;AAGA,eAAe,oBAAoB;CACjC,IAAI;EACF,MAAM,EAAE,iBAAiB,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,qBAAA,CAAA;EAC/B,OAAO;CACT,QAAQ;EACN,MAAM,IAAIA,uBAAAA,uBAAuB,yBAAyB;CAC5D;AACF"}
@@ -1,5 +1,5 @@
1
- import { t as MissingDependencyError } from "./index-CLddUTqr-eO-ae7Sx.js";
2
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@standard-community/standard-json/0.3.5/1c9f0f61b390ad3f38476964121204ef02e35ff267c2b3f61b718f5f544716d2/node_modules/@standard-community/standard-json/dist/valibot--1zFm7rT.js
1
+ import { t as MissingDependencyError } from "./index-CLddUTqr-BXqo9et4.js";
2
+ //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@standard-community/standard-json/0.3.5/51aed048de3b19fc603080fe95a6465a0f7208b9be56abfbffac914316d9d07e/node_modules/@standard-community/standard-json/dist/valibot--1zFm7rT.js
3
3
  async function getToJsonSchemaFn() {
4
4
  try {
5
5
  const { toJsonSchema } = await import("./dist-DYm9bBZO.js");
@@ -11,4 +11,4 @@ async function getToJsonSchemaFn() {
11
11
  //#endregion
12
12
  export { getToJsonSchemaFn as default };
13
13
 
14
- //# sourceMappingURL=valibot--1zFm7rT-BxcEC3Pu.js.map
14
+ //# sourceMappingURL=valibot--1zFm7rT-BuVb-6oJ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"valibot--1zFm7rT-BxcEC3Pu.js","names":[],"sources":["../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@standard-community/standard-json/0.3.5/1c9f0f61b390ad3f38476964121204ef02e35ff267c2b3f61b718f5f544716d2/node_modules/@standard-community/standard-json/dist/valibot--1zFm7rT.js"],"sourcesContent":["import { M as MissingDependencyError } from './index-CLddUTqr.js';\nimport 'quansync';\n\nasync function getToJsonSchemaFn() {\n try {\n const { toJsonSchema } = await import('@valibot/to-json-schema');\n return toJsonSchema;\n } catch {\n throw new MissingDependencyError(\"@valibot/to-json-schema\");\n }\n}\n\nexport { getToJsonSchemaFn as default };\n"],"x_google_ignoreList":[0],"mappings":";;AAGA,eAAe,oBAAoB;CACjC,IAAI;EACF,MAAM,EAAE,iBAAiB,MAAM,OAAO;EACtC,OAAO;CACT,QAAQ;EACN,MAAM,IAAI,uBAAuB,yBAAyB;CAC5D;AACF"}
1
+ {"version":3,"file":"valibot--1zFm7rT-BuVb-6oJ.js","names":[],"sources":["../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@standard-community/standard-json/0.3.5/51aed048de3b19fc603080fe95a6465a0f7208b9be56abfbffac914316d9d07e/node_modules/@standard-community/standard-json/dist/valibot--1zFm7rT.js"],"sourcesContent":["import { M as MissingDependencyError } from './index-CLddUTqr.js';\nimport 'quansync';\n\nasync function getToJsonSchemaFn() {\n try {\n const { toJsonSchema } = await import('@valibot/to-json-schema');\n return toJsonSchema;\n } catch {\n throw new MissingDependencyError(\"@valibot/to-json-schema\");\n }\n}\n\nexport { getToJsonSchemaFn as default };\n"],"x_google_ignoreList":[0],"mappings":";;AAGA,eAAe,oBAAoB;CACjC,IAAI;EACF,MAAM,EAAE,iBAAiB,MAAM,OAAO;EACtC,OAAO;CACT,QAAQ;EACN,MAAM,IAAI,uBAAuB,yBAAyB;CAC5D;AACF"}
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_utils = require("../utils-7WDNT3Ca.cjs");
2
+ const require_utils = require("../utils-Bsr_sEcH.cjs");
3
3
  let fs = require("fs");
4
4
  let fs_promises = require("fs/promises");
5
5
  let path = require("path");
@@ -1,4 +1,4 @@
1
- import { l as isDependencyPartOfPackage } from "../utils-DYi43Kp4.js";
1
+ import { l as isDependencyPartOfPackage } from "../utils-Bl3Lm7SI.js";
2
2
  import { builtinModules } from "module";
3
3
  import { existsSync } from "fs";
4
4
  import { readFile } from "fs/promises";
@@ -1,16 +1,16 @@
1
- import { t as MissingDependencyError } from "./index-CLddUTqr-eO-ae7Sx.js";
2
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@standard-community/standard-json/0.3.5/1c9f0f61b390ad3f38476964121204ef02e35ff267c2b3f61b718f5f544716d2/node_modules/@standard-community/standard-json/dist/zod-Bwrt9trS.js
1
+ import { t as MissingDependencyError } from "./index-CLddUTqr-BXqo9et4.js";
2
+ //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@standard-community/standard-json/0.3.5/51aed048de3b19fc603080fe95a6465a0f7208b9be56abfbffac914316d9d07e/node_modules/@standard-community/standard-json/dist/zod-Bwrt9trS.js
3
3
  const zodv4Error = new MissingDependencyError("zod v4");
4
4
  async function getToJsonSchemaFn() {
5
5
  return async (schema, options) => {
6
6
  let handler;
7
7
  if ("_zod" in schema) try {
8
- handler = (await import("./core-DF65PJXc.js")).toJSONSchema;
8
+ handler = (await import("./core-D3wM1JKp.js")).toJSONSchema;
9
9
  } catch {
10
10
  throw zodv4Error;
11
11
  }
12
12
  else try {
13
- handler = (await import("./esm-B51vJPGv.js")).zodToJsonSchema;
13
+ handler = (await import("./esm-D-wYOO-S.js")).zodToJsonSchema;
14
14
  } catch {
15
15
  throw new MissingDependencyError("zod-to-json-schema");
16
16
  }
@@ -20,4 +20,4 @@ async function getToJsonSchemaFn() {
20
20
  //#endregion
21
21
  export { getToJsonSchemaFn as default };
22
22
 
23
- //# sourceMappingURL=zod-Bwrt9trS-Bd40XYOT.js.map
23
+ //# sourceMappingURL=zod-Bwrt9trS-D5b1oyiT.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"zod-Bwrt9trS-Bd40XYOT.js","names":[],"sources":["../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@standard-community/standard-json/0.3.5/1c9f0f61b390ad3f38476964121204ef02e35ff267c2b3f61b718f5f544716d2/node_modules/@standard-community/standard-json/dist/zod-Bwrt9trS.js"],"sourcesContent":["import { M as MissingDependencyError } from './index-CLddUTqr.js';\nimport 'quansync';\n\nconst zodv4Error = new MissingDependencyError(\"zod v4\");\nasync function getToJsonSchemaFn() {\n return async (schema, options) => {\n let handler;\n if (\"_zod\" in schema) {\n try {\n const mod = await import('zod/v4/core');\n handler = mod.toJSONSchema;\n } catch {\n throw zodv4Error;\n }\n } else {\n try {\n const mod = await import('zod-to-json-schema');\n handler = mod.zodToJsonSchema;\n } catch {\n throw new MissingDependencyError(\"zod-to-json-schema\");\n }\n }\n return handler(schema, options);\n };\n}\n\nexport { getToJsonSchemaFn as default };\n"],"x_google_ignoreList":[0],"mappings":";;AAGA,MAAM,aAAa,IAAI,uBAAuB,QAAQ;AACtD,eAAe,oBAAoB;CACjC,OAAO,OAAO,QAAQ,YAAY;EAChC,IAAI;EACJ,IAAI,UAAU,QACZ,IAAI;GAEF,WAAU,MADQ,OAAO,sBAAA,CACX;EAChB,QAAQ;GACN,MAAM;EACR;OAEA,IAAI;GAEF,WAAU,MADQ,OAAO,qBAAA,CACX;EAChB,QAAQ;GACN,MAAM,IAAI,uBAAuB,oBAAoB;EACvD;EAEF,OAAO,QAAQ,QAAQ,OAAO;CAChC;AACF"}
1
+ {"version":3,"file":"zod-Bwrt9trS-D5b1oyiT.js","names":[],"sources":["../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@standard-community/standard-json/0.3.5/51aed048de3b19fc603080fe95a6465a0f7208b9be56abfbffac914316d9d07e/node_modules/@standard-community/standard-json/dist/zod-Bwrt9trS.js"],"sourcesContent":["import { M as MissingDependencyError } from './index-CLddUTqr.js';\nimport 'quansync';\n\nconst zodv4Error = new MissingDependencyError(\"zod v4\");\nasync function getToJsonSchemaFn() {\n return async (schema, options) => {\n let handler;\n if (\"_zod\" in schema) {\n try {\n const mod = await import('zod/v4/core');\n handler = mod.toJSONSchema;\n } catch {\n throw zodv4Error;\n }\n } else {\n try {\n const mod = await import('zod-to-json-schema');\n handler = mod.zodToJsonSchema;\n } catch {\n throw new MissingDependencyError(\"zod-to-json-schema\");\n }\n }\n return handler(schema, options);\n };\n}\n\nexport { getToJsonSchemaFn as default };\n"],"x_google_ignoreList":[0],"mappings":";;AAGA,MAAM,aAAa,IAAI,uBAAuB,QAAQ;AACtD,eAAe,oBAAoB;CACjC,OAAO,OAAO,QAAQ,YAAY;EAChC,IAAI;EACJ,IAAI,UAAU,QACZ,IAAI;GAEF,WAAU,MADQ,OAAO,sBAAA,CACX;EAChB,QAAQ;GACN,MAAM;EACR;OAEA,IAAI;GAEF,WAAU,MADQ,OAAO,qBAAA,CACX;EAChB,QAAQ;GACN,MAAM,IAAI,uBAAuB,oBAAoB;EACvD;EAEF,OAAO,QAAQ,QAAQ,OAAO;CAChC;AACF"}
@@ -1,16 +1,16 @@
1
- const require_index_CLddUTqr = require("./index-CLddUTqr-DS5tJ3WV.cjs");
2
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@standard-community/standard-json/0.3.5/1c9f0f61b390ad3f38476964121204ef02e35ff267c2b3f61b718f5f544716d2/node_modules/@standard-community/standard-json/dist/zod-Bwrt9trS.js
1
+ const require_index_CLddUTqr = require("./index-CLddUTqr-DsGkVS-W.cjs");
2
+ //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@standard-community/standard-json/0.3.5/51aed048de3b19fc603080fe95a6465a0f7208b9be56abfbffac914316d9d07e/node_modules/@standard-community/standard-json/dist/zod-Bwrt9trS.js
3
3
  const zodv4Error = new require_index_CLddUTqr.MissingDependencyError("zod v4");
4
4
  async function getToJsonSchemaFn() {
5
5
  return async (schema, options) => {
6
6
  let handler;
7
7
  if ("_zod" in schema) try {
8
- handler = (await Promise.resolve().then(() => require("./core-D0wEgdn3.cjs"))).toJSONSchema;
8
+ handler = (await Promise.resolve().then(() => require("./core-QL_X0T4Y.cjs"))).toJSONSchema;
9
9
  } catch {
10
10
  throw zodv4Error;
11
11
  }
12
12
  else try {
13
- handler = (await Promise.resolve().then(() => require("./esm-DZ1Siz1C.cjs"))).zodToJsonSchema;
13
+ handler = (await Promise.resolve().then(() => require("./esm-Ai6osZ1a.cjs"))).zodToJsonSchema;
14
14
  } catch {
15
15
  throw new require_index_CLddUTqr.MissingDependencyError("zod-to-json-schema");
16
16
  }
@@ -20,4 +20,4 @@ async function getToJsonSchemaFn() {
20
20
  //#endregion
21
21
  exports.default = getToJsonSchemaFn;
22
22
 
23
- //# sourceMappingURL=zod-Bwrt9trS-Bi11nE9Q.cjs.map
23
+ //# sourceMappingURL=zod-Bwrt9trS-DGQs9DWc.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"zod-Bwrt9trS-Bi11nE9Q.cjs","names":["MissingDependencyError"],"sources":["../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@standard-community/standard-json/0.3.5/1c9f0f61b390ad3f38476964121204ef02e35ff267c2b3f61b718f5f544716d2/node_modules/@standard-community/standard-json/dist/zod-Bwrt9trS.js"],"sourcesContent":["import { M as MissingDependencyError } from './index-CLddUTqr.js';\nimport 'quansync';\n\nconst zodv4Error = new MissingDependencyError(\"zod v4\");\nasync function getToJsonSchemaFn() {\n return async (schema, options) => {\n let handler;\n if (\"_zod\" in schema) {\n try {\n const mod = await import('zod/v4/core');\n handler = mod.toJSONSchema;\n } catch {\n throw zodv4Error;\n }\n } else {\n try {\n const mod = await import('zod-to-json-schema');\n handler = mod.zodToJsonSchema;\n } catch {\n throw new MissingDependencyError(\"zod-to-json-schema\");\n }\n }\n return handler(schema, options);\n };\n}\n\nexport { getToJsonSchemaFn as default };\n"],"x_google_ignoreList":[0],"mappings":";;AAGA,MAAM,aAAa,IAAIA,uBAAAA,uBAAuB,QAAQ;AACtD,eAAe,oBAAoB;CACjC,OAAO,OAAO,QAAQ,YAAY;EAChC,IAAI;EACJ,IAAI,UAAU,QACZ,IAAI;GAEF,WAAU,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QADQ,qBAAA,CAAA,EAAA,CACJ;EAChB,QAAQ;GACN,MAAM;EACR;OAEA,IAAI;GAEF,WAAU,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QADQ,oBAAA,CAAA,EAAA,CACJ;EAChB,QAAQ;GACN,MAAM,IAAIA,uBAAAA,uBAAuB,oBAAoB;EACvD;EAEF,OAAO,QAAQ,QAAQ,OAAO;CAChC;AACF"}
1
+ {"version":3,"file":"zod-Bwrt9trS-DGQs9DWc.cjs","names":["MissingDependencyError"],"sources":["../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@standard-community/standard-json/0.3.5/51aed048de3b19fc603080fe95a6465a0f7208b9be56abfbffac914316d9d07e/node_modules/@standard-community/standard-json/dist/zod-Bwrt9trS.js"],"sourcesContent":["import { M as MissingDependencyError } from './index-CLddUTqr.js';\nimport 'quansync';\n\nconst zodv4Error = new MissingDependencyError(\"zod v4\");\nasync function getToJsonSchemaFn() {\n return async (schema, options) => {\n let handler;\n if (\"_zod\" in schema) {\n try {\n const mod = await import('zod/v4/core');\n handler = mod.toJSONSchema;\n } catch {\n throw zodv4Error;\n }\n } else {\n try {\n const mod = await import('zod-to-json-schema');\n handler = mod.zodToJsonSchema;\n } catch {\n throw new MissingDependencyError(\"zod-to-json-schema\");\n }\n }\n return handler(schema, options);\n };\n}\n\nexport { getToJsonSchemaFn as default };\n"],"x_google_ignoreList":[0],"mappings":";;AAGA,MAAM,aAAa,IAAIA,uBAAAA,uBAAuB,QAAQ;AACtD,eAAe,oBAAoB;CACjC,OAAO,OAAO,QAAQ,YAAY;EAChC,IAAI;EACJ,IAAI,UAAU,QACZ,IAAI;GAEF,WAAU,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QADQ,qBAAA,CAAA,EAAA,CACJ;EAChB,QAAQ;GACN,MAAM;EACR;OAEA,IAAI;GAEF,WAAU,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QADQ,oBAAA,CAAA,EAAA,CACJ;EAChB,QAAQ;GACN,MAAM,IAAIA,uBAAAA,uBAAuB,oBAAoB;EACvD;EAEF,OAAO,QAAQ,QAAQ,OAAO;CAChC;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/deployer",
3
- "version": "1.68.0-alpha.0",
3
+ "version": "1.68.0-alpha.6",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "files": [
@@ -98,10 +98,11 @@
98
98
  "@sindresorhus/slugify": "^2.2.1",
99
99
  "empathic": "^2.0.0",
100
100
  "esbuild": "^0.28.0",
101
+ "find-up-simple": "^1.0.1",
101
102
  "find-workspaces": "^0.3.1",
102
103
  "fs-extra": "^11.3.5",
103
104
  "gray-matter": "^4.0.3",
104
- "hono": "^4.12.8",
105
+ "hono": "^4.13.7",
105
106
  "local-pkg": "^1.1.2",
106
107
  "resolve.exports": "^2.0.3",
107
108
  "rollup": "^4.61.1",
@@ -109,9 +110,9 @@
109
110
  "strip-json-comments": "^5.0.3",
110
111
  "tinyglobby": "^0.2.17",
111
112
  "typescript-paths": "^1.5.2",
112
- "ws": "^8.21.0",
113
+ "ws": "^8.21.3",
113
114
  "yaml": "^2.9.0",
114
- "@mastra/server": "1.68.0-alpha.0"
115
+ "@mastra/server": "1.68.0-alpha.6"
115
116
  },
116
117
  "devDependencies": {
117
118
  "@hono/node-server": "^2.0.0",
@@ -119,8 +120,8 @@
119
120
  "@hono/swagger-ui": "^0.5.3",
120
121
  "@types/fs-extra": "^11.0.4",
121
122
  "@types/node": "22.20.1",
122
- "@vitest/coverage-v8": "4.1.10",
123
- "@vitest/ui": "4.1.10",
123
+ "@vitest/coverage-v8": "4.1.11",
124
+ "@vitest/ui": "4.1.11",
124
125
  "eslint": "^10.7.0",
125
126
  "fetch-to-node": "^2.1.0",
126
127
  "hono-openapi": "^1.3.1",
@@ -129,15 +130,15 @@
129
130
  "tsx": "^4.23.1",
130
131
  "type-fest": "^5.4.4",
131
132
  "typescript": "^6.0.3",
132
- "vitest": "4.1.10",
133
- "zod": "^4.4.3",
134
- "@mastra/agent-browser": "0.5.3",
133
+ "vitest": "4.1.11",
134
+ "zod": "^4.6.4",
135
135
  "@internal/lint": "0.0.133",
136
- "@mastra/core": "1.68.0-alpha.0",
137
- "@mastra/hono": "1.7.10-alpha.0",
138
- "@mastra/mcp": "^1.18.0",
139
- "@mastra/server": "1.68.0-alpha.0",
140
- "@internal/types-builder": "0.0.108"
136
+ "@internal/types-builder": "0.0.108",
137
+ "@mastra/agent-browser": "0.5.3",
138
+ "@mastra/hono": "1.7.10-alpha.6",
139
+ "@mastra/core": "1.68.0-alpha.6",
140
+ "@mastra/server": "1.68.0-alpha.6",
141
+ "@mastra/mcp": "^2.0.0-alpha.4"
141
142
  },
142
143
  "peerDependencies": {
143
144
  "@mastra/core": ">=1.50.0-0 <2.0.0-0"