import type { ProductGraph } from '../graph/graph-types.js'; import type { Plan } from '../planner/plan-types.js'; /** * A generator target descriptor — metadata about a code generator. */ export interface GeneratorDescriptor { readonly name: string; readonly version: string; readonly description: string; readonly supportedPlatforms: readonly string[]; readonly supportedNodeKinds: readonly string[]; } /** * A generated artifact — one output file produced by a generator. */ export interface GeneratedArtifact { readonly path: string; readonly nodeId: string; readonly generator: string; readonly checksum: string; } /** * The contract that all code generators must implement. */ export interface Generator { readonly descriptor: GeneratorDescriptor; /** * Generate artifacts for the given plan and graph. * Returns the list of artifacts produced. */ generate(graph: ProductGraph, plan: Plan): Promise; /** * Verify that previously generated artifacts are still valid * against the current graph. */ verify(graph: ProductGraph, artifacts: readonly GeneratedArtifact[]): Promise; } export interface VerificationResult { readonly artifact: GeneratedArtifact; readonly valid: boolean; readonly message?: string; } /** * Graph slice — a subset of the product graph for a specific generator category. */ export interface GraphSlice { readonly category: SliceCategory; readonly rootNodeIds: readonly string[]; readonly nodeIds: readonly string[]; readonly edges: readonly { from: string; to: string; kind: string; }[]; } export type SliceCategory = 'backend' | 'frontend' | 'api' | 'runtime' | 'schema' | 'test'; /** * Extract a category-based slice of the graph. * Starts from root nodes matching the category, then walks transitive * dependencies through edges to include all reachable nodes. */ export declare function sliceGraph(graph: ProductGraph, category: SliceCategory): GraphSlice; /** * Slice the graph into all standard categories. */ export declare function sliceAllCategories(graph: ProductGraph): readonly GraphSlice[]; //# sourceMappingURL=contracts.d.ts.map