realtime-avatar 0.5.1 → 0.5.2
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/dist/express.js +1 -1
- package/dist/hono.js +1 -1
- package/dist/index.js +1 -1
- package/dist/nextjs.js +1 -1
- package/dist/{proxy-client-BsIA_LbP.d.ts → proxy-client-BIaUo0az.d.ts} +22 -1
- package/dist/react-native.d.ts +2 -2
- package/dist/react-native.js +6 -1
- package/dist/react.d.ts +2 -2
- package/dist/react.js +18 -3
- package/dist/server.js +1 -1
- package/dist/tanstack-start.js +1 -1
- package/package.json +1 -1
package/dist/express.js
CHANGED
|
@@ -43,7 +43,7 @@ var RealtimeAvatarHttpError = class extends RealtimeAvatarError {
|
|
|
43
43
|
|
|
44
44
|
// ../http-client/src/client.ts
|
|
45
45
|
var DEFAULT_BASE_URL = "https://realtimeavatar.ai/api/v1";
|
|
46
|
-
var SDK_VERSION = "0.5.
|
|
46
|
+
var SDK_VERSION = "0.5.2";
|
|
47
47
|
var RealtimeAvatar = class {
|
|
48
48
|
#apiKey;
|
|
49
49
|
#baseUrl;
|
package/dist/hono.js
CHANGED
|
@@ -43,7 +43,7 @@ var RealtimeAvatarHttpError = class extends RealtimeAvatarError {
|
|
|
43
43
|
|
|
44
44
|
// ../http-client/src/client.ts
|
|
45
45
|
var DEFAULT_BASE_URL = "https://realtimeavatar.ai/api/v1";
|
|
46
|
-
var SDK_VERSION = "0.5.
|
|
46
|
+
var SDK_VERSION = "0.5.2";
|
|
47
47
|
var RealtimeAvatar = class {
|
|
48
48
|
#apiKey;
|
|
49
49
|
#baseUrl;
|
package/dist/index.js
CHANGED
|
@@ -43,7 +43,7 @@ var RealtimeAvatarHttpError = class extends RealtimeAvatarError {
|
|
|
43
43
|
|
|
44
44
|
// ../http-client/src/client.ts
|
|
45
45
|
var DEFAULT_BASE_URL = "https://realtimeavatar.ai/api/v1";
|
|
46
|
-
var SDK_VERSION = "0.5.
|
|
46
|
+
var SDK_VERSION = "0.5.2";
|
|
47
47
|
var RealtimeAvatar = class {
|
|
48
48
|
#apiKey;
|
|
49
49
|
#baseUrl;
|
package/dist/nextjs.js
CHANGED
|
@@ -43,7 +43,7 @@ var RealtimeAvatarHttpError = class extends RealtimeAvatarError {
|
|
|
43
43
|
|
|
44
44
|
// ../http-client/src/client.ts
|
|
45
45
|
var DEFAULT_BASE_URL = "https://realtimeavatar.ai/api/v1";
|
|
46
|
-
var SDK_VERSION = "0.5.
|
|
46
|
+
var SDK_VERSION = "0.5.2";
|
|
47
47
|
var RealtimeAvatar = class {
|
|
48
48
|
#apiKey;
|
|
49
49
|
#baseUrl;
|
|
@@ -497,6 +497,18 @@ type AvatarVideoSurfaceProps = {
|
|
|
497
497
|
* enabling it can never make the first frame later than it is today.
|
|
498
498
|
*/
|
|
499
499
|
adaptivePlayout?: boolean;
|
|
500
|
+
/**
|
|
501
|
+
* Called with the receiver playout depth (SECONDS) whenever it changes — the flat
|
|
502
|
+
* {@link DEFAULT_AVATAR_PLAYOUT_DELAY_SECONDS} while `adaptivePlayout` is off, the live
|
|
503
|
+
* value while it is on.
|
|
504
|
+
*
|
|
505
|
+
* Read this if anything you render is timed against the avatar's VOICE: the media rides
|
|
506
|
+
* the receiver buffer and a side channel (captions, a transcript reveal, a lip-synced
|
|
507
|
+
* overlay) does not, so it has to be held by the same amount or it arrives early. While
|
|
508
|
+
* the cushion was a constant, consumers hard-coded it; once it moves, a hard-coded copy
|
|
509
|
+
* desyncs by up to the whole adaptive range. Fires on change only, not per frame.
|
|
510
|
+
*/
|
|
511
|
+
onPlayoutDelayChange?: (seconds: number) => void;
|
|
500
512
|
/** Test id for the box. */
|
|
501
513
|
"data-testid"?: string;
|
|
502
514
|
};
|
|
@@ -967,8 +979,17 @@ declare function readInboundRtp(reports: Iterable<Record<string, unknown>>, prev
|
|
|
967
979
|
* without `getStats` on its receiver, a stats report with no `inbound-rtp` yet,
|
|
968
980
|
* or a browser without the playout-delay hint all leave the flat cushion exactly
|
|
969
981
|
* as `useAvatarPlayoutDelay` set it.
|
|
982
|
+
*
|
|
983
|
+
* RETURNS THE APPLIED DEPTH IN SECONDS, and that return value is load-bearing rather
|
|
984
|
+
* than a convenience. Anything a consumer times against the avatar's voice — a caption
|
|
985
|
+
* reveal being the real case — has to be held by the SAME cushion, because the media is
|
|
986
|
+
* buffered and a side channel is not. While the cushion was a flat constant a consumer
|
|
987
|
+
* could hard-code it; the moment it moves, a hard-coded copy desyncs by up to the whole
|
|
988
|
+
* adaptive range. So the value comes back out of the hook, and stays equal to
|
|
989
|
+
* {@link DEFAULT_AVATAR_PLAYOUT_DELAY_SECONDS} whenever the loop is disabled or inert —
|
|
990
|
+
* a consumer can read it unconditionally.
|
|
970
991
|
*/
|
|
971
|
-
declare function useAvatarAdaptivePlayoutDelay(videoTrack: TrackReferenceOrPlaceholder | undefined, audioTrack: TrackReferenceOrPlaceholder | undefined, enabled?: boolean, options?: AdaptivePlayoutOptions):
|
|
992
|
+
declare function useAvatarAdaptivePlayoutDelay(videoTrack: TrackReferenceOrPlaceholder | undefined, audioTrack: TrackReferenceOrPlaceholder | undefined, enabled?: boolean, options?: AdaptivePlayoutOptions): number;
|
|
972
993
|
|
|
973
994
|
/**
|
|
974
995
|
* Avatar nonverbal-behavior snapshot + its SSOT derivation.
|
package/dist/react-native.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LiveKitRoomProps } from '@livekit/react-native';
|
|
2
2
|
export { AudioSession, VideoTrack, VideoTrackProps, registerGlobals } from '@livekit/react-native';
|
|
3
3
|
import { ReactNode, ReactElement } from 'react';
|
|
4
|
-
import { aS as LiveKitSessionGrant, a as AvatarVideoFit } from './proxy-client-
|
|
5
|
-
export { b as AdaptivePlayoutController, c as AdaptivePlayoutDecision, d as AdaptivePlayoutOptions, e as AdaptivePlayoutSample, f as ApproachingEndEvent, g as ApproachingEndReason, A as AvatarSessionClient, B as BehaviorSnapshot, C as CallTranscript, j as CallTranscriptSegment, k as CartesiaTtsModel, l as ClipResult, m as ClosingTurnResult, n as CreditsLowEvent, D as DEFAULT_APPROACHING_END_LEAD_SECONDS, o as DEFAULT_AVATAR_PLAYOUT_DELAY_SECONDS, p as DEFAULT_CREDITS_LOW_LEAD_SECONDS, q as DEFAULT_GOVERNOR_CONFIG, r as DEFAULT_GRACE_CEILING_SECONDS, s as DEFAULT_GRACE_WINDOW_LEAD_SECONDS, t as DEFAULT_IDLE_SECONDS, u as DEFAULT_IDLE_WARN_LEAD_SECONDS, v as DEFAULT_TURN_TIMEOUT_SECONDS, E as EndReason, w as EndedEvent, x as ExtendResult, F as FishTtsModel, y as FreezeReadingFn, G as Governor, z as GovernorAction, H as GovernorConfig, I as GovernorSignal, J as GovernorState, K as GraceWindowClosedEvent, L as GraceWindowOpenEvent, M as GraceWindowState, N as IdleWarningEvent, O as InboundRtpCursor, P as InboundRtpReading, Q as KnownBehaviorState, R as LLMProvider, S as LLMSelection, T as LiveKitAvatarGrantState, U as LiveKitAvatarGrantStatus, V as LiveKitCapacityState, W as LiveKitConnectionStatus, X as LiveKitSessionRequest, Y as LiveKitSessionStartResult, _ as MAX_RECONNECT_ATTEMPTS, $ as MAX_SESSION_INSTRUCTIONS_CHARS, a3 as ProxyClientOptions, a4 as QualityCap, a5 as RECONNECT_BACKOFF_MS, a9 as RealtimeAvatarRequestOptions, aa as RealtimeSessionApi, ab as RealtimeSessionMedia, ac as RealtimeSessionRoomSinks, ad as ReconnectPolicy, ae as ReconnectingEvent, af as RecoveryState, ag as RetryStep, ah as SessionBehavior, ai as SessionClip, aj as SessionClocks, ak as SessionEndReason, al as SessionLifecycleApi, am as SessionLifecyclePhase, an as SessionLifecyclePhaseKind, ao as SessionLifecycleRoomBridge, ap as SessionLifecycleRoomBridgeProps, aq as SurfaceLayers, ar as TurnState, as as TurnTimeoutEvent, at as UseAvatarQualityGovernorInput, au as UseLiveKitAvatarGrantInput, av as UseRealtimeSessionInput, aw as UseSessionLifecycleInput, ax as VoiceSpec, ay as VoiceSpecInput, az as capacityErrorFromBusy, aA as capacityStateFromGrant, aB as createProxyClient, aT as isNativeLiveTrackSubscribed, aC as knownBehaviorStates, aD as mapTurnState, aE as readInboundRtp, aF as sessionBehaviorSchema, aG as sessionClipSchema, aI as splitCallTranscript, aJ as useAvatarAdaptivePlayoutDelay, aK as useAvatarPlayoutDelay, aL as useAvatarQualityGovernor, aM as useCallTranscript, aN as useLiveKitAvatarGrant, aU as useLiveTrackProducing, aO as useMicLease, aP as useRealtimeSession, aQ as useReleaseMicLeaseOnTrackEnded, aR as useSessionLifecycle } from './proxy-client-
|
|
4
|
+
import { aS as LiveKitSessionGrant, a as AvatarVideoFit } from './proxy-client-BIaUo0az.js';
|
|
5
|
+
export { b as AdaptivePlayoutController, c as AdaptivePlayoutDecision, d as AdaptivePlayoutOptions, e as AdaptivePlayoutSample, f as ApproachingEndEvent, g as ApproachingEndReason, A as AvatarSessionClient, B as BehaviorSnapshot, C as CallTranscript, j as CallTranscriptSegment, k as CartesiaTtsModel, l as ClipResult, m as ClosingTurnResult, n as CreditsLowEvent, D as DEFAULT_APPROACHING_END_LEAD_SECONDS, o as DEFAULT_AVATAR_PLAYOUT_DELAY_SECONDS, p as DEFAULT_CREDITS_LOW_LEAD_SECONDS, q as DEFAULT_GOVERNOR_CONFIG, r as DEFAULT_GRACE_CEILING_SECONDS, s as DEFAULT_GRACE_WINDOW_LEAD_SECONDS, t as DEFAULT_IDLE_SECONDS, u as DEFAULT_IDLE_WARN_LEAD_SECONDS, v as DEFAULT_TURN_TIMEOUT_SECONDS, E as EndReason, w as EndedEvent, x as ExtendResult, F as FishTtsModel, y as FreezeReadingFn, G as Governor, z as GovernorAction, H as GovernorConfig, I as GovernorSignal, J as GovernorState, K as GraceWindowClosedEvent, L as GraceWindowOpenEvent, M as GraceWindowState, N as IdleWarningEvent, O as InboundRtpCursor, P as InboundRtpReading, Q as KnownBehaviorState, R as LLMProvider, S as LLMSelection, T as LiveKitAvatarGrantState, U as LiveKitAvatarGrantStatus, V as LiveKitCapacityState, W as LiveKitConnectionStatus, X as LiveKitSessionRequest, Y as LiveKitSessionStartResult, _ as MAX_RECONNECT_ATTEMPTS, $ as MAX_SESSION_INSTRUCTIONS_CHARS, a3 as ProxyClientOptions, a4 as QualityCap, a5 as RECONNECT_BACKOFF_MS, a9 as RealtimeAvatarRequestOptions, aa as RealtimeSessionApi, ab as RealtimeSessionMedia, ac as RealtimeSessionRoomSinks, ad as ReconnectPolicy, ae as ReconnectingEvent, af as RecoveryState, ag as RetryStep, ah as SessionBehavior, ai as SessionClip, aj as SessionClocks, ak as SessionEndReason, al as SessionLifecycleApi, am as SessionLifecyclePhase, an as SessionLifecyclePhaseKind, ao as SessionLifecycleRoomBridge, ap as SessionLifecycleRoomBridgeProps, aq as SurfaceLayers, ar as TurnState, as as TurnTimeoutEvent, at as UseAvatarQualityGovernorInput, au as UseLiveKitAvatarGrantInput, av as UseRealtimeSessionInput, aw as UseSessionLifecycleInput, ax as VoiceSpec, ay as VoiceSpecInput, az as capacityErrorFromBusy, aA as capacityStateFromGrant, aB as createProxyClient, aT as isNativeLiveTrackSubscribed, aC as knownBehaviorStates, aD as mapTurnState, aE as readInboundRtp, aF as sessionBehaviorSchema, aG as sessionClipSchema, aI as splitCallTranscript, aJ as useAvatarAdaptivePlayoutDelay, aK as useAvatarPlayoutDelay, aL as useAvatarQualityGovernor, aM as useCallTranscript, aN as useLiveKitAvatarGrant, aU as useLiveTrackProducing, aO as useMicLease, aP as useRealtimeSession, aQ as useReleaseMicLeaseOnTrackEnded, aR as useSessionLifecycle } from './proxy-client-BIaUo0az.js';
|
|
6
6
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
7
7
|
export { useChat, useConnectionState, useLocalParticipant, useRoomContext, useTrackToggle, useTranscriptions, useVoiceAssistant } from '@livekit/components-react';
|
|
8
8
|
export { DisconnectReason, RemoteAudioTrack, RemoteTrack, RemoteVideoTrack, Room, RoomEvent, SendTextOptions, Track } from 'livekit-client';
|
package/dist/react-native.js
CHANGED
|
@@ -515,6 +515,8 @@ function readInboundRtp(reports, previous) {
|
|
|
515
515
|
|
|
516
516
|
// ../client/src/react/use-adaptive-playout.ts
|
|
517
517
|
function useAvatarAdaptivePlayoutDelay(videoTrack, audioTrack, enabled = false, options) {
|
|
518
|
+
const ceiling = options?.ceilingSeconds ?? DEFAULT_AVATAR_PLAYOUT_DELAY_SECONDS;
|
|
519
|
+
const [appliedSeconds, setAppliedSeconds] = useState(ceiling);
|
|
518
520
|
const videoMediaTrack = videoTrack?.publication?.track;
|
|
519
521
|
const audioMediaTrack = audioTrack?.publication?.track;
|
|
520
522
|
useEffect(() => {
|
|
@@ -547,6 +549,7 @@ function useAvatarAdaptivePlayoutDelay(videoTrack, audioTrack, enabled = false,
|
|
|
547
549
|
const decision = controller.update(worst);
|
|
548
550
|
if (decision.changed) {
|
|
549
551
|
applyAvatarPlayoutDelay(videoMediaTrack, audioMediaTrack, decision.targetSeconds);
|
|
552
|
+
setAppliedSeconds(decision.targetSeconds);
|
|
550
553
|
}
|
|
551
554
|
} catch {
|
|
552
555
|
} finally {
|
|
@@ -557,8 +560,10 @@ function useAvatarAdaptivePlayoutDelay(videoTrack, audioTrack, enabled = false,
|
|
|
557
560
|
return () => {
|
|
558
561
|
closed = true;
|
|
559
562
|
clearInterval(interval);
|
|
563
|
+
setAppliedSeconds(ceiling);
|
|
560
564
|
};
|
|
561
|
-
}, [enabled, videoMediaTrack, audioMediaTrack, options]);
|
|
565
|
+
}, [enabled, videoMediaTrack, audioMediaTrack, options, ceiling]);
|
|
566
|
+
return appliedSeconds;
|
|
562
567
|
}
|
|
563
568
|
|
|
564
569
|
// ../client/src/react/quality-governor.ts
|
package/dist/react.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { A as AvatarSessionClient, a as AvatarVideoFit } from './proxy-client-
|
|
3
|
-
export { b as AdaptivePlayoutController, c as AdaptivePlayoutDecision, d as AdaptivePlayoutOptions, e as AdaptivePlayoutSample, f as ApproachingEndEvent, g as ApproachingEndReason, h as AvatarVideoSurface, i as AvatarVideoSurfaceProps, B as BehaviorSnapshot, C as CallTranscript, j as CallTranscriptSegment, k as CartesiaTtsModel, l as ClipResult, m as ClosingTurnResult, n as CreditsLowEvent, D as DEFAULT_APPROACHING_END_LEAD_SECONDS, o as DEFAULT_AVATAR_PLAYOUT_DELAY_SECONDS, p as DEFAULT_CREDITS_LOW_LEAD_SECONDS, q as DEFAULT_GOVERNOR_CONFIG, r as DEFAULT_GRACE_CEILING_SECONDS, s as DEFAULT_GRACE_WINDOW_LEAD_SECONDS, t as DEFAULT_IDLE_SECONDS, u as DEFAULT_IDLE_WARN_LEAD_SECONDS, v as DEFAULT_TURN_TIMEOUT_SECONDS, E as EndReason, w as EndedEvent, x as ExtendResult, F as FishTtsModel, y as FreezeReadingFn, G as Governor, z as GovernorAction, H as GovernorConfig, I as GovernorSignal, J as GovernorState, K as GraceWindowClosedEvent, L as GraceWindowOpenEvent, M as GraceWindowState, N as IdleWarningEvent, O as InboundRtpCursor, P as InboundRtpReading, Q as KnownBehaviorState, R as LLMProvider, S as LLMSelection, T as LiveKitAvatarGrantState, U as LiveKitAvatarGrantStatus, V as LiveKitCapacityState, W as LiveKitConnectionStatus, X as LiveKitSessionRequest, Y as LiveKitSessionStartResult, Z as LivePlaybackKeeper, _ as MAX_RECONNECT_ATTEMPTS, $ as MAX_SESSION_INSTRUCTIONS_CHARS, a0 as MIC_LEASE_ENDED_TIMEOUT_MS, a1 as MicLease, a2 as PlayableVideoElement, a3 as ProxyClientOptions, a4 as QualityCap, a5 as RECONNECT_BACKOFF_MS, a6 as RealtimeAvatarCapacityError, a7 as RealtimeAvatarLiveKitRoom, a8 as RealtimeAvatarLiveKitRoomProps, a9 as RealtimeAvatarRequestOptions, aa as RealtimeSessionApi, ab as RealtimeSessionMedia, ac as RealtimeSessionRoomSinks, ad as ReconnectPolicy, ae as ReconnectingEvent, af as RecoveryState, ag as RetryStep, ah as SessionBehavior, ai as SessionClip, aj as SessionClocks, ak as SessionEndReason, al as SessionLifecycleApi, am as SessionLifecyclePhase, an as SessionLifecyclePhaseKind, ao as SessionLifecycleRoomBridge, ap as SessionLifecycleRoomBridgeProps, aq as SurfaceLayers, ar as TurnState, as as TurnTimeoutEvent, at as UseAvatarQualityGovernorInput, au as UseLiveKitAvatarGrantInput, av as UseRealtimeSessionInput, aw as UseSessionLifecycleInput, ax as VoiceSpec, ay as VoiceSpecInput, az as capacityErrorFromBusy, aA as capacityStateFromGrant, aB as createProxyClient, aC as knownBehaviorStates, aD as mapTurnState, aE as readInboundRtp, aF as sessionBehaviorSchema, aG as sessionClipSchema, aH as shouldReplayPendingTurn, aI as splitCallTranscript, aJ as useAvatarAdaptivePlayoutDelay, aK as useAvatarPlayoutDelay, aL as useAvatarQualityGovernor, aM as useCallTranscript, aN as useLiveKitAvatarGrant, aO as useMicLease, aP as useRealtimeSession, aQ as useReleaseMicLeaseOnTrackEnded, aR as useSessionLifecycle } from './proxy-client-
|
|
2
|
+
import { A as AvatarSessionClient, a as AvatarVideoFit } from './proxy-client-BIaUo0az.js';
|
|
3
|
+
export { b as AdaptivePlayoutController, c as AdaptivePlayoutDecision, d as AdaptivePlayoutOptions, e as AdaptivePlayoutSample, f as ApproachingEndEvent, g as ApproachingEndReason, h as AvatarVideoSurface, i as AvatarVideoSurfaceProps, B as BehaviorSnapshot, C as CallTranscript, j as CallTranscriptSegment, k as CartesiaTtsModel, l as ClipResult, m as ClosingTurnResult, n as CreditsLowEvent, D as DEFAULT_APPROACHING_END_LEAD_SECONDS, o as DEFAULT_AVATAR_PLAYOUT_DELAY_SECONDS, p as DEFAULT_CREDITS_LOW_LEAD_SECONDS, q as DEFAULT_GOVERNOR_CONFIG, r as DEFAULT_GRACE_CEILING_SECONDS, s as DEFAULT_GRACE_WINDOW_LEAD_SECONDS, t as DEFAULT_IDLE_SECONDS, u as DEFAULT_IDLE_WARN_LEAD_SECONDS, v as DEFAULT_TURN_TIMEOUT_SECONDS, E as EndReason, w as EndedEvent, x as ExtendResult, F as FishTtsModel, y as FreezeReadingFn, G as Governor, z as GovernorAction, H as GovernorConfig, I as GovernorSignal, J as GovernorState, K as GraceWindowClosedEvent, L as GraceWindowOpenEvent, M as GraceWindowState, N as IdleWarningEvent, O as InboundRtpCursor, P as InboundRtpReading, Q as KnownBehaviorState, R as LLMProvider, S as LLMSelection, T as LiveKitAvatarGrantState, U as LiveKitAvatarGrantStatus, V as LiveKitCapacityState, W as LiveKitConnectionStatus, X as LiveKitSessionRequest, Y as LiveKitSessionStartResult, Z as LivePlaybackKeeper, _ as MAX_RECONNECT_ATTEMPTS, $ as MAX_SESSION_INSTRUCTIONS_CHARS, a0 as MIC_LEASE_ENDED_TIMEOUT_MS, a1 as MicLease, a2 as PlayableVideoElement, a3 as ProxyClientOptions, a4 as QualityCap, a5 as RECONNECT_BACKOFF_MS, a6 as RealtimeAvatarCapacityError, a7 as RealtimeAvatarLiveKitRoom, a8 as RealtimeAvatarLiveKitRoomProps, a9 as RealtimeAvatarRequestOptions, aa as RealtimeSessionApi, ab as RealtimeSessionMedia, ac as RealtimeSessionRoomSinks, ad as ReconnectPolicy, ae as ReconnectingEvent, af as RecoveryState, ag as RetryStep, ah as SessionBehavior, ai as SessionClip, aj as SessionClocks, ak as SessionEndReason, al as SessionLifecycleApi, am as SessionLifecyclePhase, an as SessionLifecyclePhaseKind, ao as SessionLifecycleRoomBridge, ap as SessionLifecycleRoomBridgeProps, aq as SurfaceLayers, ar as TurnState, as as TurnTimeoutEvent, at as UseAvatarQualityGovernorInput, au as UseLiveKitAvatarGrantInput, av as UseRealtimeSessionInput, aw as UseSessionLifecycleInput, ax as VoiceSpec, ay as VoiceSpecInput, az as capacityErrorFromBusy, aA as capacityStateFromGrant, aB as createProxyClient, aC as knownBehaviorStates, aD as mapTurnState, aE as readInboundRtp, aF as sessionBehaviorSchema, aG as sessionClipSchema, aH as shouldReplayPendingTurn, aI as splitCallTranscript, aJ as useAvatarAdaptivePlayoutDelay, aK as useAvatarPlayoutDelay, aL as useAvatarQualityGovernor, aM as useCallTranscript, aN as useLiveKitAvatarGrant, aO as useMicLease, aP as useRealtimeSession, aQ as useReleaseMicLeaseOnTrackEnded, aR as useSessionLifecycle } from './proxy-client-BIaUo0az.js';
|
|
4
4
|
import '@livekit/components-react';
|
|
5
5
|
import 'livekit-client';
|
|
6
6
|
import 'zod';
|
package/dist/react.js
CHANGED
|
@@ -502,6 +502,8 @@ function readInboundRtp(reports, previous) {
|
|
|
502
502
|
|
|
503
503
|
// ../client/src/react/use-adaptive-playout.ts
|
|
504
504
|
function useAvatarAdaptivePlayoutDelay(videoTrack, audioTrack, enabled = false, options) {
|
|
505
|
+
const ceiling = options?.ceilingSeconds ?? DEFAULT_AVATAR_PLAYOUT_DELAY_SECONDS;
|
|
506
|
+
const [appliedSeconds, setAppliedSeconds] = useState(ceiling);
|
|
505
507
|
const videoMediaTrack = videoTrack?.publication?.track;
|
|
506
508
|
const audioMediaTrack = audioTrack?.publication?.track;
|
|
507
509
|
useEffect(() => {
|
|
@@ -534,6 +536,7 @@ function useAvatarAdaptivePlayoutDelay(videoTrack, audioTrack, enabled = false,
|
|
|
534
536
|
const decision = controller.update(worst);
|
|
535
537
|
if (decision.changed) {
|
|
536
538
|
applyAvatarPlayoutDelay(videoMediaTrack, audioMediaTrack, decision.targetSeconds);
|
|
539
|
+
setAppliedSeconds(decision.targetSeconds);
|
|
537
540
|
}
|
|
538
541
|
} catch {
|
|
539
542
|
} finally {
|
|
@@ -544,8 +547,10 @@ function useAvatarAdaptivePlayoutDelay(videoTrack, audioTrack, enabled = false,
|
|
|
544
547
|
return () => {
|
|
545
548
|
closed = true;
|
|
546
549
|
clearInterval(interval);
|
|
550
|
+
setAppliedSeconds(ceiling);
|
|
547
551
|
};
|
|
548
|
-
}, [enabled, videoMediaTrack, audioMediaTrack, options]);
|
|
552
|
+
}, [enabled, videoMediaTrack, audioMediaTrack, options, ceiling]);
|
|
553
|
+
return appliedSeconds;
|
|
549
554
|
}
|
|
550
555
|
|
|
551
556
|
// ../client/src/react/quality-governor.ts
|
|
@@ -820,12 +825,22 @@ function AvatarVideoSurface(props) {
|
|
|
820
825
|
style,
|
|
821
826
|
children,
|
|
822
827
|
showLiveBadge = true,
|
|
823
|
-
adaptivePlayout = false
|
|
828
|
+
adaptivePlayout = false,
|
|
829
|
+
onPlayoutDelayChange
|
|
824
830
|
} = props;
|
|
825
831
|
const testId = props["data-testid"];
|
|
826
832
|
const { videoTrack, audioTrack } = useVoiceAssistant();
|
|
827
833
|
useAvatarPlayoutDelay(videoTrack, audioTrack);
|
|
828
|
-
useAvatarAdaptivePlayoutDelay(
|
|
834
|
+
const playoutDelaySeconds = useAvatarAdaptivePlayoutDelay(
|
|
835
|
+
videoTrack,
|
|
836
|
+
audioTrack,
|
|
837
|
+
adaptivePlayout
|
|
838
|
+
);
|
|
839
|
+
const onPlayoutDelayChangeRef = useRef(onPlayoutDelayChange);
|
|
840
|
+
onPlayoutDelayChangeRef.current = onPlayoutDelayChange;
|
|
841
|
+
useEffect(() => {
|
|
842
|
+
onPlayoutDelayChangeRef.current?.(playoutDelaySeconds);
|
|
843
|
+
}, [playoutDelaySeconds]);
|
|
829
844
|
const connectionState = useConnectionState();
|
|
830
845
|
const connected = connectionState === ConnectionState.Connected;
|
|
831
846
|
const trackProducing = useLiveTrackProducing(videoTrack);
|
package/dist/server.js
CHANGED
|
@@ -43,7 +43,7 @@ var RealtimeAvatarHttpError = class extends RealtimeAvatarError {
|
|
|
43
43
|
|
|
44
44
|
// ../http-client/src/client.ts
|
|
45
45
|
var DEFAULT_BASE_URL = "https://realtimeavatar.ai/api/v1";
|
|
46
|
-
var SDK_VERSION = "0.5.
|
|
46
|
+
var SDK_VERSION = "0.5.2";
|
|
47
47
|
var RealtimeAvatar = class {
|
|
48
48
|
#apiKey;
|
|
49
49
|
#baseUrl;
|
package/dist/tanstack-start.js
CHANGED
|
@@ -43,7 +43,7 @@ var RealtimeAvatarHttpError = class extends RealtimeAvatarError {
|
|
|
43
43
|
|
|
44
44
|
// ../http-client/src/client.ts
|
|
45
45
|
var DEFAULT_BASE_URL = "https://realtimeavatar.ai/api/v1";
|
|
46
|
-
var SDK_VERSION = "0.5.
|
|
46
|
+
var SDK_VERSION = "0.5.2";
|
|
47
47
|
var RealtimeAvatar = class {
|
|
48
48
|
#apiKey;
|
|
49
49
|
#baseUrl;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "realtime-avatar",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Realtime Avatar SDK. `realtime-avatar` and the route adapters hold your API key and are server-only; `realtime-avatar/react`, `/browser` and `/tools` never can — importing a server entry into a browser build throws at bundle time.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "The Influence Company",
|