@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,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MicStateCoordinator
|
|
3
|
+
*
|
|
4
|
+
* Owns local-miniapp-driven microphone requirements.
|
|
5
|
+
*
|
|
6
|
+
* Local miniapps subscribe to audio_chunk / transcription streams.
|
|
7
|
+
* This coordinator pushes the aggregate local requirement set to BluetoothSdk
|
|
8
|
+
* so the mic runs whenever at least one local consumer needs it.
|
|
9
|
+
*/
|
|
10
|
+
type MicGate = "vad" | "loudnessGate";
|
|
11
|
+
interface ConfiguredMicGates {
|
|
12
|
+
vadEnabled?: boolean | null;
|
|
13
|
+
loudnessGateEnabled?: boolean | null;
|
|
14
|
+
}
|
|
15
|
+
declare class MicStateCoordinator {
|
|
16
|
+
private static instance;
|
|
17
|
+
private localWantsPcm;
|
|
18
|
+
private localWantsLc3;
|
|
19
|
+
private configuredVad;
|
|
20
|
+
private configuredLoudnessGate;
|
|
21
|
+
private readonly miniappVadOverrides;
|
|
22
|
+
private readonly miniappLoudnessGateOverrides;
|
|
23
|
+
private overrideSequence;
|
|
24
|
+
private constructor();
|
|
25
|
+
static getInstance(): MicStateCoordinator;
|
|
26
|
+
/**
|
|
27
|
+
* Update local miniapp requirements. Called by LocalMiniappRuntime when
|
|
28
|
+
* the aggregated set of local subscriptions changes.
|
|
29
|
+
*/
|
|
30
|
+
setLocalRequirements(req: {
|
|
31
|
+
pcm: boolean;
|
|
32
|
+
lc3: boolean;
|
|
33
|
+
} & ConfiguredMicGates): void;
|
|
34
|
+
/**
|
|
35
|
+
* Apply a miniapp-owned gate override without changing the OS preference.
|
|
36
|
+
* Overrides are lifecycle-scoped and last-live-owner-wins independently for
|
|
37
|
+
* VAD and Barrier.
|
|
38
|
+
*/
|
|
39
|
+
setMiniappGateOverride(packageName: string, gate: MicGate, enabled: boolean, configured?: ConfiguredMicGates): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Remove every gate override owned by a miniapp. This is synchronous so
|
|
42
|
+
* unregister can drop ownership before recomputing aggregate mic state.
|
|
43
|
+
*/
|
|
44
|
+
clearMiniappGateOverrides(packageName: string): boolean;
|
|
45
|
+
/** Re-apply the current runtime policy after an owner is released. */
|
|
46
|
+
syncEffectiveGatePolicy(configured?: ConfiguredMicGates): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Preserve the runtime microphone contract when the persisted device
|
|
49
|
+
* settings are replayed (for example after a glasses reconnect). Active
|
|
50
|
+
* miniapp gate overrides replace the OS values, and raw PCM keeps VAD off
|
|
51
|
+
* until the last raw-audio consumer unsubscribes.
|
|
52
|
+
*/
|
|
53
|
+
applyRuntimeOverrides(settings: Record<string, unknown>): Record<string, unknown>;
|
|
54
|
+
/**
|
|
55
|
+
* Apply the complete current gate policy without treating the input as an OS
|
|
56
|
+
* preference update. Used by debounced mic-requirement writes, whose queued
|
|
57
|
+
* gate values may be stale after an override is acquired or released.
|
|
58
|
+
*/
|
|
59
|
+
applyEffectiveGatePolicy(settings: Record<string, unknown>): Record<string, unknown>;
|
|
60
|
+
private applyActiveRuntimeOverrides;
|
|
61
|
+
/**
|
|
62
|
+
* Push local requirements to BluetoothSdk. `should_send_pcm` is strictly for
|
|
63
|
+
* on-device PCM consumers; cloud audio uses LC3 through AudioCloudUplink.
|
|
64
|
+
*/
|
|
65
|
+
private applyUnion;
|
|
66
|
+
private rememberConfiguredGates;
|
|
67
|
+
private overridesFor;
|
|
68
|
+
private latestOverride;
|
|
69
|
+
private effectiveGatePatch;
|
|
70
|
+
/**
|
|
71
|
+
* Reset all requirements to off. Called during cleanup.
|
|
72
|
+
*/
|
|
73
|
+
reset(): void;
|
|
74
|
+
cleanup(): void;
|
|
75
|
+
}
|
|
76
|
+
declare const micStateCoordinator: MicStateCoordinator;
|
|
77
|
+
export default micStateCoordinator;
|
|
78
|
+
//# sourceMappingURL=MicStateCoordinator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MicStateCoordinator.d.ts","sourceRoot":"","sources":["../../src/services/MicStateCoordinator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,KAAK,OAAO,GAAG,KAAK,GAAG,cAAc,CAAA;AAOrC,UAAU,kBAAkB;IAC1B,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;IAC3B,mBAAmB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;CACrC;AAkBD,cAAM,mBAAmB;IACvB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAmC;IAG1D,OAAO,CAAC,aAAa,CAAQ;IAC7B,OAAO,CAAC,aAAa,CAAQ;IAC7B,OAAO,CAAC,aAAa,CAAqB;IAC1C,OAAO,CAAC,sBAAsB,CAAqB;IACnD,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAkC;IACtE,OAAO,CAAC,QAAQ,CAAC,4BAA4B,CAAkC;IAC/E,OAAO,CAAC,gBAAgB,CAAI;IAE5B,OAAO;WAEO,WAAW,IAAI,mBAAmB;IAOhD;;;OAGG;IACI,oBAAoB,CAAC,GAAG,EAAE;QAAC,GAAG,EAAE,OAAO,CAAC;QAAC,GAAG,EAAE,OAAO,CAAA;KAAC,GAAG,kBAAkB,GAAG,IAAI;IAQzF;;;;OAIG;IACU,sBAAsB,CACjC,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,OAAO,EAChB,UAAU,GAAE,kBAAuB,GAClC,OAAO,CAAC,IAAI,CAAC;IAoBhB;;;OAGG;IACI,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAM9D,sEAAsE;IACzD,uBAAuB,CAAC,UAAU,GAAE,kBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;IAOxF;;;;;OAKG;IACI,qBAAqB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAaxF;;;;OAIG;IACI,wBAAwB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAO3F,OAAO,CAAC,2BAA2B;IAiBnC;;;OAGG;IACH,OAAO,CAAC,UAAU;IAoBlB,OAAO,CAAC,uBAAuB;IAW/B,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,kBAAkB;IAmB1B;;OAEG;IACI,KAAK,IAAI,IAAI;IAMb,OAAO,IAAI,IAAI;CAOvB;AAED,QAAA,MAAM,mBAAmB,qBAAoC,CAAA;AAC7D,eAAe,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MicStateCoordinator
|
|
3
|
+
*
|
|
4
|
+
* Owns local-miniapp-driven microphone requirements.
|
|
5
|
+
*
|
|
6
|
+
* Local miniapps subscribe to audio_chunk / transcription streams.
|
|
7
|
+
* This coordinator pushes the aggregate local requirement set to BluetoothSdk
|
|
8
|
+
* so the mic runs whenever at least one local consumer needs it.
|
|
9
|
+
*/
|
|
10
|
+
import BluetoothSdk from "@glassly/bluetooth-sdk/internal";
|
|
11
|
+
import { createDebouncedPatchFlusher } from "../utils/debouncedPatch";
|
|
12
|
+
const LOG_TAG = "MIC_COORDINATOR";
|
|
13
|
+
/** Mic-requirement flips are debounced (300ms) and merged into one BLE write
|
|
14
|
+
* (wire v2 keeps BLE JSON small and infrequent). */
|
|
15
|
+
const flushMicRequirementsPatch = createDebouncedPatchFlusher((patch) => {
|
|
16
|
+
try {
|
|
17
|
+
// Resolve runtime overrides at flush time. A miniapp can acquire/release a
|
|
18
|
+
// gate override during the debounce window, and a captured stale value
|
|
19
|
+
// must not win after that lifecycle transition.
|
|
20
|
+
const runtimePatch = micStateCoordinator.applyEffectiveGatePolicy(patch);
|
|
21
|
+
void Promise.resolve(BluetoothSdk.updateBluetoothSettings(runtimePatch)).catch((err) => {
|
|
22
|
+
console.error(`${LOG_TAG}: failed to apply mic requirements:`, err);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
console.error(`${LOG_TAG}: failed to apply mic requirements:`, err);
|
|
27
|
+
}
|
|
28
|
+
}, 300);
|
|
29
|
+
class MicStateCoordinator {
|
|
30
|
+
static instance = null;
|
|
31
|
+
// Local miniapp requirements (set when miniapps subscribe to audio streams)
|
|
32
|
+
localWantsPcm = false;
|
|
33
|
+
localWantsLc3 = false;
|
|
34
|
+
configuredVad;
|
|
35
|
+
configuredLoudnessGate;
|
|
36
|
+
miniappVadOverrides = new Map();
|
|
37
|
+
miniappLoudnessGateOverrides = new Map();
|
|
38
|
+
overrideSequence = 0;
|
|
39
|
+
constructor() { }
|
|
40
|
+
static getInstance() {
|
|
41
|
+
if (!MicStateCoordinator.instance) {
|
|
42
|
+
MicStateCoordinator.instance = new MicStateCoordinator();
|
|
43
|
+
}
|
|
44
|
+
return MicStateCoordinator.instance;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Update local miniapp requirements. Called by LocalMiniappRuntime when
|
|
48
|
+
* the aggregated set of local subscriptions changes.
|
|
49
|
+
*/
|
|
50
|
+
setLocalRequirements(req) {
|
|
51
|
+
this.localWantsPcm = req.pcm;
|
|
52
|
+
this.localWantsLc3 = req.lc3;
|
|
53
|
+
this.rememberConfiguredGates(req);
|
|
54
|
+
console.log(`${LOG_TAG}: local requirements updated — pcm=${req.pcm} lc3=${req.lc3}`);
|
|
55
|
+
this.applyUnion();
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Apply a miniapp-owned gate override without changing the OS preference.
|
|
59
|
+
* Overrides are lifecycle-scoped and last-live-owner-wins independently for
|
|
60
|
+
* VAD and Barrier.
|
|
61
|
+
*/
|
|
62
|
+
async setMiniappGateOverride(packageName, gate, enabled, configured = {}) {
|
|
63
|
+
this.rememberConfiguredGates(configured);
|
|
64
|
+
const overrides = this.overridesFor(gate);
|
|
65
|
+
const previous = overrides.get(packageName);
|
|
66
|
+
const next = { enabled, order: ++this.overrideSequence };
|
|
67
|
+
overrides.set(packageName, next);
|
|
68
|
+
try {
|
|
69
|
+
await BluetoothSdk.updateBluetoothSettings(this.effectiveGatePatch());
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
// Do not roll back a newer request from the same package that landed
|
|
73
|
+
// while this native write was in flight.
|
|
74
|
+
if (overrides.get(packageName) === next) {
|
|
75
|
+
if (previous)
|
|
76
|
+
overrides.set(packageName, previous);
|
|
77
|
+
else
|
|
78
|
+
overrides.delete(packageName);
|
|
79
|
+
}
|
|
80
|
+
throw error;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Remove every gate override owned by a miniapp. This is synchronous so
|
|
85
|
+
* unregister can drop ownership before recomputing aggregate mic state.
|
|
86
|
+
*/
|
|
87
|
+
clearMiniappGateOverrides(packageName) {
|
|
88
|
+
const removedVad = this.miniappVadOverrides.delete(packageName);
|
|
89
|
+
const removedLoudness = this.miniappLoudnessGateOverrides.delete(packageName);
|
|
90
|
+
return removedVad || removedLoudness;
|
|
91
|
+
}
|
|
92
|
+
/** Re-apply the current runtime policy after an owner is released. */
|
|
93
|
+
async syncEffectiveGatePolicy(configured = {}) {
|
|
94
|
+
this.rememberConfiguredGates(configured);
|
|
95
|
+
const patch = this.effectiveGatePatch();
|
|
96
|
+
if (Object.keys(patch).length === 0)
|
|
97
|
+
return;
|
|
98
|
+
await BluetoothSdk.updateBluetoothSettings(patch);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Preserve the runtime microphone contract when the persisted device
|
|
102
|
+
* settings are replayed (for example after a glasses reconnect). Active
|
|
103
|
+
* miniapp gate overrides replace the OS values, and raw PCM keeps VAD off
|
|
104
|
+
* until the last raw-audio consumer unsubscribes.
|
|
105
|
+
*/
|
|
106
|
+
applyRuntimeOverrides(settings) {
|
|
107
|
+
this.rememberConfiguredGates({
|
|
108
|
+
vadEnabled: typeof settings.voice_activity_detection_enabled === "boolean"
|
|
109
|
+
? settings.voice_activity_detection_enabled
|
|
110
|
+
: undefined,
|
|
111
|
+
loudnessGateEnabled: typeof settings.loudness_gate_enabled === "boolean" ? settings.loudness_gate_enabled : undefined,
|
|
112
|
+
});
|
|
113
|
+
return this.applyActiveRuntimeOverrides(settings);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Apply the complete current gate policy without treating the input as an OS
|
|
117
|
+
* preference update. Used by debounced mic-requirement writes, whose queued
|
|
118
|
+
* gate values may be stale after an override is acquired or released.
|
|
119
|
+
*/
|
|
120
|
+
applyEffectiveGatePolicy(settings) {
|
|
121
|
+
return {
|
|
122
|
+
...settings,
|
|
123
|
+
...this.effectiveGatePatch(),
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
applyActiveRuntimeOverrides(settings) {
|
|
127
|
+
const runtimeSettings = { ...settings };
|
|
128
|
+
const vadOverride = this.latestOverride(this.miniappVadOverrides);
|
|
129
|
+
const loudnessOverride = this.latestOverride(this.miniappLoudnessGateOverrides);
|
|
130
|
+
if (this.localWantsPcm) {
|
|
131
|
+
runtimeSettings.voice_activity_detection_enabled = false;
|
|
132
|
+
}
|
|
133
|
+
else if (vadOverride) {
|
|
134
|
+
runtimeSettings.voice_activity_detection_enabled = vadOverride.enabled;
|
|
135
|
+
}
|
|
136
|
+
if (loudnessOverride) {
|
|
137
|
+
runtimeSettings.loudness_gate_enabled = loudnessOverride.enabled;
|
|
138
|
+
}
|
|
139
|
+
return runtimeSettings;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Push local requirements to BluetoothSdk. `should_send_pcm` is strictly for
|
|
143
|
+
* on-device PCM consumers; cloud audio uses LC3 through AudioCloudUplink.
|
|
144
|
+
*/
|
|
145
|
+
applyUnion() {
|
|
146
|
+
const shouldSendPcm = this.localWantsPcm;
|
|
147
|
+
const shouldSendLc3 = this.localWantsLc3;
|
|
148
|
+
// console.log(
|
|
149
|
+
// `${LOG_TAG}: applying requirements — pcm=${shouldSendPcm} lc3=${shouldSendLc3}`,
|
|
150
|
+
// )
|
|
151
|
+
// The mic control plane is a direct btsdk call now (was a host setMicRequirements
|
|
152
|
+
// hook) so a bare OEM streams audio without wiring it.
|
|
153
|
+
const patch = {
|
|
154
|
+
should_send_pcm: shouldSendPcm,
|
|
155
|
+
should_send_lc3: shouldSendLc3,
|
|
156
|
+
should_send_transcript: false,
|
|
157
|
+
...this.effectiveGatePatch(),
|
|
158
|
+
};
|
|
159
|
+
flushMicRequirementsPatch(patch);
|
|
160
|
+
}
|
|
161
|
+
rememberConfiguredGates(configured) {
|
|
162
|
+
// null means the connected device intentionally omits that setting.
|
|
163
|
+
// undefined means the caller is not updating the remembered preference.
|
|
164
|
+
if (configured.vadEnabled !== undefined) {
|
|
165
|
+
this.configuredVad = configured.vadEnabled ?? undefined;
|
|
166
|
+
}
|
|
167
|
+
if (configured.loudnessGateEnabled !== undefined) {
|
|
168
|
+
this.configuredLoudnessGate = configured.loudnessGateEnabled ?? undefined;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
overridesFor(gate) {
|
|
172
|
+
return gate === "vad" ? this.miniappVadOverrides : this.miniappLoudnessGateOverrides;
|
|
173
|
+
}
|
|
174
|
+
latestOverride(overrides) {
|
|
175
|
+
let latest;
|
|
176
|
+
for (const entry of overrides.values()) {
|
|
177
|
+
if (!latest || entry.order > latest.order)
|
|
178
|
+
latest = entry;
|
|
179
|
+
}
|
|
180
|
+
return latest;
|
|
181
|
+
}
|
|
182
|
+
effectiveGatePatch() {
|
|
183
|
+
const patch = {};
|
|
184
|
+
const vadOverride = this.latestOverride(this.miniappVadOverrides);
|
|
185
|
+
const loudnessOverride = this.latestOverride(this.miniappLoudnessGateOverrides);
|
|
186
|
+
// Hardware VAD suppresses silence. Raw-audio consumers need a continuous
|
|
187
|
+
// timeline, so their requirement wins over both OS and miniapp VAD values.
|
|
188
|
+
if (this.localWantsPcm)
|
|
189
|
+
patch.voice_activity_detection_enabled = false;
|
|
190
|
+
else if (vadOverride)
|
|
191
|
+
patch.voice_activity_detection_enabled = vadOverride.enabled;
|
|
192
|
+
else if (this.configuredVad !== undefined)
|
|
193
|
+
patch.voice_activity_detection_enabled = this.configuredVad;
|
|
194
|
+
if (loudnessOverride)
|
|
195
|
+
patch.loudness_gate_enabled = loudnessOverride.enabled;
|
|
196
|
+
else if (this.configuredLoudnessGate !== undefined) {
|
|
197
|
+
patch.loudness_gate_enabled = this.configuredLoudnessGate;
|
|
198
|
+
}
|
|
199
|
+
return patch;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Reset all requirements to off. Called during cleanup.
|
|
203
|
+
*/
|
|
204
|
+
reset() {
|
|
205
|
+
this.localWantsPcm = false;
|
|
206
|
+
this.localWantsLc3 = false;
|
|
207
|
+
this.applyUnion();
|
|
208
|
+
}
|
|
209
|
+
cleanup() {
|
|
210
|
+
console.log(`${LOG_TAG}: cleanup()`);
|
|
211
|
+
this.miniappVadOverrides.clear();
|
|
212
|
+
this.miniappLoudnessGateOverrides.clear();
|
|
213
|
+
this.reset();
|
|
214
|
+
MicStateCoordinator.instance = null;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
const micStateCoordinator = MicStateCoordinator.getInstance();
|
|
218
|
+
export default micStateCoordinator;
|
|
219
|
+
//# sourceMappingURL=MicStateCoordinator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MicStateCoordinator.js","sourceRoot":"","sources":["../../src/services/MicSt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AAa,GAAG,KAAK,CAAA;QAC1B,IAAI,CAAC,aAAa,GAAG,KAAK,CAAA;QAC1B,IAAI,CAAC,UAAU,EAAE,CAAA;IACnB,CAAC;IAEM,OAAO;QACZ,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,aAAa,CAAC,CAAA;QACpC,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,CAAA;QAChC,IAAI,CAAC,4BAA4B,CAAC,KAAK,EAAE,CAAA;QACzC,IAAI,CAAC,KAAK,EAAE,CAAA;QACZ,mBAAmB,CAAC,QAAQ,GAAG,IAAI,CAAA;IACrC,CAAC;;AAGH,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,WAAW,EAAE,CAAA;AAC7D,eAAe,mBAAmB,CAAA","sourcesContent":["/**\n * MicStateCoordinator\n *\n * Owns local-miniapp-driven microphone requirements.\n *\n * Local miniapps subscribe to audio_chunk / transcription streams.\n * This coordinator pushes the aggregate local requirement set to BluetoothSdk\n * so the mic runs whenever at least one local consumer needs it.\n */\n\nimport BluetoothSdk from \"@glassly/bluetooth-sdk/internal\"\n\nimport {createDebouncedPatchFlusher} from \"../utils/debouncedPatch\"\n\nconst LOG_TAG = \"MIC_COORDINATOR\"\n\ntype MicGate = \"vad\" | \"loudnessGate\"\n\ninterface GateOverride {\n enabled: boolean\n order: number\n}\n\ninterface ConfiguredMicGates {\n vadEnabled?: boolean | null\n loudnessGateEnabled?: boolean | null\n}\n\n/** Mic-requirement flips are debounced (300ms) and merged into one BLE write\n * (wire v2 keeps BLE JSON small and infrequent). */\nconst flushMicRequirementsPatch = createDebouncedPatchFlusher<Record<string, unknown>>((patch) => {\n try {\n // Resolve runtime overrides at flush time. A miniapp can acquire/release a\n // gate override during the debounce window, and a captured stale value\n // must not win after that lifecycle transition.\n const runtimePatch = micStateCoordinator.applyEffectiveGatePolicy(patch)\n void Promise.resolve(BluetoothSdk.updateBluetoothSettings(runtimePatch)).catch((err) => {\n console.error(`${LOG_TAG}: failed to apply mic requirements:`, err)\n })\n } catch (err) {\n console.error(`${LOG_TAG}: failed to apply mic requirements:`, err)\n }\n}, 300)\n\nclass MicStateCoordinator {\n private static instance: MicStateCoordinator | null = null\n\n // Local miniapp requirements (set when miniapps subscribe to audio streams)\n private localWantsPcm = false\n private localWantsLc3 = false\n private configuredVad: boolean | undefined\n private configuredLoudnessGate: boolean | undefined\n private readonly miniappVadOverrides = new Map<string, GateOverride>()\n private readonly miniappLoudnessGateOverrides = new Map<string, GateOverride>()\n private overrideSequence = 0\n\n private constructor() {}\n\n public static getInstance(): MicStateCoordinator {\n if (!MicStateCoordinator.instance) {\n MicStateCoordinator.instance = new MicStateCoordinator()\n }\n return MicStateCoordinator.instance\n }\n\n /**\n * Update local miniapp requirements. Called by LocalMiniappRuntime when\n * the aggregated set of local subscriptions changes.\n */\n public setLocalRequirements(req: {pcm: boolean; lc3: boolean} & ConfiguredMicGates): void {\n this.localWantsPcm = req.pcm\n this.localWantsLc3 = req.lc3\n this.rememberConfiguredGates(req)\n console.log(`${LOG_TAG}: local requirements updated — pcm=${req.pcm} lc3=${req.lc3}`)\n this.applyUnion()\n }\n\n /**\n * Apply a miniapp-owned gate override without changing the OS preference.\n * Overrides are lifecycle-scoped and last-live-owner-wins independently for\n * VAD and Barrier.\n */\n public async setMiniappGateOverride(\n packageName: string,\n gate: MicGate,\n enabled: boolean,\n configured: ConfiguredMicGates = {},\n ): Promise<void> {\n this.rememberConfiguredGates(configured)\n const overrides = this.overridesFor(gate)\n const previous = overrides.get(packageName)\n const next = {enabled, order: ++this.overrideSequence}\n overrides.set(packageName, next)\n\n try {\n await BluetoothSdk.updateBluetoothSettings(this.effectiveGatePatch())\n } catch (error) {\n // Do not roll back a newer request from the same package that landed\n // while this native write was in flight.\n if (overrides.get(packageName) === next) {\n if (previous) overrides.set(packageName, previous)\n else overrides.delete(packageName)\n }\n throw error\n }\n }\n\n /**\n * Remove every gate override owned by a miniapp. This is synchronous so\n * unregister can drop ownership before recomputing aggregate mic state.\n */\n public clearMiniappGateOverrides(packageName: string): boolean {\n const removedVad = this.miniappVadOverrides.delete(packageName)\n const removedLoudness = this.miniappLoudnessGateOverrides.delete(packageName)\n return removedVad || removedLoudness\n }\n\n /** Re-apply the current runtime policy after an owner is released. */\n public async syncEffectiveGatePolicy(configured: ConfiguredMicGates = {}): Promise<void> {\n this.rememberConfiguredGates(configured)\n const patch = this.effectiveGatePatch()\n if (Object.keys(patch).length === 0) return\n await BluetoothSdk.updateBluetoothSettings(patch)\n }\n\n /**\n * Preserve the runtime microphone contract when the persisted device\n * settings are replayed (for example after a glasses reconnect). Active\n * miniapp gate overrides replace the OS values, and raw PCM keeps VAD off\n * until the last raw-audio consumer unsubscribes.\n */\n public applyRuntimeOverrides(settings: Record<string, unknown>): Record<string, unknown> {\n this.rememberConfiguredGates({\n vadEnabled:\n typeof settings.voice_activity_detection_enabled === \"boolean\"\n ? settings.voice_activity_detection_enabled\n : undefined,\n loudnessGateEnabled:\n typeof settings.loudness_gate_enabled === \"boolean\" ? settings.loudness_gate_enabled : undefined,\n })\n\n return this.applyActiveRuntimeOverrides(settings)\n }\n\n /**\n * Apply the complete current gate policy without treating the input as an OS\n * preference update. Used by debounced mic-requirement writes, whose queued\n * gate values may be stale after an override is acquired or released.\n */\n public applyEffectiveGatePolicy(settings: Record<string, unknown>): Record<string, unknown> {\n return {\n ...settings,\n ...this.effectiveGatePatch(),\n }\n }\n\n private applyActiveRuntimeOverrides(settings: Record<string, unknown>): Record<string, unknown> {\n const runtimeSettings = {...settings}\n const vadOverride = this.latestOverride(this.miniappVadOverrides)\n const loudnessOverride = this.latestOverride(this.miniappLoudnessGateOverrides)\n\n if (this.localWantsPcm) {\n runtimeSettings.voice_activity_detection_enabled = false\n } else if (vadOverride) {\n runtimeSettings.voice_activity_detection_enabled = vadOverride.enabled\n }\n if (loudnessOverride) {\n runtimeSettings.loudness_gate_enabled = loudnessOverride.enabled\n }\n\n return runtimeSettings\n }\n\n /**\n * Push local requirements to BluetoothSdk. `should_send_pcm` is strictly for\n * on-device PCM consumers; cloud audio uses LC3 through AudioCloudUplink.\n */\n private applyUnion(): void {\n const shouldSendPcm = this.localWantsPcm\n const shouldSendLc3 = this.localWantsLc3\n\n // console.log(\n // `${LOG_TAG}: applying requirements — pcm=${shouldSendPcm} lc3=${shouldSendLc3}`,\n // )\n\n // The mic control plane is a direct btsdk call now (was a host setMicRequirements\n // hook) so a bare OEM streams audio without wiring it.\n const patch: Record<string, unknown> = {\n should_send_pcm: shouldSendPcm,\n should_send_lc3: shouldSendLc3,\n should_send_transcript: false,\n ...this.effectiveGatePatch(),\n }\n\n flushMicRequirementsPatch(patch)\n }\n\n private rememberConfiguredGates(configured: ConfiguredMicGates): void {\n // null means the connected device intentionally omits that setting.\n // undefined means the caller is not updating the remembered preference.\n if (configured.vadEnabled !== undefined) {\n this.configuredVad = configured.vadEnabled ?? undefined\n }\n if (configured.loudnessGateEnabled !== undefined) {\n this.configuredLoudnessGate = configured.loudnessGateEnabled ?? undefined\n }\n }\n\n private overridesFor(gate: MicGate): Map<string, GateOverride> {\n return gate === \"vad\" ? this.miniappVadOverrides : this.miniappLoudnessGateOverrides\n }\n\n private latestOverride(overrides: Map<string, GateOverride>): GateOverride | undefined {\n let latest: GateOverride | undefined\n for (const entry of overrides.values()) {\n if (!latest || entry.order > latest.order) latest = entry\n }\n return latest\n }\n\n private effectiveGatePatch(): Record<string, unknown> {\n const patch: Record<string, unknown> = {}\n const vadOverride = this.latestOverride(this.miniappVadOverrides)\n const loudnessOverride = this.latestOverride(this.miniappLoudnessGateOverrides)\n\n // Hardware VAD suppresses silence. Raw-audio consumers need a continuous\n // timeline, so their requirement wins over both OS and miniapp VAD values.\n if (this.localWantsPcm) patch.voice_activity_detection_enabled = false\n else if (vadOverride) patch.voice_activity_detection_enabled = vadOverride.enabled\n else if (this.configuredVad !== undefined) patch.voice_activity_detection_enabled = this.configuredVad\n\n if (loudnessOverride) patch.loudness_gate_enabled = loudnessOverride.enabled\n else if (this.configuredLoudnessGate !== undefined) {\n patch.loudness_gate_enabled = this.configuredLoudnessGate\n }\n\n return patch\n }\n\n /**\n * Reset all requirements to off. Called during cleanup.\n */\n public reset(): void {\n this.localWantsPcm = false\n this.localWantsLc3 = false\n this.applyUnion()\n }\n\n public cleanup(): void {\n console.log(`${LOG_TAG}: cleanup()`)\n this.miniappVadOverrides.clear()\n this.miniappLoudnessGateOverrides.clear()\n this.reset()\n MicStateCoordinator.instance = null\n }\n}\n\nconst micStateCoordinator = MicStateCoordinator.getInstance()\nexport default micStateCoordinator\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MiniappEngine — constructs the GlasslyJS router singletons (crash controller,
|
|
3
|
+
* UI router, JS router), binds them to the native Crust module + the launcher,
|
|
4
|
+
* wires the dev-server background-respawn signal, and starts the message pump.
|
|
5
|
+
*
|
|
6
|
+
* Engine owns this so a bare OEM's `engine.start()` brings up the local-miniapp
|
|
7
|
+
* engine with no host construction step. Host-only concerns that remain outside
|
|
8
|
+
* engine, such as Glassly-app crashloop telemetry, are attached by the host after
|
|
9
|
+
* this returns via `router.onCrashloop` / `router.onRestartToast`.
|
|
10
|
+
*
|
|
11
|
+
* Idempotent — `ensureMiniappEngine()` returns the same singletons on every call,
|
|
12
|
+
* so it's safe to call from both `engine.start()` and the host bootstrap.
|
|
13
|
+
*/
|
|
14
|
+
import { JSCrashController } from "./JSCrashController";
|
|
15
|
+
import { JSRouter } from "./JSRouter";
|
|
16
|
+
import { UIRouter } from "./UIRouter";
|
|
17
|
+
export interface MiniappEngine {
|
|
18
|
+
router: JSRouter;
|
|
19
|
+
uiRouter: UIRouter;
|
|
20
|
+
crashController: JSCrashController;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Construct (once) and return the GlasslyJS engine singletons. Starts the router's
|
|
24
|
+
* message pump on first call. Subsequent calls return the same instances.
|
|
25
|
+
*/
|
|
26
|
+
export declare function ensureMiniappEngine(): MiniappEngine;
|
|
27
|
+
/** Stop the GlasslyJS message pump and tear down router-managed JSContexts. */
|
|
28
|
+
export declare function stopMiniappEngine(): Promise<void>;
|
|
29
|
+
/** Returns the engine singletons if already constructed, else null. */
|
|
30
|
+
export declare function getMiniappEngine(): MiniappEngine | null;
|
|
31
|
+
//# sourceMappingURL=MiniappEngine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MiniappEngine.d.ts","sourceRoot":"","sources":["../../src/services/MiniappEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAOH,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAC,QAAQ,EAAsB,MAAM,YAAY,CAAA;AACxD,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AAEnC,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,QAAQ,CAAA;IAChB,QAAQ,EAAE,QAAQ,CAAA;IAClB,eAAe,EAAE,iBAAiB,CAAA;CACnC;AAwCD;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,aAAa,CAyCnD;AAED,+EAA+E;AAC/E,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAsBvD;AAED,uEAAuE;AACvE,wBAAgB,gBAAgB,IAAI,aAAa,GAAG,IAAI,CAEvD"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MiniappEngine — constructs the GlasslyJS router singletons (crash controller,
|
|
3
|
+
* UI router, JS router), binds them to the native Crust module + the launcher,
|
|
4
|
+
* wires the dev-server background-respawn signal, and starts the message pump.
|
|
5
|
+
*
|
|
6
|
+
* Engine owns this so a bare OEM's `engine.start()` brings up the local-miniapp
|
|
7
|
+
* engine with no host construction step. Host-only concerns that remain outside
|
|
8
|
+
* engine, such as Glassly-app crashloop telemetry, are attached by the host after
|
|
9
|
+
* this returns via `router.onCrashloop` / `router.onRestartToast`.
|
|
10
|
+
*
|
|
11
|
+
* Idempotent — `ensureMiniappEngine()` returns the same singletons on every call,
|
|
12
|
+
* so it's safe to call from both `engine.start()` and the host bootstrap.
|
|
13
|
+
*/
|
|
14
|
+
import CrustModule from "@glassly/crust";
|
|
15
|
+
import devServerBridge from "./DevServerBridge";
|
|
16
|
+
import localMiniappRuntime from "./LocalMiniappRuntime";
|
|
17
|
+
import { miniappLauncher } from "./MiniappLauncher";
|
|
18
|
+
import { JSCrashController } from "./JSCrashController";
|
|
19
|
+
import { JSRouter } from "./JSRouter";
|
|
20
|
+
import { UIRouter } from "./UIRouter";
|
|
21
|
+
let engine = null;
|
|
22
|
+
function wireDevServerRespawnBackground(router, uiRouter) {
|
|
23
|
+
devServerBridge.onRespawnBackground(async (packageName) => {
|
|
24
|
+
try {
|
|
25
|
+
// Re-resolve the freshly built bundle (dev: HTTP off the dev server;
|
|
26
|
+
// released: file:// snapshot) via the launcher's shared recipe. Carries
|
|
27
|
+
// the declared permissions + manifest across the respawn — omitting them
|
|
28
|
+
// would respawn the JSContext with no permissions, so SUBSCRIBE gates and
|
|
29
|
+
// per-call dispatch checks would start rejecting after a background
|
|
30
|
+
// hot-reload.
|
|
31
|
+
const resolved = await miniappLauncher.resolveBundle(packageName);
|
|
32
|
+
if (!resolved) {
|
|
33
|
+
console.warn(`GlasslyJS: respawn-bg could not resolve bundle for ${packageName}`);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
// Force a respawn (kill + spawn) rather than launcher.ensureRunning,
|
|
37
|
+
// which is idempotent and would no-op an already-registered context.
|
|
38
|
+
await router.unregister(packageName);
|
|
39
|
+
const ok = await router.spawnAndRegister(packageName, resolved.bgSource, {
|
|
40
|
+
permissions: resolved.declaredPermissions,
|
|
41
|
+
installedManifest: resolved.installedManifest,
|
|
42
|
+
});
|
|
43
|
+
if (!ok) {
|
|
44
|
+
console.warn(`GlasslyJS: respawn-bg failed for ${packageName}`);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
// The respawned JSContext is a fresh MiniappSession with ui.bound false.
|
|
48
|
+
// The mounted WebView won't re-fire glassly.ready() (it's latched), so
|
|
49
|
+
// re-announce it so RPC replies (glassly.request) reach the UI again
|
|
50
|
+
// instead of being dropped while unbound.
|
|
51
|
+
uiRouter.notifyReopen(packageName);
|
|
52
|
+
}
|
|
53
|
+
catch (e) {
|
|
54
|
+
console.warn(`GlasslyJS: respawn-bg threw for ${packageName}:`, e);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Construct (once) and return the GlasslyJS engine singletons. Starts the router's
|
|
60
|
+
* message pump on first call. Subsequent calls return the same instances.
|
|
61
|
+
*/
|
|
62
|
+
export function ensureMiniappEngine() {
|
|
63
|
+
if (engine) {
|
|
64
|
+
wireDevServerRespawnBackground(engine.router, engine.uiRouter);
|
|
65
|
+
engine.router.start();
|
|
66
|
+
return engine;
|
|
67
|
+
}
|
|
68
|
+
// The Crust native module's published TS typing doesn't include the new
|
|
69
|
+
// js* functions until expo prebuild regenerates it; cast to the binding
|
|
70
|
+
// shapes the routers expect.
|
|
71
|
+
const crust = CrustModule;
|
|
72
|
+
const crashController = new JSCrashController({
|
|
73
|
+
maxRetries: 3,
|
|
74
|
+
});
|
|
75
|
+
const uiRouter = new UIRouter({
|
|
76
|
+
jsDispatchToJs: (packageName, envelope) => CrustModule.jsDispatchToJs(packageName, envelope),
|
|
77
|
+
});
|
|
78
|
+
const router = new JSRouter(localMiniappRuntime, crust);
|
|
79
|
+
router.crashController = crashController;
|
|
80
|
+
router.uiRouter = uiRouter;
|
|
81
|
+
// Hand the router to the engine MiniappLauncher so headless launch/teardown
|
|
82
|
+
// (apps.ts start/stop, the action broker, the WebView mount path) all spawn
|
|
83
|
+
// through one place.
|
|
84
|
+
miniappLauncher.configure({ router });
|
|
85
|
+
// Wire up the dev server's "respawn-bg" signal so a touch under
|
|
86
|
+
// src/background/ kills + re-spawns the JSContext with the latest bundle.
|
|
87
|
+
// The WebView reload path stays separate (devServerBridge.onReload).
|
|
88
|
+
wireDevServerRespawnBackground(router, uiRouter);
|
|
89
|
+
router.start();
|
|
90
|
+
engine = { router, uiRouter, crashController };
|
|
91
|
+
return engine;
|
|
92
|
+
}
|
|
93
|
+
/** Stop the GlasslyJS message pump and tear down router-managed JSContexts. */
|
|
94
|
+
export async function stopMiniappEngine() {
|
|
95
|
+
const current = engine;
|
|
96
|
+
if (!current)
|
|
97
|
+
return;
|
|
98
|
+
// Null the singleton BEFORE the async teardown below: a concurrent
|
|
99
|
+
// ensureMiniappEngine() must construct fresh instead of re-starting (and
|
|
100
|
+
// re-subscribing) the router that is mid-teardown, which would leak a zombie
|
|
101
|
+
// Crust subscription once this function finishes.
|
|
102
|
+
engine = null;
|
|
103
|
+
devServerBridge.clearRespawnBackgroundHandler();
|
|
104
|
+
current.router.stop();
|
|
105
|
+
const packages = current.router.registeredPackages();
|
|
106
|
+
await Promise.all(packages.map(async (packageName) => {
|
|
107
|
+
try {
|
|
108
|
+
await current.router.unregister(packageName);
|
|
109
|
+
}
|
|
110
|
+
catch (err) {
|
|
111
|
+
console.warn(`GlasslyJS: failed to unregister ${packageName} during stop:`, err);
|
|
112
|
+
}
|
|
113
|
+
}));
|
|
114
|
+
}
|
|
115
|
+
/** Returns the engine singletons if already constructed, else null. */
|
|
116
|
+
export function getMiniappEngine() {
|
|
117
|
+
return engine;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=MiniappEngine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MiniappEngine.js","sourceRoot":"","sources":["../../src/services/MiniappEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,WAAW,MAAM,gBAAgB,CAAA;AAExC,OAAO,eAAe,MAAM,mBAAmB,CAAA;AAC/C,OAAO,mBAAmB,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAA;AACjD,OAAO,EA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IACpB,mEAAmE;IACnE,yEAAyE;IACzE,6EAA6E;IAC7E,kDAAkD;IAClD,MAAM,GAAG,IAAI,CAAA;IAEb,eAAe,CAAC,6BAA6B,EAAE,CAAA;IAC/C,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAA;IAErB,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAA;IACpD,MAAM,OAAO,CAAC,GAAG,CACf,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE;QACjC,IAAI,CAAC;YACH,MAAM,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAA;QAC9C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,IAAI,CAAC,mCAAmC,WAAW,eAAe,EAAE,GAAG,CAAC,CAAA;QAClF,CAAC;IACH,CAAC,CAAC,CACH,CAAA;AACH,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,gBAAgB;IAC9B,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["/**\n * MiniappEngine — constructs the GlasslyJS router singletons (crash controller,\n * UI router, JS router), binds them to the native Crust module + the launcher,\n * wires the dev-server background-respawn signal, and starts the message pump.\n *\n * Engine owns this so a bare OEM's `engine.start()` brings up the local-miniapp\n * engine with no host construction step. Host-only concerns that remain outside\n * engine, such as Glassly-app crashloop telemetry, are attached by the host after\n * this returns via `router.onCrashloop` / `router.onRestartToast`.\n *\n * Idempotent — `ensureMiniappEngine()` returns the same singletons on every call,\n * so it's safe to call from both `engine.start()` and the host bootstrap.\n */\n\nimport CrustModule from \"@glassly/crust\"\n\nimport devServerBridge from \"./DevServerBridge\"\nimport localMiniappRuntime from \"./LocalMiniappRuntime\"\nimport {miniappLauncher} from \"./MiniappLauncher\"\nimport {JSCrashController} from \"./JSCrashController\"\nimport {JSRouter, type JSCrustBinding} from \"./JSRouter\"\nimport {UIRouter} from \"./UIRouter\"\n\nexport interface MiniappEngine {\n router: JSRouter\n uiRouter: UIRouter\n crashController: JSCrashController\n}\n\nlet engine: MiniappEngine | null = null\n\nfunction wireDevServerRespawnBackground(router: JSRouter, uiRouter: UIRouter): void {\n devServerBridge.onRespawnBackground(async (packageName) => {\n try {\n // Re-resolve the freshly built bundle (dev: HTTP off the dev server;\n // released: file:// snapshot) via the launcher's shared recipe. Carries\n // the declared permissions + manifest across the respawn — omitting them\n // would respawn the JSContext with no permissions, so SUBSCRIBE gates and\n // per-call dispatch checks would start rejecting after a background\n // hot-reload.\n const resolved = await miniappLauncher.resolveBundle(packageName)\n if (!resolved) {\n console.warn(`GlasslyJS: respawn-bg could not resolve bundle for ${packageName}`)\n return\n }\n // Force a respawn (kill + spawn) rather than launcher.ensureRunning,\n // which is idempotent and would no-op an already-registered context.\n await router.unregister(packageName)\n const ok = await router.spawnAndRegister(packageName, resolved.bgSource, {\n permissions: resolved.declaredPermissions,\n installedManifest: resolved.installedManifest,\n })\n if (!ok) {\n console.warn(`GlasslyJS: respawn-bg failed for ${packageName}`)\n return\n }\n // The respawned JSContext is a fresh MiniappSession with ui.bound false.\n // The mounted WebView won't re-fire glassly.ready() (it's latched), so\n // re-announce it so RPC replies (glassly.request) reach the UI again\n // instead of being dropped while unbound.\n uiRouter.notifyReopen(packageName)\n } catch (e) {\n console.warn(`GlasslyJS: respawn-bg threw for ${packageName}:`, e)\n }\n })\n}\n\n/**\n * Construct (once) and return the GlasslyJS engine singletons. Starts the router's\n * message pump on first call. Subsequent calls return the same instances.\n */\nexport function ensureMiniappEngine(): MiniappEngine {\n if (engine) {\n wireDevServerRespawnBackground(engine.router, engine.uiRouter)\n engine.router.start()\n return engine\n }\n\n // The Crust native module's published TS typing doesn't include the new\n // js* functions until expo prebuild regenerates it; cast to the binding\n // shapes the routers expect.\n const crust = CrustModule as unknown as JSCrustBinding\n\n const crashController = new JSCrashController({\n maxRetries: 3,\n })\n const uiRouter = new UIRouter({\n jsDispatchToJs: (packageName: string, envelope: Record<string, unknown>) =>\n (\n CrustModule as unknown as {\n jsDispatchToJs: (p: string, e: Record<string, unknown>) => Promise<void>\n }\n ).jsDispatchToJs(packageName, envelope),\n })\n const router = new JSRouter(localMiniappRuntime, crust)\n router.crashController = crashController\n router.uiRouter = uiRouter\n\n // Hand the router to the engine MiniappLauncher so headless launch/teardown\n // (apps.ts start/stop, the action broker, the WebView mount path) all spawn\n // through one place.\n miniappLauncher.configure({router})\n\n // Wire up the dev server's \"respawn-bg\" signal so a touch under\n // src/background/ kills + re-spawns the JSContext with the latest bundle.\n // The WebView reload path stays separate (devServerBridge.onReload).\n wireDevServerRespawnBackground(router, uiRouter)\n\n router.start()\n\n engine = {router, uiRouter, crashController}\n return engine\n}\n\n/** Stop the GlasslyJS message pump and tear down router-managed JSContexts. */\nexport async function stopMiniappEngine(): Promise<void> {\n const current = engine\n if (!current) return\n // Null the singleton BEFORE the async teardown below: a concurrent\n // ensureMiniappEngine() must construct fresh instead of re-starting (and\n // re-subscribing) the router that is mid-teardown, which would leak a zombie\n // Crust subscription once this function finishes.\n engine = null\n\n devServerBridge.clearRespawnBackgroundHandler()\n current.router.stop()\n\n const packages = current.router.registeredPackages()\n await Promise.all(\n packages.map(async (packageName) => {\n try {\n await current.router.unregister(packageName)\n } catch (err) {\n console.warn(`GlasslyJS: failed to unregister ${packageName} during stop:`, err)\n }\n }),\n )\n}\n\n/** Returns the engine singletons if already constructed, else null. */\nexport function getMiniappEngine(): MiniappEngine | null {\n return engine\n}\n"]}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MiniappLauncher — headless launch/teardown of a local miniapp's background
|
|
3
|
+
* JS context.
|
|
4
|
+
*
|
|
5
|
+
* This is the one piece of "run a miniapp" that used to live inside the
|
|
6
|
+
* `LocalMiniappView` React component (resolve the bundle → read the manifest →
|
|
7
|
+
* `spawnAndRegister`), triggered only when the Compositor mounted that
|
|
8
|
+
* component on foreground. Pulling it into the runtime means:
|
|
9
|
+
*
|
|
10
|
+
* - `start()` can actually spawn an app even when nothing foregrounds it
|
|
11
|
+
* (e.g. a system app launching another miniapp via `session.miniapps`).
|
|
12
|
+
* - the action broker can wake a stopped target headlessly — no UI at all.
|
|
13
|
+
* - the dev hot-reload respawn path and the WebView mount path share one
|
|
14
|
+
* resolve+spawn recipe instead of three copies.
|
|
15
|
+
*
|
|
16
|
+
* The launcher is **headless**: no React, no RN components. The engine-owned
|
|
17
|
+
* MiniappEngine hands it the {@link JSRouter} instance once during
|
|
18
|
+
* engine construction. OEMs embedding the runtime drive miniapp lifecycle
|
|
19
|
+
* through the engine facade and stores, not a separate launcher configure API.
|
|
20
|
+
*
|
|
21
|
+
* Boundary: the launcher owns the **background** context. WebView *rendering*
|
|
22
|
+
* (the UI layer) stays with the host — the launcher just hands back the
|
|
23
|
+
* resolved UI entry so the host can mount its `<WebView>`.
|
|
24
|
+
*/
|
|
25
|
+
import { type InstalledMiniappManifest } from "./LocalMiniappRuntime";
|
|
26
|
+
import type { JSRouter } from "./JSRouter";
|
|
27
|
+
interface LauncherDeps {
|
|
28
|
+
/** The host-constructed router (needs the native Crust binding). */
|
|
29
|
+
router: JSRouter;
|
|
30
|
+
}
|
|
31
|
+
/** Hints the host may pass from a view's props to avoid re-deriving them. */
|
|
32
|
+
export interface LaunchHints {
|
|
33
|
+
devUrl?: string;
|
|
34
|
+
version?: string;
|
|
35
|
+
devPort?: string;
|
|
36
|
+
}
|
|
37
|
+
/** Everything the launcher resolved for a package — bg source + UI entry. */
|
|
38
|
+
export interface ResolvedBundle {
|
|
39
|
+
bgSource: string;
|
|
40
|
+
uiUri: string | null;
|
|
41
|
+
uiBaseDir: string | null;
|
|
42
|
+
declaredPermissions: string[];
|
|
43
|
+
installedManifest?: InstalledMiniappManifest;
|
|
44
|
+
/** Set for dev miniapps (HTTP off the dev server); null for released. */
|
|
45
|
+
devUrl: string | null;
|
|
46
|
+
devPort: number | null;
|
|
47
|
+
}
|
|
48
|
+
/** What the host needs back to render the UI layer. */
|
|
49
|
+
export interface LaunchResult {
|
|
50
|
+
uiUri: string | null;
|
|
51
|
+
uiBaseDir: string | null;
|
|
52
|
+
}
|
|
53
|
+
declare class MiniappLauncher {
|
|
54
|
+
private deps;
|
|
55
|
+
/**
|
|
56
|
+
* In-flight launches keyed by packageName. Both apps.ts start() and the
|
|
57
|
+
* WebView mount call ensureRunning() before the first spawnAndRegister
|
|
58
|
+
* resolves — without this, neither sees the package in registeredPackages()
|
|
59
|
+
* yet and both spawn the same context (a clobber/double-spawn). Concurrent
|
|
60
|
+
* callers share the same promise.
|
|
61
|
+
*/
|
|
62
|
+
private readonly inFlight;
|
|
63
|
+
/** Wire the router in. Called once from MiniappEngine construction. */
|
|
64
|
+
configure(deps: LauncherDeps): void;
|
|
65
|
+
private requireRouter;
|
|
66
|
+
/** True iff the package's background JS context is currently spawned. */
|
|
67
|
+
isRunning(packageName: string): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Resolve the background JS source + UI entry + declared permissions for a
|
|
70
|
+
* package. Handles both dev (HTTP off the running dev server) and released
|
|
71
|
+
* (file:// from the installed snapshot). Reads disk/network/storage; does
|
|
72
|
+
* NOT spawn. Returns null when the bundle can't be resolved (dev server
|
|
73
|
+
* unreachable, missing entry, no installed version).
|
|
74
|
+
*/
|
|
75
|
+
resolveBundle(packageName: string, hints?: LaunchHints): Promise<ResolvedBundle | null>;
|
|
76
|
+
/**
|
|
77
|
+
* Ensure a miniapp's background JS context is spawned. Idempotent — if the
|
|
78
|
+
* context is already alive this is a no-op spawn-wise (it still resolves the
|
|
79
|
+
* UI entry so a re-mounting host gets its `<WebView>` source back).
|
|
80
|
+
*
|
|
81
|
+
* Resolves once the context is SPAWNED. It does NOT block on the context's
|
|
82
|
+
* CONNECT handshake — the host's WebView mount shouldn't wait on background
|
|
83
|
+
* JS. Callers that need the context to be connected and ready to receive
|
|
84
|
+
* messages (the action broker) follow up with
|
|
85
|
+
* {@link LocalMiniappRuntime.waitForConnect}.
|
|
86
|
+
*/
|
|
87
|
+
ensureRunning(packageName: string, hints?: LaunchHints): Promise<LaunchResult>;
|
|
88
|
+
/** Resolve the bundle and spawn the context. Serialized via {@link inFlight}. */
|
|
89
|
+
private spawn;
|
|
90
|
+
/**
|
|
91
|
+
* Re-spawn local miniapps that were running when the app was last killed.
|
|
92
|
+
*
|
|
93
|
+
* Miniapps run in the phone's own JS engine, so a host-process kill tears
|
|
94
|
+
* down their JSContext with nothing to resurrect them. Without this they
|
|
95
|
+
* would silently stay stopped on the next launch even though the user left
|
|
96
|
+
* them running.
|
|
97
|
+
*
|
|
98
|
+
* Each local miniapp persists its running flag to disk on start/stop
|
|
99
|
+
* (`saveLocalAppRunningState`, via the applet's `onStart`/`onStop`). We read
|
|
100
|
+
* those flags back and re-spawn the background context headlessly (no
|
|
101
|
+
* foreground, no navigation) — the spawn registers the package so the home
|
|
102
|
+
* tray/switcher project it as running, exactly as a normal start would. The
|
|
103
|
+
* WebView, if any, re-attaches lazily when the user opens the app.
|
|
104
|
+
*
|
|
105
|
+
* Idempotent and best-effort: skips already-spawned contexts, and clears the
|
|
106
|
+
* persisted flag for any app whose bundle can no longer be resolved
|
|
107
|
+
* (uninstalled, or dev server gone) so a dead entry doesn't retry every boot.
|
|
108
|
+
* Not compatibility-gated: a previously-running background app shouldn't be
|
|
109
|
+
* dropped just because glasses are momentarily disconnected at boot — it
|
|
110
|
+
* resumes when they reconnect, same as mid-session.
|
|
111
|
+
*/
|
|
112
|
+
autostartLocalMiniapps(): Promise<void>;
|
|
113
|
+
/**
|
|
114
|
+
* Ensure the context is running AND has completed its CONNECT handshake.
|
|
115
|
+
* Used by the action broker, which must not deliver to a context that hasn't
|
|
116
|
+
* come up yet. Throws on spawn failure or connect timeout.
|
|
117
|
+
*/
|
|
118
|
+
ensureConnected(packageName: string, connectTimeoutMs?: number, hints?: LaunchHints): Promise<void>;
|
|
119
|
+
/** Tear down a miniapp's background JS context. */
|
|
120
|
+
stop(packageName: string): Promise<void>;
|
|
121
|
+
private storedDevUrl;
|
|
122
|
+
/** resolveDevPort — moved verbatim from the old LocalMiniappView helper. */
|
|
123
|
+
private resolveDevPort;
|
|
124
|
+
}
|
|
125
|
+
export declare const miniappLauncher: MiniappLauncher;
|
|
126
|
+
export {};
|
|
127
|
+
//# sourceMappingURL=MiniappLauncher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MiniappLauncher.d.ts","sourceRoot":"","sources":["../../src/services/MiniappLauncher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAQH,OAA4B,EAAC,KAAK,wBAAwB,EAAC,MAAM,uBAAuB,CAAA;AACxF,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AAExC,UAAU,YAAY;IACpB,oEAAoE;IACpE,MAAM,EAAE,QAAQ,CAAA;CACjB;AAED,6EAA6E;AAC7E,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,6EAA6E;AAC7E,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,mBAAmB,EAAE,MAAM,EAAE,CAAA;IAC7B,iBAAiB,CAAC,EAAE,wBAAwB,CAAA;IAC5C,yEAAyE;IACzE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CACvB;AAED,uDAAuD;AACvD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,cAAM,eAAe;IACnB,OAAO,CAAC,IAAI,CAA4B;IAExC;;;;;;OAMG;I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