import type { HarnessClient } from "../client/harness-client.js";
/** Clear the template cache (useful for testing). */
export declare function clearTemplateCache(): void;
export interface ResolveOptions {
    pipelineId: string;
    orgId?: string;
    projectId?: string;
    branch?: string;
}
export interface ResolutionResult {
    yaml: string;
    matched: string[];
    unmatchedRequired: string[];
    unmatchedOptional: string[];
    expectedKeys: string[];
}
/**
 * Fetch the runtime input template for a pipeline.
 * Returns the raw template YAML string with `<+input>` placeholders, or null if no inputs needed.
 */
export declare function fetchRuntimeInputTemplate(client: HarnessClient, options: ResolveOptions): Promise<string | null>;
/**
 * Check if a value looks like a flat key-value map of runtime inputs
 * (as opposed to already being a full pipeline YAML structure or string).
 */
export declare function isFlatKeyValueInputs(inputs: unknown): inputs is Record<string, unknown>;
/**
 * Check if inputs can be resolved through the template system.
 * Returns true for any object that isn't already a full pipeline YAML structure.
 * Broader than isFlatKeyValueInputs — also accepts structural/nested inputs
 * (e.g. codebase build objects with nested type/spec).
 */
export declare function isResolvableInputs(inputs: unknown): inputs is Record<string, unknown>;
/**
 * Flatten nested object inputs into dot-separated keys for template matching.
 * Preserves intermediate object values at each level for whole-subtree matching.
 *
 * Example: { build: { type: "branch", spec: { branch: "main" } } }
 * → { "build": { type: "branch", ... }, "build.type": "branch", "build.spec.branch": "main" }
 */
export declare function flattenInputs(inputs: Record<string, unknown>): Record<string, unknown>;
/**
 * Given a template YAML with `<+input>` placeholders and a flat key-value map,
 * substitute matching fields and return the filled YAML string.
 *
 * Matching strategy:
 * - Walk the YAML tree depth-first
 * - For any value that is `<+input>` (or starts with `<+input>.`), look for a user-provided
 *   value by the leaf field name (e.g. "branch", "env", "tag")
 * - Also try matching by the full dotted path from the YAML root (e.g. "stages.deploy.spec.branch")
 */
export declare function substituteInputs(templateYaml: string, userInputs: Record<string, unknown>): ResolutionResult;
/**
 * High-level resolver: fetches the template and substitutes user inputs.
 * Returns the resolved YAML string ready for the pipeline execute API.
 *
 * If the pipeline has no runtime inputs, returns an empty string.
 * unmatchedRequired: placeholders that MUST be provided (will cause API 400).
 * unmatchedOptional: placeholders with .default() — the API fills them in.
 */
export declare function resolveRuntimeInputs(client: HarnessClient, flatInputs: Record<string, unknown>, options: ResolveOptions): Promise<ResolutionResult>;
//# sourceMappingURL=runtime-input-resolver.d.ts.map