feat: 添加一键优化提示词功能
- 在 ICHelperPanel.ts 添加 optimizePrompt 消息处理分支 - 新增 promptOptimizeService.ts 调用后端优化 API - 完善 WebView 端优化按钮交互逻辑
This commit is contained in:
@ -9,6 +9,7 @@ import {
|
||||
handleReplaceInFile,
|
||||
handleUserAnswer,
|
||||
abortCurrentDialog,
|
||||
handleOptimizePrompt,
|
||||
handlePlanAction,
|
||||
getCurrentTaskId,
|
||||
setLastTaskId,
|
||||
@ -328,6 +329,17 @@ export async function showICHelperPanel(
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "optimizePrompt":
|
||||
if (typeof message.prompt === "string") {
|
||||
void handleOptimizePrompt(panel, message.prompt);
|
||||
} else {
|
||||
panel.webview.postMessage({
|
||||
command: "optimizeResult",
|
||||
success: false,
|
||||
error: "提示词为空或格式错误",
|
||||
});
|
||||
}
|
||||
break;
|
||||
// 处理计划操作(只做模式切换,响应已通过 submitAnswer 发送)
|
||||
case "planAction":
|
||||
if (message.action === "confirm") {
|
||||
|
||||
Reference in New Issue
Block a user