diff --git a/@packages/model-boss-mcp/tsup.config.ts b/@packages/model-boss-mcp/tsup.config.ts index 34e1a97..eea13cf 100644 --- a/@packages/model-boss-mcp/tsup.config.ts +++ b/@packages/model-boss-mcp/tsup.config.ts @@ -35,12 +35,17 @@ export default defineConfig({ }; }); - // ajv-formats requires ajv v8 deep paths (ajv/dist/compile/codegen). - // The workspace has ajv v6 which doesn't have this structure. - // The MCP SDK loads ajv validation lazily and this server never uses it, - // so mark these deep requires as external (they'll never be called at runtime). - build.onResolve({ filter: /^ajv\/dist\// }, () => { - return { path: 'ajv/dist/compile/codegen', external: true }; + // ajv-formats requires ajv v8 (ajv/dist/compile/codegen) which isn't + // installed. The MCP SDK loads ajv validation lazily and this server + // never invokes it. Stub ajv-formats entirely. + build.onResolve({ filter: /^ajv-formats/ }, (args) => { + return { path: args.path, namespace: 'ajv-stub' }; + }); + build.onResolve({ filter: /^ajv\/dist\// }, (args) => { + return { path: args.path, namespace: 'ajv-stub' }; + }); + build.onLoad({ filter: /.*/, namespace: 'ajv-stub' }, () => { + return { contents: 'module.exports = function() {};', loader: 'js' }; }); }, },