From 741c1f8f5497be57e6d9f32ecd1a476dda3dcacf Mon Sep 17 00:00:00 2001 From: sean Date: Wed, 18 Jun 2025 16:44:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=A8MCPServerCommand=E5=92=8CMCPSt?= =?UTF-8?q?reamableHttpCommand=E4=B8=AD=E6=B7=BB=E5=8A=A0'promptx=5Fdacp'?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=98=A0=E5=B0=84=EF=BC=8C=E5=90=8C=E6=97=B6?= =?UTF-8?q?=E5=9C=A8DACPCommand=E4=B8=AD=E4=BC=98=E5=8C=96=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BB=A5?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=95=B0=E7=BB=84=E5=8F=82=E6=95=B0=E7=9A=84?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E8=A7=A3=E6=9E=90=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/commands/MCPServerCommand.js | 4 +++- src/lib/commands/MCPStreamableHttpCommand.js | 3 ++- src/lib/core/pouch/commands/DACPCommand.js | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lib/commands/MCPServerCommand.js b/src/lib/commands/MCPServerCommand.js index 05ba18c..f43728f 100644 --- a/src/lib/commands/MCPServerCommand.js +++ b/src/lib/commands/MCPServerCommand.js @@ -481,7 +481,9 @@ class MCPServerCommand { result.push('--tags', args.tags); } return result; - } + }, + + 'promptx_dacp': (args) => [args] }; const mapper = paramMapping[toolName]; diff --git a/src/lib/commands/MCPStreamableHttpCommand.js b/src/lib/commands/MCPStreamableHttpCommand.js index 0c886d6..380b20f 100644 --- a/src/lib/commands/MCPStreamableHttpCommand.js +++ b/src/lib/commands/MCPStreamableHttpCommand.js @@ -449,7 +449,8 @@ class MCPStreamableHttpCommand { result.push('--tags', args.tags); } return result; - } + }, + 'promptx_dacp': (args) => [args] }; const mapper = paramMapping[toolName]; diff --git a/src/lib/core/pouch/commands/DACPCommand.js b/src/lib/core/pouch/commands/DACPCommand.js index 26ecaca..ef03c9a 100644 --- a/src/lib/core/pouch/commands/DACPCommand.js +++ b/src/lib/core/pouch/commands/DACPCommand.js @@ -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) {