/** * In-page overlay — single floating "H" mark in the bottom-right corner. * * Click → expands into an info card that surfaces: * - project / buildId / connection status * - sessionId / tabId (click-to-copy) * - current URL * - "Copy snapshot" — key fields as markdown for sharing with a teammate * or pasting into an agent prompt * - "Report a problem" — enters element-picker mode (the legacy annotation * flow, now reachable from inside the card so users don't see two FABs) * * Single Shadow DOM root attached to ; host page styles never leak in * or out. State machine: idle → info → (picker → question) → flash → idle. */ import { type TaskAttachment } from '@harnessa-fe/protocol'; export interface OverlayClient { readonly projectId: string; readonly buildId?: string; readonly displayName?: string; readonly tabId: string; readonly sessionId: string; readonly visitorId?: string; readonly userId?: string; readonly parentProjectId?: string; getConnectionState(): 'connecting' | 'open' | 'closed'; sendEvent(name: string, payload: unknown): void; /** * RPC channel to the daemon. Used to fetch and mutate the visitor's own * tasks. Resolves with `result`, rejects with the remote error message. */ query?(method: string, args?: unknown): Promise; } export declare function installOverlay(client: OverlayClient): void; interface ArrowStroke { kind: 'arrow'; color: string; x1: number; y1: number; x2: number; y2: number; } interface TextStroke { kind: 'text'; color: string; x: number; y: number; text: string; } type Stroke = ArrowStroke | TextStroke; export declare function replayStrokes(ctx: CanvasRenderingContext2D, bgCanvas: HTMLCanvasElement, strokes: Stroke[]): void; /** * Flatten strokes onto the background canvas and return as a TaskAttachment. * Exported for testing. */ export declare function finalizeAnnotation(): Promise; /** * Best-effort CSS path. Depth cap 12, id anchor short-circuits, ` >>> ` * separates shadow-DOM boundaries. */ export declare function buildCssPath(el: Element): string; export {};