import type { CredentialResolutionOptions, VercelCredentials } from './auth.js'; import { type VercelCleanupOptions, type VercelCleanupResult } from './cleanup.js'; import { type SandboxSessionRecord, type VercelSandboxClient, type VercelSandboxHandle } from './client.js'; import { type VercelBranchMetadataStore, type VercelMetadataIdentity } from './metadata.js'; import { type GitHubSourcePlan } from './source.js'; import type { ShellRunner } from '../../lib/shell.js'; export declare const DEFAULT_VERCEL_SANDBOX_TIMEOUT_MS: number; export declare class VercelLifecycleError extends Error { readonly code: string; constructor(code: string, message: string); } export declare class VercelResourceNotFoundError extends VercelLifecycleError { readonly resource: string; constructor(resource: string, name: string); } export declare class VercelIdentityConflictError extends VercelLifecycleError { constructor(message: string); } export declare class VercelScopeConflictError extends VercelLifecycleError { constructor(message: string); } export declare class VercelRouteNotFoundError extends VercelLifecycleError { constructor(name: string, port: number); } export declare class VercelCleanupError extends VercelLifecycleError { readonly result: VercelCleanupResult; constructor(result: VercelCleanupResult, message?: string); } export declare class VercelRecoveryCleanupError extends VercelCleanupError { readonly recoveryMetadataFailure?: string; constructor(result: VercelCleanupResult, message: string, recoveryMetadataFailure?: string); } export declare class VercelCreationCompensationError extends VercelCleanupError { readonly creationFailure: string; readonly recoveryMetadataFailure?: string; constructor(result: VercelCleanupResult, creationFailure: string, recoveryMetadataFailure?: string); } export interface VercelLifecycleOptions { repoRoot: string; /** * Resolve the Sandbox image reference. Defaults to the release pin when the * package carries one and the nightly channel otherwise; injected by tests so * they never reach the registry. */ resolveImage?: () => Promise; branch?: string; packageVersion?: string; ports?: number[]; env?: Record; runtimeEnvironment?: Record; credentials?: VercelCredentials; credentialOptions?: Omit; source?: GitHubSourcePlan; sourceResolver?: () => Promise; shellRunner?: ShellRunner; branchMetadataStore?: VercelBranchMetadataStore; /** List is repository-scoped and must not read an invented branch record. */ listOnly?: boolean; stateHome?: string; repoKey?: string; repository?: string; /** Authoritative live-resource identity used when branch metadata is unavailable. */ recovery?: VercelRecoveryInput; client?: VercelSandboxClient; timeoutMs?: number; vcpus?: number; onNotice?: (notice: string) => void | Promise; cleanup?: Pick; } export interface VercelRecoveryInput { identity: VercelMetadataIdentity; snapshotIds?: readonly string[]; } export interface VercelStopReport { name: string; sessions: SandboxSessionRecord[]; finalSession?: SandboxSessionRecord; snapshot?: { id: string; status: string; }; activeCpuUsageMs?: number; networkTransfer?: { ingress: number; egress: number; }; } export interface VercelLifecycle { up(): Promise; get(options?: { resume?: boolean; }): Promise; attach(): Promise; list(): Promise; status: string; image?: string; [key: string]: unknown; }>>; routes(): Promise; url(port: number): Promise; stop(): Promise; remove(): Promise; } export declare function createVercelLifecycle(options: VercelLifecycleOptions): VercelLifecycle; export declare function sandboxIdentifier(sandbox: VercelSandboxHandle): string;