import { BlockGeneratorService, type PlanBlockInput, type PlanBlockResult, type RenderBlockResult, type ValidateBlockResult } from './block-generator-service.js'; import type { ManifestDocument } from '../migration/migration-types.js'; import type { BuiltInTemplateId } from './template-registry.js'; /** * Semantic version marker for the public block generation tool contract. * * Increment this number whenever the serialized inspection payload changes in a * breaking way. */ export declare const BLOCK_GENERATION_TOOL_CONTRACT_VERSION: 1; /** * Staged execution points for the non-mutating inspection workflow. * * - `"plan"` returns the normalized `BlockSpec` and target metadata. * - `"validate"` returns the validated generation stage without rendering. * - `"render"` returns the full non-mutating preview, including copied and * emitted file snapshots. */ export type BlockGenerationToolStage = 'plan' | 'validate' | 'render'; /** * Input for the staged, non-mutating block generation inspection entrypoint. * * Extends `PlanBlockInput` with an optional `stopAfter` selector so callers can * stop at `plan`, `validate`, or continue through the full `render` preview. */ export interface InspectBlockGenerationInput extends PlanBlockInput { stopAfter?: BlockGenerationToolStage; } export interface BlockGenerationTemplateCopyPreview { owner: 'template-copy'; relativePath: string; } export interface BlockGenerationEmittedFilePreview { kind: 'generated-source' | 'starter-manifest' | 'structural'; owner: 'emitter'; relativePath: string; source: string; } export interface BlockGenerationStarterManifestPreview { document: ManifestDocument; owner: 'emitter'; relativePath: string; source: string; } export interface BlockGenerationRenderPreview { copiedTemplateFiles: BlockGenerationTemplateCopyPreview[]; emittedFiles: BlockGenerationEmittedFilePreview[]; postRender: RenderBlockResult['postRender'] & { installsDependencies: boolean; }; selectedVariant: null; starterManifestFiles: BlockGenerationStarterManifestPreview[]; template: { description: string; family: BuiltInTemplateId; features: string[]; format: 'wp-typia'; }; warnings: string[]; readmeContent: string; gitignoreContent: string; } interface BlockGenerationInspectionBase { contractVersion: typeof BLOCK_GENERATION_TOOL_CONTRACT_VERSION; mutatesWorkspace: false; stage: BlockGenerationToolStage; } export interface InspectBlockGenerationPlanResult extends BlockGenerationInspectionBase { plan: PlanBlockResult; stage: 'plan'; } export interface InspectBlockGenerationValidateResult extends BlockGenerationInspectionBase { plan: PlanBlockResult; stage: 'validate'; validated: ValidateBlockResult; } export interface InspectBlockGenerationRenderResult extends BlockGenerationInspectionBase { plan: PlanBlockResult; rendered: BlockGenerationRenderPreview; stage: 'render'; validated: ValidateBlockResult; } export type InspectBlockGenerationResult = InspectBlockGenerationPlanResult | InspectBlockGenerationValidateResult | InspectBlockGenerationRenderResult; export declare function inspectBlockGeneration(input: InspectBlockGenerationInput & { stopAfter: 'plan'; }, service?: BlockGeneratorService): Promise; export declare function inspectBlockGeneration(input: InspectBlockGenerationInput & { stopAfter: 'validate'; }, service?: BlockGeneratorService): Promise; export declare function inspectBlockGeneration(input: InspectBlockGenerationInput & { stopAfter?: 'render' | undefined; }, service?: BlockGeneratorService): Promise; export {};