Confinement: settings, the active confiner, and which backends are mounted.
API
@Interface("@prismshadow/penguin-server#Sandbox")
export abstract class Sandbox {
abstract configure(settings: SandboxSettings): void;
abstract currentSettings(): SandboxSettings;
abstract parkedSettings(): SandboxSettings | undefined;
abstract backends(): Array<{
name: string;
dimensions: readonly SandboxDimension[];
mechanism?: string;
limits?: readonly SandboxLimit[];
}>;
abstract failures(): Array<{ name: string; reason: string }>;
abstract declined(): string[];
abstract origins(): Array<{ name: string; package?: string }>;
abstract retryFailed(): Promise<void>;
abstract confiner(): SpawnConfiner;
abstract confinerFor(policyOf: () => SandboxSettings): SpawnConfiner;
abstract whenReady(): Promise<void>;
}Contract Topology
Static AST wiring across @Module / @Provide / @UseMembers (11)
configure
configure(settings: SandboxSettings): voidReplaces the active settings (the config surface's write path).
SandboxSettingsvoidcurrentSettings
currentSettings(): SandboxSettingsThe active settings as a plain copy (the config surface's read side).
SandboxSettingsparkedSettings
parkedSettings(): SandboxSettings | undefinedThe active settings as parked state, or undefined for the pristine default. The
omission is load-bearing compatibility: a default deployment keeps parking
{ motd }, which any platform bundle's context schema accepts. Once confinement
is configured the field enters the document, and from then on pushing a
sandbox-ignorant bundle is BLOCKED by schema validation — the right failure:
refusing the swap beats a swap that silently un-confines the deployment.
SandboxSettings | undefinedbackends
backends(): Array<{ name: string; dimensions: readonly SandboxDimension[]; mechanism?: string; limits?: readonly SandboxLimit[]; }>The mounted backends and what each implements, in routing preference: the one a policy goes to first (diagnostics / the config surface).
Array<{ name: string; dimensions: readonly SandboxDimension[]; mechanism?: string; limits?: readonly SandboxLimit[]; }>failures
failures(): Array<{ name: string; reason: string }>The backends that failed to load, each with why (diagnostics / the config surface).
Array<{ name: string; reason: string }>declined
declined(): string[]The backends that declined because this host is not theirs (the config surface).
string[]origins
origins(): Array<{ name: string; package?: string }>Every registered backend in routing order, with the package of the plugin that registered it when one did: what the settings page links each backend's line to (its plugin's page).
Array<{ name: string; package?: string }>retryFailed
retryFailed(): Promise<void>Loads again every backend whose load failed and that registered a loader (a bare promise cannot be re-run). Called after the sandbox's settings are saved: a backend whose check failed on its own setting mounts once that setting is fixed. Resolves when those settle.
Promise<void>confiner
confiner(): SpawnConfinerThe closure handed to the runtime: rewrites each spawn's argv under the active settings. Pure and self-contained, so the previous platform's confiner keeps serving during a hot-swap freeze window.
SpawnConfinerconfinerFor
confinerFor(policyOf: () => SandboxSettings): SpawnConfinerThe same closure under a policy the caller keeps — a Session's own snapshot. The backends are still this service's, so a backend change reaches every Session.
SpawnConfinerwhenReady
whenReady(): Promise<void>Resolves when every registered backend has loaded (or failed to).
Promise<void>