/** * Shared Rate-Limit Budget for GitHub API Calls * * Cross-process coordination via a state file at .specweave/state/github-rate-limit.json. * All GitHub API calls check this shared budget before executing. If the budget * drops below the emergency reserve (200), calls are skipped with a warning. * * Periodically validates the budget against the actual GitHub rate limit * (every 50 calls or 5 minutes, whichever comes first). */ export declare const EMERGENCY_RESERVE = 200; export interface BudgetState { remaining: number; limit: number; resetAt: string; lastChecked: string; callsSinceValidation: number; } /** * Read the current budget state from disk. Returns default if file missing or corrupt. */ export declare function getBudgetState(projectRoot: string): Promise; /** * Check if there is enough budget to make a GitHub API call. * Returns false if remaining < EMERGENCY_RESERVE (200). */ export declare function checkBudget(projectRoot: string): Promise; /** * Decrement the budget by 1 after a GitHub API call. * Atomic: read -> decrement -> write. */ export declare function decrementBudget(projectRoot: string): Promise; /** * Validate the budget against the actual GitHub rate limit via `gh api rate_limit`. * Called every VALIDATION_INTERVAL_CALLS decrements or if lastChecked > VALIDATION_INTERVAL_MS. */ export declare function validateBudget(projectRoot: string): Promise; /** * Check if validation is needed (every 50 calls or 5 min). */ export declare function needsValidation(state: BudgetState): boolean; /** * Combined check-and-decrement for use in GitHubClientV2. * Returns true if the call should proceed, false if budget exhausted. * Triggers validation when needed. */ export declare function checkAndDecrement(projectRoot: string): Promise; //# sourceMappingURL=github-rate-limit-budget.d.ts.map