/** * Leading-frame → `ChatStreamEvent` table — the ONE mapping both transports read. * * The SSE decoder (`./decode.ts`) reaches it while walking the hub's byte * framing. The NATS decoder (`./nats-decoder.ts`) reaches it for `GUIDE` chunks * carrying a `payload`: the saas-ai-agent re-streams the Product Guide's hub * frames VERBATIM into the Mingo chunk stream (`GuideStreamingService`), so the * bytes a guide answer is made of are the same frames on both transports — only * the envelope differs. Decoding them twice would drift the moment the hub adds * a frame kind, which is why this table lives outside either decoder. * * The NATS side does NOT take every event this table can produce; see * `guideFrameEvent` in `./nats-decoder.ts` for which ones cross over and why. * * 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; /** * 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: any, out: ChatStreamEvent[]): void; //# sourceMappingURL=leading-frames.d.ts.map