import { type RuntimeCompiledArtifactsSource } from "#runtime/compiled-artifacts-source.js"; import type { RuntimeSandboxRegistry } from "#runtime/sandbox/registry.js"; import type { SandboxAccess, SandboxSessionEndReason, SandboxState } from "#sandbox/state.js"; import { type SandboxProviderHandle } from "#shared/sandbox-provider.js"; interface EnsureSandboxAccessInput { readonly compiledArtifactsSource: RuntimeCompiledArtifactsSource; readonly nodeId: string; /** `false` when the sandbox outlives this access: it may not delete it, even after a failed start. */ readonly ownsSandbox?: boolean; readonly registry: RuntimeSandboxRegistry; readonly sessionId: string; readonly state: SandboxState | null; } /** The access `ensureSandboxAccess` builds, with what the opener may do beyond the sandbox API. */ export interface EnsuredSandboxAccess extends SandboxAccess { /** Permanently releases provider resources when the owning session ends. */ end(reason: SandboxSessionEndReason): Promise; /** * Lets go of the handle this access opened, if any, without stopping or * deleting the sandbox, and returns it so the caller can free what it * holds in this process. For a sandbox that outlives the access, such as a * tool session's. Waits for an open still in flight, so a caller that * finished early never leaves that handle behind. */ detach(): Promise; } export declare function ensureSandboxAccess(input: EnsureSandboxAccessInput): Promise; export {};