@spatialwalk/avatarkit 1.0.0-beta.1 → 1.0.0-beta.11

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 (67) hide show
  1. package/CHANGELOG.md +185 -0
  2. package/README.md +450 -148
  3. package/dist/{StreamingAudioPlayer-C2TfYsO8.js → StreamingAudioPlayer-CLFmPod8.js} +88 -62
  4. package/dist/StreamingAudioPlayer-CLFmPod8.js.map +1 -0
  5. package/dist/animation/AnimationWebSocketClient.d.ts.map +1 -1
  6. package/dist/animation/utils/flameConverter.d.ts.map +1 -1
  7. package/dist/audio/AnimationPlayer.d.ts +4 -0
  8. package/dist/audio/AnimationPlayer.d.ts.map +1 -1
  9. package/dist/audio/StreamingAudioPlayer.d.ts +10 -0
  10. package/dist/audio/StreamingAudioPlayer.d.ts.map +1 -1
  11. package/dist/avatar_core_wasm-D4eEi7Eh.js +1666 -0
  12. package/dist/{avatar_core_wasm-DmkU6dYn.js.map → avatar_core_wasm-D4eEi7Eh.js.map} +1 -1
  13. package/dist/avatar_core_wasm.wasm +0 -0
  14. package/dist/config/app-config.d.ts +3 -7
  15. package/dist/config/app-config.d.ts.map +1 -1
  16. package/dist/config/constants.d.ts +19 -3
  17. package/dist/config/constants.d.ts.map +1 -1
  18. package/dist/core/Avatar.d.ts +0 -8
  19. package/dist/core/Avatar.d.ts.map +1 -1
  20. package/dist/core/AvatarController.d.ts +50 -74
  21. package/dist/core/AvatarController.d.ts.map +1 -1
  22. package/dist/core/AvatarDownloader.d.ts +0 -5
  23. package/dist/core/AvatarDownloader.d.ts.map +1 -1
  24. package/dist/core/AvatarKit.d.ts +3 -15
  25. package/dist/core/AvatarKit.d.ts.map +1 -1
  26. package/dist/core/AvatarManager.d.ts.map +1 -1
  27. package/dist/core/AvatarView.d.ts +47 -46
  28. package/dist/core/AvatarView.d.ts.map +1 -1
  29. package/dist/core/NetworkLayer.d.ts +59 -0
  30. package/dist/core/NetworkLayer.d.ts.map +1 -0
  31. package/dist/index-Ck21a9C4.js +5999 -0
  32. package/dist/index-Ck21a9C4.js.map +1 -0
  33. package/dist/index.d.ts +0 -1
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +11 -11
  36. package/dist/renderer/RenderSystem.d.ts +4 -2
  37. package/dist/renderer/RenderSystem.d.ts.map +1 -1
  38. package/dist/renderer/webgl/webglRenderer.d.ts.map +1 -1
  39. package/dist/types/index.d.ts +18 -0
  40. package/dist/types/index.d.ts.map +1 -1
  41. package/dist/utils/cls-tracker.d.ts +17 -0
  42. package/dist/utils/cls-tracker.d.ts.map +1 -0
  43. package/dist/utils/logger.d.ts +1 -1
  44. package/dist/utils/logger.d.ts.map +1 -1
  45. package/package.json +14 -18
  46. package/dist/StreamingAudioPlayer-C2TfYsO8.js.map +0 -1
  47. package/dist/avatar_core_wasm-DmkU6dYn.js +0 -1666
  48. package/dist/config/region-config.d.ts +0 -17
  49. package/dist/config/region-config.d.ts.map +0 -1
  50. package/dist/generated/google/protobuf/any.d.ts +0 -145
  51. package/dist/generated/google/protobuf/any.d.ts.map +0 -1
  52. package/dist/generated/jsonapi/v1/base.d.ts +0 -140
  53. package/dist/generated/jsonapi/v1/base.d.ts.map +0 -1
  54. package/dist/generated/platform/v1/asset_groups.d.ts +0 -225
  55. package/dist/generated/platform/v1/asset_groups.d.ts.map +0 -1
  56. package/dist/generated/platform/v1/assets.d.ts +0 -149
  57. package/dist/generated/platform/v1/assets.d.ts.map +0 -1
  58. package/dist/generated/platform/v1/character.d.ts +0 -395
  59. package/dist/generated/platform/v1/character.d.ts.map +0 -1
  60. package/dist/generated/platform/v1/redeem.d.ts +0 -22
  61. package/dist/generated/platform/v1/redeem.d.ts.map +0 -1
  62. package/dist/index-DwhR9l52.js +0 -9712
  63. package/dist/index-DwhR9l52.js.map +0 -1
  64. package/dist/utils/posthog-tracker.d.ts +0 -82
  65. package/dist/utils/posthog-tracker.d.ts.map +0 -1
  66. package/dist/utils/toast.d.ts +0 -74
  67. package/dist/utils/toast.d.ts.map +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,185 @@
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.11] - 2025-11-17
9
+
10
+ ### 📚 Documentation
11
+ - Updated demo repository link in README.md
12
+ - Changed example project link from `Avatarkit-web-demo` to `AvatarKit-Web-Demo` to match the new repository name
13
+
14
+ ---
15
+
16
+ ## [1.0.0-beta.10] - 2025-11-16
17
+
18
+ ### 🔒 API Improvements
19
+ - Cleaned up public API to hide internal implementation details
20
+ - Marked internal methods with `@internal` JSDoc tag to exclude them from TypeScript declarations
21
+ - Removed unused environment configuration options (`realtimeApiBaseUrl`, `realtimeWsUrl`)
22
+ - Added `appId` getter to `AvatarKit` for accessing initialized app ID
23
+ - Internal methods like `getEnvironmentConfig`, `logEvent`, `getCanvas`, `getCameraConfig`, `updateCameraConfig` are now properly hidden from public API
24
+
25
+ ### 🐛 Bug Fixes
26
+ - Fixed memory leaks when disposing AvatarView instances
27
+ - Improved resource cleanup to prevent memory leaks when switching or disposing avatar instances
28
+ - Properly clears all callbacks, event listeners, and large data buffers on disposal
29
+
30
+ ---
31
+ ## [1.0.0-beta.9] - 2025-11-15
32
+
33
+ ### 🐛 Bug Fixes
34
+ - Fixed memory leaks when disposing AvatarView instances
35
+ - Improved resource cleanup to prevent memory leaks when switching or disposing avatar instances
36
+ - Properly clears all callbacks, event listeners, and large data buffers on disposal
37
+
38
+ ---
39
+
40
+ ## [1.0.0-beta.8] - 2025-11-14
41
+
42
+ ### 🐛 Bug Fixes
43
+ - Fixed audio-animation synchronization issue after normal playback completion
44
+ - Playback state is now properly cleaned up when audio finishes normally, preventing synchronization issues in subsequent conversations
45
+
46
+ ---
47
+
48
+ ## [1.0.0-beta.7] - 2025-11-14
49
+
50
+ ### 🔄 Refactoring
51
+ - Improved rendering state management for better stability and maintainability
52
+
53
+ ### 🐛 Bug Fixes
54
+ - Fixed interrupt not generating transition animation when interrupting during playback
55
+ - Fixed transition animation being regenerated and reset in external data mode when sending keyframes after playback starts
56
+
57
+ ---
58
+
59
+ ## [1.0.0-beta.6] - 2025-11-14
60
+
61
+ ### 🐛 Bug Fixes
62
+ - Fixed transition animation being regenerated and reset in external data mode when sending keyframes after playback starts, causing the transition to play twice
63
+
64
+ ---
65
+
66
+ ## [1.0.0-beta.5] - 2025-11-14
67
+
68
+ ### 🐛 Bug Fixes
69
+ - Fixed missing `AvatarPlaybackMode` enum export in published package
70
+
71
+ ---
72
+
73
+ ## [1.0.0-beta.4] - 2025-11-14
74
+
75
+ ### 🔄 Updates
76
+ - Updated WASM module (avatar_core_wasm.wasm)
77
+
78
+ ---
79
+
80
+ ## [1.0.0-beta.3] - 2025-11-13
81
+
82
+ ### 🎉 Major Changes
83
+
84
+ #### Architecture Refactoring - Three-Layer Architecture
85
+ - **Rendering Layer (AvatarView)**: Pure rendering responsibility, receives rendering instructions from the playback layer
86
+ - **Playback Layer (AvatarController)**: Unified data controller responsible for audio playback and animation rendering synchronization
87
+ - **Network Layer (NetworkLayer)**: Optional network communication layer, automatically composed only in network mode
88
+
89
+ #### Dual Playback Mode Support
90
+ - **Network Mode**:
91
+ - Send audio data to server via WebSocket
92
+ - Automatically receive and play animation data returned from server
93
+ - Use `controller.start()` and `controller.send()` methods
94
+
95
+ - **External Data Mode**:
96
+ - External components fully control audio and animation data acquisition
97
+ - SDK only responsible for synchronized playback of externally provided data
98
+ - Use `controller.play()`, `controller.sendAudioChunk()` and `controller.sendKeyframes()` methods
99
+
100
+ ### ✨ New Features
101
+
102
+ - **Transition Animation Optimization**:
103
+ - Transition animation duration adjusted to 200ms
104
+ - Improved audio-animation synchronization logic, ensuring audio and animation start playing together after transition animation ends
105
+ - Optimized transition frame generation and alignment logic
106
+
107
+ - **Camera Configuration Enhancement**:
108
+ - Default transparent background, background rendering functionality removed
109
+ - Camera configuration aligned with iOS (Reversed-Z projection, near=0.01, far=100)
110
+ - Support dynamic camera configuration loading from characterSettings and camera.json
111
+
112
+ - **Audio Sample Rate Configuration**:
113
+ - Updated default audio sample rate to 16kHz (previously 24kHz) to match backend requirements
114
+ - Audio format requirement: 16kHz mono PCM16
115
+
116
+ - **Telemetry Migration**:
117
+ - Migrated from PostHog to Tencent Cloud CLS (Cloud Log Service)
118
+ - Support environment-based dynamic configuration (cn/test/us)
119
+ - Support both Token and SecretId/SecretKey authentication methods
120
+ - Aligned with iOS SDK configuration
121
+
122
+ ### 🔧 API Changes
123
+
124
+ #### Breaking Changes
125
+
126
+ - **AvatarView Constructor**:
127
+ ```typescript
128
+ // Old API
129
+ new AvatarView(avatar, container)
130
+
131
+ // New API
132
+ new AvatarView(avatar, {
133
+ container: container,
134
+ playbackMode: AvatarPlaybackMode.network // or AvatarPlaybackMode.external
135
+ })
136
+ ```
137
+
138
+ - **AvatarController Methods**:
139
+ - Network Mode: `start()` / `close()` / `send()`
140
+ - External Data Mode: `play()` / `sendAudioChunk()` / `sendKeyframes()`
141
+ - Common Methods: `interrupt()` / `clear()` / `dispose()`
142
+
143
+ - **Removed Properties**:
144
+ - `realtimeStartTime` property removed (no longer needed)
145
+
146
+ ### 🐛 Bug Fixes
147
+
148
+ - Fixed audio-animation desynchronization during transition animation
149
+ - Fixed animation freezing issue in external data mode
150
+ - Fixed audio playback speed abnormality caused by sample rate mismatch
151
+ - Fixed camera configuration priority logic
152
+ - Fixed WebSocket connection state callback timing issues
153
+
154
+ ### 📚 Documentation
155
+
156
+ - Updated README.md with detailed explanation of three-layer architecture and two playback modes
157
+ - Added audio format requirements documentation (16kHz mono PCM16)
158
+ - Updated API reference documentation and code examples
159
+ - Added architecture diagrams and flowcharts
160
+
161
+ ### 🧪 Testing
162
+
163
+ - Updated unit tests to cover new architecture
164
+ - Added unit tests for external data mode
165
+ - Updated E2E tests to use new API
166
+ - All tests passing (69 unit tests + 24 E2E tests)
167
+
168
+ ### 🔄 Internal Changes
169
+
170
+ - Refactored `AvatarController` into unified playback layer
171
+ - Extracted `NetworkLayer` as independent component
172
+ - Optimized animation playback loop and audio-animation synchronization logic
173
+ - Updated WASM module (avatar_core_wasm.wasm)
174
+ - Improved error handling and logging
175
+
176
+ ### 📦 Dependencies
177
+
178
+ - No new dependencies added
179
+ - Maintained existing dependency versions
180
+
181
+ ---
182
+
183
+ ## [1.0.0-beta.2] - Previous Version
184
+
185
+ (Previous version changelog entries...)