import { type LoadedGraph, type PlatformTarget } from "@telorun/analyzer"; import { type ModuleArtifact, type SiblingLibraryMap } from "@telorun/kernel"; /** * Pre-materialize every module layer a `target` platform could need. * * This is `telo install`'s make-this-offline pass. `telo run` materializes layers * lazily — a controller layer when its candidate wins resolution, an asset layer * on first module-relative access — so warming here is an optimization, never a * correctness requirement. That is the point of the change it replaces: * previously a cold `telo run` failed outright because payloads landed on disk * only after the load that needed them. * * `target` defaults to the host but is explicit so a baked image * (`TELO_CACHE_DIR`) can be built from a machine of a different architecture — * without it, cross-building a `linux/arm64` image on a darwin laptop would cache * the wrong binaries. * * Best-effort per module for transient fetch failures (reported and skipped — * the manifest is cached either way, and `run` will fetch what it needs). An * integrity failure, a malformed layer index, and a tar entry escaping the module * directory are all hard: a tampered or corrupt artifact must never be used, and * a bad index is an authoring error the publisher has to fix. */ export interface WarmedLayers { /** Layers actually materialized for the target platform. */ materialized: number; /** * One artifact handle per module that ships a payload, keyed by the module's * canonical source — the same key a `Telo.Definition`'s `metadata.source` * carries (mirroring the kernel's `moduleArtifacts` map), so the controller * pre-install pass can hand each job its module's artifact. A module whose * warm failed transiently is still present: the handle is valid and a later * materialization may succeed where this one did not. */ artifacts: Map; /** * The module-owned libraries each module's controller bundles import by bare * specifier, keyed by the declaring module's canonical source — the same join * `kernel.load()` performs, and for the same reason: a bundle externalizes * `@telorun/cache`, so a controller resolved without it fails to import on a * module `telo run` loads fine. Warming is the only pass that holds all three * inputs (import edges, owner manifests, artifacts) outside the kernel. */ libraries: Map; } export declare function warmModuleLayers(graph: LoadedGraph, entryDir: string, registryUrl: string, manifestsDir: string, target: PlatformTarget, onWarn: (message: string) => void): Promise; /** * Parse a `--platform` value into a target. Accepts the familiar * `os/arch[/libc]` shorthand (`linux/amd64`, `linux/arm64/musl`) in the same * OCI/GOOS vocabulary the published selectors use. Omitted entirely, the host is * the target. */ export declare function parsePlatformTarget(value: string | undefined): PlatformTarget; /** Label for the install output — `linux/amd64/gnu`, or what the host resolved * to, with an unknown axis shown rather than hidden. */ export declare function describePlatformTarget(target: PlatformTarget): string; //# sourceMappingURL=warm-layers.d.ts.map