import { A2uiSurfaceStore } from "@mcp-native/a2ui"; import type { A2uiV1ActionEnvelope, A2uiV1HostExtensionRegistry, A2uiV1SurfaceState, A2uiV1SurfaceValidationPolicy, A2uiSurfaceStoreOptions } from "@mcp-native/a2ui"; import type { JsonObject } from "@mcp-native/core"; import { Component, type ReactElement, type ReactNode } from "react"; import type { NativeComponentCatalog } from "./component-adapters.js"; import type { NativeComponentLayoutContract, NativeComponentLayoutContracts, NativeSurfaceParentLayout, A2uiV1NativeMountDiagnostic, A2uiV1NativeMountDiagnosticCode, A2uiV1NativeMountReport, InspectA2uiV1NativeMountOptions } from "@mcp-native/renderer-core"; import { A2UI_V1_NATIVE_ICON_NAMES, A2uiV1NativeMountError, type A2uiV1NativeImagePolicy, type A2uiV1NativeHostExtensionPolicy, type A2uiV1NativeMediaPolicy, type A2uiV1NativeOpenUrlDescriptor, type NativeSession, type NativeSessionOptions } from "@mcp-native/renderer-core"; export { A2UI_V1_NATIVE_ICON_NAMES }; export { createNativeButtonAdapter, createNativeAudioPlayerAdapter, createNativeCheckBoxAdapter, createNativeChoicePickerAdapter, createNativeDateTimeInputAdapter, createNativeDividerAdapter, createNativeIconAdapter, createNativeImageAdapter, createNativeHostExtensionRegistration, createNativeModalAdapter, createNativeSliderAdapter, createNativeTabsAdapter, createNativeTextAdapter, createNativeTextInputAdapter, createNativeViewAdapter, createNativeVideoAdapter, } from "./component-adapters.js"; export type { NativeComponentPropMapper } from "./component-adapters.js"; export type { NativeComponentCatalog, NativeComponentVariants, NativeModalComponentProps, NativeTabItem, NativeTabsComponentProps, NativeViewComponentProps, } from "./component-adapters.js"; export type { NativeAccessibilityProps, NativeAccessibilityRole, NativeAccessibilityState, NativeAudioPlayerComponentProps, NativeButtonComponentProps, NativeButtonVariant, NativeCheckBoxComponentProps, NativeChoicePickerComponentProps, NativeChoicePickerDisplayStyle, NativeChoicePickerOption, NativeChoicePickerVariant, NativeCatalogComponentName, NativeComponentLayoutContract, NativeComponentLayoutContracts, NativeDateTimeInputComponentProps, NativeDividerComponentProps, NativeIconComponentProps, NativeIconName, NativeImageComponentProps, NativeImageFit, NativeImageResourcePolicy, NativeImageVariant, NativeHostExtensionCapabilityGrant, NativeHostExtensionComponentProps, NativeHostExtensionEventOptions, NativeHostExtensionRegistration, NativeMediaResourcePolicy, NativeSliderComponentProps, NativeTextComponentProps, NativeTextInputComponentProps, NativeTextInputVariant, NativeTextVariant, NativeViewStyle, NativeViewVariant, NativeVideoComponentProps, NativeSurfaceParentLayout, } from "@mcp-native/renderer-core"; export type { NativeComponentName, NativeElement } from "@mcp-native/renderer-core"; export interface A2uiV1NativeCatalogCapabilities { /** Required before Image can be advertised as an installed capability. */ readonly imagePolicy?: A2uiV1NativeImagePolicy; /** Required before Video or AudioPlayer can be advertised as installed capabilities. */ readonly mediaPolicy?: A2uiV1NativeMediaPolicy; } /** Returns the exact A2UI subset backed by one locally installed and policy-ready host catalog. */ export declare function getA2uiV1NativeSupportedComponentNames(components: NativeComponentCatalog, capabilities?: A2uiV1NativeCatalogCapabilities): readonly string[]; /** * Returns only extension catalogs backed by an exact helper-created local registration and a host * capability policy. These IDs can be combined with the basic catalog in renderer capabilities. */ export declare function getA2uiV1NativeSupportedHostExtensionCatalogIds(components: NativeComponentCatalog, registry: A2uiV1HostExtensionRegistry, hostExtensionPolicy: A2uiV1NativeHostExtensionPolicy | undefined): readonly string[]; export interface A2uiV1NativeHostOptions { readonly components: NativeComponentCatalog; /** Omission allows every component that is both installed and policy-ready. */ readonly allowedComponentNames?: readonly string[]; readonly allowedEventNames?: readonly string[]; readonly allowedFunctionNames?: readonly string[]; readonly hostExtensions?: A2uiV1HostExtensionRegistry; readonly allowedHostExtensionComponentNames?: readonly string[]; readonly imagePolicy?: A2uiV1NativeImagePolicy; readonly mediaPolicy?: A2uiV1NativeMediaPolicy; readonly hostExtensionPolicy?: A2uiV1NativeHostExtensionPolicy; /** Optional verified layout declarations for installed basic-catalog adapters. */ readonly layoutContracts?: NativeComponentLayoutContracts; /** Layout declarations for exact locally registered extension component names. */ readonly hostExtensionLayoutContracts?: Readonly>; } /** One immutable source of truth for native catalog validation, discovery, and mounting. */ export interface A2uiV1NativeHost { readonly components: NativeComponentCatalog; readonly policy: A2uiV1SurfaceValidationPolicy; readonly supportedComponentNames: readonly string[]; readonly supportedHostExtensionCatalogIds: readonly string[]; readonly imagePolicy?: A2uiV1NativeImagePolicy; readonly mediaPolicy?: A2uiV1NativeMediaPolicy; readonly hostExtensionPolicy?: A2uiV1NativeHostExtensionPolicy; readonly layoutContracts: NativeComponentLayoutContracts; readonly hostExtensionLayoutContracts: Readonly>; } /** Options accepted by the host-bound surface-store helper. */ export type NativeSurfaceStoreOptions = Pick; export type NativeHostSessionOptions = Omit & { readonly locale?: string; }; export type { A2uiV1NativeMountDiagnosticCode } from "@mcp-native/renderer-core"; export type { A2uiV1NativeMountDiagnostic } from "@mcp-native/renderer-core"; export type { A2uiV1NativeMountReport } from "@mcp-native/renderer-core"; export type { InspectA2uiV1NativeMountOptions } from "@mcp-native/renderer-core"; export { A2uiV1NativeMountError }; /** * Creates a frozen native host whose policy and advertised capabilities cannot drift from its * installed catalog or required resource policies. */ export declare function createA2uiV1NativeHost(options: A2uiV1NativeHostOptions): A2uiV1NativeHost; /** Returns whether a value is a genuine immutable host created by this package. */ export declare function isA2uiV1NativeHost(value: unknown): value is A2uiV1NativeHost; /** Creates a surface store bound to one registered host's exact extension registry. */ export declare function createSurfaceStore(host: A2uiV1NativeHost, options?: NativeSurfaceStoreOptions): A2uiSurfaceStore; /** Creates the shared semantic session through one immutable React Native host registration. */ export declare function createSession(host: A2uiV1NativeHost, options: NativeHostSessionOptions): NativeSession; /** Inspects the exact expanded plan and local registrations without entering React rendering. */ export declare function inspectA2uiV1NativeMount(surface: A2uiV1SurfaceState, host: A2uiV1NativeHost, options?: InspectA2uiV1NativeMountOptions): A2uiV1NativeMountReport; /** Throws a structured stable error when a surface cannot mount through the registered host. */ export declare function assertA2uiV1NativeMount(surface: A2uiV1SurfaceState, host: A2uiV1NativeHost, options?: InspectA2uiV1NativeMountOptions): A2uiV1NativeMountReport; export type A2uiV1NativeActionHandler = (envelope: A2uiV1ActionEnvelope, dataModel?: JsonObject) => void; /** Synchronous host authorization checked during the originating Button press. */ export type A2uiV1NativeOpenUrlPolicy = (request: A2uiV1NativeOpenUrlDescriptor) => boolean; /** Host-owned platform opener. The library never invokes a browser or URL handler directly. */ export type A2uiV1NativeOpenUrlHandler = (request: A2uiV1NativeOpenUrlDescriptor) => void; export interface A2uiV1NativeHostExtensionEventDescriptor { readonly extensionId: string; readonly catalogId: string; readonly schemaVersion: string; readonly componentName: string; readonly surfaceId: string; readonly sourceComponentId: string; readonly name: string; readonly payload: JsonObject; readonly userActivated: boolean; } export interface A2uiV1NativeSurfaceProps { readonly surface: A2uiV1SurfaceState; readonly policy: A2uiV1SurfaceValidationPolicy; readonly components: NativeComponentCatalog; /** Receives an official envelope and, only after explicit surface opt-in, the local model. */ readonly onAction: A2uiV1NativeActionHandler; /** Required with `onOpenUrl` when this surface is allowed to use the local `openUrl` function. */ readonly openUrlPolicy?: A2uiV1NativeOpenUrlPolicy; /** Executes an authorized URL while the originating Button press is still active. */ readonly onOpenUrl?: A2uiV1NativeOpenUrlHandler; /** Required when the reachable surface contains an Image component. */ readonly imagePolicy?: A2uiV1NativeImagePolicy; /** Required when the reachable surface contains Video or AudioPlayer. */ readonly mediaPolicy?: A2uiV1NativeMediaPolicy; /** Required when the reachable surface contains a negotiated host extension. */ readonly hostExtensionPolicy?: A2uiV1NativeHostExtensionPolicy; /** Receives only manifest-declared, schema-valid events from a local extension component. */ readonly onHostExtensionEvent?: (event: A2uiV1NativeHostExtensionEventDescriptor) => void; /** Observes renderer-local state changes without turning keystrokes into network calls. */ readonly onDataModelChange?: (dataModel: JsonObject) => void; readonly actionMetadata?: JsonObject; /** Host-selected BCP 47 locale for renderer-side number, currency, date, and plural formatting. */ readonly locale?: string; /** Injectable RFC 3339 timestamp source for host clocks and deterministic tests. */ readonly now?: () => string; } /** * Mounts the supported A2UI v1 subset with renderer-local two-way bindings. * Agent events are resolved against the latest local model at press time. */ export declare function A2uiV1NativeSurface({ surface, policy, components, onAction, openUrlPolicy, onOpenUrl, imagePolicy, mediaPolicy, hostExtensionPolicy, onHostExtensionEvent, onDataModelChange, actionMetadata, locale, now, }: A2uiV1NativeSurfaceProps): ReactElement; export type A2uiV1NativeRenderErrorCode = "native-surface-render-failed"; /** Stable render failure that does not expose a component-library exception in its message. */ export declare class A2uiV1NativeRenderError extends Error { readonly code: A2uiV1NativeRenderErrorCode; constructor(options?: ErrorOptions); } export interface A2uiV1NativeSurfaceBoundaryProps { readonly children?: ReactNode; /** Host-authored fallback. Omission renders no partial surface after failure. */ readonly fallback?: ReactNode; readonly onError: (error: A2uiV1NativeMountError | A2uiV1NativeRenderError) => void; /** Changing this value clears a prior failure for a replacement surface. */ readonly resetKey: string; } interface A2uiV1NativeSurfaceBoundaryState { readonly failed: boolean; readonly resetKey: string; } /** Reusable fail-closed boundary for applications that mount the low-level surface directly. */ export declare class A2uiV1NativeSurfaceBoundary extends Component { state: A2uiV1NativeSurfaceBoundaryState; static getDerivedStateFromError(): Partial; static getDerivedStateFromProps(props: A2uiV1NativeSurfaceBoundaryProps, state: A2uiV1NativeSurfaceBoundaryState): Partial | null; componentDidCatch(error: unknown): void; render(): ReactNode; } export interface A2uiV1NativeHostSurfaceProps { readonly host: A2uiV1NativeHost; readonly surface: A2uiV1SurfaceState; readonly onAction: A2uiV1NativeActionHandler; readonly onRenderError: (error: A2uiV1NativeMountError | A2uiV1NativeRenderError) => void; readonly fallback?: ReactNode; readonly parentLayout?: NativeSurfaceParentLayout; readonly resetKey?: string; readonly openUrlPolicy?: A2uiV1NativeOpenUrlPolicy; readonly onOpenUrl?: A2uiV1NativeOpenUrlHandler; readonly onHostExtensionEvent?: (event: A2uiV1NativeHostExtensionEventDescriptor) => void; readonly onDataModelChange?: (dataModel: JsonObject) => void; readonly actionMetadata?: JsonObject; readonly locale?: string; readonly now?: () => string; } /** Preflights and mounts through one immutable host, with surface-wide render containment. */ export declare function A2uiV1NativeHostSurface(props: A2uiV1NativeHostSurfaceProps): ReactElement; export { A2UI_V1_NATIVE_COMPONENT_NAMES, A2UI_V1_NATIVE_MAX_CHOICE_OPTIONS, A2UI_V1_NATIVE_MAX_IMAGE_BYTES, A2UI_V1_NATIVE_MAX_IMAGE_DIMENSION, A2UI_V1_NATIVE_MAX_IMAGE_PIXELS, A2UI_V1_NATIVE_MAX_IMAGE_REDIRECT_ORIGINS, A2UI_V1_NATIVE_MAX_IMAGE_REDIRECTS, A2UI_V1_NATIVE_MAX_IMAGE_URL_LENGTH, A2UI_V1_NATIVE_MAX_IMAGES, A2UI_V1_NATIVE_MAX_MEDIA, A2UI_V1_NATIVE_MAX_MEDIA_BYTES, A2UI_V1_NATIVE_MAX_MEDIA_MIME_TYPES, A2UI_V1_NATIVE_MAX_MEDIA_REDIRECT_ORIGINS, A2UI_V1_NATIVE_MAX_MEDIA_REDIRECTS, A2UI_V1_NATIVE_MAX_MEDIA_URL_LENGTH, A2UI_V1_NATIVE_MAX_OPEN_URL_LENGTH, A2UI_V1_NATIVE_MAX_RENDER_NODES, A2UI_V1_NATIVE_MAX_TOTAL_IMAGE_BYTES, A2UI_V1_NATIVE_MAX_TOTAL_IMAGE_PIXELS, A2UI_V1_NATIVE_MAX_TOTAL_MEDIA_BYTES, createA2uiV1NativeRenderPlan, createComponentSourceKey, createDataModelSourceKey, resolveA2uiV1NativeEvent, resolveA2uiV1NativeOpenUrl, updateDataModelBinding, } from "@mcp-native/renderer-core"; export type { A2uiV1NativeEventDescriptor, A2uiV1NativeEventResolutionOptions, A2uiV1NativeImagePolicy, A2uiV1NativeImageGrant, A2uiV1NativeImageRequest, A2uiV1NativeHostExtensionPolicy, A2uiV1NativeHostExtensionRequest, A2uiV1NativeMediaGrant, A2uiV1NativeMediaKind, A2uiV1NativeMediaPolicy, A2uiV1NativeMediaRequest, A2uiV1NativeOpenUrlDescriptor, A2uiV1NativeOpenUrlResolutionOptions, A2uiV1NativeRenderPlanOptions, } from "@mcp-native/renderer-core"; /** Concise public names for the current React Native A2UI renderer profile. */ export { A2UI_V1_NATIVE_ICON_NAMES as ICON_NAMES } from "@mcp-native/renderer-core"; export { A2UI_V1_NATIVE_COMPONENT_NAMES as COMPONENT_NAMES, A2UI_V1_NATIVE_MAX_CHOICE_OPTIONS as MAX_CHOICE_OPTIONS, A2UI_V1_NATIVE_MAX_IMAGE_BYTES as MAX_IMAGE_BYTES, A2UI_V1_NATIVE_MAX_IMAGE_DIMENSION as MAX_IMAGE_DIMENSION, A2UI_V1_NATIVE_MAX_IMAGE_PIXELS as MAX_IMAGE_PIXELS, A2UI_V1_NATIVE_MAX_IMAGE_REDIRECT_ORIGINS as MAX_IMAGE_REDIRECT_ORIGINS, A2UI_V1_NATIVE_MAX_IMAGE_REDIRECTS as MAX_IMAGE_REDIRECTS, A2UI_V1_NATIVE_MAX_IMAGE_URL_LENGTH as MAX_IMAGE_URL_LENGTH, A2UI_V1_NATIVE_MAX_IMAGES as MAX_IMAGES, A2UI_V1_NATIVE_MAX_MEDIA as MAX_MEDIA, A2UI_V1_NATIVE_MAX_MEDIA_BYTES as MAX_MEDIA_BYTES, A2UI_V1_NATIVE_MAX_MEDIA_MIME_TYPES as MAX_MEDIA_MIME_TYPES, A2UI_V1_NATIVE_MAX_MEDIA_REDIRECT_ORIGINS as MAX_MEDIA_REDIRECT_ORIGINS, A2UI_V1_NATIVE_MAX_MEDIA_REDIRECTS as MAX_MEDIA_REDIRECTS, A2UI_V1_NATIVE_MAX_MEDIA_URL_LENGTH as MAX_MEDIA_URL_LENGTH, A2UI_V1_NATIVE_MAX_OPEN_URL_LENGTH as MAX_OPEN_URL_LENGTH, A2UI_V1_NATIVE_MAX_RENDER_NODES as MAX_RENDER_NODES, A2UI_V1_NATIVE_MAX_TOTAL_IMAGE_BYTES as MAX_TOTAL_IMAGE_BYTES, A2UI_V1_NATIVE_MAX_TOTAL_IMAGE_PIXELS as MAX_TOTAL_IMAGE_PIXELS, A2UI_V1_NATIVE_MAX_TOTAL_MEDIA_BYTES as MAX_TOTAL_MEDIA_BYTES, createA2uiV1NativeRenderPlan as createRenderPlan, resolveA2uiV1NativeEvent as resolveEvent, resolveA2uiV1NativeOpenUrl as resolveOpenUrl, } from "@mcp-native/renderer-core"; export type { A2uiV1NativeEventDescriptor as EventDescriptor, A2uiV1NativeEventResolutionOptions as EventResolutionOptions, A2uiV1NativeHostExtensionPolicy as HostExtensionPolicy, A2uiV1NativeHostExtensionRequest as HostExtensionRequest, A2uiV1NativeImageGrant as ImageGrant, A2uiV1NativeImagePolicy as ImagePolicy, A2uiV1NativeImageRequest as ImageRequest, A2uiV1NativeMediaGrant as MediaGrant, A2uiV1NativeMediaKind as MediaKind, A2uiV1NativeMediaPolicy as MediaPolicy, A2uiV1NativeMediaRequest as MediaRequest, A2uiV1NativeOpenUrlDescriptor as OpenUrlDescriptor, A2uiV1NativeOpenUrlResolutionOptions as OpenUrlResolutionOptions, A2uiV1NativeRenderPlanOptions as RenderPlanOptions, } from "@mcp-native/renderer-core"; export { A2uiV1NativeHostSurface as HostSurface, A2uiV1NativeMountError as MountError, A2uiV1NativeRenderError as RenderError, A2uiV1NativeSurface as Surface, A2uiV1NativeSurfaceBoundary as SurfaceBoundary, assertA2uiV1NativeMount as assertMount, createA2uiV1NativeHost as createHost, getA2uiV1NativeSupportedComponentNames as getSupportedComponentNames, getA2uiV1NativeSupportedHostExtensionCatalogIds as getSupportedHostExtensionCatalogIds, inspectA2uiV1NativeMount as inspectMount, isA2uiV1NativeHost as isHost, }; export type { A2uiV1NativeActionHandler as ActionHandler, A2uiV1NativeCatalogCapabilities as CatalogCapabilities, A2uiV1NativeHost as Host, A2uiV1NativeHostExtensionEventDescriptor as HostExtensionEventDescriptor, A2uiV1NativeHostOptions as HostOptions, A2uiV1NativeHostSurfaceProps as HostSurfaceProps, A2uiV1NativeMountDiagnostic as MountDiagnostic, A2uiV1NativeMountDiagnosticCode as MountDiagnosticCode, A2uiV1NativeMountReport as MountReport, A2uiV1NativeOpenUrlHandler as OpenUrlHandler, A2uiV1NativeOpenUrlPolicy as OpenUrlPolicy, A2uiV1NativeRenderErrorCode as RenderErrorCode, A2uiV1NativeSurfaceBoundaryProps as SurfaceBoundaryProps, A2uiV1NativeSurfaceProps as SurfaceProps, InspectA2uiV1NativeMountOptions as InspectMountOptions, }; //# sourceMappingURL=index.d.ts.map