@ateam-ai-mobile/plugin-runtime 0.1.14 → 0.1.16

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,4 +1,4 @@
1
- import React$1, { MutableRefObject, ReactNode, ComponentType } from 'react';
1
+ import React$1, { MutableRefObject, ComponentType, ReactNode } from 'react';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
  import * as zustand from 'zustand';
4
4
  import * as react_native from 'react-native';
@@ -2331,6 +2331,18 @@ declare const nativePluginRegistry: {
2331
2331
  has(id: string): boolean;
2332
2332
  get(id: string): Promise<RegisteredPlugin | null>;
2333
2333
  };
2334
+ /**
2335
+ * Does this plugin render NATIVELY (the SDK's <Plugin>) rather than in a WebView?
2336
+ * The ONE answer for every place a host mounts a plugin: a host-registered
2337
+ * component (by component name or plugin id), a bundle URL, or a declared RN
2338
+ * component in 'adaptive' / 'react-native' mode. (A declared component in
2339
+ * 'iframe' mode is NOT treated as native here — unchanged from the app's
2340
+ * version; usePlugin's own bundle derivation is a separate question.)
2341
+ * (Moved from ateam-mobile src/plugins/registry.ts, 52f8722a.)
2342
+ */
2343
+ declare function rendersNative(pluginId: string, manifest: {
2344
+ render?: any;
2345
+ } | null | undefined): boolean;
2334
2346
  declare function registerBundleModules(modules: Record<string, any>): void;
2335
2347
 
2336
2348
  /** The gated surface a plugin Component receives. `device` and `native` are the
@@ -3014,6 +3026,57 @@ interface UseRemotePluginsResult {
3014
3026
  */
3015
3027
  declare function useRemotePlugins(solutionId?: string): UseRemotePluginsResult;
3016
3028
 
