import type { DurableSessionState } from "#execution/durable-session-store.js"; import type { SessionHistoryStepState, SessionStepState } from "#execution/publish-session-events.js"; import { type SessionStateTransition, type SessionStateValues } from "#execution/session/state-delta.js"; import type { SessionInboxOwnership } from "#execution/session-inbox/inbox.js"; import type { HarnessModelMessage } from "#harness/messages.js"; /** * The one set of session values owned by the workflow executing a session. * Steps run against it and return deltas; the cursor applies each to the * values its step was given and claims any continuation address the step * introduced, so every hook the session answers to is registered before the * next step runs. */ export declare class SessionStateCursor { readonly sessionWritable: WritableStream; private readonly inbox; private values; constructor(input: SessionStateValues & { readonly inbox: Pick; readonly sessionWritable: WritableStream; }); get serializedContext(): Record; get sessionState(): DurableSessionState; get history(): HarnessModelMessage[]; /** * Runs a session-changing step against the current context and session * state and adopts the delta it returns. The step is not given the history, * which is the bulk of a long session, so its Workflow step input stays * small; it cannot change the history either. */ advance(step: (state: SessionStepState) => Promise): Promise; /** {@link advance} for a step that reads or changes the history, such as a turn. */ advanceWithHistory(step: (state: SessionHistoryStepState) => Promise): Promise; /** * A delta describes a change to exactly the values its step was given, so * values that another step changed in the meantime are a sequencing bug, * never a merge. */ private adopt; }