// In an app: import { setupPlanCard } from '@aparte/plugin-cards/plan';
const { setupPlanCard } = window.apartePlugins.cards.plan;
const ago = (minutes) => Date.now() - minutes * 60000;
setupPlanCard({ tool: 'update_plan', variant: 'timeline' });
document.querySelector('aparte-chat-bubble').setSegments([{
id: 's1', type: 'tool_call', status: 'resolved',
toolCall: { id: 'c-s1', name: 'update_plan', input: {} },
structuredResult: {
title: 'Fix the failing build', timed: true,
steps: [
{ title: 'Reproduce the failure', status: 'done', startedAt: ago(14), finishedAt: ago(12) },
{ title: 'Run the parser tests', status: 'failed', startedAt: ago(12), finishedAt: ago(11), detail: '2 of 148 failed: a heading inside a list' },
{ title: 'Fix the list parser', status: 'done', startedAt: ago(11), finishedAt: ago(4) },
{ title: 'Run the whole suite', activeForm: 'Running the whole suite', status: 'in-progress', startedAt: ago(4) },
{ title: 'Open a pull request', status: 'pending' },
],
},
}]);