feat: expand magic prompts coverage and split generation prompts (#835)
- Add configurable visible/instructions prompt families for commit/PR generation, PR checks/comments flows, and git conflict resolution helpers. - Refactor prompt sending to explicit visible + synthetic parts instead of newline-based splitting, with legacy override migration for old keys. - Polish Magic Prompts settings UX with grouped sidebar entries, tooltip-based descriptions, AI icon, and validation that visible prompts cannot be empty across web and VS Code runtimes.
This commit is contained in:
committed by
GitHub
parent
2e5b02e753
commit
5f0d1623ae
@@ -47,6 +47,10 @@ type BridgeMessageInput = {
|
||||
type ConfigRuntimeDeps = {
|
||||
readSettings: (ctx?: BridgeContext) => Record<string, unknown>;
|
||||
persistSettings: (changes: Record<string, unknown>, ctx?: BridgeContext) => Promise<Record<string, unknown>>;
|
||||
readMagicPromptOverrides: () => { version: number; overrides: Record<string, string> };
|
||||
saveMagicPromptOverride: (id: string, text: string) => Promise<{ version: number; overrides: Record<string, string> }>;
|
||||
resetMagicPromptOverride: (id: string) => Promise<{ version: number; overrides: Record<string, string> }>;
|
||||
resetAllMagicPromptOverrides: () => Promise<{ version: number; overrides: Record<string, string> }>;
|
||||
fetchOpenCodeSkillsFromApi: (ctx: BridgeContext | undefined, workingDirectory?: string) => Promise<DiscoveredSkill[] | null>;
|
||||
clientReloadDelayMs: number;
|
||||
};
|
||||
@@ -140,6 +144,38 @@ export async function handleConfigBridgeMessage(
|
||||
return { id, type, success: true, data: updated };
|
||||
}
|
||||
|
||||
case 'api:magic-prompts:get': {
|
||||
return { id, type, success: true, data: deps.readMagicPromptOverrides() };
|
||||
}
|
||||
|
||||
case 'api:magic-prompts:save': {
|
||||
const request = (payload || {}) as { id?: string; text?: string };
|
||||
const promptId = typeof request.id === 'string' ? request.id : '';
|
||||
if (!promptId) {
|
||||
return { id, type, success: false, error: 'Prompt id is required' };
|
||||
}
|
||||
if (typeof request.text !== 'string') {
|
||||
return { id, type, success: false, error: 'Prompt text is required' };
|
||||
}
|
||||
const data = await deps.saveMagicPromptOverride(promptId, request.text);
|
||||
return { id, type, success: true, data };
|
||||
}
|
||||
|
||||
case 'api:magic-prompts:reset': {
|
||||
const request = (payload || {}) as { id?: string };
|
||||
const promptId = typeof request.id === 'string' ? request.id : '';
|
||||
if (!promptId) {
|
||||
return { id, type, success: false, error: 'Prompt id is required' };
|
||||
}
|
||||
const data = await deps.resetMagicPromptOverride(promptId);
|
||||
return { id, type, success: true, data };
|
||||
}
|
||||
|
||||
case 'api:magic-prompts:reset-all': {
|
||||
const data = await deps.resetAllMagicPromptOverrides();
|
||||
return { id, type, success: true, data };
|
||||
}
|
||||
|
||||
case 'api:config/reload': {
|
||||
await ctx?.manager?.restart();
|
||||
return { id, type, success: true, data: { restarted: true } };
|
||||
|
||||
Reference in New Issue
Block a user