openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
13 lines (12 loc) • 406 B
JavaScript
//#region src/agents/content-blocks.ts
function isTextContentBlock(e) {
if (!e || typeof e !== "object") return false;
const t = e;
return t.type === "text" && typeof t.text === "string";
}
function collectTextContentBlocks(e) {
if (!Array.isArray(e)) return [];
return e.filter(isTextContentBlock).map((e) => e.text);
}
//#endregion
export { isTextContentBlock as n, collectTextContentBlocks as t };