import { OutputMode } from "@outfitter/cli/types"; import { Result } from "@outfitter/contracts"; /** Check bundle mode controlling which steps are included and whether a clean tree is enforced. */ type CheckOrchestratorMode = "all" | "ci" | "pre-commit" | "pre-push"; type CheckOrchestratorCommandProfile = "default" | "hook"; interface CheckOrchestratorStep { readonly command: readonly string[]; readonly id: string; readonly label: string; } /** Options controlling which checks the orchestrator runs. */ interface CheckOrchestratorOptions { /** Command profile for nested tool invocations. */ readonly commandProfile?: CheckOrchestratorCommandProfile; /** Workspace root for resolving commands and tree-clean detection. */ readonly cwd: string; readonly mode: CheckOrchestratorMode; /** Staged file paths for pre-commit scoping. Ignored by other modes. */ readonly stagedFiles?: readonly string[]; /** Stream child process output to the terminal as each step runs. */ readonly streamOutput?: boolean; } interface CheckOrchestratorStepResult { readonly command: readonly string[]; readonly durationMs: number; readonly exitCode: number; readonly id: string; readonly label: string; readonly stderr: string; readonly stdout: string; } /** Aggregate outcome of an orchestrator run including tree-clean status. */ interface CheckOrchestratorResult { /** Step IDs that exited non-zero. */ readonly failedStepIds: readonly string[]; readonly mode: CheckOrchestratorMode; /** Paths added or modified in the working tree during the run. */ readonly mutatedPaths: readonly string[]; /** True when all steps passed and tree-clean enforcement (if applicable) succeeded. */ readonly ok: boolean; readonly steps: readonly CheckOrchestratorStepResult[]; /** Whether the working tree was unchanged after the run completed. */ readonly treeClean: boolean; } /** Error raised when the check orchestrator cannot complete its run. */ declare class CheckOrchestratorError extends Error { readonly _tag: "CheckOrchestratorError"; constructor(message: string); } /** * Build the ordered list of check steps for the given mode. * * Pre-commit mode scopes lint/typecheck to staged files and conditionally * includes agent-scaffolding sync. All other modes run the full suite. */ declare function buildCheckOrchestratorPlan(options: CheckOrchestratorOptions): readonly CheckOrchestratorStep[]; /** * Parse `git status --porcelain` output into sorted file paths. * * Handles rename entries by extracting the destination path. */ declare function parseTreePaths(statusOutput: string): string[]; /** * Execute the check plan sequentially, stopping on the first failure. * * Captures working-tree state before and after to detect mutations. * For modes other than pre-commit, a dirty tree causes an overall failure. */ declare function runCheckOrchestrator(options: CheckOrchestratorOptions): Promise>; interface PrintCheckOrchestratorResultsOptions { readonly compact?: boolean; readonly liveOutput?: boolean; readonly mode?: OutputMode; } /** * Render orchestrator results to stdout. * * Structured modes emit JSON/JSONL (optionally compact). Human mode * prints a step-by-step summary with pass/fail icons, timing, advisory * warnings, and mutation traceability. */ declare function printCheckOrchestratorResults(result: CheckOrchestratorResult, options?: PrintCheckOrchestratorResultsOptions): Promise; export { CheckOrchestratorMode, CheckOrchestratorOptions, CheckOrchestratorResult, CheckOrchestratorError, buildCheckOrchestratorPlan, parseTreePaths, runCheckOrchestrator, printCheckOrchestratorResults };