UNPKG

eve

Version:

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

1 lines 543 B
import{ChannelInstrumentationKey}from"#context/keys.js";import{ChannelKey}from"#runtime/sessions/runtime-context-keys.js";import{buildChannelInstrumentationProjection}from"#channel/instrumentation.js";function setChannelContext(e,t,n={}){let r=e.get(ChannelInstrumentationKey),i=buildChannelInstrumentationProjection({adapter:t,channelName:n.channelName,existingKind:r?.kind});e.set(ChannelKey,t),e.set(ChannelInstrumentationKey,{...i,metadata:t.instrumentation?.metadata===void 0&&r!==void 0?r.metadata:i.metadata})}export{setChannelContext};