Skip to content

RuntimeAwareBuilder

Defined in: packages/runtime/src/root/builder.ts:60

Immutable builder produced by the runtime’s Unix factory — composes an image, auto-binds a platform, and boots a RootContainer in one chain.

Consumed — obtain via the runtime-package Unix() factory and chain .use()/.env()/.tty() etc. until terminating with .build(), .start(), or .boot(). Not implemented by user code.

Mirrors core’s UnixBuilder for image composition (use, env, file, catalog, build) and layers runtime concerns on top: platform overrides (runtime), terminal wiring (tty), image-name resolution (imageResolver), and two terminal operations (start, boot) that skip the manual runtime.boot(image) step.

Every mutator returns a fresh builder — the original is never modified.

boot() auto-detects a TTY and allows piped stdin so shell scripts work unattended; start() auto-detects only when stdin is a real TTY. Pass .tty(...) or .runtime(...) explicitly for fully headless container use.

boot(): Promise<ExitCode>

Defined in: packages/runtime/src/root/builder.ts:78

Build the image, start the root container, spawn sh as PID 1, and block until it exits.

Promise<ExitCode>


build(): Promise<UnixImage>

Defined in: packages/runtime/src/root/builder.ts:76

Produce a frozen UnixImage without starting a container. Equivalent to core’s UnixBuilder.build().

Promise<UnixImage>


catalog(name, factory): RuntimeAwareBuilder

Defined in: packages/runtime/src/root/builder.ts:68

Register a named Extension factory for lazy resolution (e.g. WASM packages).

string

() => Extension

RuntimeAwareBuilder


env(key, value): RuntimeAwareBuilder

Defined in: packages/runtime/src/root/builder.ts:64

Set an environment variable on the image’s default env.

string

string

RuntimeAwareBuilder


file(path, content): RuntimeAwareBuilder

Defined in: packages/runtime/src/root/builder.ts:66

Seed a file at path with the given content in the image’s root fs.

string

string

RuntimeAwareBuilder


imageResolver(resolver): RuntimeAwareBuilder

Defined in: packages/runtime/src/root/builder.ts:74

Install an ImageResolver for container image-name resolution; chained before the built-in preset resolver.

ImageResolver

RuntimeAwareBuilder


runtime(caps): RuntimeAwareBuilder

Defined in: packages/runtime/src/root/builder.ts:70

Override the auto-detected PlatformCapabilities — use for headless / test runtimes.

PlatformCapabilities

RuntimeAwareBuilder


start(): Promise<RootContainer>

Defined in: packages/runtime/src/root/builder.ts:80

Build the image and return a started RootContainer — no shell spawned. Caller drives the container lifecycle.

Promise<RootContainer>


tty(config, getTermSize?): RuntimeAwareBuilder

Defined in: packages/runtime/src/root/builder.ts:72

Bind an explicit TtyConfig (and optional size probe) instead of letting .start()/.boot() auto-detect.

TtyConfig

() => TerminalSize

RuntimeAwareBuilder


use(ext): RuntimeAwareBuilder

Defined in: packages/runtime/src/root/builder.ts:62

Compose an Extension into the image. Returns a new builder.

Extension

RuntimeAwareBuilder