/** * Product prompt generation (M12a): the two layers, per product, in ONE guarded * judge call. * * Layer 1 (visibility) asks the category questions a shopper types when they do * NOT know the product - so those prompts must never name it. Layer 2 * (reputation) names the product deliberately, which guarantees a mention and * therefore measures sentiment, not discovery. The same split the brand check * makes between discovery prompts and branded prompts, one level down. * * Every failure path still produces prompts: the named layer is templatable * without a judge, and the category layer falls back to the product descriptor * or the brand category. A product with neither loses its visibility layer and * the run SAYS so (rule #6) rather than scoring it against nothing. */ import { CostGuard } from '../costs.js'; import type { BrandProfile, JudgeClient, ProductEntity } from '../types.js'; /** Category prompts asked per product (the layer the ranking delta rests on). */ export declare const VISIBILITY_PROMPTS_PER_PRODUCT = 3; /** Product-named prompts asked per product (the reputation layer). */ export declare const REPUTATION_PROMPTS_PER_PRODUCT = 1; /** Total prompts a product costs per engine. */ export declare const PROMPTS_PER_PRODUCT: number; /** Which layer a prompt belongs to; they are scored separately. */ export type ProductLayer = 'visibility' | 'reputation'; /** One prompt, bound to the product (by INDEX) that asked for it. */ export interface ProductPrompt { /** Index into the run's product list - a key we control, never a name. */ productIndex: number; layer: ProductLayer; prompt: string; } export interface ProductQueriesResult { prompts: ProductPrompt[]; /** Human-readable notes: fallbacks used, layers skipped. Never silent. */ notes: string[]; } export interface ProductQueriesDeps { /** Omit to skip generation entirely and use the templates (with a note). */ judge?: JudgeClient; guard: CostGuard; /** Projected setup cost for authorization; defaults to a per-model estimate. */ projectedCostUsd?: number; } export interface ProductQueriesOptions { generatedAt: string; /** Override the per-product category prompt count (tests, future flags). */ visibilityPerProduct?: number; } /** Parse `{ "": { visibility: [...], reputation: [...] } }` from judge output. */ export declare function parseProductQueries(text: string, productCount: number): Map; /** * Generate both prompt layers for every product via one guarded judge call. * * Never throws: a cap or a judge error degrades to templates with a note, the * same contract discovery and query generation follow. */ export declare function generateProductQueries(profile: BrandProfile, products: ProductEntity[], deps: ProductQueriesDeps, opts: ProductQueriesOptions): Promise;