Skip to content
Developer Preview

SessionFoldView

The fold as a consumer may READ it — the TS SessionFoldView allowlist.

Class in muse_code

Session.fold returns the concrete SessionFold, but this narrow type is what the consumer contract advertises: the fold’s own mutators (apply, mark_ephemeral_host_death, gap_filled) are hazardous in a consumer’s hands — apply would fold an event while skipping turn routing and the discard latch, and gap_filled would report a hole closed that nothing filled — so they stay off the read surface. The same seal turn() gets from the Turn protocol.

Property Type Description
items FoldItems Items, snapshot-only: the mutators are apply()’s, not yours.
session_state FoldSessionState The session-state families, keyed by notification method name.
active_turn_id str | None The turn currently running, if one is.
pending_gap Mapping[str, str] | None The outstanding delivery hole, or None.
current bool Is this fold current with the session view?
Method Signature Description
turns turns() -> list[TurnEntry] Turns in first-observed order.
turn turn(turn_id: str) -> TurnEntry | None One turn’s entry, or None if the fold never observed it.
pending_approvals pending_approvals() -> list[PendingApproval] Approvals awaiting a durable terminal, in first-observed order.
resolved_approvals resolved_approvals() -> list[Params] The winning durable terminal per approval, in first-observed order.
pending_user_inputs pending_user_inputs() -> list[Params] Prompts awaiting a durable settlement, in first-observed order.
settled_user_inputs settled_user_inputs() -> list[Params] The winning durable settlement per prompt, in first-observed order.
Source

clients/sdk-py/src/muse_code/facade/session.py:103