/** * Seed `activeCompany` in `.hq/config.json` for a joiner who has exactly one * cloud company. * * A newly invited member arrives with no local company routing at all. The * manifest reconciler restores their `companies/manifest.yaml` entry, but * nothing tells HQ which company is *current*, so they stay unrouted even * though membership resolved fine. When the answer is unambiguous — one company * and no existing choice — recording it is strictly better than leaving the * user to guess. * * Everything here is deliberately conservative. This runs unattended on every * sync, against a file the user also edits by hand, so the bar for writing is * "the answer cannot be wrong": never overwrite an existing choice, never guess * between two companies, and never clobber a file we could not parse. */ export interface SeedActiveCompanyOptions { hqRoot: string; /** Slugs of companies that reconciled successfully this run. */ companySlugs: readonly string[]; reportDiagnostic?: (diagnostic: { event: string; message: string; err: unknown; context: Record; }) => void; } export interface SeedActiveCompanyResult { /** True only when `.hq/config.json` was actually written. */ written: boolean; /** The slug that was seeded, when one was. */ activeCompany?: string; /** Why nothing was written. Absent when `written` is true. */ skippedReason?: "ambiguous" | "no-companies" | "already-set" | "unreadable-config" | "write-failed"; } /** * Seed `activeCompany` when — and only when — the answer is unambiguous. * * Never throws: the caller is a sync run whose exit code must not depend on * local routing convenience. */ export declare function seedActiveCompany(options: SeedActiveCompanyOptions): SeedActiveCompanyResult; //# sourceMappingURL=active-company.d.ts.map