import { type HarnessConfigRegistry, type HarnessType } from "./harness-config.js"; /** * Result of deterministic harness selection. * * Determinism contract: output is deeply-equal for identical inputs. * Only sorted directory listings and parsed JSON are inspected — * no reads of process.env, git state, or file mtimes. */ export interface HarnessSelection { harness_type: HarnessType; harness_config: string; source: "explicit" | "auto" | "default" | "frontmatter" | "runtime"; signals?: string[]; detectorVersion: 1; } /** * Select a harness for the given working directory. * * Deterministic: depends only on sorted directory listings and parsed * JSON contents. No process.env, git state, or file mtime reads. */ export declare function selectHarness(cwd: string, opts?: { registry?: HarnessConfigRegistry; projectDir?: string; userDir?: string; }): HarnessSelection; /** * Produce a canonical, key-sorted JSON string for a `HarnessSelection`. * The `signals` array (if present) is sorted before serialization so that * equal selections always produce the same string across runs. */ export declare function serializeHarnessSelection(sel: HarnessSelection): string; /** * Return a hashable key for an optional `HarnessSelection`. * Used in resume call-hash computation — returns a fixed sentinel when * the selection is `undefined`. */ export declare function harnessSelectionKey(sel: HarnessSelection | undefined): string; /** * Validate a persisted/plain object back into a `HarnessSelection`. * * Guards: * - `harness_type` against the canonical `HARNESS_TYPES` set. * - `source` against the known source literals (including "runtime"). * - `detectorVersion` defaults to `1`. * - `signals` must be a string array (if present). * * Returns `undefined` on malformed input so callers fall back to * a fresh `selectHarness()` call. */ export declare function parseHarnessSelection(raw: unknown): HarnessSelection | undefined;