feat: 在MCPServerCommand和MCPStreamableHttpCommand中添加'promptx_dacp'参数映射,同时在DACPCommand中优化参数处理逻辑,以支持数组参数的正确解析。

This commit is contained in:
sean
2025-06-18 16:44:41 +08:00
parent 47582c56c9
commit 741c1f8f54
3 changed files with 9 additions and 3 deletions

View File

@ -481,7 +481,9 @@ class MCPServerCommand {
result.push('--tags', args.tags); result.push('--tags', args.tags);
} }
return result; return result;
} },
'promptx_dacp': (args) => [args]
}; };
const mapper = paramMapping[toolName]; const mapper = paramMapping[toolName];

View File

@ -449,7 +449,8 @@ class MCPStreamableHttpCommand {
result.push('--tags', args.tags); result.push('--tags', args.tags);
} }
return result; return result;
} },
'promptx_dacp': (args) => [args]
}; };
const mapper = paramMapping[toolName]; const mapper = paramMapping[toolName];

View File

@ -139,8 +139,11 @@ class DACPCommand extends BasePouchCommand {
async getContent(args) { async getContent(args) {
try { try {
// 处理参数:如果是数组,取第一个元素;否则直接使用
const dacpArgs = Array.isArray(args) ? args[0] : args;
// 执行DACP调用 // 执行DACP调用
const result = await this.callDACPService(args); const result = await this.callDACPService(dacpArgs);
// 格式化响应 // 格式化响应
if (result.success) { if (result.success) {