@ateam-ai-mobile/ui 0.1.0 → 0.1.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/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { Message, JobProgress, UIAction } from '@ateam-ai-mobile/core';
3
- import * as React$1 from 'react';
4
- import React__default from 'react';
2
+ import { Message, JobProgress, UIAction, AdasSession, TenantMembership } from '@ateam-ai-mobile/core';
3
+ import * as react from 'react';
4
+ import react__default from 'react';
5
5
  import { PluginSurfaceMeta, PlatformPluginManifest } from '@ateam-ai-mobile/plugin-runtime';
6
6
  import * as zustand from 'zustand';
7
7
 
@@ -18,15 +18,15 @@ interface AdasChatScreenProps {
18
18
  }
19
19
  declare function AdasChatScreen({ onCallStart, placeholder, footerAccessory, withLightbox, }: AdasChatScreenProps): react_jsx_runtime.JSX.Element;
20
20
 
21
- interface Props$7 {
21
+ interface Props$8 {
22
22
  message: Message;
23
23
  }
24
24
  declare function DaySeparator({ date }: {
25
25
  date: Date;
26
26
  }): react_jsx_runtime.JSX.Element;
27
- declare function MessageBubble({ message }: Props$7): react_jsx_runtime.JSX.Element;
27
+ declare function MessageBubble({ message }: Props$8): react_jsx_runtime.JSX.Element;
28
28
 
29
- interface Props$6 {
29
+ interface Props$7 {
30
30
  onSend: (text: string) => void;
31
31
  onCallStart?: () => void;
32
32
  loading: boolean;
@@ -35,16 +35,16 @@ interface Props$6 {
35
35
  prefill?: string;
36
36
  placeholder?: string;
37
37
  }
38
- declare function ChatInput({ onSend, onCallStart, loading, prefill, placeholder }: Props$6): react_jsx_runtime.JSX.Element;
38
+ declare function ChatInput({ onSend, onCallStart, loading, prefill, placeholder }: Props$7): react_jsx_runtime.JSX.Element;
39
39
 
40
40
  declare function TypingIndicator(): react_jsx_runtime.JSX.Element;
41
41
 
42
- interface Props$5 {
42
+ interface Props$6 {
43
43
  progress: JobProgress;
44
44
  }
45
- declare function JobProgressBar({ progress }: Props$5): react_jsx_runtime.JSX.Element;
45
+ declare function JobProgressBar({ progress }: Props$6): react_jsx_runtime.JSX.Element;
46
46
 
47
- interface Props$4 {
47
+ interface Props$5 {
48
48
  columns: string[];
49
49
  rows: any[][];
50
50
  }
@@ -54,12 +54,12 @@ interface Props$4 {
54
54
  * key:value rows inside the card. Built specifically for narrow phone
55
55
  * screens where horizontal markdown tables become unreadable.
56
56
  */
57
- declare function TableCardBlock({ columns, rows }: Props$4): react_jsx_runtime.JSX.Element | null;
57
+ declare function TableCardBlock({ columns, rows }: Props$5): react_jsx_runtime.JSX.Element | null;
58
58
 
59
- interface Props$3 {
59
+ interface Props$4 {
60
60
  actions: UIAction[];
61
61
  }
62
- declare function UIActionsRow({ actions }: Props$3): react_jsx_runtime.JSX.Element | null;
62
+ declare function UIActionsRow({ actions }: Props$4): react_jsx_runtime.JSX.Element | null;
63
63
 
64
64
  interface PluginRendererProps {
65
65
  /** Full plugin ID, e.g. "mcp:connector-id:plugin-name" */
@@ -67,23 +67,39 @@ interface PluginRendererProps {
67
67
  /** Plugin manifest (from API) */
68
68
  manifest: any;
69
69
  /** Shared command buffer from parent — captures commands before plugin mounts */
70
- commandBufferRef?: React__default.MutableRefObject<any[]>;
70
+ commandBufferRef?: react__default.MutableRefObject<any[]>;
71
71
  /** Engine-supplied props from sys.focusUiPlugin(id, props) — forwarded to
72
72
  * the plugin Component as `PluginProps.props`. */
73
73
  props?: any;
74
74
  }
75
75
  declare function Plugin({ id, manifest, commandBufferRef, props: engineProps }: PluginRendererProps): react_jsx_runtime.JSX.Element;
76
76
 
77
- interface Props$2 {
77
+ interface Props$3 {
78
78
  pluginId: string;
79
79
  surface: PluginSurfaceMeta;
80
80
  dismiss: () => void;
81
81
  /** Engine-supplied props forwarded from sys.focusUiPlugin(id, props). */
82
82
  props?: any;
83
83
  }
84
- declare function PluginSurface({ pluginId, surface, dismiss, props }: Props$2): react_jsx_runtime.JSX.Element;
84
+ declare function PluginSurface({ pluginId, surface, dismiss, props }: Props$3): react_jsx_runtime.JSX.Element;
85
85
 
86
- interface Props$1 {
86
+ interface WidgetHostState {
87
+ pluginId: string | null;
88
+ /** Engine/chip-supplied props forwarded to the plugin as PluginProps.props. */
89
+ props?: any;
90
+ open: (pluginId: string, props?: any) => void;
91
+ close: () => void;
92
+ }
93
+ declare const useWidgetHostStore: zustand.UseBoundStore<zustand.StoreApi<WidgetHostState>>;
94
+ /**
95
+ * Open a widget by plugin id. Host surfaces registered in the surface store
96
+ * take priority (they own their chrome); everything else is presented as a
97
+ * fullscreen PluginSurface by the mounted <WidgetHost />.
98
+ */
99
+ declare function openWidget(pluginId: string, props?: any): void;
100
+ declare function WidgetHost(): react_jsx_runtime.JSX.Element | null;
101
+
102
+ interface Props$2 {
87
103
  pluginId: string;
88
104
  manifest: PlatformPluginManifest;
89
105
  commandBufferRef?: React.MutableRefObject<any[]>;
@@ -93,7 +109,7 @@ interface Props$1 {
93
109
  * existing web plugins work unmodified; the origin guards below make sure
94
110
  * the JWT seeded into localStorage can never leave the trusted hosts.
95
111
  */
96
- declare function EmbeddedPluginWebView({ pluginId, manifest, commandBufferRef }: Props$1): react_jsx_runtime.JSX.Element;
112
+ declare function EmbeddedPluginWebView({ pluginId, manifest, commandBufferRef }: Props$2): react_jsx_runtime.JSX.Element;
97
113
 
98
114
  /**
99
115
  * PostMessage bridge between the React Native host and a plugin WebView.
@@ -107,7 +123,7 @@ declare function EmbeddedPluginWebView({ pluginId, manifest, commandBufferRef }:
107
123
  declare function usePluginBridge(pluginId: string, connectorId?: string, commandBufferRef?: React.MutableRefObject<any[]>, wsRef?: {
108
124
  current: WebSocket | null;
109
125
  }): {
110
- webViewRef: React$1.RefObject<any>;
126
+ webViewRef: react.RefObject<any>;
111
127
  sendInit: () => void;
112
128
  handleMessage: (event: {
113
129
  nativeEvent: {
@@ -125,7 +141,7 @@ declare function usePluginBridge(pluginId: string, connectorId?: string, command
125
141
  */
126
142
  declare function buildPluginBridgeJS(jwt: string, tenant: string): string;
127
143
 
128
- interface Props {
144
+ interface Props$1 {
129
145
  visible: boolean;
130
146
  /** Display title shown in the top bar. */
131
147
  title?: string;
@@ -133,7 +149,18 @@ interface Props {
133
149
  bundleUrl?: string;
134
150
  onClose: () => void;
135
151
  }
136
- declare function WidgetWebView({ visible, title, bundleUrl, onClose }: Props): react_jsx_runtime.JSX.Element;
152
+ declare function WidgetWebView({ visible, title, bundleUrl, onClose }: Props$1): react_jsx_runtime.JSX.Element;
153
+
154
+ interface TenantPickerProps {
155
+ /** Called after a successful SDK-driven switch (host navigates/refreshes). */
156
+ onSwitched?: (session: AdasSession) => void;
157
+ /** Intercept the tap instead of switching — for fully custom host flows.
158
+ * When provided, the SDK does NOT call switchTenant(). */
159
+ onSelect?: (tenant: TenantMembership) => void;
160
+ /** Highlight the active tenant. Defaults to the SDK config's tenant. */
161
+ currentTenantId?: string;
162
+ }
163
+ declare function TenantPicker({ onSwitched, onSelect, currentTenantId }: TenantPickerProps): react_jsx_runtime.JSX.Element;
137
164
 
138
165
  declare function Lightbox(): react_jsx_runtime.JSX.Element | null;
139
166
 
@@ -144,6 +171,37 @@ interface LightboxState {
144
171
  }
145
172
  declare const useLightboxStore: zustand.UseBoundStore<zustand.StoreApi<LightboxState>>;
146
173
 
174
+ interface Props {
175
+ visible: boolean;
176
+ onClose: () => void;
177
+ }
178
+ declare function VoiceCallSheet({ visible, onClose }: Props): react_jsx_runtime.JSX.Element | null;
179
+
180
+ interface TranscriptEntry {
181
+ role: 'user' | 'ai' | 'tool';
182
+ text: string;
183
+ ts: number;
184
+ }
185
+ type CallState = 'idle' | 'connecting' | 'connected' | 'error';
186
+ declare function useVoiceCall(): {
187
+ callState: CallState;
188
+ sessionId: string | null;
189
+ error: string | null;
190
+ transcript: TranscriptEntry[];
191
+ aiPartial: string;
192
+ userPartial: string;
193
+ muted: boolean;
194
+ startCall: () => void;
195
+ stopCall: () => void;
196
+ toggleMute: () => void;
197
+ handleWebViewMessage: (event: any) => void;
198
+ getWebViewSource: () => {
199
+ uri: string;
200
+ };
201
+ webViewRef: react.RefObject<any>;
202
+ injectedTrackHook: string;
203
+ };
204
+
147
205
  /**
148
206
  * Host integration points for @ateam-ai-mobile/ui — same DI pattern as
149
207
  * @ateam-ai-mobile/plugin-runtime's host.ts. Everything has a safe default; the host
@@ -162,5 +220,7 @@ interface UIActionRoute {
162
220
  }
163
221
  type UIActionNavigator = (route: UIActionRoute) => void;
164
222
  declare function setUIActionNavigator(navigate: UIActionNavigator | null): void;
223
+ type ExtraHostsGetter = () => string[];
224
+ declare function setPluginWebViewExtraHosts(getter: ExtraHostsGetter | null): void;
165
225
 
166
- export { AdasChatScreen, type AdasChatScreenProps, ChatInput, type ClipboardProvider, DaySeparator, EmbeddedPluginWebView, JobProgressBar, Lightbox, MessageBubble, Plugin, PluginSurface, TableCardBlock, TypingIndicator, type UIActionRoute, UIActionsRow, WidgetWebView, buildPluginBridgeJS, setClipboardProvider, setUIActionNavigator, useLightboxStore, usePluginBridge };
226
+ export { AdasChatScreen, type AdasChatScreenProps, type CallState, ChatInput, type ClipboardProvider, DaySeparator, EmbeddedPluginWebView, JobProgressBar, Lightbox, MessageBubble, Plugin, PluginSurface, TableCardBlock, TenantPicker, type TenantPickerProps, type TranscriptEntry, TypingIndicator, type UIActionRoute, UIActionsRow, VoiceCallSheet, WidgetHost, WidgetWebView, buildPluginBridgeJS, openWidget, setClipboardProvider, setPluginWebViewExtraHosts, setUIActionNavigator, useLightboxStore, usePluginBridge, useVoiceCall, useWidgetHostStore };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { Message, JobProgress, UIAction } from '@ateam-ai-mobile/core';
3
- import * as React$1 from 'react';
4
- import React__default from 'react';
2
+ import { Message, JobProgress, UIAction, AdasSession, TenantMembership } from '@ateam-ai-mobile/core';
3
+ import * as react from 'react';
4
+ import react__default from 'react';
5
5
  import { PluginSurfaceMeta, PlatformPluginManifest } from '@ateam-ai-mobile/plugin-runtime';
6
6
  import * as zustand from 'zustand';
7
7
 
@@ -18,15 +18,15 @@ interface AdasChatScreenProps {
18
18
  }
19
19
  declare function AdasChatScreen({ onCallStart, placeholder, footerAccessory, withLightbox, }: AdasChatScreenProps): react_jsx_runtime.JSX.Element;
20
20
 
21
- interface Props$7 {
21
+ interface Props$8 {
22
22
  message: Message;
23
23
  }
24
24
  declare function DaySeparator({ date }: {
25
25
  date: Date;
26
26
  }): react_jsx_runtime.JSX.Element;
27
- declare function MessageBubble({ message }: Props$7): react_jsx_runtime.JSX.Element;
27
+ declare function MessageBubble({ message }: Props$8): react_jsx_runtime.JSX.Element;
28
28
 
29
- interface Props$6 {
29
+ interface Props$7 {
30
30
  onSend: (text: string) => void;
31
31
  onCallStart?: () => void;
32
32
  loading: boolean;
@@ -35,16 +35,16 @@ interface Props$6 {
35
35
  prefill?: string;
36
36
  placeholder?: string;
37
37
  }
38
- declare function ChatInput({ onSend, onCallStart, loading, prefill, placeholder }: Props$6): react_jsx_runtime.JSX.Element;
38
+ declare function ChatInput({ onSend, onCallStart, loading, prefill, placeholder }: Props$7): react_jsx_runtime.JSX.Element;
39
39
 
40
40
  declare function TypingIndicator(): react_jsx_runtime.JSX.Element;
41
41
 
42
- interface Props$5 {
42
+ interface Props$6 {
43
43
  progress: JobProgress;
44
44
  }
45
- declare function JobProgressBar({ progress }: Props$5): react_jsx_runtime.JSX.Element;
45
+ declare function JobProgressBar({ progress }: Props$6): react_jsx_runtime.JSX.Element;
46
46
 
47
- interface Props$4 {
47
+ interface Props$5 {
48
48
  columns: string[];
49
49
  rows: any[][];
50
50
  }
@@ -54,12 +54,12 @@ interface Props$4 {
54
54
  * key:value rows inside the card. Built specifically for narrow phone
55
55
  * screens where horizontal markdown tables become unreadable.
56
56
  */
57
- declare function TableCardBlock({ columns, rows }: Props$4): react_jsx_runtime.JSX.Element | null;
57
+ declare function TableCardBlock({ columns, rows }: Props$5): react_jsx_runtime.JSX.Element | null;
58
58
 
59
- interface Props$3 {
59
+ interface Props$4 {
60
60
  actions: UIAction[];
61
61
  }
62
- declare function UIActionsRow({ actions }: Props$3): react_jsx_runtime.JSX.Element | null;
62
+ declare function UIActionsRow({ actions }: Props$4): react_jsx_runtime.JSX.Element | null;
63
63
 
64
64
  interface PluginRendererProps {
65
65
  /** Full plugin ID, e.g. "mcp:connector-id:plugin-name" */
@@ -67,23 +67,39 @@ interface PluginRendererProps {
67
67
  /** Plugin manifest (from API) */
68
68
  manifest: any;
69
69
  /** Shared command buffer from parent — captures commands before plugin mounts */
70
- commandBufferRef?: React__default.MutableRefObject<any[]>;
70
+ commandBufferRef?: react__default.MutableRefObject<any[]>;
71
71
  /** Engine-supplied props from sys.focusUiPlugin(id, props) — forwarded to
72
72
  * the plugin Component as `PluginProps.props`. */
73
73
  props?: any;
74
74
  }
75
75
  declare function Plugin({ id, manifest, commandBufferRef, props: engineProps }: PluginRendererProps): react_jsx_runtime.JSX.Element;
76
76
 
77
- interface Props$2 {
77
+ interface Props$3 {
78
78
  pluginId: string;
79
79
  surface: PluginSurfaceMeta;
80
80
  dismiss: () => void;
81
81
  /** Engine-supplied props forwarded from sys.focusUiPlugin(id, props). */
82
82
  props?: any;
83
83
  }
84
- declare function PluginSurface({ pluginId, surface, dismiss, props }: Props$2): react_jsx_runtime.JSX.Element;
84
+ declare function PluginSurface({ pluginId, surface, dismiss, props }: Props$3): react_jsx_runtime.JSX.Element;
85
85
 
86
- interface Props$1 {
86
+ interface WidgetHostState {
87
+ pluginId: string | null;
88
+ /** Engine/chip-supplied props forwarded to the plugin as PluginProps.props. */
89
+ props?: any;
90
+ open: (pluginId: string, props?: any) => void;
91
+ close: () => void;
92
+ }
93
+ declare const useWidgetHostStore: zustand.UseBoundStore<zustand.StoreApi<WidgetHostState>>;
94
+ /**
95
+ * Open a widget by plugin id. Host surfaces registered in the surface store
96
+ * take priority (they own their chrome); everything else is presented as a
97
+ * fullscreen PluginSurface by the mounted <WidgetHost />.
98
+ */
99
+ declare function openWidget(pluginId: string, props?: any): void;
100
+ declare function WidgetHost(): react_jsx_runtime.JSX.Element | null;
101
+
102
+ interface Props$2 {
87
103
  pluginId: string;
88
104
  manifest: PlatformPluginManifest;
89
105
  commandBufferRef?: React.MutableRefObject<any[]>;
@@ -93,7 +109,7 @@ interface Props$1 {
93
109
  * existing web plugins work unmodified; the origin guards below make sure
94
110
  * the JWT seeded into localStorage can never leave the trusted hosts.
95
111
  */
96
- declare function EmbeddedPluginWebView({ pluginId, manifest, commandBufferRef }: Props$1): react_jsx_runtime.JSX.Element;
112
+ declare function EmbeddedPluginWebView({ pluginId, manifest, commandBufferRef }: Props$2): react_jsx_runtime.JSX.Element;
97
113
 
98
114
  /**
99
115
  * PostMessage bridge between the React Native host and a plugin WebView.
@@ -107,7 +123,7 @@ declare function EmbeddedPluginWebView({ pluginId, manifest, commandBufferRef }:
107
123
  declare function usePluginBridge(pluginId: string, connectorId?: string, commandBufferRef?: React.MutableRefObject<any[]>, wsRef?: {
108
124
  current: WebSocket | null;
109
125
  }): {
110
- webViewRef: React$1.RefObject<any>;
126
+ webViewRef: react.RefObject<any>;
111
127
  sendInit: () => void;
112
128
  handleMessage: (event: {
113
129
  nativeEvent: {
@@ -125,7 +141,7 @@ declare function usePluginBridge(pluginId: string, connectorId?: string, command
125
141
  */
126
142
  declare function buildPluginBridgeJS(jwt: string, tenant: string): string;
127
143
 
128
- interface Props {
144
+ interface Props$1 {
129
145
  visible: boolean;
130
146
  /** Display title shown in the top bar. */
131
147
  title?: string;
@@ -133,7 +149,18 @@ interface Props {
133
149
  bundleUrl?: string;
134
150
  onClose: () => void;
135
151
  }
136
- declare function WidgetWebView({ visible, title, bundleUrl, onClose }: Props): react_jsx_runtime.JSX.Element;
152
+ declare function WidgetWebView({ visible, title, bundleUrl, onClose }: Props$1): react_jsx_runtime.JSX.Element;
153
+
154
+ interface TenantPickerProps {
155
+ /** Called after a successful SDK-driven switch (host navigates/refreshes). */
156
+ onSwitched?: (session: AdasSession) => void;
157
+ /** Intercept the tap instead of switching — for fully custom host flows.
158
+ * When provided, the SDK does NOT call switchTenant(). */
159
+ onSelect?: (tenant: TenantMembership) => void;
160
+ /** Highlight the active tenant. Defaults to the SDK config's tenant. */
161
+ currentTenantId?: string;
162
+ }
163
+ declare function TenantPicker({ onSwitched, onSelect, currentTenantId }: TenantPickerProps): react_jsx_runtime.JSX.Element;
137
164
 
138
165
  declare function Lightbox(): react_jsx_runtime.JSX.Element | null;
139
166
 
@@ -144,6 +171,37 @@ interface LightboxState {
144
171
  }
145
172
  declare const useLightboxStore: zustand.UseBoundStore<zustand.StoreApi<LightboxState>>;
146
173
 
174
+ interface Props {
175
+ visible: boolean;
176
+ onClose: () => void;
177
+ }
178
+ declare function VoiceCallSheet({ visible, onClose }: Props): react_jsx_runtime.JSX.Element | null;
179
+
180
+ interface TranscriptEntry {
181
+ role: 'user' | 'ai' | 'tool';
182
+ text: string;
183
+ ts: number;
184
+ }
185
+ type CallState = 'idle' | 'connecting' | 'connected' | 'error';
186
+ declare function useVoiceCall(): {
187
+ callState: CallState;
188
+ sessionId: string | null;
189
+ error: string | null;
190
+ transcript: TranscriptEntry[];
191
+ aiPartial: string;
192
+ userPartial: string;
193
+ muted: boolean;
194
+ startCall: () => void;
195
+ stopCall: () => void;
196
+ toggleMute: () => void;
197
+ handleWebViewMessage: (event: any) => void;
198
+ getWebViewSource: () => {
199
+ uri: string;
200
+ };
201
+ webViewRef: react.RefObject<any>;
202
+ injectedTrackHook: string;
203
+ };
204
+
147
205
  /**
148
206
  * Host integration points for @ateam-ai-mobile/ui — same DI pattern as
149
207
  * @ateam-ai-mobile/plugin-runtime's host.ts. Everything has a safe default; the host
@@ -162,5 +220,7 @@ interface UIActionRoute {
162
220
  }
163
221
  type UIActionNavigator = (route: UIActionRoute) => void;
164
222
  declare function setUIActionNavigator(navigate: UIActionNavigator | null): void;
223
+ type ExtraHostsGetter = () => string[];
224
+ declare function setPluginWebViewExtraHosts(getter: ExtraHostsGetter | null): void;
165
225
 
166
- export { AdasChatScreen, type AdasChatScreenProps, ChatInput, type ClipboardProvider, DaySeparator, EmbeddedPluginWebView, JobProgressBar, Lightbox, MessageBubble, Plugin, PluginSurface, TableCardBlock, TypingIndicator, type UIActionRoute, UIActionsRow, WidgetWebView, buildPluginBridgeJS, setClipboardProvider, setUIActionNavigator, useLightboxStore, usePluginBridge };
226
+ export { AdasChatScreen, type AdasChatScreenProps, type CallState, ChatInput, type ClipboardProvider, DaySeparator, EmbeddedPluginWebView, JobProgressBar, Lightbox, MessageBubble, Plugin, PluginSurface, TableCardBlock, TenantPicker, type TenantPickerProps, type TranscriptEntry, TypingIndicator, type UIActionRoute, UIActionsRow, VoiceCallSheet, WidgetHost, WidgetWebView, buildPluginBridgeJS, openWidget, setClipboardProvider, setPluginWebViewExtraHosts, setUIActionNavigator, useLightboxStore, usePluginBridge, useVoiceCall, useWidgetHostStore };