@spatius/avatarkit 1.3.4 → 1.3.5

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.
@@ -1,85 +0,0 @@
1
- import { bt as isDebugMode } from "./logger-B_tTFAYq.js";
2
- //#region config/app-config.ts
3
- var GLOBAL_FLAME_CDN_BASE = "https://cdn.spatialwalk.cloud/public";
4
- var CN_FLAME_CDN_BASE = "https://cdn.spatialwalk.top/public";
5
- function getFlameCdnBase(region) {
6
- return region.startsWith("cn-") ? CN_FLAME_CDN_BASE : GLOBAL_FLAME_CDN_BASE;
7
- }
8
- var APP_CONFIG = {
9
- testEnv: false,
10
- get debug() {
11
- return isDebugMode();
12
- },
13
- rendering: {
14
- /**
15
- * Sort mode
16
- * - 'balance': Performance first, sort first frame then reuse (default)
17
- * - 'quality': Quality first, re-sort every frame
18
- */
19
- sortMode: "balance" },
20
- camera: {
21
- position: [
22
- -.02,
23
- -.013,
24
- 1.5
25
- ],
26
- target: [
27
- 0,
28
- 0,
29
- 0
30
- ],
31
- fov: 22,
32
- near: .01,
33
- far: 100
34
- },
35
- animation: { fps: 25 },
36
- audio: { sampleRate: 16e3 },
37
- avatar: {
38
- baseAssetsPath: "",
39
- wasmPath: "./wasm/avatar_core_wasm.js"
40
- },
41
- flame: {
42
- cdnBase: GLOBAL_FLAME_CDN_BASE,
43
- unifiedModelPath: "unified_model_body.pb.gz"
44
- },
45
- wasm: {
46
- logLevel: "basic",
47
- enableValidation: false,
48
- enablePerformanceMetrics: true
49
- }
50
- };
51
- //#endregion
52
- //#region utils/error-utils.ts
53
- /**
54
- * Error Utility Functions
55
- * Provides consistent error handling and formatting across the application
56
- */
57
- /**
58
- * Convert unknown error to a readable error message string
59
- *
60
- * @param err - Unknown error object (could be Error, string, object, etc.)
61
- * @returns Formatted error message string
62
- *
63
- * @example
64
- * try {
65
- * riskyOperation()
66
- * } catch (err) {
67
- * const message = errorToMessage(err)
68
- * logger.error('Operation failed:', message)
69
- * }
70
- */
71
- function errorToMessage(err) {
72
- if (err instanceof Error) return err.message;
73
- if (typeof err === "string") return err;
74
- if (typeof err === "object" && err !== null) {
75
- if ("message" in err && typeof err.message === "string") return err.message;
76
- try {
77
- return JSON.stringify(err);
78
- } catch {
79
- return String(err);
80
- }
81
- }
82
- return String(err);
83
- }
84
- //#endregion
85
- export { APP_CONFIG as n, getFlameCdnBase as r, errorToMessage as t };