realtime-avatar 0.5.2 → 0.5.4
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/chunk-I3BFZHMQ.js +678 -0
- package/dist/chunk-XZ5DRDND.js +72 -0
- package/dist/express.js +2 -715
- package/dist/hono.js +2 -715
- package/dist/index.js +1 -678
- package/dist/nextjs.js +2 -715
- package/dist/{proxy-client-BIaUo0az.d.ts → proxy-client-DylBmlgX.d.ts} +5 -5
- package/dist/react-native.d.ts +14 -2
- package/dist/react-native.js +11 -1
- package/dist/react.d.ts +2 -2
- package/dist/server.js +1 -678
- package/dist/tanstack-start.js +2 -715
- package/package.json +1 -1
|
@@ -220,8 +220,8 @@ declare const liveKitSessionRequestSchema: z.ZodObject<{
|
|
|
220
220
|
rules: z.ZodString;
|
|
221
221
|
cooldown_seconds: z.ZodOptional<z.ZodNumber>;
|
|
222
222
|
renderer: z.ZodOptional<z.ZodEnum<{
|
|
223
|
-
generative: "generative";
|
|
224
223
|
editor: "editor";
|
|
224
|
+
generative: "generative";
|
|
225
225
|
}>>;
|
|
226
226
|
}, z.core.$strict>>;
|
|
227
227
|
}, z.core.$strict>>;
|
|
@@ -251,12 +251,12 @@ declare const liveKitSessionGrantSchema: z.ZodObject<{
|
|
|
251
251
|
}, z.core.$loose>;
|
|
252
252
|
declare const sessionEndReasonSchema: z.ZodEnum<{
|
|
253
253
|
idle: "idle";
|
|
254
|
-
disconnected: "disconnected";
|
|
255
|
-
failed: "failed";
|
|
256
254
|
user_ended: "user_ended";
|
|
257
255
|
session_cap: "session_cap";
|
|
256
|
+
disconnected: "disconnected";
|
|
258
257
|
out_of_credits: "out_of_credits";
|
|
259
258
|
agent_ended: "agent_ended";
|
|
259
|
+
failed: "failed";
|
|
260
260
|
}>;
|
|
261
261
|
type SessionEndReasonLabel = z.infer<typeof sessionEndReasonSchema>;
|
|
262
262
|
declare const approachingEndReasonSchema: z.ZodEnum<{
|
|
@@ -289,8 +289,8 @@ declare const capacityBusyResponseSchema: z.ZodObject<{
|
|
|
289
289
|
recommended_retry_ms: z.ZodNumber;
|
|
290
290
|
}, z.core.$strict>;
|
|
291
291
|
declare const liveKitSessionReleaseReasonSchema: z.ZodEnum<{
|
|
292
|
-
page_hide: "page_hide";
|
|
293
292
|
disconnected: "disconnected";
|
|
293
|
+
page_hide: "page_hide";
|
|
294
294
|
superseded: "superseded";
|
|
295
295
|
unmount: "unmount";
|
|
296
296
|
manual: "manual";
|
|
@@ -1619,4 +1619,4 @@ interface ProxyClientOptions {
|
|
|
1619
1619
|
}
|
|
1620
1620
|
declare function createProxyClient(options: ProxyClientOptions): AvatarSessionClient;
|
|
1621
1621
|
|
|
1622
|
-
export {
|
|
1622
|
+
export { type QualityCap as $, type AvatarVideoFit as A, type BehaviorSnapshot as B, type CallTranscript as C, DEFAULT_APPROACHING_END_LEAD_SECONDS as D, type EndReason as E, type FishTtsModel as F, type Governor as G, type GovernorState as H, type GraceWindowClosedEvent as I, type GraceWindowOpenEvent as J, type GraceWindowState as K, type LiveKitSessionGrant as L, type IdleWarningEvent as M, type InboundRtpCursor as N, type InboundRtpReading as O, type KnownBehaviorState as P, type LLMProvider as Q, type LLMSelection as R, type LiveKitAvatarGrantState as S, type LiveKitAvatarGrantStatus as T, type LiveKitCapacityState as U, type LiveKitConnectionStatus as V, type LiveKitSessionRequest as W, type LiveKitSessionStartResult as X, MAX_RECONNECT_ATTEMPTS as Y, MAX_SESSION_INSTRUCTIONS_CHARS as Z, type ProxyClientOptions as _, AdaptivePlayoutController as a, RECONNECT_BACKOFF_MS as a0, type RealtimeAvatarRequestOptions as a1, type RealtimeSessionApi as a2, type RealtimeSessionMedia as a3, type RealtimeSessionRoomSinks as a4, type ReconnectPolicy as a5, type ReconnectingEvent as a6, type RecoveryState as a7, type RetryStep as a8, type SessionBehavior as a9, splitCallTranscript as aA, useAvatarAdaptivePlayoutDelay as aB, useAvatarPlayoutDelay as aC, useAvatarQualityGovernor as aD, useCallTranscript as aE, useLiveKitAvatarGrant as aF, useLiveTrackProducing as aG, useMicLease as aH, useRealtimeSession as aI, useReleaseMicLeaseOnTrackEnded as aJ, useSessionLifecycle as aK, AvatarVideoSurface as aL, type AvatarVideoSurfaceProps as aM, type LivePlaybackKeeper as aN, MIC_LEASE_ENDED_TIMEOUT_MS as aO, type MicLease as aP, type PlayableVideoElement as aQ, RealtimeAvatarCapacityError as aR, RealtimeAvatarLiveKitRoom as aS, type RealtimeAvatarLiveKitRoomProps as aT, shouldReplayPendingTurn as aU, type SessionClip as aa, type SessionClocks as ab, type SessionEndReason as ac, type SessionLifecycleApi as ad, type SessionLifecyclePhase as ae, type SessionLifecyclePhaseKind as af, SessionLifecycleRoomBridge as ag, type SessionLifecycleRoomBridgeProps as ah, type SurfaceLayers as ai, type TurnState as aj, type TurnTimeoutEvent as ak, type UseAvatarQualityGovernorInput as al, type UseLiveKitAvatarGrantInput as am, type UseRealtimeSessionInput as an, type UseSessionLifecycleInput as ao, type VoiceSpec as ap, type VoiceSpecInput as aq, capacityErrorFromBusy as ar, capacityStateFromGrant as as, createProxyClient as at, isNativeLiveTrackSubscribed as au, knownBehaviorStates as av, mapTurnState as aw, readInboundRtp as ax, sessionBehaviorSchema as ay, sessionClipSchema as az, type AdaptivePlayoutDecision as b, type AdaptivePlayoutOptions as c, type AdaptivePlayoutSample as d, type ApproachingEndEvent as e, type ApproachingEndReason as f, type AvatarSessionClient as g, type CallTranscriptSegment as h, type CartesiaTtsModel as i, type ClipResult as j, type ClosingTurnResult as k, type CreditsLowEvent as l, DEFAULT_AVATAR_PLAYOUT_DELAY_SECONDS as m, DEFAULT_CREDITS_LOW_LEAD_SECONDS as n, DEFAULT_GOVERNOR_CONFIG as o, DEFAULT_GRACE_CEILING_SECONDS as p, DEFAULT_GRACE_WINDOW_LEAD_SECONDS as q, DEFAULT_IDLE_SECONDS as r, DEFAULT_IDLE_WARN_LEAD_SECONDS as s, DEFAULT_TURN_TIMEOUT_SECONDS as t, type EndedEvent as u, type ExtendResult as v, type FreezeReadingFn as w, type GovernorAction as x, type GovernorConfig as y, type GovernorSignal as z };
|
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 {
|
|
5
|
-
export {
|
|
4
|
+
import { L as LiveKitSessionGrant, A as AvatarVideoFit } from './proxy-client-DylBmlgX.js';
|
|
5
|
+
export { a as AdaptivePlayoutController, b as AdaptivePlayoutDecision, c as AdaptivePlayoutOptions, d as AdaptivePlayoutSample, e as ApproachingEndEvent, f as ApproachingEndReason, g as AvatarSessionClient, B as BehaviorSnapshot, C as CallTranscript, h as CallTranscriptSegment, i as CartesiaTtsModel, j as ClipResult, k as ClosingTurnResult, l as CreditsLowEvent, D as DEFAULT_APPROACHING_END_LEAD_SECONDS, m as DEFAULT_AVATAR_PLAYOUT_DELAY_SECONDS, n as DEFAULT_CREDITS_LOW_LEAD_SECONDS, o as DEFAULT_GOVERNOR_CONFIG, p as DEFAULT_GRACE_CEILING_SECONDS, q as DEFAULT_GRACE_WINDOW_LEAD_SECONDS, r as DEFAULT_IDLE_SECONDS, s as DEFAULT_IDLE_WARN_LEAD_SECONDS, t as DEFAULT_TURN_TIMEOUT_SECONDS, E as EndReason, u as EndedEvent, v as ExtendResult, F as FishTtsModel, w as FreezeReadingFn, G as Governor, x as GovernorAction, y as GovernorConfig, z as GovernorSignal, H as GovernorState, I as GraceWindowClosedEvent, J as GraceWindowOpenEvent, K as GraceWindowState, M as IdleWarningEvent, N as InboundRtpCursor, O as InboundRtpReading, P as KnownBehaviorState, Q as LLMProvider, R as LLMSelection, S as LiveKitAvatarGrantState, T as LiveKitAvatarGrantStatus, U as LiveKitCapacityState, V as LiveKitConnectionStatus, W as LiveKitSessionRequest, X as LiveKitSessionStartResult, Y as MAX_RECONNECT_ATTEMPTS, Z as MAX_SESSION_INSTRUCTIONS_CHARS, _ as ProxyClientOptions, $ as QualityCap, a0 as RECONNECT_BACKOFF_MS, a1 as RealtimeAvatarRequestOptions, a2 as RealtimeSessionApi, a3 as RealtimeSessionMedia, a4 as RealtimeSessionRoomSinks, a5 as ReconnectPolicy, a6 as ReconnectingEvent, a7 as RecoveryState, a8 as RetryStep, a9 as SessionBehavior, aa as SessionClip, ab as SessionClocks, ac as SessionEndReason, ad as SessionLifecycleApi, ae as SessionLifecyclePhase, af as SessionLifecyclePhaseKind, ag as SessionLifecycleRoomBridge, ah as SessionLifecycleRoomBridgeProps, ai as SurfaceLayers, aj as TurnState, ak as TurnTimeoutEvent, al as UseAvatarQualityGovernorInput, am as UseLiveKitAvatarGrantInput, an as UseRealtimeSessionInput, ao as UseSessionLifecycleInput, ap as VoiceSpec, aq as VoiceSpecInput, ar as capacityErrorFromBusy, as as capacityStateFromGrant, at as createProxyClient, au as isNativeLiveTrackSubscribed, av as knownBehaviorStates, aw as mapTurnState, ax as readInboundRtp, ay as sessionBehaviorSchema, az as sessionClipSchema, aA as splitCallTranscript, aB as useAvatarAdaptivePlayoutDelay, aC as useAvatarPlayoutDelay, aD as useAvatarQualityGovernor, aE as useCallTranscript, aF as useLiveKitAvatarGrant, aG as useLiveTrackProducing, aH as useMicLease, aI as useRealtimeSession, aJ as useReleaseMicLeaseOnTrackEnded, aK as useSessionLifecycle } from './proxy-client-DylBmlgX.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';
|
|
@@ -96,6 +96,18 @@ type AvatarVideoSurfaceProps = {
|
|
|
96
96
|
* keeps the flat cushion.
|
|
97
97
|
*/
|
|
98
98
|
adaptivePlayout?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Called with the receiver playout depth (SECONDS) whenever it changes — the flat
|
|
101
|
+
* default while `adaptivePlayout` is off, the live value while it is on.
|
|
102
|
+
*
|
|
103
|
+
* Read this if anything you render is timed against the avatar's VOICE. The media rides
|
|
104
|
+
* the receiver buffer and a side channel (captions, a transcript reveal) does not, so it
|
|
105
|
+
* has to be held by the same amount or it arrives early — and once the depth moves, a
|
|
106
|
+
* hard-coded copy is wrong by however far the loop has descended. Web got this in 0.5.2;
|
|
107
|
+
* shipping `adaptivePlayout` here without it hands a native consumer the latency knob and
|
|
108
|
+
* no way to keep anything in sync with the voice it just un-buffered.
|
|
109
|
+
*/
|
|
110
|
+
onPlayoutDelayChange?: (seconds: number) => void;
|
|
99
111
|
/** Test id for the box. */
|
|
100
112
|
testID?: string;
|
|
101
113
|
};
|
package/dist/react-native.js
CHANGED
|
@@ -897,11 +897,21 @@ function AvatarVideoSurface(props) {
|
|
|
897
897
|
children,
|
|
898
898
|
showLiveBadge = true,
|
|
899
899
|
adaptivePlayout = false,
|
|
900
|
+
onPlayoutDelayChange,
|
|
900
901
|
testID
|
|
901
902
|
} = props;
|
|
902
903
|
const { videoTrack, audioTrack } = useVoiceAssistant();
|
|
903
904
|
useAvatarPlayoutDelay(videoTrack, audioTrack);
|
|
904
|
-
useAvatarAdaptivePlayoutDelay(
|
|
905
|
+
const playoutDelaySeconds = useAvatarAdaptivePlayoutDelay(
|
|
906
|
+
videoTrack,
|
|
907
|
+
audioTrack,
|
|
908
|
+
adaptivePlayout
|
|
909
|
+
);
|
|
910
|
+
const onPlayoutDelayChangeRef = useRef(onPlayoutDelayChange);
|
|
911
|
+
onPlayoutDelayChangeRef.current = onPlayoutDelayChange;
|
|
912
|
+
useEffect(() => {
|
|
913
|
+
onPlayoutDelayChangeRef.current?.(playoutDelaySeconds);
|
|
914
|
+
}, [playoutDelaySeconds]);
|
|
905
915
|
const connectionState = useConnectionState();
|
|
906
916
|
const connected = connectionState === ConnectionState.Connected;
|
|
907
917
|
const trackProducing = useLiveTrackProducing(
|
package/dist/react.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
2
|
+
import { g as AvatarSessionClient, A as AvatarVideoFit } from './proxy-client-DylBmlgX.js';
|
|
3
|
+
export { a as AdaptivePlayoutController, b as AdaptivePlayoutDecision, c as AdaptivePlayoutOptions, d as AdaptivePlayoutSample, e as ApproachingEndEvent, f as ApproachingEndReason, aL as AvatarVideoSurface, aM as AvatarVideoSurfaceProps, B as BehaviorSnapshot, C as CallTranscript, h as CallTranscriptSegment, i as CartesiaTtsModel, j as ClipResult, k as ClosingTurnResult, l as CreditsLowEvent, D as DEFAULT_APPROACHING_END_LEAD_SECONDS, m as DEFAULT_AVATAR_PLAYOUT_DELAY_SECONDS, n as DEFAULT_CREDITS_LOW_LEAD_SECONDS, o as DEFAULT_GOVERNOR_CONFIG, p as DEFAULT_GRACE_CEILING_SECONDS, q as DEFAULT_GRACE_WINDOW_LEAD_SECONDS, r as DEFAULT_IDLE_SECONDS, s as DEFAULT_IDLE_WARN_LEAD_SECONDS, t as DEFAULT_TURN_TIMEOUT_SECONDS, E as EndReason, u as EndedEvent, v as ExtendResult, F as FishTtsModel, w as FreezeReadingFn, G as Governor, x as GovernorAction, y as GovernorConfig, z as GovernorSignal, H as GovernorState, I as GraceWindowClosedEvent, J as GraceWindowOpenEvent, K as GraceWindowState, M as IdleWarningEvent, N as InboundRtpCursor, O as InboundRtpReading, P as KnownBehaviorState, Q as LLMProvider, R as LLMSelection, S as LiveKitAvatarGrantState, T as LiveKitAvatarGrantStatus, U as LiveKitCapacityState, V as LiveKitConnectionStatus, W as LiveKitSessionRequest, X as LiveKitSessionStartResult, aN as LivePlaybackKeeper, Y as MAX_RECONNECT_ATTEMPTS, Z as MAX_SESSION_INSTRUCTIONS_CHARS, aO as MIC_LEASE_ENDED_TIMEOUT_MS, aP as MicLease, aQ as PlayableVideoElement, _ as ProxyClientOptions, $ as QualityCap, a0 as RECONNECT_BACKOFF_MS, aR as RealtimeAvatarCapacityError, aS as RealtimeAvatarLiveKitRoom, aT as RealtimeAvatarLiveKitRoomProps, a1 as RealtimeAvatarRequestOptions, a2 as RealtimeSessionApi, a3 as RealtimeSessionMedia, a4 as RealtimeSessionRoomSinks, a5 as ReconnectPolicy, a6 as ReconnectingEvent, a7 as RecoveryState, a8 as RetryStep, a9 as SessionBehavior, aa as SessionClip, ab as SessionClocks, ac as SessionEndReason, ad as SessionLifecycleApi, ae as SessionLifecyclePhase, af as SessionLifecyclePhaseKind, ag as SessionLifecycleRoomBridge, ah as SessionLifecycleRoomBridgeProps, ai as SurfaceLayers, aj as TurnState, ak as TurnTimeoutEvent, al as UseAvatarQualityGovernorInput, am as UseLiveKitAvatarGrantInput, an as UseRealtimeSessionInput, ao as UseSessionLifecycleInput, ap as VoiceSpec, aq as VoiceSpecInput, ar as capacityErrorFromBusy, as as capacityStateFromGrant, at as createProxyClient, av as knownBehaviorStates, aw as mapTurnState, ax as readInboundRtp, ay as sessionBehaviorSchema, az as sessionClipSchema, aU as shouldReplayPendingTurn, aA as splitCallTranscript, aB as useAvatarAdaptivePlayoutDelay, aC as useAvatarPlayoutDelay, aD as useAvatarQualityGovernor, aE as useCallTranscript, aF as useLiveKitAvatarGrant, aH as useMicLease, aI as useRealtimeSession, aJ as useReleaseMicLeaseOnTrackEnded, aK as useSessionLifecycle } from './proxy-client-DylBmlgX.js';
|
|
4
4
|
import '@livekit/components-react';
|
|
5
5
|
import 'livekit-client';
|
|
6
6
|
import 'zod';
|