diff --git a/src/components/SkillInstallCard.tsx b/src/components/SkillInstallCard.tsx index bdc29491f..b5da33a75 100644 --- a/src/components/SkillInstallCard.tsx +++ b/src/components/SkillInstallCard.tsx @@ -1,6 +1,16 @@ import type { ClawdisSkillMetadata } from 'clawhub-schema' import { formatInstallCommand, formatInstallLabel } from './skillDetailUtils' +const CAPABILITY_DISPLAY: Record = { + shell: { icon: '>_', label: 'Shell commands' }, + filesystem: { icon: '\uD83D\uDCC2', label: 'File access' }, + network: { icon: '\uD83C\uDF10', label: 'Web search/fetch' }, + browser: { icon: '\uD83D\uDD0D', label: 'Browser control' }, + sessions: { icon: '\u26A1', label: 'Session orchestration' }, + messaging: { icon: '\u2709\uFE0F', label: 'Message sending' }, + scheduling: { icon: '\u23F0', label: 'Scheduling/cron' }, +} + type SkillInstallCardProps = { clawdis: ClawdisSkillMetadata | undefined osLabels: string[] @@ -12,6 +22,7 @@ export function SkillInstallCard({ clawdis, osLabels }: SkillInstallCardProps) { const envVars = clawdis?.envVars ?? [] const dependencies = clawdis?.dependencies ?? [] const links = clawdis?.links + const hasCapabilities = Boolean(clawdis?.capabilities?.length) const hasRuntimeRequirements = Boolean( clawdis?.emoji || osLabels.length || @@ -19,18 +30,35 @@ export function SkillInstallCard({ clawdis, osLabels }: SkillInstallCardProps) { requirements?.anyBins?.length || requirements?.env?.length || requirements?.config?.length || - clawdis?.primaryEnv || - envVars.length, + envVars.length || + clawdis?.primaryEnv, ) const hasInstallSpecs = installSpecs.length > 0 const hasDependencies = dependencies.length > 0 const hasLinks = Boolean(links?.homepage || links?.repository || links?.documentation) - if (!hasRuntimeRequirements && !hasInstallSpecs && !hasDependencies && !hasLinks) return null + if (!hasCapabilities && !hasRuntimeRequirements && !hasInstallSpecs && !hasDependencies && !hasLinks) { + return null + } return (
+ {hasCapabilities ? ( +
+

+ Capabilities +

+
+ {clawdis!.capabilities!.map((cap) => ( +
+ {CAPABILITY_DISPLAY[cap]?.icon ?? cap} + {CAPABILITY_DISPLAY[cap]?.label ?? cap} +
+ ))} +
+
+ ) : null} {hasRuntimeRequirements ? (

@@ -79,7 +107,10 @@ export function SkillInstallCard({ clawdis, osLabels }: SkillInstallCardProps) { Environment variables
{envVars.map((env, index) => ( -
+
{env.name} {env.required === false ? ( optional @@ -87,7 +118,9 @@ export function SkillInstallCard({ clawdis, osLabels }: SkillInstallCardProps) { required ) : null} {env.description ? ( - — {env.description} + + — {env.description} + ) : null}
))} @@ -108,16 +141,21 @@ export function SkillInstallCard({ clawdis, osLabels }: SkillInstallCardProps) {
{dep.name} - {dep.type}{dep.version ? ` ${dep.version}` : ''} + {dep.type} + {dep.version ? ` ${dep.version}` : ''} {dep.url ? ( ) : null} {dep.repository && dep.repository !== dep.url ? ( ) : null}
@@ -160,19 +198,25 @@ export function SkillInstallCard({ clawdis, osLabels }: SkillInstallCardProps) { {links?.homepage ? ( ) : null} {links?.repository ? ( ) : null} {links?.documentation ? ( ) : null}