import { Runtime } from './base.ts'; import type { MountResolver } from './resolver.ts'; import type { BridgeDispatchFn, RunArgs, RunResult, RuntimeLanguage } from './types.ts'; /** * A runtime that interprets one language's code inside a command. * * The engine inside a single command (python3, node): the workspace * splits the line, and a captured stage's code lands here as run(). * Never the whole line; that is LineExecutor's door. * * The language it interprets is declared once, for both doors: run() * for a script CLI (runtimeForLanguage) and eval() for a config-borne * policy script (evaluatorOf). One attribute, because two would let a * runtime claim python at one door and js at the other, and the * disagreement would only surface as an unexplained 127 or a policy * evaluated on the wrong engine. Concrete runtimes inherit it from * their language tier (PythonRuntime, JsRuntime) rather than declaring * it per class. * * How an implementation sees workspace files is its own concern: a * sandboxed interpreter bridges file I/O through the workspace * dispatch attached here, while a host subprocess only sees the host * filesystem and keeps the default no-op attach. * * The doors are the data plane (dispatch) and the name plane * (resolver), and the list is complete on purpose: there is no * session door. A guest reads the frozen `RunArgs.env` snapshot; an * env write lands on the guest's own copy and dies with the run, * never reaching the live session, so guest code can neither trip nor * bypass a `preSession` rule. That blindness is a security boundary, * not a gap — a runtime that ever needs session state must take a * gated `SessionView`, never a bare session reference. */ export declare abstract class LanguageRuntime extends Runtime { abstract readonly language: RuntimeLanguage; /** * Late-wire workspace I/O into a user-constructed instance. The * workspace attaches its dispatch at construction; runtimes that * never touch workspace files keep the default no-op. */ attach(_dispatch: BridgeDispatchFn, _resolver: MountResolver): void; /** Execute one program and return its captured outcome. */ abstract run(args: RunArgs): Promise; } //# sourceMappingURL=language.d.ts.map