eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
1 lines • 578 B
JavaScript
import{contextStorage}from"#context/container.js";import{rememberInstrumentationBackgroundTaskForCall}from"#instrumentation/state.js";import{publishBackgroundTaskSettlements}from"#instrumentation/native-events.js";function createBackgroundTaskInstrumentation(e){return{publishBackgroundTaskSettlements:t=>publishBackgroundTaskSettlements({...t,hooks:e.hooks()}),rememberBackgroundTasks:t=>{contextStorage.run(e.ctx,()=>{for(let n of t)n.callId!==void 0&&rememberInstrumentationBackgroundTaskForCall(e.sessionId,n.callId,n.taskId)})}}}export{createBackgroundTaskInstrumentation};