/** * The autopilot cost cap in force, in tokens or in dollars (cost-in-tokens/AC-9..AC-19). * * On a Claude or Codex subscription the dollars are never charged, so a dollar cap * stops a run on a figure nobody pays. Setup and init now save the cap in tokens; * a dollar cap already saved keeps working until someone sets a new one, because * converting it at a guessed rate would change what it stops on without anyone * choosing that (design D1). * * @module */ import type { AutopilotConfig } from './state.js'; export type Cap = { unit: 'tokens'; tokens: number; } | { unit: 'usd'; usd: number; }; /** * The cap a config sets, or null for none. Within one config the token cap wins * (cost-in-tokens/AC-12); which config the keys came from is settled earlier, by * `withTeamDefaults`, which keeps them together. */ export declare function capInForce(c: AutopilotConfig | null | undefined): Cap | null; /** * `40M`, `500k`, `40000000` → whole tokens; `none` → null; anything else → undefined * (cost-in-tokens/AC-10). A fraction is allowed only where a suffix makes it whole * (`1.5M`), so a cap is always a whole number of tokens. */ export declare function parseTokenCap(text: string): number | null | undefined; /** * Tokens left before the cap less a 10% margin — the same margin the dollar cap * keeps (autopilot-reads-agent-result/AC-17). Negative once past it. */ export declare function tokensLeft(capTokens: number, usedTokens: number): number; /** `40M tokens` or `$15`: the cap in the unit it is set in (cost-in-tokens/AC-19). */ export declare function capText(cap: Cap): string; //# sourceMappingURL=cap.d.ts.map