@mentra/engine 0.1.0-beta.0
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 +79 -0
- package/build/devtools.d.ts +11 -0
- package/build/devtools.d.ts.map +1 -0
- package/build/devtools.js +13 -0
- package/build/devtools.js.map +1 -0
- package/build/engine.d.ts +261 -0
- package/build/engine.d.ts.map +1 -0
- package/build/engine.js +170 -0
- package/build/engine.js.map +1 -0
- package/build/facades/dev.d.ts +58 -0
- package/build/facades/dev.d.ts.map +1 -0
- package/build/facades/dev.js +189 -0
- package/build/facades/dev.js.map +1 -0
- package/build/facades/display.d.ts +21 -0
- package/build/facades/display.d.ts.map +1 -0
- package/build/facades/display.js +17 -0
- package/build/facades/display.js.map +1 -0
- package/build/facades/displayMirror.d.ts +15 -0
- package/build/facades/displayMirror.d.ts.map +1 -0
- package/build/facades/displayMirror.js +29 -0
- package/build/facades/displayMirror.js.map +1 -0
- package/build/facades/gallery.d.ts +62 -0
- package/build/facades/gallery.d.ts.map +1 -0
- package/build/facades/gallery.js +61 -0
- package/build/facades/gallery.js.map +1 -0
- package/build/facades/glasses.d.ts +141 -0
- package/build/facades/glasses.d.ts.map +1 -0
- package/build/facades/glasses.js +199 -0
- package/build/facades/glasses.js.map +1 -0
- package/build/facades/glassesSettings.d.ts +13 -0
- package/build/facades/glassesSettings.d.ts.map +1 -0
- package/build/facades/glassesSettings.js +54 -0
- package/build/facades/glassesSettings.js.map +1 -0
- package/build/facades/glassesWifi.d.ts +25 -0
- package/build/facades/glassesWifi.d.ts.map +1 -0
- package/build/facades/glassesWifi.js +57 -0
- package/build/facades/glassesWifi.js.map +1 -0
- package/build/facades/miniapps.d.ts +43 -0
- package/build/facades/miniapps.d.ts.map +1 -0
- package/build/facades/miniapps.js +49 -0
- package/build/facades/miniapps.js.map +1 -0
- package/build/facades/notifications.d.ts +13 -0
- package/build/facades/notifications.d.ts.map +1 -0
- package/build/facades/notifications.js +12 -0
- package/build/facades/notifications.js.map +1 -0
- package/build/facades/ota.d.ts +103 -0
- package/build/facades/ota.d.ts.map +1 -0
- package/build/facades/ota.js +156 -0
- package/build/facades/ota.js.map +1 -0
- package/build/facades/pairing.d.ts +114 -0
- package/build/facades/pairing.d.ts.map +1 -0
- package/build/facades/pairing.js +275 -0
- package/build/facades/pairing.js.map +1 -0
- package/build/facades/permissions.d.ts +33 -0
- package/build/facades/permissions.d.ts.map +1 -0
- package/build/facades/permissions.js +155 -0
- package/build/facades/permissions.js.map +1 -0
- package/build/facades/phoneNotifications.d.ts +21 -0
- package/build/facades/phoneNotifications.d.ts.map +1 -0
- package/build/facades/phoneNotifications.js +51 -0
- package/build/facades/phoneNotifications.js.map +1 -0
- package/build/facades/reports.d.ts +36 -0
- package/build/facades/reports.d.ts.map +1 -0
- package/build/facades/reports.js +134 -0
- package/build/facades/reports.js.map +1 -0
- package/build/facades/session.d.ts +21 -0
- package/build/facades/session.d.ts.map +1 -0
- package/build/facades/session.js +52 -0
- package/build/facades/session.js.map +1 -0
- package/build/facades/settings.d.ts +37 -0
- package/build/facades/settings.d.ts.map +1 -0
- package/build/facades/settings.js +55 -0
- package/build/facades/settings.js.map +1 -0
- package/build/facades/speech.d.ts +30 -0
- package/build/facades/speech.d.ts.map +1 -0
- package/build/facades/speech.js +37 -0
- package/build/facades/speech.js.map +1 -0
- package/build/index.d.ts +43 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +45 -0
- package/build/index.js.map +1 -0
- package/build/internal.d.ts +67 -0
- package/build/internal.d.ts.map +1 -0
- package/build/internal.js +90 -0
- package/build/internal.js.map +1 -0
- package/build/runtime/bootstrap.d.ts +83 -0
- package/build/runtime/bootstrap.d.ts.map +1 -0
- package/build/runtime/bootstrap.js +56 -0
- package/build/runtime/bootstrap.js.map +1 -0
- package/build/runtime/config.d.ts +146 -0
- package/build/runtime/config.d.ts.map +1 -0
- package/build/runtime/config.js +18 -0
- package/build/runtime/config.js.map +1 -0
- package/build/runtime/streamConfig.d.ts +4 -0
- package/build/runtime/streamConfig.d.ts.map +1 -0
- package/build/runtime/streamConfig.js +38 -0
- package/build/runtime/streamConfig.js.map +1 -0
- package/build/services/AppRegistry.d.ts +269 -0
- package/build/services/AppRegistry.d.ts.map +1 -0
- package/build/services/AppRegistry.js +1079 -0
- package/build/services/AppRegistry.js.map +1 -0
- package/build/services/AudioCloudUplink.d.ts +9 -0
- package/build/services/AudioCloudUplink.d.ts.map +1 -0
- package/build/services/AudioCloudUplink.js +48 -0
- package/build/services/AudioCloudUplink.js.map +1 -0
- package/build/services/AudioPlaybackService.d.ts +175 -0
- package/build/services/AudioPlaybackService.d.ts.map +1 -0
- package/build/services/AudioPlaybackService.js +705 -0
- package/build/services/AudioPlaybackService.js.map +1 -0
- package/build/services/AutomaticReportResult.d.ts +20 -0
- package/build/services/AutomaticReportResult.d.ts.map +1 -0
- package/build/services/AutomaticReportResult.js +29 -0
- package/build/services/AutomaticReportResult.js.map +1 -0
- package/build/services/BlobStore.d.ts +91 -0
- package/build/services/BlobStore.d.ts.map +1 -0
- package/build/services/BlobStore.js +668 -0
- package/build/services/BlobStore.js.map +1 -0
- package/build/services/CaptionsTesterReportService.d.ts +4 -0
- package/build/services/CaptionsTesterReportService.d.ts.map +1 -0
- package/build/services/CaptionsTesterReportService.js +80 -0
- package/build/services/CaptionsTesterReportService.js.map +1 -0
- package/build/services/CloudAudioSubscriptionSync.d.ts +24 -0
- package/build/services/CloudAudioSubscriptionSync.d.ts.map +1 -0
- package/build/services/CloudAudioSubscriptionSync.js +39 -0
- package/build/services/CloudAudioSubscriptionSync.js.map +1 -0
- package/build/services/CloudClientService.d.ts +143 -0
- package/build/services/CloudClientService.d.ts.map +1 -0
- package/build/services/CloudClientService.js +644 -0
- package/build/services/CloudClientService.js.map +1 -0
- package/build/services/CloudTranscriptE2EMetrics.d.ts +4 -0
- package/build/services/CloudTranscriptE2EMetrics.d.ts.map +1 -0
- package/build/services/CloudTranscriptE2EMetrics.js +24 -0
- package/build/services/CloudTranscriptE2EMetrics.js.map +1 -0
- package/build/services/ConnectionCoordinator.d.ts +51 -0
- package/build/services/ConnectionCoordinator.d.ts.map +1 -0
- package/build/services/ConnectionCoordinator.js +34 -0
- package/build/services/ConnectionCoordinator.js.map +1 -0
- package/build/services/DevServerBridge.d.ts +63 -0
- package/build/services/DevServerBridge.d.ts.map +1 -0
- package/build/services/DevServerBridge.js +294 -0
- package/build/services/DevServerBridge.js.map +1 -0
- package/build/services/DeviceEventRouter.d.ts +3 -0
- package/build/services/DeviceEventRouter.d.ts.map +1 -0
- package/build/services/DeviceEventRouter.js +190 -0
- package/build/services/DeviceEventRouter.js.map +1 -0
- package/build/services/DeviceStoreHydration.d.ts +38 -0
- package/build/services/DeviceStoreHydration.d.ts.map +1 -0
- package/build/services/DeviceStoreHydration.js +124 -0
- package/build/services/DeviceStoreHydration.js.map +1 -0
- package/build/services/DisplayProcessor.d.ts +223 -0
- package/build/services/DisplayProcessor.d.ts.map +1 -0
- package/build/services/DisplayProcessor.js +552 -0
- package/build/services/DisplayProcessor.js.map +1 -0
- package/build/services/GlassesReadiness.d.ts +41 -0
- package/build/services/GlassesReadiness.d.ts.map +1 -0
- package/build/services/GlassesReadiness.js +82 -0
- package/build/services/GlassesReadiness.js.map +1 -0
- package/build/services/GlassesSettingsSync.d.ts +33 -0
- package/build/services/GlassesSettingsSync.d.ts.map +1 -0
- package/build/services/GlassesSettingsSync.js +121 -0
- package/build/services/GlassesSettingsSync.js.map +1 -0
- package/build/services/GlassesStatusProjection.d.ts +3 -0
- package/build/services/GlassesStatusProjection.d.ts.map +1 -0
- package/build/services/GlassesStatusProjection.js +65 -0
- package/build/services/GlassesStatusProjection.js.map +1 -0
- package/build/services/HeadingService.d.ts +27 -0
- package/build/services/HeadingService.d.ts.map +1 -0
- package/build/services/HeadingService.js +96 -0
- package/build/services/HeadingService.js.map +1 -0
- package/build/services/LocalDisplayManager.d.ts +139 -0
- package/build/services/LocalDisplayManager.d.ts.map +1 -0
- package/build/services/LocalDisplayManager.js +579 -0
- package/build/services/LocalDisplayManager.js.map +1 -0
- package/build/services/LocalMiniappRuntime.d.ts +439 -0
- package/build/services/LocalMiniappRuntime.d.ts.map +1 -0
- package/build/services/LocalMiniappRuntime.js +3695 -0
- package/build/services/LocalMiniappRuntime.js.map +1 -0
- package/build/services/LocalSttFallbackCoordinator.d.ts +57 -0
- package/build/services/LocalSttFallbackCoordinator.d.ts.map +1 -0
- package/build/services/LocalSttFallbackCoordinator.js +137 -0
- package/build/services/LocalSttFallbackCoordinator.js.map +1 -0
- package/build/services/MentraJSCrashController.d.ts +97 -0
- package/build/services/MentraJSCrashController.d.ts.map +1 -0
- package/build/services/MentraJSCrashController.js +138 -0
- package/build/services/MentraJSCrashController.js.map +1 -0
- package/build/services/MentraJSCrashloopReportService.d.ts +9 -0
- package/build/services/MentraJSCrashloopReportService.d.ts.map +1 -0
- package/build/services/MentraJSCrashloopReportService.js +54 -0
- package/build/services/MentraJSCrashloopReportService.js.map +1 -0
- package/build/services/MentraJSLogPipeline.d.ts +87 -0
- package/build/services/MentraJSLogPipeline.d.ts.map +1 -0
- package/build/services/MentraJSLogPipeline.js +137 -0
- package/build/services/MentraJSLogPipeline.js.map +1 -0
- package/build/services/MentraJSRouter.d.ts +203 -0
- package/build/services/MentraJSRouter.d.ts.map +1 -0
- package/build/services/MentraJSRouter.js +480 -0
- package/build/services/MentraJSRouter.js.map +1 -0
- package/build/services/MentraUIRouter.d.ts +137 -0
- package/build/services/MentraUIRouter.d.ts.map +1 -0
- package/build/services/MentraUIRouter.js +210 -0
- package/build/services/MentraUIRouter.js.map +1 -0
- package/build/services/MicStateCoordinator.d.ts +37 -0
- package/build/services/MicStateCoordinator.d.ts.map +1 -0
- package/build/services/MicStateCoordinator.js +81 -0
- package/build/services/MicStateCoordinator.js.map +1 -0
- package/build/services/MiniappEngine.d.ts +31 -0
- package/build/services/MiniappEngine.d.ts.map +1 -0
- package/build/services/MiniappEngine.js +119 -0
- package/build/services/MiniappEngine.js.map +1 -0
- package/build/services/MiniappLauncher.d.ts +129 -0
- package/build/services/MiniappLauncher.d.ts.map +1 -0
- package/build/services/MiniappLauncher.js +291 -0
- package/build/services/MiniappLauncher.js.map +1 -0
- package/build/services/MiniappRunningRegistry.d.ts +24 -0
- package/build/services/MiniappRunningRegistry.d.ts.map +1 -0
- package/build/services/MiniappRunningRegistry.js +52 -0
- package/build/services/MiniappRunningRegistry.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/NavigationHandlers.d.ts +90 -0
- package/build/services/NavigationHandlers.d.ts.map +1 -0
- package/build/services/NavigationHandlers.js +379 -0
- package/build/services/NavigationHandlers.js.map +1 -0
- package/build/services/NavigationService.d.ts +254 -0
- package/build/services/NavigationService.d.ts.map +1 -0
- package/build/services/NavigationService.js +553 -0
- package/build/services/NavigationService.js.map +1 -0
- package/build/services/NotificationsEmitter.d.ts +28 -0
- package/build/services/NotificationsEmitter.d.ts.map +1 -0
- package/build/services/NotificationsEmitter.js +22 -0
- package/build/services/NotificationsEmitter.js.map +1 -0
- package/build/services/OfflineSpeechModelService.d.ts +33 -0
- package/build/services/OfflineSpeechModelService.d.ts.map +1 -0
- package/build/services/OfflineSpeechModelService.js +136 -0
- package/build/services/OfflineSpeechModelService.js.map +1 -0
- package/build/services/OtaInstallCoordinator.d.ts +195 -0
- package/build/services/OtaInstallCoordinator.d.ts.map +1 -0
- package/build/services/OtaInstallCoordinator.js +1047 -0
- package/build/services/OtaInstallCoordinator.js.map +1 -0
- package/build/services/OtaService.d.ts +3 -0
- package/build/services/OtaService.d.ts.map +1 -0
- package/build/services/OtaService.js +65 -0
- package/build/services/OtaService.js.map +1 -0
- package/build/services/OtaUpdateCheckService.d.ts +65 -0
- package/build/services/OtaUpdateCheckService.d.ts.map +1 -0
- package/build/services/OtaUpdateCheckService.js +260 -0
- package/build/services/OtaUpdateCheckService.js.map +1 -0
- package/build/services/PairingIdentity.d.ts +80 -0
- package/build/services/PairingIdentity.d.ts.map +1 -0
- package/build/services/PairingIdentity.js +145 -0
- package/build/services/PairingIdentity.js.map +1 -0
- 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 +24 -0
- package/build/services/PhoneCalendarService.js.map +1 -0
- package/build/services/PhoneCameraFovCoordinator.d.ts +28 -0
- package/build/services/PhoneCameraFovCoordinator.d.ts.map +1 -0
- package/build/services/PhoneCameraFovCoordinator.js +180 -0
- package/build/services/PhoneCameraFovCoordinator.js.map +1 -0
- package/build/services/PhoneLocationService.d.ts +36 -0
- package/build/services/PhoneLocationService.d.ts.map +1 -0
- package/build/services/PhoneLocationService.js +115 -0
- package/build/services/PhoneLocationService.js.map +1 -0
- package/build/services/PhoneNotificationsSync.d.ts +3 -0
- package/build/services/PhoneNotificationsSync.d.ts.map +1 -0
- package/build/services/PhoneNotificationsSync.js +35 -0
- package/build/services/PhoneNotificationsSync.js.map +1 -0
- package/build/services/PhonePhotoCoordinator.d.ts +103 -0
- package/build/services/PhonePhotoCoordinator.d.ts.map +1 -0
- package/build/services/PhonePhotoCoordinator.js +326 -0
- package/build/services/PhonePhotoCoordinator.js.map +1 -0
- package/build/services/PhoneStreamCoordinator.d.ts +168 -0
- package/build/services/PhoneStreamCoordinator.d.ts.map +1 -0
- package/build/services/PhoneStreamCoordinator.js +632 -0
- package/build/services/PhoneStreamCoordinator.js.map +1 -0
- package/build/services/PhoneVideoCoordinator.d.ts +50 -0
- package/build/services/PhoneVideoCoordinator.d.ts.map +1 -0
- package/build/services/PhoneVideoCoordinator.js +147 -0
- package/build/services/PhoneVideoCoordinator.js.map +1 -0
- package/build/services/STTModelManager.d.ts +65 -0
- package/build/services/STTModelManager.d.ts.map +1 -0
- package/build/services/STTModelManager.js +292 -0
- package/build/services/STTModelManager.js.map +1 -0
- package/build/services/SceneRenderer.d.ts +90 -0
- package/build/services/SceneRenderer.d.ts.map +1 -0
- package/build/services/SceneRenderer.js +248 -0
- package/build/services/SceneRenderer.js.map +1 -0
- 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 +67 -0
- package/build/services/StreamLifecycleController.d.ts.map +1 -0
- package/build/services/StreamLifecycleController.js +152 -0
- package/build/services/StreamLifecycleController.js.map +1 -0
- package/build/services/TTSModelManager.d.ts +90 -0
- package/build/services/TTSModelManager.d.ts.map +1 -0
- package/build/services/TTSModelManager.js +366 -0
- package/build/services/TTSModelManager.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/WebviewBridge.d.ts +22 -0
- package/build/services/WebviewBridge.d.ts.map +1 -0
- package/build/services/WebviewBridge.js +47 -0
- package/build/services/WebviewBridge.js.map +1 -0
- package/build/services/asg/GalleryMediaIntegrityReportService.d.ts +17 -0
- package/build/services/asg/GalleryMediaIntegrityReportService.d.ts.map +1 -0
- package/build/services/asg/GalleryMediaIntegrityReportService.js +43 -0
- package/build/services/asg/GalleryMediaIntegrityReportService.js.map +1 -0
- package/build/services/asg/asgCameraApi.d.ts +205 -0
- package/build/services/asg/asgCameraApi.d.ts.map +1 -0
- package/build/services/asg/asgCameraApi.js +1410 -0
- package/build/services/asg/asgCameraApi.js.map +1 -0
- 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/galleryMediaValidation.d.ts +29 -0
- package/build/services/asg/galleryMediaValidation.d.ts.map +1 -0
- package/build/services/asg/galleryMediaValidation.js +149 -0
- package/build/services/asg/galleryMediaValidation.js.map +1 -0
- package/build/services/asg/galleryNotices.d.ts +33 -0
- package/build/services/asg/galleryNotices.d.ts.map +1 -0
- package/build/services/asg/galleryNotices.js +29 -0
- package/build/services/asg/galleryNotices.js.map +1 -0
- 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 +20 -0
- package/build/services/asg/gallerySettingsService.d.ts.map +1 -0
- package/build/services/asg/gallerySettingsService.js +53 -0
- package/build/services/asg/gallerySettingsService.js.map +1 -0
- package/build/services/asg/gallerySyncNotifications.d.ts +56 -0
- package/build/services/asg/gallerySyncNotifications.d.ts.map +1 -0
- package/build/services/asg/gallerySyncNotifications.js +198 -0
- package/build/services/asg/gallerySyncNotifications.js.map +1 -0
- package/build/services/asg/gallerySyncService.d.ts +137 -0
- package/build/services/asg/gallerySyncService.d.ts.map +1 -0
- package/build/services/asg/gallerySyncService.js +1933 -0
- package/build/services/asg/gallerySyncService.js.map +1 -0
- 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 +144 -0
- package/build/services/asg/localNetworkTransport.js.map +1 -0
- package/build/services/asg/localStorageService.d.ts +146 -0
- package/build/services/asg/localStorageService.d.ts.map +1 -0
- package/build/services/asg/localStorageService.js +572 -0
- package/build/services/asg/localStorageService.js.map +1 -0
- package/build/services/asg/mediaProcessingQueue.d.ts +70 -0
- package/build/services/asg/mediaProcessingQueue.d.ts.map +1 -0
- package/build/services/asg/mediaProcessingQueue.js +451 -0
- package/build/services/asg/mediaProcessingQueue.js.map +1 -0
- package/build/services/asgOtaVersionUrl.d.ts +2 -0
- package/build/services/asgOtaVersionUrl.d.ts.map +1 -0
- package/build/services/asgOtaVersionUrl.js +36 -0
- package/build/services/asgOtaVersionUrl.js.map +1 -0
- package/build/services/blobPaths.d.ts +31 -0
- package/build/services/blobPaths.d.ts.map +1 -0
- package/build/services/blobPaths.js +86 -0
- package/build/services/blobPaths.js.map +1 -0
- package/build/services/cloudStreamApi.d.ts +59 -0
- package/build/services/cloudStreamApi.d.ts.map +1 -0
- package/build/services/cloudStreamApi.js +81 -0
- package/build/services/cloudStreamApi.js.map +1 -0
- package/build/services/gallerySyncClock.d.ts +17 -0
- package/build/services/gallerySyncClock.d.ts.map +1 -0
- package/build/services/gallerySyncClock.js +21 -0
- package/build/services/gallerySyncClock.js.map +1 -0
- package/build/services/glassesClockSync.d.ts +20 -0
- package/build/services/glassesClockSync.d.ts.map +1 -0
- package/build/services/glassesClockSync.js +97 -0
- package/build/services/glassesClockSync.js.map +1 -0
- package/build/services/manifestVersionGate.d.ts +28 -0
- package/build/services/manifestVersionGate.d.ts.map +1 -0
- package/build/services/manifestVersionGate.js +41 -0
- package/build/services/manifestVersionGate.js.map +1 -0
- package/build/services/mentraUiShim.d.ts +38 -0
- package/build/services/mentraUiShim.d.ts.map +1 -0
- package/build/services/mentraUiShim.js +360 -0
- package/build/services/mentraUiShim.js.map +1 -0
- package/build/services/navigation/roadNameResolver.d.ts +67 -0
- package/build/services/navigation/roadNameResolver.d.ts.map +1 -0
- package/build/services/navigation/roadNameResolver.js +96 -0
- package/build/services/navigation/roadNameResolver.js.map +1 -0
- package/build/services/navigation/routesApiCodec.d.ts +38 -0
- package/build/services/navigation/routesApiCodec.d.ts.map +1 -0
- package/build/services/navigation/routesApiCodec.js +68 -0
- package/build/services/navigation/routesApiCodec.js.map +1 -0
- package/build/services/otaDisplayState.d.ts +42 -0
- package/build/services/otaDisplayState.d.ts.map +1 -0
- package/build/services/otaDisplayState.js +92 -0
- package/build/services/otaDisplayState.js.map +1 -0
- package/build/services/otaInstallPolicy.d.ts +81 -0
- package/build/services/otaInstallPolicy.d.ts.map +1 -0
- package/build/services/otaInstallPolicy.js +96 -0
- package/build/services/otaInstallPolicy.js.map +1 -0
- package/build/services/otaLegacyMapping.d.ts +22 -0
- package/build/services/otaLegacyMapping.d.ts.map +1 -0
- package/build/services/otaLegacyMapping.js +56 -0
- package/build/services/otaLegacyMapping.js.map +1 -0
- package/build/services/slimStreamStatus.d.ts +7 -0
- package/build/services/slimStreamStatus.d.ts.map +1 -0
- package/build/services/slimStreamStatus.js +26 -0
- package/build/services/slimStreamStatus.js.map +1 -0
- package/build/stores/apps.d.ts +104 -0
- package/build/stores/apps.d.ts.map +1 -0
- package/build/stores/apps.js +492 -0
- package/build/stores/apps.js.map +1 -0
- package/build/stores/bluetoothSettingKeys.d.ts +4 -0
- package/build/stores/bluetoothSettingKeys.d.ts.map +1 -0
- package/build/stores/bluetoothSettingKeys.js +31 -0
- package/build/stores/bluetoothSettingKeys.js.map +1 -0
- package/build/stores/cloudClientStatus.d.ts +9 -0
- package/build/stores/cloudClientStatus.d.ts.map +1 -0
- package/build/stores/cloudClientStatus.js +24 -0
- package/build/stores/cloudClientStatus.js.map +1 -0
- package/build/stores/connection.d.ts +22 -0
- package/build/stores/connection.d.ts.map +1 -0
- package/build/stores/connection.js +43 -0
- package/build/stores/connection.js.map +1 -0
- package/build/stores/core.d.ts +15 -0
- package/build/stores/core.d.ts.map +1 -0
- package/build/stores/core.js +21 -0
- package/build/stores/core.js.map +1 -0
- package/build/stores/display.d.ts +24 -0
- package/build/stores/display.d.ts.map +1 -0
- package/build/stores/display.js +96 -0
- package/build/stores/display.js.map +1 -0
- package/build/stores/gallerySync.d.ts +101 -0
- package/build/stores/gallerySync.d.ts.map +1 -0
- package/build/stores/gallerySync.js +217 -0
- package/build/stores/gallerySync.js.map +1 -0
- package/build/stores/glasses.d.ts +62 -0
- package/build/stores/glasses.d.ts.map +1 -0
- package/build/stores/glasses.js +203 -0
- package/build/stores/glasses.js.map +1 -0
- package/build/stores/settings.d.ts +37 -0
- package/build/stores/settings.d.ts.map +1 -0
- package/build/stores/settings.js +922 -0
- package/build/stores/settings.js.map +1 -0
- package/build/types/applet.d.ts +96 -0
- package/build/types/applet.d.ts.map +1 -0
- package/build/types/applet.js +5 -0
- package/build/types/applet.js.map +1 -0
- package/build/types/asg.d.ts +53 -0
- package/build/types/asg.d.ts.map +1 -0
- package/build/types/asg.js +2 -0
- package/build/types/asg.js.map +1 -0
- package/build/types/capabilities/even-realities-g1.d.ts +12 -0
- package/build/types/capabilities/even-realities-g1.d.ts.map +1 -0
- package/build/types/capabilities/even-realities-g1.js +55 -0
- package/build/types/capabilities/even-realities-g1.js.map +1 -0
- package/build/types/capabilities/even-realities-g2.d.ts +12 -0
- package/build/types/capabilities/even-realities-g2.d.ts.map +1 -0
- package/build/types/capabilities/even-realities-g2.js +75 -0
- package/build/types/capabilities/even-realities-g2.js.map +1 -0
- package/build/types/capabilities/mentra-display.d.ts +12 -0
- package/build/types/capabilities/mentra-display.d.ts.map +1 -0
- package/build/types/capabilities/mentra-display.js +63 -0
- package/build/types/capabilities/mentra-display.js.map +1 -0
- package/build/types/capabilities/mentra-live.d.ts +12 -0
- package/build/types/capabilities/mentra-live.d.ts.map +1 -0
- package/build/types/capabilities/mentra-live.js +92 -0
- package/build/types/capabilities/mentra-live.js.map +1 -0
- package/build/types/capabilities/none.d.ts +13 -0
- package/build/types/capabilities/none.d.ts.map +1 -0
- package/build/types/capabilities/none.js +65 -0
- package/build/types/capabilities/none.js.map +1 -0
- package/build/types/capabilities/simulated-glasses.d.ts +13 -0
- package/build/types/capabilities/simulated-glasses.d.ts.map +1 -0
- package/build/types/capabilities/simulated-glasses.js +65 -0
- package/build/types/capabilities/simulated-glasses.js.map +1 -0
- package/build/types/capabilities/vuzix-z100.d.ts +12 -0
- package/build/types/capabilities/vuzix-z100.d.ts.map +1 -0
- package/build/types/capabilities/vuzix-z100.js +52 -0
- package/build/types/capabilities/vuzix-z100.js.map +1 -0
- package/build/types/enums.d.ts +40 -0
- package/build/types/enums.d.ts.map +1 -0
- package/build/types/enums.js +44 -0
- package/build/types/enums.js.map +1 -0
- package/build/types/hardware.d.ts +160 -0
- package/build/types/hardware.d.ts.map +1 -0
- package/build/types/hardware.js +36 -0
- package/build/types/hardware.js.map +1 -0
- package/build/types/index.d.ts +11 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/index.js +10 -0
- package/build/types/index.js.map +1 -0
- package/build/utils/GlobalEventEmitter.d.ts +10 -0
- package/build/utils/GlobalEventEmitter.d.ts.map +1 -0
- package/build/utils/GlobalEventEmitter.js +13 -0
- package/build/utils/GlobalEventEmitter.js.map +1 -0
- package/build/utils/cloudClient/RnUdpAdapter.d.ts +3 -0
- package/build/utils/cloudClient/RnUdpAdapter.d.ts.map +1 -0
- package/build/utils/cloudClient/RnUdpAdapter.js +41 -0
- package/build/utils/cloudClient/RnUdpAdapter.js.map +1 -0
- package/build/utils/cloudClient/cloudSecureStore.d.ts +3 -0
- package/build/utils/cloudClient/cloudSecureStore.d.ts.map +1 -0
- package/build/utils/cloudClient/cloudSecureStore.js +26 -0
- package/build/utils/cloudClient/cloudSecureStore.js.map +1 -0
- package/build/utils/debouncedPatch.d.ts +6 -0
- package/build/utils/debouncedPatch.d.ts.map +1 -0
- package/build/utils/debouncedPatch.js +25 -0
- package/build/utils/debouncedPatch.js.map +1 -0
- package/build/utils/devLogging.d.ts +26 -0
- package/build/utils/devLogging.d.ts.map +1 -0
- package/build/utils/devLogging.js +116 -0
- package/build/utils/devLogging.js.map +1 -0
- package/build/utils/devMiniappLaunch.d.ts +44 -0
- package/build/utils/devMiniappLaunch.d.ts.map +1 -0
- package/build/utils/devMiniappLaunch.js +52 -0
- package/build/utils/devMiniappLaunch.js.map +1 -0
- package/build/utils/diagnosticContext.d.ts +3 -0
- package/build/utils/diagnosticContext.d.ts.map +1 -0
- package/build/utils/diagnosticContext.js +119 -0
- package/build/utils/diagnosticContext.js.map +1 -0
- package/build/utils/display/composer/ColumnComposer.d.ts +131 -0
- package/build/utils/display/composer/ColumnComposer.d.ts.map +1 -0
- package/build/utils/display/composer/ColumnComposer.js +204 -0
- package/build/utils/display/composer/ColumnComposer.js.map +1 -0
- package/build/utils/display/composer/index.d.ts +9 -0
- package/build/utils/display/composer/index.d.ts.map +1 -0
- package/build/utils/display/composer/index.js +9 -0
- package/build/utils/display/composer/index.js.map +1 -0
- package/build/utils/display/helpers/DisplayHelpers.d.ts +165 -0
- package/build/utils/display/helpers/DisplayHelpers.d.ts.map +1 -0
- package/build/utils/display/helpers/DisplayHelpers.js +312 -0
- package/build/utils/display/helpers/DisplayHelpers.js.map +1 -0
- package/build/utils/display/helpers/ScrollView.d.ts +183 -0
- package/build/utils/display/helpers/ScrollView.d.ts.map +1 -0
- package/build/utils/display/helpers/ScrollView.js +257 -0
- package/build/utils/display/helpers/ScrollView.js.map +1 -0
- package/build/utils/display/helpers/index.d.ts +11 -0
- package/build/utils/display/helpers/index.d.ts.map +1 -0
- package/build/utils/display/helpers/index.js +10 -0
- package/build/utils/display/helpers/index.js.map +1 -0
- package/build/utils/display/index.d.ts +174 -0
- package/build/utils/display/index.d.ts.map +1 -0
- package/build/utils/display/index.js +185 -0
- package/build/utils/display/index.js.map +1 -0
- package/build/utils/display/measurer/TextMeasurer.d.ts +160 -0
- package/build/utils/display/measurer/TextMeasurer.d.ts.map +1 -0
- package/build/utils/display/measurer/TextMeasurer.js +273 -0
- package/build/utils/display/measurer/TextMeasurer.js.map +1 -0
- package/build/utils/display/measurer/index.d.ts +10 -0
- package/build/utils/display/measurer/index.d.ts.map +1 -0
- package/build/utils/display/measurer/index.js +11 -0
- package/build/utils/display/measurer/index.js.map +1 -0
- package/build/utils/display/measurer/script-detection.d.ts +53 -0
- package/build/utils/display/measurer/script-detection.d.ts.map +1 -0
- package/build/utils/display/measurer/script-detection.js +184 -0
- package/build/utils/display/measurer/script-detection.js.map +1 -0
- package/build/utils/display/profiles/g1.d.ts +33 -0
- package/build/utils/display/profiles/g1.d.ts.map +1 -0
- package/build/utils/display/profiles/g1.js +213 -0
- package/build/utils/display/profiles/g1.js.map +1 -0
- package/build/utils/display/profiles/g2.d.ts +13 -0
- package/build/utils/display/profiles/g2.d.ts.map +1 -0
- package/build/utils/display/profiles/g2.js +34 -0
- package/build/utils/display/profiles/g2.js.map +1 -0
- package/build/utils/display/profiles/index.d.ts +12 -0
- package/build/utils/display/profiles/index.d.ts.map +1 -0
- package/build/utils/display/profiles/index.js +15 -0
- package/build/utils/display/profiles/index.js.map +1 -0
- package/build/utils/display/profiles/nex.d.ts +10 -0
- package/build/utils/display/profiles/nex.d.ts.map +1 -0
- package/build/utils/display/profiles/nex.js +150 -0
- package/build/utils/display/profiles/nex.js.map +1 -0
- package/build/utils/display/profiles/types.d.ts +103 -0
- package/build/utils/display/profiles/types.d.ts.map +1 -0
- package/build/utils/display/profiles/types.js +2 -0
- package/build/utils/display/profiles/types.js.map +1 -0
- package/build/utils/display/profiles/z100.d.ts +33 -0
- package/build/utils/display/profiles/z100.d.ts.map +1 -0
- package/build/utils/display/profiles/z100.js +182 -0
- package/build/utils/display/profiles/z100.js.map +1 -0
- package/build/utils/display/scene/degrade.d.ts +25 -0
- package/build/utils/display/scene/degrade.d.ts.map +1 -0
- package/build/utils/display/scene/degrade.js +64 -0
- package/build/utils/display/scene/degrade.js.map +1 -0
- package/build/utils/display/scene/differ.d.ts +38 -0
- package/build/utils/display/scene/differ.d.ts.map +1 -0
- package/build/utils/display/scene/differ.js +107 -0
- package/build/utils/display/scene/differ.js.map +1 -0
- package/build/utils/display/scene/index.d.ts +10 -0
- package/build/utils/display/scene/index.d.ts.map +1 -0
- package/build/utils/display/scene/index.js +6 -0
- package/build/utils/display/scene/index.js.map +1 -0
- package/build/utils/display/scene/process.d.ts +35 -0
- package/build/utils/display/scene/process.d.ts.map +1 -0
- package/build/utils/display/scene/process.js +187 -0
- package/build/utils/display/scene/process.js.map +1 -0
- package/build/utils/display/scene/store.d.ts +48 -0
- package/build/utils/display/scene/store.d.ts.map +1 -0
- package/build/utils/display/scene/store.js +0 -0
- package/build/utils/display/scene/store.js.map +1 -0
- package/build/utils/display/scene/types.d.ts +120 -0
- package/build/utils/display/scene/types.d.ts.map +1 -0
- package/build/utils/display/scene/types.js +0 -0
- package/build/utils/display/scene/types.js.map +1 -0
- package/build/utils/display/wrapper/TextWrapper.d.ts +102 -0
- package/build/utils/display/wrapper/TextWrapper.d.ts.map +1 -0
- package/build/utils/display/wrapper/TextWrapper.js +471 -0
- package/build/utils/display/wrapper/TextWrapper.js.map +1 -0
- package/build/utils/display/wrapper/index.d.ts +12 -0
- package/build/utils/display/wrapper/index.d.ts.map +1 -0
- package/build/utils/display/wrapper/index.js +12 -0
- package/build/utils/display/wrapper/index.js.map +1 -0
- package/build/utils/display/wrapper/types.d.ts +75 -0
- package/build/utils/display/wrapper/types.d.ts.map +1 -0
- package/build/utils/display/wrapper/types.js +11 -0
- package/build/utils/display/wrapper/types.js.map +1 -0
- package/build/utils/e2eMetrics.d.ts +6 -0
- package/build/utils/e2eMetrics.d.ts.map +1 -0
- package/build/utils/e2eMetrics.js +27 -0
- package/build/utils/e2eMetrics.js.map +1 -0
- package/build/utils/hardware/hardware.d.ts +42 -0
- package/build/utils/hardware/hardware.d.ts.map +1 -0
- package/build/utils/hardware/hardware.js +127 -0
- package/build/utils/hardware/hardware.js.map +1 -0
- package/build/utils/hardware/index.d.ts +2 -0
- package/build/utils/hardware/index.d.ts.map +1 -0
- package/build/utils/hardware/index.js +2 -0
- package/build/utils/hardware/index.js.map +1 -0
- package/build/utils/miniappGlobals.d.ts +60 -0
- package/build/utils/miniappGlobals.d.ts.map +1 -0
- package/build/utils/miniappGlobals.js +224 -0
- package/build/utils/miniappGlobals.js.map +1 -0
- package/build/utils/permissions/MediaLibraryPermissions.d.ts +45 -0
- package/build/utils/permissions/MediaLibraryPermissions.d.ts.map +1 -0
- package/build/utils/permissions/MediaLibraryPermissions.js +145 -0
- package/build/utils/permissions/MediaLibraryPermissions.js.map +1 -0
- package/build/utils/permissions/galleryDisplayName.d.ts +8 -0
- package/build/utils/permissions/galleryDisplayName.d.ts.map +1 -0
- package/build/utils/permissions/galleryDisplayName.js +25 -0
- package/build/utils/permissions/galleryDisplayName.js.map +1 -0
- package/build/utils/storage/index.d.ts +3 -0
- package/build/utils/storage/index.d.ts.map +1 -0
- package/build/utils/storage/index.js +3 -0
- package/build/utils/storage/index.js.map +1 -0
- package/build/utils/storage/storage.d.ts +24 -0
- package/build/utils/storage/storage.d.ts.map +1 -0
- package/build/utils/storage/storage.js +85 -0
- package/build/utils/storage/storage.js.map +1 -0
- package/build/utils/storage/zip.d.ts +3 -0
- package/build/utils/storage/zip.d.ts.map +1 -0
- package/build/utils/storage/zip.js +14 -0
- package/build/utils/storage/zip.js.map +1 -0
- package/build/utils/timers/index.d.ts +3 -0
- package/build/utils/timers/index.d.ts.map +1 -0
- package/build/utils/timers/index.js +3 -0
- package/build/utils/timers/index.js.map +1 -0
- package/build/utils/timers/timers.d.ts +9 -0
- package/build/utils/timers/timers.d.ts.map +1 -0
- package/build/utils/timers/timers.js +105 -0
- package/build/utils/timers/timers.js.map +1 -0
- package/package.json +120 -0
- package/src/devtools.ts +13 -0
- package/src/engine.ts +173 -0
- package/src/facades/dev.ts +198 -0
- package/src/facades/display.ts +17 -0
- package/src/facades/displayMirror.ts +33 -0
- package/src/facades/gallery.ts +69 -0
- package/src/facades/glasses.ts +206 -0
- package/src/facades/glassesSettings.ts +56 -0
- package/src/facades/glassesWifi.ts +68 -0
- package/src/facades/miniapps.ts +55 -0
- package/src/facades/notifications.ts +15 -0
- package/src/facades/ota.ts +174 -0
- package/src/facades/pairing.ts +329 -0
- package/src/facades/permissions.ts +165 -0
- package/src/facades/phoneNotifications.ts +50 -0
- package/src/facades/reports.ts +185 -0
- package/src/facades/session.ts +55 -0
- package/src/facades/settings.ts +57 -0
- package/src/facades/speech.ts +38 -0
- package/src/index.ts +191 -0
- package/src/internal.ts +159 -0
- package/src/runtime/bootstrap.ts +118 -0
- package/src/runtime/config.ts +147 -0
- package/src/runtime/streamConfig.ts +34 -0
- package/src/services/AppRegistry.ts +1190 -0
- package/src/services/AudioCloudUplink.ts +50 -0
- package/src/services/AudioPlaybackService.ts +813 -0
- package/src/services/AutomaticReportResult.ts +48 -0
- package/src/services/BlobStore.ts +746 -0
- package/src/services/CaptionsTesterReportService.ts +107 -0
- package/src/services/CloudAudioSubscriptionSync.ts +41 -0
- package/src/services/CloudClientService.ts +689 -0
- package/src/services/CloudTranscriptE2EMetrics.ts +27 -0
- package/src/services/ConnectionCoordinator.ts +65 -0
- package/src/services/DevServerBridge.ts +332 -0
- package/src/services/DeviceEventRouter.ts +238 -0
- package/src/services/DeviceStoreHydration.ts +130 -0
- package/src/services/DisplayProcessor.ts +775 -0
- package/src/services/GlassesReadiness.ts +103 -0
- package/src/services/GlassesSettingsSync.ts +134 -0
- package/src/services/GlassesStatusProjection.ts +73 -0
- package/src/services/HeadingService.ts +98 -0
- package/src/services/LocalDisplayManager.ts +703 -0
- package/src/services/LocalMiniappRuntime.ts +4213 -0
- package/src/services/LocalSttFallbackCoordinator.ts +147 -0
- package/src/services/MentraJSCrashController.ts +189 -0
- package/src/services/MentraJSCrashloopReportService.ts +66 -0
- package/src/services/MentraJSLogPipeline.ts +166 -0
- package/src/services/MentraJSRouter.ts +557 -0
- package/src/services/MentraUIRouter.ts +244 -0
- package/src/services/MicStateCoordinator.ts +94 -0
- package/src/services/MiniappEngine.ts +143 -0
- package/src/services/MiniappLauncher.ts +340 -0
- package/src/services/MiniappRunningRegistry.ts +57 -0
- package/src/services/NativeHttpResponse.ts +6 -0
- package/src/services/NavigationHandlers.ts +423 -0
- package/src/services/NavigationService.ts +731 -0
- package/src/services/NotificationsEmitter.ts +48 -0
- package/src/services/OfflineSpeechModelService.ts +168 -0
- package/src/services/OtaInstallCoordinator.ts +1205 -0
- package/src/services/OtaService.ts +83 -0
- package/src/services/OtaUpdateCheckService.ts +386 -0
- package/src/services/PairingIdentity.ts +154 -0
- package/src/services/PhoneCalendarHelpers.ts +212 -0
- package/src/services/PhoneCalendarService.ts +42 -0
- package/src/services/PhoneCameraFovCoordinator.ts +195 -0
- package/src/services/PhoneLocationService.ts +122 -0
- package/src/services/PhoneNotificationsSync.ts +44 -0
- package/src/services/PhonePhotoCoordinator.ts +409 -0
- package/src/services/PhoneStreamCoordinator.ts +777 -0
- package/src/services/PhoneVideoCoordinator.ts +189 -0
- package/src/services/STTModelManager.ts +360 -0
- package/src/services/SceneRenderer.ts +292 -0
- package/src/services/SentenceTtsPipeline.ts +106 -0
- package/src/services/StreamLifecycleController.ts +213 -0
- package/src/services/TTSModelManager.ts +466 -0
- package/src/services/TranscriptionRouting.ts +37 -0
- package/src/services/WebviewBridge.ts +50 -0
- package/src/services/asg/GalleryMediaIntegrityReportService.ts +70 -0
- package/src/services/asg/asgCameraApi.ts +1695 -0
- package/src/services/asg/cameraRollExportCoordinator.ts +627 -0
- package/src/services/asg/cameraRollExportLedger.ts +122 -0
- package/src/services/asg/galleryMediaValidation.ts +183 -0
- package/src/services/asg/galleryNotices.ts +61 -0
- package/src/services/asg/galleryPathMigration.ts +22 -0
- package/src/services/asg/gallerySettingsService.ts +68 -0
- package/src/services/asg/gallerySyncNotifications.ts +236 -0
- package/src/services/asg/gallerySyncService.ts +2269 -0
- package/src/services/asg/galleryTransferLedger.ts +312 -0
- package/src/services/asg/localNetworkTransport.ts +173 -0
- package/src/services/asg/localStorageService.ts +652 -0
- package/src/services/asg/mediaProcessingQueue.ts +518 -0
- package/src/services/asgOtaVersionUrl.ts +41 -0
- package/src/services/blobPaths.ts +86 -0
- package/src/services/cloudStreamApi.ts +154 -0
- package/src/services/gallerySyncClock.ts +39 -0
- package/src/services/glassesClockSync.ts +115 -0
- package/src/services/manifestVersionGate.ts +43 -0
- package/src/services/mentraUiShim.ts +366 -0
- package/src/services/navigation/roadNameResolver.ts +112 -0
- package/src/services/navigation/routesApiCodec.ts +69 -0
- package/src/services/otaDisplayState.ts +115 -0
- package/src/services/otaInstallPolicy.ts +106 -0
- package/src/services/otaLegacyMapping.ts +71 -0
- package/src/services/slimStreamStatus.ts +28 -0
- package/src/stores/apps.ts +614 -0
- package/src/stores/bluetoothSettingKeys.ts +36 -0
- package/src/stores/cloudClientStatus.ts +37 -0
- package/src/stores/connection.ts +69 -0
- package/src/stores/core.ts +32 -0
- package/src/stores/display.ts +121 -0
- package/src/stores/gallerySync.ts +380 -0
- package/src/stores/glasses.ts +309 -0
- package/src/stores/settings.ts +1001 -0
- package/src/types/applet.ts +112 -0
- package/src/types/asg.ts +58 -0
- package/src/types/capabilities/even-realities-g1.ts +67 -0
- package/src/types/capabilities/even-realities-g2.ts +88 -0
- package/src/types/capabilities/mentra-display.ts +75 -0
- package/src/types/capabilities/mentra-live.ts +103 -0
- package/src/types/capabilities/none.ts +76 -0
- package/src/types/capabilities/simulated-glasses.ts +76 -0
- package/src/types/capabilities/vuzix-z100.ts +64 -0
- package/src/types/enums.ts +43 -0
- package/src/types/hardware.ts +203 -0
- package/src/types/index.ts +37 -0
- package/src/utils/GlobalEventEmitter.ts +14 -0
- package/src/utils/cloudClient/RnUdpAdapter.ts +47 -0
- package/src/utils/cloudClient/cloudSecureStore.ts +28 -0
- package/src/utils/debouncedPatch.ts +28 -0
- package/src/utils/devLogging.ts +140 -0
- package/src/utils/devMiniappLaunch.ts +68 -0
- package/src/utils/diagnosticContext.ts +155 -0
- package/src/utils/display/composer/ColumnComposer.ts +285 -0
- package/src/utils/display/composer/index.ts +15 -0
- package/src/utils/display/helpers/DisplayHelpers.ts +413 -0
- package/src/utils/display/helpers/ScrollView.ts +337 -0
- package/src/utils/display/helpers/index.ts +14 -0
- package/src/utils/display/index.ts +273 -0
- package/src/utils/display/measurer/TextMeasurer.ts +346 -0
- package/src/utils/display/measurer/index.ts +21 -0
- package/src/utils/display/measurer/script-detection.ts +218 -0
- package/src/utils/display/profiles/g1.ts +236 -0
- package/src/utils/display/profiles/g2.ts +39 -0
- package/src/utils/display/profiles/index.ts +28 -0
- package/src/utils/display/profiles/nex.ts +166 -0
- package/src/utils/display/profiles/types.ts +132 -0
- package/src/utils/display/profiles/z100.ts +198 -0
- package/src/utils/display/scene/degrade.ts +80 -0
- package/src/utils/display/scene/differ.ts +128 -0
- package/src/utils/display/scene/index.ts +21 -0
- package/src/utils/display/scene/process.ts +214 -0
- package/src/utils/display/scene/store.ts +0 -0
- package/src/utils/display/scene/types.ts +0 -0
- package/src/utils/display/wrapper/TextWrapper.ts +546 -0
- package/src/utils/display/wrapper/index.ts +15 -0
- package/src/utils/display/wrapper/types.ts +102 -0
- package/src/utils/e2eMetrics.ts +30 -0
- package/src/utils/hardware/hardware.ts +166 -0
- package/src/utils/hardware/index.ts +1 -0
- package/src/utils/miniappGlobals.ts +260 -0
- package/src/utils/permissions/MediaLibraryPermissions.ts +161 -0
- package/src/utils/permissions/galleryDisplayName.ts +28 -0
- package/src/utils/storage/index.ts +2 -0
- package/src/utils/storage/storage.ts +101 -0
- package/src/utils/storage/zip.ts +13 -0
- package/src/utils/timers/index.ts +2 -0
- package/src/utils/timers/timers.ts +139 -0
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PhonePhotoCoordinator — owns local-miniapp takePhoto() end-to-end.
|
|
3
|
+
*
|
|
4
|
+
* Architecture:
|
|
5
|
+
* miniapp → SDK → LocalMiniappRuntime → photo runtime hook
|
|
6
|
+
* → coordinator.takePhoto(packageName, opts)
|
|
7
|
+
* ├── (precheck) glasses connected + hasCamera
|
|
8
|
+
* ├── cloudClientService.startManagedPhoto → {requestId, uploadUrl, readUrl} (cloud-v2 runtime presign)
|
|
9
|
+
* ├── BluetoothSdk.requestPhoto(requestId, size, uploadUrl, compress, sound)
|
|
10
|
+
* └── race:
|
|
11
|
+
* - cloudClientService.awaitManagedPhotoReady(requestId) resolves on photo.ready push
|
|
12
|
+
* - BluetoothSdk.requestPhoto rejects if terminal photo_response is an error
|
|
13
|
+
* - handlePhotoError(requestId, code, message) rejects if MantleManager observes
|
|
14
|
+
* the same BLE photo_response error before the native promise crosses the bridge
|
|
15
|
+
*
|
|
16
|
+
* `activeRequests` lets MantleManager's gated `photo_response` listener
|
|
17
|
+
* short-circuit our long-poll with a typed error (CAMERA_BUSY, BATTERY_LOW,
|
|
18
|
+
* etc.) instead of waiting 30s for cloud's timeout.
|
|
19
|
+
*/
|
|
20
|
+
import BluetoothSdk from "@mentra/bluetooth-sdk/internal";
|
|
21
|
+
import { cloudClientService } from "./CloudClientService";
|
|
22
|
+
import { isGlassesConnected } from "./GlassesReadiness";
|
|
23
|
+
import { useGlassesStore } from "../stores/glasses";
|
|
24
|
+
/** Map legacy/cloud size names onto the native take_photo enum. */
|
|
25
|
+
function normalizePhotoSize(value) {
|
|
26
|
+
if (typeof value !== "string")
|
|
27
|
+
return "medium";
|
|
28
|
+
switch (value) {
|
|
29
|
+
case "small":
|
|
30
|
+
return "low";
|
|
31
|
+
case "large":
|
|
32
|
+
return "high";
|
|
33
|
+
case "full":
|
|
34
|
+
return "max";
|
|
35
|
+
default:
|
|
36
|
+
return ["low", "medium", "high", "max"].includes(value) ? value : "medium";
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export class PhotoError extends Error {
|
|
40
|
+
code;
|
|
41
|
+
stage;
|
|
42
|
+
transport;
|
|
43
|
+
constructor(code, message, stage, transport) {
|
|
44
|
+
super(message);
|
|
45
|
+
this.code = code;
|
|
46
|
+
this.stage = stage;
|
|
47
|
+
this.transport = transport;
|
|
48
|
+
this.name = "PhotoError";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Last-resort ceiling for the complete capture + encode + transfer + upload
|
|
53
|
+
* pipeline. This must exceed the managed-photo service's 30s ready-push
|
|
54
|
+
* timeout so the cloud can return its more specific failure first.
|
|
55
|
+
*
|
|
56
|
+
* Text mode commonly spends several seconds detecting/cropping the region and
|
|
57
|
+
* can take another 10s+ to transfer over BLE. A 15s ceiling incorrectly
|
|
58
|
+
* rejected successful captures while their upload was still in progress.
|
|
59
|
+
*/
|
|
60
|
+
export const CAPTURE_PIPELINE_TIMEOUT_MS = 45_000;
|
|
61
|
+
export const CAMERA_WARM_UP_DEFAULT_DURATION_MS = 15_000;
|
|
62
|
+
export const CAMERA_WARM_UP_MAX_DURATION_MS = 60_000;
|
|
63
|
+
let bleRequestCounter = 0;
|
|
64
|
+
/** Short 4-hex-char correlation id sent over BLE instead of the full cloud
|
|
65
|
+
* requestId UUID (wire v2 keeps BLE JSON small). */
|
|
66
|
+
function mintBleRequestId() {
|
|
67
|
+
bleRequestCounter = (bleRequestCounter + 1) & 0xffff;
|
|
68
|
+
return bleRequestCounter.toString(16).padStart(4, "0");
|
|
69
|
+
}
|
|
70
|
+
function toNativeCompression(compress) {
|
|
71
|
+
if (compress === "high")
|
|
72
|
+
return "heavy";
|
|
73
|
+
if (compress === "low" || compress === "medium")
|
|
74
|
+
return "medium";
|
|
75
|
+
return "none";
|
|
76
|
+
}
|
|
77
|
+
export class PhonePhotoCoordinator {
|
|
78
|
+
// Cloud requestId → in-flight slot. The gated photo_response listener
|
|
79
|
+
// (DeviceEventRouter) resolves short BLE ids via bleIdToCloud before calling
|
|
80
|
+
// owns() / handlePhotoError().
|
|
81
|
+
activeRequests = new Map();
|
|
82
|
+
/** Short BLE correlation id (4-char hex) → full cloud requestId. */
|
|
83
|
+
bleIdToCloud = new Map();
|
|
84
|
+
activeWarmUps = new Map();
|
|
85
|
+
async takePhoto(packageName, opts) {
|
|
86
|
+
// Pre-check: if glasses aren't even connected, the BLE photo command
|
|
87
|
+
// would be sent into the void and we'd wait 30s for the cloud long-poll
|
|
88
|
+
// to time out. Fail fast with a typed error.
|
|
89
|
+
//
|
|
90
|
+
// We DON'T pre-check `hasCamera` here — the canonical capability data
|
|
91
|
+
// lives in `getModelCapabilities(deviceModel)` from @mentra/types and
|
|
92
|
+
// pulling that into this file would add a cross-package import. If a
|
|
93
|
+
// cameraless device receives the BLE photo command, the glasses-side
|
|
94
|
+
// handler will return a photo_response error within ~1s and the gated
|
|
95
|
+
// photo_response listener in MantleManager will short-circuit our
|
|
96
|
+
// long-poll. Slower but correct.
|
|
97
|
+
if (!isGlassesConnected(useGlassesStore.getState().connection)) {
|
|
98
|
+
throw new PhotoError("GLASSES_NOT_CONNECTED", "Glasses are not connected", "command", "ble");
|
|
99
|
+
}
|
|
100
|
+
// Text-mode sensor resolution is owned by ASG constants; keep cloud metadata on a stable
|
|
101
|
+
// high-capacity tier and let the glasses ignore the public size when mode=text.
|
|
102
|
+
const captureSize = opts.size ?? "medium";
|
|
103
|
+
// 1) Presign via the cloud-v2 managed-photo service. Local miniapps use
|
|
104
|
+
// ONLY the cloud-v2 path: the runtime presigns upload+read URLs and the
|
|
105
|
+
// phone (as the device controller) delivers the bytes; the legacy
|
|
106
|
+
// backend_url mint is gone from this flow.
|
|
107
|
+
let requestId;
|
|
108
|
+
let uploadUrl;
|
|
109
|
+
let readUrl;
|
|
110
|
+
const flowStarted = performance.now();
|
|
111
|
+
try {
|
|
112
|
+
const presignStarted = performance.now();
|
|
113
|
+
const r = await cloudClientService.startManagedPhoto({
|
|
114
|
+
size: opts.mode === "text" ? "max" : captureSize,
|
|
115
|
+
});
|
|
116
|
+
const presignMs = Math.round(performance.now() - presignStarted);
|
|
117
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
118
|
+
console.debug(`[PhonePhotoCoordinator] presign ${presignMs}ms size=${opts.mode === "text" ? "max" : captureSize} mode=${opts.mode ?? "photo"}`);
|
|
119
|
+
}
|
|
120
|
+
requestId = r.requestId;
|
|
121
|
+
uploadUrl = r.uploadUrl;
|
|
122
|
+
readUrl = r.readUrl;
|
|
123
|
+
}
|
|
124
|
+
catch (err) {
|
|
125
|
+
throw this.toPhotoError(err, "PHOTO_REQUEST_FAILED", "presign", "cloud-rest");
|
|
126
|
+
}
|
|
127
|
+
// 2) Build the outcome Promise FIRST so both resolve+reject handles
|
|
128
|
+
// are wired into activeRequests BEFORE any code path can produce
|
|
129
|
+
// an error. Without this, a fast BLE photo_response (BATTERY_LOW
|
|
130
|
+
// etc.) racing with the Promise constructor could fire
|
|
131
|
+
// handlePhotoError() against a no-op rejectFn and silently drop
|
|
132
|
+
// the error.
|
|
133
|
+
// When the managed-photo upload URL is loopback (the local storage provider
|
|
134
|
+
// reached over `adb reverse`), the glasses cannot reach it over WiFi —
|
|
135
|
+
// localhost on the glasses is the glasses. Force BLE transfer so the phone
|
|
136
|
+
// (which CAN reach the reversed runtime) relays the bytes; a public r2/s3
|
|
137
|
+
// presigned URL stays on "auto".
|
|
138
|
+
const isLoopbackUpload = /^https?:\/\/(localhost|127\.0\.0\.1|10\.0\.2\.2)\b/.test(uploadUrl);
|
|
139
|
+
const abort = new AbortController();
|
|
140
|
+
const bleRequestId = mintBleRequestId();
|
|
141
|
+
this.bleIdToCloud.set(bleRequestId, requestId);
|
|
142
|
+
const outcome = new Promise((resolve, reject) => {
|
|
143
|
+
this.activeRequests.set(requestId, { packageName, abort, resolve, reject });
|
|
144
|
+
});
|
|
145
|
+
// Last-resort watchdog for a wedged pipeline. The managed-photo ready push
|
|
146
|
+
// normally resolves or rejects first; this only prevents an indefinite hang
|
|
147
|
+
// if both the native terminal response and cloud push disappear.
|
|
148
|
+
const captureWatchdog = setTimeout(() => {
|
|
149
|
+
const e = this.activeRequests.get(requestId);
|
|
150
|
+
if (!e)
|
|
151
|
+
return;
|
|
152
|
+
e.abort.abort();
|
|
153
|
+
e.reject(new PhotoError("CAPTURE_TIMEOUT", "Photo capture did not complete. The take_photo command, media processing, transfer, or upload may have stalled.", "capture", isLoopbackUpload ? "ble" : "wifi"));
|
|
154
|
+
}, CAPTURE_PIPELINE_TIMEOUT_MS);
|
|
155
|
+
// Clear the watchdog on BOTH arms. Not `.finally()`: that would mint a new
|
|
156
|
+
// promise that re-rejects unobserved whenever the photo fails (the caller
|
|
157
|
+
// only awaits `outcome` itself), i.e. an unhandled rejection per failure.
|
|
158
|
+
const clearWatchdog = () => clearTimeout(captureWatchdog);
|
|
159
|
+
void outcome.then(clearWatchdog, clearWatchdog);
|
|
160
|
+
// 3) Drive glasses over BLE. requestPhoto now resolves at terminal
|
|
161
|
+
// photo_response success, so run it beside the cloud poll instead of
|
|
162
|
+
// awaiting it before polling. Native defaults transferMethod to "auto"
|
|
163
|
+
// (Wi-Fi direct with BLE fallback) unless the miniapp forces BLE.
|
|
164
|
+
try {
|
|
165
|
+
void BluetoothSdk.requestPhoto({
|
|
166
|
+
requestId: bleRequestId,
|
|
167
|
+
appId: packageName,
|
|
168
|
+
size: normalizePhotoSize(captureSize),
|
|
169
|
+
mode: opts.mode ?? "photo",
|
|
170
|
+
webhookUrl: uploadUrl,
|
|
171
|
+
authToken: null,
|
|
172
|
+
...(isLoopbackUpload || opts.transferMethod === "ble" ? { transferMethod: "ble" } : {}),
|
|
173
|
+
compress: toNativeCompression(opts.compress),
|
|
174
|
+
save: opts.saveToGallery ?? false,
|
|
175
|
+
sound: opts.sound ?? true,
|
|
176
|
+
exposureTimeNs: opts.exposureTimeNs ?? null,
|
|
177
|
+
iso: opts.iso,
|
|
178
|
+
aeExposureDivisor: opts.aeExposureDivisor,
|
|
179
|
+
isoCap: opts.isoCap,
|
|
180
|
+
noiseReduction: opts.noiseReduction,
|
|
181
|
+
edgeEnhancement: opts.edgeEnhancement,
|
|
182
|
+
mfnr: opts.mfnr,
|
|
183
|
+
zsl: opts.zsl,
|
|
184
|
+
ispDigitalGain: opts.ispDigitalGain,
|
|
185
|
+
ispAnalogGain: opts.ispAnalogGain,
|
|
186
|
+
}).catch((err) => {
|
|
187
|
+
const e = this.activeRequests.get(requestId);
|
|
188
|
+
if (!e)
|
|
189
|
+
return;
|
|
190
|
+
e.abort.abort();
|
|
191
|
+
e.reject(this.toPhotoError(err, "BLE_SEND_FAILED", "command", "ble"));
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
catch (err) {
|
|
195
|
+
this.activeRequests.delete(requestId);
|
|
196
|
+
this.bleIdToCloud.delete(bleRequestId);
|
|
197
|
+
throw this.toPhotoError(err, "BLE_SEND_FAILED", "command", "ble");
|
|
198
|
+
}
|
|
199
|
+
// 4) Await the runtime's photo.ready push (replaces the legacy long-poll).
|
|
200
|
+
// handlePhotoError races against it and uses the same entry to reject
|
|
201
|
+
// first.
|
|
202
|
+
cloudClientService
|
|
203
|
+
.awaitManagedPhotoReady(requestId)
|
|
204
|
+
.then((res) => {
|
|
205
|
+
const e = this.activeRequests.get(requestId);
|
|
206
|
+
if (!e)
|
|
207
|
+
return; // already settled by handlePhotoError
|
|
208
|
+
e.resolve({ photoUrl: res.readUrl ?? readUrl, mimeType: "image/jpeg", size: -1 });
|
|
209
|
+
})
|
|
210
|
+
.catch((err) => {
|
|
211
|
+
const e = this.activeRequests.get(requestId);
|
|
212
|
+
if (e)
|
|
213
|
+
e.reject(this.toPhotoError(err, "POLL_FAILED", "push", "ws"));
|
|
214
|
+
});
|
|
215
|
+
try {
|
|
216
|
+
const result = await outcome;
|
|
217
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
218
|
+
console.debug(`[PhonePhotoCoordinator] takePhoto complete ${Math.round(performance.now() - flowStarted)}ms requestId=${requestId}`);
|
|
219
|
+
}
|
|
220
|
+
return {
|
|
221
|
+
photoUrl: result.photoUrl,
|
|
222
|
+
mimeType: result.mimeType,
|
|
223
|
+
size: result.size,
|
|
224
|
+
requestId,
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
finally {
|
|
228
|
+
this.activeRequests.delete(requestId);
|
|
229
|
+
this.bleIdToCloud.delete(bleRequestId);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
/** Map a short BLE requestId from photo_response back to the cloud requestId. */
|
|
233
|
+
resolveCloudRequestId(bleOrCloudId) {
|
|
234
|
+
return this.bleIdToCloud.get(bleOrCloudId) ?? bleOrCloudId;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Pre-warm the glasses camera so the next takePhoto() is near-instant.
|
|
238
|
+
*
|
|
239
|
+
* Pure BLE — NO cloud presign, NO upload, NO long-poll. The phone mints and owns
|
|
240
|
+
* the requestId, sends the warm-up command, and resolves when the camera reports
|
|
241
|
+
* ready (the native promise resolves on the ready status event).
|
|
242
|
+
*/
|
|
243
|
+
async warmUpCamera(packageName, opts) {
|
|
244
|
+
// Pre-check: if glasses aren't connected, the BLE warm-up command would be
|
|
245
|
+
// sent into the void. Fail fast with a typed error.
|
|
246
|
+
if (!isGlassesConnected(useGlassesStore.getState().connection)) {
|
|
247
|
+
throw new PhotoError("GLASSES_NOT_CONNECTED", "Glasses are not connected", "command", "ble");
|
|
248
|
+
}
|
|
249
|
+
let lease;
|
|
250
|
+
try {
|
|
251
|
+
await this.stopWarmUpForApp(packageName);
|
|
252
|
+
const requestId = mintBleRequestId();
|
|
253
|
+
const requestedDuration = typeof opts.durationMs === "number" && Number.isFinite(opts.durationMs) && opts.durationMs > 0
|
|
254
|
+
? Math.round(opts.durationMs)
|
|
255
|
+
: CAMERA_WARM_UP_DEFAULT_DURATION_MS;
|
|
256
|
+
const durationMs = Math.min(requestedDuration, CAMERA_WARM_UP_MAX_DURATION_MS);
|
|
257
|
+
lease = { requestId, durationMs };
|
|
258
|
+
this.activeWarmUps.set(packageName, lease);
|
|
259
|
+
await BluetoothSdk.warmUpCamera({
|
|
260
|
+
requestId,
|
|
261
|
+
size: normalizePhotoSize(opts.size ?? "medium"),
|
|
262
|
+
mode: opts.mode ?? "photo",
|
|
263
|
+
exposureTimeNs: opts.exposureTimeNs ?? null,
|
|
264
|
+
durationMs,
|
|
265
|
+
});
|
|
266
|
+
if (this.activeWarmUps.get(packageName) === lease) {
|
|
267
|
+
lease.expiryTimer = setTimeout(() => {
|
|
268
|
+
if (this.activeWarmUps.get(packageName) === lease) {
|
|
269
|
+
this.activeWarmUps.delete(packageName);
|
|
270
|
+
}
|
|
271
|
+
}, durationMs);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
catch (err) {
|
|
275
|
+
if (lease && this.activeWarmUps.get(packageName) === lease) {
|
|
276
|
+
if (lease.expiryTimer)
|
|
277
|
+
clearTimeout(lease.expiryTimer);
|
|
278
|
+
this.activeWarmUps.delete(packageName);
|
|
279
|
+
}
|
|
280
|
+
throw this.toPhotoError(err, "WARM_UP_FAILED", "command", "ble");
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
/** Release a miniapp's warm-up even if its original warmUpCamera promise is still opening. */
|
|
284
|
+
async stopWarmUpForApp(packageName) {
|
|
285
|
+
const active = this.activeWarmUps.get(packageName);
|
|
286
|
+
if (!active)
|
|
287
|
+
return;
|
|
288
|
+
await BluetoothSdk.stopCameraWarmUp(active.requestId);
|
|
289
|
+
if (this.activeWarmUps.get(packageName) === active) {
|
|
290
|
+
this.activeWarmUps.delete(packageName);
|
|
291
|
+
if (active.expiryTimer)
|
|
292
|
+
clearTimeout(active.expiryTimer);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
/** True iff this requestId (short BLE id or cloud id) is one we're currently waiting on. */
|
|
296
|
+
owns(requestId) {
|
|
297
|
+
const cloudId = this.resolveCloudRequestId(requestId);
|
|
298
|
+
return this.activeRequests.has(cloudId);
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Called by MantleManager's gated photo_response listener when glasses
|
|
302
|
+
* report an error (BATTERY_LOW, CAMERA_BUSY, etc.) for a phone-owned
|
|
303
|
+
* requestId. Rejects the in-flight takePhoto Promise immediately.
|
|
304
|
+
*/
|
|
305
|
+
handlePhotoError(requestId, errorCode, errorMessage) {
|
|
306
|
+
const cloudId = this.resolveCloudRequestId(requestId);
|
|
307
|
+
const entry = this.activeRequests.get(cloudId);
|
|
308
|
+
if (!entry)
|
|
309
|
+
return;
|
|
310
|
+
this.bleIdToCloud.delete(requestId);
|
|
311
|
+
// Abort the in-flight long-poll first so we don't double-resolve.
|
|
312
|
+
entry.abort.abort();
|
|
313
|
+
entry.reject(new PhotoError(errorCode || "GLASSES_ERROR", errorMessage || "Glasses error", "capture", "ble"));
|
|
314
|
+
// cloud-v2 pending photo requests TTL out on their own; nothing to free.
|
|
315
|
+
}
|
|
316
|
+
toPhotoError(err, fallbackCode, stage, transport) {
|
|
317
|
+
if (err instanceof PhotoError)
|
|
318
|
+
return err;
|
|
319
|
+
const code = err?.code;
|
|
320
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
321
|
+
return new PhotoError(code || fallbackCode, message, stage, transport);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
// Singleton — coordinator state is process-wide (mirrors phoneStreamCoordinator).
|
|
325
|
+
export const phonePhotoCoordinator = new PhonePhotoCoordinator();
|
|
326
|
+
//# sourceMappingURL=PhonePhotoCoordinator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhonePhotoCoordinator.js","sourceRoot":"","sources":["../../src/services/PhonePhotoCoordinator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,YAAY,MAAM,gCAAgC,CAAA;AAEzD,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAA;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AAI,qBAAqB,EAAE,CAAA","sourcesContent":["/**\n * PhonePhotoCoordinator — owns local-miniapp takePhoto() end-to-end.\n *\n * Architecture:\n * miniapp → SDK → LocalMiniappRuntime → photo runtime hook\n * → coordinator.takePhoto(packageName, opts)\n * ├── (precheck) glasses connected + hasCamera\n * ├── cloudClientService.startManagedPhoto → {requestId, uploadUrl, readUrl} (cloud-v2 runtime presign)\n * ├── BluetoothSdk.requestPhoto(requestId, size, uploadUrl, compress, sound)\n * └── race:\n * - cloudClientService.awaitManagedPhotoReady(requestId) resolves on photo.ready push\n * - BluetoothSdk.requestPhoto rejects if terminal photo_response is an error\n * - handlePhotoError(requestId, code, message) rejects if MantleManager observes\n * the same BLE photo_response error before the native promise crosses the bridge\n *\n * `activeRequests` lets MantleManager's gated `photo_response` listener\n * short-circuit our long-poll with a typed error (CAMERA_BUSY, BATTERY_LOW,\n * etc.) instead of waiting 30s for cloud's timeout.\n */\n\nimport BluetoothSdk from \"@mentra/bluetooth-sdk/internal\"\nimport type {PhotoSize} from \"@mentra/bluetooth-sdk/internal\"\nimport {cloudClientService} from \"./CloudClientService\"\nimport {isGlassesConnected} from \"./GlassesReadiness\"\nimport {useGlassesStore} from \"../stores/glasses\"\n\ninterface PhotoResult {\n photoUrl: string\n mimeType: string\n size: number\n}\n\n/** Map legacy/cloud size names onto the native take_photo enum. */\nfunction normalizePhotoSize(value: unknown): PhotoSize {\n if (typeof value !== \"string\") return \"medium\"\n switch (value) {\n case \"small\":\n return \"low\"\n case \"large\":\n return \"high\"\n case \"full\":\n return \"max\"\n default:\n return ([\"low\", \"medium\", \"high\", \"max\"] as const).includes(value as PhotoSize) ? (value as PhotoSize) : \"medium\"\n }\n}\n\nexport interface PhotoOpts {\n /** Legacy cloud size names are normalized before the native take_photo command. */\n size?: \"low\" | \"medium\" | \"high\" | \"max\" | \"small\" | \"large\" | \"full\"\n mode?: \"photo\" | \"text\"\n /** Force phone-relayed BLE delivery, or leave native on its auto Wi-Fi/BLE policy. */\n transferMethod?: \"auto\" | \"ble\"\n compress?: \"none\" | \"low\" | \"medium\" | \"high\"\n sound?: boolean\n saveToGallery?: boolean\n exposureTimeNs?: number\n iso?: number | null\n aeExposureDivisor?: number\n isoCap?: number\n noiseReduction?: boolean\n edgeEnhancement?: boolean\n mfnr?: boolean\n zsl?: boolean\n ispDigitalGain?: number\n ispAnalogGain?: string\n}\n\nexport interface PhotoTaken {\n photoUrl: string\n mimeType: string\n size: number\n requestId: string\n}\n\n/** Pipeline stage a photo request failed at — surfaced to the miniapp so a dev\n * sees exactly where it broke, not just a flattened message. */\nexport type PhotoStage = \"presign\" | \"command\" | \"capture\" | \"upload\" | \"push\"\n/** Transport in play at the point of failure. */\nexport type PhotoTransport = \"cloud-rest\" | \"ble\" | \"wifi\" | \"ws\"\n\nexport class PhotoError extends Error {\n constructor(\n public readonly code: string,\n message: string,\n public readonly stage?: PhotoStage,\n public readonly transport?: PhotoTransport,\n ) {\n super(message)\n this.name = \"PhotoError\"\n }\n}\n\ninterface ActiveRequest {\n packageName: string\n abort: AbortController\n resolve: (r: PhotoResult) => void\n reject: (err: Error) => void\n}\n\n/**\n * Last-resort ceiling for the complete capture + encode + transfer + upload\n * pipeline. This must exceed the managed-photo service's 30s ready-push\n * timeout so the cloud can return its more specific failure first.\n *\n * Text mode commonly spends several seconds detecting/cropping the region and\n * can take another 10s+ to transfer over BLE. A 15s ceiling incorrectly\n * rejected successful captures while their upload was still in progress.\n */\nexport const CAPTURE_PIPELINE_TIMEOUT_MS = 45_000\nexport const CAMERA_WARM_UP_DEFAULT_DURATION_MS = 15_000\nexport const CAMERA_WARM_UP_MAX_DURATION_MS = 60_000\n\nlet bleRequestCounter = 0\n\n/** Short 4-hex-char correlation id sent over BLE instead of the full cloud\n * requestId UUID (wire v2 keeps BLE JSON small). */\nfunction mintBleRequestId(): string {\n bleRequestCounter = (bleRequestCounter + 1) & 0xffff\n return bleRequestCounter.toString(16).padStart(4, \"0\")\n}\n\nfunction toNativeCompression(compress: PhotoOpts[\"compress\"]): \"none\" | \"medium\" | \"heavy\" {\n if (compress === \"high\") return \"heavy\"\n if (compress === \"low\" || compress === \"medium\") return \"medium\"\n return \"none\"\n}\n\nexport class PhonePhotoCoordinator {\n // Cloud requestId → in-flight slot. The gated photo_response listener\n // (DeviceEventRouter) resolves short BLE ids via bleIdToCloud before calling\n // owns() / handlePhotoError().\n private readonly activeRequests = new Map<string, ActiveRequest>()\n /** Short BLE correlation id (4-char hex) → full cloud requestId. */\n private readonly bleIdToCloud = new Map<string, string>()\n private readonly activeWarmUps = new Map<\n string,\n {requestId: string; durationMs: number; expiryTimer?: ReturnType<typeof setTimeout>}\n >()\n\n async takePhoto(packageName: string, opts: PhotoOpts): Promise<PhotoTaken> {\n // Pre-check: if glasses aren't even connected, the BLE photo command\n // would be sent into the void and we'd wait 30s for the cloud long-poll\n // to time out. Fail fast with a typed error.\n //\n // We DON'T pre-check `hasCamera` here — the canonical capability data\n // lives in `getModelCapabilities(deviceModel)` from @mentra/types and\n // pulling that into this file would add a cross-package import. If a\n // cameraless device receives the BLE photo command, the glasses-side\n // handler will return a photo_response error within ~1s and the gated\n // photo_response listener in MantleManager will short-circuit our\n // long-poll. Slower but correct.\n if (!isGlassesConnected(useGlassesStore.getState().connection)) {\n throw new PhotoError(\"GLASSES_NOT_CONNECTED\", \"Glasses are not connected\", \"command\", \"ble\")\n }\n\n // Text-mode sensor resolution is owned by ASG constants; keep cloud metadata on a stable\n // high-capacity tier and let the glasses ignore the public size when mode=text.\n const captureSize = opts.size ?? \"medium\"\n\n // 1) Presign via the cloud-v2 managed-photo service. Local miniapps use\n // ONLY the cloud-v2 path: the runtime presigns upload+read URLs and the\n // phone (as the device controller) delivers the bytes; the legacy\n // backend_url mint is gone from this flow.\n let requestId: string\n let uploadUrl: string\n let readUrl: string\n const flowStarted = performance.now()\n try {\n const presignStarted = performance.now()\n const r = await cloudClientService.startManagedPhoto({\n size: opts.mode === \"text\" ? \"max\" : captureSize,\n })\n const presignMs = Math.round(performance.now() - presignStarted)\n if (typeof __DEV__ !== \"undefined\" && __DEV__) {\n console.debug(\n `[PhonePhotoCoordinator] presign ${presignMs}ms size=${opts.mode === \"text\" ? \"max\" : captureSize} mode=${\n opts.mode ?? \"photo\"\n }`,\n )\n }\n requestId = r.requestId\n uploadUrl = r.uploadUrl\n readUrl = r.readUrl\n } catch (err) {\n throw this.toPhotoError(err, \"PHOTO_REQUEST_FAILED\", \"presign\", \"cloud-rest\")\n }\n\n // 2) Build the outcome Promise FIRST so both resolve+reject handles\n // are wired into activeRequests BEFORE any code path can produce\n // an error. Without this, a fast BLE photo_response (BATTERY_LOW\n // etc.) racing with the Promise constructor could fire\n // handlePhotoError() against a no-op rejectFn and silently drop\n // the error.\n // When the managed-photo upload URL is loopback (the local storage provider\n // reached over `adb reverse`), the glasses cannot reach it over WiFi —\n // localhost on the glasses is the glasses. Force BLE transfer so the phone\n // (which CAN reach the reversed runtime) relays the bytes; a public r2/s3\n // presigned URL stays on \"auto\".\n const isLoopbackUpload = /^https?:\\/\\/(localhost|127\\.0\\.0\\.1|10\\.0\\.2\\.2)\\b/.test(uploadUrl)\n\n const abort = new AbortController()\n const bleRequestId = mintBleRequestId()\n this.bleIdToCloud.set(bleRequestId, requestId)\n\n const outcome = new Promise<PhotoResult>((resolve, reject) => {\n this.activeRequests.set(requestId, {packageName, abort, resolve, reject})\n })\n\n // Last-resort watchdog for a wedged pipeline. The managed-photo ready push\n // normally resolves or rejects first; this only prevents an indefinite hang\n // if both the native terminal response and cloud push disappear.\n const captureWatchdog = setTimeout(() => {\n const e = this.activeRequests.get(requestId)\n if (!e) return\n e.abort.abort()\n e.reject(\n new PhotoError(\n \"CAPTURE_TIMEOUT\",\n \"Photo capture did not complete. The take_photo command, media processing, transfer, or upload may have stalled.\",\n \"capture\",\n isLoopbackUpload ? \"ble\" : \"wifi\",\n ),\n )\n }, CAPTURE_PIPELINE_TIMEOUT_MS)\n // Clear the watchdog on BOTH arms. Not `.finally()`: that would mint a new\n // promise that re-rejects unobserved whenever the photo fails (the caller\n // only awaits `outcome` itself), i.e. an unhandled rejection per failure.\n const clearWatchdog = () => clearTimeout(captureWatchdog)\n void outcome.then(clearWatchdog, clearWatchdog)\n\n // 3) Drive glasses over BLE. requestPhoto now resolves at terminal\n // photo_response success, so run it beside the cloud poll instead of\n // awaiting it before polling. Native defaults transferMethod to \"auto\"\n // (Wi-Fi direct with BLE fallback) unless the miniapp forces BLE.\n try {\n void BluetoothSdk.requestPhoto({\n requestId: bleRequestId,\n appId: packageName,\n size: normalizePhotoSize(captureSize),\n mode: opts.mode ?? \"photo\",\n webhookUrl: uploadUrl,\n authToken: null,\n ...(isLoopbackUpload || opts.transferMethod === \"ble\" ? {transferMethod: \"ble\" as const} : {}),\n compress: toNativeCompression(opts.compress),\n save: opts.saveToGallery ?? false,\n sound: opts.sound ?? true,\n exposureTimeNs: opts.exposureTimeNs ?? null,\n iso: opts.iso,\n aeExposureDivisor: opts.aeExposureDivisor,\n isoCap: opts.isoCap,\n noiseReduction: opts.noiseReduction,\n edgeEnhancement: opts.edgeEnhancement,\n mfnr: opts.mfnr,\n zsl: opts.zsl,\n ispDigitalGain: opts.ispDigitalGain,\n ispAnalogGain: opts.ispAnalogGain,\n }).catch((err) => {\n const e = this.activeRequests.get(requestId)\n if (!e) return\n e.abort.abort()\n e.reject(this.toPhotoError(err, \"BLE_SEND_FAILED\", \"command\", \"ble\"))\n })\n } catch (err) {\n this.activeRequests.delete(requestId)\n this.bleIdToCloud.delete(bleRequestId)\n throw this.toPhotoError(err, \"BLE_SEND_FAILED\", \"command\", \"ble\")\n }\n\n // 4) Await the runtime's photo.ready push (replaces the legacy long-poll).\n // handlePhotoError races against it and uses the same entry to reject\n // first.\n cloudClientService\n .awaitManagedPhotoReady(requestId)\n .then((res) => {\n const e = this.activeRequests.get(requestId)\n if (!e) return // already settled by handlePhotoError\n e.resolve({photoUrl: res.readUrl ?? readUrl, mimeType: \"image/jpeg\", size: -1})\n })\n .catch((err) => {\n const e = this.activeRequests.get(requestId)\n if (e) e.reject(this.toPhotoError(err, \"POLL_FAILED\", \"push\", \"ws\"))\n })\n\n try {\n const result = await outcome\n if (typeof __DEV__ !== \"undefined\" && __DEV__) {\n console.debug(\n `[PhonePhotoCoordinator] takePhoto complete ${Math.round(\n performance.now() - flowStarted,\n )}ms requestId=${requestId}`,\n )\n }\n return {\n photoUrl: result.photoUrl,\n mimeType: result.mimeType,\n size: result.size,\n requestId,\n }\n } finally {\n this.activeRequests.delete(requestId)\n this.bleIdToCloud.delete(bleRequestId)\n }\n }\n\n /** Map a short BLE requestId from photo_response back to the cloud requestId. */\n resolveCloudRequestId(bleOrCloudId: string): string {\n return this.bleIdToCloud.get(bleOrCloudId) ?? bleOrCloudId\n }\n\n /**\n * Pre-warm the glasses camera so the next takePhoto() is near-instant.\n *\n * Pure BLE — NO cloud presign, NO upload, NO long-poll. The phone mints and owns\n * the requestId, sends the warm-up command, and resolves when the camera reports\n * ready (the native promise resolves on the ready status event).\n */\n async warmUpCamera(\n packageName: string,\n opts: {\n size?: \"low\" | \"medium\" | \"high\" | \"max\"\n mode?: \"photo\" | \"text\"\n exposureTimeNs?: number\n durationMs?: number\n },\n ): Promise<void> {\n // Pre-check: if glasses aren't connected, the BLE warm-up command would be\n // sent into the void. Fail fast with a typed error.\n if (!isGlassesConnected(useGlassesStore.getState().connection)) {\n throw new PhotoError(\"GLASSES_NOT_CONNECTED\", \"Glasses are not connected\", \"command\", \"ble\")\n }\n\n let lease: {requestId: string; durationMs: number; expiryTimer?: ReturnType<typeof setTimeout>} | undefined\n try {\n await this.stopWarmUpForApp(packageName)\n const requestId = mintBleRequestId()\n const requestedDuration =\n typeof opts.durationMs === \"number\" && Number.isFinite(opts.durationMs) && opts.durationMs > 0\n ? Math.round(opts.durationMs)\n : CAMERA_WARM_UP_DEFAULT_DURATION_MS\n const durationMs = Math.min(requestedDuration, CAMERA_WARM_UP_MAX_DURATION_MS)\n lease = {requestId, durationMs}\n this.activeWarmUps.set(packageName, lease)\n await BluetoothSdk.warmUpCamera({\n requestId,\n size: normalizePhotoSize(opts.size ?? \"medium\"),\n mode: opts.mode ?? \"photo\",\n exposureTimeNs: opts.exposureTimeNs ?? null,\n durationMs,\n })\n if (this.activeWarmUps.get(packageName) === lease) {\n lease.expiryTimer = setTimeout(() => {\n if (this.activeWarmUps.get(packageName) === lease) {\n this.activeWarmUps.delete(packageName)\n }\n }, durationMs)\n }\n } catch (err) {\n if (lease && this.activeWarmUps.get(packageName) === lease) {\n if (lease.expiryTimer) clearTimeout(lease.expiryTimer)\n this.activeWarmUps.delete(packageName)\n }\n throw this.toPhotoError(err, \"WARM_UP_FAILED\", \"command\", \"ble\")\n }\n }\n\n /** Release a miniapp's warm-up even if its original warmUpCamera promise is still opening. */\n async stopWarmUpForApp(packageName: string): Promise<void> {\n const active = this.activeWarmUps.get(packageName)\n if (!active) return\n await BluetoothSdk.stopCameraWarmUp(active.requestId)\n if (this.activeWarmUps.get(packageName) === active) {\n this.activeWarmUps.delete(packageName)\n if (active.expiryTimer) clearTimeout(active.expiryTimer)\n }\n }\n\n /** True iff this requestId (short BLE id or cloud id) is one we're currently waiting on. */\n owns(requestId: string): boolean {\n const cloudId = this.resolveCloudRequestId(requestId)\n return this.activeRequests.has(cloudId)\n }\n\n /**\n * Called by MantleManager's gated photo_response listener when glasses\n * report an error (BATTERY_LOW, CAMERA_BUSY, etc.) for a phone-owned\n * requestId. Rejects the in-flight takePhoto Promise immediately.\n */\n handlePhotoError(requestId: string, errorCode: string, errorMessage: string): void {\n const cloudId = this.resolveCloudRequestId(requestId)\n const entry = this.activeRequests.get(cloudId)\n if (!entry) return\n this.bleIdToCloud.delete(requestId)\n // Abort the in-flight long-poll first so we don't double-resolve.\n entry.abort.abort()\n entry.reject(new PhotoError(errorCode || \"GLASSES_ERROR\", errorMessage || \"Glasses error\", \"capture\", \"ble\"))\n // cloud-v2 pending photo requests TTL out on their own; nothing to free.\n }\n\n private toPhotoError(err: unknown, fallbackCode: string, stage?: PhotoStage, transport?: PhotoTransport): PhotoError {\n if (err instanceof PhotoError) return err\n const code = (err as {code?: string})?.code\n const message = err instanceof Error ? err.message : String(err)\n return new PhotoError(code || fallbackCode, message, stage, transport)\n }\n}\n\n// Singleton — coordinator state is process-wide (mirrors phoneStreamCoordinator).\nexport const phonePhotoCoordinator = new PhonePhotoCoordinator()\n"]}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PhoneStreamCoordinator — owns all local-miniapp streaming on the phone.
|
|
3
|
+
*
|
|
4
|
+
* Architecture:
|
|
5
|
+
* miniapp → SDK → LocalMiniappRuntime → coordinator
|
|
6
|
+
* coordinator → BluetoothSdk (BLE → glasses publisher)
|
|
7
|
+
* coordinator ↔ cloudStreamApi (managed only, cloud-v2 runtime provisioning)
|
|
8
|
+
* coordinator ↔ StreamLifecycleController (keep-alive heartbeat)
|
|
9
|
+
* coordinator → status listeners → routed back to miniapp(s)
|
|
10
|
+
*
|
|
11
|
+
* Single-stream constraint:
|
|
12
|
+
* At most ONE stream is active across all miniapps. The exception is that
|
|
13
|
+
* multiple miniapps can subscribe to a single managed stream that's already
|
|
14
|
+
* running — Cloudflare muxes one ingest into many viewers, so subscribers
|
|
15
|
+
* share the same playback URLs. Refcounted; teardown happens when the last
|
|
16
|
+
* subscriber releases.
|
|
17
|
+
*
|
|
18
|
+
* Status routing:
|
|
19
|
+
* Glasses publisher status arrives over BLE as `stream_status` events with
|
|
20
|
+
* a `streamId`. The coordinator's `owns(streamId)` lookup lets MantleManager
|
|
21
|
+
* route phone-owned status events here (not to cloud). For managed streams,
|
|
22
|
+
* we additionally poll Cloudflare's live-input status every 5s to surface
|
|
23
|
+
* what the OTHER end of the pipe sees.
|
|
24
|
+
*
|
|
25
|
+
* Important: this is the ONLY place that mints `streamId`s for phone-owned
|
|
26
|
+
* streams. We use a `phone-` prefix so they're trivially distinguishable from
|
|
27
|
+
* cloud-minted IDs in logs and from cloud-SDK app streams that flow through
|
|
28
|
+
* the legacy path.
|
|
29
|
+
*/
|
|
30
|
+
import type { KeepAliveAckEvent, StreamResolvedConfig, StreamStartRequest, StreamStatusEvent } from "@mentra/bluetooth-sdk/internal";
|
|
31
|
+
import { type RestreamDestinationInput } from "./cloudStreamApi";
|
|
32
|
+
/**
|
|
33
|
+
* Default cadence + thresholds. Exposed via {@link CoordinatorTimings} so tests
|
|
34
|
+
* can shorten them; production code should never override these.
|
|
35
|
+
*/
|
|
36
|
+
declare const DEFAULT_TIMINGS: {
|
|
37
|
+
readonly keepAliveIntervalMs: 15000;
|
|
38
|
+
readonly ackTimeoutMs: 10000;
|
|
39
|
+
readonly maxMissedAcks: 3;
|
|
40
|
+
readonly cloudflareStatusPollMs: 5000;
|
|
41
|
+
readonly hlsReadinessInitialDelayMs: 5000;
|
|
42
|
+
readonly hlsReadinessPollMs: 2000;
|
|
43
|
+
readonly hlsReadinessMaxAttempts: 30;
|
|
44
|
+
};
|
|
45
|
+
type TimingConfig = {
|
|
46
|
+
[K in keyof typeof DEFAULT_TIMINGS]: number;
|
|
47
|
+
};
|
|
48
|
+
export type CoordinatorTimings = Partial<TimingConfig>;
|
|
49
|
+
export interface StartUnmanagedOptions {
|
|
50
|
+
streamUrl: string;
|
|
51
|
+
video?: StreamStartRequest["video"];
|
|
52
|
+
audio?: StreamStartRequest["audio"];
|
|
53
|
+
sound?: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface StartManagedOptions {
|
|
56
|
+
restreamDestinations?: RestreamDestinationInput[];
|
|
57
|
+
video?: StreamStartRequest["video"];
|
|
58
|
+
audio?: StreamStartRequest["audio"];
|
|
59
|
+
sound?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Ingest protocol preference — a real latency/durability trade on Cloudflare:
|
|
62
|
+
* - "srt" (default): SRT ingest -> LL-HLS playback (~10-20s glass-to-screen),
|
|
63
|
+
* with shareable HLS/DASH URLs and automatic recording.
|
|
64
|
+
* - "whip": WebRTC ingest -> WHEP playback (<1s glass-to-screen), but NO
|
|
65
|
+
* HLS/DASH playback and NO recording (Cloudflare limitation; the returned
|
|
66
|
+
* hlsUrl will serve 204 forever).
|
|
67
|
+
*/
|
|
68
|
+
ingest?: "srt" | "whip";
|
|
69
|
+
}
|
|
70
|
+
export interface StreamPublisherStartResult {
|
|
71
|
+
streamId: string;
|
|
72
|
+
status: string;
|
|
73
|
+
resolvedConfig?: StreamResolvedConfig;
|
|
74
|
+
}
|
|
75
|
+
export interface ManagedStartResult extends StreamPublisherStartResult {
|
|
76
|
+
liveInputId: string;
|
|
77
|
+
/** Playback mode this stream supports: "hls" (SRT/RTMP ingest — use hlsUrl/
|
|
78
|
+
* dashUrl, recording on) or "webrtc" (WHIP ingest — use webrtcUrl/WHEP,
|
|
79
|
+
* sub-second, no HLS, no recording). */
|
|
80
|
+
mode: "hls" | "webrtc";
|
|
81
|
+
hlsUrl: string;
|
|
82
|
+
dashUrl: string;
|
|
83
|
+
webrtcUrl?: string;
|
|
84
|
+
}
|
|
85
|
+
export type StreamStatusUpdate = {
|
|
86
|
+
streamId: string;
|
|
87
|
+
source: "glasses" | "cloudflare" | "coordinator";
|
|
88
|
+
status: string;
|
|
89
|
+
data?: Record<string, unknown>;
|
|
90
|
+
};
|
|
91
|
+
export type StatusSubscriber = (packageName: string, update: StreamStatusUpdate) => void;
|
|
92
|
+
export declare class StreamConflictError extends Error {
|
|
93
|
+
readonly code: string;
|
|
94
|
+
/** Pipeline stage that failed (provision | command | publish | playback). */
|
|
95
|
+
readonly stage?: string | undefined;
|
|
96
|
+
/** Transport in play at the failure (cloud-rest | ble | wifi). */
|
|
97
|
+
readonly transport?: string | undefined;
|
|
98
|
+
constructor(code: string, message: string,
|
|
99
|
+
/** Pipeline stage that failed (provision | command | publish | playback). */
|
|
100
|
+
stage?: string | undefined,
|
|
101
|
+
/** Transport in play at the failure (cloud-rest | ble | wifi). */
|
|
102
|
+
transport?: string | undefined);
|
|
103
|
+
}
|
|
104
|
+
export declare class PhoneStreamCoordinator {
|
|
105
|
+
private current;
|
|
106
|
+
private lifecycle;
|
|
107
|
+
private statusSubscriber;
|
|
108
|
+
private idCounter;
|
|
109
|
+
private readonly timings;
|
|
110
|
+
/**
|
|
111
|
+
* Serializes state transitions (start, stop, teardown). Without it, a
|
|
112
|
+
* second `start*` racing with the first can pass the `this.current === null`
|
|
113
|
+
* pre-check while the first is still awaiting its provision/BLE work, and
|
|
114
|
+
* end up provisioning two separate streams. A teardown racing with a start
|
|
115
|
+
* can clear `current` mid-stop and let the start fire BLE writes that
|
|
116
|
+
* collide with the in-flight stopStream.
|
|
117
|
+
*/
|
|
118
|
+
private inFlight;
|
|
119
|
+
/** Drop identical stream_status fanouts within one session. */
|
|
120
|
+
private lastFanoutSignature;
|
|
121
|
+
/** Send full resolvedConfig only once per stream session. */
|
|
122
|
+
private resolvedConfigForwarded;
|
|
123
|
+
constructor(timings?: CoordinatorTimings);
|
|
124
|
+
/**
|
|
125
|
+
* Run `work` under the transition lock. Each call awaits the previous
|
|
126
|
+
* transition before re-evaluating preconditions, so e.g. two concurrent
|
|
127
|
+
* `startManaged` calls are observed sequentially.
|
|
128
|
+
*/
|
|
129
|
+
private runExclusive;
|
|
130
|
+
/**
|
|
131
|
+
* Register the function that routes status updates to miniapps.
|
|
132
|
+
* LocalMiniappRuntime wires this so updates become EVENT envelopes on the
|
|
133
|
+
* `stream_status` stream for every subscribing miniapp.
|
|
134
|
+
*/
|
|
135
|
+
setStatusSubscriber(cb: StatusSubscriber): void;
|
|
136
|
+
/**
|
|
137
|
+
* True when a phone-owned stream currently uses this streamId. For managed
|
|
138
|
+
* streams, all subscribers share the same streamId so a single equality
|
|
139
|
+
* check covers the multi-subscriber case.
|
|
140
|
+
*/
|
|
141
|
+
owns(streamId: string): boolean;
|
|
142
|
+
startUnmanaged(packageName: string, opts: StartUnmanagedOptions): Promise<StreamPublisherStartResult>;
|
|
143
|
+
startManaged(packageName: string, opts: StartManagedOptions): Promise<ManagedStartResult>;
|
|
144
|
+
stop(packageName: string, streamId?: string): Promise<void>;
|
|
145
|
+
/**
|
|
146
|
+
* Called by MantleManager when a `stream_status` event arrives from glasses
|
|
147
|
+
* and the registry says it's phone-owned.
|
|
148
|
+
*/
|
|
149
|
+
handleGlassesStatus(event: StreamStatusEvent): void;
|
|
150
|
+
/** Called by MantleManager when a phone-owned keep_alive_ack arrives. */
|
|
151
|
+
handleKeepAliveAck(event: KeepAliveAckEvent): void;
|
|
152
|
+
private mintId;
|
|
153
|
+
private startLifecycle;
|
|
154
|
+
private startCloudflareStatusPoll;
|
|
155
|
+
private startHlsReadinessPoll;
|
|
156
|
+
private fanout;
|
|
157
|
+
/**
|
|
158
|
+
* Run teardown of the currently-active stream. Caller must hold the
|
|
159
|
+
* transition lock (see {@link runExclusive}). Keeps `this.current`
|
|
160
|
+
* populated until BluetoothSdk.stopStream resolves so a concurrent caller
|
|
161
|
+
* waiting on the lock can't claim the slot mid-stop and have its
|
|
162
|
+
* startStream BLE write collide with our in-flight stopStream.
|
|
163
|
+
*/
|
|
164
|
+
private teardownLocked;
|
|
165
|
+
}
|
|
166
|
+
export declare const phoneStreamCoordinator: PhoneStreamCoordinator;
|
|
167
|
+
export {};
|
|
168
|
+
//# sourceMappingURL=PhoneStreamCoordinator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhoneStreamCoordinator.d.ts","sourceRoot":"","sources":["../../src/services/PhoneStreamCoordinator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AAMvC,OAAO,EAML,KAAK,wBAAwB,EAC9B,MAAM,kBAAkB,CAAA;AAEzB;;;GAGG;AACH,QAAA,MAAM,eAAe;;;;;;;;CASX,CAAA;AAEV,KAAK,YAAY,GAAG;KAAE,CAAC,IAAI,MAAM,OAAO,eA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