import type { SessionStateMap } from "#harness/types.js"; import type { TokenUsage } from "#shared/token-usage.js"; /** What a run's `ctx.agent` sessions have spent, turn by turn. */ export interface RunUsageTally { /** Adds one ended turn's usage. */ record(turnUsage: TokenUsage): void; /** The running total, or `undefined` before any turn ended. */ total(): TokenUsage | undefined; } /** `onRecord` runs after each recorded turn, so the run can send a total no reply will carry. */ export declare function createRunUsageTally(onRecord?: () => void): RunUsageTally; /** * Adds a run's delegated spend to the session's totals: its running `total`, * less the part of it `counted` earlier. */ export declare function countRunUsage(session: T, total: TokenUsage, counted?: TokenUsage): T;