@anam-ai/agent-widget 0.6.0 → 0.6.1-alpha.1

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
@@ -112,6 +112,26 @@ The widget merges configuration from three sources (highest priority wins):
112
112
  3. **During session:** Real-time video avatar with voice input, optional text input, and mute controls
113
113
  4. **On close:** Stops the stream and cleans up resources
114
114
 
115
+ ### Startup recovery
116
+
117
+ Startup has a 45-second deadline through token acquisition and usable video
118
+ playback. If it expires, the widget shows network guidance and emits
119
+ `anam-agent:error` with code `STARTUP_TIMEOUT`. The existing retry control
120
+ starts a new attempt. Closing or removing the widget also cancels startup.
121
+
122
+ An abandoned attempt stops its own SDK client, including sessions allocated
123
+ after cancellation. If signalling never became ready, it sends a best-effort
124
+ `POST /api/sessions/:id/release` to `api-base-url` with the original session
125
+ token in the Authorization header and no cross-origin cookies. Same-origin
126
+ preview requests retain their deployment-gateway cookie. The server verifies that
127
+ the token created that exact session. Tokens are never included in widget
128
+ events or logs. A late callback cannot change the replacement call.
129
+
130
+ Deploy the companion Lab release endpoint with widget support and CORS before
131
+ publishing this package. Verify the alpha package in Build preview before
132
+ publishing stable for customer embeds. Existing pinned package versions keep
133
+ their current behavior until upgraded.
134
+
115
135
  ## Events
116
136
 
117
137
  The widget dispatches custom DOM events on the `<anam-agent>` element:
@@ -242,6 +262,15 @@ Builds and serves at `http://localhost:4173/playground/preview.html` using the U
242
262
  pnpm typecheck
243
263
  ```
244
264
 
265
+ ### Tests
266
+
267
+ ```bash
268
+ pnpm test
269
+ ```
270
+
271
+ The lifecycle suite covers deadline expiry, cancellation during token minting,
272
+ late engine allocation, stale callbacks after retry, and playback failure.
273
+
245
274
  ### Lint
246
275
 
247
276
  ```bash