UNPKG

eve

Version:

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

1 lines • 793 B
import{parseJsonObject}from"#shared/json.js";import{normalizePresentationText}from"#shared/presentation-text.js";import{createRuntimeActionRequestFromToolCall}from"#harness/coordination.js";function createPresentedRuntimeActionRequestFromToolCall(e){let t=createRuntimeActionRequestFromToolCall(e),n=e.tools.get(e.toolCall.toolName)?.label?.start;if(n===void 0)return{action:t};try{let e=normalizePresentationText(n(parseJsonObject(t.input)));return e===``?{action:t}:{action:t,presentationLabel:e}}catch{return{action:t}}}function collectActionPresentation(e){let t=Object.fromEntries(e.flatMap(({action:e,presentationLabel:t})=>t===void 0?[]:[[e.callId,{label:t}]]));return Object.keys(t).length===0?void 0:t}export{collectActionPresentation,createPresentedRuntimeActionRequestFromToolCall};