The line under an agent's turn: time taken, tokens, cost, Copy and the files it changed.
Installation
Usage
import { TurnFooter, type TurnFooterFile } from "./ui/uicontext/components/kit/TurnFooter.ts"export const Footer = <M>(h: Html.H<M>, turn: { readonly id: string; readonly ms: number; readonly endedAt: string; readonly tokens: number; readonly cost: number; readonly answer: string; readonly files: ReadonlyArray<TurnFooterFile> }) => TurnFooter(h, { key: turn.id, elapsed: turn.ms, at: turn.endedAt, tokens: turn.tokens, cost: turn.cost, copy: turn.answer, files: turn.files })API reference
Options
| Name | Type | Default | Description |
|---|---|---|---|
keyrequired | string | — | Names the footer's Copy button among others on the page |
elapsedrequired | number | — | Milliseconds the turn ran, or has run so far |
at | string | — | When it finished, as an ISO time; left out while it runs |
state | "running" | "done" | "stopped" | "failed" | — | — |
timeZone | string | — | — |
locale | string | — | — |
tokens | number | — | Tokens the turn used, in and out together |
cost | number | — | What the tokens cost, in dollars |
model | string | — | The model that answered, by name |
files | TurnFooterFile[] | — | — |
limit | number | 2 | File chips before "+N more"; 2 by default |
copy | string | — | The answer's text, for Copy |
openedFile | (path: string) => Message | — | Pressing a file's chip |
Accessibility
- While the turn runs the footer is a status that says Working and for how long. The finish time is a
<time>element. - The file chips are a named group of buttons, each titled with the full path.