Cost waterfall
import { CostWaterfall } from "@arcadia/ui/charts";Run cost Report on model API prices
Total $0.100 Failed
CostWaterfall
stepsrequired- readonly CostStep[]
- The run's steps in the order they ran; a sub-agent holds its own under children.
task- string
- What the run set out to do, in one quiet line beside the title.
status- CostStepStatus | null
- The run's state: running, done or failed. Absent reads the steps' own states; null says the outcome was not measured, and the head draws no state.
mode- "cost" | "tokens"
- The unit the bars measure, controlled: cost is measured spend, tokens is input and output. A controlled unit stands even where nothing measured it: every figure then says Not measured and draws no bar, and no spend is invented.
defaultMode- "cost" | "tokens"
- The unit the run opens on, where it measured both, when the caller does not own it: cost where any step measured one, else tokens.
onModeChange- (mode: CostWaterfallMode) => void
- Told the unit a person picked in the head.
collapsed- readonly string[]
- The sub-agents folded to one row, controlled: an id here hides its children.
defaultCollapsed- readonly string[]
- The sub-agents folded from the first frame, when the caller does not own that.
onCollapsedChange- (ids: string[]) => void
- Told the sub-agents folded after a person folds or unfolds one.
openId- string | null
- The step whose details are open, controlled.
defaultOpenId- string | null
- The step whose details are open from the first frame, when the caller does not own that.
onOpenChange- (id: string | null, step?: CostStep) => void
- Told the step whose details a person opened, with that step.
maxHeight- number
- The rows' bound in pixels: past it they scroll under the head and its axis.
formatCost- (amount: number) => string
- How an amount reads on a figure, in the cost column and in the details. Default: dollars with aligned decimals across rows and a leading minus for credits.
columns- boolean | readonly CostWaterfallColumn[]
- The numeric columns at each row's end, read from the step's own
tokensIn,tokensOut,costandduration, with a sub-agent's children added where they measured the same field:in,out,costandtime, in that order.trueshows all four; absent shows none. A field nothing measured reads a quiet hyphen, never a zero. title- string
- Default:
"Run cost" - The head's title.
rootStyle- RootStyle<CostWaterfallKnobs>
Rest props go to HTMLAttributes<HTMLDivElement>.
State machine
Run cost Prepare the release
Total $0.090 Failed