/** Per-generation cap for the events.jsonl bus (a long-running dev session hit 9 GB in the wild, and * a 254 MB file OOM-crash-looped every ingesting consumer in the 2026-07-28 flood). Override with * `LENSMCP_EVENT_MAX_BYTES` (default 50 MB). 0/invalid ⇒ the default. */ export declare const EVENT_MAX_BYTES: number; /** Rotated generations kept as history (`events.jsonl.1` … `.N`, newest → oldest). With the live * file that bounds a workspace to (N+1) × EVENT_MAX_BYTES (~300 MB at defaults). Override with * `LENSMCP_EVENT_MAX_FILES`. */ export declare const EVENT_MAX_FILES: number; /** * Round-robin rotation for a bus file: when the live file exceeds the per-generation cap, drop the * oldest generation, shift `.1` → `.2` → … → `.N`, and rename the live file to `.1` (the next append * recreates it fresh). Throttled by a per-file byte counter so we `statSync` at most ~once per MB, * not per event. Best-effort + fs-tap-safe (pristine refs, callers hold `writing`). Many processes * append to the same path — the final `renameSync` is atomic, so a concurrent rotate that loses the * race just throws ENOENT and no-ops (a racing shift can at worst mis-order HISTORY generations, * never touch the live file). Exported so every OTHER writer to the shared bus (the cluster * gateway's observability emit) enforces the same contract — the gateway was the one writer with NO * rotation, which is how foodguard's bus outgrew every consumer. `caps` exists for tests. */ export declare function maybeRotateEventFile(file: string, addedBytes: number, caps?: { maxBytes?: number; maxFiles?: number; }): void; export type LensSeverity = 'info' | 'error'; export type LogSeverity = 'debug' | 'info' | 'warning' | 'error' | 'fatal'; /** Service identity stamped on every event (set by the cluster serve executor). */ export declare const PROJECT: string; /** The file bus — same default the cluster gateway and dashboard use. */ export declare const EVENT_FILE: string; /** True while the lens itself is appending — the fs tap skips self-writes. */ export declare function isLensWriting(): boolean; /** Flow correlation stamped into `context` so the event joins a request trace. */ export interface FlowCtx { flowId?: string; requestId?: string; originNodeId?: string; } export declare function lensEmit(source: string, severity: LensSeverity, title: string, raw: Record, fingerprint?: string, flowCtx?: FlowCtx, /** Event category. Defaults to `cluster` — what every tap emitted before this existed. */ category?: string): void; /** * Emit a raw service log line — the ACTUAL stdout/Logger output a pod prints — as * a `runtime` event so it surfaces in the dashboard Logs view. Same fs-tap-safe * write path as {@link lensEmit}; `source: 'nestjs'` + `raw.project` carries the * concrete service name (which the dashboard prefers as the log's source). */ export declare function lensLog(severity: LogSeverity, title: string, detail?: { stack?: string; }): void;