@mentra/engine 0.1.0-dev.0 → 3.1.0-beta.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -18
- package/build/bluetooth-sdk/debug.d.ts +2 -0
- package/build/bluetooth-sdk/debug.d.ts.map +1 -0
- package/build/bluetooth-sdk/debug.js +2 -0
- package/build/bluetooth-sdk/debug.js.map +1 -0
- package/build/bluetooth-sdk/index.d.ts +3 -0
- package/build/bluetooth-sdk/index.d.ts.map +1 -0
- package/build/bluetooth-sdk/index.js +3 -0
- package/build/bluetooth-sdk/index.js.map +1 -0
- package/build/bluetooth-sdk/ota-transport.d.ts +2 -0
- package/build/bluetooth-sdk/ota-transport.d.ts.map +1 -0
- package/build/bluetooth-sdk/ota-transport.js +2 -0
- package/build/bluetooth-sdk/ota-transport.js.map +1 -0
- package/build/bluetooth-sdk/photo-receiver.d.ts +3 -0
- package/build/bluetooth-sdk/photo-receiver.d.ts.map +1 -0
- package/build/bluetooth-sdk/photo-receiver.js +3 -0
- package/build/bluetooth-sdk/photo-receiver.js.map +1 -0
- package/build/bluetooth-sdk/react.d.ts +2 -0
- package/build/bluetooth-sdk/react.d.ts.map +1 -0
- package/build/bluetooth-sdk/react.js +2 -0
- package/build/bluetooth-sdk/react.js.map +1 -0
- package/build/bluetooth-sdk/types.d.ts +2 -0
- package/build/bluetooth-sdk/types.d.ts.map +1 -0
- package/build/bluetooth-sdk/types.js +2 -0
- package/build/bluetooth-sdk/types.js.map +1 -0
- package/build/engine.d.ts +29 -18
- package/build/engine.d.ts.map +1 -1
- package/build/engine.js +9 -4
- package/build/engine.js.map +1 -1
- package/build/facades/dev.d.ts +3 -2
- package/build/facades/dev.d.ts.map +1 -1
- package/build/facades/dev.js +18 -12
- package/build/facades/dev.js.map +1 -1
- package/build/facades/display.d.ts +1 -1
- package/build/facades/display.d.ts.map +1 -1
- package/build/facades/display.js +1 -1
- package/build/facades/display.js.map +1 -1
- package/build/facades/gallery.js +1 -1
- package/build/facades/gallery.js.map +1 -1
- package/build/facades/glasses.d.ts +4 -13
- package/build/facades/glasses.d.ts.map +1 -1
- package/build/facades/glasses.js +21 -6
- package/build/facades/glasses.js.map +1 -1
- package/build/facades/glassesSettings.d.ts.map +1 -1
- package/build/facades/glassesSettings.js +1 -0
- package/build/facades/glassesSettings.js.map +1 -1
- package/build/facades/miniapps.d.ts +4 -0
- package/build/facades/miniapps.d.ts.map +1 -1
- package/build/facades/miniapps.js +5 -0
- package/build/facades/miniapps.js.map +1 -1
- package/build/facades/ota.d.ts +24 -21
- package/build/facades/ota.d.ts.map +1 -1
- package/build/facades/ota.js +31 -12
- package/build/facades/ota.js.map +1 -1
- package/build/facades/pairing.d.ts +12 -5
- package/build/facades/pairing.d.ts.map +1 -1
- package/build/facades/pairing.js +93 -17
- package/build/facades/pairing.js.map +1 -1
- package/build/facades/permissions.d.ts +10 -0
- package/build/facades/permissions.d.ts.map +1 -1
- package/build/facades/permissions.js +10 -0
- package/build/facades/permissions.js.map +1 -1
- package/build/facades/phoneNotifications.d.ts +0 -4
- package/build/facades/phoneNotifications.d.ts.map +1 -1
- package/build/facades/phoneNotifications.js +4 -14
- package/build/facades/phoneNotifications.js.map +1 -1
- package/build/facades/speech.d.ts +7 -6
- package/build/facades/speech.d.ts.map +1 -1
- package/build/facades/speech.js +1 -1
- package/build/facades/speech.js.map +1 -1
- package/build/generated/releaseMetadata.d.ts +12 -0
- package/build/generated/releaseMetadata.d.ts.map +1 -0
- package/build/generated/releaseMetadata.js +10 -0
- package/build/generated/releaseMetadata.js.map +1 -0
- package/build/index.d.ts +12 -10
- package/build/index.d.ts.map +1 -1
- package/build/index.js +7 -6
- package/build/index.js.map +1 -1
- package/build/react/MentraLiveOtaFlow.d.ts +44 -0
- package/build/react/MentraLiveOtaFlow.d.ts.map +1 -0
- package/build/react/MentraLiveOtaFlow.js +430 -0
- package/build/react/MentraLiveOtaFlow.js.map +1 -0
- package/build/react/index.d.ts +3 -0
- package/build/react/index.d.ts.map +1 -0
- package/build/react/index.js +3 -0
- package/build/react/index.js.map +1 -0
- package/build/react/useEngineSnapshot.d.ts +2 -0
- package/build/react/useEngineSnapshot.d.ts.map +1 -0
- package/build/react/useEngineSnapshot.js +14 -0
- package/build/react/useEngineSnapshot.js.map +1 -0
- package/build/react/useMentraLiveOta.d.ts +84 -0
- package/build/react/useMentraLiveOta.d.ts.map +1 -0
- package/build/react/useMentraLiveOta.js +627 -0
- package/build/react/useMentraLiveOta.js.map +1 -0
- package/build/runtime/bootstrap.d.ts +24 -1
- package/build/runtime/bootstrap.d.ts.map +1 -1
- package/build/runtime/bootstrap.js +17 -0
- package/build/runtime/bootstrap.js.map +1 -1
- package/build/runtime/scanQrSeam.d.ts +7 -0
- package/build/runtime/scanQrSeam.d.ts.map +1 -0
- package/build/runtime/scanQrSeam.js +16 -0
- package/build/runtime/scanQrSeam.js.map +1 -0
- package/build/services/AppRegistry.d.ts +41 -57
- package/build/services/AppRegistry.d.ts.map +1 -1
- package/build/services/AppRegistry.js +208 -144
- package/build/services/AppRegistry.js.map +1 -1
- package/build/services/AudioCloudUplink.d.ts +12 -0
- package/build/services/AudioCloudUplink.d.ts.map +1 -1
- package/build/services/AudioCloudUplink.js +22 -1
- package/build/services/AudioCloudUplink.js.map +1 -1
- package/build/services/AudioPlaybackService.d.ts +41 -2
- package/build/services/AudioPlaybackService.d.ts.map +1 -1
- package/build/services/AudioPlaybackService.js +250 -33
- package/build/services/AudioPlaybackService.js.map +1 -1
- package/build/services/BlobStore.d.ts +4 -1
- package/build/services/BlobStore.d.ts.map +1 -1
- package/build/services/BlobStore.js +80 -19
- package/build/services/BlobStore.js.map +1 -1
- package/build/services/CloudAudioSubscriptionSync.d.ts.map +1 -1
- package/build/services/CloudAudioSubscriptionSync.js +13 -1
- package/build/services/CloudAudioSubscriptionSync.js.map +1 -1
- package/build/services/CloudClientService.d.ts +15 -0
- package/build/services/CloudClientService.d.ts.map +1 -1
- package/build/services/CloudClientService.js +93 -1
- package/build/services/CloudClientService.js.map +1 -1
- package/build/services/DeviceEventRouter.js +5 -5
- package/build/services/DeviceEventRouter.js.map +1 -1
- package/build/services/DisplayProcessor.d.ts +3 -3
- package/build/services/DisplayProcessor.js +3 -3
- package/build/services/DisplayProcessor.js.map +1 -1
- package/build/services/ForegroundLocationPermission.d.ts +13 -0
- package/build/services/ForegroundLocationPermission.d.ts.map +1 -0
- package/build/services/ForegroundLocationPermission.js +12 -0
- package/build/services/ForegroundLocationPermission.js.map +1 -0
- package/build/services/GlassesSettingsSync.d.ts.map +1 -1
- package/build/services/GlassesSettingsSync.js +9 -3
- package/build/services/GlassesSettingsSync.js.map +1 -1
- package/build/services/GlassesStatusProjection.d.ts +15 -1
- package/build/services/GlassesStatusProjection.d.ts.map +1 -1
- package/build/services/GlassesStatusProjection.js +18 -11
- package/build/services/GlassesStatusProjection.js.map +1 -1
- package/build/services/HotspotOtaTransport.d.ts +29 -0
- package/build/services/HotspotOtaTransport.d.ts.map +1 -0
- package/build/services/HotspotOtaTransport.js +147 -0
- package/build/services/HotspotOtaTransport.js.map +1 -0
- package/build/services/HotspotShutdown.d.ts +17 -0
- package/build/services/HotspotShutdown.d.ts.map +1 -0
- package/build/services/HotspotShutdown.js +29 -0
- package/build/services/HotspotShutdown.js.map +1 -0
- package/build/services/LocalDisplayManager.d.ts +17 -3
- package/build/services/LocalDisplayManager.d.ts.map +1 -1
- package/build/services/LocalDisplayManager.js +108 -23
- package/build/services/LocalDisplayManager.js.map +1 -1
- package/build/services/LocalMiniappRuntime.d.ts +74 -2
- package/build/services/LocalMiniappRuntime.d.ts.map +1 -1
- package/build/services/LocalMiniappRuntime.js +785 -291
- package/build/services/LocalMiniappRuntime.js.map +1 -1
- package/build/services/LocalMiniappStorage.d.ts +32 -0
- package/build/services/LocalMiniappStorage.d.ts.map +1 -0
- package/build/services/LocalMiniappStorage.js +66 -0
- package/build/services/LocalMiniappStorage.js.map +1 -0
- package/build/services/LocalMiniappUserIdentity.d.ts +20 -0
- package/build/services/LocalMiniappUserIdentity.d.ts.map +1 -0
- package/build/services/LocalMiniappUserIdentity.js +43 -0
- package/build/services/LocalMiniappUserIdentity.js.map +1 -0
- package/build/services/LocalSttFallbackCoordinator.d.ts +9 -6
- package/build/services/LocalSttFallbackCoordinator.d.ts.map +1 -1
- package/build/services/LocalSttFallbackCoordinator.js +18 -12
- package/build/services/LocalSttFallbackCoordinator.js.map +1 -1
- package/build/services/MicStateCoordinator.d.ts +42 -1
- package/build/services/MicStateCoordinator.d.ts.map +1 -1
- package/build/services/MicStateCoordinator.js +141 -3
- package/build/services/MicStateCoordinator.js.map +1 -1
- package/build/services/MiniappLauncher.d.ts.map +1 -1
- package/build/services/MiniappLauncher.js +23 -3
- package/build/services/MiniappLauncher.js.map +1 -1
- package/build/services/MiniappLiveness.d.ts +12 -0
- package/build/services/MiniappLiveness.d.ts.map +1 -0
- package/build/services/MiniappLiveness.js +16 -0
- package/build/services/MiniappLiveness.js.map +1 -0
- package/build/services/NativeHttpResponse.d.ts +3 -0
- package/build/services/NativeHttpResponse.d.ts.map +1 -0
- package/build/services/NativeHttpResponse.js +6 -0
- package/build/services/NativeHttpResponse.js.map +1 -0
- package/build/services/OtaArtifactDownloader.d.ts +65 -0
- package/build/services/OtaArtifactDownloader.d.ts.map +1 -0
- package/build/services/OtaArtifactDownloader.js +226 -0
- package/build/services/OtaArtifactDownloader.js.map +1 -0
- package/build/services/OtaAutoChain.d.ts +41 -0
- package/build/services/OtaAutoChain.d.ts.map +1 -0
- package/build/services/OtaAutoChain.js +91 -0
- package/build/services/OtaAutoChain.js.map +1 -0
- package/build/services/OtaErrorMapping.d.ts +18 -0
- package/build/services/OtaErrorMapping.d.ts.map +1 -0
- package/build/services/OtaErrorMapping.js +63 -0
- package/build/services/OtaErrorMapping.js.map +1 -0
- package/build/services/OtaInstallCoordinator.d.ts +120 -17
- package/build/services/OtaInstallCoordinator.d.ts.map +1 -1
- package/build/services/OtaInstallCoordinator.js +605 -136
- package/build/services/OtaInstallCoordinator.js.map +1 -1
- package/build/services/OtaService.d.ts.map +1 -1
- package/build/services/OtaService.js +9 -2
- package/build/services/OtaService.js.map +1 -1
- package/build/services/OtaUpdateCheckService.d.ts +42 -4
- package/build/services/OtaUpdateCheckService.d.ts.map +1 -1
- package/build/services/OtaUpdateCheckService.js +158 -26
- package/build/services/OtaUpdateCheckService.js.map +1 -1
- package/build/services/PhoneCalendarHelpers.d.ts +32 -0
- package/build/services/PhoneCalendarHelpers.d.ts.map +1 -0
- package/build/services/PhoneCalendarHelpers.js +157 -0
- package/build/services/PhoneCalendarHelpers.js.map +1 -0
- package/build/services/PhoneCalendarService.d.ts +5 -0
- package/build/services/PhoneCalendarService.d.ts.map +1 -0
- package/build/services/PhoneCalendarService.js +45 -0
- package/build/services/PhoneCalendarService.js.map +1 -0
- package/build/services/PhoneCameraFovCoordinator.d.ts +30 -0
- package/build/services/PhoneCameraFovCoordinator.d.ts.map +1 -0
- package/build/services/PhoneCameraFovCoordinator.js +194 -0
- package/build/services/PhoneCameraFovCoordinator.js.map +1 -0
- package/build/services/PhoneNotificationsSync.d.ts.map +1 -1
- package/build/services/PhoneNotificationsSync.js +12 -10
- package/build/services/PhoneNotificationsSync.js.map +1 -1
- package/build/services/PhonePhotoCoordinator.d.ts +26 -2
- package/build/services/PhonePhotoCoordinator.d.ts.map +1 -1
- package/build/services/PhonePhotoCoordinator.js +80 -10
- package/build/services/PhonePhotoCoordinator.js.map +1 -1
- package/build/services/PhoneStreamCoordinator.d.ts +8 -1
- package/build/services/PhoneStreamCoordinator.d.ts.map +1 -1
- package/build/services/PhoneStreamCoordinator.js +125 -13
- package/build/services/PhoneStreamCoordinator.js.map +1 -1
- package/build/services/PhoneVideoCoordinator.d.ts +2 -0
- package/build/services/PhoneVideoCoordinator.d.ts.map +1 -1
- package/build/services/PhoneVideoCoordinator.js +10 -0
- package/build/services/PhoneVideoCoordinator.js.map +1 -1
- package/build/services/SceneRenderer.d.ts.map +1 -1
- package/build/services/SceneRenderer.js +15 -0
- package/build/services/SceneRenderer.js.map +1 -1
- package/build/services/SentenceTtsPipeline.d.ts +31 -0
- package/build/services/SentenceTtsPipeline.d.ts.map +1 -0
- package/build/services/SentenceTtsPipeline.js +67 -0
- package/build/services/SentenceTtsPipeline.js.map +1 -0
- package/build/services/StreamLifecycleController.d.ts +3 -3
- package/build/services/StreamLifecycleController.js +3 -3
- package/build/services/StreamLifecycleController.js.map +1 -1
- package/build/services/SupportProfileSync.d.ts +22 -0
- package/build/services/SupportProfileSync.d.ts.map +1 -0
- package/build/services/SupportProfileSync.js +213 -0
- package/build/services/SupportProfileSync.js.map +1 -0
- package/build/services/TranscriptionRouting.d.ts +12 -0
- package/build/services/TranscriptionRouting.d.ts.map +1 -0
- package/build/services/TranscriptionRouting.js +24 -0
- package/build/services/TranscriptionRouting.js.map +1 -0
- package/build/services/TtsTextSanitizer.d.ts +5 -0
- package/build/services/TtsTextSanitizer.d.ts.map +1 -0
- package/build/services/TtsTextSanitizer.js +61 -0
- package/build/services/TtsTextSanitizer.js.map +1 -0
- package/build/services/WifiAdbRequest.d.ts +17 -0
- package/build/services/WifiAdbRequest.d.ts.map +1 -0
- package/build/services/WifiAdbRequest.js +35 -0
- package/build/services/WifiAdbRequest.js.map +1 -0
- package/build/services/asg/asgCameraApi.d.ts +43 -0
- package/build/services/asg/asgCameraApi.d.ts.map +1 -1
- package/build/services/asg/asgCameraApi.js +509 -26
- package/build/services/asg/asgCameraApi.js.map +1 -1
- package/build/services/asg/cameraRollExportCoordinator.d.ts +60 -0
- package/build/services/asg/cameraRollExportCoordinator.d.ts.map +1 -0
- package/build/services/asg/cameraRollExportCoordinator.js +618 -0
- package/build/services/asg/cameraRollExportCoordinator.js.map +1 -0
- package/build/services/asg/cameraRollExportLedger.d.ts +44 -0
- package/build/services/asg/cameraRollExportLedger.d.ts.map +1 -0
- package/build/services/asg/cameraRollExportLedger.js +78 -0
- package/build/services/asg/cameraRollExportLedger.js.map +1 -0
- package/build/services/asg/galleryNotices.d.ts +1 -1
- package/build/services/asg/galleryNotices.d.ts.map +1 -1
- package/build/services/asg/galleryNotices.js.map +1 -1
- package/build/services/asg/galleryPathMigration.d.ts +3 -0
- package/build/services/asg/galleryPathMigration.d.ts.map +1 -0
- package/build/services/asg/galleryPathMigration.js +26 -0
- package/build/services/asg/galleryPathMigration.js.map +1 -0
- package/build/services/asg/gallerySettingsService.d.ts +1 -0
- package/build/services/asg/gallerySettingsService.d.ts.map +1 -1
- package/build/services/asg/gallerySettingsService.js +2 -0
- package/build/services/asg/gallerySettingsService.js.map +1 -1
- package/build/services/asg/gallerySyncService.d.ts.map +1 -1
- package/build/services/asg/gallerySyncService.js +162 -56
- package/build/services/asg/gallerySyncService.js.map +1 -1
- package/build/services/asg/galleryTransferLedger.d.ts +58 -0
- package/build/services/asg/galleryTransferLedger.d.ts.map +1 -0
- package/build/services/asg/galleryTransferLedger.js +225 -0
- package/build/services/asg/galleryTransferLedger.js.map +1 -0
- package/build/services/asg/localNetworkTransport.d.ts +15 -0
- package/build/services/asg/localNetworkTransport.d.ts.map +1 -0
- package/build/services/asg/localNetworkTransport.js +145 -0
- package/build/services/asg/localNetworkTransport.js.map +1 -0
- package/build/services/asg/localStorageService.d.ts +18 -0
- package/build/services/asg/localStorageService.d.ts.map +1 -1
- package/build/services/asg/localStorageService.js +168 -19
- package/build/services/asg/localStorageService.js.map +1 -1
- package/build/services/asg/mediaProcessingQueue.d.ts +10 -0
- package/build/services/asg/mediaProcessingQueue.d.ts.map +1 -1
- package/build/services/asg/mediaProcessingQueue.js +193 -62
- package/build/services/asg/mediaProcessingQueue.js.map +1 -1
- package/build/services/audioPlaybackAssets.d.ts +8 -0
- package/build/services/audioPlaybackAssets.d.ts.map +1 -0
- package/build/services/audioPlaybackAssets.js +7 -0
- package/build/services/audioPlaybackAssets.js.map +1 -0
- package/build/services/gallerySyncClock.js +1 -1
- package/build/services/gallerySyncClock.js.map +1 -1
- package/build/services/glassesClockSync.d.ts.map +1 -1
- package/build/services/glassesClockSync.js +7 -3
- package/build/services/glassesClockSync.js.map +1 -1
- package/build/services/manifestActions.d.ts +7 -0
- package/build/services/manifestActions.d.ts.map +1 -0
- package/build/services/manifestActions.js +25 -0
- package/build/services/manifestActions.js.map +1 -0
- package/build/services/otaDisplayState.d.ts +23 -12
- package/build/services/otaDisplayState.d.ts.map +1 -1
- package/build/services/otaDisplayState.js +36 -14
- package/build/services/otaDisplayState.js.map +1 -1
- package/build/services/otaInstallPolicy.d.ts +20 -4
- package/build/services/otaInstallPolicy.d.ts.map +1 -1
- package/build/services/otaInstallPolicy.js +28 -3
- package/build/services/otaInstallPolicy.js.map +1 -1
- package/build/services/otaLegacyMapping.d.ts +1 -1
- package/build/services/otaLegacyMapping.d.ts.map +1 -1
- package/build/services/otaLegacyMapping.js.map +1 -1
- package/build/services/otaManifestPolicy.d.ts +14 -0
- package/build/services/otaManifestPolicy.d.ts.map +1 -0
- package/build/services/otaManifestPolicy.js +19 -0
- package/build/services/otaManifestPolicy.js.map +1 -0
- package/build/services/otaManifestUrl.d.ts +3 -0
- package/build/services/otaManifestUrl.d.ts.map +1 -0
- package/build/services/otaManifestUrl.js +38 -0
- package/build/services/otaManifestUrl.js.map +1 -0
- package/build/services/otaReleaseVersion.d.ts +10 -0
- package/build/services/otaReleaseVersion.d.ts.map +1 -0
- package/build/services/otaReleaseVersion.js +14 -0
- package/build/services/otaReleaseVersion.js.map +1 -0
- package/build/services/slimStreamStatus.d.ts +11 -0
- package/build/services/slimStreamStatus.d.ts.map +1 -1
- package/build/services/slimStreamStatus.js +14 -4
- package/build/services/slimStreamStatus.js.map +1 -1
- package/build/stores/appVisibility.d.ts +3 -0
- package/build/stores/appVisibility.d.ts.map +1 -0
- package/build/stores/appVisibility.js +3 -0
- package/build/stores/appVisibility.js.map +1 -0
- package/build/stores/apps.d.ts.map +1 -1
- package/build/stores/apps.js +18 -1
- package/build/stores/apps.js.map +1 -1
- package/build/stores/bluetoothSettingKeys.d.ts.map +1 -1
- package/build/stores/bluetoothSettingKeys.js +2 -0
- package/build/stores/bluetoothSettingKeys.js.map +1 -1
- package/build/stores/core.d.ts +3 -3
- package/build/stores/core.d.ts.map +1 -1
- package/build/stores/core.js.map +1 -1
- package/build/stores/gallerySync.d.ts +2 -0
- package/build/stores/gallerySync.d.ts.map +1 -1
- package/build/stores/gallerySync.js +2 -0
- package/build/stores/gallerySync.js.map +1 -1
- package/build/stores/glasses.d.ts +10 -4
- package/build/stores/glasses.d.ts.map +1 -1
- package/build/stores/glasses.js +3 -0
- package/build/stores/glasses.js.map +1 -1
- package/build/stores/settings.d.ts +17 -0
- package/build/stores/settings.d.ts.map +1 -1
- package/build/stores/settings.js +157 -17
- package/build/stores/settings.js.map +1 -1
- package/build/types/applet.d.ts +3 -1
- package/build/types/applet.d.ts.map +1 -1
- package/build/types/applet.js +1 -1
- package/build/types/applet.js.map +1 -1
- package/build/types/asg.d.ts +7 -0
- package/build/types/asg.d.ts.map +1 -1
- package/build/types/asg.js.map +1 -1
- package/build/types/capabilities/even-realities-g1.d.ts.map +1 -1
- package/build/types/capabilities/even-realities-g1.js +2 -0
- package/build/types/capabilities/even-realities-g1.js.map +1 -1
- package/build/types/capabilities/even-realities-g2.d.ts.map +1 -1
- package/build/types/capabilities/even-realities-g2.js +2 -0
- package/build/types/capabilities/even-realities-g2.js.map +1 -1
- package/build/types/capabilities/mentra-display.d.ts.map +1 -1
- package/build/types/capabilities/mentra-display.js +2 -0
- package/build/types/capabilities/mentra-display.js.map +1 -1
- package/build/types/capabilities/mentra-live.d.ts.map +1 -1
- package/build/types/capabilities/mentra-live.js +2 -0
- package/build/types/capabilities/mentra-live.js.map +1 -1
- package/build/types/capabilities/nimo.d.ts +9 -0
- package/build/types/capabilities/nimo.d.ts.map +1 -0
- package/build/types/capabilities/nimo.js +57 -0
- package/build/types/capabilities/nimo.js.map +1 -0
- package/build/types/capabilities/none.d.ts.map +1 -1
- package/build/types/capabilities/none.js +2 -0
- package/build/types/capabilities/none.js.map +1 -1
- package/build/types/capabilities/simulated-glasses.d.ts.map +1 -1
- package/build/types/capabilities/simulated-glasses.js +2 -0
- package/build/types/capabilities/simulated-glasses.js.map +1 -1
- package/build/types/capabilities/vuzix-z100.d.ts.map +1 -1
- package/build/types/capabilities/vuzix-z100.js +2 -0
- package/build/types/capabilities/vuzix-z100.js.map +1 -1
- package/build/types/enums.d.ts +4 -26
- package/build/types/enums.d.ts.map +1 -1
- package/build/types/enums.js +3 -27
- package/build/types/enums.js.map +1 -1
- package/build/types/hardware.d.ts +6 -14
- package/build/types/hardware.d.ts.map +1 -1
- package/build/types/hardware.js +18 -4
- package/build/types/hardware.js.map +1 -1
- package/build/types/index.d.ts +3 -7
- package/build/types/index.d.ts.map +1 -1
- package/build/types/index.js +3 -7
- package/build/types/index.js.map +1 -1
- package/build/utils/configuredDevHost.d.ts +6 -0
- package/build/utils/configuredDevHost.d.ts.map +1 -0
- package/build/utils/configuredDevHost.js +19 -0
- package/build/utils/configuredDevHost.js.map +1 -0
- package/build/utils/devMiniappLaunch.d.ts +19 -8
- package/build/utils/devMiniappLaunch.d.ts.map +1 -1
- package/build/utils/devMiniappLaunch.js +144 -21
- package/build/utils/devMiniappLaunch.js.map +1 -1
- package/build/utils/diagnosticContext.d.ts.map +1 -1
- package/build/utils/diagnosticContext.js +15 -17
- package/build/utils/diagnosticContext.js.map +1 -1
- package/build/utils/display/composer/ColumnComposer.d.ts +1 -1
- package/build/utils/display/composer/ColumnComposer.js +1 -1
- package/build/utils/display/composer/ColumnComposer.js.map +1 -1
- package/build/utils/hardware/hardware.d.ts.map +1 -1
- package/build/utils/hardware/hardware.js +7 -3
- package/build/utils/hardware/hardware.js.map +1 -1
- package/build/utils/miniappDiagnostics.d.ts +64 -0
- package/build/utils/miniappDiagnostics.d.ts.map +1 -0
- package/build/utils/miniappDiagnostics.js +173 -0
- package/build/utils/miniappDiagnostics.js.map +1 -0
- package/build/utils/permissions/MediaLibraryPermissions.d.ts +11 -0
- package/build/utils/permissions/MediaLibraryPermissions.d.ts.map +1 -1
- package/build/utils/permissions/MediaLibraryPermissions.js +27 -4
- package/build/utils/permissions/MediaLibraryPermissions.js.map +1 -1
- package/build/utils/timers/timers.d.ts.map +1 -1
- package/build/utils/timers/timers.js +55 -18
- package/build/utils/timers/timers.js.map +1 -1
- package/package.json +66 -31
- package/src/assets/silence.wav +0 -0
- package/src/bluetooth-sdk/debug.ts +1 -0
- package/src/bluetooth-sdk/index.ts +2 -0
- package/src/bluetooth-sdk/ota-transport.ts +1 -0
- package/src/bluetooth-sdk/photo-receiver.ts +2 -0
- package/src/bluetooth-sdk/react.ts +1 -0
- package/src/bluetooth-sdk/types.ts +1 -0
- package/src/engine.ts +9 -4
- package/src/facades/dev.ts +17 -12
- package/src/facades/display.ts +1 -1
- package/src/facades/gallery.ts +1 -1
- package/src/facades/glasses.ts +20 -7
- package/src/facades/glassesSettings.ts +5 -0
- package/src/facades/miniapps.ts +7 -0
- package/src/facades/ota.ts +41 -13
- package/src/facades/pairing.ts +103 -23
- package/src/facades/permissions.ts +14 -0
- package/src/facades/phoneNotifications.ts +4 -13
- package/src/facades/speech.ts +21 -7
- package/src/generated/releaseMetadata.ts +20 -0
- package/src/index.ts +42 -13
- package/src/react/MentraLiveOtaFlow.tsx +754 -0
- package/src/react/index.ts +21 -0
- package/src/react/useEngineSnapshot.ts +16 -0
- package/src/react/useMentraLiveOta.ts +793 -0
- package/src/runtime/bootstrap.ts +33 -1
- package/src/runtime/scanQrSeam.ts +20 -0
- package/src/services/AppRegistry.ts +240 -149
- package/src/services/AudioCloudUplink.ts +23 -1
- package/src/services/AudioPlaybackService.ts +287 -38
- package/src/services/BlobStore.ts +79 -19
- package/src/services/CloudAudioSubscriptionSync.ts +13 -1
- package/src/services/CloudClientService.ts +96 -1
- package/src/services/DeviceEventRouter.ts +5 -5
- package/src/services/DisplayProcessor.ts +3 -3
- package/src/services/ForegroundLocationPermission.ts +24 -0
- package/src/services/GlassesSettingsSync.ts +9 -3
- package/src/services/GlassesStatusProjection.ts +20 -11
- package/src/services/HotspotOtaTransport.ts +185 -0
- package/src/services/HotspotShutdown.ts +41 -0
- package/src/services/LocalDisplayManager.ts +114 -24
- package/src/services/LocalMiniappRuntime.ts +967 -346
- package/src/services/LocalMiniappStorage.ts +82 -0
- package/src/services/LocalMiniappUserIdentity.ts +46 -0
- package/src/services/LocalSttFallbackCoordinator.ts +19 -12
- package/src/services/MicStateCoordinator.ts +169 -4
- package/src/services/MiniappLauncher.ts +30 -3
- package/src/services/MiniappLiveness.ts +24 -0
- package/src/services/NativeHttpResponse.ts +6 -0
- package/src/services/OtaArtifactDownloader.ts +312 -0
- package/src/services/OtaAutoChain.ts +130 -0
- package/src/services/OtaErrorMapping.ts +80 -0
- package/src/services/OtaInstallCoordinator.ts +680 -151
- package/src/services/OtaService.ts +12 -7
- package/src/services/OtaUpdateCheckService.ts +205 -27
- package/src/services/PhoneCalendarHelpers.ts +212 -0
- package/src/services/PhoneCalendarService.ts +65 -0
- package/src/services/PhoneCameraFovCoordinator.ts +210 -0
- package/src/services/PhoneNotificationsSync.ts +12 -10
- package/src/services/PhonePhotoCoordinator.ts +117 -19
- package/src/services/PhoneStreamCoordinator.ts +139 -25
- package/src/services/PhoneVideoCoordinator.ts +11 -0
- package/src/services/SceneRenderer.ts +16 -0
- package/src/services/SentenceTtsPipeline.ts +106 -0
- package/src/services/StreamLifecycleController.ts +3 -3
- package/src/services/SupportProfileSync.ts +218 -0
- package/src/services/TranscriptionRouting.ts +37 -0
- package/src/services/TtsTextSanitizer.ts +66 -0
- package/src/services/WifiAdbRequest.ts +53 -0
- package/src/services/asg/asgCameraApi.ts +615 -33
- package/src/services/asg/cameraRollExportCoordinator.ts +627 -0
- package/src/services/asg/cameraRollExportLedger.ts +122 -0
- package/src/services/asg/galleryNotices.ts +1 -0
- package/src/services/asg/galleryPathMigration.ts +22 -0
- package/src/services/asg/gallerySettingsService.ts +3 -0
- package/src/services/asg/gallerySyncService.ts +184 -73
- package/src/services/asg/galleryTransferLedger.ts +312 -0
- package/src/services/asg/localNetworkTransport.ts +170 -0
- package/src/services/asg/localStorageService.ts +179 -24
- package/src/services/asg/mediaProcessingQueue.ts +209 -62
- package/src/services/audioPlaybackAssets.ts +8 -0
- package/src/services/gallerySyncClock.ts +1 -1
- package/src/services/glassesClockSync.ts +7 -3
- package/src/services/manifestActions.ts +30 -0
- package/src/services/otaDisplayState.ts +58 -17
- package/src/services/otaInstallPolicy.ts +34 -4
- package/src/services/otaLegacyMapping.ts +1 -1
- package/src/services/otaManifestPolicy.ts +42 -0
- package/src/services/otaManifestUrl.ts +44 -0
- package/src/services/otaReleaseVersion.ts +22 -0
- package/src/services/slimStreamStatus.ts +16 -5
- package/src/stores/appVisibility.ts +3 -0
- package/src/stores/apps.ts +19 -1
- package/src/stores/bluetoothSettingKeys.ts +2 -0
- package/src/stores/core.ts +4 -4
- package/src/stores/gallerySync.ts +4 -0
- package/src/stores/glasses.ts +16 -6
- package/src/stores/settings.ts +179 -18
- package/src/types/applet.ts +3 -1
- package/src/types/asg.ts +7 -0
- package/src/types/capabilities/even-realities-g1.ts +3 -0
- package/src/types/capabilities/even-realities-g2.ts +3 -0
- package/src/types/capabilities/mentra-display.ts +3 -0
- package/src/types/capabilities/mentra-live.ts +3 -0
- package/src/types/capabilities/nimo.ts +59 -0
- package/src/types/capabilities/none.ts +3 -0
- package/src/types/capabilities/simulated-glasses.ts +3 -0
- package/src/types/capabilities/vuzix-z100.ts +3 -0
- package/src/types/enums.ts +4 -28
- package/src/types/hardware.ts +23 -14
- package/src/types/index.ts +3 -6
- package/src/utils/configuredDevHost.ts +17 -0
- package/src/utils/devMiniappLaunch.ts +151 -23
- package/src/utils/diagnosticContext.ts +17 -17
- package/src/utils/display/composer/ColumnComposer.ts +1 -1
- package/src/utils/hardware/hardware.ts +7 -9
- package/src/utils/miniappDiagnostics.ts +226 -0
- package/src/utils/permissions/MediaLibraryPermissions.ts +35 -4
- package/src/utils/timers/timers.ts +57 -21
- package/build/devtools.d.ts +0 -11
- package/build/devtools.d.ts.map +0 -1
- package/build/devtools.js +0 -13
- package/build/devtools.js.map +0 -1
- package/build/internal.d.ts +0 -66
- package/build/internal.d.ts.map +0 -1
- package/build/internal.js +0 -89
- package/build/internal.js.map +0 -1
- package/build/services/asgOtaVersionUrl.d.ts +0 -2
- package/build/services/asgOtaVersionUrl.d.ts.map +0 -1
- package/build/services/asgOtaVersionUrl.js +0 -36
- package/build/services/asgOtaVersionUrl.js.map +0 -1
- package/src/devtools.ts +0 -13
- package/src/internal.ts +0 -158
- package/src/services/asgOtaVersionUrl.ts +0 -41
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import Constants from "expo-constants"
|
|
2
|
+
import * as Device from "expo-device"
|
|
3
|
+
import {Platform} from "react-native"
|
|
4
|
+
import type {SupportStateInput} from "@mentra/cloud-client"
|
|
5
|
+
|
|
6
|
+
import {useGlassesStore} from "../stores/glasses"
|
|
7
|
+
import {BgTimer} from "../utils/timers"
|
|
8
|
+
import {cloudClientService} from "./CloudClientService"
|
|
9
|
+
|
|
10
|
+
const ENGINE_VERSION = (require("../../package.json") as {version?: string}).version
|
|
11
|
+
const BLUETOOTH_SDK_VERSION = (require("@mentra/bluetooth-sdk/package.json") as {version?: string}).version
|
|
12
|
+
const DEBOUNCE_MS = 2_000
|
|
13
|
+
const RETRY_MS = 30_000
|
|
14
|
+
const HEARTBEAT_MS = 6 * 60 * 60_000
|
|
15
|
+
|
|
16
|
+
let unsubscribe: (() => void) | null = null
|
|
17
|
+
let debounceTimer: number | null = null
|
|
18
|
+
let retryTimer: number | null = null
|
|
19
|
+
let heartbeatTimer: number | null = null
|
|
20
|
+
let lastSentFingerprint: string | null = null
|
|
21
|
+
let queuedFingerprint: string | null = null
|
|
22
|
+
let sendingGeneration: number | null = null
|
|
23
|
+
let syncGeneration = 0
|
|
24
|
+
let consecutiveSendFailures = 0
|
|
25
|
+
let lastFailure: {code: string; stage: string} | null = null
|
|
26
|
+
let lastConnectionState: string | null = null
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Keep Cloud V2's canonical support snapshot current without creating an event
|
|
30
|
+
* stream from noisy store updates. Only the explicitly selected fields below
|
|
31
|
+
* leave the phone; Wi-Fi, Bluetooth addresses, location and diagnostics do not.
|
|
32
|
+
*/
|
|
33
|
+
export function startSupportProfileSync(): void {
|
|
34
|
+
if (unsubscribe) return
|
|
35
|
+
const generation = ++syncGeneration
|
|
36
|
+
lastConnectionState = useGlassesStore.getState().connection.state
|
|
37
|
+
unsubscribe = useGlassesStore.subscribe(() => handleGlassesStoreChange(generation))
|
|
38
|
+
heartbeatTimer = BgTimer.setInterval(() => void sendCurrentSnapshot(true, generation), HEARTBEAT_MS)
|
|
39
|
+
void sendCurrentSnapshot(true, generation)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function stopSupportProfileSync(): void {
|
|
43
|
+
syncGeneration += 1
|
|
44
|
+
unsubscribe?.()
|
|
45
|
+
unsubscribe = null
|
|
46
|
+
if (debounceTimer !== null) BgTimer.clearTimeout(debounceTimer)
|
|
47
|
+
if (retryTimer !== null) BgTimer.clearTimeout(retryTimer)
|
|
48
|
+
if (heartbeatTimer !== null) BgTimer.clearInterval(heartbeatTimer)
|
|
49
|
+
debounceTimer = null
|
|
50
|
+
retryTimer = null
|
|
51
|
+
heartbeatTimer = null
|
|
52
|
+
lastSentFingerprint = null
|
|
53
|
+
queuedFingerprint = null
|
|
54
|
+
sendingGeneration = null
|
|
55
|
+
consecutiveSendFailures = 0
|
|
56
|
+
lastFailure = null
|
|
57
|
+
lastConnectionState = null
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function handleGlassesStoreChange(generation: number): void {
|
|
61
|
+
if (!unsubscribe || generation !== syncGeneration) return
|
|
62
|
+
const connectionState = useGlassesStore.getState().connection.state
|
|
63
|
+
if (connectionState === "connected" && lastConnectionState !== "connected") lastFailure = null
|
|
64
|
+
lastConnectionState = connectionState
|
|
65
|
+
scheduleMeaningfulUpdate(generation)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function scheduleMeaningfulUpdate(generation = syncGeneration): void {
|
|
69
|
+
if (!unsubscribe || generation !== syncGeneration) return
|
|
70
|
+
const fingerprint = snapshotFingerprint(buildSnapshot())
|
|
71
|
+
if (fingerprint === lastSentFingerprint) return
|
|
72
|
+
queuedFingerprint = fingerprint
|
|
73
|
+
armDebounce(generation)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function armDebounce(generation: number): void {
|
|
77
|
+
if (debounceTimer !== null) BgTimer.clearTimeout(debounceTimer)
|
|
78
|
+
debounceTimer = BgTimer.setTimeout(() => {
|
|
79
|
+
debounceTimer = null
|
|
80
|
+
void sendCurrentSnapshot(false, generation)
|
|
81
|
+
}, DEBOUNCE_MS)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
async function sendCurrentSnapshot(force: boolean, generation = syncGeneration): Promise<void> {
|
|
85
|
+
if (!unsubscribe || generation !== syncGeneration) return
|
|
86
|
+
if (sendingGeneration === generation) {
|
|
87
|
+
const fingerprint = snapshotFingerprint(buildSnapshot())
|
|
88
|
+
if (fingerprint !== lastSentFingerprint) queuedFingerprint = fingerprint
|
|
89
|
+
return
|
|
90
|
+
}
|
|
91
|
+
const snapshot = buildSnapshot()
|
|
92
|
+
const fingerprint = snapshotFingerprint(snapshot)
|
|
93
|
+
if (!force && fingerprint === lastSentFingerprint) return
|
|
94
|
+
|
|
95
|
+
sendingGeneration = generation
|
|
96
|
+
let retryDelayMs: number | null = null
|
|
97
|
+
try {
|
|
98
|
+
const result = await cloudClientService.core.supportProfile.update(snapshot)
|
|
99
|
+
if (generation !== syncGeneration || !unsubscribe) return
|
|
100
|
+
consecutiveSendFailures = 0
|
|
101
|
+
retryDelayMs = retryDelayForSupportProfileResult(result)
|
|
102
|
+
if (retryDelayMs === null) {
|
|
103
|
+
lastSentFingerprint = fingerprint
|
|
104
|
+
if (queuedFingerprint === fingerprint) queuedFingerprint = null
|
|
105
|
+
if (retryTimer !== null) BgTimer.clearTimeout(retryTimer)
|
|
106
|
+
retryTimer = null
|
|
107
|
+
}
|
|
108
|
+
} catch (error) {
|
|
109
|
+
if (generation !== syncGeneration || !unsubscribe) return
|
|
110
|
+
consecutiveSendFailures += 1
|
|
111
|
+
retryDelayMs = retryDelayForSendFailure(consecutiveSendFailures)
|
|
112
|
+
console.warn(
|
|
113
|
+
`supportProfile: Cloud V2 update failed (retry in ${Math.round(retryDelayMs / 1_000)}s):`,
|
|
114
|
+
error instanceof Error ? error.message : error,
|
|
115
|
+
)
|
|
116
|
+
} finally {
|
|
117
|
+
const generationIsActive = generation === syncGeneration && sendingGeneration === generation && Boolean(unsubscribe)
|
|
118
|
+
if (generationIsActive) {
|
|
119
|
+
sendingGeneration = null
|
|
120
|
+
if (retryDelayMs !== null) {
|
|
121
|
+
if (retryTimer !== null) BgTimer.clearTimeout(retryTimer)
|
|
122
|
+
retryTimer = BgTimer.setTimeout(() => {
|
|
123
|
+
retryTimer = null
|
|
124
|
+
void sendCurrentSnapshot(true, generation)
|
|
125
|
+
}, retryDelayMs)
|
|
126
|
+
} else {
|
|
127
|
+
const currentFingerprint = snapshotFingerprint(buildSnapshot())
|
|
128
|
+
if (currentFingerprint !== lastSentFingerprint) {
|
|
129
|
+
queuedFingerprint = currentFingerprint
|
|
130
|
+
if (retryTimer === null) armDebounce(generation)
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export function retryDelayForSupportProfileResult(result: {
|
|
138
|
+
status: "accepted" | "deduplicated" | "stale"
|
|
139
|
+
}): number | null {
|
|
140
|
+
if (result.status === "accepted" || result.status === "deduplicated") return null
|
|
141
|
+
return RETRY_MS
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Support freshness is not worth an aggressive retry loop. A snapshot the
|
|
146
|
+
* server keeps rejecting (skewed clock, deleted account, signed-out host)
|
|
147
|
+
* backs off exponentially until it converges on the heartbeat cadence.
|
|
148
|
+
*/
|
|
149
|
+
export function retryDelayForSendFailure(consecutiveFailures: number): number {
|
|
150
|
+
return Math.min(HEARTBEAT_MS, RETRY_MS * 2 ** Math.min(Math.max(consecutiveFailures, 1) - 1, 10))
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export function buildSnapshot(observedAt = new Date()): SupportStateInput {
|
|
154
|
+
const glasses = useGlassesStore.getState()
|
|
155
|
+
const device = {
|
|
156
|
+
hardwareId: optional(glasses.serialNumber),
|
|
157
|
+
model: optional(glasses.deviceModel),
|
|
158
|
+
androidVersion: optional(glasses.androidVersion),
|
|
159
|
+
firmwareVersion: optional(glasses.firmwareVersion),
|
|
160
|
+
mtkFirmwareVersion: optional(glasses.mtkFirmwareVersion),
|
|
161
|
+
besFirmwareVersion: optional(glasses.besFirmwareVersion),
|
|
162
|
+
appVersion: optional(glasses.appVersion),
|
|
163
|
+
buildNumber: optional(glasses.buildNumber),
|
|
164
|
+
}
|
|
165
|
+
const hasDevice = Object.values(device).some(Boolean)
|
|
166
|
+
const constants = Constants as typeof Constants & {
|
|
167
|
+
nativeAppVersion?: string | null
|
|
168
|
+
nativeBuildVersion?: string | null
|
|
169
|
+
}
|
|
170
|
+
return {
|
|
171
|
+
observedAt: observedAt.toISOString(),
|
|
172
|
+
host: {
|
|
173
|
+
appVersion: optional(constants.nativeAppVersion ?? Constants.expoConfig?.version),
|
|
174
|
+
appBuild: optional(constants.nativeBuildVersion),
|
|
175
|
+
engineVersion: optional(ENGINE_VERSION),
|
|
176
|
+
bluetoothSdkVersion: optional(BLUETOOTH_SDK_VERSION),
|
|
177
|
+
phonePlatform: Platform.OS === "ios" || Platform.OS === "android" ? Platform.OS : "unknown",
|
|
178
|
+
phoneModel: optional(Device.modelName),
|
|
179
|
+
phoneOsVersion: optional(
|
|
180
|
+
Platform.OS === "android"
|
|
181
|
+
? String((Platform.constants as {Release?: string} | undefined)?.Release ?? Platform.Version)
|
|
182
|
+
: String(Platform.Version),
|
|
183
|
+
),
|
|
184
|
+
connectionState: glasses.connection.state,
|
|
185
|
+
...(lastFailure ? {failureCode: lastFailure.code, failureStage: lastFailure.stage} : {}),
|
|
186
|
+
},
|
|
187
|
+
...(hasDevice ? {device} : {}),
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/** Record only normalized connection failures; arbitrary exception messages never leave the phone. */
|
|
192
|
+
export function recordSupportProfileConnectionFailure(error: unknown, stage: string): void {
|
|
193
|
+
const rawCode =
|
|
194
|
+
typeof error === "object" && error && "code" in error ? String((error as {code?: unknown}).code ?? "") : ""
|
|
195
|
+
const message = error instanceof Error ? `${error.name} ${error.message}`.toLowerCase() : ""
|
|
196
|
+
const code = /^[a-zA-Z0-9_.-]{1,64}$/.test(rawCode)
|
|
197
|
+
? rawCode.toLowerCase()
|
|
198
|
+
: message.includes("permission")
|
|
199
|
+
? "permission_denied"
|
|
200
|
+
: message.includes("bluetooth") && (message.includes("off") || message.includes("unavailable"))
|
|
201
|
+
? "bluetooth_unavailable"
|
|
202
|
+
: message.includes("not found") || message.includes("no default")
|
|
203
|
+
? "device_not_found"
|
|
204
|
+
: message.includes("timeout")
|
|
205
|
+
? "connect_timeout"
|
|
206
|
+
: "connect_failed"
|
|
207
|
+
lastFailure = {code, stage: stage.replace(/[^a-zA-Z0-9_.-]/g, "_").slice(0, 64)}
|
|
208
|
+
scheduleMeaningfulUpdate()
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export function snapshotFingerprint(snapshot: SupportStateInput): string {
|
|
212
|
+
return JSON.stringify({host: snapshot.host, device: snapshot.device})
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function optional(value: string | null | undefined): string | undefined {
|
|
216
|
+
const trimmed = value?.trim()
|
|
217
|
+
return trimmed ? trimmed.slice(0, 128) : undefined
|
|
218
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface TranscriptionRouteSummary {
|
|
2
|
+
hasCloudSubscriber: boolean
|
|
3
|
+
hasForceLocalSubscriber: boolean
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface TranscriptionSubscriberRoutes {
|
|
7
|
+
cloud: boolean
|
|
8
|
+
forceLocal: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type TranscriptionDeliveryRoute = "default" | "forceLocal" | "all"
|
|
12
|
+
|
|
13
|
+
export function summarizeTranscriptionRoutes<T>(
|
|
14
|
+
subscribers: Iterable<T>,
|
|
15
|
+
routesFor: (subscriber: T) => TranscriptionSubscriberRoutes,
|
|
16
|
+
): TranscriptionRouteSummary {
|
|
17
|
+
let hasCloudSubscriber = false
|
|
18
|
+
let hasForceLocalSubscriber = false
|
|
19
|
+
for (const subscriber of subscribers) {
|
|
20
|
+
const routes = routesFor(subscriber)
|
|
21
|
+
if (routes.cloud) hasCloudSubscriber = true
|
|
22
|
+
if (routes.forceLocal) hasForceLocalSubscriber = true
|
|
23
|
+
}
|
|
24
|
+
return {hasCloudSubscriber, hasForceLocalSubscriber}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function transcriptionDeliveryRoute(
|
|
28
|
+
source: "cloud" | "local",
|
|
29
|
+
routes: TranscriptionSubscriberRoutes,
|
|
30
|
+
cloudConnected: boolean,
|
|
31
|
+
): TranscriptionDeliveryRoute | null {
|
|
32
|
+
if (source === "cloud") return routes.cloud ? "default" : null
|
|
33
|
+
if (cloudConnected) return routes.forceLocal ? "forceLocal" : null
|
|
34
|
+
if (routes.cloud && routes.forceLocal) return "all"
|
|
35
|
+
if (routes.forceLocal) return "forceLocal"
|
|
36
|
+
return routes.cloud ? "default" : null
|
|
37
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
const HTML_ENTITIES: Record<string, string> = {
|
|
2
|
+
"&": "&",
|
|
3
|
+
"<": "<",
|
|
4
|
+
">": ">",
|
|
5
|
+
""": '"',
|
|
6
|
+
"'": "'",
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** Convert display-oriented text into plain words before TTS synthesis. */
|
|
10
|
+
export function sanitizeTtsText(text: string): string {
|
|
11
|
+
let speech = text.replace(/&(amp|lt|gt|quot|#39);/gi, (entity) => HTML_ENTITIES[entity.toLowerCase()] ?? entity)
|
|
12
|
+
|
|
13
|
+
speech = speech
|
|
14
|
+
.replace(/<say-as\b[^>]*>(.*?)<\/say-as>/gis, "$1")
|
|
15
|
+
.replace(/<\/?[a-z][a-z0-9-]*(?:\s[^<>]*?)?\s*\/?>/gi, " ")
|
|
16
|
+
.replace(/\[([^\]]+)]\([^)]+\)/g, "$1")
|
|
17
|
+
.replace(/`([^`]*)`/g, "$1")
|
|
18
|
+
.replace(/(-?\d+(?:[.,]\d+)?)\s*(?:°\s*f\b|℉)/gi, "$1 degrees Fahrenheit")
|
|
19
|
+
.replace(/(-?\d+(?:[.,]\d+)?)\s*(?:°\s*c\b|℃)/gi, "$1 degrees Celsius")
|
|
20
|
+
.replace(/(-?\d+(?:[.,]\d+)?)\s*°/g, "$1 degrees")
|
|
21
|
+
.replace(/<=/g, " less than or equal to ")
|
|
22
|
+
.replace(/>=/g, " greater than or equal to ")
|
|
23
|
+
.replace(/</g, " less than ")
|
|
24
|
+
.replace(/>/g, " greater than ")
|
|
25
|
+
.replace(/[[\]{}()]/g, " ")
|
|
26
|
+
.replace(/(degrees Fahrenheit)\s+(-?\d+(?:[.,]\d+)? degrees Celsius)\b/gi, "$1 or $2")
|
|
27
|
+
.replace(/(degrees Celsius)\s+(-?\d+(?:[.,]\d+)? degrees Fahrenheit)\b/gi, "$1 or $2")
|
|
28
|
+
.replace(/&/g, " and ")
|
|
29
|
+
.replace(/\+/g, " plus ")
|
|
30
|
+
.replace(/=/g, " equals ")
|
|
31
|
+
.replace(/#/g, " hash ")
|
|
32
|
+
.replace(/@/g, " at ")
|
|
33
|
+
.replace(/%/g, " percent ")
|
|
34
|
+
.replace(/\\/g, " backslash ")
|
|
35
|
+
.replace(/\//g, (slash, offset, source) => {
|
|
36
|
+
const numericSeparator = /\d/.test(source[offset - 1] ?? "") && /\d/.test(source[offset + 1] ?? "")
|
|
37
|
+
return numericSeparator ? slash : " slash "
|
|
38
|
+
})
|
|
39
|
+
.replace(/\*/g, " star ")
|
|
40
|
+
|
|
41
|
+
return speech
|
|
42
|
+
.replace(/\s+([,.;:!?])/g, "$1")
|
|
43
|
+
.replace(/\s+/g, " ")
|
|
44
|
+
.trim()
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Prepare an already-trimmed sentence list while preserving the exact-text opt-out. */
|
|
48
|
+
export function prepareTtsSentences(sentences: string[], enableSanitization = true): string[] {
|
|
49
|
+
if (!enableSanitization) return sentences
|
|
50
|
+
|
|
51
|
+
const sanitized = sentences.map((sentence) => sanitizeTtsText(sentence)).filter(Boolean)
|
|
52
|
+
|
|
53
|
+
return sanitized.map((sentence, index) => {
|
|
54
|
+
const previous = sanitized[index - 1]
|
|
55
|
+
if (!previous) return sentence
|
|
56
|
+
|
|
57
|
+
const followsFahrenheit = /degrees Fahrenheit[,.;:!?]?$/i.test(previous)
|
|
58
|
+
const followsCelsius = /degrees Celsius[,.;:!?]?$/i.test(previous)
|
|
59
|
+
const startsWithFahrenheit = /^-?\d+(?:[.,]\d+)? degrees Fahrenheit\b/i.test(sentence)
|
|
60
|
+
const startsWithCelsius = /^-?\d+(?:[.,]\d+)? degrees Celsius\b/i.test(sentence)
|
|
61
|
+
|
|
62
|
+
return (followsFahrenheit && startsWithCelsius) || (followsCelsius && startsWithFahrenheit)
|
|
63
|
+
? `or ${sentence}`
|
|
64
|
+
: sentence
|
|
65
|
+
})
|
|
66
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export interface WifiAdbRequestDependencies {
|
|
2
|
+
isSystemPackage: (packageName: string) => boolean
|
|
3
|
+
setWifiAdbState: (enabled: boolean) => Promise<void>
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export type WifiAdbRequestErrorCode = "NOT_PERMITTED" | "INVALID_ARGUMENT" | "INTERNAL"
|
|
7
|
+
|
|
8
|
+
export type WifiAdbRequestResult =
|
|
9
|
+
| {ok: true}
|
|
10
|
+
| {
|
|
11
|
+
ok: false
|
|
12
|
+
error: {code: WifiAdbRequestErrorCode; message: string}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Apply the SYSTEM-only Wi-Fi ADB policy before calling the native SDK. */
|
|
16
|
+
export async function handleWifiAdbRequest(
|
|
17
|
+
packageName: string,
|
|
18
|
+
payload: Record<string, unknown>,
|
|
19
|
+
dependencies: WifiAdbRequestDependencies,
|
|
20
|
+
): Promise<WifiAdbRequestResult> {
|
|
21
|
+
if (!dependencies.isSystemPackage(packageName)) {
|
|
22
|
+
return {
|
|
23
|
+
ok: false,
|
|
24
|
+
error: {
|
|
25
|
+
code: "NOT_PERMITTED",
|
|
26
|
+
message: "setWifiAdbState is restricted to system apps",
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (typeof payload.enabled !== "boolean") {
|
|
32
|
+
return {
|
|
33
|
+
ok: false,
|
|
34
|
+
error: {
|
|
35
|
+
code: "INVALID_ARGUMENT",
|
|
36
|
+
message: "enabled must be a boolean",
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
await dependencies.setWifiAdbState(payload.enabled)
|
|
43
|
+
return {ok: true}
|
|
44
|
+
} catch (error) {
|
|
45
|
+
return {
|
|
46
|
+
ok: false,
|
|
47
|
+
error: {
|
|
48
|
+
code: "INTERNAL",
|
|
49
|
+
message: error instanceof Error ? error.message : "Wi-Fi ADB error",
|
|
50
|
+
},
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|