eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
2 lines • 703 B
JavaScript
import{cardChildToFallbackText}from"#compiled/chat/index.js";import{cardToSlackBlocks}from"#compiled/@chat-adapter/slack/blocks.js";function cardToBlocks(e){return cardToSlackBlocks({...e,children:e.children.map(preserveLinkActionId)})}function cardToFallbackText(t){let n=[];t.title&&n.push(t.title),t.subtitle&&n.push(t.subtitle);for(let r of t.children){let t=cardChildToFallbackText(r);t&&n.push(t)}return n.join(`
`).trim()}function preserveLinkActionId(e){return e.type===`section`?{...e,children:e.children.map(preserveLinkActionId)}:e.type===`actions`?{...e,children:e.children.map(e=>e.type===`link-button`&&e.id===void 0?{...e,id:`link:${e.url}`}:e)}:e}export{cardToBlocks,cardToFallbackText};