@mastra/deployer 0.20.2-alpha.1 → 0.21.0-alpha.0
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.
- package/CHANGELOG.md +33 -0
- package/dist/build/analyze/bundleExternals.d.ts +4 -1
- package/dist/build/analyze/bundleExternals.d.ts.map +1 -1
- package/dist/build/analyze.cjs +2 -2
- package/dist/build/analyze.js +1 -1
- package/dist/build/bundler.cjs +3 -3
- package/dist/build/bundler.js +1 -1
- package/dist/build/index.cjs +12 -12
- package/dist/build/index.js +4 -4
- package/dist/bundler/index.cjs +2 -2
- package/dist/bundler/index.js +1 -1
- package/dist/{chunk-QZSRLR5Y.cjs → chunk-2TROY6ZL.cjs} +36 -23
- package/dist/chunk-2TROY6ZL.cjs.map +1 -0
- package/dist/{chunk-36JTHYM2.js → chunk-3JKL47PF.js} +36 -23
- package/dist/chunk-3JKL47PF.js.map +1 -0
- package/dist/{chunk-LV3YJXBH.js → chunk-5SQQZCSZ.js} +3 -3
- package/dist/{chunk-LV3YJXBH.js.map → chunk-5SQQZCSZ.js.map} +1 -1
- package/dist/{chunk-B3MAF4HY.cjs → chunk-7VHHRH2P.cjs} +9 -9
- package/dist/{chunk-B3MAF4HY.cjs.map → chunk-7VHHRH2P.cjs.map} +1 -1
- package/dist/{chunk-75YMBRRS.cjs → chunk-DCDNHNNC.cjs} +17 -17
- package/dist/{chunk-75YMBRRS.cjs.map → chunk-DCDNHNNC.cjs.map} +1 -1
- package/dist/{chunk-IJ5XDUJI.js → chunk-MKPUJONL.js} +4 -4
- package/dist/{chunk-IJ5XDUJI.js.map → chunk-MKPUJONL.js.map} +1 -1
- package/dist/{chunk-4JSGBXG4.cjs → chunk-MTGZ2VHE.cjs} +14 -14
- package/dist/{chunk-4JSGBXG4.cjs.map → chunk-MTGZ2VHE.cjs.map} +1 -1
- package/dist/{chunk-J6ARA5AG.js → chunk-ORJZPIKJ.js} +3 -3
- package/dist/{chunk-J6ARA5AG.js.map → chunk-ORJZPIKJ.js.map} +1 -1
- package/dist/{chunk-XJH6DNVG.cjs → chunk-S7HYYJRS.cjs} +5 -5
- package/dist/{chunk-XJH6DNVG.cjs.map → chunk-S7HYYJRS.cjs.map} +1 -1
- package/dist/{chunk-ZGEIJUOE.js → chunk-X6AP4LE6.js} +5 -5
- package/dist/{chunk-ZGEIJUOE.js.map → chunk-X6AP4LE6.js.map} +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.js +2 -2
- package/dist/server/handlers/a2a.d.ts +1 -1
- package/dist/server/handlers/routes/agents/handlers.d.ts +4 -4
- package/dist/server/handlers/routes/agents/router.d.ts.map +1 -1
- package/dist/server/handlers/routes/scores/handlers.d.ts +143 -113
- package/dist/server/handlers/routes/scores/handlers.d.ts.map +1 -1
- package/dist/server/index.cjs +49 -3
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.js +49 -3
- package/dist/server/index.js.map +1 -1
- package/package.json +9 -9
- package/dist/chunk-36JTHYM2.js.map +0 -1
- package/dist/chunk-QZSRLR5Y.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/build/customInstrumentation.ts","../src/bundler/index.ts"],"names":["pkg"],"mappings":";;;;;;;;;;;;;;;;;AAIO,SAAS,+BAAA,CACd,WACA,MAAA,EAGA;AACA,EAAA,OAAO,MAAA,CAAO;AAAA,IACZ,QAAA,EAAU,QAAA;AAAA,IACV,KAAA,EAAO;AAAA,MACL,eAAA,EAAiB;AAAA,KACnB;AAAA,IACA,SAAA,EAAW,KAAA;AAAA,IACX,OAAA,EAAS;AAAA;AAAA,MAEP,OAAA,EAAQ;AAAA,MACR,QAAA,CAAS;AAAA,QACP,UAAA,EAAY,CAAC,KAAA,EAAO,KAAK,CAAA;AAAA,QACzB,cAAA,EAAgB,QAAA;AAAA,QAChB,uBAAA,EAAyB,IAAA;AAAA,QACzB,cAAA,EAAgB;AAAA,OACjB;AAAA;AACH,GACD,CAAA;AACH;AAEA,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I,MAAA,GAAS,OAAO,CAAA,CAAE,CAAA;AAAA,IACjF;AAAA,EACF;AACF","file":"chunk-ZGEIJUOE.js","sourcesContent":["import { rollup } from 'rollup';\nimport { esbuild } from './plugins/esbuild';\nimport commonjs from '@rollup/plugin-commonjs';\n\nexport function getCustomInstrumentationBundler(\n entryFile: string,\n result: {\n hasCustomConfig: false;\n },\n) {\n return rollup({\n logLevel: 'silent',\n input: {\n instrumentation: entryFile,\n },\n treeshake: false,\n plugins: [\n // transpile typescript to something we understand\n esbuild(),\n commonjs({\n extensions: ['.js', '.ts'],\n strictRequires: 'strict',\n transformMixedEsModules: true,\n ignoreTryCatch: false,\n }),\n ],\n });\n}\n\nexport async function writeCustomInstrumentation(\n entryFile: string,\n outputDir: string,\n options: {\n sourcemap?: boolean;\n } = {},\n): Promise<{\n hasCustomConfig: boolean;\n externalDependencies: string[];\n}> {\n const result = {\n hasCustomConfig: false,\n } as const;\n\n const bundle = await getCustomInstrumentationBundler(entryFile, result);\n\n const { output } = await bundle.write({\n dir: outputDir,\n format: 'es',\n entryFileNames: '[name].mjs',\n sourcemap: options.sourcemap,\n });\n const externals = output[0].imports.filter(x => !x.startsWith('./'));\n\n return { ...result, externalDependencies: externals };\n}\n","import { existsSync } from 'node:fs';\nimport { stat, writeFile } from 'node:fs/promises';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { MastraBundler } from '@mastra/core/bundler';\nimport { MastraError, ErrorDomain, ErrorCategory } from '@mastra/core/error';\nimport virtual from '@rollup/plugin-virtual';\nimport * as pkg from 'empathic/package';\nimport fsExtra, { copy, ensureDir, readJSON, emptyDir } from 'fs-extra/esm';\nimport type { InputOptions, OutputOptions } from 'rollup';\nimport { glob } from 'tinyglobby';\nimport { analyzeBundle } from '../build/analyze';\nimport { createBundler as createBundlerUtil, getInputOptions } from '../build/bundler';\nimport { getBundlerOptions } from '../build/bundlerOptions';\nimport { writeCustomInstrumentation } from '../build/customInstrumentation';\nimport { writeTelemetryConfig } from '../build/telemetry';\nimport { getPackageRootPath } from '../build/utils';\nimport { DepsService } from '../services/deps';\nimport { FileService } from '../services/fs';\nimport {\n collectTransitiveWorkspaceDependencies,\n getWorkspaceInformation,\n packWorkspaceDependencies,\n} from './workspaceDependencies';\n\nexport abstract class Bundler extends MastraBundler {\n protected analyzeOutputDir = '.build';\n protected outputDir = 'output';\n\n constructor(name: string, component: 'BUNDLER' | 'DEPLOYER' = 'BUNDLER') {\n super({ name, component });\n }\n\n async prepare(outputDirectory: string): Promise<void> {\n // Clean up the output directory first\n await emptyDir(outputDirectory);\n\n await ensureDir(join(outputDirectory, this.analyzeOutputDir));\n await ensureDir(join(outputDirectory, this.outputDir));\n }\n\n async writeInstrumentationFile(outputDirectory: string, customInstrumentationFile?: string) {\n const instrumentationFile = join(outputDirectory, 'instrumentation.mjs');\n const __dirname = dirname(fileURLToPath(import.meta.url));\n\n if (customInstrumentationFile) {\n await copy(customInstrumentationFile, instrumentationFile);\n } else {\n await copy(join(__dirname, 'templates', 'instrumentation-template.js'), instrumentationFile);\n }\n }\n\n async writePackageJson(\n outputDirectory: string,\n dependencies: Map<string, string>,\n resolutions?: Record<string, string>,\n ) {\n this.logger.debug(`Writing project's package.json`);\n\n await ensureDir(outputDirectory);\n const pkgPath = join(outputDirectory, 'package.json');\n\n const dependenciesMap = new Map();\n for (const [key, value] of dependencies.entries()) {\n if (key.startsWith('@')) {\n // Handle scoped packages (e.g. @org/package)\n const pkgChunks = key.split('/');\n dependenciesMap.set(`${pkgChunks[0]}/${pkgChunks[1]}`, value);\n } else {\n // For non-scoped packages, take only the first part before any slash\n const pkgName = key.split('/')[0] || key;\n dependenciesMap.set(pkgName, value);\n }\n }\n\n // add telemetry dependencies\n dependenciesMap.set('@opentelemetry/core', '^2.0.1');\n dependenciesMap.set('@opentelemetry/api', '^1.9.0');\n dependenciesMap.set('@opentelemetry/auto-instrumentations-node', '^0.59.0');\n dependenciesMap.set('@opentelemetry/exporter-trace-otlp-grpc', '^0.201.0');\n dependenciesMap.set('@opentelemetry/exporter-trace-otlp-http', '^0.201.0');\n dependenciesMap.set('@opentelemetry/resources', '^2.0.1');\n dependenciesMap.set('@opentelemetry/sdk-node', '^0.201.0');\n dependenciesMap.set('@opentelemetry/sdk-trace-base', '^2.0.1');\n dependenciesMap.set('@opentelemetry/semantic-conventions', '^1.33.0');\n dependenciesMap.set('@opentelemetry/instrumentation', '^0.202.0');\n\n await writeFile(\n pkgPath,\n JSON.stringify(\n {\n name: 'server',\n version: '1.0.0',\n description: '',\n type: 'module',\n main: 'index.mjs',\n scripts: {\n start: 'node --import=./instrumentation.mjs --import=@opentelemetry/instrumentation/hook.mjs ./index.mjs',\n },\n author: 'Mastra',\n license: 'ISC',\n dependencies: Object.fromEntries(dependenciesMap.entries()),\n ...(Object.keys(resolutions ?? {}).length > 0 && { resolutions }),\n pnpm: {\n neverBuiltDependencies: [],\n },\n },\n null,\n 2,\n ),\n );\n }\n\n protected createBundler(inputOptions: InputOptions, outputOptions: Partial<OutputOptions> & { dir: string }) {\n return createBundlerUtil(inputOptions, outputOptions);\n }\n\n protected async analyze(\n entry: string | string[],\n mastraFile: string,\n outputDirectory: string,\n { enableEsmShim = true }: { enableEsmShim?: boolean } = {},\n ) {\n return await analyzeBundle(\n ([] as string[]).concat(entry),\n mastraFile,\n {\n outputDir: join(outputDirectory, this.analyzeOutputDir),\n projectRoot: outputDirectory,\n platform: 'node',\n bundlerOptions: {\n enableEsmShim,\n },\n },\n this.logger,\n );\n }\n\n protected async installDependencies(outputDirectory: string, rootDir = process.cwd()) {\n const deps = new DepsService(rootDir);\n deps.__setLogger(this.logger);\n\n await deps.install({ dir: join(outputDirectory, this.outputDir) });\n }\n\n protected async copyPublic(mastraDir: string, outputDirectory: string) {\n const publicDir = join(mastraDir, 'public');\n\n try {\n await stat(publicDir);\n } catch {\n return;\n }\n\n await copy(publicDir, join(outputDirectory, this.outputDir));\n }\n\n protected async copyDOTNPMRC({\n rootDir = process.cwd(),\n outputDirectory,\n }: {\n rootDir?: string;\n outputDirectory: string;\n }) {\n const sourceDotNpmRcPath = join(rootDir, '.npmrc');\n const targetDotNpmRcPath = join(outputDirectory, this.outputDir, '.npmrc');\n\n try {\n await stat(sourceDotNpmRcPath);\n await copy(sourceDotNpmRcPath, targetDotNpmRcPath);\n } catch {\n return;\n }\n }\n\n protected async getBundlerOptions(\n serverFile: string,\n mastraEntryFile: string,\n analyzedBundleInfo: Awaited<ReturnType<typeof analyzeBundle>>,\n toolsPaths: (string | string[])[],\n { enableSourcemap = false, enableEsmShim = true }: { enableSourcemap?: boolean; enableEsmShim?: boolean } = {},\n ) {\n const { workspaceRoot } = await getWorkspaceInformation({ mastraEntryFile });\n const closestPkgJson = pkg.up({ cwd: dirname(mastraEntryFile) });\n const projectRoot = closestPkgJson ? dirname(closestPkgJson) : process.cwd();\n\n const inputOptions: InputOptions = await getInputOptions(\n mastraEntryFile,\n analyzedBundleInfo,\n 'node',\n {\n 'process.env.NODE_ENV': JSON.stringify('production'),\n },\n { sourcemap: enableSourcemap, workspaceRoot, projectRoot, enableEsmShim },\n );\n const isVirtual = serverFile.includes('\\n') || existsSync(serverFile);\n\n const toolsInputOptions = await this.getToolsInputOptions(toolsPaths);\n\n if (isVirtual) {\n inputOptions.input = { index: '#entry', ...toolsInputOptions };\n\n if (Array.isArray(inputOptions.plugins)) {\n inputOptions.plugins.unshift(virtual({ '#entry': serverFile }));\n } else {\n inputOptions.plugins = [virtual({ '#entry': serverFile })];\n }\n } else {\n inputOptions.input = { index: serverFile, ...toolsInputOptions };\n }\n\n return inputOptions;\n }\n\n async getToolsInputOptions(toolsPaths: (string | string[])[]) {\n const inputs: Record<string, string> = {};\n\n for (const toolPath of toolsPaths) {\n const expandedPaths = await glob(toolPath, {\n absolute: true,\n expandDirectories: false,\n });\n\n for (const path of expandedPaths) {\n if (await fsExtra.pathExists(path)) {\n const fileService = new FileService();\n const entryFile = fileService.getFirstExistingFile([\n join(path, 'index.ts'),\n join(path, 'index.js'),\n path, // if path itself is a file\n ]);\n\n // if it doesn't exist or is a dir skip it. using a dir as a tool will crash the process\n if (!entryFile || (await stat(entryFile)).isDirectory()) {\n this.logger.warn(`No entry file found in ${path}, skipping...`);\n continue;\n }\n\n const uniqueToolID = crypto.randomUUID();\n // Normalize Windows paths to forward slashes for consistent handling\n const normalizedEntryFile = entryFile.replaceAll('\\\\', '/');\n inputs[`tools/${uniqueToolID}`] = normalizedEntryFile;\n } else {\n this.logger.warn(`Tool path ${path} does not exist, skipping...`);\n }\n }\n }\n\n return inputs;\n }\n\n protected async _bundle(\n serverFile: string,\n mastraEntryFile: string,\n {\n projectRoot,\n outputDirectory,\n enableEsmShim = true,\n }: { projectRoot: string; outputDirectory: string; enableEsmShim?: boolean },\n toolsPaths: (string | string[])[] = [],\n bundleLocation: string = join(outputDirectory, this.outputDir),\n ): Promise<void> {\n const analyzeDir = join(outputDirectory, this.analyzeOutputDir);\n let sourcemap = false;\n\n try {\n const bundlerOptions = await getBundlerOptions(mastraEntryFile, analyzeDir);\n sourcemap = !!bundlerOptions?.sourcemap;\n } catch (error) {\n this.logger.debug('Failed to get bundler options, sourcemap will be disabled', { error });\n }\n\n let analyzedBundleInfo;\n try {\n const resolvedToolsPaths = await this.getToolsInputOptions(toolsPaths);\n analyzedBundleInfo = await analyzeBundle(\n [serverFile, ...Object.values(resolvedToolsPaths)],\n mastraEntryFile,\n {\n outputDir: analyzeDir,\n projectRoot,\n platform: 'node',\n bundlerOptions: {\n enableEsmShim,\n },\n },\n this.logger,\n );\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new MastraError(\n {\n id: 'DEPLOYER_BUNDLER_ANALYZE_FAILED',\n text: `Failed to analyze Mastra application: ${message}`,\n domain: ErrorDomain.DEPLOYER,\n category: ErrorCategory.SYSTEM,\n },\n error,\n );\n }\n\n let externalDependencies: string[];\n try {\n const result = await writeTelemetryConfig(mastraEntryFile, join(outputDirectory, this.outputDir));\n\n externalDependencies = result?.externalDependencies ?? [];\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new MastraError(\n {\n id: 'DEPLOYER_BUNDLER_TELEMETRY_FAILED',\n text: `Failed to write telemetry config: ${message}`,\n domain: ErrorDomain.DEPLOYER,\n category: ErrorCategory.SYSTEM,\n },\n error,\n );\n }\n\n const mastraFolder = dirname(mastraEntryFile);\n\n const fileService = new FileService();\n const customInstrumentation = fileService.getFirstExistingFileOrUndefined([\n join(mastraFolder, 'instrumentation.js'),\n join(mastraFolder, 'instrumentation.ts'),\n join(mastraFolder, 'instrumentation.mjs'),\n ]);\n\n try {\n if (customInstrumentation) {\n const result = await writeCustomInstrumentation(customInstrumentation, join(outputDirectory, this.outputDir), {\n sourcemap,\n });\n externalDependencies = [...externalDependencies, ...result.externalDependencies];\n await this.writeInstrumentationFile(join(outputDirectory, this.outputDir), customInstrumentation);\n } else {\n await this.writeInstrumentationFile(join(outputDirectory, this.outputDir));\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new MastraError(\n {\n id: 'DEPLOYER_BUNDLER_INSTRUMENTATION_FILE_FAILED',\n text: `Failed to write instrumentation file: ${message}, ${customInstrumentation ? ` Found custom instrumentation file: ${customInstrumentation}` : ''}`,\n domain: ErrorDomain.DEPLOYER,\n category: ErrorCategory.SYSTEM,\n },\n error,\n );\n }\n\n const dependenciesToInstall = new Map<string, string>();\n\n // Add extenal dependencies from telemetry file\n for (const external of externalDependencies) {\n dependenciesToInstall.set(external, 'latest');\n }\n\n const workspaceDependencies = new Set<string>();\n for (const dep of analyzedBundleInfo.externalDependencies) {\n try {\n if (analyzedBundleInfo.workspaceMap.has(dep)) {\n workspaceDependencies.add(dep);\n continue;\n }\n\n const rootPath = await getPackageRootPath(dep);\n const pkg = await readJSON(`${rootPath}/package.json`);\n\n dependenciesToInstall.set(dep, pkg.version || 'latest');\n } catch {\n dependenciesToInstall.set(dep, 'latest');\n }\n }\n\n let resolutions: Record<string, string> = {};\n if (workspaceDependencies.size > 0) {\n try {\n const result = collectTransitiveWorkspaceDependencies({\n workspaceMap: analyzedBundleInfo.workspaceMap,\n initialDependencies: workspaceDependencies,\n logger: this.logger,\n });\n resolutions = result.resolutions;\n\n // Update dependenciesToInstall with the resolved TGZ paths\n Object.entries(resolutions).forEach(([pkgName, tgzPath]) => {\n dependenciesToInstall.set(pkgName, tgzPath);\n });\n\n await packWorkspaceDependencies({\n workspaceMap: analyzedBundleInfo.workspaceMap,\n usedWorkspacePackages: result.usedWorkspacePackages,\n bundleOutputDir: join(outputDirectory, this.outputDir),\n logger: this.logger,\n });\n } catch (error) {\n throw new MastraError(\n {\n id: 'DEPLOYER_BUNDLER_WORKSPACE_DEPS_FAILED',\n text: `Failed to collect and pack workspace dependencies.`,\n domain: ErrorDomain.DEPLOYER,\n category: ErrorCategory.USER,\n },\n error,\n );\n }\n }\n\n try {\n await this.writePackageJson(join(outputDirectory, this.outputDir), dependenciesToInstall, resolutions);\n\n this.logger.info('Bundling Mastra application');\n const inputOptions: InputOptions = await this.getBundlerOptions(\n serverFile,\n mastraEntryFile,\n analyzedBundleInfo,\n toolsPaths,\n { enableSourcemap: sourcemap, enableEsmShim: false },\n );\n\n const bundler = await this.createBundler(\n {\n ...inputOptions,\n logLevel: inputOptions.logLevel === 'silent' ? 'warn' : inputOptions.logLevel,\n onwarn: warning => {\n if (warning.code === 'CIRCULAR_DEPENDENCY') {\n if (warning.ids?.[0]?.includes('node_modules')) {\n return;\n }\n\n this.logger.warn(`Circular dependency found:\n\\t${warning.message.replace('Circular dependency: ', '')}`);\n }\n },\n },\n {\n dir: bundleLocation,\n manualChunks: {\n mastra: ['#mastra'],\n },\n sourcemap,\n },\n );\n\n await bundler.write();\n const toolImports: string[] = [];\n const toolsExports: string[] = [];\n Array.from(Object.keys(inputOptions.input || {}))\n .filter(key => key.startsWith('tools/'))\n .forEach((key, index) => {\n const toolExport = `tool${index}`;\n toolImports.push(`import * as ${toolExport} from './${key}.mjs';`);\n toolsExports.push(toolExport);\n });\n\n await writeFile(\n join(bundleLocation, 'tools.mjs'),\n `${toolImports.join('\\n')}\n\nexport const tools = [${toolsExports.join(', ')}]`,\n );\n this.logger.info('Bundling Mastra done');\n\n this.logger.info('Copying public files');\n await this.copyPublic(dirname(mastraEntryFile), outputDirectory);\n this.logger.info('Done copying public files');\n\n this.logger.info('Copying .npmrc file');\n await this.copyDOTNPMRC({ outputDirectory, rootDir: projectRoot });\n\n this.logger.info('Done copying .npmrc file');\n\n this.logger.info('Installing dependencies');\n await this.installDependencies(outputDirectory, projectRoot);\n\n this.logger.info('Done installing dependencies');\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new MastraError(\n {\n id: 'DEPLOYER_BUNDLER_BUNDLE_STAGE_FAILED',\n text: `Failed during bundler bundle stage: ${message}`,\n domain: ErrorDomain.DEPLOYER,\n category: ErrorCategory.SYSTEM,\n },\n error,\n );\n }\n }\n\n async lint(_entryFile: string, _outputDirectory: string, toolsPaths: (string | string[])[]): Promise<void> {\n const toolsInputOptions = await this.getToolsInputOptions(toolsPaths);\n const toolsLength = Object.keys(toolsInputOptions).length;\n if (toolsLength > 0) {\n this.logger.info(`Found ${toolsLength} ${toolsLength === 1 ? 'tool' : 'tools'}`);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/build/customInstrumentation.ts","../src/bundler/index.ts"],"names":["pkg"],"mappings":";;;;;;;;;;;;;;;;;AAIO,SAAS,+BAAA,CACd,WACA,MAAA,EAGA;AACA,EAAA,OAAO,MAAA,CAAO;AAAA,IACZ,QAAA,EAAU,QAAA;AAAA,IACV,KAAA,EAAO;AAAA,MACL,eAAA,EAAiB;AAAA,KACnB;AAAA,IACA,SAAA,EAAW,KAAA;AAAA,IACX,OAAA,EAAS;AAAA;AAAA,MAEP,OAAA,EAAQ;AAAA,MACR,QAAA,CAAS;AAAA,QACP,UAAA,EAAY,CAAC,KAAA,EAAO,KAAK,CAAA;AAAA,QACzB,cAAA,EAAgB,QAAA;AAAA,QAChB,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,MAAA,IAAA,CAAK,MAAA,CAAO,KAAK,CAAA,MAAA,EAAS,WAAW,IAAI,WAAA,KAAgB,CAAA,GAAI,MAAA,GAAS,OAAO,CAAA,CAAE,CAAA;AAAA,IACjF;AAAA,EACF;AACF","file":"chunk-X6AP4LE6.js","sourcesContent":["import { rollup } from 'rollup';\nimport { esbuild } from './plugins/esbuild';\nimport commonjs from '@rollup/plugin-commonjs';\n\nexport function getCustomInstrumentationBundler(\n entryFile: string,\n result: {\n hasCustomConfig: false;\n },\n) {\n return rollup({\n logLevel: 'silent',\n input: {\n instrumentation: entryFile,\n },\n treeshake: false,\n plugins: [\n // transpile typescript to something we understand\n esbuild(),\n commonjs({\n extensions: ['.js', '.ts'],\n strictRequires: 'strict',\n transformMixedEsModules: true,\n ignoreTryCatch: false,\n }),\n ],\n });\n}\n\nexport async function writeCustomInstrumentation(\n entryFile: string,\n outputDir: string,\n options: {\n sourcemap?: boolean;\n } = {},\n): Promise<{\n hasCustomConfig: boolean;\n externalDependencies: string[];\n}> {\n const result = {\n hasCustomConfig: false,\n } as const;\n\n const bundle = await getCustomInstrumentationBundler(entryFile, result);\n\n const { output } = await bundle.write({\n dir: outputDir,\n format: 'es',\n entryFileNames: '[name].mjs',\n sourcemap: options.sourcemap,\n });\n const externals = output[0].imports.filter(x => !x.startsWith('./'));\n\n return { ...result, externalDependencies: externals };\n}\n","import { existsSync } from 'node:fs';\nimport { stat, writeFile } from 'node:fs/promises';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { MastraBundler } from '@mastra/core/bundler';\nimport { MastraError, ErrorDomain, ErrorCategory } from '@mastra/core/error';\nimport virtual from '@rollup/plugin-virtual';\nimport * as pkg from 'empathic/package';\nimport fsExtra, { copy, ensureDir, readJSON, emptyDir } from 'fs-extra/esm';\nimport type { InputOptions, OutputOptions } from 'rollup';\nimport { glob } from 'tinyglobby';\nimport { analyzeBundle } from '../build/analyze';\nimport { createBundler as createBundlerUtil, getInputOptions } from '../build/bundler';\nimport { getBundlerOptions } from '../build/bundlerOptions';\nimport { writeCustomInstrumentation } from '../build/customInstrumentation';\nimport { writeTelemetryConfig } from '../build/telemetry';\nimport { getPackageRootPath } from '../build/utils';\nimport { DepsService } from '../services/deps';\nimport { FileService } from '../services/fs';\nimport {\n collectTransitiveWorkspaceDependencies,\n getWorkspaceInformation,\n packWorkspaceDependencies,\n} from './workspaceDependencies';\n\nexport abstract class Bundler extends MastraBundler {\n protected analyzeOutputDir = '.build';\n protected outputDir = 'output';\n\n constructor(name: string, component: 'BUNDLER' | 'DEPLOYER' = 'BUNDLER') {\n super({ name, component });\n }\n\n async prepare(outputDirectory: string): Promise<void> {\n // Clean up the output directory first\n await emptyDir(outputDirectory);\n\n await ensureDir(join(outputDirectory, this.analyzeOutputDir));\n await ensureDir(join(outputDirectory, this.outputDir));\n }\n\n async writeInstrumentationFile(outputDirectory: string, customInstrumentationFile?: string) {\n const instrumentationFile = join(outputDirectory, 'instrumentation.mjs');\n const __dirname = dirname(fileURLToPath(import.meta.url));\n\n if (customInstrumentationFile) {\n await copy(customInstrumentationFile, instrumentationFile);\n } else {\n await copy(join(__dirname, 'templates', 'instrumentation-template.js'), instrumentationFile);\n }\n }\n\n async writePackageJson(\n outputDirectory: string,\n dependencies: Map<string, string>,\n resolutions?: Record<string, string>,\n ) {\n this.logger.debug(`Writing project's package.json`);\n\n await ensureDir(outputDirectory);\n const pkgPath = join(outputDirectory, 'package.json');\n\n const dependenciesMap = new Map();\n for (const [key, value] of dependencies.entries()) {\n if (key.startsWith('@')) {\n // Handle scoped packages (e.g. @org/package)\n const pkgChunks = key.split('/');\n dependenciesMap.set(`${pkgChunks[0]}/${pkgChunks[1]}`, value);\n } else {\n // For non-scoped packages, take only the first part before any slash\n const pkgName = key.split('/')[0] || key;\n dependenciesMap.set(pkgName, value);\n }\n }\n\n // add telemetry dependencies\n dependenciesMap.set('@opentelemetry/core', '^2.0.1');\n dependenciesMap.set('@opentelemetry/api', '^1.9.0');\n dependenciesMap.set('@opentelemetry/auto-instrumentations-node', '^0.59.0');\n dependenciesMap.set('@opentelemetry/exporter-trace-otlp-grpc', '^0.201.0');\n dependenciesMap.set('@opentelemetry/exporter-trace-otlp-http', '^0.201.0');\n dependenciesMap.set('@opentelemetry/resources', '^2.0.1');\n dependenciesMap.set('@opentelemetry/sdk-node', '^0.201.0');\n dependenciesMap.set('@opentelemetry/sdk-trace-base', '^2.0.1');\n dependenciesMap.set('@opentelemetry/semantic-conventions', '^1.33.0');\n dependenciesMap.set('@opentelemetry/instrumentation', '^0.202.0');\n\n await writeFile(\n pkgPath,\n JSON.stringify(\n {\n name: 'server',\n version: '1.0.0',\n description: '',\n type: 'module',\n main: 'index.mjs',\n scripts: {\n start: 'node --import=./instrumentation.mjs --import=@opentelemetry/instrumentation/hook.mjs ./index.mjs',\n },\n author: 'Mastra',\n license: 'ISC',\n dependencies: Object.fromEntries(dependenciesMap.entries()),\n ...(Object.keys(resolutions ?? {}).length > 0 && { resolutions }),\n pnpm: {\n neverBuiltDependencies: [],\n },\n },\n null,\n 2,\n ),\n );\n }\n\n protected createBundler(inputOptions: InputOptions, outputOptions: Partial<OutputOptions> & { dir: string }) {\n return createBundlerUtil(inputOptions, outputOptions);\n }\n\n protected async analyze(\n entry: string | string[],\n mastraFile: string,\n outputDirectory: string,\n { enableEsmShim = true }: { enableEsmShim?: boolean } = {},\n ) {\n return await analyzeBundle(\n ([] as string[]).concat(entry),\n mastraFile,\n {\n outputDir: join(outputDirectory, this.analyzeOutputDir),\n projectRoot: outputDirectory,\n platform: 'node',\n bundlerOptions: {\n enableEsmShim,\n },\n },\n this.logger,\n );\n }\n\n protected async installDependencies(outputDirectory: string, rootDir = process.cwd()) {\n const deps = new DepsService(rootDir);\n deps.__setLogger(this.logger);\n\n await deps.install({ dir: join(outputDirectory, this.outputDir) });\n }\n\n protected async copyPublic(mastraDir: string, outputDirectory: string) {\n const publicDir = join(mastraDir, 'public');\n\n try {\n await stat(publicDir);\n } catch {\n return;\n }\n\n await copy(publicDir, join(outputDirectory, this.outputDir));\n }\n\n protected async copyDOTNPMRC({\n rootDir = process.cwd(),\n outputDirectory,\n }: {\n rootDir?: string;\n outputDirectory: string;\n }) {\n const sourceDotNpmRcPath = join(rootDir, '.npmrc');\n const targetDotNpmRcPath = join(outputDirectory, this.outputDir, '.npmrc');\n\n try {\n await stat(sourceDotNpmRcPath);\n await copy(sourceDotNpmRcPath, targetDotNpmRcPath);\n } catch {\n return;\n }\n }\n\n protected async getBundlerOptions(\n serverFile: string,\n mastraEntryFile: string,\n analyzedBundleInfo: Awaited<ReturnType<typeof analyzeBundle>>,\n toolsPaths: (string | string[])[],\n { enableSourcemap = false, enableEsmShim = true }: { enableSourcemap?: boolean; enableEsmShim?: boolean } = {},\n ) {\n const { workspaceRoot } = await getWorkspaceInformation({ mastraEntryFile });\n const closestPkgJson = pkg.up({ cwd: dirname(mastraEntryFile) });\n const projectRoot = closestPkgJson ? dirname(closestPkgJson) : process.cwd();\n\n const inputOptions: InputOptions = await getInputOptions(\n mastraEntryFile,\n analyzedBundleInfo,\n 'node',\n {\n 'process.env.NODE_ENV': JSON.stringify('production'),\n },\n { sourcemap: enableSourcemap, workspaceRoot, projectRoot, enableEsmShim },\n );\n const isVirtual = serverFile.includes('\\n') || existsSync(serverFile);\n\n const toolsInputOptions = await this.getToolsInputOptions(toolsPaths);\n\n if (isVirtual) {\n inputOptions.input = { index: '#entry', ...toolsInputOptions };\n\n if (Array.isArray(inputOptions.plugins)) {\n inputOptions.plugins.unshift(virtual({ '#entry': serverFile }));\n } else {\n inputOptions.plugins = [virtual({ '#entry': serverFile })];\n }\n } else {\n inputOptions.input = { index: serverFile, ...toolsInputOptions };\n }\n\n return inputOptions;\n }\n\n async getToolsInputOptions(toolsPaths: (string | string[])[]) {\n const inputs: Record<string, string> = {};\n\n for (const toolPath of toolsPaths) {\n const expandedPaths = await glob(toolPath, {\n absolute: true,\n expandDirectories: false,\n });\n\n for (const path of expandedPaths) {\n if (await fsExtra.pathExists(path)) {\n const fileService = new FileService();\n const entryFile = fileService.getFirstExistingFile([\n join(path, 'index.ts'),\n join(path, 'index.js'),\n path, // if path itself is a file\n ]);\n\n // if it doesn't exist or is a dir skip it. using a dir as a tool will crash the process\n if (!entryFile || (await stat(entryFile)).isDirectory()) {\n this.logger.warn(`No entry file found in ${path}, skipping...`);\n continue;\n }\n\n const uniqueToolID = crypto.randomUUID();\n // Normalize Windows paths to forward slashes for consistent handling\n const normalizedEntryFile = entryFile.replaceAll('\\\\', '/');\n inputs[`tools/${uniqueToolID}`] = normalizedEntryFile;\n } else {\n this.logger.warn(`Tool path ${path} does not exist, skipping...`);\n }\n }\n }\n\n return inputs;\n }\n\n protected async _bundle(\n serverFile: string,\n mastraEntryFile: string,\n {\n projectRoot,\n outputDirectory,\n enableEsmShim = true,\n }: { projectRoot: string; outputDirectory: string; enableEsmShim?: boolean },\n toolsPaths: (string | string[])[] = [],\n bundleLocation: string = join(outputDirectory, this.outputDir),\n ): Promise<void> {\n const analyzeDir = join(outputDirectory, this.analyzeOutputDir);\n let sourcemap = false;\n\n try {\n const bundlerOptions = await getBundlerOptions(mastraEntryFile, analyzeDir);\n sourcemap = !!bundlerOptions?.sourcemap;\n } catch (error) {\n this.logger.debug('Failed to get bundler options, sourcemap will be disabled', { error });\n }\n\n let analyzedBundleInfo;\n try {\n const resolvedToolsPaths = await this.getToolsInputOptions(toolsPaths);\n analyzedBundleInfo = await analyzeBundle(\n [serverFile, ...Object.values(resolvedToolsPaths)],\n mastraEntryFile,\n {\n outputDir: analyzeDir,\n projectRoot,\n platform: 'node',\n bundlerOptions: {\n enableEsmShim,\n },\n },\n this.logger,\n );\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new MastraError(\n {\n id: 'DEPLOYER_BUNDLER_ANALYZE_FAILED',\n text: `Failed to analyze Mastra application: ${message}`,\n domain: ErrorDomain.DEPLOYER,\n category: ErrorCategory.SYSTEM,\n },\n error,\n );\n }\n\n let externalDependencies: string[];\n try {\n const result = await writeTelemetryConfig(mastraEntryFile, join(outputDirectory, this.outputDir));\n\n externalDependencies = result?.externalDependencies ?? [];\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new MastraError(\n {\n id: 'DEPLOYER_BUNDLER_TELEMETRY_FAILED',\n text: `Failed to write telemetry config: ${message}`,\n domain: ErrorDomain.DEPLOYER,\n category: ErrorCategory.SYSTEM,\n },\n error,\n );\n }\n\n const mastraFolder = dirname(mastraEntryFile);\n\n const fileService = new FileService();\n const customInstrumentation = fileService.getFirstExistingFileOrUndefined([\n join(mastraFolder, 'instrumentation.js'),\n join(mastraFolder, 'instrumentation.ts'),\n join(mastraFolder, 'instrumentation.mjs'),\n ]);\n\n try {\n if (customInstrumentation) {\n const result = await writeCustomInstrumentation(customInstrumentation, join(outputDirectory, this.outputDir), {\n sourcemap,\n });\n externalDependencies = [...externalDependencies, ...result.externalDependencies];\n await this.writeInstrumentationFile(join(outputDirectory, this.outputDir), customInstrumentation);\n } else {\n await this.writeInstrumentationFile(join(outputDirectory, this.outputDir));\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new MastraError(\n {\n id: 'DEPLOYER_BUNDLER_INSTRUMENTATION_FILE_FAILED',\n text: `Failed to write instrumentation file: ${message}, ${customInstrumentation ? ` Found custom instrumentation file: ${customInstrumentation}` : ''}`,\n domain: ErrorDomain.DEPLOYER,\n category: ErrorCategory.SYSTEM,\n },\n error,\n );\n }\n\n const dependenciesToInstall = new Map<string, string>();\n\n // Add extenal dependencies from telemetry file\n for (const external of externalDependencies) {\n dependenciesToInstall.set(external, 'latest');\n }\n\n const workspaceDependencies = new Set<string>();\n for (const dep of analyzedBundleInfo.externalDependencies) {\n try {\n if (analyzedBundleInfo.workspaceMap.has(dep)) {\n workspaceDependencies.add(dep);\n continue;\n }\n\n const rootPath = await getPackageRootPath(dep);\n const pkg = await readJSON(`${rootPath}/package.json`);\n\n dependenciesToInstall.set(dep, pkg.version || 'latest');\n } catch {\n dependenciesToInstall.set(dep, 'latest');\n }\n }\n\n let resolutions: Record<string, string> = {};\n if (workspaceDependencies.size > 0) {\n try {\n const result = collectTransitiveWorkspaceDependencies({\n workspaceMap: analyzedBundleInfo.workspaceMap,\n initialDependencies: workspaceDependencies,\n logger: this.logger,\n });\n resolutions = result.resolutions;\n\n // Update dependenciesToInstall with the resolved TGZ paths\n Object.entries(resolutions).forEach(([pkgName, tgzPath]) => {\n dependenciesToInstall.set(pkgName, tgzPath);\n });\n\n await packWorkspaceDependencies({\n workspaceMap: analyzedBundleInfo.workspaceMap,\n usedWorkspacePackages: result.usedWorkspacePackages,\n bundleOutputDir: join(outputDirectory, this.outputDir),\n logger: this.logger,\n });\n } catch (error) {\n throw new MastraError(\n {\n id: 'DEPLOYER_BUNDLER_WORKSPACE_DEPS_FAILED',\n text: `Failed to collect and pack workspace dependencies.`,\n domain: ErrorDomain.DEPLOYER,\n category: ErrorCategory.USER,\n },\n error,\n );\n }\n }\n\n try {\n await this.writePackageJson(join(outputDirectory, this.outputDir), dependenciesToInstall, resolutions);\n\n this.logger.info('Bundling Mastra application');\n const inputOptions: InputOptions = await this.getBundlerOptions(\n serverFile,\n mastraEntryFile,\n analyzedBundleInfo,\n toolsPaths,\n { enableSourcemap: sourcemap, enableEsmShim: false },\n );\n\n const bundler = await this.createBundler(\n {\n ...inputOptions,\n logLevel: inputOptions.logLevel === 'silent' ? 'warn' : inputOptions.logLevel,\n onwarn: warning => {\n if (warning.code === 'CIRCULAR_DEPENDENCY') {\n if (warning.ids?.[0]?.includes('node_modules')) {\n return;\n }\n\n this.logger.warn(`Circular dependency found:\n\\t${warning.message.replace('Circular dependency: ', '')}`);\n }\n },\n },\n {\n dir: bundleLocation,\n manualChunks: {\n mastra: ['#mastra'],\n },\n sourcemap,\n },\n );\n\n await bundler.write();\n const toolImports: string[] = [];\n const toolsExports: string[] = [];\n Array.from(Object.keys(inputOptions.input || {}))\n .filter(key => key.startsWith('tools/'))\n .forEach((key, index) => {\n const toolExport = `tool${index}`;\n toolImports.push(`import * as ${toolExport} from './${key}.mjs';`);\n toolsExports.push(toolExport);\n });\n\n await writeFile(\n join(bundleLocation, 'tools.mjs'),\n `${toolImports.join('\\n')}\n\nexport const tools = [${toolsExports.join(', ')}]`,\n );\n this.logger.info('Bundling Mastra done');\n\n this.logger.info('Copying public files');\n await this.copyPublic(dirname(mastraEntryFile), outputDirectory);\n this.logger.info('Done copying public files');\n\n this.logger.info('Copying .npmrc file');\n await this.copyDOTNPMRC({ outputDirectory, rootDir: projectRoot });\n\n this.logger.info('Done copying .npmrc file');\n\n this.logger.info('Installing dependencies');\n await this.installDependencies(outputDirectory, projectRoot);\n\n this.logger.info('Done installing dependencies');\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new MastraError(\n {\n id: 'DEPLOYER_BUNDLER_BUNDLE_STAGE_FAILED',\n text: `Failed during bundler bundle stage: ${message}`,\n domain: ErrorDomain.DEPLOYER,\n category: ErrorCategory.SYSTEM,\n },\n error,\n );\n }\n }\n\n async lint(_entryFile: string, _outputDirectory: string, toolsPaths: (string | string[])[]): Promise<void> {\n const toolsInputOptions = await this.getToolsInputOptions(toolsPaths);\n const toolsLength = Object.keys(toolsInputOptions).length;\n if (toolsLength > 0) {\n this.logger.info(`Found ${toolsLength} ${toolsLength === 1 ? 'tool' : 'tools'}`);\n }\n }\n}\n"]}
|
package/dist/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkDCDNHNNC_cjs = require('./chunk-DCDNHNNC.cjs');
|
|
4
|
+
var chunk2TROY6ZL_cjs = require('./chunk-2TROY6ZL.cjs');
|
|
5
5
|
var chunk3JYRSECU_cjs = require('./chunk-3JYRSECU.cjs');
|
|
6
6
|
|
|
7
7
|
// src/deploy/base.ts
|
|
8
|
-
var Deployer = class extends
|
|
8
|
+
var Deployer = class extends chunkDCDNHNNC_cjs.Bundler {
|
|
9
9
|
deps = new chunk3JYRSECU_cjs.DepsService();
|
|
10
10
|
constructor(args) {
|
|
11
11
|
super(args.name, "DEPLOYER");
|
|
@@ -25,12 +25,12 @@ var Deployer = class extends chunk75YMBRRS_cjs.Bundler {
|
|
|
25
25
|
|
|
26
26
|
// src/build/babel/remove-all-options-deployer.ts
|
|
27
27
|
function removeAllOptionsExceptDeployer(result, logger) {
|
|
28
|
-
return
|
|
28
|
+
return chunk2TROY6ZL_cjs.removeAllOptionsFromMastraExcept(result, "deployer", logger);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
// src/build/deployer.ts
|
|
32
32
|
async function getDeployer(entryFile, outputDir, logger) {
|
|
33
|
-
const result = await
|
|
33
|
+
const result = await chunk2TROY6ZL_cjs.extractMastraOption(
|
|
34
34
|
"deployer",
|
|
35
35
|
entryFile,
|
|
36
36
|
removeAllOptionsExceptDeployer,
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Bundler } from './chunk-
|
|
2
|
-
import { extractMastraOption, removeAllOptionsFromMastraExcept } from './chunk-
|
|
1
|
+
import { Bundler } from './chunk-X6AP4LE6.js';
|
|
2
|
+
import { extractMastraOption, removeAllOptionsFromMastraExcept } from './chunk-3JKL47PF.js';
|
|
3
3
|
import { DepsService, FileService } from './chunk-5QFG6SCM.js';
|
|
4
4
|
export { Deps, FileService, createChildProcessLogger, createPinoStream } from './chunk-5QFG6SCM.js';
|
|
5
5
|
|
|
@@ -4,7 +4,7 @@ export declare function getAgentCardByIdHandler(c: Context): Promise<Response &
|
|
|
4
4
|
extensions?: {
|
|
5
5
|
description?: string | undefined;
|
|
6
6
|
params?: {
|
|
7
|
-
[x: string]:
|
|
7
|
+
[x: string]: import("hono/utils/types").JSONValue;
|
|
8
8
|
} | undefined;
|
|
9
9
|
required?: boolean | undefined;
|
|
10
10
|
uri: string;
|
|
@@ -93,10 +93,10 @@ export declare function getAgentsHandler(c: Context): Promise<Response & import(
|
|
|
93
93
|
};
|
|
94
94
|
}[] | undefined;
|
|
95
95
|
defaultGenerateOptions?: {
|
|
96
|
-
[x: string]:
|
|
96
|
+
[x: string]: import("hono/utils/types").JSONValue;
|
|
97
97
|
} | undefined;
|
|
98
98
|
defaultStreamOptions?: {
|
|
99
|
-
[x: string]:
|
|
99
|
+
[x: string]: import("hono/utils/types").JSONValue;
|
|
100
100
|
} | undefined;
|
|
101
101
|
};
|
|
102
102
|
}, import("hono/utils/http-status").ContentfulStatusCode, "json">>;
|
|
@@ -192,10 +192,10 @@ export declare function getAgentByIdHandler(c: Context): Promise<Response & impo
|
|
|
192
192
|
};
|
|
193
193
|
}[] | undefined;
|
|
194
194
|
defaultGenerateOptions?: {
|
|
195
|
-
[x: string]:
|
|
195
|
+
[x: string]: import("hono/utils/types").JSONValue;
|
|
196
196
|
} | undefined;
|
|
197
197
|
defaultStreamOptions?: {
|
|
198
|
-
[x: string]:
|
|
198
|
+
[x: string]: import("hono/utils/types").JSONValue;
|
|
199
199
|
} | undefined;
|
|
200
200
|
}, import("hono/utils/http-status").ContentfulStatusCode, "json">>;
|
|
201
201
|
export declare function getEvalsByAgentIdHandler(c: Context): Promise<Response & import("hono").TypedResponse<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../../src/server/handlers/routes/agents/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AA2BvD,wBAAgB,YAAY,CAAC,gBAAgB,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../../src/server/handlers/routes/agents/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AA2BvD,wBAAgB,YAAY,CAAC,gBAAgB,EAAE,gBAAgB,8EAy4C9D;AAED,wBAAgB,eAAe,CAAC,gBAAgB,EAAE,gBAAgB,8EAyHjE"}
|
|
@@ -6,30 +6,30 @@ export declare function getScorerHandler(c: Context): Promise<Response & import(
|
|
|
6
6
|
name: any;
|
|
7
7
|
description: string;
|
|
8
8
|
judge?: {
|
|
9
|
-
model: {
|
|
9
|
+
model: import("@mastra/core/llm/model").ModelRouterModelId | {
|
|
10
10
|
readonly specificationVersion: "v1";
|
|
11
11
|
readonly provider: string;
|
|
12
12
|
readonly modelId: string;
|
|
13
13
|
readonly defaultObjectGenerationMode: "tool" | "json" | undefined;
|
|
14
14
|
readonly supportsImageUrls?: boolean | undefined;
|
|
15
15
|
readonly supportsStructuredOutputs?: boolean | undefined;
|
|
16
|
-
supportsUrl?:
|
|
17
|
-
doGenerate:
|
|
18
|
-
doStream:
|
|
16
|
+
supportsUrl?: undefined;
|
|
17
|
+
doGenerate: never;
|
|
18
|
+
doStream: never;
|
|
19
19
|
} | {
|
|
20
20
|
readonly specificationVersion: "v2";
|
|
21
21
|
readonly provider: string;
|
|
22
22
|
readonly modelId: string;
|
|
23
23
|
supportedUrls: {
|
|
24
24
|
[x: string]: {
|
|
25
|
-
exec:
|
|
26
|
-
test:
|
|
25
|
+
exec: never;
|
|
26
|
+
test: never;
|
|
27
27
|
readonly source: string;
|
|
28
28
|
readonly global: boolean;
|
|
29
29
|
readonly ignoreCase: boolean;
|
|
30
30
|
readonly multiline: boolean;
|
|
31
31
|
lastIndex: number;
|
|
32
|
-
compile:
|
|
32
|
+
compile: never;
|
|
33
33
|
readonly flags: string;
|
|
34
34
|
readonly sticky: boolean;
|
|
35
35
|
readonly unicode: boolean;
|
|
@@ -37,10 +37,25 @@ export declare function getScorerHandler(c: Context): Promise<Response & import(
|
|
|
37
37
|
readonly hasIndices: boolean;
|
|
38
38
|
}[];
|
|
39
39
|
} | {
|
|
40
|
-
then:
|
|
40
|
+
then: never;
|
|
41
41
|
};
|
|
42
|
-
doGenerate:
|
|
43
|
-
doStream:
|
|
42
|
+
doGenerate: never;
|
|
43
|
+
doStream: never;
|
|
44
|
+
} | {
|
|
45
|
+
id: `${string}/${string}`;
|
|
46
|
+
url?: string | undefined;
|
|
47
|
+
apiKey?: string | undefined;
|
|
48
|
+
headers?: {
|
|
49
|
+
[x: string]: string;
|
|
50
|
+
} | undefined;
|
|
51
|
+
} | {
|
|
52
|
+
providerId: string;
|
|
53
|
+
modelId: string;
|
|
54
|
+
url?: string | undefined;
|
|
55
|
+
apiKey?: string | undefined;
|
|
56
|
+
headers?: {
|
|
57
|
+
[x: string]: string;
|
|
58
|
+
} | undefined;
|
|
44
59
|
};
|
|
45
60
|
instructions: string;
|
|
46
61
|
} | undefined;
|
|
@@ -50,7 +65,7 @@ export declare function getScorerHandler(c: Context): Promise<Response & import(
|
|
|
50
65
|
readonly _output: any;
|
|
51
66
|
readonly _input: any;
|
|
52
67
|
readonly _def: {
|
|
53
|
-
errorMap?:
|
|
68
|
+
errorMap?: undefined;
|
|
54
69
|
description?: string | undefined | undefined;
|
|
55
70
|
};
|
|
56
71
|
readonly description: string | undefined;
|
|
@@ -62,34 +77,34 @@ export declare function getScorerHandler(c: Context): Promise<Response & import(
|
|
|
62
77
|
readonly output: any;
|
|
63
78
|
} | undefined;
|
|
64
79
|
};
|
|
65
|
-
_parse:
|
|
66
|
-
_getType:
|
|
67
|
-
_getOrReturnCtx:
|
|
68
|
-
_processInputParams:
|
|
69
|
-
_parseSync:
|
|
70
|
-
_parseAsync:
|
|
71
|
-
parse:
|
|
72
|
-
safeParse:
|
|
73
|
-
parseAsync:
|
|
74
|
-
safeParseAsync:
|
|
75
|
-
spa:
|
|
76
|
-
refine:
|
|
77
|
-
refinement:
|
|
78
|
-
_refinement:
|
|
79
|
-
superRefine:
|
|
80
|
-
or:
|
|
81
|
-
and:
|
|
82
|
-
transform:
|
|
83
|
-
brand:
|
|
84
|
-
describe:
|
|
85
|
-
pipe:
|
|
80
|
+
_parse: never;
|
|
81
|
+
_getType: never;
|
|
82
|
+
_getOrReturnCtx: never;
|
|
83
|
+
_processInputParams: never;
|
|
84
|
+
_parseSync: never;
|
|
85
|
+
_parseAsync: never;
|
|
86
|
+
parse: never;
|
|
87
|
+
safeParse: never;
|
|
88
|
+
parseAsync: never;
|
|
89
|
+
safeParseAsync: never;
|
|
90
|
+
spa: never;
|
|
91
|
+
refine: never;
|
|
92
|
+
refinement: never;
|
|
93
|
+
_refinement: never;
|
|
94
|
+
superRefine: never;
|
|
95
|
+
or: never;
|
|
96
|
+
and: never;
|
|
97
|
+
transform: never;
|
|
98
|
+
brand: never;
|
|
99
|
+
describe: never;
|
|
100
|
+
pipe: never;
|
|
86
101
|
};
|
|
87
102
|
output: {
|
|
88
103
|
readonly _type: any;
|
|
89
104
|
readonly _output: any;
|
|
90
105
|
readonly _input: any;
|
|
91
106
|
readonly _def: {
|
|
92
|
-
errorMap?:
|
|
107
|
+
errorMap?: undefined;
|
|
93
108
|
description?: string | undefined | undefined;
|
|
94
109
|
};
|
|
95
110
|
readonly description: string | undefined;
|
|
@@ -101,27 +116,27 @@ export declare function getScorerHandler(c: Context): Promise<Response & import(
|
|
|
101
116
|
readonly output: any;
|
|
102
117
|
} | undefined;
|
|
103
118
|
};
|
|
104
|
-
_parse:
|
|
105
|
-
_getType:
|
|
106
|
-
_getOrReturnCtx:
|
|
107
|
-
_processInputParams:
|
|
108
|
-
_parseSync:
|
|
109
|
-
_parseAsync:
|
|
110
|
-
parse:
|
|
111
|
-
safeParse:
|
|
112
|
-
parseAsync:
|
|
113
|
-
safeParseAsync:
|
|
114
|
-
spa:
|
|
115
|
-
refine:
|
|
116
|
-
refinement:
|
|
117
|
-
_refinement:
|
|
118
|
-
superRefine:
|
|
119
|
-
or:
|
|
120
|
-
and:
|
|
121
|
-
transform:
|
|
122
|
-
brand:
|
|
123
|
-
describe:
|
|
124
|
-
pipe:
|
|
119
|
+
_parse: never;
|
|
120
|
+
_getType: never;
|
|
121
|
+
_getOrReturnCtx: never;
|
|
122
|
+
_processInputParams: never;
|
|
123
|
+
_parseSync: never;
|
|
124
|
+
_parseAsync: never;
|
|
125
|
+
parse: never;
|
|
126
|
+
safeParse: never;
|
|
127
|
+
parseAsync: never;
|
|
128
|
+
safeParseAsync: never;
|
|
129
|
+
spa: never;
|
|
130
|
+
refine: never;
|
|
131
|
+
refinement: never;
|
|
132
|
+
_refinement: never;
|
|
133
|
+
superRefine: never;
|
|
134
|
+
or: never;
|
|
135
|
+
and: never;
|
|
136
|
+
transform: never;
|
|
137
|
+
brand: never;
|
|
138
|
+
describe: never;
|
|
139
|
+
pipe: never;
|
|
125
140
|
};
|
|
126
141
|
} | undefined;
|
|
127
142
|
};
|
|
@@ -131,7 +146,7 @@ export declare function getScorerHandler(c: Context): Promise<Response & import(
|
|
|
131
146
|
readonly _output: any;
|
|
132
147
|
readonly _input: any;
|
|
133
148
|
readonly _def: {
|
|
134
|
-
errorMap?:
|
|
149
|
+
errorMap?: undefined;
|
|
135
150
|
description?: string | undefined | undefined;
|
|
136
151
|
};
|
|
137
152
|
readonly description: string | undefined;
|
|
@@ -143,34 +158,34 @@ export declare function getScorerHandler(c: Context): Promise<Response & import(
|
|
|
143
158
|
readonly output: any;
|
|
144
159
|
} | undefined;
|
|
145
160
|
};
|
|
146
|
-
_parse:
|
|
147
|
-
_getType:
|
|
148
|
-
_getOrReturnCtx:
|
|
149
|
-
_processInputParams:
|
|
150
|
-
_parseSync:
|
|
151
|
-
_parseAsync:
|
|
152
|
-
parse:
|
|
153
|
-
safeParse:
|
|
154
|
-
parseAsync:
|
|
155
|
-
safeParseAsync:
|
|
156
|
-
spa:
|
|
157
|
-
refine:
|
|
158
|
-
refinement:
|
|
159
|
-
_refinement:
|
|
160
|
-
superRefine:
|
|
161
|
-
or:
|
|
162
|
-
and:
|
|
163
|
-
transform:
|
|
164
|
-
brand:
|
|
165
|
-
describe:
|
|
166
|
-
pipe:
|
|
161
|
+
_parse: never;
|
|
162
|
+
_getType: never;
|
|
163
|
+
_getOrReturnCtx: never;
|
|
164
|
+
_processInputParams: never;
|
|
165
|
+
_parseSync: never;
|
|
166
|
+
_parseAsync: never;
|
|
167
|
+
parse: never;
|
|
168
|
+
safeParse: never;
|
|
169
|
+
parseAsync: never;
|
|
170
|
+
safeParseAsync: never;
|
|
171
|
+
spa: never;
|
|
172
|
+
refine: never;
|
|
173
|
+
refinement: never;
|
|
174
|
+
_refinement: never;
|
|
175
|
+
superRefine: never;
|
|
176
|
+
or: never;
|
|
177
|
+
and: never;
|
|
178
|
+
transform: never;
|
|
179
|
+
brand: never;
|
|
180
|
+
describe: never;
|
|
181
|
+
pipe: never;
|
|
167
182
|
};
|
|
168
183
|
output: {
|
|
169
184
|
readonly _type: any;
|
|
170
185
|
readonly _output: any;
|
|
171
186
|
readonly _input: any;
|
|
172
187
|
readonly _def: {
|
|
173
|
-
errorMap?:
|
|
188
|
+
errorMap?: undefined;
|
|
174
189
|
description?: string | undefined | undefined;
|
|
175
190
|
};
|
|
176
191
|
readonly description: string | undefined;
|
|
@@ -182,56 +197,56 @@ export declare function getScorerHandler(c: Context): Promise<Response & import(
|
|
|
182
197
|
readonly output: any;
|
|
183
198
|
} | undefined;
|
|
184
199
|
};
|
|
185
|
-
_parse:
|
|
186
|
-
_getType:
|
|
187
|
-
_getOrReturnCtx:
|
|
188
|
-
_processInputParams:
|
|
189
|
-
_parseSync:
|
|
190
|
-
_parseAsync:
|
|
191
|
-
parse:
|
|
192
|
-
safeParse:
|
|
193
|
-
parseAsync:
|
|
194
|
-
safeParseAsync:
|
|
195
|
-
spa:
|
|
196
|
-
refine:
|
|
197
|
-
refinement:
|
|
198
|
-
_refinement:
|
|
199
|
-
superRefine:
|
|
200
|
-
or:
|
|
201
|
-
and:
|
|
202
|
-
transform:
|
|
203
|
-
brand:
|
|
204
|
-
describe:
|
|
205
|
-
pipe:
|
|
200
|
+
_parse: never;
|
|
201
|
+
_getType: never;
|
|
202
|
+
_getOrReturnCtx: never;
|
|
203
|
+
_processInputParams: never;
|
|
204
|
+
_parseSync: never;
|
|
205
|
+
_parseAsync: never;
|
|
206
|
+
parse: never;
|
|
207
|
+
safeParse: never;
|
|
208
|
+
parseAsync: never;
|
|
209
|
+
safeParseAsync: never;
|
|
210
|
+
spa: never;
|
|
211
|
+
refine: never;
|
|
212
|
+
refinement: never;
|
|
213
|
+
_refinement: never;
|
|
214
|
+
superRefine: never;
|
|
215
|
+
or: never;
|
|
216
|
+
and: never;
|
|
217
|
+
transform: never;
|
|
218
|
+
brand: never;
|
|
219
|
+
describe: never;
|
|
220
|
+
pipe: never;
|
|
206
221
|
};
|
|
207
222
|
} | undefined;
|
|
208
223
|
readonly name: any;
|
|
209
224
|
readonly description: string;
|
|
210
225
|
readonly judge: {
|
|
211
|
-
model: {
|
|
226
|
+
model: import("@mastra/core/llm/model").ModelRouterModelId | {
|
|
212
227
|
readonly specificationVersion: "v1";
|
|
213
228
|
readonly provider: string;
|
|
214
229
|
readonly modelId: string;
|
|
215
230
|
readonly defaultObjectGenerationMode: "tool" | "json" | undefined;
|
|
216
231
|
readonly supportsImageUrls?: boolean | undefined;
|
|
217
232
|
readonly supportsStructuredOutputs?: boolean | undefined;
|
|
218
|
-
supportsUrl?:
|
|
219
|
-
doGenerate:
|
|
220
|
-
doStream:
|
|
233
|
+
supportsUrl?: undefined;
|
|
234
|
+
doGenerate: never;
|
|
235
|
+
doStream: never;
|
|
221
236
|
} | {
|
|
222
237
|
readonly specificationVersion: "v2";
|
|
223
238
|
readonly provider: string;
|
|
224
239
|
readonly modelId: string;
|
|
225
240
|
supportedUrls: {
|
|
226
241
|
[x: string]: {
|
|
227
|
-
exec:
|
|
228
|
-
test:
|
|
242
|
+
exec: never;
|
|
243
|
+
test: never;
|
|
229
244
|
readonly source: string;
|
|
230
245
|
readonly global: boolean;
|
|
231
246
|
readonly ignoreCase: boolean;
|
|
232
247
|
readonly multiline: boolean;
|
|
233
248
|
lastIndex: number;
|
|
234
|
-
compile:
|
|
249
|
+
compile: never;
|
|
235
250
|
readonly flags: string;
|
|
236
251
|
readonly sticky: boolean;
|
|
237
252
|
readonly unicode: boolean;
|
|
@@ -239,18 +254,33 @@ export declare function getScorerHandler(c: Context): Promise<Response & import(
|
|
|
239
254
|
readonly hasIndices: boolean;
|
|
240
255
|
}[];
|
|
241
256
|
} | {
|
|
242
|
-
then:
|
|
257
|
+
then: never;
|
|
243
258
|
};
|
|
244
|
-
doGenerate:
|
|
245
|
-
doStream:
|
|
259
|
+
doGenerate: never;
|
|
260
|
+
doStream: never;
|
|
261
|
+
} | {
|
|
262
|
+
id: `${string}/${string}`;
|
|
263
|
+
url?: string | undefined;
|
|
264
|
+
apiKey?: string | undefined;
|
|
265
|
+
headers?: {
|
|
266
|
+
[x: string]: string;
|
|
267
|
+
} | undefined;
|
|
268
|
+
} | {
|
|
269
|
+
providerId: string;
|
|
270
|
+
modelId: string;
|
|
271
|
+
url?: string | undefined;
|
|
272
|
+
apiKey?: string | undefined;
|
|
273
|
+
headers?: {
|
|
274
|
+
[x: string]: string;
|
|
275
|
+
} | undefined;
|
|
246
276
|
};
|
|
247
277
|
instructions: string;
|
|
248
278
|
} | undefined;
|
|
249
|
-
preprocess:
|
|
250
|
-
analyze:
|
|
251
|
-
generateScore:
|
|
252
|
-
generateReason:
|
|
253
|
-
run:
|
|
279
|
+
preprocess: never;
|
|
280
|
+
analyze: never;
|
|
281
|
+
generateScore: never;
|
|
282
|
+
generateReason: never;
|
|
283
|
+
run: never;
|
|
254
284
|
};
|
|
255
285
|
sampling?: {
|
|
256
286
|
type: "none";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../../../../src/server/handlers/routes/scores/handlers.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAGpC,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,OAAO,qBAUjD;AAED,wBAAsB,gBAAgB,CAAC,CAAC,EAAE,OAAO
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../../../../src/server/handlers/routes/scores/handlers.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAGpC,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,OAAO,qBAUjD;AAED,wBAAsB,gBAAgB,CAAC,CAAC,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0EAYhD;AAED,wBAAsB,uBAAuB,CAAC,CAAC,EAAE,OAAO,qBAkBvD;AAED,wBAAsB,0BAA0B,CAAC,CAAC,EAAE,OAAO,qBAsB1D;AAED,wBAAsB,0BAA0B,CAAC,CAAC,EAAE,OAAO,qBAqB1D;AAED,wBAAsB,gBAAgB,CAAC,CAAC,EAAE,OAAO,qBAchD"}
|