3029
+ /**
3030
+ * Surface manifest types — the contract a plugin declares to live inside
3031
+ * the Ada host shell.
3032
+ *
3033
+ * Future: this maps directly onto the platform-side `surface` field on
3034
+ * plugin manifests. While that schema is in flight, the mobile shell
3035
+ * registers built-in surfaces locally (see bootstrap.tsx).
3036
+ */
3037
+
3038
+ type SurfaceType = 'drawer' | 'card' | 'fullscreen' | 'header' | 'ambient' | 'nudge';
3039
+ type SurfaceVisibility = 'always' | 'user' | 'engine';
3040
+ /** Where in the host's chrome the plugin lives. Generic, host-agnostic role.
3041
+ * - `featured`: signature surface — host shows it prominently (e.g. pinned card on home).
3042
+ * - `menu`: lives as a row in the host's navigation menu (side menu / hamburger).
3043
+ * - undefined: regular plugin — host puts it in the default plugin list / picker. */
3044
+ type SurfacePlacement = 'featured' | 'menu';
3045
+ interface SurfaceManifestBase {
3046
+ /** Stable plugin/surface id. e.g. "mcp:memory:drawer" */
3047
+ id: string;
3048
+ type: SurfaceType;
3049
+ visibility: SurfaceVisibility;
3050
+ /** Optional: where in host chrome to render. Omit = default plugin list. */
3051
+ placement?: SurfacePlacement;
3052
+ /** Short emoji or symbol — shown on cards / header pills */
3053
+ icon?: string;
3054
+ title: string;
3055
+ subtitle?: string;
3056
+ /** Marks plugins that handle sensitive data (host shows lock pill) */
3057
+ privacy?: boolean;
3058
+ }
3059
+ /** A surface that mounts a host component when active (drawer, fullscreen) */
3060
+ interface MountSurfaceManifest extends SurfaceManifestBase {
3061
+ type: 'drawer' | 'fullscreen';
3062
+ /** React component the dispatcher mounts when this surface is active.
3063
+ * Receives `dismiss` to close itself, plus optional `props` forwarded
3064
+ * from `sys.focusUiPlugin(id, props)`. */
3065
+ Component: ComponentType<{
3066
+ dismiss: () => void;
3067
+ props?: any;
3068
+ }>;
3069
+ }
3070
+ /** A surface that renders inline (card list / header / ambient) */
3071
+ interface InlineSurfaceManifest extends SurfaceManifestBase {
3072
+ type: 'card' | 'header' | 'ambient' | 'nudge';
3073
+ /** For cards: chat prompt to send when tapped */
3074
+ prompt?: string;
3075
+ /** Custom tap handler. Overrides `prompt` if present. */
3076
+ onPress?: () => void;
3077
+ }
3078
+ type SurfaceManifest = MountSurfaceManifest | InlineSurfaceManifest;
3079
+
3017
3080
  /**
3018
3081
  * Summary returned by cp.listContextPlugins — no `render` field.
3019
3082
  * Used for the plugin grid (name, icon, description).
@@ -3021,6 +3084,9 @@ declare function useRemotePlugins(solutionId?: string): UseRemotePluginsResult;
3021
3084
  interface PluginSurfaceMeta {
3022
3085
  type: 'drawer' | 'card' | 'fullscreen' | 'header' | 'ambient' | 'nudge';
3023
3086
  visibility?: 'always' | 'user' | 'engine';
3087
+ /** Where the surface sits in the host shell. (Was only in the app's copy of
3088
+ * this type, ateam-mobile 674db281.) */
3089
+ placement?: SurfacePlacement;
3024
3090
  trigger?: {
3025
3091
  from?: string;
3026
3092
  gesture?: string;
@@ -3248,57 +3314,6 @@ interface AdaOrbProps {
3248
3314
  }
3249
3315
  declare function AdaOrb({ size, state, inscription }: AdaOrbProps): react_jsx_runtime.JSX.Element;
3250
3316
 
3251
- /**
3252
- * Surface manifest types — the contract a plugin declares to live inside
3253
- * the Ada host shell.
3254
- *
3255
- * Future: this maps directly onto the platform-side `surface` field on
3256
- * plugin manifests. While that schema is in flight, the mobile shell
3257
- * registers built-in surfaces locally (see bootstrap.tsx).
3258
- */
3259
-
3260
- type SurfaceType = 'drawer' | 'card' | 'fullscreen' | 'header' | 'ambient' | 'nudge';
3261
- type SurfaceVisibility = 'always' | 'user' | 'engine';
3262
- /** Where in the host's chrome the plugin lives. Generic, host-agnostic role.
3263
- * - `featured`: signature surface — host shows it prominently (e.g. pinned card on home).
3264
- * - `menu`: lives as a row in the host's navigation menu (side menu / hamburger).
3265
- * - undefined: regular plugin — host puts it in the default plugin list / picker. */
3266
- type SurfacePlacement = 'featured' | 'menu';
3267
- interface SurfaceManifestBase {
3268
- /** Stable plugin/surface id. e.g. "mcp:memory:drawer" */
3269
- id: string;
3270
- type: SurfaceType;
3271
- visibility: SurfaceVisibility;
3272
- /** Optional: where in host chrome to render. Omit = default plugin list. */
3273
- placement?: SurfacePlacement;
3274
- /** Short emoji or symbol — shown on cards / header pills */
3275
- icon?: string;
3276
- title: string;
3277
- subtitle?: string;
3278
- /** Marks plugins that handle sensitive data (host shows lock pill) */
3279
- privacy?: boolean;
3280
- }
3281
- /** A surface that mounts a host component when active (drawer, fullscreen) */
3282
- interface MountSurfaceManifest extends SurfaceManifestBase {
3283
- type: 'drawer' | 'fullscreen';
3284
- /** React component the dispatcher mounts when this surface is active.
3285
- * Receives `dismiss` to close itself, plus optional `props` forwarded
3286
- * from `sys.focusUiPlugin(id, props)`. */
3287
- Component: ComponentType<{
3288
- dismiss: () => void;
3289
- props?: any;
3290
- }>;
3291
- }
3292
- /** A surface that renders inline (card list / header / ambient) */
3293
- interface InlineSurfaceManifest extends SurfaceManifestBase {
3294
- type: 'card' | 'header' | 'ambient' | 'nudge';
3295
- /** For cards: chat prompt to send when tapped */
3296
- prompt?: string;
3297
- /** Custom tap handler. Overrides `prompt` if present. */
3298
- onPress?: () => void;
3299
- }
3300
- type SurfaceManifest = MountSurfaceManifest | InlineSurfaceManifest;
3301
-
3302
3317
  interface SurfaceState {
3303
3318
  manifests: Record<string, SurfaceManifest>;
3304
3319
  activeDrawer: string | null;
@@ -3332,4 +3347,4 @@ declare function isInlineSurface(m: SurfaceManifest): m is InlineSurfaceManifest
3332
3347
 
3333
3348
  declare function SurfaceDispatcher(): react_jsx_runtime.JSX.Element;
3334
3349
 
3335
- 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, 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 };
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 };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React$1, { MutableRefObject, ReactNode, ComponentType } from 'react';
1
+ import React$1, { MutableRefObject, ComponentType, ReactNode } from 'react';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
  import * as zustand from 'zustand';
