import type { RuntimeSandboxRegistry } from "#runtime/sandbox/registry.js"; import type { SandboxProviderHandle } from "#shared/sandbox-provider.js"; /** What a binding that keeps tool-session sandboxes tells the calls that use them. */ export interface ToolSessionSandboxSupport { /** * Frees what a call's handle holds in this process once the call ends, * leaving the session's sandbox for later and overlapping calls. Absent * when a handle holds nothing of its own, such as a client to a remote * sandbox. */ releaseHandle?(handle: SandboxProviderHandle): Promise; } /** Marks a binding whose `start` reopens a session's sandbox by session id. */ export declare function withToolSessionSandboxes(implementation: Implementation, support?: ToolSessionSandboxSupport): Implementation; /** Raised when a keyed tool session opens a sandbox on a provider that cannot keep it. */ export declare class ToolSessionSandboxUnsupportedError extends Error { constructor(providerName: string); } /** Throws unless the registry's sandbox provider can keep tool-session sandboxes. */ export declare function assertToolSessionSandboxSupport(registry: RuntimeSandboxRegistry): void; /** Frees what a keyed call's handle holds in this process; the sandbox itself stays. */ export declare function releaseToolSessionHandle(registry: RuntimeSandboxRegistry, handle: SandboxProviderHandle): Promise;