import { type RuntimeConfig } from './config.ts'; import { type RouteScript } from './routing/types.ts'; import type { RuntimeOptions, RuntimeReach } from './types.ts'; /** * An engine the workspace can route commands or whole lines to. * * A runtime is to its commands what the regex engine is to grep: the * machinery inside a handler, invisible to the dispatcher. Each runtime * declares the command names it captures; a command binds to the first * runtime in the workspace's ordered list that captures it. * Implementations own their engine lifecycle (lazy boot, reuse across * runs, teardown in close). * * The base holds only what every tier shares: the registry name, the * captured command names, the coerced config, and the per-line * admission script. What a runtime can DO is declared by its tier and * mixins, detected by type and never by probing: LanguageRuntime * interprets one command's code (run), LineExecutor takes whole lines * (runLine), Evaluator evaluates expressions (eval). * * Every runtime is constructed the same way (captures, config, * script); each subclass hands the base its class-default captures and * its config key list, so a config field the runtime does not have * fails loud (config_cls in Python). */ export declare abstract class Runtime { abstract readonly name: string; readonly captures: readonly string[]; /** * Which doors this runtime's code has to the outside world (see * RuntimeReach): 'vfs' when the workspace dispatch is its only one, * as the bridged engines (monty, pyodide, quickjs) and the vfs * routing marker declare, 'process' or 'remote' when the code can * act around that gate. The default is 'process', the no-promise * claim, so a custom runtime must declare a narrower reach * explicitly rather than inherit it. Embedders read the aggregate: * only a world in which every runtime reaches 'vfs' makes "agent * code cannot bypass mount modes and policy" a true statement, * which is what the dsh adapter's sandbox claim is built from; one * wider runtime voids it. */ readonly reach: RuntimeReach; /** The runtime's coerced implementation knobs. */ config: RuntimeConfig; script?: RouteScript; constructor(options?: RuntimeOptions, defaultCaptures?: readonly string[], configKeys?: readonly string[]); /** Release engine resources. Default: nothing held. */ close(): Promise; } /** A workspace runtimes-list entry: an instance or a name shorthand. */ export type RuntimeEntry = Runtime | string; /** The code API takes functions; script source belongs to config. */ export declare function scriptStringError(kind?: string): Error; //# sourceMappingURL=base.d.ts.map