@mentra/engine 3.1.0-dev.44 → 3.1.0-dev.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -91,6 +91,10 @@ const ota = useMentraLiveOta({onFinished, onOpenWifiSetup})
91
91
  // Render ota.state.screen and invoke ota.install(), retryInstall(), finish(), etc.
92
92
  ```
93
93
 
94
+ On `up_to_date`, use `ota.state.completedUpdate` to distinguish a completed
95
+ update session from a standalone check. `releaseTransition` is optional release
96
+ metadata and is not a completion marker.
97
+
94
98
  Customize presentation only. Engine must remain responsible for OTA ordering,
95
99
  hotspot staging, restart recovery, retries, and verification. The canonical
96
100
  stock and custom integration guide is
@@ -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.44",
5
- "releaseSetId": "mentra-3.1.0-dev.44",
6
- "sourceCommit": "f94478f24d12b7cd6c9f430dd8ebdb74358f46ef",
7
- "otaManifestUrl": "https://github.com/Mentra-Community/MentraOS/releases/download/mentra-builds-v3.1.0/mentra-live-ota-3.1.0-dev.44.json",
8
- "otaManifestSha256": "a7dafdf212e34f0971292158cc2e63ec4c7ffd220afe1bdd0336911b82171593"
4
+ "releaseIdentity": "3.1.0-dev.47",
5
+ "releaseSetId": "mentra-3.1.0-dev.47",
6
+ "sourceCommit": "8449244dc1c7623c9edbf535ed43f68aeee71a1e",
7
+ "otaManifestUrl": "https://github.com/Mentra-Community/MentraOS/releases/download/mentra-builds-v3.1.0/mentra-live-ota-3.1.0-dev.47.json",
8
+ "otaManifestSha256": "7e1104f7a21ce5ce4bfd6653853f3616e7629fff6e5e794336134f9c6e757336"
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.44\",\n \"releaseSetId\": \"mentra-3.1.0-dev.44\",\n \"sourceCommit\": \"f94478f24d12b7cd6c9f430dd8ebdb74358f46ef\",\n \"otaManifestUrl\": \"https://github.com/Mentra-Community/MentraOS/releases/download/mentra-builds-v3.1.0/mentra-live-ota-3.1.0-dev.44.json\",\n \"otaManifestSha256\": \"a7dafdf212e34f0971292158cc2e63ec4c7ffd220afe1bdd0336911b82171593\"\n})\n"]}
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.47\",\n \"releaseSetId\": \"mentra-3.1.0-dev.47\",\n \"sourceCommit\": \"8449244dc1c7623c9edbf535ed43f68aeee71a1e\",\n \"otaManifestUrl\": \"https://github.com/Mentra-Community/MentraOS/releases/download/mentra-builds-v3.1.0/mentra-live-ota-3.1.0-dev.47.json\",\n \"otaManifestSha256\": \"7e1104f7a21ce5ce4bfd6653853f3616e7629fff6e5e794336134f9c6e757336\"\n})\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MentraLiveOtaFlow.d.ts","sourceRoot":"","sources":["../../src/react/MentraLiveOtaFlow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAgB,MAAM,OAAO,CAAA;AACpC,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAA;AAIrB,OAAO,EAAiD,KAAK,qBAAqB,EAAC,MAAM,oBAAoB,CAAA;AAE7G,YAAY,EAAC,qBAAqB,EAAC,MAAM,oBAAoB,CAAA;AAE7D,MAAM,MAAM,sBAAsB,GAAG;IACnC,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAA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eAAe,EACf,KAAK,EACL,SAAiB,EACjB,KAAK,EACL,SAA4B,GAC7B,EAAE,sBAAsB,qBA0BxB"}
@@ -15,11 +15,16 @@ const DEFAULT_THEME = {
15
15
  };
16
16
  const ENGLISH_COPY = {
17
17
  "common:continue": "Continue",
18
+ "common:done": "Done",
18
19
  "ota:checkingForUpdates": "Checking for updates",
19
20
  "ota:checkingForUpdatesMessage": "Connected devices will perform automatic updates. Automatic updates can be disabled in Device Settings",
21
+ "ota:finishingUpdate": "Finishing your update",
22
+ "ota:checkingAdditionalUpdates": "Checking whether your glasses need any additional updates.",
20
23
  "ota:updateAvailable": "{{deviceName}} Update Available",
21
24
  "ota:updateConnectWifi": "Connect your {{deviceName}} to WiFi to install the update.",
25
+ "ota:wifiRequiredTitle": "WiFi Needed for Update",
22
26
  "ota:updateDescription": "A new update is available for your glasses. We recommend updating now for the best experience.",
27
+ "ota:updateSequenceMessage": "Your glasses may install more than one update and restart several times. Keep them nearby until finished.",
23
28
  "ota:releaseTransition": "{{fromVersion}} → {{toVersion}}",
24
29
  "ota:releaseTransitionUnknown": "Current version unknown → {{toVersion}}",
25
30
  "ota:updatedToVersion": "Updated to {{version}}",
@@ -28,6 +33,7 @@ const ENGLISH_COPY = {
28
33
  "ota:updateNow": "Update Now",
29
34
  "ota:setupWifi": "Setup WiFi",
30
35
  "ota:updateLater": "Later",
36
+ "ota:updateComplete": "Update complete",
31
37
  "ota:upToDate": "Up To Date",
32
38
  "ota:devBuild": "Development Build",
33
39
  "ota:devBuildNoOta": "This mobile app is a development build, so automatic glasses updates are disabled. Use the developer settings manifest override to update them manually.",
@@ -82,8 +88,19 @@ function OtaFlowContent({ allowDevSkip, colors, controller, deviceName, superMod
82
88
  <ActivityIndicator size="large" color={colors.foreground}/>
83
89
  </FlowPage>);
84
90
  }
91
+ if (state.screen === "finishing") {
92
+ return (<FlowPage colors={colors} icon="download" title={translate("ota:finishingUpdate")}>
93
+ <BodyText colors={colors}>{translate("ota:checkingAdditionalUpdates")}</BodyText>
94
+ <ActivityIndicator size="large" color={colors.foreground}/>
95
+ </FlowPage>);
96
+ }
85
97
  if (state.screen === "update_available" || state.screen === "wifi_required") {
86
- return (<FlowPage colors={colors} icon="download" title={translate(state.versionChange ? "ota:downgradeAvailable" : "ota:updateAvailable", { deviceName })} actions={<>
98
+ const titleKey = state.screen === "wifi_required"
99
+ ? "ota:wifiRequiredTitle"
100
+ : state.versionChange
101
+ ? "ota:downgradeAvailable"
102
+ : "ota:updateAvailable";
103
+ return (<FlowPage colors={colors} icon="download" title={translate(titleKey, { deviceName })} actions={<>
87
104
  <FlowButton colors={colors} disabled={!state.wifiStatusKnown} label={translate(state.screen === "wifi_required" ? "ota:setupWifi" : "ota:updateNow")} onPress={state.screen === "wifi_required" ? controller.openWifiSetup : controller.install}/>
88
105
  {state.canDismiss ? (<FlowButton colors={colors} label={translate("ota:updateLater")} onPress={controller.finish} secondary/>) : null}
89
106
  {allowDevSkip && state.updateRequired ? (<FlowButton colors={colors} label="Skip (dev only)" onPress={controller.finish} secondary/>) : null}
@@ -101,6 +118,7 @@ function OtaFlowContent({ allowDevSkip, colors, controller, deviceName, superMod
101
118
  ? translate("ota:updateConnectWifi", { deviceName })
102
119
  : translate(state.versionChange ? "ota:downgradeDescription" : "ota:updateDescription")}
103
120
  </BodyText>
121
+ <BodyText colors={colors}>{translate("ota:updateSequenceMessage")}</BodyText>
104
122
  </FlowPage>);
105
123
  }
106
124
  if (state.screen === "dev_build") {
@@ -109,7 +127,7 @@ function OtaFlowContent({ allowDevSkip, colors, controller, deviceName, superMod
109
127
  </FlowPage>);
110
128
  }
111
129
  if (state.screen === "up_to_date") {
112
- return (<FlowPage actions={<FlowButton colors={colors} label={translate("common:continue")} onPress={controller.finish}/>} colors={colors} icon="check" title={translate("ota:upToDate")}>
130
+ return (<FlowPage actions={<FlowButton colors={colors} label={translate(state.completedUpdate ? "common:done" : "common:continue")} onPress={controller.finish}/>} colors={colors} icon="check" title={translate(state.completedUpdate ? "ota:updateComplete" : "ota:upToDate")}>
113
131
  <BodyText colors={colors}>{translate("ota:noUpdatesAvailable")}</BodyText>
114
132
  {state.releaseTransition ? (<BodyText colors={colors}>
115
133
  {translate("ota:updatedToVersion", { version: state.releaseTransition.toVersion })}
@@ -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,uBAAuB,EAAE,iCAAiC;IAC1D,8BAA8B,EAAE,yCAAyC;IACzE,sBAAsB,EAAE,wBAAwB;IAChD,wBAAwB,EAAE,wCAAwC;IAClE,0BAA0B,EACxB,kLAAkL;IACpL,eAAe,EAAE,YAAY;IAC7B,eAAe,EAAE,YAAY;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,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: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"]}
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,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Ac,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 \"common:done\": \"Done\",\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:finishingUpdate\": \"Finishing your update\",\n \"ota:checkingAdditionalUpdates\": \"Checking whether your glasses need any additional updates.\",\n \"ota:updateAvailable\": \"{{deviceName}} Update Available\",\n \"ota:updateConnectWifi\": \"Connect your {{deviceName}} to WiFi to install the update.\",\n \"ota:wifiRequiredTitle\": \"WiFi Needed for Update\",\n \"ota:updateDescription\":\n \"A new update is available for your glasses. We recommend updating now for the best experience.\",\n \"ota:updateSequenceMessage\":\n \"Your glasses may install more than one update and restart several times. Keep them nearby until finished.\",\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:updateComplete\": \"Update complete\",\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 === \"finishing\") {\n return (\n <FlowPage colors={colors} icon=\"download\" title={translate(\"ota:finishingUpdate\")}>\n <BodyText colors={colors}>{translate(\"ota:checkingAdditionalUpdates\")}</BodyText>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n </FlowPage>\n )\n }\n\n if (state.screen === \"update_available\" || state.screen === \"wifi_required\") {\n const titleKey =\n state.screen === \"wifi_required\"\n ? \"ota:wifiRequiredTitle\"\n : state.versionChange\n ? \"ota:downgradeAvailable\"\n : \"ota:updateAvailable\"\n return (\n <FlowPage\n colors={colors}\n icon=\"download\"\n title={translate(titleKey, {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 <BodyText colors={colors}>{translate(\"ota:updateSequenceMessage\")}</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={\n <FlowButton\n colors={colors}\n label={translate(state.completedUpdate ? \"common:done\" : \"common:continue\")}\n onPress={controller.finish}\n />\n }\n colors={colors}\n icon=\"check\"\n title={translate(state.completedUpdate ? \"ota:updateComplete\" : \"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"]}
@@ -1,6 +1,6 @@
1
1
  import type { ReleaseChangelog } from "../facades/ota";
2
2
  export type MentraLiveOtaFlowPage = "check" | "progress";
3
- export type MentraLiveOtaScreen = "initializing" | "checking" | "update_available" | "wifi_required" | "up_to_date" | "dev_build" | "check_failed" | "update_info_unavailable" | "starting" | "preparing_hotspot" | "updating" | "restarting" | "verifying" | "complete" | "failed" | "disconnected";
3
+ export type MentraLiveOtaScreen = "initializing" | "checking" | "finishing" | "update_available" | "wifi_required" | "up_to_date" | "dev_build" | "check_failed" | "update_info_unavailable" | "starting" | "preparing_hotspot" | "updating" | "restarting" | "verifying" | "complete" | "failed" | "disconnected";
4
4
  export type MentraLiveOtaErrorCode = "check_failed" | "update_info_unavailable" | "install_failed" | "bes_restart_required";
5
5
  export type MentraLiveOtaError = {
6
6
  code: MentraLiveOtaErrorCode;
@@ -44,6 +44,8 @@ export type MentraLiveOtaState = {
44
44
  canDiscard: boolean;
45
45
  canOpenWifiSetup: boolean;
46
46
  continueDisabled: boolean;
47
+ /** True only after an approved update session reaches a final no-update check. */
48
+ completedUpdate: boolean;
47
49
  /** Release labels for the offered or just-completed coordinated update. */
48
50
  releaseTransition: MentraLiveOtaReleaseTransition | null;
49
51
  /** Release notes crossed by this update, newest first. Populated on completion. */
@@ -1 +1 @@
1
- {"version":3,"file":"useMentraLiveOta.d.ts","sourceRoot":"","sources":["../../src/react/useMentraLiveOta.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,gBAAgB,CAAA;AAGpD,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,UAAU,CAAA;AAExD,MAAM,MAAM,mBAAmB,GAC3B,cAAc,GACd,UAAU,GACV,kBAAkB,GAClB,eAAe,GACf,YAAY,GACZ,WAAW,GACX,cAAc,GACd,yBAAyB,GACzB,UAAU,GACV,mBAAmB,GACnB,UAAU,GACV,YAAY,GACZ,WAAW,GACX,UAAU,GACV,QAAQ,GACR,cAAc,CAAA;AAElB,MAAM,MAAM,sBAAsB,GAC9B,cAAc,GACd,yBAAyB,GACzB,gBAAgB,GAChB,sBAAsB,CAAA;AAE1B,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,sBAAsB,CAAA;IAC5B,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,SAAS,CAAA;AACvD,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,aAAa,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,SAAS,CAAA;AACnH,MAAM,MAAM,yBAAyB,GAAG,UAAU,GAAG,SAAS,CAAA;AAC9D,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAA;AAErD,MAAM,MAAM,8BAA8B,GAAG;IAC3C,0FAA0F;IAC1F,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,kBAAkB,GA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E,uBAA4B,GAAG,uBAAuB,CA2iB/F"}
@@ -40,10 +40,10 @@ function installProgress(snapshot) {
40
40
  const isDownload = otaStatus?.phase === "download";
41
41
  const totalSteps = otaStatus?.totalSteps ?? 1;
42
42
  const rawPercent = isDownload
43
- ? otaStatus?.stepPercent ?? 0
43
+ ? (otaStatus?.stepPercent ?? 0)
44
44
  : totalSteps >= 2
45
- ? otaStatus?.overallPercent ?? 0
46
- : otaStatus?.stepPercent ?? 0;
45
+ ? (otaStatus?.overallPercent ?? 0)
46
+ : (otaStatus?.stepPercent ?? 0);
47
47
  return Math.min(Math.max(rawPercent, snapshot.mtkInstallStallSimulatedPercent ?? 0, 0), 100);
48
48
  }
49
49
  function progressScreen(snapshot) {
@@ -84,6 +84,7 @@ export function useMentraLiveOta(options = {}) {
84
84
  const [updateFingerprint, setUpdateFingerprint] = useState(null);
85
85
  const [offeredReleaseTransition, setOfferedReleaseTransition] = useState(null);
86
86
  const [completedReleaseTransition, setCompletedReleaseTransition] = useState(null);
87
+ const [completedUpdate, setCompletedUpdate] = useState(false);
87
88
  const [completedChangelogs, setCompletedChangelogs] = useState([]);
88
89
  const [checkGeneration, setCheckGeneration] = useState(0);
89
90
  const performCheckGenerationRef = useRef(0);
@@ -117,6 +118,7 @@ export function useMentraLiveOta(options = {}) {
117
118
  const returnToCheck = useCallback(() => {
118
119
  installActionPendingRef.current = false;
119
120
  autoChainAdvancedRef.current = false;
121
+ setCheckState("checking");
120
122
  setPage("check");
121
123
  setCheckGeneration((generation) => generation + 1);
122
124
  }, []);
@@ -125,6 +127,20 @@ export function useMentraLiveOta(options = {}) {
125
127
  ota.clearProgress();
126
128
  setPage("progress");
127
129
  }, []);
130
+ const continueApprovedChain = useCallback((result) => {
131
+ if (installActionPendingRef.current || !isOtaAutoChainActive() || !result.updateInfo)
132
+ return false;
133
+ const snapshot = ota.snapshot();
134
+ if (!snapshot.wifiStatusKnown || (!snapshot.wifiConnected && snapshot.hotspotOtaVersion !== 1))
135
+ return false;
136
+ const admission = tryAdvanceOtaAutoChain(otaAutoChainFingerprint(result), result.updateInfo.isDowngrade === true, releaseRangeTargetVersion(result), result.releaseVersion);
137
+ if (!admission.advance)
138
+ return false;
139
+ checkCompletedRef.current = true;
140
+ ota.installSession.prepare(result);
141
+ navigateToProgress();
142
+ return true;
143
+ }, [navigateToProgress]);
128
144
  useEffect(() => {
129
145
  if (!runtimeReady || page !== "check")
130
146
  return;
@@ -235,31 +251,22 @@ export function useMentraLiveOta(options = {}) {
235
251
  const fromVersion = currentReleaseVersion(ota.snapshot().appVersion);
236
252
  setOfferedReleaseTransition(result.releaseVersion ? { fromVersion, toVersion: result.releaseVersion } : null);
237
253
  }
238
- if (isOtaAutoChainActive()) {
239
- const snapshot = ota.snapshot();
240
- if (!snapshot.wifiStatusKnown)
241
- return;
242
- if (!snapshot.wifiConnected && snapshot.hotspotOtaVersion !== 1) {
243
- stopOtaAutoChain();
244
- }
245
- else {
246
- const admission = tryAdvanceOtaAutoChain(fingerprint, result.updateInfo.isDowngrade === true, releaseRangeTargetVersion(result), result.releaseVersion);
247
- if (admission.advance) {
248
- checkCompletedRef.current = true;
249
- ota.installSession.prepare(result);
250
- navigateToProgress();
251
- return;
252
- }
253
- }
254
+ if (isOtaAutoChainActive() && !ota.snapshot().wifiStatusKnown) {
255
+ checkCompletedRef.current = true;
256
+ return;
254
257
  }
258
+ if (continueApprovedChain(result))
259
+ return;
255
260
  checkCompletedRef.current = true;
256
261
  setCheckState("update_available");
257
262
  return;
258
263
  }
259
- if (isOtaAutoChainActive()) {
264
+ const completedApprovedSession = isOtaAutoChainActive();
265
+ if (completedApprovedSession) {
260
266
  setCompletedChangelogs(releaseChangelogsForActiveChain());
261
267
  setCompletedReleaseTransition(releaseTransitionFromRange(otaAutoChainReleaseRange()));
262
268
  }
269
+ setCompletedUpdate(completedApprovedSession);
263
270
  stopOtaAutoChain();
264
271
  checkCompletedRef.current = true;
265
272
  ota.clearUpdateAvailable();
@@ -282,7 +289,32 @@ export function useMentraLiveOta(options = {}) {
282
289
  if (reconnectTimeout)
283
290
  clearTimeout(reconnectTimeout);
284
291
  };
285
- }, [checkGeneration, navigateToProgress, otaSnapshot.connected, otaSnapshot.wifiStatusKnown, page, runtimeReady]);
292
+ }, [checkGeneration, continueApprovedChain, otaSnapshot.connected, otaSnapshot.wifiStatusKnown, page, runtimeReady]);
293
+ useEffect(() => {
294
+ if (!runtimeReady ||
295
+ page !== "check" ||
296
+ (checkState !== "checking" && checkState !== "update_available") ||
297
+ !otaSnapshot.wifiStatusKnown ||
298
+ !isOtaAutoChainActive()) {
299
+ return;
300
+ }
301
+ const result = selectedCheckResultRef.current;
302
+ if (!result?.updateAvailable || !result.updateInfo)
303
+ return;
304
+ if (!otaSnapshot.wifiConnected && otaSnapshot.hotspotOtaVersion !== 1) {
305
+ setCheckState("update_available");
306
+ return;
307
+ }
308
+ continueApprovedChain(result);
309
+ }, [
310
+ checkState,
311
+ continueApprovedChain,
312
+ otaSnapshot.hotspotOtaVersion,
313
+ otaSnapshot.wifiConnected,
314
+ otaSnapshot.wifiStatusKnown,
315
+ page,
316
+ runtimeReady,
317
+ ]);
286
318
  useEffect(() => {
287
319
  if (!runtimeReady || page !== "progress")
288
320
  return;
@@ -324,6 +356,7 @@ export function useMentraLiveOta(options = {}) {
324
356
  const check = useCallback(() => {
325
357
  setOfferedReleaseTransition(null);
326
358
  setCompletedReleaseTransition(null);
359
+ setCompletedUpdate(false);
327
360
  setCompletedChangelogs([]);
328
361
  setPage("check");
329
362
  setCheckState("checking");
@@ -348,6 +381,7 @@ export function useMentraLiveOta(options = {}) {
348
381
  return;
349
382
  }
350
383
  ota.installSession.prepare(result);
384
+ setCompletedUpdate(false);
351
385
  setCompletedChangelogs([]);
352
386
  if (updateFingerprint) {
353
387
  const fromVersion = offeredReleaseTransition
@@ -395,6 +429,7 @@ export function useMentraLiveOta(options = {}) {
395
429
  const state = useMemo(() => {
396
430
  const hotspotSupported = otaSnapshot.hotspotOtaVersion === 1;
397
431
  const canInstall = otaSnapshot.wifiStatusKnown && (otaSnapshot.wifiConnected || hotspotSupported);
432
+ const autoChainActive = isOtaAutoChainActive();
398
433
  if (!runtimeReady) {
399
434
  return {
400
435
  screen: "initializing",
@@ -424,30 +459,34 @@ export function useMentraLiveOta(options = {}) {
424
459
  canDiscard: false,
425
460
  canOpenWifiSetup: false,
426
461
  continueDisabled: false,
462
+ completedUpdate: false,
427
463
  releaseTransition: null,
428
464
  changelogs: [],
429
465
  };
430
466
  }
431
467
  if (page === "check") {
432
468
  const wifiRequired = otaSnapshot.wifiStatusKnown && !otaSnapshot.wifiConnected && !hotspotSupported;
433
- const screen = checkState === "checking"
434
- ? "checking"
435
- : checkState === "update_available"
436
- ? wifiRequired
437
- ? "wifi_required"
438
- : "update_available"
439
- : checkState === "no_update"
440
- ? "up_to_date"
441
- : checkState === "dev_build"
442
- ? "dev_build"
443
- : errorKind === "pin_unavailable"
444
- ? "update_info_unavailable"
445
- : "check_failed";
446
- const error = screen === "check_failed"
447
- ? { code: "check_failed", message: "Couldn't check for updates. Please check your connection and try again." }
448
- : screen === "update_info_unavailable"
449
- ? { code: "update_info_unavailable", message: "Update information for this app version is unavailable." }
450
- : null;
469
+ let screen;
470
+ if (checkState === "checking")
471
+ screen = autoChainActive ? "finishing" : "checking";
472
+ else if (checkState === "update_available")
473
+ screen = wifiRequired ? "wifi_required" : "update_available";
474
+ else if (checkState === "no_update")
475
+ screen = "up_to_date";
476
+ else if (checkState === "dev_build")
477
+ screen = "dev_build";
478
+ else
479
+ screen = errorKind === "pin_unavailable" ? "update_info_unavailable" : "check_failed";
480
+ let error = null;
481
+ if (screen === "check_failed") {
482
+ error = {
483
+ code: "check_failed",
484
+ message: "Couldn't check for updates. Please check your connection and try again.",
485
+ };
486
+ }
487
+ else if (screen === "update_info_unavailable") {
488
+ error = { code: "update_info_unavailable", message: "Update information for this app version is unavailable." };
489
+ }
451
490
  return {
452
491
  screen,
453
492
  connected: otaSnapshot.connected,
@@ -472,12 +511,15 @@ export function useMentraLiveOta(options = {}) {
472
511
  canInstall: screen === "update_available" && canInstall,
473
512
  canRetry: screen === "check_failed",
474
513
  canFinish: screen === "up_to_date" || screen === "dev_build" || screen === "update_info_unavailable",
475
- canDismiss: (screen === "update_available" || screen === "wifi_required") && !isUpdateRequired,
514
+ canDismiss: (screen === "update_available" || screen === "wifi_required") && !isUpdateRequired && !autoChainActive,
476
515
  canDiscard: false,
477
516
  canOpenWifiSetup: screen === "wifi_required",
478
517
  continueDisabled: false,
518
+ completedUpdate: screen === "up_to_date" && completedUpdate,
479
519
  releaseTransition: screen === "update_available" || screen === "wifi_required"
480
- ? offeredReleaseTransition
520
+ ? autoChainActive
521
+ ? releaseTransitionFromRange(otaAutoChainReleaseRange())
522
+ : offeredReleaseTransition
481
523
  : screen === "up_to_date"
482
524
  ? completedReleaseTransition
483
525
  : null,
@@ -489,7 +531,8 @@ export function useMentraLiveOta(options = {}) {
489
531
  const displayedError = requiresGlassesReboot
490
532
  ? BES_INSTALL_RESTART_MESSAGE
491
533
  : installSnapshot.errorMsg || getOtaErrorMessage(installSnapshot.otaStatus?.error);
492
- const screen = progressScreen(installSnapshot);
534
+ const progressState = progressScreen(installSnapshot);
535
+ const screen = progressState === "complete" && autoChainActive ? "finishing" : progressState;
493
536
  const error = screen === "failed"
494
537
  ? {
495
538
  code: requiresGlassesReboot ? "bes_restart_required" : "install_failed",
@@ -528,6 +571,7 @@ export function useMentraLiveOta(options = {}) {
528
571
  canDiscard: screen === "disconnected",
529
572
  canOpenWifiSetup: screen === "failed" && showChangeWifi,
530
573
  continueDisabled: installSnapshot.continueButtonDisabled,
574
+ completedUpdate: false,
531
575
  releaseTransition: releaseTransitionFromRange(otaAutoChainReleaseRange()),
532
576
  changelogs,
533
577
  };
@@ -535,6 +579,7 @@ export function useMentraLiveOta(options = {}) {
535
579
  checkState,
536
580
  completedChangelogs,
537
581
  completedReleaseTransition,
582
+ completedUpdate,
538
583
  errorKind,
539
584
  firmwareRestarting,
540
585
  installSnapshot,