import { MessageObject } from '../types/memory.js'; /** * Flattens a stored message's content into prompt text. * * `MessageContentObject.parts` is `unknown[]` and its shape depends on * `content.type` — `"text"` holds plain strings, while `"rich"`/`"document"` * hold {@link MessagePart} OBJECTS. Model providers must never hand one of * those objects to a chat API as `content`: OpenAI-compatible endpoints reject * the whole request with `400 Invalid type for 'messages[N].content'`, which * breaks every later turn in the thread because the message is persisted. * * Document parts render as a short label only. The body is not inlined here — * `injectAttachedDocuments` resolves it to fresh text once per turn, so * embedding a (possibly stale) copy per history entry would duplicate it. * * Total function: returns `""` for empty, unknown or malformed content rather * than leaking a non-string value. */ declare function messageToPromptText(message: MessageObject): string; export { messageToPromptText };