@spatialwalk/avatarkit 1.0.0-beta.30 → 1.0.0-beta.31

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
@@ -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.31] - 2025-12-16
9
+
10
+ ### 🐛 Bugfix
11
+ - **Environment CORS Issue** - Fixed CORS issues when requesting configuration and character data APIs. SDK now provides default configuration fallback when config requests fail, ensuring smooth operation across different environments.
12
+
8
13
  ## [1.0.0-beta.30] - 2025-12-15
9
14
 
10
15
  ### 🐛 Bugfix
package/README.md CHANGED
@@ -272,11 +272,11 @@ constructor(avatar: Avatar, container: HTMLElement)
272
272
  ```
273
273
 
274
274
  **Parameters:**
275
- - `avatar`: Avatar 实例
276
- - `container`: Canvas 容器元素(必选)
277
- - Canvas 自动使用容器的完整尺寸(宽度和高度)
278
- - Canvas 宽高比适应容器尺寸 - 设置容器尺寸以控制宽高比
279
- - Canvas 会自动添加到容器中
275
+ - `avatar`: Avatar instance
276
+ - `container`: Canvas container element (required)
277
+ - Canvas automatically uses the full size of the container (width and height)
278
+ - Canvas aspect ratio adapts to container size - set container size to control aspect ratio
279
+ - Canvas will be automatically added to the container
280
280
  - SDK automatically handles resize events via ResizeObserver
281
281
 
282
282
  **Playback Mode:**
@@ -472,18 +472,18 @@ enum ConnectionState {
472
472
 
473
473
  ```typescript
474
474
  enum ConversationState {
475
- idle = 'idle', // 呼吸态
476
- playing = 'playing' // 播放态
475
+ idle = 'idle', // Idle state (breathing animation)
476
+ playing = 'playing' // Playing state (active conversation)
477
477
  }
478
478
  ```
479
479
 
480
- **状态说明:**
481
- - `idle`: 数字人处于呼吸态,等待对话开始
482
- - `playing`: 数字人正在播放对话内容(包括过渡动画期间)
480
+ **State Description:**
481
+ - `idle`: Avatar is in idle state (breathing animation), waiting for conversation to start
482
+ - `playing`: Avatar is playing conversation content (including during transition animations)
483
483
 
484
- **注意:** 过渡动画期间会提前通知目标状态:
485
- - `idle` 过渡到 `playing` 时,立即通知 `playing` 状态
486
- - `playing` 过渡到 `idle` 时,立即通知 `idle` 状态
484
+ **Note:** During transition animations, the target state is notified immediately:
485
+ - When transitioning from `idle` to `playing`, the `playing` state is notified immediately
486
+ - When transitioning from `playing` to `idle`, the `idle` state is notified immediately
487
487
 
488
488
  ## 🎨 Rendering System
489
489
 
@@ -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, e as errorToMessage, l as logEvent, a as logger } from "./index-FJY_63Bh.js";
4
+ import { A as APP_CONFIG, e as errorToMessage, l as logEvent, a as logger } from "./index-CCBBCJi2.js";
5
5
  class StreamingAudioPlayer {
6
6
  constructor(options) {
7
7
  __publicField(this, "audioContext", null);
File without changes
@@ -1733,7 +1733,7 @@ const _AnimationPlayer = class _AnimationPlayer {
1733
1733
  if (this.streamingPlayer) {
1734
1734
  return;
1735
1735
  }
1736
- const { StreamingAudioPlayer } = await import("./StreamingAudioPlayer-CVqWInxw.js");
1736
+ const { StreamingAudioPlayer } = await import("./StreamingAudioPlayer-B07iPxK4.js");
1737
1737
  this.streamingPlayer = new StreamingAudioPlayer({
1738
1738
  sampleRate: APP_CONFIG.audio.sampleRate,
1739
1739
  channelCount: 1,
@@ -1892,8 +1892,7 @@ async function fetchSdkConfig(version) {
1892
1892
  }
1893
1893
  configCache.promise = (async () => {
1894
1894
  try {
1895
- const isDev = typeof window !== "undefined" && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1");
1896
- const configUrl = isDev ? `/api/config/sdk?version=${version}` : `https://config.spatialwalk.top/sdk?version=${version}`;
1895
+ const configUrl = `https://config.spatialwalk.top/sdk?version=${version}`;
1897
1896
  logger.log(`[SdkConfigLoader] Fetching SDK config from: ${configUrl}`);
