@glassly/engine 0.1.0-dev.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 +96 -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 +336 -0
- package/build/engine.d.ts.map +1 -0
- package/build/engine.js +198 -0
- package/build/engine.js.map +1 -0
- package/build/facades/dev.d.ts +69 -0
- package/build/facades/dev.d.ts.map +1 -0
- package/build/facades/dev.js +204 -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 +142 -0
- package/build/facades/glasses.d.ts.map +1 -0
- package/build/facades/glasses.js +214 -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 +55 -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/maps.d.ts +18 -0
- package/build/facades/maps.d.ts.map +1 -0
- package/build/facades/maps.js +13 -0
- package/build/facades/maps.js.map +1 -0
- package/build/facades/memory.d.ts +38 -0
- package/build/facades/memory.d.ts.map +1 -0
- package/build/facades/memory.js +33 -0
- package/build/facades/memory.js.map +1 -0
- package/build/facades/miniapps.d.ts +47 -0
- package/build/facades/miniapps.d.ts.map +1 -0
- package/build/facades/miniapps.js +54 -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 +106 -0
- package/build/facades/ota.d.ts.map +1 -0
- package/build/facades/ota.js +159 -0
- package/build/facades/ota.js.map +1 -0
- package/build/facades/pairing.d.ts +115 -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 +17 -0
- package/build/facades/phoneNotifications.d.ts.map +1 -0
- package/build/facades/phoneNotifications.js +41 -0
- package/build/facades/phoneNotifications.js.map +1 -0
- package/build/facades/providerKeys.d.ts +26 -0
- package/build/facades/providerKeys.d.ts.map +1 -0
- package/build/facades/providerKeys.js +26 -0
- package/build/facades/providerKeys.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/speakers.d.ts +41 -0
- package/build/facades/speakers.d.ts.map +1 -0
- package/build/facades/speakers.js +139 -0
- package/build/facades/speakers.js.map +1 -0
- package/build/facades/speech.d.ts +44 -0
- package/build/facades/speech.d.ts.map +1 -0
- package/build/facades/speech.js +46 -0
- package/build/facades/speech.js.map +1 -0
- package/build/index.d.ts +48 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +49 -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 +115 -0
- package/build/runtime/bootstrap.d.ts.map +1 -0
- package/build/runtime/bootstrap.js +73 -0
- package/build/runtime/bootstrap.js.map +1 -0
- package/build/runtime/config.d.ts +152 -0
- package/build/runtime/config.d.ts.map +1 -0
- package/build/runtime/config.js +19 -0
- package/build/runtime/config.js.map +1 -0
- 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/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/AiTierResolution.d.ts +61 -0
- package/build/services/AiTierResolution.d.ts.map +1 -0
- package/build/services/AiTierResolution.js +83 -0
- package/build/services/AiTierResolution.js.map +1 -0
- package/build/services/AppRegistry.d.ts +303 -0
- package/build/services/AppRegistry.d.ts.map +1 -0
- package/build/services/AppRegistry.js +1108 -0
- package/build/services/AppRegistry.js.map +1 -0
- package/build/services/AudioCloudUplink.d.ts +15 -0
- package/build/services/AudioCloudUplink.d.ts.map +1 -0
- package/build/services/AudioCloudUplink.js +54 -0
- package/build/services/AudioCloudUplink.js.map +1 -0
- package/build/services/AudioPlaybackService.d.ts +183 -0
- package/build/services/AudioPlaybackService.d.ts.map +1 -0
- package/build/services/AudioPlaybackService.js +750 -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 +106 -0
- package/build/services/BlobStore.d.ts.map +1 -0
- package/build/services/BlobStore.js +741 -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 +51 -0
- package/build/services/CloudAudioSubscriptionSync.js.map +1 -0
- package/build/services/CloudClientService.d.ts +293 -0
- package/build/services/CloudClientService.d.ts.map +1 -0
- package/build/services/CloudClientService.js +965 -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 +296 -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 +214 -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/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/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 +127 -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 +33 -0
- package/build/services/HeadingService.d.ts.map +1 -0
- package/build/services/HeadingService.js +123 -0
- package/build/services/HeadingService.js.map +1 -0
- package/build/services/HotspotOtaTransport.d.ts +29 -0
- package/build/services/HotspotOtaTransport.d.ts.map +1 -0
- package/build/services/HotspotOtaTransport.js +146 -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/JSCrashController.d.ts +97 -0
- package/build/services/JSCrashController.d.ts.map +1 -0
- package/build/services/JSCrashController.js +138 -0
- package/build/services/JSCrashController.js.map +1 -0
- package/build/services/JSCrashloopReportService.d.ts +9 -0
- package/build/services/JSCrashloopReportService.d.ts.map +1 -0
- package/build/services/JSCrashloopReportService.js +54 -0
- package/build/services/JSCrashloopReportService.js.map +1 -0
- package/build/services/JSLogPipeline.d.ts +87 -0
- package/build/services/JSLogPipeline.d.ts.map +1 -0
- package/build/services/JSLogPipeline.js +137 -0
- package/build/services/JSLogPipeline.js.map +1 -0
- package/build/services/JSRouter.d.ts +203 -0
- package/build/services/JSRouter.d.ts.map +1 -0
- package/build/services/JSRouter.js +482 -0
- package/build/services/JSRouter.js.map +1 -0
- package/build/services/LocalDisplayManager.d.ts +162 -0
- package/build/services/LocalDisplayManager.d.ts.map +1 -0
- package/build/services/LocalDisplayManager.js +687 -0
- package/build/services/LocalDisplayManager.js.map +1 -0
- package/build/services/LocalMiniappDataMigration.d.ts +46 -0
- package/build/services/LocalMiniappDataMigration.d.ts.map +1 -0
- package/build/services/LocalMiniappDataMigration.js +78 -0
- package/build/services/LocalMiniappDataMigration.js.map +1 -0
- package/build/services/LocalMiniappRuntime.d.ts +677 -0
- package/build/services/LocalMiniappRuntime.d.ts.map +1 -0
- package/build/services/LocalMiniappRuntime.js +5068 -0
- package/build/services/LocalMiniappRuntime.js.map +1 -0
- 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 +41 -0
- package/build/services/LocalMiniappUserIdentity.d.ts.map +1 -0
- package/build/services/LocalMiniappUserIdentity.js +73 -0
- package/build/services/LocalMiniappUserIdentity.js.map +1 -0
- package/build/services/LocalSttFallbackCoordinator.d.ts +101 -0
- package/build/services/LocalSttFallbackCoordinator.d.ts.map +1 -0
- package/build/services/LocalSttFallbackCoordinator.js +210 -0
- package/build/services/LocalSttFallbackCoordinator.js.map +1 -0
- package/build/services/MapboxTokenService.d.ts +33 -0
- package/build/services/MapboxTokenService.d.ts.map +1 -0
- package/build/services/MapboxTokenService.js +115 -0
- package/build/services/MapboxTokenService.js.map +1 -0
- package/build/services/MemoryCapture.d.ts +40 -0
- package/build/services/MemoryCapture.d.ts.map +1 -0
- package/build/services/MemoryCapture.js +42 -0
- package/build/services/MemoryCapture.js.map +1 -0
- package/build/services/MemoryStore.d.ts +184 -0
- package/build/services/MemoryStore.d.ts.map +1 -0
- package/build/services/MemoryStore.js +541 -0
- package/build/services/MemoryStore.js.map +1 -0
- package/build/services/MicStateCoordinator.d.ts +78 -0
- package/build/services/MicStateCoordinator.d.ts.map +1 -0
- package/build/services/MicStateCoordinator.js +219 -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 +127 -0
- package/build/services/MiniappLauncher.d.ts.map +1 -0
- package/build/services/MiniappLauncher.js +309 -0
- package/build/services/MiniappLauncher.js.map +1 -0
- 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/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/NativeNavigationService.d.ts +51 -0
- package/build/services/NativeNavigationService.d.ts.map +1 -0
- package/build/services/NativeNavigationService.js +154 -0
- package/build/services/NativeNavigationService.js.map +1 -0
- package/build/services/NavigationHandlers.d.ts +107 -0
- package/build/services/NavigationHandlers.d.ts.map +1 -0
- package/build/services/NavigationHandlers.js +479 -0
- package/build/services/NavigationHandlers.js.map +1 -0
- package/build/services/NavigationService.d.ts +283 -0
- package/build/services/NavigationService.d.ts.map +1 -0
- package/build/services/NavigationService.js +696 -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/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/OtaInstallCoordinator.d.ts +275 -0
- package/build/services/OtaInstallCoordinator.d.ts.map +1 -0
- package/build/services/OtaInstallCoordinator.js +1491 -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 +72 -0
- package/build/services/OtaService.js.map +1 -0
- package/build/services/OtaUpdateCheckService.d.ts +100 -0
- package/build/services/OtaUpdateCheckService.d.ts.map +1 -0
- package/build/services/OtaUpdateCheckService.js +380 -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 +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/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 +37 -0
- package/build/services/PhoneNotificationsSync.js.map +1 -0
- package/build/services/PhonePhotoCoordinator.d.ts +110 -0
- package/build/services/PhonePhotoCoordinator.d.ts.map +1 -0
- package/build/services/PhonePhotoCoordinator.js +344 -0
- package/build/services/PhonePhotoCoordinator.js.map +1 -0
- package/build/services/PhoneStreamCoordinator.d.ts +175 -0
- package/build/services/PhoneStreamCoordinator.d.ts.map +1 -0
- package/build/services/PhoneStreamCoordinator.js +740 -0
- package/build/services/PhoneStreamCoordinator.js.map +1 -0
- package/build/services/PhoneVideoCoordinator.d.ts +52 -0
- package/build/services/PhoneVideoCoordinator.d.ts.map +1 -0
- package/build/services/PhoneVideoCoordinator.js +157 -0
- package/build/services/PhoneVideoCoordinator.js.map +1 -0
- package/build/services/ProviderKeyValidation.d.ts +27 -0
- package/build/services/ProviderKeyValidation.d.ts.map +1 -0
- package/build/services/ProviderKeyValidation.js +42 -0
- package/build/services/ProviderKeyValidation.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 +366 -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 +274 -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/SpeakerIdModelManager.d.ts +36 -0
- package/build/services/SpeakerIdModelManager.d.ts.map +1 -0
- package/build/services/SpeakerIdModelManager.js +132 -0
- package/build/services/SpeakerIdModelManager.js.map +1 -0
- package/build/services/SpeakerIdSync.d.ts +14 -0
- package/build/services/SpeakerIdSync.d.ts.map +1 -0
- package/build/services/SpeakerIdSync.js +62 -0
- package/build/services/SpeakerIdSync.js.map +1 -0
- package/build/services/SpeakerLabelResolver.d.ts +80 -0
- package/build/services/SpeakerLabelResolver.d.ts.map +1 -0
- package/build/services/SpeakerLabelResolver.js +108 -0
- package/build/services/SpeakerLabelResolver.js.map +1 -0
- package/build/services/SpeakerProfileStore.d.ts +90 -0
- package/build/services/SpeakerProfileStore.d.ts.map +1 -0
- package/build/services/SpeakerProfileStore.js +213 -0
- package/build/services/SpeakerProfileStore.js.map +1 -0
- package/build/services/SpeakerSegmentResolver.d.ts +87 -0
- package/build/services/SpeakerSegmentResolver.d.ts.map +1 -0
- package/build/services/SpeakerSegmentResolver.js +137 -0
- package/build/services/SpeakerSegmentResolver.js.map +1 -0
- package/build/services/StreamLifecycleController.d.ts +63 -0
- package/build/services/StreamLifecycleController.d.ts.map +1 -0
- package/build/services/StreamLifecycleController.js +148 -0
- package/build/services/StreamLifecycleController.js.map +1 -0
- 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/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 +22 -0
- package/build/services/TranscriptionRouting.d.ts.map +1 -0
- package/build/services/TranscriptionRouting.js +34 -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/UIRouter.d.ts +137 -0
- package/build/services/UIRouter.d.ts.map +1 -0
- package/build/services/UIRouter.js +210 -0
- package/build/services/UIRouter.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/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/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 +208 -0
- package/build/services/asg/asgCameraApi.d.ts.map +1 -0
- package/build/services/asg/asgCameraApi.js +1480 -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 +1945 -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/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/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/effectiveCapabilities.d.ts +8 -0
- package/build/services/effectiveCapabilities.d.ts.map +1 -0
- package/build/services/effectiveCapabilities.js +23 -0
- package/build/services/effectiveCapabilities.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/manifestActions.d.ts +31 -0
- package/build/services/manifestActions.d.ts.map +1 -0
- package/build/services/manifestActions.js +54 -0
- package/build/services/manifestActions.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/memoryStoreInstance.d.ts +19 -0
- package/build/services/memoryStoreInstance.d.ts.map +1 -0
- package/build/services/memoryStoreInstance.js +65 -0
- package/build/services/memoryStoreInstance.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 +87 -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 +53 -0
- package/build/services/otaDisplayState.d.ts.map +1 -0
- package/build/services/otaDisplayState.js +114 -0
- package/build/services/otaDisplayState.js.map +1 -0
- package/build/services/otaInstallPolicy.d.ts +93 -0
- package/build/services/otaInstallPolicy.d.ts.map +1 -0
- package/build/services/otaInstallPolicy.js +117 -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/otaManifestUrl.d.ts +2 -0
- package/build/services/otaManifestUrl.d.ts.map +1 -0
- package/build/services/otaManifestUrl.js +46 -0
- package/build/services/otaManifestUrl.js.map +1 -0
- package/build/services/slimStreamStatus.d.ts +18 -0
- package/build/services/slimStreamStatus.d.ts.map +1 -0
- package/build/services/slimStreamStatus.js +36 -0
- package/build/services/slimStreamStatus.js.map +1 -0
- package/build/services/soniox/SonioxDirectService.d.ts +109 -0
- package/build/services/soniox/SonioxDirectService.d.ts.map +1 -0
- package/build/services/soniox/SonioxDirectService.js +449 -0
- package/build/services/soniox/SonioxDirectService.js.map +1 -0
- package/build/services/soniox/SonioxRealtimeClient.d.ts +121 -0
- package/build/services/soniox/SonioxRealtimeClient.d.ts.map +1 -0
- package/build/services/soniox/SonioxRealtimeClient.js +301 -0
- package/build/services/soniox/SonioxRealtimeClient.js.map +1 -0
- package/build/services/soniox/SonioxTokenAssembler.d.ts +98 -0
- package/build/services/soniox/SonioxTokenAssembler.d.ts.map +1 -0
- package/build/services/soniox/SonioxTokenAssembler.js +394 -0
- package/build/services/soniox/SonioxTokenAssembler.js.map +1 -0
- package/build/services/speakerProfileStoreInstance.d.ts +8 -0
- package/build/services/speakerProfileStoreInstance.d.ts.map +1 -0
- package/build/services/speakerProfileStoreInstance.js +24 -0
- package/build/services/speakerProfileStoreInstance.js.map +1 -0
- package/build/services/uiShim.d.ts +38 -0
- package/build/services/uiShim.d.ts.map +1 -0
- package/build/services/uiShim.js +369 -0
- package/build/services/uiShim.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 +503 -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 +33 -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 +103 -0
- package/build/stores/gallerySync.d.ts.map +1 -0
- package/build/stores/gallerySync.js +219 -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 +208 -0
- package/build/stores/glasses.js.map +1 -0
- package/build/stores/settings.d.ts +54 -0
- package/build/stores/settings.d.ts.map +1 -0
- package/build/stores/settings.js +1200 -0
- package/build/stores/settings.js.map +1 -0
- package/build/stores/transcriptionDebug.d.ts +25 -0
- package/build/stores/transcriptionDebug.d.ts.map +1 -0
- package/build/stores/transcriptionDebug.js +0 -0
- package/build/stores/transcriptionDebug.js.map +1 -0
- package/build/types/applet.d.ts +101 -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 +57 -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 +83 -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 +65 -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 +94 -0
- package/build/types/capabilities/mentra-live.js.map +1 -0
- package/build/types/capabilities/nimo.d.ts +13 -0
- package/build/types/capabilities/nimo.d.ts.map +1 -0
- package/build/types/capabilities/nimo.js +72 -0
- package/build/types/capabilities/nimo.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 +67 -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 +82 -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 +54 -0
- package/build/types/capabilities/vuzix-z100.js.map +1 -0
- package/build/types/enums.d.ts +22 -0
- package/build/types/enums.d.ts.map +1 -0
- package/build/types/enums.js +27 -0
- package/build/types/enums.js.map +1 -0
- package/build/types/hardware.d.ts +155 -0
- package/build/types/hardware.d.ts.map +1 -0
- package/build/types/hardware.js +52 -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 +11 -0
- package/build/utils/GlobalEventEmitter.d.ts.map +1 -0
- package/build/utils/GlobalEventEmitter.js +14 -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/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/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 +55 -0
- package/build/utils/devMiniappLaunch.d.ts.map +1 -0
- package/build/utils/devMiniappLaunch.js +175 -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 +122 -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 +188 -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/anchor.d.ts +17 -0
- package/build/utils/display/scene/anchor.d.ts.map +1 -0
- package/build/utils/display/scene/anchor.js +33 -0
- package/build/utils/display/scene/anchor.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 +11 -0
- package/build/utils/display/scene/index.d.ts.map +1 -0
- package/build/utils/display/scene/index.js +7 -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 +201 -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 +139 -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 +131 -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/memory/search.d.ts +72 -0
- package/build/utils/memory/search.d.ts.map +1 -0
- package/build/utils/memory/search.js +178 -0
- package/build/utils/memory/search.js.map +1 -0
- 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/miniappGlobals.d.ts +59 -0
- package/build/utils/miniappGlobals.d.ts.map +1 -0
- package/build/utils/miniappGlobals.js +223 -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/speakerEmbedding.d.ts +8 -0
- package/build/utils/speakerEmbedding.d.ts.map +1 -0
- package/build/utils/speakerEmbedding.js +63 -0
- package/build/utils/speakerEmbedding.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 +142 -0
- package/build/utils/timers/timers.js.map +1 -0
- package/package.json +122 -0
- package/src/assets/silence.wav +0 -0
- package/src/devtools.ts +13 -0
- package/src/engine.ts +198 -0
- package/src/facades/dev.ts +213 -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 +219 -0
- package/src/facades/glassesSettings.ts +57 -0
- package/src/facades/glassesWifi.ts +68 -0
- package/src/facades/maps.ts +13 -0
- package/src/facades/memory.ts +46 -0
- package/src/facades/miniapps.ts +62 -0
- package/src/facades/notifications.ts +14 -0
- package/src/facades/ota.ts +177 -0
- package/src/facades/pairing.ts +329 -0
- package/src/facades/permissions.ts +165 -0
- package/src/facades/phoneNotifications.ts +41 -0
- package/src/facades/providerKeys.ts +31 -0
- package/src/facades/reports.ts +180 -0
- package/src/facades/session.ts +54 -0
- package/src/facades/settings.ts +57 -0
- package/src/facades/speakers.ts +152 -0
- package/src/facades/speech.ts +49 -0
- package/src/index.ts +214 -0
- package/src/internal.ts +155 -0
- package/src/runtime/bootstrap.ts +159 -0
- package/src/runtime/config.ts +155 -0
- package/src/runtime/scanQrSeam.ts +20 -0
- package/src/runtime/streamConfig.ts +34 -0
- package/src/services/AiTierResolution.ts +106 -0
- package/src/services/AppRegistry.ts +1245 -0
- package/src/services/AudioCloudUplink.ts +56 -0
- package/src/services/AudioPlaybackService.ts +873 -0
- package/src/services/AutomaticReportResult.ts +50 -0
- package/src/services/BlobStore.ts +823 -0
- package/src/services/CaptionsTesterReportService.ts +107 -0
- package/src/services/CloudAudioSubscriptionSync.ts +53 -0
- package/src/services/CloudClientService.ts +1031 -0
- package/src/services/CloudTranscriptE2EMetrics.ts +27 -0
- package/src/services/ConnectionCoordinator.ts +65 -0
- package/src/services/DevServerBridge.ts +334 -0
- package/src/services/DeviceEventRouter.ts +266 -0
- package/src/services/DeviceStoreHydration.ts +130 -0
- package/src/services/DisplayProcessor.ts +775 -0
- package/src/services/ForegroundLocationPermission.ts +24 -0
- package/src/services/GlassesReadiness.ts +103 -0
- package/src/services/GlassesSettingsSync.ts +140 -0
- package/src/services/GlassesStatusProjection.ts +73 -0
- package/src/services/HeadingService.ts +122 -0
- package/src/services/HotspotOtaTransport.ts +184 -0
- package/src/services/HotspotShutdown.ts +41 -0
- package/src/services/JSCrashController.ts +189 -0
- package/src/services/JSCrashloopReportService.ts +66 -0
- package/src/services/JSLogPipeline.ts +166 -0
- package/src/services/JSRouter.ts +555 -0
- package/src/services/LocalDisplayManager.ts +815 -0
- package/src/services/LocalMiniappDataMigration.ts +102 -0
- package/src/services/LocalMiniappRuntime.ts +5747 -0
- package/src/services/LocalMiniappStorage.ts +82 -0
- package/src/services/LocalMiniappUserIdentity.ts +79 -0
- package/src/services/LocalSttFallbackCoordinator.ts +247 -0
- package/src/services/MapboxTokenService.ts +118 -0
- package/src/services/MemoryCapture.ts +61 -0
- package/src/services/MemoryStore.ts +633 -0
- package/src/services/MicStateCoordinator.ts +259 -0
- package/src/services/MiniappEngine.ts +143 -0
- package/src/services/MiniappLauncher.ts +365 -0
- package/src/services/MiniappLiveness.ts +24 -0
- package/src/services/MiniappRunningRegistry.ts +57 -0
- package/src/services/NativeHttpResponse.ts +6 -0
- package/src/services/NativeNavigationService.ts +176 -0
- package/src/services/NavigationHandlers.ts +527 -0
- package/src/services/NavigationService.ts +926 -0
- package/src/services/NotificationsEmitter.ts +49 -0
- package/src/services/OfflineSpeechModelService.ts +168 -0
- package/src/services/OtaArtifactDownloader.ts +312 -0
- package/src/services/OtaInstallCoordinator.ts +1707 -0
- package/src/services/OtaService.ts +89 -0
- package/src/services/OtaUpdateCheckService.ts +550 -0
- package/src/services/PairingIdentity.ts +154 -0
- package/src/services/PhoneCalendarHelpers.ts +212 -0
- package/src/services/PhoneCalendarService.ts +61 -0
- package/src/services/PhoneCameraFovCoordinator.ts +210 -0
- package/src/services/PhoneLocationService.ts +120 -0
- package/src/services/PhoneNotificationsSync.ts +46 -0
- package/src/services/PhonePhotoCoordinator.ts +435 -0
- package/src/services/PhoneStreamCoordinator.ts +874 -0
- package/src/services/PhoneVideoCoordinator.ts +203 -0
- package/src/services/ProviderKeyValidation.ts +57 -0
- package/src/services/STTModelManager.ts +434 -0
- package/src/services/SceneRenderer.ts +320 -0
- package/src/services/SentenceTtsPipeline.ts +106 -0
- package/src/services/SpeakerIdModelManager.ts +151 -0
- package/src/services/SpeakerIdSync.ts +79 -0
- package/src/services/SpeakerLabelResolver.ts +140 -0
- package/src/services/SpeakerProfileStore.ts +265 -0
- package/src/services/SpeakerSegmentResolver.ts +194 -0
- package/src/services/StreamLifecycleController.ts +203 -0
- package/src/services/SupportProfileSync.ts +218 -0
- package/src/services/TTSModelManager.ts +466 -0
- package/src/services/TranscriptionRouting.ts +47 -0
- package/src/services/TtsTextSanitizer.ts +66 -0
- package/src/services/UIRouter.ts +250 -0
- package/src/services/WebviewBridge.ts +50 -0
- package/src/services/WifiAdbRequest.ts +53 -0
- package/src/services/asg/GalleryMediaIntegrityReportService.ts +72 -0
- package/src/services/asg/asgCameraApi.ts +1786 -0
- package/src/services/asg/cameraRollExportCoordinator.ts +627 -0
- package/src/services/asg/cameraRollExportLedger.ts +122 -0
- package/src/services/asg/galleryMediaValidation.ts +185 -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 +235 -0
- package/src/services/asg/gallerySyncService.ts +2278 -0
- package/src/services/asg/galleryTransferLedger.ts +312 -0
- package/src/services/asg/localNetworkTransport.ts +169 -0
- package/src/services/asg/localStorageService.ts +652 -0
- package/src/services/asg/mediaProcessingQueue.ts +518 -0
- package/src/services/audioPlaybackAssets.ts +8 -0
- package/src/services/blobPaths.ts +86 -0
- package/src/services/cloudStreamApi.ts +142 -0
- package/src/services/effectiveCapabilities.ts +27 -0
- package/src/services/gallerySyncClock.ts +39 -0
- package/src/services/glassesClockSync.ts +115 -0
- package/src/services/manifestActions.ts +80 -0
- package/src/services/manifestVersionGate.ts +43 -0
- package/src/services/memoryStoreInstance.ts +70 -0
- package/src/services/navigation/roadNameResolver.ts +103 -0
- package/src/services/navigation/routesApiCodec.ts +69 -0
- package/src/services/otaDisplayState.ts +156 -0
- package/src/services/otaInstallPolicy.ts +132 -0
- package/src/services/otaLegacyMapping.ts +71 -0
- package/src/services/otaManifestUrl.ts +53 -0
- package/src/services/slimStreamStatus.ts +39 -0
- package/src/services/soniox/SonioxDirectService.ts +517 -0
- package/src/services/soniox/SonioxRealtimeClient.ts +349 -0
- package/src/services/soniox/SonioxTokenAssembler.ts +451 -0
- package/src/services/speakerProfileStoreInstance.ts +25 -0
- package/src/services/uiShim.ts +375 -0
- package/src/stores/apps.ts +626 -0
- package/src/stores/bluetoothSettingKeys.ts +35 -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 +384 -0
- package/src/stores/glasses.ts +314 -0
- package/src/stores/settings.ts +1299 -0
- package/src/stores/transcriptionDebug.ts +0 -0
- package/src/types/applet.ts +121 -0
- package/src/types/asg.ts +58 -0
- package/src/types/capabilities/even-realities-g1.ts +70 -0
- package/src/types/capabilities/even-realities-g2.ts +98 -0
- package/src/types/capabilities/mentra-display.ts +78 -0
- package/src/types/capabilities/mentra-live.ts +106 -0
- package/src/types/capabilities/nimo.ts +84 -0
- package/src/types/capabilities/none.ts +79 -0
- package/src/types/capabilities/simulated-glasses.ts +95 -0
- package/src/types/capabilities/vuzix-z100.ts +67 -0
- package/src/types/enums.ts +27 -0
- package/src/types/hardware.ts +220 -0
- package/src/types/index.ts +38 -0
- package/src/utils/GlobalEventEmitter.ts +15 -0
- package/src/utils/cloudClient/RnUdpAdapter.ts +47 -0
- package/src/utils/cloudClient/cloudSecureStore.ts +28 -0
- package/src/utils/configuredDevHost.ts +17 -0
- package/src/utils/debouncedPatch.ts +28 -0
- package/src/utils/devLogging.ts +140 -0
- package/src/utils/devMiniappLaunch.ts +196 -0
- package/src/utils/diagnosticContext.ts +159 -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 +409 -0
- package/src/utils/display/helpers/ScrollView.ts +326 -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/anchor.ts +39 -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 +24 -0
- package/src/utils/display/scene/process.ts +228 -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 +171 -0
- package/src/utils/hardware/index.ts +1 -0
- package/src/utils/memory/search.ts +204 -0
- package/src/utils/miniappDiagnostics.ts +226 -0
- package/src/utils/miniappGlobals.ts +259 -0
- package/src/utils/permissions/MediaLibraryPermissions.ts +161 -0
- package/src/utils/permissions/galleryDisplayName.ts +28 -0
- package/src/utils/speakerEmbedding.ts +58 -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 +175 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import BluetoothSdk, { isEnabledHotspotStatus, OtaServer } from "@glassly/bluetooth-sdk/internal";
|
|
2
|
+
// One coordinator selects the native Android or iOS staging implementation at runtime.
|
|
3
|
+
// eslint-disable-next-line react-native/split-platform-components
|
|
4
|
+
import { PermissionsAndroid, Platform } from "react-native";
|
|
5
|
+
import { cleanupArtifacts, OtaArtifactError, planArtifacts, prepareArtifacts, rewriteManifestForLocalServer, } from "./OtaArtifactDownloader";
|
|
6
|
+
import { disableHotspotWithRetry } from "./HotspotShutdown";
|
|
7
|
+
import { localNetworkTransport } from "./asg/localNetworkTransport";
|
|
8
|
+
export class HotspotOtaTransportError extends Error {
|
|
9
|
+
code;
|
|
10
|
+
constructor(code, message) {
|
|
11
|
+
super(message);
|
|
12
|
+
this.code = code;
|
|
13
|
+
this.name = "HotspotOtaTransportError";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/** Owns the single phone-side endpoint and network lease for one hotspot OTA attempt. */
|
|
17
|
+
class HotspotOtaTransport {
|
|
18
|
+
active = false;
|
|
19
|
+
prepared = [];
|
|
20
|
+
hotspotRequested = false;
|
|
21
|
+
localNetworkConnected = false;
|
|
22
|
+
serverStarted = false;
|
|
23
|
+
teardownPromise = null;
|
|
24
|
+
async prepare(checkResult, onProgress) {
|
|
25
|
+
if (this.teardownPromise)
|
|
26
|
+
await this.teardownPromise;
|
|
27
|
+
if (this.active) {
|
|
28
|
+
throw new Error("A hotspot OTA transport is already active");
|
|
29
|
+
}
|
|
30
|
+
if (!checkResult.manifestBody) {
|
|
31
|
+
throw new Error("The selected OTA check has no manifest body");
|
|
32
|
+
}
|
|
33
|
+
let phase = "downloading";
|
|
34
|
+
try {
|
|
35
|
+
await this.ensureAndroidWifiPermission();
|
|
36
|
+
onProgress?.({ phase: "downloading" });
|
|
37
|
+
this.prepared = await prepareArtifacts(planArtifacts(checkResult), (artifact) => onProgress?.({ phase: "downloading", artifact }), Platform.OS === "ios" ? this.downloadIosArtifact : undefined);
|
|
38
|
+
phase = "starting_hotspot";
|
|
39
|
+
onProgress?.({ phase: "starting_hotspot" });
|
|
40
|
+
this.hotspotRequested = true;
|
|
41
|
+
const hotspot = await BluetoothSdk.setHotspotState(true);
|
|
42
|
+
if (!isEnabledHotspotStatus(hotspot)) {
|
|
43
|
+
throw new HotspotOtaTransportError("hotspot_start_failed", "Mentra Live did not return hotspot credentials");
|
|
44
|
+
}
|
|
45
|
+
phase = "joining_hotspot";
|
|
46
|
+
onProgress?.({ phase: "joining_hotspot" });
|
|
47
|
+
const scopedAddress = await localNetworkTransport.connect(hotspot.ssid, hotspot.password);
|
|
48
|
+
this.localNetworkConnected = true;
|
|
49
|
+
let localAddress = scopedAddress;
|
|
50
|
+
if (Platform.OS === "ios") {
|
|
51
|
+
try {
|
|
52
|
+
localAddress = await OtaServer.waitForWifiAddress(hotspot.localIp, 15_000);
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
throw new HotspotOtaTransportError("hotspot_join_failed", error instanceof Error ? error.message : String(error));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const artifactPaths = Object.fromEntries(this.prepared.map((artifact) => [artifact.sha256, artifact.filePath]));
|
|
59
|
+
// Start exactly one native listener to learn its selected port, then atomically replace
|
|
60
|
+
// the placeholder with the immutable rewritten manifest before ota_start is sent.
|
|
61
|
+
const server = await OtaServer.startOtaServer("{}", artifactPaths, localAddress);
|
|
62
|
+
this.serverStarted = true;
|
|
63
|
+
const manifest = rewriteManifestForLocalServer(checkResult.manifestBody, this.prepared, server.baseUrl);
|
|
64
|
+
const published = await OtaServer.startOtaServer(manifest, artifactPaths, server.host);
|
|
65
|
+
if (published.manifestUrl !== server.manifestUrl) {
|
|
66
|
+
throw new Error("Local OTA server endpoint changed while publishing the manifest");
|
|
67
|
+
}
|
|
68
|
+
this.active = true;
|
|
69
|
+
onProgress?.({ phase: "serving" });
|
|
70
|
+
return published.manifestUrl;
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
const joined = this.localNetworkConnected;
|
|
74
|
+
await this.teardown();
|
|
75
|
+
if (error instanceof OtaArtifactError || error instanceof HotspotOtaTransportError) {
|
|
76
|
+
throw error;
|
|
77
|
+
}
|
|
78
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
79
|
+
if (phase === "starting_hotspot") {
|
|
80
|
+
throw new HotspotOtaTransportError("hotspot_start_failed", message);
|
|
81
|
+
}
|
|
82
|
+
if (phase === "joining_hotspot" && !joined) {
|
|
83
|
+
throw new HotspotOtaTransportError("hotspot_join_failed", message);
|
|
84
|
+
}
|
|
85
|
+
throw new HotspotOtaTransportError("hotspot_server_failed", message);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/** Android 13+ requires the nearby-WiFi runtime grant before WifiNetworkSpecifier is usable. */
|
|
89
|
+
async ensureAndroidWifiPermission() {
|
|
90
|
+
if (Platform.OS !== "android")
|
|
91
|
+
return;
|
|
92
|
+
const permission = PermissionsAndroid.PERMISSIONS.NEARBY_WIFI_DEVICES;
|
|
93
|
+
if (await PermissionsAndroid.check(permission))
|
|
94
|
+
return;
|
|
95
|
+
const result = await PermissionsAndroid.request(permission);
|
|
96
|
+
if (result !== PermissionsAndroid.RESULTS.GRANTED) {
|
|
97
|
+
throw new HotspotOtaTransportError("hotspot_wifi_permission_denied", "Nearby devices permission is required to connect to the glasses hotspot");
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
downloadIosArtifact = async (entry, destination, onProgress) => {
|
|
101
|
+
const subscription = OtaServer.addListener("artifactDownloadProgress", (event) => {
|
|
102
|
+
if (event.destination === destination)
|
|
103
|
+
onProgress?.(event.bytesWritten, event.contentLength);
|
|
104
|
+
});
|
|
105
|
+
try {
|
|
106
|
+
return await OtaServer.downloadArtifact(entry.url, destination);
|
|
107
|
+
}
|
|
108
|
+
finally {
|
|
109
|
+
subscription.remove();
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
async teardown() {
|
|
113
|
+
if (this.teardownPromise)
|
|
114
|
+
return this.teardownPromise;
|
|
115
|
+
this.teardownPromise = (async () => {
|
|
116
|
+
if (this.hotspotRequested) {
|
|
117
|
+
const hotspotStopped = await disableHotspotWithRetry(() => BluetoothSdk.setHotspotState(false), {
|
|
118
|
+
// A completed APK step has just replaced ASG. Let the new command path
|
|
119
|
+
// settle before asking it to tear down the SystemUI-owned access point.
|
|
120
|
+
initialDelayMs: this.serverStarted ? 750 : 0,
|
|
121
|
+
});
|
|
122
|
+
if (!hotspotStopped) {
|
|
123
|
+
console.warn("[OTA_PROGRESS] glasses hotspot shutdown was not confirmed after bounded retries");
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (this.serverStarted)
|
|
127
|
+
await OtaServer.stopOtaServer().catch(() => { });
|
|
128
|
+
if (this.localNetworkConnected)
|
|
129
|
+
await localNetworkTransport.disconnect().catch(() => { });
|
|
130
|
+
await cleanupArtifacts().catch(() => { });
|
|
131
|
+
this.prepared = [];
|
|
132
|
+
this.active = false;
|
|
133
|
+
this.serverStarted = false;
|
|
134
|
+
this.localNetworkConnected = false;
|
|
135
|
+
this.hotspotRequested = false;
|
|
136
|
+
})();
|
|
137
|
+
try {
|
|
138
|
+
await this.teardownPromise;
|
|
139
|
+
}
|
|
140
|
+
finally {
|
|
141
|
+
this.teardownPromise = null;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
export const hotspotOtaTransport = new HotspotOtaTransport();
|
|
146
|
+
//# sourceMappingURL=HotspotOtaTransport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HotspotOtaTransport.js","sourceRoot":"","sources":["../../src/services/HotspotOtaTransport.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,EAAE,EAAC,sBAAsB,EAAE,SAAS,EAAC,MAAM,iCAAiC,CAAA;AAC/F,uFAAuF;AACvF,kEAAkE;AAClE,OAAO,EAAC,kBAAkB,EAAE,QAAQ,EAAC,MAAM,cAAc,CAAA;AAEzD,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,6BAA6B,GAG9B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAC,uBAAuB,EAAC,MAAM,mBAAmB,CAAA;AACzD,OAAO,EAAC,qBAAqB,EAAC,MAAM,6BAA6B,CAAA;AAejE,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IAE/B;IADlB,YACkB,IAAyB,EACzC,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAA;QAHE,SAAI,GAAJ,IAAI,CAAqB;QAIzC,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAA;IACxC,CAAC;CACF;AAED,yFAAyF;AACzF,MAAM,mBAAmB;IACf,MAAM,GAAG,KAAK,CAAA;IACd,QAAQ,GAA0B,EAAE,CAAA;IACpC,gBAAgB,GAAG,KAAK,CAAA;IACxB,qBAAqB,GAAG,KAAK,CAAA;IAC7B,aAAa,GAAG,KAAK,CAAA;IACrB,eAAe,GAAyB,IAAI,CAAA;IAEpD,KAAK,CAAC,OAAO,CACX,WAAyC,EACzC,UAAmD;QAEnD,IAAI,IAAI,CAAC,eAAe;YAAE,MAAM,IAAI,CAAC,eAAe,CAAA;QACpD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAA;QAC9D,CAAC;QACD,IAAI,CAAC,WAAW,CAAC,YAAY,EAA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BAAgB,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;YACxC,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAA;YAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;YACnB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAA;YAC1B,IAAI,CAAC,qBAAqB,GAAG,KAAK,CAAA;YAClC,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAA;QAC/B,CAAC,CAAC,EAAE,CAAA;QACJ,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,eAAe,CAAA;QAC5B,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,eAAe,GAAG,IAAI,CAAA;QAC7B,CAAC;IACH,CAAC;CACF;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,mBAAmB,EAAE,CAAA","sourcesContent":["import BluetoothSdk, {isEnabledHotspotStatus, OtaServer} from \"@glassly/bluetooth-sdk/internal\"\n// One coordinator selects the native Android or iOS staging implementation at runtime.\n// eslint-disable-next-line react-native/split-platform-components\nimport {PermissionsAndroid, Platform} from \"react-native\"\nimport type {OtaCheckCurrentGlassesResult} from \"./OtaUpdateCheckService\"\nimport {\n cleanupArtifacts,\n OtaArtifactError,\n planArtifacts,\n prepareArtifacts,\n rewriteManifestForLocalServer,\n type OtaArtifactDownloadProgress,\n type PreparedOtaArtifact,\n} from \"./OtaArtifactDownloader\"\nimport {disableHotspotWithRetry} from \"./HotspotShutdown\"\nimport {localNetworkTransport} from \"./asg/localNetworkTransport\"\n\nexport type HotspotOtaPhase = \"idle\" | \"downloading\" | \"starting_hotspot\" | \"joining_hotspot\" | \"serving\"\n\nexport type HotspotOtaProgress = {\n phase: HotspotOtaPhase\n artifact?: OtaArtifactDownloadProgress\n}\n\nexport type HotspotOtaErrorCode =\n | \"hotspot_wifi_permission_denied\"\n | \"hotspot_start_failed\"\n | \"hotspot_join_failed\"\n | \"hotspot_server_failed\"\n\nexport class HotspotOtaTransportError extends Error {\n constructor(\n public readonly code: HotspotOtaErrorCode,\n message: string,\n ) {\n super(message)\n this.name = \"HotspotOtaTransportError\"\n }\n}\n\n/** Owns the single phone-side endpoint and network lease for one hotspot OTA attempt. */\nclass HotspotOtaTransport {\n private active = false\n private prepared: PreparedOtaArtifact[] = []\n private hotspotRequested = false\n private localNetworkConnected = false\n private serverStarted = false\n private teardownPromise: Promise<void> | null = null\n\n async prepare(\n checkResult: OtaCheckCurrentGlassesResult,\n onProgress?: (progress: HotspotOtaProgress) => void,\n ): Promise<string> {\n if (this.teardownPromise) await this.teardownPromise\n if (this.active) {\n throw new Error(\"A hotspot OTA transport is already active\")\n }\n if (!checkResult.manifestBody) {\n throw new Error(\"The selected OTA check has no manifest body\")\n }\n\n let phase: HotspotOtaPhase = \"downloading\"\n try {\n await this.ensureAndroidWifiPermission()\n onProgress?.({phase: \"downloading\"})\n this.prepared = await prepareArtifacts(\n planArtifacts(checkResult),\n (artifact) => onProgress?.({phase: \"downloading\", artifact}),\n Platform.OS === \"ios\" ? this.downloadIosArtifact : undefined,\n )\n\n phase = \"starting_hotspot\"\n onProgress?.({phase: \"starting_hotspot\"})\n this.hotspotRequested = true\n const hotspot = await BluetoothSdk.setHotspotState(true)\n if (!isEnabledHotspotStatus(hotspot)) {\n throw new HotspotOtaTransportError(\"hotspot_start_failed\", \"Mentra Live did not return hotspot credentials\")\n }\n phase = \"joining_hotspot\"\n onProgress?.({phase: \"joining_hotspot\"})\n const scopedAddress = await localNetworkTransport.connect(hotspot.ssid, hotspot.password)\n this.localNetworkConnected = true\n let localAddress = scopedAddress\n if (Platform.OS === \"ios\") {\n try {\n localAddress = await OtaServer.waitForWifiAddress(hotspot.localIp, 15_000)\n } catch (error) {\n throw new HotspotOtaTransportError(\n \"hotspot_join_failed\",\n error instanceof Error ? error.message : String(error),\n )\n }\n }\n const artifactPaths = Object.fromEntries(this.prepared.map((artifact) => [artifact.sha256, artifact.filePath]))\n // Start exactly one native listener to learn its selected port, then atomically replace\n // the placeholder with the immutable rewritten manifest before ota_start is sent.\n const server = await OtaServer.startOtaServer(\"{}\", artifactPaths, localAddress)\n this.serverStarted = true\n const manifest = rewriteManifestForLocalServer(checkResult.manifestBody, this.prepared, server.baseUrl)\n const published = await OtaServer.startOtaServer(manifest, artifactPaths, server.host)\n if (published.manifestUrl !== server.manifestUrl) {\n throw new Error(\"Local OTA server endpoint changed while publishing the manifest\")\n }\n this.active = true\n onProgress?.({phase: \"serving\"})\n return published.manifestUrl\n } catch (error) {\n const joined = this.localNetworkConnected\n await this.teardown()\n if (error instanceof OtaArtifactError || error instanceof HotspotOtaTransportError) {\n throw error\n }\n const message = error instanceof Error ? error.message : String(error)\n if (phase === \"starting_hotspot\") {\n throw new HotspotOtaTransportError(\"hotspot_start_failed\", message)\n }\n if (phase === \"joining_hotspot\" && !joined) {\n throw new HotspotOtaTransportError(\"hotspot_join_failed\", message)\n }\n throw new HotspotOtaTransportError(\"hotspot_server_failed\", message)\n }\n }\n\n /** Android 13+ requires the nearby-WiFi runtime grant before WifiNetworkSpecifier is usable. */\n private async ensureAndroidWifiPermission(): Promise<void> {\n if (Platform.OS !== \"android\") return\n\n const permission = PermissionsAndroid.PERMISSIONS.NEARBY_WIFI_DEVICES\n if (await PermissionsAndroid.check(permission)) return\n const result = await PermissionsAndroid.request(permission)\n if (result !== PermissionsAndroid.RESULTS.GRANTED) {\n throw new HotspotOtaTransportError(\n \"hotspot_wifi_permission_denied\",\n \"Nearby devices permission is required to connect to the glasses hotspot\",\n )\n }\n }\n\n private downloadIosArtifact = async (\n entry: {url: string},\n destination: string,\n onProgress?: (bytesWritten: number, contentLength: number) => void,\n ): Promise<{statusCode: number}> => {\n const subscription = OtaServer.addListener(\"artifactDownloadProgress\", (event) => {\n if (event.destination === destination) onProgress?.(event.bytesWritten, event.contentLength)\n })\n try {\n return await OtaServer.downloadArtifact(entry.url, destination)\n } finally {\n subscription.remove()\n }\n }\n\n async teardown(): Promise<void> {\n if (this.teardownPromise) return this.teardownPromise\n this.teardownPromise = (async () => {\n if (this.hotspotRequested) {\n const hotspotStopped = await disableHotspotWithRetry(() => BluetoothSdk.setHotspotState(false), {\n // A completed APK step has just replaced ASG. Let the new command path\n // settle before asking it to tear down the SystemUI-owned access point.\n initialDelayMs: this.serverStarted ? 750 : 0,\n })\n if (!hotspotStopped) {\n console.warn(\"[OTA_PROGRESS] glasses hotspot shutdown was not confirmed after bounded retries\")\n }\n }\n if (this.serverStarted) await OtaServer.stopOtaServer().catch(() => {})\n if (this.localNetworkConnected) await localNetworkTransport.disconnect().catch(() => {})\n await cleanupArtifacts().catch(() => {})\n this.prepared = []\n this.active = false\n this.serverStarted = false\n this.localNetworkConnected = false\n this.hotspotRequested = false\n })()\n try {\n await this.teardownPromise\n } finally {\n this.teardownPromise = null\n }\n }\n}\n\nexport const hotspotOtaTransport = new HotspotOtaTransport()\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type HotspotState = {
|
|
2
|
+
state: "disabled" | "enabled";
|
|
3
|
+
};
|
|
4
|
+
type HotspotShutdownOptions = {
|
|
5
|
+
attempts?: number;
|
|
6
|
+
initialDelayMs?: number;
|
|
7
|
+
retryDelayMs?: number;
|
|
8
|
+
sleep?: (delayMs: number) => Promise<void>;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Disable a glasses hotspot with a bounded retry. ASG APK replacement keeps the
|
|
12
|
+
* BLE link alive through BES, but the first command after the new ASG process
|
|
13
|
+
* appears can still land while its command path is settling.
|
|
14
|
+
*/
|
|
15
|
+
export declare function disableHotspotWithRetry(requestDisabled: () => Promise<HotspotState>, options?: HotspotShutdownOptions): Promise<boolean>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=HotspotShutdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HotspotShutdown.d.ts","sourceRoot":"","sources":["../../src/services/HotspotShutdown.ts"],"names":[],"mappings":"AAAA,KAAK,YAAY,GAAG;IAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CAAA;CAAC,CAAA;AAEnD,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3C,CAAA;AAID;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC3C,eAAe,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,EAC5C,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,OAAO,CAAC,CAqBlB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const sleep = (delayMs) => new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
2
|
+
/**
|
|
3
|
+
* Disable a glasses hotspot with a bounded retry. ASG APK replacement keeps the
|
|
4
|
+
* BLE link alive through BES, but the first command after the new ASG process
|
|
5
|
+
* appears can still land while its command path is settling.
|
|
6
|
+
*/
|
|
7
|
+
export async function disableHotspotWithRetry(requestDisabled, options = {}) {
|
|
8
|
+
const attempts = Math.max(1, options.attempts ?? 2);
|
|
9
|
+
const initialDelayMs = Math.max(0, options.initialDelayMs ?? 0);
|
|
10
|
+
const retryDelayMs = Math.max(0, options.retryDelayMs ?? 500);
|
|
11
|
+
const wait = options.sleep ?? sleep;
|
|
12
|
+
if (initialDelayMs > 0)
|
|
13
|
+
await wait(initialDelayMs);
|
|
14
|
+
for (let attempt = 1; attempt <= attempts; attempt += 1) {
|
|
15
|
+
try {
|
|
16
|
+
const status = await requestDisabled();
|
|
17
|
+
if (status.state === "disabled")
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
// A lost command is indistinguishable from a response timeout here. Retry
|
|
22
|
+
// while the phone still owns the hotspot network and local server.
|
|
23
|
+
}
|
|
24
|
+
if (attempt < attempts && retryDelayMs > 0)
|
|
25
|
+
await wait(retryDelayMs);
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=HotspotShutdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HotspotShutdown.js","sourceRoot":"","sources":["../../src/services/HotspotShutdown.ts"],"names":[],"mappings":"AASA,MAAM,KAAK,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAA;AAE/F;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,eAA4C,EAC5C,UAAkC,EAAE;IAEpC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAA;IACnD,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,cAAc,IAAI,CAAC,CAAC,CAAA;IAC/D,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,YAAY,IAAI,GAAG,CAAC,CAAA;IAC7D,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,IAAI,KAAK,CAAA;IAEnC,IAAI,cAAc,GAAG,CAAC;QAAE,MAAM,IAAI,CAAC,cAAc,CAAC,CAAA;IAElD,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,IAAI,QAAQ,EAAE,OAAO,IAAI,CAAC,EAAE,CAAC;QACxD,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,eAAe,EAAE,CAAA;YACtC,IAAI,MAAM,CAAC,KAAK,KAAK,UAAU;gBAAE,OAAO,IAAI,CAAA;QAC9C,CAAC;QAAC,MAAM,CAAC;YACP,0EAA0E;YAC1E,mEAAmE;QACrE,CAAC;QAED,IAAI,OAAO,GAAG,QAAQ,IAAI,YAAY,GAAG,CAAC;YAAE,MAAM,IAAI,CAAC,YAAY,CAAC,CAAA;IACtE,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC","sourcesContent":["type HotspotState = {state: \"disabled\" | \"enabled\"}\n\ntype HotspotShutdownOptions = {\n attempts?: number\n initialDelayMs?: number\n retryDelayMs?: number\n sleep?: (delayMs: number) => Promise<void>\n}\n\nconst sleep = (delayMs: number) => new Promise<void>((resolve) => setTimeout(resolve, delayMs))\n\n/**\n * Disable a glasses hotspot with a bounded retry. ASG APK replacement keeps the\n * BLE link alive through BES, but the first command after the new ASG process\n * appears can still land while its command path is settling.\n */\nexport async function disableHotspotWithRetry(\n requestDisabled: () => Promise<HotspotState>,\n options: HotspotShutdownOptions = {},\n): Promise<boolean> {\n const attempts = Math.max(1, options.attempts ?? 2)\n const initialDelayMs = Math.max(0, options.initialDelayMs ?? 0)\n const retryDelayMs = Math.max(0, options.retryDelayMs ?? 500)\n const wait = options.sleep ?? sleep\n\n if (initialDelayMs > 0) await wait(initialDelayMs)\n\n for (let attempt = 1; attempt <= attempts; attempt += 1) {\n try {\n const status = await requestDisabled()\n if (status.state === \"disabled\") return true\n } catch {\n // A lost command is indistinguishable from a response timeout here. Retry\n // while the phone still owns the hotspot network and local server.\n }\n\n if (attempt < attempts && retryDelayMs > 0) await wait(retryDelayMs)\n }\n\n return false\n}\n"]}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSCrashController — crash recovery state machine for the
|
|
3
|
+
* per-miniapp JSContexts owned by JSRouter.
|
|
4
|
+
*
|
|
5
|
+
* RUNNING
|
|
6
|
+
* │ crash detected (uncaught exception, native bridge throw,
|
|
7
|
+
* │ ping miss, soft-watchdog kill, etc.)
|
|
8
|
+
* ▼
|
|
9
|
+
* CRASHED ──── respawn allowed? ──── no ──► CRASHLOOP_DISABLED
|
|
10
|
+
* │ (persistent banner)
|
|
11
|
+
* ▼ yes
|
|
12
|
+
* BACKOFF(2s → 8s → 30s)
|
|
13
|
+
* │ timer fires
|
|
14
|
+
* ▼
|
|
15
|
+
* RUNNING (and stays here on a clean 60s window;
|
|
16
|
+
* otherwise crash count increments)
|
|
17
|
+
*
|
|
18
|
+
* Retry policy: zero retries by default — the first crash escalates
|
|
19
|
+
* straight to CRASHLOOP_DISABLED, matching how Android / iOS treat crashed
|
|
20
|
+
* apps. Callers that prefer auto-respawn opt in by passing
|
|
21
|
+
* `{maxRetries: 3, backoffMs: [2_000, 8_000, 30_000]}`; the BACKOFF state
|
|
22
|
+
* machine and exponential delays are implemented and unit-tested for that
|
|
23
|
+
* case.
|
|
24
|
+
*
|
|
25
|
+
* The controller is purely a policy engine — it doesn't actually call
|
|
26
|
+
* jsSpawn / jsKill. Callers (JSRouter) read the
|
|
27
|
+
* Outcome returned from onCrash() and drive the host accordingly. This
|
|
28
|
+
* makes the controller unit-testable with synthetic timer.
|
|
29
|
+
*/
|
|
30
|
+
export type CrashState = {
|
|
31
|
+
kind: "RUNNING";
|
|
32
|
+
sinceMs: number;
|
|
33
|
+
} | {
|
|
34
|
+
kind: "CRASHED";
|
|
35
|
+
reason: string;
|
|
36
|
+
crashedAtMs: number;
|
|
37
|
+
} | {
|
|
38
|
+
kind: "BACKOFF";
|
|
39
|
+
until: number;
|
|
40
|
+
attempt: number;
|
|
41
|
+
reason: string;
|
|
42
|
+
} | {
|
|
43
|
+
kind: "CRASHLOOP_DISABLED";
|
|
44
|
+
sinceMs: number;
|
|
45
|
+
reason: string;
|
|
46
|
+
};
|
|
47
|
+
export interface CrashOutcome {
|
|
48
|
+
/** Caller must call `respawn(packageName)` after this delay (ms from now). */
|
|
49
|
+
scheduleRespawnAfterMs?: number;
|
|
50
|
+
/** Caller should surface "X restarted" toast (2nd-within-5m crash). */
|
|
51
|
+
showRestartToast?: boolean;
|
|
52
|
+
/** Caller should surface persistent "crashloop disabled" banner. */
|
|
53
|
+
surfaceCrashloopBanner?: boolean;
|
|
54
|
+
/** Caller may push the crash event to dev portal / Sentry as warn-level. */
|
|
55
|
+
sentryLevel?: "info" | "warning" | "error";
|
|
56
|
+
}
|
|
57
|
+
export interface CrashControllerOptions {
|
|
58
|
+
/** Override the wall clock for tests. Defaults to Date.now. */
|
|
59
|
+
now?: () => number;
|
|
60
|
+
/** Backoff sequence in ms. Defaults to [2_000, 8_000, 30_000]. */
|
|
61
|
+
backoffMs?: number[];
|
|
62
|
+
/** Window in ms — N crashes inside this window escalates. Defaults to 5min. */
|
|
63
|
+
crashWindowMs?: number;
|
|
64
|
+
/** Max retries before CRASHLOOP_DISABLED. Defaults to 0 — first crash
|
|
65
|
+
* escalates immediately, matching Android / iOS app conventions. */
|
|
66
|
+
maxRetries?: number;
|
|
67
|
+
/** Clean-uptime threshold that resets the retry counter. Defaults to 60s. */
|
|
68
|
+
cleanUptimeResetMs?: number;
|
|
69
|
+
}
|
|
70
|
+
export declare class JSCrashController {
|
|
71
|
+
private readonly now;
|
|
72
|
+
private readonly backoffMs;
|
|
73
|
+
private readonly crashWindowMs;
|
|
74
|
+
private readonly maxRetries;
|
|
75
|
+
private readonly cleanUptimeResetMs;
|
|
76
|
+
private readonly packages;
|
|
77
|
+
constructor(opts?: CrashControllerOptions);
|
|
78
|
+
/** Tracking starts when JSRouter spawns a fresh JSContext. */
|
|
79
|
+
onSpawn(packageName: string): void;
|
|
80
|
+
/** Called when JSRouter explicitly tears down (user-initiated). */
|
|
81
|
+
onKill(packageName: string): void;
|
|
82
|
+
/**
|
|
83
|
+
* Record a crash and return the policy outcome. Caller is responsible for
|
|
84
|
+
* scheduling the respawn (timer ownership belongs at the orchestration
|
|
85
|
+
* layer that holds the host context, not here).
|
|
86
|
+
*/
|
|
87
|
+
onCrash(packageName: string, reason: string): CrashOutcome;
|
|
88
|
+
/** Inspect current state — useful for tests and diagnostics. */
|
|
89
|
+
stateFor(packageName: string): CrashState | null;
|
|
90
|
+
/** Total respawns since registration — surfaced to Sentry as a counter. */
|
|
91
|
+
respawnCount(packageName: string): number;
|
|
92
|
+
/** Currently-disabled packages. Host UI uses this to show banners. */
|
|
93
|
+
disabledPackages(): string[];
|
|
94
|
+
/** Manually re-enable a disabled package (user "Try again" tap). */
|
|
95
|
+
reset(packageName: string): void;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=JSCrashController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JSCrashController.d.ts","sourceRoot":"","sources":["../../src/services/JSCrashController.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,MAAM,MAAM,UAAU,GAClB;IAAC,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,GAClC;IAAC,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAC,GACtD;IAAC,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,GACjE;IAAC,IAAI,EAAE,oBAAoB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,CAAA;AAEjE,MAAM,WAAW,YAAY;IAC3B,8EAA8E;IAC9E,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,oEAAoE;IACpE,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,4EAA4E;IAC5E,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAA;CAC3C;AAED,MAAM,WAAW,sBAAsB;IACrC,+DAA+D;IAC/D,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;IAClB,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;yEACqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,6EAA6E;IAC7E,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAeD,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAc;IAClC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAU;IACpC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAQ;IACtC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;IACnC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAQ;IAC3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAuC;gBAEpD,IAAI,GAAE,sBAA2B;IAQ7C,8DAA8D;IAC9D,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAiBlC,mEAAmE;IACnE,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAIjC;;;;OAIG;IACH,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,YAAY;IA4C1D,gEAAgE;IAChE,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI;IAIhD,2EAA2E;IAC3E,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM;IAIzC,sEAAsE;IACtE,gBAAgB,IAAI,MAAM,EAAE;IAQ5B,oEAAoE;IACpE,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;CAMjC"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSCrashController — crash recovery state machine for the
|
|
3
|
+
* per-miniapp JSContexts owned by JSRouter.
|
|
4
|
+
*
|
|
5
|
+
* RUNNING
|
|
6
|
+
* │ crash detected (uncaught exception, native bridge throw,
|
|
7
|
+
* │ ping miss, soft-watchdog kill, etc.)
|
|
8
|
+
* ▼
|
|
9
|
+
* CRASHED ──── respawn allowed? ──── no ──► CRASHLOOP_DISABLED
|
|
10
|
+
* │ (persistent banner)
|
|
11
|
+
* ▼ yes
|
|
12
|
+
* BACKOFF(2s → 8s → 30s)
|
|
13
|
+
* │ timer fires
|
|
14
|
+
* ▼
|
|
15
|
+
* RUNNING (and stays here on a clean 60s window;
|
|
16
|
+
* otherwise crash count increments)
|
|
17
|
+
*
|
|
18
|
+
* Retry policy: zero retries by default — the first crash escalates
|
|
19
|
+
* straight to CRASHLOOP_DISABLED, matching how Android / iOS treat crashed
|
|
20
|
+
* apps. Callers that prefer auto-respawn opt in by passing
|
|
21
|
+
* `{maxRetries: 3, backoffMs: [2_000, 8_000, 30_000]}`; the BACKOFF state
|
|
22
|
+
* machine and exponential delays are implemented and unit-tested for that
|
|
23
|
+
* case.
|
|
24
|
+
*
|
|
25
|
+
* The controller is purely a policy engine — it doesn't actually call
|
|
26
|
+
* jsSpawn / jsKill. Callers (JSRouter) read the
|
|
27
|
+
* Outcome returned from onCrash() and drive the host accordingly. This
|
|
28
|
+
* makes the controller unit-testable with synthetic timer.
|
|
29
|
+
*/
|
|
30
|
+
const DEFAULT_BACKOFFS = [2_000, 8_000, 30_000];
|
|
31
|
+
const DEFAULT_WINDOW_MS = 5 * 60_000;
|
|
32
|
+
const DEFAULT_MAX_RETRIES = 0;
|
|
33
|
+
const DEFAULT_CLEAN_UPTIME_RESET_MS = 60_000;
|
|
34
|
+
export class JSCrashController {
|
|
35
|
+
now;
|
|
36
|
+
backoffMs;
|
|
37
|
+
crashWindowMs;
|
|
38
|
+
maxRetries;
|
|
39
|
+
cleanUptimeResetMs;
|
|
40
|
+
packages = new Map();
|
|
41
|
+
constructor(opts = {}) {
|
|
42
|
+
this.now = opts.now ?? (() => Date.now());
|
|
43
|
+
this.backoffMs = opts.backoffMs ?? DEFAULT_BACKOFFS;
|
|
44
|
+
this.crashWindowMs = opts.crashWindowMs ?? DEFAULT_WINDOW_MS;
|
|
45
|
+
this.maxRetries = opts.maxRetries ?? DEFAULT_MAX_RETRIES;
|
|
46
|
+
this.cleanUptimeResetMs = opts.cleanUptimeResetMs ?? DEFAULT_CLEAN_UPTIME_RESET_MS;
|
|
47
|
+
}
|
|
48
|
+
/** Tracking starts when JSRouter spawns a fresh JSContext. */
|
|
49
|
+
onSpawn(packageName) {
|
|
50
|
+
const at = this.now();
|
|
51
|
+
const prev = this.packages.get(packageName);
|
|
52
|
+
if (prev) {
|
|
53
|
+
// Carry forward the crash history; a respawn doesn't reset retry
|
|
54
|
+
// budget unless the previous RUNNING state survived >= cleanUptimeResetMs.
|
|
55
|
+
prev.state = { kind: "RUNNING", sinceMs: at };
|
|
56
|
+
prev.totalRespawns += 1;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
this.packages.set(packageName, {
|
|
60
|
+
state: { kind: "RUNNING", sinceMs: at },
|
|
61
|
+
crashesInWindow: [],
|
|
62
|
+
totalRespawns: 0,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/** Called when JSRouter explicitly tears down (user-initiated). */
|
|
67
|
+
onKill(packageName) {
|
|
68
|
+
this.packages.delete(packageName);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Record a crash and return the policy outcome. Caller is responsible for
|
|
72
|
+
* scheduling the respawn (timer ownership belongs at the orchestration
|
|
73
|
+
* layer that holds the host context, not here).
|
|
74
|
+
*/
|
|
75
|
+
onCrash(packageName, reason) {
|
|
76
|
+
const at = this.now();
|
|
77
|
+
const entry = this.packages.get(packageName) ?? {
|
|
78
|
+
state: { kind: "RUNNING", sinceMs: at },
|
|
79
|
+
crashesInWindow: [],
|
|
80
|
+
totalRespawns: 0,
|
|
81
|
+
};
|
|
82
|
+
// If the previous RUNNING window was long enough, reset the retry
|
|
83
|
+
// counter — a crash after a stable session shouldn't burn budget.
|
|
84
|
+
if (entry.state.kind === "RUNNING") {
|
|
85
|
+
const uptime = at - entry.state.sinceMs;
|
|
86
|
+
if (uptime >= this.cleanUptimeResetMs) {
|
|
87
|
+
entry.crashesInWindow = [];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// Drop crashes that fell out of the window before counting the new one.
|
|
91
|
+
const cutoff = at - this.crashWindowMs;
|
|
92
|
+
entry.crashesInWindow = entry.crashesInWindow.filter((t) => t >= cutoff);
|
|
93
|
+
entry.crashesInWindow.push(at);
|
|
94
|
+
this.packages.set(packageName, entry);
|
|
95
|
+
const crashCount = entry.crashesInWindow.length;
|
|
96
|
+
if (crashCount > this.maxRetries) {
|
|
97
|
+
entry.state = { kind: "CRASHLOOP_DISABLED", sinceMs: at, reason };
|
|
98
|
+
return {
|
|
99
|
+
surfaceCrashloopBanner: true,
|
|
100
|
+
sentryLevel: "error",
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
const attempt = crashCount - 1;
|
|
104
|
+
const delayMs = this.backoffMs[Math.min(attempt, this.backoffMs.length - 1)];
|
|
105
|
+
entry.state = { kind: "BACKOFF", until: at + delayMs, attempt: crashCount, reason };
|
|
106
|
+
return {
|
|
107
|
+
scheduleRespawnAfterMs: delayMs,
|
|
108
|
+
showRestartToast: crashCount >= 2,
|
|
109
|
+
sentryLevel: crashCount === 1 ? "info" : "warning",
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
/** Inspect current state — useful for tests and diagnostics. */
|
|
113
|
+
stateFor(packageName) {
|
|
114
|
+
return this.packages.get(packageName)?.state ?? null;
|
|
115
|
+
}
|
|
116
|
+
/** Total respawns since registration — surfaced to Sentry as a counter. */
|
|
117
|
+
respawnCount(packageName) {
|
|
118
|
+
return this.packages.get(packageName)?.totalRespawns ?? 0;
|
|
119
|
+
}
|
|
120
|
+
/** Currently-disabled packages. Host UI uses this to show banners. */
|
|
121
|
+
disabledPackages() {
|
|
122
|
+
const out = [];
|
|
123
|
+
for (const [name, entry] of this.packages) {
|
|
124
|
+
if (entry.state.kind === "CRASHLOOP_DISABLED")
|
|
125
|
+
out.push(name);
|
|
126
|
+
}
|
|
127
|
+
return out;
|
|
128
|
+
}
|
|
129
|
+
/** Manually re-enable a disabled package (user "Try again" tap). */
|
|
130
|
+
reset(packageName) {
|
|
131
|
+
const entry = this.packages.get(packageName);
|
|
132
|
+
if (!entry)
|
|
133
|
+
return;
|
|
134
|
+
entry.crashesInWindow = [];
|
|
135
|
+
entry.state = { kind: "RUNNING", sinceMs: this.now() };
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=JSCrashController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JSCrashController.js","sourceRoot":"","sources":["../../src/services/JSCrashController.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAyCH,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;AAC/C,MAAM,iBAAiB,GAAG,CAAC,GAAG,MAAM,CAAA;AACpC,MAAM,mBAAmB,GAAG,CAAC,CAAA;AAC7B,MAAM,6BAA6B,GAAG,MAAM,CAAA;AAE5C,MAAM,OAAO,iBAAiB;IACX,GAAG,CAAc;IACjB,SAAS,CAAU;IACnB,aAAa,CAAQ;IACrB,UAAU,CAAQ;IAClB,kBAAkB,CAAQ;IAC1B,QAAQ,GAA8B,IAAI,GAAG,EAAE,CAAA;IAEhE,YAAY,OAA+B,EAAE;QAC3C,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAA;QACzC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,gBAAgB,CAAA;QACnD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,IAAI,iBAAiB,CAAA;QAC5D,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,mBAAmB,CAAA;QACxD,IAAI,CAAC,kBAAkB,GAAG,I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K,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;SACnD,CAAA;IACH,CAAC;IAED,gEAAgE;IAChE,QAAQ,CAAC,WAAmB;QAC1B,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,KAAK,IAAI,IAAI,CAAA;IACtD,CAAC;IAED,2EAA2E;IAC3E,YAAY,CAAC,WAAmB;QAC9B,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,aAAa,IAAI,CAAC,CAAA;IAC3D,CAAC;IAED,sEAAsE;IACtE,gBAAgB;QACd,MAAM,GAAG,GAAa,EAAE,CAAA;QACxB,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1C,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,oBAAoB;gBAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC/D,CAAC;QACD,OAAO,GAAG,CAAA;IACZ,CAAC;IAED,oEAAoE;IACpE,KAAK,CAAC,WAAmB;QACvB,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;QAC5C,IAAI,CAAC,KAAK;YAAE,OAAM;QAClB,KAAK,CAAC,eAAe,GAAG,EAAE,CAAA;QAC1B,KAAK,CAAC,KAAK,GAAG,EAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,EAAE,EAAC,CAAA;IACtD,CAAC;CACF","sourcesContent":["/**\n * JSCrashController — crash recovery state machine for the\n * per-miniapp JSContexts owned by JSRouter.\n *\n * RUNNING\n * │ crash detected (uncaught exception, native bridge throw,\n * │ ping miss, soft-watchdog kill, etc.)\n * ▼\n * CRASHED ──── respawn allowed? ──── no ──► CRASHLOOP_DISABLED\n * │ (persistent banner)\n * ▼ yes\n * BACKOFF(2s → 8s → 30s)\n * │ timer fires\n * ▼\n * RUNNING (and stays here on a clean 60s window;\n * otherwise crash count increments)\n *\n * Retry policy: zero retries by default — the first crash escalates\n * straight to CRASHLOOP_DISABLED, matching how Android / iOS treat crashed\n * apps. Callers that prefer auto-respawn opt in by passing\n * `{maxRetries: 3, backoffMs: [2_000, 8_000, 30_000]}`; the BACKOFF state\n * machine and exponential delays are implemented and unit-tested for that\n * case.\n *\n * The controller is purely a policy engine — it doesn't actually call\n * jsSpawn / jsKill. Callers (JSRouter) read the\n * Outcome returned from onCrash() and drive the host accordingly. This\n * makes the controller unit-testable with synthetic timer.\n */\n\nexport type CrashState =\n | {kind: \"RUNNING\"; sinceMs: number}\n | {kind: \"CRASHED\"; reason: string; crashedAtMs: number}\n | {kind: \"BACKOFF\"; until: number; attempt: number; reason: string}\n | {kind: \"CRASHLOOP_DISABLED\"; sinceMs: number; reason: string}\n\nexport interface CrashOutcome {\n /** Caller must call `respawn(packageName)` after this delay (ms from now). */\n scheduleRespawnAfterMs?: number\n /** Caller should surface \"X restarted\" toast (2nd-within-5m crash). */\n showRestartToast?: boolean\n /** Caller should surface persistent \"crashloop disabled\" banner. */\n surfaceCrashloopBanner?: boolean\n /** Caller may push the crash event to dev portal / Sentry as warn-level. */\n sentryLevel?: \"info\" | \"warning\" | \"error\"\n}\n\nexport interface CrashControllerOptions {\n /** Override the wall clock for tests. Defaults to Date.now. */\n now?: () => number\n /** Backoff sequence in ms. Defaults to [2_000, 8_000, 30_000]. */\n backoffMs?: number[]\n /** Window in ms — N crashes inside this window escalates. Defaults to 5min. */\n crashWindowMs?: number\n /** Max retries before CRASHLOOP_DISABLED. Defaults to 0 — first crash\n * escalates immediately, matching Android / iOS app conventions. */\n maxRetries?: number\n /** Clean-uptime threshold that resets the retry counter. Defaults to 60s. */\n cleanUptimeResetMs?: number\n}\n\ninterface PackageState {\n state: CrashState\n /** Crash timestamps inside the current window (sorted ascending). */\n crashesInWindow: number[]\n /** Total respawns since the package was first registered (for telemetry). */\n totalRespawns: number\n}\n\nconst DEFAULT_BACKOFFS = [2_000, 8_000, 30_000]\nconst DEFAULT_WINDOW_MS = 5 * 60_000\nconst DEFAULT_MAX_RETRIES = 0\nconst DEFAULT_CLEAN_UPTIME_RESET_MS = 60_000\n\nexport class JSCrashController {\n private readonly now: () => number\n private readonly backoffMs: number[]\n private readonly crashWindowMs: number\n private readonly maxRetries: number\n private readonly cleanUptimeResetMs: number\n private readonly packages: Map<string, PackageState> = new Map()\n\n constructor(opts: CrashControllerOptions = {}) {\n this.now = opts.now ?? (() => Date.now())\n this.backoffMs = opts.backoffMs ?? DEFAULT_BACKOFFS\n this.crashWindowMs = opts.crashWindowMs ?? DEFAULT_WINDOW_MS\n this.maxRetries = opts.maxRetries ?? DEFAULT_MAX_RETRIES\n this.cleanUptimeResetMs = opts.cleanUptimeResetMs ?? DEFAULT_CLEAN_UPTIME_RESET_MS\n }\n\n /** Tracking starts when JSRouter spawns a fresh JSContext. */\n onSpawn(packageName: string): void {\n const at = this.now()\n const prev = this.packages.get(packageName)\n if (prev) {\n // Carry forward the crash history; a respawn doesn't reset retry\n // budget unless the previous RUNNING state survived >= cleanUptimeResetMs.\n prev.state = {kind: \"RUNNING\", sinceMs: at}\n prev.totalRespawns += 1\n } else {\n this.packages.set(packageName, {\n state: {kind: \"RUNNING\", sinceMs: at},\n crashesInWindow: [],\n totalRespawns: 0,\n })\n }\n }\n\n /** Called when JSRouter explicitly tears down (user-initiated). */\n onKill(packageName: string): void {\n this.packages.delete(packageName)\n }\n\n /**\n * Record a crash and return the policy outcome. Caller is responsible for\n * scheduling the respawn (timer ownership belongs at the orchestration\n * layer that holds the host context, not here).\n */\n onCrash(packageName: string, reason: string): CrashOutcome {\n const at = this.now()\n const entry = this.packages.get(packageName) ?? {\n state: {kind: \"RUNNING\", sinceMs: at},\n crashesInWindow: [],\n totalRespawns: 0,\n }\n\n // If the previous RUNNING window was long enough, reset the retry\n // counter — a crash after a stable session shouldn't burn budget.\n if (entry.state.kind === \"RUNNING\") {\n const uptime = at - entry.state.sinceMs\n if (uptime >= this.cleanUptimeResetMs) {\n entry.crashesInWindow = []\n }\n }\n\n // Drop crashes that fell out of the window before counting the new one.\n const cutoff = at - this.crashWindowMs\n entry.crashesInWindow = entry.crashesInWindow.filter((t) => t >= cutoff)\n entry.crashesInWindow.push(at)\n this.packages.set(packageName, entry)\n\n const crashCount = entry.crashesInWindow.length\n\n if (crashCount > this.maxRetries) {\n entry.state = {kind: \"CRASHLOOP_DISABLED\", sinceMs: at, reason}\n return {\n surfaceCrashloopBanner: true,\n sentryLevel: \"error\",\n }\n }\n\n const attempt = crashCount - 1\n const delayMs = this.backoffMs[Math.min(attempt, this.backoffMs.length - 1)]!\n entry.state = {kind: \"BACKOFF\", until: at + delayMs, attempt: crashCount, reason}\n\n return {\n scheduleRespawnAfterMs: delayMs,\n showRestartToast: crashCount >= 2,\n sentryLevel: crashCount === 1 ? \"info\" : \"warning\",\n }\n }\n\n /** Inspect current state — useful for tests and diagnostics. */\n stateFor(packageName: string): CrashState | null {\n return this.packages.get(packageName)?.state ?? null\n }\n\n /** Total respawns since registration — surfaced to Sentry as a counter. */\n respawnCount(packageName: string): number {\n return this.packages.get(packageName)?.totalRespawns ?? 0\n }\n\n /** Currently-disabled packages. Host UI uses this to show banners. */\n disabledPackages(): string[] {\n const out: string[] = []\n for (const [name, entry] of this.packages) {\n if (entry.state.kind === \"CRASHLOOP_DISABLED\") out.push(name)\n }\n return out\n }\n\n /** Manually re-enable a disabled package (user \"Try again\" tap). */\n reset(packageName: string): void {\n const entry = this.packages.get(packageName)\n if (!entry) return\n entry.crashesInWindow = []\n entry.state = {kind: \"RUNNING\", sinceMs: this.now()}\n }\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type AutomaticReportSubmissionStatus } from "./AutomaticReportResult";
|
|
2
|
+
export declare function submitJSCrashloopReport(params: {
|
|
3
|
+
packageName: string;
|
|
4
|
+
reason: string;
|
|
5
|
+
lastLogLines?: string[];
|
|
6
|
+
}): Promise<AutomaticReportSubmissionStatus>;
|
|
7
|
+
export declare function startJSCrashloopReportService(): void;
|
|
8
|
+
export declare function stopJSCrashloopReportService(): void;
|
|
9
|
+
//# sourceMappingURL=JSCrashloopReportService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JSCrashloopReportService.d.ts","sourceRoot":"","sources":["../../src/services/JSCrashloopReportService.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,+BAA+B,EACrC,MAAM,yBAAyB,CAAA;AAQhC,wBAAsB,uBAAuB,CAAC,MAAM,EAAE;IACpD,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;CACxB,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAwB3C;AAeD,wBAAgB,6BAA6B,IAAI,IAAI,CAGpD;AAED,wBAAgB,4BAA4B,IAAI,IAAI,CAGnD"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { submitAutomaticReport } from "../facades/reports";
|
|
2
|
+
import { useAppStatusStore } from "../stores/apps";
|
|
3
|
+
import { logAutomaticReportSubmissionStatus, toAutomaticReportSubmissionStatus, } from "./AutomaticReportResult";
|
|
4
|
+
import { getMiniappEngine } from "./MiniappEngine";
|
|
5
|
+
import { islandNotifications } from "./NotificationsEmitter";
|
|
6
|
+
const LOG_TAG = "JSCrashloopReport";
|
|
7
|
+
let unsubscribe = null;
|
|
8
|
+
export async function submitJSCrashloopReport(params) {
|
|
9
|
+
const { packageName, reason, lastLogLines = [] } = params;
|
|
10
|
+
const app = useAppStatusStore.getState().apps.find((a) => a.packageName === packageName);
|
|
11
|
+
const appName = app?.name ?? packageName;
|
|
12
|
+
const result = await submitAutomaticReport({
|
|
13
|
+
kind: "automatic",
|
|
14
|
+
trigger: {
|
|
15
|
+
type: "automatic",
|
|
16
|
+
source: "miniapp_crashloop",
|
|
17
|
+
reason: "glasslyjs_crashloop_disabled",
|
|
18
|
+
sourceAppletPackageName: packageName,
|
|
19
|
+
sourceAppletName: appName,
|
|
20
|
+
},
|
|
21
|
+
report: {
|
|
22
|
+
expectedBehavior: `${appName} should run without crashing.`,
|
|
23
|
+
actualBehavior: JSON.stringify({ reason, lastLogLines }, null, 2),
|
|
24
|
+
systemPriority: "critical",
|
|
25
|
+
},
|
|
26
|
+
throttleKey: `glasslyjs_crashloop:${packageName}`,
|
|
27
|
+
});
|
|
28
|
+
const status = toAutomaticReportSubmissionStatus(result);
|
|
29
|
+
logAutomaticReportSubmissionStatus(LOG_TAG, status, packageName);
|
|
30
|
+
return status;
|
|
31
|
+
}
|
|
32
|
+
function handleNotification(notification) {
|
|
33
|
+
if (notification.kind !== "miniapp_crashloop" || !notification.packageName)
|
|
34
|
+
return;
|
|
35
|
+
const packageName = notification.packageName;
|
|
36
|
+
const lastLogLines = getMiniappEngine()?.router.logRing.snapshot(packageName) ?? [];
|
|
37
|
+
void submitJSCrashloopReport({
|
|
38
|
+
packageName,
|
|
39
|
+
reason: notification.reason,
|
|
40
|
+
lastLogLines,
|
|
41
|
+
}).catch((error) => {
|
|
42
|
+
console.error(`[${LOG_TAG}] Unexpected error:`, error);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
export function startJSCrashloopReportService() {
|
|
46
|
+
if (unsubscribe)
|
|
47
|
+
return;
|
|
48
|
+
unsubscribe = islandNotifications.subscribe(handleNotification);
|
|
49
|
+
}
|
|
50
|
+
export function stopJSCrashloopReportService() {
|
|
51
|
+
unsubscribe?.();
|
|
52
|
+
unsubscribe = null;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=JSCrashloopReportService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JSCrashloopReportService.js","sourceRoot":"","sources":["../../src/services/JSCrashloopReportService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAC,MAAM,oBAAoB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E,WAAW,CAAC,CAAA;IAChE,OAAO,MAAM,CAAA;AACf,CAAC;AAED,SAAS,kBAAkB,CAAC,YAAgC;IAC1D,IAAI,YAAY,CAAC,IAAI,KAAK,mBAAmB,IAAI,CAAC,YAAY,CAAC,WAAW;QAAE,OAAM;IAClF,MAAM,WAAW,GAAG,YAAY,CAAC,WAAW,CAAA;IAC5C,MAAM,YAAY,GAAG,gBAAgB,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,EAAE,CAAA;IACnF,KAAK,uBAAuB,CAAC;QAC3B,WAAW;QACX,MAAM,EAAE,YAAY,CAAC,MAAM;QAC3B,YAAY;KACb,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACjB,OAAO,CAAC,KAAK,CAAC,IAAI,OAAO,qBAAqB,EAAE,KAAK,CAAC,CAAA;IACxD,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,UAAU,6BAA6B;IAC3C,IAAI,WAAW;QAAE,OAAM;IACvB,WAAW,GAAG,mBAAmB,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAA;AACjE,CAAC;AAED,MAAM,UAAU,4BAA4B;IAC1C,WAAW,EAAE,EAAE,CAAA;IACf,WAAW,GAAG,IAAI,CAAA;AACpB,CAAC","sourcesContent":["import {submitAutomaticReport} from \"../facades/reports\"\nimport {useAppStatusStore} from \"../stores/apps\"\nimport {\n logAutomaticReportSubmissionStatus,\n toAutomaticReportSubmissionStatus,\n type AutomaticReportSubmissionStatus,\n} from \"./AutomaticReportResult\"\nimport {getMiniappEngine} from \"./MiniappEngine\"\nimport {islandNotifications, type IslandNotification} from \"./NotificationsEmitter\"\n\nconst LOG_TAG = \"JSCrashloopReport\"\n\nlet unsubscribe: (() => void) | null = null\n\nexport async function submitJSCrashloopReport(params: {\n packageName: string\n reason: string\n lastLogLines?: string[]\n}): Promise<AutomaticReportSubmissionStatus> {\n const {packageName, reason, lastLogLines = []} = params\n const app = useAppStatusStore.getState().apps.find((a) => a.packageName === packageName)\n const appName = app?.name ?? packageName\n const result = await submitAutomaticReport({\n kind: \"automatic\",\n trigger: {\n type: \"automatic\",\n source: \"miniapp_crashloop\",\n reason: \"glasslyjs_crashloop_disabled\",\n sourceAppletPackageName: packageName,\n sourceAppletName: appName,\n },\n report: {\n expectedBehavior: `${appName} should run without crashing.`,\n actualBehavior: JSON.stringify({reason, lastLogLines}, null, 2),\n systemPriority: \"critical\",\n },\n throttleKey: `glasslyjs_crashloop:${packageName}`,\n })\n\n const status = toAutomaticReportSubmissionStatus(result)\n logAutomaticReportSubmissionStatus(LOG_TAG, status, packageName)\n return status\n}\n\nfunction handleNotification(notification: IslandNotification): void {\n if (notification.kind !== \"miniapp_crashloop\" || !notification.packageName) return\n const packageName = notification.packageName\n const lastLogLines = getMiniappEngine()?.router.logRing.snapshot(packageName) ?? []\n void submitJSCrashloopReport({\n packageName,\n reason: notification.reason,\n lastLogLines,\n }).catch((error) => {\n console.error(`[${LOG_TAG}] Unexpected error:`, error)\n })\n}\n\nexport function startJSCrashloopReportService(): void {\n if (unsubscribe) return\n unsubscribe = islandNotifications.subscribe(handleNotification)\n}\n\nexport function stopJSCrashloopReportService(): void {\n unsubscribe?.()\n unsubscribe = null\n}\n"]}
|