4
4
  import * as react_native from 'react-native';
@@ -2331,6 +2331,18 @@ declare const nativePluginRegistry: {
2331
2331
  has(id: string): boolean;
2332
2332
  get(id: string): Promise<RegisteredPlugin | null>;
2333
2333
  };
2334
+ /**
2335
+ * Does this plugin render NATIVELY (the SDK's <Plugin>) rather than in a WebView?
2336
+ * The ONE answer for every place a host mounts a plugin: a host-registered
2337
+ * component (by component name or plugin id), a bundle URL, or a declared RN
2338
+ * component in 'adaptive' / 'react-native' mode. (A declared component in
2339
+ * 'iframe' mode is NOT treated as native here — unchanged from the app's
2340
+ * version; usePlugin's own bundle derivation is a separate question.)
2341
+ * (Moved from ateam-mobile src/plugins/registry.ts, 52f8722a.)
2342
+ */
2343
+ declare function rendersNative(pluginId: string, manifest: {
2344
+ render?: any;
2345
+ } | null | undefined): boolean;
2334
2346
  declare function registerBundleModules(modules: Record<string, any>): void;
2335
2347
 
2336
2348
  /** The gated surface a plugin Component receives. `device` and `native` are the
@@ -3014,6 +3026,57 @@ interface UseRemotePluginsResult {
3014
3026
  */
3015
3027
  declare function useRemotePlugins(solutionId?: string): UseRemotePluginsResult;
3016
3028
 
