/** * Immutable image profiles. * * A run's image is the union of (a) a pinned runtime image — bun, node, or * python3 at an exact version, carrying the supervisor and NO skills corpus; * the bundle is fetched by digest at run time — and (b) an optional prebuilt * dependency layer built at publish time when the skill manifest's * `system_deps` are allowlisted. Nothing is installed at execution time. * * Version pins live in code; image digests and the system_deps allowlist are * deployment configuration, because a digest names a concrete artifact in a * concrete registry. An un-pinned runtime or an unknown system_deps entry * fails closed at admission — a launch never carries a guess. */ import type { FrozenAdmission, RuntimeName } from "./types.js"; export type { RuntimeName }; export interface PinnedRuntime { runtime: RuntimeName; /** Exact pinned runtime version. */ version: string; /** Image digest; null until deployment config supplies one. */ imageDigest: string | null; } export interface DependencyLayerRule { /** Canonical system_deps key: sorted, unique, comma-joined. */ canonicalKey: string; /** Prebuilt layer tag produced at publish time. */ layerTag: string; } export interface ImageProfileRegistryConfig { runtimes: PinnedRuntime[]; /** system_deps allowlist: canonical key -> prebuilt layer tag. */ dependencyLayers: Record; } export interface ResolvedImageProfile { runtime: PinnedRuntime; runtimeImageDigest: string; dependencyLayerTag: string | null; } export type ImageProfileResolutionFailure = { reason: "UNKNOWN_RUNTIME"; runtime: string; } | { reason: "UNPINNED_RUNTIME"; runtime: RuntimeName; } | { reason: "UNALLOWED_SYSTEM_DEPS"; systemDeps: string[]; }; export declare class ImageProfileResolutionError extends Error { readonly failure: ImageProfileResolutionFailure; constructor(failure: ImageProfileResolutionFailure); } /** * Pinned runtime versions. These match what the package itself is built with * (bun 1.3.14) plus the node and python lines the corpus's runtime contracts * name. Digests are deployment configuration and start null: admission refuses * an unpinned launch. */ export declare const DEFAULT_IMAGE_PROFILES: ImageProfileRegistryConfig; export interface ImageProfileRegistry { resolve(runtime: RuntimeName, systemDeps: string[]): ResolvedImageProfile; } export declare function createImageProfileRegistry(config?: ImageProfileRegistryConfig): ImageProfileRegistry; /** Canonical system_deps key: sorted, unique, comma-joined. */ export declare function canonicalSystemDepsKey(systemDeps: string[]): string; /** Build an allowlist entry from a manifest's declared system_deps. */ export declare function dependencyLayerRule(layerTag: string, systemDeps: string[]): DependencyLayerRule; /** Resolve + freeze the image half of an admission. */ export declare function resolveImageProfile(registry: ImageProfileRegistry, input: { runtime: RuntimeName; systemDeps: string[]; }): Pick;