@d-id/client-sdk 1.2.3 → 1.2.4-staging.353

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,4 +1,4 @@
1
- import { c as De, C as O, S as l, a as Fe, b as Ne, A as m, d as Ue, l as de, e as je, t as xe, f as v, g as U, h as Oe, i as Be, j as A, n as Je } from "./index-DDkjAtAc.js";
1
+ import { c as De, C as O, S as l, a as Fe, b as Ne, A as m, d as Ue, l as de, e as je, t as xe, f as v, g as U, h as Oe, i as Be, j as A, n as Je } from "./index-CRiHH3dL.js";
2
2
  function Qe(C, L, g, i) {
3
3
  const M = De(C, `${L}/v2/agents/${g}`, i);
4
4
  return {
@@ -50,7 +50,8 @@ async function Ge(C, L, g) {
50
50
  try {
51
51
  const e = await ge.createStream({
52
52
  transport: L.transport,
53
- chat_persist: L.chat_persist ?? !0
53
+ chat_persist: L.chat_persist ?? !0,
54
+ verbose: g.verbose ?? !1
54
55
  }), { id: t, session_token: r, session_url: o, interrupt_enabled: c } = e;
55
56
  (re = n.onStreamCreated) == null || re.call(n, { session_id: t, stream_id: t, agent_id: C }), S = t, $ = r, K = o, Y = c ?? !0, await a.prepareConnection(K, $);
56
57
  } catch (e) {
@@ -18,4 +18,5 @@ export interface Analytics {
18
18
  enrich(props: Record<string, any>): void;
19
19
  additionalProperties: Record<string, any>;
20
20
  }
21
+ export declare function _resetOfflineBufferForTests(): void;
21
22
  export declare function initializeAnalytics(config: AnalyticsOptions): Analytics;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import { AvSyncReport, SlimRTCStatsReport } from '../../../types';
2
+
3
+ export declare function buildAvSyncReport(stats: SlimRTCStatsReport[]): AvSyncReport | null;
@@ -1,8 +1,9 @@
1
- import { AnalyticsRTCStatsReport, SlimRTCStatsReport } from '../../../types';
1
+ import { AnalyticsRTCStatsReport, AvSyncReport, SlimRTCStatsReport } from '../../../types';
2
2
 
3
3
  export interface VideoRTCStatsReport {
4
4
  webRTCStats: {
5
5
  anomalies: AnalyticsRTCStatsReport[];
6
+ avSync: AvSyncReport | null;
6
7
  aggregateReport: AnalyticsRTCStatsReport;
7
8
  minRtt: number;
8
9
  maxRtt: number;
@@ -146,6 +146,7 @@ export interface AgentManagerOptions {
146
146
  baseURL?: string;
147
147
  wsURL?: string;
148
148
  debug?: boolean;
149
+ verbose?: boolean;
149
150
  enableAnalitics?: boolean;
150
151
  mixpanelKey?: string;
151
152
  mixpanelAdditionalProperties?: Record<string, any>;
@@ -101,6 +101,7 @@ export interface StreamingManagerOptions {
101
101
  callbacks: ManagerCallbacks;
102
102
  baseURL?: string;
103
103
  debug?: boolean;
104
+ verbose?: boolean;
104
105
  auth: Auth;
105
106
  analytics: Analytics;
106
107
  /**
@@ -131,6 +132,27 @@ export interface SlimRTCStatsReport {
131
132
  framesPerSecond: any;
132
133
  freezeCount: number;
133
134
  freezeDuration: number;
135
+ av?: AvSyncSample;
136
+ }
137
+ export interface AvSyncSample {
138
+ /** Audio estimatedPlayoutTimestamp (ms, NTP) — playout time of the audio sample currently being rendered. */
139
+ audioPlayout: number;
140
+ /** Video estimatedPlayoutTimestamp (ms, NTP) — playout time of the video frame currently being rendered. */
141
+ videoPlayout: number;
142
+ /** Local timestamp of this sample (ms) — the video inbound-rtp report timestamp; the utterance time axis. */
143
+ localTs: number;
144
+ }
145
+ export interface AvSyncReport {
146
+ /** Measurable samples in this utterance (both audio and video playout present). Report is null if fewer than 2. */
147
+ sampleCount: number;
148
+ /** Measurement window in milliseconds (first to last sample). */
149
+ durationMs: number;
150
+ /** How long the A/V offset was perceptibly off (audio ahead > 45ms or behind > 100ms) — the "was there a lip-sync issue, and for how long" signal. */
151
+ desyncDurationMs: number;
152
+ /** The single worst offset (largest magnitude), signed. Positive = audio ahead of video, negative = video ahead. */
153
+ maxOffsetMs: number;
154
+ /** Settled offset after startup (signed median over the back half). ~0 = recovered; non-zero = persistent lip-sync error. */
155
+ residualOffsetMs: number;
134
156
  }
135
157
  export interface AnalyticsRTCStatsReport {
136
158
  timestamp?: number;
@@ -6,6 +6,7 @@ export interface CreateSessionV2Options {
6
6
  provider: TransportProvider.Livekit;
7
7
  };
8
8
  chat_persist?: boolean;
9
+ verbose?: boolean;
9
10
  }
10
11
  export interface CreateSessionV2Response {
11
12
  id: string;
@@ -35,4 +35,11 @@ export declare function getAgentInfo(agent: Agent): {
35
35
  export declare const getErrorMessage: (error: unknown) => string;
36
36
  export declare const sumFunc: (numbers: number[]) => number;
37
37
  export declare const average: (numbers: number[]) => number;
38
+ export declare const min: (numbers: number[]) => number;
39
+ export declare const max: (numbers: number[]) => number;
40
+ export declare const round: (value: number, decimals?: number) => number;
41
+ export declare const percentile: (numbers: number[], p: number) => number;
42
+ export declare const median: (numbers: number[]) => number;
43
+ /** Run fn, returning fallback instead of throwing — so a telemetry failure can never break the caller. */
44
+ export declare const safe: <T>(fn: () => T, fallback: T) => T;
38
45
  export declare function getStreamAnalyticsProps(data: any, agent: Agent, additionalProps: Record<string, any>): any;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@d-id/client-sdk",
3
3
  "private": false,
4
- "version": "1.2.3",
4
+ "version": "1.2.4-staging.353",
5
5
  "type": "module",
6
6
  "description": "d-id client sdk",
7
7
  "repository": {