fix(ui): pull upstream skill UI to match new shared types
Build: Production / build (push) Successful in 5m51s
Build: Production / build (push) Successful in 5m51s
Bumping shared CompanySkillListItem and CatalogSkill types in the previous commits without updating the UI consumers broke the storybook mocks (missing catalogKind, originHash, packageName, packageVersion) and the CompanySkills page (missing queryKeys.companySkills.catalog family). Replace the affected UI files with upstream/master: - ui/src/api/companySkills.ts - ui/src/pages/CompanySkills.tsx - ui/src/lib/queryKeys.ts - ui/storybook/stories/acpx-local.stories.tsx Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
import type {
|
||||
CatalogSkill,
|
||||
CatalogSkillFileDetail,
|
||||
CatalogSkillKind,
|
||||
CompanySkill,
|
||||
CompanySkillCreateRequest,
|
||||
CompanySkillDetail,
|
||||
CompanySkillFileDetail,
|
||||
CompanySkillImportResult,
|
||||
CompanySkillInstallCatalogRequest,
|
||||
CompanySkillInstallCatalogResult,
|
||||
CompanySkillListItem,
|
||||
CompanySkillProjectScanRequest,
|
||||
CompanySkillProjectScanResult,
|
||||
@@ -11,6 +16,12 @@ import type {
|
||||
} from "@paperclipai/shared";
|
||||
import { api } from "./client";
|
||||
|
||||
export interface CatalogListQuery {
|
||||
kind?: CatalogSkillKind;
|
||||
category?: string;
|
||||
q?: string;
|
||||
}
|
||||
|
||||
export const companySkillsApi = {
|
||||
list: (companyId: string) =>
|
||||
api.get<CompanySkillListItem[]>(`/companies/${encodeURIComponent(companyId)}/skills`),
|
||||
@@ -36,15 +47,10 @@ export const companySkillsApi = {
|
||||
`/companies/${encodeURIComponent(companyId)}/skills`,
|
||||
payload,
|
||||
),
|
||||
importFromSource: (companyId: string, source: string, authToken?: string) =>
|
||||
importFromSource: (companyId: string, source: string) =>
|
||||
api.post<CompanySkillImportResult>(
|
||||
`/companies/${encodeURIComponent(companyId)}/skills/import`,
|
||||
{ source, ...(authToken ? { authToken } : {}) },
|
||||
),
|
||||
updateAuth: (companyId: string, skillId: string, authToken: string | null) =>
|
||||
api.patch<CompanySkill>(
|
||||
`/companies/${encodeURIComponent(companyId)}/skills/${encodeURIComponent(skillId)}/auth`,
|
||||
{ authToken },
|
||||
{ source },
|
||||
),
|
||||
scanProjects: (companyId: string, payload: CompanySkillProjectScanRequest = {}) =>
|
||||
api.post<CompanySkillProjectScanResult>(
|
||||
@@ -60,4 +66,23 @@ export const companySkillsApi = {
|
||||
api.delete<CompanySkill>(
|
||||
`/companies/${encodeURIComponent(companyId)}/skills/${encodeURIComponent(skillId)}`,
|
||||
),
|
||||
catalogList: (query: CatalogListQuery = {}) => {
|
||||
const params = new URLSearchParams();
|
||||
if (query.kind) params.set("kind", query.kind);
|
||||
if (query.category) params.set("category", query.category);
|
||||
if (query.q) params.set("q", query.q);
|
||||
const search = params.toString();
|
||||
return api.get<CatalogSkill[]>(`/skills/catalog${search ? `?${search}` : ""}`);
|
||||
},
|
||||
catalogDetail: (catalogRef: string) =>
|
||||
api.get<CatalogSkill>(`/skills/catalog/${encodeURIComponent(catalogRef)}`),
|
||||
catalogFile: (catalogRef: string, relativePath: string = "SKILL.md") =>
|
||||
api.get<CatalogSkillFileDetail>(
|
||||
`/skills/catalog/${encodeURIComponent(catalogRef)}/files?path=${encodeURIComponent(relativePath)}`,
|
||||
),
|
||||
installCatalog: (companyId: string, payload: CompanySkillInstallCatalogRequest) =>
|
||||
api.post<CompanySkillInstallCatalogResult>(
|
||||
`/companies/${encodeURIComponent(companyId)}/skills/install-catalog`,
|
||||
payload,
|
||||
),
|
||||
};
|
||||
|
||||
@@ -11,6 +11,11 @@ export const queryKeys = {
|
||||
["company-skills", companyId, skillId, "update-status"] as const,
|
||||
file: (companyId: string, skillId: string, relativePath: string) =>
|
||||
["company-skills", companyId, skillId, "file", relativePath] as const,
|
||||
catalog: (filters: { kind?: string; category?: string; q?: string } = {}) =>
|
||||
["company-skills", "catalog", filters.kind ?? "__all-kinds__", filters.category ?? "__all-categories__", filters.q ?? ""] as const,
|
||||
catalogDetail: (catalogRef: string) => ["company-skills", "catalog", "detail", catalogRef] as const,
|
||||
catalogFile: (catalogRef: string, relativePath: string) =>
|
||||
["company-skills", "catalog", "file", catalogRef, relativePath] as const,
|
||||
},
|
||||
agents: {
|
||||
list: (companyId: string) => ["agents", companyId] as const,
|
||||
@@ -63,6 +68,8 @@ export const queryKeys = {
|
||||
documents: (issueId: string) => ["issues", "documents", issueId] as const,
|
||||
document: (issueId: string, key: string) => ["issues", "document", issueId, key] as const,
|
||||
documentRevisions: (issueId: string, key: string) => ["issues", "document-revisions", issueId, key] as const,
|
||||
documentAnnotations: (issueId: string, key: string, status: "open" | "resolved" | "all" = "all") =>
|
||||
["issues", "document-annotations", issueId, key, status] as const,
|
||||
activity: (issueId: string) => ["issues", "activity", issueId] as const,
|
||||
runs: (issueId: string) => ["issues", "runs", issueId] as const,
|
||||
approvals: (issueId: string) => ["issues", "approvals", issueId] as const,
|
||||
|
||||
+1431
-244
File diff suppressed because it is too large
Load Diff
@@ -447,6 +447,10 @@ const acpxSkillsCompanyLibrary: CompanySkillListItem[] = [
|
||||
sourceLabel: "Paperclip",
|
||||
sourceBadge: "paperclip",
|
||||
sourcePath: "skills/paperclip",
|
||||
catalogKind: null,
|
||||
originHash: null,
|
||||
packageName: null,
|
||||
packageVersion: null,
|
||||
},
|
||||
{
|
||||
id: "skill-design-guide",
|
||||
@@ -470,6 +474,10 @@ const acpxSkillsCompanyLibrary: CompanySkillListItem[] = [
|
||||
sourceLabel: "Local",
|
||||
sourceBadge: "local",
|
||||
sourcePath: "skills/design-guide",
|
||||
catalogKind: null,
|
||||
originHash: null,
|
||||
packageName: null,
|
||||
packageVersion: null,
|
||||
},
|
||||
{
|
||||
id: "skill-mobile-qa",
|
||||
@@ -493,6 +501,10 @@ const acpxSkillsCompanyLibrary: CompanySkillListItem[] = [
|
||||
sourceLabel: "Local",
|
||||
sourceBadge: "local",
|
||||
sourcePath: "skills/mobile-app-qa",
|
||||
catalogKind: null,
|
||||
originHash: null,
|
||||
packageName: null,
|
||||
packageVersion: null,
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user