import type { AssistantMessageDiagnostic } from "@earendil-works/pi-ai"; /** Diagnostic `type` tag carrying the cooling deadline; also the wire contract the * stophook matches on. */ export declare const MANAGED_PROVIDER_COOLING_DIAGNOSTIC = "crtr:managed-provider-cooling"; /** Stable error code so a caller can recognize the typed error without message parsing. */ export declare const MANAGED_PROVIDER_COOLING_CODE = "managed_provider_cooling"; /** * Broker-owned, live policy exposed to the jiti-loaded provider-rotation * extension through its UI context. A callback (rather than a boot-time value) * is required because an attached viewer can pin or unpin the running broker * with `set_model`; the very next provider attempt must observe that decision. */ export declare const MANAGED_PROVIDER_ROTATION_POLICY_UI: unique symbol; export type ManagedProviderRotationPolicy = { allowCrossProviderFallback: boolean; reason?: "provider-pinned" | "model-exact"; }; export type ManagedProviderRotationPolicyControl = () => ManagedProviderRotationPolicy; /** Non-broker/test hosts retain the historical permissive fallback policy. */ export declare function readManagedProviderRotationPolicy(ui: unknown): ManagedProviderRotationPolicy; /** Every managed provider pool tried this turn is cooling; `rateLimitedUntil` is * the earliest future deadline (epoch ms) across those pools. */ export declare class ManagedProviderCoolingError extends Error { readonly code = "managed_provider_cooling"; readonly rateLimitedUntil: number; constructor(message: string, rateLimitedUntil: number); /** The diagnostic to attach to the terminal assistant error so the deadline * reaches the stophook without regex-parsing the message. Built inline (not via * pi-ai's `createAssistantMessageDiagnostic`) to keep this module's runtime * import graph pi-free — the shape matches `AssistantMessageDiagnostic`. */ toDiagnostic(): AssistantMessageDiagnostic; } /** Strictly read the managed-cooling deadline (epoch ms) off an assistant * message's diagnostics. Returns the finite, strictly-positive `rateLimitedUntil` * from the first cooling diagnostic, or undefined when the message carries none * (or a malformed one). */ export declare function hasManagedProviderCoolingDiagnostic(message: unknown): boolean; export declare function extractCoolingDeadline(message: unknown): number | undefined;