@voxevolv/client 0.3.1 → 0.3.3

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/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to `@voxevolv/client` are recorded here.
4
4
 
5
+ ## 0.3.3 - 2026-09-17
6
+
7
+ - Add identified, revisioned transcript snapshots with `onTranscriptUpdated()` and `session.transcript`.
8
+ - Reconcile late finals, corrected text, interruption, and replay by message identity. Legacy callbacks remain available.
9
+
10
+ ## 0.3.2 - 2026-09-17
11
+
12
+ - Recover from agent loss even while the room remains connected, with a default three-minute recovery deadline.
13
+ - Restore the client handshake, tools, audio, and latest replacement context before reporting connected.
14
+ - Coalesce pending replacement context by key; superseded pending requests reject explicitly.
15
+ - Expose `autoRejoin.timeoutMs`; explicit `maxAttempts` remains an optional earlier limit.
16
+
5
17
  ## 0.3.1 - 2026-07-28
6
18
 
7
19
  - Treat a server-pushed `session.ending` event as a graceful hang-up: it marks
package/README.md CHANGED
@@ -26,7 +26,7 @@ Browsers without a build step can use the versioned bundle after publication:
26
26
  ```html
27
27
  <script type="module">
28
28
  import { RealtimeSession } from
29
- "https://cdn.jsdelivr.net/npm/@voxevolv/client@0.3.1/dist/browser/index.js";
29
+ "https://cdn.jsdelivr.net/npm/@voxevolv/client@0.3.2/dist/browser/index.js";
30
30
  </script>
31
31
  ```
32
32
 
@@ -47,8 +47,10 @@ const session = await RealtimeSession.create({
47
47
  },
48
48
  });
49
49
 
50
- session.onUserTranscript(({ text, final }) => renderUser(text, final));
51
- session.onAgentTranscript(({ text, final }) => renderAgent(text, final));
50
+ session.onTranscriptUpdated(message => {
51
+ // Replace this message by ID, including when it is interrupted.
52
+ renderMessage(message.messageId, message.role, message.text, message.final, message.interrupted);
53
+ });
52
54
  session.onError((event) => reportVoiceError(event.payload));
53
55
 
54
56
  await session.connect();
@@ -125,12 +127,41 @@ await session.connect({ waitForRemoteAudio: false });
125
127
 
126
128
  ## Recovery, rejoin, and connection quality
127
129
 
128
- Set `autoRejoin: true` to let the SDK own recovery after LiveKit exhausts its
129
- transport-level reconnect. Automatic recovery runs only after the session has
130
+ With `@voxevolv/client@0.3.2`, set `autoRejoin: true` to let the SDK recover
131
+ when an agent leaves, its worker changes, a context command times out, or LiveKit
132
+ exhausts its transport reconnect. Automatic recovery runs only after the session has
130
133
  connected successfully, never after an explicit `disconnect()`, `end()`, or
131
134
  terminal LiveKit removal. It waits for browser connectivity, obtains a fresh
132
135
  room token, and retries with bounded backoff.
133
136
 
137
+ Automatic rejoin has a default 180-second deadline, including time spent offline.
138
+ Use `autoRejoin: { timeoutMs: 180_000 }` to configure it; an explicit `maxAttempts`
139
+ can stop retries earlier. This renews the room connection for the **same session**.
140
+ It never creates a replacement assessment/session. `connected` is reported only
141
+ after the client hello (including tool handlers), agent readiness, remote audio
142
+ (unless opted out), and replacement-context restoration succeed.
143
+
144
+ The updated server protects replacement-worker startup with a three-minute
145
+ participant grace period. It restores up to the latest 200 committed transcript
146
+ messages within 100,000 UTF-8 bytes and skips the initial greeting on resume.
147
+ Uncommitted speech, raw audio, provider-internal state, and tool executions are
148
+ not replayed. Recovery does not extend an application's timer or the session's
149
+ configured maximum duration.
150
+
151
+ Use stable keys and `mode: "replace"` for screen frames and timer snapshots.
152
+ Only one update per key is sent at a time; while recovering, the newest pending
153
+ value replaces older pending values. Superseded callers reject with
154
+ `Context update superseded by a newer value`, so handle each returned promise.
155
+ The SDK retains up to 64 keys / 16 MiB of recent replacement context for recovery;
156
+ it restores accepted values with `respond: false`. Append updates are not queued
157
+ or replayed during recovery because repeating them could duplicate input. Updates
158
+ already in flight may have reached the server even if their acknowledgment was lost.
159
+
160
+ Keep the existing `RealtimeSession` instance during recovery, register tools on
161
+ that instance, and use `onStateChange` / `onRecovery` for UI. Avoid application
162
+ retry loops that create new sessions. Older clients remain API-compatible but
163
+ need the SDK upgrade to gain agent-loss detection and context restoration.
164
+
134
165
  ```ts
135
166
  session.onStateChange((state) => {
136
167
  // reconnecting: LiveKit is restoring transport