import { type RunTextCommand } from '../gh-cli/exec.mts'; /** Substrings of a failed `gh` call that mark a transport hiccup worth retrying. */ export declare const DEFAULT_RETRYABLE_MARKERS: readonly string[]; /** The largest stdout one buffered `gh api` call may return; job logs are streamed, not buffered. */ export declare const API_MAX_BUFFER_BYTES: number; export interface GhApiOptions { /** Runs `gh` with the given argv and returns stdout. Defaults to {@link createGhRunner}. */ run?: RunTextCommand; attempts?: number; retryableMarkers?: readonly string[]; sleep?: (ms: number) => Promise; warn?: (message: string) => void; } export interface GhApi { /** `gh api ` with bounded retries on transport errors. Resolves to stdout. */ call: (args: string[]) => Promise; isRetryable: (error: unknown) => boolean; sleep: (ms: number) => Promise; /** Runs an arbitrary `gh` argv once, without retries. */ run: RunTextCommand; } /** * Builds the default `gh` runner. `tokenEnv` names the environment variable that holds the * token; when set and present it is passed to `gh` as `GH_TOKEN`. Otherwise `gh` uses its own * credentials. */ export declare function createGhRunner(tokenEnv?: string): RunTextCommand; /** The `gh` child environment: forced color removed, and `tokenEnv`'s value exposed as `GH_TOKEN`. */ export declare function ghEnvWithToken(tokenEnv?: string): (env: NodeJS.ProcessEnv) => NodeJS.ProcessEnv; export declare function createGhApi({ run, attempts, retryableMarkers, sleep, warn, }?: GhApiOptions): GhApi;