mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-26 02:04:37 +08:00
Move MCP Server logic (tool registration, resource registration, schema conversion) from apps/cli/src/mcp.ts to packages/mcp-server so both CLI and Desktop can share the same MCP implementation. - New package: chatlab-mcp (packages/mcp-server) with McpDatabaseManager interface abstraction - CLI mcp.ts slimmed to thin entry (~37 lines) calling startMcpServer() - Desktop helper prototype at apps/desktop/helper/mcp.ts for dev-time MCP without GUI - All 8 MCP tools and 3 resources unchanged Co-authored-by: Cursor <cursoragent@cursor.com>
29 lines
832 B
TypeScript
29 lines
832 B
TypeScript
import { defineConfig } from 'tsup'
|
|
|
|
export default defineConfig({
|
|
entry: {
|
|
cli: 'src/cli.ts',
|
|
index: 'src/index.ts',
|
|
},
|
|
format: ['esm'],
|
|
outDir: 'dist',
|
|
outExtension: () => ({ js: '.mjs' }),
|
|
splitting: true,
|
|
sourcemap: true,
|
|
clean: true,
|
|
target: 'node20',
|
|
platform: 'node',
|
|
noExternal: [/^@openchatlab\//, 'chatlab-mcp', 'stream-json'],
|
|
external: ['better-sqlite3', '@node-rs/jieba'],
|
|
banner: {
|
|
js: [
|
|
"import { createRequire as __createRequire } from 'module';",
|
|
"import { dirname as __pathDirname } from 'path';",
|
|
"import { fileURLToPath as __fileURLToPath } from 'url';",
|
|
'const require = __createRequire(import.meta.url);',
|
|
'const __filename = __fileURLToPath(import.meta.url);',
|
|
'const __dirname = __pathDirname(__filename);',
|
|
].join('\n'),
|
|
},
|
|
})
|