// In an app: import { setupScoreCard } from '@aparte/plugin-cards/score';
const { setupScoreCard } = window.apartePlugins.cards.score;
setupScoreCard({ tool: 'get_match' });
const viewport = document.querySelector('aparte-chat-viewport');
viewport.appendMessage({ id: 'u1', role: 'user', content: 'What’s the score in the Northport game?', timestamp: Date.now() });
viewport.appendMessage({ id: 'a1', role: 'assistant', timestamp: Date.now(), segments: [{
id: 's1', type: 'tool_call', status: 'resolved',
toolCall: { id: 'c-s1', name: 'get_match', input: { team: 'Northport FC' } },
structuredResult: {
home: { name: 'Northport FC', shortName: 'NPT', color: '#c8102e', score: 2 }, away: { name: 'Riverside United', shortName: 'RIV', color: '#1d4ed8', score: 1 },
status: 'live', clock: 67, sport: 'football', competition: 'Coastal League', round: 'Matchday 12', venue: 'Harbour Ground',
events: [
{ minute: 12, team: 'home', type: 'goal', player: 'M. Okafor' },
{ minute: 38, team: 'away', type: 'goal', player: 'L. Varga' },
{ minute: 61, team: 'home', type: 'penalty', player: 'S. Dubois' },
],
},
}] });