@mentra/bluetooth-sdk 3.2.0-dev.254 → 3.2.0-dev.259

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.
Files changed (31) hide show
  1. package/android/src/main/java/com/mentra/bluetoothsdk/GeneratedReleaseMetadata.kt +5 -5
  2. package/android/src/main/java/com/mentra/bluetoothsdk/streaming/StreamModels.kt +11 -0
  3. package/android/src/test/java/com/mentra/bluetoothsdk/StreamDegradationPreferenceTest.kt +61 -0
  4. package/android/src/test/java/com/mentra/bluetoothsdk/StreamRequestTest.kt +134 -0
  5. package/android/src/test/java/com/mentra/bluetoothsdk/utils/BleJsonCompactTest.java +31 -0
  6. package/build/BluetoothSdk.types.d.ts +7 -0
  7. package/build/BluetoothSdk.types.d.ts.map +1 -1
  8. package/build/BluetoothSdk.types.js.map +1 -1
  9. package/build/_private/BluetoothSdkModule.d.ts.map +1 -1
  10. package/build/_private/BluetoothSdkModule.js +5 -0
  11. package/build/_private/BluetoothSdkModule.js.map +1 -1
  12. package/build/_private/streamRequestPayload.d.ts +8 -0
  13. package/build/_private/streamRequestPayload.d.ts.map +1 -0
  14. package/build/_private/streamRequestPayload.js +42 -0
  15. package/build/_private/streamRequestPayload.js.map +1 -0
  16. package/build/generated/releaseMetadata.js +5 -5
  17. package/build/generated/releaseMetadata.js.map +1 -1
  18. package/build/index.d.ts +1 -1
  19. package/build/index.d.ts.map +1 -1
  20. package/build/index.js.map +1 -1
  21. package/ios/Source/BluetoothSdkDefaults.swift +1 -1
  22. package/ios/Source/GeneratedReleaseMetadata.swift +5 -5
  23. package/ios/Source/streaming/StreamModels.swift +34 -6
  24. package/ios/Tests/StreamDegradationPreferenceTests.swift +55 -0
  25. package/ios/Tests/StreamRequestTests.swift +113 -0
  26. package/package.json +2 -2
  27. package/src/BluetoothSdk.types.ts +8 -0
  28. package/src/_private/BluetoothSdkModule.ts +9 -0
  29. package/src/_private/streamRequestPayload.ts +43 -0
  30. package/src/generated/releaseMetadata.ts +5 -5
  31. package/src/index.ts +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"BluetoothSdk.types.js","sourceRoot":"","sources":["../src/BluetoothSdk.types.ts"],"names":[],"mappings":"AA2CA,MAAM,CAAC,MAAM,wCAAwC,GAAG,KAAK,CAAA;AAwB7D,MAAM,UAAU,kCAAkC,CAChD,MAA+B;IAE/B,OAAO,MAAM,CAAC,KAAK,KAAK,WAAW,CAAA;AACrC,CAAC;AAED,MAAM,UAAU,8BAA8B,CAAC,MAA+B;IAC5E,OAAO,MAAM,CAAC,KAAK,KAAK,WAAW,IAAI,MAAM,CAAC,WAAW,CAAA;AAC3D,CAAC;AAED,MAAM,UAAU,6BAA6B,CAAC,MAA+B;IAC3E,OAAO,MAAM,CAAC,KAAK,KAAK,UAAU,IAAI,MAAM,CAAC,KAAK,KAAK,YAAY,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS,CAAA;AACnG,CAAC;AAED,MAAM,UAAU,+BAA+B;IAC7C,OAAO;QACL,UAAU,EAAE,EAAC,KAAK,EAAE,cAAc,EAAC;QACnC,OAAO,EAAE,EAAC,KAAK,EAAE,UAAU,EAAC;QAC5B,6BAA6B,EAAE,wCAAwC;QACvE,IAAI,EAAE,EAAC,KAAK,EAAE,cAAc,EAAC;KAC9B,CAAA;AACH,CAAC;AA2BD,MAAM,UAAU,qBAAqB,CAAC,MAAkB;IACtD,OAAO,MAAM,CAAC,KAAK,KAAK,WAAW,CAAA;AACrC,CAAC;AAkFD,MAAM,UAAU,sBAAsB,CAAC,MAAqB;IAC1D,OAAO,MAAM,CAAC,KAAK,KAAK,SAAS,CAAA;AACnC,CAAC;AAwYD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,SAAS,EAAE,mBAAmB;IAC9B,EAAE,EAAE,mBAAmB;IACvB,EAAE,EAAE,mBAAmB;IACvB,UAAU,EAAE,aAAa;IACzB,SAAS,EAAE,gBAAgB;IAC3B,KAAK,EAAE,cAAc;IACrB,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,iBAAiB;IACxB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,EAAE,EAAE,mBAAmB;CACf,CAAA;AAWV,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAA;AAChC,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;AACjC,MAAM,CAAC,MAAM,kBAAkB,GAAG,cAAc,CAAA","sourcesContent":["import type {PhotoCompression} from \"@mentra/cloud-protocol/photo-compression\"\nexport type {PhotoCompression} from \"@mentra/cloud-protocol/photo-compression\"\n\n// Bluetooth SDK Event Types\nexport type GlassesNotReadyEvent = {\n type: \"glasses_not_ready\"\n message: string\n}\n\n// NOTE: unlike most events below, the native module does NOT include a `type`\n// field on the button_press payload 闂?it sends only {buttonId, pressType,\n// timestamp} (see BluetoothSdkModule on both iOS and Android). Consumers must\n// filter on `pressType` / the \"button_press\" listener name, never `event.type`.\nexport type ButtonPressEvent = {\n buttonId: string\n pressType: \"long\" | \"short\"\n timestamp: number\n}\n\nexport type TouchEvent = {\n type: \"touch_event\"\n deviceModel: DeviceModel\n gestureName: string\n timestamp: number\n}\n\nexport type AccelEvent = {\n type: \"accel_event\"\n x: number\n y: number\n z: number\n timestamp: number\n}\n\nexport type HeadUpEvent = {\n up: boolean\n}\n\nexport type VoiceActivityDetectionStatusEvent = {\n type: \"voice_activity_detection_status\"\n voiceActivityDetectionEnabled: boolean\n}\n\nexport const DEFAULT_VOICE_ACTIVITY_DETECTION_ENABLED = false\n\nexport type SpeakingStatusEvent = {\n type: \"speaking_status\"\n speaking: boolean\n timestamp: number\n}\n\nexport type BatteryStatusEvent = {\n type: \"battery_status\"\n level: number\n charging: boolean\n timestamp: number\n}\n\nexport type GlassesConnectionStatus =\n | {state: \"disconnected\"}\n | {state: \"scanning\"}\n | {state: \"connecting\"}\n | {state: \"bonding\"}\n | {state: \"connected\"; fullyBooted: boolean}\n\nexport type ConnectedGlassesConnectionStatus = Extract<GlassesConnectionStatus, {state: \"connected\"}>\n\nexport function isConnectedGlassesConnectionStatus(\n status: GlassesConnectionStatus,\n): status is ConnectedGlassesConnectionStatus {\n return status.state === \"connected\"\n}\n\nexport function isReadyGlassesConnectionStatus(status: GlassesConnectionStatus): boolean {\n return status.state === \"connected\" && status.fullyBooted\n}\n\nexport function isBusyGlassesConnectionStatus(status: GlassesConnectionStatus): boolean {\n return status.state === \"scanning\" || status.state === \"connecting\" || status.state === \"bonding\"\n}\n\nexport function createDisconnectedGlassesStatus(): Partial<GlassesStatus> {\n return {\n connection: {state: \"disconnected\"},\n hotspot: {state: \"disabled\"},\n voiceActivityDetectionEnabled: DEFAULT_VOICE_ACTIVITY_DETECTION_ENABLED,\n wifi: {state: \"disconnected\"},\n }\n}\n\n/** K900 `sr_getvol` response (Mentra Live glasses media step volume 0闂?5). */\nexport type GlassesMediaVolumeGetResult = {\n level: number\n statusCode: number\n}\n\n/** K900 `sr_vol` acknowledgment. */\nexport type GlassesMediaVolumeSetResult = {\n statusCode: number\n}\n\nexport type LocalTranscriptionEvent = {\n text: string\n isFinal?: boolean\n transcribeLanguage?: string\n}\n\nexport type LogEvent = {\n message: string\n}\n\nexport type WifiStatus = {state: \"disconnected\"} | {state: \"connected\"; ssid: string; localIp?: string}\n\nexport type ConnectedWifiStatus = Extract<WifiStatus, {state: \"connected\"}>\n\nexport function isConnectedWifiStatus(status: WifiStatus): status is ConnectedWifiStatus {\n return status.state === \"connected\"\n}\n\nexport type WifiStatusChangeEvent = WifiStatus & {\n type: \"wifi_status_change\"\n /**\n * Glasses-reported provisioning failure reason when THIS event is the verdict of a\n * failed connect attempt; absent on routine link-state updates. An attempt property,\n * not a link property 闂?which is why it lives on the event, not on WifiStatus:\n * \"connect_timeout\" arrives on a disconnected status (never associated), while\n * \"connected_to_other_network\" arrives on a *connected* status (the attempt failed\n * and the glasses ended up on / fell back to a different SSID than requested).\n * Requires ASG client v40+ 闂?older glasses never send it.\n */\n error?: string\n}\n\nexport type WifiForgetOutcome =\n | \"confirmed\"\n | \"dispatched\"\n | \"not_found\"\n | \"unsupported\"\n | \"failed\"\n | \"legacy_unverified\"\n\nexport type WifiForgetResult = {\n ssid: string\n outcome: WifiForgetOutcome\n connected?: boolean\n currentSsid?: string\n localIp?: string\n error?: string\n}\n\nexport type ModernWifiForgetResultEvent = {\n type: \"wifi_forget_result\"\n mode: \"modern\"\n requestId: string\n sid: string\n ssid: string\n protocolVersion: number\n outcome: Exclude<WifiForgetOutcome, \"legacy_unverified\">\n connected?: boolean\n currentSsid?: string\n localIp?: string\n error?: string\n}\n\nexport type LegacyWifiForgetResultEvent = {\n type: \"wifi_forget_result\"\n mode: \"legacy\"\n ssid: string\n dispatched: boolean\n connected?: boolean\n currentSsid?: string\n localIp?: string\n error?: string\n}\n\nexport type WifiForgetResultEvent = ModernWifiForgetResultEvent | LegacyWifiForgetResultEvent\n\nexport type SavedWifiNetworksOutcome = \"confirmed\" | \"unsupported\" | \"failed\"\n\nexport type SavedWifiNetworksResult = {\n outcome: SavedWifiNetworksOutcome\n networks: string[]\n error?: string\n}\n\nexport type SavedWifiNetworksEvent = {\n type: \"saved_wifi_networks\"\n requestId: string\n sid: string\n protocolVersion: number\n outcome: SavedWifiNetworksOutcome\n networks: string[]\n error?: string\n}\n\nexport type HotspotStatus = {state: \"disabled\"} | {state: \"enabled\"; ssid: string; password: string; localIp: string}\n\nexport type EnabledHotspotStatus = Extract<HotspotStatus, {state: \"enabled\"}>\n\nexport function isEnabledHotspotStatus(status: HotspotStatus): status is EnabledHotspotStatus {\n return status.state === \"enabled\"\n}\n\nexport type HotspotStatusChangeEvent = HotspotStatus & {\n type: \"hotspot_status_change\"\n}\n\nexport type HotspotErrorEvent = {\n type: \"hotspot_error\"\n errorMessage: string\n timestamp: number\n}\n\nexport type VersionInfoResult = {\n versionInfoType?: string\n sid?: string\n androidVersion: string\n firmwareVersion: string\n besFirmwareVersion: string\n mtkFirmwareVersion: string\n buildNumber: string\n systemTimeMs?: number\n otaVersionUrl: string\n appVersion: string\n /**\n * Package the glasses client actually runs as, from `version_info_1`.\n * `\"com.mentra.asg_client\"` is the stock client; anything else is a sideloaded build (Android\n * forces a distinct package on any build not signed with Mentra's release key) that coexists\n * with the stock app and must not be driven by OTA.\n *\n * Omitted — not empty — whenever this result carries no identity: either the glasses predate\n * the field, or the response resolved from a `version_info` chunk that does not carry it (only\n * chunk 1 does). Omission is what keeps a response from overwriting an identity an earlier\n * chunk established, so treat `undefined` as \"unknown\", never as \"stock\".\n */\n packageName?: string\n /** Phone-served hotspot OTA protocol version; 0 means unsupported/legacy glasses. */\n hotspotOtaVersion: number\n /** Session-correlated WiFi forget result protocol; absent/0 means unsupported. */\n wifiForgetResultVersion?: number\n /** Session-correlated saved-network listing protocol; absent/0 means unsupported. */\n savedWifiNetworksVersion?: number\n}\n\nexport type VersionInfoEvent = VersionInfoResult & {\n type: \"version_info\"\n}\n\nexport type WifiScanResultEvent = {\n type: \"wifi_scan_result\"\n networks: WifiSearchResult[]\n scanComplete?: boolean\n}\n\nexport type PhotoResponseEvent =\n | {\n type: \"photo_response\"\n state: \"success\"\n requestId: string\n uploadUrl: string\n photoUrl?: string\n statusUrl?: string\n contentType?: string\n fileSizeBytes?: number\n timestamp: number\n }\n | {\n type: \"photo_response\"\n state: \"error\"\n requestId: string\n timestamp: number\n errorCode?: string\n errorMessage: string\n }\n\nexport type PhotoSuccessResponseEvent = Extract<PhotoResponseEvent, {state: \"success\"}>\n\nexport type PhotoStatusState =\n | \"accepted\"\n | \"queued\"\n | \"configuring\"\n | \"capturing\"\n | \"captured\"\n | \"compressing\"\n | \"ble_fallback_compression\"\n | \"uploading\"\n | \"uploaded\"\n | \"ready_for_transfer\"\n | \"transferring\"\n | \"thumbnail_received\"\n | \"failed\"\n\nexport type PhotoResolvedConfig = {\n format?: \"jpeg\" | string\n width?: number\n height?: number\n quality?: number\n requestedSize?: PhotoSize | string\n source?: \"sdk\" | \"button\" | string\n transferMethod?: \"webhook\" | \"ble\" | \"local\" | string\n compression?: PhotoCompression\n saveToGallery?: boolean\n exposureTimeNs?: number\n iso?: number\n}\n\nexport type PhotoFpsRange = {\n min?: number\n max?: number\n}\n\nexport type PhotoRequestedCaptureConfig = {\n manual?: boolean\n exposureTimeNs?: number\n iso?: number\n frameDurationNs?: number\n aeMode?: number\n aeLock?: boolean\n aeExposureCompensation?: number\n aeTargetFpsRange?: PhotoFpsRange\n noiseReductionMode?: number\n edgeMode?: number\n afMode?: number\n zsl?: boolean\n}\n\nexport type PhotoMeteredPreview = {\n exposureTimeNs?: number\n iso?: number\n totalLightProxy?: number\n}\n\nexport type PhotoCaptureMetadata = {\n manual?: boolean\n exposureTimeNs?: number\n iso?: number\n frameDurationNs?: number\n aeMode?: number\n aeState?: number\n aeStateName?: string\n noiseReductionMode?: number\n edgeMode?: number\n zsl?: boolean\n sensorTimestampNs?: number\n totalLightProxy?: number\n mfnrLikely?: boolean\n mfnrApplied?: boolean\n width?: number\n height?: number\n noiseReductionWarning?: \"not_implemented\" | string\n ispDigitalGainWarning?: \"not_implemented\" | string\n ispAnalogGainWarning?: \"not_implemented\" | string\n [key: string]: unknown\n}\n\nexport type PhotoStatusEvent = {\n type: \"photo_status\"\n requestId: string\n status: PhotoStatusState | string\n timestamp: number\n resolvedConfig?: PhotoResolvedConfig\n requestedCaptureConfig?: PhotoRequestedCaptureConfig\n meteredPreview?: PhotoMeteredPreview\n captureMetadata?: PhotoCaptureMetadata\n errorCode?: string\n errorMessage?: string\n /** Present on thumbnail_received: a JPEG data URI, not the final photo. */\n thumbnailUrl?: string\n fileSizeBytes?: number\n}\n\nexport type CameraStatusEvent = {\n type: \"camera_status\"\n requestId: string\n state: \"warming\" | \"ready\" | \"stopped\" | \"error\" | string\n timestamp: number\n errorCode?: string\n errorMessage?: string\n}\n\nexport type VideoRecordingStatusEvent = {\n type: \"video_recording_status\"\n requestId?: string\n success: boolean\n status: VideoRecordingStatusState\n details?: string | null\n timestamp: number\n data?: {\n recording?: boolean\n duration_ms?: number\n duration_formatted?: string\n [key: string]: unknown\n }\n}\n\nexport type VideoRecordingStatusState =\n | \"recording_started\"\n | \"recording_status\"\n | \"already_recording\"\n | \"recording_stopped\"\n | \"not_recording\"\n | \"request_id_mismatch\"\n | \"service_unavailable\"\n | \"json_error\"\n | \"battery_low\"\n | \"camera_busy\"\n | \"storage_unavailable\"\n | \"integrity_failed\"\n | \"error\"\n\nexport type VideoRecordingStartedStatusEvent = Omit<VideoRecordingStatusEvent, \"success\" | \"status\"> & {\n success: true\n status: \"recording_started\"\n}\n\nexport type VideoRecordingStoppedStatusEvent = Omit<VideoRecordingStatusEvent, \"success\" | \"status\"> & {\n success: true\n status: \"recording_stopped\"\n}\n\nexport type VideoRecordingSuccessStatusEvent = VideoRecordingStartedStatusEvent | VideoRecordingStoppedStatusEvent\n\nexport type MediaUploadSuccessEvent = {\n type: \"media_success\"\n requestId: string\n mediaUrl: string\n mediaType: number\n timestamp: number\n}\n\nexport type MediaUploadErrorEvent = {\n type: \"media_error\"\n requestId: string\n errorMessage: string\n mediaType: number\n timestamp: number\n}\n\nexport type MediaUploadEvent = MediaUploadSuccessEvent | MediaUploadErrorEvent\n\nexport type GalleryStatusEvent = {\n type: \"gallery_status\"\n photos: number\n videos: number\n total: number\n totalSize?: number\n hasContent: boolean\n cameraBusy: boolean\n cameraBusyReason?: \"video\" | \"stream\" | (string & {})\n}\n\nexport type CompatibleGlassesSearchStopEvent = {\n type: \"compatible_glasses_search_stop\"\n deviceModel: DeviceModel\n}\n\nexport type HeartbeatSentEvent = {\n type: \"heartbeat_sent\"\n heartbeat_sent: {\n timestamp: number\n }\n}\n\nexport type HeartbeatReceivedEvent = {\n type: \"heartbeat_received\"\n heartbeat_received: {\n timestamp: number\n }\n}\n\nexport type SwipeVolumeStatusEvent = {\n type: \"swipe_volume_status\"\n enabled: boolean\n timestamp: number\n}\n\nexport type SwitchStatusEvent = {\n type: \"switch_status\"\n switchType?: number\n switchValue?: number\n timestamp: number\n}\n\nexport type RgbLedControlResponseEvent =\n | {\n type: \"rgb_led_control_response\"\n state: \"success\"\n requestId: string\n }\n | {\n type: \"rgb_led_control_response\"\n state: \"error\"\n requestId: string\n errorCode: string\n }\n\nexport type RgbLedControlSuccessResponseEvent = Extract<RgbLedControlResponseEvent, {state: \"success\"}>\n\nexport type SettingsAckStatus = \"applied\" | \"ready\" | \"error\" | \"failed\" | \"failure\" | \"rejected\"\n\nexport type SettingsAckSetting =\n | \"gallery_mode\"\n | \"button_photo\"\n | \"button_video_recording\"\n | \"button_max_recording_time\"\n | \"camera_fov\"\n | \"camera_fov_override\"\n | \"camera_tuning\"\n\nexport type SettingsAckEvent = {\n type: \"settings_ack\"\n requestId: string\n setting: SettingsAckSetting\n status: SettingsAckStatus\n timestamp: number\n fov?: number\n roiPosition?: CameraRoiPositionValue\n hardwareApplied?: boolean\n leaseId?: string\n active?: boolean\n size?: ButtonPhotoSize | string\n width?: number\n height?: number\n fps?: number\n enabled?: boolean\n minutes?: number\n /** ANR enabled flag; present when setting === \"camera_tuning\" */\n anr?: boolean\n /** Stock-gain flag; present when setting === \"camera_tuning\" */\n gain?: boolean\n errorCode?: string\n errorMessage?: string\n}\n\nexport type SettingsAckSuccessStatus = Exclude<SettingsAckStatus, \"error\" | \"failed\" | \"failure\" | \"rejected\">\n\nexport type SettingsAckSuccessEvent = Omit<SettingsAckEvent, \"status\"> & {\n status: SettingsAckSuccessStatus\n}\n\nexport type RgbLedAction = \"on\" | \"off\"\nexport type RgbLedColor = \"red\" | \"green\" | \"blue\" | \"orange\" | \"white\"\nexport type PhotoSize = \"low\" | \"medium\" | \"high\" | \"max\"\nexport type PhotoMode = \"photo\" | \"text\"\nexport type PhotoTransferMethod = \"auto\" | \"direct\" | \"ble\"\nexport type ButtonPhotoSize = \"low\" | \"medium\" | \"high\" | \"max\"\n\n/**\n * @deprecated Sticky action-button photo presets via {@link BluetoothSdkPublicModule.setPhotoCaptureDefaults}\n * are deprecated. Prefer per-request {@link BluetoothSdkPublicModule.requestPhoto} options\n * (e.g. `mode: \"text\"` for text sensor size/crop, or explicit `aeExposureDivisor`) instead of\n * persisting button-photo tuning on the glasses.\n */\nexport type PhotoCaptureDefaults = {\n size?: PhotoSize\n /** ZSL preview buffering for physical camera-button photos. */\n zsl?: boolean\n /** MFNR still capture for physical camera-button photos. */\n mfnr?: boolean\n noiseReduction?: boolean\n edgeEnhancement?: boolean\n ispDigitalGain?: number\n ispAnalogGain?: string\n aeExposureDivisor?: number\n isoCap?: number\n compress?: PhotoCompression\n sound?: boolean\n /** When true, clears stored NR/edge/ISP presets on the glasses before applying other fields. */\n resetCaptureTuning?: boolean\n}\n\nexport type VideoRecordingDefaults = {\n width: number\n height: number\n fps: number\n}\n\n/**\n * Optional per-recording video settings for {@link startVideoRecording}. When\n * omitted, the glasses fall back to their saved video recording defaults. Any\n * field left undefined is omitted from the BLE command (glasses default applies).\n */\nexport interface VideoRecordingSettings {\n width?: number\n height?: number\n fps?: number\n /**\n * Optional auto-stop timer in minutes, sent on `start_video_recording`.\n * `0` (the default) means record until stopped or interrupted\n * (battery/storage/thermal/error).\n */\n maxRecordingTimeMinutes?: number\n}\nexport const DeviceModels = {\n Simulated: \"Simulated Glasses\",\n G1: \"Even Realities G1\",\n G2: \"Even Realities G2\",\n MentraLive: \"Mentra Live\",\n MentraNex: \"Mentra Display\",\n Mach1: \"Mentra Mach1\",\n Z100: \"Vuzix Z100\",\n Frame: \"Brilliant Frame\",\n Nimo: \"NIMO\",\n Ar99: \"AR99\",\n R1: \"Even Realities R1\",\n} as const\n\nexport type DeviceModel = (typeof DeviceModels)[keyof typeof DeviceModels]\nexport type ObservableStoreCategory = \"glasses\" | \"bluetooth\" | \"core\"\n\nexport type DashboardMenuItem = {\n title: string\n packageName: string\n values?: Record<string, unknown>\n}\n\nexport const CAMERA_FOV_MIN = 62\nexport const CAMERA_FOV_MAX = 118\nexport const CAMERA_FOV_DEFAULT = CAMERA_FOV_MAX\n\nexport type CameraRoiPosition = \"center\" | \"bottom\" | \"top\"\nexport type CameraRoiPositionValue = 0 | 1 | 2\nexport type CameraFovPreset = \"narrow\" | \"standard\" | \"wide\"\n\nexport type CameraFovRequest =\n | {\n fov: number\n roiPosition?: CameraRoiPosition\n }\n | {\n preset: CameraFovPreset\n }\n\nexport type CameraFovResult = {\n requestId: string\n fov: number\n roiPosition: CameraRoiPosition\n timestamp: number\n}\n\nexport type CameraFovOverrideRequest = CameraFovRequest & {\n /** Phone-owned lease used to make delayed releases safe. */\n leaseId: string\n /** Safety TTL; refresh the same lease/configuration to extend without a HAL restart. */\n ttlMs?: number\n}\n\nexport type CameraFovSetting = {\n fov: number\n roiPosition: CameraRoiPositionValue\n}\n\ntype NativeCameraFovSetting = {\n fov: number\n roi_position: CameraRoiPositionValue\n}\n\nexport type MicPreference = \"auto\" | \"phone\" | \"glasses\" | \"bluetooth\"\nexport type MicMode = \"phone\" | \"glasses\" | \"bluetoothClassic\" | \"bluetooth\"\n\nexport type PhotoRequestParams = {\n /**\n * Send an oriented <=500px, quality-50 JPEG preview before the full photo. Default false.\n * Enables a 110-second end-to-end native deadline (ordinary requests: 30 seconds).\n */\n presend_thumbnail?: boolean\n requestId?: string\n appId?: string\n size: PhotoSize\n mode?: PhotoMode\n /** `direct` disables BLE fallback; `ble` skips direct upload and forces phone-relayed transfer. */\n transferMethod?: PhotoTransferMethod\n webhookUrl: string | null\n authToken: string | null\n compress?: PhotoCompression\n save?: boolean\n sound: boolean\n exposureTimeNs?: number | null\n /** Sensor ISO for this capture only. Only used when exposureTimeNs enables manual exposure. */\n iso?: number | null\n /** After AE convergence, divide metered exposure by this factor (scan mode). */\n aeExposureDivisor?: number\n /** Cap ISO after AE metering (scan mode). */\n isoCap?: number\n /** Requested on wire; glasses may log not_implemented. */\n noiseReduction?: boolean\n edgeEnhancement?: boolean\n /** ZSL buffering. Forced off for manual/scan stills because fixed sensor controls take priority. */\n zsl?: boolean\n /** MFNR still capture. Forced off for manual/scan stills because fixed sensor controls take priority. */\n mfnr?: boolean\n ispDigitalGain?: number\n ispAnalogGain?: string\n}\n\nexport type WarmUpCameraParams = {\n /** Supply this when the owner needs to call stopCameraWarmUp during teardown. */\n requestId?: string\n size: PhotoSize\n mode?: PhotoMode\n exposureTimeNs?: number | null\n /** Ready-state hold; defaults to 15 seconds and is capped at 5 minutes by ASG. */\n durationMs?: number\n /** ZSL preview buffering for the warm-up session. */\n zsl?: boolean\n /** MFNR still capture for the warm-up session. */\n mfnr?: boolean\n}\n\nexport type StreamVideoConfig = {\n width?: number\n height?: number\n bitrate?: number\n /** WHIP minimum target in bps; omitted leaves it unset. Clamped to the maximum. */\n minBitrateBps?: number\n /** WHIP startup bitrate in bps, clamped to the requested bounds. */\n initialBitrateBps?: number\n fps?: number\n}\n\nexport type StreamAudioConfig = {\n bitrate?: number\n sampleRate?: number\n echoCancellation?: boolean\n noiseSuppression?: boolean\n}\n\n/** ICE overrides for a WHIP stream. Ignored by the RTMP and SRT paths. */\nexport type StreamIceConfig = {\n /**\n * STUN server the glasses should use while gathering candidates.\n *\n * Omit to keep the default Cloudflare STUN server. Pass an empty string to force host-only\n * gathering, which is what SoftAP calling needs: the WHIP server runs on the phone across the\n * glasses' own hotspot, so a server-reflexive candidate is meaningless and there is no route to\n * a STUN server anyway. A value that is not a `stun:`/`stuns:` URI is ignored and the default is\n * kept, so a malformed override cannot silently disable ICE.\n */\n stun?: string\n}\n\nexport type StreamStartRequest = {\n type?: \"start_stream\"\n streamUrl: string\n streamId?: string\n sound?: boolean\n video?: StreamVideoConfig\n audio?: StreamAudioConfig\n ice?: StreamIceConfig\n /** When false, glasses skip mic capture. Defaults to true. */\n captureAudio?: boolean\n /**\n * Correlation id echoed by the glasses in every SOFTAP_TRACE log line, so phone and glasses\n * logs can be joined despite having unsynchronised clocks.\n *\n * TEMPORARY: part of the SoftAP diagnostic trace layer.\n */\n traceId?: string\n}\n\nexport type StreamKeepAliveRequest = {\n type?: \"keep_stream_alive\"\n streamId: string\n ackId: string\n}\n\nexport type PairFailureEvent = {\n type: \"pair_failure\"\n error: string\n}\n\nexport type PairingInfoEvent = {\n had_previous_bond: boolean\n pairing_code?: string\n classic_bond_ready?: boolean\n secure_pairing_capable?: boolean\n protocol_version?: number\n}\n\nexport type EnteringPairingModeEvent = {\n window_ms: number\n reason?: string\n}\n\nexport type OwnerReplacedEvent = {\n reason: string\n}\n\nexport type AudioPairingNeededEvent = {\n type: \"audio_pairing_needed\"\n deviceName: string\n}\n\nexport type AudioConnectedEvent = {\n type: \"audio_connected\"\n deviceName: string\n}\n\nexport type AudioDisconnectedEvent = {\n type: \"audio_disconnected\"\n}\n\nexport type SaveSettingEvent = {\n type: \"save_setting\"\n key: string\n value: any\n}\n\nexport type WsTextEvent = {\n type: \"ws_text\"\n text: string\n}\n\nexport type WsBinEvent = {\n type: \"ws_bin\"\n base64: string\n}\n\nexport type MicPcmEvent = {\n type: \"mic_pcm\"\n pcm: ArrayBuffer\n sampleRate: 16000\n bitsPerSample: 16\n channels: 1\n encoding: \"pcm_s16le\"\n voiceActivityDetectionEnabled: boolean\n /**\n * The microphone this buffer came from (`\"glasses\"`, `\"phone\"`, `\"bluetooth\"`, or `\"\"` when none\n * is selected). Stamped per frame because the SDK can move the source mid-stream, so a consumer\n * that told a remote party which microphone it is sending can check rather than assume.\n */\n source: string\n}\n\nexport type MicLc3Event = {\n type: \"mic_lc3\"\n lc3: ArrayBuffer\n sampleRate: 16000\n channels: 1\n encoding: \"lc3\"\n frameDurationMs: 10\n frameSizeBytes: number\n bitrate: number\n packetizedFromGlasses: boolean\n voiceActivityDetectionEnabled: boolean\n}\n\n/** Native glasses-microphone diagnostics emitted when the SDK detects a transport or decode issue. */\nexport type MicHealthEvent = {\n type: \"mic_health\"\n reason: \"sequence_gap\" | \"decode_failure\"\n sequenceGapEvents: number\n decodeFailures: number\n lastLc3ReceivedAt?: number\n lastPcmProducedAt?: number\n timestamp: number\n}\n\nexport type StreamStatusLifecycleState = \"initializing\" | \"streaming\" | \"stopping\" | \"stopped\"\nexport type StreamStatusReconnectState = \"reconnecting\" | \"reconnected\" | \"reconnect_failed\"\nexport type StreamStatusState = StreamStatusLifecycleState | StreamStatusReconnectState | \"error\"\n\n/** Effective stream settings reported by the glasses after defaults and clamps. */\nexport type StreamResolvedConfig = {\n transport?: \"rtmp\" | \"srt\" | \"whip\"\n video?: {\n /** Encoded output width sent to the stream endpoint. */\n width: number\n /** Encoded output height sent to the stream endpoint. */\n height: number\n /** Native camera buffer width selected before crop/downscale. */\n captureWidth?: number\n /** Native camera buffer height selected before crop/downscale. */\n captureHeight?: number\n /** Encoded video bitrate in bits per second. */\n bitrate: number\n /** Resolved capture/encode frame rate. */\n fps: number\n }\n audio?: {\n /** Encoded audio bitrate in bits per second. */\n bitrate?: number\n /** Audio sample rate in Hz. */\n sampleRate?: number\n echoCancellation?: boolean\n noiseSuppression?: boolean\n }\n}\n\n/** Live encoder and device telemetry emitted periodically by supported glasses firmware. */\nexport type StreamLiveStats = {\n /** Current encoded video bitrate in bits per second. */\n bitrate?: number\n /** Current encode frame rate. */\n fps?: number\n droppedFrames?: number\n /** Seconds since the stream started. */\n duration?: number\n /** Device temperature in 闂佺娅i悡? if the hardware reports it. */\n temperatureC?: number\n}\n\ntype StreamStatusCommon = {\n type: \"stream_status\"\n streamId?: string\n /** ASG process identity and monotonic revision for reconnect reconciliation. */\n sid?: string\n revision?: number\n terminal?: boolean\n errorDetails?: string\n timestamp?: number\n resolvedConfig?: StreamResolvedConfig\n stats?: StreamLiveStats\n}\n\nexport type StreamStatusEvent =\n | (StreamStatusCommon & {\n kind: \"lifecycle\"\n status: StreamStatusLifecycleState\n })\n | (StreamStatusCommon & {\n kind: \"reconnect\"\n status: \"reconnecting\"\n attempt: number\n maxAttempts: number\n reason: string\n })\n | (StreamStatusCommon & {\n kind: \"reconnect\"\n status: \"reconnected\"\n attempt: number\n })\n | (StreamStatusCommon & {\n kind: \"reconnect\"\n status: \"reconnect_failed\"\n maxAttempts: number\n })\n | (StreamStatusCommon & {\n kind: \"error\"\n status: \"error\"\n errorDetails: string\n })\n | (StreamStatusCommon & {\n kind: \"snapshot\"\n status: StreamStatusState\n streaming: boolean\n reconnecting: boolean\n attempt?: number\n })\n\nexport type KeepAliveAckEvent = {\n type: \"keep_alive_ack\"\n streamId: string\n ackId: string\n timestamp?: number\n}\n\nexport type MtkUpdateCompleteEvent = {\n type: \"mtk_update_complete\"\n message: string\n timestamp: number\n}\n\n/**\n * The glasses process restarted while the BES kept the BLE link alive (its `sid`\n * changed, or first appeared after an update from a pre-sid build). There is no\n * physical disconnect for this — treat it as the logical reconnect edge.\n */\nexport type GlassesSessionChangedEvent = {\n type: \"glasses_session_changed\"\n previous_sid: string\n sid: string\n}\n\n/** @deprecated Glasses no longer emit ota_progress; use {@link OtaStatusEvent} and status-store mapping. */\nexport type OtaProgressEvent = {\n type: \"ota_progress\"\n stage?: OtaStage\n status?: OtaProgressStatus\n progress?: number\n bytes_downloaded?: number\n total_bytes?: number\n current_update?: string\n error_message?: string\n}\n\nexport type OtaStartAckEvent = {\n type: \"ota_start_ack\"\n timestamp: number\n}\nexport type OtaStatusEvent = {\n type: \"ota_status\"\n session_id: string\n total_steps: number\n current_step: number\n step_type: \"apk\" | \"mtk\" | \"bes\"\n phase: \"download\" | \"install\"\n step_percent: number\n /** Real bytes received in the current download; absent on older glasses. */\n bytes_downloaded?: number\n overall_percent: number\n status: \"in_progress\" | \"step_complete\" | \"complete\" | \"failed\" | \"idle\"\n error_message?: string\n}\n\nexport type OtaQueryResult = OtaStatusEvent\n\n/** Nex BLE protobuf trace (NexEventUtils); payload matches native Map keys. */\nexport type BleCommandTraceEvent = {\n command: string\n commandText: string\n timestamp: number\n}\n\nexport type MiniappSelectedEvent = {\n type: \"miniapp_selected\"\n packageName: string\n}\n\n// Union type of all native/internal Bluetooth SDK events.\nexport type BluetoothSdkInternalEvent = Parameters<BluetoothSdkModuleEvents[keyof BluetoothSdkModuleEvents]>[0]\n\nexport type BluetoothSdkModuleEvents = {\n glasses_status: (changed: Partial<GlassesStatus>) => void\n bluetooth_status: (changed: Partial<BluetoothStatus>) => void\n log: (event: LogEvent) => void\n device_discovered: (device: Device) => void\n default_device_changed: (event: {device?: Device}) => void\n // Individual event handlers\n glasses_not_ready: (event: GlassesNotReadyEvent) => void\n button_press: (event: ButtonPressEvent) => void\n touch_event: (event: TouchEvent) => void\n accel_event: (event: AccelEvent) => void\n head_up: (event: HeadUpEvent) => void\n voice_activity_detection_status: (event: VoiceActivityDetectionStatusEvent) => void\n speaking_status: (event: SpeakingStatusEvent) => void\n battery_status: (event: BatteryStatusEvent) => void\n local_transcription: (event: LocalTranscriptionEvent) => void\n native_notification_status: (event: NativeNotificationStatus) => void\n native_notification_delivery: (event: NativeNotificationDelivery) => void\n phone_notification: (event: PhoneNotificationEvent) => void\n phone_notification_dismissed: (event: PhoneNotificationDismissedEvent) => void\n wifi_status_change: (event: WifiStatusChangeEvent) => void\n wifi_scan_result: (event: WifiScanResultEvent) => void\n wifi_forget_result: (event: WifiForgetResultEvent) => void\n saved_wifi_networks: (event: SavedWifiNetworksEvent) => void\n hotspot_status_change: (event: HotspotStatusChangeEvent) => void\n hotspot_error: (event: HotspotErrorEvent) => void\n photo_response: (event: PhotoResponseEvent) => void\n photo_status: (event: PhotoStatusEvent) => void\n camera_status: (event: CameraStatusEvent) => void\n video_recording_status: (event: VideoRecordingStatusEvent) => void\n media_success: (event: MediaUploadSuccessEvent) => void\n media_error: (event: MediaUploadErrorEvent) => void\n gallery_status: (event: GalleryStatusEvent) => void\n compatible_glasses_search_stop: (event: CompatibleGlassesSearchStopEvent) => void\n heartbeat_sent: (event: HeartbeatSentEvent) => void\n heartbeat_received: (event: HeartbeatReceivedEvent) => void\n swipe_volume_status: (event: SwipeVolumeStatusEvent) => void\n switch_status: (event: SwitchStatusEvent) => void\n rgb_led_control_response: (event: RgbLedControlResponseEvent) => void\n settings_ack: (event: SettingsAckEvent) => void\n pair_failure: (event: PairFailureEvent) => void\n pairing_info: (event: PairingInfoEvent) => void\n entering_pairing_mode: (event: EnteringPairingModeEvent) => void\n owner_replaced: (event: OwnerReplacedEvent) => void\n audio_pairing_needed: (event: AudioPairingNeededEvent) => void\n audio_connected: (event: AudioConnectedEvent) => void\n audio_disconnected: (event: AudioDisconnectedEvent) => void\n save_setting: (event: SaveSettingEvent) => void\n ws_text: (event: WsTextEvent) => void\n ws_bin: (event: WsBinEvent) => void\n mic_pcm: (event: MicPcmEvent) => void\n mic_lc3: (event: MicLc3Event) => void\n mic_health: (event: MicHealthEvent) => void\n stream_status: (event: StreamStatusEvent) => void\n keep_alive_ack: (event: KeepAliveAckEvent) => void\n mtk_update_complete: (event: MtkUpdateCompleteEvent) => void\n glasses_session_changed: (event: GlassesSessionChangedEvent) => void\n ota_start_ack: (event: OtaStartAckEvent) => void\n ota_status: (event: OtaStatusEvent) => void\n ar99_ota_status: (event: Ar99OtaStatusEvent) => void\n version_info: (event: VersionInfoEvent) => void\n send_command_to_ble: (event: BleCommandTraceEvent) => void\n receive_command_from_ble: (event: BleCommandTraceEvent) => void\n miniapp_selected: (event: MiniappSelectedEvent) => void\n extraction_progress: (event: ExtractionProgressEvent) => void\n}\n\nexport interface ExtractionProgressEvent {\n percentage: number\n bytesRead: number\n totalBytes: number\n}\n\nexport interface Ar99OtaStatusEvent {\n type: \"ar99_ota_status\"\n phase: string\n progress: number\n offset: number\n total: number\n errorMessage?: string\n error_message?: string\n}\n\nexport interface PhoneNotificationEvent {\n notificationId: string\n app: string\n title: string\n content: string\n priority: string\n timestamp: number\n packageName: string\n}\n\nexport interface PhoneNotificationDismissedEvent {\n notificationId: string\n notificationKey: string\n packageName: string\n timestamp: number\n}\n\n/**\n * Outbound payload for `sendPhoneNotification` — a notification pushed INTO the glasses' own\n * notification centre. The inverse of {@link PhoneNotificationEvent}, which reports\n * notifications the glasses relayed TO the phone (iOS/ANCS). Drivers map these keys onto\n * whatever their firmware expects.\n */\nexport interface NativeNotificationConfig {\n enabled: boolean\n autoDisplay: boolean\n durationSeconds: number\n doNotDisturb: boolean\n /** Android package names. iOS rejects nonempty lists; its ANCS filter is firmware-owned. */\n blockedApps: string[]\n}\n\nexport interface NativeNotificationStatus {\n supported: boolean\n source: \"phone\" | \"ancs\" | \"unsupported\"\n authorization: \"system\" | \"authorized\" | \"not_authorized\" | \"unknown\"\n /** `submitted` is not a firmware-confirmed acknowledgement. */\n state: \"unavailable\" | \"disabled\" | \"configuring\" | \"submitted\" | \"needs_reconnect\" | \"failed\"\n config: NativeNotificationConfig\n error: string\n}\n\nexport interface NativeNotificationDelivery {\n notificationId: string\n status: \"delivered\" | \"failed\" | \"cancelled\" | \"dropped\"\n reason: string\n}\n\nexport interface NativePhoneNotification {\n /** Stable id from the phone's notification listener; parsed to an int where firmware needs one. */\n notificationId: string\n /** Reverse-DNS package id of the originating app. */\n packageName: string\n /** Human app name (e.g. \"Messages\"). */\n appName: string\n title: string\n /** Android `android.subText`. Empty when the listener didn't capture one. */\n subtitle: string\n body: string\n /** Unix ms post time. */\n timestampMs: number\n /** Posted or updated. Removal is not supported by the verified protocol. */\n action: 0\n}\n\nexport type PublicGlassesStatus = Omit<\n GlassesStatus,\n \"otaUpdateAvailable\" | \"otaProgress\" | \"otaInProgress\" | \"otaVersionUrl\"\n>\n\nexport type PublicBluetoothStatus = Pick<\n BluetoothStatus,\n | \"searching\"\n | \"searchingController\"\n | \"systemMicUnavailable\"\n | \"micRanking\"\n | \"currentMic\"\n | \"searchResults\"\n | \"wifiScanResults\"\n | \"lastLog\"\n | \"otherBtConnected\"\n | \"galleryModeEnabled\"\n>\n\nexport type BluetoothSdkEventMap = {\n native_notification_status: NativeNotificationStatus\n native_notification_delivery: NativeNotificationDelivery\n log: LogEvent\n device_discovered: Device\n default_device_changed: {device?: Device}\n glasses_not_ready: GlassesNotReadyEvent\n button_press: ButtonPressEvent\n touch_event: TouchEvent\n accel_event: AccelEvent\n head_up: HeadUpEvent\n voice_activity_detection_status: VoiceActivityDetectionStatusEvent\n speaking_status: SpeakingStatusEvent\n battery_status: BatteryStatusEvent\n local_transcription: LocalTranscriptionEvent\n wifi_status_change: WifiStatusChangeEvent\n wifi_scan_result: WifiScanResultEvent\n wifi_forget_result: WifiForgetResultEvent\n saved_wifi_networks: SavedWifiNetworksEvent\n hotspot_status_change: HotspotStatusChangeEvent\n hotspot_error: HotspotErrorEvent\n photo_response: PhotoResponseEvent\n photo_status: PhotoStatusEvent\n camera_status: CameraStatusEvent\n video_recording_status: VideoRecordingStatusEvent\n media_success: MediaUploadSuccessEvent\n media_error: MediaUploadErrorEvent\n gallery_status: GalleryStatusEvent\n compatible_glasses_search_stop: CompatibleGlassesSearchStopEvent\n swipe_volume_status: SwipeVolumeStatusEvent\n switch_status: SwitchStatusEvent\n rgb_led_control_response: RgbLedControlResponseEvent\n settings_ack: SettingsAckEvent\n pair_failure: PairFailureEvent\n pairing_info: PairingInfoEvent\n entering_pairing_mode: EnteringPairingModeEvent\n owner_replaced: OwnerReplacedEvent\n audio_pairing_needed: AudioPairingNeededEvent\n audio_connected: AudioConnectedEvent\n audio_disconnected: AudioDisconnectedEvent\n mic_pcm: MicPcmEvent\n mic_lc3: MicLc3Event\n mic_health: MicHealthEvent\n stream_status: StreamStatusEvent\n /** Mentra Live MTK updater completed and the glasses are about to restart. */\n mtk_update_complete: MtkUpdateCompleteEvent\n /** The ASG process restarted while the BES kept the BLE connection alive. */\n glasses_session_changed: GlassesSessionChangedEvent\n ota_start_ack: OtaStartAckEvent\n ota_status: OtaStatusEvent\n ar99_ota_status: Ar99OtaStatusEvent\n version_info: VersionInfoEvent\n extraction_progress: ExtractionProgressEvent\n}\n\nexport type BluetoothSdkEventName = keyof BluetoothSdkEventMap\n\nexport type BluetoothSdkEventListener<EventName extends BluetoothSdkEventName> = (\n event: BluetoothSdkEventMap[EventName],\n) => void\n\nexport type BluetoothSdkSubscription = {\n remove(): void\n}\n\nexport type BluetoothSdkEvent = BluetoothSdkEventMap[BluetoothSdkEventName]\n\nexport interface BluetoothSdkPublicModule {\n configureNativeNotifications(config: NativeNotificationConfig): Promise<void>\n getNativeNotificationStatus(): Promise<NativeNotificationStatus>\n addListener<EventName extends BluetoothSdkEventName>(\n eventName: EventName,\n listener: BluetoothSdkEventListener<EventName>,\n ): BluetoothSdkSubscription\n\n /** Read an immutable snapshot of the current glasses state. */\n getGlassesStatus(): Promise<PublicGlassesStatus>\n /** Read an immutable snapshot of the phone Bluetooth adapter state. */\n getBluetoothStatus(): Promise<PublicBluetoothStatus>\n /** Observe immutable glasses-state patches. Returns an unsubscribe function. */\n subscribeGlassesStatus(listener: (changed: Partial<PublicGlassesStatus>) => void): () => void\n /** Observe immutable Bluetooth-state patches. Returns an unsubscribe function. */\n subscribeBluetoothStatus(listener: (changed: Partial<PublicBluetoothStatus>) => void): () => void\n\n getDefaultDevice(): Promise<Device | null>\n setDefaultDevice(device: Device | null): Promise<void>\n clearDefaultDevice(): Promise<void>\n\n startScan(model: DeviceModel): Promise<void>\n stopScan(): Promise<void>\n scan(options: ScanOptions): Promise<Device[]>\n scan(model: DeviceModel, options?: ScanModelOptions): Promise<Device[]>\n connect(device: Device, options?: ConnectOptions): Promise<void>\n connectDefault(options?: ConnectOptions): Promise<void>\n cancelConnectionAttempt(): Promise<void>\n disconnect(): Promise<void>\n forget(): Promise<void>\n\n displayText(text: string, x?: number, y?: number, size?: number): Promise<void>\n clearDisplay(): Promise<void>\n /** Set session-only content below the dashboard status header. Pass an empty string to reset it. */\n setDashboardContent(content: string): Promise<void>\n showDashboard(): Promise<void>\n setDashboardPosition(height: number, depth: number): Promise<void>\n setHeadUpAngle(angleDegrees: number): Promise<void>\n setImuEnabled(enabled: boolean): Promise<void>\n setScreenDisabled(disabled: boolean): Promise<void>\n /** Keep legacy Mentra Live OTA sessions awake. Modern sessions normally do not require this. */\n ping(): Promise<void>\n\n requestWifiScan(): Promise<WifiSearchResult[]>\n /** List exact WiFi SSIDs from glasses that support reliable saved-network enumeration. */\n getSavedWifiNetworks(): Promise<SavedWifiNetworksResult>\n sendWifiCredentials(ssid: string, password: string): Promise<WifiStatusChangeEvent>\n /** Forget a saved network and return its correlated semantic outcome. */\n forgetWifiNetwork(ssid: string): Promise<WifiForgetResult>\n setHotspotState(enabled: boolean): Promise<HotspotStatusChangeEvent>\n /** Set the glasses clock from the phone after an OTA clock-skew failure. */\n setSystemTime(timestampMs: number): Promise<void>\n /** Enable or disable Wi-Fi ADB on Mentra Live (no-op on other devices). */\n setWifiAdbState(enabled: boolean): Promise<void>\n\n setGalleryModeEnabled(enabled: boolean): Promise<SettingsAckSuccessEvent>\n setVoiceActivityDetectionEnabled(enabled: boolean): Promise<void>\n setLoudnessGateEnabled(enabled: boolean): Promise<void>\n /**\n * @deprecated Sticky action-button photo presets are deprecated. Prefer per-request\n * `requestPhoto(...)` options (e.g. `mode: \"text\"` for text sensor size/crop, or explicit per-shot\n * fields). Still functional until removed in a future release.\n */\n setPhotoCaptureDefaults(settings: PhotoCaptureDefaults): Promise<SettingsAckSuccessEvent>\n setVideoRecordingDefaults(settings: VideoRecordingDefaults): Promise<SettingsAckSuccessEvent>\n setMaxVideoRecordingDuration(minutes: number): Promise<SettingsAckSuccessEvent>\n setCameraFov(request: CameraFovRequest): Promise<CameraFovResult>\n /** One-way FOV command for legacy ASG clients that do not send settings acknowledgements. */\n setLegacyCameraFov(request: CameraFovRequest): Promise<CameraFovResult>\n setCameraFovOverride(request: CameraFovOverrideRequest): Promise<CameraFovResult>\n releaseCameraFovOverride(leaseId: string): Promise<SettingsAckSuccessEvent>\n /**\n * Configure camera HAL tuning (ANR / gain) on Mentra Live glasses.\n *\n * The phone sends a {@code camera_tuning_config} BLE command; the glasses relay it as a\n * {@code camconfig} broadcast to the camera HAL so parameters take effect without a reboot.\n *\n * **Scan-mode convention**: call with `(false, false)` when activating scan mode to disable ANR\n * and pixsmart gain for sharper text/barcode captures. Call with `(true, true)` to restore\n * defaults when exiting scan mode.\n *\n * @param anrOn `true` = ANR enabled (default), `false` = ANR disabled\n * @param gainOn `true` = stock gain params (default), `false` = pixsmart gain-off params\n */\n setCameraTuningConfig(anrOn: boolean, gainOn: boolean): Promise<SettingsAckSuccessEvent>\n queryGalleryStatus(): Promise<GalleryStatusEvent>\n requestPhoto(params: PhotoRequestParams): Promise<PhotoSuccessResponseEvent>\n warmUpCamera(params: WarmUpCameraParams): Promise<CameraStatusEvent>\n /** Release one request-owned warm-up. Opening requests reject with camera_warm_up_cancelled. */\n stopCameraWarmUp(requestId: string): Promise<void>\n startVideoRecording(\n requestId: string,\n save: boolean,\n sound: boolean,\n settings?: VideoRecordingSettings,\n ): Promise<VideoRecordingStartedStatusEvent>\n /**\n * Stop the active recording. When {@link webhookUrl} is provided, the glasses\n * upload the recorded video to it (multipart) using {@link authToken}. These\n * are supplied at stop time (not start) so the token is fresh when the upload\n * runs 闂?a recording can last arbitrarily long. An empty/omitted webhook keeps\n * the video on device (no upload).\n */\n stopVideoRecording(\n requestId: string,\n webhookUrl?: string,\n authToken?: string,\n ): Promise<VideoRecordingStoppedStatusEvent>\n /** Query the glasses for the current recording state and elapsed duration. */\n queryVideoRecordingStatus(requestId: string): Promise<VideoRecordingStatusEvent>\n\n startStream(params: StreamStartRequest): Promise<StreamStatusEvent>\n stopStream(): Promise<StreamStatusEvent>\n\n setMicState(enabled: boolean, useGlassesMic?: boolean, sendTranscript?: boolean, sendLc3Data?: boolean): Promise<void>\n setPreferredMic(preferredMic: MicPreference): Promise<void>\n setOwnAppAudioPlaying(playing: boolean): Promise<void>\n getGlassesMediaVolume(): Promise<GlassesMediaVolumeGetResult>\n setGlassesMediaVolume(level: number): Promise<GlassesMediaVolumeSetResult>\n\n rgbLedControl(\n requestId: string,\n packageName: string | null,\n action: RgbLedAction,\n color: RgbLedColor | null,\n onDurationMs: number,\n offDurationMs: number,\n count: number,\n ): Promise<RgbLedControlSuccessResponseEvent>\n\n requestVersionInfo(): Promise<VersionInfoResult>\n /**\n * Select the OTA manifest used by subsequent update checks and installs.\n * The URL may point at Mentra's hosted manifest or any customer-controlled HTTP(S) server.\n */\n setOtaVersionUrl(otaVersionUrl: string): void\n /** Return the configured or release-embedded OTA manifest URL. Rejects when a source build is unconfigured. */\n getOtaVersionUrl(): string\n /** Fetch the configured OTA manifest and return whether any ASG/BES/MTK update is available. */\n checkForOtaUpdate(): Promise<boolean>\n /** Return bundled release changelogs crossed between two coordinated product versions, newest first. */\n getReleaseChangelogs(fromVersion?: string | null, toVersion?: string | null): ReleaseChangelog[]\n /** Start OTA from the configured or explicitly supplied manifest URL. */\n startOtaUpdate(otaVersionUrl?: string | null): Promise<OtaStartAckEvent>\n /** Query the active OTA session and return the correlated status response. */\n queryOtaStatus(): Promise<OtaQueryResult>\n startAr99OtaFromFile(path: string): Promise<boolean>\n cancelAr99Ota(): Promise<void>\n sendAr99FactoryReset(): Promise<void>\n buildAr99OtaSignature(\n secret: string,\n appName: string,\n currentVersion: string,\n serialNumber: string,\n nonce: string,\n ): string\n\n // // stt commands (MOVE TO CRUST)\n // setSttModelDetails(path: string, languageCode: string): Promise<void>\n // getSttModelPath(): Promise<string>\n // checkSttModelAvailable(): Promise<boolean>\n // validateSttModel(path: string): Promise<boolean>\n // extractTarBz2(sourcePath: string, destinationPath: string): Promise<boolean>\n\n // // tts commands (MOVE TO CRUST)\n // setTtsModelDetails(path: string, languageCode: string): Promise<void>\n // getTtsModelPath(): Promise<string>\n // getTtsModelLanguage(): Promise<string>\n // checkTtsModelAvailable(): Promise<boolean>\n // validateTtsModel(path: string): Promise<boolean>\n // generateTtsAudio(text: string, path: string, outputPath: string, speakerId: number, speed: number): Promise<boolean>\n\n // STT Commands (TODO: MOVE TO CRUST)\n setSttModelDetails(path: string, languageCode: string): Promise<void>\n getSttModelPath(): Promise<string>\n checkSttModelAvailable(): Promise<boolean>\n validateSttModel(path: string): Promise<boolean>\n extractTarBz2(sourcePath: string, destinationPath: string): Promise<boolean>\n restartTranscriber(): Promise<void>\n\n // TTS Commands (TODO: MOVE TO CRUST)\n setTtsModelDetails(path: string, languageCode: string): Promise<void>\n getTtsModelPath(): Promise<string>\n getTtsModelLanguage(): Promise<string>\n checkTtsModelAvailable(): Promise<boolean>\n validateTtsModel(path: string): Promise<boolean>\n generateTtsAudio(\n text: string,\n modelPath: string,\n outputPath: string,\n speakerId: number,\n speed: number,\n ): Promise<boolean>\n}\n\n// OTA update status types\nexport type OtaStage = \"download\" | \"install\"\nexport type OtaProgressStatus = \"STARTED\" | \"PROGRESS\" | \"FINISHED\" | \"FAILED\"\n\nexport interface OtaStatus {\n sessionId: string\n totalSteps: number\n currentStep: number\n stepType: \"apk\" | \"mtk\" | \"bes\"\n phase: \"download\" | \"install\"\n stepPercent: number\n /** Real bytes received in the current download; independent of rounded percent. */\n bytesDownloaded?: number\n overallPercent: number\n status: \"in_progress\" | \"step_complete\" | \"complete\" | \"failed\" | \"idle\"\n error?: string\n}\n\nexport interface OtaUpdateInfo {\n available: boolean\n versionCode: number\n versionName: string\n updates: string[] // [\"apk\", \"mtk\", \"bes\"]\n totalSize: number\n cacheReady?: boolean\n /** Exact BES target selected from the OTA manifest, when a BES step is pending. */\n besVersion?: string\n /** True when the APK step installs an older build than the glasses currently run (exact-pin manifests only). */\n isDowngrade?: boolean\n}\n\nexport interface ReleaseChangelog {\n /** Base production version, for example `3.1.0`. */\n version: string\n /** Markdown body authored in `/changelogs/<version>.md`. */\n markdown: string\n}\n\nexport interface OtaProgress {\n stage: OtaStage\n status: OtaProgressStatus\n progress: number\n bytesDownloaded: number\n totalBytes: number\n currentUpdate: string\n errorMessage?: string\n}\n\nexport interface GlassesStatus {\n // state:\n connection: GlassesConnectionStatus\n micEnabled: boolean\n voiceActivityDetectionEnabled: boolean\n bluetoothClassicConnected: boolean\n signalStrength: number\n /** Milliseconds since epoch when signalStrength was last refreshed by the phone BLE stack. */\n signalStrengthUpdatedAt: number\n // device info\n deviceModel: string\n androidVersion: string\n firmwareVersion: string\n besFirmwareVersion: string\n mtkFirmwareVersion: string\n bluetoothMacAddress: string\n wifiMacAddress: string\n leftMacAddress: string\n rightMacAddress: string\n buildNumber: string\n /** Glasses System.currentTimeMillis() from last version_info (clock skew detection). */\n systemTimeMs?: number\n otaVersionUrl: string\n appVersion: string\n /**\n * Package the glasses client actually runs as, from `version_info_1`. Empty string on glasses\n * whose client predates the field. `\"com.mentra.asg_client\"` is the stock client; anything else\n * is a sideloaded build (Android forces a distinct package on any build not signed with Mentra's\n * release key) that coexists with the stock app and must not be driven by OTA.\n */\n packageName: string\n /** Phone-served hotspot OTA protocol version; 0 means unsupported/legacy glasses. */\n hotspotOtaVersion: number\n bluetoothName: string\n serialNumber: string\n style: string\n color: string\n // wifi info\n wifi: WifiStatus\n // battery info\n batteryLevel: number\n charging: boolean\n caseBatteryLevel: number\n caseCharging: boolean\n caseOpen: boolean\n caseRemoved: boolean\n // hotspot info\n hotspot: HotspotStatus\n // OTA update info\n otaUpdateAvailable: OtaUpdateInfo | null\n otaProgress: OtaProgress | null\n otaInProgress: boolean\n // ring info\n controllerConnected: boolean\n controllerFullyBooted: boolean\n controllerMacAddress: string\n controllerBatteryLevel: number\n controllerSignalStrength: number\n}\n\nexport interface CoreDashboardMenuItem {\n name: string\n packageName: string\n running: boolean\n}\n\nexport interface CalendarEvent {\n title: string\n location?: string\n time: string\n endDate: number\n}\n\nexport interface CoreSettings {\n menu_apps: CoreDashboardMenuItem[]\n calendar_events: CalendarEvent[]\n}\n\nexport interface Device {\n /**\n * Stable app-facing key for this scan result, within the limits of the\n * platform identifier available to the SDK. Do not parse this value; use the\n * typed model, name, address, projectName, and rssi fields instead.\n */\n id: string\n model: DeviceModel\n name: string\n /** Platform address/identifier when available: Android Bluetooth address, iOS CoreBluetooth identifier. */\n address?: string\n /** Optional AR99 project discriminator. Supported value: AR99. */\n projectName?: string\n /**\n * Optional scan signal strength. It may be undefined at first discovery and\n * appear in a later scan update when the platform reports RSSI metadata.\n */\n rssi?: number\n /** Mentra Live: unit is currently in pairing mode (adv flag). */\n pairingMode?: boolean\n /** Mentra Live: four-character hex spoken pairing code when available. */\n pairingCode?: string\n /** Mentra Live: advertisement carries the secure-pairing capability trailer. */\n securePairingCapable?: boolean\n}\n\nexport interface ConnectOptions {\n saveAsDefault?: boolean\n cancelExistingConnectionAttempt?: boolean\n /**\n * iOS Mentra Live only. When true, CoreBluetooth requires ANCS authorization\n * as part of the connection. Set false when the app does not use notification\n * relay and must avoid the system ANCS authorization flow. Defaults to true.\n * Android accepts this option as a no-op.\n */\n requiresAncs?: boolean\n}\n\nexport type ScanResultsCallback = (devices: Device[]) => void\n\n/** Advisory for an empty scan. System connection state does not identify an owning app. */\nexport interface ScanDiagnostic {\n code: string\n message: string\n}\n\nexport interface ScanOptions {\n model: DeviceModel\n /** Defaults to 15000. */\n timeoutMs?: number\n /** Alias for `timeoutMs`, useful when mirroring native examples. */\n timeout?: number\n /** Called every time the discovered device list changes during the scan. */\n onResults?: ScanResultsCallback\n /** Optional non-fatal hint before an empty scan resolves, on Android and iOS. */\n onDiagnostic?: (diagnostic: ScanDiagnostic) => void\n}\n\nexport type ScanModelOptions = Omit<ScanOptions, \"model\">\n\nexport interface WifiSearchResult {\n ssid: string\n requiresPassword: boolean\n signalStrength: number\n /** Frequency in MHz (from glasses scan). 5 GHz band is typically 5170闂?825. Omitted if unknown. */\n frequency?: number\n}\n\nexport interface BluetoothStatus {\n // state:\n searching: boolean\n searchingController: boolean\n default_wearable?: DeviceModel | \"\"\n pending_wearable?: DeviceModel | \"\"\n device_name?: string\n device_address?: string\n default_controller?: DeviceModel | \"\"\n pending_controller?: DeviceModel | \"\"\n controller_device_name?: string\n controller_address?: string\n systemMicUnavailable: boolean\n micRanking: MicMode[]\n currentMic: MicMode | \"\" | null\n /**\n * Nearby glasses in stable discovery order.\n * Existing entries keep their array position as details refresh; new glasses append at the end,\n * and removals should not reorder remaining entries.\n */\n searchResults: Device[]\n wifiScanResults: WifiSearchResult[]\n lastLog: string[]\n otherBtConnected: boolean\n // desired settings the SDK sends to compatible connected glasses:\n galleryModeEnabled: boolean\n}\n\nexport type BluetoothSettingsUpdate = Partial<{\n auth_email: string\n core_token: string\n sensing_enabled: boolean\n power_saving_mode: boolean\n lc3_frame_size: number\n preferred_mic: MicPreference\n screen_disabled: boolean\n contextual_dashboard: boolean\n head_up_angle: number\n imu_enabled: boolean\n brightness: number\n auto_brightness: boolean\n dashboard_height: number\n dashboard_depth: number\n menu_apps: DashboardMenuItem[] | CoreDashboardMenuItem[] | Array<Record<string, unknown>> | null\n calendar_events: CalendarEvent[]\n metric_system: boolean\n twelve_hour_time: boolean\n gallery_mode: boolean\n voice_activity_detection_enabled: boolean\n loudness_gate_enabled: boolean\n button_photo_size: ButtonPhotoSize\n button_video_settings: {width: number; height: number; fps: number}\n button_video_width: number\n button_video_height: number\n button_video_fps: number\n button_max_recording_time: number\n camera_fov: NativeCameraFovSetting\n should_send_pcm: boolean\n should_send_lc3: boolean\n should_send_transcript: boolean\n offline_mode: boolean\n local_stt_fallback_active: boolean\n pending_wearable: DeviceModel | \"\"\n default_wearable: DeviceModel | \"\"\n device_name: string\n device_address: string\n default_controller: DeviceModel | \"\"\n pending_controller: DeviceModel | \"\"\n controller_device_name: string\n controller_address: string\n}>\n"]}
