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; /** * 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; /** * 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; /** * 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): Record; /** * 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): ResolutionResult; /** * Apply simple inline overrides onto already-materialized input-set YAML. * * The runtime template is used only as a map from public input keys to exact * runtime locations. Fields that the caller did not provide are left from the * input set, instead of leaking unresolved `<+input>` placeholders from the * template into the execute body. */ export declare function substituteInputsIntoBaseYaml(templateYaml: string, userInputs: Record, baseYaml: string): 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, options: ResolveOptions): Promise; export declare function resolveRuntimeInputsWithBaseYaml(client: HarnessClient, flatInputs: Record, options: ResolveOptions, baseYaml: string): Promise; //# sourceMappingURL=runtime-input-resolver.d.ts.map