eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
32 lines (31 loc) • 1.66 kB
TypeScript
import type { DurableSessionState } from "#execution/durable-session-store.js";
import type { SessionInboxOwnership } from "#execution/session-inbox/inbox.js";
import type { TurnStepInput, TurnStepPayload } from "#execution/session/turn-step-types.js";
/** A durable-state transition; absent fields keep the cursor's current value. */
export interface SessionStateTransition {
readonly serializedContext?: Record<string, unknown>;
readonly sessionState?: DurableSessionState;
}
/**
* The one mutable serialized-context / session-state pair owned by the
* workflow executing a session. Steps return transitions; the cursor adopts
* them and claims any continuation address a step introduced, so every hook
* the session answers to is registered before the next step runs.
*/
export declare class SessionStateCursor {
readonly sessionWritable: WritableStream<Uint8Array>;
private readonly inbox;
private currentSerializedContext;
private currentSessionState;
constructor(input: {
readonly inbox: Pick<SessionInboxOwnership, "claimSessionHooks">;
readonly sessionWritable: WritableStream<Uint8Array>;
readonly serializedContext: Record<string, unknown>;
readonly sessionState: DurableSessionState;
});
get serializedContext(): Record<string, unknown>;
get sessionState(): DurableSessionState;
/** Applies a transition after claiming every continuation address it introduced. */
apply(transition: SessionStateTransition): Promise<void>;
createStepInput(input: TurnStepPayload | undefined, signals: Pick<TurnStepInput, "abortSignal" | "steeringSignal">): TurnStepInput;
}