Adds readable skill badges to the agent detail view with an interactive detail panel, along with corresponding tests and utility functions. A typecheck fix for the dashboard docker config is included. Fusion-Task-Id: FN-3381
16 lines
372 B
TypeScript
16 lines
372 B
TypeScript
const SKILL_PATH_LABEL_PATTERN = /(?:^|\/)skills\/([^/]+)\/SKILL\.md$/i;
|
|
|
|
export function formatAgentSkillBadgeLabel(skillId: string): string {
|
|
const trimmedSkillId = skillId.trim();
|
|
if (!trimmedSkillId) {
|
|
return skillId;
|
|
}
|
|
|
|
const match = trimmedSkillId.match(SKILL_PATH_LABEL_PATTERN);
|
|
if (match?.[1]) {
|
|
return match[1];
|
|
}
|
|
|
|
return trimmedSkillId;
|
|
}
|