Skip to content
Developer Preview

Turn

A turn, as a CONSUMER sees it — the turn surface and nothing else.

Class in muse_code

Session.turn() and send_user_turn() advertise THIS rather than the concrete TurnHandle so the “fed by Session” mutators (settle_completed, push_item, fail, …) are not part of the consumer contract: an embedder calling one would fabricate a terminal the server never authored. Python cannot hide them at runtime the way the TS Turn interface does, so the seal is the return annotation plus this documented surface — the same convention the fold’s read views use.

Property Type Description
turn_id str The wire turn id.
observed_start bool Did THIS session observe a turn/started? Not a launch marker.
completed Awaitable[TurnOutcome] The turn-wait; settles on a server-authored fact.
Method Signature Description
items items() -> AsyncIterator[FoldedItem] This turn’s items: folded backlog, then the live tail.
deltas deltas() -> AsyncIterator[ItemDeltaParams] This turn’s item/delta frames, live only.
Source

clients/sdk-py/src/muse_code/facade/turn_handle.py:405