import type { Sandbox, SandboxCreateConfig, SandboxProvider } from '../../types/sandbox/index.js'; /** A sandbox release gets thirty seconds before the turn stops waiting for it. */ export declare const DEFAULT_SANDBOX_TEARDOWN_TIMEOUT_MS = 30000; export declare function resolveSandboxTeardownTimeoutMs(value: number | undefined): number; export type SandboxTeardownResult = { readonly kind: 'destroyed'; } | { readonly kind: 'failed'; readonly error: unknown; } | { readonly kind: 'timed_out'; readonly error: Error; }; export type SandboxAcquisitionResult = { readonly kind: 'created'; readonly sandbox: Sandbox; } | { readonly kind: 'cancelled'; readonly createPending: boolean; } | { readonly kind: 'timed_out'; readonly createPending: boolean; readonly error: Error; }; /** * Release a sandbox under a fresh owner. * * The turn signal is deliberately not an input: cleanup normally begins because * that signal is already aborted. A private signal gives the implementation a * chance to stop its transport at the teardown deadline, while the independent * race keeps a third-party implementation that ignores it from pinning the turn. */ export declare function teardownSandbox(sandbox: Sandbox, timeoutMs: number): Promise; /** * Acquire a sandbox without allowing foreign setup to outlive run authority. * * Cancellation or the turn timeout settles this function even when a provider * ignores the signal. * A handle that arrives later is never published and is released exactly once. * This proves host/run liveness and cleanup of every handle the provider * returns. It cannot prove that a remote service did not commit an allocation * behind a response that never disclosed its identity; that requires a * provider-owned reconciliation key or fleet reaper. */ export declare function acquireSandbox(options: { readonly provider: SandboxProvider; readonly config: Omit; readonly signal: AbortSignal; /** Remaining wall-clock owned by the turn, not a second sandbox budget. */ readonly timeoutMs: number; readonly teardownTimeoutMs: number; readonly onLateTeardown?: (result: SandboxTeardownResult) => void; }): Promise; //# sourceMappingURL=sandbox-lifecycle.d.ts.map