diff --git a/plugins/plugin-agent-catalog/src/components/AgentInfoCard.tsx b/plugins/plugin-agent-catalog/src/components/AgentInfoCard.tsx index 9ddd3f5..30025b8 100644 --- a/plugins/plugin-agent-catalog/src/components/AgentInfoCard.tsx +++ b/plugins/plugin-agent-catalog/src/components/AgentInfoCard.tsx @@ -8,15 +8,35 @@ import type { ReactNode } from 'react'; import { InfoCard } from '@backstage/core-components'; import { useEntity } from '@backstage/plugin-catalog-react'; import { Chip, Grid, Typography } from '@material-ui/core'; +import { makeStyles } from '@material-ui/core/styles'; const A = 'agentcatalog.io'; +const useStyles = makeStyles(theme => ({ + chips: { + display: 'flex', + flexWrap: 'wrap', + gap: theme.spacing(1), + }, + statValue: { + overflowWrap: 'anywhere', + }, + detail: { + margin: 0, + overflowWrap: 'anywhere', + }, +})); + const Stat = ({ label, value }: { label: string; value: ReactNode }) => ( - + {label} - + {value} @@ -24,8 +44,10 @@ const Stat = ({ label, value }: { label: string; value: ReactNode }) => ( export const AgentInfoCard = () => { const { entity } = useEntity(); + const classes = useStyles(); const ann = entity.metadata.annotations ?? {}; - const agent = (entity.spec as { agent?: Record })?.agent ?? {}; + const agent = + (entity.spec as { agent?: Record })?.agent ?? {}; const requests = ann[`${A}/usage-requests`]; const tokens = ann[`${A}/usage-tokens`]; @@ -54,41 +76,73 @@ export const AgentInfoCard = () => { > - {cluster && } - {discovery && } - {reachable && ( - - )} - {sourceStatus && ( - - )} - {cardSource && } - {interfaceStatus && ( - - )} +
+ {cluster && ( + + )} + {discovery && ( + + )} + {reachable && ( + + )} + {sourceStatus && ( + + )} + {cardSource && ( + + )} + {interfaceStatus && ( + + )} +
- + @@ -96,42 +150,76 @@ export const AgentInfoCard = () => { {sourceStatus === 'unavailable' && ( - - Source is currently unavailable. Last successful observation: {sourceLastSuccessAt ?? 'unknown'}. + + Source is currently unavailable. Last successful observation:{' '} + {sourceLastSuccessAt ?? 'unknown'}. )} {signals && ( - - Flagged because: {signals}. If this is a real - agent, label its Service agentcatalog.io/a2a: "true"; - if it's a false positive, label it "false". + + Flagged because: {signals}. If this is a real agent, + label its Service agentcatalog.io/a2a: "true"; if + it's a false positive, label it "false". )} {interfaceDrift && ( - - Declared interface differs from the live card: {interfaceDrift}. + + Declared interface differs from the live card:{' '} + {interfaceDrift}. )} {(modelConfig || image) && ( - - {modelConfig && <>model config: {modelConfig} } - {image && <>image: {image}} + + {modelConfig && ( + <> + model config: {modelConfig}{' '} + + )} + {image && ( + <> + image: {image} + + )} )} {requests === undefined && ( - + No per-agent usage: this agent has no gateway key alias. Issue it - a key aliased {String(agent.namespace ?? 'ns')}/{entity.metadata.title ?? entity.metadata.name} to - light up traction. + a key aliased{' '} + + {String(agent.namespace ?? 'ns')}/ + {entity.metadata.title ?? entity.metadata.name} + {' '} + to light up traction. )} diff --git a/plugins/plugin-agent-catalog/src/plugin.tsx b/plugins/plugin-agent-catalog/src/plugin.tsx index f58a2fe..6a58298 100644 --- a/plugins/plugin-agent-catalog/src/plugin.tsx +++ b/plugins/plugin-agent-catalog/src/plugin.tsx @@ -32,14 +32,14 @@ const agentFleetPage = PageBlueprint.make({ routeRef: agentsRouteRef, title: agentCatalogNavItem.title, icon: , - loader: () => - import('./components/FleetPage').then(m => ), + loader: () => import('./components/FleetPage').then(m => ), }, }); const agentInfoCard = EntityCardBlueprint.make({ name: 'agent-info', params: { + type: 'info', filter: (entity: Entity) => entity.kind === 'Component' && ['ai-agent', 'ai-agent-team', 'llm-workload'].includes(