mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 04:11:10 -05:00
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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user