/** * The shared front half of a run: discover the brand profile (M4) then resolve * the buyer query pack (M5). Both `runCheck` (which runs it concurrently with * the zero-LLM audit, then asks/scores) and `runGenerateQueries` (which stops * here) compose the same two calls, so it lives in exactly one place - a change * to discovery/query-gen wiring can never make the two surfaces drift (M15 * review). It emits the discovery/queries {@link ProgressEvent}s itself so the * caller only owns the terminal `discovery-start` and the ask/scoring phases. */ import { CostGuard } from '../costs.js'; import { type ProfileFs } from '../discovery/index.js'; import { type QueryFs } from '../queries/index.js'; import type { Fetcher } from '../fetcher/index.js'; import type { BrandProfile, JudgeClient, QueryPack } from '../types.js'; import type { ProgressEvent } from './check.js'; export interface DiscoverAndQueriesDeps { fetcher: Fetcher; judge?: JudgeClient; guard: CostGuard; profileFs?: ProfileFs; queryFs?: QueryFs; now: () => string; } export interface DiscoverAndQueriesOptions { stateDir: string; persist: boolean; refresh?: boolean; brand?: string; category?: string; samplePages?: number; regenerate?: boolean; queriesFile?: string; count?: number; } export interface DiscoverAndQueriesResult { profile: BrandProfile; pack: QueryPack; /** Path the query pack was written to, if persisted. */ queryPath?: string; /** Human-readable notes (competitor skip, query-gen skip). */ notes: string[]; } export declare function discoverAndBuildQueries(domain: string, deps: DiscoverAndQueriesDeps, opts: DiscoverAndQueriesOptions, report?: (event: ProgressEvent) => void): Promise;