/**
 * BYOK (Bring Your Own Key) budget fetcher.
 *
 * For custom harnesses that use a provider's API key stored in the keychain
 * (e.g. OpenRouter), this module fetches the account's credit/usage data so
 * `agents view` can show a budget bar alongside the harness detail row — the
 * same bar style the native usage system uses, just sourced from the provider
 * API rather than the CLI's own usage tracking.
 */
import type { Profile } from './profiles.js';
export interface ByokBudgetInfo {
    limitUsd: number | null;
    remainingUsd: number | null;
    usedUsd: number;
    usedPercent: number | null;
    fetchedAt: Date;
}
export interface ByokUsageResult {
    budget: ByokBudgetInfo | null;
    error: string | null;
}
export declare function setByokFetchForTest(fn: typeof globalThis.fetch): void;
export declare const BYOK_REFRESH_INTERVAL_MS: number;
export declare function setByokCachePathForTest(value: string | null): string | null;
export declare function resetByokCacheForTest(): void;
export declare function hasByokProvider(provider: string): boolean;
export declare function renderByokBar(result: ByokUsageResult): string;
/**
 * Fetch the BYOK budget for a harness.
 *
 * Returns `null` when the harness has no registered BYOK provider or no auth.
 * Returns a `ByokUsageResult` with `budget: null` when the token is absent
 * from the keychain (so the caller can skip rendering a bar without error).
 *
 * Ordinary reads are cache-only. Explicit refreshes are serialized per provider
 * credential across every agents-cli process on the device.
 */
export declare function getByokUsageForHarness(profile: Profile, opts?: {
    forceRefresh?: boolean;
}): Promise<ByokUsageResult | null>;
/** Refresh each configured BYOK credential when its daemon-owned snapshot is due. */
export declare function refreshDueByokUsage(profiles: Profile[], now?: number): Promise<{
    refreshed: number;
    skipped: number;
}>;
