UNPKG

eve

Version:

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

1 lines 1.07 kB
import{stampDefinitionKey}from"#internal/authored-definition/source-identity.js";const ALLOWED_DYNAMIC_TOOL_EVENTS=new Set([`session.started`,`turn.started`,`step.started`]),ALLOWED_DYNAMIC_INSTRUCTION_EVENTS=new Set([`session.started`,`turn.started`]),ALLOWED_DYNAMIC_SKILL_EVENTS=new Set([`session.started`,`turn.started`]),ALLOWED_DYNAMIC_CONNECTION_EVENTS=new Set([`session.started`,`turn.started`]),DYNAMIC_SENTINEL_KIND=`eve:dynamic`;function defineDynamic(e){let t={kind:DYNAMIC_SENTINEL_KIND,events:e.events};return stampDefinitionKey(t,`dynamic:${Object.keys(e.events).join(`,`)}`),t}function assertResolverOnlyDynamicSentinel(e,t){let n=Object.keys(e).filter(e=>e!==`events`&&e!==`kind`);if(n.length>0)throw Error(`${t} Unknown key(s): ${n.join(`, `)}.`)}function isDynamicSentinel(e){return typeof e==`object`&&!!e&&e.kind===`eve:dynamic`}export{ALLOWED_DYNAMIC_CONNECTION_EVENTS,ALLOWED_DYNAMIC_INSTRUCTION_EVENTS,ALLOWED_DYNAMIC_SKILL_EVENTS,ALLOWED_DYNAMIC_TOOL_EVENTS,DYNAMIC_SENTINEL_KIND,assertResolverOnlyDynamicSentinel,defineDynamic,isDynamicSentinel};