import { type RunProcessHandle, type RunSpawner } from "./daemon.js"; import { detectContainerRuntime } from "./container.js"; import type { RunnerIdentity } from "./identity.js"; export type IsolationMode = "container" | "host"; export interface IsolationConfig { /** `container` (default) = throwaway container per run; `host` = raw process, full machine access. */ mode: IsolationMode; /** Container image ref (container mode). Defaults to the version-pinned ghcr.io/boardwalk-labs image. */ image?: string; /** Container network mode (container mode). Defaults to `host` — preserves LAN/VPN/localhost reach. */ network?: string; /** Extra host bind mounts to expose to the run (container mode). */ mounts?: readonly string[]; } /** This package's version (the runner image tag is pinned to it). Read from package.json so a * release bump is one file. */ export declare function packageVersion(): string; /** Default runner image ref — the version-pinned public image (base + this runtime). */ export declare function defaultImage(): string; /** Raw-process spawner (the `--host` escape hatch): one Node process per run, full machine access. * Env = the platform contract + the claim's resolved vars over a minimal base (PATH + proxy knobs; * HOME = the run's workspace). */ export declare function processSpawn(opts: { entry: string; env: Record; cwd: string; }): RunProcessHandle; /** Error thrown when container isolation is requested but no runtime is available — the caller * surfaces the message and exits (never silently drop to the unisolated path). */ export declare class NoContainerRuntimeError extends Error { constructor(); } /** Pick the run spawner from the isolation config. Container is default; `host` is the escape hatch; * container-with-no-runtime throws {@link NoContainerRuntimeError}. */ export declare function resolveSpawner(iso: IsolationConfig, log: (line: string) => void, detect?: typeof detectContainerRuntime): Promise; export interface StartRunnerOptions { baseUrl: string; identity: RunnerIdentity; isolation: IsolationConfig; workDir: string; once?: boolean; /** Progress line sink (stdout by default). */ log?: (line: string) => void; /** Wire SIGINT/SIGTERM → drain (Ctrl-C finishes the current run; a second forces quit). Default on. */ handleSignals?: boolean; } /** * Run the daemon to completion: resolve the spawner (isolation), poll → claim → execute → heartbeat, * and drain cleanly on Ctrl-C. Both entry points call this after obtaining an identity, so there is * exactly one implementation of the run loop + isolation decision. */ export declare function startRunner(opts: StartRunnerOptions): Promise;