feat(skills-ui): manage plugin skill mirrors

This commit is contained in:
2026-06-16 12:11:35 +08:00
parent 0ac3cce6f3
commit a9b830d11e
4 changed files with 388 additions and 3 deletions

View File

@ -19,6 +19,7 @@ import type {
FileAttachment,
NotificationDetail,
NotificationRun,
BeaverPlugin,
ProviderConfigPayload,
Session,
SessionDetail,
@ -833,6 +834,55 @@ export async function listSkills(): Promise<Skill[]> {
return fetchJSON('/api/skills');
}
export async function listPlugins(): Promise<BeaverPlugin[]> {
return fetchJSON('/api/plugins');
}
export async function syncPlugins(): Promise<BeaverPlugin[]> {
return fetchJSON('/api/plugins/sync', {
method: 'POST',
body: JSON.stringify({}),
});
}
export async function enablePlugin(pluginId: string): Promise<BeaverPlugin> {
return fetchJSON(`/api/plugins/${encodeURIComponent(pluginId)}/enable`, {
method: 'POST',
body: JSON.stringify({}),
});
}
export async function pausePlugin(pluginId: string): Promise<BeaverPlugin> {
return fetchJSON(`/api/plugins/${encodeURIComponent(pluginId)}/pause`, {
method: 'POST',
body: JSON.stringify({}),
});
}
export async function resumePlugin(pluginId: string): Promise<BeaverPlugin> {
return fetchJSON(`/api/plugins/${encodeURIComponent(pluginId)}/resume`, {
method: 'POST',
body: JSON.stringify({}),
});
}
export async function disablePlugin(
pluginId: string,
payload: { disable_linked_skills: boolean }
): Promise<BeaverPlugin> {
return fetchJSON(`/api/plugins/${encodeURIComponent(pluginId)}/disable`, {
method: 'POST',
body: JSON.stringify(payload),
});
}
export async function adoptPluginSkill(pluginId: string, skillName: string): Promise<BeaverPlugin> {
return fetchJSON(`/api/plugins/${encodeURIComponent(pluginId)}/skills/${encodeURIComponent(skillName)}/adopt`, {
method: 'POST',
body: JSON.stringify({}),
});
}
export async function getSkillDetail(skillName: string): Promise<SkillDetailResponse> {
return fetchJSON(`/api/skills/${encodeURIComponent(skillName)}/detail`);
}