@spatialwalk/avatarkit 1.0.0-beta.3 โ†’ 1.0.0-beta.30

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.
Files changed (96) hide show
  1. package/CHANGELOG.md +436 -0
  2. package/README.md +328 -138
  3. package/dist/StreamingAudioPlayer-CVqWInxw.js +398 -0
  4. package/dist/animation/AnimationWebSocketClient.d.ts +6 -24
  5. package/dist/animation/utils/eventEmitter.d.ts +0 -4
  6. package/dist/animation/utils/flameConverter.d.ts +3 -11
  7. package/dist/audio/AnimationPlayer.d.ts +5 -29
  8. package/dist/audio/StreamingAudioPlayer.d.ts +8 -66
  9. package/dist/avatar_core_wasm-i0Ocpx6q.js +2693 -0
  10. package/dist/avatar_core_wasm.wasm +0 -0
  11. package/dist/config/app-config.d.ts +4 -13
  12. package/dist/config/constants.d.ts +18 -11
  13. package/dist/config/sdk-config-loader.d.ts +2 -9
  14. package/dist/core/Avatar.d.ts +0 -15
  15. package/dist/core/AvatarController.d.ts +49 -109
  16. package/dist/core/AvatarDownloader.d.ts +0 -95
  17. package/dist/core/AvatarManager.d.ts +7 -18
  18. package/dist/core/AvatarSDK.d.ts +21 -0
  19. package/dist/core/AvatarView.d.ts +25 -119
  20. package/dist/core/NetworkLayer.d.ts +1 -0
  21. package/dist/generated/driveningress/v1/driveningress.d.ts +1 -12
  22. package/dist/generated/driveningress/v2/driveningress.d.ts +0 -3
  23. package/dist/generated/google/protobuf/struct.d.ts +5 -39
  24. package/dist/generated/google/protobuf/timestamp.d.ts +1 -103
  25. package/dist/index-FJY_63Bh.js +7912 -0
  26. package/dist/index.d.ts +1 -6
  27. package/dist/index.js +17 -17
  28. package/dist/renderer/RenderSystem.d.ts +1 -77
  29. package/dist/renderer/covariance.d.ts +0 -12
  30. package/dist/renderer/renderer.d.ts +0 -1
  31. package/dist/renderer/sortSplats.d.ts +0 -11
  32. package/dist/renderer/webgl/reorderData.d.ts +0 -13
  33. package/dist/renderer/webgl/webglRenderer.d.ts +3 -40
  34. package/dist/renderer/webgpu/webgpuRenderer.d.ts +3 -28
  35. package/dist/types/character-settings.d.ts +0 -5
  36. package/dist/types/character.d.ts +3 -21
  37. package/dist/types/index.d.ts +38 -18
  38. package/dist/utils/animation-interpolation.d.ts +3 -13
  39. package/dist/utils/client-id.d.ts +1 -0
  40. package/dist/utils/cls-tracker.d.ts +11 -0
  41. package/dist/utils/conversationId.d.ts +1 -0
  42. package/dist/utils/error-utils.d.ts +1 -25
  43. package/dist/utils/heartbeat-manager.d.ts +18 -0
  44. package/dist/utils/id-manager.d.ts +37 -0
  45. package/dist/utils/logger.d.ts +5 -11
  46. package/dist/utils/usage-tracker.d.ts +5 -0
  47. package/dist/vanilla/vite.config.d.ts +2 -0
  48. package/dist/wasm/avatarCoreAdapter.d.ts +11 -97
  49. package/dist/wasm/avatarCoreMemory.d.ts +5 -54
  50. package/package.json +16 -11
  51. package/dist/StreamingAudioPlayer-BeLlDiwE.js +0 -288
  52. package/dist/StreamingAudioPlayer-BeLlDiwE.js.map +0 -1
  53. package/dist/animation/AnimationWebSocketClient.d.ts.map +0 -1
  54. package/dist/animation/utils/eventEmitter.d.ts.map +0 -1
  55. package/dist/animation/utils/flameConverter.d.ts.map +0 -1
  56. package/dist/audio/AnimationPlayer.d.ts.map +0 -1
  57. package/dist/audio/StreamingAudioPlayer.d.ts.map +0 -1
  58. package/dist/avatar_core_wasm-DmkU6dYn.js +0 -1666
  59. package/dist/avatar_core_wasm-DmkU6dYn.js.map +0 -1
  60. package/dist/config/app-config.d.ts.map +0 -1
  61. package/dist/config/constants.d.ts.map +0 -1
  62. package/dist/config/sdk-config-loader.d.ts.map +0 -1
  63. package/dist/core/Avatar.d.ts.map +0 -1
  64. package/dist/core/AvatarController.d.ts.map +0 -1
  65. package/dist/core/AvatarDownloader.d.ts.map +0 -1
  66. package/dist/core/AvatarKit.d.ts +0 -60
  67. package/dist/core/AvatarKit.d.ts.map +0 -1
  68. package/dist/core/AvatarManager.d.ts.map +0 -1
  69. package/dist/core/AvatarView.d.ts.map +0 -1
  70. package/dist/generated/driveningress/v1/driveningress.d.ts.map +0 -1
  71. package/dist/generated/driveningress/v2/driveningress.d.ts.map +0 -1
  72. package/dist/generated/google/protobuf/struct.d.ts.map +0 -1
  73. package/dist/generated/google/protobuf/timestamp.d.ts.map +0 -1
  74. package/dist/index-NmYXWJnL.js +0 -9712
  75. package/dist/index-NmYXWJnL.js.map +0 -1
  76. package/dist/index.d.ts.map +0 -1
  77. package/dist/index.js.map +0 -1
  78. package/dist/renderer/RenderSystem.d.ts.map +0 -1
  79. package/dist/renderer/covariance.d.ts.map +0 -1
  80. package/dist/renderer/renderer.d.ts.map +0 -1
  81. package/dist/renderer/sortSplats.d.ts.map +0 -1
  82. package/dist/renderer/webgl/reorderData.d.ts.map +0 -1
  83. package/dist/renderer/webgl/webglRenderer.d.ts.map +0 -1
  84. package/dist/renderer/webgpu/webgpuRenderer.d.ts.map +0 -1
  85. package/dist/types/character-settings.d.ts.map +0 -1
  86. package/dist/types/character.d.ts.map +0 -1
  87. package/dist/types/index.d.ts.map +0 -1
  88. package/dist/utils/animation-interpolation.d.ts.map +0 -1
  89. package/dist/utils/error-utils.d.ts.map +0 -1
  90. package/dist/utils/logger.d.ts.map +0 -1
  91. package/dist/utils/posthog-tracker.d.ts +0 -82
  92. package/dist/utils/posthog-tracker.d.ts.map +0 -1
  93. package/dist/utils/reqId.d.ts +0 -20
  94. package/dist/utils/reqId.d.ts.map +0 -1
  95. package/dist/wasm/avatarCoreAdapter.d.ts.map +0 -1
  96. package/dist/wasm/avatarCoreMemory.d.ts.map +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,436 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.0.0-beta.30] - 2025-12-15
