import type { MultiModelCostEstimate } from "./pricing.js"; /** * Parse a `--max-cost` flag value or DEEPDIVE_MAX_COST env var into a * dollar number. Accepts: * - "$0.50" → 0.50 * - "0.50" → 0.50 * - "$5" → 5 * - "5" → 5 * - ".25" → 0.25 * * Rejects: negative, non-numeric, scientific notation, currency suffixes * other than leading "$". Returns undefined for invalid input — callers * decide whether that's a hard error (CLI) or just "no cap" (env). */ export declare function parseMaxCost(raw: string | undefined): number | undefined; /** * Format a cost cap for inclusion in a user-visible error / log. * formatMaxCost(0.5) → "$0.500" * formatMaxCost(5) → "$5.00" * formatMaxCost(0.001) → "$0.0010" */ export declare function formatMaxCost(amount: number): string; /** * Thrown by `enforceBudget` when the running cost has crossed the cap. * The agent's outer try/catch surfaces this with a clear stderr message * and a distinct exit code, so wrapping scripts can branch on "we hit * the cap" vs "actual error". * * Carries: `spentUsd` (running aggregate at the moment of detection), * `capUsd` (the cap the run was started with), and `unpricedCalls` (calls * that contributed $0 because their model wasn't priced — surfaced so * the user knows the cap was enforced against the priced subset only). */ export declare class BudgetExceededError extends Error { readonly spentUsd: number; readonly capUsd: number; readonly unpricedCalls: number; constructor(spentUsd: number, capUsd: number, unpricedCalls: number); } /** * Check whether the running cost has crossed the cap. Throws * `BudgetExceededError` if so; returns silently otherwise. Caller is * the agent's per-call usage sink — called after each `llm.call` event * is emitted (so the event itself appears in the stream even when the * call that pushed us over the cap is the one that triggers the abort). * * The `unpricedCallCount` argument is the running tally of calls whose * model contributed $0 to the aggregate — used for the warn message, * not for the threshold check itself. */ export declare function enforceBudget(cost: MultiModelCostEstimate, capUsd: number | undefined, unpricedCallCount: number): void; //# sourceMappingURL=budget.d.ts.map