mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-20 20:34:19 +00:00
feat(ui): add extensions management to Config page
Add an "Extensions" tab to the Config page for managing transform extensions in the active mode (global or project): - GET /api/extensions lists installed extensions with their manifest descriptions, merged with the built-in catalog so users can see what is available to download. - POST /api/extensions/install downloads a whitelisted built-in extension into the active mode's extensions directory. - POST /api/extensions/open opens that directory in the user's editor, mirroring the skill "open in editor" affordance. ExtensionSpec now carries the manifest description so the list can surface it. The UI shows installed extensions with a built-in badge, available built-ins with a Download button, and an Open-directory action. Strings are translated across all 11 locales.
This commit is contained in:
@@ -158,6 +158,13 @@ export interface Extra {
|
||||
targets: ExtraTarget[];
|
||||
}
|
||||
|
||||
export interface ExtensionInfo {
|
||||
name: string;
|
||||
description?: string;
|
||||
builtin: boolean;
|
||||
installed: boolean;
|
||||
}
|
||||
|
||||
export interface ExtraDiffItem {
|
||||
action: string; // "create" | "update" | "prune"
|
||||
file: string;
|
||||
@@ -527,6 +534,18 @@ export const api = {
|
||||
deleteExtra: (name: string) =>
|
||||
apiFetch<{ success: boolean }>(`/extras/${encodeURIComponent(name)}`, { method: 'DELETE' }),
|
||||
listExtraExtensions: () => apiFetch<{ extensions: string[] }>('/extras/extensions'),
|
||||
// Extensions management (Config page)
|
||||
listExtensions: () => apiFetch<{ extensions: ExtensionInfo[] }>('/extensions'),
|
||||
installExtension: (name: string) =>
|
||||
apiFetch<{ success: boolean; name: string }>('/extensions/install', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ name }),
|
||||
}),
|
||||
openExtensionsDir: (editor?: string) =>
|
||||
apiFetch<{ editor: string; path: string; pid: number }>('/extensions/open', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(editor ? { editor } : {}),
|
||||
}),
|
||||
// extension: undefined = leave unchanged; '' = clear; name = set (forces copy mode)
|
||||
setExtraMode: (name: string, target: string, mode: string, flatten?: boolean, extension?: string) =>
|
||||
apiFetch<{ success: boolean }>(`/extras/${encodeURIComponent(name)}/mode`, {
|
||||
|
||||
Reference in New Issue
Block a user