feat(client): project digital employee runtime into UI
This commit is contained in:
@@ -613,10 +613,6 @@ export function postDigitalEmployeeWorkdayAction(
|
||||
});
|
||||
}
|
||||
|
||||
export function digitalEmployeeReportPdfUrl(date: string): string {
|
||||
return `${apiOrigin()}${apiBase}/api/digital-employee/reports/${encodeURIComponent(date)}/pdf`;
|
||||
}
|
||||
|
||||
export function dispatchPlanNow(planId: string): Promise<PlanDispatchResponse> {
|
||||
return apiFetch<PlanDispatchResponse>(`/api/debug/plan/${encodeURIComponent(planId)}/dispatch`, {
|
||||
method: 'POST',
|
||||
|
||||
@@ -432,6 +432,18 @@ function categoryFor(skillId: string): string {
|
||||
return '综合';
|
||||
}
|
||||
|
||||
function capabilityLevelFor(value: unknown): SkillSummary['capabilityLevel'] {
|
||||
if (
|
||||
value === 'core' ||
|
||||
value === 'standard' ||
|
||||
value === 'specialized' ||
|
||||
value === 'experimental'
|
||||
) {
|
||||
return value;
|
||||
}
|
||||
return 'standard';
|
||||
}
|
||||
|
||||
function zhDescription(skillId: string, rawDescription: unknown, name: string): string {
|
||||
const description = str(rawDescription).trim();
|
||||
if (description && hasChinese(description)) return description;
|
||||
@@ -450,8 +462,8 @@ export function adaptSkillSummaries(skillsData: Obj[] | null): SkillSummary[] {
|
||||
version: s.version ? str(s.version) : null,
|
||||
enabled: Boolean(s.enabled),
|
||||
description: zhDescription(sid, s.description, zhName(sid, str(s.name, sid))),
|
||||
category: categoryFor(sid),
|
||||
capabilityLevel: 'standard' as const,
|
||||
category: s.category ? str(s.category, categoryFor(sid)) : categoryFor(sid),
|
||||
capabilityLevel: capabilityLevelFor(s.capability_level ?? s.capabilityLevel),
|
||||
source: 'skill-api' as const,
|
||||
};
|
||||
});
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user