import { type ChildProcess } from "node:child_process"; export interface SpawnOutcome { stdout: string; stderr: string; exitCode: number | null; /** The run exceeded its wall-clock timeout. */ timedOut: boolean; /** The caller's AbortSignal fired (distinct from a timeout). */ aborted: boolean; } /** One-line reason a spawn did not succeed, honest about cancel vs timeout. */ export declare function spawnOutcomeFailureReason(outcome: SpawnOutcome): string; export declare function killProcessTree(child: ChildProcess, fallbackSignal?: NodeJS.Signals): void; export declare function safeSpawnAsync(command: string, args: string[], options: { cwd: string; timeoutMs: number; signal?: AbortSignal; }): Promise; /** * Return the first candidate that actually runs (probe: --version). Node's * spawn does not reliably resolve bare names on Windows (and Git Bash * environments put msys curl first anyway), so callers pass absolute * System32 paths as the preferred candidates. */ export declare function firstSpawnable(candidates: string[], cwd: string, timeoutMs?: number): Promise; export declare function resolveRunnerCommand(toolId: string, command: string, cwd: string, pathValue?: string): string | undefined; export declare function resetRunnerAvailabilityCache(): void; export declare function invalidateRunnerAvailability(toolId: string): void; export interface InstallCandidate { label: string; command: string; args: string[]; /** Per-candidate post-install probe; overrides the global verify spec. */ verify?: InstallVerifySpec; } /** * Shared in-flight/failure key for one install attempt, derived from the * actual install command rather than the caller: the same install requested * through different lanes (an LSP server recipe and a CLI runner recipe, * different workspace roots) shares one attempt instead of racing. All * supported channels install globally (npm -g, winget, uv tool, managed * dirs), so the workspace root is not part of the identity. */ export declare function installKey(candidates: InstallCandidate[]): string; /** SHA-256 of a file, streamed: archives can be hundreds of MB. */ export declare function sha256OfFile(filePath: string): Promise; export interface InstallOutcome { installed: boolean; detail: string; } /** Post-install probe: the installed tool itself must run `verify.args`. */ export interface InstallVerifySpec { command: string; args: string[]; } export declare function shareInstall(key: string, factory: () => Promise): Promise; export declare function tryInstallCandidates(candidates: InstallCandidate[], cwd: string, signal?: AbortSignal, verify?: InstallVerifySpec): Promise; //# sourceMappingURL=helpers.d.ts.map