eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
1 lines • 896 B
JavaScript
import{sessionHookTokens}from"#execution/session/hook-tokens.js";var SessionStateCursor=class{sessionWritable;inbox;currentSerializedContext;currentSessionState;constructor(e){this.inbox=e.inbox,this.sessionWritable=e.sessionWritable,this.currentSerializedContext=e.serializedContext,this.currentSessionState=e.sessionState}get serializedContext(){return this.currentSerializedContext}get sessionState(){return this.currentSessionState}async apply(e){let t=e.serializedContext??this.currentSerializedContext,n=e.sessionState??this.currentSessionState;await this.inbox.claimSessionHooks(sessionHookTokens({serializedContext:t,sessionState:n})),this.currentSerializedContext=t,this.currentSessionState=n}createStepInput(e,t){return{...t,input:e,sessionWritable:this.sessionWritable,serializedContext:this.currentSerializedContext,sessionState:this.currentSessionState}}};export{SessionStateCursor};