1898
1897
  const response = await fetch(configUrl, {
1899
1898
  method: "GET",
@@ -1920,7 +1919,11 @@ async function fetchSdkConfig(version) {
1920
1919
  configCache.config = config;
1921
1920
  logger.log(`[SdkConfigLoader] SDK config fetched successfully:`, config);
1922
1921
  } catch (error) {
1923
- configCache.config = {};
1922
+ configCache.config = {
1923
+ [Environment.cn]: "https://api.open.spatialwalk.top",
1924
+ [Environment.intl]: "https://api.intl.spatialwalk.cloud"
1925
+ };
1926
+ logger.log("[SdkConfigLoader] Using default SDK config:", configCache.config);
1924
1927
  } finally {
1925
1928
  configCache.promise = null;
1926
1929
  }
@@ -3131,7 +3134,7 @@ class AvatarSDK {
3131
3134
  }
3132
3135
  __publicField(AvatarSDK, "_isInitialized", false);
3133
3136
  __publicField(AvatarSDK, "_configuration", null);
3134
- __publicField(AvatarSDK, "_version", "1.0.0-beta.30");
3137
+ __publicField(AvatarSDK, "_version", "1.0.0-beta.31");
3135
3138
  __publicField(AvatarSDK, "_avatarCore", null);
3136
3139
  __publicField(AvatarSDK, "_dynamicSdkConfig", null);
3137
3140
  function varint64read() {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { b, c, f, d, j, g, C, i, D, E, k, h, L, R, S, m } from "./index-FJY_63Bh.js";
1
+ import { b, c, f, d, j, g, C, i, D, E, k, h, L, R, S, m } from "./index-CCBBCJi2.js";
2
2
  export {
3
3
  b as Avatar,
4
4
  c as AvatarController,
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@spatialwalk/avatarkit",
3
3
  "type": "module",
4
- "version": "1.0.0-beta.30",
4
+ "version": "1.0.0-beta.31",
5
+ "packageManager": "pnpm@10.18.2",
5
6
  "description": "SPAvatar SDK - 3D Gaussian Splatting Avatar Rendering SDK",
6
7
  "author": "SPAvatar Team",
7
8
  "license": "MIT",
@@ -31,6 +32,16 @@
31
32
  "CHANGELOG.md",
32
33
  "dist"
33
34
  ],
35
+ "scripts": {
36
+ "build": "SDK_BUILD=true vite build --mode library",
37
+ "dev": "vite build --mode library --watch",
38
+ "clean": "rm -rf dist",
39
+ "typecheck": "tsc --noEmit",
40
+ "test": "cd tests && pnpm test",
41
+ "test:watch": "cd tests && pnpm run test:watch",
42
+ "test:e2e": "cd tests && pnpm run test:e2e",
43
+ "test:perf": "cd tests && pnpm run test:perf"
44
+ },
34
45
  "peerDependencies": {
35
46
  "@webgpu/types": "*"
36
47
  },
@@ -46,15 +57,5 @@
46
57
  "typescript": "^5.0.0",
47
58
  "vite": "^5.0.0",
48
59
  "vite-plugin-dts": "^4.5.4"
49
- },
50
- "scripts": {
51
- "build": "SDK_BUILD=true vite build --mode library",
52
- "dev": "vite build --mode library --watch",
53
- "clean": "rm -rf dist",
54
- "typecheck": "tsc --noEmit",
55
- "test": "cd tests && pnpm test",
56
- "test:watch": "cd tests && pnpm run test:watch",
57
- "test:e2e": "cd tests && pnpm run test:e2e",
58
- "test:perf": "cd tests && pnpm run test:perf"
59
60
  }
60
- }
61
+ }