@mentra/engine 0.1.0-beta.0 → 0.1.0-dev.1
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 +42 -1
- package/build/engine.d.ts +11 -3
- package/build/engine.d.ts.map +1 -1
- package/build/engine.js +7 -2
- package/build/engine.js.map +1 -1
- package/build/facades/dev.d.ts.map +1 -1
- package/build/facades/dev.js +9 -5
- package/build/facades/dev.js.map +1 -1
- package/build/facades/gallery.js +1 -1
- package/build/facades/gallery.js.map +1 -1
- package/build/facades/glasses.d.ts +1 -0
- package/build/facades/glasses.d.ts.map +1 -1
- package/build/facades/glasses.js +19 -4
- package/build/facades/glasses.js.map +1 -1
- package/build/facades/glassesSettings.d.ts.map +1 -1
- package/build/facades/glassesSettings.js +1 -0
- package/build/facades/glassesSettings.js.map +1 -1
- package/build/facades/miniapps.d.ts +4 -0
- package/build/facades/miniapps.d.ts.map +1 -1
- package/build/facades/miniapps.js +5 -0
- package/build/facades/miniapps.js.map +1 -1
- package/build/facades/ota.d.ts +11 -2
- package/build/facades/ota.d.ts.map +1 -1
- package/build/facades/ota.js +19 -4
- package/build/facades/ota.js.map +1 -1
- package/build/facades/pairing.d.ts +4 -0
- package/build/facades/pairing.d.ts.map +1 -1
- package/build/facades/pairing.js +10 -8
- package/build/facades/pairing.js.map +1 -1
- package/build/facades/phoneNotifications.d.ts +0 -4
- package/build/facades/phoneNotifications.d.ts.map +1 -1
- package/build/facades/phoneNotifications.js +4 -14
- package/build/facades/phoneNotifications.js.map +1 -1
- package/build/index.d.ts +6 -3
- package/build/index.d.ts.map +1 -1
- package/build/index.js +4 -2
- package/build/index.js.map +1 -1
- package/build/internal.d.ts +2 -2
- package/build/internal.d.ts.map +1 -1
- package/build/internal.js +1 -1
- package/build/internal.js.map +1 -1
- package/build/react/MentraLiveOtaFlow.d.ts +38 -0
- package/build/react/MentraLiveOtaFlow.d.ts.map +1 -0
- package/build/react/MentraLiveOtaFlow.js +528 -0
- package/build/react/MentraLiveOtaFlow.js.map +1 -0
- package/build/react/index.d.ts +2 -0
- package/build/react/index.d.ts.map +1 -0
- package/build/react/index.js +2 -0
- package/build/react/index.js.map +1 -0
- package/build/react/useEngineSnapshot.d.ts +2 -0
- package/build/react/useEngineSnapshot.d.ts.map +1 -0
- package/build/react/useEngineSnapshot.js +14 -0
- package/build/react/useEngineSnapshot.js.map +1 -0
- package/build/runtime/bootstrap.d.ts +24 -1
- package/build/runtime/bootstrap.d.ts.map +1 -1
- package/build/runtime/bootstrap.js +17 -0
- package/build/runtime/bootstrap.js.map +1 -1
- package/build/runtime/scanQrSeam.d.ts +7 -0
- package/build/runtime/scanQrSeam.d.ts.map +1 -0
- package/build/runtime/scanQrSeam.js +16 -0
- package/build/runtime/scanQrSeam.js.map +1 -0
- package/build/services/AppRegistry.d.ts +18 -8
- package/build/services/AppRegistry.d.ts.map +1 -1
- package/build/services/AppRegistry.js +44 -45
- package/build/services/AppRegistry.js.map +1 -1
- package/build/services/AudioCloudUplink.d.ts +9 -3
- package/build/services/AudioCloudUplink.d.ts.map +1 -1
- package/build/services/AudioCloudUplink.js +9 -3
- package/build/services/AudioCloudUplink.js.map +1 -1
- package/build/services/AudioPlaybackService.d.ts +9 -1
- package/build/services/AudioPlaybackService.d.ts.map +1 -1
- package/build/services/AudioPlaybackService.js +77 -32
- package/build/services/AudioPlaybackService.js.map +1 -1
- package/build/services/BlobStore.d.ts +2 -1
- package/build/services/BlobStore.d.ts.map +1 -1
- package/build/services/BlobStore.js +17 -9
- package/build/services/BlobStore.js.map +1 -1
- package/build/services/CloudAudioSubscriptionSync.d.ts.map +1 -1
- package/build/services/CloudAudioSubscriptionSync.js +13 -1
- package/build/services/CloudAudioSubscriptionSync.js.map +1 -1
- package/build/services/CloudClientService.d.ts +15 -0
- package/build/services/CloudClientService.d.ts.map +1 -1
- package/build/services/CloudClientService.js +75 -0
- package/build/services/CloudClientService.js.map +1 -1
- package/build/services/ForegroundLocationPermission.d.ts +13 -0
- package/build/services/ForegroundLocationPermission.d.ts.map +1 -0
- package/build/services/ForegroundLocationPermission.js +12 -0
- package/build/services/ForegroundLocationPermission.js.map +1 -0
- package/build/services/GlassesSettingsSync.d.ts.map +1 -1
- package/build/services/GlassesSettingsSync.js +9 -3
- package/build/services/GlassesSettingsSync.js.map +1 -1
- package/build/services/GlassesStatusProjection.d.ts +2 -1
- package/build/services/GlassesStatusProjection.d.ts.map +1 -1
- package/build/services/GlassesStatusProjection.js +15 -8
- package/build/services/GlassesStatusProjection.js.map +1 -1
- package/build/services/HotspotOtaTransport.d.ts +29 -0
- package/build/services/HotspotOtaTransport.d.ts.map +1 -0
- package/build/services/HotspotOtaTransport.js +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/LocalDisplayManager.d.ts +15 -0
- package/build/services/LocalDisplayManager.d.ts.map +1 -1
- package/build/services/LocalDisplayManager.js +106 -20
- package/build/services/LocalDisplayManager.js.map +1 -1
- package/build/services/LocalMiniappRuntime.d.ts +67 -1
- package/build/services/LocalMiniappRuntime.d.ts.map +1 -1
- package/build/services/LocalMiniappRuntime.js +486 -126
- package/build/services/LocalMiniappRuntime.js.map +1 -1
- package/build/services/LocalMiniappStorage.d.ts +32 -0
- package/build/services/LocalMiniappStorage.d.ts.map +1 -0
- package/build/services/LocalMiniappStorage.js +66 -0
- package/build/services/LocalMiniappStorage.js.map +1 -0
- package/build/services/LocalMiniappUserIdentity.d.ts +20 -0
- package/build/services/LocalMiniappUserIdentity.d.ts.map +1 -0
- package/build/services/LocalMiniappUserIdentity.js +43 -0
- package/build/services/LocalMiniappUserIdentity.js.map +1 -0
- package/build/services/MicStateCoordinator.d.ts +42 -1
- package/build/services/MicStateCoordinator.d.ts.map +1 -1
- package/build/services/MicStateCoordinator.js +141 -3
- package/build/services/MicStateCoordinator.js.map +1 -1
- package/build/services/MiniappLauncher.d.ts.map +1 -1
- package/build/services/MiniappLauncher.js +23 -3
- package/build/services/MiniappLauncher.js.map +1 -1
- package/build/services/MiniappLiveness.d.ts +12 -0
- package/build/services/MiniappLiveness.d.ts.map +1 -0
- package/build/services/MiniappLiveness.js +16 -0
- package/build/services/MiniappLiveness.js.map +1 -0
- package/build/services/OtaArtifactDownloader.d.ts +65 -0
- package/build/services/OtaArtifactDownloader.d.ts.map +1 -0
- package/build/services/OtaArtifactDownloader.js +226 -0
- package/build/services/OtaArtifactDownloader.js.map +1 -0
- package/build/services/OtaAutoChain.d.ts +34 -0
- package/build/services/OtaAutoChain.d.ts.map +1 -0
- package/build/services/OtaAutoChain.js +83 -0
- package/build/services/OtaAutoChain.js.map +1 -0
- package/build/services/OtaErrorMapping.d.ts +18 -0
- package/build/services/OtaErrorMapping.d.ts.map +1 -0
- package/build/services/OtaErrorMapping.js +63 -0
- package/build/services/OtaErrorMapping.js.map +1 -0
- package/build/services/OtaInstallCoordinator.d.ts +94 -14
- package/build/services/OtaInstallCoordinator.d.ts.map +1 -1
- package/build/services/OtaInstallCoordinator.js +574 -130
- package/build/services/OtaInstallCoordinator.js.map +1 -1
- package/build/services/OtaService.d.ts.map +1 -1
- package/build/services/OtaService.js +8 -1
- package/build/services/OtaService.js.map +1 -1
- package/build/services/OtaUpdateCheckService.d.ts +38 -3
- package/build/services/OtaUpdateCheckService.d.ts.map +1 -1
- package/build/services/OtaUpdateCheckService.js +142 -22
- package/build/services/OtaUpdateCheckService.js.map +1 -1
- package/build/services/PhoneCalendarService.d.ts.map +1 -1
- package/build/services/PhoneCalendarService.js +22 -1
- package/build/services/PhoneCalendarService.js.map +1 -1
- package/build/services/PhoneCameraFovCoordinator.d.ts +2 -0
- package/build/services/PhoneCameraFovCoordinator.d.ts.map +1 -1
- package/build/services/PhoneCameraFovCoordinator.js +14 -0
- package/build/services/PhoneCameraFovCoordinator.js.map +1 -1
- package/build/services/PhoneNotificationsSync.d.ts.map +1 -1
- package/build/services/PhoneNotificationsSync.js +12 -10
- package/build/services/PhoneNotificationsSync.js.map +1 -1
- package/build/services/PhonePhotoCoordinator.d.ts +10 -3
- package/build/services/PhonePhotoCoordinator.d.ts.map +1 -1
- package/build/services/PhonePhotoCoordinator.js +21 -3
- package/build/services/PhonePhotoCoordinator.js.map +1 -1
- package/build/services/PhoneStreamCoordinator.d.ts +8 -1
- package/build/services/PhoneStreamCoordinator.d.ts.map +1 -1
- package/build/services/PhoneStreamCoordinator.js +125 -13
- package/build/services/PhoneStreamCoordinator.js.map +1 -1
- package/build/services/PhoneVideoCoordinator.d.ts +2 -0
- package/build/services/PhoneVideoCoordinator.d.ts.map +1 -1
- package/build/services/PhoneVideoCoordinator.js +10 -0
- package/build/services/PhoneVideoCoordinator.js.map +1 -1
- package/build/services/SceneRenderer.d.ts.map +1 -1
- package/build/services/SceneRenderer.js +15 -0
- package/build/services/SceneRenderer.js.map +1 -1
- package/build/services/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/TtsTextSanitizer.d.ts +5 -0
- package/build/services/TtsTextSanitizer.d.ts.map +1 -0
- package/build/services/TtsTextSanitizer.js +61 -0
- package/build/services/TtsTextSanitizer.js.map +1 -0
- package/build/services/WifiAdbRequest.d.ts +17 -0
- package/build/services/WifiAdbRequest.d.ts.map +1 -0
- package/build/services/WifiAdbRequest.js +35 -0
- package/build/services/WifiAdbRequest.js.map +1 -0
- package/build/services/asg/asgCameraApi.d.ts +3 -0
- package/build/services/asg/asgCameraApi.d.ts.map +1 -1
- package/build/services/asg/asgCameraApi.js +72 -2
- package/build/services/asg/asgCameraApi.js.map +1 -1
- package/build/services/asg/gallerySyncService.d.ts.map +1 -1
- package/build/services/asg/gallerySyncService.js +26 -14
- package/build/services/asg/gallerySyncService.js.map +1 -1
- package/build/services/asg/localNetworkTransport.d.ts +2 -2
- package/build/services/asg/localNetworkTransport.d.ts.map +1 -1
- package/build/services/asg/localNetworkTransport.js +6 -6
- package/build/services/asg/localNetworkTransport.js.map +1 -1
- package/build/services/audioPlaybackAssets.d.ts +8 -0
- package/build/services/audioPlaybackAssets.d.ts.map +1 -0
- package/build/services/audioPlaybackAssets.js +7 -0
- package/build/services/audioPlaybackAssets.js.map +1 -0
- package/build/services/glassesClockSync.js +2 -2
- package/build/services/glassesClockSync.js.map +1 -1
- package/build/services/manifestActions.d.ts +7 -0
- package/build/services/manifestActions.d.ts.map +1 -0
- package/build/services/manifestActions.js +25 -0
- package/build/services/manifestActions.js.map +1 -0
- package/build/services/otaDisplayState.d.ts +22 -11
- package/build/services/otaDisplayState.d.ts.map +1 -1
- package/build/services/otaDisplayState.js +36 -14
- package/build/services/otaDisplayState.js.map +1 -1
- package/build/services/otaInstallPolicy.d.ts +15 -3
- package/build/services/otaInstallPolicy.d.ts.map +1 -1
- package/build/services/otaInstallPolicy.js +24 -3
- package/build/services/otaInstallPolicy.js.map +1 -1
- package/build/services/otaManifestUrl.d.ts +2 -0
- package/build/services/otaManifestUrl.d.ts.map +1 -0
- package/build/services/{asgOtaVersionUrl.js → otaManifestUrl.js} +15 -5
- package/build/services/otaManifestUrl.js.map +1 -0
- package/build/services/slimStreamStatus.d.ts +11 -0
- package/build/services/slimStreamStatus.d.ts.map +1 -1
- package/build/services/slimStreamStatus.js +14 -4
- package/build/services/slimStreamStatus.js.map +1 -1
- package/build/stores/apps.d.ts.map +1 -1
- package/build/stores/apps.js +11 -0
- package/build/stores/apps.js.map +1 -1
- package/build/stores/bluetoothSettingKeys.d.ts.map +1 -1
- package/build/stores/bluetoothSettingKeys.js +2 -0
- package/build/stores/bluetoothSettingKeys.js.map +1 -1
- package/build/stores/gallerySync.d.ts +2 -0
- package/build/stores/gallerySync.d.ts.map +1 -1
- package/build/stores/gallerySync.js +2 -0
- package/build/stores/gallerySync.js.map +1 -1
- package/build/stores/glasses.d.ts.map +1 -1
- package/build/stores/glasses.js +3 -0
- package/build/stores/glasses.js.map +1 -1
- package/build/stores/settings.d.ts +17 -0
- package/build/stores/settings.d.ts.map +1 -1
- package/build/stores/settings.js +152 -19
- package/build/stores/settings.js.map +1 -1
- package/build/types/applet.d.ts +2 -0
- package/build/types/applet.d.ts.map +1 -1
- package/build/types/applet.js.map +1 -1
- package/build/types/enums.d.ts +1 -0
- package/build/types/enums.d.ts.map +1 -1
- package/build/types/enums.js +1 -0
- package/build/types/enums.js.map +1 -1
- package/build/types/hardware.d.ts +1 -0
- package/build/types/hardware.d.ts.map +1 -1
- package/build/types/hardware.js +14 -0
- package/build/types/hardware.js.map +1 -1
- package/build/utils/configuredDevHost.d.ts +6 -0
- package/build/utils/configuredDevHost.d.ts.map +1 -0
- package/build/utils/configuredDevHost.js +19 -0
- package/build/utils/configuredDevHost.js.map +1 -0
- package/build/utils/devMiniappLaunch.d.ts +19 -8
- package/build/utils/devMiniappLaunch.d.ts.map +1 -1
- package/build/utils/devMiniappLaunch.js +144 -21
- package/build/utils/devMiniappLaunch.js.map +1 -1
- package/build/utils/diagnosticContext.d.ts.map +1 -1
- package/build/utils/diagnosticContext.js +15 -17
- package/build/utils/diagnosticContext.js.map +1 -1
- package/build/utils/hardware/hardware.d.ts.map +1 -1
- package/build/utils/hardware/hardware.js +7 -3
- package/build/utils/hardware/hardware.js.map +1 -1
- package/build/utils/miniappDiagnostics.d.ts +64 -0
- package/build/utils/miniappDiagnostics.d.ts.map +1 -0
- package/build/utils/miniappDiagnostics.js +173 -0
- package/build/utils/miniappDiagnostics.js.map +1 -0
- package/build/utils/timers/timers.d.ts.map +1 -1
- package/build/utils/timers/timers.js +55 -18
- package/build/utils/timers/timers.js.map +1 -1
- package/package.json +27 -18
- package/src/assets/silence.wav +0 -0
- package/src/engine.ts +7 -2
- package/src/facades/dev.ts +9 -5
- package/src/facades/gallery.ts +1 -1
- package/src/facades/glasses.ts +17 -4
- package/src/facades/glassesSettings.ts +5 -0
- package/src/facades/miniapps.ts +7 -0
- package/src/facades/ota.ts +19 -4
- package/src/facades/pairing.ts +11 -7
- package/src/facades/phoneNotifications.ts +4 -13
- package/src/index.ts +26 -2
- package/src/internal.ts +2 -1
- package/src/react/MentraLiveOtaFlow.tsx +856 -0
- package/src/react/index.ts +7 -0
- package/src/react/useEngineSnapshot.ts +16 -0
- package/src/runtime/bootstrap.ts +33 -1
- package/src/runtime/scanQrSeam.ts +20 -0
- package/src/services/AppRegistry.ts +72 -48
- package/src/services/AudioCloudUplink.ts +9 -3
- package/src/services/AudioPlaybackService.ts +94 -34
- package/src/services/BlobStore.ts +22 -9
- package/src/services/CloudAudioSubscriptionSync.ts +13 -1
- package/src/services/CloudClientService.ts +74 -0
- package/src/services/ForegroundLocationPermission.ts +24 -0
- package/src/services/GlassesSettingsSync.ts +9 -3
- package/src/services/GlassesStatusProjection.ts +16 -8
- package/src/services/HotspotOtaTransport.ts +184 -0
- package/src/services/HotspotShutdown.ts +41 -0
- package/src/services/LocalDisplayManager.ts +112 -21
- package/src/services/LocalMiniappRuntime.ts +576 -130
- package/src/services/LocalMiniappStorage.ts +82 -0
- package/src/services/LocalMiniappUserIdentity.ts +46 -0
- package/src/services/MicStateCoordinator.ts +169 -4
- package/src/services/MiniappLauncher.ts +30 -3
- package/src/services/MiniappLiveness.ts +24 -0
- package/src/services/OtaArtifactDownloader.ts +312 -0
- package/src/services/OtaAutoChain.ts +106 -0
- package/src/services/OtaErrorMapping.ts +80 -0
- package/src/services/OtaInstallCoordinator.ts +645 -143
- package/src/services/OtaService.ts +11 -5
- package/src/services/OtaUpdateCheckService.ts +180 -20
- package/src/services/PhoneCalendarService.ts +27 -4
- package/src/services/PhoneCameraFovCoordinator.ts +15 -0
- package/src/services/PhoneNotificationsSync.ts +12 -10
- package/src/services/PhonePhotoCoordinator.ts +33 -7
- package/src/services/PhoneStreamCoordinator.ts +139 -25
- package/src/services/PhoneVideoCoordinator.ts +11 -0
- package/src/services/SceneRenderer.ts +16 -0
- package/src/services/SupportProfileSync.ts +218 -0
- package/src/services/TtsTextSanitizer.ts +66 -0
- package/src/services/WifiAdbRequest.ts +53 -0
- package/src/services/asg/asgCameraApi.ts +99 -8
- package/src/services/asg/gallerySyncService.ts +28 -19
- package/src/services/asg/localNetworkTransport.ts +7 -11
- package/src/services/audioPlaybackAssets.ts +8 -0
- package/src/services/glassesClockSync.ts +2 -2
- package/src/services/manifestActions.ts +30 -0
- package/src/services/otaDisplayState.ts +57 -16
- package/src/services/otaInstallPolicy.ts +29 -3
- package/src/services/{asgOtaVersionUrl.ts → otaManifestUrl.ts} +16 -4
- package/src/services/slimStreamStatus.ts +16 -5
- package/src/stores/apps.ts +12 -0
- package/src/stores/bluetoothSettingKeys.ts +2 -0
- package/src/stores/gallerySync.ts +4 -0
- package/src/stores/glasses.ts +3 -0
- package/src/stores/settings.ts +174 -21
- package/src/types/applet.ts +2 -0
- package/src/types/enums.ts +2 -1
- package/src/types/hardware.ts +17 -0
- package/src/utils/configuredDevHost.ts +17 -0
- package/src/utils/devMiniappLaunch.ts +151 -23
- package/src/utils/diagnosticContext.ts +17 -17
- package/src/utils/hardware/hardware.ts +7 -9
- package/src/utils/miniappDiagnostics.ts +226 -0
- package/src/utils/timers/timers.ts +57 -21
- package/build/services/asgOtaVersionUrl.d.ts +0 -2
- package/build/services/asgOtaVersionUrl.d.ts.map +0 -1
- package/build/services/asgOtaVersionUrl.js.map +0 -1
package/src/facades/miniapps.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* `<WebView>` wired to them. This facade is the lifecycle half.
|
|
10
10
|
*/
|
|
11
11
|
import {useAppStatusStore} from "../stores/apps"
|
|
12
|
+
import localMiniappRuntime from "../services/LocalMiniappRuntime"
|
|
12
13
|
import type {ClientApp} from "../types"
|
|
13
14
|
|
|
14
15
|
type AppsState = ReturnType<typeof useAppStatusStore.getState>
|
|
@@ -29,6 +30,12 @@ export const miniapps = {
|
|
|
29
30
|
})
|
|
30
31
|
},
|
|
31
32
|
|
|
33
|
+
/** Miniapps actively subscribed to Mentra Live hardware-button events. */
|
|
34
|
+
buttonPressSubscribers: (): string[] => localMiniappRuntime.getButtonPressSubscribers(),
|
|
35
|
+
/** Observe the active Mentra Live hardware-button subscriber set. */
|
|
36
|
+
onButtonPressSubscribersChanged: (cb: (packageNames: string[]) => void): (() => void) =>
|
|
37
|
+
localMiniappRuntime.onButtonPressSubscribersChanged(cb),
|
|
38
|
+
|
|
32
39
|
/** Re-fetch the installed-app list from the backend. */
|
|
33
40
|
refresh: () => useAppStatusStore.getState().refresh(),
|
|
34
41
|
/** Start (foreground) a miniapp. */
|
package/src/facades/ota.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ota facade — `engine.ota`: the OEM-facing OTA read/observe surface. Engine's
|
|
3
3
|
* OtaService projects the glasses' OTA BLE events into the engine store; this facade
|
|
4
|
-
* exposes the snapshot + change subscriptions the
|
|
5
|
-
*
|
|
4
|
+
* exposes the snapshot + change subscriptions behind the shared OTA flow exported by
|
|
5
|
+
* `@mentra/engine/ota`. Hosts retain only their surrounding navigation and theme/i18n adapters.
|
|
6
6
|
*
|
|
7
7
|
* Availability checks live in engine. Install orchestration lives in engine too:
|
|
8
8
|
* `installSession` fronts the OtaInstallCoordinator state machine (WP 8B) — the host
|
|
@@ -11,8 +11,10 @@
|
|
|
11
11
|
import BluetoothSdk from "@mentra/bluetooth-sdk/internal"
|
|
12
12
|
import type {OtaProgress, OtaProgressStatus, OtaStatus, OtaUpdateInfo} from "@mentra/bluetooth-sdk/internal"
|
|
13
13
|
import {isGlassesConnected, useGlassesStore} from "../stores/glasses"
|
|
14
|
-
import {
|
|
14
|
+
import {resolveOtaManifestUrl} from "../services/otaManifestUrl"
|
|
15
15
|
import {otaInstallCoordinator, type OtaInstallSnapshot} from "../services/OtaInstallCoordinator"
|
|
16
|
+
import {startGlassesStatusProjection} from "../services/GlassesStatusProjection"
|
|
17
|
+
import {startOtaService} from "../services/OtaService"
|
|
16
18
|
import {
|
|
17
19
|
checkCurrentGlassesForUpdate,
|
|
18
20
|
type OtaCheckCurrentGlassesOptions,
|
|
@@ -26,9 +28,10 @@ function projectSnapshot() {
|
|
|
26
28
|
buildNumber: s.buildNumber || null,
|
|
27
29
|
mtkFirmwareVersion: s.mtkFirmwareVersion || null,
|
|
28
30
|
besFirmwareVersion: s.besFirmwareVersion || null,
|
|
31
|
+
hotspotOtaVersion: s.hotspotOtaVersion ?? 0,
|
|
29
32
|
wifiConnected: s.wifi.state === "connected",
|
|
30
33
|
wifiStatusKnown: s.wifiStatusKnown,
|
|
31
|
-
manifestUrl:
|
|
34
|
+
manifestUrl: resolveOtaManifestUrl(s.otaVersionUrl, s.buildNumber),
|
|
32
35
|
updateAvailable: s.otaUpdateAvailable,
|
|
33
36
|
status: s.otaStatus,
|
|
34
37
|
legacyProgress: s.otaProgress,
|
|
@@ -50,6 +53,16 @@ export type {
|
|
|
50
53
|
|
|
51
54
|
export const ota = {
|
|
52
55
|
// --- actions ---
|
|
56
|
+
/**
|
|
57
|
+
* Start the device-status and OTA projections without starting the authenticated
|
|
58
|
+
* cloud/miniapp runtime. This is the explicit entry point for Bluetooth-only hosts.
|
|
59
|
+
* Idempotent and safe when the full engine runtime is already running.
|
|
60
|
+
*/
|
|
61
|
+
initialize: async () => {
|
|
62
|
+
const hydrated = startGlassesStatusProjection()
|
|
63
|
+
startOtaService()
|
|
64
|
+
await hydrated
|
|
65
|
+
},
|
|
53
66
|
/**
|
|
54
67
|
* Start the firmware install with the resolved OTA manifest URL. Progress lands on
|
|
55
68
|
* `status()`/`onStatus()`. (The host resolves the manifest URL — dev-override/env/prod
|
|
@@ -115,6 +128,8 @@ export const ota = {
|
|
|
115
128
|
* the snapshot; every watchdog/retry/reconnect rule lives in the coordinator.
|
|
116
129
|
*/
|
|
117
130
|
installSession: {
|
|
131
|
+
/** Select Wi-Fi or capability-gated hotspot transport for this checked manifest. */
|
|
132
|
+
prepare: (result: OtaCheckCurrentGlassesResult) => otaInstallCoordinator.prepare(result),
|
|
118
133
|
/** Bind the machine to the mounted progress screen. Idempotent per attach/detach cycle. */
|
|
119
134
|
attach: () => otaInstallCoordinator.attach(),
|
|
120
135
|
/** Unbind on unmount: clears all timers/listeners and resets session state. */
|
package/src/facades/pairing.ts
CHANGED
|
@@ -291,25 +291,29 @@ export const pairing = {
|
|
|
291
291
|
await BluetoothSdk.stopScan()
|
|
292
292
|
return
|
|
293
293
|
}
|
|
294
|
-
await BluetoothSdk.disconnect()
|
|
295
294
|
if (projectPairingIdentity().kind === "paired") {
|
|
296
295
|
// The persisted settings describe a COMPLETE pairing: restore it to
|
|
297
296
|
// native (the attempt's connect-by-name overwrote the native
|
|
298
297
|
// device_name; and if native somehow lost its default entirely, this
|
|
299
298
|
// repairs the divergence instead of forgetting a real pairing).
|
|
300
299
|
console.log("PairingIdentity: abandonAttempt — preserving pairing; attempt cancelled, native identity re-seeded")
|
|
300
|
+
await BluetoothSdk.disconnect()
|
|
301
301
|
await pushAllBluetoothSettings()
|
|
302
|
-
|
|
302
|
+
return
|
|
303
|
+
}
|
|
304
|
+
if (nativeHasDefault) {
|
|
303
305
|
// Mid-relay: native promoted and its echoes are still landing — the
|
|
304
306
|
// incomplete JS snapshot must not be pushed over the fresher native
|
|
305
307
|
// identity (the on-connect replay's race). Native holds the truth.
|
|
306
308
|
console.log("PairingIdentity: abandonAttempt — preserving pairing; JS identity mid-relay, native kept as-is")
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
// persisted pairing — a genuinely partial attempt.
|
|
310
|
-
console.log("PairingIdentity: abandonAttempt — no pairing on either layer; forgetting the partial attempt")
|
|
311
|
-
await BluetoothSdk.forget()
|
|
309
|
+
await BluetoothSdk.disconnect()
|
|
310
|
+
return
|
|
312
311
|
}
|
|
312
|
+
// Partial attempt: forget owns teardown. Do NOT disconnect() first — that
|
|
313
|
+
// nulls the MentraLive SGC and used to skip Classic removeBond, leaving
|
|
314
|
+
// IBRT ACL up so glasses never re-advertise for the next scan.
|
|
315
|
+
console.log("PairingIdentity: abandonAttempt — no pairing on either layer; forgetting the partial attempt")
|
|
316
|
+
await BluetoothSdk.forget()
|
|
313
317
|
},
|
|
314
318
|
|
|
315
319
|
/** Subscribe to pairing failures; returns an unsubscribe. */
|
|
@@ -3,25 +3,16 @@
|
|
|
3
3
|
* notifications to the glasses, with a per-app blocklist. Android-only (the
|
|
4
4
|
* NotificationListenerService); the getters return sensible defaults on iOS.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* listener); the installed-apps list +
|
|
6
|
+
* The per-app blocklist is an engine setting (auto-synced to the native
|
|
7
|
+
* listener); the installed-apps list + listener permission are CrustModule.
|
|
8
|
+
* Capture itself is controlled only by Android notification access and the
|
|
9
|
+
* hidden operational kill switch.
|
|
8
10
|
*/
|
|
9
11
|
import {Platform} from "react-native"
|
|
10
12
|
import CrustModule from "@mentra/crust"
|
|
11
13
|
import {useSettingsStore, SETTINGS} from "../stores/settings"
|
|
12
14
|
|
|
13
15
|
export const phoneNotifications = {
|
|
14
|
-
/** Is phone-notification forwarding enabled? (false on iOS) */
|
|
15
|
-
enabled: (): boolean => {
|
|
16
|
-
if (Platform.OS !== "android") return false
|
|
17
|
-
return useSettingsStore.getState().getSetting(SETTINGS.notifications_enabled.key) ?? true
|
|
18
|
-
},
|
|
19
|
-
/** Enable/disable phone-notification forwarding. (no-op on iOS) */
|
|
20
|
-
setEnabled: (enabled: boolean) => {
|
|
21
|
-
if (Platform.OS !== "android") return
|
|
22
|
-
return useSettingsStore.getState().setSetting(SETTINGS.notifications_enabled.key, enabled)
|
|
23
|
-
},
|
|
24
|
-
|
|
25
16
|
/** The phone's installed apps (package, name, icon). (empty on iOS) */
|
|
26
17
|
installedApps: (): Promise<Array<{packageName: string; appName: string; icon: string | null}>> => {
|
|
27
18
|
if (Platform.OS !== "android") return Promise.resolve([])
|
package/src/index.ts
CHANGED
|
@@ -32,6 +32,8 @@ export type {
|
|
|
32
32
|
IslandConfigValues,
|
|
33
33
|
IslandAnalytics,
|
|
34
34
|
IslandUiSeams,
|
|
35
|
+
ScanQrOptions,
|
|
36
|
+
ScanQrResult,
|
|
35
37
|
SubjectTokenType,
|
|
36
38
|
} from "./runtime/bootstrap"
|
|
37
39
|
|
|
@@ -91,7 +93,6 @@ export {
|
|
|
91
93
|
DOWNLOAD_STUCK_TIMEOUT_MS,
|
|
92
94
|
MTK_INSTALL_TIMEOUT_MS,
|
|
93
95
|
GLOBAL_OTA_TIMEOUT_MS,
|
|
94
|
-
POST_APK_OTA_START_DELAY_MS,
|
|
95
96
|
PING_INTERVAL_MS,
|
|
96
97
|
QUERY_REPLY_TIMEOUT_MS,
|
|
97
98
|
OtaProgressMessages,
|
|
@@ -106,6 +107,24 @@ export type {
|
|
|
106
107
|
OtaSnapshot,
|
|
107
108
|
OtaInstallSnapshot,
|
|
108
109
|
} from "./facades/ota"
|
|
110
|
+
export {
|
|
111
|
+
beginOtaAutoChain,
|
|
112
|
+
clearOtaAutoChainReconnectWait,
|
|
113
|
+
isOtaAutoChainActive,
|
|
114
|
+
otaAutoChainFingerprint,
|
|
115
|
+
otaAutoChainReconnectWaitRemaining,
|
|
116
|
+
stopOtaAutoChain,
|
|
117
|
+
tryAdvanceOtaAutoChain,
|
|
118
|
+
MAX_OTA_AUTO_CHAIN_PASSES,
|
|
119
|
+
OTA_AUTO_CHAIN_RECONNECT_TIMEOUT_MS,
|
|
120
|
+
} from "./services/OtaAutoChain"
|
|
121
|
+
export type {OtaAutoChainAdvanceResult} from "./services/OtaAutoChain"
|
|
122
|
+
export {
|
|
123
|
+
BES_INSTALL_RESTART_MESSAGE,
|
|
124
|
+
getOtaErrorMessage,
|
|
125
|
+
shouldRequireGlassesRebootForBesFailure,
|
|
126
|
+
shouldShowChangeWifiForOtaDownloadFailure,
|
|
127
|
+
} from "./services/OtaErrorMapping"
|
|
109
128
|
|
|
110
129
|
// Gallery read models: engine.gallery.onNotice payload types, the media
|
|
111
130
|
// permission helper + display-name derivation host gallery UI uses, and the
|
|
@@ -153,7 +172,12 @@ export {
|
|
|
153
172
|
} from "./stores/apps"
|
|
154
173
|
|
|
155
174
|
// Pure dev-miniapp launch-route decision (registration itself is internal).
|
|
156
|
-
export {
|
|
175
|
+
export {
|
|
176
|
+
decideDevLaunchRoute,
|
|
177
|
+
type DecideDevLaunchOptions,
|
|
178
|
+
type DevLaunchResult,
|
|
179
|
+
type DevManifest,
|
|
180
|
+
} from "./utils/devMiniappLaunch"
|
|
157
181
|
export {HardwareCompatibility, type CompatibilityResult} from "./utils/hardware"
|
|
158
182
|
export {BgTimer, throttle, debounce} from "./utils/timers"
|
|
159
183
|
|
package/src/internal.ts
CHANGED
|
@@ -30,6 +30,7 @@ export {
|
|
|
30
30
|
getDevAppAttestation,
|
|
31
31
|
DEV_APP_PACKAGE_NAME,
|
|
32
32
|
type DevAppRecord,
|
|
33
|
+
type MiniappReleaseIdentity,
|
|
33
34
|
} from "./services/AppRegistry"
|
|
34
35
|
export {default as displayProcessor} from "./services/DisplayProcessor"
|
|
35
36
|
export {default as localDisplayManager, type DisplayPayload} from "./services/LocalDisplayManager"
|
|
@@ -93,7 +94,7 @@ export {phoneLocationService, stopPhoneLocation} from "./services/PhoneLocationS
|
|
|
93
94
|
// Clock-skew fix commands (BLE writes) used by OTA + gallery sync.
|
|
94
95
|
export {fixGlassesClockIfSkewed, maybeFixGlassesClockFromVersionInfo} from "./services/glassesClockSync"
|
|
95
96
|
// OTA manifest-URL resolution (dev-override/legacy-build/env/prod).
|
|
96
|
-
export {
|
|
97
|
+
export {resolveOtaManifestUrl} from "./services/otaManifestUrl"
|
|
97
98
|
// Flat OTA check helpers (network + BLE state). Host usage is a tracked
|
|
98
99
|
// burn-down surface (§F); the sanctioned path is engine.ota.checkForUpdates().
|
|
99
100
|
export {
|