import { type ArtifactSelector, type ModuleFileClaim } from "@telorun/analyzer"; import type { PayloadLayer } from "@telorun/kernel"; /** Manifest-relative POSIX path of a selected file, grouped into the layer it * belongs to. Content is read by the caller — this module decides membership * only, so it stays testable without a filesystem. */ export interface LayerPlan { role: PayloadLayer["role"]; selector?: ArtifactSelector; files: string[]; } /** Where every selected file landed, for the publish-time printout. The author's * only feedback that a file they meant as a controller sidecar ended up in the * common layer, or that an asset they forgot to claim is not lazy. */ export interface Partition { layers: LayerPlan[]; /** `assets:` patterns that matched nothing — almost always a typo, and invisible * in `layers` because an empty layer is dropped. */ unmatchedAssets: string[]; /** `siblings=` patterns that matched nothing, with the claim that declared * each one. */ unmatchedSiblings: Array<{ origin: string; pattern: string; }>; } /** * Partition the selected payload into the layers a module artifact ships. * * A **controller layer** per distinct selector, holding its entry points plus * whatever their sibling qualifiers claim. The **assets** layer holds what * `assets:` claims — it is fetched lazily, on first module-relative access. The * **common** layer holds everything left over. * * The sink runs toward correctness: an unclaimed file joins `common`, which is * materialized alongside *any* controller layer, so a sidecar nobody declared is * on disk before the controller that needs it imports. A forgotten declaration * therefore costs bytes, never a module-not-found at runtime. Both declarations * are optional and only ever buy laziness. * * `claims` is everything the manifest names — read by `collectModuleFileClaims`, * which asks each syntax's own owner (this module recognises neither a PURL nor * a YAML tag). `files` are the manifest-relative paths `selectFiles` produced; * `assetPatterns` is the author's `assets:` list. A claimed file joins the * payload whether or not `files:` selected it — the manifest already names it, * so restating it would be pure duplication. Layers with no files are dropped, * so a controller-only module publishes exactly one payload layer. */ export declare function partitionLayers(claims: readonly ModuleFileClaim[], files: string[], assetPatterns: string[]): Partition; /** * One line per layer for the publish output, so an author can see that a file they * meant as a sidecar or an asset landed in `common` instead. * * Patterns that matched nothing are reported too: an empty layer is dropped from * the partition, so a typo'd `assets:` glob would otherwise print nothing at all — * silence about the single mistake this output exists to catch. */ export declare function describePartition(partition: Partition): string[]; //# sourceMappingURL=partition-layers.d.ts.map