/** * The query-resolution orchestrator (M5): decide which prompt pack a run uses. * * Precedence: an explicit `--queries ` wins; otherwise a persisted * `queries.yml` is reused as-is (hand edits survive) unless `--regenerate` is * set; only then do we make the one guarded judge call. All I/O is injected. */ import { CostGuard } from '../costs.js'; import type { BrandProfile, JudgeClient, QueryPack } from '../types.js'; import { type QueryFs } from './persist.js'; export interface ResolveQueriesDeps { /** Judge for generation; omit only when a cached/explicit pack is expected. */ judge?: JudgeClient; guard?: CostGuard; fs?: QueryFs; now?: () => string; } export interface ResolveQueriesOptions { /** Where `queries.yml` lives (from `resolveStateDir`). */ stateDir: string; /** Regenerate even if a pack exists. */ regenerate?: boolean; /** Explicit `--queries ` path; bypasses generation entirely. */ queriesFile?: string; /** Target pack size. */ count?: number; /** Persist a freshly generated pack (default true). */ persist?: boolean; } export interface ResolveQueriesResult { pack: QueryPack; /** Path the pack was written to, if persisted this run. */ path?: string; /** True when a persisted pack was reused without regenerating. */ fromCache?: boolean; /** True when the pack came from an explicit `--queries` file. */ fromFile?: boolean; /** Reason generation was skipped (cap hit, judge error, or no judge). */ note?: string; } /** Resolve the query pack for a run: explicit file, cached, or generated. */ export declare function resolveQueries(profile: BrandProfile, deps: ResolveQueriesDeps, opts: ResolveQueriesOptions): Promise;