export interface RescueOptions { /** HQ root to operate on. Passed as `--hq-root`. Defaults to the script's * own resolution (cwd-based) when omitted. */ hqRoot?: string; /** Upstream repo, e.g. `indigoai-us/hq-core`. Script default: * `indigoai-us/hq-core-staging`. */ source?: string; /** Git ref (tag or branch). Script default: `main`. */ ref?: string; /** 40-char lowercase hex SHA pinning the three-way history floor. When * omitted the script reads the on-disk sync stamp from core/core.yaml. */ floorSha?: string; /** Narrow the wipe set to an explicit list of top-level paths (`--paths`, * comma-joined). */ paths?: string[]; /** Extra top-level entries to always preserve (`--preserve`, repeatable). */ preserve?: string[]; /** Extra relative subpaths to carve out + restore (`--preserve-subpath`, * repeatable). */ preserveSubpaths?: string[]; /** Plan only — classify + report, change nothing on disk (`--dry-run`). */ dryRun?: boolean; /** Skip the interactive confirmation prompt (`--yes`). Required for any * non-interactive caller. */ assumeYes?: boolean; /** Skip the pre-op safety snapshot under ~/.hq/backups (`--no-backup`). */ noBackup?: boolean; /** Override the backup root (`--backup-dir`). */ backupDir?: string; /** Inspect interrupted-update snapshots and delete only positively superseded ones. */ recoverSnapshots?: boolean; /** Verify that the live tree matches this restored snapshot before one retry. */ verifyRestoredSnapshot?: string; /** Shallow-clone the source and skip the history-floor compare * (`--no-history-check`). */ noHistoryCheck?: boolean; /** Cloud-update mode (`--cloud-update`). */ cloudUpdate?: boolean; /** GitHub token forwarded to the script as `GH_TOKEN` (avoids the * anonymous-clone rate limit; required for private sources). */ ghToken?: string; /** * Bounded wait (seconds) for the per-root operation lock when a sync/reindex * is already running. `0` → refuse immediately; omitted → inherit * `HQ_OP_LOCK_TIMEOUT` / infinite wait. Also accepted as `--lock-timeout * ` inside {@link extraArgs} (the machine `hq-rescue` entrypoint * forwards raw argv) — it is consumed here and never passed to the rescue * script, which doesn't understand it. */ lockTimeoutSec?: number; /** Escape hatch — additional raw args appended verbatim. */ extraArgs?: string[]; } /** * Pull `--lock-timeout ` out of `extraArgs` (the raw argv the machine * `hq-rescue` entrypoint forwards) so it controls the operation-lock wait * instead of leaking to the rescue script. Returns the resolved timeout * (explicit `opts.lockTimeoutSec` wins) and a copy of extraArgs with the flag * removed. */ export declare function extractLockTimeout(opts: RescueOptions): { lockTimeoutSec: number | undefined; cleanedExtraArgs: string[] | undefined; }; export interface RescueResult { /** Exit status of the underlying script (0 = success). */ status: number; } /** * Build the argv passed to bash (after the script path itself). Pure + * exported so callers and tests can assert the flag mapping without spawning. */ export declare function buildRescueArgs(opts?: RescueOptions): string[]; /** * Run the rescue against an HQ root. Synchronous — the work is long-running * (clone + scan + overlay) and callers want the exit status + live output. * stdout/stderr are written directly so the user sees the scan log and the * confirmation prompt (unless `assumeYes` is set). */ export declare function rescue(opts?: RescueOptions): RescueResult; //# sourceMappingURL=rescue.d.ts.map