@spatialwalk/avatarkit 1.0.0-beta.90 → 1.0.0-beta.91
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 +6 -0
- package/dist/{StreamingAudioPlayer-GS4x7i1m.js → StreamingAudioPlayer-CGUA8-w0.js} +1 -1
- package/dist/avatar_core_wasm-9834c91c.wasm +0 -0
- package/dist/{index-jdCd5L22.js → index-BYr_FIpm.js} +30 -10
- package/dist/index.js +1 -1
- package/package.json +17 -16
- package/dist/assets/cpu-benchmark-worker-C6iFEUSO.js +0 -36
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ 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.91] - 2026-03-19
|
|
9
|
+
|
|
10
|
+
### 🐛 Bugfixes
|
|
11
|
+
|
|
12
|
+
- **Inline CPU Benchmark Worker** — Consumers using Vite could not build: `Could not resolve entry module "public/assets/cpu-benchmark-worker-*.js"`. Root cause: `new URL()` worker pattern in Vite library mode compiles to absolute path that downstream bundlers cannot resolve. Fixed by replacing with inline Blob URL worker.
|
|
13
|
+
|
|
8
14
|
## [1.0.0-beta.90] - 2026-03-18
|
|
9
15
|
|
|
10
16
|
### 🐛 Bugfixes
|
|
@@ -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-
|
|
4
|
+
import { A as APP_CONFIG, l as logger, e as errorToMessage, a as logEvent } from "./index-BYr_FIpm.js";
|
|
5
5
|
class StreamingAudioPlayer {
|
|
6
6
|
// Mark if AudioContext is being resumed, avoid concurrent resume requests
|
|
7
7
|
constructor(options) {
|
|
File without changes
|
|
@@ -9495,7 +9495,7 @@ const _AnimationPlayer = class _AnimationPlayer {
|
|
|
9495
9495
|
if (this.streamingPlayer) {
|
|
9496
9496
|
return;
|
|
9497
9497
|
}
|
|
9498
|
-
const { StreamingAudioPlayer } = await import("./StreamingAudioPlayer-
|
|
9498
|
+
const { StreamingAudioPlayer } = await import("./StreamingAudioPlayer-CGUA8-w0.js");
|
|
9499
9499
|
const { AvatarSDK: AvatarSDK2 } = await Promise.resolve().then(() => AvatarSDK$1);
|
|
9500
9500
|
const audioFormat = AvatarSDK2.getAudioFormat();
|
|
9501
9501
|
this.streamingPlayer = new StreamingAudioPlayer({
|
|
@@ -11054,24 +11054,44 @@ async function gpuBenchmark() {
|
|
|
11054
11054
|
return 0;
|
|
11055
11055
|
}
|
|
11056
11056
|
}
|
|
11057
|
+
const workerCode = `
|
|
11058
|
+
const N = 128;
|
|
11059
|
+
const A = new Float32Array(N * N);
|
|
11060
|
+
const B = new Float32Array(N * N);
|
|
11061
|
+
const C = new Float32Array(N * N);
|
|
11062
|
+
for (let i = 0; i < A.length; i++) { A[i] = (i % 100) / 100; B[i] = ((i * 7) % 100) / 100; }
|
|
11063
|
+
function bench() {
|
|
11064
|
+
for (let i = 0; i < N; i++)
|
|
11065
|
+
for (let j = 0; j < N; j++) {
|
|
11066
|
+
let s = 0;
|
|
11067
|
+
for (let k = 0; k < N; k++) s += A[i * N + k] * B[k * N + j];
|
|
11068
|
+
C[i * N + j] = s;
|
|
11069
|
+
}
|
|
11070
|
+
}
|
|
11071
|
+
self.onmessage = () => {
|
|
11072
|
+
const w = performance.now() + 1000;
|
|
11073
|
+
while (performance.now() < w) bench();
|
|
11074
|
+
let it = 0;
|
|
11075
|
+
const m = performance.now() + 1000;
|
|
11076
|
+
while (performance.now() < m) { bench(); it++; }
|
|
11077
|
+
self.postMessage({ cpuScore: it });
|
|
11078
|
+
};
|
|
11079
|
+
`;
|
|
11057
11080
|
function cpuBenchmark() {
|
|
11058
11081
|
return new Promise((resolve2) => {
|
|
11059
11082
|
try {
|
|
11060
|
-
const
|
|
11061
|
-
|
|
11062
|
-
|
|
11063
|
-
"/assets/cpu-benchmark-worker-C6iFEUSO.js",
|
|
11064
|
-
import.meta.url
|
|
11065
|
-
),
|
|
11066
|
-
{ type: "module" }
|
|
11067
|
-
);
|
|
11083
|
+
const blob = new Blob([workerCode], { type: "application/javascript" });
|
|
11084
|
+
const url = URL.createObjectURL(blob);
|
|
11085
|
+
const worker = new Worker(url, { type: "classic" });
|
|
11068
11086
|
worker.onmessage = (e2) => {
|
|
11069
11087
|
resolve2(e2.data.cpuScore);
|
|
11070
11088
|
worker.terminate();
|
|
11089
|
+
URL.revokeObjectURL(url);
|
|
11071
11090
|
};
|
|
11072
11091
|
worker.onerror = () => {
|
|
11073
11092
|
resolve2(0);
|
|
11074
11093
|
worker.terminate();
|
|
11094
|
+
URL.revokeObjectURL(url);
|
|
11075
11095
|
};
|
|
11076
11096
|
worker.postMessage("start");
|
|
11077
11097
|
} catch {
|
|
@@ -11453,7 +11473,7 @@ class AvatarSDK {
|
|
|
11453
11473
|
__publicField(AvatarSDK, "_initializationState", "uninitialized");
|
|
11454
11474
|
__publicField(AvatarSDK, "_initializingPromise", null);
|
|
11455
11475
|
__publicField(AvatarSDK, "_configuration", null);
|
|
11456
|
-
__publicField(AvatarSDK, "_version", "1.0.0-beta.
|
|
11476
|
+
__publicField(AvatarSDK, "_version", "1.0.0-beta.91");
|
|
11457
11477
|
__publicField(AvatarSDK, "_avatarCore", null);
|
|
11458
11478
|
__publicField(AvatarSDK, "_dynamicSdkConfig", null);
|
|
11459
11479
|
__publicField(AvatarSDK, "_cachedDeviceScore", null);
|
package/dist/index.js
CHANGED
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.
|
|
4
|
+
"version": "1.0.0-beta.91",
|
|
5
|
+
"packageManager": "pnpm@10.18.2",
|
|
5
6
|
"description": "AvatarKit SDK - 3D Gaussian Splatting Avatar Rendering SDK",
|
|
6
7
|
"author": "AvatarKit Team",
|
|
7
8
|
"license": "MIT",
|
|
@@ -43,6 +44,20 @@
|
|
|
43
44
|
"next.js",
|
|
44
45
|
"next.d.ts"
|
|
45
46
|
],
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "SDK_BUILD=true vite build --mode library && npm run build:vite-plugin && npm run build:next-plugin",
|
|
49
|
+
"build:vite-plugin": "tsc vite.ts --outDir . --module esnext --target es2020 --moduleResolution bundler --esModuleInterop --skipLibCheck --declaration --declarationMap",
|
|
50
|
+
"build:next-plugin": "tsc next.ts --outDir . --module esnext --target es2020 --moduleResolution bundler --esModuleInterop --skipLibCheck --declaration --declarationMap",
|
|
51
|
+
"dev": "vite build --mode library --watch",
|
|
52
|
+
"demo": "vite --config demo/vite.config.mjs",
|
|
53
|
+
"demo:benchmark": "vite --config benchmark-demo/vite.config.mjs",
|
|
54
|
+
"clean": "rm -rf dist",
|
|
55
|
+
"typecheck": "tsc --noEmit",
|
|
56
|
+
"test": "cd tests && pnpm test",
|
|
57
|
+
"test:watch": "cd tests && pnpm run test:watch",
|
|
58
|
+
"test:e2e": "cd tests && pnpm run test:e2e",
|
|
59
|
+
"test:perf": "cd tests && pnpm run test:perf"
|
|
60
|
+
},
|
|
46
61
|
"peerDependencies": {
|
|
47
62
|
"@webgpu/types": "*",
|
|
48
63
|
"vite": "^5.0.0",
|
|
@@ -69,19 +84,5 @@
|
|
|
69
84
|
"typescript": "^5.0.0",
|
|
70
85
|
"vite": "^5.0.0",
|
|
71
86
|
"vite-plugin-dts": "^4.5.4"
|
|
72
|
-
},
|
|
73
|
-
"scripts": {
|
|
74
|
-
"build": "SDK_BUILD=true vite build --mode library && npm run build:vite-plugin && npm run build:next-plugin",
|
|
75
|
-
"build:vite-plugin": "tsc vite.ts --outDir . --module esnext --target es2020 --moduleResolution bundler --esModuleInterop --skipLibCheck --declaration --declarationMap",
|
|
76
|
-
"build:next-plugin": "tsc next.ts --outDir . --module esnext --target es2020 --moduleResolution bundler --esModuleInterop --skipLibCheck --declaration --declarationMap",
|
|
77
|
-
"dev": "vite build --mode library --watch",
|
|
78
|
-
"demo": "vite --config demo/vite.config.mjs",
|
|
79
|
-
"demo:benchmark": "vite --config benchmark-demo/vite.config.mjs",
|
|
80
|
-
"clean": "rm -rf dist",
|
|
81
|
-
"typecheck": "tsc --noEmit",
|
|
82
|
-
"test": "cd tests && pnpm test",
|
|
83
|
-
"test:watch": "cd tests && pnpm run test:watch",
|
|
84
|
-
"test:e2e": "cd tests && pnpm run test:e2e",
|
|
85
|
-
"test:perf": "cd tests && pnpm run test:perf"
|
|
86
87
|
}
|
|
87
|
-
}
|
|
88
|
+
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
(function() {
|
|
2
|
-
"use strict";
|
|
3
|
-
const MATRIX_SIZE = 128;
|
|
4
|
-
const A = new Float32Array(MATRIX_SIZE * MATRIX_SIZE);
|
|
5
|
-
const B = new Float32Array(MATRIX_SIZE * MATRIX_SIZE);
|
|
6
|
-
const C = new Float32Array(MATRIX_SIZE * MATRIX_SIZE);
|
|
7
|
-
for (let i = 0; i < A.length; i++) {
|
|
8
|
-
A[i] = i % 100 / 100;
|
|
9
|
-
B[i] = i * 7 % 100 / 100;
|
|
10
|
-
}
|
|
11
|
-
function benchmarkMatrixMultiply() {
|
|
12
|
-
const N = MATRIX_SIZE;
|
|
13
|
-
for (let i = 0; i < N; i++) {
|
|
14
|
-
for (let j = 0; j < N; j++) {
|
|
15
|
-
let sum = 0;
|
|
16
|
-
for (let k = 0; k < N; k++) {
|
|
17
|
-
sum += A[i * N + k] * B[k * N + j];
|
|
18
|
-
}
|
|
19
|
-
C[i * N + j] = sum;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
self.onmessage = () => {
|
|
24
|
-
const warmupEnd = performance.now() + 1e3;
|
|
25
|
-
while (performance.now() < warmupEnd) {
|
|
26
|
-
benchmarkMatrixMultiply();
|
|
27
|
-
}
|
|
28
|
-
let iterations = 0;
|
|
29
|
-
const measureEnd = performance.now() + 1e3;
|
|
30
|
-
while (performance.now() < measureEnd) {
|
|
31
|
-
benchmarkMatrixMultiply();
|
|
32
|
-
iterations++;
|
|
33
|
-
}
|
|
34
|
-
self.postMessage({ cpuScore: iterations });
|
|
35
|
-
};
|
|
36
|
-
})();
|