@opengeni/sdk 0.15.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -44,12 +44,55 @@ contiguous `sequence` number:
44
44
  - Ends gracefully when the provided `AbortSignal` aborts; throws on
45
45
  non-retryable failures (e.g. 401/403/404).
46
46
 
47
- Use `client.listEvents(workspaceId, sessionId, { before, after, limit })` for
48
- durable replay pages. `before` is an exclusive sequence cursor that returns the
49
- newest matching page, still ordered ascending in the response. Pass
50
- `compact: true` for history windows that do not need individual delta fragments;
51
- delta runs may be coalesced and expose `payload.coalescedUntil` as the true last
52
- sequence for stream resume cursors.
47
+ Use `client.listEventPage(...)` when monitoring another session. A call without
48
+ a cursor is safe by default: it returns a newest-first-selected (but
49
+ ascending-in-response) semantic tail, uses bounded `summary` payloads, and omits
50
+ raw message/reasoning/command/PTY deltas. The page returns exact
51
+ `coveredSequence`, `nextBefore`/`nextAfter`, byte, truncation, and projection
52
+ metadata. Filters can select canonical event types or the `control`, `terminal`,
53
+ `failure`, `checkpoint`, `tool_receipt`, and `provider_account` semantic classes;
54
+ `latest` is an exclusive typed lookup that returns the newest event in exactly
55
+ the requested class. It cannot be combined with any type or class include/exclude
56
+ filter, so an unrelated newer event cannot displace the requested result and an
57
+ exclusion cannot remove it.
58
+
59
+ For callback-loss recovery, `latest` selects authoritative current/legacy rows
60
+ by durable session `sequence` across distinct turns; explicit `late_rejected` and
61
+ `duplicate` callbacks never compete with current truth. `turnGeneration` remains
62
+ metadata and is interpreted only within its turn/retry scope. Use
63
+ `resultMode: "compact"` to receive one bounded result-bearing completion,
64
+ failure, checkpoint, or receipt without creating another model turn. The
65
+ `receipt` spelling aliases `tool_receipt`, and a missing event returns `null`.
66
+ The compact result includes exact source/generation/covered-sequence facts and
67
+ bounded text/output/result/failure/checkpoint/receipt values. Retained-output
68
+ storage and full-evidence retrieval are separate contracts from this event
69
+ projection.
70
+
71
+ ```ts
72
+ const terminal = await client.listEventPage(workspaceId, sessionId, {
73
+ latest: "terminal",
74
+ payloadMode: "summary",
75
+ });
76
+
77
+ const recovered = await client.getLatestEventResult(workspaceId, sessionId, {
78
+ latest: "terminal",
79
+ });
80
+
81
+ const older = await client.listEventPage(workspaceId, sessionId, {
82
+ before: terminal.nextBefore ?? undefined,
83
+ includeClasses: ["failure", "checkpoint"],
84
+ payloadMode: "none",
85
+ });
86
+ ```
87
+
88
+ Use explicit `mode: "forensic", payloadMode: "full"` with `after`/`before` for
89
+ exact retained audit replay. “Full” means the exact durable audit projection;
90
+ it cannot restore source bytes that the audit boundary never retained. REST/SDK
91
+ pages remain count- and byte-bounded, so continue with the returned cursor. The
92
+ convenience `client.listEvents(...)` returns only the page's event array. Pass
93
+ `compact: true` for forensic history windows that do not need individual delta
94
+ fragments; delta runs may be coalesced and expose `payload.coalescedUntil` as
95
+ the true last sequence for stream resume cursors.
53
96
 
54
97
  ```ts
55
98
  const controller = new AbortController();