/** * The small local-environment surface the box-side commands touch, injected so * they are testable without an actual EC2 host. * * Node-only. `self-deploy` needs the base set; `replica-sync` extends it with two * filesystem probes for the repo clone, kept as an extension so the self-deploy * surface stays minimal. */ import { spawnSync } from "node:child_process"; /** The local surface used by `outposts self-deploy`. */ export interface SelfDeployDependencies { spawnSync: (command: string, args: string[], options?: Parameters[2]) => ReturnType; readTextFile: (file: string) => string; loadCachedTokens: () => { refreshToken?: string; idToken?: string; } | undefined; getUid: () => number | undefined; isStdinTty: () => boolean; confirm: () => Promise; defaultHqRoot: () => string; invokingUser: () => string; } /** * The extra local surface `replica-sync` needs on top of the self-deploy set: * two filesystem probes for the repos clone. */ export interface ReplicaSyncDependencies extends SelfDeployDependencies { pathExists: (p: string) => boolean; mkdirp: (p: string) => void; } export declare const defaultSelfDeployDependencies: SelfDeployDependencies; export declare const defaultReplicaSyncDependencies: ReplicaSyncDependencies; /** * Run a child and throw a plain description on any failure. * * Child output is deliberately excluded from the thrown message: even though * these callers never pass credentials in argv, several of them stream secrets * through a child's stdin or environment, so the error path stays secret-safe by * construction rather than by review. */ export declare function runChecked(deps: SelfDeployDependencies, command: string, args: string[], description: string, options?: Parameters[2]): void; /** `runChecked` under `sudo` unless already root. */ export declare function runPrivileged(deps: SelfDeployDependencies, command: string, args: string[], description: string, options?: Parameters[2]): void; /** True when `command args` exits 0. Never throws. */ export declare function commandSucceeded(deps: SelfDeployDependencies, command: string, args: string[]): boolean; /** Trimmed stdout of `command args`, or undefined when it failed. Never throws. */ export declare function commandOutput(deps: SelfDeployDependencies, command: string, args: string[]): string | undefined; //# sourceMappingURL=host-deps.d.ts.map