@spatialwalk/avatarkit 1.0.0-beta.103 → 1.0.0-beta.104

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 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.104]
9
+
10
+ ### 🐛 Bugfixes
11
+
12
+ - **Telemetry logging** — Fixed console error logs showing only generic event name with no diagnostic details. Each telemetry event now uses its own event name and includes all properties inline for easier debugging.
13
+
8
14
  ## [1.0.0-beta.103]
9
15
 
10
16
  ### 🔧 Internal
@@ -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-BqX6ubaV.js";
4
+ import { A as APP_CONFIG, l as logger, e as errorToMessage, a as logEvent } from "./index-BFNu-mKX.js";
5
5
  class StreamingAudioPlayer {
6
6
  // Mark if AudioContext is being resumed, avoid concurrent resume requests
7
7
  constructor(options) {
@@ -143,9 +143,8 @@ class StreamingAudioPlayer {
143
143
  });
144
144
  } catch (err) {
145
145
  logger.errorWithError("[StreamingAudioPlayer] Failed to resume AudioContext:", err);
146
- logEvent("character_player", "error", {
146
+ logEvent("audio_context_resume_failed", "error", {
147
147
  sessionId: this.sessionId,
148
- event: "audio_context_resume_failed",
149
148
  reason: err instanceof Error ? err.message : String(err)
150
149
  });
151
150
  } finally {
@@ -281,9 +280,8 @@ class StreamingAudioPlayer {
281
280
  if (!audioBuffer) {
282
281
  const errorMessage = "Failed to create AudioBuffer from PCM data";
283
282
  logger.error(errorMessage);
284
- logEvent("character_player", "error", {
285
- sessionId: this.sessionId,
286
- event: "audio_buffer_creation_failed"
283
+ logEvent("audio_buffer_creation_failed", "error", {
284
+ sessionId: this.sessionId
287
285
  });
288
286
  return;
289
287
  }
@@ -305,8 +303,7 @@ class StreamingAudioPlayer {
305
303
  const lastChunk = this.audioChunks[this.scheduledChunks - 1];
306
304
  if (lastChunk && !lastChunk.isLast) {
307
305
  this.log("All audio chunks ended but end=false, pausing and setting autoContinue");
308
- logEvent("character_player", "warning", {
309
- event: "audio_buffer_stall",
306
+ logEvent("audio_buffer_stall", "warning", {
310
307
  scheduled_chunks: this.scheduledChunks,
311
308
  audio_time: this.getCurrentTime()
312
309
  });
@@ -330,9 +327,8 @@ class StreamingAudioPlayer {
330
327
  });
331
328
  } catch (err) {
332
329
  logger.errorWithError("Failed to schedule audio chunk:", err);
333
- logEvent("character_player", "error", {
330
+ logEvent("schedule_chunk_failed", "error", {
334
331
  sessionId: this.sessionId,
335
- event: "schedule_chunk_failed",
336
332
  reason: err instanceof Error ? err.message : String(err)
337
333
  });
338
334
  }
@@ -9415,7 +9415,8 @@ function logEvent(event, level = "info", contents = {}) {
9415
9415
  error: "error"
9416
9416
  };
9417
9417
  const logMethod = logLevels[level] ?? "log";
9418
- logger[logMethod](`[Telemetry] ${event}`, context);
9418
+ const propsDescription = Object.entries(contents).map(([k2, v2]) => `${k2}=${v2}`).join(", ");
9419
+ logger[logMethod](`[Telemetry] ${event} [${propsDescription}]`);
9419
9420
  trackEvent(event, level, context);
9420
9421
  }
9421
9422
  const _AnimationPlayer = class _AnimationPlayer {
@@ -9508,7 +9509,7 @@ const _AnimationPlayer = class _AnimationPlayer {
9508
9509
  if (this.streamingPlayer) {
9509
9510
  return;
9510
9511
  }
9511
- const { StreamingAudioPlayer } = await import("./StreamingAudioPlayer-CxtOBEsC.js");
9512
+ const { StreamingAudioPlayer } = await import("./StreamingAudioPlayer-CCmsLyxv.js");
9512
9513
  const { AvatarSDK: AvatarSDK2 } = await Promise.resolve().then(() => AvatarSDK$1);
9513
9514
  const audioFormat = AvatarSDK2.getAudioFormat();
9514
9515
  this.streamingPlayer = new StreamingAudioPlayer({
@@ -9521,8 +9522,7 @@ const _AnimationPlayer = class _AnimationPlayer {
9521
9522
  } catch (error) {
9522
9523
  const message = error instanceof Error ? error.message : String(error);
9523
9524
  logger.error("[AnimationPlayer] Failed to initialize streaming player:", message);
9524
- logEvent("character_player", "error", {
9525
- event: "streaming_player_initialize_failed",
9525
+ logEvent("streaming_player_initialize_failed", "error", {
9526
9526
  reason: message
9527
9527
  });
9528
9528
  throw error;
@@ -11548,7 +11548,7 @@ class AvatarSDK {
11548
11548
  __publicField(AvatarSDK, "_initializationState", "uninitialized");
11549
11549
  __publicField(AvatarSDK, "_initializingPromise", null);
11550
11550
  __publicField(AvatarSDK, "_configuration", null);
11551
- __publicField(AvatarSDK, "_version", "1.0.0-beta.103");
11551
+ __publicField(AvatarSDK, "_version", "1.0.0-beta.104");
11552
11552
  __publicField(AvatarSDK, "_avatarCore", null);
11553
11553
  __publicField(AvatarSDK, "_dynamicSdkConfig", null);
11554
11554
  __publicField(AvatarSDK, "_cachedDeviceScore", null);
@@ -13450,9 +13450,8 @@ class AvatarController {
13450
13450
  volume = Math.max(0, Math.min(1, volume));
13451
13451
  }
13452
13452
  (_a = this.animationPlayer) == null ? void 0 : _a.setVolume(volume);
13453
- logEvent("character_player", "info", {
13453
+ logEvent("volume_changed", "info", {
13454
13454
  avatar_id: this.avatar.id,
13455
- event: "volume_changed",
13456
13455
  volume
13457
13456
  });
13458
13457
  }
@@ -13515,8 +13514,7 @@ class AvatarController {
13515
13514
  this.emit("stopRendering");
13516
13515
  if (this.frameStarvationEvents.length > 0) {
13517
13516
  const hasReqEnd = this.frameStarvationEvents.some((e2) => e2.reqEnd);
13518
- logEvent("character_player", "warning", {
13519
- event: "frame_starvation",
13517
+ logEvent("frame_starvation", "warning", {
13520
13518
  avatar_id: this.avatar.id,
13521
13519
  conversationId: ((_a2 = this.networkLayer) == null ? void 0 : _a2.getCurrentConversationId()) || void 0,
13522
13520
  starvation_count: this.frameStarvationEvents.length,
@@ -13526,9 +13524,8 @@ class AvatarController {
13526
13524
  }
13527
13525
  this.frameStarvationEvents = [];
13528
13526
  this.isFrameStarved = false;
13529
- logEvent("character_player", "info", {
13527
+ logEvent("playback_ended", "info", {
13530
13528
  avatar_id: this.avatar.id,
13531
- event: "playback_ended",
13532
13529
  conversationId: ((_b2 = this.networkLayer) == null ? void 0 : _b2.getCurrentConversationId()) || void 0
13533
13530
  });
13534
13531
  this.clearPlaybackData();
@@ -13554,9 +13551,8 @@ class AvatarController {
13554
13551
  this.notifyConversationState(AvatarState.playing);
13555
13552
  this.startPlaybackLoop();
13556
13553
  this.isStartingPlayback = false;
13557
- logEvent("character_player", "info", {
13554
+ logEvent("playback_started", "info", {
13558
13555
  avatar_id: this.avatar.id,
13559
- event: "playback_started",
13560
13556
  conversationId: ((_a = this.networkLayer) == null ? void 0 : _a.getCurrentConversationId()) || void 0
13561
13557
  });
13562
13558
  } catch (error) {
@@ -13617,8 +13613,7 @@ class AvatarController {
13617
13613
  const shouldReport = state.audioTimeZeroCount > this.MAX_AUDIO_TIME_ZERO_COUNT || state.audioTimeStuckCount > this.MAX_AUDIO_TIME_STUCK_COUNT || hasScheduledButNoActive && this.isPlaying;
13618
13614
  if (shouldReport && isNotPaused) {
13619
13615
  state.reported = true;
13620
- logEvent("character_player", "error", {
13621
- event: "playback_stuck_after_transition",
13616
+ logEvent("playback_stuck_after_transition", "error", {
13622
13617
  avatar_id: this.avatar.id,
13623
13618
  conversationId: ((_e2 = this.networkLayer) == null ? void 0 : _e2.getCurrentConversationId()) || void 0,
13624
13619
  // 诊断信息(包含 audioContextState 用于诊断,但不作为触发条件)
@@ -13863,9 +13858,8 @@ class AvatarController {
13863
13858
  this.isFallbackMode = false;
13864
13859
  this.clearPlaybackData();
13865
13860
  this.resetConversationIdState();
13866
- logEvent("character_player", "info", {
13861
+ logEvent("audio_only_playback_ended", "info", {
13867
13862
  avatar_id: this.avatar.id,
13868
- event: "audio_only_playback_ended",
13869
13863
  conversationId: this.getEffectiveConversationId() || void 0
13870
13864
  });
13871
13865
  });
@@ -13881,9 +13875,8 @@ class AvatarController {
13881
13875
  this.currentState = AvatarState.playing;
13882
13876
  this.notifyConversationState(AvatarState.playing, true);
13883
13877
  this.startAudioMonitoringLoop();
13884
- logEvent("character_player", "info", {
13878
+ logEvent("audio_only_playback_started", "info", {
13885
13879
  avatar_id: this.avatar.id,
13886
- event: "audio_only_playback_started",
13887
13880
  conversationId: this.getEffectiveConversationId() || void 0
13888
13881
  });
13889
13882
  } catch (error) {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { b, c, m, f, d, j, g, C, i, D, E, k, h, L, R, n } from "./index-BqX6ubaV.js";
1
+ import { b, c, m, f, d, j, g, C, i, D, E, k, h, L, R, n } from "./index-BFNu-mKX.js";
2
2
  export {
3
3
  b as Avatar,
4
4
  c as AvatarController,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spatialwalk/avatarkit",
3
3
  "type": "module",
4
- "version": "1.0.0-beta.103",
4
+ "version": "1.0.0-beta.104",
5
5
  "packageManager": "pnpm@10.18.2",
6
6
  "description": "AvatarKit SDK - 3D Gaussian Splatting Avatar Rendering SDK",
7
7
  "author": "AvatarKit Team",