@glassly/engine 0.1.0-dev.1 → 0.1.0-dev.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -19
- package/build/bluetooth-sdk/debug.d.ts +2 -0
- package/build/bluetooth-sdk/debug.d.ts.map +1 -0
- package/build/bluetooth-sdk/debug.js +2 -0
- package/build/bluetooth-sdk/debug.js.map +1 -0
- package/build/bluetooth-sdk/index.d.ts +3 -0
- package/build/bluetooth-sdk/index.d.ts.map +1 -0
- package/build/bluetooth-sdk/index.js +3 -0
- package/build/bluetooth-sdk/index.js.map +1 -0
- package/build/bluetooth-sdk/ota-transport.d.ts +2 -0
- package/build/bluetooth-sdk/ota-transport.d.ts.map +1 -0
- package/build/bluetooth-sdk/ota-transport.js +2 -0
- package/build/bluetooth-sdk/ota-transport.js.map +1 -0
- package/build/bluetooth-sdk/photo-receiver.d.ts +3 -0
- package/build/bluetooth-sdk/photo-receiver.d.ts.map +1 -0
- package/build/bluetooth-sdk/photo-receiver.js +3 -0
- package/build/bluetooth-sdk/photo-receiver.js.map +1 -0
- package/build/bluetooth-sdk/react.d.ts +2 -0
- package/build/bluetooth-sdk/react.d.ts.map +1 -0
- package/build/bluetooth-sdk/react.js +2 -0
- package/build/bluetooth-sdk/react.js.map +1 -0
- package/build/bluetooth-sdk/types.d.ts +2 -0
- package/build/bluetooth-sdk/types.d.ts.map +1 -0
- package/build/bluetooth-sdk/types.js +2 -0
- package/build/bluetooth-sdk/types.js.map +1 -0
- package/build/engine.d.ts +30 -18
- package/build/engine.d.ts.map +1 -1
- package/build/engine.js +12 -3
- package/build/engine.js.map +1 -1
- package/build/facades/dev.d.ts +1 -1
- package/build/facades/display.d.ts +11 -4
- package/build/facades/display.d.ts.map +1 -1
- package/build/facades/display.js +12 -2
- package/build/facades/display.js.map +1 -1
- package/build/facades/displayMirror.d.ts +2 -6
- package/build/facades/displayMirror.d.ts.map +1 -1
- package/build/facades/displayMirror.js +7 -14
- package/build/facades/displayMirror.js.map +1 -1
- package/build/facades/glasses.d.ts +6 -13
- package/build/facades/glasses.d.ts.map +1 -1
- package/build/facades/glasses.js +7 -3
- package/build/facades/glasses.js.map +1 -1
- package/build/facades/ota.d.ts +21 -21
- package/build/facades/ota.d.ts.map +1 -1
- package/build/facades/ota.js +26 -10
- package/build/facades/ota.js.map +1 -1
- package/build/facades/pairing.d.ts +11 -5
- package/build/facades/pairing.d.ts.map +1 -1
- package/build/facades/pairing.js +93 -17
- package/build/facades/pairing.js.map +1 -1
- package/build/facades/phoneNotifications.d.ts +12 -2
- package/build/facades/phoneNotifications.d.ts.map +1 -1
- package/build/facades/phoneNotifications.js +30 -10
- package/build/facades/phoneNotifications.js.map +1 -1
- package/build/facades/speakers.d.ts +1 -1
- package/build/facades/speakers.d.ts.map +1 -1
- package/build/facades/speakers.js.map +1 -1
- package/build/facades/speech.d.ts +7 -6
- package/build/facades/speech.d.ts.map +1 -1
- package/build/facades/speech.js +1 -1
- package/build/facades/speech.js.map +1 -1
- package/build/generated/releaseMetadata.d.ts +12 -0
- package/build/generated/releaseMetadata.d.ts.map +1 -0
- package/build/generated/releaseMetadata.js +10 -0
- package/build/generated/releaseMetadata.js.map +1 -0
- package/build/index.d.ts +9 -6
- package/build/index.d.ts.map +1 -1
- package/build/index.js +7 -5
- package/build/index.js.map +1 -1
- package/build/react/MentraLiveOtaFlow.d.ts +44 -0
- package/build/react/MentraLiveOtaFlow.d.ts.map +1 -0
- package/build/react/MentraLiveOtaFlow.js +322 -0
- package/build/react/MentraLiveOtaFlow.js.map +1 -0
- package/build/react/index.d.ts +3 -0
- package/build/react/index.d.ts.map +1 -0
- package/build/react/index.js +3 -0
- package/build/react/index.js.map +1 -0
- package/build/react/useEngineSnapshot.d.ts +2 -0
- package/build/react/useEngineSnapshot.d.ts.map +1 -0
- package/build/react/useEngineSnapshot.js +14 -0
- package/build/react/useEngineSnapshot.js.map +1 -0
- package/build/react/useMentraLiveOta.d.ts +84 -0
- package/build/react/useMentraLiveOta.d.ts.map +1 -0
- package/build/react/useMentraLiveOta.js +627 -0
- package/build/react/useMentraLiveOta.js.map +1 -0
- package/build/services/AppRegistry.d.ts +8 -0
- package/build/services/AppRegistry.d.ts.map +1 -1
- package/build/services/AppRegistry.js +15 -0
- package/build/services/AppRegistry.js.map +1 -1
- package/build/services/BlobStore.d.ts +2 -0
- package/build/services/BlobStore.d.ts.map +1 -1
- package/build/services/BlobStore.js +63 -10
- package/build/services/BlobStore.js.map +1 -1
- package/build/services/CustomDashboardModel.d.ts +48 -0
- package/build/services/CustomDashboardModel.d.ts.map +1 -0
- package/build/services/CustomDashboardModel.js +73 -0
- package/build/services/CustomDashboardModel.js.map +1 -0
- package/build/services/CustomDashboardService.d.ts +55 -0
- package/build/services/CustomDashboardService.d.ts.map +1 -0
- package/build/services/CustomDashboardService.js +492 -0
- package/build/services/CustomDashboardService.js.map +1 -0
- package/build/services/DashboardCoordinator.d.ts +26 -0
- package/build/services/DashboardCoordinator.d.ts.map +1 -0
- package/build/services/DashboardCoordinator.js +125 -0
- package/build/services/DashboardCoordinator.js.map +1 -0
- package/build/services/DeviceEventRouter.d.ts.map +1 -1
- package/build/services/DeviceEventRouter.js +45 -6
- package/build/services/DeviceEventRouter.js.map +1 -1
- package/build/services/DisplayProcessor.d.ts +3 -3
- package/build/services/DisplayProcessor.js +3 -3
- package/build/services/DisplayProcessor.js.map +1 -1
- package/build/services/GestureDotsService.d.ts +40 -0
- package/build/services/GestureDotsService.d.ts.map +1 -0
- package/build/services/GestureDotsService.js +167 -0
- package/build/services/GestureDotsService.js.map +1 -0
- package/build/services/GlassesStatusProjection.d.ts +15 -1
- package/build/services/GlassesStatusProjection.d.ts.map +1 -1
- package/build/services/GlassesStatusProjection.js +18 -11
- package/build/services/GlassesStatusProjection.js.map +1 -1
- package/build/services/HotspotOtaTransport.d.ts.map +1 -1
- package/build/services/HotspotOtaTransport.js +8 -7
- package/build/services/HotspotOtaTransport.js.map +1 -1
- package/build/services/LocalDisplayManager.d.ts +55 -3
- package/build/services/LocalDisplayManager.d.ts.map +1 -1
- package/build/services/LocalDisplayManager.js +196 -16
- package/build/services/LocalDisplayManager.js.map +1 -1
- package/build/services/LocalMiniappRuntime.d.ts +13 -0
- package/build/services/LocalMiniappRuntime.d.ts.map +1 -1
- package/build/services/LocalMiniappRuntime.js +32 -0
- package/build/services/LocalMiniappRuntime.js.map +1 -1
- package/build/services/MiniappExitGesture.d.ts +33 -0
- package/build/services/MiniappExitGesture.d.ts.map +1 -0
- package/build/services/MiniappExitGesture.js +54 -0
- package/build/services/MiniappExitGesture.js.map +1 -0
- package/build/services/OtaAutoChain.d.ts +41 -0
- package/build/services/OtaAutoChain.d.ts.map +1 -0
- package/build/services/OtaAutoChain.js +91 -0
- package/build/services/OtaAutoChain.js.map +1 -0
- package/build/services/OtaErrorMapping.d.ts +18 -0
- package/build/services/OtaErrorMapping.d.ts.map +1 -0
- package/build/services/OtaErrorMapping.js +63 -0
- package/build/services/OtaErrorMapping.js.map +1 -0
- package/build/services/OtaInstallCoordinator.d.ts +26 -3
- package/build/services/OtaInstallCoordinator.d.ts.map +1 -1
- package/build/services/OtaInstallCoordinator.js +38 -13
- package/build/services/OtaInstallCoordinator.js.map +1 -1
- package/build/services/OtaService.d.ts.map +1 -1
- package/build/services/OtaService.js +1 -1
- package/build/services/OtaService.js.map +1 -1
- package/build/services/OtaUpdateCheckService.d.ts +4 -1
- package/build/services/OtaUpdateCheckService.d.ts.map +1 -1
- package/build/services/OtaUpdateCheckService.js +28 -16
- package/build/services/OtaUpdateCheckService.js.map +1 -1
- package/build/services/PhoneNotificationsSync.d.ts +13 -0
- package/build/services/PhoneNotificationsSync.d.ts.map +1 -1
- package/build/services/PhoneNotificationsSync.js +101 -9
- package/build/services/PhoneNotificationsSync.js.map +1 -1
- package/build/services/PhonePhotoCoordinator.js +1 -1
- package/build/services/PhonePhotoCoordinator.js.map +1 -1
- package/build/services/PhoneStreamCoordinator.d.ts.map +1 -1
- package/build/services/PhoneStreamCoordinator.js +9 -6
- package/build/services/PhoneStreamCoordinator.js.map +1 -1
- package/build/services/SceneRenderer.d.ts.map +1 -1
- package/build/services/SceneRenderer.js +5 -0
- package/build/services/SceneRenderer.js.map +1 -1
- package/build/services/StreamLifecycleController.d.ts +4 -0
- package/build/services/StreamLifecycleController.d.ts.map +1 -1
- package/build/services/StreamLifecycleController.js +4 -0
- package/build/services/StreamLifecycleController.js.map +1 -1
- package/build/services/asg/localNetworkTransport.d.ts.map +1 -1
- package/build/services/asg/localNetworkTransport.js +13 -12
- package/build/services/asg/localNetworkTransport.js.map +1 -1
- package/build/services/effectiveCapabilities.d.ts +1 -1
- package/build/services/effectiveCapabilities.d.ts.map +1 -1
- package/build/services/effectiveCapabilities.js +26 -7
- package/build/services/effectiveCapabilities.js.map +1 -1
- package/build/services/gestureClaims.d.ts +18 -0
- package/build/services/gestureClaims.d.ts.map +1 -0
- package/build/services/gestureClaims.js +24 -0
- package/build/services/gestureClaims.js.map +1 -0
- package/build/services/gestureDotGlyphs.d.ts +8 -0
- package/build/services/gestureDotGlyphs.d.ts.map +1 -0
- package/build/services/gestureDotGlyphs.js +13 -0
- package/build/services/gestureDotGlyphs.js.map +1 -0
- package/build/services/glassesClockSync.d.ts.map +1 -1
- package/build/services/glassesClockSync.js +5 -1
- package/build/services/glassesClockSync.js.map +1 -1
- package/build/services/iosNotificationAppCatalog.d.ts +13 -0
- package/build/services/iosNotificationAppCatalog.d.ts.map +1 -0
- package/build/services/iosNotificationAppCatalog.js +28 -0
- package/build/services/iosNotificationAppCatalog.js.map +1 -0
- package/build/services/otaDisplayState.d.ts +1 -1
- package/build/services/otaDisplayState.d.ts.map +1 -1
- package/build/services/otaDisplayState.js.map +1 -1
- package/build/services/otaInstallPolicy.d.ts +5 -1
- package/build/services/otaInstallPolicy.d.ts.map +1 -1
- package/build/services/otaInstallPolicy.js +4 -0
- package/build/services/otaInstallPolicy.js.map +1 -1
- package/build/services/otaLegacyMapping.d.ts +1 -1
- package/build/services/otaLegacyMapping.d.ts.map +1 -1
- package/build/services/otaLegacyMapping.js.map +1 -1
- package/build/services/otaManifestPolicy.d.ts +14 -0
- package/build/services/otaManifestPolicy.d.ts.map +1 -0
- package/build/services/otaManifestPolicy.js +20 -0
- package/build/services/otaManifestPolicy.js.map +1 -0
- package/build/services/otaManifestUrl.d.ts +2 -1
- package/build/services/otaManifestUrl.d.ts.map +1 -1
- package/build/services/otaManifestUrl.js +24 -32
- package/build/services/otaManifestUrl.js.map +1 -1
- package/build/services/otaReleaseVersion.d.ts +10 -0
- package/build/services/otaReleaseVersion.d.ts.map +1 -0
- package/build/services/otaReleaseVersion.js +14 -0
- package/build/services/otaReleaseVersion.js.map +1 -0
- package/build/stores/appVisibility.d.ts +3 -0
- package/build/stores/appVisibility.d.ts.map +1 -0
- package/build/stores/appVisibility.js +3 -0
- package/build/stores/appVisibility.js.map +1 -0
- package/build/stores/apps.d.ts.map +1 -1
- package/build/stores/apps.js +7 -1
- package/build/stores/apps.js.map +1 -1
- package/build/stores/core.d.ts +3 -3
- package/build/stores/core.d.ts.map +1 -1
- package/build/stores/core.js.map +1 -1
- package/build/stores/display.d.ts +4 -4
- package/build/stores/display.d.ts.map +1 -1
- package/build/stores/display.js +12 -36
- package/build/stores/display.js.map +1 -1
- package/build/stores/glasses.d.ts +10 -4
- package/build/stores/glasses.d.ts.map +1 -1
- package/build/stores/glasses.js +2 -0
- package/build/stores/glasses.js.map +1 -1
- package/build/stores/settings.d.ts.map +1 -1
- package/build/stores/settings.js +140 -5
- package/build/stores/settings.js.map +1 -1
- package/build/types/applet.d.ts +3 -1
- package/build/types/applet.d.ts.map +1 -1
- package/build/types/applet.js +0 -3
- package/build/types/applet.js.map +1 -1
- package/build/types/capabilities/even-realities-g2.d.ts.map +1 -1
- package/build/types/capabilities/even-realities-g2.js +2 -2
- package/build/types/capabilities/even-realities-g2.js.map +1 -1
- package/build/types/enums.d.ts +1 -5
- package/build/types/enums.d.ts.map +1 -1
- package/build/types/enums.js +1 -8
- package/build/types/enums.js.map +1 -1
- package/build/types/hardware.d.ts +1 -1
- package/build/types/hardware.d.ts.map +1 -1
- package/build/types/hardware.js +1 -0
- package/build/types/hardware.js.map +1 -1
- package/build/types/index.d.ts +3 -7
- package/build/types/index.d.ts.map +1 -1
- package/build/types/index.js +3 -7
- package/build/types/index.js.map +1 -1
- package/build/utils/display/composer/ColumnComposer.d.ts +1 -1
- package/build/utils/display/composer/ColumnComposer.js +1 -1
- package/build/utils/display/composer/ColumnComposer.js.map +1 -1
- package/build/utils/display/scene/process.d.ts.map +1 -1
- package/build/utils/display/scene/process.js +4 -3
- package/build/utils/display/scene/process.js.map +1 -1
- package/build/utils/display/scene/types.d.ts +6 -2
- package/build/utils/display/scene/types.d.ts.map +1 -1
- package/build/utils/display/scene/types.js.map +1 -1
- package/package.json +69 -35
- package/src/bluetooth-sdk/debug.ts +1 -0
- package/src/bluetooth-sdk/index.ts +2 -0
- package/src/bluetooth-sdk/ota-transport.ts +1 -0
- package/src/bluetooth-sdk/photo-receiver.ts +2 -0
- package/src/bluetooth-sdk/react.ts +1 -0
- package/src/bluetooth-sdk/types.ts +1 -0
- package/src/engine.ts +12 -3
- package/src/facades/display.ts +12 -2
- package/src/facades/displayMirror.ts +7 -15
- package/src/facades/glasses.ts +8 -4
- package/src/facades/ota.ts +36 -11
- package/src/facades/pairing.ts +103 -23
- package/src/facades/phoneNotifications.ts +32 -10
- package/src/facades/speakers.ts +1 -1
- package/src/facades/speech.ts +21 -7
- package/src/generated/releaseMetadata.ts +20 -0
- package/src/index.ts +31 -5
- package/src/react/MentraLiveOtaFlow.tsx +754 -0
- package/src/react/index.ts +21 -0
- package/src/react/useEngineSnapshot.ts +16 -0
- package/src/react/useMentraLiveOta.ts +793 -0
- package/src/services/AppRegistry.ts +16 -0
- package/src/services/BlobStore.ts +57 -10
- package/src/services/CustomDashboardModel.ts +83 -0
- package/src/services/CustomDashboardService.ts +516 -0
- package/src/services/DashboardCoordinator.ts +121 -0
- package/src/services/DeviceEventRouter.ts +48 -8
- package/src/services/DisplayProcessor.ts +3 -3
- package/src/services/GestureDotsService.ts +164 -0
- package/src/services/GlassesStatusProjection.ts +20 -11
- package/src/services/HotspotOtaTransport.ts +8 -7
- package/src/services/LocalDisplayManager.ts +198 -18
- package/src/services/LocalMiniappRuntime.ts +37 -0
- package/src/services/MiniappExitGesture.ts +76 -0
- package/src/services/OtaAutoChain.ts +130 -0
- package/src/services/OtaErrorMapping.ts +80 -0
- package/src/services/OtaInstallCoordinator.ts +40 -13
- package/src/services/OtaService.ts +1 -2
- package/src/services/OtaUpdateCheckService.ts +33 -19
- package/src/services/PhoneNotificationsSync.ts +125 -9
- package/src/services/PhonePhotoCoordinator.ts +1 -1
- package/src/services/PhoneStreamCoordinator.ts +10 -6
- package/src/services/SceneRenderer.ts +4 -0
- package/src/services/StreamLifecycleController.ts +4 -0
- package/src/services/asg/localNetworkTransport.ts +20 -19
- package/src/services/effectiveCapabilities.ts +27 -7
- package/src/services/gestureClaims.ts +28 -0
- package/src/services/gestureDotGlyphs.ts +15 -0
- package/src/services/glassesClockSync.ts +5 -1
- package/src/services/iosNotificationAppCatalog.ts +39 -0
- package/src/services/otaDisplayState.ts +1 -1
- package/src/services/otaInstallPolicy.ts +5 -1
- package/src/services/otaLegacyMapping.ts +1 -1
- package/src/services/otaManifestPolicy.ts +43 -0
- package/src/services/otaManifestUrl.ts +27 -36
- package/src/services/otaReleaseVersion.ts +22 -0
- package/src/stores/appVisibility.ts +3 -0
- package/src/stores/apps.ts +7 -1
- package/src/stores/core.ts +4 -4
- package/src/stores/display.ts +16 -48
- package/src/stores/glasses.ts +15 -6
- package/src/stores/settings.ts +140 -5
- package/src/types/applet.ts +3 -1
- package/src/types/capabilities/even-realities-g2.ts +3 -2
- package/src/types/enums.ts +1 -9
- package/src/types/hardware.ts +2 -1
- package/src/types/index.ts +3 -7
- package/src/utils/display/composer/ColumnComposer.ts +1 -1
- package/src/utils/display/scene/process.ts +4 -3
- package/src/utils/display/scene/types.ts +0 -0
- package/build/devtools.d.ts +0 -11
- package/build/devtools.d.ts.map +0 -1
- package/build/devtools.js +0 -13
- package/build/devtools.js.map +0 -1
- package/build/internal.d.ts +0 -67
- package/build/internal.d.ts.map +0 -1
- package/build/internal.js +0 -90
- package/build/internal.js.map +0 -1
- package/src/devtools.ts +0 -13
- package/src/internal.ts +0 -155
package/src/facades/pairing.ts
CHANGED
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
// target hint) lives on the full surface, not the public entry (same reason
|
|
11
11
|
// the glasses facade imports internal).
|
|
12
12
|
import BluetoothSdk from "@glassly/bluetooth-sdk/internal"
|
|
13
|
-
import type {ConnectOptions, Device, PairFailureEvent, GlassesNotReadyEvent} from "@glassly/bluetooth-sdk"
|
|
13
|
+
import type {ConnectOptions, Device, DeviceModel, PairFailureEvent, GlassesNotReadyEvent} from "@glassly/bluetooth-sdk"
|
|
14
14
|
import {useCoreStore} from "../stores/core"
|
|
15
15
|
import {useGlassesStore} from "../stores/glasses"
|
|
16
|
+
import {SETTINGS, useSettingsStore} from "../stores/settings"
|
|
16
17
|
import {hasDefaultDevice} from "../services/DeviceStoreHydration"
|
|
17
18
|
import {
|
|
18
19
|
markPendingSelection,
|
|
@@ -20,18 +21,14 @@ import {
|
|
|
20
21
|
subscribePairingIdentity,
|
|
21
22
|
type IdentitySnapshot,
|
|
22
23
|
} from "../services/PairingIdentity"
|
|
23
|
-
import {
|
|
24
|
-
isGlassesConnected,
|
|
25
|
-
isGlassesLinkLayerBusy,
|
|
26
|
-
isGlassesReady,
|
|
27
|
-
waitForGlassesReady,
|
|
28
|
-
} from "../services/GlassesReadiness"
|
|
24
|
+
import {isGlassesConnected, isGlassesLinkLayerBusy, isGlassesReady} from "../services/GlassesReadiness"
|
|
29
25
|
import {
|
|
30
26
|
logAutomaticReportSubmissionStatus,
|
|
31
27
|
toAutomaticReportSubmissionStatus,
|
|
32
28
|
type AutomaticReportSubmissionStatus,
|
|
33
29
|
} from "../services/AutomaticReportResult"
|
|
34
30
|
import {pushAllBluetoothSettings} from "../services/GlassesSettingsSync"
|
|
31
|
+
import {ControllerTypes} from "../types"
|
|
35
32
|
import {submitAutomaticReport} from "./reports"
|
|
36
33
|
|
|
37
34
|
export type {IdentitySnapshot} from "../services/PairingIdentity"
|
|
@@ -60,6 +57,82 @@ function projectReadiness() {
|
|
|
60
57
|
}
|
|
61
58
|
}
|
|
62
59
|
|
|
60
|
+
function projectTargetReady(options: Pick<PairingReadyWaitOptions, "deviceModel" | "deviceName">): boolean {
|
|
61
|
+
const {deviceModel, deviceName} = options
|
|
62
|
+
const glasses = useGlassesStore.getState()
|
|
63
|
+
|
|
64
|
+
if (deviceModel === ControllerTypes.R1) {
|
|
65
|
+
if (!glasses.controllerConnected || !glasses.controllerFullyBooted) return false
|
|
66
|
+
const settings = useSettingsStore.getState()
|
|
67
|
+
const pairedModel = settings.getSetting(SETTINGS.default_controller.key)
|
|
68
|
+
const pairedName = settings.getSetting(SETTINGS.controller_device_name.key)
|
|
69
|
+
return (!deviceModel || pairedModel === deviceModel) && (!deviceName || pairedName === deviceName)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (!isGlassesReady(glasses.connection)) return false
|
|
73
|
+
const identity = projectPairingIdentity()
|
|
74
|
+
if (!deviceModel && !deviceName) return true
|
|
75
|
+
return (
|
|
76
|
+
identity.kind === "paired" &&
|
|
77
|
+
(!deviceModel || identity.model === deviceModel) &&
|
|
78
|
+
(!deviceName || identity.name === deviceName)
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function subscribeTargetReady(
|
|
83
|
+
options: Pick<PairingReadyWaitOptions, "deviceModel" | "deviceName">,
|
|
84
|
+
cb: (ready: boolean) => void,
|
|
85
|
+
): () => void {
|
|
86
|
+
let last = projectTargetReady(options)
|
|
87
|
+
const notify = () => {
|
|
88
|
+
const ready = projectTargetReady(options)
|
|
89
|
+
if (ready === last) return
|
|
90
|
+
last = ready
|
|
91
|
+
cb(ready)
|
|
92
|
+
}
|
|
93
|
+
const unsubscribeGlasses = useGlassesStore.subscribe(notify)
|
|
94
|
+
const unsubscribeSettings = useSettingsStore.subscribe(notify)
|
|
95
|
+
return () => {
|
|
96
|
+
unsubscribeGlasses()
|
|
97
|
+
unsubscribeSettings()
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
async function waitForTargetReady(options: PairingReadyWaitOptions, timeoutMs: number): Promise<boolean> {
|
|
102
|
+
return new Promise((resolve) => {
|
|
103
|
+
if (options.signal?.aborted) {
|
|
104
|
+
resolve(false)
|
|
105
|
+
return
|
|
106
|
+
}
|
|
107
|
+
if (projectTargetReady(options)) {
|
|
108
|
+
resolve(true)
|
|
109
|
+
return
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
let settled = false
|
|
113
|
+
let timeout: ReturnType<typeof setTimeout> | null = null
|
|
114
|
+
let unsubscribe: (() => void) | null = null
|
|
115
|
+
let onAbort: (() => void) | null = null
|
|
116
|
+
const finish = (ready: boolean) => {
|
|
117
|
+
if (settled) return
|
|
118
|
+
settled = true
|
|
119
|
+
if (timeout) clearTimeout(timeout)
|
|
120
|
+
if (unsubscribe) unsubscribe()
|
|
121
|
+
if (onAbort && options.signal) options.signal.removeEventListener("abort", onAbort)
|
|
122
|
+
resolve(ready)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
unsubscribe = subscribeTargetReady(options, (ready) => {
|
|
126
|
+
if (ready) finish(true)
|
|
127
|
+
})
|
|
128
|
+
if (options.signal) {
|
|
129
|
+
onAbort = () => finish(false)
|
|
130
|
+
options.signal.addEventListener("abort", onAbort)
|
|
131
|
+
}
|
|
132
|
+
timeout = setTimeout(() => finish(projectTargetReady(options)), timeoutMs)
|
|
133
|
+
})
|
|
134
|
+
}
|
|
135
|
+
|
|
63
136
|
export type PairingReadinessSnapshot = ReturnType<typeof projectReadiness>
|
|
64
137
|
|
|
65
138
|
export async function submitPairingBootTimeoutReport(params: {
|
|
@@ -108,12 +181,7 @@ async function waitForReadyDuringPairing(options: PairingReadyWaitOptions = {}):
|
|
|
108
181
|
})
|
|
109
182
|
|
|
110
183
|
try {
|
|
111
|
-
const ready = await
|
|
112
|
-
getConnection: () => useGlassesStore.getState().connection,
|
|
113
|
-
subscribe: (listener) => useGlassesStore.subscribe((state) => state.connection, listener),
|
|
114
|
-
timeoutMs,
|
|
115
|
-
signal: options.signal,
|
|
116
|
-
})
|
|
184
|
+
const ready = await waitForTargetReady(options, timeoutMs)
|
|
117
185
|
|
|
118
186
|
if (!ready && !options.signal?.aborted) {
|
|
119
187
|
void submitPairingBootTimeoutReport({
|
|
@@ -193,6 +261,14 @@ export const pairing = {
|
|
|
193
261
|
cb(snap)
|
|
194
262
|
})
|
|
195
263
|
},
|
|
264
|
+
/** Whether the exact wearable or controller selected on the scan screen is ready. */
|
|
265
|
+
targetReady: (options: Pick<PairingReadyWaitOptions, "deviceModel" | "deviceName">): boolean =>
|
|
266
|
+
projectTargetReady(options),
|
|
267
|
+
/** Subscribe to readiness for the exact selected target, excluding stale devices. */
|
|
268
|
+
onTargetReady: (
|
|
269
|
+
options: Pick<PairingReadyWaitOptions, "deviceModel" | "deviceName">,
|
|
270
|
+
cb: (ready: boolean) => void,
|
|
271
|
+
): (() => void) => subscribeTargetReady(options, cb),
|
|
196
272
|
|
|
197
273
|
// --- pairing-identity lifecycle (the PairingIdentity read-model + the JS-owned
|
|
198
274
|
// identity writes; promotion to `paired` only ever happens natively) ---
|
|
@@ -206,7 +282,7 @@ export const pairing = {
|
|
|
206
282
|
markPendingSelection: (model: string) => markPendingSelection(model),
|
|
207
283
|
|
|
208
284
|
/** Start scanning for nearby glasses. Results land on `searchResults()`/`onFound()`. */
|
|
209
|
-
scan: (
|
|
285
|
+
scan: (model: DeviceModel): Promise<void> => BluetoothSdk.startScan(model),
|
|
210
286
|
/** Whether a scan is currently in progress. */
|
|
211
287
|
scanning: (): boolean => useCoreStore.getState().searching,
|
|
212
288
|
/** Subscribe to scan-in-progress changes; fires only when it changes. Returns an unsubscribe. */
|
|
@@ -226,7 +302,7 @@ export const pairing = {
|
|
|
226
302
|
// leak as mutable references into the store.
|
|
227
303
|
searchResults: () => useCoreStore.getState().searchResults.map((result) => ({...result})),
|
|
228
304
|
/** Subscribe to scan-result changes; fires only when they change. Returns an unsubscribe. */
|
|
229
|
-
onFound: (cb: (results:
|
|
305
|
+
onFound: (cb: (results: Device[]) => void): (() => void) => {
|
|
230
306
|
let last = JSON.stringify(useCoreStore.getState().searchResults)
|
|
231
307
|
return useCoreStore.subscribe(() => {
|
|
232
308
|
const results = useCoreStore.getState().searchResults
|
|
@@ -250,7 +326,7 @@ export const pairing = {
|
|
|
250
326
|
return BluetoothSdk.connect(device, {...options, saveAsDefault: false})
|
|
251
327
|
},
|
|
252
328
|
/** Set a device as the default for subsequent `glasses.connectDefault()`. */
|
|
253
|
-
setDefault: (
|
|
329
|
+
setDefault: (device: Device | null): Promise<void> => BluetoothSdk.setDefaultDevice(device),
|
|
254
330
|
/**
|
|
255
331
|
* Prime the native Bluetooth Classic audio watcher with the picked device.
|
|
256
332
|
* The iOS Mentra Live flow pairs Classic audio BEFORE any BLE connect
|
|
@@ -291,25 +367,29 @@ export const pairing = {
|
|
|
291
367
|
await BluetoothSdk.stopScan()
|
|
292
368
|
return
|
|
293
369
|
}
|
|
294
|
-
await BluetoothSdk.disconnect()
|
|
295
370
|
if (projectPairingIdentity().kind === "paired") {
|
|
296
371
|
// The persisted settings describe a COMPLETE pairing: restore it to
|
|
297
372
|
// native (the attempt's connect-by-name overwrote the native
|
|
298
373
|
// device_name; and if native somehow lost its default entirely, this
|
|
299
374
|
// repairs the divergence instead of forgetting a real pairing).
|
|
300
375
|
console.log("PairingIdentity: abandonAttempt — preserving pairing; attempt cancelled, native identity re-seeded")
|
|
376
|
+
await BluetoothSdk.disconnect()
|
|
301
377
|
await pushAllBluetoothSettings()
|
|
302
|
-
|
|
378
|
+
return
|
|
379
|
+
}
|
|
380
|
+
if (nativeHasDefault) {
|
|
303
381
|
// Mid-relay: native promoted and its echoes are still landing — the
|
|
304
382
|
// incomplete JS snapshot must not be pushed over the fresher native
|
|
305
383
|
// identity (the on-connect replay's race). Native holds the truth.
|
|
306
384
|
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()
|
|
385
|
+
await BluetoothSdk.disconnect()
|
|
386
|
+
return
|
|
312
387
|
}
|
|
388
|
+
// Partial attempt: forget owns teardown. Do NOT disconnect() first — that
|
|
389
|
+
// nulls the MentraLive SGC and used to skip Classic removeBond, leaving
|
|
390
|
+
// IBRT ACL up so glasses never re-advertise for the next scan.
|
|
391
|
+
console.log("PairingIdentity: abandonAttempt — no pairing on either layer; forgetting the partial attempt")
|
|
392
|
+
await BluetoothSdk.forget()
|
|
313
393
|
},
|
|
314
394
|
|
|
315
395
|
/** Subscribe to pairing failures; returns an unsubscribe. */
|
|
@@ -1,25 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* phoneNotifications facade — `engine.phoneNotifications`: forward phone
|
|
3
|
-
* notifications to the glasses, with a per-app blocklist.
|
|
4
|
-
* NotificationListenerService); the getters return sensible defaults on iOS.
|
|
3
|
+
* notifications to the glasses, with a per-app blocklist.
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* Android: apps come from the NotificationListenerService's installed-apps
|
|
6
|
+
* enumeration and the blocklist filters capture phone-side.
|
|
7
|
+
* iOS: apps are the seeded catalog plus what the glasses' ANCS client has
|
|
8
|
+
* reported posting notifications (`ios_notification_seen_apps`); the blocklist
|
|
9
|
+
* is mapped onto the G2's on-glass allowlist by PhoneNotificationsSync.
|
|
10
|
+
* Capture itself is controlled by Android notification access / iOS ANCS
|
|
11
|
+
* authorization (`glasses.ancsAuthorized`), not by this facade.
|
|
10
12
|
*/
|
|
11
13
|
import {Platform} from "react-native"
|
|
12
14
|
import CrustModule from "@glassly/crust"
|
|
13
15
|
import {useSettingsStore, SETTINGS} from "../stores/settings"
|
|
16
|
+
import {useGlassesStore} from "../stores/glasses"
|
|
17
|
+
import {getKnownNotificationApps} from "../services/PhoneNotificationsSync"
|
|
14
18
|
|
|
15
19
|
export const phoneNotifications = {
|
|
16
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Apps to show in the notification filter UI (package/bundle id, name, icon).
|
|
22
|
+
* Android: installed apps. iOS: seeded catalog ∪ glasses-reported apps
|
|
23
|
+
* (icons unavailable — iOS offers no cross-app icon lookup).
|
|
24
|
+
*/
|
|
17
25
|
installedApps: (): Promise<Array<{packageName: string; appName: string; icon: string | null}>> => {
|
|
18
|
-
if (Platform.OS
|
|
19
|
-
return
|
|
26
|
+
if (Platform.OS === "android") return CrustModule.getInstalledApps()
|
|
27
|
+
if (Platform.OS !== "ios") return Promise.resolve([])
|
|
28
|
+
return Promise.resolve(
|
|
29
|
+
getKnownNotificationApps().map((app) => ({
|
|
30
|
+
packageName: app.appId,
|
|
31
|
+
appName: app.displayName,
|
|
32
|
+
icon: null,
|
|
33
|
+
})),
|
|
34
|
+
)
|
|
20
35
|
},
|
|
21
36
|
|
|
22
|
-
/** The per-app blocklist (package
|
|
37
|
+
/** The per-app blocklist (package/bundle ids whose notifications are NOT forwarded). */
|
|
23
38
|
blocklist: (): string[] => {
|
|
24
39
|
const b = useSettingsStore.getState().getSetting(SETTINGS.notifications_blocklist.key)
|
|
25
40
|
return Array.isArray(b) ? b : []
|
|
@@ -38,4 +53,11 @@ export const phoneNotifications = {
|
|
|
38
53
|
if (Platform.OS !== "android") return
|
|
39
54
|
return CrustModule.openNotificationListenerSettings()
|
|
40
55
|
},
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* iOS: whether the connected glasses may read the phone's ANCS notification
|
|
59
|
+
* stream (the "Share System Notifications" Bluetooth consent). Always false
|
|
60
|
+
* on Android — Android capture is the notification listener instead.
|
|
61
|
+
*/
|
|
62
|
+
ancsAuthorized: (): boolean => Boolean(useGlassesStore.getState().ancsAuthorized),
|
|
41
63
|
}
|
package/src/facades/speakers.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* store push back to native happens via SpeakerIdSync.
|
|
14
14
|
*/
|
|
15
15
|
import BluetoothSdk from "@glassly/bluetooth-sdk/internal"
|
|
16
|
-
import type {SpeakerEnrollProgressEvent, SpeakerEnrollResultEvent} from "@glassly/bluetooth-sdk
|
|
16
|
+
import type {SpeakerEnrollProgressEvent, SpeakerEnrollResultEvent} from "@glassly/bluetooth-sdk"
|
|
17
17
|
|
|
18
18
|
import speakerIdModelManager, {type SpeakerIdModelProgress} from "../services/SpeakerIdModelManager"
|
|
19
19
|
import type {SpeakerProfile} from "../services/SpeakerProfileStore"
|
package/src/facades/speech.ts
CHANGED
|
@@ -7,25 +7,39 @@
|
|
|
7
7
|
import BluetoothSdk from "@glassly/bluetooth-sdk/internal"
|
|
8
8
|
import sttModelManager from "../services/STTModelManager"
|
|
9
9
|
import ttsModelManager from "../services/TTSModelManager"
|
|
10
|
-
import offlineSpeechModelService
|
|
10
|
+
import offlineSpeechModelService, {
|
|
11
|
+
type DownloadStatus as OfflineModelDownloadStatus,
|
|
12
|
+
} from "../services/OfflineSpeechModelService"
|
|
11
13
|
import sonioxDirectService from "../services/soniox/SonioxDirectService"
|
|
14
|
+
import type {
|
|
15
|
+
DownloadProgress as SttDownloadProgress,
|
|
16
|
+
ExtractionProgress as SttExtractionProgress,
|
|
17
|
+
LanguageConfig as SttLanguageConfig,
|
|
18
|
+
LanguageInfo as SttLanguageInfo,
|
|
19
|
+
} from "../services/STTModelManager"
|
|
12
20
|
|
|
13
21
|
export const speech = {
|
|
14
22
|
/** Restart the glasses' on-device transcriber (e.g. after switching STT language). */
|
|
15
23
|
restartTranscriber: (): Promise<void> => BluetoothSdk.restartTranscriber(),
|
|
16
24
|
stt: {
|
|
17
25
|
currentLanguage: () => sttModelManager.getCurrentLanguage(),
|
|
18
|
-
languages: () => sttModelManager.getAvailableLanguages(),
|
|
19
|
-
languageInfo: () => sttModelManager.getAllLanguageInfo(),
|
|
20
|
-
download: (
|
|
26
|
+
languages: (): SttLanguageConfig[] => sttModelManager.getAvailableLanguages(),
|
|
27
|
+
languageInfo: (): Promise<SttLanguageInfo[]> => sttModelManager.getAllLanguageInfo(),
|
|
28
|
+
download: (
|
|
29
|
+
...args: [
|
|
30
|
+
code?: string,
|
|
31
|
+
onProgress?: (progress: SttDownloadProgress) => void,
|
|
32
|
+
onExtractionProgress?: (progress: SttExtractionProgress) => void,
|
|
33
|
+
]
|
|
34
|
+
): Promise<void> => sttModelManager.downloadModel(...args),
|
|
21
35
|
activate: (code: string) => sttModelManager.setCurrentLanguage(code),
|
|
22
36
|
cancelDownload: () => sttModelManager.cancelDownload(),
|
|
23
37
|
deleteModel: (...args: Parameters<typeof sttModelManager.deleteModel>) => sttModelManager.deleteModel(...args),
|
|
24
38
|
/** Current auto-download status of the offline STT model. */
|
|
25
|
-
status: () => offlineSpeechModelService.getStatus(),
|
|
39
|
+
status: (): OfflineModelDownloadStatus | null => offlineSpeechModelService.getStatus(),
|
|
26
40
|
/** Subscribe to auto-download status changes; returns an unsubscribe. */
|
|
27
|
-
onStatusChanged: (
|
|
28
|
-
offlineSpeechModelService.subscribe(
|
|
41
|
+
onStatusChanged: (listener: (status: OfflineModelDownloadStatus | null) => void): (() => void) =>
|
|
42
|
+
offlineSpeechModelService.subscribe(listener),
|
|
29
43
|
},
|
|
30
44
|
/** Phone → Soniox direct transcription (user-supplied API key, Settings > Keys). */
|
|
31
45
|
sonioxDirect: {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Generated by release CI. Do not edit in a release checkout. */
|
|
2
|
+
export interface EngineReleaseMetadata {
|
|
3
|
+
schemaVersion: 1
|
|
4
|
+
familyBaseVersion: string | null
|
|
5
|
+
releaseIdentity: string | null
|
|
6
|
+
releaseSetId: string | null
|
|
7
|
+
sourceCommit: string | null
|
|
8
|
+
otaManifestUrl: string | null
|
|
9
|
+
otaManifestSha256: string | null
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const ENGINE_RELEASE_METADATA: Readonly<EngineReleaseMetadata> = Object.freeze({
|
|
13
|
+
"schemaVersion": 1,
|
|
14
|
+
"familyBaseVersion": "0.1.0",
|
|
15
|
+
"releaseIdentity": "0.1.0-dev.100",
|
|
16
|
+
"releaseSetId": "glassly-0.1.0-dev.100",
|
|
17
|
+
"sourceCommit": "5759886304d66eec8e3088937b3b650fab1283b7",
|
|
18
|
+
"otaManifestUrl": null,
|
|
19
|
+
"otaManifestSha256": null
|
|
20
|
+
})
|
package/src/index.ts
CHANGED
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
* renders with (decision functions, sort/order helpers, policy constants,
|
|
7
7
|
* capability tables, timers). Judgment rule: read models, commands, pure
|
|
8
8
|
* functions and types belong here; anything that mutates runtime state or
|
|
9
|
-
* exposes a raw store/service
|
|
10
|
-
* (migration-era surface) or `@glassly/engine/devtools` (debug-only) instead.
|
|
9
|
+
* exposes a raw store/service remains private to the GlasslyOS host.
|
|
11
10
|
* See cloud-v2/docs/issues/020-glasses-status-boundary/integration-review.md §D.
|
|
12
11
|
*/
|
|
13
12
|
|
|
@@ -43,6 +42,13 @@ export type {
|
|
|
43
42
|
// device-model key helpers. The raw useSettingsStore stays internal;
|
|
44
43
|
// imperative access goes through engine.settings.
|
|
45
44
|
export {SETTINGS, useSetting} from "./stores/settings"
|
|
45
|
+
export {
|
|
46
|
+
isCustomDashboardEligible,
|
|
47
|
+
normalizeDashboardWidgets,
|
|
48
|
+
DASHBOARD_WIDGET_IDS,
|
|
49
|
+
type DashboardWidgetId,
|
|
50
|
+
type DashboardWidgetSetting,
|
|
51
|
+
} from "./services/CustomDashboardModel"
|
|
46
52
|
|
|
47
53
|
// AI tier registry: the curated per-tier model dropdown options and helpers
|
|
48
54
|
// the Settings > AI Models screen renders. Resolution itself runs inside
|
|
@@ -103,6 +109,7 @@ export {
|
|
|
103
109
|
GLOBAL_OTA_TIMEOUT_MS,
|
|
104
110
|
PING_INTERVAL_MS,
|
|
105
111
|
QUERY_REPLY_TIMEOUT_MS,
|
|
112
|
+
BES_RESTART_TIMEOUT_MS,
|
|
106
113
|
OtaProgressMessages,
|
|
107
114
|
} from "./services/otaInstallPolicy"
|
|
108
115
|
export {deriveDisplayState} from "./services/otaDisplayState"
|
|
@@ -112,9 +119,28 @@ export type {
|
|
|
112
119
|
OtaProgressStatus,
|
|
113
120
|
OtaStatus,
|
|
114
121
|
OtaUpdateInfo,
|
|
122
|
+
ReleaseChangelog,
|
|
115
123
|
OtaSnapshot,
|
|
116
124
|
OtaInstallSnapshot,
|
|
117
125
|
} from "./facades/ota"
|
|
126
|
+
export {
|
|
127
|
+
beginOtaAutoChain,
|
|
128
|
+
clearOtaAutoChainReconnectWait,
|
|
129
|
+
isOtaAutoChainActive,
|
|
130
|
+
otaAutoChainFingerprint,
|
|
131
|
+
otaAutoChainReconnectWaitRemaining,
|
|
132
|
+
stopOtaAutoChain,
|
|
133
|
+
tryAdvanceOtaAutoChain,
|
|
134
|
+
MAX_OTA_AUTO_CHAIN_PASSES,
|
|
135
|
+
OTA_AUTO_CHAIN_RECONNECT_TIMEOUT_MS,
|
|
136
|
+
} from "./services/OtaAutoChain"
|
|
137
|
+
export type {OtaAutoChainAdvanceResult} from "./services/OtaAutoChain"
|
|
138
|
+
export {
|
|
139
|
+
BES_INSTALL_RESTART_MESSAGE,
|
|
140
|
+
getOtaErrorMessage,
|
|
141
|
+
shouldRequireGlassesRebootForBesFailure,
|
|
142
|
+
shouldShowChangeWifiForOtaDownloadFailure,
|
|
143
|
+
} from "./services/OtaErrorMapping"
|
|
118
144
|
|
|
119
145
|
// Gallery read models: engine.gallery.onNotice payload types, the media
|
|
120
146
|
// permission helper + display-name derivation host gallery UI uses, and the
|
|
@@ -134,7 +160,7 @@ export type {
|
|
|
134
160
|
|
|
135
161
|
// Bluetooth SDK event types host UI subscribes to via engine facades (the
|
|
136
162
|
// BluetoothSdk singleton passthrough itself is internal).
|
|
137
|
-
export type {PairFailureEvent, GlassesNotReadyEvent} from "@glassly/bluetooth-sdk
|
|
163
|
+
export type {PairFailureEvent, GlassesNotReadyEvent} from "@glassly/bluetooth-sdk"
|
|
138
164
|
|
|
139
165
|
// Cloud connection status enum (read model; the connection store is internal).
|
|
140
166
|
export {WebSocketStatus} from "./stores/connection"
|
|
@@ -179,7 +205,7 @@ export {
|
|
|
179
205
|
export {HardwareCompatibility, type CompatibilityResult} from "./utils/hardware"
|
|
180
206
|
export {BgTimer, throttle, debounce} from "./utils/timers"
|
|
181
207
|
|
|
182
|
-
//
|
|
208
|
+
// Hardware types and capability profiles.
|
|
183
209
|
export {
|
|
184
210
|
HardwareType,
|
|
185
211
|
HardwareRequirementLevel,
|
|
@@ -191,9 +217,9 @@ export {
|
|
|
191
217
|
evenRealitiesG1,
|
|
192
218
|
evenRealitiesG2,
|
|
193
219
|
mentraLive,
|
|
220
|
+
nimo,
|
|
194
221
|
vuzixZ100,
|
|
195
222
|
mentraDisplay,
|
|
196
|
-
nimo,
|
|
197
223
|
} from "./types"
|
|
198
224
|
export type {
|
|
199
225
|
HardwareRequirement,
|