Turn Footer

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

TurnFooter options
NameTypeDefaultDescription
keyrequiredstring—Names the footer's Copy button among others on the page
elapsedrequirednumber—Milliseconds the turn ran, or has run so far
atstring—When it finished, as an ISO time; left out while it runs
state"running" | "done" | "stopped" | "failed"——
timeZonestring——
localestring——
tokensnumber—Tokens the turn used, in and out together
costnumber—What the tokens cost, in dollars
modelstring—The model that answered, by name
filesTurnFooterFile[]——
limitnumber2File chips before "+N more"; 2 by default
copystring—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.

Source