/** * @file Async spawn with retry. * WHY THIS IS NOT AN OPTION ON `spawn`. That function returns a promise * carrying live `process` and `stdin` accessors, so a caller can write to * the running child or signal it mid-flight. A retry spawns a SECOND child, * which leaves those accessors pointing at a corpse. Rather than hand back a * surface that silently means something else on attempt two, retry lives on * its own function that resolves to the result alone. * Retry stays as unsafe here as it is anywhere: it suits a command that runs * twice with the same outcome. A `git push` killed on timeout may already * have reached the server. */ import type { SpawnRetryFailure } from './retry/policy.js'; import type { SpawnExtra, SpawnOptions, SpawnStdioResult } from './types.js'; /** * The retry policy reads `status`; the async result reports `code`. */ export declare function asRetryFailure(result: SpawnStdioResult): SpawnRetryFailure; /** * Spawn `cmd`, retrying per the options, and resolve with the final result. * * Unlike {@link spawn} the returned promise carries no `process` or `stdin`: * a retry replaces the child, so those would name the wrong one. * * `throws` behaves as it does on {@link spawn}. Internally every attempt runs * with `throws: false` so the loop can read a non-zero exit and decide, and a * caller who wanted a throw gets one from the final result. */ export declare function spawnWithRetry(cmd: string, args?: string[] | readonly string[] | undefined, options?: SpawnOptions | undefined, extra?: SpawnExtra | undefined): Promise;