1
+ {"version":3,"file":"BluetoothSdk.types.js","sourceRoot":"","sources":["../src/BluetoothSdk.types.ts"],"names":[],"mappings":"AA2CA,MAAM,CAAC,MAAM,wCAAwC,GAAG,KAAK,CAAA;AAwB7D,MAAM,UAAU,kCAAkC,CAChD,MAA+B;IAE/B,OAAO,MAAM,CAAC,KAAK,KAAK,WAAW,CAAA;AACrC,CAAC;AAED,MAAM,UAAU,8BAA8B,CAAC,MAA+B;IAC5E,OAAO,MAAM,CAAC,KAAK,KAAK,WAAW,IAAI,MAAM,CAAC,WAAW,CAAA;AAC3D,CAAC;AAED,MAAM,UAAU,6BAA6B,CAAC,MAA+B;IAC3E,OAAO,MAAM,CAAC,KAAK,KAAK,UAAU,IAAI,MAAM,CAAC,KAAK,KAAK,YAAY,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS,CAAA;AACnG,CAAC;AAED,MAAM,UAAU,+BAA+B;IAC7C,OAAO;QACL,UAAU,EAAE,EAAC,KAAK,EAAE,cAAc,EAAC;QACnC,OAAO,EAAE,EAAC,KAAK,EAAE,UAAU,EAAC;QAC5B,6BAA6B,EAAE,wCAAwC;QACvE,IAAI,EAAE,EAAC,KAAK,EAAE,cAAc,EAAC;KAC9B,CAAA;AACH,CAAC;AA2BD,MAAM,UAAU,qBAAqB,CAAC,MAAkB;IACtD,OAAO,MAAM,CAAC,KAAK,KAAK,WAAW,CAAA;AACrC,CAAC;AAkFD,MAAM,UAAU,sBAAsB,CAAC,MAAqB;IAC1D,OAAO,MAAM,CAAC,KAAK,KAAK,SAAS,CAAA;AACnC,CAAC;AAwYD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,SAAS,EAAE,mBAAmB;IAC9B,EAAE,EAAE,mBAAmB;IACvB,EAAE,EAAE,mBAAmB;IACvB,UAAU,EAAE,aAAa;IACzB,SAAS,EAAE,gBAAgB;IAC3B,KAAK,EAAE,cAAc;IACrB,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,iBAAiB;IACxB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,EAAE,EAAE,mBAAmB;CACf,CAAA;AAWV,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAA;AAChC,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;AACjC,MAAM,CAAC,MAAM,kBAAkB,GAAG,cAAc,CAAA","sourcesContent":["import type {PhotoCompression} from \"@mentra/cloud-protocol/photo-compression\"\nexport type {PhotoCompression} from \"@mentra/cloud-protocol/photo-compression\"\n\n// Bluetooth SDK Event Types\nexport type GlassesNotReadyEvent = {\n type: \"glasses_not_ready\"\n message: string\n}\n\n// NOTE: unlike most events below, the native module does NOT include a `type`\n// field on the button_press payload 闂?it sends only {buttonId, pressType,\n// timestamp} (see BluetoothSdkModule on both iOS and Android). Consumers must\n// filter on `pressType` / the \"button_press\" listener name, never `event.type`.\nexport type ButtonPressEvent = {\n buttonId: string\n pressType: \"long\" | \"short\"\n timestamp: number\n}\n\nexport type TouchEvent = {\n type: \"touch_event\"\n deviceModel: DeviceModel\n gestureName: string\n timestamp: number\n}\n\nexport type AccelEvent = {\n type: \"accel_event\"\n x: number\n y: number\n z: number\n timestamp: number\n}\n\nexport type HeadUpEvent = {\n up: boolean\n}\n\nexport type VoiceActivityDetectionStatusEvent = {\n type: \"voice_activity_detection_status\"\n voiceActivityDetectionEnabled: boolean\n}\n\nexport const DEFAULT_VOICE_ACTIVITY_DETECTION_ENABLED = false\n\nexport type SpeakingStatusEvent = {\n type: \"speaking_status\"\n speaking: boolean\n timestamp: number\n}\n\nexport type BatteryStatusEvent = {\n type: \"battery_status\"\n level: number\n charging: boolean\n timestamp: number\n}\n\nexport type GlassesConnectionStatus =\n | {state: \"disconnected\"}\n | {state: \"scanning\"}\n | {state: \"connecting\"}\n | {state: \"bonding\"}\n | {state: \"connected\"; fullyBooted: boolean}\n\nexport type ConnectedGlassesConnectionStatus = Extract<GlassesConnectionStatus, {state: \"connected\"}>\n\nexport function isConnectedGlassesConnectionStatus(\n status: GlassesConnectionStatus,\n): status is ConnectedGlassesConnectionStatus {\n return status.state === \"connected\"\n}\n\nexport function isReadyGlassesConnectionStatus(status: GlassesConnectionStatus): boolean {\n return status.state === \"connected\" && status.fullyBooted\n}\n\nexport function isBusyGlassesConnectionStatus(status: GlassesConnectionStatus): boolean {\n return status.state === \"scanning\" || status.state === \"connecting\" || status.state === \"bonding\"\n}\n\nexport function createDisconnectedGlassesStatus(): Partial<GlassesStatus> {\n return {\n connection: {state: \"disconnected\"},\n hotspot: {state: \"disabled\"},\n voiceActivityDetectionEnabled: DEFAULT_VOICE_ACTIVITY_DETECTION_ENABLED,\n wifi: {state: \"disconnected\"},\n }\n}\n\n/** K900 `sr_getvol` response (Mentra Live glasses media step volume 0闂?5). */\nexport type GlassesMediaVolumeGetResult = {\n level: number\n statusCode: number\n}\n\n/** K900 `sr_vol` acknowledgment. */\nexport type GlassesMediaVolumeSetResult = {\n statusCode: number\n}\n\nexport type LocalTranscriptionEvent = {\n text: string\n isFinal?: boolean\n transcribeLanguage?: string\n}\n\nexport type LogEvent = {\n message: string\n}\n\nexport type WifiStatus = {state: \"disconnected\"} | {state: \"connected\"; ssid: string; localIp?: string}\n\nexport type ConnectedWifiStatus = Extract<WifiStatus, {state: \"connected\"}>\n\nexport function isConnectedWifiStatus(status: WifiStatus): status is ConnectedWifiStatus {\n return status.state === \"connected\"\n}\n\nexport type WifiStatusChangeEvent = WifiStatus & {\n type: \"wifi_status_change\"\n /**\n * Glasses-reported provisioning failure reason when THIS event is the verdict of a\n * failed connect attempt; absent on routine link-state updates. An attempt property,\n * not a link property 闂?which is why it lives on the event, not on WifiStatus:\n * \"connect_timeout\" arrives on a disconnected status (never associated), while\n * \"connected_to_other_network\" arrives on a *connected* status (the attempt failed\n * and the glasses ended up on / fell back to a different SSID than requested).\n * Requires ASG client v40+ 闂?older glasses never send it.\n */\n error?: string\n}\n\nexport type WifiForgetOutcome =\n | \"confirmed\"\n | \"dispatched\"\n | \"not_found\"\n | \"unsupported\"\n | \"failed\"\n | \"legacy_unverified\"\n\nexport type WifiForgetResult = {\n ssid: string\n outcome: WifiForgetOutcome\n connected?: boolean\n currentSsid?: string\n localIp?: string\n error?: string\n}\n\nexport type ModernWifiForgetResultEvent = {\n type: \"wifi_forget_result\"\n mode: \"modern\"\n requestId: string\n sid: string\n ssid: string\n protocolVersion: number\n outcome: Exclude<WifiForgetOutcome, \"legacy_unverified\">\n connected?: boolean\n currentSsid?: string\n localIp?: string\n error?: string\n}\n\nexport type LegacyWifiForgetResultEvent = {\n type: \"wifi_forget_result\"\n mode: \"legacy\"\n ssid: string\n dispatched: boolean\n connected?: boolean\n currentSsid?: string\n localIp?: string\n error?: string\n}\n\nexport type WifiForgetResultEvent = ModernWifiForgetResultEvent | LegacyWifiForgetResultEvent\n\nexport type SavedWifiNetworksOutcome = \"confirmed\" | \"unsupported\" | \"failed\"\n\nexport type SavedWifiNetworksResult = {\n outcome: SavedWifiNetworksOutcome\n networks: string[]\n error?: string\n}\n\nexport type SavedWifiNetworksEvent = {\n type: \"saved_wifi_networks\"\n requestId: string\n sid: string\n protocolVersion: number\n outcome: SavedWifiNetworksOutcome\n networks: string[]\n error?: string\n}\n\nexport type HotspotStatus = {state: \"disabled\"} | {state: \"enabled\"; ssid: string; password: string; localIp: string}\n\nexport type EnabledHotspotStatus = Extract<HotspotStatus, {state: \"enabled\"}>\n\nexport function isEnabledHotspotStatus(status: HotspotStatus): status is EnabledHotspotStatus {\n return status.state === \"enabled\"\n}\n\nexport type HotspotStatusChangeEvent = HotspotStatus & {\n type: \"hotspot_status_change\"\n}\n\nexport type HotspotErrorEvent = {\n type: \"hotspot_error\"\n errorMessage: string\n timestamp: number\n}\n\nexport type VersionInfoResult = {\n versionInfoType?: string\n sid?: string\n androidVersion: string\n firmwareVersion: string\n besFirmwareVersion: string\n mtkFirmwareVersion: string\n buildNumber: string\n systemTimeMs?: number\n otaVersionUrl: string\n appVersion: string\n /**\n * Package the glasses client actually runs as, from `version_info_1`.\n * `\"com.mentra.asg_client\"` is the stock client; anything else is a sideloaded build (Android\n * forces a distinct package on any build not signed with Mentra's release key) that coexists\n * with the stock app and must not be driven by OTA.\n *\n * Omitted — not empty — whenever this result carries no identity: either the glasses predate\n * the field, or the response resolved from a `version_info` chunk that does not carry it (only\n * chunk 1 does). Omission is what keeps a response from overwriting an identity an earlier\n * chunk established, so treat `undefined` as \"unknown\", never as \"stock\".\n */\n packageName?: string\n /** Phone-served hotspot OTA protocol version; 0 means unsupported/legacy glasses. */\n hotspotOtaVersion: number\n /** Session-correlated WiFi forget result protocol; absent/0 means unsupported. */\n wifiForgetResultVersion?: number\n /** Session-correlated saved-network listing protocol; absent/0 means unsupported. */\n savedWifiNetworksVersion?: number\n}\n\nexport type VersionInfoEvent = VersionInfoResult & {\n type: \"version_info\"\n}\n\nexport type WifiScanResultEvent = {\n type: \"wifi_scan_result\"\n networks: WifiSearchResult[]\n scanComplete?: boolean\n}\n\nexport type PhotoResponseEvent =\n | {\n type: \"photo_response\"\n state: \"success\"\n requestId: string\n uploadUrl: string\n photoUrl?: string\n statusUrl?: string\n contentType?: string\n fileSizeBytes?: number\n timestamp: number\n }\n | {\n type: \"photo_response\"\n state: \"error\"\n requestId: string\n timestamp: number\n errorCode?: string\n errorMessage: string\n }\n\nexport type PhotoSuccessResponseEvent = Extract<PhotoResponseEvent, {state: \"success\"}>\n\nexport type PhotoStatusState =\n | \"accepted\"\n | \"queued\"\n | \"configuring\"\n | \"capturing\"\n | \"captured\"\n | \"compressing\"\n | \"ble_fallback_compression\"\n | \"uploading\"\n | \"uploaded\"\n | \"ready_for_transfer\"\n | \"transferring\"\n | \"thumbnail_received\"\n | \"failed\"\n\nexport type PhotoResolvedConfig = {\n format?: \"jpeg\" | string\n width?: number\n height?: number\n quality?: number\n requestedSize?: PhotoSize | string\n source?: \"sdk\" | \"button\" | string\n transferMethod?: \"webhook\" | \"ble\" | \"local\" | string\n compression?: PhotoCompression\n saveToGallery?: boolean\n exposureTimeNs?: number\n iso?: number\n}\n\nexport type PhotoFpsRange = {\n min?: number\n max?: number\n}\n\nexport type PhotoRequestedCaptureConfig = {\n manual?: boolean\n exposureTimeNs?: number\n iso?: number\n frameDurationNs?: number\n aeMode?: number\n aeLock?: boolean\n aeExposureCompensation?: number\n aeTargetFpsRange?: PhotoFpsRange\n noiseReductionMode?: number\n edgeMode?: number\n afMode?: number\n zsl?: boolean\n}\n\nexport type PhotoMeteredPreview = {\n exposureTimeNs?: number\n iso?: number\n totalLightProxy?: number\n}\n\nexport type PhotoCaptureMetadata = {\n manual?: boolean\n exposureTimeNs?: number\n iso?: number\n frameDurationNs?: number\n aeMode?: number\n aeState?: number\n aeStateName?: string\n noiseReductionMode?: number\n edgeMode?: number\n zsl?: boolean\n sensorTimestampNs?: number\n totalLightProxy?: number\n mfnrLikely?: boolean\n mfnrApplied?: boolean\n width?: number\n height?: number\n noiseReductionWarning?: \"not_implemented\" | string\n ispDigitalGainWarning?: \"not_implemented\" | string\n ispAnalogGainWarning?: \"not_implemented\" | string\n [key: string]: unknown\n}\n\nexport type PhotoStatusEvent = {\n type: \"photo_status\"\n requestId: string\n status: PhotoStatusState | string\n timestamp: number\n resolvedConfig?: PhotoResolvedConfig\n requestedCaptureConfig?: PhotoRequestedCaptureConfig\n meteredPreview?: PhotoMeteredPreview\n captureMetadata?: PhotoCaptureMetadata\n errorCode?: string\n errorMessage?: string\n /** Present on thumbnail_received: a JPEG data URI, not the final photo. */\n thumbnailUrl?: string\n fileSizeBytes?: number\n}\n\nexport type CameraStatusEvent = {\n type: \"camera_status\"\n requestId: string\n state: \"warming\" | \"ready\" | \"stopped\" | \"error\" | string\n timestamp: number\n errorCode?: string\n errorMessage?: string\n}\n\nexport type VideoRecordingStatusEvent = {\n type: \"video_recording_status\"\n requestId?: string\n success: boolean\n status: VideoRecordingStatusState\n details?: string | null\n timestamp: number\n data?: {\n recording?: boolean\n duration_ms?: number\n duration_formatted?: string\n [key: string]: unknown\n }\n}\n\nexport type VideoRecordingStatusState =\n | \"recording_started\"\n | \"recording_status\"\n | \"already_recording\"\n | \"recording_stopped\"\n | \"not_recording\"\n | \"request_id_mismatch\"\n | \"service_unavailable\"\n | \"json_error\"\n | \"battery_low\"\n | \"camera_busy\"\n | \"storage_unavailable\"\n | \"integrity_failed\"\n | \"error\"\n\nexport type VideoRecordingStartedStatusEvent = Omit<VideoRecordingStatusEvent, \"success\" | \"status\"> & {\n success: true\n status: \"recording_started\"\n}\n\nexport type VideoRecordingStoppedStatusEvent = Omit<VideoRecordingStatusEvent, \"success\" | \"status\"> & {\n success: true\n status: \"recording_stopped\"\n}\n\nexport type VideoRecordingSuccessStatusEvent = VideoRecordingStartedStatusEvent | VideoRecordingStoppedStatusEvent\n\nexport type MediaUploadSuccessEvent = {\n type: \"media_success\"\n requestId: string\n mediaUrl: string\n mediaType: number\n timestamp: number\n}\n\nexport type MediaUploadErrorEvent = {\n type: \"media_error\"\n requestId: string\n errorMessage: string\n mediaType: number\n timestamp: number\n}\n\nexport type MediaUploadEvent = MediaUploadSuccessEvent | MediaUploadErrorEvent\n\nexport type GalleryStatusEvent = {\n type: \"gallery_status\"\n photos: number\n videos: number\n total: number\n totalSize?: number\n hasContent: boolean\n cameraBusy: boolean\n cameraBusyReason?: \"video\" | \"stream\" | (string & {})\n}\n\nexport type CompatibleGlassesSearchStopEvent = {\n type: \"compatible_glasses_search_stop\"\n deviceModel: DeviceModel\n}\n\nexport type HeartbeatSentEvent = {\n type: \"heartbeat_sent\"\n heartbeat_sent: {\n timestamp: number\n }\n}\n\nexport type HeartbeatReceivedEvent = {\n type: \"heartbeat_received\"\n heartbeat_received: {\n timestamp: number\n }\n}\n\nexport type SwipeVolumeStatusEvent = {\n type: \"swipe_volume_status\"\n enabled: boolean\n timestamp: number\n}\n\nexport type SwitchStatusEvent = {\n type: \"switch_status\"\n switchType?: number\n switchValue?: number\n timestamp: number\n}\n\nexport type RgbLedControlResponseEvent =\n | {\n type: \"rgb_led_control_response\"\n state: \"success\"\n requestId: string\n }\n | {\n type: \"rgb_led_control_response\"\n state: \"error\"\n requestId: string\n errorCode: string\n }\n\nexport type RgbLedControlSuccessResponseEvent = Extract<RgbLedControlResponseEvent, {state: \"success\"}>\n\nexport type SettingsAckStatus = \"applied\" | \"ready\" | \"error\" | \"failed\" | \"failure\" | \"rejected\"\n\nexport type SettingsAckSetting =\n | \"gallery_mode\"\n | \"button_photo\"\n | \"button_video_recording\"\n | \"button_max_recording_time\"\n | \"camera_fov\"\n | \"camera_fov_override\"\n | \"camera_tuning\"\n\nexport type SettingsAckEvent = {\n type: \"settings_ack\"\n requestId: string\n setting: SettingsAckSetting\n status: SettingsAckStatus\n timestamp: number\n fov?: number\n roiPosition?: CameraRoiPositionValue\n hardwareApplied?: boolean\n leaseId?: string\n active?: boolean\n size?: ButtonPhotoSize | string\n width?: number\n height?: number\n fps?: number\n enabled?: boolean\n minutes?: number\n /** ANR enabled flag; present when setting === \"camera_tuning\" */\n anr?: boolean\n /** Stock-gain flag; present when setting === \"camera_tuning\" */\n gain?: boolean\n errorCode?: string\n errorMessage?: string\n}\n\nexport type SettingsAckSuccessStatus = Exclude<SettingsAckStatus, \"error\" | \"failed\" | \"failure\" | \"rejected\">\n\nexport type SettingsAckSuccessEvent = Omit<SettingsAckEvent, \"status\"> & {\n status: SettingsAckSuccessStatus\n}\n\nexport type RgbLedAction = \"on\" | \"off\"\nexport type RgbLedColor = \"red\" | \"green\" | \"blue\" | \"orange\" | \"white\"\nexport type PhotoSize = \"low\" | \"medium\" | \"high\" | \"max\"\nexport type PhotoMode = \"photo\" | \"text\"\nexport type PhotoTransferMethod = \"auto\" | \"direct\" | \"ble\"\nexport type ButtonPhotoSize = \"low\" | \"medium\" | \"high\" | \"max\"\n\n/**\n * @deprecated Sticky action-button photo presets via {@link BluetoothSdkPublicModule.setPhotoCaptureDefaults}\n * are deprecated. Prefer per-request {@link BluetoothSdkPublicModule.requestPhoto} options\n * (e.g. `mode: \"text\"` for text sensor size/crop, or explicit `aeExposureDivisor`) instead of\n * persisting button-photo tuning on the glasses.\n */\nexport type PhotoCaptureDefaults = {\n size?: PhotoSize\n /** ZSL preview buffering for physical camera-button photos. */\n zsl?: boolean\n /** MFNR still capture for physical camera-button photos. */\n mfnr?: boolean\n noiseReduction?: boolean\n edgeEnhancement?: boolean\n ispDigitalGain?: number\n ispAnalogGain?: string\n aeExposureDivisor?: number\n isoCap?: number\n compress?: PhotoCompression\n sound?: boolean\n /** When true, clears stored NR/edge/ISP presets on the glasses before applying other fields. */\n resetCaptureTuning?: boolean\n}\n\nexport type VideoRecordingDefaults = {\n width: number\n height: number\n fps: number\n}\n\n/**\n * Optional per-recording video settings for {@link startVideoRecording}. When\n * omitted, the glasses fall back to their saved video recording defaults. Any\n * field left undefined is omitted from the BLE command (glasses default applies).\n */\nexport interface VideoRecordingSettings {\n width?: number\n height?: number\n fps?: number\n /**\n * Optional auto-stop timer in minutes, sent on `start_video_recording`.\n * `0` (the default) means record until stopped or interrupted\n * (battery/storage/thermal/error).\n */\n maxRecordingTimeMinutes?: number\n}\nexport const DeviceModels = {\n Simulated: \"Simulated Glasses\",\n G1: \"Even Realities G1\",\n G2: \"Even Realities G2\",\n MentraLive: \"Mentra Live\",\n MentraNex: \"Mentra Display\",\n Mach1: \"Mentra Mach1\",\n Z100: \"Vuzix Z100\",\n Frame: \"Brilliant Frame\",\n Nimo: \"NIMO\",\n Ar99: \"AR99\",\n R1: \"Even Realities R1\",\n} as const\n\nexport type DeviceModel = (typeof DeviceModels)[keyof typeof DeviceModels]\nexport type ObservableStoreCategory = \"glasses\" | \"bluetooth\" | \"core\"\n\nexport type DashboardMenuItem = {\n title: string\n packageName: string\n values?: Record<string, unknown>\n}\n\nexport const CAMERA_FOV_MIN = 62\nexport const CAMERA_FOV_MAX = 118\nexport const CAMERA_FOV_DEFAULT = CAMERA_FOV_MAX\n\nexport type CameraRoiPosition = \"center\" | \"bottom\" | \"top\"\nexport type CameraRoiPositionValue = 0 | 1 | 2\nexport type CameraFovPreset = \"narrow\" | \"standard\" | \"wide\"\n\nexport type CameraFovRequest =\n | {\n fov: number\n roiPosition?: CameraRoiPosition\n }\n | {\n preset: CameraFovPreset\n }\n\nexport type CameraFovResult = {\n requestId: string\n fov: number\n roiPosition: CameraRoiPosition\n timestamp: number\n}\n\nexport type CameraFovOverrideRequest = CameraFovRequest & {\n /** Phone-owned lease used to make delayed releases safe. */\n leaseId: string\n /** Safety TTL; refresh the same lease/configuration to extend without a HAL restart. */\n ttlMs?: number\n}\n\nexport type CameraFovSetting = {\n fov: number\n roiPosition: CameraRoiPositionValue\n}\n\ntype NativeCameraFovSetting = {\n fov: number\n roi_position: CameraRoiPositionValue\n}\n\nexport type MicPreference = \"auto\" | \"phone\" | \"glasses\" | \"bluetooth\"\nexport type MicMode = \"phone\" | \"glasses\" | \"bluetoothClassic\" | \"bluetooth\"\n\nexport type PhotoRequestParams = {\n /**\n * Send an oriented <=500px, quality-50 JPEG preview before the full photo. Default false.\n * Enables a 110-second end-to-end native deadline (ordinary requests: 30 seconds).\n */\n presend_thumbnail?: boolean\n requestId?: string\n appId?: string\n size: PhotoSize\n mode?: PhotoMode\n /** `direct` disables BLE fallback; `ble` skips direct upload and forces phone-relayed transfer. */\n transferMethod?: PhotoTransferMethod\n webhookUrl: string | null\n authToken: string | null\n compress?: PhotoCompression\n save?: boolean\n sound: boolean\n exposureTimeNs?: number | null\n /** Sensor ISO for this capture only. Only used when exposureTimeNs enables manual exposure. */\n iso?: number | null\n /** After AE convergence, divide metered exposure by this factor (scan mode). */\n aeExposureDivisor?: number\n /** Cap ISO after AE metering (scan mode). */\n isoCap?: number\n /** Requested on wire; glasses may log not_implemented. */\n noiseReduction?: boolean\n edgeEnhancement?: boolean\n /** ZSL buffering. Forced off for manual/scan stills because fixed sensor controls take priority. */\n zsl?: boolean\n /** MFNR still capture. Forced off for manual/scan stills because fixed sensor controls take priority. */\n mfnr?: boolean\n ispDigitalGain?: number\n ispAnalogGain?: string\n}\n\nexport type WarmUpCameraParams = {\n /** Supply this when the owner needs to call stopCameraWarmUp during teardown. */\n requestId?: string\n size: PhotoSize\n mode?: PhotoMode\n exposureTimeNs?: number | null\n /** Ready-state hold; defaults to 15 seconds and is capped at 5 minutes by ASG. */\n durationMs?: number\n /** ZSL preview buffering for the warm-up session. */\n zsl?: boolean\n /** MFNR still capture for the warm-up session. */\n mfnr?: boolean\n}\n\nexport type StreamDegradationPreference = \"MAINTAIN_FRAMERATE\" | \"MAINTAIN_RESOLUTION\" | \"BALANCED\" | \"DISABLED\"\n\nexport type StreamVideoConfig = {\n width?: number\n height?: number\n bitrate?: number\n /** WHIP minimum target in bps; omitted leaves it unset. Clamped to the maximum. */\n minBitrateBps?: number\n /** WHIP startup bitrate in bps, clamped to the requested bounds. */\n initialBitrateBps?: number\n fps?: number\n /** WHIP adaptation policy. Omit to keep the glasses' MAINTAIN_FRAMERATE default. */\n degradationPreference?: StreamDegradationPreference\n}\n\nexport type StreamAudioConfig = {\n bitrate?: number\n sampleRate?: number\n echoCancellation?: boolean\n noiseSuppression?: boolean\n}\n\n/** ICE overrides for a WHIP stream. Ignored by the RTMP and SRT paths. */\nexport type StreamIceConfig = {\n /**\n * STUN server the glasses should use while gathering candidates.\n *\n * Omit to keep the default Cloudflare STUN server. Pass an empty string to force host-only\n * gathering, which is what SoftAP calling needs: the WHIP server runs on the phone across the\n * glasses' own hotspot, so a server-reflexive candidate is meaningless and there is no route to\n * a STUN server anyway. A value that is not a `stun:`/`stuns:` URI is ignored and the default is\n * kept, so a malformed override cannot silently disable ICE.\n */\n stun?: string\n}\n\nexport type StreamStartRequest = {\n type?: \"start_stream\"\n streamUrl: string\n streamId?: string\n sound?: boolean\n video?: StreamVideoConfig\n audio?: StreamAudioConfig\n ice?: StreamIceConfig\n /** When false, glasses skip mic capture. Defaults to true. */\n captureAudio?: boolean\n /**\n * Correlation id echoed by the glasses in every SOFTAP_TRACE log line, so phone and glasses\n * logs can be joined despite having unsynchronised clocks.\n *\n * TEMPORARY: part of the SoftAP diagnostic trace layer.\n */\n traceId?: string\n authToken?: string\n telemetry?: boolean\n}\n\nexport type StreamKeepAliveRequest = {\n type?: \"keep_stream_alive\"\n streamId: string\n ackId: string\n}\n\nexport type PairFailureEvent = {\n type: \"pair_failure\"\n error: string\n}\n\nexport type PairingInfoEvent = {\n had_previous_bond: boolean\n pairing_code?: string\n classic_bond_ready?: boolean\n secure_pairing_capable?: boolean\n protocol_version?: number\n}\n\nexport type EnteringPairingModeEvent = {\n window_ms: number\n reason?: string\n}\n\nexport type OwnerReplacedEvent = {\n reason: string\n}\n\nexport type AudioPairingNeededEvent = {\n type: \"audio_pairing_needed\"\n deviceName: string\n}\n\nexport type AudioConnectedEvent = {\n type: \"audio_connected\"\n deviceName: string\n}\n\nexport type AudioDisconnectedEvent = {\n type: \"audio_disconnected\"\n}\n\nexport type SaveSettingEvent = {\n type: \"save_setting\"\n key: string\n value: any\n}\n\nexport type WsTextEvent = {\n type: \"ws_text\"\n text: string\n}\n\nexport type WsBinEvent = {\n type: \"ws_bin\"\n base64: string\n}\n\nexport type MicPcmEvent = {\n type: \"mic_pcm\"\n pcm: ArrayBuffer\n sampleRate: 16000\n bitsPerSample: 16\n channels: 1\n encoding: \"pcm_s16le\"\n voiceActivityDetectionEnabled: boolean\n /**\n * The microphone this buffer came from (`\"glasses\"`, `\"phone\"`, `\"bluetooth\"`, or `\"\"` when none\n * is selected). Stamped per frame because the SDK can move the source mid-stream, so a consumer\n * that told a remote party which microphone it is sending can check rather than assume.\n */\n source: string\n}\n\nexport type MicLc3Event = {\n type: \"mic_lc3\"\n lc3: ArrayBuffer\n sampleRate: 16000\n channels: 1\n encoding: \"lc3\"\n frameDurationMs: 10\n frameSizeBytes: number\n bitrate: number\n packetizedFromGlasses: boolean\n voiceActivityDetectionEnabled: boolean\n}\n\n/** Native glasses-microphone diagnostics emitted when the SDK detects a transport or decode issue. */\nexport type MicHealthEvent = {\n type: \"mic_health\"\n reason: \"sequence_gap\" | \"decode_failure\"\n sequenceGapEvents: number\n decodeFailures: number\n lastLc3ReceivedAt?: number\n lastPcmProducedAt?: number\n timestamp: number\n}\n\nexport type StreamStatusLifecycleState = \"initializing\" | \"streaming\" | \"stopping\" | \"stopped\"\nexport type StreamStatusReconnectState = \"reconnecting\" | \"reconnected\" | \"reconnect_failed\"\nexport type StreamStatusState = StreamStatusLifecycleState | StreamStatusReconnectState | \"error\"\n\n/** Effective stream settings reported by the glasses after defaults and clamps. */\nexport type StreamResolvedConfig = {\n transport?: \"rtmp\" | \"srt\" | \"whip\"\n video?: {\n /** Encoded output width sent to the stream endpoint. */\n width: number\n /** Encoded output height sent to the stream endpoint. */\n height: number\n /** Native camera buffer width selected before crop/downscale. */\n captureWidth?: number\n /** Native camera buffer height selected before crop/downscale. */\n captureHeight?: number\n /** Encoded video bitrate in bits per second. */\n bitrate: number\n /** Resolved capture/encode frame rate. */\n fps: number\n /** Applied WHIP adaptation policy; absent on older firmware and other transports. */\n degradationPreference?: StreamDegradationPreference\n }\n audio?: {\n /** Encoded audio bitrate in bits per second. */\n bitrate?: number\n /** Audio sample rate in Hz. */\n sampleRate?: number\n echoCancellation?: boolean\n noiseSuppression?: boolean\n }\n}\n\n/** Live encoder and device telemetry emitted periodically by supported glasses firmware. */\nexport type StreamLiveStats = {\n /** Current encoded video bitrate in bits per second. */\n bitrate?: number\n /** Current encode frame rate. */\n fps?: number\n droppedFrames?: number\n /** Seconds since the stream started. */\n duration?: number\n /** Device temperature in 闂佺娅i悡? if the hardware reports it. */\n temperatureC?: number\n}\n\ntype StreamStatusCommon = {\n type: \"stream_status\"\n streamId?: string\n /** ASG process identity and monotonic revision for reconnect reconciliation. */\n sid?: string\n revision?: number\n terminal?: boolean\n errorDetails?: string\n timestamp?: number\n resolvedConfig?: StreamResolvedConfig\n stats?: StreamLiveStats\n}\n\nexport type StreamStatusEvent =\n | (StreamStatusCommon & {\n kind: \"lifecycle\"\n status: StreamStatusLifecycleState\n })\n | (StreamStatusCommon & {\n kind: \"reconnect\"\n status: \"reconnecting\"\n attempt: number\n maxAttempts: number\n reason: string\n })\n | (StreamStatusCommon & {\n kind: \"reconnect\"\n status: \"reconnected\"\n attempt: number\n })\n | (StreamStatusCommon & {\n kind: \"reconnect\"\n status: \"reconnect_failed\"\n maxAttempts: number\n })\n | (StreamStatusCommon & {\n kind: \"error\"\n status: \"error\"\n errorDetails: string\n })\n | (StreamStatusCommon & {\n kind: \"snapshot\"\n status: StreamStatusState\n streaming: boolean\n reconnecting: boolean\n attempt?: number\n })\n\nexport type KeepAliveAckEvent = {\n type: \"keep_alive_ack\"\n streamId: string\n ackId: string\n timestamp?: number\n}\n\nexport type MtkUpdateCompleteEvent = {\n type: \"mtk_update_complete\"\n message: string\n timestamp: number\n}\n\n/**\n * The glasses process restarted while the BES kept the BLE link alive (its `sid`\n * changed, or first appeared after an update from a pre-sid build). There is no\n * physical disconnect for this — treat it as the logical reconnect edge.\n */\nexport type GlassesSessionChangedEvent = {\n type: \"glasses_session_changed\"\n previous_sid: string\n sid: string\n}\n\n/** @deprecated Glasses no longer emit ota_progress; use {@link OtaStatusEvent} and status-store mapping. */\nexport type OtaProgressEvent = {\n type: \"ota_progress\"\n stage?: OtaStage\n status?: OtaProgressStatus\n progress?: number\n bytes_downloaded?: number\n total_bytes?: number\n current_update?: string\n error_message?: string\n}\n\nexport type OtaStartAckEvent = {\n type: \"ota_start_ack\"\n timestamp: number\n}\nexport type OtaStatusEvent = {\n type: \"ota_status\"\n session_id: string\n total_steps: number\n current_step: number\n step_type: \"apk\" | \"mtk\" | \"bes\"\n phase: \"download\" | \"install\"\n step_percent: number\n /** Real bytes received in the current download; absent on older glasses. */\n bytes_downloaded?: number\n overall_percent: number\n status: \"in_progress\" | \"step_complete\" | \"complete\" | \"failed\" | \"idle\"\n error_message?: string\n}\n\nexport type OtaQueryResult = OtaStatusEvent\n\n/** Nex BLE protobuf trace (NexEventUtils); payload matches native Map keys. */\nexport type BleCommandTraceEvent = {\n command: string\n commandText: string\n timestamp: number\n}\n\nexport type MiniappSelectedEvent = {\n type: \"miniapp_selected\"\n packageName: string\n}\n\n// Union type of all native/internal Bluetooth SDK events.\nexport type BluetoothSdkInternalEvent = Parameters<BluetoothSdkModuleEvents[keyof BluetoothSdkModuleEvents]>[0]\n\nexport type BluetoothSdkModuleEvents = {\n glasses_status: (changed: Partial<GlassesStatus>) => void\n bluetooth_status: (changed: Partial<BluetoothStatus>) => void\n log: (event: LogEvent) => void\n device_discovered: (device: Device) => void\n default_device_changed: (event: {device?: Device}) => void\n // Individual event handlers\n glasses_not_ready: (event: GlassesNotReadyEvent) => void\n button_press: (event: ButtonPressEvent) => void\n touch_event: (event: TouchEvent) => void\n accel_event: (event: AccelEvent) => void\n head_up: (event: HeadUpEvent) => void\n voice_activity_detection_status: (event: VoiceActivityDetectionStatusEvent) => void\n speaking_status: (event: SpeakingStatusEvent) => void\n battery_status: (event: BatteryStatusEvent) => void\n local_transcription: (event: LocalTranscriptionEvent) => void\n native_notification_status: (event: NativeNotificationStatus) => void\n native_notification_delivery: (event: NativeNotificationDelivery) => void\n phone_notification: (event: PhoneNotificationEvent) => void\n phone_notification_dismissed: (event: PhoneNotificationDismissedEvent) => void\n wifi_status_change: (event: WifiStatusChangeEvent) => void\n wifi_scan_result: (event: WifiScanResultEvent) => void\n wifi_forget_result: (event: WifiForgetResultEvent) => void\n saved_wifi_networks: (event: SavedWifiNetworksEvent) => void\n hotspot_status_change: (event: HotspotStatusChangeEvent) => void\n hotspot_error: (event: HotspotErrorEvent) => void\n photo_response: (event: PhotoResponseEvent) => void\n photo_status: (event: PhotoStatusEvent) => void\n camera_status: (event: CameraStatusEvent) => void\n video_recording_status: (event: VideoRecordingStatusEvent) => void\n media_success: (event: MediaUploadSuccessEvent) => void\n media_error: (event: MediaUploadErrorEvent) => void\n gallery_status: (event: GalleryStatusEvent) => void\n compatible_glasses_search_stop: (event: CompatibleGlassesSearchStopEvent) => void\n heartbeat_sent: (event: HeartbeatSentEvent) => void\n heartbeat_received: (event: HeartbeatReceivedEvent) => void\n swipe_volume_status: (event: SwipeVolumeStatusEvent) => void\n switch_status: (event: SwitchStatusEvent) => void\n rgb_led_control_response: (event: RgbLedControlResponseEvent) => void\n settings_ack: (event: SettingsAckEvent) => void\n pair_failure: (event: PairFailureEvent) => void\n pairing_info: (event: PairingInfoEvent) => void\n entering_pairing_mode: (event: EnteringPairingModeEvent) => void\n owner_replaced: (event: OwnerReplacedEvent) => void\n audio_pairing_needed: (event: AudioPairingNeededEvent) => void\n audio_connected: (event: AudioConnectedEvent) => void\n audio_disconnected: (event: AudioDisconnectedEvent) => void\n save_setting: (event: SaveSettingEvent) => void\n ws_text: (event: WsTextEvent) => void\n ws_bin: (event: WsBinEvent) => void\n mic_pcm: (event: MicPcmEvent) => void\n mic_lc3: (event: MicLc3Event) => void\n mic_health: (event: MicHealthEvent) => void\n stream_status: (event: StreamStatusEvent) => void\n keep_alive_ack: (event: KeepAliveAckEvent) => void\n mtk_update_complete: (event: MtkUpdateCompleteEvent) => void\n glasses_session_changed: (event: GlassesSessionChangedEvent) => void\n ota_start_ack: (event: OtaStartAckEvent) => void\n ota_status: (event: OtaStatusEvent) => void\n ar99_ota_status: (event: Ar99OtaStatusEvent) => void\n version_info: (event: VersionInfoEvent) => void\n send_command_to_ble: (event: BleCommandTraceEvent) => void\n receive_command_from_ble: (event: BleCommandTraceEvent) => void\n miniapp_selected: (event: MiniappSelectedEvent) => void\n extraction_progress: (event: ExtractionProgressEvent) => void\n}\n\nexport interface ExtractionProgressEvent {\n percentage: number\n bytesRead: number\n totalBytes: number\n}\n\nexport interface Ar99OtaStatusEvent {\n type: \"ar99_ota_status\"\n phase: string\n progress: number\n offset: number\n total: number\n errorMessage?: string\n error_message?: string\n}\n\nexport interface PhoneNotificationEvent {\n notificationId: string\n app: string\n title: string\n content: string\n priority: string\n timestamp: number\n packageName: string\n}\n\nexport interface PhoneNotificationDismissedEvent {\n notificationId: string\n notificationKey: string\n packageName: string\n timestamp: number\n}\n\n/**\n * Outbound payload for `sendPhoneNotification` — a notification pushed INTO the glasses' own\n * notification centre. The inverse of {@link PhoneNotificationEvent}, which reports\n * notifications the glasses relayed TO the phone (iOS/ANCS). Drivers map these keys onto\n * whatever their firmware expects.\n */\nexport interface NativeNotificationConfig {\n enabled: boolean\n autoDisplay: boolean\n durationSeconds: number\n doNotDisturb: boolean\n /** Android package names. iOS rejects nonempty lists; its ANCS filter is firmware-owned. */\n blockedApps: string[]\n}\n\nexport interface NativeNotificationStatus {\n supported: boolean\n source: \"phone\" | \"ancs\" | \"unsupported\"\n authorization: \"system\" | \"authorized\" | \"not_authorized\" | \"unknown\"\n /** `submitted` is not a firmware-confirmed acknowledgement. */\n state: \"unavailable\" | \"disabled\" | \"configuring\" | \"submitted\" | \"needs_reconnect\" | \"failed\"\n config: NativeNotificationConfig\n error: string\n}\n\nexport interface NativeNotificationDelivery {\n notificationId: string\n status: \"delivered\" | \"failed\" | \"cancelled\" | \"dropped\"\n reason: string\n}\n\nexport interface NativePhoneNotification {\n /** Stable id from the phone's notification listener; parsed to an int where firmware needs one. */\n notificationId: string\n /** Reverse-DNS package id of the originating app. */\n packageName: string\n /** Human app name (e.g. \"Messages\"). */\n appName: string\n title: string\n /** Android `android.subText`. Empty when the listener didn't capture one. */\n subtitle: string\n body: string\n /** Unix ms post time. */\n timestampMs: number\n /** Posted or updated. Removal is not supported by the verified protocol. */\n action: 0\n}\n\nexport type PublicGlassesStatus = Omit<\n GlassesStatus,\n \"otaUpdateAvailable\" | \"otaProgress\" | \"otaInProgress\" | \"otaVersionUrl\"\n>\n\nexport type PublicBluetoothStatus = Pick<\n BluetoothStatus,\n | \"searching\"\n | \"searchingController\"\n | \"systemMicUnavailable\"\n | \"micRanking\"\n | \"currentMic\"\n | \"searchResults\"\n | \"wifiScanResults\"\n | \"lastLog\"\n | \"otherBtConnected\"\n | \"galleryModeEnabled\"\n>\n\nexport type BluetoothSdkEventMap = {\n native_notification_status: NativeNotificationStatus\n native_notification_delivery: NativeNotificationDelivery\n log: LogEvent\n device_discovered: Device\n default_device_changed: {device?: Device}\n glasses_not_ready: GlassesNotReadyEvent\n button_press: ButtonPressEvent\n touch_event: TouchEvent\n accel_event: AccelEvent\n head_up: HeadUpEvent\n voice_activity_detection_status: VoiceActivityDetectionStatusEvent\n speaking_status: SpeakingStatusEvent\n battery_status: BatteryStatusEvent\n local_transcription: LocalTranscriptionEvent\n wifi_status_change: WifiStatusChangeEvent\n wifi_scan_result: WifiScanResultEvent\n wifi_forget_result: WifiForgetResultEvent\n saved_wifi_networks: SavedWifiNetworksEvent\n hotspot_status_change: HotspotStatusChangeEvent\n hotspot_error: HotspotErrorEvent\n photo_response: PhotoResponseEvent\n photo_status: PhotoStatusEvent\n camera_status: CameraStatusEvent\n video_recording_status: VideoRecordingStatusEvent\n media_success: MediaUploadSuccessEvent\n media_error: MediaUploadErrorEvent\n gallery_status: GalleryStatusEvent\n compatible_glasses_search_stop: CompatibleGlassesSearchStopEvent\n swipe_volume_status: SwipeVolumeStatusEvent\n switch_status: SwitchStatusEvent\n rgb_led_control_response: RgbLedControlResponseEvent\n settings_ack: SettingsAckEvent\n pair_failure: PairFailureEvent\n pairing_info: PairingInfoEvent\n entering_pairing_mode: EnteringPairingModeEvent\n owner_replaced: OwnerReplacedEvent\n audio_pairing_needed: AudioPairingNeededEvent\n audio_connected: AudioConnectedEvent\n audio_disconnected: AudioDisconnectedEvent\n mic_pcm: MicPcmEvent\n mic_lc3: MicLc3Event\n mic_health: MicHealthEvent\n stream_status: StreamStatusEvent\n /** Mentra Live MTK updater completed and the glasses are about to restart. */\n mtk_update_complete: MtkUpdateCompleteEvent\n /** The ASG process restarted while the BES kept the BLE connection alive. */\n glasses_session_changed: GlassesSessionChangedEvent\n ota_start_ack: OtaStartAckEvent\n ota_status: OtaStatusEvent\n ar99_ota_status: Ar99OtaStatusEvent\n version_info: VersionInfoEvent\n extraction_progress: ExtractionProgressEvent\n}\n\nexport type BluetoothSdkEventName = keyof BluetoothSdkEventMap\n\nexport type BluetoothSdkEventListener<EventName extends BluetoothSdkEventName> = (\n event: BluetoothSdkEventMap[EventName],\n) => void\n\nexport type BluetoothSdkSubscription = {\n remove(): void\n}\n\nexport type BluetoothSdkEvent = BluetoothSdkEventMap[BluetoothSdkEventName]\n\nexport interface BluetoothSdkPublicModule {\n configureNativeNotifications(config: NativeNotificationConfig): Promise<void>\n getNativeNotificationStatus(): Promise<NativeNotificationStatus>\n addListener<EventName extends BluetoothSdkEventName>(\n eventName: EventName,\n listener: BluetoothSdkEventListener<EventName>,\n ): BluetoothSdkSubscription\n\n /** Read an immutable snapshot of the current glasses state. */\n getGlassesStatus(): Promise<PublicGlassesStatus>\n /** Read an immutable snapshot of the phone Bluetooth adapter state. */\n getBluetoothStatus(): Promise<PublicBluetoothStatus>\n /** Observe immutable glasses-state patches. Returns an unsubscribe function. */\n subscribeGlassesStatus(listener: (changed: Partial<PublicGlassesStatus>) => void): () => void\n /** Observe immutable Bluetooth-state patches. Returns an unsubscribe function. */\n subscribeBluetoothStatus(listener: (changed: Partial<PublicBluetoothStatus>) => void): () => void\n\n getDefaultDevice(): Promise<Device | null>\n setDefaultDevice(device: Device | null): Promise<void>\n clearDefaultDevice(): Promise<void>\n\n startScan(model: DeviceModel): Promise<void>\n stopScan(): Promise<void>\n scan(options: ScanOptions): Promise<Device[]>\n scan(model: DeviceModel, options?: ScanModelOptions): Promise<Device[]>\n connect(device: Device, options?: ConnectOptions): Promise<void>\n connectDefault(options?: ConnectOptions): Promise<void>\n cancelConnectionAttempt(): Promise<void>\n disconnect(): Promise<void>\n forget(): Promise<void>\n\n displayText(text: string, x?: number, y?: number, size?: number): Promise<void>\n clearDisplay(): Promise<void>\n /** Set session-only content below the dashboard status header. Pass an empty string to reset it. */\n setDashboardContent(content: string): Promise<void>\n showDashboard(): Promise<void>\n setDashboardPosition(height: number, depth: number): Promise<void>\n setHeadUpAngle(angleDegrees: number): Promise<void>\n setImuEnabled(enabled: boolean): Promise<void>\n setScreenDisabled(disabled: boolean): Promise<void>\n /** Keep legacy Mentra Live OTA sessions awake. Modern sessions normally do not require this. */\n ping(): Promise<void>\n\n requestWifiScan(): Promise<WifiSearchResult[]>\n /** List exact WiFi SSIDs from glasses that support reliable saved-network enumeration. */\n getSavedWifiNetworks(): Promise<SavedWifiNetworksResult>\n sendWifiCredentials(ssid: string, password: string): Promise<WifiStatusChangeEvent>\n /** Forget a saved network and return its correlated semantic outcome. */\n forgetWifiNetwork(ssid: string): Promise<WifiForgetResult>\n setHotspotState(enabled: boolean): Promise<HotspotStatusChangeEvent>\n /** Set the glasses clock from the phone after an OTA clock-skew failure. */\n setSystemTime(timestampMs: number): Promise<void>\n /** Enable or disable Wi-Fi ADB on Mentra Live (no-op on other devices). */\n setWifiAdbState(enabled: boolean): Promise<void>\n\n setGalleryModeEnabled(enabled: boolean): Promise<SettingsAckSuccessEvent>\n setVoiceActivityDetectionEnabled(enabled: boolean): Promise<void>\n setLoudnessGateEnabled(enabled: boolean): Promise<void>\n /**\n * @deprecated Sticky action-button photo presets are deprecated. Prefer per-request\n * `requestPhoto(...)` options (e.g. `mode: \"text\"` for text sensor size/crop, or explicit per-shot\n * fields). Still functional until removed in a future release.\n */\n setPhotoCaptureDefaults(settings: PhotoCaptureDefaults): Promise<SettingsAckSuccessEvent>\n setVideoRecordingDefaults(settings: VideoRecordingDefaults): Promise<SettingsAckSuccessEvent>\n setMaxVideoRecordingDuration(minutes: number): Promise<SettingsAckSuccessEvent>\n setCameraFov(request: CameraFovRequest): Promise<CameraFovResult>\n /** One-way FOV command for legacy ASG clients that do not send settings acknowledgements. */\n setLegacyCameraFov(request: CameraFovRequest): Promise<CameraFovResult>\n setCameraFovOverride(request: CameraFovOverrideRequest): Promise<CameraFovResult>\n releaseCameraFovOverride(leaseId: string): Promise<SettingsAckSuccessEvent>\n /**\n * Configure camera HAL tuning (ANR / gain) on Mentra Live glasses.\n *\n * The phone sends a {@code camera_tuning_config} BLE command; the glasses relay it as a\n * {@code camconfig} broadcast to the camera HAL so parameters take effect without a reboot.\n *\n * **Scan-mode convention**: call with `(false, false)` when activating scan mode to disable ANR\n * and pixsmart gain for sharper text/barcode captures. Call with `(true, true)` to restore\n * defaults when exiting scan mode.\n *\n * @param anrOn `true` = ANR enabled (default), `false` = ANR disabled\n * @param gainOn `true` = stock gain params (default), `false` = pixsmart gain-off params\n */\n setCameraTuningConfig(anrOn: boolean, gainOn: boolean): Promise<SettingsAckSuccessEvent>\n queryGalleryStatus(): Promise<GalleryStatusEvent>\n requestPhoto(params: PhotoRequestParams): Promise<PhotoSuccessResponseEvent>\n warmUpCamera(params: WarmUpCameraParams): Promise<CameraStatusEvent>\n /** Release one request-owned warm-up. Opening requests reject with camera_warm_up_cancelled. */\n stopCameraWarmUp(requestId: string): Promise<void>\n startVideoRecording(\n requestId: string,\n save: boolean,\n sound: boolean,\n settings?: VideoRecordingSettings,\n ): Promise<VideoRecordingStartedStatusEvent>\n /**\n * Stop the active recording. When {@link webhookUrl} is provided, the glasses\n * upload the recorded video to it (multipart) using {@link authToken}. These\n * are supplied at stop time (not start) so the token is fresh when the upload\n * runs 闂?a recording can last arbitrarily long. An empty/omitted webhook keeps\n * the video on device (no upload).\n */\n stopVideoRecording(\n requestId: string,\n webhookUrl?: string,\n authToken?: string,\n ): Promise<VideoRecordingStoppedStatusEvent>\n /** Query the glasses for the current recording state and elapsed duration. */\n queryVideoRecordingStatus(requestId: string): Promise<VideoRecordingStatusEvent>\n\n startStream(params: StreamStartRequest): Promise<StreamStatusEvent>\n stopStream(): Promise<StreamStatusEvent>\n\n setMicState(enabled: boolean, useGlassesMic?: boolean, sendTranscript?: boolean, sendLc3Data?: boolean): Promise<void>\n setPreferredMic(preferredMic: MicPreference): Promise<void>\n setOwnAppAudioPlaying(playing: boolean): Promise<void>\n getGlassesMediaVolume(): Promise<GlassesMediaVolumeGetResult>\n setGlassesMediaVolume(level: number): Promise<GlassesMediaVolumeSetResult>\n\n rgbLedControl(\n requestId: string,\n packageName: string | null,\n action: RgbLedAction,\n color: RgbLedColor | null,\n onDurationMs: number,\n offDurationMs: number,\n count: number,\n ): Promise<RgbLedControlSuccessResponseEvent>\n\n requestVersionInfo(): Promise<VersionInfoResult>\n /**\n * Select the OTA manifest used by subsequent update checks and installs.\n * The URL may point at Mentra's hosted manifest or any customer-controlled HTTP(S) server.\n */\n setOtaVersionUrl(otaVersionUrl: string): void\n /** Return the configured or release-embedded OTA manifest URL. Rejects when a source build is unconfigured. */\n getOtaVersionUrl(): string\n /** Fetch the configured OTA manifest and return whether any ASG/BES/MTK update is available. */\n checkForOtaUpdate(): Promise<boolean>\n /** Return bundled release changelogs crossed between two coordinated product versions, newest first. */\n getReleaseChangelogs(fromVersion?: string | null, toVersion?: string | null): ReleaseChangelog[]\n /** Start OTA from the configured or explicitly supplied manifest URL. */\n startOtaUpdate(otaVersionUrl?: string | null): Promise<OtaStartAckEvent>\n /** Query the active OTA session and return the correlated status response. */\n queryOtaStatus(): Promise<OtaQueryResult>\n startAr99OtaFromFile(path: string): Promise<boolean>\n cancelAr99Ota(): Promise<void>\n sendAr99FactoryReset(): Promise<void>\n buildAr99OtaSignature(\n secret: string,\n appName: string,\n currentVersion: string,\n serialNumber: string,\n nonce: string,\n ): string\n\n // // stt commands (MOVE TO CRUST)\n // setSttModelDetails(path: string, languageCode: string): Promise<void>\n // getSttModelPath(): Promise<string>\n // checkSttModelAvailable(): Promise<boolean>\n // validateSttModel(path: string): Promise<boolean>\n // extractTarBz2(sourcePath: string, destinationPath: string): Promise<boolean>\n\n // // tts commands (MOVE TO CRUST)\n // setTtsModelDetails(path: string, languageCode: string): Promise<void>\n // getTtsModelPath(): Promise<string>\n // getTtsModelLanguage(): Promise<string>\n // checkTtsModelAvailable(): Promise<boolean>\n // validateTtsModel(path: string): Promise<boolean>\n // generateTtsAudio(text: string, path: string, outputPath: string, speakerId: number, speed: number): Promise<boolean>\n\n // STT Commands (TODO: MOVE TO CRUST)\n setSttModelDetails(path: string, languageCode: string): Promise<void>\n getSttModelPath(): Promise<string>\n checkSttModelAvailable(): Promise<boolean>\n validateSttModel(path: string): Promise<boolean>\n extractTarBz2(sourcePath: string, destinationPath: string): Promise<boolean>\n restartTranscriber(): Promise<void>\n\n // TTS Commands (TODO: MOVE TO CRUST)\n setTtsModelDetails(path: string, languageCode: string): Promise<void>\n getTtsModelPath(): Promise<string>\n getTtsModelLanguage(): Promise<string>\n checkTtsModelAvailable(): Promise<boolean>\n validateTtsModel(path: string): Promise<boolean>\n generateTtsAudio(\n text: string,\n modelPath: string,\n outputPath: string,\n speakerId: number,\n speed: number,\n ): Promise<boolean>\n}\n\n// OTA update status types\nexport type OtaStage = \"download\" | \"install\"\nexport type OtaProgressStatus = \"STARTED\" | \"PROGRESS\" | \"FINISHED\" | \"FAILED\"\n\nexport interface OtaStatus {\n sessionId: string\n totalSteps: number\n currentStep: number\n stepType: \"apk\" | \"mtk\" | \"bes\"\n phase: \"download\" | \"install\"\n stepPercent: number\n /** Real bytes received in the current download; independent of rounded percent. */\n bytesDownloaded?: number\n overallPercent: number\n status: \"in_progress\" | \"step_complete\" | \"complete\" | \"failed\" | \"idle\"\n error?: string\n}\n\nexport interface OtaUpdateInfo {\n available: boolean\n versionCode: number\n versionName: string\n updates: string[] // [\"apk\", \"mtk\", \"bes\"]\n totalSize: number\n cacheReady?: boolean\n /** Exact BES target selected from the OTA manifest, when a BES step is pending. */\n besVersion?: string\n /** True when the APK step installs an older build than the glasses currently run (exact-pin manifests only). */\n isDowngrade?: boolean\n}\n\nexport interface ReleaseChangelog {\n /** Base production version, for example `3.1.0`. */\n version: string\n /** Markdown body authored in `/changelogs/<version>.md`. */\n markdown: string\n}\n\nexport interface OtaProgress {\n stage: OtaStage\n status: OtaProgressStatus\n progress: number\n bytesDownloaded: number\n totalBytes: number\n currentUpdate: string\n errorMessage?: string\n}\n\nexport interface GlassesStatus {\n // state:\n connection: GlassesConnectionStatus\n micEnabled: boolean\n voiceActivityDetectionEnabled: boolean\n bluetoothClassicConnected: boolean\n signalStrength: number\n /** Milliseconds since epoch when signalStrength was last refreshed by the phone BLE stack. */\n signalStrengthUpdatedAt: number\n // device info\n deviceModel: string\n androidVersion: string\n firmwareVersion: string\n besFirmwareVersion: string\n mtkFirmwareVersion: string\n bluetoothMacAddress: string\n wifiMacAddress: string\n leftMacAddress: string\n rightMacAddress: string\n buildNumber: string\n /** Glasses System.currentTimeMillis() from last version_info (clock skew detection). */\n systemTimeMs?: number\n otaVersionUrl: string\n appVersion: string\n /**\n * Package the glasses client actually runs as, from `version_info_1`. Empty string on glasses\n * whose client predates the field. `\"com.mentra.asg_client\"` is the stock client; anything else\n * is a sideloaded build (Android forces a distinct package on any build not signed with Mentra's\n * release key) that coexists with the stock app and must not be driven by OTA.\n */\n packageName: string\n /** Phone-served hotspot OTA protocol version; 0 means unsupported/legacy glasses. */\n hotspotOtaVersion: number\n bluetoothName: string\n serialNumber: string\n style: string\n color: string\n // wifi info\n wifi: WifiStatus\n // battery info\n batteryLevel: number\n charging: boolean\n caseBatteryLevel: number\n caseCharging: boolean\n caseOpen: boolean\n caseRemoved: boolean\n // hotspot info\n hotspot: HotspotStatus\n // OTA update info\n otaUpdateAvailable: OtaUpdateInfo | null\n otaProgress: OtaProgress | null\n otaInProgress: boolean\n // ring info\n controllerConnected: boolean\n controllerFullyBooted: boolean\n controllerMacAddress: string\n controllerBatteryLevel: number\n controllerSignalStrength: number\n}\n\nexport interface CoreDashboardMenuItem {\n name: string\n packageName: string\n running: boolean\n}\n\nexport interface CalendarEvent {\n title: string\n location?: string\n time: string\n endDate: number\n}\n\nexport interface CoreSettings {\n menu_apps: CoreDashboardMenuItem[]\n calendar_events: CalendarEvent[]\n}\n\nexport interface Device {\n /**\n * Stable app-facing key for this scan result, within the limits of the\n * platform identifier available to the SDK. Do not parse this value; use the\n * typed model, name, address, projectName, and rssi fields instead.\n */\n id: string\n model: DeviceModel\n name: string\n /** Platform address/identifier when available: Android Bluetooth address, iOS CoreBluetooth identifier. */\n address?: string\n /** Optional AR99 project discriminator. Supported value: AR99. */\n projectName?: string\n /**\n * Optional scan signal strength. It may be undefined at first discovery and\n * appear in a later scan update when the platform reports RSSI metadata.\n */\n rssi?: number\n /** Mentra Live: unit is currently in pairing mode (adv flag). */\n pairingMode?: boolean\n /** Mentra Live: four-character hex spoken pairing code when available. */\n pairingCode?: string\n /** Mentra Live: advertisement carries the secure-pairing capability trailer. */\n securePairingCapable?: boolean\n}\n\nexport interface ConnectOptions {\n saveAsDefault?: boolean\n cancelExistingConnectionAttempt?: boolean\n /**\n * iOS Mentra Live only. When true, CoreBluetooth requires ANCS authorization\n * as part of the connection. Set false when the app does not use notification\n * relay and must avoid the system ANCS authorization flow. Defaults to true.\n * Android accepts this option as a no-op.\n */\n requiresAncs?: boolean\n}\n\nexport type ScanResultsCallback = (devices: Device[]) => void\n\n/** Advisory for an empty scan. System connection state does not identify an owning app. */\nexport interface ScanDiagnostic {\n code: string\n message: string\n}\n\nexport interface ScanOptions {\n model: DeviceModel\n /** Defaults to 15000. */\n timeoutMs?: number\n /** Alias for `timeoutMs`, useful when mirroring native examples. */\n timeout?: number\n /** Called every time the discovered device list changes during the scan. */\n onResults?: ScanResultsCallback\n /** Optional non-fatal hint before an empty scan resolves, on Android and iOS. */\n onDiagnostic?: (diagnostic: ScanDiagnostic) => void\n}\n\nexport type ScanModelOptions = Omit<ScanOptions, \"model\">\n\nexport interface WifiSearchResult {\n ssid: string\n requiresPassword: boolean\n signalStrength: number\n /** Frequency in MHz (from glasses scan). 5 GHz band is typically 5170闂?825. Omitted if unknown. */\n frequency?: number\n}\n\nexport interface BluetoothStatus {\n // state:\n searching: boolean\n searchingController: boolean\n default_wearable?: DeviceModel | \"\"\n pending_wearable?: DeviceModel | \"\"\n device_name?: string\n device_address?: string\n default_controller?: DeviceModel | \"\"\n pending_controller?: DeviceModel | \"\"\n controller_device_name?: string\n controller_address?: string\n systemMicUnavailable: boolean\n micRanking: MicMode[]\n currentMic: MicMode | \"\" | null\n /**\n * Nearby glasses in stable discovery order.\n * Existing entries keep their array position as details refresh; new glasses append at the end,\n * and removals should not reorder remaining entries.\n */\n searchResults: Device[]\n wifiScanResults: WifiSearchResult[]\n lastLog: string[]\n otherBtConnected: boolean\n // desired settings the SDK sends to compatible connected glasses:\n galleryModeEnabled: boolean\n}\n\nexport type BluetoothSettingsUpdate = Partial<{\n auth_email: string\n core_token: string\n sensing_enabled: boolean\n power_saving_mode: boolean\n lc3_frame_size: number\n preferred_mic: MicPreference\n screen_disabled: boolean\n contextual_dashboard: boolean\n head_up_angle: number\n imu_enabled: boolean\n brightness: number\n auto_brightness: boolean\n dashboard_height: number\n dashboard_depth: number\n menu_apps: DashboardMenuItem[] | CoreDashboardMenuItem[] | Array<Record<string, unknown>> | null\n calendar_events: CalendarEvent[]\n metric_system: boolean\n twelve_hour_time: boolean\n gallery_mode: boolean\n voice_activity_detection_enabled: boolean\n loudness_gate_enabled: boolean\n button_photo_size: ButtonPhotoSize\n button_video_settings: {width: number; height: number; fps: number}\n button_video_width: number\n button_video_height: number\n button_video_fps: number\n button_max_recording_time: number\n camera_fov: NativeCameraFovSetting\n should_send_pcm: boolean\n should_send_lc3: boolean\n should_send_transcript: boolean\n offline_mode: boolean\n local_stt_fallback_active: boolean\n pending_wearable: DeviceModel | \"\"\n default_wearable: DeviceModel | \"\"\n device_name: string\n device_address: string\n default_controller: DeviceModel | \"\"\n pending_controller: DeviceModel | \"\"\n controller_device_name: string\n controller_address: string\n}>\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"BluetoothSdkModule.d.ts","sourceRoot":"","sources":["../../src/_private/BluetoothSdkModule.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAsB,MAAM,MAAM,CAAA;AAKtD,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EAExB,oBAAoB,EACpB,aAAa,EAKb,gBAAgB,EAChB,wBAAwB,EACxB,eAAe,EAGf,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,MAAM,EACN,WAAW,EACX,2BAA2B,EAC3B,2BAA2B,EAC3B,aAAa,EACb,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,uBAAuB,EACvB,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,EACvB,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,yBAAyB,EACzB,qBAAqB,EACrB,YAAY,EACZ,WAAW,EACX,iCAAiC,EACjC,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,gCAAgC,EAChC,sBAAsB,EACtB,gCAAgC,EAChC,yBAAyB,EACzB,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,uBAAuB,CAAA;AAI9B;;;;;;;GAOG;AAEH,KAAK,eAAe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,CAAA"}
1
+ {"version":3,"file":"BluetoothSdkModule.d.ts","sourceRoot":"","sources":["../../src/_private/BluetoothSdkModule.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAsB,MAAM,MAAM,CAAA;AAKtD,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EAExB,oBAAoB,EACpB,aAAa,EAKb,gBAAgB,EAChB,wBAAwB,EACxB,eAAe,EAGf,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,MAAM,EACN,WAAW,EACX,2BAA2B,EAC3B,2BAA2B,EAC3B,aAAa,EACb,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,uBAAuB,EACvB,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,EACvB,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,yBAAyB,EACzB,qBAAqB,EACrB,YAAY,EACZ,WAAW,EACX,iCAAiC,EACjC,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,gCAAgC,EAChC,sBAAsB,EACtB,gCAAgC,EAChC,yBAAyB,EACzB,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,uBAAuB,CAAA;AAK9B;;;;;;;GAOG;AAEH,KAAK,eAAe,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,KAAK,IAAI,CAAA;AAChE,KAAK,uBAAuB,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAA;AAGhF,OAAO,OAAO,wBAAyB,SAAQ,YAAY,CAAC,wBAAwB,CAAC;IAEnF,gBAAgB,IAAI,OAAO,CAAC,aAAa,CAAC;IAC1C,kBAAkB,IAAI,OAAO,CAAC,qBAAqB,CAAC;IACpD,gBAAgB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAC1C,MAAM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AO,CAAC,OAAO,CAAC;IAChD,gBAAgB,CACd,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,OAAO,CAAC;IAEnB,iFAAiF;IACjF,qBAAqB,CAAC,YAAY,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;IAC3E,4BAA4B,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IAC7E,2BAA2B,IAAI,OAAO,CAAC,wBAAwB,CAAC;IAGhE,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAC5D,uBAAuB,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;IACvE,eAAe,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,IAAI;IACtD,iBAAiB,CAAC,QAAQ,EAAE,uBAAuB,GAAG,MAAM,IAAI;IAGhE,WAAW,IAAI,MAAM;CACtB;AAED,MAAM,MAAM,0BAA0B,GAAG,wBAAwB,CAAA;AAIjE,QAAA,MAAM,wBAAwB,0BAAgE,CAAA;AA8W9F,eAAe,wBAAwB,CAAA;AACvC,eAAO,MAAM,YAAY,EAA+B,0BAA0B,CAAA"}
@@ -5,6 +5,7 @@ import { installNativeLogConsole } from "./nativeLogConsole";
5
5
  import { CAMERA_FOV_DEFAULT, CAMERA_FOV_MAX, CAMERA_FOV_MIN, } from "../BluetoothSdk.types";
6
6
  import { warmUpCameraParamsForNative } from "./cameraRequestPayload";
7
7
  import { photoRequestParamsForNative } from "./photoRequestPayload";
8
+ import { streamRequestParamsForNative } from "./streamRequestPayload";
8
9
  // This call loads the native module object from the JSI.
9
10
  // NativeModule<BluetoothSdkModuleEvents> already extends EventEmitter<BluetoothSdkModuleEvents>
10
11
  const NativeBluetoothSdkModule = requireNativeModule("BluetoothSdk");
@@ -278,6 +279,10 @@ const nativeWarmUpCamera = NativeBluetoothSdkModule.warmUpCamera.bind(NativeBlue
278
279
  NativeBluetoothSdkModule.warmUpCamera = function (params) {
279
280
  return nativeWarmUpCamera(warmUpCameraParamsForNative(params));
280
281
  };
282
+ const nativeStartStream = bindNativeMethod(NativeBluetoothSdkModule, "startStream");
283
+ NativeBluetoothSdkModule.startStream = function (params) {
284
+ return nativeStartStream(streamRequestParamsForNative(params));
285
+ };
281
286
  export default NativeBluetoothSdkModule;
282
287
  export const BluetoothSdk = NativeBluetoothSdkModule;
283
288
  //# sourceMappingURL=BluetoothSdkModule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BluetoothSdkModule.js","sourceRoot":"","sources":["../../src/_private/BluetoothSdkModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAe,mBAAmB,EAAC,MAAM,MAAM,CAAA;AACtD,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAA;AAErC,OAAO,EAAC,uBAAuB,EAAC,MAAM,oBAAoB,CAAA;AAE1D,OAAO,EAML,kBAAkB,EAClB,cAAc,EACd,cAAc,GA8Cf,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAC,2BAA2B,EAAC,MAAM,wBAAwB,CAAA;AAClE,OAAO,EAAC,2BAA2B,EAAC,MAAM,uBAAuB,CAAA;AAyPjE,yDAAyD;AACzD,gGAAgG;AAChG,MAAM,wBAAwB,GAAG,mBAAmB,CAA2B,cAAc,CAAC,CAAA;AAC9F,uBAAuB,CAAC,wBAAwB,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAA;AAE9D,MAAM,uBAAuB,GAA6B;IACxD,aAAa,EAAE,IAAI;IACnB,+BAA+B,EAAE,IAAI;IACrC,YAAY,EAAE,IAAI;CACnB,CAAA;AAED,MAAM,uBAAuB,GAAG,MAAM,CAAA;AAEtC,SAAS,gBAAgB,CAA0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AE,KAAK,IAAI,EAAE,CAAC,qBAAqB,CAAC,MAAM,IAAI,CAAC,kBAAkB,EAAE,EAAE,WAAW,CAAC,KAAK,CAAC;QACjG,2EAA2E;QAC3E,aAAa,EACX,OAAO,IAAI,CAAC,iBAAiB,KAAK,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAkB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;KAC9G,EACD,EAAC,GAAG,WAAW,EAAE,SAAS,EAAC,CAC5B,CAAA;IACD,uBAAuB,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IAC3C,IAAI,CAAC;QACH,OAAO,MAAM,OAAO,CAAC,MAAM,CAAA;IAC7B,CAAC;YAAS,CAAC;QACT,uBAAuB,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IAChD,CAAC;AACH,CAAC,CAAA;AAED,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,YAAY,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAA;AAC/F,wBAAwB,CAAC,YAAY,GAAG,UAAU,MAA0B;IAC1E,OAAO,kBAAkB,CAAC,2BAA2B,CAAC,MAAM,CAAkC,CAAC,CAAA;AACjG,CAAC,CAAA;AAED,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,YAAY,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAA;AAC/F,wBAAwB,CAAC,YAAY,GAAG,UAAU,MAA0B;IAC1E,OAAO,kBAAkB,CAAC,2BAA2B,CAAC,MAAM,CAAkC,CAAC,CAAA;AACjG,CAAC,CAAA;AAED,eAAe,wBAAwB,CAAA;AACvC,MAAM,CAAC,MAAM,YAAY,GAAG,wBAAsD,CAAA","sourcesContent":["import {createScanSession} from \"./scanSession\"\nimport {NativeModule, requireNativeModule} from \"expo\"\nimport {Platform} from \"react-native\"\n\nimport {installNativeLogConsole} from \"./nativeLogConsole\"\n\nimport {\n BluetoothSettingsUpdate,\n BluetoothSdkModuleEvents,\n BluetoothStatus,\n PhotoCaptureDefaults,\n CalendarEvent,\n CAMERA_FOV_DEFAULT,\n CAMERA_FOV_MAX,\n CAMERA_FOV_MIN,\n CameraFovPreset,\n CameraFovRequest,\n CameraFovOverrideRequest,\n CameraFovResult,\n CameraFovSetting,\n CameraRoiPosition,\n CameraStatusEvent,\n ConnectOptions,\n DashboardMenuItem,\n Device,\n DeviceModel,\n GlassesMediaVolumeGetResult,\n GlassesMediaVolumeSetResult,\n GlassesStatus,\n GalleryStatusEvent,\n HotspotStatusChangeEvent,\n MicPreference,\n NativePhoneNotification,\n NativeNotificationConfig,\n NativeNotificationStatus,\n ObservableStoreCategory,\n OtaQueryResult,\n OtaStartAckEvent,\n PhotoRequestParams,\n PhotoSuccessResponseEvent,\n PublicBluetoothStatus,\n RgbLedAction,\n RgbLedColor,\n RgbLedControlSuccessResponseEvent,\n ScanDiagnostic,\n ScanModelOptions,\n ScanOptions,\n SettingsAckSuccessEvent,\n StreamStartRequest,\n StreamStatusEvent,\n VideoRecordingStartedStatusEvent,\n VideoRecordingSettings,\n VideoRecordingStoppedStatusEvent,\n VideoRecordingStatusEvent,\n VersionInfoResult,\n WarmUpCameraParams,\n SavedWifiNetworksResult,\n WifiForgetResult,\n WifiSearchResult,\n WifiStatusChangeEvent,\n} from \"../BluetoothSdk.types\"\nimport {warmUpCameraParamsForNative} from \"./cameraRequestPayload\"\nimport {photoRequestParamsForNative} from \"./photoRequestPayload\"\n\n/**\n * Private React Native native-module facade.\n *\n * This file intentionally lives under `_private` so the package root can expose\n * a small SDK surface while MentraOS uses its monorepo-only internal alias\n * during migration. Raw status getters/listeners stay here so React hooks can\n * shape native store snapshots before app code sees them.\n */\n\ntype GlassesListener = (changed: Partial<GlassesStatus>) => void\ntype BluetoothStatusListener = (changed: Partial<PublicBluetoothStatus>) => void\ntype MaybePromise<T> = T | Promise<T>\n\ndeclare class BluetoothSdkNativeModule extends NativeModule<BluetoothSdkModuleEvents> {\n // Observable Store Functions (native)\n getGlassesStatus(): Promise<GlassesStatus>\n getBluetoothStatus(): Promise<PublicBluetoothStatus>\n getDefaultDevice(): Promise<Device | null>\n update(category: ObservableStoreCategory, values: object): Promise<void>\n\n // Display Commands\n displayEvent(params: Record<string, unknown>): Promise<void>\n displayText(text: string, x?: number, y?: number, size?: number): Promise<void>\n clearDisplay(): Promise<void>\n setDashboardContent(content: string): Promise<void>\n\n // Connection Commands\n requestStatus(): Promise<void>\n connectDefault(options?: ConnectOptions): Promise<void>\n connectDefaultWithOptions(options: Required<ConnectOptions>): Promise<void>\n setDefaultDevice(device: Device | null): Promise<void>\n clearDefaultDevice(): Promise<void>\n getScanDiagnostic?: (model: DeviceModel) => Promise<ScanDiagnostic | null>\n startScan(model: DeviceModel): Promise<void>\n stopScan(): Promise<void>\n scan(options: ScanOptions): Promise<Device[]>\n scan(model: DeviceModel, options?: ScanModelOptions): Promise<Device[]>\n connect(device: Device, options?: ConnectOptions): Promise<void>\n connectWithOptions(device: Device, options: Required<ConnectOptions>): Promise<void>\n cancelConnectionAttempt(): Promise<void>\n connectDefaultController(): Promise<void>\n disconnectController(): Promise<void>\n connectSimulated(): Promise<void>\n disconnect(): Promise<void>\n forget(): Promise<void>\n forgetController(): Promise<void>\n showDashboard(): Promise<void>\n setBrightness(level: number, autoMode?: boolean | null): Promise<void>\n setAutoBrightness(enabled: boolean): Promise<void>\n setDashboardPosition(height: number, depth: number): Promise<void>\n setDashboardMenu(items: DashboardMenuItem[]): Promise<void>\n setCalendarEvents(events: CalendarEvent[]): Promise<void>\n setHeadUpAngle(angleDegrees: number): Promise<void>\n setImuEnabled(enabled: boolean): Promise<void>\n setScreenDisabled(disabled: boolean): Promise<void>\n ping(): Promise<void>\n dbg1(): Promise<void>\n dbg2(): Promise<void>\n\n // Incident Reporting\n sendIncidentId(incidentId: string, apiBaseUrl?: string | null): Promise<void>\n\n // WiFi Commands\n requestWifiScan(): Promise<WifiSearchResult[]>\n getSavedWifiNetworks(): Promise<SavedWifiNetworksResult>\n sendWifiCredentials(ssid: string, password: string): Promise<WifiStatusChangeEvent>\n forgetWifiNetwork(ssid: string): Promise<WifiForgetResult>\n setHotspotState(enabled: boolean): Promise<HotspotStatusChangeEvent>\n /** Enable or disable Wi-Fi ADB on Mentra Live (no-op on other devices). */\n setWifiAdbState(enabled: boolean): Promise<void>\n /** Set the glasses system clock when phone detects clock skew (Mentra Live and G2). */\n setSystemTime(timestampMs: number): Promise<void>\n /** Logs current WiFi frequency (MHz) and 5 GHz band to Android logcat. */\n logCurrentWifiFrequency(): Promise<void>\n\n // Gallery Commands\n setGalleryModeEnabled(enabled: boolean): Promise<SettingsAckSuccessEvent>\n setVoiceActivityDetectionEnabled(enabled: boolean): Promise<void>\n /** Mentra Live center-mic loudness / Barrier gate (cs_swit type 10). */\n setLoudnessGateEnabled(enabled: boolean): Promise<void>\n /**\n * @deprecated Sticky action-button photo presets are deprecated. Prefer per-request\n * `requestPhoto(...)` options (e.g. `mode: \"text\"` for text sensor size/crop).\n */\n setPhotoCaptureDefaults(settings: PhotoCaptureDefaults): Promise<SettingsAckSuccessEvent>\n setVideoRecordingDefaults(width: number, height: number, fps: number): Promise<SettingsAckSuccessEvent>\n setMaxVideoRecordingDuration(minutes: number): Promise<SettingsAckSuccessEvent>\n setCameraFov(request: CameraFovRequest): Promise<CameraFovResult>\n setLegacyCameraFov(request: CameraFovRequest): Promise<CameraFovResult>\n restoreLegacyCameraFov(): Promise<void>\n setCameraFovOverride(request: CameraFovOverrideRequest): Promise<CameraFovResult>\n releaseCameraFovOverride(leaseId: string): Promise<SettingsAckSuccessEvent>\n /**\n * Configure camera HAL tuning (ANR / gain) on Mentra Live glasses.\n * Sends a {@code camera_tuning_config} BLE message; the ASG client relays it as a\n * {@code camconfig} broadcast so the HAL picks up new parameters without a reboot.\n *\n * Scan-mode convention: pass `{anr: false, gain: false}` when activating scan mode\n * (disables ANR and pixsmart gain) and `{anr: true, gain: true}` to restore defaults.\n */\n setCameraTuningConfig(anrOn: boolean, gainOn: boolean): Promise<SettingsAckSuccessEvent>\n queryGalleryStatus(): Promise<GalleryStatusEvent>\n requestPhoto(params: PhotoRequestParams): Promise<PhotoSuccessResponseEvent>\n warmUpCamera(params: WarmUpCameraParams): Promise<CameraStatusEvent>\n stopCameraWarmUp(requestId: string): Promise<void>\n\n // OTA Commands\n setOtaVersionUrl(otaVersionUrl: string): void\n getOtaVersionUrl(): string\n checkForOtaUpdate(): Promise<boolean>\n startOtaUpdate(otaVersionUrl?: string | null): Promise<OtaStartAckEvent>\n sendOtaQueryStatus(): Promise<OtaQueryResult>\n startAr99OtaFromFile(path: string): Promise<boolean>\n cancelAr99Ota(): Promise<void>\n sendAr99FactoryReset(): Promise<void>\n buildAr99OtaSignature(\n secret: string,\n appName: string,\n currentVersion: string,\n serialNumber: string,\n nonce: string,\n ): string\n\n // Version Info Commands\n requestVersionInfo(): Promise<VersionInfoResult>\n\n // Video Recording Commands\n startVideoRecording(\n requestId: string,\n save: boolean,\n sound: boolean,\n settings?: VideoRecordingSettings,\n ): Promise<VideoRecordingStartedStatusEvent>\n stopVideoRecording(\n requestId: string,\n webhookUrl?: string,\n authToken?: string,\n ): Promise<VideoRecordingStoppedStatusEvent>\n queryVideoRecordingStatus(requestId: string): Promise<VideoRecordingStatusEvent>\n\n // Stream Commands\n startStream(params: StreamStartRequest): Promise<StreamStatusEvent>\n stopStream(): Promise<StreamStatusEvent>\n\n // Microphone Commands\n setMicState(enabled: boolean, useGlassesMic?: boolean, sendTranscript?: boolean, sendLc3Data?: boolean): Promise<void>\n setPreferredMic(preferredMic: MicPreference): Promise<void>\n /**\n * Lock microphone selection to one source (`\"glasses\"`) until released with `null`.\n *\n * Stronger than [setPreferredMic]: a preference is a ranking the SDK falls through when a source\n * is unavailable, while a pin has no fallback and reports `mic_health` with\n * `reason: \"pinned-source-unavailable\"` instead. Android only; the iOS implementation is a no-op,\n * so a caller that depends on the guarantee must gate on platform.\n */\n setMicSourcePin(source: string | null): Promise<void>\n restartTranscriber(): Promise<void>\n\n // Audio Playback Monitoring\n // Notify native side when our app starts/stops playing audio\n // Used to suspend LC3 mic during audio playback to avoid MCU overload\n setOwnAppAudioPlaying(playing: boolean): Promise<void>\n\n // Live PCM output stream (miniapp speaker.createStream). MentraOS-internal\n // ? 16-bit LE PCM chunks into a streaming AudioTrack (USAGE_MEDIA, so it\n // follows the phone's media route, e.g. A2DP to glasses). Implemented with\n // AudioTrack on Android and AVAudioEngine on iOS.\n /**\n * Open a PCM stream session. One AudioTrack per id; caller manages ids.\n *\n * `jitterMs` sizes the playout buffer and is therefore also the stream's floor latency, since a\n * streaming track fills to its buffer and stays there. Omit it for one-way media, where the\n * default cushion is inaudible; pass a small value for conversational audio, where the same\n * cushion is delay before the far end is heard. Android only — iOS accepts and ignores it.\n */\n pcmStreamOpen(\n streamId: string,\n sampleRate: number,\n channels: number,\n volume: number,\n jitterMs?: number,\n ): Promise<void>\n /**\n * Append base64 PCM. Resolves with the queued-but-unplayed backlog in ms;\n * blocks (on a background dispatcher) while the backlog is above the\n * backpressure ceiling, so awaited writes self-throttle to realtime.\n */\n pcmStreamWrite(streamId: string, base64: string): Promise<{bufferedMs: number}>\n /** Drain the backlog, then stop. Resolves with the total played duration. */\n pcmStreamClose(streamId: string): Promise<{durationMs: number}>\n /** Stop immediately, dropping any backlog. Idempotent. */\n pcmStreamAbort(streamId: string): Promise<void>\n\n /** Mentra Live only: K900 `cs_getvol` / `sr_getvol`. */\n getGlassesMediaVolume(): Promise<GlassesMediaVolumeGetResult>\n /** Mentra Live only: K900 `cs_vol` / `sr_vol`; level clamped 0??5 on native. */\n setGlassesMediaVolume(level: number): Promise<GlassesMediaVolumeSetResult>\n\n // RGB LED Control\n rgbLedControl(\n requestId: string,\n packageName: string | null,\n action: RgbLedAction,\n color: RgbLedColor | null,\n onDurationMs: number,\n offDurationMs: number,\n count: number,\n ): Promise<RgbLedControlSuccessResponseEvent>\n\n // STT Commands\n setSttModelDetails(path: string, languageCode: string): Promise<void>\n getSttModelPath(): Promise<string>\n checkSttModelAvailable(): Promise<boolean>\n validateSttModel(path: string): Promise<boolean>\n extractTarBz2(sourcePath: string, destinationPath: string): Promise<boolean>\n\n // TTS Commands\n setTtsModelDetails(path: string, languageCode: string): Promise<void>\n getTtsModelPath(): Promise<string>\n getTtsModelLanguage(): Promise<string>\n checkTtsModelAvailable(): Promise<boolean>\n validateTtsModel(path: string): Promise<boolean>\n generateTtsAudio(\n text: string,\n modelPath: string,\n outputPath: string,\n speakerId: number,\n speed: number,\n ): Promise<boolean>\n\n /** Android G2 content upload. iOS receives ANCS directly and rejects uploads. */\n sendPhoneNotification(notification: NativePhoneNotification): Promise<void>\n configureNativeNotifications(config: NativeNotificationConfig): Promise<void>\n getNativeNotificationStatus(): Promise<NativeNotificationStatus>\n\n // Helper methods for type-safe observable store access\n updateGlasses(values: Partial<GlassesStatus>): Promise<void>\n updateBluetoothSettings(values: BluetoothSettingsUpdate): Promise<void>\n onGlassesStatus(callback: GlassesListener): () => void\n onBluetoothStatus(callback: BluetoothStatusListener): () => void\n\n // Process resident-set-size in MB. iOS-only; Android stub returns 0.\n getMemoryMB(): number\n}\n\nexport type BluetoothSdkInternalModule = BluetoothSdkNativeModule\n\n// This call loads the native module object from the JSI.\n// NativeModule<BluetoothSdkModuleEvents> already extends EventEmitter<BluetoothSdkModuleEvents>\nconst NativeBluetoothSdkModule = requireNativeModule<BluetoothSdkNativeModule>(\"BluetoothSdk\")\ninstallNativeLogConsole(NativeBluetoothSdkModule, Platform.OS)\n\nconst DEFAULT_CONNECT_OPTIONS: Required<ConnectOptions> = {\n saveAsDefault: true,\n cancelExistingConnectionAttempt: true,\n requiresAncs: true,\n}\n\nconst DEFAULT_SCAN_TIMEOUT_MS = 15_000\n\nfunction bindNativeMethod<T extends (...args: never[]) => unknown>(module: Record<string, unknown>, name: string): T {\n const method = module[name]\n if (typeof method !== \"function\") {\n console.warn(`[BluetoothSdk] Native method \"${name}\" is unavailable ??rebuild the app (bun android / bun ios)`)\n return (async () => {\n throw new Error(`BluetoothSdk.${name} is not available in this native build. Rebuild the app.`)\n }) as T\n }\n return method.bind(module) as T\n}\n\nconst CAMERA_ROI_MIN = 0\nconst CAMERA_ROI_MAX = 2\nconst CAMERA_ROI_POSITION_VALUES: Record<CameraRoiPosition, CameraFovSetting[\"roiPosition\"]> = {\n center: 0,\n bottom: 1,\n top: 2,\n}\n\n// Named presets are a convenience layer over the numeric {fov, roiPosition} API.\n// The default is the full sensor; \"standard\" preserves the historical 102° crop.\nconst CAMERA_FOV_PRESETS: Record<CameraFovPreset, CameraFovSetting> = {\n narrow: {fov: 82, roiPosition: 0},\n standard: {fov: 102, roiPosition: 0},\n wide: {fov: CAMERA_FOV_MAX, roiPosition: 0},\n}\n\nfunction clampInteger(value: number, min: number, max: number): number {\n return Math.max(min, Math.min(max, Math.round(value)))\n}\n\nfunction normalizeCameraFov(request: CameraFovRequest): CameraFovSetting {\n if (\"preset\" in request) {\n return CAMERA_FOV_PRESETS[request.preset] ?? CAMERA_FOV_PRESETS.standard\n }\n\n const roiPosition = request.roiPosition ?? \"center\"\n\n return {\n fov: clampInteger(Number.isFinite(request.fov) ? request.fov : CAMERA_FOV_DEFAULT, CAMERA_FOV_MIN, CAMERA_FOV_MAX),\n roiPosition: clampInteger(CAMERA_ROI_POSITION_VALUES[roiPosition] ?? 0, CAMERA_ROI_MIN, CAMERA_ROI_MAX) as\n | 0\n | 1\n | 2,\n }\n}\n\nfunction searchResultsForModel(status: Partial<PublicBluetoothStatus>, model: DeviceModel): Device[] {\n return status.searchResults?.filter((device) => device.model === model) ?? []\n}\n\nfunction normalizeScanArgs(modelOrOptions: DeviceModel | ScanOptions, options?: ScanModelOptions): ScanOptions {\n if (typeof modelOrOptions === \"string\") {\n return {model: modelOrOptions, ...options}\n }\n return modelOrOptions\n}\n\nfunction normalizeTimeoutMs(timeoutMs: number | undefined, defaultTimeoutMs: number): number {\n return typeof timeoutMs === \"number\" && Number.isFinite(timeoutMs) && timeoutMs > 0 ? timeoutMs : defaultTimeoutMs\n}\n\nfunction dashboardMenuItemToNative(item: DashboardMenuItem): Record<string, unknown> {\n return {\n ...(item.values ?? {}),\n title: item.title,\n packageName: item.packageName,\n }\n}\n\nfunction adaptConnectionStatusToNative(connection: GlassesStatus[\"connection\"]): Record<string, unknown> {\n switch (connection.state) {\n case \"connected\":\n return {connectionState: \"CONNECTED\", connected: true, fullyBooted: connection.fullyBooted}\n case \"scanning\":\n return {connectionState: \"SCANNING\", connected: false, fullyBooted: false}\n case \"connecting\":\n return {connectionState: \"CONNECTING\", connected: false, fullyBooted: false}\n case \"bonding\":\n return {connectionState: \"BONDING\", connected: false, fullyBooted: false}\n case \"disconnected\":\n return {connectionState: \"DISCONNECTED\", connected: false, fullyBooted: false}\n }\n}\n\nfunction adaptGlassesUpdateToNative(values: Partial<GlassesStatus>): Record<string, unknown> {\n const {wifi, hotspot, connection, ...rest} = values\n let update: Record<string, unknown> = {...rest}\n if (connection) {\n update = {\n ...update,\n ...adaptConnectionStatusToNative(connection),\n }\n }\n if (wifi?.state === \"connected\") {\n update = {\n ...update,\n wifiConnected: true,\n wifiSsid: wifi.ssid,\n wifiLocalIp: wifi.localIp ?? \"\",\n }\n } else if (wifi?.state === \"disconnected\") {\n update = {\n ...update,\n wifiConnected: false,\n wifiSsid: \"\",\n wifiLocalIp: \"\",\n }\n }\n if (hotspot?.state === \"enabled\") {\n update = {\n ...update,\n hotspotEnabled: true,\n hotspotSsid: hotspot.ssid,\n hotspotPassword: hotspot.password,\n hotspotGatewayIp: hotspot.localIp,\n }\n } else if (hotspot?.state === \"disabled\") {\n update = {\n ...update,\n hotspotEnabled: false,\n hotspotSsid: \"\",\n hotspotPassword: \"\",\n hotspotGatewayIp: \"\",\n }\n }\n return update\n}\n\n// Add helper methods to the module\nconst nativeGetGlassesStatus = NativeBluetoothSdkModule.getGlassesStatus.bind(\n NativeBluetoothSdkModule,\n) as () => MaybePromise<GlassesStatus>\nNativeBluetoothSdkModule.getGlassesStatus = function () {\n return Promise.resolve(nativeGetGlassesStatus())\n}\n\nconst nativeGetBluetoothStatus = NativeBluetoothSdkModule.getBluetoothStatus.bind(\n NativeBluetoothSdkModule,\n) as () => MaybePromise<BluetoothStatus>\nNativeBluetoothSdkModule.getBluetoothStatus = function () {\n return Promise.resolve(nativeGetBluetoothStatus())\n}\n\nconst nativeGetDefaultDevice = NativeBluetoothSdkModule.getDefaultDevice.bind(\n NativeBluetoothSdkModule,\n) as () => MaybePromise<Device | null>\nNativeBluetoothSdkModule.getDefaultDevice = function () {\n return Promise.resolve(nativeGetDefaultDevice())\n}\n\nconst nativeSetMicState = NativeBluetoothSdkModule.setMicState.bind(NativeBluetoothSdkModule) as (\n enabled: boolean,\n useGlassesMic: boolean,\n sendTranscript: boolean,\n sendLc3Data: boolean,\n) => MaybePromise<void>\n\nconst nativeDisplayText = NativeBluetoothSdkModule.displayText.bind(NativeBluetoothSdkModule) as (\n text: string,\n x: number,\n y: number,\n size: number,\n) => MaybePromise<void>\n\nNativeBluetoothSdkModule.updateGlasses = function (values: Partial<GlassesStatus>) {\n return this.update(\"glasses\", adaptGlassesUpdateToNative(values))\n}\n\nNativeBluetoothSdkModule.updateBluetoothSettings = function (values: BluetoothSettingsUpdate) {\n return this.update(\"bluetooth\", values)\n}\n\nNativeBluetoothSdkModule.displayText = function (text: string, x?: number, y?: number, size?: number) {\n return Promise.resolve(nativeDisplayText(text, x ?? 0, y ?? 0, size ?? 24))\n}\n\nNativeBluetoothSdkModule.setBrightness = function (level: number, autoMode?: boolean | null) {\n return this.updateBluetoothSettings({\n ...(autoMode == null ? {} : {auto_brightness: autoMode}),\n brightness: level,\n })\n}\n\nNativeBluetoothSdkModule.setAutoBrightness = function (enabled: boolean) {\n return this.updateBluetoothSettings({auto_brightness: enabled})\n}\n\nNativeBluetoothSdkModule.setDashboardPosition = function (height: number, depth: number) {\n return this.updateBluetoothSettings({\n dashboard_height: height,\n dashboard_depth: depth,\n })\n}\n\nNativeBluetoothSdkModule.setDashboardMenu = function (items: DashboardMenuItem[]) {\n return this.updateBluetoothSettings({menu_apps: items.map(dashboardMenuItemToNative)})\n}\n\nNativeBluetoothSdkModule.setCalendarEvents = function (events: CalendarEvent[]) {\n return this.updateBluetoothSettings({calendar_events: events})\n}\n\nNativeBluetoothSdkModule.setHeadUpAngle = function (angleDegrees: number) {\n return this.updateBluetoothSettings({head_up_angle: angleDegrees})\n}\n\nNativeBluetoothSdkModule.setImuEnabled = function (enabled: boolean) {\n return this.updateBluetoothSettings({imu_enabled: enabled})\n}\n\nNativeBluetoothSdkModule.setScreenDisabled = function (disabled: boolean) {\n return this.updateBluetoothSettings({screen_disabled: disabled})\n}\n\nNativeBluetoothSdkModule.setVoiceActivityDetectionEnabled = function (enabled: boolean) {\n return this.updateBluetoothSettings({voice_activity_detection_enabled: enabled})\n}\n\nNativeBluetoothSdkModule.setLoudnessGateEnabled = function (enabled: boolean) {\n return this.updateBluetoothSettings({loudness_gate_enabled: enabled})\n}\n\nconst nativeSetCameraFov = bindNativeMethod<(fov: CameraFovSetting) => MaybePromise<CameraFovResult>>(\n NativeBluetoothSdkModule as unknown as Record<string, unknown>,\n \"setCameraFov\",\n)\nNativeBluetoothSdkModule.setCameraFov = function (request: CameraFovRequest) {\n const setting = normalizeCameraFov(request)\n return Promise.resolve(nativeSetCameraFov(setting))\n}\n\nconst nativeSetLegacyCameraFov = bindNativeMethod<(fov: CameraFovSetting) => MaybePromise<CameraFovResult>>(\n NativeBluetoothSdkModule as unknown as Record<string, unknown>,\n \"setLegacyCameraFov\",\n)\nNativeBluetoothSdkModule.setLegacyCameraFov = function (request: CameraFovRequest) {\n return Promise.resolve(nativeSetLegacyCameraFov(normalizeCameraFov(request)))\n}\n\nconst nativeRestoreLegacyCameraFov = bindNativeMethod<() => MaybePromise<void>>(\n NativeBluetoothSdkModule as unknown as Record<string, unknown>,\n \"restoreLegacyCameraFov\",\n)\nNativeBluetoothSdkModule.restoreLegacyCameraFov = function () {\n return Promise.resolve(nativeRestoreLegacyCameraFov())\n}\n\nconst nativeSetCameraFovOverride = bindNativeMethod<\n (request: CameraFovSetting & {leaseId: string; ttlMs: number}) => MaybePromise<CameraFovResult>\n>(NativeBluetoothSdkModule as unknown as Record<string, unknown>, \"setCameraFovOverride\")\nNativeBluetoothSdkModule.setCameraFovOverride = function (request: CameraFovOverrideRequest) {\n const setting = normalizeCameraFov(request)\n const requestedTtl =\n typeof request.ttlMs === \"number\" && Number.isFinite(request.ttlMs) && request.ttlMs > 0\n ? Math.round(request.ttlMs)\n : 300_000\n return Promise.resolve(\n nativeSetCameraFovOverride({\n ...setting,\n leaseId: request.leaseId,\n ttlMs: Math.min(requestedTtl, 600_000),\n }),\n )\n}\n\nNativeBluetoothSdkModule.setMicState = function (\n enabled: boolean,\n useGlassesMic?: boolean,\n sendTranscript?: boolean,\n sendLc3Data?: boolean,\n) {\n return Promise.resolve(\n nativeSetMicState(enabled, useGlassesMic ?? true, sendTranscript ?? false, sendLc3Data ?? false),\n )\n}\n\nNativeBluetoothSdkModule.setPreferredMic = function (preferredMic: MicPreference) {\n return this.updateBluetoothSettings({preferred_mic: preferredMic})\n}\n\nNativeBluetoothSdkModule.onGlassesStatus = function (callback: GlassesListener) {\n const subscription = this.addListener(\"glasses_status\", callback)\n return () => subscription.remove()\n}\n\nNativeBluetoothSdkModule.onBluetoothStatus = function (callback: BluetoothStatusListener) {\n const subscription = this.addListener(\"bluetooth_status\", callback)\n return () => subscription.remove()\n}\n\nconst nativeConnectDefault = NativeBluetoothSdkModule.connectDefault.bind(NativeBluetoothSdkModule)\nNativeBluetoothSdkModule.connectDefault = function (options?: ConnectOptions) {\n if (!options) {\n return nativeConnectDefault()\n }\n return this.connectDefaultWithOptions({...DEFAULT_CONNECT_OPTIONS, ...options})\n}\n\nNativeBluetoothSdkModule.connect = function (device: Device, options?: ConnectOptions) {\n return this.connectWithOptions(device, {...DEFAULT_CONNECT_OPTIONS, ...options})\n}\n\nconst nativeStopScan = NativeBluetoothSdkModule.stopScan.bind(NativeBluetoothSdkModule)\nconst activeScanCancellations = new Set<() => Promise<void>>()\nNativeBluetoothSdkModule.stopScan = async function () {\n if (activeScanCancellations.size === 0) return nativeStopScan()\n await Promise.all([...activeScanCancellations].map(cancel => cancel()))\n}\n\nNativeBluetoothSdkModule.scan = async function (modelOrOptions: DeviceModel | ScanOptions, options?: ScanModelOptions) {\n if (activeScanCancellations.size > 0) await this.stopScan()\n const scanOptions = normalizeScanArgs(modelOrOptions, options)\n const timeoutMs = normalizeTimeoutMs(scanOptions.timeoutMs ?? scanOptions.timeout, DEFAULT_SCAN_TIMEOUT_MS)\n const session = createScanSession(\n {\n start: (model) => this.startScan(model),\n stop: nativeStopScan,\n subscribe: (onResults) =>\n this.onBluetoothStatus((status) => {\n if (Array.isArray(status.searchResults)) onResults(searchResultsForModel(status, scanOptions.model))\n }),\n getResults: async () => searchResultsForModel(await this.getBluetoothStatus(), scanOptions.model),\n // Older native binaries simply omit diagnostics until the host is rebuilt.\n getDiagnostic:\n typeof this.getScanDiagnostic === \"function\" ? () => this.getScanDiagnostic!(scanOptions.model) : undefined,\n },\n {...scanOptions, timeoutMs},\n )\n activeScanCancellations.add(session.cancel)\n try {\n return await session.result\n } finally {\n activeScanCancellations.delete(session.cancel)\n }\n}\n\nconst nativeRequestPhoto = NativeBluetoothSdkModule.requestPhoto.bind(NativeBluetoothSdkModule)\nNativeBluetoothSdkModule.requestPhoto = function (params: PhotoRequestParams) {\n return nativeRequestPhoto(photoRequestParamsForNative(params) as unknown as PhotoRequestParams)\n}\n\nconst nativeWarmUpCamera = NativeBluetoothSdkModule.warmUpCamera.bind(NativeBluetoothSdkModule)\nNativeBluetoothSdkModule.warmUpCamera = function (params: WarmUpCameraParams) {\n return nativeWarmUpCamera(warmUpCameraParamsForNative(params) as unknown as WarmUpCameraParams)\n}\n\nexport default NativeBluetoothSdkModule\nexport const BluetoothSdk = NativeBluetoothSdkModule as BluetoothSdkInternalModule\n"]}
1
+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GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IAC3C,IAAI,CAAC;QACH,OAAO,MAAM,OAAO,CAAC,MAAM,CAAA;IAC7B,CAAC;YAAS,CAAC;QACT,uBAAuB,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IAChD,CAAC;AACH,CAAC,CAAA;AAED,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,YAAY,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAA;AAC/F,wBAAwB,CAAC,YAAY,GAAG,UAAU,MAA0B;IAC1E,OAAO,kBAAkB,CAAC,2BAA2B,CAAC,MAAM,CAAkC,CAAC,CAAA;AACjG,CAAC,CAAA;AAED,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,YAAY,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAA;AAC/F,wBAAwB,CAAC,YAAY,GAAG,UAAU,MAA0B;IAC1E,OAAO,kBAAkB,CAAC,2BAA2B,CAAC,MAAM,CAAkC,CAAC,CAAA;AACjG,CAAC,CAAA;AAED,MAAM,iBAAiB,GAAG,gBAAgB,CACxC,wBAA8D,EAC9D,aAAa,CACd,CAAA;AACD,wBAAwB,CAAC,WAAW,GAAG,UAAU,MAA0B;IACzE,OAAO,iBAAiB,CAAC,4BAA4B,CAAC,MAAM,CAAkC,CAAC,CAAA;AACjG,CAAC,CAAA;AAED,eAAe,wBAAwB,CAAA;AACvC,MAAM,CAAC,MAAM,YAAY,GAAG,wBAAsD,CAAA","sourcesContent":["import {createScanSession} from \"./scanSession\"\nimport {NativeModule, requireNativeModule} from \"expo\"\nimport {Platform} from \"react-native\"\n\nimport {installNativeLogConsole} from \"./nativeLogConsole\"\n\nimport {\n BluetoothSettingsUpdate,\n BluetoothSdkModuleEvents,\n BluetoothStatus,\n PhotoCaptureDefaults,\n CalendarEvent,\n CAMERA_FOV_DEFAULT,\n CAMERA_FOV_MAX,\n CAMERA_FOV_MIN,\n CameraFovPreset,\n CameraFovRequest,\n CameraFovOverrideRequest,\n CameraFovResult,\n CameraFovSetting,\n CameraRoiPosition,\n CameraStatusEvent,\n ConnectOptions,\n DashboardMenuItem,\n Device,\n DeviceModel,\n GlassesMediaVolumeGetResult,\n GlassesMediaVolumeSetResult,\n GlassesStatus,\n GalleryStatusEvent,\n HotspotStatusChangeEvent,\n MicPreference,\n NativePhoneNotification,\n NativeNotificationConfig,\n NativeNotificationStatus,\n ObservableStoreCategory,\n OtaQueryResult,\n OtaStartAckEvent,\n PhotoRequestParams,\n PhotoSuccessResponseEvent,\n PublicBluetoothStatus,\n RgbLedAction,\n RgbLedColor,\n RgbLedControlSuccessResponseEvent,\n ScanDiagnostic,\n ScanModelOptions,\n ScanOptions,\n SettingsAckSuccessEvent,\n StreamStartRequest,\n StreamStatusEvent,\n VideoRecordingStartedStatusEvent,\n VideoRecordingSettings,\n VideoRecordingStoppedStatusEvent,\n VideoRecordingStatusEvent,\n VersionInfoResult,\n WarmUpCameraParams,\n SavedWifiNetworksResult,\n WifiForgetResult,\n WifiSearchResult,\n WifiStatusChangeEvent,\n} from \"../BluetoothSdk.types\"\nimport {warmUpCameraParamsForNative} from \"./cameraRequestPayload\"\nimport {photoRequestParamsForNative} from \"./photoRequestPayload\"\nimport {streamRequestParamsForNative} from \"./streamRequestPayload\"\n\n/**\n * Private React Native native-module facade.\n *\n * This file intentionally lives under `_private` so the package root can expose\n * a small SDK surface while MentraOS uses its monorepo-only internal alias\n * during migration. Raw status getters/listeners stay here so React hooks can\n * shape native store snapshots before app code sees them.\n */\n\ntype GlassesListener = (changed: Partial<GlassesStatus>) => void\ntype BluetoothStatusListener = (changed: Partial<PublicBluetoothStatus>) => void\ntype MaybePromise<T> = T | Promise<T>\n\ndeclare class BluetoothSdkNativeModule extends NativeModule<BluetoothSdkModuleEvents> {\n // Observable Store Functions (native)\n getGlassesStatus(): Promise<GlassesStatus>\n getBluetoothStatus(): Promise<PublicBluetoothStatus>\n getDefaultDevice(): Promise<Device | null>\n update(category: ObservableStoreCategory, values: object): Promise<void>\n\n // Display Commands\n displayEvent(params: Record<string, unknown>): Promise<void>\n displayText(text: string, x?: number, y?: number, size?: number): Promise<void>\n clearDisplay(): Promise<void>\n setDashboardContent(content: string): Promise<void>\n\n // Connection Commands\n requestStatus(): Promise<void>\n connectDefault(options?: ConnectOptions): Promise<void>\n connectDefaultWithOptions(options: Required<ConnectOptions>): Promise<void>\n setDefaultDevice(device: Device | null): Promise<void>\n clearDefaultDevice(): Promise<void>\n getScanDiagnostic?: (model: DeviceModel) => Promise<ScanDiagnostic | null>\n startScan(model: DeviceModel): Promise<void>\n stopScan(): Promise<void>\n scan(options: ScanOptions): Promise<Device[]>\n scan(model: DeviceModel, options?: ScanModelOptions): Promise<Device[]>\n connect(device: Device, options?: ConnectOptions): Promise<void>\n connectWithOptions(device: Device, options: Required<ConnectOptions>): Promise<void>\n cancelConnectionAttempt(): Promise<void>\n connectDefaultController(): Promise<void>\n disconnectController(): Promise<void>\n connectSimulated(): Promise<void>\n disconnect(): Promise<void>\n forget(): Promise<void>\n forgetController(): Promise<void>\n showDashboard(): Promise<void>\n setBrightness(level: number, autoMode?: boolean | null): Promise<void>\n setAutoBrightness(enabled: boolean): Promise<void>\n setDashboardPosition(height: number, depth: number): Promise<void>\n setDashboardMenu(items: DashboardMenuItem[]): Promise<void>\n setCalendarEvents(events: CalendarEvent[]): Promise<void>\n setHeadUpAngle(angleDegrees: number): Promise<void>\n setImuEnabled(enabled: boolean): Promise<void>\n setScreenDisabled(disabled: boolean): Promise<void>\n ping(): Promise<void>\n dbg1(): Promise<void>\n dbg2(): Promise<void>\n\n // Incident Reporting\n sendIncidentId(incidentId: string, apiBaseUrl?: string | null): Promise<void>\n\n // WiFi Commands\n requestWifiScan(): Promise<WifiSearchResult[]>\n getSavedWifiNetworks(): Promise<SavedWifiNetworksResult>\n sendWifiCredentials(ssid: string, password: string): Promise<WifiStatusChangeEvent>\n forgetWifiNetwork(ssid: string): Promise<WifiForgetResult>\n setHotspotState(enabled: boolean): Promise<HotspotStatusChangeEvent>\n /** Enable or disable Wi-Fi ADB on Mentra Live (no-op on other devices). */\n setWifiAdbState(enabled: boolean): Promise<void>\n /** Set the glasses system clock when phone detects clock skew (Mentra Live and G2). */\n setSystemTime(timestampMs: number): Promise<void>\n /** Logs current WiFi frequency (MHz) and 5 GHz band to Android logcat. */\n logCurrentWifiFrequency(): Promise<void>\n\n // Gallery Commands\n setGalleryModeEnabled(enabled: boolean): Promise<SettingsAckSuccessEvent>\n setVoiceActivityDetectionEnabled(enabled: boolean): Promise<void>\n /** Mentra Live center-mic loudness / Barrier gate (cs_swit type 10). */\n setLoudnessGateEnabled(enabled: boolean): Promise<void>\n /**\n * @deprecated Sticky action-button photo presets are deprecated. Prefer per-request\n * `requestPhoto(...)` options (e.g. `mode: \"text\"` for text sensor size/crop).\n */\n setPhotoCaptureDefaults(settings: PhotoCaptureDefaults): Promise<SettingsAckSuccessEvent>\n setVideoRecordingDefaults(width: number, height: number, fps: number): Promise<SettingsAckSuccessEvent>\n setMaxVideoRecordingDuration(minutes: number): Promise<SettingsAckSuccessEvent>\n setCameraFov(request: CameraFovRequest): Promise<CameraFovResult>\n setLegacyCameraFov(request: CameraFovRequest): Promise<CameraFovResult>\n restoreLegacyCameraFov(): Promise<void>\n setCameraFovOverride(request: CameraFovOverrideRequest): Promise<CameraFovResult>\n releaseCameraFovOverride(leaseId: string): Promise<SettingsAckSuccessEvent>\n /**\n * Configure camera HAL tuning (ANR / gain) on Mentra Live glasses.\n * Sends a {@code camera_tuning_config} BLE message; the ASG client relays it as a\n * {@code camconfig} broadcast so the HAL picks up new parameters without a reboot.\n *\n * Scan-mode convention: pass `{anr: false, gain: false}` when activating scan mode\n * (disables ANR and pixsmart gain) and `{anr: true, gain: true}` to restore defaults.\n */\n setCameraTuningConfig(anrOn: boolean, gainOn: boolean): Promise<SettingsAckSuccessEvent>\n queryGalleryStatus(): Promise<GalleryStatusEvent>\n requestPhoto(params: PhotoRequestParams): Promise<PhotoSuccessResponseEvent>\n warmUpCamera(params: WarmUpCameraParams): Promise<CameraStatusEvent>\n stopCameraWarmUp(requestId: string): Promise<void>\n\n // OTA Commands\n setOtaVersionUrl(otaVersionUrl: string): void\n getOtaVersionUrl(): string\n checkForOtaUpdate(): Promise<boolean>\n startOtaUpdate(otaVersionUrl?: string | null): Promise<OtaStartAckEvent>\n sendOtaQueryStatus(): Promise<OtaQueryResult>\n startAr99OtaFromFile(path: string): Promise<boolean>\n cancelAr99Ota(): Promise<void>\n sendAr99FactoryReset(): Promise<void>\n buildAr99OtaSignature(\n secret: string,\n appName: string,\n currentVersion: string,\n serialNumber: string,\n nonce: string,\n ): string\n\n // Version Info Commands\n requestVersionInfo(): Promise<VersionInfoResult>\n\n // Video Recording Commands\n startVideoRecording(\n requestId: string,\n save: boolean,\n sound: boolean,\n settings?: VideoRecordingSettings,\n ): Promise<VideoRecordingStartedStatusEvent>\n stopVideoRecording(\n requestId: string,\n webhookUrl?: string,\n authToken?: string,\n ): Promise<VideoRecordingStoppedStatusEvent>\n queryVideoRecordingStatus(requestId: string): Promise<VideoRecordingStatusEvent>\n\n // Stream Commands\n startStream(params: StreamStartRequest): Promise<StreamStatusEvent>\n stopStream(): Promise<StreamStatusEvent>\n\n // Microphone Commands\n setMicState(enabled: boolean, useGlassesMic?: boolean, sendTranscript?: boolean, sendLc3Data?: boolean): Promise<void>\n setPreferredMic(preferredMic: MicPreference): Promise<void>\n /**\n * Lock microphone selection to one source (`\"glasses\"`) until released with `null`.\n *\n * Stronger than [setPreferredMic]: a preference is a ranking the SDK falls through when a source\n * is unavailable, while a pin has no fallback and reports `mic_health` with\n * `reason: \"pinned-source-unavailable\"` instead. Android only; the iOS implementation is a no-op,\n * so a caller that depends on the guarantee must gate on platform.\n */\n setMicSourcePin(source: string | null): Promise<void>\n restartTranscriber(): Promise<void>\n\n // Audio Playback Monitoring\n // Notify native side when our app starts/stops playing audio\n // Used to suspend LC3 mic during audio playback to avoid MCU overload\n setOwnAppAudioPlaying(playing: boolean): Promise<void>\n\n // Live PCM output stream (miniapp speaker.createStream). MentraOS-internal\n // ? 16-bit LE PCM chunks into a streaming AudioTrack (USAGE_MEDIA, so it\n // follows the phone's media route, e.g. A2DP to glasses). Implemented with\n // AudioTrack on Android and AVAudioEngine on iOS.\n /**\n * Open a PCM stream session. One AudioTrack per id; caller manages ids.\n *\n * `jitterMs` sizes the playout buffer and is therefore also the stream's floor latency, since a\n * streaming track fills to its buffer and stays there. Omit it for one-way media, where the\n * default cushion is inaudible; pass a small value for conversational audio, where the same\n * cushion is delay before the far end is heard. Android only — iOS accepts and ignores it.\n */\n pcmStreamOpen(\n streamId: string,\n sampleRate: number,\n channels: number,\n volume: number,\n jitterMs?: number,\n ): Promise<void>\n /**\n * Append base64 PCM. Resolves with the queued-but-unplayed backlog in ms;\n * blocks (on a background dispatcher) while the backlog is above the\n * backpressure ceiling, so awaited writes self-throttle to realtime.\n */\n pcmStreamWrite(streamId: string, base64: string): Promise<{bufferedMs: number}>\n /** Drain the backlog, then stop. Resolves with the total played duration. */\n pcmStreamClose(streamId: string): Promise<{durationMs: number}>\n /** Stop immediately, dropping any backlog. Idempotent. */\n pcmStreamAbort(streamId: string): Promise<void>\n\n /** Mentra Live only: K900 `cs_getvol` / `sr_getvol`. */\n getGlassesMediaVolume(): Promise<GlassesMediaVolumeGetResult>\n /** Mentra Live only: K900 `cs_vol` / `sr_vol`; level clamped 0??5 on native. */\n setGlassesMediaVolume(level: number): Promise<GlassesMediaVolumeSetResult>\n\n // RGB LED Control\n rgbLedControl(\n requestId: string,\n packageName: string | null,\n action: RgbLedAction,\n color: RgbLedColor | null,\n onDurationMs: number,\n offDurationMs: number,\n count: number,\n ): Promise<RgbLedControlSuccessResponseEvent>\n\n // STT Commands\n setSttModelDetails(path: string, languageCode: string): Promise<void>\n getSttModelPath(): Promise<string>\n checkSttModelAvailable(): Promise<boolean>\n validateSttModel(path: string): Promise<boolean>\n extractTarBz2(sourcePath: string, destinationPath: string): Promise<boolean>\n\n // TTS Commands\n setTtsModelDetails(path: string, languageCode: string): Promise<void>\n getTtsModelPath(): Promise<string>\n getTtsModelLanguage(): Promise<string>\n checkTtsModelAvailable(): Promise<boolean>\n validateTtsModel(path: string): Promise<boolean>\n generateTtsAudio(\n text: string,\n modelPath: string,\n outputPath: string,\n speakerId: number,\n speed: number,\n ): Promise<boolean>\n\n /** Android G2 content upload. iOS receives ANCS directly and rejects uploads. */\n sendPhoneNotification(notification: NativePhoneNotification): Promise<void>\n configureNativeNotifications(config: NativeNotificationConfig): Promise<void>\n getNativeNotificationStatus(): Promise<NativeNotificationStatus>\n\n // Helper methods for type-safe observable store access\n updateGlasses(values: Partial<GlassesStatus>): Promise<void>\n updateBluetoothSettings(values: BluetoothSettingsUpdate): Promise<void>\n onGlassesStatus(callback: GlassesListener): () => void\n onBluetoothStatus(callback: BluetoothStatusListener): () => void\n\n // Process resident-set-size in MB. iOS-only; Android stub returns 0.\n getMemoryMB(): number\n}\n\nexport type BluetoothSdkInternalModule = BluetoothSdkNativeModule\n\n// This call loads the native module object from the JSI.\n// NativeModule<BluetoothSdkModuleEvents> already extends EventEmitter<BluetoothSdkModuleEvents>\nconst NativeBluetoothSdkModule = requireNativeModule<BluetoothSdkNativeModule>(\"BluetoothSdk\")\ninstallNativeLogConsole(NativeBluetoothSdkModule, Platform.OS)\n\nconst DEFAULT_CONNECT_OPTIONS: Required<ConnectOptions> = {\n saveAsDefault: true,\n cancelExistingConnectionAttempt: true,\n requiresAncs: true,\n}\n\nconst DEFAULT_SCAN_TIMEOUT_MS = 15_000\n\nfunction bindNativeMethod<T extends (...args: never[]) => unknown>(module: Record<string, unknown>, name: string): T {\n const method = module[name]\n if (typeof method !== \"function\") {\n console.warn(`[BluetoothSdk] Native method \"${name}\" is unavailable ??rebuild the app (bun android / bun ios)`)\n return (async () => {\n throw new Error(`BluetoothSdk.${name} is not available in this native build. Rebuild the app.`)\n }) as T\n }\n return method.bind(module) as T\n}\n\nconst CAMERA_ROI_MIN = 0\nconst CAMERA_ROI_MAX = 2\nconst CAMERA_ROI_POSITION_VALUES: Record<CameraRoiPosition, CameraFovSetting[\"roiPosition\"]> = {\n center: 0,\n bottom: 1,\n top: 2,\n}\n\n// Named presets are a convenience layer over the numeric {fov, roiPosition} API.\n// The default is the full sensor; \"standard\" preserves the historical 102° crop.\nconst CAMERA_FOV_PRESETS: Record<CameraFovPreset, CameraFovSetting> = {\n narrow: {fov: 82, roiPosition: 0},\n standard: {fov: 102, roiPosition: 0},\n wide: {fov: CAMERA_FOV_MAX, roiPosition: 0},\n}\n\nfunction clampInteger(value: number, min: number, max: number): number {\n return Math.max(min, Math.min(max, Math.round(value)))\n}\n\nfunction normalizeCameraFov(request: CameraFovRequest): CameraFovSetting {\n if (\"preset\" in request) {\n return CAMERA_FOV_PRESETS[request.preset] ?? CAMERA_FOV_PRESETS.standard\n }\n\n const roiPosition = request.roiPosition ?? \"center\"\n\n return {\n fov: clampInteger(Number.isFinite(request.fov) ? request.fov : CAMERA_FOV_DEFAULT, CAMERA_FOV_MIN, CAMERA_FOV_MAX),\n roiPosition: clampInteger(CAMERA_ROI_POSITION_VALUES[roiPosition] ?? 0, CAMERA_ROI_MIN, CAMERA_ROI_MAX) as\n | 0\n | 1\n | 2,\n }\n}\n\nfunction searchResultsForModel(status: Partial<PublicBluetoothStatus>, model: DeviceModel): Device[] {\n return status.searchResults?.filter((device) => device.model === model) ?? []\n}\n\nfunction normalizeScanArgs(modelOrOptions: DeviceModel | ScanOptions, options?: ScanModelOptions): ScanOptions {\n if (typeof modelOrOptions === \"string\") {\n return {model: modelOrOptions, ...options}\n }\n return modelOrOptions\n}\n\nfunction normalizeTimeoutMs(timeoutMs: number | undefined, defaultTimeoutMs: number): number {\n return typeof timeoutMs === \"number\" && Number.isFinite(timeoutMs) && timeoutMs > 0 ? timeoutMs : defaultTimeoutMs\n}\n\nfunction dashboardMenuItemToNative(item: DashboardMenuItem): Record<string, unknown> {\n return {\n ...(item.values ?? {}),\n title: item.title,\n packageName: item.packageName,\n }\n}\n\nfunction adaptConnectionStatusToNative(connection: GlassesStatus[\"connection\"]): Record<string, unknown> {\n switch (connection.state) {\n case \"connected\":\n return {connectionState: \"CONNECTED\", connected: true, fullyBooted: connection.fullyBooted}\n case \"scanning\":\n return {connectionState: \"SCANNING\", connected: false, fullyBooted: false}\n case \"connecting\":\n return {connectionState: \"CONNECTING\", connected: false, fullyBooted: false}\n case \"bonding\":\n return {connectionState: \"BONDING\", connected: false, fullyBooted: false}\n case \"disconnected\":\n return {connectionState: \"DISCONNECTED\", connected: false, fullyBooted: false}\n }\n}\n\nfunction adaptGlassesUpdateToNative(values: Partial<GlassesStatus>): Record<string, unknown> {\n const {wifi, hotspot, connection, ...rest} = values\n let update: Record<string, unknown> = {...rest}\n if (connection) {\n update = {\n ...update,\n ...adaptConnectionStatusToNative(connection),\n }\n }\n if (wifi?.state === \"connected\") {\n update = {\n ...update,\n wifiConnected: true,\n wifiSsid: wifi.ssid,\n wifiLocalIp: wifi.localIp ?? \"\",\n }\n } else if (wifi?.state === \"disconnected\") {\n update = {\n ...update,\n wifiConnected: false,\n wifiSsid: \"\",\n wifiLocalIp: \"\",\n }\n }\n if (hotspot?.state === \"enabled\") {\n update = {\n ...update,\n hotspotEnabled: true,\n hotspotSsid: hotspot.ssid,\n hotspotPassword: hotspot.password,\n hotspotGatewayIp: hotspot.localIp,\n }\n } else if (hotspot?.state === \"disabled\") {\n update = {\n ...update,\n hotspotEnabled: false,\n hotspotSsid: \"\",\n hotspotPassword: \"\",\n hotspotGatewayIp: \"\",\n }\n }\n return update\n}\n\n// Add helper methods to the module\nconst nativeGetGlassesStatus = NativeBluetoothSdkModule.getGlassesStatus.bind(\n NativeBluetoothSdkModule,\n) as () => MaybePromise<GlassesStatus>\nNativeBluetoothSdkModule.getGlassesStatus = function () {\n return Promise.resolve(nativeGetGlassesStatus())\n}\n\nconst nativeGetBluetoothStatus = NativeBluetoothSdkModule.getBluetoothStatus.bind(\n NativeBluetoothSdkModule,\n) as () => MaybePromise<BluetoothStatus>\nNativeBluetoothSdkModule.getBluetoothStatus = function () {\n return Promise.resolve(nativeGetBluetoothStatus())\n}\n\nconst nativeGetDefaultDevice = NativeBluetoothSdkModule.getDefaultDevice.bind(\n NativeBluetoothSdkModule,\n) as () => MaybePromise<Device | null>\nNativeBluetoothSdkModule.getDefaultDevice = function () {\n return Promise.resolve(nativeGetDefaultDevice())\n}\n\nconst nativeSetMicState = NativeBluetoothSdkModule.setMicState.bind(NativeBluetoothSdkModule) as (\n enabled: boolean,\n useGlassesMic: boolean,\n sendTranscript: boolean,\n sendLc3Data: boolean,\n) => MaybePromise<void>\n\nconst nativeDisplayText = NativeBluetoothSdkModule.displayText.bind(NativeBluetoothSdkModule) as (\n text: string,\n x: number,\n y: number,\n size: number,\n) => MaybePromise<void>\n\nNativeBluetoothSdkModule.updateGlasses = function (values: Partial<GlassesStatus>) {\n return this.update(\"glasses\", adaptGlassesUpdateToNative(values))\n}\n\nNativeBluetoothSdkModule.updateBluetoothSettings = function (values: BluetoothSettingsUpdate) {\n return this.update(\"bluetooth\", values)\n}\n\nNativeBluetoothSdkModule.displayText = function (text: string, x?: number, y?: number, size?: number) {\n return Promise.resolve(nativeDisplayText(text, x ?? 0, y ?? 0, size ?? 24))\n}\n\nNativeBluetoothSdkModule.setBrightness = function (level: number, autoMode?: boolean | null) {\n return this.updateBluetoothSettings({\n ...(autoMode == null ? {} : {auto_brightness: autoMode}),\n brightness: level,\n })\n}\n\nNativeBluetoothSdkModule.setAutoBrightness = function (enabled: boolean) {\n return this.updateBluetoothSettings({auto_brightness: enabled})\n}\n\nNativeBluetoothSdkModule.setDashboardPosition = function (height: number, depth: number) {\n return this.updateBluetoothSettings({\n dashboard_height: height,\n dashboard_depth: depth,\n })\n}\n\nNativeBluetoothSdkModule.setDashboardMenu = function (items: DashboardMenuItem[]) {\n return this.updateBluetoothSettings({menu_apps: items.map(dashboardMenuItemToNative)})\n}\n\nNativeBluetoothSdkModule.setCalendarEvents = function (events: CalendarEvent[]) {\n return this.updateBluetoothSettings({calendar_events: events})\n}\n\nNativeBluetoothSdkModule.setHeadUpAngle = function (angleDegrees: number) {\n return this.updateBluetoothSettings({head_up_angle: angleDegrees})\n}\n\nNativeBluetoothSdkModule.setImuEnabled = function (enabled: boolean) {\n return this.updateBluetoothSettings({imu_enabled: enabled})\n}\n\nNativeBluetoothSdkModule.setScreenDisabled = function (disabled: boolean) {\n return this.updateBluetoothSettings({screen_disabled: disabled})\n}\n\nNativeBluetoothSdkModule.setVoiceActivityDetectionEnabled = function (enabled: boolean) {\n return this.updateBluetoothSettings({voice_activity_detection_enabled: enabled})\n}\n\nNativeBluetoothSdkModule.setLoudnessGateEnabled = function (enabled: boolean) {\n return this.updateBluetoothSettings({loudness_gate_enabled: enabled})\n}\n\nconst nativeSetCameraFov = bindNativeMethod<(fov: CameraFovSetting) => MaybePromise<CameraFovResult>>(\n NativeBluetoothSdkModule as unknown as Record<string, unknown>,\n \"setCameraFov\",\n)\nNativeBluetoothSdkModule.setCameraFov = function (request: CameraFovRequest) {\n const setting = normalizeCameraFov(request)\n return Promise.resolve(nativeSetCameraFov(setting))\n}\n\nconst nativeSetLegacyCameraFov = bindNativeMethod<(fov: CameraFovSetting) => MaybePromise<CameraFovResult>>(\n NativeBluetoothSdkModule as unknown as Record<string, unknown>,\n \"setLegacyCameraFov\",\n)\nNativeBluetoothSdkModule.setLegacyCameraFov = function (request: CameraFovRequest) {\n return Promise.resolve(nativeSetLegacyCameraFov(normalizeCameraFov(request)))\n}\n\nconst nativeRestoreLegacyCameraFov = bindNativeMethod<() => MaybePromise<void>>(\n NativeBluetoothSdkModule as unknown as Record<string, unknown>,\n \"restoreLegacyCameraFov\",\n)\nNativeBluetoothSdkModule.restoreLegacyCameraFov = function () {\n return Promise.resolve(nativeRestoreLegacyCameraFov())\n}\n\nconst nativeSetCameraFovOverride = bindNativeMethod<\n (request: CameraFovSetting & {leaseId: string; ttlMs: number}) => MaybePromise<CameraFovResult>\n>(NativeBluetoothSdkModule as unknown as Record<string, unknown>, \"setCameraFovOverride\")\nNativeBluetoothSdkModule.setCameraFovOverride = function (request: CameraFovOverrideRequest) {\n const setting = normalizeCameraFov(request)\n const requestedTtl =\n typeof request.ttlMs === \"number\" && Number.isFinite(request.ttlMs) && request.ttlMs > 0\n ? Math.round(request.ttlMs)\n : 300_000\n return Promise.resolve(\n nativeSetCameraFovOverride({\n ...setting,\n leaseId: request.leaseId,\n ttlMs: Math.min(requestedTtl, 600_000),\n }),\n )\n}\n\nNativeBluetoothSdkModule.setMicState = function (\n enabled: boolean,\n useGlassesMic?: boolean,\n sendTranscript?: boolean,\n sendLc3Data?: boolean,\n) {\n return Promise.resolve(\n nativeSetMicState(enabled, useGlassesMic ?? true, sendTranscript ?? false, sendLc3Data ?? false),\n )\n}\n\nNativeBluetoothSdkModule.setPreferredMic = function (preferredMic: MicPreference) {\n return this.updateBluetoothSettings({preferred_mic: preferredMic})\n}\n\nNativeBluetoothSdkModule.onGlassesStatus = function (callback: GlassesListener) {\n const subscription = this.addListener(\"glasses_status\", callback)\n return () => subscription.remove()\n}\n\nNativeBluetoothSdkModule.onBluetoothStatus = function (callback: BluetoothStatusListener) {\n const subscription = this.addListener(\"bluetooth_status\", callback)\n return () => subscription.remove()\n}\n\nconst nativeConnectDefault = NativeBluetoothSdkModule.connectDefault.bind(NativeBluetoothSdkModule)\nNativeBluetoothSdkModule.connectDefault = function (options?: ConnectOptions) {\n if (!options) {\n return nativeConnectDefault()\n }\n return this.connectDefaultWithOptions({...DEFAULT_CONNECT_OPTIONS, ...options})\n}\n\nNativeBluetoothSdkModule.connect = function (device: Device, options?: ConnectOptions) {\n return this.connectWithOptions(device, {...DEFAULT_CONNECT_OPTIONS, ...options})\n}\n\nconst nativeStopScan = NativeBluetoothSdkModule.stopScan.bind(NativeBluetoothSdkModule)\nconst activeScanCancellations = new Set<() => Promise<void>>()\nNativeBluetoothSdkModule.stopScan = async function () {\n if (activeScanCancellations.size === 0) return nativeStopScan()\n await Promise.all([...activeScanCancellations].map(cancel => cancel()))\n}\n\nNativeBluetoothSdkModule.scan = async function (modelOrOptions: DeviceModel | ScanOptions, options?: ScanModelOptions) {\n if (activeScanCancellations.size > 0) await this.stopScan()\n const scanOptions = normalizeScanArgs(modelOrOptions, options)\n const timeoutMs = normalizeTimeoutMs(scanOptions.timeoutMs ?? scanOptions.timeout, DEFAULT_SCAN_TIMEOUT_MS)\n const session = createScanSession(\n {\n start: (model) => this.startScan(model),\n stop: nativeStopScan,\n subscribe: (onResults) =>\n this.onBluetoothStatus((status) => {\n if (Array.isArray(status.searchResults)) onResults(searchResultsForModel(status, scanOptions.model))\n }),\n getResults: async () => searchResultsForModel(await this.getBluetoothStatus(), scanOptions.model),\n // Older native binaries simply omit diagnostics until the host is rebuilt.\n getDiagnostic:\n typeof this.getScanDiagnostic === \"function\" ? () => this.getScanDiagnostic!(scanOptions.model) : undefined,\n },\n {...scanOptions, timeoutMs},\n )\n activeScanCancellations.add(session.cancel)\n try {\n return await session.result\n } finally {\n activeScanCancellations.delete(session.cancel)\n }\n}\n\nconst nativeRequestPhoto = NativeBluetoothSdkModule.requestPhoto.bind(NativeBluetoothSdkModule)\nNativeBluetoothSdkModule.requestPhoto = function (params: PhotoRequestParams) {\n return nativeRequestPhoto(photoRequestParamsForNative(params) as unknown as PhotoRequestParams)\n}\n\nconst nativeWarmUpCamera = NativeBluetoothSdkModule.warmUpCamera.bind(NativeBluetoothSdkModule)\nNativeBluetoothSdkModule.warmUpCamera = function (params: WarmUpCameraParams) {\n return nativeWarmUpCamera(warmUpCameraParamsForNative(params) as unknown as WarmUpCameraParams)\n}\n\nconst nativeStartStream = bindNativeMethod<(params: StreamStartRequest) => Promise<StreamStatusEvent>>(\n NativeBluetoothSdkModule as unknown as Record<string, unknown>,\n \"startStream\",\n)\nNativeBluetoothSdkModule.startStream = function (params: StreamStartRequest) {\n return nativeStartStream(streamRequestParamsForNative(params) as unknown as StreamStartRequest)\n}\n\nexport default NativeBluetoothSdkModule\nexport const BluetoothSdk = NativeBluetoothSdkModule as BluetoothSdkInternalModule\n"]}
@@ -0,0 +1,8 @@
1
+ import type { StreamStartRequest } from "../BluetoothSdk.types";
2
+ /**
3
+ * Normalizes stream start request parameters for the native module bridge.
4
+ * Preserves omission of telemetry when undefined so the glasses use their build default,
5
+ * and forwards explicit true / false.
6
+ */
7
+ export declare function streamRequestParamsForNative(params: StreamStartRequest): Record<string, unknown>;
8
+ //# sourceMappingURL=streamRequestPayload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streamRequestPayload.d.ts","sourceRoot":"","sources":["../../src/_private/streamRequestPayload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,uBAAuB,CAAA;AAE7D;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAmChG"}