代码提交
This commit is contained in:
1 parent
fe7cdba07e
commit
106f1d1794
6 files changed
+294
-12
No files matched your search
@@ -174,6 +174,31 @@ export async function setAgentFeatured(
|
||||
return res.json() as Promise<Agent>;
|
||||
}
|
||||
|
||||
export interface AgentSkillsSyncRemoval {
|
||||
agent_id: string;
|
||||
agent_name: string | null;
|
||||
user_id: string | null;
|
||||
removed_skills: string[];
|
||||
}
|
||||
|
||||
export interface AgentSkillsSyncResult {
|
||||
checked: number;
|
||||
modified: number;
|
||||
removals: AgentSkillsSyncRemoval[];
|
||||
}
|
||||
|
||||
export async function adminSyncAgentSkills(): Promise<AgentSkillsSyncResult> {
|
||||
const res = await apiFetch(
|
||||
`${getBackendBaseURL()}/api/agents/admin/sync-skills`,
|
||||
{ method: "POST" },
|
||||
);
|
||||
if (!res.ok) {
|
||||
const err = (await res.json().catch(() => ({}))) as { detail?: string };
|
||||
throw new Error(err.detail ?? `Failed to sync agent skills: ${res.statusText}`);
|
||||
}
|
||||
return res.json() as Promise<AgentSkillsSyncResult>;
|
||||
}
|
||||
|
||||
export async function checkAgentName(
|
||||
name: string,
|
||||
): Promise<{ available: boolean; name: string }> {
|
||||
|
||||
Reference in new issue
Block a user