@spatius/avatarkit 1.3.8 → 1.3.10-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.
@@ -57,16 +57,3 @@ export type PreloadResources<T> = {
57
57
  export type PreloadCameraSettings = PreloadResources<{
58
58
  camera: CameraSettings;
59
59
  }>;
60
- /**
61
- * Resource type enumeration
62
- */
63
- export declare enum ResourceType {
64
- CAMERA = "camera",
65
- ANIMATION_IDLE = "frameIdle",
66
- MODEL_SHAPE = "shape",
67
- MODEL_GS = "gsStandard"
68
- }
69
- /**
70
- * Extract all resource URLs
71
- */
72
- export declare function extractResourceUrls(meta: CharacterMeta): Record<ResourceType, string | null>;
@@ -115,6 +115,23 @@ export interface AudioFormat {
115
115
  */
116
116
  readonly inputAudioFormat?: 'pcm' | 'opus';
117
117
  }
118
+ /** Options for creating an {@link AvatarView}. */
119
+ export interface AvatarViewOptions {
120
+ /**
121
+ * Audio format for THIS view. Defaults to `{ channelCount: 1, sampleRate: 16000 }`.
122
+ *
123
+ * Audio format is per-view, not global: two views in one page can run different
124
+ * sample rates. Change any field later via `view.controller.setAudioFormat()`
125
+ * (it lives on the controller, next to `initializeAudioContext` which you must
126
+ * call after it).
127
+ */
128
+ readonly audioFormat?: AudioFormat;
129
+ }
130
+ /**
131
+ * Partial update for `controller.setAudioFormat()`: fields left out keep their
132
+ * current value. `channelCount` is fixed at 1 and cannot be changed.
133
+ */
134
+ export type AudioFormatPatch = Partial<Omit<AudioFormat, 'channelCount'>>;
118
135
  export declare enum RenderQuality {
119
136
  standard = "standard",
120
137
  high = "high",
@@ -127,8 +144,6 @@ export interface Configuration {
127
144
  readonly drivingServiceMode?: DrivingServiceMode;
128
145
  /** Log level, default is off */
129
146
  readonly logLevel?: LogLevel;
130
- /** Audio format configuration, default is { channelCount: 1, sampleRate: 16000 } */
131
- readonly audioFormat?: AudioFormat;
132
147
  /** Custom endpoint overriding the region-derived host for both character API and driving WebSocket. */
133
148
  readonly customEndpoint?: string;
134
149
  /** Render quality tier, default is RenderQuality.ultra */
@@ -168,8 +183,6 @@ export declare enum ConversationState {
168
183
  paused = "paused"
169
184
  }
170
185
  export declare enum ErrorCode {
171
- /** AppID not recognized (reserved, future appID validation logic) */
172
- appIDUnrecognized = "appIDUnrecognized",
173
186
  /** Session Token invalid (WebSocket close code 4010) */
174
187
  sessionTokenInvalid = "sessionTokenInvalid",
175
188
  /** Session Token expired (WebSocket close code 4010) */
@@ -188,10 +201,17 @@ export declare enum ErrorCode {
188
201
  failedToDownloadAvatarAssets = "failedToDownloadAvatarAssets",
189
202
  /** Avatar asset compatibility_flags not supported by this SDK version (upgrade SDK) */
190
203
  unsupportedAvatarAsset = "unsupportedAvatarAsset",
204
+ /**
205
+ * Neither WebGL2 nor WebGPU is available, so the avatar cannot be drawn at all.
206
+ * Typically hardware acceleration is disabled in the browser, the GPU driver is
207
+ * blocklisted, or the page runs in a restricted iframe. Deterministic — no point
208
+ * retrying; tell the user to enable graphics acceleration.
209
+ */
210
+ renderNotSupported = "renderNotSupported",
211
+ /** Render system failed to initialize for a reason other than missing WebGL2/WebGPU */
212
+ renderInitFailed = "renderInitFailed",
191
213
  /** WebSocket connection error (handshake failure, network error) */
192
214
  websocketError = "websocketError",
193
- /** WebSocket connection closed abnormally (close code 1006) */
194
- websocketClosedAbnormally = "websocketClosedAbnormally",
195
215
  /** WebSocket closed with unexpected close code */
196
216
  websocketClosedUnexpected = "websocketClosedUnexpected",
197
217
  /** Session timeout (WebSocket close code 4002) */
@@ -204,8 +224,6 @@ export declare enum ErrorCode {
204
224
  playbackStartFailed = "playbackStartFailed",
205
225
  /** Playback initialization failed */
206
226
  playbackInitFailed = "playbackInitFailed",
207
- /** Audio-only playback initialization failed */
208
- audioOnlyInitFailed = "audioOnlyInitFailed",
209
227
  /** No audio data to play */
210
228
  noAudio = "noAudio",
211
229
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spatius/avatarkit",
3
3
  "type": "module",
4
- "version": "1.3.8",
4
+ "version": "1.3.10-beta.1",
5
5
  "packageManager": "pnpm@10.18.2",
6
6
  "description": "AvatarKit — real-time, audio-driven avatar rendering SDK for Web.",
7
7
  "homepage": "https://spatius.ai/",
@@ -91,8 +91,7 @@
91
91
  "@opentelemetry/sdk-trace-web": "2.7.1",
92
92
  "@opentelemetry/semantic-conventions": "^1.41.1",
93
93
  "nanoid": "^5.1.6",
94
- "opusscript": "0.1.1",
95
- "posthog-js": "^1.422.5"
94
+ "opusscript": "0.1.1"
96
95
  },
97
96
  "devDependencies": {
98
97
  "@types/node": "^20.11.30",
@@ -1,24 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
- key = keys[i];
12
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
- get: ((k) => from[k]).bind(null, key),
14
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
- });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
20
- value: mod,
21
- enumerable: true
22
- }) : target, mod));
23
- //#endregion
24
- export { __toESM as n, __commonJSMin as t };