/**
 * Git credential handling via PTY.
 *
 * Detects credential prompts (password, passphrase, username, PIN) in PTY output,
 * forwards them to the client via credential_prompt messages, and writes the
 * client's response back to PTY stdin.
 */
import type { CredentialPromptType, Message } from "@pocketcoder/shared";
export interface CredentialPattern {
    pattern: RegExp;
    type: CredentialPromptType;
}
export declare const CREDENTIAL_PATTERNS: CredentialPattern[];
/**
 * Detect a credential prompt in PTY output data.
 * Returns the prompt type and the full prompt text, or null if no prompt detected.
 */
export declare function detectCredentialPrompt(data: string): {
    type: CredentialPromptType;
    prompt: string;
} | null;
export interface CredentialResponse {
    value: string;
    cancelled: boolean;
}
/**
 * Request credentials from the client by sending a credential_prompt event
 * and waiting for a credential_response. Times out after 90 seconds.
 *
 * @param requestId The request ID to correlate prompt with response
 * @param promptType The type of credential being requested
 * @param prompt The raw prompt text from the PTY
 * @param send Function to send messages to the client
 * @returns The credential response from the client
 */
export declare function requestCredential(requestId: string, promptType: CredentialPromptType, prompt: string, send: (message: Message) => void): Promise<CredentialResponse>;
/**
 * Resolve a pending credential request with the client's response.
 * Called when a credential_response message is received.
 *
 * @param requestId The request ID from the credential_response
 * @param value The credential value entered by the user
 * @param cancelled Whether the user cancelled the prompt
 * @returns true if the request was found and resolved, false otherwise
 */
export declare function resolveCredential(requestId: string, value: string, cancelled: boolean): boolean;
/**
 * Check if there is a pending credential request for the given request ID.
 */
export declare function hasPendingCredential(requestId: string): boolean;
/**
 * Clear all pending credential requests. Used during shutdown.
 */
export declare function clearPendingCredentials(): void;
//# sourceMappingURL=credentials.d.ts.map