import type { RuntimeProgressSink } from "./runtime-progress.js"; type RestorePhase = "workspace" | "asset"; declare const RESTORE_STEPS: Set<"asset_restore" | "directory_merge" | "git_export" | "git_import" | "git_integration" | "git_ref_cleanup" | "index_reset" | "workspace_extract" | "workspace_transfer">; export type WorkspaceRestoreStep = typeof RESTORE_STEPS extends Set ? T : never; declare const GIT_COMMANDS: Set<"commit_tree" | "log" | "merge_base" | "merge_tree" | "rev_parse" | "symbolic_ref" | "update_ref">; export type WorkspaceRestoreGitCommand = typeof GIT_COMMANDS extends Set ? T : never; declare const GIT_FAILURE_KINDS: Set<"invalid_object" | "merge_conflict" | "permission_denied" | "ref_conflict" | "unknown">; type GitFailureKind = typeof GIT_FAILURE_KINDS extends Set ? T : never; declare const TRANSFER_STEPS: Set<"archive_create" | "archive_download" | "archive_extract" | "archive_validate" | "file_download" | "file_finalize" | "sandbox_access" | "sandbox_guard">; type TransferStep = typeof TRANSFER_STEPS extends Set ? T : never; declare const TRANSFER_FAILURE_KINDS: Set<"command_failed" | "download_failed" | "download_missing" | "listing_byte_limit" | "listing_entry_limit" | "listing_line_limit" | "listing_stderr_limit" | "listing_timeout" | "unsafe_archive">; type TransferFailureKind = typeof TRANSFER_FAILURE_KINDS extends Set ? T : never; export interface WorkspaceRestoreDiagnostic { phase: RestorePhase; step?: WorkspaceRestoreStep; errorCode: string; httpStatus?: number; exitCode?: number; gitCommand?: WorkspaceRestoreGitCommand; gitFailureKind?: GitFailureKind; transferStep?: TransferStep; transferFailureKind?: TransferFailureKind; rpcCode?: number; } /** Keep each settlement's diagnostic receipt isolated across asynchronous work. */ export declare function withWorkspaceRestoreDiagnosticCapture(operation: () => Promise): Promise; /** Annotate the original thrown error in its restore scope; never change it. */ export declare function withWorkspaceRestoreGitCommand(command: WorkspaceRestoreGitCommand, operation: () => Promise): Promise; /** Retain bounded fields across an existing error wrapper, without a raw cause. */ export declare function preserveWorkspaceRestoreErrorDiagnostic(wrapper: T, source: unknown, transferEvidence?: unknown): T; /** Decode persisted adapter metadata; never copy arbitrary properties or text. */ export declare function sanitizeWorkspaceRestoreDiagnostic(value: unknown): WorkspaceRestoreDiagnostic | undefined; export declare function getWorkspaceRestoreDiagnostic(error: unknown): WorkspaceRestoreDiagnostic | undefined; /** Preserve the scheduler-selected task's snapshot when errors share identity. */ export declare function recordWorkspaceRestoreDiagnostic(error: unknown, diagnostic: WorkspaceRestoreDiagnostic | undefined): void; /** Record only the failing step. Successful cleanup must not replace evidence. */ export declare function withWorkspaceRestoreStep(step: WorkspaceRestoreStep, operation: () => Promise): Promise; /** Add evidence without changing the thrown error, restore policy, or task ordering. */ export declare function withWorkspaceRestoreDiagnostics(phase: RestorePhase, operation: () => Promise, onProgress?: RuntimeProgressSink, onDiagnostic?: (diagnostic: WorkspaceRestoreDiagnostic) => void): Promise; export {}; //# sourceMappingURL=workspace-restore-diagnostics.d.ts.map