@ateam-ai-mobile/ui 0.1.10 → 0.1.11

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/index.d.mts CHANGED
@@ -533,6 +533,7 @@ declare class VoiceSessionManager implements VoiceSessionProvider {
533
533
  /** Run an authorized device tool. Never throws: every failure is an answer. */
534
534
  private runDeviceTool;
535
535
  private setState;
536
+ private setCallAudio;
536
537
  private appendTranscript;
537
538
  private emit;
538
539
  private waitForConnect;
@@ -594,6 +595,12 @@ interface OAuthProvider {
594
595
  }
595
596
  /** Register a native OAuth implementation (e.g. via @ateam-ai-mobile/expo). */
596
597
  declare function setOAuthProvider(oauth: OAuthProvider | null): void;
598
+ interface CallAudioProvider {
599
+ beginCall(): void;
600
+ endCall(): void;
601
+ }
602
+ /** Register the device's call audio mode (e.g. via @ateam-ai-mobile/expo). */
603
+ declare function setCallAudioProvider(callAudio: CallAudioProvider | null): void;
597
604
  interface ClipboardProvider {
598
605
  setString(text: string): Promise<void>;
599
606
  }
@@ -610,4 +617,4 @@ declare function setUIActionNavigator(navigate: UIActionNavigator | null): void;
610
617
  type ExtraHostsGetter = () => string[];
611
618
  declare function setPluginWebViewExtraHosts(getter: ExtraHostsGetter | null): void;
612
619
 
613
- export { AdasChatScreen, type AdasChatScreenProps, type CallState, ChatInput, type ClipboardProvider, DaySeparator, EmbeddedPluginWebView, type HandoffExchangeDeps, HandoffScreen, type HandoffScreenProps, type InviteJoinDeps, JobProgressBar, JoinScreen, type JoinScreenProps, Lightbox, LoginScreen, type LoginScreenProps, MessageBubble, type OAuthGoogleConfig, type OAuthProvider, type OpenJoinDeps, OpenJoinScreen, type OpenJoinScreenProps, Plugin, PluginSurface, type ProviderSignInDeps, TableCardBlock, TenantPicker, type TenantPickerProps, type TranscriptEntry, TypingIndicator, type UIActionRoute, UIActionsRow, VoiceCallSheet, VoiceMicIndicator, VoiceSessionHost, WidgetHost, WidgetWebView, WorkspaceBanner, type WorkspaceBannerProps, buildPluginBridgeJS, completeInviteJoin, completeOpenJoin, completeProviderSignIn, googleClientIds, handoffErrorMessage, inviteHeadline, isConsumerDisabled, openJoinErrorMessage, openWidget, runHandoffExchange, setClipboardProvider, setOAuthProvider, setPluginWebViewExtraHosts, setUIActionNavigator, useLightboxStore, usePluginBridge, useVoiceCall, useWidgetHostStore, voiceSession };
620
+ export { AdasChatScreen, type AdasChatScreenProps, type CallAudioProvider, type CallState, ChatInput, type ClipboardProvider, DaySeparator, EmbeddedPluginWebView, type HandoffExchangeDeps, HandoffScreen, type HandoffScreenProps, type InviteJoinDeps, JobProgressBar, JoinScreen, type JoinScreenProps, Lightbox, LoginScreen, type LoginScreenProps, MessageBubble, type OAuthGoogleConfig, type OAuthProvider, type OpenJoinDeps, OpenJoinScreen, type OpenJoinScreenProps, Plugin, PluginSurface, type ProviderSignInDeps, TableCardBlock, TenantPicker, type TenantPickerProps, type TranscriptEntry, TypingIndicator, type UIActionRoute, UIActionsRow, VoiceCallSheet, VoiceMicIndicator, VoiceSessionHost, WidgetHost, WidgetWebView, WorkspaceBanner, type WorkspaceBannerProps, buildPluginBridgeJS, completeInviteJoin, completeOpenJoin, completeProviderSignIn, googleClientIds, handoffErrorMessage, inviteHeadline, isConsumerDisabled, openJoinErrorMessage, openWidget, runHandoffExchange, setCallAudioProvider, setClipboardProvider, setOAuthProvider, setPluginWebViewExtraHosts, setUIActionNavigator, useLightboxStore, usePluginBridge, useVoiceCall, useWidgetHostStore, voiceSession };
package/dist/index.d.ts CHANGED
@@ -533,6 +533,7 @@ declare class VoiceSessionManager implements VoiceSessionProvider {
533
533
  /** Run an authorized device tool. Never throws: every failure is an answer. */
534
534
  private runDeviceTool;
535
535
  private setState;
536
+ private setCallAudio;
536
537
  private appendTranscript;
537
538
  private emit;
538
539
  private waitForConnect;
@@ -594,6 +595,12 @@ interface OAuthProvider {
594
595
  }
595
596
  /** Register a native OAuth implementation (e.g. via @ateam-ai-mobile/expo). */
596
597
  declare function setOAuthProvider(oauth: OAuthProvider | null): void;
598
+ interface CallAudioProvider {
599
+ beginCall(): void;
600
+ endCall(): void;
601
+ }
602
+ /** Register the device's call audio mode (e.g. via @ateam-ai-mobile/expo). */
603
+ declare function setCallAudioProvider(callAudio: CallAudioProvider | null): void;
597
604
  interface ClipboardProvider {
598
605
  setString(text: string): Promise<void>;
599
606
  }
@@ -610,4 +617,4 @@ declare function setUIActionNavigator(navigate: UIActionNavigator | null): void;
610
617
  type ExtraHostsGetter = () => string[];
611
618
  declare function setPluginWebViewExtraHosts(getter: ExtraHostsGetter | null): void;
612
619
 
613
- export { AdasChatScreen, type AdasChatScreenProps, type CallState, ChatInput, type ClipboardProvider, DaySeparator, EmbeddedPluginWebView, type HandoffExchangeDeps, HandoffScreen, type HandoffScreenProps, type InviteJoinDeps, JobProgressBar, JoinScreen, type JoinScreenProps, Lightbox, LoginScreen, type LoginScreenProps, MessageBubble, type OAuthGoogleConfig, type OAuthProvider, type OpenJoinDeps, OpenJoinScreen, type OpenJoinScreenProps, Plugin, PluginSurface, type ProviderSignInDeps, TableCardBlock, TenantPicker, type TenantPickerProps, type TranscriptEntry, TypingIndicator, type UIActionRoute, UIActionsRow, VoiceCallSheet, VoiceMicIndicator, VoiceSessionHost, WidgetHost, WidgetWebView, WorkspaceBanner, type WorkspaceBannerProps, buildPluginBridgeJS, completeInviteJoin, completeOpenJoin, completeProviderSignIn, googleClientIds, handoffErrorMessage, inviteHeadline, isConsumerDisabled, openJoinErrorMessage, openWidget, runHandoffExchange, setClipboardProvider, setOAuthProvider, setPluginWebViewExtraHosts, setUIActionNavigator, useLightboxStore, usePluginBridge, useVoiceCall, useWidgetHostStore, voiceSession };
620
+ export { AdasChatScreen, type AdasChatScreenProps, type CallAudioProvider, type CallState, ChatInput, type ClipboardProvider, DaySeparator, EmbeddedPluginWebView, type HandoffExchangeDeps, HandoffScreen, type HandoffScreenProps, type InviteJoinDeps, JobProgressBar, JoinScreen, type JoinScreenProps, Lightbox, LoginScreen, type LoginScreenProps, MessageBubble, type OAuthGoogleConfig, type OAuthProvider, type OpenJoinDeps, OpenJoinScreen, type OpenJoinScreenProps, Plugin, PluginSurface, type ProviderSignInDeps, TableCardBlock, TenantPicker, type TenantPickerProps, type TranscriptEntry, TypingIndicator, type UIActionRoute, UIActionsRow, VoiceCallSheet, VoiceMicIndicator, VoiceSessionHost, WidgetHost, WidgetWebView, WorkspaceBanner, type WorkspaceBannerProps, buildPluginBridgeJS, completeInviteJoin, completeOpenJoin, completeProviderSignIn, googleClientIds, handoffErrorMessage, inviteHeadline, isConsumerDisabled, openJoinErrorMessage, openWidget, runHandoffExchange, setCallAudioProvider, setClipboardProvider, setOAuthProvider, setPluginWebViewExtraHosts, setUIActionNavigator, useLightboxStore, usePluginBridge, useVoiceCall, useWidgetHostStore, voiceSession };
package/dist/index.js CHANGED
@@ -64,6 +64,7 @@ __export(index_exports, {
64
64
  openJoinErrorMessage: () => openJoinErrorMessage,
65
65
  openWidget: () => openWidget,
66
66
  runHandoffExchange: () => runHandoffExchange,
67
+ setCallAudioProvider: () => setCallAudioProvider,
67
68
  setClipboardProvider: () => setClipboardProvider,
68
69
  setOAuthProvider: () => setOAuthProvider,
69
70
  setPluginWebViewExtraHosts: () => setPluginWebViewExtraHosts,
@@ -286,6 +287,13 @@ function setOAuthProvider(oauth) {
286
287
  function getOAuthProvider() {
287
288
  return _oauth;
288
289
  }
290
+ var _callAudio = null;
291
+ function setCallAudioProvider(callAudio) {
292
+ _callAudio = callAudio;
293
+ }
294
+ function getCallAudioProvider() {
295
+ return _callAudio;
296
+ }
289
297
  var _clipboard = null;
290
298
  function setClipboardProvider(clipboard) {
291
299
  _clipboard = clipboard;
@@ -2886,6 +2894,9 @@ function originOf(url) {
2886
2894
  const m = /^([a-z][a-z0-9+.-]*:\/\/[^/?#]+)/i.exec(url);
2887
2895
  return m ? m[1].toLowerCase() : null;
2888
2896
  }
2897
+ function isLiveCall(state) {
2898
+ return state === "connecting" || state === "connected";
2899
+ }
2889
2900
  var IDLE = {
2890
2901
  callState: "idle",
2891
2902
  sessionId: null,
@@ -3340,9 +3351,22 @@ var VoiceSessionManager = class {
3340
3351
  }
3341
3352
  // ── internals ────────────────────────────────────────────────
3342
3353
  setState(partial) {
3354
+ const wasLive = isLiveCall(this.state.callState);
3343
3355
  this.state = { ...this.state, ...partial };
3356
+ const isLive = isLiveCall(this.state.callState);
3357
+ if (wasLive !== isLive) this.setCallAudio(isLive);
3344
3358
  this.emit({ type: "state" });
3345
3359
  }
3360
+ setCallAudio(on) {
3361
+ const audio = getCallAudioProvider();
3362
+ if (!audio) return;
3363
+ try {
3364
+ if (on) audio.beginCall();
3365
+ else audio.endCall();
3366
+ } catch (e) {
3367
+ console.warn("[voiceSession] call audio mode failed:", e?.message || String(e));
3368
+ }
3369
+ }
3346
3370
  appendTranscript(entry) {
3347
3371
  this.state = { ...this.state, transcript: [...this.state.transcript, entry] };
3348
3372
  this.emit({ type: "transcript" });
@@ -3843,6 +3867,7 @@ var styles21 = import_react_native22.StyleSheet.create({
3843
3867
  openJoinErrorMessage,
3844
3868
  openWidget,
3845
3869
  runHandoffExchange,
3870
+ setCallAudioProvider,
3846
3871
  setClipboardProvider,
3847
3872
  setOAuthProvider,
3848
3873
  setPluginWebViewExtraHosts,