/** * Per-unit filtered codegen for the deploy pipeline. * * For each deployment unit, runs `pikku all` with --names and --outDir * flags to produce a separate .pikku/ directory containing only the * registrations needed by that unit. * * Uses --stateInput to avoid re-inspecting the codebase for each unit. */ import type { InspectorState } from '@pikku/inspector'; import type { DeploymentManifest, DeploymentUnit } from '../analyzer/manifest.js'; export interface PerUnitCodegenOptions { /** Root directory of the project (where pikku.config.json lives) */ projectDir: string; /** The deployment manifest with all units */ manifest: DeploymentManifest; /** The full (unfiltered) inspector state */ inspectorState: InspectorState; /** Base output directory for deploy artifacts (defaults to /.deploy) */ deployDir?: string; /** Path to pikku binary (auto-resolved if not provided) */ pikkuBin?: string; /** Called for each unit as it starts/completes */ onProgress?: (unitName: string, status: 'start' | 'done' | 'error', error?: string) => void; /** Resolve unit output directory (defaults to /) */ resolveUnitDir?: (unit: DeploymentUnit, baseDeployDir: string) => string; /** * Whether the deploy pipeline emits per-step workflow queues. When `false` * the per-unit codegen filter does NOT include `wf-orchestrator-*` / * `wf-step-*` queue names — they don't exist in the manifest, and pulling * them through codegen would force the workflow runtime to register queue * meta the provider doesn't actually use. Defaults to `true`. */ workflowQueues?: boolean; } export interface PerUnitCodegenResult { /** Map of unit name -> path to the unit's .pikku directory */ unitPikkuDirs: Map; /** Units that failed codegen */ errors: Array<{ unitName: string; error: string; }>; } /** * Runs filtered codegen for each deployment unit. * * For each unit: * 1. Calls `pikku all --stateInput= --names= --outDir= --silent` * 2. This produces pikku-bootstrap.gen.ts (and all other codegen) filtered to only that unit's functions * * The inspector state is saved once to a temp file and reused across all units. */ export declare function generatePerUnitCodegen(options: PerUnitCodegenOptions): Promise;