@spatialwalk/avatarkit 1.0.0-beta.80 → 1.0.0-beta.82

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 (52) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/README.md +26 -0
  3. package/dist/{StreamingAudioPlayer-BT5-8dZQ.js → StreamingAudioPlayer-Pe6o4lP8.js} +1 -1
  4. package/dist/avatar_core_wasm-e68766db.wasm +0 -0
  5. package/dist/core/AvatarController.d.ts +1 -25
  6. package/dist/{index-a-0wPb5D.js → index-DvCy6yVA.js} +9249 -8937
  7. package/dist/index.d.ts +0 -1
  8. package/dist/index.js +1 -1
  9. package/dist/next.d.ts +2 -0
  10. package/dist/types/character.d.ts +37 -1
  11. package/dist/types/index.d.ts +9 -0
  12. package/next.d.ts +1 -12
  13. package/next.js +115 -25
  14. package/package.json +20 -17
  15. package/dist/animation/AnimationWebSocketClient.d.ts +0 -6
  16. package/dist/animation/utils/eventEmitter.d.ts +0 -5
  17. package/dist/animation/utils/flameConverter.d.ts +0 -5
  18. package/dist/audio/AnimationPlayer.d.ts +0 -6
  19. package/dist/audio/StreamingAudioPlayer.d.ts +0 -7
  20. package/dist/config/app-config.d.ts +0 -43
  21. package/dist/config/constants.d.ts +0 -21
  22. package/dist/config/sdk-config-loader.d.ts +0 -6
  23. package/dist/core/AvatarDownloader.d.ts +0 -15
  24. package/dist/core/NetworkLayer.d.ts +0 -7
  25. package/dist/generated/common/v1/models.d.ts +0 -36
  26. package/dist/generated/driveningress/v1/driveningress.d.ts +0 -79
  27. package/dist/generated/driveningress/v2/driveningress.d.ts +0 -162
  28. package/dist/generated/google/protobuf/struct.d.ts +0 -107
  29. package/dist/generated/google/protobuf/timestamp.d.ts +0 -128
  30. package/dist/internal/constants.d.ts +0 -102
  31. package/dist/internal/index.d.ts +0 -7
  32. package/dist/renderer/RenderSystem.d.ts +0 -9
  33. package/dist/renderer/covariance.d.ts +0 -5
  34. package/dist/renderer/renderer.d.ts +0 -12
  35. package/dist/renderer/sortSplats.d.ts +0 -5
  36. package/dist/renderer/webgl/reorderData.d.ts +0 -7
  37. package/dist/renderer/webgl/webglRenderer.d.ts +0 -96
  38. package/dist/renderer/webgpu/webgpuRenderer.d.ts +0 -79
  39. package/dist/utils/animation-interpolation.d.ts +0 -8
  40. package/dist/utils/client-id.d.ts +0 -6
  41. package/dist/utils/conversationId.d.ts +0 -10
  42. package/dist/utils/error-utils.d.ts +0 -26
  43. package/dist/utils/id-manager.d.ts +0 -34
  44. package/dist/utils/log-sanitizer.d.ts +0 -15
  45. package/dist/utils/log-sink.d.ts +0 -47
  46. package/dist/utils/logger.d.ts +0 -25
  47. package/dist/utils/posthog-tracker.d.ts +0 -8
  48. package/dist/utils/pwa-cache-manager.d.ts +0 -17
  49. package/dist/utils/usage-tracker.d.ts +0 -6
  50. package/dist/vanilla/vite.config.d.ts +0 -2
  51. package/dist/wasm/avatarCoreAdapter.d.ts +0 -77
  52. package/dist/wasm/avatarCoreMemory.d.ts +0 -144
package/CHANGELOG.md CHANGED
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.0.0-beta.82] - 2026-02-12
9
+
10
+ ### 🔧 Improvements
11
+ - **Proto V2 协议更新** - 更新解码协议
12
+
8
13
  ## [1.0.0-beta.80] - 2026-02-08
9
14
 
10
15
  ### ✨ New Features
