TaskElapsed
Small pieces of task metadata for your own task rows. TaskElapsed prints the time between startedAt and endedAt (for example 1m 23s) and ticks every second while the task is running and has no end time; it renders nothing for a task that has not started. It renders a bare span, so wrap it in Text for size and color. TaskKindIcon shows the icon of a task kind (shell, agent, remote, workflow) in a light gray ThemeIcon; size is a Mantine size, md by default. TaskList, TaskDetail and AgentTree use both. The underlying helpers are getTaskElapsedMs, toTimestamp and the useNow hook.
Getting Started
$pnpm add @sinups/ai-kit @mantine/core @mantine/hooks @tabler/icons-reactExamples
Kinds and elapsed time
API reference
Prop
Type
Required
task
Pick<BackgroundTask, 'status' | 'startedAt' | 'endedAt'>
Yes
Task whose `startedAt`/`endedAt` give the elapsed time