/** * Leading-frame → `ChatStreamEvent` table — the ONE mapping both transports read. * * The SSE decoder (`./decode.ts`) reaches it while walking the hub's byte * framing. It lives outside that decoder so a second transport can reuse the * table rather than re-implement it and drift the moment the hub adds a frame * kind. * * Server-safe: no React, no browser APIs. */ import type { ChatStreamEvent } from './events'; /** * Escape `<` so markdown renderers that pass HTML through (rehypeRaw) * don't treat XML-like tokens in Claude's thinking output as elements. * `<` → `<` preserves the visible character without breaking * blockquote `>` markers. Per-character, so it distributes over * concatenation: escape(a + b) === escape(a) + escape(b) — callers may * apply it per-delta or on the accumulated string interchangeably. */ export declare function escapeThinkingTags(text: string): string; /** Wire number field, or `undefined` for anything else. Exported because the * SSE decoder's TRAILING usage frame must coerce its token counts through the * same gate this table already applies to the LEADING `usage:start` frame — * two gates would be two contracts for one wire field. */ export declare function frameNum(value: unknown): number | undefined; /** * Map one parsed leading frame to normalized events, replicating the * legacy parser's else-if chain ORDER and its exact truthiness/typeof * gates. Frames that matched a branch but failed its inner validation * (e.g. `routing` without a string `routedComplexity`) produce NO event, * exactly like the legacy no-op. * * Every branch pushes AT MOST ONE event — `guideFrameEvent` relies on that * to hand a single event back to `decodeNatsChunk`'s per-chunk contract. */ export declare function mapLeadingFrame(meta: Record, out: ChatStreamEvent[]): void; //# sourceMappingURL=leading-frames.d.ts.map