export type MonitorEventKind = 'error' | 'unhandledrejection' | 'fetch' | 'xhr' | 'click' | 'mousedown' | 'route' | 'dialog' | 'submit' | 'probe';
export interface MonitorEventBase {
    /** Epoch ms when the event was captured. */
    ts: number;
    /** Per-tab session id, minted at start(). */
    sessionId: string;
    /** Monotonic counter within the session — useful for reordering reordered batches. */
    seq: number;
}
export interface MonitorErrorEvent extends MonitorEventBase {
    kind: 'error' | 'unhandledrejection';
    message: string;
    stack?: string;
    source?: string;
    line?: number;
    col?: number;
}
export interface MonitorBodyCapture {
    /** Body content, possibly truncated. Secrets redacted (Bearer/JWT/ls_pat_/password fields). */
    body?: string;
    /** Original size in bytes before truncation. */
    bodySize?: number;
    /** True if body was truncated to fit the cap. */
    bodyTruncated?: boolean;
    /** Best-effort content type from the headers, if known. */
    contentType?: string;
}
export interface MonitorRequestCapture extends MonitorBodyCapture {
    /** True if an Authorization header was attached. Value is NEVER captured. */
    hasAuth?: boolean;
}
export interface MonitorNetworkEvent extends MonitorEventBase {
    kind: 'fetch' | 'xhr';
    url: string;
    method: string;
    /** 0 when the request threw before a response was received. */
    status: number;
    durationMs: number;
    /** True if status >= 400 OR the request threw. */
    failed: boolean;
    /** Error message when the request threw. */
    error?: string;
    /**
     * Request snapshot — body + Authorization presence. Only captured for
     * mutating methods (POST/PUT/PATCH/DELETE) to avoid polluting the stream
     * with GET URLs that already encode their inputs in the path.
     */
    request?: MonitorRequestCapture;
    /**
     * Response snapshot — body capture. Captured for failures (status >= 400)
     * by default; verbose mode captures 2xx bodies too.
     */
    response?: MonitorBodyCapture;
}
export interface MonitorOverlayInfo {
    tag: string;
    zIndex: number;
    pointerEvents: string;
    classes: string;
}
export interface MonitorClickTarget {
    tag: string;
    id: string | null;
    classes: string[];
    role: string | null;
    selector: string;
    /** textContent of the target, trimmed + truncated to 80 chars. Omitted if empty. */
    text?: string;
    /** aria-label attribute, truncated. Omitted if missing. */
    ariaLabel?: string;
    /** data-testid attribute. Omitted if missing. */
    testid?: string;
    /** name attribute (form fields). Omitted if missing. */
    name?: string;
    /**
     * Derived human label: aria-label → text → nearest interactive ancestor's
     * aria-label/text. Omitted when same as `text` or when nothing is found.
     * Use this for human-readable rendering ("user clicked <label>").
     */
    label?: string;
}
export interface MonitorClickEvent extends MonitorEventBase {
    kind: 'click' | 'mousedown';
    target: MonitorClickTarget;
    /** Whether the actual hit-tested element matched the original target. */
    hitMatchesTarget: boolean;
    hitTarget?: MonitorClickTarget;
    coords: {
        x: number;
        y: number;
    };
    /** Count of currently-open Radix-style dialogs in the document. */
    openDialogs: number;
    /** Resolved CSS `pointer-events` on <body>. Often the culprit when clicks vanish. */
    bodyPointerEvents: string;
    /** Up to 5 fixed/sticky overlays sitting at the click coords, sorted by z-index desc. */
    overlaysAtPoint?: MonitorOverlayInfo[];
}
export interface MonitorRouteEvent extends MonitorEventBase {
    kind: 'route';
    from: string;
    to: string;
    via: 'pushState' | 'replaceState' | 'popstate' | 'hashchange';
}
export interface MonitorDialogEvent extends MonitorEventBase {
    kind: 'dialog';
    action: 'mount' | 'unmount' | 'state';
    selector: string;
    state?: string | null;
    /** Truncated outerHTML (≤1KB) for mount events — gives the reviewer a hook. */
    outerHTML?: string;
}
export interface MonitorProbeEvent extends MonitorEventBase {
    kind: 'probe';
    /** Free-form label set by the caller (e.g. 'overlay-at-click', 'auth-state'). */
    label: string;
    /** Arbitrary JSON-serialisable payload. Cyclic refs become "[cyclic]". */
    data: unknown;
}
export interface MonitorSubmitField {
    /** name attribute of the field, or '<unnamed>' if missing. */
    name: string;
    /** input type — text/email/password/checkbox/etc., or 'textarea'/'select'. */
    type: string;
    /** True if the field has a non-empty value. Values themselves are NEVER captured. */
    hasValue: boolean;
}
export interface MonitorSubmitEvent extends MonitorEventBase {
    kind: 'submit';
    form: {
        id: string | null;
        action: string | null;
        method: string;
        selector: string;
        /** Field summary. Values are never captured (PII). */
        fields: MonitorSubmitField[];
    };
}
export type MonitorEvent = MonitorErrorEvent | MonitorNetworkEvent | MonitorClickEvent | MonitorRouteEvent | MonitorDialogEvent | MonitorSubmitEvent | MonitorProbeEvent;
/**
 * Envelope POSTed to the launch-beacon receiver. Must stay assignment-compatible
 * with server/beacon/wire.ts MonitorBatchEnvelope — that file is the contract
 * boundary; bump `v` and update both sides if you change the envelope shape.
 */
export interface MonitorBatch {
    sessionId: string;
    events: MonitorEvent[];
    meta: {
        url: string;
        userAgent: string;
        viewport: {
            w: number;
            h: number;
            dpr: number;
        };
        v: 1;
    };
}
//# sourceMappingURL=wire.d.ts.map