import { z } from "zod"; declare const BudgetConfigSchema: z.ZodObject<{ schema_version: z.ZodLiteral<1>; monthly_budget_usd: z.ZodOptional; monthly_start_day: z.ZodDefault; story_budget_usd: z.ZodOptional; credit_balance_usd: z.ZodOptional; credit_baseline_at: z.ZodOptional; }, z.core.$strip>; export type BudgetConfig = z.infer; /** * Load `.brewing/budget.yaml`. Returns null when the file is absent — * gauge is opt-in. Throws on malformed YAML / schema violation so a * mis-authored config surfaces loudly instead of silently disabling. */ export declare function loadBudgetConfig(repoRoot: string): BudgetConfig | null; /** ISO-8601 date of the current monthly budget period start, given config. */ export declare function currentPeriodStart(config: Pick, now?: Date): Date; /** * Sum cost entries across ALL story sidecars in `specs/` whose entry * `at` is >= `since`. Story IDs are derived from filenames * (`story-.cost.jsonl`). Used by both: * - monthly_budget_usd gauge (since = period start) * - credit_balance_usd gauge (since = credit_baseline_at) */ export declare function aggregateSpendSince(repoRoot: string, since: Date): { usd: number; entryCount: number; storyCount: number; }; /** * Back-compat wrapper for the period-based aggregation. */ export declare function aggregateMonthSpend(repoRoot: string, config: BudgetConfig, now?: Date): { usd: number; entryCount: number; storyCount: number; }; export interface FuelGaugeArgs { currentUsd: number; budgetUsd: number; /** GIF rendered when status === "warn" or "halt". Defaults to fuel-empty. */ gifUrl?: string; } export type BudgetStatus = "ok" | "warn" | "halt"; export declare function classifyBudgetStatus(currentUsd: number, budgetUsd: number): BudgetStatus; /** * Render the fuel-gauge markdown block. Empty string when budget <= 0 * (defensive — the config schema rejects this). Always returns a * trailing newline so callers can concatenate without thinking. */ export declare function formatFuelGauge(args: FuelGaugeArgs): string; /** * Render the credit-balance gauge (sc#66 0.19.0-α.35). Reports remaining * USD on a one-shot Anthropic deposit (no auto-recharge). Spends counted * since `baselineAt`; remaining = `deposit - spent`. */ export declare function formatCreditGauge(args: { depositUsd: number; spentUsd: number; baselineAt: string; gifUrl?: string; }): string; /** * Convenience: read config + aggregate spend + format gauge(s) in one * call. Returns empty string when no budget.yaml exists (gauge disabled). * Renders BOTH gauges when both fields are set in the config. * Best-effort: a parse failure or aggregation error logs to console.warn * and returns "" rather than blocking the agent's comment. */ export declare function fuelGaugeFromRepo(repoRoot: string, now?: Date): string; export {}; //# sourceMappingURL=budget.d.ts.map