@ateam-ai-mobile/plugin-runtime 0.1.20 → 0.1.22

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
@@ -1245,6 +1245,83 @@ interface VoiceAPI {
1245
1245
  transcript(): VoiceTranscriptEntry[];
1246
1246
  }
1247
1247
 
1248
+ type AiLiveCamera = 'front' | 'back';
1249
+ /** What the AI saw over time, as the live session's episode events. */
1250
+ interface AiLiveEpisode {
1251
+ /** episode.started / .interrupted / .recovered / .ongoing / .ended */
1252
+ type: string;
1253
+ /** The task class id from the chosen setup, e.g. "drinking". */
1254
+ class: string;
1255
+ episodeId: string;
1256
+ /** Whose camera saw it: the signed-in person whose live session this is (live sessions are per
1257
+ * person, workspace + actor). Always there: an event without it never reaches the screen. */
1258
+ actorId: string;
1259
+ /** When (ms since the epoch, the session's clock). */
1260
+ at: number;
1261
+ [key: string]: unknown;
1262
+ }
1263
+ type AiLiveState =
1264
+ /** Nothing running for this screen. */
1265
+ 'idle'
1266
+ /** Asking for the live session, opening the camera and the connection. */
1267
+ | 'starting'
1268
+ /** Pictures are going to the AI ("Sending to AI" is on screen). */
1269
+ | 'sending'
1270
+ /** Stopped by stop(), by the screen closing, or by the person taking the yes back (lastError says so). */
1271
+ | 'stopped'
1272
+ /** It could not start or it broke; `lastError` says why in plain words. */
1273
+ | 'error';
1274
+ interface AiLiveSnapshot {
1275
+ state: AiLiveState;
1276
+ camera: AiLiveCamera | null;
1277
+ /** Pictures sent since start. */
1278
+ sent: number;
1279
+ /** Picture slots that sent nothing (no fresh camera frame, or the connection was busy). */
1280
+ skipped: number;
1281
+ lastEpisode: AiLiveEpisode | null;
1282
+ lastError: string | null;
1283
+ }
1284
+ interface AiLiveStartOptions {
1285
+ /** Which camera: 'back' (default) or 'front', the selfie camera. */
1286
+ camera?: AiLiveCamera;
1287
+ }
1288
+ interface AiLiveAPI {
1289
+ /** Start sending this phone's camera to the chosen AI, in a live session of the
1290
+ * phone's own (capped at US$0.50). Refuses by name when either side has not said
1291
+ * yes, when another screen is sending already, or when the person already has a
1292
+ * live session running elsewhere. */
1293
+ start(opts?: AiLiveStartOptions): Promise<AiLiveSnapshot>;
1294
+ /** Stop sending. Closing the screen does the same. */
1295
+ stop(): Promise<void>;
1296
+ getSnapshot(): AiLiveSnapshot;
1297
+ /** Called with every episode event the AI makes while this screen sends. */
1298
+ onEpisode(cb: (ev: AiLiveEpisode) => void): Subscription;
1299
+ /** Called whenever the snapshot changes. */
1300
+ subscribe(cb: (snap: AiLiveSnapshot) => void): Subscription;
1301
+ }
1302
+ /** What the host supplies (setAiLiveProvider). `owner` is the screen's holder id,
1303
+ * captured by the gate — a plugin never supplies its own. */
1304
+ interface AiLiveProvider {
1305
+ /** `ctx.allowed` is the two-sided consent, asked again right before every picture:
1306
+ * once it answers no, the provider sends nothing more and stops. */
1307
+ start(opts: AiLiveStartOptions, owner: string, ctx: {
1308
+ visual: DeviceState['visual'];
1309
+ allowed: () => boolean;
1310
+ }): Promise<AiLiveSnapshot>;
1311
+ /** `why` (optional) is what the screen then reads as lastError, e.g. the yes taken back. */
1312
+ stop(owner: string, why?: string): Promise<void>;
1313
+ getSnapshot(owner: string): AiLiveSnapshot;
1314
+ onEpisode(cb: (ev: AiLiveEpisode) => void, owner: string): Subscription;
1315
+ subscribe(cb: (snap: AiLiveSnapshot) => void, owner: string): Subscription;
1316
+ /** The screen is gone: drop its callbacks and its last snapshot (after stop). */
1317
+ forget(owner: string): void;
1318
+ /** Whether ANY screen is sending right now — what the platform's indicator shows. */
1319
+ isSending(): boolean;
1320
+ /** Any change of isSending(). */
1321
+ subscribeSending(cb: () => void): Subscription;
1322
+ }
1323
+ declare const AI_LIVE_IDLE: AiLiveSnapshot;
1324
+
1248
1325
  /**
1249
1326
  * @adas/plugin-sdk — Type definitions
1250
1327
  *
@@ -1821,6 +1898,11 @@ interface NativeCapabilities$1 {
1821
1898
  nfc?: boolean;
1822
1899
  /** Real biometric auth (Face ID / Touch ID / fingerprint). */
1823
1900
  biometricsV2?: boolean;
