import type { DiagEvent, LogEvent, NetworkEvent, TraceEvent } from "@vincentt-xr/harness/events"; import type { UAClass } from "@vincentt-xr/harness/tunnel"; /** One line per viewer per 5s on the terminal. The agent's pull is unthrottled. */ export declare const PERF_THROTTLE_MS = 5000; export declare function uaLabel(c: UAClass): string; export declare function uaShort(c: UAClass): string; /** * Color carries meaning, never identity: a stream where four labels are four * colors is a stream where nothing stands out, and it degrades to unreadable in * a piped log — which is where an agent reads it. Output must be fully readable * with color stripped, so every colorizer here is a pure wrapper the caller can * disable wholesale. */ export interface Palette { red(s: string): string; yellow(s: string): string; dim(s: string): string; } export declare function palette(color: boolean): Palette; export declare function formatBytes(n: number): string; export declare function formatDuration(ms: number): string; /** * The record draws `200 1.2 MB 1.9s`. The event type carries no byte count, * so the caller supplies one when it has it and the column stays blank rather * than showing a zero that would read as an empty response. */ export declare function renderNetworkWithSize(label: string, e: NetworkEvent, bytes: number | undefined, p: Palette): string; /** * displayPath keeps the path and drops the origin. The origin is the preview's * own capability URL on every same-origin request, and printing it on every line * would put the capability in the creator's scrollback dozens of times a minute * — the same reason 2.18 sets Referrer-Policy: no-referrer. */ export declare function displayPath(url: string): string; export declare function renderLog(label: string, e: LogEvent, p: Palette): string; export declare function renderTrace(label: string, e: TraceEvent): string; /** The dispatcher. Returns null for an event kind the terminal does not print. */ export declare function renderEvent(label: string, e: DiagEvent, p: Palette): string | null; /** * A 60 Hz sampler printed raw would bury logs and network under the one signal a * creator is least often looking for. This is a per-VIEWER gate, not a global * one: four phones each get their own line every 5s, because suppressing the * fourth phone's perf because the first phone just reported would hide the exact * comparison the creator opened four phones to make. */ export declare class PerfThrottle { private readonly windowMs; private readonly last; constructor(windowMs?: number); allow(label: string, now: number): boolean; forget(label: string): void; }