import { Octokit } from '@octokit/rest';
/**
 * Options for GitHub authentication.
 * Supports both personal access token and GitHub App authentication.
 */
export interface GitHubAuthOptions {
    /** Personal access token or fine-grained token */
    token?: string;
    /** GitHub App ID */
    appId?: string;
    /** GitHub App private key (PEM content or file path) */
    privateKey?: string;
    /** GitHub App installation ID (auto-detected if omitted) */
    installationId?: string;
    /** Repository owner (for auto-detecting installation ID) */
    owner?: string;
    /** Repository name (for auto-detecting installation ID) */
    repo?: string;
}
/**
 * Result of successful GitHub authentication.
 */
export interface GitHubAuthResult {
    /** Authenticated Octokit instance */
    octokit: Octokit;
    /** Authentication method used */
    authType: 'github-app' | 'token';
    /** Raw token string for environment propagation */
    token: string;
}
/**
 * Create an authenticated Octokit instance.
 * Returns undefined if no credentials are provided (auth is optional in CLI mode).
 *
 * For token auth: uses the token directly.
 * For GitHub App auth: creates JWT-authenticated client, resolves installation ID,
 * then extracts an installation access token for environment propagation.
 */
export declare function createAuthenticatedOctokit(options: GitHubAuthOptions): Promise<GitHubAuthResult | undefined>;
/**
 * Resolve GitHub auth options from environment variables.
 * Used as fallback when no explicit CLI arguments are provided.
 */
export declare function resolveAuthFromEnvironment(): GitHubAuthOptions;
/**
 * Resolve private key — supports both inline PEM content and file paths.
 */
export declare function resolvePrivateKey(keyOrPath: string): string;
/**
 * Inject GitHub credentials into process.env for child processes.
 *
 * Sets GITHUB_TOKEN/GH_TOKEN for gh CLI, and configures git HTTPS auth
 * via GIT_CONFIG_COUNT/KEY/VALUE env vars so `git clone`, `git push`, etc.
 * work automatically against github.com without any local git config.
 *
 * Uses git's GIT_CONFIG_COUNT mechanism (git 2.31+, March 2021):
 * - No temp files or global config mutation
 * - Inherited by all child processes automatically
 * - Works regardless of local git configuration
 */
export declare function injectGitHubCredentials(token: string): void;