9
+
10
+ ### ๐Ÿ› Bugfix
11
+ - **Template Resources Duplicate Download** - Fixed issue where template resources were being re-downloaded for each new character load. Template resources are now only loaded once during SDK initialization and reused for all characters.
12
+
13
+ ## [1.0.0-beta.29] - 2025-12-15
14
+
15
+ ### ๐Ÿ”„ Breaking Changes
16
+ - **Environment Enum** - Removed `Environment.test`. Only `Environment.cn` and `Environment.intl` are now supported. Environment configuration must be explicitly provided.
17
+ - **Log Level Default** - Default log level changed from `LogLevel.all` to `LogLevel.off`. Set `logLevel: LogLevel.all` in configuration to enable all logs.
18
+
19
+ ### โœจ New Features
20
+ - **Avatar Caching** - Added avatar caching methods in `AvatarManager`:
21
+ - `retrieve(id: string): Avatar | undefined` - Get cached avatar by ID
22
+ - `clear(id: string): void` - Clear cached avatar for specific ID
23
+ - `clearAll(): void` - Clear all cached avatars
24
+ - `clearCache()` is now deprecated, use `clearAll()` instead
25
+ - **Background Image Support** - Added background image control in `AvatarView`:
26
+ - `isOpaque: boolean` - Getter/setter to control canvas background transparency
27
+ - `setBackgroundImage(image: HTMLImageElement | string | null): void` - Set or remove background image
28
+
29
+ ### ๐Ÿ”ง Improvements
30
+ - **Avatar Version Checking** - Avatar cache now automatically checks version and reloads if cached avatar version differs from latest metadata
31
+ - **Concurrent Loading** - Multiple concurrent `load()` calls for the same avatar ID now reuse the same loading promise
32
+
33
+ ## [1.0.0-beta.28] - 2025-12-08
34
+
35
+ ### ๐Ÿ”„ Breaking Changes
36
+ - **Class Renamed** - `AvatarKit` class has been renamed to `AvatarSDK` for better consistency
37
+ - Update all imports: `import { AvatarKit } from '@spatialwalk/avatarkit'` โ†’ `import { AvatarSDK } from '@spatialwalk/avatarkit'`
38
+ - Update all API calls: `AvatarKit.initialize()` โ†’ `AvatarSDK.initialize()`
39
+ - All static methods and properties remain the same, only the class name has changed
40
+
41
+ ### ๐Ÿ”ง Improvements
42
+ - **Rendering Optimizations** - Added fragment shader discard optimization to improve performance and edge quality
43
+ - **Shader Alignment** - Removed view matrix transpose to align with Android SDK implementation
44
+ - **Resource Cleanup** - Removed unused `frameMono` and `audioMono` resources from SDK and tests
45
+
46
+ ## [1.0.0-beta.27] - 2025-12-04
47
+
48
+ ### ๐Ÿ› Bugfix
49
+
50
+ ## [1.0.0-beta.26] - 2025-12-03
51
+
52
+ ### โœจ New Features
53
+ - **Log Level Configuration** - Added `logLevel` configuration option to control SDK logging verbosity
54
+ - `LogLevel.off` - Disable all logs
55
+ - `LogLevel.error` - Only error logs
56
+ - `LogLevel.warning` - Warning and error logs
57
+ - `LogLevel.all` - All logs (default)
58
+ - **Standardized CLS Logging Events** - All CLS logging events now use standardized field names for better querying
59
+ - Standard events: `sdk_initialized`, `send_audio_failed`, `message_error`, `heartbeat_failed`, `service_restarted`, `session_token_invalid`, `session_token_expired`, `yield_animation_failed`, `fetch_avatar_metadata_failed`, `download_avatar_assets_failed`
60
+ - Standard fields: `req_id`, `con_id`, `avatar_id`, `description`
61
+ - **End-to-End Latency Tracking** - Added `driving_latency` event to track latency metrics for both SDK and Host modes
62
+ - Tracks: `start`, `tap2`, `tap4`, `end`, `first_frame` timestamps
63
+ - Automatically reported at key moments during audio/animation processing
64
+
65
+ ### ๐Ÿ”ง Improvements
66
+ - **CLS Configuration Alignment** - Updated CLS endpoints and Topic IDs to match iOS SDK configuration
67
+ - **Default API Endpoints** - Fixed default API endpoint for `intl` environment to `api.intl.spatialwalk.cloud`
68
+ - **Error Code Enum** - Added new error codes: `appIDUnrecognized`, `sessionTokenInvalid`, `sessionTokenExpired`, `failedToFetchAvatarMetadata`, `failedToDownloadAvatarAssets`
69
+
70
+ ### ๐Ÿ—‘๏ธ Removed
71
+ - **Redundant Log Events** - Removed unnecessary log events: `playback_paused`, `playback_resumed`, `reconnecting`, `connect_success`, `server_error`, `decode_failed`
72
+
73
+ ## [1.0.0-beta.25] - 2025-12-03
74
+
75
+ ### ๐Ÿ”ง Improvements
76
+ - **Removed Audio Buffer Limit** - Removed the 100 chunk limit on pending audio buffers to allow unlimited audio data buffering
77
+
78
+ ## [1.0.0-beta.24] - 2025-11-26
79
+
80
+ ### ๐Ÿ”ง API Changes
81
+ - **Backend Endpoints Updated** - Backend API endpoints have been updated for all environments
82
+
83
+ ## [1.0.0-beta.23] - 2025-11-26
84
+
85
+ ### ๐Ÿ”ง API Changes
86
+ - **Breaking Change** - `playback()` method is no longer supported and has been removed from public API
87
+
88
+ ## [1.0.0-beta.22] - 2025-11-26
89
+
90
+ ### ๐Ÿ”ง API Changes
91
+ - **State Callback Renamed** - `onAvatarState` has been renamed to `onConversationState` for better clarity
92
+ - The callback now uses `ConversationState` enum with states: `idle` and `playing`
93
+ - **Environment Enum Updated** - `Environment.us` has been renamed to `Environment.intl` for better internationalization support
94
+ - All references to `Environment.us` should be updated to `Environment.intl`
95
+ - Remote config endpoints now use `intl` instead of `us`
96
+
97
+ ### โœจ New Features
98
+ - **Volume Control** - Added volume control API for audio playback
99
+ - `setVolume(volume: number)` - Set audio volume (0.0 to 1.0)
100
+ - `getVolume(): number` - Get current audio volume
101
+ - Volume control only affects the avatar's audio player, not system volume
102
+ - Volume changes take effect immediately, including for currently playing audio
103
+
104
+ ## [1.0.0-beta.21] - 2025-11-25
105
+
106
+ ### โœจ New Features
107
+ - **SDK Mode Connection Timeout Fallback** - Enhanced fallback mechanism for SDK mode:
108
+ - If WebSocket connection fails to establish within 15 seconds, the SDK automatically enters fallback mode
109
+ - In fallback mode, audio data can still be sent and will play normally, even though no animation data will be received
110
+ - Connection failures also trigger this fallback mechanism
111
+ - `ConnectionState.connecting` and `ConnectionState.failed` events are emitted to notify external applications
112
+ - Concurrent connection attempts are prevented to avoid race conditions
113
+
114
+ ### ๐Ÿ”ง Improvements
115
+ - Improved connection state management: `isConnected` now accurately reflects actual connection status (false in fallback mode)
116
+ - Added `canSend()` method in `NetworkLayer` to check if audio can be sent (including fallback mode)
117
+ - Better separation of concerns: connection state checks are now handled by `NetworkLayer`, while playback logic remains in `AvatarController`
118
+
119
+ ## [1.0.0-beta.20] - 2025-11-25
120
+
121
+ ### ๐Ÿ”ง Improvements
122
+ - Removed 1-second audio buffer requirement for auto-starting playback in Host mode
123
+
124
+ ## [1.0.0-beta.19] - 2025-11-25
125
+
126
+ ### ๐Ÿ“š Documentation
127
+ - **Fixed misleading documentation** - Corrected Host mode API documentation to accurately reflect that `yieldAudioData()` can be called directly to start a new session without requiring `playback()` first
128
+ - Removed misleading "after playback() is called" comments
129
+ - Clarified two ways to start a session: using `playback()` for existing data, or `yieldAudioData()` directly for streaming
130
+ - Updated all examples and workflow descriptions to reflect correct API usage
131
+
132
+ ## [1.0.0-beta.18] - 2025-11-25
133
+
134
+ ### ๐Ÿ”ง API Changes
135
+ - **Renamed `reqId` to `conversationId`** - Updated terminology for better clarity
136
+ - All methods and parameters that used `reqId` now use `conversationId`
137
+ - `getCurrentReqId()` โ†’ `getCurrentConversationId()`
138
+ - `generateReqId()` โ†’ `generateConversationId()`
139
+ - Updated all event logs and documentation to use `conversationId`
140
+ - Note: Protobuf protocol still uses `reqId` field name internally, but SDK API uses `conversationId`
141
+
142
+ ### ๐Ÿ“š Documentation
143
+ - Enhanced Host mode documentation to clearly emphasize the workflow: send audio data first to get conversationId, then use that conversationId to send animation data
144
+ - Updated Host Mode Example and Host Mode Flow sections with clearer step-by-step instructions
145
+
146
+ ## [1.0.0-beta.17] - 2025-11-24
147
+
148
+ ### โœจ New Features
149
+ - **Audio-Only Fallback Mechanism** - SDK now includes automatic fallback to audio-only playback when animation data is unavailable
150
+ - SDK mode: Automatically enters audio-only mode when server returns an error
151
+ - Host mode: Automatically enters audio-only mode when empty animation data is provided
152
+ - Once in audio-only mode, subsequent animation data for that session is ignored
153
+ - Fallback mode is interruptible, just like normal playback mode
154
+
155
+ ### ๐Ÿ”ง API Changes
156
+ - **Playback Mode Configuration** - Moved playback mode configuration from `AvatarView` constructor to `AvatarSDK.initialize()`
157
+ - Playback mode is now determined by `drivingServiceMode` in `AvatarSDK.initialize()` configuration
158
+ - `AvatarView` constructor now only requires `avatar` and `container` parameters
159
+ - Removed `AvatarViewOptions` interface
160
+ - `container` parameter is now required (no longer optional)
161
+ - **Method Renames** - Renamed methods in `AvatarController` for Host mode to better reflect their purpose
162
+ - `play()` โ†’ `playback()`: Renamed to better reflect that the method is used for playback of existing data (replay mode)
163
+ - Old API: `avatarController.play(initialAudioChunks, initialKeyframes)`
164
+ - New API: `avatarController.playback(initialAudioChunks, initialKeyframes)`
165
+ - `sendAudioChunk()` โ†’ `yieldAudioData()`: Renamed to better reflect that the method yields/streams audio data
166
+ - Old API: `avatarController.sendAudioChunk(data, isLast)`
167
+ - New API: `avatarController.yieldAudioData(data, isLast)`
168
+ - `sendKeyframes()` โ†’ `yieldFramesData()`: Renamed to better reflect that the method yields/streams animation keyframes
169
+ - Old API: `avatarController.sendKeyframes(keyframes, reqId)`
170
+ - New API: `avatarController.yieldFramesData(keyframes, conversationId)`
171
+
172
+ ### ๐Ÿ”ง Improvements
173
+ - Extended transition animation duration from 200ms to 400ms for smoother end-of-playback transitions
174
+
175
+ ### ๐Ÿ“š Documentation
176
+ - Updated README.md to use "SDK mode" and "Host mode" terminology instead of "Network mode" and "External data mode"
177
+ - Added fallback mechanism documentation
178
+ - Updated API reference to reflect new constructor signature
179
+
180
+ ## [1.0.0-beta.16] - 2025-11-21
181
+
182
+ ### โœจ New Features
183
+ - **Multi-AvatarView Support** - SDK now supports multiple `AvatarView` instances simultaneously
184
+ - Each `AvatarView` instance can manage its own character independently
185
+ - Multiple characters can be displayed and controlled at the same time
186
+ - Each instance maintains its own rendering context, playback state, and network connection
187
+ - Removed the previous limitation of "only one AvatarView instance at a time"
188
+
189
+ ### ๐Ÿ“š Documentation
190
+ - Updated README.md to reflect multi-character support capabilities
191
+ - Added multi-character usage examples
192
+ - Removed outdated limitation notes about single AvatarView instance
193
+
194
+ ---
195
+
196
+ ## [1.0.0-beta.15] - 2025-11-20
197
+
198
+ ### โœจ New Features
199
+ - Added authentication support for API requests
200
+ - `appId` is now automatically included in HTTP headers (`X-App-Id`) and WebSocket URL query parameters
201
+ - `sessionToken` is now automatically included in HTTP headers (`Authorization: Bearer {token}`) and WebSocket URL query parameters
202
+ - All network requests (character loading, resource downloads, WebSocket connections) now include authentication credentials
203
+
204
+ ### ๐Ÿ”ง Improvements
205
+ - Fixed canvas resize handling for different aspect ratios
206
+ - Projection matrix is now correctly updated when canvas aspect ratio changes
207
+ - Rendering system properly handles portrait (9:16) and landscape (16:9) aspect ratios
208
+ - Canvas automatically adapts to container size changes via ResizeObserver
209
+
210
+ ### ๐Ÿ› Bug Fixes
211
+ - Fixed `RenderSystem.handleResize()` to update projection matrix when canvas size changes
212
+ - Previously only updated aspect ratio, now also updates projection matrix for correct rendering
213
+
214
+ ---
215
+
216
+ ## [1.0.0-beta.14] - 2025-11-18
217
+
218
+ ### โœจ New Features
219
+ - Added pause and resume functionality for avatar playback
220
+ - New `pause()` method to pause audio and animation playback
221
+ - New `resume()` method to resume playback from paused state
222
+ - Added `paused` state to `AvatarState` enum
223
+ - State changes are communicated via `onAvatarState` callback
224
+ - Works in both network mode and external data mode
225
+
226
+ ### ๐Ÿ”ง Improvements
227
+ - Canvas now uses container's full dimensions instead of fixed 1:1 aspect ratio
228
+ - Canvas automatically adapts to container size (width and height)
229
+ - External developers can control canvas aspect ratio by setting container dimensions
230
+ - Rendering system correctly handles any aspect ratio without distortion
231
+
232
+ ---
233
+
234
+ ## [1.0.0-beta.13] - 2025-11-17
235
+
236
+ ### ๐Ÿ”’ API Improvements
237
+ - Reduced console noise by setting default log level to Warning
238
+ - Logger now only outputs warnings and errors by default
239
+ - Set `VITE_DEBUG_LOG=true` to enable all logs
240
+ - Simplified logger configuration using `setGlobalLogLevel(LogLevel.Warning)`
241
+
242
+ ### ๐Ÿ› Bug Fixes
243
+ - Fixed SDK config loader warning in non-debug mode
244
+ - Config loading failures are now silently handled in production
245
+ - Warnings only shown when `VITE_DEBUG_LOG=true`
246
+
247
+ ---
248
+
249
+ ## [1.0.0-beta.12] - 2025-11-17
250
+
251
+ ### ๐Ÿ”’ API Improvements
252
+ - Marked performance monitoring APIs as internal
253
+ - `RenderPerformanceStats` interface and `getPerformanceStats()` method are now marked with `@internal` tag
254
+ - These APIs are not exposed in the public TypeScript definitions
255
+ - Reverted performance monitoring implementation to simpler version (only `renderTime` and `sortTime`)
256
+
257
+ ---
258
+
259
+ ## [1.0.0-beta.11] - 2025-11-17
260
+
261
+ ### ๐Ÿ“š Documentation
262
+ - Updated demo repository link in README.md
263
+ - Changed example project link from `Avatarkit-web-demo` to `AvatarSDK-Web-Demo` to match the new repository name
264
+
265
+ ---
266
+
267
+ ## [1.0.0-beta.10] - 2025-11-16
268
+
269
+ ### ๐Ÿ”’ API Improvements
270
+ - Cleaned up public API to hide internal implementation details
271
+ - Marked internal methods with `@internal` JSDoc tag to exclude them from TypeScript declarations
272
+ - Removed unused environment configuration options (`realtimeApiBaseUrl`, `realtimeWsUrl`)
273
+ - Added `appId` getter to `AvatarSDK` for accessing initialized app ID
274
+ - Internal methods like `getEnvironmentConfig`, `logEvent`, `getCanvas`, `getCameraConfig`, `updateCameraConfig` are now properly hidden from public API
275
+
276
+ ### ๐Ÿ› Bug Fixes
277
+ - Fixed memory leaks when disposing AvatarView instances
278
+ - Improved resource cleanup to prevent memory leaks when switching or disposing avatar instances
279
+ - Properly clears all callbacks, event listeners, and large data buffers on disposal
280
+
281
+ ---
282
+ ## [1.0.0-beta.9] - 2025-11-15
283
+
284
+ ### ๐Ÿ› Bug Fixes
285
+ - Fixed memory leaks when disposing AvatarView instances
286
+ - Improved resource cleanup to prevent memory leaks when switching or disposing avatar instances
287
+ - Properly clears all callbacks, event listeners, and large data buffers on disposal
288
+
289
+ ---
290
+
291
+ ## [1.0.0-beta.8] - 2025-11-14
292
+
293
+ ### ๐Ÿ› Bug Fixes
294
+ - Fixed audio-animation synchronization issue after normal playback completion
295
+ - Playback state is now properly cleaned up when audio finishes normally, preventing synchronization issues in subsequent conversations
296
+
297
+ ---
298
+
299
+ ## [1.0.0-beta.7] - 2025-11-14
300
+
301
+ ### ๐Ÿ”„ Refactoring
302
+ - Improved rendering state management for better stability and maintainability
303
+
304
+ ### ๐Ÿ› Bug Fixes
305
+ - Fixed interrupt not generating transition animation when interrupting during playback
306
+ - Fixed transition animation being regenerated and reset in external data mode when sending keyframes after playback starts
307
+
308
+ ---
309
+
310
+ ## [1.0.0-beta.6] - 2025-11-14
311
+
312
+ ### ๐Ÿ› Bug Fixes
313
+ - Fixed transition animation being regenerated and reset in external data mode when sending keyframes after playback starts, causing the transition to play twice
314
+
315
+ ---
316
+
317
+ ## [1.0.0-beta.5] - 2025-11-14
318
+
319
+ ### ๐Ÿ› Bug Fixes
320
+ - Fixed missing `DrivingServiceMode` enum export in published package
321
+
322
+ ---
323
+
324
+ ## [1.0.0-beta.4] - 2025-11-14
325
+
326
+ ### ๐Ÿ”„ Updates
327
+ - Updated WASM module (avatar_core_wasm.wasm)
328
+
329
+ ---
330
+
331
+ ## [1.0.0-beta.3] - 2025-11-13
332
+
333
+ ### ๐ŸŽ‰ Major Changes
334
+
335
+ #### Architecture Refactoring - Three-Layer Architecture
336
+ - **Rendering Layer (AvatarView)**: Pure rendering responsibility, receives rendering instructions from the playback layer
337
+ - **Playback Layer (AvatarController)**: Unified data controller responsible for audio playback and animation rendering synchronization
338
+ - **Network Layer (NetworkLayer)**: Optional network communication layer, automatically composed only in network mode
339
+
340
+ #### Dual Playback Mode Support
341
+ - **Network Mode**:
342
+ - Send audio data to server via WebSocket
343
+ - Automatically receive and play animation data returned from server
344
+ - Use `controller.start()` and `controller.send()` methods
345
+
346
+ - **External Data Mode**:
347
+ - External components fully control audio and animation data acquisition
348
+ - SDK only responsible for synchronized playback of externally provided data
349
+ - Use `controller.playback()`, `controller.yieldAudioData()` and `controller.yieldFramesData()` methods
350
+
351
+ ### โœจ New Features
352
+
353
+ - **Transition Animation Optimization**:
354
+ - Transition animation duration adjusted to 200ms
355
+ - Improved audio-animation synchronization logic, ensuring audio and animation start playing together after transition animation ends
356
+ - Optimized transition frame generation and alignment logic
357
+
358
+ - **Camera Configuration Enhancement**:
359
+ - Default transparent background, background rendering functionality removed
360
+ - Camera configuration aligned with iOS (Reversed-Z projection, near=0.01, far=100)
361
+ - Support dynamic camera configuration loading from characterSettings and camera.json
362
+
363
+ - **Audio Sample Rate Configuration**:
364
+ - Updated default audio sample rate to 16kHz (previously 24kHz) to match backend requirements
365
+ - Audio format requirement: 16kHz mono PCM16
366
+
367
+ - **Telemetry Migration**:
368
+ - Migrated from PostHog to Tencent Cloud CLS (Cloud Log Service)
369
+ - Support environment-based dynamic configuration (cn/test/us)
370
+ - Support both Token and SecretId/SecretKey authentication methods
371
+ - Aligned with iOS SDK configuration
372
+
373
+ ### ๐Ÿ”ง API Changes
374
+
375
+ #### Breaking Changes
376
+
377
+ - **AvatarView Constructor**:
378
+ ```typescript
379
+ // Old API
380
+ new AvatarView(avatar, container)
381
+
382
+ // New API
383
+ new AvatarView(avatar, {
384
+ container: container,
385
+ playbackMode: DrivingServiceMode.sdk // or DrivingServiceMode.host
386
+ })
387
+ ```
388
+
389
+ - **AvatarController Methods**:
390
+ - Network Mode: `start()` / `close()` / `send()`
391
+ - External Data Mode: `play()` / `sendAudioChunk()` / `sendKeyframes()`
392
+ - Common Methods: `interrupt()` / `clear()` / `dispose()`
393
+
394
+ - **Removed Properties**:
395
+ - `realtimeStartTime` property removed (no longer needed)
396
+
397
+ ### ๐Ÿ› Bug Fixes
398
+
399
+ - Fixed audio-animation desynchronization during transition animation
400
+ - Fixed animation freezing issue in external data mode
401
+ - Fixed audio playback speed abnormality caused by sample rate mismatch
402
+ - Fixed camera configuration priority logic
403
+ - Fixed WebSocket connection state callback timing issues
404
+
405
+ ### ๐Ÿ“š Documentation
406
+
407
+ - Updated README.md with detailed explanation of three-layer architecture and two playback modes
408
+ - Added audio format requirements documentation (16kHz mono PCM16)
409
+ - Updated API reference documentation and code examples
410
+ - Added architecture diagrams and flowcharts
411
+
412
+ ### ๐Ÿงช Testing
413
+
414
+ - Updated unit tests to cover new architecture
415
+ - Added unit tests for external data mode
416
+ - Updated E2E tests to use new API
417
+ - All tests passing (69 unit tests + 24 E2E tests)
418
+
419
+ ### ๐Ÿ”„ Internal Changes
420
+
421
+ - Refactored `AvatarController` into unified playback layer
422
+ - Extracted `NetworkLayer` as independent component
423
+ - Optimized animation playback loop and audio-animation synchronization logic
424
+ - Updated WASM module (avatar_core_wasm.wasm)
425
+ - Improved error handling and logging
426
+
427
+ ### ๐Ÿ“ฆ Dependencies
428
+
429
+ - No new dependencies added
430
+ - Maintained existing dependency versions
431
+
432
+ ---
433
+
434
+ ## [1.0.0-beta.2] - Previous Version
435
+
436
+ (Previous version changelog entries...)