@spatius/avatarkit 1.0.0 → 1.2.0-beta.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/dist/index.js CHANGED
@@ -1,21 +1,24 @@
1
- import { j, b, c, n, f, d, m, g, C, k, h, D, E, i, L, R, T, o } from "./index-zTpDp_Pv.js";
1
+ import { k, b, c, o, f, d, n, g, C, m, i, D, E, F, j, L, h, R, p, T, q } from "./index-DHCQ9wsL.js";
2
2
  export {
3
- j as AnimationType,
3
+ k as AnimationType,
4
4
  b as Avatar,
5
5
  c as AvatarController,
6
- n as AvatarError,
6
+ o as AvatarError,
7
7
  f as AvatarManager,
8
8
  d as AvatarSDK,
9
- m as AvatarState,
9
+ n as AvatarState,
10
10
  g as AvatarView,
11
11
  C as ConnectionState,
12
- k as ConversationState,
13
- h as DEFAULT_REGION,
12
+ m as ConversationState,
13
+ i as DEFAULT_REGION,
14
14
  D as DrivingServiceMode,
15
15
  E as ErrorCode,
16
- i as LoadProgress,
16
+ F as FrameStarvationMode,
17
+ j as LoadProgress,
17
18
  L as LogLevel,
18
- R as ResourceType,
19
+ h as RENDER_QUALITY_PARAMS,
20
+ R as RenderQuality,
21
+ p as ResourceType,
19
22
  T as TransitionType,
20
- o as extractResourceUrls
23
+ q as extractResourceUrls
21
24
  };
@@ -23,7 +23,6 @@ export interface TransformSettings {
23
23
  }
24
24
  export interface CharacterSettings {
25
25
  eyelid: EyelidSettings;
26
- eyefocus?: EyelidSettings;
27
26
  camera: CameraSettings;
28
27
  transform?: TransformSettings;
29
28
  }
@@ -3,9 +3,22 @@
3
3
  */
4
4
  export declare enum DrivingServiceMode {
5
5
  /** Driven by SDK directly */
6
- sdk = "sdk",
6
+ direct = "direct",
7
7
  /** Driven by host application */
8
- host = "host"
8
+ backend = "backend"
9
+ }
10
+ /**
11
+ * Strategy for handling animation-frame starvation (animation frames can't keep up
12
+ * with the audio clock).
13
+ *
14
+ * - `audioIndependent` (default): audio keeps playing, animation catches up; starvation
15
+ * is only reported as telemetry. This is the historical default behavior.
16
+ * - `strictSync`: pause audio and wait when frames run out, resume once new frames
17
+ * arrive, notifying via `AvatarController.onPlaybackStall`.
18
+ */
19
+ export declare enum FrameStarvationMode {
20
+ audioIndependent = "audioIndependent",
21
+ strictSync = "strictSync"
9
22
  }
10
23
  export declare enum LogLevel {
11
24
  /** Disable all logs */
@@ -23,8 +36,15 @@ export interface AudioFormat {
23
36
  /** Sample rate, supported: 8000, 16000, 22050, 24000, 32000, 44100, 48000, default: 16000 */
24
37
  readonly sampleRate: number;
25
38
  }
39
+ export declare enum RenderQuality {
40
+ standard = "standard",
41
+ high = "high",
42
+ ultra = "ultra"
43
+ }
26
44
  export interface Configuration {
27
- /** Driving service mode, default is sdk */
45
+ /** Region used to compose endpoint URLs (default 'us-west'). Not part of the public quickstart. */
46
+ readonly region?: string;
47
+ /** Driving service mode, default is direct */
28
48
  readonly drivingServiceMode?: DrivingServiceMode;
29
49
  /** Log level, default is off */
30
50
  readonly logLevel?: LogLevel;
@@ -32,6 +52,8 @@ export interface Configuration {
32
52
  readonly audioFormat?: AudioFormat;
33
53
  /** Custom endpoint overriding the region-derived host for both character API and driving WebSocket. */
34
54
  readonly customEndpoint?: string;
55
+ /** Render quality tier, default is RenderQuality.ultra */
56
+ readonly renderQuality?: RenderQuality;
35
57
  }
36
58
  export declare enum LoadProgress {
37
59
  downloading = "downloading",
@@ -81,6 +103,8 @@ export declare enum ErrorCode {
81
103
  avatarIDUnrecognized = "avatarIDUnrecognized",
82
104
  /** Failed to fetch avatar metadata */
83
105
  failedToFetchAvatarMetadata = "failedToFetchAvatarMetadata",
106
+ /** Avatar metadata format invalid / failed to parse */
107
+ invalidAvatarMetadata = "invalidAvatarMetadata",
84
108
  /** Failed to download avatar assets */
85
109
  failedToDownloadAvatarAssets = "failedToDownloadAvatarAssets",
86
110
  /** WebSocket connection error (handshake failure, network error) */
@@ -169,13 +193,6 @@ export interface PostProcessingConfig {
169
193
  eyeBlink?: number;
170
194
  /** Expression weight (0.0-2.0, 0=no expression, 1=normal, >1=enhanced) */
171
195
  expressionWeight?: number;
172
- /** Eye tracking complete configuration (real-time control of eye_focus, must provide complete configuration) */
173
- eyefocus?: {
174
- enabled: boolean;
175
- auto_eyelid_adjustment?: boolean;
176
- eyelid_threshold?: number;
177
- targets?: number[];
178
- };
179
196
  }
180
197
  export interface CharacterInfo {
181
198
  pointCount: number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spatius/avatarkit",
3
3
  "type": "module",
4
- "version": "1.0.0",
4
+ "version": "1.2.0-beta.1",
5
5
  "packageManager": "pnpm@10.18.2",
6
6
  "description": "AvatarKit SDK - 3D Gaussian Splatting Avatar Rendering SDK",
7
7
  "author": "AvatarKit Team",
@@ -48,6 +48,7 @@
48
48
  "build": "SDK_BUILD=true vite build --mode library && npm run build:vite-plugin && npm run build:next-plugin",
49
49
  "build:vite-plugin": "tsc vite.ts --outDir . --module esnext --target es2020 --moduleResolution bundler --esModuleInterop --skipLibCheck --declaration --declarationMap",
50
50
  "build:next-plugin": "tsc next.ts --outDir . --module esnext --target es2020 --moduleResolution bundler --esModuleInterop --skipLibCheck --declaration --declarationMap",
51
+ "prepare": "npm run build",
51
52
  "dev": "vite build --mode library --watch",
52
53
  "demo": "vite --config demo/vite.config.mjs",
53
54
  "demo:benchmark": "vite --config benchmark-demo/vite.config.mjs",
@@ -75,6 +76,12 @@
75
76
  "dependencies": {
76
77
  "@bufbuild/protobuf": "^2.10.0",
77
78
  "@guiiai/logg": "^1.2.4",
79
+ "@opentelemetry/api": "^1.9.1",
80
+ "@opentelemetry/api-logs": "^0.218.0",
81
+ "@opentelemetry/exporter-logs-otlp-http": "^0.218.0",
82
+ "@opentelemetry/resources": "^2.7.1",
83
+ "@opentelemetry/sdk-logs": "^0.218.0",
84
+ "@opentelemetry/semantic-conventions": "^1.41.1",
78
85
  "nanoid": "^5.1.6",
79
86
  "posthog-js": "^1.310.1"
80
87
  },