feat(chat): MCP tool apps — custom inline renderers for 12 tools
12 of 33 MCP tools now render as rich inline cards instead of raw JSON: EntityCard, HealthSummary, LXCList, EntityTable, KnowledgeResults, BlastRadius, ChangeLog, FleetSnapshot, MetricChart. Architecture: - Server: annotateJSONResult() wraps queryRows with __renderer hints - Registry: match/dispatch system maps tool names to Svelte components - Chat: inline dispatch with 5-card limit, overflow to collapsed group - ToolCallGroup: unmatched prop, hides when all matched, ARIA labels Tests: 3 new Go tests for annotateJSONResult (wrap, no-op, multi-row).
This commit is contained in:
11
web/src/lib/renderers/entity-card.ts
Normal file
11
web/src/lib/renderers/entity-card.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { registerToolRenderer } from '$lib/tool-renderers'
|
||||
import EntityCard from './EntityCard.svelte'
|
||||
|
||||
const TOOLS = ['get_entity', 'whoami', 'explain']
|
||||
|
||||
export function init() {
|
||||
registerToolRenderer({
|
||||
match: (t) => TOOLS.includes(t.name) || t.result?.__renderer === 'entity_card',
|
||||
component: EntityCard,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user