@voxevolv/client 0.3.4 → 0.3.6

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,32 @@
2
2
 
3
3
  All notable changes to `@voxevolv/client` are recorded here.
4
4
 
5
+ ## 0.3.6 - 2026-09-23
6
+
7
+ - Enable initial connection retries by default for both `RealtimeSession` and
8
+ `RealtimeSession.create()`. Omitted `startupRetry` uses the existing three-attempt
9
+ policy with a 65-second overall deadline.
10
+ - Set `startupRetry: false` to retain a single startup attempt and its configured
11
+ `connect({ readyTimeoutMs })` budget. Explicit `true` and custom policies remain supported.
12
+
13
+ ## 0.3.5 - 2026-09-23
14
+
15
+ - Preserve global client command order across concurrent context keys and prevent
16
+ timer updates from being overtaken by screen updates at the LiveKit publish boundary.
17
+ - Add opt-in SDK-owned initial connection recovery with three default attempts,
18
+ increasing 15/20/25-second readiness budgets, bounded delays, and a 65-second
19
+ overall startup deadline.
20
+ - Renew the same session's room token between startup attempts while keeping
21
+ intermediate failures nonterminal.
22
+ - Add `onStartupAttempt()` progress events for connecting and retrying UI.
23
+ - Stop startup retry on terminal HTTP, session, microphone, and audio errors;
24
+ preserve one configured credential refresh after `401` and honor explicitly
25
+ retryable `session.error` events.
26
+ - Preserve caller options across startup attempts, retry transient network
27
+ failures, and enforce the startup deadline during token renewal.
28
+ - Keep explicit startup cancellation disconnected and deliver command timeouts
29
+ even when an earlier command is still waiting to publish.
30
+
5
31
  ## 0.3.4 - 2026-09-22
6
32
 
7
33
  - Add a typed `trigger` and safe command correlation fields to every recovery event.
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.4/dist/browser/index.js";
29
+ "https://cdn.jsdelivr.net/npm/@voxevolv/client@0.3.6/dist/browser/index.js";
30
30
  </script>
31
31
  ```
32
32
 
@@ -125,6 +125,66 @@ Applications that intentionally run without agent audio can opt out:
125
125
  await session.connect({ waitForRemoteAudio: false });
126
126
  ```
127
127
 
128
+ ## Initial connection retries
129
+
130
+ Startup retries are enabled by default in SDK 0.3.6 for both `new RealtimeSession()`
131
+ and `RealtimeSession.create()`. Omit `startupRetry` or pass `true` to retry a
132
+ session that has not connected successfully yet. The default policy allows up to
133
+ three total attempts with 15, 20, and 25-second readiness budgets, waits one second
134
+ before attempt two and three
135
+ seconds before attempt three, and enforces a 65-second overall deadline. The
136
+ overall deadline also includes room connection, token renewal, microphone
137
+ publication, the client hello, and remote-audio readiness.
138
+
139
+ Set `startupRetry: false` in the constructor or `create()` options for a single
140
+ startup attempt using the `readyTimeoutMs` supplied through `connect()` or the
141
+ constructor defaults. This does not disable `autoRejoin` after a successful connection.
142
+
143
+ Attempt one uses the room token returned at session creation. Later attempts
144
+ obtain a fresh room token for the same VoxEvolv session ID. Intermediate
145
+ failures remain nonterminal; `connect()` rejects and the session enters
146
+ `failed` only when the attempts are exhausted, the overall deadline expires,
147
+ or a terminal error occurs.
148
+
149
+ ```ts
150
+ const session = await RealtimeSession.create({
151
+ endpoint: "/api/voice-session",
152
+ apiBase: "https://YOUR_VOXEVOLV_HOST/v1",
153
+ autoRejoin: true,
154
+ });
155
+
156
+ session.onStartupAttempt(({ status, attempt, maxAttempts, error }) => {
157
+ if (status === "started" && attempt > 1) {
158
+ renderConnectionStatus(`Retrying connection (${attempt}/${maxAttempts})…`);
159
+ }
160
+ if (status === "failed") recordStartupFailure(attempt, error);
161
+ });
162
+
163
+ await session.connect();
164
+ ```
165
+
166
+ Custom policies use explicit attempts. `delayBeforeMs` is the wait before that
167
+ attempt. When startup retry is enabled, each attempt's `readyTimeoutMs` replaces
168
+ the single timeout supplied through `connect()` or the constructor defaults.
169
+
170
+ ```ts
171
+ startupRetry: {
172
+ attempts: [
173
+ { readyTimeoutMs: 15_000 },
174
+ { delayBeforeMs: 1_000, readyTimeoutMs: 20_000 },
175
+ { delayBeforeMs: 3_000, readyTimeoutMs: 25_000 },
176
+ ],
177
+ timeoutMs: 65_000,
178
+ }
179
+ ```
180
+
181
+ The SDK does not retry invalid audio configuration, microphone permission or
182
+ device errors, non-retryable `session.error` events, or non-transient HTTP 4xx
183
+ responses such as `401`, `403`, and `409 Session has ended`. A configured
184
+ `refreshCredentials` callback still gets one opportunity to replace expired
185
+ credentials after a `401`. A `session.error` explicitly marked
186
+ `retryable: true` may advance to the next startup attempt.
187
+
128
188
  ## Recovery, rejoin, and connection quality
129
189
 
130
190
  With `@voxevolv/client@0.3.2` or newer, set `autoRejoin: true` to let the SDK recover
@@ -158,9 +218,9 @@ or replayed during recovery because repeating them could duplicate input. Update
158
218
  already in flight may have reached the server even if their acknowledgment was lost.
159
219
 
160
220
  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.
221
+ that instance, and use `onStateChange`, `onStartupAttempt`, and `onRecovery` for
222
+ UI. Avoid application retry loops that create new sessions. Older clients remain
223
+ API-compatible but need the SDK upgrade to gain these recovery behaviors.
164
224
 
165
225
  ```ts
166
226
  session.onStateChange((state) => {