import type { AccountSlot } from "./accounts.ts";
import type { PinSource } from "./affinity.ts";
import type { AnthropicSubscriptionAuthLane } from "./options.ts";
import type { Options, SDKMessage, SdkQuery } from "./sdk-boundary.ts";
export type AuthenticatedAttemptInput = {
    accountName: string;
    accounts: readonly AccountSlot[];
    authLane: AnthropicSubscriptionAuthLane;
    pinSource?: PinSource;
    options: Options;
    /**
     * Digest of the OAuth access token this attempt authenticates with. A
     * resident session spawned with a different token must not serve the turn:
     * a refresh revokes the previous access token, so that subprocess would
     * answer 401 "token has been revoked".
     */
    credentialDigest?: string;
    /**
     * Checks the CLI's `initializationResult()` before the prompt is consumed; throwing fails the attempt closed
     * (a `claude-cli` account that initialized on an inherited credential, senpi#4436).
     */
    verifyInitialization?: (initialization: unknown) => Promise<void>;
};
export interface RetainableAttempt<TEvent> {
    messages: AsyncIterable<TEvent>;
    discard(): void;
}
export type AttemptFactoryInput = {
    prompt: Parameters<SdkQuery>[0]["prompt"];
    query: SdkQuery;
    sessionId?: string;
    /** The turn's abort signal; an initialization wait never outlives it. */
    signal?: AbortSignal;
    onQuery?: (query: ReturnType<SdkQuery>) => void;
    onAttemptStart?: () => void;
    createAttempt?: (input: AuthenticatedAttemptInput) => RetainableAttempt<SDKMessage> | Promise<RetainableAttempt<SDKMessage>>;
};
/**
 * Awaits the CLI's `initializationResult()`, rejecting as soon as `signal` aborts, so an abort during a hung
 * initialization ends the wait (as `awaitInitialization` does for a reattach). A later rejection of the abandoned
 * wait is handled, never unhandled.
 */
export declare function initializationOrAbort(initialization: Promise<unknown>, signal?: AbortSignal): Promise<unknown>;
export declare function createAttemptMessages(input: AttemptFactoryInput, auth: AuthenticatedAttemptInput): Promise<AsyncIterable<SDKMessage>>;
//# sourceMappingURL=auth-attempt.d.ts.map