Skip to content

Commit 73ed42e

Browse files
committed
feat: 更新工具注册逻辑,移除 project_bind 工具,优化 connect_project 工具的描述和参数处理,确保向后兼容性和功能一致性
1 parent 9330cf4 commit 73ed42e

1 file changed

Lines changed: 6 additions & 20 deletions

File tree

src/server.ts

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -298,27 +298,13 @@ class WaveForgeServer {
298298
const projectBindTool = new ProjectBindTool(this.projectManager);
299299
const projectInfoTool = new ProjectInfoTool(this.projectManager);
300300

301-
// 注册 project_bind 工具(完整实现)
302-
toolRegistry.registerTool({
303-
name: 'project_bind',
304-
handler: {
305-
getDefinition: () => ProjectBindTool.getDefinition(),
306-
handle: async (args) =>
307-
await projectBindTool.handle(args as ProjectBindParams),
308-
},
309-
category: 'project',
310-
description: '绑定项目到当前连接,提供稳定项目标识',
311-
enabled: true,
312-
});
313-
314-
// 注册 connect_project 工具(向后兼容的别名)
301+
// 注册 connect_project 工具(主要实现)
315302
toolRegistry.registerTool({
316303
name: 'connect_project',
317304
handler: {
318305
getDefinition: () => ({
319306
name: 'connect_project',
320-
description:
321-
'连接项目到当前会话(project_bind 的别名,保持向后兼容)',
307+
description: '连接项目到当前会话,提供稳定项目标识',
322308
inputSchema: {
323309
type: 'object' as const,
324310
properties: {
@@ -332,15 +318,15 @@ class WaveForgeServer {
332318
},
333319
}),
334320
handle: async (args: any) => {
335-
// connect_project 的参数转换为 project_bind 的参数格式
321+
// 处理 connect_project 参数
336322
const projectBindParams: ProjectBindParams = {
337323
project_path: args?.project_path,
338324
};
339325
return await projectBindTool.handle(projectBindParams);
340326
},
341327
},
342328
category: 'project',
343-
description: '连接项目到当前会话(向后兼容)',
329+
description: '连接项目到当前会话,提供稳定项目标识',
344330
enabled: true,
345331
});
346332

@@ -357,8 +343,8 @@ class WaveForgeServer {
357343
});
358344

359345
logger.info(LogCategory.Task, LogAction.Create, '项目管理工具注册完成', {
360-
tools: ['project_bind', 'connect_project', 'project_info'],
361-
backwardCompatible: true,
346+
tools: ['connect_project', 'project_info'],
347+
primaryTool: 'connect_project',
362348
});
363349
}
364350

0 commit comments

Comments
 (0)