Adds SkillsView.vue (cloud-skill CRUD, per-host entitlement grant/revoke, read-only host local-skill inventory), skill API client methods + types, and wires it into App.vue behind the skills:admin scope. Console typecheck/build/tests green (20 passed). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,11 @@ import type {
|
||||
TokenUsageEvent,
|
||||
UserListResponse,
|
||||
UserSubmissionPolicy,
|
||||
CloudSkill,
|
||||
CloudSkillListResponse,
|
||||
CloudSkillEntitlementsResponse,
|
||||
HostSkillInventoryResponse,
|
||||
CloudSkillKind,
|
||||
} from "./types";
|
||||
|
||||
const configuredBaseUrl = import.meta.env.VITE_CLOUD_API_BASE_URL as
|
||||
@@ -328,3 +333,76 @@ export function deleteLlmProviderProfile(
|
||||
{ method: "DELETE" },
|
||||
);
|
||||
}
|
||||
|
||||
export interface CloudSkillPayload {
|
||||
name: string;
|
||||
kind: CloudSkillKind;
|
||||
description: string;
|
||||
tags: string[];
|
||||
content: string;
|
||||
steps: Record<string, unknown>[];
|
||||
parameters: Record<string, Record<string, unknown>>;
|
||||
}
|
||||
|
||||
export function listCloudSkills(): Promise<CloudSkillListResponse> {
|
||||
return request<CloudSkillListResponse>("/v1/skills");
|
||||
}
|
||||
|
||||
export function createCloudSkill(payload: CloudSkillPayload): Promise<CloudSkill> {
|
||||
return request<CloudSkill>("/v1/skills", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
}
|
||||
|
||||
export function updateCloudSkill(
|
||||
skillId: string,
|
||||
payload: CloudSkillPayload,
|
||||
): Promise<CloudSkill> {
|
||||
return request<CloudSkill>(`/v1/skills/${encodeURIComponent(skillId)}`, {
|
||||
method: "PATCH",
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
}
|
||||
|
||||
export function deleteCloudSkill(skillId: string): Promise<void> {
|
||||
return request<void>(`/v1/skills/${encodeURIComponent(skillId)}`, {
|
||||
method: "DELETE",
|
||||
});
|
||||
}
|
||||
|
||||
export function listCloudSkillEntitlements(
|
||||
skillId: string,
|
||||
): Promise<CloudSkillEntitlementsResponse> {
|
||||
return request<CloudSkillEntitlementsResponse>(
|
||||
`/v1/skills/${encodeURIComponent(skillId)}/entitlements`,
|
||||
);
|
||||
}
|
||||
|
||||
export function grantCloudSkillEntitlement(
|
||||
skillId: string,
|
||||
hostId: string,
|
||||
): Promise<void> {
|
||||
return request<void>(
|
||||
`/v1/skills/${encodeURIComponent(skillId)}/entitlements/${encodeURIComponent(hostId)}`,
|
||||
{ method: "POST" },
|
||||
);
|
||||
}
|
||||
|
||||
export function revokeCloudSkillEntitlement(
|
||||
skillId: string,
|
||||
hostId: string,
|
||||
): Promise<void> {
|
||||
return request<void>(
|
||||
`/v1/skills/${encodeURIComponent(skillId)}/entitlements/${encodeURIComponent(hostId)}`,
|
||||
{ method: "DELETE" },
|
||||
);
|
||||
}
|
||||
|
||||
export function getHostSkillInventory(
|
||||
hostId: string,
|
||||
): Promise<HostSkillInventoryResponse> {
|
||||
return request<HostSkillInventoryResponse>(
|
||||
`/v1/hosts/${encodeURIComponent(hostId)}/skill-inventory`,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user