/** * Dependency-free ANSI escape-sequence primitives. * * These live in their own leaf module (no logger/db/server imports) so both * server-side detection code (`cli-patterns.ts`, which re-exports them) and * client components (the terminal display normalizer, Issue #1172) can share the * exact same tested pattern without pulling Node-only modules into the browser * bundle. * * Covers: * - SGR sequences: ESC[Nm (colors, bold, underline, etc.) * - OSC sequences: ESC]...BEL and ESC]...ST (ESC \\) - window title, and the * OSC 8 hyperlinks that claude/codex/copilot emit (Issue #1912). Also * available on its own as {@link stripOsc} (Issue #2369), for a consumer that * renders SGR and must not render OSC. * - CSI sequences: ESC[...letter (cursor movement, erase, etc.) * * Known limitations (SEC-002): 8-bit CSI (0x9B), DEC private modes (ESC[?25h), * character-set switching (ESC(0), and some RGB color forms may not match. In * practice tmux capture-pane output rarely contains these. */ /** {@link OSC_SOURCE} as a reusable global pattern. */ export declare const OSC_PATTERN: RegExp; export declare const ANSI_PATTERN: RegExp; /** Remove all ANSI escape sequences from a string. */ export declare function stripAnsi(str: string): string; /** * Remove OSC sequences only, leaving SGR (colour) and CSI untouched. * * For OSC 8 hyperlinks — `ESC ] 8 ; ; ST