UNPKG

eve

Version:

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

1 lines 839 B
import{EVE_ATTRIBUTE_VALUE_MAX_BYTES,normalizeEveAttributes,truncateForTag}from"#runtime/attributes/normalize.js";import"#internal/workflow/builtins.js";let WARNED_ABOUT_TAG_FAILURE=!1;async function setEveAttributes(e){let t=normalizeEveAttributes(e);if(Object.keys(t).length!==0)try{let{setAttributes:e}=await import(`#compiled/@workflow/core/index.js`);await e(t,{allowReservedAttributes:!0})}catch(e){if(isTerminalRunAttributeError(e))return;WARNED_ABOUT_TAG_FAILURE||(WARNED_ABOUT_TAG_FAILURE=!0,console.warn(`[eve] setEveAttributes failed; suppressing further warnings this process.`,{keys:Object.keys(t),error:e.message}))}}function isTerminalRunAttributeError(e){return e instanceof Error&&e.message.startsWith(`Cannot set attributes on run in terminal state`)}export{EVE_ATTRIBUTE_VALUE_MAX_BYTES,setEveAttributes,truncateForTag};