package/README.md CHANGED
@@ -31,6 +31,7 @@ We provide complete example code and best practices to help you quickly integrat
31
31
  - ✅ Usage examples for both SDK mode and Host mode
32
32
  - ✅ Audio processing examples (PCM16, WAV, MP3, etc.)
33
33
  - ✅ Vite configuration examples
34
+ - ✅ Next.js configuration examples
34
35
  - ✅ Best practices for common scenarios
35
36
 
36
37
  **[👉 View Demo Repository](https://github.com/spatialwalk/avatarkit-demo)** | *If not yet created, please contact the team*
@@ -107,6 +108,31 @@ export default defineConfig({
107
108
  })
108
109
  ```
109
110
 
111
+ ## 🔧 Next.js Configuration
112
+
113
+ For Next.js projects, use the `withAvatarkit` wrapper to automatically handle WASM file configuration with webpack.
114
+
115
+ ### Using the Plugin
116
+
117
+ Wrap your Next.js config in `next.config.mjs`:
118
+
119
+ ```javascript
120
+ import { withAvatarkit } from '@spatialwalk/avatarkit/next'
121
+
122
+ export default withAvatarkit({
123
+ // ...your existing Next.js config
124
+ })
125
+ ```
126
+
127
+ ### Plugin Features
128
+
129
+ The plugin automatically handles:
130
+
131
+ - ✅ **Emscripten Fix**: Patches `scriptDirectory` so the WASM glue file correctly resolves assets at `/_next/static/chunks/` instead of a build-time `file://` path
132
+ - ✅ **WASM Copying**: Copies `.wasm` files into `static/chunks/` via a custom webpack plugin (client build only)
133
+ - ✅ **Content-Type Headers**: Adds `application/wasm` response header for `/_next/static/chunks/*.wasm`
134
+ - ✅ **Config Chaining**: Preserves your existing `webpack` and `headers` configurations
135
+
110
136
  ## 🔐 Authentication
111
137
 
112
138
  All environments require an **App ID** and **Session Token** for authentication.
@@ -1,7 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { A as APP_CONFIG, l as logger, e as errorToMessage, a as logEvent } from "./index-a-0wPb5D.js";
4
+ import { A as APP_CONFIG, l as logger, e as errorToMessage, a as logEvent } from "./index-DvCy6yVA.js";
5
5
  class StreamingAudioPlayer {
6
6
  // Mark if AudioContext is being resumed, avoid concurrent resume requests
7
7
  constructor(options) {
File without changes
@@ -1,21 +1,9 @@
1
- import { Flame } from '../generated/driveningress/v1/driveningress';
2
1
  import { Avatar } from './Avatar';
3
- import { AnimationPlayer } from '../audio/AnimationPlayer';
4
- import { AvatarState, ConnectionState, DrivingServiceMode, ConversationState, PostProcessingConfig, KeyframeData } from '../types';
2
+ import { ConnectionState, DrivingServiceMode, ConversationState, PostProcessingConfig, KeyframeData } from '../types';
5
3
  export declare class AvatarController {
6
4
  private networkLayer?;
7
5
  private readonly playbackMode;
8
- protected avatar: Avatar;
9
- protected animationPlayer: AnimationPlayer | null;
10
- protected currentKeyframes: Flame[];
11
- protected pendingAudioChunks: Array<{
12
- data: Uint8Array;
13
- isLast: boolean;
14
- }>;
15
- protected isPlaying: boolean;
16
6
  private isStartingPlayback;
17
- protected isConnected: boolean;
18
- protected currentState: AvatarState;
19
7
  private currentConversationId;
20
8
  private reqEnd;
21
9
  onConnectionState: ((state: ConnectionState) => void) | null;
@@ -147,16 +135,4 @@ export declare class AvatarController {
147
135
  * @returns Current volume value (0.0 - 1.0)
148
136
  */
149
137
  getVolume(): number;
150
- /**
151
- * Stop playback
152
- */
153
- protected stopPlayback(): void;
154
- /**
155
- * Clean up players
156
- */
157
- protected cleanupPlayers(): void;
158
- /**
159
- * Emit event
160
- */
161
- protected emit(event: string, data?: any): void;
162
138
  }