@mentra/engine 3.1.0-dev.10 → 3.1.0-dev.101
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 +24 -6
- 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/engine.d.ts +5 -2
- package/build/engine.d.ts.map +1 -1
- package/build/facades/ota.d.ts +12 -7
- package/build/facades/ota.d.ts.map +1 -1
- package/build/facades/ota.js +10 -6
- 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 +81 -7
- package/build/facades/pairing.js.map +1 -1
- package/build/generated/releaseMetadata.js +5 -5
- package/build/generated/releaseMetadata.js.map +1 -1
- package/build/index.d.ts +3 -3
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/react/MentraLiveOtaFlow.d.ts +8 -2
- package/build/react/MentraLiveOtaFlow.d.ts.map +1 -1
- package/build/react/MentraLiveOtaFlow.js +256 -354
- package/build/react/MentraLiveOtaFlow.js.map +1 -1
- package/build/react/index.d.ts +1 -0
- package/build/react/index.d.ts.map +1 -1
- package/build/react/index.js +1 -0
- package/build/react/index.js.map +1 -1
- 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/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/DisplayProcessor.d.ts +3 -3
- package/build/services/DisplayProcessor.js +3 -3
- package/build/services/DisplayProcessor.js.map +1 -1
- package/build/services/GlassesStatusProjection.d.ts +15 -2
- package/build/services/GlassesStatusProjection.d.ts.map +1 -1
- package/build/services/GlassesStatusProjection.js +3 -3
- 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 +2 -3
- package/build/services/LocalDisplayManager.d.ts.map +1 -1
- package/build/services/LocalDisplayManager.js +2 -3
- package/build/services/LocalDisplayManager.js.map +1 -1
- package/build/services/OtaAutoChain.d.ts +9 -2
- package/build/services/OtaAutoChain.d.ts.map +1 -1
- package/build/services/OtaAutoChain.js +10 -2
- package/build/services/OtaAutoChain.js.map +1 -1
- package/build/services/OtaInstallCoordinator.d.ts +26 -3
- package/build/services/OtaInstallCoordinator.d.ts.map +1 -1
- package/build/services/OtaInstallCoordinator.js +35 -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 +21 -5
- package/build/services/OtaUpdateCheckService.js.map +1 -1
- package/build/services/PhonePhotoCoordinator.js +1 -1
- package/build/services/PhonePhotoCoordinator.js.map +1 -1
- package/build/services/StreamLifecycleController.d.ts +3 -3
- package/build/services/StreamLifecycleController.js +3 -3
- 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/glassesClockSync.js +1 -1
- package/build/services/glassesClockSync.js.map +1 -1
- package/build/services/otaInstallPolicy.d.ts +4 -0
- 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/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/glasses.d.ts +10 -4
- package/build/stores/glasses.d.ts.map +1 -1
- package/build/stores/glasses.js.map +1 -1
- package/build/types/applet.d.ts +1 -1
- package/build/types/applet.js +1 -1
- package/build/types/applet.js.map +1 -1
- package/build/types/capabilities/even-realities-g1.d.ts.map +1 -1
- package/build/types/capabilities/even-realities-g1.js +2 -0
- package/build/types/capabilities/even-realities-g1.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 -0
- package/build/types/capabilities/even-realities-g2.js.map +1 -1
- package/build/types/capabilities/mentra-display.d.ts.map +1 -1
- package/build/types/capabilities/mentra-display.js +2 -0
- package/build/types/capabilities/mentra-display.js.map +1 -1
- package/build/types/capabilities/mentra-live.d.ts.map +1 -1
- package/build/types/capabilities/mentra-live.js +2 -0
- package/build/types/capabilities/mentra-live.js.map +1 -1
- package/build/types/capabilities/nimo.d.ts +9 -0
- package/build/types/capabilities/nimo.d.ts.map +1 -0
- package/build/types/capabilities/nimo.js +57 -0
- package/build/types/capabilities/nimo.js.map +1 -0
- package/build/types/capabilities/none.d.ts.map +1 -1
- package/build/types/capabilities/none.js +2 -0
- package/build/types/capabilities/none.js.map +1 -1
- package/build/types/capabilities/simulated-glasses.d.ts.map +1 -1
- package/build/types/capabilities/simulated-glasses.js +2 -0
- package/build/types/capabilities/simulated-glasses.js.map +1 -1
- package/build/types/capabilities/vuzix-z100.d.ts.map +1 -1
- package/build/types/capabilities/vuzix-z100.js +2 -0
- package/build/types/capabilities/vuzix-z100.js.map +1 -1
- package/build/types/enums.d.ts +2 -1
- 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 +3 -2
- package/build/types/hardware.d.ts.map +1 -1
- package/build/types/hardware.js +3 -1
- package/build/types/hardware.js.map +1 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/index.js +1 -1
- 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/package.json +13 -6
- package/src/bluetooth-sdk/ota-transport.ts +1 -0
- package/src/facades/ota.ts +20 -7
- package/src/facades/pairing.ts +88 -12
- package/src/generated/releaseMetadata.ts +5 -5
- package/src/index.ts +3 -0
- package/src/react/MentraLiveOtaFlow.tsx +378 -480
- package/src/react/index.ts +14 -0
- package/src/react/useMentraLiveOta.ts +793 -0
- package/src/services/BlobStore.ts +57 -10
- package/src/services/DisplayProcessor.ts +3 -3
- package/src/services/GlassesStatusProjection.ts +7 -6
- package/src/services/HotspotOtaTransport.ts +8 -7
- package/src/services/LocalDisplayManager.ts +2 -3
- package/src/services/OtaAutoChain.ts +26 -2
- package/src/services/OtaInstallCoordinator.ts +37 -13
- package/src/services/OtaService.ts +1 -2
- package/src/services/OtaUpdateCheckService.ts +26 -8
- package/src/services/PhonePhotoCoordinator.ts +1 -1
- package/src/services/StreamLifecycleController.ts +3 -3
- package/src/services/asg/localNetworkTransport.ts +20 -19
- package/src/services/glassesClockSync.ts +1 -1
- package/src/services/otaInstallPolicy.ts +4 -0
- 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/glasses.ts +13 -6
- package/src/types/applet.ts +1 -1
- package/src/types/capabilities/even-realities-g1.ts +3 -0
- package/src/types/capabilities/even-realities-g2.ts +3 -0
- package/src/types/capabilities/mentra-display.ts +3 -0
- package/src/types/capabilities/mentra-live.ts +3 -0
- package/src/types/capabilities/nimo.ts +59 -0
- package/src/types/capabilities/none.ts +3 -0
- package/src/types/capabilities/simulated-glasses.ts +3 -0
- package/src/types/capabilities/vuzix-z100.ts +3 -0
- package/src/types/enums.ts +1 -0
- package/src/types/hardware.ts +4 -2
- package/src/types/index.ts +1 -0
- package/src/utils/display/composer/ColumnComposer.ts +1 -1
package/src/facades/pairing.ts
CHANGED
|
@@ -13,6 +13,7 @@ import BluetoothSdk from "@mentra/bluetooth-sdk/internal"
|
|
|
13
13
|
import type {ConnectOptions, Device, DeviceModel, PairFailureEvent, GlassesNotReadyEvent} from "@mentra/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) ---
|
|
@@ -12,9 +12,9 @@ export interface EngineReleaseMetadata {
|
|
|
12
12
|
export const ENGINE_RELEASE_METADATA: Readonly<EngineReleaseMetadata> = Object.freeze({
|
|
13
13
|
"schemaVersion": 1,
|
|
14
14
|
"familyBaseVersion": "3.1.0",
|
|
15
|
-
"releaseIdentity": "3.1.0-dev.
|
|
16
|
-
"releaseSetId": "mentra-3.1.0-dev.
|
|
17
|
-
"sourceCommit": "
|
|
18
|
-
"otaManifestUrl": "https://github.com/Mentra-Community/MentraOS/releases/download/mentra-v3.1.0
|
|
19
|
-
"otaManifestSha256": "
|
|
15
|
+
"releaseIdentity": "3.1.0-dev.101",
|
|
16
|
+
"releaseSetId": "mentra-3.1.0-dev.101",
|
|
17
|
+
"sourceCommit": "7cbd0579aa228fcfd4d36adda6de1150c3a43647",
|
|
18
|
+
"otaManifestUrl": "https://github.com/Mentra-Community/MentraOS/releases/download/mentra-builds-v3.1.0/mentra-live-ota-3.1.0-dev.101.json",
|
|
19
|
+
"otaManifestSha256": "37c1d4399b7d7a9bf973138bca4035e930df80cf67da828a3e54049ed0034802"
|
|
20
20
|
})
|
package/src/index.ts
CHANGED
|
@@ -89,6 +89,7 @@ export {
|
|
|
89
89
|
GLOBAL_OTA_TIMEOUT_MS,
|
|
90
90
|
PING_INTERVAL_MS,
|
|
91
91
|
QUERY_REPLY_TIMEOUT_MS,
|
|
92
|
+
BES_RESTART_TIMEOUT_MS,
|
|
92
93
|
OtaProgressMessages,
|
|
93
94
|
} from "./services/otaInstallPolicy"
|
|
94
95
|
export {deriveDisplayState} from "./services/otaDisplayState"
|
|
@@ -98,6 +99,7 @@ export type {
|
|
|
98
99
|
OtaProgressStatus,
|
|
99
100
|
OtaStatus,
|
|
100
101
|
OtaUpdateInfo,
|
|
102
|
+
ReleaseChangelog,
|
|
101
103
|
OtaSnapshot,
|
|
102
104
|
OtaInstallSnapshot,
|
|
103
105
|
} from "./facades/ota"
|
|
@@ -195,6 +197,7 @@ export {
|
|
|
195
197
|
evenRealitiesG1,
|
|
196
198
|
evenRealitiesG2,
|
|
197
199
|
mentraLive,
|
|
200
|
+
nimo,
|
|
198
201
|
vuzixZ100,
|
|
199
202
|
mentraDisplay,
|
|
200
203
|
} from "./types"
|