Optionalparent: UsageAccumulatorThe current running totals.
Adds one model step's usage to the running totals (and to any parent
this accumulator is a .child() of). modelKey (e.g.
"anthropic:claude-sonnet-5") is looked up in the price table to
compute cost; an unknown key makes .totals.cost undefined rather
than throwing.
OptionalmodelKey: stringCreates a new accumulator whose .add() calls roll up into this one, for
per-call/per-brick totals that still contribute to a parent's grand total.
Accumulates token usage (and, optionally, cost) across model calls.
runAgentLoopowns a per-run accumulator; aBrickorStructurecan hold a long-lived one and pass.child()into each call so totals roll up across calls (and across bricks, for aStructure).