realtime-avatar 0.24.0 → 0.24.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.
@@ -1,4 +1,4 @@
1
- import { RealtimeAvatar, isQueued, RealtimeAvatarHttpError } from './chunk-ZXPLFSG7.js';
1
+ import { RealtimeAvatar, isQueued, RealtimeAvatarHttpError } from './chunk-EODL5S3A.js';
2
2
 
3
3
  // ../proxy/src/config.ts
4
4
  var json = (body, status = 200) => new Response(JSON.stringify(body), {
@@ -654,7 +654,7 @@ z.enum([
654
654
 
655
655
  // ../http-client/src/client.ts
656
656
  var DEFAULT_BASE_URL = "https://realtimeavatar.ai/api/v1";
657
- var SDK_VERSION = "0.24.0";
657
+ var SDK_VERSION = "0.24.1";
658
658
  var RealtimeAvatar = class {
659
659
  #apiKey;
660
660
  #baseUrl;
package/dist/express.js CHANGED
@@ -1,5 +1,5 @@
1
- import { createProxyHandler } from './chunk-FUJI3KIH.js';
2
- import './chunk-ZXPLFSG7.js';
1
+ import { createProxyHandler } from './chunk-4PWWEERK.js';
2
+ import './chunk-EODL5S3A.js';
3
3
  import './chunk-MCIXU6XP.js';
4
4
 
5
5
  // ../proxy/src/express.ts
package/dist/hono.js CHANGED
@@ -1,5 +1,5 @@
1
- import { createProxyHandler } from './chunk-FUJI3KIH.js';
2
- import './chunk-ZXPLFSG7.js';
1
+ import { createProxyHandler } from './chunk-4PWWEERK.js';
2
+ import './chunk-EODL5S3A.js';
3
3
  import './chunk-MCIXU6XP.js';
4
4
 
5
5
  // ../proxy/src/hono.ts
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { RealtimeAvatar, RealtimeAvatarError, RealtimeAvatarHttpError, clipLibraryDeclarationSchema, isQueued, listRecordingsResponseSchema, recordingAccessResponseSchema, recordingArtifactSchema, recordingModeSchema, verifyTranscript } from './chunk-ZXPLFSG7.js';
1
+ export { RealtimeAvatar, RealtimeAvatarError, RealtimeAvatarHttpError, clipLibraryDeclarationSchema, isQueued, listRecordingsResponseSchema, recordingAccessResponseSchema, recordingArtifactSchema, recordingModeSchema, verifyTranscript } from './chunk-EODL5S3A.js';
2
2
  import './chunk-MCIXU6XP.js';
package/dist/nextjs.js CHANGED
@@ -1,5 +1,5 @@
1
- import { createProxyHandler } from './chunk-FUJI3KIH.js';
2
- import './chunk-ZXPLFSG7.js';
1
+ import { createProxyHandler } from './chunk-4PWWEERK.js';
2
+ import './chunk-EODL5S3A.js';
3
3
  import './chunk-MCIXU6XP.js';
4
4
 
5
5
  // ../proxy/src/nextjs.ts
@@ -706,32 +706,35 @@ function useLiveKitAvatarGrant(input) {
706
706
  warmLiveKitHost(serverUrlHintRef.current ?? readLiveKitUrlHint());
707
707
  setState({ status: "requesting", grant: null, busy: null, error: null });
708
708
  }
709
- void client.createLiveKitSessionOrBusy(request, requestOptions).then((result) => {
710
- if (cancelled) {
711
- if (result.status !== "busy") {
712
- void client.releaseLiveKitSession(result.grant.session_id, "superseded");
713
- }
714
- return;
715
- }
716
- if (result.status === "busy") {
717
- queueTicketRef.current = result.busy.queue_ticket_id ?? queueTicketRef.current;
718
- setState({ status: "busy", grant: null, busy: result.busy, error: null });
719
- return;
720
- }
721
- queueTicketRef.current = null;
722
- if (heldSessionRef.current && heldSessionRef.current !== result.grant.session_id) {
723
- releaseHeld("superseded", false);
724
- }
725
- heldSessionRef.current = result.grant.session_id;
726
- writeLiveKitUrlHint(result.grant.livekit_url);
727
- setState({ status: "ready", grant: result.grant, busy: null, error: null });
728
- }).catch((error) => {
709
+ queueMicrotask(() => {
729
710
  if (cancelled) return;
730
- setState({
731
- status: "failed",
732
- grant: null,
733
- busy: null,
734
- error: error instanceof Error ? error : new Error(String(error))
711
+ void client.createLiveKitSessionOrBusy(request, requestOptions).then((result) => {
712
+ if (cancelled) {
713
+ if (result.status !== "busy") {
714
+ void client.releaseLiveKitSession(result.grant.session_id, "superseded");
715
+ }
716
+ return;
717
+ }
718
+ if (result.status === "busy") {
719
+ queueTicketRef.current = result.busy.queue_ticket_id ?? queueTicketRef.current;
720
+ setState({ status: "busy", grant: null, busy: result.busy, error: null });
721
+ return;
722
+ }
723
+ queueTicketRef.current = null;
724
+ if (heldSessionRef.current && heldSessionRef.current !== result.grant.session_id) {
725
+ releaseHeld("superseded", false);
726
+ }
727
+ heldSessionRef.current = result.grant.session_id;
728
+ writeLiveKitUrlHint(result.grant.livekit_url);
729
+ setState({ status: "ready", grant: result.grant, busy: null, error: null });
730
+ }).catch((error) => {
731
+ if (cancelled) return;
732
+ setState({
733
+ status: "failed",
734
+ grant: null,
735
+ busy: null,
736
+ error: error instanceof Error ? error : new Error(String(error))
737
+ });
735
738
  });
736
739
  });
737
740
  return () => {
package/dist/react.js CHANGED
@@ -860,32 +860,35 @@ function useLiveKitAvatarGrant(input) {
860
860
  warmLiveKitHost(serverUrlHintRef.current ?? readLiveKitUrlHint());
861
861
  setState({ status: "requesting", grant: null, busy: null, error: null });
862
862
  }
863
- void client.createLiveKitSessionOrBusy(request, requestOptions).then((result) => {
864
- if (cancelled) {
865
- if (result.status !== "busy") {
866
- void client.releaseLiveKitSession(result.grant.session_id, "superseded");
867
- }
868
- return;
869
- }
870
- if (result.status === "busy") {
871
- queueTicketRef.current = result.busy.queue_ticket_id ?? queueTicketRef.current;
872
- setState({ status: "busy", grant: null, busy: result.busy, error: null });
873
- return;
874
- }
875
- queueTicketRef.current = null;
876
- if (heldSessionRef.current && heldSessionRef.current !== result.grant.session_id) {
877
- releaseHeld("superseded", false);
878
- }
879
- heldSessionRef.current = result.grant.session_id;
880
- writeLiveKitUrlHint(result.grant.livekit_url);
881
- setState({ status: "ready", grant: result.grant, busy: null, error: null });
882
- }).catch((error) => {
863
+ queueMicrotask(() => {
883
864
  if (cancelled) return;
884
- setState({
885
- status: "failed",
886
- grant: null,
887
- busy: null,
888
- error: error instanceof Error ? error : new Error(String(error))
865
+ void client.createLiveKitSessionOrBusy(request, requestOptions).then((result) => {
866
+ if (cancelled) {
867
+ if (result.status !== "busy") {
868
+ void client.releaseLiveKitSession(result.grant.session_id, "superseded");
869
+ }
870
+ return;
871
+ }
872
+ if (result.status === "busy") {
873
+ queueTicketRef.current = result.busy.queue_ticket_id ?? queueTicketRef.current;
874
+ setState({ status: "busy", grant: null, busy: result.busy, error: null });
875
+ return;
876
+ }
877
+ queueTicketRef.current = null;
878
+ if (heldSessionRef.current && heldSessionRef.current !== result.grant.session_id) {
879
+ releaseHeld("superseded", false);
880
+ }
881
+ heldSessionRef.current = result.grant.session_id;
882
+ writeLiveKitUrlHint(result.grant.livekit_url);
883
+ setState({ status: "ready", grant: result.grant, busy: null, error: null });
884
+ }).catch((error) => {
885
+ if (cancelled) return;
886
+ setState({
887
+ status: "failed",
888
+ grant: null,
889
+ busy: null,
890
+ error: error instanceof Error ? error : new Error(String(error))
891
+ });
889
892
  });
890
893
  });
891
894
  return () => {
package/dist/server.js CHANGED
@@ -1,2 +1,2 @@
1
- export { RealtimeAvatar, RealtimeAvatarError, RealtimeAvatarHttpError, clipLibraryDeclarationSchema, isQueued, listRecordingsResponseSchema, recordingAccessResponseSchema, recordingArtifactSchema, recordingModeSchema, verifyTranscript } from './chunk-ZXPLFSG7.js';
1
+ export { RealtimeAvatar, RealtimeAvatarError, RealtimeAvatarHttpError, clipLibraryDeclarationSchema, isQueued, listRecordingsResponseSchema, recordingAccessResponseSchema, recordingArtifactSchema, recordingModeSchema, verifyTranscript } from './chunk-EODL5S3A.js';
2
2
  import './chunk-MCIXU6XP.js';
@@ -1,5 +1,5 @@
1
- import { createProxyHandler } from './chunk-FUJI3KIH.js';
2
- import './chunk-ZXPLFSG7.js';
1
+ import { createProxyHandler } from './chunk-4PWWEERK.js';
2
+ import './chunk-EODL5S3A.js';
3
3
  import './chunk-MCIXU6XP.js';
4
4
 
5
5
  // src/tanstack-start.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "realtime-avatar",
3
- "version": "0.24.0",
3
+ "version": "0.24.1",
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",