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
@@ -831,6 +831,30 @@ const handleLocalApiRequest = async (url: URL, init?: RequestInit) => {
|
||||
return new Response(JSON.stringify(updated), { status: 200, headers: { 'Content-Type': 'application/json' } });
|
||||
}
|
||||
|
||||
if (pathname === '/api/magic-prompts') {
|
||||
if (method === 'GET') {
|
||||
const data = await sendBridgeMessage('api:magic-prompts:get');
|
||||
return new Response(JSON.stringify(data), { status: 200, headers: { 'Content-Type': 'application/json' } });
|
||||
}
|
||||
if (method === 'DELETE') {
|
||||
const data = await sendBridgeMessage('api:magic-prompts:reset-all');
|
||||
return new Response(JSON.stringify(data), { status: 200, headers: { 'Content-Type': 'application/json' } });
|
||||
}
|
||||
}
|
||||
|
||||
if (pathname.startsWith('/api/magic-prompts/')) {
|
||||
const id = decodeURIComponent(pathname.slice('/api/magic-prompts/'.length));
|
||||
if (method === 'PUT') {
|
||||
const body = init?.body ? JSON.parse(init.body as string) : {};
|
||||
const data = await sendBridgeMessage('api:magic-prompts:save', { id, text: body?.text });
|
||||
return new Response(JSON.stringify(data), { status: 200, headers: { 'Content-Type': 'application/json' } });
|
||||
}
|
||||
if (method === 'DELETE') {
|
||||
const data = await sendBridgeMessage('api:magic-prompts:reset', { id });
|
||||
return new Response(JSON.stringify(data), { status: 200, headers: { 'Content-Type': 'application/json' } });
|
||||
}
|
||||
}
|
||||
|
||||
if (pathname === '/api/config/opencode-resolution' && method === 'GET') {
|
||||
try {
|
||||
const data = await sendBridgeMessage('api:config/opencode-resolution:get');
|
||||
|
||||
Reference in New Issue
Block a user