3029
+ /**
3030
+ * Surface manifest types — the contract a plugin declares to live inside
3031
+ * the Ada host shell.
3032
+ *
3033
+ * Future: this maps directly onto the platform-side `surface` field on
3034
+ * plugin manifests. While that schema is in flight, the mobile shell
3035
+ * registers built-in surfaces locally (see bootstrap.tsx).
3036
+ */
3037
+
3038
+ type SurfaceType = 'drawer' | 'card' | 'fullscreen' | 'header' | 'ambient' | 'nudge';
3039
+ type SurfaceVisibility = 'always' | 'user' | 'engine';
3040
+ /** Where in the host's chrome the plugin lives. Generic, host-agnostic role.
3041
+ * - `featured`: signature surface — host shows it prominently (e.g. pinned card on home).
3042
+ * - `menu`: lives as a row in the host's navigation menu (side menu / hamburger).
3043
+ * - undefined: regular plugin — host puts it in the default plugin list / picker. */
3044
+ type SurfacePlacement = 'featured' | 'menu';
3045
+ interface SurfaceManifestBase {
3046
+ /** Stable plugin/surface id. e.g. "mcp:memory:drawer" */
3047
+ id: string;
3048
+ type: SurfaceType;
3049
+ visibility: SurfaceVisibility;
3050
+ /** Optional: where in host chrome to render. Omit = default plugin list. */
3051
+ placement?: SurfacePlacement;
3052
+ /** Short emoji or symbol — shown on cards / header pills */
3053
+ icon?: string;
3054
+ title: string;
3055
+ subtitle?: string;
3056
+ /** Marks plugins that handle sensitive data (host shows lock pill) */
3057
+ privacy?: boolean;
3058
+ }
3059
+ /** A surface that mounts a host component when active (drawer, fullscreen) */
3060
+ interface MountSurfaceManifest extends SurfaceManifestBase {
3061
+ type: 'drawer' | 'fullscreen';
3062
+ /** React component the dispatcher mounts when this surface is active.
3063
+ * Receives `dismiss` to close itself, plus optional `props` forwarded
3064
+ * from `sys.focusUiPlugin(id, props)`. */
3065
+ Component: ComponentType<{
3066
+ dismiss: () => void;
3067
+ props?: any;
3068
+ }>;
3069
+ }
3070
+ /** A surface that renders inline (card list / header / ambient) */
3071
+ interface InlineSurfaceManifest extends SurfaceManifestBase {
3072
+ type: 'card' | 'header' | 'ambient' | 'nudge';
3073
+ /** For cards: chat prompt to send when tapped */
3074
+ prompt?: string;
3075
+ /** Custom tap handler. Overrides `prompt` if present. */
3076
+ onPress?: () => void;
3077
+ }
3078
+ type SurfaceManifest = MountSurfaceManifest | InlineSurfaceManifest;
3079
+
3017
3080
  /**
3018
3081
  * Summary returned by cp.listContextPlugins — no `render` field.
3019
3082
  * Used for the plugin grid (name, icon, description).
@@ -3021,6 +3084,9 @@ declare function useRemotePlugins(solutionId?: string): UseRemotePluginsResult;
3021
3084
  interface PluginSurfaceMeta {
3022
3085
  type: 'drawer' | 'card' | 'fullscreen' | 'header' | 'ambient' | 'nudge';
3023
3086
  visibility?: 'always' | 'user' | 'engine';
3087
+ /** Where the surface sits in the host shell. (Was only in the app's copy of
3088
+ * this type, ateam-mobile 674db281.) */
3089
+ placement?: SurfacePlacement;
3024
3090
  trigger?: {
3025
3091
  from?: string;
3026
3092
  gesture?: string;
@@ -3248,57 +3314,6 @@ interface AdaOrbProps {
3248
3314
  }
3249
3315
  declare function AdaOrb({ size, state, inscription }: AdaOrbProps): react_jsx_runtime.JSX.Element;
3250
3316
 
3251
- /**
3252
- * Surface manifest types — the contract a plugin declares to live inside
3253
- * the Ada host shell.
3254
- *
3255
- * Future: this maps directly onto the platform-side `surface` field on
3256
- * plugin manifests. While that schema is in flight, the mobile shell
3257
- * registers built-in surfaces locally (see bootstrap.tsx).
3258
- */
3259
-
3260
- type SurfaceType = 'drawer' | 'card' | 'fullscreen' | 'header' | 'ambient' | 'nudge';
3261
- type SurfaceVisibility = 'always' | 'user' | 'engine';
3262
- /** Where in the host's chrome the plugin lives. Generic, host-agnostic role.
3263
- * - `featured`: signature surface — host shows it prominently (e.g. pinned card on home).
3264
- * - `menu`: lives as a row in the host's navigation menu (side menu / hamburger).
3265
- * - undefined: regular plugin — host puts it in the default plugin list / picker. */
3266
- type SurfacePlacement = 'featured' | 'menu';
3267
- interface SurfaceManifestBase {
3268
- /** Stable plugin/surface id. e.g. "mcp:memory:drawer" */
3269
- id: string;
3270
- type: SurfaceType;
3271
- visibility: SurfaceVisibility;
3272
- /** Optional: where in host chrome to render. Omit = default plugin list. */
3273
- placement?: SurfacePlacement;
3274
- /** Short emoji or symbol — shown on cards / header pills */
3275
- icon?: string;
3276
- title: string;
3277
- subtitle?: string;
3278
- /** Marks plugins that handle sensitive data (host shows lock pill) */
3279
- privacy?: boolean;
3280
- }
3281
- /** A surface that mounts a host component when active (drawer, fullscreen) */
3282
- interface MountSurfaceManifest extends SurfaceManifestBase {
3283
- type: 'drawer' | 'fullscreen';
3284
- /** React component the dispatcher mounts when this surface is active.
3285
- * Receives `dismiss` to close itself, plus optional `props` forwarded
3286
- * from `sys.focusUiPlugin(id, props)`. */
3287
- Component: ComponentType<{
3288
- dismiss: () => void;
3289
- props?: any;
3290
- }>;
3291
- }
3292
- /** A surface that renders inline (card list / header / ambient) */
3293
- interface InlineSurfaceManifest extends SurfaceManifestBase {
3294
- type: 'card' | 'header' | 'ambient' | 'nudge';
3295
- /** For cards: chat prompt to send when tapped */
3296
- prompt?: string;
3297
- /** Custom tap handler. Overrides `prompt` if present. */
3298
- onPress?: () => void;
3299
- }
3300
- type SurfaceManifest = MountSurfaceManifest | InlineSurfaceManifest;
3301
-
3302
3317
  interface SurfaceState {
3303
3318
  manifests: Record<string, SurfaceManifest>;
3304
3319
  activeDrawer: string | null;
@@ -3332,4 +3347,4 @@ declare function isInlineSurface(m: SurfaceManifest): m is InlineSurfaceManifest
3332
3347
 
3333
3348
  declare function SurfaceDispatcher(): react_jsx_runtime.JSX.Element;
3334
3349
 
3335
- 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, 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 };
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 };
package/dist/index.js CHANGED
@@ -483,6 +483,13 @@ function registerNativePlugin(id, plugin) {
483
483
  function unregisterNativePlugin(id) {
484
484
  _nativeRegistry.delete(id);
485
485
  }
486
+ function rendersNative(pluginId, manifest) {
487
+ const render = manifest?.render;
488
+ const rnComponent = render?.reactNative?.component || render?.component || "";
489
+ const hasBundleUrl = !!(render?.bundleUrl || render?.reactNative?.bundleUrl);
490
+ const isNativeMode = render?.mode === "adaptive" || render?.mode === "react-native";
491
+ return nativePluginRegistry.has(rnComponent) || nativePluginRegistry.has(pluginId) || hasBundleUrl || !!rnComponent && isNativeMode;
492
+ }
486
493
  function registerBundleModules(modules) {
487
494
  for (const [name, mod] of Object.entries(modules)) {
488
495
  _bundleModules.set(name, mod);
@@ -3394,6 +3401,7 @@ __export(index_exports, {
3394
3401
  registerService: () => registerService,
3395
3402
  registerTools: () => registerTools,
3396
3403
  releaseDeviceStateHolds: () => releaseDeviceStateHolds,
3404
+ rendersNative: () => rendersNative,
3397
3405
  resetDeviceToolLoader: () => resetDeviceToolLoader,
3398
3406
  resolvePluginGrants: () => resolvePluginGrants,
3399
3407
  resolvePluginRuntimeProps: () => resolvePluginRuntimeProps,
@@ -3828,6 +3836,7 @@ init_SurfaceDispatcher();
3828
3836
  registerService,
3829
3837
  registerTools,
3830
3838
  releaseDeviceStateHolds,
3839
+ rendersNative,
3831
3840
  resetDeviceToolLoader,
3832
3841
  resolvePluginGrants,
3833
3842
  resolvePluginRuntimeProps,