import type { VercelCredentials } from './auth.js'; import type { VercelIdentityTags } from './metadata-schema.js'; import { type SandboxSessionRecord, type SandboxSessionStatus, type VercelSandboxDeleteByNameResult, type VercelStopResult } from './client.js'; export declare const TERMINAL_SESSION_STATES: Set; export declare const STOPPABLE_SESSION_STATES: Set; export interface VercelCleanupSandbox { readonly id?: string; readonly name: string; readonly status: SandboxSessionStatus; readonly persistent?: boolean; readonly tags?: Record; readonly currentSnapshotId?: string; } export interface VercelCleanupSnapshot { readonly snapshotId: string; readonly status: 'failed' | 'created' | 'deleted'; delete(options?: { signal?: AbortSignal; }): Promise; } export interface VercelCleanupAdapter { get(request: { credentials: VercelCredentials; name: string; resume: false; signal?: AbortSignal; }): Promise; listSessions(sandbox: VercelCleanupSandbox, options?: { signal?: AbortSignal; }): Promise; stop(sandbox: VercelCleanupSandbox, options?: { signal?: AbortSignal; }): Promise; listSnapshots(request: { credentials: VercelCredentials; name: string; signal?: AbortSignal; }): Promise; getSnapshot(request: { credentials: VercelCredentials; snapshotId: string; signal?: AbortSignal; }): Promise; delete(sandbox: VercelCleanupSandbox, options?: { signal?: AbortSignal; }): Promise; deleteByName(request: { credentials: VercelCredentials; name: string; signal?: AbortSignal; }): Promise; } export interface VercelCleanupResult { verified: boolean; sandboxDeleted: boolean; snapshotsCleaned: boolean; sandboxMissing: boolean; snapshotIds: string[]; residualSandboxIds: string[]; residualSnapshotIds: string[]; finalSessions: SandboxSessionRecord[]; finalStop?: VercelStopResult; errors: string[]; } export interface VercelCleanupOptions { name: string; credentials: VercelCredentials; expectedTags: VercelIdentityTags; knownSnapshotIds?: readonly string[]; adapter: VercelCleanupAdapter; timeoutMs?: number; maxAttempts?: number; backoffMs?: number; signal?: AbortSignal; sleep?: (milliseconds: number, signal?: AbortSignal) => Promise; } export declare function cleanupVercelSandbox(options: VercelCleanupOptions): Promise;