/** * The shared budget file (ADR-508 ยง2.1): `.claude-flow/cost/budget.json`, * version 1. `ruflo cost budget set` writes it; the ruflo-mods cost ladder and * `ruflo cost budget export` read it. * * Second copy of plugins/ruflo-mods/hooks/cost/file.ts (the mod may not import * outside its plugin folder). __tests__/cost-budget-file.test.ts runs both over * the same hostile corpus and requires identical answers. */ export declare const BUDGET_PATH = ".claude-flow/cost/budget.json"; export declare const MAX_WINDOWS = 8; export declare const MAX_USD = 1000000; /** The largest budget file read (a budget is a few hundred bytes). */ export declare const MAX_FILE_BYTES: number; /** LiteLLM's `budget_duration` grammar (`30s`, `30m`, `30h`, `30d`), with a bounded count. */ export declare const PERIOD: RegExp; export interface BudgetWindow { readonly usd: number; readonly period: string; } export interface BudgetFile { readonly version: 1; readonly windows: readonly BudgetWindow[]; readonly hardStop: boolean; readonly fallbackModel?: string; } export declare const periodSeconds: (period: string) => number; /** A budget value validated, or undefined when it breaks any rule (see the mod copy for the list). */ export declare function validateBudget(value: unknown): BudgetFile | undefined; /** The smallest-`usd` window (ties: the shorter period): the one a single session nears first. */ export declare function ladderWindow(budget: BudgetFile): BudgetWindow; export type ReadBudget = { kind: 'absent'; } | { kind: 'ok'; budget: BudgetFile; } | { kind: 'invalid'; reason: string; }; /** Reads and validates the project's budget file. Never throws. */ export declare function readBudget(cwd: string): ReadBudget; export interface BudgetFlags { daily?: unknown; weekly?: unknown; monthly?: unknown; hardStop?: unknown; fallbackModel?: unknown; } /** A budget from `set` flags (`--daily` 24h, `--weekly` 7d, `--monthly` 30d), or the reason it is not one. */ export declare function budgetFromFlags(flags: BudgetFlags): { budget?: BudgetFile; error?: string; }; /** Writes the budget file atomically (temp file, rename). Holds no credential. */ export declare function writeBudget(cwd: string, budget: BudgetFile): string; //# sourceMappingURL=budget-file.d.ts.map