import type { MergedConfig } from "../config/config-layer.js"; import type { OrchestratorResult } from "../lib/orchestrator-types.js"; /** Minimal context interface — only the bits preflight needs. */ export interface PreflightContext { ui: { notify(message: string, type?: "error" | "info" | "warning"): void; }; } export interface RunOrchestratorPreflightOptions { /** "task" runs validateModelConfig; "ceremony" skips it. */ mode: "task" | "ceremony"; /** Minimal context for notifications. */ ctx: PreflightContext; /** Prefix for notify messages, e.g. "forge:run-task" or "forge:fix-bug". */ notifyPrefix: string; /** Persona name catalogue from readPersonaDir. */ personaCatalogue: string[]; /** Pipeline name catalogue from readPipelineNames; null if no config found. */ pipelineCatalogue: string[] | null; /** Merged model-routing config from loadLayeredConfig. */ modelRoutingConfig: MergedConfig; /** Available models from ctx.modelRegistry.getAvailable(). */ availableModels: Array<{ provider: string; id: string; }>; } /** Discriminated union: proceed=true → continue; proceed=false → return result early. */ export type OrchestratorPreflightResult = { proceed: true; } | { proceed: false; result: OrchestratorResult; }; /** * Run the orchestrator pre-flight check. * * In mode="task": calls validateModelConfig and surfaces warnings/errors via * ctx.ui.notify. Returns `{ proceed: false, result }` with status="failed" if * there are errors; returns `{ proceed: true }` otherwise. * * In mode="ceremony": returns `{ proceed: true }` immediately without calling * validateModelConfig. This matches the existing behaviour of ceremony dispatch * which uses lookupPersonaModel rather than the full validator. */ export declare function runOrchestratorPreflight(opts: RunOrchestratorPreflightOptions): OrchestratorPreflightResult;