import { type ResolvedMicrosandboxOptions } from "#execution/sandbox/bindings/microsandbox-options.js"; import { type MicrosandboxSessionMetadata } from "#execution/sandbox/bindings/microsandbox-metadata.js"; import type { SandboxBackendTags } from "#public/definitions/sandbox-backend.js"; import type { SandboxNetworkPolicy } from "#shared/sandbox-network-policy.js"; import type { SandboxProcess, SandboxRemovePathOptions, SandboxSpawnOptions } from "#shared/sandbox-session.js"; import type { Sandbox as MicrosandboxSandbox } from "microsandbox"; export type MicrosandboxModule = typeof import("microsandbox"); export declare class MicrosandboxVm { #private; constructor(input: { readonly module: MicrosandboxModule; readonly options: ResolvedMicrosandboxOptions; readonly sessionKey: string; readonly tags?: SandboxBackendTags; }, sandbox: MicrosandboxSandbox, sandboxName: string, networkPolicy: SandboxNetworkPolicy | undefined, metadataPath?: string, optionsHash?: string, stateSnapshotName?: string); get id(): string; captureState(optionsHash: string): Promise; detach(): Promise; readFileBytes(path: string): Promise; removePath(options: SandboxRemovePathOptions): Promise; removePersisted(): Promise; setNetworkPolicy(policy: SandboxNetworkPolicy): Promise; spawn(options: SandboxSpawnOptions): Promise; stopAndSnapshot(snapshotName: string): Promise; writeFiles(files: ReadonlyArray<{ path: string; content: string | Uint8Array; }>): Promise; writeMetadata(path: string, optionsHash: string): Promise; private runInternalCommand; } export declare function createPreparedMicrosandbox(input: { readonly fromSnapshot?: string; readonly log?: (message: string) => void; readonly module: MicrosandboxModule; readonly name: string; readonly networkPolicy?: SandboxNetworkPolicy; readonly options: ResolvedMicrosandboxOptions; readonly sessionKey: string; readonly setupBaseRuntime: boolean; readonly tags?: SandboxBackendTags; }): Promise; export declare function connectMicrosandbox(input: { readonly metadata: MicrosandboxSessionMetadata; readonly metadataPath: string; readonly module: MicrosandboxModule; readonly options: ResolvedMicrosandboxOptions; readonly sessionKey: string; readonly tags?: SandboxBackendTags; }): Promise; /** * Loads the microsandbox npm package and ensures its VM runtime is * installed. During `eve dev`, both are installed automatically when * missing (unless `setup.autoInstall: false`): the package with the * project's package manager, the runtime via microsandbox's installer. * Production processes never install — they fail with actionable * errors instead. */ export declare function loadMicrosandboxModule(input: { readonly appRoot: string; readonly log?: (message: string) => void; readonly options: ResolvedMicrosandboxOptions; }): Promise; /** * Loads microsandbox only when its package and runtime are already * present — used by cleanup paths that must never trigger installs. */ export declare function loadMicrosandboxWithoutInstall(): Promise; export declare function stopAndSnapshotMicrosandboxSandbox(module: MicrosandboxModule, sandboxName: string, snapshotName: string): Promise; export declare function snapshotExists(module: MicrosandboxModule, snapshotName: string): Promise; export declare function sandboxExists(module: MicrosandboxModule, sandboxName: string): Promise; export declare function removeSnapshotIfExists(module: MicrosandboxModule, snapshotName: string): Promise; export declare function createProviderName(prefix: string, key: string, extra?: string): string; export declare function createStableHash(value: string): string; export declare function doesPathExist(path: string): Promise; export declare function isMicrosandboxNotFoundError(error: unknown): boolean;