1901
+ /** The developer's half of "camera pictures may go to an AI service off the
1902
+ * phone". Declaring it grants nothing by itself: the person on the phone must
1903
+ * also allow it in the host's settings. Both are checked together by
1904
+ * `mayPicturesLeavePhone()`. Not declared = pictures never leave. */
1905
+ picturesToAi?: boolean;
1824
1906
  }
1825
1907
  interface PluginHooks$1 {
1826
1908
  onAppStart?: boolean;
@@ -1912,6 +1994,14 @@ interface PluginProps {
1912
1994
  * plugin gets a refusal (reads say so, actions throw) — never a fake `idle`.
1913
1995
  */
1914
1996
  voice: VoiceAPI;
1997
+ /**
1998
+ * The workspace's CHOSEN AI watching the phone camera, live — gated to plugins
1999
+ * that declared `capabilities: { picturesToAi: true }` AND used only when the
2000
+ * person on the phone allowed "Pictures to AI". The screen gets episodes
2001
+ * ("drinking" started), never pictures; "Sending to AI" is platform-owned.
2002
+ * REQUIRED like `voice`: an undeclared plugin gets a refusal, never a fake idle.
2003
+ */
2004
+ aiLive: AiLiveAPI;
1915
2005
  theme: ThemeTokens;
1916
2006
  context: PluginContext;
1917
2007
  /** Engine-supplied props from `sys.focusUiPlugin(pluginId, props)`.
@@ -2287,6 +2377,28 @@ declare function implementedVoice(): boolean;
2287
2377
  */
2288
2378
  declare function gateVoice(declared: boolean, pluginId: string): VoiceAPI;
2289
2379
 
2380
+ /** The person took the yes back: what the screen reads, and why it stopped. */
2381
+ declare const CONSENT_TAKEN_BACK = "Camera pictures to AI was turned off on this phone, so sending stopped.";
2382
+ /** Host DI: the app supplies the live provider once at startup; null detaches it. */
2383
+ declare function setAiLiveProvider(provider: AiLiveProvider | null): void;
2384
+ /**
2385
+ * The `aiLive` a plugin receives. `capabilities` is its TRUSTED declaration
2386
+ * (pluginRuntime.ts); `holder` is the mounted screen it is bound to; `camera()` gives
2387
+ * the visual session the SDK's sender reads, held as aiLiveCameraHolder(holder). It
2388
+ * is built by resolvePluginRuntimeProps (the one place device gates are called) and
2389
+ * never reaches the plugin: the plugin gets episodes, the sender gets the camera.
2390
+ */
2391
+ declare function gateAiLive(capabilities: NativeCapabilities$1 | undefined, pluginId: string, holder: string, camera: () => DeviceState['visual']): AiLiveAPI;
2392
+ /** The screen closed: stop its live session and release its camera, and keep nothing of it. Closed for
2393
+ * good first, so every later start() of this screen is refused; then, in turn after anything it asked
2394
+ * before, the session stopped and the camera released. */
2395
+ declare function releaseAiLive(holder: string): Promise<void>;
2396
+ /** For the platform's "Sending to AI" indicator: is any screen sending, and when that changes. */
2397
+ declare const aiLiveIndicator: {
2398
+ isSending: () => boolean;
2399
+ subscribe: (cb: () => void) => Subscription;
2400
+ };
2401
+
2290
2402
  /**
2291
2403
  * Host integration points — the DI seams that keep this package free of
2292
2404
  * Expo imports. The host app (or @ateam-ai-mobile/expo) plugs in concrete providers
@@ -2324,6 +2436,20 @@ declare function setCameraPreviewProvider(Component: ((props: CameraPreviewImplP
2324
2436
  /** Null when the host installed none — the SDK then renders a stated reason,
2325
2437
  * never a black rectangle that looks like a dark room. */
2326
2438
  declare function getCameraPreviewProvider(): ((props: CameraPreviewImplProps) => any) | null;
2439
+ /** Install the host's answer to "did the person on this phone allow camera
2440
+ * pictures to go to AI?". Pass null to remove it (consent then reads as no). */
2441
+ declare function setPicturesToAiConsentProvider(provider: (() => boolean) | null): void;
2442
+ /** The host calls this whenever anything its consent answer reads may have changed
2443
+ * (the switch, the camera's own switch, the OS permission). Listeners re-ask
2444
+ * mayPicturesLeavePhone(); nothing is passed, so nothing can be cached. */
2445
+ declare function notifyPicturesToAiConsentChanged(): void;
2446
+ /** Hear when the consent answer may have changed (see notifyPicturesToAiConsentChanged). */
2447
+ declare function onPicturesToAiConsentChange(cb: () => void): {
2448
+ unsubscribe(): void;
2449
+ };
2450
+ /** The one check: true only when the plugin's trusted declaration includes
2451
+ * `picturesToAi` AND the person on the phone allowed it right now. */
2452
+ declare function mayPicturesLeavePhone(declared?: NativeCapabilities$1 | null): boolean;
2327
2453
  type PluginResolver = RegisteredPlugin | (() => Promise<RegisteredPlugin | null>);
2328
2454
  declare function registerNativePlugin(id: string, plugin: PluginResolver): void;
2329
2455
  declare function unregisterNativePlugin(id: string): void;
@@ -2352,6 +2478,8 @@ interface PluginRuntimeProps {
2352
2478
  native: PluginNative;
2353
2479
  deviceState: DeviceState;
2354
2480
  voice: VoiceAPI;
2481
+ /** The workspace's chosen AI watching the phone camera, live (`picturesToAi`). */
2482
+ aiLive: AiLiveAPI;
2355
2483
  }
2356
2484
  /** One declaration source — either the server manifest or the registry entry. */
2357
2485
  interface PluginDeclaration {
@@ -3347,4 +3475,4 @@ declare function isInlineSurface(m: SurfaceManifest): m is InlineSurfaceManifest
3347
3475
 
3348
3476
  declare function SurfaceDispatcher(): react_jsx_runtime.JSX.Element;
3349
3477
 
3350
- export { ActionButton, type ActivitySnapshot, AdaOrb, type AdaOrbState, Badge, type BiometricsAPI, type BiometricsAPIv2, type BluetoothAPI, type BluetoothDevice, type Bridge, type BundleCacheEntry, type BundleStorage, type CameraAPI, CameraPreview, type CameraPreviewProps, type CapabilitySnapshot, type CapabilityStatus, Card, type Confidence, type ConnectivityAPI, type ConnectivitySnapshot, type CookiesAPI, type DeviceBridgeDomain, type DeviceContextSnapshot, type DeviceState, type DeviceToolContext, type DeviceToolDefinition, type DeviceToolFailureReason, type DeviceToolFn, type DeviceToolOutcome, type DeviceToolSummary, type DeviceToolsAction, type DeviceToolsSessionDeps, EmptyState, type EnvironmentSnapshot, ErrorState, type FileSystemAPI, type Freshness, type HapticsAPI, type InlineSurfaceManifest, type InteractionSnapshot, ListItem, type LoadedBundleInfo, type LoadedBundleSource, LoadingState, type LocationAPI, type MapsAPI, type MapsAddress, type MapsCoordinate, type MapsPlace, type MapsRoute, type MapsRouteStep, MemoryBundleStorage, type MountSurfaceManifest, type NativeCapabilities$1 as NativeCapabilities, type NfcAPI, type NotificationsAPI, PLATFORM_VOICE_CALLER, type PluginManifest as PlatformPluginManifest, type PluginBridge, type PluginContext, type PluginGrants, type PluginHooks$1 as PluginHooks, type PluginManifest$1 as PluginManifest, type PluginNative, type PluginProps, type PluginRuntimeProps, type PluginRuntimeSource, PluginSDK, type PluginSummary, type PluginSurfaceMeta, type RegisteredPlugin, type RegisteredServicePlugin, type RegisteredToolsPlugin, type RegisteredUIPlugin, type RemotePlugin, type RenderMode, type ScannerAPI, SearchBar, type SessionSnapshot, type SharingAPI, type SpatialEvent, type SpatialIntent, type SpatialPoint, type SpatialSnapshot, type SpatialStateEvent, type StateEvent, type StateListener, type StateQuality, type StorageAPI, type Subscription, SurfaceCard, type SurfaceCardProps, SurfaceDispatcher, SurfaceDrawer, type SurfaceDrawerProps, SurfaceFullscreen, type SurfaceFullscreenProps, type SurfaceManifest, type SurfacePlacement, type SurfaceType, type SurfaceVisibility, TabBar, type ThemeTokens, type TrustedToolDeclaration, type VisionAPI, type VisionFrameQuality, type VisionLabel, type VisionObject, type VisionText, type VisualSnapshot, type VisualStartOptions, type VoiceAPI, type VoiceCaller, type VoiceDeviceToolCall, type VoiceDeviceToolReason, type VoiceEvent, type VoicePersona, type VoiceSessionProvider, type VoiceSnapshot, type VoiceStartOptions, type VoiceState, type VoiceSubscription, type VoiceTranscriptEntry, type WebViewCookie, __resetSessionSyncForTest, bundleManager, callDeviceTool, clearDeviceTools, createNativeBridge, deviceStateHolders, deviceState as deviceStateV2, deviceToolsActionForSession, ensureDeviceToolsLoaded, explainCapability, gateDeviceState, gatePluginNative, gateVoice, getCameraPreviewProvider, getHaptics, getNativeBundleHash, getNativeBundleUrl, getNativeComponentId, getPlugin, getPluginNative, handleServerDeviceToolCall, hasDeviceTool, implementedStateDomains, implementedVoice, isActionable, isDeviceToolCommand, isInlineSurface, isMountSurface, listDeviceTools, listPlugins, nativePluginRegistry, neverObserved, pluginBundleUrl, register, registerBundleModules, registerDeviceTools, registerNativePlugin, registerPlatformDeviceTools, registerService, registerTools, releaseDeviceStateHolds, rendersNative, resetDeviceToolLoader, resolvePluginGrants, resolvePluginRuntimeProps, resolvePluginUrl, setBundleStorage, setCameraPreviewProvider, setDeviceStateProvider, setDeviceToolContextProvider, setDeviceToolResultPoster, setHapticsProvider, setPluginNativeProvider, setPluginThemeColors, setVoiceProvider, supportsNative, supportsWebView, syncDeviceToolsForSession, unregisterDeviceTools, unregisterNativePlugin, useApi, useNativeBridge, usePlugin, usePluginRuntimeProps, usePluginTheme, useRemotePlugins, useSurfaceStore };
3478
+ export { AI_LIVE_IDLE, ActionButton, type ActivitySnapshot, AdaOrb, type AdaOrbState, type AiLiveAPI, type AiLiveCamera, type AiLiveEpisode, type AiLiveProvider, type AiLiveSnapshot, type AiLiveStartOptions, type AiLiveState, Badge, type BiometricsAPI, type BiometricsAPIv2, type BluetoothAPI, type BluetoothDevice, type Bridge, type BundleCacheEntry, type BundleStorage, CONSENT_TAKEN_BACK, type CameraAPI, CameraPreview, type CameraPreviewProps, type CapabilitySnapshot, type CapabilityStatus, Card, type Confidence, type ConnectivityAPI, type ConnectivitySnapshot, type CookiesAPI, type DeviceBridgeDomain, type DeviceContextSnapshot, type DeviceState, type DeviceToolContext, type DeviceToolDefinition, type DeviceToolFailureReason, type DeviceToolFn, type DeviceToolOutcome, type DeviceToolSummary, type DeviceToolsAction, type DeviceToolsSessionDeps, EmptyState, type EnvironmentSnapshot, ErrorState, type FileSystemAPI, type Freshness, type HapticsAPI, type InlineSurfaceManifest, type InteractionSnapshot, ListItem, type LoadedBundleInfo, type LoadedBundleSource, LoadingState, type LocationAPI, type MapsAPI, type MapsAddress, type MapsCoordinate, type MapsPlace, type MapsRoute, type MapsRouteStep, MemoryBundleStorage, type MountSurfaceManifest, type NativeCapabilities$1 as NativeCapabilities, type NfcAPI, type NotificationsAPI, PLATFORM_VOICE_CALLER, type PluginManifest as PlatformPluginManifest, type PluginBridge, type PluginContext, type PluginGrants, type PluginHooks$1 as PluginHooks, type PluginManifest$1 as PluginManifest, type PluginNative, type PluginProps, type PluginRuntimeProps, type PluginRuntimeSource, PluginSDK, type PluginSummary, type PluginSurfaceMeta, type RegisteredPlugin, type RegisteredServicePlugin, type RegisteredToolsPlugin, type RegisteredUIPlugin, type RemotePlugin, type RenderMode, type ScannerAPI, SearchBar, type SessionSnapshot, type SharingAPI, type SpatialEvent, type SpatialIntent, type SpatialPoint, type SpatialSnapshot, type SpatialStateEvent, type StateEvent, type StateListener, type StateQuality, type StorageAPI, type Subscription, SurfaceCard, type SurfaceCardProps, SurfaceDispatcher, SurfaceDrawer, type SurfaceDrawerProps, SurfaceFullscreen, type SurfaceFullscreenProps, type SurfaceManifest, type SurfacePlacement, type SurfaceType, type SurfaceVisibility, TabBar, type ThemeTokens, type TrustedToolDeclaration, type VisionAPI, type VisionFrameQuality, type VisionLabel, type VisionObject, type VisionText, type VisualSnapshot, type VisualStartOptions, type VoiceAPI, type VoiceCaller, type VoiceDeviceToolCall, type VoiceDeviceToolReason, type VoiceEvent, type VoicePersona, type VoiceSessionProvider, type VoiceSnapshot, type VoiceStartOptions, type VoiceState, type VoiceSubscription, type VoiceTranscriptEntry, type WebViewCookie, __resetSessionSyncForTest, aiLiveIndicator, bundleManager, callDeviceTool, clearDeviceTools, createNativeBridge, deviceStateHolders, deviceState as deviceStateV2, deviceToolsActionForSession, ensureDeviceToolsLoaded, explainCapability, gateAiLive, gateDeviceState, gatePluginNative, gateVoice, getCameraPreviewProvider, getHaptics, getNativeBundleHash, getNativeBundleUrl, getNativeComponentId, getPlugin, getPluginNative, handleServerDeviceToolCall, hasDeviceTool, implementedStateDomains, implementedVoice, isActionable, isDeviceToolCommand, isInlineSurface, isMountSurface, listDeviceTools, listPlugins, mayPicturesLeavePhone, nativePluginRegistry, neverObserved, notifyPicturesToAiConsentChanged, onPicturesToAiConsentChange, pluginBundleUrl, register, registerBundleModules, registerDeviceTools, registerNativePlugin, registerPlatformDeviceTools, registerService, registerTools, releaseAiLive, releaseDeviceStateHolds, rendersNative, resetDeviceToolLoader, resolvePluginGrants, resolvePluginRuntimeProps, resolvePluginUrl, setAiLiveProvider, setBundleStorage, setCameraPreviewProvider, setDeviceStateProvider, setDeviceToolContextProvider, setDeviceToolResultPoster, setHapticsProvider, setPicturesToAiConsentProvider, setPluginNativeProvider, setPluginThemeColors, setVoiceProvider, supportsNative, supportsWebView, syncDeviceToolsForSession, unregisterDeviceTools, unregisterNativePlugin, useApi, useNativeBridge, usePlugin, usePluginRuntimeProps, usePluginTheme, useRemotePlugins, useSurfaceStore };
package/dist/index.d.ts CHANGED
@@ -1245,6 +1245,83 @@ interface VoiceAPI {
1245
1245
  transcript(): VoiceTranscriptEntry[];
1246
1246
  }
1247
1247
 
1248
+ type AiLiveCamera = 'front' | 'back';
1249
+ /** What the AI saw over time, as the live session's episode events. */
1250
+ interface AiLiveEpisode {
1251
+ /** episode.started / .interrupted / .recovered / .ongoing / .ended */
1252
+ type: string;
1253
+ /** The task class id from the chosen setup, e.g. "drinking". */
1254
+ class: string;
1255
+ episodeId: string;
1256
+ /** Whose camera saw it: the signed-in person whose live session this is (live sessions are per
1257
+ * person, workspace + actor). Always there: an event without it never reaches the screen. */
1258
+ actorId: string;
1259
+ /** When (ms since the epoch, the session's clock). */
1260
+ at: number;
1261
+ [key: string]: unknown;
1262
+ }
1263
+ type AiLiveState =
1264
+ /** Nothing running for this screen. */
1265
+ 'idle'
1266
+ /** Asking for the live session, opening the camera and the connection. */
1267
+ | 'starting'
1268
+ /** Pictures are going to the AI ("Sending to AI" is on screen). */
1269
+ | 'sending'
1270
+ /** Stopped by stop(), by the screen closing, or by the person taking the yes back (lastError says so). */
1271
+ | 'stopped'
1272
+ /** It could not start or it broke; `lastError` says why in plain words. */
1273
+ | 'error';
1274
+ interface AiLiveSnapshot {
1275
+ state: AiLiveState;
1276
+ camera: AiLiveCamera | null;
1277
+ /** Pictures sent since start. */
1278
+ sent: number;
1279
+ /** Picture slots that sent nothing (no fresh camera frame, or the connection was busy). */
1280
+ skipped: number;
1281
+ lastEpisode: AiLiveEpisode | null;
1282
+ lastError: string | null;
1283
+ }
1284
+ interface AiLiveStartOptions {
1285
+ /** Which camera: 'back' (default) or 'front', the selfie camera. */
1286
+ camera?: AiLiveCamera;
1287
+ }
1288
+ interface AiLiveAPI {
1289
+ /** Start sending this phone's camera to the chosen AI, in a live session of the
1290
+ * phone's own (capped at US$0.50). Refuses by name when either side has not said
1291
+ * yes, when another screen is sending already, or when the person already has a
1292
+ * live session running elsewhere. */
1293
+ start(opts?: AiLiveStartOptions): Promise<AiLiveSnapshot>;
1294
+ /** Stop sending. Closing the screen does the same. */
1295
+ stop(): Promise<void>;
1296
+ getSnapshot(): AiLiveSnapshot;
1297
+ /** Called with every episode event the AI makes while this screen sends. */
1298
+ onEpisode(cb: (ev: AiLiveEpisode) => void): Subscription;
1299
+ /** Called whenever the snapshot changes. */
1300
+ subscribe(cb: (snap: AiLiveSnapshot) => void): Subscription;
1301
+ }
1302
+ /** What the host supplies (setAiLiveProvider). `owner` is the screen's holder id,
1303
+ * captured by the gate — a plugin never supplies its own. */
1304
+ interface AiLiveProvider {
1305
+ /** `ctx.allowed` is the two-sided consent, asked again right before every picture:
1306
+ * once it answers no, the provider sends nothing more and stops. */
1307
+ start(opts: AiLiveStartOptions, owner: string, ctx: {
1308
+ visual: DeviceState['visual'];
1309
+ allowed: () => boolean;
1310
+ }): Promise<AiLiveSnapshot>;
1311
+ /** `why` (optional) is what the screen then reads as lastError, e.g. the yes taken back. */
1312
+ stop(owner: string, why?: string): Promise<void>;
1313
+ getSnapshot(owner: string): AiLiveSnapshot;
1314
+ onEpisode(cb: (ev: AiLiveEpisode) => void, owner: string): Subscription;
1315
+ subscribe(cb: (snap: AiLiveSnapshot) => void, owner: string): Subscription;
1316
+ /** The screen is gone: drop its callbacks and its last snapshot (after stop). */
1317
+ forget(owner: string): void;
1318
+ /** Whether ANY screen is sending right now — what the platform's indicator shows. */
1319
+ isSending(): boolean;
1320
+ /** Any change of isSending(). */
1321
+ subscribeSending(cb: () => void): Subscription;
1322
+ }
1323
+ declare const AI_LIVE_IDLE: AiLiveSnapshot;
1324
+
1248
1325
  /**
1249
1326
  * @adas/plugin-sdk — Type definitions
1250
1327
  *
@@ -1821,6 +1898,11 @@ interface NativeCapabilities$1 {
1821
1898
  nfc?: boolean;
1822
1899
  /** Real biometric auth (Face ID / Touch ID / fingerprint). */
1823
1900
  biometricsV2?: boolean;
1901
+ /** The developer's half of "camera pictures may go to an AI service off the
1902
+ * phone". Declaring it grants nothing by itself: the person on the phone must
1903
+ * also allow it in the host's settings. Both are checked together by
1904
+ * `mayPicturesLeavePhone()`. Not declared = pictures never leave. */
1905
+ picturesToAi?: boolean;
1824
1906
  }
1825
1907
  interface PluginHooks$1 {
1826
1908
  onAppStart?: boolean;
@@ -1912,6 +1994,14 @@ interface PluginProps {
1912
1994
  * plugin gets a refusal (reads say so, actions throw) — never a fake `idle`.
1913
1995
  */
1914
1996
  voice: VoiceAPI;
1997
+ /**
1998
+ * The workspace's CHOSEN AI watching the phone camera, live — gated to plugins
1999
+ * that declared `capabilities: { picturesToAi: true }` AND used only when the
2000
+ * person on the phone allowed "Pictures to AI". The screen gets episodes
2001
+ * ("drinking" started), never pictures; "Sending to AI" is platform-owned.
2002
+ * REQUIRED like `voice`: an undeclared plugin gets a refusal, never a fake idle.
2003
+ */
2004
+ aiLive: AiLiveAPI;
1915
2005
  theme: ThemeTokens;
1916
2006
  context: PluginContext;
1917
2007
  /** Engine-supplied props from `sys.focusUiPlugin(pluginId, props)`.
@@ -2287,6 +2377,28 @@ declare function implementedVoice(): boolean;
2287
2377
  */
2288
2378
  declare function gateVoice(declared: boolean, pluginId: string): VoiceAPI;
2289
2379
 
2380
+ /** The person took the yes back: what the screen reads, and why it stopped. */
2381
+ declare const CONSENT_TAKEN_BACK = "Camera pictures to AI was turned off on this phone, so sending stopped.";
2382
+ /** Host DI: the app supplies the live provider once at startup; null detaches it. */
2383
+ declare function setAiLiveProvider(provider: AiLiveProvider | null): void;
2384
+ /**
2385
+ * The `aiLive` a plugin receives. `capabilities` is its TRUSTED declaration
2386
+ * (pluginRuntime.ts); `holder` is the mounted screen it is bound to; `camera()` gives
2387
+ * the visual session the SDK's sender reads, held as aiLiveCameraHolder(holder). It
2388
+ * is built by resolvePluginRuntimeProps (the one place device gates are called) and
2389
+ * never reaches the plugin: the plugin gets episodes, the sender gets the camera.
2390
+ */
2391
+ declare function gateAiLive(capabilities: NativeCapabilities$1 | undefined, pluginId: string, holder: string, camera: () => DeviceState['visual']): AiLiveAPI;
2392
+ /** The screen closed: stop its live session and release its camera, and keep nothing of it. Closed for
2393
+ * good first, so every later start() of this screen is refused; then, in turn after anything it asked
2394
+ * before, the session stopped and the camera released. */
2395
+ declare function releaseAiLive(holder: string): Promise<void>;
2396
+ /** For the platform's "Sending to AI" indicator: is any screen sending, and when that changes. */
2397
+ declare const aiLiveIndicator: {
2398
+ isSending: () => boolean;
2399
+ subscribe: (cb: () => void) => Subscription;
2400
+ };
2401
+
2290
2402
  /**
2291
2403
  * Host integration points — the DI seams that keep this package free of
2292
2404
  * Expo imports. The host app (or @ateam-ai-mobile/expo) plugs in concrete providers
@@ -2324,6 +2436,20 @@ declare function setCameraPreviewProvider(Component: ((props: CameraPreviewImplP
2324
2436
  /** Null when the host installed none — the SDK then renders a stated reason,
2325
2437
  * never a black rectangle that looks like a dark room. */
2326
2438
  declare function getCameraPreviewProvider(): ((props: CameraPreviewImplProps) => any) | null;
2439
+ /** Install the host's answer to "did the person on this phone allow camera
2440
+ * pictures to go to AI?". Pass null to remove it (consent then reads as no). */
2441
+ declare function setPicturesToAiConsentProvider(provider: (() => boolean) | null): void;
2442
+ /** The host calls this whenever anything its consent answer reads may have changed
2443
+ * (the switch, the camera's own switch, the OS permission). Listeners re-ask
2444
+ * mayPicturesLeavePhone(); nothing is passed, so nothing can be cached. */
2445
+ declare function notifyPicturesToAiConsentChanged(): void;
2446
+ /** Hear when the consent answer may have changed (see notifyPicturesToAiConsentChanged). */
2447
+ declare function onPicturesToAiConsentChange(cb: () => void): {
2448
+ unsubscribe(): void;
2449
+ };
2450
+ /** The one check: true only when the plugin's trusted declaration includes
2451
+ * `picturesToAi` AND the person on the phone allowed it right now. */
2452
+ declare function mayPicturesLeavePhone(declared?: NativeCapabilities$1 | null): boolean;
2327
2453
  type PluginResolver = RegisteredPlugin | (() => Promise<RegisteredPlugin | null>);
2328
2454
  declare function registerNativePlugin(id: string, plugin: PluginResolver): void;
2329
2455
  declare function unregisterNativePlugin(id: string): void;
@@ -2352,6 +2478,8 @@ interface PluginRuntimeProps {
2352
2478
  native: PluginNative;
2353
2479
  deviceState: DeviceState;
2354
2480
  voice: VoiceAPI;
2481
+ /** The workspace's chosen AI watching the phone camera, live (`picturesToAi`). */
2482
+ aiLive: AiLiveAPI;
2355
2483
  }
2356
2484
  /** One declaration source — either the server manifest or the registry entry. */
2357
2485
  interface PluginDeclaration {
@@ -3347,4 +3475,4 @@ declare function isInlineSurface(m: SurfaceManifest): m is InlineSurfaceManifest
3347
3475
 
3348
3476
  declare function SurfaceDispatcher(): react_jsx_runtime.JSX.Element;
3349
3477
 
3350
- export { ActionButton, type ActivitySnapshot, AdaOrb, type AdaOrbState, Badge, type BiometricsAPI, type BiometricsAPIv2, type BluetoothAPI, type BluetoothDevice, type Bridge, type BundleCacheEntry, type BundleStorage, type CameraAPI, CameraPreview, type CameraPreviewProps, type CapabilitySnapshot, type CapabilityStatus, Card, type Confidence, type ConnectivityAPI, type ConnectivitySnapshot, type CookiesAPI, type DeviceBridgeDomain, type DeviceContextSnapshot, type DeviceState, type DeviceToolContext, type DeviceToolDefinition, type DeviceToolFailureReason, type DeviceToolFn, type DeviceToolOutcome, type DeviceToolSummary, type DeviceToolsAction, type DeviceToolsSessionDeps, EmptyState, type EnvironmentSnapshot, ErrorState, type FileSystemAPI, type Freshness, type HapticsAPI, type InlineSurfaceManifest, type InteractionSnapshot, ListItem, type LoadedBundleInfo, type LoadedBundleSource, LoadingState, type LocationAPI, type MapsAPI, type MapsAddress, type MapsCoordinate, type MapsPlace, type MapsRoute, type MapsRouteStep, MemoryBundleStorage, type MountSurfaceManifest, type NativeCapabilities$1 as NativeCapabilities, type NfcAPI, type NotificationsAPI, PLATFORM_VOICE_CALLER, type PluginManifest as PlatformPluginManifest, type PluginBridge, type PluginContext, type PluginGrants, type PluginHooks$1 as PluginHooks, type PluginManifest$1 as PluginManifest, type PluginNative, type PluginProps, type PluginRuntimeProps, type PluginRuntimeSource, PluginSDK, type PluginSummary, type PluginSurfaceMeta, type RegisteredPlugin, type RegisteredServicePlugin, type RegisteredToolsPlugin, type RegisteredUIPlugin, type RemotePlugin, type RenderMode, type ScannerAPI, SearchBar, type SessionSnapshot, type SharingAPI, type SpatialEvent, type SpatialIntent, type SpatialPoint, type SpatialSnapshot, type SpatialStateEvent, type StateEvent, type StateListener, type StateQuality, type StorageAPI, type Subscription, SurfaceCard, type SurfaceCardProps, SurfaceDispatcher, SurfaceDrawer, type SurfaceDrawerProps, SurfaceFullscreen, type SurfaceFullscreenProps, type SurfaceManifest, type SurfacePlacement, type SurfaceType, type SurfaceVisibility, TabBar, type ThemeTokens, type TrustedToolDeclaration, type VisionAPI, type VisionFrameQuality, type VisionLabel, type VisionObject, type VisionText, type VisualSnapshot, type VisualStartOptions, type VoiceAPI, type VoiceCaller, type VoiceDeviceToolCall, type VoiceDeviceToolReason, type VoiceEvent, type VoicePersona, type VoiceSessionProvider, type VoiceSnapshot, type VoiceStartOptions, type VoiceState, type VoiceSubscription, type VoiceTranscriptEntry, type WebViewCookie, __resetSessionSyncForTest, bundleManager, callDeviceTool, clearDeviceTools, createNativeBridge, deviceStateHolders, deviceState as deviceStateV2, deviceToolsActionForSession, ensureDeviceToolsLoaded, explainCapability, gateDeviceState, gatePluginNative, gateVoice, getCameraPreviewProvider, getHaptics, getNativeBundleHash, getNativeBundleUrl, getNativeComponentId, getPlugin, getPluginNative, handleServerDeviceToolCall, hasDeviceTool, implementedStateDomains, implementedVoice, isActionable, isDeviceToolCommand, isInlineSurface, isMountSurface, listDeviceTools, listPlugins, nativePluginRegistry, neverObserved, pluginBundleUrl, register, registerBundleModules, registerDeviceTools, registerNativePlugin, registerPlatformDeviceTools, registerService, registerTools, releaseDeviceStateHolds, rendersNative, resetDeviceToolLoader, resolvePluginGrants, resolvePluginRuntimeProps, resolvePluginUrl, setBundleStorage, setCameraPreviewProvider, setDeviceStateProvider, setDeviceToolContextProvider, setDeviceToolResultPoster, setHapticsProvider, setPluginNativeProvider, setPluginThemeColors, setVoiceProvider, supportsNative, supportsWebView, syncDeviceToolsForSession, unregisterDeviceTools, unregisterNativePlugin, useApi, useNativeBridge, usePlugin, usePluginRuntimeProps, usePluginTheme, useRemotePlugins, useSurfaceStore };
3478
+ export { AI_LIVE_IDLE, ActionButton, type ActivitySnapshot, AdaOrb, type AdaOrbState, type AiLiveAPI, type AiLiveCamera, type AiLiveEpisode, type AiLiveProvider, type AiLiveSnapshot, type AiLiveStartOptions, type AiLiveState, Badge, type BiometricsAPI, type BiometricsAPIv2, type BluetoothAPI, type BluetoothDevice, type Bridge, type BundleCacheEntry, type BundleStorage, CONSENT_TAKEN_BACK, type CameraAPI, CameraPreview, type CameraPreviewProps, type CapabilitySnapshot, type CapabilityStatus, Card, type Confidence, type ConnectivityAPI, type ConnectivitySnapshot, type CookiesAPI, type DeviceBridgeDomain, type DeviceContextSnapshot, type DeviceState, type DeviceToolContext, type DeviceToolDefinition, type DeviceToolFailureReason, type DeviceToolFn, type DeviceToolOutcome, type DeviceToolSummary, type DeviceToolsAction, type DeviceToolsSessionDeps, EmptyState, type EnvironmentSnapshot, ErrorState, type FileSystemAPI, type Freshness, type HapticsAPI, type InlineSurfaceManifest, type InteractionSnapshot, ListItem, type LoadedBundleInfo, type LoadedBundleSource, LoadingState, type LocationAPI, type MapsAPI, type MapsAddress, type MapsCoordinate, type MapsPlace, type MapsRoute, type MapsRouteStep, MemoryBundleStorage, type MountSurfaceManifest, type NativeCapabilities$1 as NativeCapabilities, type NfcAPI, type NotificationsAPI, PLATFORM_VOICE_CALLER, type PluginManifest as PlatformPluginManifest, type PluginBridge, type PluginContext, type PluginGrants, type PluginHooks$1 as PluginHooks, type PluginManifest$1 as PluginManifest, type PluginNative, type PluginProps, type PluginRuntimeProps, type PluginRuntimeSource, PluginSDK, type PluginSummary, type PluginSurfaceMeta, type RegisteredPlugin, type RegisteredServicePlugin, type RegisteredToolsPlugin, type RegisteredUIPlugin, type RemotePlugin, type RenderMode, type ScannerAPI, SearchBar, type SessionSnapshot, type SharingAPI, type SpatialEvent, type SpatialIntent, type SpatialPoint, type SpatialSnapshot, type SpatialStateEvent, type StateEvent, type StateListener, type StateQuality, type StorageAPI, type Subscription, SurfaceCard, type SurfaceCardProps, SurfaceDispatcher, SurfaceDrawer, type SurfaceDrawerProps, SurfaceFullscreen, type SurfaceFullscreenProps, type SurfaceManifest, type SurfacePlacement, type SurfaceType, type SurfaceVisibility, TabBar, type ThemeTokens, type TrustedToolDeclaration, type VisionAPI, type VisionFrameQuality, type VisionLabel, type VisionObject, type VisionText, type VisualSnapshot, type VisualStartOptions, type VoiceAPI, type VoiceCaller, type VoiceDeviceToolCall, type VoiceDeviceToolReason, type VoiceEvent, type VoicePersona, type VoiceSessionProvider, type VoiceSnapshot, type VoiceStartOptions, type VoiceState, type VoiceSubscription, type VoiceTranscriptEntry, type WebViewCookie, __resetSessionSyncForTest, aiLiveIndicator, bundleManager, callDeviceTool, clearDeviceTools, createNativeBridge, deviceStateHolders, deviceState as deviceStateV2, deviceToolsActionForSession, ensureDeviceToolsLoaded, explainCapability, gateAiLive, gateDeviceState, gatePluginNative, gateVoice, getCameraPreviewProvider, getHaptics, getNativeBundleHash, getNativeBundleUrl, getNativeComponentId, getPlugin, getPluginNative, handleServerDeviceToolCall, hasDeviceTool, implementedStateDomains, implementedVoice, isActionable, isDeviceToolCommand, isInlineSurface, isMountSurface, listDeviceTools, listPlugins, mayPicturesLeavePhone, nativePluginRegistry, neverObserved, notifyPicturesToAiConsentChanged, onPicturesToAiConsentChange, pluginBundleUrl, register, registerBundleModules, registerDeviceTools, registerNativePlugin, registerPlatformDeviceTools, registerService, registerTools, releaseAiLive, releaseDeviceStateHolds, rendersNative, resetDeviceToolLoader, resolvePluginGrants, resolvePluginRuntimeProps, resolvePluginUrl, setAiLiveProvider, setBundleStorage, setCameraPreviewProvider, setDeviceStateProvider, setDeviceToolContextProvider, setDeviceToolResultPoster, setHapticsProvider, setPicturesToAiConsentProvider, setPluginNativeProvider, setPluginThemeColors, setVoiceProvider, supportsNative, supportsWebView, syncDeviceToolsForSession, unregisterDeviceTools, unregisterNativePlugin, useApi, useNativeBridge, usePlugin, usePluginRuntimeProps, usePluginTheme, useRemotePlugins, useSurfaceStore };