/** * Visitor identity + environment capture. * * `visitorId` is an opaque UUID persisted in `localStorage.__hfe_visitor_id__` * (per-origin, per-browser). It stitches a user's activity across pageloads, * refreshes, and tabs so the daemon can build a coherent user journey. * * Privacy: anonymous by default. No canvas / WebGL / AudioContext * fingerprinting. The app may pass `userId` via `HarnessaScript userId=…` * which the daemon attaches to `VisitorMeta.userId` — that field is only * meaningful when the host app explicitly opts in. */ import type { VisitorEnv } from '@harnessa-fe/protocol'; /** Read or lazily create the visitorId. localStorage scope = per-origin. */ export declare function getOrCreateVisitorId(): string; /** * Same-origin iframe child inherits the parent's visitorId so the journey * stitches across micro-frontends. Cross-origin children fall back to their * own (a different visitorId — expected, browsers isolate localStorage). */ export declare function tryInheritVisitorFromParent(): string | undefined; /** * Snapshot the browser environment for this pageload. Cheap (all sync * reads); safe to call on every hello. */ export declare function collectEnv(): VisitorEnv; /** Expose to same-origin iframes; called by client.ts after resolving id. */ export declare function publishVisitorIdToWindow(id: string): void;