eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
1 lines • 620 B
JavaScript
import{createLogger}from"#internal/logging.js";import{parseActivityBatchV1}from"#protocol/activity.js";import{postSessionCallbackRequest}from"#execution/session-callback-request.js";const log=createLogger(`execution.activity-submit`);async function submitActivity(e){if(e.sink!==void 0&&e.events.length!==0)try{let t=parseActivityBatchV1({events:e.events,version:1});if(t===void 0)return;let n=await postSessionCallbackRequest({body:t,logFailures:!1,timeoutMs:2e3,url:e.sink.url});if(!n.ok)throw Error(`Activity sink failed with HTTP ${n.status}.`)}catch{log.warn(`activity sink request failed`)}}export{submitActivity};