feat(extensions): add ZIP installation and unify action dialogs

This commit is contained in:
2026-09-06 00:52:59 +08:00
parent ba66b182af
commit 99a92e9eb1
29 changed files with 554 additions and 50 deletions
+5 -2
View File
@@ -27,8 +27,11 @@ export async function getSkill(skillId: string): Promise<Skill> {
return toSkill(await apiClient.get<ApiSkill>(`/api/skills/${skillId}`))
}
export async function installSkill(packagePath: string): Promise<Skill> {
return toSkill(await apiClient.post<ApiSkill>('/api/skills/install', { package_path: packagePath }))
export async function installSkill(source: string | File): Promise<Skill> {
const installed = typeof source === 'string'
? await apiClient.post<ApiSkill>('/api/skills/install', { package_path: source })
: await apiClient.postBinary<ApiSkill>('/api/skills/install-zip', source)
return toSkill(installed)
}
export async function enableSkill(skillId: string): Promise<Skill> {