import { type SeedStyle, type CatalogEntry } from "../formats.js"; import type { HostComponentSite } from "./catalog-scan.js"; /** * Source capture for the host's OWN registered components — everything mapped * in ``. Vendo used to store only their NAMES, so the * console's Apps gallery drew a grey labeled block where a real chart belongs. * Now the component's module (and its whole import closure) travels with the * name, and the console renders it in the same jail a generated component uses. * * The corpus is CONTENT-ADDRESSED. Ten components importing one * `format-currency.ts` store it once: * * .vendo/components/.json — refs only, ~400 bytes * .vendo/components/modules/.json — { source, imports? }, one per * distinct module or stylesheet * * That split is the point, not an optimization: the index is small enough that * LISTING it is the hash manifest a Cloud push compares against, and the heavy * half is keyed by content, so a push can ask "which of these hashes do you * already have?" with one keys-only call (cli/cloud/host-components.ts). */ export declare const COMPONENTS_DIR = "components"; export interface HostComponentCaptureResult { captured: string[]; drifted: string[]; /** Records deleted because the host no longer registers that component. */ pruned: string[]; /** Registered components left uncaptured this run (over budget, or with a * module the entry rule cannot turn into a default export). */ skipped: string[]; /** Captured, but with neither usable `examples` nor a representable props * schema — so a preview can only show a labeled placeholder. */ withoutSamples: string[]; warnings: string[]; } /** The first declared example that parses to a JSON object of props. A * malformed or non-object entry is stepped over rather than failing the * component. */ export declare function declaredSample(examples: readonly string[] | undefined): Record | null; /** * Capture every registered component's source into `.vendo/components/`. * `styles` are the app-root stylesheets the pin capture already collected — * shared by every component, so they enter the corpus once. */ export declare function captureHostComponents(options: { root: string; out: string; sites: readonly HostComponentSite[]; styles: readonly SeedStyle[]; /** The catalog sync just wrote — the source of the preview seed, via its * `examples` then its derived `propsSchema`. The MERGED file, not the raw * scan, so curated copy on a scanned entry counts exactly like a * registry-declared one. */ catalog?: readonly CatalogEntry[]; /** A degraded catalog scan prunes nothing: it never saw the whole project. */ degraded: boolean; budgetBytes?: number; }): Promise;