Optional ReadonlydnsDNS resolution; absent on runtimes with no resolver API (edge platforms).
Cloudflare Workers omits this key entirely — its network access is
fetch, which resolves names internally and exposes no lookup surface.
ReadonlyenvEnvironment variables. Always read env through this, never process.env.
Treat it as a snapshot taken when the runtime services were created: the
Deno adapter materializes Deno.env.toObject() and the Workers adapter
receives a per-invocation bindings object, so neither reflects a variable
set after startup. (The Node and Bun adapters pass process.env through,
which does.) Nothing in the framework mutates the environment at runtime.
Optional ReadonlyfsFile system access; absent on runtimes without one (edge platforms).
ReadonlysubtleWeb Crypto SubtleCrypto for cryptographic operations.
Optional ReadonlyworkersWorker-thread spawning; absent on runtimes without threads (edge platforms).
Terminates the process.
Optionalcode: number
Exit code (defaults to 0)
Never returns
Returns the host name, when the runtime exposes one.
The host name
Returns a high-resolution monotonic timestamp in milliseconds, suitable for measuring durations.
Monotonic milliseconds
Returns the current wall-clock time in milliseconds since the epoch.
Milliseconds since the Unix epoch
OptionalonRegisters a handler for a process-termination signal, so an application
can run app.stop() before the process dies.
Without this, an application catching SIGTERM has to reach for
Deno.addSignalListener or process.on directly — a runtime API in
application code, which is what AI_GUIDELINES §4.2 exists to prevent, and
which forces a different entry point per target.
Absent on two platforms, for two different reasons. Cloudflare Workers
omits the key entirely: an isolate is evicted, never signalled, so there is
nothing to register for. The Deno adapter omits it on Windows, where
Deno.addSignalListener('SIGTERM') throws — so a caller must treat this as
optional (runtime.onSignal?.(…)) rather than assuming a non-edge runtime
always provides it.
Handlers are additive: registering twice for one signal runs both, in registration order. The framework never removes them — a process that has received a termination signal is ending.
The signal to listen for
Invoked when the signal arrives; must not throw
Generates cryptographically secure random bytes.
Number of bytes
The random bytes
OptionalreportSchedules a repeating callback.
Callback to invoke
Interval in milliseconds
Handle for clearInterval
Schedules a one-shot callback.
Callback to invoke
Delay in milliseconds
Handle for clearTimeout
Generates a UUID v4.
A random UUID
Returns the runtime version string.
The version (e.g. "2.7.5")
Runtime services — every runtime-specific operation the framework needs, abstracted behind one interface. Registered under
CAPABILITIES.RUNTIMEby the RuntimePlugin, which is mandatory in every application.Example
Since
0.1.0