/** * Shared capsule-manifest shape + loader for the manifest-tier commands * (capsule / asset / scene verify-and-inspect). The adapter injects the raw * manifest JSON via {@link CommandContext.manifestSource}; this parses it. One * permissive entry shape covers heterogeneous manifest rows (assets carry a * `source`; capsules/scenes carry `generated` test files). * * @module */ import { type CapsuleCommandResult } from '@czap/core'; import type { CommandContext } from '../registry.js'; /** One capsule-manifest entry (fields vary by capsule kind). */ export interface CapsuleManifestEntry { readonly name: string; readonly kind?: string; readonly source?: string; readonly generated?: { readonly testFile: string; readonly benchFile: string; }; } /** The capsule manifest document. */ export interface CapsuleManifest { readonly capsules: readonly CapsuleManifestEntry[]; } /** Why the capsule manifest could not be loaded. */ export type ManifestLoadFailure = { readonly ok: false; readonly reason: 'missing'; } | { readonly ok: false; readonly reason: 'invalid'; readonly detail: string; }; /** Tagged outcome of {@link loadManifest} — corrupt JSON is a structured failure, never a throw. */ export type ManifestLoadResult = { readonly ok: true; readonly manifest: CapsuleManifest; } | ManifestLoadFailure; /** * Parse the injected manifest source. An absent manifest and corrupt JSON both * return tagged failures so handlers fail structurally across the dispatcher * seam (which promises never to throw). */ export declare function loadManifest(context: CommandContext): ManifestLoadResult; /** * The ONE structured failure for an unusable capsule manifest — capsule/asset/ * scene commands previously said it three different ways. Names the default * path, the override, and the literal next step. */ export declare function manifestUnavailable(command: string, failure: ManifestLoadFailure, context: CommandContext): CapsuleCommandResult; /** * Manifest-absent teaching error: names the path that was looked at (when * the adapter exposes it) and gives both ways out — the repo-internal pnpm * script is not typeable by an npm consumer, so the env override is named too. */ export declare function manifestMissing(context: CommandContext): string; //# sourceMappingURL=manifest.d.ts.map