/** * Rendering message parts as the flat text a human or a model reads. * * One renderer, so a new core part kind is legible on every surface at once or on none — the * copied-out expression it replaces broke on `artifact` in three places the same way, rendering it * as an empty string rather than anything a reader could notice. * * It reaches only the three surfaces that call it (the connector inbox, `cotal join`, the mesh * view). Four others still carry their own copy — two stringify, two filter non-text parts out * before mapping — and a fix here cannot reach a surface whose defect is that it does not use this. */ import type { Part } from "./types.js"; import { type Extension } from "./registry.js"; /** * A renderer for ONE extension part kind — an {@link Extension} of kind `"part-renderer"`, whose * `name` is the part kind it draws (e.g. `"ag-ui.frame"`). * * **THIS IS A SEAM, NOT KNOWLEDGE.** Core cannot render an extension's part: it does not know what * the payload means, and `AGENTS.md` is explicit that an adapter's concepts must not leak in here. * But the alternative that was shipping — every extension part rendering as a marker on every * surface — means an extension can put a part on the wire that **nothing in the standard can ever * display.** So core declares the contract and stays ignorant of who fills it, exactly as * {@link TerminalLayout} does for terminal backends: the provider self-registers on import, and the * consumer here resolves by kind without ever importing the extension package. * * **THE MARKER IS NOT REMOVED, AND THAT MATTERS.** A kind with no registered renderer still renders * `[unrenderable part kind …]`. This makes the marker RARER; it does not make absence quiet again. */ export interface PartRenderer extends Extension { readonly kind: "part-renderer"; /** The part kind this draws — the `kind` field of the parts it is resolved for. */ readonly name: string; render(part: Part): string; } /** A message's parts as one flat string, space-joined. */ export declare function partsToText(parts: readonly Part[]): string; //# sourceMappingURL=parts.d.ts.map