import { type Diagnostic, type DiagnosticCode, type SourceLocation, type SourceSpan } from "../../kernel/diagnostic.js"; import { type FilterAst, type LifecycleMode, type ProcedureManifest, type SchemaManifest, type TriggerManifest, type ViewManifest } from "../model/ManifestGrammar.js"; /** * Day-1 envelope-and-shape parser. Loop 1 (`mantle validate`) does * the cross-manifest checks (Trigger.target.procedure exists, View.from * is a Schema, etc.) — see ADR-0007 and `docs/handbook/reference/manifest.md`. * * Diagnostics emitted here are intentionally narrow: bad envelope or * structurally malformed shipped grammar. * * The canonical API withholds its value when any document fails. The legacy * `{ manifests, diagnostics }` adapter below therefore returns no manifests * on failure rather than exposing a partial graph. * * Each caller-owned source may contain multiple YAML documents separated by * `---`; source identities and document indexes remain intact. */ /** * Throwable carrier used by the envelope-shape validators below * (`validateEnvelope`, kind-specific `validate*Spec`). Each throw * carries a JSON Pointer + diagnostic code; the top-level * The source parser catches the throw and converts it to a Diagnostic * for the public `{ manifests, diagnostics }` return shape. */ export declare class ManifestParseError extends Error { readonly docIndex?: number | undefined; /** JSON Pointer into the manifest (e.g. `/spec/output`). */ readonly pointer?: string | undefined; readonly code: DiagnosticCode; readonly details?: Pick | undefined; constructor(message: string, docIndex?: number | undefined, /** JSON Pointer into the manifest (e.g. `/spec/output`). */ pointer?: string | undefined, code?: DiagnosticCode, details?: Pick | undefined); } /** One caller-owned manifest source. Core never resolves this ID as a path. */ export interface ManifestSource { readonly sourceId: string; readonly text: string; } export interface ManifestSourceSet { readonly sources: readonly ManifestSource[]; } type ParsedSchemaManifest = Omit & { readonly spec: Omit & { readonly uniqueIndexes: ReadonlyArray>; readonly indexes: ReadonlyArray>; readonly searchableFields: readonly string[]; readonly localized: boolean; readonly lifecycle: LifecycleMode; }; }; type ParsedViewManifest = Omit & { readonly spec: Omit & { readonly orderBy: ReadonlyArray<{ readonly field: string; readonly direction: "asc" | "desc"; }>; }; }; /** Canonical atom value after all static authoring defaults are materialized. */ export type ParsedManifest = ParsedSchemaManifest | ParsedViewManifest | ProcedureManifest | TriggerManifest; export interface ParsedManifestEntry { readonly manifest: ParsedManifest; readonly source: SourceLocation; /** YAML-node spans keyed by JSON Pointer; source identity lives in `source`. */ readonly sourceSpans: Readonly>; } declare const parsedManifestSetBrand: unique symbol; /** Parser-owned value. Consumers cannot construct it as an ordinary object literal. */ export interface ParsedManifestSet { readonly entries: readonly ParsedManifestEntry[]; readonly [parsedManifestSetBrand]: true; } export type ParseResult = { readonly ok: true; readonly value: T; readonly diagnostics: readonly Diagnostic[]; } | { readonly ok: false; readonly diagnostics: readonly Diagnostic[]; }; /** * Pure, source-aware parse boundary. Any error withholds the sealed value so a * later stage cannot consume a partial manifest graph. */ export declare function parseManifestSources(sourceSet: ManifestSourceSet): ParseResult; /** Resolve the narrowest retained authored span for a parsed semantic path. */ export declare function sourceLocationAt(entry: ParsedManifestEntry, path: string): SourceLocation; export type { FilterAst }; //# sourceMappingURL=ManifestParser.d.ts.map