import type { E2BDesktopSandbox } from "./e2b-desktop-launch.js"; export interface DetachedTimers { /** Injected clock (ms) for tests. */ now?: () => number; /** Injected sleep for tests. */ sleep?: (ms: number) => Promise; } export interface DetachedStepOptions extends DetachedTimers { /** Short [a-z0-9-] label; names the script/status/log files under /tmp. */ name: string; /** The shell command to run (the lab author's own command — package.json-script trust). */ command: string; cwd?: string; /** Wall-clock budget for the step. */ timeoutMs: number; pollIntervalMs?: number; requestTimeoutMs?: number; } export interface DetachedStepResult { ok: boolean; exitCode?: number; timedOut: boolean; /** Capped, UNREDACTED log tail — redact before persisting. */ logTail: string; } /** Read the capped log tail for a step (raw — caller redacts). */ export declare function readDetachedLog(desktop: E2BDesktopSandbox, name: string, requestTimeoutMs?: number): Promise; /** * Run a BOUNDED step (install/build) detached, polling its atomic status file until it * exits or the budget runs out. On timeout the process group is killed and the log tail is * still captured so failures stay diagnosable. */ export declare function runDetachedStep(desktop: E2BDesktopSandbox, options: DetachedStepOptions): Promise; /** * Launch a LONG-LIVED process (the subject's server) fully detached and return immediately. * No status polling: liveness is the caller's readiness probe, and reclamation belongs to * the sandbox lifecycle (create with kill-on-timeout). */ export declare function startDetachedProcess(desktop: E2BDesktopSandbox, options: { name: string; command: string; cwd?: string; requestTimeoutMs?: number; }): Promise; /** * Poll a URL from INSIDE the sandbox until it answers 2xx/3xx or the budget runs out. * Returns true when the subject is ready. */ export declare function probeUrl(desktop: E2BDesktopSandbox, url: string, options: { timeoutMs: number; intervalMs?: number; requestTimeoutMs?: number; } & DetachedTimers): Promise;