import type { RuntimeProgressSink } from "./runtime-progress.js"; import { type WorkspaceRestoreOutcome } from "./workspace-restore-merge.js"; /** * The one staged-runtime capability the teardown factory needs: restore the * sandbox workspace back onto the host. */ export interface WorkspaceRestoreTeardownRuntime { restoreWorkspace(onProgress?: RuntimeProgressSink): Promise; } /** * Builds the shared ACP adapter teardown step. The Claude, Codex, and Gemini * adapters run the same five steps at teardown and differ only in two log * strings: the start message and the failure prefix. Give this factory the * staged runtime, the `onLog` sink, and those two strings; it returns the * teardown step. * * The returned step logs `startMessage` to `stdout`, restores the workspace, * and on success returns `{ ok: true }`. On a caught error, it classifies the * error into an allowlisted {@link WorkspaceRestoreOutcome} code, logs * `failurePrefix` plus the allowlisted diagnostic to `stderr`, and returns * `{ ok: false, code }`. */ export declare function createWorkspaceRestoreTeardown(input: { stagedRuntime: WorkspaceRestoreTeardownRuntime; onLog: (stream: "stdout" | "stderr", chunk: string) => Promise; startMessage: string; failurePrefix: string; }): () => Promise; //# sourceMappingURL=workspace-restore-teardown.d.ts.map