UNPKG

eve

Version:

Filesystem-first framework for durable backend AI agents that run anywhere.

2 lines • 703 B
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(e){let t=[];e.title&&t.push(e.title),e.subtitle&&t.push(e.subtitle);for(let n of e.children){let e=cardChildToFallbackText(n);e&&t.push(e)}return t.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};