refactor: consolidate code action and enhance prompts into unified support prompts system

- Rename codeActionPrompt to supportPrompt for better clarity
- Move enhance prompt functionality into support prompts system
- Add ENHANCE tab alongside other support prompt types
- Update UI to show enhancement configuration in ENHANCE tab
- Update tests to reflect new unified structure

This change simplifies the prompt system by treating enhancement as another type of support prompt rather than a separate system.
This commit is contained in:
sam hoang
2025-01-23 10:46:04 +07:00
parent 22907a0578
commit 55a5a97d8b
5 changed files with 140 additions and 213 deletions

View File

@@ -40,7 +40,7 @@ import { enhancePrompt } from "../../utils/enhance-prompt"
import { getCommitInfo, searchCommits, getWorkingState } from "../../utils/git"
import { ConfigManager } from "../config/ConfigManager"
import { CustomModesManager } from "../config/CustomModesManager"
import { enhance, codeActionPrompt } from "../../shared/support-prompt"
import { supportPrompt } from "../../shared/support-prompt"
import { ACTION_NAMES } from "../CodeActionProvider"
@@ -205,7 +205,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
const { customPrompts } = await visibleProvider.getState()
const prompt = codeActionPrompt.create(promptType, params, customPrompts)
const prompt = supportPrompt.create(promptType, params, customPrompts)
await visibleProvider.initClineWithTask(prompt)
}
@@ -996,16 +996,10 @@ export class ClineProvider implements vscode.WebviewViewProvider {
}
}
const getEnhancePrompt = (value: string | PromptComponent | undefined): string => {
if (typeof value === "string") {
return value
}
return enhance.prompt // Use the constant from modes.ts which we know is a string
}
const enhancedPrompt = await enhancePrompt(
configToUse,
message.text,
getEnhancePrompt(customPrompts?.enhance),
supportPrompt.get(customPrompts, "ENHANCE"),
)
await this.postMessageToWebview({
type: "enhancedPrompt",