/** * Release Asset Manifest — v2 body schema, types, and validator. * * The manifest body is content-addressed metadata describing transformed * browser modules and compiled CSS for a release, plus the per-route closure * used to drive preload hints and asset URL rewriting. * * The extension-backed schema is used when the schema contract is available. * Consumption paths also use a dependency-free parser that applies the same * bounds and returns a detached, deeply frozen snapshot. * * @module release-assets/manifest-schema */ import type { InferSchema } from "../extensions/schema/index.js"; import { type ReleaseAssetContentType } from "./constants.js"; /** * Check that an untrusted value is a non-empty, trimmed string within * `maxLength` that contains no control characters. */ export declare function isSafeBoundedText(value: unknown, maxLength: number): value is string; /** Extension-backed validator for the strict release asset manifest v2 body. */ export declare const getReleaseAssetManifestSchema: () => import("../internal-agents/schema.js").Schema; projectId: import("../internal-agents/schema.js").Schema; releaseId: import("../internal-agents/schema.js").Schema; releaseVersion: import("../internal-agents/schema.js").Schema; manifestVersion: import("../internal-agents/schema.js").Schema; builderVersion: import("../internal-agents/schema.js").Schema; sourceContentHash: import("../internal-agents/schema.js").Schema; createdAt: import("../internal-agents/schema.js").Schema; assetBasePath: import("../internal-agents/schema.js").Schema<"/_vf/assets">; modules: import("../internal-agents/schema.js").Schema; size: import("../internal-agents/schema.js").Schema; contentType: import("../internal-agents/schema.js").Schema; }>>>; css: import("../internal-agents/schema.js").Schema; size: import("../internal-agents/schema.js").Schema; contentType: import("../internal-agents/schema.js").Schema<"text/css">; styleProfileHash: import("../internal-agents/schema.js").Schema; cssPipelineIdentity: import("../internal-agents/schema.js").Schema; }>[]>; routes: import("../internal-agents/schema.js").Schema; css: import("../internal-agents/schema.js").Schema; }>>>; dependencyMode: import("../internal-agents/schema.js").Schema<"immutable" | "source">; dependencies: import("../internal-agents/schema.js").Schema; size: import("../internal-agents/schema.js").Schema; contentType: import("../internal-agents/schema.js").Schema; }>>>; }>>; /** Validated, immutable release asset manifest v2 body. */ export type ReleaseAssetManifest = InferSchema>; /** Content-addressed JavaScript module entry. */ export type ReleaseAssetEntry = ReleaseAssetManifest["modules"][string]; /** Content-addressed CSS entry. */ export type ReleaseAssetCssEntry = ReleaseAssetManifest["css"][number]; /** Per-route module and CSS closure. */ export type ReleaseAssetRouteEntry = ReleaseAssetManifest["routes"][string]; /** Capability represented by entries in the manifest dependency map. */ export type ReleaseAssetDependencyMode = ReleaseAssetManifest["dependencyMode"]; /** Manifest whose dependency entries name uploaded content-addressed assets. */ export type ImmutableReleaseAssetManifest = ReleaseAssetManifest & { readonly dependencyMode: "immutable"; }; /** True only when manifest dependency entries are safe immutable rewrite targets. */ export declare function hasImmutableReleaseAssetDependencies(manifest: ReleaseAssetManifest | null | undefined): manifest is ImmutableReleaseAssetManifest; /** Manifest lifecycle states (DB-owned; mirrored here for runtime checks). */ export type ReleaseAssetManifestState = "queued" | "building" | "ready" | "partial" | "failed" | "superseded"; /** Response shape for the GET asset-manifest endpoint. */ export interface ReleaseAssetManifestResponse { state: ReleaseAssetManifestState; manifest_version: number; manifest: ReleaseAssetManifest | null; } /** Strict ready response with a generation-matched validated manifest body. */ export interface ReadyReleaseAssetManifestResponse { readonly state: "ready"; readonly manifest_version: number; readonly manifest: ReleaseAssetManifest; } /** * Options shared by the dependency-free consumption parsers. `acceptLegacyV1` * defaults to `false`, so a v1 manifest body is rejected as a schema skew; set * it to `true` only on read paths that must still adapt a readable v1 manifest. */ export interface ReleaseAssetManifestParseOptions { /** * Accept the v1 body still held for releases published before the v2 move. * * Off by default, and deliberately opt-in per call site. * * Runtime reads must set it, or every release published before the v2 move * loses its browser modules. Producer-side callers must not: for the build * executor verifying what it just emitted, the CLI waiting on a deploy, or a * locally built bundle, a v1 body means the builder and this framework are * skewed, and accepting it would hide that skew instead of naming it. * * @default false */ readonly acceptLegacyV1?: boolean; } /** * Parse an untrusted manifest without requiring a registered schema extension. * * The parser is non-throwing, applies explicit work and memory bounds, validates * route references, and returns a detached deeply frozen snapshot. */ export declare function parseReleaseAssetManifest(value: unknown, options?: ReleaseAssetManifestParseOptions): ReleaseAssetManifest | null; /** * Parse an untrusted ready response without executing accessors. * * The response envelope and manifest body must identify the same release and * manifest generation. Extra envelope fields are ignored so the control plane * can add unrelated metadata without weakening these identity checks. */ export declare function parseReadyReleaseAssetManifestResponse(value: unknown, expectedReleaseId: string, options?: ReleaseAssetManifestParseOptions): ReadyReleaseAssetManifestResponse | null; /** * Explain why a ready manifest response was rejected. * * `parseReadyReleaseAssetManifestResponse` returns null for five distinct * reasons, which left operators with "invalid or mismatched" and no way to tell * a stale build from a corrupt payload. The commonest cause by far is version * skew: assets built by a framework older than the reader expect a different * schema, and the remedy is to deploy a newer builder, not to rebuild against * the same one. * * Only bounded, self-produced text is returned. Untrusted values are reported * as their shape or as a bounded integer, never echoed. */ export declare function describeReadyReleaseAssetManifestRejection(value: unknown, expectedReleaseId: string, options?: ReleaseAssetManifestParseOptions): string; /** * Read an own data property from an untrusted value without invoking accessors. * * Returns undefined for primitives, accessor-backed properties, and values * whose property inspection throws (for example hostile proxies). */ export declare function readUntrustedOwnDataProperty(value: unknown, key: PropertyKey): unknown; //# sourceMappingURL=manifest-schema.d.ts.map