feat: 在MCPServerCommand和MCPStreamableHttpCommand中添加'promptx_dacp'参数映射,同时在DACPCommand中优化参数处理逻辑,以支持数组参数的正确解析。
This commit is contained in:
@ -481,7 +481,9 @@ class MCPServerCommand {
|
||||
result.push('--tags', args.tags);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
},
|
||||
|
||||
'promptx_dacp': (args) => [args]
|
||||
};
|
||||
|
||||
const mapper = paramMapping[toolName];
|
||||
|
||||
@ -449,7 +449,8 @@ class MCPStreamableHttpCommand {
|
||||
result.push('--tags', args.tags);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
},
|
||||
'promptx_dacp': (args) => [args]
|
||||
};
|
||||
|
||||
const mapper = paramMapping[toolName];
|
||||
|
||||
@ -139,8 +139,11 @@ class DACPCommand extends BasePouchCommand {
|
||||
|
||||
async getContent(args) {
|
||||
try {
|
||||
// 处理参数:如果是数组,取第一个元素;否则直接使用
|
||||
const dacpArgs = Array.isArray(args) ? args[0] : args;
|
||||
|
||||
// 执行DACP调用
|
||||
const result = await this.callDACPService(args);
|
||||
const result = await this.callDACPService(dacpArgs);
|
||||
|
||||
// 格式化响应
|
||||
if (result.success) {
|
||||
|
||||
Reference in New Issue
Block a user