@sema-agent/core
Version:
Stateless, task-oriented AI agent core
17 lines (16 loc) • 1.1 kB
TypeScript
/**
* The shared text rendering of a content block, for model-facing readers that show a block with its MIME type: a text block is
* its own text; any other block is its marker — `[image: image/png]`, `[document: application/pdf]`, `[<type>]` — never
* its payload. Readers: the `tool_end.output` projection's cut block, the observer digest, the sub-agent step outcome,
* the auto-mode classifier window and the user-attachment view. The standalone compaction summarizer's
* message flatten (`serializeConversation` in `src/engine/compaction/utils.ts`) renders bare `[image]` /
* `[document]` markers without MIME types; the host-facing post-tool-batch digest omits non-text blocks.
* A leaf module (no imports); consumers outside `src/engine` reach it through the `src/internal/llm.ts` facade.
*/
/** A text block: `{ type: "text", text: string }`. */
export declare const isTextBlock: (b: unknown) => b is {
type: "text";
text: string;
};
/** The block as text: a text block's text, any other block's marker. */
export declare const renderContentBlock: (b: unknown) => string;