@spatius/avatarkit 0.5.0 → 1.0.0

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,19 +1,21 @@
1
- import { b, c, m, f, d, k, g, C, j, h, D, E, i, L, R, n } from "./index-DrRoews_.js";
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";
2
2
  export {
3
+ j as AnimationType,
3
4
  b as Avatar,
4
5
  c as AvatarController,
5
- m as AvatarError,
6
+ n as AvatarError,
6
7
  f as AvatarManager,
7
8
  d as AvatarSDK,
8
- k as AvatarState,
9
+ m as AvatarState,
9
10
  g as AvatarView,
10
11
  C as ConnectionState,
11
- j as ConversationState,
12
+ k as ConversationState,
12
13
  h as DEFAULT_REGION,
13
14
  D as DrivingServiceMode,
14
15
  E as ErrorCode,
15
16
  i as LoadProgress,
16
17
  L as LogLevel,
17
18
  R as ResourceType,
18
- n as extractResourceUrls
19
+ T as TransitionType,
20
+ o as extractResourceUrls
19
21
  };
@@ -29,6 +29,8 @@ export interface CustomAnimation {
29
29
  export interface CharacterAsset {
30
30
  characterId: string;
31
31
  version: string;
32
+ createdAt?: string;
33
+ updatedAt?: string;
32
34
  camera?: ResourceHolder;
33
35
  models?: Models;
34
36
  animations?: Animations;
@@ -30,8 +30,8 @@ export interface Configuration {
30
30
  readonly logLevel?: LogLevel;
31
31
  /** Audio format configuration, default is { channelCount: 1, sampleRate: 16000 } */
32
32
  readonly audioFormat?: AudioFormat;
33
- /** Custom character data API base URL (optional, if provided will be used preferentially) */
34
- readonly characterApiBaseUrl?: string;
33
+ /** Custom endpoint overriding the region-derived host for both character API and driving WebSocket. */
34
+ readonly customEndpoint?: string;
35
35
  }
36
36
  export declare enum LoadProgress {
37
37
  downloading = "downloading",
@@ -49,6 +49,15 @@ export declare enum ConnectionState {
49
49
  connected = "connected",
50
50
  failed = "failed"
51
51
  }
52
+ export declare enum AnimationType {
53
+ idle = "idle",
54
+ mono = "mono"
55
+ }
56
+ export declare enum TransitionType {
57
+ none = "none",
58
+ linear = "linear",
59
+ bezier = "bezier"
60
+ }
52
61
  export declare enum ConversationState {
53
62
  /** Idle state (breathing animation) */
54
63
  idle = "idle",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spatius/avatarkit",
3
3
  "type": "module",
4
- "version": "0.5.0",
4
+ "version": "1.0.0",
5
5
  "packageManager": "pnpm@10.18.2",
6
6
  "description": "AvatarKit SDK - 3D Gaussian Splatting Avatar Rendering SDK",
7
7
  "author": "AvatarKit Team",
@@ -1,85 +0,0 @@
1
- /**
2
- * Per-frame render timing — Web platform.
3
- * Aligned with Android FrameRenderInfo / iOS FrameRenderInfo.
4
- */
5
- export interface FrameRenderInfo {
6
- /** Frame start timestamp (performance.now ms). */
7
- startTimeMs: number;
8
- /** Frame end timestamp (performance.now ms). */
9
- endTimeMs: number;
10
- /** Sort stage time (ms). */
11
- sortTimeMs: number;
12
- /** GPU render time (ms). */
13
- renderTimeMs: number;
14
- /** Reorder time (ms, WebGL path only; 0 for WebGPU). */
15
- reorderTimeMs: number;
16
- /** CPU render-submit time (ms, loadSplats + render call). */
17
- renderSubmitTimeMs: number;
18
- /** Production frame serial (incremented on actual render). */
19
- frameSerial: number;
20
- /** Presentation frame serial (incremented on display submit). */
21
- presentFrameSerial: number;
22
- /** Idle time: gap between previous frame end and this frame start (ms). */
23
- idleTimeMs: number;
24
- }
25
- /**
26
- * Frame rate monitoring info — unified public API across platforms.
27
- * Contains pre-computed high-level performance metrics.
28
- */
29
- export interface FrameRateInfo {
30
- /** Production FPS (actual frames rendered per second). */
31
- fps: number;
32
- /** Presentation FPS (display refresh rate including reused frames). */
33
- presentationFps: number;
34
- /** 95th percentile frame interval (ms). */
35
- frameIntervalP95Ms: number;
36
- /** 99th percentile frame interval (ms). */
37
- frameIntervalP99Ms: number;
38
- /** Percentage of frames with interval > 50ms (jank ratio). */
39
- jankRatioPercent: number;
40
- /** Average total frame time (ms). */
41
- averageFrameTimeMs: number;
42
- /** Estimated CPU busy ratio (%). Browser approximation based on frame active time vs interval. */
43
- cpuUsagePercent: number;
44
- /** Per-frame details within the sliding window (aligned with Android/iOS). */
45
- frames: FrameRenderInfo[];
46
- }
47
- export interface PlaybackStats {
48
- avgFps: number;
49
- frameCount: number;
50
- durationMs: number;
51
- /** Percentage of frame intervals > 50ms */
52
- jankRatio: number;
53
- /** Coefficient of variation of frame intervals (stddev / mean) */
54
- fpsCv: number;
55
- }
56
- /**
57
- * Frame rate monitor with 2-second sliding window.
58
- * Aligned with Android/iOS FrameRateMonitor.
59
- *
60
- * @example
61
- * ```ts
62
- * controller.frameRateMonitorEnabled = true
63
- * controller.onFrameRateInfo = (info) => {
64
- * console.log('FPS:', info.fps, 'Jank:', info.jankRatioPercent)
65
- * }
66
- * ```
67
- */
68
- export declare class FrameRateMonitor {
69
- enabled: boolean;
70
- onFrameRateInfo: ((info: FrameRateInfo) => void) | null;
71
- private lwFrameCount;
72
- private lwStartTimeMs;
73
- private lwLastEndTimeMs;
74
- private lwJankCount;
75
- private lwSumInterval;
76
- private lwSumIntervalSq;
77
- /** Reset the lightweight counter. Call at playback start. */
78
- resetPlaybackStats(): void;
79
- /** Get lightweight playback stats. Call at playback end. */
80
- getPlaybackStats(): PlaybackStats;
81
- private frames;
82
- private computeFrameRateInfo;
83
- private percentileInterval;
84
- private jankRatio;
85
- }