@spatius/avatarkit 1.3.1-beta.6 → 1.3.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.
Files changed (22) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/{AvatarDownloader-Dfi7wtgQ.js → AvatarDownloader-DyhenPKd.js} +98 -43
  3. package/dist/{AvatarSDK-CnZqa_X4.js → AvatarSDK-DgPvHU4L.js} +162 -2560
  4. package/dist/{OpusCodec-D9DcUV65.js → OpusCodec-CXU7ysrU.js} +43 -9
  5. package/dist/{OpusDecoderProxy-Ar_dFXRB.js → OpusDecoderProxy-Cq8Z_MZY.js} +19 -6
  6. package/dist/{OpusEncoderProxy-9YIZ7nIt.js → OpusEncoderProxy-CzY-VckE.js} +42 -7
  7. package/dist/{StreamingAudioPlayer-D4q7c1U0.js → StreamingAudioPlayer-CIJmBp3z.js} +2 -2
  8. package/dist/assets/{AvatarDownloader-D5GePpJ2.js → AvatarDownloader-G5FO1bVl.js} +96 -41
  9. package/dist/assets/{AvatarSDK-DR8dNylh.js → AvatarSDK-C_Anluwp.js} +149 -12
  10. package/dist/assets/{OpusDecoderWorker.worker-B7R93nev.js → OpusDecoderWorker.worker-C2T0afkj.js} +21 -5
  11. package/dist/assets/{OpusEncoderWorker.worker-BYWIV5xu.js → OpusEncoderWorker.worker-DLYO9vPK.js} +53 -11
  12. package/dist/assets/{logger-D8rDVim7.js → logger-YPooEAbA.js} +451 -132
  13. package/dist/core/AvatarController.d.ts +10 -0
  14. package/dist/{error-utils-CqKOrHrY.js → error-utils-BogEllAd.js} +1 -1
  15. package/dist/index.js +279 -46
  16. package/dist/internal-telemetry.d.ts +45 -20
  17. package/dist/internal-telemetry.js +27 -2
  18. package/dist/{logger-fAU8oahT.js → logger-BOpQ7u0w.js} +468 -132
  19. package/dist/otel-trace-Ct4T48nC.js +2565 -0
  20. package/dist/{pwa-cache-manager-CwXaM3xR.js → pwa-cache-manager-C7NbU52Q.js} +1 -1
  21. package/dist/types/index.d.ts +30 -4
  22. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { n as __exportAll } from "./rolldown-runtime-B-1-B7_t.js";
2
- import { t as logger } from "./logger-fAU8oahT.js";
2
+ import { t as logger } from "./logger-BOpQ7u0w.js";
3
3
  //#region utils/pwa-cache-manager.ts
4
4
  /**
5
5
  * PWA Cache Manager
@@ -5,7 +5,29 @@ export declare enum DrivingServiceMode {
5
5
  /** Driven by SDK directly */
6
6
  direct = "direct",
7
7
  /** Driven by host application */
8
- backend = "backend"
8
+ backend = "backend",
9
+ /**
10
+ * Use this **only** when driving the avatar through the companion RTC SDK,
11
+ * `@spatius/avatarkit-rtc`. If you are not using that package, stay on
12
+ * `direct` / `backend` — do not switch to this because it looks newer.
13
+ *
14
+ * **Telemetry dimension only — it gates no behaviour.** Every session reports
15
+ * `dsm`; without a value of its own, RTC traffic would be indistinguishable
16
+ * from plain `backend` traffic on the dashboards.
17
+ *
18
+ * It deliberately does not unlock any API. RTC drives the avatar frame by
19
+ * frame through `AvatarView.renderFrame` / `renderFromProtobuf`, which put the
20
+ * view into pure-rendering mode on their own — it never calls the host-driven
21
+ * feeding path (`yieldAudioData` / `yieldFramesData`) that `backend` exists
22
+ * for. So the `=== backend` checks guarding those methods are left untouched:
23
+ * loosening them for `rtc` would widen the reachable API surface without
24
+ * enabling anything RTC actually uses.
25
+ *
26
+ * Note the two concepts sit at different levels and are not interchangeable:
27
+ * pure-rendering mode is a per-frame runtime state of the render loop, while
28
+ * this is a session-wide value declared once at `initialize`.
29
+ */
30
+ rtc = "rtc"
9
31
  }
10
32
  /**
11
33
  * Strategy for handling animation-frame starvation (animation frames can't keep up
@@ -46,13 +68,17 @@ export interface AudioFormat {
46
68
  * the uplink is raw PCM unless you opt in.
47
69
  *
48
70
  * Opus cuts the upload to roughly an eighth, at the cost of encoding on the
49
- * client. Off by default so bandwidth is traded for CPU only where that is
50
- * wanted low-end devices (e.g. learning tablets) should not be asked to
51
- * encode audio they cannot afford to.
71
+ * client. **On by default** the uplink drops to roughly 1/8 the bytes, which
72
+ * matters most on the mobile networks where playback stalls actually happen.
73
+ * Set it to `false` to keep the raw PCM uplink (e.g. on low-end devices where
74
+ * the encode cost is not worth the bandwidth saved).
52
75
  *
53
76
  * Only effective in direct mode: host mode has no uplink, and Opus input is
54
77
  * already Opus so there is nothing to encode. Independent of
55
78
  * `inputAudioFormat`, which describes what the host feeds in.
79
+ *
80
+ * Falls back to a raw PCM uplink (with a warning) when `sampleRate` is not one
81
+ * of Opus's supported rates — see `AvatarSDK.initialize`.
56
82
  */
57
83
  readonly opusUplinkEnabled?: boolean;
58
84
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spatius/avatarkit",
3
3
  "type": "module",
4
- "version": "1.3.1-beta.6",
4
+ "version": "1.3.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/",