mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-21 04:41:16 -05:00
refactor: separate mode and support prompts
- Rename customPrompts to customModePrompts for mode-specific prompts - Add new customSupportPrompts type for support action prompts - Update types to be more specific (CustomModePrompts and CustomSupportPrompts) - Fix all related tests and component implementations
This commit is contained in:
@@ -84,11 +84,11 @@ type SupportPromptType = keyof typeof defaultTemplates
|
||||
|
||||
export const supportPrompt = {
|
||||
default: defaultTemplates,
|
||||
get: (customPrompts: Record<string, any> | undefined, type: SupportPromptType): string => {
|
||||
return customPrompts?.[type] ?? defaultTemplates[type]
|
||||
get: (customSupportPrompts: Record<string, any> | undefined, type: SupportPromptType): string => {
|
||||
return customSupportPrompts?.[type] ?? defaultTemplates[type]
|
||||
},
|
||||
create: (type: SupportPromptType, params: PromptParams, customPrompts?: Record<string, any>): string => {
|
||||
const template = supportPrompt.get(customPrompts, type)
|
||||
create: (type: SupportPromptType, params: PromptParams, customSupportPrompts?: Record<string, any>): string => {
|
||||
const template = supportPrompt.get(customSupportPrompts, type)
|
||||
return createPrompt(template, params)
|
||||
},
|
||||
} as const
|
||||
@@ -102,3 +102,7 @@ export const supportPromptLabels: Record<SupportPromptType, string> = {
|
||||
IMPROVE: "Improve Code",
|
||||
ENHANCE: "Enhance Prompt",
|
||||
} as const
|
||||
|
||||
export type CustomSupportPrompts = {
|
||||
[key: string]: string | undefined
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user