@mentra/engine 3.1.0-dev.33 → 3.1.0-dev.38
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/build/engine.d.ts +2 -0
- package/build/engine.d.ts.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/react/MentraLiveOtaFlow.d.ts.map +1 -1
- package/build/react/MentraLiveOtaFlow.js +17 -0
- package/build/react/MentraLiveOtaFlow.js.map +1 -1
- package/build/react/index.d.ts +1 -1
- package/build/react/index.d.ts.map +1 -1
- package/build/react/index.js.map +1 -1
- package/build/react/useMentraLiveOta.d.ts +8 -0
- package/build/react/useMentraLiveOta.d.ts.map +1 -1
- package/build/react/useMentraLiveOta.js +39 -7
- package/build/react/useMentraLiveOta.js.map +1 -1
- package/build/services/OtaAutoChain.d.ts +3 -1
- package/build/services/OtaAutoChain.d.ts.map +1 -1
- package/build/services/OtaAutoChain.js +3 -1
- package/build/services/OtaAutoChain.js.map +1 -1
- package/build/services/OtaUpdateCheckService.d.ts +3 -0
- package/build/services/OtaUpdateCheckService.d.ts.map +1 -1
- package/build/services/OtaUpdateCheckService.js +12 -0
- package/build/services/OtaUpdateCheckService.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/package.json +6 -6
- package/src/facades/pairing.ts +88 -12
- package/src/generated/releaseMetadata.ts +5 -5
- package/src/react/MentraLiveOtaFlow.tsx +23 -0
- package/src/react/index.ts +1 -0
- package/src/react/useMentraLiveOta.ts +55 -7
- package/src/services/OtaAutoChain.ts +4 -0
- package/src/services/OtaUpdateCheckService.ts +15 -0
- package/src/services/otaReleaseVersion.ts +22 -0
package/build/engine.d.ts
CHANGED
|
@@ -202,6 +202,8 @@ export declare const engine: {
|
|
|
202
202
|
pairing: {
|
|
203
203
|
readiness: () => import("./facades/pairing").PairingReadinessSnapshot;
|
|
204
204
|
onReadiness: (cb: (readiness: import("./facades/pairing").PairingReadinessSnapshot) => void) => (() => void);
|
|
205
|
+
targetReady: (options: Pick<import("./facades/pairing").PairingReadyWaitOptions, "deviceModel" | "deviceName">) => boolean;
|
|
206
|
+
onTargetReady: (options: Pick<import("./facades/pairing").PairingReadyWaitOptions, "deviceModel" | "deviceName">, cb: (ready: boolean) => void) => (() => void);
|
|
205
207
|
identity: () => import(".").IdentitySnapshot;
|
|
206
208
|
onIdentity: (cb: (identity: import(".").IdentitySnapshot) => void) => (() => void);
|
|
207
209
|
markPendingSelection: (model: string) => import("typesafe-ts").AsyncResult<void, Error>;
|
package/build/engine.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAC,SAAS,EAAkD,aAAa,EAAC,MAAM,qBAAqB,CAAA;AAmC5G,eAAO,MAAM,MAAM;IACjB,2EAA2E;;IAE3E,8EAA8E;;IAE9E;iDAC6C;;IA0E7C;;yCAEqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2BrC,mFAAmF;;;;;;;;IAEnF,sEAAsE;;;;;;;;;;;;IAEtE,qFAAqF;;;gBA7FlC,CAAC;mBAAiB,CAAC;;;gBAKhD,CAAC;mBAAiB,CAAC;;;;;;;;;;;;;;;;IA0FzC,qEAAqE;;;;IAErE,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEtF,6EAA6E;;;;;;;;;;;;IAE7E,iFAAiF;;;;;;;;;;;;;;;;;;;IAEjF,8CAA8C
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAC,SAAS,EAAkD,aAAa,EAAC,MAAM,qBAAqB,CAAA;AAmC5G,eAAO,MAAM,MAAM;IACjB,2EAA2E;;IAE3E,8EAA8E;;IAE9E;iDAC6C;;IA0E7C;;yCAEqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2BrC,mFAAmF;;;;;;;;IAEnF,sEAAsE;;;;;;;;;;;;IAEtE,qFAAqF;;;gBA7FlC,CAAC;mBAAiB,CAAC;;;gBAKhD,CAAC;mBAAiB,CAAC;;;;;;;;;;;;;;;;IA0FzC,qEAAqE;;;;IAErE,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEtF,6EAA6E;;;;;;;;;;;;IAE7E,iFAAiF;;;;;;;;;;;;;;;;;;;IAEjF,8CAA8C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAE9C,uDAAuD;;;;;;;;;;;;IAEvD,8EAA8E;;;;;;;IAE9E,qFAAqF;;;;;;;;;;;;;;CAGtF,CAAA"}
|
|
@@ -29,6 +29,10 @@ declare function waitForBluetoothClassic(options?: Pick<PairingReadyWaitOptions,
|
|
|
29
29
|
export declare const pairing: {
|
|
30
30
|
readiness: () => PairingReadinessSnapshot;
|
|
31
31
|
onReadiness: (cb: (readiness: PairingReadinessSnapshot) => void) => (() => void);
|
|
32
|
+
/** Whether the exact wearable or controller selected on the scan screen is ready. */
|
|
33
|
+
targetReady: (options: Pick<PairingReadyWaitOptions, "deviceModel" | "deviceName">) => boolean;
|
|
34
|
+
/** Subscribe to readiness for the exact selected target, excluding stale devices. */
|
|
35
|
+
onTargetReady: (options: Pick<PairingReadyWaitOptions, "deviceModel" | "deviceName">, cb: (ready: boolean) => void) => (() => void);
|
|
32
36
|
/** The identity lifecycle snapshot: none | pending (chosen, never paired) | paired. */
|
|
33
37
|
identity: () => IdentitySnapshot;
|
|
34
38
|
/** Subscribe to identity changes; fires only when the projected snapshot changes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pairing.d.ts","sourceRoot":"","sources":["../../src/facades/pairing.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,oBAAoB,EAAC,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"pairing.d.ts","sourceRoot":"","sources":["../../src/facades/pairing.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,oBAAoB,EAAC,MAAM,uBAAuB,CAAA;AAKtH,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,6BAA6B,CAAA;AAEpC,OAAO,EAGL,KAAK,+BAA+B,EACrC,MAAM,mCAAmC,CAAA;AAK1C,YAAY,EAAC,gBAAgB,EAAC,MAAM,6BAA6B,CAAA;AAEjE,MAAM,WAAW,uBAAuB;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB;AAOD,iBAAS,gBAAgB;;;;;;EASxB;AA8ED,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAE1E,wBAAsB,8BAA8B,CAAC,MAAM,EAAE;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,kBAAkB,EAAE,OAAO,CAAA;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAA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,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC;IAYxD;;;;;;OAMG;mBACkB,MAAM,YAAY,cAAc,KAAG,OAAO,CAAC,IAAI,CAAC;IAIrE,6EAA6E;yBACxD,MAAM,GAAG,IAAI,KAAG,OAAO,CAAC,IAAI,CAAC;IAClD;;;;;;;;OAQG;wCACiC,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;IAE1D;;;;;;;;;;;;;;;;;;OAkBG;0BACuB,OAAO,CAAC,IAAI,CAAC;IAmCvC,6DAA6D;wBACzC,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC;IAIpE,oFAAoF;4BAC5D,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC;IAI5E,sFAAsF;;IAEtF,uEAAuE;;CAExE,CAAA"}
|
package/build/facades/pairing.js
CHANGED
|
@@ -12,11 +12,13 @@
|
|
|
12
12
|
import BluetoothSdk from "@mentra/bluetooth-sdk/internal";
|
|
13
13
|
import { useCoreStore } from "../stores/core";
|
|
14
14
|
import { useGlassesStore } from "../stores/glasses";
|
|
15
|
+
import { SETTINGS, useSettingsStore } from "../stores/settings";
|
|
15
16
|
import { hasDefaultDevice } from "../services/DeviceStoreHydration";
|
|
16
17
|
import { markPendingSelection, projectPairingIdentity, subscribePairingIdentity, } from "../services/PairingIdentity";
|
|
17
|
-
import { isGlassesConnected, isGlassesLinkLayerBusy, isGlassesReady
|
|
18
|
+
import { isGlassesConnected, isGlassesLinkLayerBusy, isGlassesReady } from "../services/GlassesReadiness";
|
|
18
19
|
import { logAutomaticReportSubmissionStatus, toAutomaticReportSubmissionStatus, } from "../services/AutomaticReportResult";
|
|
19
20
|
import { pushAllBluetoothSettings } from "../services/GlassesSettingsSync";
|
|
21
|
+
import { ControllerTypes } from "../types";
|
|
20
22
|
import { submitAutomaticReport } from "./reports";
|
|
21
23
|
const DEFAULT_PAIRING_BOOT_TIMEOUT_MS = 35_000;
|
|
22
24
|
const DEFAULT_BT_CLASSIC_TIMEOUT_MS = 1_000;
|
|
@@ -32,6 +34,79 @@ function projectReadiness() {
|
|
|
32
34
|
nativeLinkBusy: isGlassesLinkLayerBusy(s.connection),
|
|
33
35
|
};
|
|
34
36
|
}
|
|
37
|
+
function projectTargetReady(options) {
|
|
38
|
+
const { deviceModel, deviceName } = options;
|
|
39
|
+
const glasses = useGlassesStore.getState();
|
|
40
|
+
if (deviceModel === ControllerTypes.R1) {
|
|
41
|
+
if (!glasses.controllerConnected || !glasses.controllerFullyBooted)
|
|
42
|
+
return false;
|
|
43
|
+
const settings = useSettingsStore.getState();
|
|
44
|
+
const pairedModel = settings.getSetting(SETTINGS.default_controller.key);
|
|
45
|
+
const pairedName = settings.getSetting(SETTINGS.controller_device_name.key);
|
|
46
|
+
return (!deviceModel || pairedModel === deviceModel) && (!deviceName || pairedName === deviceName);
|
|
47
|
+
}
|
|
48
|
+
if (!isGlassesReady(glasses.connection))
|
|
49
|
+
return false;
|
|
50
|
+
const identity = projectPairingIdentity();
|
|
51
|
+
if (!deviceModel && !deviceName)
|
|
52
|
+
return true;
|
|
53
|
+
return (identity.kind === "paired" &&
|
|
54
|
+
(!deviceModel || identity.model === deviceModel) &&
|
|
55
|
+
(!deviceName || identity.name === deviceName));
|
|
56
|
+
}
|
|
57
|
+
function subscribeTargetReady(options, cb) {
|
|
58
|
+
let last = projectTargetReady(options);
|
|
59
|
+
const notify = () => {
|
|
60
|
+
const ready = projectTargetReady(options);
|
|
61
|
+
if (ready === last)
|
|
62
|
+
return;
|
|
63
|
+
last = ready;
|
|
64
|
+
cb(ready);
|
|
65
|
+
};
|
|
66
|
+
const unsubscribeGlasses = useGlassesStore.subscribe(notify);
|
|
67
|
+
const unsubscribeSettings = useSettingsStore.subscribe(notify);
|
|
68
|
+
return () => {
|
|
69
|
+
unsubscribeGlasses();
|
|
70
|
+
unsubscribeSettings();
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
async function waitForTargetReady(options, timeoutMs) {
|
|
74
|
+
return new Promise((resolve) => {
|
|
75
|
+
if (options.signal?.aborted) {
|
|
76
|
+
resolve(false);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (projectTargetReady(options)) {
|
|
80
|
+
resolve(true);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
let settled = false;
|
|
84
|
+
let timeout = null;
|
|
85
|
+
let unsubscribe = null;
|
|
86
|
+
let onAbort = null;
|
|
87
|
+
const finish = (ready) => {
|
|
88
|
+
if (settled)
|
|
89
|
+
return;
|
|
90
|
+
settled = true;
|
|
91
|
+
if (timeout)
|
|
92
|
+
clearTimeout(timeout);
|
|
93
|
+
if (unsubscribe)
|
|
94
|
+
unsubscribe();
|
|
95
|
+
if (onAbort && options.signal)
|
|
96
|
+
options.signal.removeEventListener("abort", onAbort);
|
|
97
|
+
resolve(ready);
|
|
98
|
+
};
|
|
99
|
+
unsubscribe = subscribeTargetReady(options, (ready) => {
|
|
100
|
+
if (ready)
|
|
101
|
+
finish(true);
|
|
102
|
+
});
|
|
103
|
+
if (options.signal) {
|
|
104
|
+
onAbort = () => finish(false);
|
|
105
|
+
options.signal.addEventListener("abort", onAbort);
|
|
106
|
+
}
|
|
107
|
+
timeout = setTimeout(() => finish(projectTargetReady(options)), timeoutMs);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
35
110
|
export async function submitPairingBootTimeoutReport(params) {
|
|
36
111
|
const { deviceModel, deviceName, showGlassesBooting, elapsedMs, route = DEFAULT_PAIRING_ROUTE } = params;
|
|
37
112
|
const result = await submitAutomaticReport({
|
|
@@ -65,12 +140,7 @@ async function waitForReadyDuringPairing(options = {}) {
|
|
|
65
140
|
showGlassesBooting = true;
|
|
66
141
|
});
|
|
67
142
|
try {
|
|
68
|
-
const ready = await
|
|
69
|
-
getConnection: () => useGlassesStore.getState().connection,
|
|
70
|
-
subscribe: (listener) => useGlassesStore.subscribe((state) => state.connection, listener),
|
|
71
|
-
timeoutMs,
|
|
72
|
-
signal: options.signal,
|
|
73
|
-
});
|
|
143
|
+
const ready = await waitForTargetReady(options, timeoutMs);
|
|
74
144
|
if (!ready && !options.signal?.aborted) {
|
|
75
145
|
void submitPairingBootTimeoutReport({
|
|
76
146
|
deviceModel: options.deviceModel,
|
|
@@ -142,6 +212,10 @@ export const pairing = {
|
|
|
142
212
|
cb(snap);
|
|
143
213
|
});
|
|
144
214
|
},
|
|
215
|
+
/** Whether the exact wearable or controller selected on the scan screen is ready. */
|
|
216
|
+
targetReady: (options) => projectTargetReady(options),
|
|
217
|
+
/** Subscribe to readiness for the exact selected target, excluding stale devices. */
|
|
218
|
+
onTargetReady: (options, cb) => subscribeTargetReady(options, cb),
|
|
145
219
|
// --- pairing-identity lifecycle (the PairingIdentity read-model + the JS-owned
|
|
146
220
|
// identity writes; promotion to `paired` only ever happens natively) ---
|
|
147
221
|
/** The identity lifecycle snapshot: none | pending (chosen, never paired) | paired. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pairing.js","sourceRoot":"","sources":["../../src/facades/pairing.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,0EAA0E;AAC1E,4EAA4E;AAC5E,wCAAwC;AACxC,OAAO,YAAY,MAAM,gCAAgC,CAAA;AAEzD,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAC,gBAAgB,EAAC,MAAM,kCAAkC,CAAA;AACjE,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,GAEzB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,cAAc,EACd,mBAAmB,GACpB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACL,kCAAkC,EAClC,iCAAiC,GAElC,MAAM,mCAAmC,CAAA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EAAE,yBAAyB;IACvC,uEAAuE;IACvE,uBAAuB;CACxB,CAAA","sourcesContent":["/**\n * pairing facade — `engine.pairing`: scan for nearby glasses + pair. Scan state\n * (searching + results) comes from the engine core store; scan/connect go over the\n * bluetooth-sdk; pair-failure / not-ready are the bluetooth-sdk events.\n *\n * (Connect-the-already-paired-default is `engine.glasses.connectDefault()`; this\n * facade is the first-time discovery + pair flow.)\n */\n// Internal btsdk surface — updateBluetoothSettings (the Bluetooth Classic\n// target hint) lives on the full surface, not the public entry (same reason\n// the glasses facade imports internal).\nimport BluetoothSdk from \"@mentra/bluetooth-sdk/internal\"\nimport type {ConnectOptions, Device, DeviceModel, PairFailureEvent, GlassesNotReadyEvent} from \"@mentra/bluetooth-sdk\"\nimport {useCoreStore} from \"../stores/core\"\nimport {useGlassesStore} from \"../stores/glasses\"\nimport {hasDefaultDevice} from \"../services/DeviceStoreHydration\"\nimport {\n markPendingSelection,\n projectPairingIdentity,\n subscribePairingIdentity,\n type IdentitySnapshot,\n} from \"../services/PairingIdentity\"\nimport {\n isGlassesConnected,\n isGlassesLinkLayerBusy,\n isGlassesReady,\n waitForGlassesReady,\n} from \"../services/GlassesReadiness\"\nimport {\n logAutomaticReportSubmissionStatus,\n toAutomaticReportSubmissionStatus,\n type AutomaticReportSubmissionStatus,\n} from \"../services/AutomaticReportResult\"\nimport {pushAllBluetoothSettings} from \"../services/GlassesSettingsSync\"\nimport {submitAutomaticReport} from \"./reports\"\n\nexport type {IdentitySnapshot} from \"../services/PairingIdentity\"\n\nexport interface PairingReadyWaitOptions {\n deviceModel?: string\n deviceName?: string\n timeoutMs?: number\n route?: string\n signal?: AbortSignal\n}\n\nconst DEFAULT_PAIRING_BOOT_TIMEOUT_MS = 35_000\nconst DEFAULT_BT_CLASSIC_TIMEOUT_MS = 1_000\nconst DEFAULT_PAIRING_ROUTE = \"/pairing/loading\"\nconst LOG_TAG = \"PairingTimeoutReport\"\n\nfunction projectReadiness() {\n const s = useGlassesStore.getState()\n return {\n state: s.connection.state,\n connected: s.connection.state === \"connected\",\n fullyBooted: isGlassesReady(s.connection),\n bluetoothClassicConnected: s.bluetoothClassicConnected,\n nativeLinkBusy: isGlassesLinkLayerBusy(s.connection),\n }\n}\n\nexport type PairingReadinessSnapshot = ReturnType<typeof projectReadiness>\n\nexport async function submitPairingBootTimeoutReport(params: {\n deviceModel?: string\n deviceName?: string\n showGlassesBooting: boolean\n elapsedMs: number\n route?: string\n}): Promise<AutomaticReportSubmissionStatus> {\n const {deviceModel, deviceName, showGlassesBooting, elapsedMs, route = DEFAULT_PAIRING_ROUTE} = params\n const result = await submitAutomaticReport({\n kind: \"automatic\",\n trigger: {\n type: \"automatic\",\n source: \"pairing_loading\",\n reason: \"glasses_connect_timeout\",\n },\n report: {\n expectedBehavior: `Glasses should connect successfully within ${Math.round(elapsedMs / 1000)} seconds.`,\n actualBehavior: JSON.stringify(\n {\n deviceModel,\n deviceName,\n showGlassesBooting,\n elapsedMs,\n route,\n },\n null,\n 2,\n ),\n systemPriority: \"medium\",\n },\n throttleKey: `pairing_timeout|${deviceModel || \"unknown\"}|${deviceName || \"unknown\"}`,\n })\n\n const status = toAutomaticReportSubmissionStatus(result)\n logAutomaticReportSubmissionStatus(LOG_TAG, status, deviceModel, deviceName)\n return status\n}\n\nasync function waitForReadyDuringPairing(options: PairingReadyWaitOptions = {}): Promise<boolean> {\n const timeoutMs = options.timeoutMs ?? DEFAULT_PAIRING_BOOT_TIMEOUT_MS\n let showGlassesBooting = false\n const notReadySub = BluetoothSdk.addListener(\"glasses_not_ready\", () => {\n showGlassesBooting = true\n })\n\n try {\n const ready = await waitForGlassesReady({\n getConnection: () => useGlassesStore.getState().connection,\n subscribe: (listener) => useGlassesStore.subscribe((state) => state.connection, listener),\n timeoutMs,\n signal: options.signal,\n })\n\n if (!ready && !options.signal?.aborted) {\n void submitPairingBootTimeoutReport({\n deviceModel: options.deviceModel,\n deviceName: options.deviceName,\n showGlassesBooting,\n elapsedMs: timeoutMs,\n route: options.route,\n }).catch((error) => {\n console.error(`[${LOG_TAG}] Unexpected error:`, error)\n })\n }\n\n return ready\n } finally {\n notReadySub.remove()\n }\n}\n\nasync function waitForBluetoothClassic(\n options: Pick<PairingReadyWaitOptions, \"timeoutMs\" | \"signal\"> = {},\n): Promise<boolean> {\n const timeoutMs = options.timeoutMs ?? DEFAULT_BT_CLASSIC_TIMEOUT_MS\n return new Promise((resolve) => {\n if (options.signal?.aborted) {\n resolve(false)\n return\n }\n\n const initial = useGlassesStore.getState().bluetoothClassicConnected\n if (initial) {\n resolve(true)\n return\n }\n\n let settled = false\n let timeout: ReturnType<typeof setTimeout> | null = null\n let unsubscribe: (() => void) | null = null\n let onAbort: (() => void) | null = null\n\n const finish = (value: boolean) => {\n if (settled) return\n settled = true\n if (timeout) clearTimeout(timeout)\n if (unsubscribe) unsubscribe()\n if (onAbort && options.signal) options.signal.removeEventListener(\"abort\", onAbort)\n resolve(value)\n }\n\n if (options.signal) {\n onAbort = () => finish(false)\n options.signal.addEventListener(\"abort\", onAbort)\n }\n\n unsubscribe = useGlassesStore.subscribe(\n (s) => s.bluetoothClassicConnected,\n (connected) => {\n if (connected) finish(true)\n },\n )\n\n timeout = setTimeout(() => {\n finish(useGlassesStore.getState().bluetoothClassicConnected)\n }, timeoutMs)\n })\n}\n\nexport const pairing = {\n readiness: (): PairingReadinessSnapshot => projectReadiness(),\n onReadiness: (cb: (readiness: PairingReadinessSnapshot) => void): (() => void) => {\n let last = JSON.stringify(projectReadiness())\n return useGlassesStore.subscribe(() => {\n const snap = projectReadiness()\n const key = JSON.stringify(snap)\n if (key === last) return\n last = key\n cb(snap)\n })\n },\n\n // --- pairing-identity lifecycle (the PairingIdentity read-model + the JS-owned\n // identity writes; promotion to `paired` only ever happens natively) ---\n /** The identity lifecycle snapshot: none | pending (chosen, never paired) | paired. */\n identity: (): IdentitySnapshot => projectPairingIdentity(),\n /** Subscribe to identity changes; fires only when the projected snapshot changes.\n * Returns an unsubscribe. */\n onIdentity: (cb: (identity: IdentitySnapshot) => void): (() => void) => subscribePairingIdentity(cb),\n /** Mark the chosen model as the pending selection (the scan-entry write); the\n * host renders it as a finish-pairing affordance until pairing succeeds. */\n markPendingSelection: (model: string) => markPendingSelection(model),\n\n /** Start scanning for nearby glasses. Results land on `searchResults()`/`onFound()`. */\n scan: (model: DeviceModel): Promise<void> => BluetoothSdk.startScan(model),\n /** Whether a scan is currently in progress. */\n scanning: (): boolean => useCoreStore.getState().searching,\n /** Subscribe to scan-in-progress changes; fires only when it changes. Returns an unsubscribe. */\n onScanning: (cb: (scanning: boolean) => void): (() => void) => useCoreStore.subscribe((s) => s.searching, cb),\n /** Whether a controller scan is currently in progress. */\n scanningController: (): boolean => useCoreStore.getState().searchingController,\n /** Subscribe to controller-scan-in-progress changes; fires only when it changes. Returns an unsubscribe. */\n onScanningController: (cb: (scanning: boolean) => void): (() => void) =>\n useCoreStore.subscribe((s) => s.searchingController, cb),\n /** Whether the phone has another Bluetooth (audio) device connected — the BT Classic pairing hint. */\n otherBtConnected: (): boolean => useCoreStore.getState().otherBtConnected,\n /** Subscribe to other-Bluetooth-device-connected changes; fires only when it changes. Returns an unsubscribe. */\n onOtherBtConnected: (cb: (connected: boolean) => void): (() => void) =>\n useCoreStore.subscribe((s) => s.otherBtConnected, cb),\n /** The current scan results (snapshot). */\n // Copy the array AND each entry: neither the list nor the Device objects may\n // leak as mutable references into the store.\n searchResults: () => useCoreStore.getState().searchResults.map((result) => ({...result})),\n /** Subscribe to scan-result changes; fires only when they change. Returns an unsubscribe. */\n onFound: (cb: (results: Device[]) => void): (() => void) => {\n let last = JSON.stringify(useCoreStore.getState().searchResults)\n return useCoreStore.subscribe(() => {\n const results = useCoreStore.getState().searchResults\n const key = JSON.stringify(results)\n if (key === last) return\n last = key\n // Copy like searchResults(): listeners must not mutate shared scan state.\n cb(results.map((result) => ({...result})))\n })\n },\n\n /**\n * Pair with (connect to) a discovered device. Two-phase identity: the connect\n * attempt only marks the device as pending (`saveAsDefault: false` — no eager\n * default-device write); the native layer promotes it to the default wearable\n * when pairing actually succeeds (handleDeviceReady), so an abandoned or\n * failed attempt can't leave a default identity with no paired device behind.\n */\n pair: async (device: Device, options?: ConnectOptions): Promise<void> => {\n await pushAllBluetoothSettings()\n return BluetoothSdk.connect(device, {...options, saveAsDefault: false})\n },\n /** Set a device as the default for subsequent `glasses.connectDefault()`. */\n setDefault: (device: Device | null): Promise<void> => BluetoothSdk.setDefaultDevice(device),\n /**\n * Prime the native Bluetooth Classic audio watcher with the picked device.\n * The iOS Mentra Live flow pairs Classic audio BEFORE any BLE connect\n * exists, and native detects the pairing by matching the connected audio\n * route against its device_name — which two-phase identity no longer sets\n * at selection time. This is native-only routing state (device_name has no\n * native→JS echo): the phone's persisted identity is untouched, and\n * promotion still happens only at pairing success.\n */\n setBluetoothClassicTarget: (device: Device): Promise<void> =>\n BluetoothSdk.updateBluetoothSettings({device_name: device.name}),\n /**\n * Abandon an in-flight pairing attempt (back-out, failure retry, conflict\n * retry) without destroying an existing pairing. The decision comes from the\n * LIVE hydrated default-device read — never from flow-entry state, because a\n * pairing can PROMOTE while the flow is open (the glasses finish pairing\n * even as the user backs out of the UI), and an entry snapshot would forget\n * that brand-new pairing:\n * - Default device exists and glasses are connected (nothing in flight — an\n * attempt drops the link first): stop the scan, touch nothing else.\n * - Default device exists with an attempt in flight: cancel it, then re-seed\n * the native identity from the phone's persisted settings — the attempt's\n * connect-by-name overwrote the native device_name, so a later\n * connectDefault() would otherwise target the abandoned device.\n * - No default device (genuinely unpaired attempt): also forget, clearing\n * the partial native pairing state.\n * The read fails OPEN to \"preserve\" — a transient failure must never wipe a\n * real pairing. The `pending_wearable` marker is deliberately left alone —\n * the host renders it as a finish-pairing affordance.\n */\n abandonAttempt: async (): Promise<void> => {\n const nativeHasDefault = await hasDefaultDevice().catch(() => true)\n if (nativeHasDefault && isGlassesConnected(useGlassesStore.getState().connection)) {\n // Still connected means no connect attempt is in flight (an attempt drops\n // the existing link first): the user browsed the scan and backed out.\n // Stop the scan and leave the live pairing untouched.\n console.log(\"PairingIdentity: abandonAttempt — pairing intact and connected; stopping scan only\")\n await BluetoothSdk.stopScan()\n return\n }\n if (projectPairingIdentity().kind === \"paired\") {\n // The persisted settings describe a COMPLETE pairing: restore it to\n // native (the attempt's connect-by-name overwrote the native\n // device_name; and if native somehow lost its default entirely, this\n // repairs the divergence instead of forgetting a real pairing).\n console.log(\"PairingIdentity: abandonAttempt — preserving pairing; attempt cancelled, native identity re-seeded\")\n await BluetoothSdk.disconnect()\n await pushAllBluetoothSettings()\n return\n }\n if (nativeHasDefault) {\n // Mid-relay: native promoted and its echoes are still landing — the\n // incomplete JS snapshot must not be pushed over the fresher native\n // identity (the on-connect replay's race). Native holds the truth.\n console.log(\"PairingIdentity: abandonAttempt — preserving pairing; JS identity mid-relay, native kept as-is\")\n await BluetoothSdk.disconnect()\n return\n }\n // Partial attempt: forget owns teardown. Do NOT disconnect() first — that\n // nulls the MentraLive SGC and used to skip Classic removeBond, leaving\n // IBRT ACL up so glasses never re-advertise for the next scan.\n console.log(\"PairingIdentity: abandonAttempt — no pairing on either layer; forgetting the partial attempt\")\n await BluetoothSdk.forget()\n },\n\n /** Subscribe to pairing failures; returns an unsubscribe. */\n onPairFailure: (cb: (event: PairFailureEvent) => void): (() => void) => {\n const sub = BluetoothSdk.addListener(\"pair_failure\", cb)\n return () => sub.remove()\n },\n /** Subscribe to glasses-not-ready events during pairing; returns an unsubscribe. */\n onGlassesNotReady: (cb: (event: GlassesNotReadyEvent) => void): (() => void) => {\n const sub = BluetoothSdk.addListener(\"glasses_not_ready\", cb)\n return () => sub.remove()\n },\n /** Wait for paired glasses to finish booting; engine files the timeout diagnostic. */\n waitForReady: waitForReadyDuringPairing,\n /** Wait briefly for Bluetooth Classic to come up after BLE pairing. */\n waitForBluetoothClassic,\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pairing.js","sourceRoot":"","sources":["../../src/facades/pairing.ts"],"names":[],"mappings":"AAAA;;;;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,OAAM;QACR,CAAC;QACD,IAAI,sBAAsB,EAAE,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC/C,oEAAoE;YACpE,6DAA6D;YAC7D,qEAAqE;YACrE,gEAAgE;YAChE,OAAO,CAAC,GAAG,CAAC,oGAAoG,CAAC,CAAA;YACjH,MAAM,YAAY,CAAC,UAAU,EAAE,CAAA;YAC/B,MAAM,wBAAwB,EAAE,CAAA;YAChC,OAAM;QACR,CAAC;QACD,IAAI,gBAAgB,EAAE,CAAC;YACrB,oEAAoE;YACpE,oEAAoE;YACpE,mEAAmE;YACnE,OAAO,CAAC,GAAG,CAAC,gGAAgG,CAAC,CAAA;YAC7G,MAAM,YAAY,CAAC,UAAU,EAAE,CAAA;YAC/B,OAAM;QACR,CAAC;QACD,0EAA0E;QAC1E,wEAAwE;QACxE,+DAA+D;QAC/D,OAAO,CAAC,GAAG,CAAC,8FAA8F,CAAC,CAAA;QAC3G,MAAM,YAAY,CAAC,MAAM,EAAE,CAAA;IAC7B,CAAC;IAED,6DAA6D;IAC7D,aAAa,EAAE,CAAC,EAAqC,EAAgB,EAAE;QACrE,MAAM,GAAG,GAAG,YAAY,CAAC,WAAW,CAAC,cAAc,EAAE,EAAE,CAAC,CAAA;QACxD,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAA;IAC3B,CAAC;IACD,oFAAoF;IACpF,iBAAiB,EAAE,CAAC,EAAyC,EAAgB,EAAE;QAC7E,MAAM,GAAG,GAAG,YAAY,CAAC,WAAW,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAA;QAC7D,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAA;IAC3B,CAAC;IACD,sFAAsF;IACtF,YAAY,EAAE,yBAAyB;IACvC,uEAAuE;IACvE,uBAAuB;CACxB,CAAA","sourcesContent":["/**\n * pairing facade — `engine.pairing`: scan for nearby glasses + pair. Scan state\n * (searching + results) comes from the engine core store; scan/connect go over the\n * bluetooth-sdk; pair-failure / not-ready are the bluetooth-sdk events.\n *\n * (Connect-the-already-paired-default is `engine.glasses.connectDefault()`; this\n * facade is the first-time discovery + pair flow.)\n */\n// Internal btsdk surface — updateBluetoothSettings (the Bluetooth Classic\n// target hint) lives on the full surface, not the public entry (same reason\n// the glasses facade imports internal).\nimport BluetoothSdk from \"@mentra/bluetooth-sdk/internal\"\nimport type {ConnectOptions, Device, DeviceModel, PairFailureEvent, GlassesNotReadyEvent} from \"@mentra/bluetooth-sdk\"\nimport {useCoreStore} from \"../stores/core\"\nimport {useGlassesStore} from \"../stores/glasses\"\nimport {SETTINGS, useSettingsStore} from \"../stores/settings\"\nimport {hasDefaultDevice} from \"../services/DeviceStoreHydration\"\nimport {\n markPendingSelection,\n projectPairingIdentity,\n subscribePairingIdentity,\n type IdentitySnapshot,\n} from \"../services/PairingIdentity\"\nimport {isGlassesConnected, isGlassesLinkLayerBusy, isGlassesReady} from \"../services/GlassesReadiness\"\nimport {\n logAutomaticReportSubmissionStatus,\n toAutomaticReportSubmissionStatus,\n type AutomaticReportSubmissionStatus,\n} from \"../services/AutomaticReportResult\"\nimport {pushAllBluetoothSettings} from \"../services/GlassesSettingsSync\"\nimport {ControllerTypes} from \"../types\"\nimport {submitAutomaticReport} from \"./reports\"\n\nexport type {IdentitySnapshot} from \"../services/PairingIdentity\"\n\nexport interface PairingReadyWaitOptions {\n deviceModel?: string\n deviceName?: string\n timeoutMs?: number\n route?: string\n signal?: AbortSignal\n}\n\nconst DEFAULT_PAIRING_BOOT_TIMEOUT_MS = 35_000\nconst DEFAULT_BT_CLASSIC_TIMEOUT_MS = 1_000\nconst DEFAULT_PAIRING_ROUTE = \"/pairing/loading\"\nconst LOG_TAG = \"PairingTimeoutReport\"\n\nfunction projectReadiness() {\n const s = useGlassesStore.getState()\n return {\n state: s.connection.state,\n connected: s.connection.state === \"connected\",\n fullyBooted: isGlassesReady(s.connection),\n bluetoothClassicConnected: s.bluetoothClassicConnected,\n nativeLinkBusy: isGlassesLinkLayerBusy(s.connection),\n }\n}\n\nfunction projectTargetReady(options: Pick<PairingReadyWaitOptions, \"deviceModel\" | \"deviceName\">): boolean {\n const {deviceModel, deviceName} = options\n const glasses = useGlassesStore.getState()\n\n if (deviceModel === ControllerTypes.R1) {\n if (!glasses.controllerConnected || !glasses.controllerFullyBooted) return false\n const settings = useSettingsStore.getState()\n const pairedModel = settings.getSetting(SETTINGS.default_controller.key)\n const pairedName = settings.getSetting(SETTINGS.controller_device_name.key)\n return (!deviceModel || pairedModel === deviceModel) && (!deviceName || pairedName === deviceName)\n }\n\n if (!isGlassesReady(glasses.connection)) return false\n const identity = projectPairingIdentity()\n if (!deviceModel && !deviceName) return true\n return (\n identity.kind === \"paired\" &&\n (!deviceModel || identity.model === deviceModel) &&\n (!deviceName || identity.name === deviceName)\n )\n}\n\nfunction subscribeTargetReady(\n options: Pick<PairingReadyWaitOptions, \"deviceModel\" | \"deviceName\">,\n cb: (ready: boolean) => void,\n): () => void {\n let last = projectTargetReady(options)\n const notify = () => {\n const ready = projectTargetReady(options)\n if (ready === last) return\n last = ready\n cb(ready)\n }\n const unsubscribeGlasses = useGlassesStore.subscribe(notify)\n const unsubscribeSettings = useSettingsStore.subscribe(notify)\n return () => {\n unsubscribeGlasses()\n unsubscribeSettings()\n }\n}\n\nasync function waitForTargetReady(options: PairingReadyWaitOptions, timeoutMs: number): Promise<boolean> {\n return new Promise((resolve) => {\n if (options.signal?.aborted) {\n resolve(false)\n return\n }\n if (projectTargetReady(options)) {\n resolve(true)\n return\n }\n\n let settled = false\n let timeout: ReturnType<typeof setTimeout> | null = null\n let unsubscribe: (() => void) | null = null\n let onAbort: (() => void) | null = null\n const finish = (ready: boolean) => {\n if (settled) return\n settled = true\n if (timeout) clearTimeout(timeout)\n if (unsubscribe) unsubscribe()\n if (onAbort && options.signal) options.signal.removeEventListener(\"abort\", onAbort)\n resolve(ready)\n }\n\n unsubscribe = subscribeTargetReady(options, (ready) => {\n if (ready) finish(true)\n })\n if (options.signal) {\n onAbort = () => finish(false)\n options.signal.addEventListener(\"abort\", onAbort)\n }\n timeout = setTimeout(() => finish(projectTargetReady(options)), timeoutMs)\n })\n}\n\nexport type PairingReadinessSnapshot = ReturnType<typeof projectReadiness>\n\nexport async function submitPairingBootTimeoutReport(params: {\n deviceModel?: string\n deviceName?: string\n showGlassesBooting: boolean\n elapsedMs: number\n route?: string\n}): Promise<AutomaticReportSubmissionStatus> {\n const {deviceModel, deviceName, showGlassesBooting, elapsedMs, route = DEFAULT_PAIRING_ROUTE} = params\n const result = await submitAutomaticReport({\n kind: \"automatic\",\n trigger: {\n type: \"automatic\",\n source: \"pairing_loading\",\n reason: \"glasses_connect_timeout\",\n },\n report: {\n expectedBehavior: `Glasses should connect successfully within ${Math.round(elapsedMs / 1000)} seconds.`,\n actualBehavior: JSON.stringify(\n {\n deviceModel,\n deviceName,\n showGlassesBooting,\n elapsedMs,\n route,\n },\n null,\n 2,\n ),\n systemPriority: \"medium\",\n },\n throttleKey: `pairing_timeout|${deviceModel || \"unknown\"}|${deviceName || \"unknown\"}`,\n })\n\n const status = toAutomaticReportSubmissionStatus(result)\n logAutomaticReportSubmissionStatus(LOG_TAG, status, deviceModel, deviceName)\n return status\n}\n\nasync function waitForReadyDuringPairing(options: PairingReadyWaitOptions = {}): Promise<boolean> {\n const timeoutMs = options.timeoutMs ?? DEFAULT_PAIRING_BOOT_TIMEOUT_MS\n let showGlassesBooting = false\n const notReadySub = BluetoothSdk.addListener(\"glasses_not_ready\", () => {\n showGlassesBooting = true\n })\n\n try {\n const ready = await waitForTargetReady(options, timeoutMs)\n\n if (!ready && !options.signal?.aborted) {\n void submitPairingBootTimeoutReport({\n deviceModel: options.deviceModel,\n deviceName: options.deviceName,\n showGlassesBooting,\n elapsedMs: timeoutMs,\n route: options.route,\n }).catch((error) => {\n console.error(`[${LOG_TAG}] Unexpected error:`, error)\n })\n }\n\n return ready\n } finally {\n notReadySub.remove()\n }\n}\n\nasync function waitForBluetoothClassic(\n options: Pick<PairingReadyWaitOptions, \"timeoutMs\" | \"signal\"> = {},\n): Promise<boolean> {\n const timeoutMs = options.timeoutMs ?? DEFAULT_BT_CLASSIC_TIMEOUT_MS\n return new Promise((resolve) => {\n if (options.signal?.aborted) {\n resolve(false)\n return\n }\n\n const initial = useGlassesStore.getState().bluetoothClassicConnected\n if (initial) {\n resolve(true)\n return\n }\n\n let settled = false\n let timeout: ReturnType<typeof setTimeout> | null = null\n let unsubscribe: (() => void) | null = null\n let onAbort: (() => void) | null = null\n\n const finish = (value: boolean) => {\n if (settled) return\n settled = true\n if (timeout) clearTimeout(timeout)\n if (unsubscribe) unsubscribe()\n if (onAbort && options.signal) options.signal.removeEventListener(\"abort\", onAbort)\n resolve(value)\n }\n\n if (options.signal) {\n onAbort = () => finish(false)\n options.signal.addEventListener(\"abort\", onAbort)\n }\n\n unsubscribe = useGlassesStore.subscribe(\n (s) => s.bluetoothClassicConnected,\n (connected) => {\n if (connected) finish(true)\n },\n )\n\n timeout = setTimeout(() => {\n finish(useGlassesStore.getState().bluetoothClassicConnected)\n }, timeoutMs)\n })\n}\n\nexport const pairing = {\n readiness: (): PairingReadinessSnapshot => projectReadiness(),\n onReadiness: (cb: (readiness: PairingReadinessSnapshot) => void): (() => void) => {\n let last = JSON.stringify(projectReadiness())\n return useGlassesStore.subscribe(() => {\n const snap = projectReadiness()\n const key = JSON.stringify(snap)\n if (key === last) return\n last = key\n cb(snap)\n })\n },\n /** Whether the exact wearable or controller selected on the scan screen is ready. */\n targetReady: (options: Pick<PairingReadyWaitOptions, \"deviceModel\" | \"deviceName\">): boolean =>\n projectTargetReady(options),\n /** Subscribe to readiness for the exact selected target, excluding stale devices. */\n onTargetReady: (\n options: Pick<PairingReadyWaitOptions, \"deviceModel\" | \"deviceName\">,\n cb: (ready: boolean) => void,\n ): (() => void) => subscribeTargetReady(options, cb),\n\n // --- pairing-identity lifecycle (the PairingIdentity read-model + the JS-owned\n // identity writes; promotion to `paired` only ever happens natively) ---\n /** The identity lifecycle snapshot: none | pending (chosen, never paired) | paired. */\n identity: (): IdentitySnapshot => projectPairingIdentity(),\n /** Subscribe to identity changes; fires only when the projected snapshot changes.\n * Returns an unsubscribe. */\n onIdentity: (cb: (identity: IdentitySnapshot) => void): (() => void) => subscribePairingIdentity(cb),\n /** Mark the chosen model as the pending selection (the scan-entry write); the\n * host renders it as a finish-pairing affordance until pairing succeeds. */\n markPendingSelection: (model: string) => markPendingSelection(model),\n\n /** Start scanning for nearby glasses. Results land on `searchResults()`/`onFound()`. */\n scan: (model: DeviceModel): Promise<void> => BluetoothSdk.startScan(model),\n /** Whether a scan is currently in progress. */\n scanning: (): boolean => useCoreStore.getState().searching,\n /** Subscribe to scan-in-progress changes; fires only when it changes. Returns an unsubscribe. */\n onScanning: (cb: (scanning: boolean) => void): (() => void) => useCoreStore.subscribe((s) => s.searching, cb),\n /** Whether a controller scan is currently in progress. */\n scanningController: (): boolean => useCoreStore.getState().searchingController,\n /** Subscribe to controller-scan-in-progress changes; fires only when it changes. Returns an unsubscribe. */\n onScanningController: (cb: (scanning: boolean) => void): (() => void) =>\n useCoreStore.subscribe((s) => s.searchingController, cb),\n /** Whether the phone has another Bluetooth (audio) device connected — the BT Classic pairing hint. */\n otherBtConnected: (): boolean => useCoreStore.getState().otherBtConnected,\n /** Subscribe to other-Bluetooth-device-connected changes; fires only when it changes. Returns an unsubscribe. */\n onOtherBtConnected: (cb: (connected: boolean) => void): (() => void) =>\n useCoreStore.subscribe((s) => s.otherBtConnected, cb),\n /** The current scan results (snapshot). */\n // Copy the array AND each entry: neither the list nor the Device objects may\n // leak as mutable references into the store.\n searchResults: () => useCoreStore.getState().searchResults.map((result) => ({...result})),\n /** Subscribe to scan-result changes; fires only when they change. Returns an unsubscribe. */\n onFound: (cb: (results: Device[]) => void): (() => void) => {\n let last = JSON.stringify(useCoreStore.getState().searchResults)\n return useCoreStore.subscribe(() => {\n const results = useCoreStore.getState().searchResults\n const key = JSON.stringify(results)\n if (key === last) return\n last = key\n // Copy like searchResults(): listeners must not mutate shared scan state.\n cb(results.map((result) => ({...result})))\n })\n },\n\n /**\n * Pair with (connect to) a discovered device. Two-phase identity: the connect\n * attempt only marks the device as pending (`saveAsDefault: false` — no eager\n * default-device write); the native layer promotes it to the default wearable\n * when pairing actually succeeds (handleDeviceReady), so an abandoned or\n * failed attempt can't leave a default identity with no paired device behind.\n */\n pair: async (device: Device, options?: ConnectOptions): Promise<void> => {\n await pushAllBluetoothSettings()\n return BluetoothSdk.connect(device, {...options, saveAsDefault: false})\n },\n /** Set a device as the default for subsequent `glasses.connectDefault()`. */\n setDefault: (device: Device | null): Promise<void> => BluetoothSdk.setDefaultDevice(device),\n /**\n * Prime the native Bluetooth Classic audio watcher with the picked device.\n * The iOS Mentra Live flow pairs Classic audio BEFORE any BLE connect\n * exists, and native detects the pairing by matching the connected audio\n * route against its device_name — which two-phase identity no longer sets\n * at selection time. This is native-only routing state (device_name has no\n * native→JS echo): the phone's persisted identity is untouched, and\n * promotion still happens only at pairing success.\n */\n setBluetoothClassicTarget: (device: Device): Promise<void> =>\n BluetoothSdk.updateBluetoothSettings({device_name: device.name}),\n /**\n * Abandon an in-flight pairing attempt (back-out, failure retry, conflict\n * retry) without destroying an existing pairing. The decision comes from the\n * LIVE hydrated default-device read — never from flow-entry state, because a\n * pairing can PROMOTE while the flow is open (the glasses finish pairing\n * even as the user backs out of the UI), and an entry snapshot would forget\n * that brand-new pairing:\n * - Default device exists and glasses are connected (nothing in flight — an\n * attempt drops the link first): stop the scan, touch nothing else.\n * - Default device exists with an attempt in flight: cancel it, then re-seed\n * the native identity from the phone's persisted settings — the attempt's\n * connect-by-name overwrote the native device_name, so a later\n * connectDefault() would otherwise target the abandoned device.\n * - No default device (genuinely unpaired attempt): also forget, clearing\n * the partial native pairing state.\n * The read fails OPEN to \"preserve\" — a transient failure must never wipe a\n * real pairing. The `pending_wearable` marker is deliberately left alone —\n * the host renders it as a finish-pairing affordance.\n */\n abandonAttempt: async (): Promise<void> => {\n const nativeHasDefault = await hasDefaultDevice().catch(() => true)\n if (nativeHasDefault && isGlassesConnected(useGlassesStore.getState().connection)) {\n // Still connected means no connect attempt is in flight (an attempt drops\n // the existing link first): the user browsed the scan and backed out.\n // Stop the scan and leave the live pairing untouched.\n console.log(\"PairingIdentity: abandonAttempt — pairing intact and connected; stopping scan only\")\n await BluetoothSdk.stopScan()\n return\n }\n if (projectPairingIdentity().kind === \"paired\") {\n // The persisted settings describe a COMPLETE pairing: restore it to\n // native (the attempt's connect-by-name overwrote the native\n // device_name; and if native somehow lost its default entirely, this\n // repairs the divergence instead of forgetting a real pairing).\n console.log(\"PairingIdentity: abandonAttempt — preserving pairing; attempt cancelled, native identity re-seeded\")\n await BluetoothSdk.disconnect()\n await pushAllBluetoothSettings()\n return\n }\n if (nativeHasDefault) {\n // Mid-relay: native promoted and its echoes are still landing — the\n // incomplete JS snapshot must not be pushed over the fresher native\n // identity (the on-connect replay's race). Native holds the truth.\n console.log(\"PairingIdentity: abandonAttempt — preserving pairing; JS identity mid-relay, native kept as-is\")\n await BluetoothSdk.disconnect()\n return\n }\n // Partial attempt: forget owns teardown. Do NOT disconnect() first — that\n // nulls the MentraLive SGC and used to skip Classic removeBond, leaving\n // IBRT ACL up so glasses never re-advertise for the next scan.\n console.log(\"PairingIdentity: abandonAttempt — no pairing on either layer; forgetting the partial attempt\")\n await BluetoothSdk.forget()\n },\n\n /** Subscribe to pairing failures; returns an unsubscribe. */\n onPairFailure: (cb: (event: PairFailureEvent) => void): (() => void) => {\n const sub = BluetoothSdk.addListener(\"pair_failure\", cb)\n return () => sub.remove()\n },\n /** Subscribe to glasses-not-ready events during pairing; returns an unsubscribe. */\n onGlassesNotReady: (cb: (event: GlassesNotReadyEvent) => void): (() => void) => {\n const sub = BluetoothSdk.addListener(\"glasses_not_ready\", cb)\n return () => sub.remove()\n },\n /** Wait for paired glasses to finish booting; engine files the timeout diagnostic. */\n waitForReady: waitForReadyDuringPairing,\n /** Wait briefly for Bluetooth Classic to come up after BLE pairing. */\n waitForBluetoothClassic,\n}\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export const ENGINE_RELEASE_METADATA = Object.freeze({
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"familyBaseVersion": "3.1.0",
|
|
4
|
-
"releaseIdentity": "3.1.0-dev.
|
|
5
|
-
"releaseSetId": "mentra-3.1.0-dev.
|
|
6
|
-
"sourceCommit": "
|
|
7
|
-
"otaManifestUrl": "https://github.com/Mentra-Community/MentraOS/releases/download/mentra-builds-v3.1.0/mentra-live-ota-3.1.0-dev.
|
|
8
|
-
"otaManifestSha256": "
|
|
4
|
+
"releaseIdentity": "3.1.0-dev.38",
|
|
5
|
+
"releaseSetId": "mentra-3.1.0-dev.38",
|
|
6
|
+
"sourceCommit": "1982fb29e2859267a19a5e1a87820b6762234f7c",
|
|
7
|
+
"otaManifestUrl": "https://github.com/Mentra-Community/MentraOS/releases/download/mentra-builds-v3.1.0/mentra-live-ota-3.1.0-dev.38.json",
|
|
8
|
+
"otaManifestSha256": "9f952e253b26d0abb3936819d22e14d7bac627926dda6946d9e1d9330aa774cc"
|
|
9
9
|
});
|
|
10
10
|
//# sourceMappingURL=releaseMetadata.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"releaseMetadata.js","sourceRoot":"","sources":["../../src/generated/releaseMetadata.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,uBAAuB,GAAoC,MAAM,CAAC,MAAM,CAAC;IACpF,eAAe,EAAE,CAAC;IAClB,mBAAmB,EAAE,OAAO;IAC5B,iBAAiB,EAAE,cAAc;IACjC,cAAc,EAAE,qBAAqB;IACrC,cAAc,EAAE,0CAA0C;IAC1D,gBAAgB,EAAE,uHAAuH;IACzI,mBAAmB,EAAE,kEAAkE;CACxF,CAAC,CAAA","sourcesContent":["/** Generated by release CI. Do not edit in a release checkout. */\nexport interface EngineReleaseMetadata {\n schemaVersion: 1\n familyBaseVersion: string | null\n releaseIdentity: string | null\n releaseSetId: string | null\n sourceCommit: string | null\n otaManifestUrl: string | null\n otaManifestSha256: string | null\n}\n\nexport const ENGINE_RELEASE_METADATA: Readonly<EngineReleaseMetadata> = Object.freeze({\n \"schemaVersion\": 1,\n \"familyBaseVersion\": \"3.1.0\",\n \"releaseIdentity\": \"3.1.0-dev.
|
|
1
|
+
{"version":3,"file":"releaseMetadata.js","sourceRoot":"","sources":["../../src/generated/releaseMetadata.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,uBAAuB,GAAoC,MAAM,CAAC,MAAM,CAAC;IACpF,eAAe,EAAE,CAAC;IAClB,mBAAmB,EAAE,OAAO;IAC5B,iBAAiB,EAAE,cAAc;IACjC,cAAc,EAAE,qBAAqB;IACrC,cAAc,EAAE,0CAA0C;IAC1D,gBAAgB,EAAE,uHAAuH;IACzI,mBAAmB,EAAE,kEAAkE;CACxF,CAAC,CAAA","sourcesContent":["/** Generated by release CI. Do not edit in a release checkout. */\nexport interface EngineReleaseMetadata {\n schemaVersion: 1\n familyBaseVersion: string | null\n releaseIdentity: string | null\n releaseSetId: string | null\n sourceCommit: string | null\n otaManifestUrl: string | null\n otaManifestSha256: string | null\n}\n\nexport const ENGINE_RELEASE_METADATA: Readonly<EngineReleaseMetadata> = Object.freeze({\n \"schemaVersion\": 1,\n \"familyBaseVersion\": \"3.1.0\",\n \"releaseIdentity\": \"3.1.0-dev.38\",\n \"releaseSetId\": \"mentra-3.1.0-dev.38\",\n \"sourceCommit\": \"1982fb29e2859267a19a5e1a87820b6762234f7c\",\n \"otaManifestUrl\": \"https://github.com/Mentra-Community/MentraOS/releases/download/mentra-builds-v3.1.0/mentra-live-ota-3.1.0-dev.38.json\",\n \"otaManifestSha256\": \"9f952e253b26d0abb3936819d22e14d7bac627926dda6946d9e1d9330aa774cc\"\n})\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MentraLiveOtaFlow.d.ts","sourceRoot":"","sources":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AA;IACnF,0DAA0D;IAC1D,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,wEAAwE;IACxE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,+EAA+E;IAC/E,SAAS,CAAC,EAAE,0BAA0B,CAAA;IACtC,6EAA6E;IAC7E,KAAK,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAA;IACvC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAC7B,CAAA;AA4DD,wBAAgB,iBAAiB,CAAC,EAChC,YAAwD,EACxD,UAA0B,EAC1B,WAAqB,EACrB,iBAAwB,EACxB,UAAU,EACV,0BAA0B,EAC1B,eAAe,EACf,KAAK,EACL,SAAiB,EACjB,KAAK,EACL,SAA4B,GAC7B,EAAE,sBAAsB,qBA0BxB"}
|
|
@@ -20,6 +20,9 @@ const ENGLISH_COPY = {
|
|
|
20
20
|
"ota:updateAvailable": "{{deviceName}} Update Available",
|
|
21
21
|
"ota:updateConnectWifi": "Connect your {{deviceName}} to WiFi to install the update.",
|
|
22
22
|
"ota:updateDescription": "A new update is available for your glasses. We recommend updating now for the best experience.",
|
|
23
|
+
"ota:releaseTransition": "{{fromVersion}} → {{toVersion}}",
|
|
24
|
+
"ota:releaseTransitionUnknown": "Current version unknown → {{toVersion}}",
|
|
25
|
+
"ota:updatedToVersion": "Updated to {{version}}",
|
|
23
26
|
"ota:downgradeAvailable": "{{deviceName}} Version Change Required",
|
|
24
27
|
"ota:downgradeDescription": "This app requires an earlier glasses software version. Your photos and videos will be preserved, but glasses settings will be reset and restored automatically after the change.",
|
|
25
28
|
"ota:updateNow": "Update Now",
|
|
@@ -85,6 +88,14 @@ function OtaFlowContent({ allowDevSkip, colors, controller, deviceName, superMod
|
|
|
85
88
|
{state.canDismiss ? (<FlowButton colors={colors} label={translate("ota:updateLater")} onPress={controller.finish} secondary/>) : null}
|
|
86
89
|
{allowDevSkip && state.updateRequired ? (<FlowButton colors={colors} label="Skip (dev only)" onPress={controller.finish} secondary/>) : null}
|
|
87
90
|
</>}>
|
|
91
|
+
{state.releaseTransition ? (<BodyText colors={colors}>
|
|
92
|
+
{state.releaseTransition.fromVersion
|
|
93
|
+
? translate("ota:releaseTransition", {
|
|
94
|
+
fromVersion: state.releaseTransition.fromVersion,
|
|
95
|
+
toVersion: state.releaseTransition.toVersion,
|
|
96
|
+
})
|
|
97
|
+
: translate("ota:releaseTransitionUnknown", { toVersion: state.releaseTransition.toVersion })}
|
|
98
|
+
</BodyText>) : null}
|
|
88
99
|
<BodyText colors={colors}>
|
|
89
100
|
{state.screen === "wifi_required"
|
|
90
101
|
? translate("ota:updateConnectWifi", { deviceName })
|
|
@@ -100,6 +111,9 @@ function OtaFlowContent({ allowDevSkip, colors, controller, deviceName, superMod
|
|
|
100
111
|
if (state.screen === "up_to_date") {
|
|
101
112
|
return (<FlowPage actions={<FlowButton colors={colors} label={translate("common:continue")} onPress={controller.finish}/>} colors={colors} icon="check" title={translate("ota:upToDate")}>
|
|
102
113
|
<BodyText colors={colors}>{translate("ota:noUpdatesAvailable")}</BodyText>
|
|
114
|
+
{state.releaseTransition ? (<BodyText colors={colors}>
|
|
115
|
+
{translate("ota:updatedToVersion", { version: state.releaseTransition.toVersion })}
|
|
116
|
+
</BodyText>) : null}
|
|
103
117
|
<ChangelogList changelogs={state.changelogs} colors={colors}/>
|
|
104
118
|
</FlowPage>);
|
|
105
119
|
}
|
|
@@ -165,6 +179,9 @@ function OtaFlowContent({ allowDevSkip, colors, controller, deviceName, superMod
|
|
|
165
179
|
: "Your glasses are up to date.";
|
|
166
180
|
return (<FlowPage actions={<FlowButton colors={colors} label={state.versionChange && !state.versionChangeConverged ? "Continue" : "Done"} onPress={controller.finish}/>} colors={colors} icon="check" title={title}>
|
|
167
181
|
<BodyText colors={colors}>{message}</BodyText>
|
|
182
|
+
{state.releaseTransition ? (<BodyText colors={colors}>
|
|
183
|
+
{translate("ota:updatedToVersion", { version: state.releaseTransition.toVersion })}
|
|
184
|
+
</BodyText>) : null}
|
|
168
185
|
<ChangelogList changelogs={state.changelogs} colors={colors}/>
|
|
169
186
|
</FlowPage>);
|
|
170
187
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MentraLiveOtaFlow.js","sourceRoot":"","sources":["../../src/react/MentraLiveOtaFlow.tsx"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAA;AACpC,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,UAAU,EACV,IAAI,EACJ,IAAI,GAGL,MAAM,cAAc,CAAA;AACrB,OAAO,EAAC,YAAY,EAAC,MAAM,gCAAgC,CAAA;AAC3D,OAAO,GAAG,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,MAAM,kBAAkB,CAAA;AAEhD,OAAO,EAAC,gBAAgB,EAA2D,MAAM,oBAAoB,CAAA;AAwC7G,MAAM,aAAa,GAA2B;IAC5C,UAAU,EAAE,SAAS;IACrB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,SAAS;IAChB,UAAU,EAAE,SAAS;IACrB,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,SAAS;IACtB,OAAO,EAAE,SAAS;CACnB,CAAA;AAED,MAAM,YAAY,GAA2B;IAC3C,iBAAiB,EAAE,UAAU;IAC7B,wBAAwB,EAAE,sBAAsB;IAChD,+BAA+B,EAC7B,wGAAwG;IAC1G,qBAAqB,EAAE,iCAAiC;IACxD,uBAAuB,EAAE,4DAA4D;IACrF,uBAAuB,EACrB,gGAAgG;IAClG,wBAAwB,EAAE,wCAAwC;IAClE,0BAA0B,EACxB,kLAAkL;IACpL,eAAe,EAAE,YAAY;IAC7B,eAAe,EAAE,YAAY;IAC7B,iBAAiB,EAAE,OAAO;IAC1B,cAAc,EAAE,YAAY;IAC5B,cAAc,EAAE,mBAAmB;IACnC,mBAAmB,EACjB,0JAA0J;IAC5J,wBAAwB,EAAE,8CAA8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AAG,EAAE,SAAS,EAAE,QAAQ,EAAC;IACxE,OAAO,EAAE,EAAC,QAAQ,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,cAAc,CAAC,EAAE,UAAU,EAAE,KAAK,EAAC;IACzE,aAAa,EAAE,EAAC,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAC;IAC7F,YAAY,EAAE,EAAC,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAC;IAC1C,aAAa,EAAE,EAAC,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAC;IAC5E,gBAAgB,EAAE,EAAC,GAAG,EAAE,EAAE,EAAE,eAAe,EAAE,CAAC,EAAC;IAC/C,cAAc,EAAE,EAAC,GAAG,EAAE,CAAC,EAAC;IACxB,gBAAgB,EAAE,EAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAC;IACnD,iBAAiB,EAAE,EAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAC;IACjD,MAAM,EAAE;QACN,UAAU,EAAE,QAAQ;QACpB,YAAY,EAAE,EAAE;QAChB,WAAW,EAAE,CAAC;QACd,cAAc,EAAE,QAAQ;QACxB,SAAS,EAAE,EAAE;QACb,iBAAiB,EAAE,EAAE;KACtB;IACD,UAAU,EAAE,EAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAC;CAC9C,CAAC,CAAA","sourcesContent":["/* eslint-disable react-native/no-raw-text -- BodyText and PercentText are local Text wrappers. */\nimport React, {useMemo} from \"react\"\nimport {\n ActivityIndicator,\n Pressable,\n ScrollView,\n StyleSheet,\n Text,\n View,\n type StyleProp,\n type ViewStyle,\n} from \"react-native\"\nimport {SafeAreaView} from \"react-native-safe-area-context\"\nimport Svg, {Path, Rect} from \"react-native-svg\"\n\nimport {useMentraLiveOta, type MentraLiveOtaController, type MentraLiveOtaFlowPage} from \"./useMentraLiveOta\"\n\nexport type {MentraLiveOtaFlowPage} from \"./useMentraLiveOta\"\n\nexport type MentraLiveOtaFlowTheme = {\n background: string\n border: string\n error: string\n foreground: string\n primary: string\n primaryText: string\n textDim: string\n}\n\nexport type MentraLiveOtaFlowTranslate = (key: string, options?: Record<string, string>) => string\n\nexport type MentraLiveOtaFlowProps = {\n /** Display name used in update copy. */\n deviceName?: string\n /** Entry page. `progress` exists for recovery/deep-link compatibility. */\n initialPage?: MentraLiveOtaFlowPage\n /** Start the OTA-only projections. Full Engine hosts should pass false. */\n initializeRuntime?: boolean\n /** Called after the final check or when the user leaves an optional update. */\n onFinished: () => void\n /** Host-owned Wi-Fi setup for glasses that do not support hotspot OTA. */\n onOpenWifiSetup: () => void\n /** Lets a host coordinate its global connection overlay with OTA progress and firmware restarts. */\n onFirmwareRestartingChange?: (restarting: boolean, progressActive: boolean) => void\n /** Enables the existing developer-only escape hatches. */\n allowDevSkip?: boolean\n /** Enables the existing super-mode interrupted-session escape hatch. */\n superMode?: boolean\n /** Optional host localization. Defaults to the Mentra App English OTA copy. */\n translate?: MentraLiveOtaFlowTranslate\n /** Optional host theme. Both hosts use the same layout and state machine. */\n theme?: Partial<MentraLiveOtaFlowTheme>\n style?: StyleProp<ViewStyle>\n}\n\nconst DEFAULT_THEME: MentraLiveOtaFlowTheme = {\n background: \"#FFFFFF\",\n border: \"#D7DFDA\",\n error: \"#C43131\",\n foreground: \"#0E2C1A\",\n primary: \"#00B869\",\n primaryText: \"#FFFFFF\",\n textDim: \"#66736B\",\n}\n\nconst ENGLISH_COPY: Record<string, string> = {\n \"common:continue\": \"Continue\",\n \"ota:checkingForUpdates\": \"Checking for updates\",\n \"ota:checkingForUpdatesMessage\":\n \"Connected devices will perform automatic updates. Automatic updates can be disabled in Device Settings\",\n \"ota:updateAvailable\": \"{{deviceName}} Update Available\",\n \"ota:updateConnectWifi\": \"Connect your {{deviceName}} to WiFi to install the update.\",\n \"ota:updateDescription\":\n \"A new update is available for your glasses. We recommend updating now for the best experience.\",\n \"ota:downgradeAvailable\": \"{{deviceName}} Version Change Required\",\n \"ota:downgradeDescription\":\n \"This app requires an earlier glasses software version. Your photos and videos will be preserved, but glasses settings will be reset and restored automatically after the change.\",\n \"ota:updateNow\": \"Update Now\",\n \"ota:setupWifi\": \"Setup WiFi\",\n \"ota:updateLater\": \"Later\",\n \"ota:upToDate\": \"Up To Date\",\n \"ota:devBuild\": \"Development Build\",\n \"ota:devBuildNoOta\":\n \"This mobile app is a development build, so automatic glasses updates are disabled. Use the developer settings manifest override to update them manually.\",\n \"ota:noUpdatesAvailable\": \"Your glasses are running the latest version.\",\n \"ota:checkFailed\": \"Check Failed\",\n \"ota:checkFailedMessage\": \"Couldn't check for updates. Please check your connection and try again.\",\n \"ota:updateInfoUnavailable\": \"Update Info Unavailable\",\n \"ota:updateInfoUnavailableMessage\":\n \"Update information for this version of the app is unavailable. Please check the app store for a newer version of the Mentra App.\",\n \"ota:downgradeDuration\": \"Your glasses will restart twice — this may take up to 2 minutes.\",\n \"ota:versionChangeRestarting\": \"Installing a different version…\",\n \"ota:versionChangeVerifying\": \"Verifying your glasses…\",\n \"ota:versionChangeKeepNearby\": \"Keep your glasses nearby and connected. They will restart on their own.\",\n \"ota:versionChangeComplete\": \"Version Change Complete\",\n \"ota:versionChangeCompleteMessage\":\n \"Your glasses are now on the required version. Their settings were reset and are being restored automatically.\",\n \"ota:versionChangeFirmwarePassComplete\": \"Firmware updated\",\n \"ota:versionChangeFirmwarePassCompleteMessage\":\n \"Your glasses restarted with new firmware. One more step: they'll now continue to the required version.\",\n}\n\nfunction defaultTranslate(key: string, options?: Record<string, string>): string {\n let value = ENGLISH_COPY[key] ?? key\n for (const [name, replacement] of Object.entries(options ?? {})) {\n value = value.replaceAll(`{{${name}}}`, replacement)\n }\n return value\n}\n\nexport function MentraLiveOtaFlow({\n allowDevSkip = typeof __DEV__ !== \"undefined\" && __DEV__,\n deviceName = \"Mentra Live\",\n initialPage = \"check\",\n initializeRuntime = true,\n onFinished,\n onFirmwareRestartingChange,\n onOpenWifiSetup,\n style,\n superMode = false,\n theme,\n translate = defaultTranslate,\n}: MentraLiveOtaFlowProps) {\n const colors = useMemo(() => ({...DEFAULT_THEME, ...theme}), [theme])\n const controller = useMentraLiveOta({\n initialPage,\n initializeRuntime,\n onFinished,\n onFirmwareRestartingChange,\n onOpenWifiSetup,\n })\n\n return (\n <SafeAreaView style={[styles.safeArea, {backgroundColor: colors.background}, style]}>\n <View style={styles.header}>\n <View />\n <MentraMark color={colors.primary} />\n </View>\n <OtaFlowContent\n allowDevSkip={allowDevSkip}\n colors={colors}\n controller={controller}\n deviceName={deviceName}\n superMode={superMode}\n translate={translate}\n />\n </SafeAreaView>\n )\n}\n\nfunction OtaFlowContent({\n allowDevSkip,\n colors,\n controller,\n deviceName,\n superMode,\n translate,\n}: {\n allowDevSkip: boolean\n colors: MentraLiveOtaFlowTheme\n controller: MentraLiveOtaController\n deviceName: string\n superMode: boolean\n translate: MentraLiveOtaFlowTranslate\n}) {\n const {state} = controller\n\n if (state.screen === \"initializing\") {\n return (\n <FlowPage colors={colors} icon=\"download\" title={translate(\"ota:checkingForUpdates\")}>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n </FlowPage>\n )\n }\n\n if (state.screen === \"checking\") {\n return (\n <FlowPage colors={colors} icon=\"download\" title={translate(\"ota:checkingForUpdates\")}>\n <BodyText colors={colors}>{translate(\"ota:checkingForUpdatesMessage\")}</BodyText>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n </FlowPage>\n )\n }\n\n if (state.screen === \"update_available\" || state.screen === \"wifi_required\") {\n return (\n <FlowPage\n colors={colors}\n icon=\"download\"\n title={translate(state.versionChange ? \"ota:downgradeAvailable\" : \"ota:updateAvailable\", {deviceName})}\n actions={\n <>\n <FlowButton\n colors={colors}\n disabled={!state.wifiStatusKnown}\n label={translate(state.screen === \"wifi_required\" ? \"ota:setupWifi\" : \"ota:updateNow\")}\n onPress={state.screen === \"wifi_required\" ? controller.openWifiSetup : controller.install}\n />\n {state.canDismiss ? (\n <FlowButton colors={colors} label={translate(\"ota:updateLater\")} onPress={controller.finish} secondary />\n ) : null}\n {allowDevSkip && state.updateRequired ? (\n <FlowButton colors={colors} label=\"Skip (dev only)\" onPress={controller.finish} secondary />\n ) : null}\n </>\n }>\n <BodyText colors={colors}>\n {state.screen === \"wifi_required\"\n ? translate(\"ota:updateConnectWifi\", {deviceName})\n : translate(state.versionChange ? \"ota:downgradeDescription\" : \"ota:updateDescription\")}\n </BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"dev_build\") {\n return (\n <FlowPage\n actions={<FlowButton colors={colors} label={translate(\"common:continue\")} onPress={controller.finish} />}\n colors={colors}\n icon=\"settings\"\n title={translate(\"ota:devBuild\")}>\n <BodyText colors={colors}>{translate(\"ota:devBuildNoOta\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"up_to_date\") {\n return (\n <FlowPage\n actions={<FlowButton colors={colors} label={translate(\"common:continue\")} onPress={controller.finish} />}\n colors={colors}\n icon=\"check\"\n title={translate(\"ota:upToDate\")}>\n <BodyText colors={colors}>{translate(\"ota:noUpdatesAvailable\")}</BodyText>\n <ChangelogList changelogs={state.changelogs} colors={colors} />\n </FlowPage>\n )\n }\n\n if (state.screen === \"update_info_unavailable\") {\n return (\n <FlowPage\n actions={<FlowButton colors={colors} label={translate(\"common:continue\")} onPress={controller.finish} />}\n colors={colors}\n icon=\"alert\"\n title={translate(\"ota:updateInfoUnavailable\")}>\n <BodyText colors={colors}>{translate(\"ota:updateInfoUnavailableMessage\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"check_failed\") {\n return (\n <FlowPage\n actions={\n <>\n <FlowButton colors={colors} label=\"Retry\" onPress={controller.retryCheck} />\n {allowDevSkip ? (\n <FlowButton colors={colors} label=\"Skip (dev only)\" onPress={controller.finish} secondary />\n ) : null}\n </>\n }\n colors={colors}\n icon=\"alert\"\n title={translate(\"ota:checkFailed\")}>\n <BodyText colors={colors}>{translate(\"ota:checkFailedMessage\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.versionChangePhase === \"restarting\" || state.versionChangePhase === \"verifying\") {\n return (\n <FlowPage\n colors={colors}\n icon=\"download\"\n title={translate(\n state.versionChangePhase === \"verifying\" ? \"ota:versionChangeVerifying\" : \"ota:versionChangeRestarting\",\n )}>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n <BodyText colors={colors}>{translate(\"ota:versionChangeKeepNearby\")}</BodyText>\n <BodyText colors={colors}>{translate(\"ota:downgradeDuration\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"starting\" || state.screen === \"preparing_hotspot\") {\n const title =\n state.hotspotPhase === \"downloading\"\n ? \"Downloading update to phone...\"\n : state.hotspotPhase === \"starting_hotspot\"\n ? \"Starting glasses hotspot...\"\n : state.hotspotPhase === \"joining_hotspot\"\n ? \"Connecting phone to glasses...\"\n : \"Starting update...\"\n return (\n <FlowPage colors={colors} icon=\"download\" title={title}>\n {state.hotspotPhase === \"downloading\" && state.hotspotArtifactPercent !== null ? (\n <PercentText colors={colors} percent={state.hotspotArtifactPercent} />\n ) : null}\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n <BodyText colors={colors}>Do not disconnect your glasses</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"updating\") {\n return (\n <FlowPage colors={colors} icon=\"download\" title={state.phase === \"download\" ? \"Downloading...\" : \"Installing...\"}>\n {state.installingApkOnly ? (\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n ) : (\n <>\n <PercentText colors={colors} percent={state.progress ?? 0} />\n <View style={[styles.progressTrack, {backgroundColor: colors.border}]}>\n <View\n style={[styles.progressFill, {backgroundColor: colors.primary, width: `${state.progress ?? 0}%`}]}\n />\n </View>\n </>\n )}\n <BodyText colors={colors}>Do not disconnect your glasses</BodyText>\n {state.versionChange && state.phase === \"install\" ? (\n <BodyText colors={colors}>{translate(\"ota:downgradeDuration\")}</BodyText>\n ) : null}\n </FlowPage>\n )\n }\n\n if (state.screen === \"restarting\") {\n return (\n <FlowPage\n actions={\n <FlowButton colors={colors} disabled={state.continueDisabled} label=\"Continue\" onPress={controller.finish} />\n }\n colors={colors}\n icon=\"check\"\n title=\"Update Installed\"\n />\n )\n }\n\n if (state.screen === \"complete\") {\n const title = state.versionChangeConverged\n ? translate(\"ota:versionChangeComplete\")\n : state.versionChange\n ? translate(\"ota:versionChangeFirmwarePassComplete\")\n : \"Update complete!\"\n const message = state.versionChangeConverged\n ? translate(\"ota:versionChangeCompleteMessage\")\n : state.versionChange\n ? translate(\"ota:versionChangeFirmwarePassCompleteMessage\")\n : \"Your glasses are up to date.\"\n return (\n <FlowPage\n actions={\n <FlowButton\n colors={colors}\n label={state.versionChange && !state.versionChangeConverged ? \"Continue\" : \"Done\"}\n onPress={controller.finish}\n />\n }\n colors={colors}\n icon=\"check\"\n title={title}>\n <BodyText colors={colors}>{message}</BodyText>\n <ChangelogList changelogs={state.changelogs} colors={colors} />\n </FlowPage>\n )\n }\n\n if (state.screen === \"failed\") {\n return (\n <FlowPage\n actions={\n <>\n <FlowButton\n colors={colors}\n label={state.canRetry ? \"Retry\" : \"Done\"}\n onPress={state.canRetry ? controller.retryInstall : controller.finish}\n />\n {state.canOpenWifiSetup ? (\n <FlowButton colors={colors} label=\"Change WiFi\" onPress={controller.openWifiSetup} secondary />\n ) : null}\n </>\n }\n colors={colors}\n icon=\"alert\"\n title=\"Update Failed\">\n <BodyText colors={colors}>{state.error?.message}</BodyText>\n </FlowPage>\n )\n }\n\n return (\n <FlowPage\n actions={\n superMode ? (\n <FlowButton colors={colors} label=\"Skip (super)\" onPress={controller.discard} secondary />\n ) : undefined\n }\n colors={colors}\n icon=\"bluetooth\"\n title=\"Glasses disconnected\">\n <BodyText colors={colors}>Reconnecting...</BodyText>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n </FlowPage>\n )\n}\n\ntype FlowPageProps = {\n actions?: React.ReactNode\n children?: React.ReactNode\n colors: MentraLiveOtaFlowTheme\n icon: \"alert\" | \"bluetooth\" | \"check\" | \"download\" | \"settings\"\n title: string\n}\n\nfunction FlowPage({actions, children, colors, icon, title}: FlowPageProps) {\n return (\n <View style={styles.page} testID=\"mentra-live-ota-flow\">\n <View style={styles.centerContent}>\n <FlowIcon colors={colors} name={icon} />\n <Text style={[styles.title, {color: colors.foreground}]}>{title}</Text>\n {children}\n </View>\n {actions ? <View style={styles.actions}>{actions}</View> : <View style={styles.actionSpacer} />}\n </View>\n )\n}\n\nfunction BodyText({children, colors}: {children: React.ReactNode; colors: MentraLiveOtaFlowTheme}) {\n return <Text style={[styles.body, {color: colors.textDim}]}>{children}</Text>\n}\n\nfunction PercentText({colors, percent}: {colors: MentraLiveOtaFlowTheme; percent: number}) {\n return <Text style={[styles.percent, {color: colors.primary}]}>{Math.round(percent)}%</Text>\n}\n\nfunction ChangelogList({\n changelogs,\n colors,\n}: {\n changelogs: MentraLiveOtaController[\"state\"][\"changelogs\"]\n colors: MentraLiveOtaFlowTheme\n}) {\n if (changelogs.length === 0) return null\n return (\n <ScrollView contentContainerStyle={styles.changelogContent} style={styles.changelogList}>\n {changelogs.map((entry) => (\n <View key={entry.version} style={styles.changelogEntry}>\n <Text selectable style={[styles.changelogVersion, {color: colors.foreground}]}>\n {entry.version}\n </Text>\n <Text selectable style={[styles.changelogMarkdown, {color: colors.textDim}]}>\n {entry.markdown}\n </Text>\n </View>\n ))}\n </ScrollView>\n )\n}\n\nfunction FlowButton({\n colors,\n disabled = false,\n label,\n onPress,\n secondary = false,\n}: {\n colors: MentraLiveOtaFlowTheme\n disabled?: boolean\n label: string\n onPress: () => void\n secondary?: boolean\n}) {\n return (\n <Pressable\n accessibilityRole=\"button\"\n disabled={disabled}\n onPress={onPress}\n style={({pressed}) => [\n styles.button,\n {\n backgroundColor: secondary ? colors.background : colors.foreground,\n borderColor: secondary ? colors.border : colors.foreground,\n opacity: disabled ? 0.45 : pressed ? 0.75 : 1,\n },\n ]}\n testID={`button-${label}`}>\n <Text style={[styles.buttonText, {color: secondary ? colors.foreground : colors.background}]}>{label}</Text>\n </Pressable>\n )\n}\n\nfunction MentraMark({color}: {color: string}) {\n return (\n <Svg width={33} height={18} viewBox=\"0 0 50 27\" fill=\"none\">\n <Rect y={14.8072} width={11.8457} height={11.8457} fill={color} />\n <Path d=\"M9.36639 0L30.7163 14.8072V26.6529L9.36639 11.8457V0Z\" fill={color} />\n <Path d=\"M28.6501 0L50 14.8072V26.6529L28.6501 11.8457V0Z\" fill={color} />\n </Svg>\n )\n}\n\nfunction FlowIcon({colors, name}: {colors: MentraLiveOtaFlowTheme; name: FlowPageProps[\"icon\"]}) {\n const color = name === \"alert\" || name === \"bluetooth\" ? colors.error : colors.primary\n const glyph =\n name === \"check\" ? \"✓\" : name === \"alert\" ? \"!\" : name === \"settings\" ? \"⚙\" : name === \"bluetooth\" ? \"⌁\" : \"↓\"\n return <Text style={[styles.icon, {color}]}>{glyph}</Text>\n}\n\nconst styles = StyleSheet.create({\n safeArea: {flex: 1},\n header: {\n alignItems: \"center\",\n flexDirection: \"row\",\n height: 48,\n justifyContent: \"space-between\",\n paddingHorizontal: 20,\n },\n page: {flex: 1, paddingBottom: 24, paddingHorizontal: 24},\n centerContent: {alignItems: \"center\", flex: 1, gap: 16, justifyContent: \"center\"},\n actionSpacer: {height: 48},\n actions: {gap: 12},\n icon: {fontSize: 64, fontWeight: \"500\", lineHeight: 72, textAlign: \"center\"},\n title: {fontSize: 20, fontWeight: \"600\", textAlign: \"center\"},\n body: {fontSize: 14, lineHeight: 20, maxWidth: 420, textAlign: \"center\"},\n percent: {fontSize: 30, fontVariant: [\"tabular-nums\"], fontWeight: \"700\"},\n progressTrack: {borderRadius: 4, height: 8, maxWidth: 420, overflow: \"hidden\", width: \"100%\"},\n progressFill: {borderRadius: 4, height: 8},\n changelogList: {flexShrink: 1, maxHeight: 260, maxWidth: 420, width: \"100%\"},\n changelogContent: {gap: 18, paddingVertical: 4},\n changelogEntry: {gap: 8},\n changelogVersion: {fontSize: 16, fontWeight: \"600\"},\n changelogMarkdown: {fontSize: 14, lineHeight: 20},\n button: {\n alignItems: \"center\",\n borderRadius: 50,\n borderWidth: 1,\n justifyContent: \"center\",\n minHeight: 44,\n paddingHorizontal: 20,\n },\n buttonText: {fontSize: 14, fontWeight: \"500\"},\n})\n"]}
|
|
1
|
+
{"version":3,"file":"MentraLiveOtaFlow.js","sourceRoot":"","sources":["../../src/react/MentraLiveOtaFlow.tsx"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAA;AACpC,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,UAAU,EACV,IAAI,EACJ,IAAI,GAGL,MAAM,cAAc,CAAA;AACrB,OAAO,EAAC,YAAY,EAAC,MAAM,gCAAgC,CAAA;AAC3D,OAAO,GAAG,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,MAAM,kBAAkB,CAAA;AAEhD,OAAO,EAAC,gBAAgB,EAA2D,MAAM,oBAAoB,CAAA;AAwC7G,MAAM,aAAa,GAA2B;IAC5C,UAAU,EAAE,SAAS;IACrB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,SAAS;IAChB,UAAU,EAAE,SAAS;IACrB,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,SAAS;IACtB,OAAO,EAAE,SAAS;CACnB,CAAA;AAED,MAAM,YAAY,GAA2B;IAC3C,iBAAiB,EAAE,UAAU;IAC7B,wBAAwB,EAAE,sBAAsB;IAChD,+BAA+B,EAC7B,wGAAwG;IAC1G,qBAAqB,EAAE,iCAAiC;IACxD,uBAAuB,EAAE,4DAA4D;IACrF,uBAAuB,EACrB,gGAAgG;IAClG,uBAAuB,EAAE,iCAAiC;IAC1D,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ActivityIndicator,\n Pressable,\n ScrollView,\n StyleSheet,\n Text,\n View,\n type StyleProp,\n type ViewStyle,\n} from \"react-native\"\nimport {SafeAreaView} from \"react-native-safe-area-context\"\nimport Svg, {Path, Rect} from \"react-native-svg\"\n\nimport {useMentraLiveOta, type MentraLiveOtaController, type MentraLiveOtaFlowPage} from \"./useMentraLiveOta\"\n\nexport type {MentraLiveOtaFlowPage} from \"./useMentraLiveOta\"\n\nexport type MentraLiveOtaFlowTheme = {\n background: string\n border: string\n error: string\n foreground: string\n primary: string\n primaryText: string\n textDim: string\n}\n\nexport type MentraLiveOtaFlowTranslate = (key: string, options?: Record<string, string>) => string\n\nexport type MentraLiveOtaFlowProps = {\n /** Display name used in update copy. */\n deviceName?: string\n /** Entry page. `progress` exists for recovery/deep-link compatibility. */\n initialPage?: MentraLiveOtaFlowPage\n /** Start the OTA-only projections. Full Engine hosts should pass false. */\n initializeRuntime?: boolean\n /** Called after the final check or when the user leaves an optional update. */\n onFinished: () => void\n /** Host-owned Wi-Fi setup for glasses that do not support hotspot OTA. */\n onOpenWifiSetup: () => void\n /** Lets a host coordinate its global connection overlay with OTA progress and firmware restarts. */\n onFirmwareRestartingChange?: (restarting: boolean, progressActive: boolean) => void\n /** Enables the existing developer-only escape hatches. */\n allowDevSkip?: boolean\n /** Enables the existing super-mode interrupted-session escape hatch. */\n superMode?: boolean\n /** Optional host localization. Defaults to the Mentra App English OTA copy. */\n translate?: MentraLiveOtaFlowTranslate\n /** Optional host theme. Both hosts use the same layout and state machine. */\n theme?: Partial<MentraLiveOtaFlowTheme>\n style?: StyleProp<ViewStyle>\n}\n\nconst DEFAULT_THEME: MentraLiveOtaFlowTheme = {\n background: \"#FFFFFF\",\n border: \"#D7DFDA\",\n error: \"#C43131\",\n foreground: \"#0E2C1A\",\n primary: \"#00B869\",\n primaryText: \"#FFFFFF\",\n textDim: \"#66736B\",\n}\n\nconst ENGLISH_COPY: Record<string, string> = {\n \"common:continue\": \"Continue\",\n \"ota:checkingForUpdates\": \"Checking for updates\",\n \"ota:checkingForUpdatesMessage\":\n \"Connected devices will perform automatic updates. Automatic updates can be disabled in Device Settings\",\n \"ota:updateAvailable\": \"{{deviceName}} Update Available\",\n \"ota:updateConnectWifi\": \"Connect your {{deviceName}} to WiFi to install the update.\",\n \"ota:updateDescription\":\n \"A new update is available for your glasses. We recommend updating now for the best experience.\",\n \"ota:releaseTransition\": \"{{fromVersion}} → {{toVersion}}\",\n \"ota:releaseTransitionUnknown\": \"Current version unknown → {{toVersion}}\",\n \"ota:updatedToVersion\": \"Updated to {{version}}\",\n \"ota:downgradeAvailable\": \"{{deviceName}} Version Change Required\",\n \"ota:downgradeDescription\":\n \"This app requires an earlier glasses software version. Your photos and videos will be preserved, but glasses settings will be reset and restored automatically after the change.\",\n \"ota:updateNow\": \"Update Now\",\n \"ota:setupWifi\": \"Setup WiFi\",\n \"ota:updateLater\": \"Later\",\n \"ota:upToDate\": \"Up To Date\",\n \"ota:devBuild\": \"Development Build\",\n \"ota:devBuildNoOta\":\n \"This mobile app is a development build, so automatic glasses updates are disabled. Use the developer settings manifest override to update them manually.\",\n \"ota:noUpdatesAvailable\": \"Your glasses are running the latest version.\",\n \"ota:checkFailed\": \"Check Failed\",\n \"ota:checkFailedMessage\": \"Couldn't check for updates. Please check your connection and try again.\",\n \"ota:updateInfoUnavailable\": \"Update Info Unavailable\",\n \"ota:updateInfoUnavailableMessage\":\n \"Update information for this version of the app is unavailable. Please check the app store for a newer version of the Mentra App.\",\n \"ota:downgradeDuration\": \"Your glasses will restart twice — this may take up to 2 minutes.\",\n \"ota:versionChangeRestarting\": \"Installing a different version…\",\n \"ota:versionChangeVerifying\": \"Verifying your glasses…\",\n \"ota:versionChangeKeepNearby\": \"Keep your glasses nearby and connected. They will restart on their own.\",\n \"ota:versionChangeComplete\": \"Version Change Complete\",\n \"ota:versionChangeCompleteMessage\":\n \"Your glasses are now on the required version. Their settings were reset and are being restored automatically.\",\n \"ota:versionChangeFirmwarePassComplete\": \"Firmware updated\",\n \"ota:versionChangeFirmwarePassCompleteMessage\":\n \"Your glasses restarted with new firmware. One more step: they'll now continue to the required version.\",\n}\n\nfunction defaultTranslate(key: string, options?: Record<string, string>): string {\n let value = ENGLISH_COPY[key] ?? key\n for (const [name, replacement] of Object.entries(options ?? {})) {\n value = value.replaceAll(`{{${name}}}`, replacement)\n }\n return value\n}\n\nexport function MentraLiveOtaFlow({\n allowDevSkip = typeof __DEV__ !== \"undefined\" && __DEV__,\n deviceName = \"Mentra Live\",\n initialPage = \"check\",\n initializeRuntime = true,\n onFinished,\n onFirmwareRestartingChange,\n onOpenWifiSetup,\n style,\n superMode = false,\n theme,\n translate = defaultTranslate,\n}: MentraLiveOtaFlowProps) {\n const colors = useMemo(() => ({...DEFAULT_THEME, ...theme}), [theme])\n const controller = useMentraLiveOta({\n initialPage,\n initializeRuntime,\n onFinished,\n onFirmwareRestartingChange,\n onOpenWifiSetup,\n })\n\n return (\n <SafeAreaView style={[styles.safeArea, {backgroundColor: colors.background}, style]}>\n <View style={styles.header}>\n <View />\n <MentraMark color={colors.primary} />\n </View>\n <OtaFlowContent\n allowDevSkip={allowDevSkip}\n colors={colors}\n controller={controller}\n deviceName={deviceName}\n superMode={superMode}\n translate={translate}\n />\n </SafeAreaView>\n )\n}\n\nfunction OtaFlowContent({\n allowDevSkip,\n colors,\n controller,\n deviceName,\n superMode,\n translate,\n}: {\n allowDevSkip: boolean\n colors: MentraLiveOtaFlowTheme\n controller: MentraLiveOtaController\n deviceName: string\n superMode: boolean\n translate: MentraLiveOtaFlowTranslate\n}) {\n const {state} = controller\n\n if (state.screen === \"initializing\") {\n return (\n <FlowPage colors={colors} icon=\"download\" title={translate(\"ota:checkingForUpdates\")}>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n </FlowPage>\n )\n }\n\n if (state.screen === \"checking\") {\n return (\n <FlowPage colors={colors} icon=\"download\" title={translate(\"ota:checkingForUpdates\")}>\n <BodyText colors={colors}>{translate(\"ota:checkingForUpdatesMessage\")}</BodyText>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n </FlowPage>\n )\n }\n\n if (state.screen === \"update_available\" || state.screen === \"wifi_required\") {\n return (\n <FlowPage\n colors={colors}\n icon=\"download\"\n title={translate(state.versionChange ? \"ota:downgradeAvailable\" : \"ota:updateAvailable\", {deviceName})}\n actions={\n <>\n <FlowButton\n colors={colors}\n disabled={!state.wifiStatusKnown}\n label={translate(state.screen === \"wifi_required\" ? \"ota:setupWifi\" : \"ota:updateNow\")}\n onPress={state.screen === \"wifi_required\" ? controller.openWifiSetup : controller.install}\n />\n {state.canDismiss ? (\n <FlowButton colors={colors} label={translate(\"ota:updateLater\")} onPress={controller.finish} secondary />\n ) : null}\n {allowDevSkip && state.updateRequired ? (\n <FlowButton colors={colors} label=\"Skip (dev only)\" onPress={controller.finish} secondary />\n ) : null}\n </>\n }>\n {state.releaseTransition ? (\n <BodyText colors={colors}>\n {state.releaseTransition.fromVersion\n ? translate(\"ota:releaseTransition\", {\n fromVersion: state.releaseTransition.fromVersion,\n toVersion: state.releaseTransition.toVersion,\n })\n : translate(\"ota:releaseTransitionUnknown\", {toVersion: state.releaseTransition.toVersion})}\n </BodyText>\n ) : null}\n <BodyText colors={colors}>\n {state.screen === \"wifi_required\"\n ? translate(\"ota:updateConnectWifi\", {deviceName})\n : translate(state.versionChange ? \"ota:downgradeDescription\" : \"ota:updateDescription\")}\n </BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"dev_build\") {\n return (\n <FlowPage\n actions={<FlowButton colors={colors} label={translate(\"common:continue\")} onPress={controller.finish} />}\n colors={colors}\n icon=\"settings\"\n title={translate(\"ota:devBuild\")}>\n <BodyText colors={colors}>{translate(\"ota:devBuildNoOta\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"up_to_date\") {\n return (\n <FlowPage\n actions={<FlowButton colors={colors} label={translate(\"common:continue\")} onPress={controller.finish} />}\n colors={colors}\n icon=\"check\"\n title={translate(\"ota:upToDate\")}>\n <BodyText colors={colors}>{translate(\"ota:noUpdatesAvailable\")}</BodyText>\n {state.releaseTransition ? (\n <BodyText colors={colors}>\n {translate(\"ota:updatedToVersion\", {version: state.releaseTransition.toVersion})}\n </BodyText>\n ) : null}\n <ChangelogList changelogs={state.changelogs} colors={colors} />\n </FlowPage>\n )\n }\n\n if (state.screen === \"update_info_unavailable\") {\n return (\n <FlowPage\n actions={<FlowButton colors={colors} label={translate(\"common:continue\")} onPress={controller.finish} />}\n colors={colors}\n icon=\"alert\"\n title={translate(\"ota:updateInfoUnavailable\")}>\n <BodyText colors={colors}>{translate(\"ota:updateInfoUnavailableMessage\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"check_failed\") {\n return (\n <FlowPage\n actions={\n <>\n <FlowButton colors={colors} label=\"Retry\" onPress={controller.retryCheck} />\n {allowDevSkip ? (\n <FlowButton colors={colors} label=\"Skip (dev only)\" onPress={controller.finish} secondary />\n ) : null}\n </>\n }\n colors={colors}\n icon=\"alert\"\n title={translate(\"ota:checkFailed\")}>\n <BodyText colors={colors}>{translate(\"ota:checkFailedMessage\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.versionChangePhase === \"restarting\" || state.versionChangePhase === \"verifying\") {\n return (\n <FlowPage\n colors={colors}\n icon=\"download\"\n title={translate(\n state.versionChangePhase === \"verifying\" ? \"ota:versionChangeVerifying\" : \"ota:versionChangeRestarting\",\n )}>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n <BodyText colors={colors}>{translate(\"ota:versionChangeKeepNearby\")}</BodyText>\n <BodyText colors={colors}>{translate(\"ota:downgradeDuration\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"starting\" || state.screen === \"preparing_hotspot\") {\n const title =\n state.hotspotPhase === \"downloading\"\n ? \"Downloading update to phone...\"\n : state.hotspotPhase === \"starting_hotspot\"\n ? \"Starting glasses hotspot...\"\n : state.hotspotPhase === \"joining_hotspot\"\n ? \"Connecting phone to glasses...\"\n : \"Starting update...\"\n return (\n <FlowPage colors={colors} icon=\"download\" title={title}>\n {state.hotspotPhase === \"downloading\" && state.hotspotArtifactPercent !== null ? (\n <PercentText colors={colors} percent={state.hotspotArtifactPercent} />\n ) : null}\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n <BodyText colors={colors}>Do not disconnect your glasses</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"updating\") {\n return (\n <FlowPage colors={colors} icon=\"download\" title={state.phase === \"download\" ? \"Downloading...\" : \"Installing...\"}>\n {state.installingApkOnly ? (\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n ) : (\n <>\n <PercentText colors={colors} percent={state.progress ?? 0} />\n <View style={[styles.progressTrack, {backgroundColor: colors.border}]}>\n <View\n style={[styles.progressFill, {backgroundColor: colors.primary, width: `${state.progress ?? 0}%`}]}\n />\n </View>\n </>\n )}\n <BodyText colors={colors}>Do not disconnect your glasses</BodyText>\n {state.versionChange && state.phase === \"install\" ? (\n <BodyText colors={colors}>{translate(\"ota:downgradeDuration\")}</BodyText>\n ) : null}\n </FlowPage>\n )\n }\n\n if (state.screen === \"restarting\") {\n return (\n <FlowPage\n actions={\n <FlowButton colors={colors} disabled={state.continueDisabled} label=\"Continue\" onPress={controller.finish} />\n }\n colors={colors}\n icon=\"check\"\n title=\"Update Installed\"\n />\n )\n }\n\n if (state.screen === \"complete\") {\n const title = state.versionChangeConverged\n ? translate(\"ota:versionChangeComplete\")\n : state.versionChange\n ? translate(\"ota:versionChangeFirmwarePassComplete\")\n : \"Update complete!\"\n const message = state.versionChangeConverged\n ? translate(\"ota:versionChangeCompleteMessage\")\n : state.versionChange\n ? translate(\"ota:versionChangeFirmwarePassCompleteMessage\")\n : \"Your glasses are up to date.\"\n return (\n <FlowPage\n actions={\n <FlowButton\n colors={colors}\n label={state.versionChange && !state.versionChangeConverged ? \"Continue\" : \"Done\"}\n onPress={controller.finish}\n />\n }\n colors={colors}\n icon=\"check\"\n title={title}>\n <BodyText colors={colors}>{message}</BodyText>\n {state.releaseTransition ? (\n <BodyText colors={colors}>\n {translate(\"ota:updatedToVersion\", {version: state.releaseTransition.toVersion})}\n </BodyText>\n ) : null}\n <ChangelogList changelogs={state.changelogs} colors={colors} />\n </FlowPage>\n )\n }\n\n if (state.screen === \"failed\") {\n return (\n <FlowPage\n actions={\n <>\n <FlowButton\n colors={colors}\n label={state.canRetry ? \"Retry\" : \"Done\"}\n onPress={state.canRetry ? controller.retryInstall : controller.finish}\n />\n {state.canOpenWifiSetup ? (\n <FlowButton colors={colors} label=\"Change WiFi\" onPress={controller.openWifiSetup} secondary />\n ) : null}\n </>\n }\n colors={colors}\n icon=\"alert\"\n title=\"Update Failed\">\n <BodyText colors={colors}>{state.error?.message}</BodyText>\n </FlowPage>\n )\n }\n\n return (\n <FlowPage\n actions={\n superMode ? (\n <FlowButton colors={colors} label=\"Skip (super)\" onPress={controller.discard} secondary />\n ) : undefined\n }\n colors={colors}\n icon=\"bluetooth\"\n title=\"Glasses disconnected\">\n <BodyText colors={colors}>Reconnecting...</BodyText>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n </FlowPage>\n )\n}\n\ntype FlowPageProps = {\n actions?: React.ReactNode\n children?: React.ReactNode\n colors: MentraLiveOtaFlowTheme\n icon: \"alert\" | \"bluetooth\" | \"check\" | \"download\" | \"settings\"\n title: string\n}\n\nfunction FlowPage({actions, children, colors, icon, title}: FlowPageProps) {\n return (\n <View style={styles.page} testID=\"mentra-live-ota-flow\">\n <View style={styles.centerContent}>\n <FlowIcon colors={colors} name={icon} />\n <Text style={[styles.title, {color: colors.foreground}]}>{title}</Text>\n {children}\n </View>\n {actions ? <View style={styles.actions}>{actions}</View> : <View style={styles.actionSpacer} />}\n </View>\n )\n}\n\nfunction BodyText({children, colors}: {children: React.ReactNode; colors: MentraLiveOtaFlowTheme}) {\n return <Text style={[styles.body, {color: colors.textDim}]}>{children}</Text>\n}\n\nfunction PercentText({colors, percent}: {colors: MentraLiveOtaFlowTheme; percent: number}) {\n return <Text style={[styles.percent, {color: colors.primary}]}>{Math.round(percent)}%</Text>\n}\n\nfunction ChangelogList({\n changelogs,\n colors,\n}: {\n changelogs: MentraLiveOtaController[\"state\"][\"changelogs\"]\n colors: MentraLiveOtaFlowTheme\n}) {\n if (changelogs.length === 0) return null\n return (\n <ScrollView contentContainerStyle={styles.changelogContent} style={styles.changelogList}>\n {changelogs.map((entry) => (\n <View key={entry.version} style={styles.changelogEntry}>\n <Text selectable style={[styles.changelogVersion, {color: colors.foreground}]}>\n {entry.version}\n </Text>\n <Text selectable style={[styles.changelogMarkdown, {color: colors.textDim}]}>\n {entry.markdown}\n </Text>\n </View>\n ))}\n </ScrollView>\n )\n}\n\nfunction FlowButton({\n colors,\n disabled = false,\n label,\n onPress,\n secondary = false,\n}: {\n colors: MentraLiveOtaFlowTheme\n disabled?: boolean\n label: string\n onPress: () => void\n secondary?: boolean\n}) {\n return (\n <Pressable\n accessibilityRole=\"button\"\n disabled={disabled}\n onPress={onPress}\n style={({pressed}) => [\n styles.button,\n {\n backgroundColor: secondary ? colors.background : colors.foreground,\n borderColor: secondary ? colors.border : colors.foreground,\n opacity: disabled ? 0.45 : pressed ? 0.75 : 1,\n },\n ]}\n testID={`button-${label}`}>\n <Text style={[styles.buttonText, {color: secondary ? colors.foreground : colors.background}]}>{label}</Text>\n </Pressable>\n )\n}\n\nfunction MentraMark({color}: {color: string}) {\n return (\n <Svg width={33} height={18} viewBox=\"0 0 50 27\" fill=\"none\">\n <Rect y={14.8072} width={11.8457} height={11.8457} fill={color} />\n <Path d=\"M9.36639 0L30.7163 14.8072V26.6529L9.36639 11.8457V0Z\" fill={color} />\n <Path d=\"M28.6501 0L50 14.8072V26.6529L28.6501 11.8457V0Z\" fill={color} />\n </Svg>\n )\n}\n\nfunction FlowIcon({colors, name}: {colors: MentraLiveOtaFlowTheme; name: FlowPageProps[\"icon\"]}) {\n const color = name === \"alert\" || name === \"bluetooth\" ? colors.error : colors.primary\n const glyph =\n name === \"check\" ? \"✓\" : name === \"alert\" ? \"!\" : name === \"settings\" ? \"⚙\" : name === \"bluetooth\" ? \"⌁\" : \"↓\"\n return <Text style={[styles.icon, {color}]}>{glyph}</Text>\n}\n\nconst styles = StyleSheet.create({\n safeArea: {flex: 1},\n header: {\n alignItems: \"center\",\n flexDirection: \"row\",\n height: 48,\n justifyContent: \"space-between\",\n paddingHorizontal: 20,\n },\n page: {flex: 1, paddingBottom: 24, paddingHorizontal: 24},\n centerContent: {alignItems: \"center\", flex: 1, gap: 16, justifyContent: \"center\"},\n actionSpacer: {height: 48},\n actions: {gap: 12},\n icon: {fontSize: 64, fontWeight: \"500\", lineHeight: 72, textAlign: \"center\"},\n title: {fontSize: 20, fontWeight: \"600\", textAlign: \"center\"},\n body: {fontSize: 14, lineHeight: 20, maxWidth: 420, textAlign: \"center\"},\n percent: {fontSize: 30, fontVariant: [\"tabular-nums\"], fontWeight: \"700\"},\n progressTrack: {borderRadius: 4, height: 8, maxWidth: 420, overflow: \"hidden\", width: \"100%\"},\n progressFill: {borderRadius: 4, height: 8},\n changelogList: {flexShrink: 1, maxHeight: 260, maxWidth: 420, width: \"100%\"},\n changelogContent: {gap: 18, paddingVertical: 4},\n changelogEntry: {gap: 8},\n changelogVersion: {fontSize: 16, fontWeight: \"600\"},\n changelogMarkdown: {fontSize: 14, lineHeight: 20},\n button: {\n alignItems: \"center\",\n borderRadius: 50,\n borderWidth: 1,\n justifyContent: \"center\",\n minHeight: 44,\n paddingHorizontal: 20,\n },\n buttonText: {fontSize: 14, fontWeight: \"500\"},\n})\n"]}
|
package/build/react/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { MentraLiveOtaFlow, type MentraLiveOtaFlowPage, type MentraLiveOtaFlowProps, type MentraLiveOtaFlowTheme, type MentraLiveOtaFlowTranslate, } from "./MentraLiveOtaFlow";
|
|
2
|
-
export { useMentraLiveOta, type MentraLiveOtaController, type MentraLiveOtaError, type MentraLiveOtaErrorCode, type MentraLiveOtaHotspotPhase, type MentraLiveOtaInstallPhase, type MentraLiveOtaScreen, type MentraLiveOtaState, type MentraLiveOtaStep, type MentraLiveOtaTransport, type UseMentraLiveOtaOptions, } from "./useMentraLiveOta";
|
|
2
|
+
export { useMentraLiveOta, type MentraLiveOtaController, type MentraLiveOtaError, type MentraLiveOtaErrorCode, type MentraLiveOtaHotspotPhase, type MentraLiveOtaInstallPhase, type MentraLiveOtaReleaseTransition, type MentraLiveOtaScreen, type MentraLiveOtaState, type MentraLiveOtaStep, type MentraLiveOtaTransport, type UseMentraLiveOtaOptions, } from "./useMentraLiveOta";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,GAChC,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,GAC7B,MAAM,oBAAoB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,GAChC,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,8BAA8B,EACnC,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,GAC7B,MAAM,oBAAoB,CAAA"}
|
package/build/react/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,GAKlB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,GAKlB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,gBAAgB,GAYjB,MAAM,oBAAoB,CAAA","sourcesContent":["export {\n MentraLiveOtaFlow,\n type MentraLiveOtaFlowPage,\n type MentraLiveOtaFlowProps,\n type MentraLiveOtaFlowTheme,\n type MentraLiveOtaFlowTranslate,\n} from \"./MentraLiveOtaFlow\"\nexport {\n useMentraLiveOta,\n type MentraLiveOtaController,\n type MentraLiveOtaError,\n type MentraLiveOtaErrorCode,\n type MentraLiveOtaHotspotPhase,\n type MentraLiveOtaInstallPhase,\n type MentraLiveOtaReleaseTransition,\n type MentraLiveOtaScreen,\n type MentraLiveOtaState,\n type MentraLiveOtaStep,\n type MentraLiveOtaTransport,\n type UseMentraLiveOtaOptions,\n} from \"./useMentraLiveOta\"\n"]}
|