/** * Pure {@link BrandProfile} assembly and merge rules (M4). * * `buildProfile` folds extracted signals + discovered competitors into the * persisted shape; `buildProfileFromFlags` is the no-fetch degraded fallback; * `mergeProfile` implements the "user edits always win" rule for `--refresh`. */ import { type BrandProfile, type BusinessType } from '../types.js'; import { type ExtractedSignals } from './extract.js'; export interface BuildProfileInput { domain: string; signals: ExtractedSignals; competitors: string[]; /** How the discovery call classified the business (M5a), when it did. */ businessType?: BusinessType; generatedAt: string; } /** Assemble a profile from extracted signals and the (llm) competitor list. */ export declare function buildProfile(input: BuildProfileInput): BrandProfile; export interface FlagInput { brand?: string; category?: string; generatedAt: string; } /** * Apply `--brand`/`--category` flags over an existing profile, overriding ONLY * the flagged fields (marked `user`) and preserving every other curated field. * This is the flags path when a profile already exists - it must never wipe * fields the flags do not mention. */ export declare function applyFlags(existing: BrandProfile, flags: FlagInput): BrandProfile; export interface FlagProfileInput { domain: string; brand?: string; category?: string; generatedAt: string; } /** * Build a profile from `--brand`/`--category` flags with no fetch. Flagged * fields are `user`-sourced and the profile is `degraded` (fetch-derived * features flag themselves off downstream). */ export declare function buildProfileFromFlags(input: FlagProfileInput): BrandProfile; /** * Merge a freshly discovered profile over an existing one. A field whose * existing source is `user` is never overwritten; every other field takes the * fresh value/source. The refresh stamps the fresh `generatedAt`. */ export declare function mergeProfile(existing: BrandProfile, fresh: BrandProfile): BrandProfile;