feat(skills): agent settings Skills tab with uninstall and archive/chat import (#179)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Yaowei Zheng
2026-08-04 20:20:07 +08:00
committed by GitHub
parent d89bfddc7a
commit 7cc5c30e71
13 changed files with 1141 additions and 12 deletions
+18
View File
@@ -54,6 +54,7 @@ import type {
SessionResponse,
SessionsResponse,
SessionTracesResponse,
SkillArchiveInstallRequest,
SkillInstallRequest,
SkillLibraryResponse,
RetryNowResponse,
@@ -527,6 +528,23 @@ export const installAgentSkills = (projectId: string, agentId: string, names: st
{ method: "POST", body: { names } satisfies SkillInstallRequest },
);
/** Installs one skill from an uploaded zip (base64); 409 skill_exists unless overwrite; 201 returns the latest installed list. */
export const installAgentSkillArchive = (
projectId: string,
agentId: string,
body: SkillArchiveInstallRequest,
) =>
apiFetch<AgentSkillsResponse>(
`/api/projects/${encodeURIComponent(projectId)}/agents/${encodeURIComponent(agentId)}` +
`/skills/archive`,
{ method: "POST", body },
);
/** Zip download URL for one installed skill (server sets Content-Disposition attachment); the export round-trips through installAgentSkillArchive. */
export const agentSkillArchiveUrl = (projectId: string, agentId: string, name: string): string =>
`/api/projects/${encodeURIComponent(projectId)}/agents/${encodeURIComponent(agentId)}` +
`/skills/${encodeURIComponent(name)}/archive`;
export const removeAgentSkill = (projectId: string, agentId: string, name: string) =>
apiFetch<void>(
`/api/projects/${encodeURIComponent(projectId)}/agents/${encodeURIComponent(agentId)}` +