/** What one repair attempt ended with. */ export type RepairGatewayAuthOutcome = /** Rotated and pushed to the agent. `epoch` numbers the rotation (see `rotationEpoch`). */ { status: 'ok'; clientSecret: string; epoch: number; } /** The secret WAS rotated (the old one is dead) but the push to the agent failed. */ | { status: 'delivery-failed'; clientSecret: string; error: string; epoch: number; } /** * The call succeeded but issued no new secret: the server found a credential push for * this agent already in flight or just finished and deliberately rotated nothing. */ | { status: 'unchanged'; } /** Nothing was rotated: the call failed or the server refused it. */ | { status: 'failed'; message: string; } /** A repair for this agent is already running (this tab). Nothing was sent. */ | { status: 'busy'; }; /** * The single place that sends `setupAgentGatewayAuth` from the agent page (BOFF-8686). * * `setupAgentGatewayAuth` rotates the agent's OAuth secret, so callers must only * invoke `repair` from a deliberate, confirmed user action; nothing here runs by * itself. `running` is true while a repair for this hook's agent is in flight, whichever * component started it. `rotationEpoch` is the number of the latest rotation of this agent's * secret: a secret from an earlier epoch is dead and must not be shown any more. */ export declare function useRepairGatewayAuth(agentId: string | undefined): { repair: () => Promise; running: boolean; rotationEpoch: number; };