# `T3.RPC.Cursor`
[🔗](https://github.com/dl-alexandre/t3-elixir/blob/main/lib/t3/rpc/cursor.ex#L1)

Extract T3 orchestration resume sequences without interpreting event bodies.

`sequence/1` reads an event's `sequence`, a thread snapshot's
`snapshotSequence`, or a shell snapshot's nested `snapshotSequence`. Arrays
return their highest eligible sequence. Unknown event bodies still advance a
cursor. Missing/invalid sequence fields and completion markers return `nil`.

Project-enrichment shell snapshots marked `resolvedRepositoryIdentityRoots`
are always ignored: their high-water may precede replayed events on the wire.
Advancing from that marker can skip replay if a consumer crashes partway.

`advance/2` is monotonic. Commit the result only after consuming the entire
chunk (and, for durable consumers, storing the corresponding application
changes). A cursor alone does not make T3 replay durable: the server can fall
back to a current-state snapshot when history is pruned or over its replay
budget. Scope stored cursors to the environment and subscription/filter set.

# `t`

```elixir
@type t() :: non_neg_integer() | nil
```

# `advance`

```elixir
@spec advance(t(), term()) :: t()
```

Advance an existing cursor after consuming items; never moves backwards.

# `sequence`

```elixir
@spec sequence(term()) :: t()
```

Return the highest resumable sequence in a stream item or chunk array.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
