import type { Writable } from 'node:stream'; import { type VercelSetupStatus } from './setup.js'; import type { VercelBranchMetadataStore } from './metadata.js'; import type { ShellRunner } from '../../lib/shell.js'; import type { VercelSandboxClient, VercelSandboxHandle } from './client.js'; export declare const VERCEL_SANDBOX_HOME = "/vercel"; export declare const VERCEL_RUNTIME_DIRECTORY = "/vercel/.devbox/runtime"; export declare const VERCEL_RUNTIME_ENV_STATE_PATH = "/vercel/.devbox/runtime/environment.json"; export declare const VERCEL_RUNTIME_GITHUB_TOKEN_PATH = "/vercel/.devbox/runtime/github-token"; export declare const VERCEL_GH_CONFIG_DIRECTORY = "/vercel/.config/gh"; export declare const VERCEL_RUNTIME_PI_PATH = "/vercel/.pi"; export declare const VERCEL_RUNTIME_PREPARATION_PATH = "/vercel/.devbox/runtime/preparation.json"; export declare const RUNTIME_PREPARATION_TIMEOUT_MS: number; /** Positive evidence that this Sandbox instance completed full preparation. */ export interface RuntimePreparationMarker { sandboxId: string; revision: string; githubTokenHash: string; environmentHash: string; } export interface PreparedSandboxRuntime { setupStatus: VercelSetupStatus | null; /** True when evidence proved the box already prepared and work was skipped. */ reused: boolean; } export declare class VercelRuntimeSyncError extends Error { readonly code = "runtime_sync_failed"; constructor(message: string); } export interface PrepareSandboxRuntimeOptions { repoRoot: string; repository: string; env: Record; envPath?: string; runtimeEnvironment?: Record; shellRunner: ShellRunner; sandbox: VercelSandboxHandle; client: VercelSandboxClient; stderr: Writable; hostHome?: string; piRoot?: string; signal?: AbortSignal; displayCredentialsStore?: VercelBranchMetadataStore; secrets?: string[]; /** `attach` attempts an evidence-backed skip before full preparation. */ mode?: 'boot' | 'attach'; } /** * A skip is only correct with positive evidence tied to this Sandbox instance * at an unchanged HEAD. Any absent, unreadable, or stale field means full * preparation, which is also the documented route by which a rotated host * `.env` or GitHub token reaches the box. */ export declare function evaluatePreparation(marker: unknown, actual: RuntimePreparationMarker): boolean; export declare function prepareSandboxRuntime(options: PrepareSandboxRuntimeOptions): Promise;