/** * Per-kind context bags threaded into a target's `create()` call. * * Only `DeployContext` is pinned by the contract. `DriverContext` and * `ConnectorContext` are intentionally minimal and extensible — adding optional * fields stays backwards-compatible. */ import type { Logger } from "@skaile/workspaces/types"; /** Context passed to a `DriverTarget.create()`. */ export interface DriverContext { readonly log?: Logger; readonly signal?: AbortSignal; } /** Context passed to a `ConnectorTarget.create()`. */ export interface ConnectorContext { readonly log?: Logger; } /** A host→container bind a deploy target should apply when standing the workspace up. */ export interface DeployMount { readonly host: string; readonly container: string; /** Mount read-only. Defaults to `false`. */ readonly ro?: boolean; } /** Generic per-deployment resource caps a target may enforce where supported. */ export interface DeployResources { /** CPU quota in nanoCPUs (e.g. `1_500_000_000` = 1.5 cores). */ readonly cpuNanos?: number; readonly memoryBytes?: number; readonly pidsLimit?: number; } /** * Context passed to a `DeployTarget.create()` / `restore()`. * * `mounts` / `labels` / `resources` are the *generic* per-session injection * channel a host (e.g. skaile-platform) uses to drive any target uniformly. * Built-ins honour what applies (container targets map them to `-v` / `--label` * / cgroup flags; the process targets ignore mounts). Target-specific policy * (apparmor, FUSE, fleet binds, …) stays in that target's own `configSchema` — * it never leaks into this shared context. */ export interface DeployContext { readonly workspaceId: string; /** Caller-issued, opaque WS auth token. */ readonly wsAuth?: string; /** Image reference resolved by the target's `buildStrategy`. */ readonly imageRef?: string; readonly env: Readonly>; /** Generic host→container binds; container targets apply them, process targets ignore them. */ readonly mounts?: ReadonlyArray; /** Generic labels stamped onto the deployment for reconciliation/ownership. */ readonly labels?: Readonly>; /** Generic resource caps applied where the runtime supports them. */ readonly resources?: DeployResources; readonly log: Logger; readonly signal: AbortSignal; } //# sourceMappingURL=context.d.ts.map