realtime-avatar 0.3.0 → 0.4.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.
package/dist/express.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as ProxyConfig } from './types-E8SrD6sv.js';
2
- import './types-C_EMPwN7.js';
1
+ import { P as ProxyConfig } from './types-9leGOgVv.js';
2
+ import './types-C5zypiVY.js';
3
3
 
4
4
  type Expressish = {
5
5
  method: string;
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.3.0";
46
+ var SDK_VERSION = "0.4.1";
47
47
  var RealtimeAvatar = class {
48
48
  #apiKey;
49
49
  #baseUrl;
@@ -60,7 +60,7 @@ var RealtimeAvatar = class {
60
60
  if (!options.apiKey) throw new RealtimeAvatarError("apiKey is required");
61
61
  this.#apiKey = options.apiKey;
62
62
  this.#baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
63
- this.#fetch = options.fetch ?? globalThis.fetch;
63
+ this.#fetch = options.fetch ?? ((input, init) => globalThis.fetch(input, init));
64
64
  this.#timeoutMs = options.timeoutMs ?? 6e4;
65
65
  this.#maxRetries = Math.max(0, options.maxRetries ?? 2);
66
66
  this.#userAgent = [`realtime-avatar-sdk/${SDK_VERSION}`, runtimeTag(), options.userAgent].filter(Boolean).join(" ");
package/dist/hono.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as ProxyConfig } from './types-E8SrD6sv.js';
2
- import './types-C_EMPwN7.js';
1
+ import { P as ProxyConfig } from './types-9leGOgVv.js';
2
+ import './types-C5zypiVY.js';
3
3
 
4
4
  /**
5
5
  * Hono (and anything else built on Fetch handlers — Workers, Bun, Deno).
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.3.0";
46
+ var SDK_VERSION = "0.4.1";
47
47
  var RealtimeAvatar = class {
48
48
  #apiKey;
49
49
  #baseUrl;
@@ -60,7 +60,7 @@ var RealtimeAvatar = class {
60
60
  if (!options.apiKey) throw new RealtimeAvatarError("apiKey is required");
61
61
  this.#apiKey = options.apiKey;
62
62
  this.#baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
63
- this.#fetch = options.fetch ?? globalThis.fetch;
63
+ this.#fetch = options.fetch ?? ((input, init) => globalThis.fetch(input, init));
64
64
  this.#timeoutMs = options.timeoutMs ?? 6e4;
65
65
  this.#maxRetries = Math.max(0, options.maxRetries ?? 2);
66
66
  this.#userAgent = [`realtime-avatar-sdk/${SDK_VERSION}`, runtimeTag(), options.userAgent].filter(Boolean).join(" ");
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { a as CallPolicy, C as CallMode, S as StartCallResult, E as EndCallOptions, A as Avatar, b as AvatarUpdate, c as ClipSyncResult, d as AssetKind, e as Asset, L as ListSessionsOptions, U as UsageSessionPage, f as UsageSession, g as CreditBalance, T as TranscriptPayload } from './types-C_EMPwN7.js';
2
- export { h as CallConnection, i as CallQueued, j as ContextMessage, k as EndCallReason, V as VideoPolicy, l as VideoState, m as isQueued } from './types-C_EMPwN7.js';
1
+ import { a as CallPolicy, C as CallMode, S as StartCallResult, E as EndCallOptions, A as Avatar, b as AvatarUpdate, c as ClipSyncResult, d as AssetKind, e as Asset, L as ListSessionsOptions, U as UsageSessionPage, f as UsageSession, g as CreditBalance, T as TranscriptPayload } from './types-C5zypiVY.js';
2
+ export { h as CallConnection, i as CallQueued, j as ContextMessage, k as EndCallReason, V as VideoPolicy, l as VideoState, m as isQueued } from './types-C5zypiVY.js';
3
3
 
4
4
  interface RealtimeAvatarOptions {
5
5
  /** `tic_live_…` or `tic_test_…`. Server-side only — never ship this to a browser. */
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.3.0";
46
+ var SDK_VERSION = "0.4.1";
47
47
  var RealtimeAvatar = class {
48
48
  #apiKey;
49
49
  #baseUrl;
@@ -60,7 +60,7 @@ var RealtimeAvatar = class {
60
60
  if (!options.apiKey) throw new RealtimeAvatarError("apiKey is required");
61
61
  this.#apiKey = options.apiKey;
62
62
  this.#baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
63
- this.#fetch = options.fetch ?? globalThis.fetch;
63
+ this.#fetch = options.fetch ?? ((input, init) => globalThis.fetch(input, init));
64
64
  this.#timeoutMs = options.timeoutMs ?? 6e4;
65
65
  this.#maxRetries = Math.max(0, options.maxRetries ?? 2);
66
66
  this.#userAgent = [`realtime-avatar-sdk/${SDK_VERSION}`, runtimeTag(), options.userAgent].filter(Boolean).join(" ");
package/dist/nextjs.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as ProxyConfig } from './types-E8SrD6sv.js';
2
- import './types-C_EMPwN7.js';
1
+ import { P as ProxyConfig } from './types-9leGOgVv.js';
2
+ import './types-C5zypiVY.js';
3
3
 
4
4
  /**
5
5
  * App Router. Mount at `app/api/realtime-avatar/[...path]/route.ts`:
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.3.0";
46
+ var SDK_VERSION = "0.4.1";
47
47
  var RealtimeAvatar = class {
48
48
  #apiKey;
49
49
  #baseUrl;
@@ -60,7 +60,7 @@ var RealtimeAvatar = class {
60
60
  if (!options.apiKey) throw new RealtimeAvatarError("apiKey is required");
61
61
  this.#apiKey = options.apiKey;
62
62
  this.#baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
63
- this.#fetch = options.fetch ?? globalThis.fetch;
63
+ this.#fetch = options.fetch ?? ((input, init) => globalThis.fetch(input, init));
64
64
  this.#timeoutMs = options.timeoutMs ?? 6e4;
65
65
  this.#maxRetries = Math.max(0, options.maxRetries ?? 2);
66
66
  this.#userAgent = [`realtime-avatar-sdk/${SDK_VERSION}`, runtimeTag(), options.userAgent].filter(Boolean).join(" ");
@@ -204,38 +204,6 @@ declare const liveKitSessionRequestSchema: z.ZodObject<{
204
204
  when: z.ZodOptional<z.ZodString>;
205
205
  hint: z.ZodOptional<z.ZodString>;
206
206
  }, z.core.$strict>>>;
207
- sceneGraph: z.ZodOptional<z.ZodObject<{
208
- scenes: z.ZodArray<z.ZodObject<{
209
- scene_id: z.ZodString;
210
- hub_clip_id: z.ZodString;
211
- clips: z.ZodArray<z.ZodObject<{
212
- clip_id: z.ZodString;
213
- source_video_url: z.ZodOptional<z.ZodString>;
214
- video_cache_id: z.ZodOptional<z.ZodString>;
215
- max_seconds: z.ZodOptional<z.ZodNumber>;
216
- trigger: z.ZodOptional<z.ZodEnum<{
217
- idle: "idle";
218
- listen: "listen";
219
- think: "think";
220
- directive: "directive";
221
- }>>;
222
- loop: z.ZodOptional<z.ZodBoolean>;
223
- weight: z.ZodOptional<z.ZodNumber>;
224
- crossfade_ms: z.ZodOptional<z.ZodNumber>;
225
- trim_start_ms: z.ZodOptional<z.ZodNumber>;
226
- trim_end_ms: z.ZodOptional<z.ZodNumber>;
227
- when: z.ZodOptional<z.ZodString>;
228
- hint: z.ZodOptional<z.ZodString>;
229
- }, z.core.$strict>>;
230
- }, z.core.$strict>>;
231
- transitions: z.ZodArray<z.ZodObject<{
232
- clip_id: z.ZodString;
233
- source_video_url: z.ZodString;
234
- from_scene: z.ZodString;
235
- to_scene: z.ZodString;
236
- max_seconds: z.ZodOptional<z.ZodNumber>;
237
- }, z.core.$strict>>;
238
- }, z.core.$strict>>;
239
207
  behavior: z.ZodOptional<z.ZodObject<{
240
208
  gestures_enabled: z.ZodOptional<z.ZodBoolean>;
241
209
  gesture_freq: z.ZodOptional<z.ZodEnum<{
@@ -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 { aK as LiveKitSessionGrant, a as AvatarVideoFit } from './proxy-client-cZyX50-O.js';
5
- export { b as ApproachingEndEvent, c as ApproachingEndReason, A as AvatarSessionClient, B as BehaviorSnapshot, C as CallTranscript, f as CallTranscriptSegment, g as CartesiaTtsModel, h as ClipResult, i as ClosingTurnResult, j as CreditsLowEvent, D as DEFAULT_APPROACHING_END_LEAD_SECONDS, k as DEFAULT_AVATAR_PLAYOUT_DELAY_SECONDS, l as DEFAULT_CREDITS_LOW_LEAD_SECONDS, m as DEFAULT_GOVERNOR_CONFIG, n as DEFAULT_GRACE_CEILING_SECONDS, o as DEFAULT_GRACE_WINDOW_LEAD_SECONDS, p as DEFAULT_IDLE_SECONDS, q as DEFAULT_IDLE_WARN_LEAD_SECONDS, r as DEFAULT_TURN_TIMEOUT_SECONDS, E as EndReason, s as EndedEvent, t as ExtendResult, F as FishTtsModel, u as FreezeReadingFn, G as Governor, v as GovernorAction, w as GovernorConfig, x as GovernorSignal, y as GovernorState, z as GraceWindowClosedEvent, H as GraceWindowOpenEvent, I as GraceWindowState, J as IdleWarningEvent, K as KnownBehaviorState, L as LLMProvider, M as LLMSelection, N as LiveKitAvatarGrantState, O as LiveKitAvatarGrantStatus, P as LiveKitCapacityState, Q as LiveKitConnectionStatus, R as LiveKitSessionRequest, S as LiveKitSessionStartResult, U as MAX_RECONNECT_ATTEMPTS, V as MAX_SESSION_INSTRUCTIONS_CHARS, Z as ProxyClientOptions, _ as QualityCap, $ as RECONNECT_BACKOFF_MS, a3 as RealtimeAvatarRequestOptions, a4 as RealtimeSessionApi, a5 as RealtimeSessionMedia, a6 as RealtimeSessionRoomSinks, a7 as ReconnectPolicy, a8 as ReconnectingEvent, a9 as RecoveryState, aa as RetryStep, ab as SessionBehavior, ac as SessionClip, ad as SessionClocks, ae as SessionEndReason, af as SessionLifecycleApi, ag as SessionLifecyclePhase, ah as SessionLifecyclePhaseKind, ai as SessionLifecycleRoomBridge, aj as SessionLifecycleRoomBridgeProps, ak as SurfaceLayers, al as TurnState, am as TurnTimeoutEvent, an as UseAvatarQualityGovernorInput, ao as UseLiveKitAvatarGrantInput, ap as UseRealtimeSessionInput, aq as UseSessionLifecycleInput, ar as VoiceSpec, as as VoiceSpecInput, at as capacityErrorFromBusy, au as capacityStateFromGrant, av as createProxyClient, aL as isNativeLiveTrackSubscribed, aw as knownBehaviorStates, ax as mapTurnState, ay as sessionBehaviorSchema, az as sessionClipSchema, aB as splitCallTranscript, aC as useAvatarPlayoutDelay, aD as useAvatarQualityGovernor, aE as useCallTranscript, aF as useLiveKitAvatarGrant, aM as useLiveTrackProducing, aG as useMicLease, aH as useRealtimeSession, aI as useReleaseMicLeaseOnTrackEnded, aJ as useSessionLifecycle } from './proxy-client-cZyX50-O.js';
4
+ import { aK as LiveKitSessionGrant, a as AvatarVideoFit } from './proxy-client-Dm-O0jNn.js';
5
+ export { b as ApproachingEndEvent, c as ApproachingEndReason, A as AvatarSessionClient, B as BehaviorSnapshot, C as CallTranscript, f as CallTranscriptSegment, g as CartesiaTtsModel, h as ClipResult, i as ClosingTurnResult, j as CreditsLowEvent, D as DEFAULT_APPROACHING_END_LEAD_SECONDS, k as DEFAULT_AVATAR_PLAYOUT_DELAY_SECONDS, l as DEFAULT_CREDITS_LOW_LEAD_SECONDS, m as DEFAULT_GOVERNOR_CONFIG, n as DEFAULT_GRACE_CEILING_SECONDS, o as DEFAULT_GRACE_WINDOW_LEAD_SECONDS, p as DEFAULT_IDLE_SECONDS, q as DEFAULT_IDLE_WARN_LEAD_SECONDS, r as DEFAULT_TURN_TIMEOUT_SECONDS, E as EndReason, s as EndedEvent, t as ExtendResult, F as FishTtsModel, u as FreezeReadingFn, G as Governor, v as GovernorAction, w as GovernorConfig, x as GovernorSignal, y as GovernorState, z as GraceWindowClosedEvent, H as GraceWindowOpenEvent, I as GraceWindowState, J as IdleWarningEvent, K as KnownBehaviorState, L as LLMProvider, M as LLMSelection, N as LiveKitAvatarGrantState, O as LiveKitAvatarGrantStatus, P as LiveKitCapacityState, Q as LiveKitConnectionStatus, R as LiveKitSessionRequest, S as LiveKitSessionStartResult, U as MAX_RECONNECT_ATTEMPTS, V as MAX_SESSION_INSTRUCTIONS_CHARS, Z as ProxyClientOptions, _ as QualityCap, $ as RECONNECT_BACKOFF_MS, a3 as RealtimeAvatarRequestOptions, a4 as RealtimeSessionApi, a5 as RealtimeSessionMedia, a6 as RealtimeSessionRoomSinks, a7 as ReconnectPolicy, a8 as ReconnectingEvent, a9 as RecoveryState, aa as RetryStep, ab as SessionBehavior, ac as SessionClip, ad as SessionClocks, ae as SessionEndReason, af as SessionLifecycleApi, ag as SessionLifecyclePhase, ah as SessionLifecyclePhaseKind, ai as SessionLifecycleRoomBridge, aj as SessionLifecycleRoomBridgeProps, ak as SurfaceLayers, al as TurnState, am as TurnTimeoutEvent, an as UseAvatarQualityGovernorInput, ao as UseLiveKitAvatarGrantInput, ap as UseRealtimeSessionInput, aq as UseSessionLifecycleInput, ar as VoiceSpec, as as VoiceSpecInput, at as capacityErrorFromBusy, au as capacityStateFromGrant, av as createProxyClient, aL as isNativeLiveTrackSubscribed, aw as knownBehaviorStates, ax as mapTurnState, ay as sessionBehaviorSchema, az as sessionClipSchema, aB as splitCallTranscript, aC as useAvatarPlayoutDelay, aD as useAvatarQualityGovernor, aE as useCallTranscript, aF as useLiveKitAvatarGrant, aM as useLiveTrackProducing, aG as useMicLease, aH as useRealtimeSession, aI as useReleaseMicLeaseOnTrackEnded, aJ as useSessionLifecycle } from './proxy-client-Dm-O0jNn.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';
@@ -405,7 +405,8 @@ function useLiveKitAvatarGrant(input) {
405
405
  );
406
406
  useEffect(() => {
407
407
  if (!autoRetryBusy || !active || !tabVisible || state.status !== "busy" || !state.busy) return;
408
- const retryMs = Math.max(state.busy.recommended_retry_ms, 250);
408
+ const hinted = state.busy.recommended_retry_ms;
409
+ const retryMs = Math.max(Number.isFinite(hinted) ? hinted : 5e3, 250);
409
410
  const timer = window.setTimeout(refresh, retryMs);
410
411
  return () => window.clearTimeout(timer);
411
412
  }, [active, autoRetryBusy, tabVisible, refresh, state.busy, state.status]);
@@ -1018,28 +1019,6 @@ var sessionBehaviorSchema = z.object({
1018
1019
  gestures_enabled: z.boolean().optional(),
1019
1020
  gesture_freq: z.enum(["sparse", "balanced", "lively"]).optional()
1020
1021
  }).strict();
1021
- var _SCENE_CLIP_ID_RE = /^[A-Za-z0-9_-]{1,64}$/;
1022
- var sceneIdSchema = z.string().regex(/^[a-z0-9_]{1,40}$/, "scene_id must be a lowercase slug");
1023
- var sceneTransitionSchema = z.object({
1024
- clip_id: z.string().regex(_SCENE_CLIP_ID_RE, "clip_id must be a slug"),
1025
- source_video_url: z.string().url(),
1026
- from_scene: sceneIdSchema,
1027
- to_scene: sceneIdSchema,
1028
- max_seconds: z.number().min(1).max(10).optional()
1029
- }).strict().superRefine((v, ctx) => {
1030
- if (v.from_scene === v.to_scene) {
1031
- ctx.addIssue({ code: "custom", message: "a transition's from_scene must differ from to_scene", path: ["to_scene"] });
1032
- }
1033
- });
1034
- var sceneClusterSchema = z.object({
1035
- scene_id: sceneIdSchema,
1036
- hub_clip_id: z.string().regex(_SCENE_CLIP_ID_RE, "hub_clip_id must be a slug"),
1037
- clips: z.array(sessionClipSchema).min(1).max(4)
1038
- }).strict();
1039
- var sceneGraphSchema = z.object({
1040
- scenes: z.array(sceneClusterSchema).min(1).max(4),
1041
- transitions: z.array(sceneTransitionSchema).min(2).max(12)
1042
- }).strict();
1043
1022
  var transcriptWebhookSchema = z.object({
1044
1023
  url: z.string().url().max(500),
1045
1024
  secret: z.string().min(16).max(200)
@@ -1076,7 +1055,6 @@ z.object({
1076
1055
  // fewer is always safe — so the wire must not hold a number too.
1077
1056
  clip_library: z.array(sessionClipSchema).optional(),
1078
1057
  choreography: sessionChoreographySchema.optional(),
1079
- scene_graph: sceneGraphSchema.optional(),
1080
1058
  behavior: sessionBehaviorSchema.optional(),
1081
1059
  expression_profile: z.string().min(1).max(40).optional(),
1082
1060
  render_backend: renderBackendSchema.optional(),
@@ -1143,7 +1121,6 @@ z.object({
1143
1121
  voiceId: z.string().min(1).max(240).nullable().optional(),
1144
1122
  // Unbounded, for the same reason as `clip_library` on the wire schema above.
1145
1123
  clipLibrary: z.array(sessionClipSchema).optional(),
1146
- sceneGraph: sceneGraphSchema.optional(),
1147
1124
  behavior: sessionBehaviorSchema.optional(),
1148
1125
  renderBackend: renderBackendSchema.optional(),
1149
1126
  supportEdits: sessionSupportEditsSchema.optional(),
@@ -1195,13 +1172,7 @@ var behaviorStateFrameSchema = z.object({
1195
1172
  clip_id: z.string().min(1).max(64).optional(),
1196
1173
  trigger: clipTriggerSchema.optional(),
1197
1174
  loop: z.boolean().optional(),
1198
- prev_clip_id: z.string().min(1).max(64).optional(),
1199
- scene: z.string().min(1).max(40).optional(),
1200
- scene_transition: z.object({
1201
- clip_id: z.string().min(1).max(64),
1202
- from_scene: z.string().min(1).max(40),
1203
- to_scene: z.string().min(1).max(40)
1204
- }).optional()
1175
+ prev_clip_id: z.string().min(1).max(64).optional()
1205
1176
  }).strip();
1206
1177
  var clipAckFrameSchema = z.object({
1207
1178
  kind: z.literal("clip_ack"),
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-cZyX50-O.js';
3
- export { b as ApproachingEndEvent, c as ApproachingEndReason, d as AvatarVideoSurface, e as AvatarVideoSurfaceProps, B as BehaviorSnapshot, C as CallTranscript, f as CallTranscriptSegment, g as CartesiaTtsModel, h as ClipResult, i as ClosingTurnResult, j as CreditsLowEvent, D as DEFAULT_APPROACHING_END_LEAD_SECONDS, k as DEFAULT_AVATAR_PLAYOUT_DELAY_SECONDS, l as DEFAULT_CREDITS_LOW_LEAD_SECONDS, m as DEFAULT_GOVERNOR_CONFIG, n as DEFAULT_GRACE_CEILING_SECONDS, o as DEFAULT_GRACE_WINDOW_LEAD_SECONDS, p as DEFAULT_IDLE_SECONDS, q as DEFAULT_IDLE_WARN_LEAD_SECONDS, r as DEFAULT_TURN_TIMEOUT_SECONDS, E as EndReason, s as EndedEvent, t as ExtendResult, F as FishTtsModel, u as FreezeReadingFn, G as Governor, v as GovernorAction, w as GovernorConfig, x as GovernorSignal, y as GovernorState, z as GraceWindowClosedEvent, H as GraceWindowOpenEvent, I as GraceWindowState, J as IdleWarningEvent, K as KnownBehaviorState, L as LLMProvider, M as LLMSelection, N as LiveKitAvatarGrantState, O as LiveKitAvatarGrantStatus, P as LiveKitCapacityState, Q as LiveKitConnectionStatus, R as LiveKitSessionRequest, S as LiveKitSessionStartResult, T as LivePlaybackKeeper, U as MAX_RECONNECT_ATTEMPTS, V as MAX_SESSION_INSTRUCTIONS_CHARS, W as MIC_LEASE_ENDED_TIMEOUT_MS, X as MicLease, Y as PlayableVideoElement, Z as ProxyClientOptions, _ as QualityCap, $ as RECONNECT_BACKOFF_MS, a0 as RealtimeAvatarCapacityError, a1 as RealtimeAvatarLiveKitRoom, a2 as RealtimeAvatarLiveKitRoomProps, a3 as RealtimeAvatarRequestOptions, a4 as RealtimeSessionApi, a5 as RealtimeSessionMedia, a6 as RealtimeSessionRoomSinks, a7 as ReconnectPolicy, a8 as ReconnectingEvent, a9 as RecoveryState, aa as RetryStep, ab as SessionBehavior, ac as SessionClip, ad as SessionClocks, ae as SessionEndReason, af as SessionLifecycleApi, ag as SessionLifecyclePhase, ah as SessionLifecyclePhaseKind, ai as SessionLifecycleRoomBridge, aj as SessionLifecycleRoomBridgeProps, ak as SurfaceLayers, al as TurnState, am as TurnTimeoutEvent, an as UseAvatarQualityGovernorInput, ao as UseLiveKitAvatarGrantInput, ap as UseRealtimeSessionInput, aq as UseSessionLifecycleInput, ar as VoiceSpec, as as VoiceSpecInput, at as capacityErrorFromBusy, au as capacityStateFromGrant, av as createProxyClient, aw as knownBehaviorStates, ax as mapTurnState, ay as sessionBehaviorSchema, az as sessionClipSchema, aA as shouldReplayPendingTurn, aB as splitCallTranscript, aC as useAvatarPlayoutDelay, aD as useAvatarQualityGovernor, aE as useCallTranscript, aF as useLiveKitAvatarGrant, aG as useMicLease, aH as useRealtimeSession, aI as useReleaseMicLeaseOnTrackEnded, aJ as useSessionLifecycle } from './proxy-client-cZyX50-O.js';
2
+ import { A as AvatarSessionClient, a as AvatarVideoFit } from './proxy-client-Dm-O0jNn.js';
3
+ export { b as ApproachingEndEvent, c as ApproachingEndReason, d as AvatarVideoSurface, e as AvatarVideoSurfaceProps, B as BehaviorSnapshot, C as CallTranscript, f as CallTranscriptSegment, g as CartesiaTtsModel, h as ClipResult, i as ClosingTurnResult, j as CreditsLowEvent, D as DEFAULT_APPROACHING_END_LEAD_SECONDS, k as DEFAULT_AVATAR_PLAYOUT_DELAY_SECONDS, l as DEFAULT_CREDITS_LOW_LEAD_SECONDS, m as DEFAULT_GOVERNOR_CONFIG, n as DEFAULT_GRACE_CEILING_SECONDS, o as DEFAULT_GRACE_WINDOW_LEAD_SECONDS, p as DEFAULT_IDLE_SECONDS, q as DEFAULT_IDLE_WARN_LEAD_SECONDS, r as DEFAULT_TURN_TIMEOUT_SECONDS, E as EndReason, s as EndedEvent, t as ExtendResult, F as FishTtsModel, u as FreezeReadingFn, G as Governor, v as GovernorAction, w as GovernorConfig, x as GovernorSignal, y as GovernorState, z as GraceWindowClosedEvent, H as GraceWindowOpenEvent, I as GraceWindowState, J as IdleWarningEvent, K as KnownBehaviorState, L as LLMProvider, M as LLMSelection, N as LiveKitAvatarGrantState, O as LiveKitAvatarGrantStatus, P as LiveKitCapacityState, Q as LiveKitConnectionStatus, R as LiveKitSessionRequest, S as LiveKitSessionStartResult, T as LivePlaybackKeeper, U as MAX_RECONNECT_ATTEMPTS, V as MAX_SESSION_INSTRUCTIONS_CHARS, W as MIC_LEASE_ENDED_TIMEOUT_MS, X as MicLease, Y as PlayableVideoElement, Z as ProxyClientOptions, _ as QualityCap, $ as RECONNECT_BACKOFF_MS, a0 as RealtimeAvatarCapacityError, a1 as RealtimeAvatarLiveKitRoom, a2 as RealtimeAvatarLiveKitRoomProps, a3 as RealtimeAvatarRequestOptions, a4 as RealtimeSessionApi, a5 as RealtimeSessionMedia, a6 as RealtimeSessionRoomSinks, a7 as ReconnectPolicy, a8 as ReconnectingEvent, a9 as RecoveryState, aa as RetryStep, ab as SessionBehavior, ac as SessionClip, ad as SessionClocks, ae as SessionEndReason, af as SessionLifecycleApi, ag as SessionLifecyclePhase, ah as SessionLifecyclePhaseKind, ai as SessionLifecycleRoomBridge, aj as SessionLifecycleRoomBridgeProps, ak as SurfaceLayers, al as TurnState, am as TurnTimeoutEvent, an as UseAvatarQualityGovernorInput, ao as UseLiveKitAvatarGrantInput, ap as UseRealtimeSessionInput, aq as UseSessionLifecycleInput, ar as VoiceSpec, as as VoiceSpecInput, at as capacityErrorFromBusy, au as capacityStateFromGrant, av as createProxyClient, aw as knownBehaviorStates, ax as mapTurnState, ay as sessionBehaviorSchema, az as sessionClipSchema, aA as shouldReplayPendingTurn, aB as splitCallTranscript, aC as useAvatarPlayoutDelay, aD as useAvatarQualityGovernor, aE as useCallTranscript, aF as useLiveKitAvatarGrant, aG as useMicLease, aH as useRealtimeSession, aI as useReleaseMicLeaseOnTrackEnded, aJ as useSessionLifecycle } from './proxy-client-Dm-O0jNn.js';
4
4
  import '@livekit/components-react';
5
5
  import 'livekit-client';
6
6
  import 'zod';
package/dist/react.js CHANGED
@@ -364,7 +364,8 @@ function useLiveKitAvatarGrant(input) {
364
364
  );
365
365
  useEffect(() => {
366
366
  if (!autoRetryBusy || !active || !tabVisible || state.status !== "busy" || !state.busy) return;
367
- const retryMs = Math.max(state.busy.recommended_retry_ms, 250);
367
+ const hinted = state.busy.recommended_retry_ms;
368
+ const retryMs = Math.max(Number.isFinite(hinted) ? hinted : 5e3, 250);
368
369
  const timer = window.setTimeout(refresh, retryMs);
369
370
  return () => window.clearTimeout(timer);
370
371
  }, [active, autoRetryBusy, tabVisible, refresh, state.busy, state.status]);
@@ -1236,28 +1237,6 @@ var sessionBehaviorSchema = z.object({
1236
1237
  gestures_enabled: z.boolean().optional(),
1237
1238
  gesture_freq: z.enum(["sparse", "balanced", "lively"]).optional()
1238
1239
  }).strict();
1239
- var _SCENE_CLIP_ID_RE = /^[A-Za-z0-9_-]{1,64}$/;
1240
- var sceneIdSchema = z.string().regex(/^[a-z0-9_]{1,40}$/, "scene_id must be a lowercase slug");
1241
- var sceneTransitionSchema = z.object({
1242
- clip_id: z.string().regex(_SCENE_CLIP_ID_RE, "clip_id must be a slug"),
1243
- source_video_url: z.string().url(),
1244
- from_scene: sceneIdSchema,
1245
- to_scene: sceneIdSchema,
1246
- max_seconds: z.number().min(1).max(10).optional()
1247
- }).strict().superRefine((v, ctx) => {
1248
- if (v.from_scene === v.to_scene) {
1249
- ctx.addIssue({ code: "custom", message: "a transition's from_scene must differ from to_scene", path: ["to_scene"] });
1250
- }
1251
- });
1252
- var sceneClusterSchema = z.object({
1253
- scene_id: sceneIdSchema,
1254
- hub_clip_id: z.string().regex(_SCENE_CLIP_ID_RE, "hub_clip_id must be a slug"),
1255
- clips: z.array(sessionClipSchema).min(1).max(4)
1256
- }).strict();
1257
- var sceneGraphSchema = z.object({
1258
- scenes: z.array(sceneClusterSchema).min(1).max(4),
1259
- transitions: z.array(sceneTransitionSchema).min(2).max(12)
1260
- }).strict();
1261
1240
  var transcriptWebhookSchema = z.object({
1262
1241
  url: z.string().url().max(500),
1263
1242
  secret: z.string().min(16).max(200)
@@ -1294,7 +1273,6 @@ z.object({
1294
1273
  // fewer is always safe — so the wire must not hold a number too.
1295
1274
  clip_library: z.array(sessionClipSchema).optional(),
1296
1275
  choreography: sessionChoreographySchema.optional(),
1297
- scene_graph: sceneGraphSchema.optional(),
1298
1276
  behavior: sessionBehaviorSchema.optional(),
1299
1277
  expression_profile: z.string().min(1).max(40).optional(),
1300
1278
  render_backend: renderBackendSchema.optional(),
@@ -1361,7 +1339,6 @@ z.object({
1361
1339
  voiceId: z.string().min(1).max(240).nullable().optional(),
1362
1340
  // Unbounded, for the same reason as `clip_library` on the wire schema above.
1363
1341
  clipLibrary: z.array(sessionClipSchema).optional(),
1364
- sceneGraph: sceneGraphSchema.optional(),
1365
1342
  behavior: sessionBehaviorSchema.optional(),
1366
1343
  renderBackend: renderBackendSchema.optional(),
1367
1344
  supportEdits: sessionSupportEditsSchema.optional(),
@@ -1413,13 +1390,7 @@ var behaviorStateFrameSchema = z.object({
1413
1390
  clip_id: z.string().min(1).max(64).optional(),
1414
1391
  trigger: clipTriggerSchema.optional(),
1415
1392
  loop: z.boolean().optional(),
1416
- prev_clip_id: z.string().min(1).max(64).optional(),
1417
- scene: z.string().min(1).max(40).optional(),
1418
- scene_transition: z.object({
1419
- clip_id: z.string().min(1).max(64),
1420
- from_scene: z.string().min(1).max(40),
1421
- to_scene: z.string().min(1).max(40)
1422
- }).optional()
1393
+ prev_clip_id: z.string().min(1).max(64).optional()
1423
1394
  }).strip();
1424
1395
  var clipAckFrameSchema = z.object({
1425
1396
  kind: z.literal("clip_ack"),
package/dist/server.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export { RealtimeAvatar, RealtimeAvatarError, RealtimeAvatarHttpError, RealtimeAvatarOptions, StartCallOptions, verifyTranscript } from './index.js';
2
- export { e as Asset, d as AssetKind, A as Avatar, b as AvatarUpdate, h as CallConnection, C as CallMode, a as CallPolicy, i as CallQueued, c as ClipSyncResult, j as ContextMessage, g as CreditBalance, E as EndCallOptions, k as EndCallReason, L as ListSessionsOptions, S as StartCallResult, T as TranscriptPayload, f as UsageSession, U as UsageSessionPage, V as VideoPolicy, l as VideoState, m as isQueued } from './types-C_EMPwN7.js';
2
+ export { e as Asset, d as AssetKind, A as Avatar, b as AvatarUpdate, h as CallConnection, C as CallMode, a as CallPolicy, i as CallQueued, c as ClipSyncResult, j as ContextMessage, g as CreditBalance, E as EndCallOptions, k as EndCallReason, L as ListSessionsOptions, S as StartCallResult, T as TranscriptPayload, f as UsageSession, U as UsageSessionPage, V as VideoPolicy, l as VideoState, m as isQueued } from './types-C5zypiVY.js';
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.3.0";
46
+ var SDK_VERSION = "0.4.1";
47
47
  var RealtimeAvatar = class {
48
48
  #apiKey;
49
49
  #baseUrl;
@@ -60,7 +60,7 @@ var RealtimeAvatar = class {
60
60
  if (!options.apiKey) throw new RealtimeAvatarError("apiKey is required");
61
61
  this.#apiKey = options.apiKey;
62
62
  this.#baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
63
- this.#fetch = options.fetch ?? globalThis.fetch;
63
+ this.#fetch = options.fetch ?? ((input, init) => globalThis.fetch(input, init));
64
64
  this.#timeoutMs = options.timeoutMs ?? 6e4;
65
65
  this.#maxRetries = Math.max(0, options.maxRetries ?? 2);
66
66
  this.#userAgent = [`realtime-avatar-sdk/${SDK_VERSION}`, runtimeTag(), options.userAgent].filter(Boolean).join(" ");
@@ -1,5 +1,5 @@
1
- import { P as ProxyConfig } from './types-E8SrD6sv.js';
2
- import './types-C_EMPwN7.js';
1
+ import { P as ProxyConfig } from './types-9leGOgVv.js';
2
+ import './types-C5zypiVY.js';
3
3
 
4
4
  /**
5
5
  * TanStack Start. Mount at `routes/api/realtime-avatar/$.ts` — the trailing `$` is Start's
@@ -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.3.0";
46
+ var SDK_VERSION = "0.4.1";
47
47
  var RealtimeAvatar = class {
48
48
  #apiKey;
49
49
  #baseUrl;
@@ -60,7 +60,7 @@ var RealtimeAvatar = class {
60
60
  if (!options.apiKey) throw new RealtimeAvatarError("apiKey is required");
61
61
  this.#apiKey = options.apiKey;
62
62
  this.#baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
63
- this.#fetch = options.fetch ?? globalThis.fetch;
63
+ this.#fetch = options.fetch ?? ((input, init) => globalThis.fetch(input, init));
64
64
  this.#timeoutMs = options.timeoutMs ?? 6e4;
65
65
  this.#maxRetries = Math.max(0, options.maxRetries ?? 2);
66
66
  this.#userAgent = [`realtime-avatar-sdk/${SDK_VERSION}`, runtimeTag(), options.userAgent].filter(Boolean).join(" ");
@@ -1,4 +1,4 @@
1
- import { C as CallMode, a as CallPolicy } from './types-C_EMPwN7.js';
1
+ import { C as CallMode, a as CallPolicy } from './types-C5zypiVY.js';
2
2
 
3
3
  /** The three things a caller can ask the proxy to do. Gate on these, not on URLs. */
4
4
  type ProxyOperation = "connect" | "end" | "avatars" | "credits";
@@ -114,39 +114,6 @@ interface components {
114
114
  crossfade_easing?: "linear" | "smooth" | "ease_out";
115
115
  wrap_crossfade_ms?: number;
116
116
  };
117
- scene_graph?: {
118
- scenes: {
119
- scene_id: string;
120
- hub_clip_id: string;
121
- clips: {
122
- clip_id: string;
123
- /**
124
- * Format: uri
125
- * @description The clip's video URL — for a platform-generated library this is the generated clip's hosted URL, filled in server-side at hydration.
126
- */
127
- source_video_url?: string;
128
- video_cache_id?: string;
129
- max_seconds?: number;
130
- /** @enum {string} */
131
- trigger?: "idle" | "listen" | "think" | "directive";
132
- loop?: boolean;
133
- weight?: number;
134
- crossfade_ms?: number;
135
- trim_start_ms?: number;
136
- trim_end_ms?: number;
137
- when?: string;
138
- hint?: string;
139
- }[];
140
- }[];
141
- transitions: {
142
- clip_id: string;
143
- /** Format: uri */
144
- source_video_url: string;
145
- from_scene: string;
146
- to_scene: string;
147
- max_seconds?: number;
148
- }[];
149
- };
150
117
  behavior?: {
151
118
  gestures_enabled?: boolean;
152
119
  /** @enum {string} */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "realtime-avatar",
3
- "version": "0.3.0",
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 \u2014 importing a server entry into a browser build throws at bundle time.",
3
+ "version": "0.4.1",
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",
7
7
  "homepage": "https://realtimeavatar.ai/docs",