ace-tool 0.1.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/dist/index.js ADDED
@@ -0,0 +1,102 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Ace Tool - MCP 服务器入口
4
+ * 代码库索引和语义搜索工具
5
+ */
6
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
7
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
8
+ import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
9
+ import { initConfig } from './config.js';
10
+ import { logger } from './logger.js';
11
+ import { SEARCH_CONTEXT_TOOL } from './prompts/searchContext.js';
12
+ import { searchContextTool } from './tools/searchContext.js';
13
+ /**
14
+ * 创建 MCP 服务器
15
+ */
16
+ const server = new Server({
17
+ name: 'ace-tool',
18
+ version: '0.1.0',
19
+ }, {
20
+ capabilities: {
21
+ tools: {},
22
+ },
23
+ });
24
+ /**
25
+ * 列出可用工具
26
+ */
27
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
28
+ const tools = [
29
+ {
30
+ name: SEARCH_CONTEXT_TOOL.name,
31
+ description: SEARCH_CONTEXT_TOOL.description,
32
+ inputSchema: SEARCH_CONTEXT_TOOL.inputSchema,
33
+ },
34
+ ];
35
+ return { tools };
36
+ });
37
+ /**
38
+ * 处理工具调用
39
+ */
40
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
41
+ const { name, arguments: args } = request.params;
42
+ logger.info(`Tool called: ${name}, args: ${JSON.stringify(args)}`);
43
+ try {
44
+ if (name === 'search_context') {
45
+ const result = await searchContextTool(args);
46
+ logger.info(`Tool result: ${result?.text?.substring(0, 100)}...`);
47
+ return {
48
+ content: [
49
+ {
50
+ type: 'text',
51
+ text: result?.text || 'Error: No result returned',
52
+ },
53
+ ],
54
+ };
55
+ }
56
+ return {
57
+ content: [
58
+ {
59
+ type: 'text',
60
+ text: `Unknown tool: ${name}`,
61
+ },
62
+ ],
63
+ };
64
+ }
65
+ catch (error) {
66
+ const errorMessage = error instanceof Error ? error.message : String(error);
67
+ logger.error(`Tool execution error: ${errorMessage}`);
68
+ return {
69
+ content: [
70
+ {
71
+ type: 'text',
72
+ text: `Error: ${errorMessage}`,
73
+ },
74
+ ],
75
+ };
76
+ }
77
+ });
78
+ /**
79
+ * 主函数
80
+ */
81
+ async function main() {
82
+ try {
83
+ // 初始化配置
84
+ const config = initConfig();
85
+ logger.info('Starting ace-tool MCP server...');
86
+ logger.info(`API: ${config.baseUrl}`);
87
+ // 启动 MCP 服务器
88
+ const transport = new StdioServerTransport();
89
+ await server.connect(transport);
90
+ logger.info('MCP server connected via stdio');
91
+ }
92
+ catch (error) {
93
+ logger.exception('Server error', error);
94
+ process.exit(1);
95
+ }
96
+ }
97
+ // 运行主函数
98
+ main().catch((error) => {
99
+ console.error('Fatal error:', error);
100
+ process.exit(1);
101
+ });
102
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GAEvB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D;;GAEG;AACH,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB;IACE,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,OAAO;CACjB,EACD;IACE,YAAY,EAAE;QACZ,KAAK,EAAE,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CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5E,MAAM,CAAC,KAAK,CAAC,yBAAyB,YAAY,EAAE,CAAC,CAAC;QACtD,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,UAAU,YAAY,EAAE;iBAC/B;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC,CAAC,CAAC;AAEH;;GAEG;AACH,KAAK,UAAU,IAAI;IACjB,IAAI,CAAC;QACH,QAAQ;QACR,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;QAE5B,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;QAC/C,MAAM,CAAC,IAAI,CAAC,QAAQ,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;QAEtC,aAAa;QACb,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAEhC,MAAM,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;IAChD,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,MAAM,CAAC,SAAS,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;QACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,QAAQ;AACR,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * 日志模块 - 支持输出到项目 .ace-tool 目录
3
+ */
4
+ type LogLevel = 'debug' | 'info' | 'warning' | 'error';
5
+ export declare const logger: {
6
+ /**
7
+ * 启用日志
8
+ */
9
+ enable(): void;
10
+ /**
11
+ * 禁用日志
12
+ */
13
+ disable(): void;
14
+ /**
15
+ * 设置日志级别
16
+ */
17
+ setLevel(level: LogLevel): void;
18
+ /**
19
+ * 设置日志输出到项目的 .ace-tool 目录
20
+ * 只有在日志启用时才会创建文件
21
+ */
22
+ setProjectPath(projectRoot: string): void;
23
+ /**
24
+ * 关闭日志流
25
+ */
26
+ close(): void;
27
+ debug(message: string, ...args: unknown[]): void;
28
+ info(message: string, ...args: unknown[]): void;
29
+ warning(message: string, ...args: unknown[]): void;
30
+ error(message: string, ...args: unknown[]): void;
31
+ exception(message: string, error: unknown): void;
32
+ };
33
+ export {};
34
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,KAAK,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAiDvD,eAAO,MAAM,MAAM;IACjB;;OAEG;cACO,IAAI;IAId;;OAEG;eACQ,IAAI;IAIf;;OAEG;oBACa,QAAQ,GAAG,IAAI;IAI/B;;;OAGG;gCACyB,MAAM,GAAG,IAAI;IA4BzC;;OAEG;aACM,IAAI;mBAOE,MAAM,WAAW,OAAO,EAAE,GAAG,IAAI;kBAIlC,MAAM,WAAW,OAAO,EAAE,GAAG,IAAI;qBAI9B,MAAM,WAAW,OAAO,EAAE,GAAG,IAAI;mBAInC,MAAM,WAAW,OAAO,EAAE,GAAG,IAAI;uBAI7B,MAAM,SAAS,OAAO,GAAG,IAAI;CAQjD,CAAC"}
package/dist/logger.js ADDED
@@ -0,0 +1,116 @@
1
+ /**
2
+ * 日志模块 - 支持输出到项目 .ace-tool 目录
3
+ */
4
+ import fs from 'fs';
5
+ import path from 'path';
6
+ const LOG_LEVELS = {
7
+ debug: 0,
8
+ info: 1,
9
+ warning: 2,
10
+ error: 3
11
+ };
12
+ // 默认日志级别
13
+ let currentLevel = 'info';
14
+ // 日志是否启用(默认关闭)
15
+ let enabled = false;
16
+ // 日志文件路径
17
+ let logFilePath = null;
18
+ // 日志文件流
19
+ let logStream = null;
20
+ function formatTimestamp() {
21
+ return new Date().toISOString().replace('T', ' ').substring(0, 19);
22
+ }
23
+ function log(level, message, ...args) {
24
+ // 如果日志未启用,直接返回
25
+ if (!enabled) {
26
+ return;
27
+ }
28
+ if (LOG_LEVELS[level] < LOG_LEVELS[currentLevel]) {
29
+ return;
30
+ }
31
+ const timestamp = formatTimestamp();
32
+ const levelStr = level.toUpperCase().padEnd(7);
33
+ const formattedMessage = args.length > 0
34
+ ? `${message} ${args.map(a => JSON.stringify(a)).join(' ')}`
35
+ : message;
36
+ const logLine = `${timestamp} | ${levelStr} | ${formattedMessage}\n`;
37
+ // 如果有日志文件,写入文件
38
+ if (logStream) {
39
+ logStream.write(logLine);
40
+ }
41
+ }
42
+ export const logger = {
43
+ /**
44
+ * 启用日志
45
+ */
46
+ enable() {
47
+ enabled = true;
48
+ },
49
+ /**
50
+ * 禁用日志
51
+ */
52
+ disable() {
53
+ enabled = false;
54
+ },
55
+ /**
56
+ * 设置日志级别
57
+ */
58
+ setLevel(level) {
59
+ currentLevel = level;
60
+ },
61
+ /**
62
+ * 设置日志输出到项目的 .ace-tool 目录
63
+ * 只有在日志启用时才会创建文件
64
+ */
65
+ setProjectPath(projectRoot) {
66
+ // 如果日志未启用,不创建文件
67
+ if (!enabled) {
68
+ return;
69
+ }
70
+ const aceDir = path.join(projectRoot, '.ace-tool');
71
+ // 确保 .ace-tool 目录存在
72
+ if (!fs.existsSync(aceDir)) {
73
+ fs.mkdirSync(aceDir, { recursive: true });
74
+ }
75
+ logFilePath = path.join(aceDir, 'ace-tool.log');
76
+ // 关闭旧的流
77
+ if (logStream) {
78
+ logStream.end();
79
+ }
80
+ // 创建新的写入流(追加模式)
81
+ logStream = fs.createWriteStream(logFilePath, { flags: 'a' });
82
+ // 写入分隔线
83
+ const separator = `\n${'='.repeat(60)}\n${formatTimestamp()} | Session started\n${'='.repeat(60)}\n`;
84
+ logStream.write(separator);
85
+ },
86
+ /**
87
+ * 关闭日志流
88
+ */
89
+ close() {
90
+ if (logStream) {
91
+ logStream.end();
92
+ logStream = null;
93
+ }
94
+ },
95
+ debug(message, ...args) {
96
+ log('debug', message, ...args);
97
+ },
98
+ info(message, ...args) {
99
+ log('info', message, ...args);
100
+ },
101
+ warning(message, ...args) {
102
+ log('warning', message, ...args);
103
+ },
104
+ error(message, ...args) {
105
+ log('error', message, ...args);
106
+ },
107
+ exception(message, error) {
108
+ const errorMessage = error instanceof Error ? error.message : String(error);
109
+ const stack = error instanceof Error ? error.stack : '';
110
+ log('error', `${message}: ${errorMessage}`);
111
+ if (stack && logStream) {
112
+ logStream.write(stack + '\n');
113
+ }
114
+ }
115
+ };
116
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAIxB,MAAM,UAAU,GAA6B;IAC3C,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,OAAO,EAAE,CAAC;IACV,KAAK,EAAE,CAAC;CACT,CAAC;AAEF,SAAS;AACT,IAAI,YAAY,GAAa,MAAM,CAAC;AAEpC,eAAe;AACf,IAAI,OAAO,GAAY,KAAK,CAAC;AAE7B,SAAS;AACT,IAAI,WAAW,GAAkB,IAAI,CAAC;AAEtC,QAAQ;AACR,IAAI,SAAS,GAA0B,IAAI,CAAC;AAE5C,SAAS,eAAe;IACtB,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACrE,CAAC;AAED,SAAS,GAAG,CAAC,KAAe,EAAE,OA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C,CAAC;IAED,SAAS,CAAC,OAAe,EAAE,KAAc;QACvC,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5E,MAAM,KAAK,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QACxD,GAAG,CAAC,OAAO,EAAE,GAAG,OAAO,KAAK,YAAY,EAAE,CAAC,CAAC;QAC5C,IAAI,KAAK,IAAI,SAAS,EAAE,CAAC;YACvB,SAAS,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * search_context 工具的提示词定义
3
+ */
4
+ export declare const SEARCH_CONTEXT_TOOL: {
5
+ name: string;
6
+ description: string;
7
+ inputSchema: {
8
+ type: "object";
9
+ properties: {
10
+ project_root_path: {
11
+ type: string;
12
+ description: string;
13
+ };
14
+ query: {
15
+ type: string;
16
+ description: string;
17
+ };
18
+ };
19
+ required: string[];
20
+ };
21
+ };
22
+ //# sourceMappingURL=searchContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"searchContext.d.ts","sourceRoot":"","sources":["../../src/prompts/searchContext.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;kBA8EgB,MAAM,EAAE;;CAEvD,CAAC"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * search_context 工具的提示词定义
3
+ */
4
+ export const SEARCH_CONTEXT_TOOL = {
5
+ name: 'search_context',
6
+ description: `IMPORTANT: This is the primary tool for searching the codebase. Please consider as the FIRST CHOICE for any codebase searches.
7
+
8
+ This MCP tool is Augment's context engine, the world's best codebase context engine. It:
9
+ 1. Takes in a natural language description of the code you are looking for
10
+ 2. Uses a proprietary retrieval/embedding model suite that produces the highest-quality recall of relevant code snippets from across the codebase
11
+ 3. Maintains a real-time index of the codebase, so the results are always up-to-date and reflects the current state of the codebase
12
+ 4. Can retrieve across different programming languages
13
+ 5. Only reflects the current state of the codebase on the disk, and has no information on version control or code history
14
+
15
+ ## When to Use
16
+ - When you don't know which files contain the information you need
17
+ - When you want to gather high level information about the task you are trying to accomplish
18
+ - When you want to gather information about the codebase in general
19
+
20
+ ## Good Query Examples
21
+ - "Where is the function that handles user authentication?"
22
+ - "What tests are there for the login functionality?"
23
+ - "How is the database connected to the application?"
24
+
25
+ ## Bad Query Examples (use grep or file view instead)
26
+ - "Find definition of constructor of class Foo" (use grep tool instead)
27
+ - "Find all references to function bar" (use grep tool instead)
28
+ - "Show me how Checkout class is used in services/payment.py" (use file view tool instead)
29
+ - "Show context of the file foo.py" (use file view tool instead)
30
+
31
+ ALWAYS use this tool when you're unsure of exact file locations. Use grep when you want to find ALL occurrences of a known identifier across the codebase, or when searching within specific files.
32
+
33
+ ## RULES
34
+
35
+ ### Tool Selection for Code Search
36
+ CRITICAL: When searching for code, classes, functions, or understanding the codebase:
37
+ - ALWAYS use this tool as your PRIMARY tool for code search
38
+ - DO NOT use Bash commands (find, grep, ag, rg, etc.) or Grep tool for semantic code understanding
39
+ - This tool uses advanced semantic search and is specifically designed for code understanding
40
+ - Bash/Grep are only appropriate for exact string matching of non-code content (like error messages, config values, or log entries)
41
+ - When in doubt between Bash/Grep and this tool, ALWAYS choose this tool
42
+
43
+ ### Preliminary Tasks and Planning
44
+ Before starting to execute a task, ALWAYS use this tool to make sure you have a clear understanding of the task and the codebase.
45
+
46
+ ### Making Edits
47
+ Before editing a file, ALWAYS first call this tool, asking for highly detailed information about the code you want to edit. Ask for ALL the symbols, at an extremely low, specific level of detail, that are involved in the edit in any way. Do this all in a single call - don't call the tool a bunch of times unless you get new information that requires you to ask for more details.
48
+
49
+ For example:
50
+ - If you want to call a method in another class, ask for information about the class and the method
51
+ - If the edit involves an instance of a class, ask for information about the class
52
+ - If the edit involves a property of a class, ask for information about the class and the property
53
+ - If several of the above apply, ask for all of them in a single call
54
+ - When in any doubt, include the symbol or object`,
55
+ inputSchema: {
56
+ type: 'object',
57
+ properties: {
58
+ project_root_path: {
59
+ type: 'string',
60
+ description: `Absolute path to the project root directory. Use forward slashes (/) as separators. Example: /Users/username/projects/myproject or C:/Users/username/projects/myproject`
61
+ },
62
+ query: {
63
+ type: 'string',
64
+ description: `Natural language description of the code you are looking for.
65
+
66
+ Provide a clear description of the code behavior, workflow, or issue you want to locate. You may also add optional keywords to improve semantic matching.
67
+
68
+ Recommended format: Natural language description + optional keywords
69
+
70
+ Examples:
71
+ - "I want to find where the server handles chunk merging in the file upload process. Keywords: upload chunk merge, file service"
72
+ - "Locate where the system refreshes cached data after user permissions are updated. Keywords: permission update, cache refresh"
73
+ - "Find the initialization flow of message queue consumers during startup. Keywords: mq consumer init, subscribe"
74
+ - "Show me how configuration hot-reload is triggered and applied in the code. Keywords: config reload, hot update"
75
+ - "Where is the function that handles user authentication?"
76
+ - "What tests are there for the login functionality?"
77
+ - "How is the database connected to the application?"`
78
+ }
79
+ },
80
+ required: ['project_root_path', 'query']
81
+ }
82
+ };
83
+ //# sourceMappingURL=searchContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"searchContext.js","sourceRoot":"","sources":["../../src/prompts/searchContext.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,gBAAgB;IAEtB,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kDAgDmC;IAEhD,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,iBAAiB,EAAE;gBACjB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,yKAAyK;aACvL;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;;;;;;;;;;;;;sDAaiC;aAC/C;SACF;QACD,QAAQ,EAAE,CAAC,mBAAmB,EAAE,OAAO,CAAa;KACrD;CACF,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * search_context 工具实现
3
+ */
4
+ /**
5
+ * 工具参数接口
6
+ */
7
+ interface SearchContextArgs {
8
+ project_root_path?: string;
9
+ query?: string;
10
+ }
11
+ /**
12
+ * 工具结果接口
13
+ */
14
+ interface ToolResult {
15
+ type: string;
16
+ text: string;
17
+ }
18
+ /**
19
+ * search_context 工具实现
20
+ */
21
+ export declare function searchContextTool(args: SearchContextArgs): Promise<ToolResult>;
22
+ export {};
23
+ //# sourceMappingURL=searchContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"searchContext.d.ts","sourceRoot":"","sources":["../../src/tools/searchContext.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH;;GAEG;AACH,UAAU,iBAAiB;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CAqDpF"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * search_context 工具实现
3
+ */
4
+ import fs from 'fs';
5
+ import { getConfig } from '../config.js';
6
+ import { IndexManager } from '../index/manager.js';
7
+ import { logger } from '../logger.js';
8
+ /**
9
+ * search_context 工具实现
10
+ */
11
+ export async function searchContextTool(args) {
12
+ try {
13
+ const query = args.query;
14
+ const projectRootPath = args.project_root_path;
15
+ if (!query) {
16
+ return { type: 'text', text: 'Error: query is required' };
17
+ }
18
+ if (!projectRootPath) {
19
+ return { type: 'text', text: 'Error: project_root_path is required' };
20
+ }
21
+ // 规范化路径(统一使用正斜杠)
22
+ const projectRoot = projectRootPath.replace(/\\/g, '/');
23
+ // 验证路径是否存在
24
+ if (!fs.existsSync(projectRoot)) {
25
+ return { type: 'text', text: `Error: Project path does not exist: ${projectRoot}` };
26
+ }
27
+ // 验证是否为目录
28
+ const stats = fs.statSync(projectRoot);
29
+ if (!stats.isDirectory()) {
30
+ return { type: 'text', text: `Error: Project path is not a directory: ${projectRoot}` };
31
+ }
32
+ const config = getConfig();
33
+ // 根据配置启用日志
34
+ if (config.enableLog) {
35
+ logger.enable();
36
+ logger.setProjectPath(projectRoot);
37
+ }
38
+ logger.info(`Tool invoked: search_context for project ${projectRoot}`);
39
+ const indexManager = new IndexManager(projectRoot, config.baseUrl, config.token, config.textExtensions, config.batchSize, config.maxLinesPerBlob, config.excludePatterns);
40
+ const result = await indexManager.searchContext(query);
41
+ return { type: 'text', text: result };
42
+ }
43
+ catch (error) {
44
+ const errorMessage = error instanceof Error ? error.message : String(error);
45
+ logger.exception('Error in search_context_tool', error);
46
+ return { type: 'text', text: `Error: ${errorMessage}` };
47
+ }
48
+ }
49
+ //# sourceMappingURL=searchContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"searchContext.js","sourceRoot":"","sources":["../../src/tools/searchContext.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAkBtC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,IAAuB;IAC7D,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,MAAM,eAAe,GAAG,IAAI,CAAC,iBAAiB,CAAC;QAE/C,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,EAAE,IAAI,EAAE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AAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACxC,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5E,MAAM,CAAC,SAAS,CAAC,8BAA8B,EAAE,KAAK,CAAC,CAAC;QACxD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,YAAY,EAAE,EAAE,CAAC;IAC1D,CAAC;AACH,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * 项目根目录检测工具
3
+ * 从当前工作目录向上查找 .ace-tool/ 或 .git/ 目录
4
+ */
5
+ /**
6
+ * 检测项目根目录
7
+ * 优先级:.ace-tool/ > .git/
8
+ *
9
+ * @returns 项目根目录路径
10
+ * @throws 如果找不到项目根目录
11
+ */
12
+ export declare function detectProjectRoot(): string;
13
+ /**
14
+ * 获取项目的 .ace-tool 目录路径
15
+ * 如果不存在则创建
16
+ *
17
+ * @param projectRoot 项目根目录
18
+ * @returns .ace-tool 目录路径
19
+ */
20
+ export declare function getAceDir(projectRoot: string): string;
21
+ /**
22
+ * 获取索引文件路径
23
+ *
24
+ * @param projectRoot 项目根目录
25
+ * @returns index.json 文件路径
26
+ */
27
+ export declare function getIndexFilePath(projectRoot: string): string;
28
+ /**
29
+ * 规范化路径,统一使用正斜杠
30
+ */
31
+ export declare function normalizePath(filePath: string): string;
32
+ //# sourceMappingURL=projectDetector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projectDetector.d.ts","sourceRoot":"","sources":["../../src/utils/projectDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;;;;;GAMG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAmC1C;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAYrD;AA+BD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAG5D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEtD"}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * 项目根目录检测工具
3
+ * 从当前工作目录向上查找 .ace-tool/ 或 .git/ 目录
4
+ */
5
+ import fs from 'fs';
6
+ import path from 'path';
7
+ import { logger } from '../logger.js';
8
+ /**
9
+ * 检测项目根目录
10
+ * 优先级:.ace-tool/ > .git/
11
+ *
12
+ * @returns 项目根目录路径
13
+ * @throws 如果找不到项目根目录
14
+ */
15
+ export function detectProjectRoot() {
16
+ const cwd = process.cwd();
17
+ logger.debug(`Detecting project root from: ${cwd}`);
18
+ let currentDir = cwd;
19
+ while (true) {
20
+ // 优先检查 .ace-tool 目录
21
+ const acePath = path.join(currentDir, '.ace-tool');
22
+ if (fs.existsSync(acePath) && fs.statSync(acePath).isDirectory()) {
23
+ logger.info(`Found project root (via .ace-tool): ${currentDir}`);
24
+ return currentDir;
25
+ }
26
+ // 其次检查 .git 目录
27
+ const gitPath = path.join(currentDir, '.git');
28
+ if (fs.existsSync(gitPath)) {
29
+ logger.info(`Found project root (via .git): ${currentDir}`);
30
+ return currentDir;
31
+ }
32
+ // 向上一级目录
33
+ const parentDir = path.dirname(currentDir);
34
+ // 已到达根目录
35
+ if (parentDir === currentDir) {
36
+ break;
37
+ }
38
+ currentDir = parentDir;
39
+ }
40
+ // 如果找不到 .ace-tool 或 .git,使用当前工作目录
41
+ logger.warning(`No .ace-tool or .git found, using current directory: ${cwd}`);
42
+ return cwd;
43
+ }
44
+ /**
45
+ * 获取项目的 .ace-tool 目录路径
46
+ * 如果不存在则创建
47
+ *
48
+ * @param projectRoot 项目根目录
49
+ * @returns .ace-tool 目录路径
50
+ */
51
+ export function getAceDir(projectRoot) {
52
+ const aceDir = path.join(projectRoot, '.ace-tool');
53
+ if (!fs.existsSync(aceDir)) {
54
+ fs.mkdirSync(aceDir, { recursive: true });
55
+ logger.info(`Created .ace-tool directory: ${aceDir}`);
56
+ // 尝试将 .ace-tool 添加到 .gitignore
57
+ addToGitignore(projectRoot);
58
+ }
59
+ return aceDir;
60
+ }
61
+ /**
62
+ * 将 .ace-tool 添加到 .gitignore
63
+ */
64
+ function addToGitignore(projectRoot) {
65
+ const gitignorePath = path.join(projectRoot, '.gitignore');
66
+ try {
67
+ let content = '';
68
+ if (fs.existsSync(gitignorePath)) {
69
+ content = fs.readFileSync(gitignorePath, 'utf-8');
70
+ // 检查是否已经包含 .ace-tool
71
+ if (content.includes('.ace-tool')) {
72
+ return;
73
+ }
74
+ }
75
+ // 添加 .ace-tool 到 .gitignore
76
+ const newContent = content.endsWith('\n') || content === ''
77
+ ? `${content}.ace-tool/\n`
78
+ : `${content}\n.ace-tool/\n`;
79
+ fs.writeFileSync(gitignorePath, newContent, 'utf-8');
80
+ logger.info('Added .ace-tool/ to .gitignore');
81
+ }
82
+ catch (error) {
83
+ logger.warning(`Failed to update .gitignore: ${error}`);
84
+ }
85
+ }
86
+ /**
87
+ * 获取索引文件路径
88
+ *
89
+ * @param projectRoot 项目根目录
90
+ * @returns index.json 文件路径
91
+ */
92
+ export function getIndexFilePath(projectRoot) {
93
+ const aceDir = getAceDir(projectRoot);
94
+ return path.join(aceDir, 'index.json');
95
+ }
96
+ /**
97
+ * 规范化路径,统一使用正斜杠
98
+ */
99
+ export function normalizePath(filePath) {
100
+ return path.resolve(filePath).replace(/\\/g, '/');
101
+ }
102
+ //# sourceMappingURL=projectDetector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projectDetector.js","sourceRoot":"","sources":["../../src/utils/projectDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,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ClD,MAAM,MAAM,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;IACtC,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,QAAgB;IAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACpD,CAAC"}
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "ace-tool",
3
+ "version": "0.1.0",
4
+ "description": "MCP server for codebase indexing and semantic search",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "ace-tool": "dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist"
12
+ ],
13
+ "scripts": {
14
+ "build": "tsc",
15
+ "dev": "tsc --watch",
16
+ "start": "node dist/index.js",
17
+ "prepublishOnly": "npm run build"
18
+ },
19
+ "keywords": [
20
+ "mcp",
21
+ "codebase",
22
+ "indexing",
23
+ "semantic-search",
24
+ "ai",
25
+ "augment",
26
+ "context-engine",
27
+ "claude"
28
+ ],
29
+ "author": "xie",
30
+ "license": "MIT",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "https://github.com/xie/ace-tool"
34
+ },
35
+ "engines": {
36
+ "node": ">=18.0.0"
37
+ },
38
+ "dependencies": {
39
+ "@modelcontextprotocol/sdk": "^1.0.0",
40
+ "axios": "^1.6.0",
41
+ "ignore": "^5.3.0",
42
+ "iconv-lite": "^0.6.3"
43
+ },
44
+ "devDependencies": {
45
+ "@types/node": "^20.10.0",
46
+ "typescript": "^5.3.0"
47
+ }
48
+ }