eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
1 lines • 1.21 kB
JavaScript
import{createInstrumentationDispatcher}from"#instrumentation/dispatch.js";function sessionIdempotencyKey(e){return`session:${e}`}function turnIdempotencyKey(e,t){return`turn:${e}:${t}`}function attemptIdempotencyKey(e){return`step:${e.attemptId}`}function modelCallIdempotencyKey(e,t){return`model:${e.attemptId}:${String(t)}`}function toolCallIdempotencyKey(e,t,n){return`tool:${e.attemptId}:${t}:${String(n)}`}function inputIdempotencyKey(e,t,n){return`input:${e}:${t}:${n}`}function channelDeliveryIdempotencyKey(e,t){return`channel-delivery:${e}:${t}`}function actionIdempotencyKey(e,t,n){return`action:${e}:${t}:${n}`}const INSTRUMENTATION_PRINCIPAL_TYPES=[`anonymous`,`app`,`local-dev`,`none`,`other`,`runtime`,`service`,`unknown`,`user`];function isInstrumentationPrincipalType(e){return INSTRUMENTATION_PRINCIPAL_TYPES.some(t=>t===e)}function createInstrumentationHooks(e,t={}){return createInstrumentationDispatcher(e,t)}export{INSTRUMENTATION_PRINCIPAL_TYPES,actionIdempotencyKey,attemptIdempotencyKey,channelDeliveryIdempotencyKey,createInstrumentationHooks,inputIdempotencyKey,isInstrumentationPrincipalType,modelCallIdempotencyKey,sessionIdempotencyKey,toolCallIdempotencyKey,turnIdempotencyKey};