@spatialwalk/avatarkit 1.0.0-beta.80 → 1.0.0-beta.82
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 +5 -0
- package/README.md +26 -0
- package/dist/{StreamingAudioPlayer-BT5-8dZQ.js → StreamingAudioPlayer-Pe6o4lP8.js} +1 -1
- package/dist/avatar_core_wasm-e68766db.wasm +0 -0
- package/dist/core/AvatarController.d.ts +1 -25
- package/dist/{index-a-0wPb5D.js → index-DvCy6yVA.js} +9249 -8937
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -1
- package/dist/next.d.ts +2 -0
- package/dist/types/character.d.ts +37 -1
- package/dist/types/index.d.ts +9 -0
- package/next.d.ts +1 -12
- package/next.js +115 -25
- package/package.json +20 -17
- package/dist/animation/AnimationWebSocketClient.d.ts +0 -6
- package/dist/animation/utils/eventEmitter.d.ts +0 -5
- package/dist/animation/utils/flameConverter.d.ts +0 -5
- package/dist/audio/AnimationPlayer.d.ts +0 -6
- package/dist/audio/StreamingAudioPlayer.d.ts +0 -7
- package/dist/config/app-config.d.ts +0 -43
- package/dist/config/constants.d.ts +0 -21
- package/dist/config/sdk-config-loader.d.ts +0 -6
- package/dist/core/AvatarDownloader.d.ts +0 -15
- package/dist/core/NetworkLayer.d.ts +0 -7
- package/dist/generated/common/v1/models.d.ts +0 -36
- package/dist/generated/driveningress/v1/driveningress.d.ts +0 -79
- package/dist/generated/driveningress/v2/driveningress.d.ts +0 -162
- package/dist/generated/google/protobuf/struct.d.ts +0 -107
- package/dist/generated/google/protobuf/timestamp.d.ts +0 -128
- package/dist/internal/constants.d.ts +0 -102
- package/dist/internal/index.d.ts +0 -7
- package/dist/renderer/RenderSystem.d.ts +0 -9
- package/dist/renderer/covariance.d.ts +0 -5
- package/dist/renderer/renderer.d.ts +0 -12
- package/dist/renderer/sortSplats.d.ts +0 -5
- package/dist/renderer/webgl/reorderData.d.ts +0 -7
- package/dist/renderer/webgl/webglRenderer.d.ts +0 -96
- package/dist/renderer/webgpu/webgpuRenderer.d.ts +0 -79
- package/dist/utils/animation-interpolation.d.ts +0 -8
- package/dist/utils/client-id.d.ts +0 -6
- package/dist/utils/conversationId.d.ts +0 -10
- package/dist/utils/error-utils.d.ts +0 -26
- package/dist/utils/id-manager.d.ts +0 -34
- package/dist/utils/log-sanitizer.d.ts +0 -15
- package/dist/utils/log-sink.d.ts +0 -47
- package/dist/utils/logger.d.ts +0 -25
- package/dist/utils/posthog-tracker.d.ts +0 -8
- package/dist/utils/pwa-cache-manager.d.ts +0 -17
- package/dist/utils/usage-tracker.d.ts +0 -6
- package/dist/vanilla/vite.config.d.ts +0 -2
- package/dist/wasm/avatarCoreAdapter.d.ts +0 -77
- package/dist/wasm/avatarCoreMemory.d.ts +0 -144
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/next.d.ts
ADDED
|
@@ -1,5 +1,41 @@
|
|
|
1
|
-
import { CharacterAsset } from '../generated/driveningress/v2/driveningress';
|
|
2
1
|
import { CameraSettings, CharacterSettings } from './character-settings';
|
|
2
|
+
export interface Resource {
|
|
3
|
+
type: string;
|
|
4
|
+
local: string;
|
|
5
|
+
remote: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ResourceHolder {
|
|
8
|
+
resource?: Resource;
|
|
9
|
+
}
|
|
10
|
+
export interface Models {
|
|
11
|
+
shape?: ResourceHolder;
|
|
12
|
+
gsStandard?: ResourceHolder;
|
|
13
|
+
gsHigh?: ResourceHolder;
|
|
14
|
+
gsUltra?: ResourceHolder;
|
|
15
|
+
}
|
|
16
|
+
export interface Animations {
|
|
17
|
+
frameIdle?: ResourceHolder;
|
|
18
|
+
frameMono?: ResourceHolder;
|
|
19
|
+
audioMono?: ResourceHolder;
|
|
20
|
+
}
|
|
21
|
+
export interface CustomAnimation {
|
|
22
|
+
key: string;
|
|
23
|
+
pbUrl: string;
|
|
24
|
+
wavUrl: string;
|
|
25
|
+
remark: string;
|
|
26
|
+
}
|
|
27
|
+
export interface CharacterAsset {
|
|
28
|
+
characterId: string;
|
|
29
|
+
version: string;
|
|
30
|
+
camera?: ResourceHolder;
|
|
31
|
+
models?: Models;
|
|
32
|
+
animations?: Animations;
|
|
33
|
+
background?: ResourceHolder;
|
|
34
|
+
characterSettings?: {
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
};
|
|
37
|
+
customAnimations: CustomAnimation[];
|
|
38
|
+
}
|
|
3
39
|
/**
|
|
4
40
|
* Character metadata
|
|
5
41
|
*/
|
package/dist/types/index.d.ts
CHANGED
|
@@ -163,4 +163,13 @@ export interface PostProcessingConfig {
|
|
|
163
163
|
targets?: number[];
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
|
+
export interface FlameInfo {
|
|
167
|
+
vertexCount: number;
|
|
168
|
+
faceCount: number;
|
|
169
|
+
jointCount: number;
|
|
170
|
+
}
|
|
171
|
+
export interface CharacterInfo {
|
|
172
|
+
pointCount: number;
|
|
173
|
+
hasAnimation: boolean;
|
|
174
|
+
}
|
|
166
175
|
export * from './character';
|
package/next.d.ts
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
* Next.js plugin for @spatialwalk/avatarkit
|
|
3
|
-
* Automatically handles WASM file configuration for Next.js (webpack)
|
|
4
|
-
*
|
|
5
|
-
* Usage:
|
|
6
|
-
* import { withAvatarkit } from './avatarkit-next-plugin.mjs'
|
|
7
|
-
* export default withAvatarkit({ ...your next config... })
|
|
8
|
-
*/
|
|
9
|
-
export declare function withAvatarkit(nextConfig?: Record<string, any>): {
|
|
10
|
-
webpack: (config: any, context: any) => any;
|
|
11
|
-
headers(): Promise<any[]>;
|
|
12
|
-
};
|
|
1
|
+
export declare function withAvatarkit(nextConfig?: any): any;
|
|
13
2
|
export default withAvatarkit;
|
|
14
3
|
//# sourceMappingURL=next.d.ts.map
|
package/next.js
CHANGED
|
@@ -1,32 +1,74 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Next.js plugin for @spatialwalk/avatarkit
|
|
3
|
-
*
|
|
3
|
+
* Handles WASM file configuration for both webpack and Turbopack (Next.js 15+/16+)
|
|
4
4
|
*
|
|
5
5
|
* Usage:
|
|
6
|
-
* import { withAvatarkit } from '
|
|
6
|
+
* import { withAvatarkit } from '@spatialwalk/avatarkit/next'
|
|
7
7
|
* export default withAvatarkit({ ...your next config... })
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
10
|
-
import { join } from 'path';
|
|
11
|
-
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
// This
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
import { fileURLToPath } from 'url';
|
|
10
|
+
import { dirname, join } from 'path';
|
|
11
|
+
import { writeFileSync, readFileSync, readdirSync, mkdirSync, copyFileSync, existsSync, } from 'fs';
|
|
12
|
+
// ── Locate SDK directory ──────────────────────────────────────────────
|
|
13
|
+
// Walk up from this file (inside the SDK package) to find the package root.
|
|
14
|
+
// This is reliable regardless of process.cwd(), monorepos, or hoisted deps.
|
|
15
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
16
|
+
const __dirname = dirname(__filename);
|
|
17
|
+
// Since this file IS inside the SDK package (at package root), __dirname is the SDK dir.
|
|
18
|
+
const sdkDir = __dirname;
|
|
19
|
+
const sdkDistDir = join(sdkDir, 'dist');
|
|
20
|
+
// ── Embedded webpack loader ───────────────────────────────────────────
|
|
21
|
+
// Fixes Emscripten's scriptDirectory: bundlers replace import.meta.url with
|
|
22
|
+
// a build-time path that browsers can't use to locate WASM files.
|
|
23
|
+
// This loader replaces it with the correct public path.
|
|
24
|
+
function createLoaderCode(wasmPublicPath) {
|
|
25
|
+
return `module.exports = function(source) {
|
|
26
|
+
// Strategy 1: Replace assignment only (simpler, more robust)
|
|
27
|
+
var pattern1 = /scriptDirectory\\s*=\\s*new\\s+URL\\(\\s*"\\."\\s*,\\s*_scriptName\\s*\\)\\.href\\s*;/;
|
|
28
|
+
var result = source.replace(pattern1, 'scriptDirectory = "${wasmPublicPath}";');
|
|
29
|
+
if (result !== source) return result;
|
|
30
|
+
|
|
31
|
+
// Strategy 2: Full try/catch block (handles different catch syntax)
|
|
32
|
+
var pattern2 = /try\\s*\\{\\s*scriptDirectory\\s*=\\s*new\\s+URL\\(\\s*"\\."\\s*,\\s*_scriptName\\s*\\)\\.href\\s*;?\\s*\\}\\s*catch\\s*(\\([^)]*\\))?\\s*\\{\\s*\\}/;
|
|
33
|
+
result = source.replace(pattern2, 'scriptDirectory = "${wasmPublicPath}";');
|
|
34
|
+
if (result !== source) return result;
|
|
35
|
+
|
|
36
|
+
console.warn('[avatarkit] WARNING: scriptDirectory pattern not matched in', this.resourcePath);
|
|
37
|
+
return source;
|
|
20
38
|
}
|
|
21
39
|
`;
|
|
22
|
-
|
|
23
|
-
|
|
40
|
+
}
|
|
41
|
+
function ensureLoader(wasmPublicPath) {
|
|
42
|
+
const cacheDir = join(sdkDir, '.cache');
|
|
24
43
|
const loaderPath = join(cacheDir, 'wasm-script-dir-loader.cjs');
|
|
25
44
|
mkdirSync(cacheDir, { recursive: true });
|
|
26
|
-
writeFileSync(loaderPath,
|
|
45
|
+
writeFileSync(loaderPath, createLoaderCode(wasmPublicPath));
|
|
27
46
|
return loaderPath;
|
|
28
47
|
}
|
|
29
|
-
// ──
|
|
48
|
+
// ── Copy WASM files to public directory ───────────────────────────────
|
|
49
|
+
// Works for both webpack and Turbopack: public/ files are served by Next.js
|
|
50
|
+
function copyWasmToPublic(projectDir) {
|
|
51
|
+
const publicWasmDir = join(projectDir, 'public', '_avatarkit');
|
|
52
|
+
mkdirSync(publicWasmDir, { recursive: true });
|
|
53
|
+
try {
|
|
54
|
+
const files = readdirSync(sdkDistDir);
|
|
55
|
+
for (const file of files) {
|
|
56
|
+
if (file.startsWith('avatar_core_wasm') && file.endsWith('.wasm')) {
|
|
57
|
+
const src = join(sdkDistDir, file);
|
|
58
|
+
const dest = join(publicWasmDir, file);
|
|
59
|
+
copyFileSync(src, dest);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
console.warn('[avatarkit] Failed to copy WASM files:', err.message);
|
|
65
|
+
console.warn('[avatarkit] SDK dist dir:', sdkDistDir);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// ── Webpack plugin: copy WASM to build output ─────────────────────────
|
|
69
|
+
// Emits WASM files into .next/static/chunks/ during webpack compilation.
|
|
70
|
+
// This is needed in addition to public/ for standalone Docker deployments
|
|
71
|
+
// where .next/static/ is copied but public/ may not be.
|
|
30
72
|
class CopyWasmPlugin {
|
|
31
73
|
apply(compiler) {
|
|
32
74
|
compiler.hooks.thisCompilation.tap('AvatarkitCopyWasm', (compilation) => {
|
|
@@ -34,28 +76,75 @@ class CopyWasmPlugin {
|
|
|
34
76
|
name: 'AvatarkitCopyWasm',
|
|
35
77
|
stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL,
|
|
36
78
|
}, () => {
|
|
37
|
-
const wasmDir = join(process.cwd(), 'node_modules', '@spatialwalk', 'avatarkit', 'dist');
|
|
38
79
|
try {
|
|
39
|
-
const files = readdirSync(
|
|
80
|
+
const files = readdirSync(sdkDistDir);
|
|
40
81
|
for (const file of files) {
|
|
41
82
|
if (file.startsWith('avatar_core_wasm') && file.endsWith('.wasm')) {
|
|
42
|
-
const content = readFileSync(join(
|
|
83
|
+
const content = readFileSync(join(sdkDistDir, file));
|
|
43
84
|
compilation.emitAsset(`static/chunks/${file}`, new compiler.webpack.sources.RawSource(content));
|
|
44
85
|
}
|
|
45
86
|
}
|
|
46
87
|
}
|
|
47
88
|
catch (err) {
|
|
48
|
-
console.warn('[avatarkit]
|
|
89
|
+
console.warn('[avatarkit] CopyWasmPlugin error:', err.message);
|
|
49
90
|
}
|
|
50
91
|
});
|
|
51
92
|
});
|
|
52
93
|
}
|
|
53
94
|
}
|
|
54
|
-
// ──
|
|
95
|
+
// ── Detect project root from next.config location ─────────────────────
|
|
96
|
+
// next.config.mjs is always at the project root. Since this module is imported
|
|
97
|
+
// from next.config.mjs, we find the project root by walking up from import.meta.url
|
|
98
|
+
// of the calling module. However, we can't access the caller's import.meta.url,
|
|
99
|
+
// so we search for the nearest next.config.* file from the SDK location upwards.
|
|
100
|
+
function findProjectRoot() {
|
|
101
|
+
let dir = process.cwd(); // fallback, but also check for next.config
|
|
102
|
+
const configNames = [
|
|
103
|
+
'next.config.mjs',
|
|
104
|
+
'next.config.js',
|
|
105
|
+
'next.config.ts',
|
|
106
|
+
'next.config.cjs',
|
|
107
|
+
];
|
|
108
|
+
// Verify cwd has a next.config file
|
|
109
|
+
for (const name of configNames) {
|
|
110
|
+
if (existsSync(join(dir, name))) {
|
|
111
|
+
return dir;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
// Fallback: search from SDK location upward
|
|
115
|
+
let searchDir = sdkDir;
|
|
116
|
+
while (searchDir !== dirname(searchDir)) {
|
|
117
|
+
for (const name of configNames) {
|
|
118
|
+
if (existsSync(join(searchDir, name))) {
|
|
119
|
+
return searchDir;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
searchDir = dirname(searchDir);
|
|
123
|
+
}
|
|
124
|
+
return process.cwd();
|
|
125
|
+
}
|
|
126
|
+
// ── Main plugin ───────────────────────────────────────────────────────
|
|
55
127
|
export function withAvatarkit(nextConfig = {}) {
|
|
56
|
-
const
|
|
128
|
+
const basePath = nextConfig.basePath || '';
|
|
129
|
+
const wasmPublicPath = `${basePath}/_avatarkit/`;
|
|
130
|
+
const loaderPath = ensureLoader(wasmPublicPath);
|
|
131
|
+
const projectRoot = findProjectRoot();
|
|
132
|
+
// Copy WASM files to public/_avatarkit/ (works for both webpack & Turbopack)
|
|
133
|
+
copyWasmToPublic(projectRoot);
|
|
57
134
|
return {
|
|
58
135
|
...nextConfig,
|
|
136
|
+
// ── Turbopack configuration (Next.js 15+/16+) ──
|
|
137
|
+
turbopack: {
|
|
138
|
+
...nextConfig.turbopack,
|
|
139
|
+
rules: {
|
|
140
|
+
...nextConfig.turbopack?.rules,
|
|
141
|
+
'**/avatar_core_wasm*.js': {
|
|
142
|
+
loaders: [loaderPath],
|
|
143
|
+
as: '*.js',
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
// ── Webpack configuration ──
|
|
59
148
|
webpack: (config, context) => {
|
|
60
149
|
// 1. Fix: Next.js sets module.generator.asset.filename which breaks asset/inline
|
|
61
150
|
if (config.module.generator?.asset?.filename) {
|
|
@@ -72,7 +161,7 @@ export function withAvatarkit(nextConfig = {}) {
|
|
|
72
161
|
enforce: 'pre',
|
|
73
162
|
use: [{ loader: loaderPath }],
|
|
74
163
|
});
|
|
75
|
-
// 3. Copy WASM files to static/chunks/ (client only)
|
|
164
|
+
// 3. Copy WASM files to static/chunks/ (client build only, for standalone)
|
|
76
165
|
if (!context.isServer) {
|
|
77
166
|
config.plugins.push(new CopyWasmPlugin());
|
|
78
167
|
}
|
|
@@ -82,12 +171,13 @@ export function withAvatarkit(nextConfig = {}) {
|
|
|
82
171
|
}
|
|
83
172
|
return config;
|
|
84
173
|
},
|
|
174
|
+
// ── Headers: ensure WASM content-type ──
|
|
85
175
|
async headers() {
|
|
86
176
|
const userHeaders = typeof nextConfig.headers === 'function' ? await nextConfig.headers() : [];
|
|
87
177
|
return [
|
|
88
178
|
...userHeaders,
|
|
89
179
|
{
|
|
90
|
-
source: '/
|
|
180
|
+
source: '/_avatarkit/:path*.wasm',
|
|
91
181
|
headers: [{ key: 'Content-Type', value: 'application/wasm' }],
|
|
92
182
|
},
|
|
93
183
|
];
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spatialwalk/avatarkit",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-beta.
|
|
5
|
-
"packageManager": "pnpm@10.18.2",
|
|
4
|
+
"version": "1.0.0-beta.82",
|
|
6
5
|
"description": "AvatarKit SDK - 3D Gaussian Splatting Avatar Rendering SDK",
|
|
7
6
|
"author": "AvatarKit Team",
|
|
8
7
|
"license": "MIT",
|
|
@@ -44,26 +43,18 @@
|
|
|
44
43
|
"next.js",
|
|
45
44
|
"next.d.ts"
|
|
46
45
|
],
|
|
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
|
-
"clean": "rm -rf dist",
|
|
53
|
-
"typecheck": "tsc --noEmit",
|
|
54
|
-
"test": "cd tests && pnpm test",
|
|
55
|
-
"test:watch": "cd tests && pnpm run test:watch",
|
|
56
|
-
"test:e2e": "cd tests && pnpm run test:e2e",
|
|
57
|
-
"test:perf": "cd tests && pnpm run test:perf"
|
|
58
|
-
},
|
|
59
46
|
"peerDependencies": {
|
|
60
47
|
"@webgpu/types": "*",
|
|
61
48
|
"vite": "^5.0.0",
|
|
62
49
|
"next": ">=13.0.0"
|
|
63
50
|
},
|
|
64
51
|
"peerDependenciesMeta": {
|
|
65
|
-
"vite": {
|
|
66
|
-
|
|
52
|
+
"vite": {
|
|
53
|
+
"optional": true
|
|
54
|
+
},
|
|
55
|
+
"next": {
|
|
56
|
+
"optional": true
|
|
57
|
+
}
|
|
67
58
|
},
|
|
68
59
|
"dependencies": {
|
|
69
60
|
"@bufbuild/protobuf": "^2.10.0",
|
|
@@ -78,5 +69,17 @@
|
|
|
78
69
|
"typescript": "^5.0.0",
|
|
79
70
|
"vite": "^5.0.0",
|
|
80
71
|
"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
|
+
"clean": "rm -rf dist",
|
|
79
|
+
"typecheck": "tsc --noEmit",
|
|
80
|
+
"test": "cd tests && pnpm test",
|
|
81
|
+
"test:watch": "cd tests && pnpm run test:watch",
|
|
82
|
+
"test:e2e": "cd tests && pnpm run test:e2e",
|
|
83
|
+
"test:perf": "cd tests && pnpm run test:perf"
|
|
81
84
|
}
|
|
82
|
-
}
|
|
85
|
+
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
export declare const APP_CONFIG: {
|
|
2
|
-
testEnv: boolean;
|
|
3
|
-
readonly debug: boolean;
|
|
4
|
-
rendering: {
|
|
5
|
-
/**
|
|
6
|
-
* Sort mode
|
|
7
|
-
* - 'balance': Performance first, sort first frame then reuse (default)
|
|
8
|
-
* - 'quality': Quality first, re-sort every frame
|
|
9
|
-
*/
|
|
10
|
-
sortMode: "balance" | "quality";
|
|
11
|
-
};
|
|
12
|
-
camera: {
|
|
13
|
-
position: [number, number, number];
|
|
14
|
-
target: [number, number, number];
|
|
15
|
-
fov: number;
|
|
16
|
-
near: number;
|
|
17
|
-
far: number;
|
|
18
|
-
};
|
|
19
|
-
animation: {
|
|
20
|
-
fps: number;
|
|
21
|
-
};
|
|
22
|
-
audio: {
|
|
23
|
-
sampleRate: number;
|
|
24
|
-
};
|
|
25
|
-
avatar: {
|
|
26
|
-
baseAssetsPath: string;
|
|
27
|
-
wasmPath: string;
|
|
28
|
-
};
|
|
29
|
-
flame: {
|
|
30
|
-
cdnBaseUrl: string;
|
|
31
|
-
resources: {
|
|
32
|
-
flameModel: string;
|
|
33
|
-
flameTemplate: string;
|
|
34
|
-
teethPb: string;
|
|
35
|
-
teethNpz: string;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
wasm: {
|
|
39
|
-
logLevel: "basic" | "verbose";
|
|
40
|
-
enableValidation: boolean;
|
|
41
|
-
enablePerformanceMetrics: boolean;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Environment } from '../types';
|
|
2
|
-
export declare const POSTHOG_HOST_CN: string;
|
|
3
|
-
export declare const POSTHOG_API_KEY_CN: string;
|
|
4
|
-
export declare const POSTHOG_HOST_INTL: string;
|
|
5
|
-
export declare const POSTHOG_API_KEY_INTL: string;
|
|
6
|
-
export declare const POSTHOG_TRACK_EVENTS: boolean;
|
|
7
|
-
export declare const POSTHOG_PROJECT_NAME: string;
|
|
8
|
-
export declare function getPostHogConfig(_environment: Environment): {
|
|
9
|
-
host: string;
|
|
10
|
-
apiKey: string;
|
|
11
|
-
disableCompression: boolean;
|
|
12
|
-
};
|
|
13
|
-
export declare const ENV_TEST: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Comprehensive debug mode check
|
|
16
|
-
* Returns true if:
|
|
17
|
-
* - VITE_ENV_TEST is 'true', OR
|
|
18
|
-
* - Running in DEV mode, OR
|
|
19
|
-
* - URL has debug=1 parameter
|
|
20
|
-
*/
|
|
21
|
-
export declare function isDebugMode(): boolean;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Avatar Downloader (iOS Compatible)
|
|
3
|
-
* Downloads character resources from CharacterMeta structure
|
|
4
|
-
*/
|
|
5
|
-
export declare class AvatarDownloader {
|
|
6
|
-
private baseAssetsPath;
|
|
7
|
-
constructor(baseAssetsPath?: string);
|
|
8
|
-
/**
|
|
9
|
-
* Get AvatarKit SDK API Client (api.open.spatialwalk.top for cn, api.intl.spatialwalk.cloud for intl)
|
|
10
|
-
* Used for: character details and resource URLs (public endpoints, no auth required)
|
|
11
|
-
* Note: This endpoint does not require authentication, so we don't add X-App-Id or Authorization headers
|
|
12
|
-
* to avoid CORS preflight requests for simple GET requests
|
|
13
|
-
*/
|
|
14
|
-
private getSdkApiClient;
|
|
15
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NetworkLayer - Network communication layer
|
|
3
|
-
* Responsible for WebSocket connections, protocol handling, and data retrieval
|
|
4
|
-
* Automatically calls AvatarController (playback layer) interfaces after obtaining data
|
|
5
|
-
* @internal Not part of public API
|
|
6
|
-
*/
|
|
7
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
|
|
2
|
-
export declare const protobufPackage = "common.v1";
|
|
3
|
-
/**
|
|
4
|
-
* CustomAnimation 自定义动画配置
|
|
5
|
-
* 用于角色资产组的自定义动画定义
|
|
6
|
-
*/
|
|
7
|
-
export interface CustomAnimation {
|
|
8
|
-
/** 动画唯一标识 */
|
|
9
|
-
key: string;
|
|
10
|
-
/** pb类型动画文件URL */
|
|
11
|
-
pbUrl: string;
|
|
12
|
-
/** wav类型音频文件URL(可选) */
|
|
13
|
-
wavUrl: string;
|
|
14
|
-
/** 备注说明 */
|
|
15
|
-
remark: string;
|
|
16
|
-
}
|
|
17
|
-
export declare const CustomAnimation: MessageFns<CustomAnimation>;
|
|
18
|
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
19
|
-
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
20
|
-
[K in keyof T]?: DeepPartial<T[K]>;
|
|
21
|
-
} : Partial<T>;
|
|
22
|
-
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
23
|
-
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
24
|
-
[K in keyof P]: Exact<P[K], I[K]>;
|
|
25
|
-
} & {
|
|
26
|
-
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
27
|
-
};
|
|
28
|
-
export interface MessageFns<T> {
|
|
29
|
-
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
30
|
-
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
31
|
-
fromJSON(object: any): T;
|
|
32
|
-
toJSON(message: T): unknown;
|
|
33
|
-
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
34
|
-
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
35
|
-
}
|
|
36
|
-
export {};
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
|
|
2
|
-
export declare const protobufPackage = "driveningress.v1";
|
|
3
|
-
export declare enum MessageType {
|
|
4
|
-
MESSAGE_UNSPECIFIED = 0,
|
|
5
|
-
MESSAGE_ERROR = 2,
|
|
6
|
-
MESSAGE_SERVER_RESPONSE_ANIMATION = 1004,
|
|
7
|
-
MESSAGE_CLIENT_AUDIO_INPUT = 2003,
|
|
8
|
-
UNRECOGNIZED = -1
|
|
9
|
-
}
|
|
10
|
-
export declare function messageTypeFromJSON(object: any): MessageType;
|
|
11
|
-
export declare function messageTypeToJSON(object: MessageType): string;
|
|
12
|
-
/**
|
|
13
|
-
* 兼容流式传输,只要 req_id 相同,客户端可以将音频分段发若干个 ClientAudioInputData
|
|
14
|
-
* 新 req_id 出现后,老 req_id 的请求将被忽略
|
|
15
|
-
*/
|
|
16
|
-
export interface ClientAudioInputData {
|
|
17
|
-
reqId: string;
|
|
18
|
-
audio: Uint8Array;
|
|
19
|
-
end: boolean;
|
|
20
|
-
}
|
|
21
|
-
export interface Flame {
|
|
22
|
-
/** 平移 */
|
|
23
|
-
translation: number[];
|
|
24
|
-
/** 旋转 */
|
|
25
|
-
rotation: number[];
|
|
26
|
-
/** 脖子 */
|
|
27
|
-
neckPose: number[];
|
|
28
|
-
/** 下巴 */
|
|
29
|
-
jawPose: number[];
|
|
30
|
-
/** 眼睛 */
|
|
31
|
-
eyePose: number[];
|
|
32
|
-
/** 眼皮 */
|
|
33
|
-
eyeLid: number[];
|
|
34
|
-
/** 表情参数 */
|
|
35
|
-
expression: number[];
|
|
36
|
-
}
|
|
37
|
-
export interface FlameAnimation {
|
|
38
|
-
keyframes: Flame[];
|
|
39
|
-
}
|
|
40
|
-
export interface ServerResponseAnimationData {
|
|
41
|
-
reqId: string;
|
|
42
|
-
animation?: FlameAnimation | undefined;
|
|
43
|
-
}
|
|
44
|
-
export interface ErrorInfo {
|
|
45
|
-
reqId: string;
|
|
46
|
-
code: number;
|
|
47
|
-
reason: string;
|
|
48
|
-
}
|
|
49
|
-
export interface Message {
|
|
50
|
-
type: MessageType;
|
|
51
|
-
error?: ErrorInfo | undefined;
|
|
52
|
-
serverResponseAnimation?: ServerResponseAnimationData | undefined;
|
|
53
|
-
clientAudioInput?: ClientAudioInputData | undefined;
|
|
54
|
-
}
|
|
55
|
-
export declare const ClientAudioInputData: MessageFns<ClientAudioInputData>;
|
|
56
|
-
export declare const Flame: MessageFns<Flame>;
|
|
57
|
-
export declare const FlameAnimation: MessageFns<FlameAnimation>;
|
|
58
|
-
export declare const ServerResponseAnimationData: MessageFns<ServerResponseAnimationData>;
|
|
59
|
-
export declare const ErrorInfo: MessageFns<ErrorInfo>;
|
|
60
|
-
export declare const Message: MessageFns<Message>;
|
|
61
|
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
62
|
-
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
63
|
-
[K in keyof T]?: DeepPartial<T[K]>;
|
|
64
|
-
} : Partial<T>;
|
|
65
|
-
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
66
|
-
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
67
|
-
[K in keyof P]: Exact<P[K], I[K]>;
|
|
68
|
-
} & {
|
|
69
|
-
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
70
|
-
};
|
|
71
|
-
export interface MessageFns<T> {
|
|
72
|
-
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
73
|
-
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
74
|
-
fromJSON(object: any): T;
|
|
75
|
-
toJSON(message: T): unknown;
|
|
76
|
-
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
77
|
-
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
78
|
-
}
|
|
79
|
-
export {};
|