@mentra/engine 0.1.0-dev.1 → 3.1.0-beta.103

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.
Files changed (267) hide show
  1. package/README.md +43 -29
  2. package/build/bluetooth-sdk/debug.d.ts +2 -0
  3. package/build/bluetooth-sdk/debug.d.ts.map +1 -0
  4. package/build/bluetooth-sdk/debug.js +2 -0
  5. package/build/bluetooth-sdk/debug.js.map +1 -0
  6. package/build/bluetooth-sdk/index.d.ts +3 -0
  7. package/build/bluetooth-sdk/index.d.ts.map +1 -0
  8. package/build/bluetooth-sdk/index.js +3 -0
  9. package/build/bluetooth-sdk/index.js.map +1 -0
  10. package/build/bluetooth-sdk/ota-transport.d.ts +2 -0
  11. package/build/bluetooth-sdk/ota-transport.d.ts.map +1 -0
  12. package/build/bluetooth-sdk/ota-transport.js +2 -0
  13. package/build/bluetooth-sdk/ota-transport.js.map +1 -0
  14. package/build/bluetooth-sdk/photo-receiver.d.ts +3 -0
  15. package/build/bluetooth-sdk/photo-receiver.d.ts.map +1 -0
  16. package/build/bluetooth-sdk/photo-receiver.js +3 -0
  17. package/build/bluetooth-sdk/photo-receiver.js.map +1 -0
  18. package/build/bluetooth-sdk/react.d.ts +2 -0
  19. package/build/bluetooth-sdk/react.d.ts.map +1 -0
  20. package/build/bluetooth-sdk/react.js +2 -0
  21. package/build/bluetooth-sdk/react.js.map +1 -0
  22. package/build/bluetooth-sdk/types.d.ts +2 -0
  23. package/build/bluetooth-sdk/types.d.ts.map +1 -0
  24. package/build/bluetooth-sdk/types.js +2 -0
  25. package/build/bluetooth-sdk/types.js.map +1 -0
  26. package/build/engine.d.ts +18 -15
  27. package/build/engine.d.ts.map +1 -1
  28. package/build/engine.js +2 -2
  29. package/build/engine.js.map +1 -1
  30. package/build/facades/display.d.ts +1 -1
  31. package/build/facades/display.d.ts.map +1 -1
  32. package/build/facades/display.js +1 -1
  33. package/build/facades/display.js.map +1 -1
  34. package/build/facades/glasses.d.ts +3 -13
  35. package/build/facades/glasses.d.ts.map +1 -1
  36. package/build/facades/glasses.js +3 -3
  37. package/build/facades/glasses.js.map +1 -1
  38. package/build/facades/ota.d.ts +16 -22
  39. package/build/facades/ota.d.ts.map +1 -1
  40. package/build/facades/ota.js +13 -9
  41. package/build/facades/ota.js.map +1 -1
  42. package/build/facades/pairing.d.ts +8 -5
  43. package/build/facades/pairing.d.ts.map +1 -1
  44. package/build/facades/pairing.js +83 -9
  45. package/build/facades/pairing.js.map +1 -1
  46. package/build/facades/speech.d.ts +7 -6
  47. package/build/facades/speech.d.ts.map +1 -1
  48. package/build/facades/speech.js +1 -1
  49. package/build/facades/speech.js.map +1 -1
  50. package/build/generated/releaseMetadata.d.ts +12 -0
  51. package/build/generated/releaseMetadata.d.ts.map +1 -0
  52. package/build/generated/releaseMetadata.js +10 -0
  53. package/build/generated/releaseMetadata.js.map +1 -0
  54. package/build/index.d.ts +7 -8
  55. package/build/index.d.ts.map +1 -1
  56. package/build/index.js +4 -5
  57. package/build/index.js.map +1 -1
  58. package/build/react/MentraLiveOtaFlow.d.ts +8 -2
  59. package/build/react/MentraLiveOtaFlow.d.ts.map +1 -1
  60. package/build/react/MentraLiveOtaFlow.js +256 -354
  61. package/build/react/MentraLiveOtaFlow.js.map +1 -1
  62. package/build/react/index.d.ts +1 -0
  63. package/build/react/index.d.ts.map +1 -1
  64. package/build/react/index.js +1 -0
  65. package/build/react/index.js.map +1 -1
  66. package/build/react/useMentraLiveOta.d.ts +84 -0
  67. package/build/react/useMentraLiveOta.d.ts.map +1 -0
  68. package/build/react/useMentraLiveOta.js +627 -0
  69. package/build/react/useMentraLiveOta.js.map +1 -0
  70. package/build/services/AppRegistry.d.ts +8 -0
  71. package/build/services/AppRegistry.d.ts.map +1 -1
  72. package/build/services/AppRegistry.js +15 -0
  73. package/build/services/AppRegistry.js.map +1 -1
  74. package/build/services/BlobStore.d.ts +2 -0
  75. package/build/services/BlobStore.d.ts.map +1 -1
  76. package/build/services/BlobStore.js +63 -10
  77. package/build/services/BlobStore.js.map +1 -1
  78. package/build/services/DisplayProcessor.d.ts +3 -3
  79. package/build/services/DisplayProcessor.js +3 -3
  80. package/build/services/DisplayProcessor.js.map +1 -1
  81. package/build/services/GlassesStatusProjection.d.ts +15 -2
  82. package/build/services/GlassesStatusProjection.d.ts.map +1 -1
  83. package/build/services/GlassesStatusProjection.js +3 -3
  84. package/build/services/GlassesStatusProjection.js.map +1 -1
  85. package/build/services/HotspotOtaTransport.d.ts.map +1 -1
  86. package/build/services/HotspotOtaTransport.js +8 -7
  87. package/build/services/HotspotOtaTransport.js.map +1 -1
  88. package/build/services/LocalDisplayManager.d.ts +2 -3
  89. package/build/services/LocalDisplayManager.d.ts.map +1 -1
  90. package/build/services/LocalDisplayManager.js +2 -3
  91. package/build/services/LocalDisplayManager.js.map +1 -1
  92. package/build/services/OtaAutoChain.d.ts +9 -2
  93. package/build/services/OtaAutoChain.d.ts.map +1 -1
  94. package/build/services/OtaAutoChain.js +10 -2
  95. package/build/services/OtaAutoChain.js.map +1 -1
  96. package/build/services/OtaInstallCoordinator.d.ts +26 -3
  97. package/build/services/OtaInstallCoordinator.d.ts.map +1 -1
  98. package/build/services/OtaInstallCoordinator.js +38 -13
  99. package/build/services/OtaInstallCoordinator.js.map +1 -1
  100. package/build/services/OtaService.d.ts.map +1 -1
  101. package/build/services/OtaService.js +1 -1
  102. package/build/services/OtaService.js.map +1 -1
  103. package/build/services/OtaUpdateCheckService.d.ts +4 -1
  104. package/build/services/OtaUpdateCheckService.d.ts.map +1 -1
  105. package/build/services/OtaUpdateCheckService.js +33 -21
  106. package/build/services/OtaUpdateCheckService.js.map +1 -1
  107. package/build/services/PhonePhotoCoordinator.js +1 -1
  108. package/build/services/PhonePhotoCoordinator.js.map +1 -1
  109. package/build/services/PhoneStreamCoordinator.d.ts.map +1 -1
  110. package/build/services/PhoneStreamCoordinator.js +9 -6
  111. package/build/services/PhoneStreamCoordinator.js.map +1 -1
  112. package/build/services/StreamLifecycleController.d.ts +3 -3
  113. package/build/services/StreamLifecycleController.js +3 -3
  114. package/build/services/StreamLifecycleController.js.map +1 -1
  115. package/build/services/asg/localNetworkTransport.d.ts.map +1 -1
  116. package/build/services/asg/localNetworkTransport.js +13 -12
  117. package/build/services/asg/localNetworkTransport.js.map +1 -1
  118. package/build/services/glassesClockSync.d.ts.map +1 -1
  119. package/build/services/glassesClockSync.js +5 -1
  120. package/build/services/glassesClockSync.js.map +1 -1
  121. package/build/services/otaDisplayState.d.ts +1 -1
  122. package/build/services/otaDisplayState.d.ts.map +1 -1
  123. package/build/services/otaDisplayState.js.map +1 -1
  124. package/build/services/otaInstallPolicy.d.ts +5 -1
  125. package/build/services/otaInstallPolicy.d.ts.map +1 -1
  126. package/build/services/otaInstallPolicy.js +4 -0
  127. package/build/services/otaInstallPolicy.js.map +1 -1
  128. package/build/services/otaLegacyMapping.d.ts +1 -1
  129. package/build/services/otaLegacyMapping.d.ts.map +1 -1
  130. package/build/services/otaLegacyMapping.js.map +1 -1
  131. package/build/services/otaManifestPolicy.d.ts +14 -0
  132. package/build/services/otaManifestPolicy.d.ts.map +1 -0
  133. package/build/services/otaManifestPolicy.js +19 -0
  134. package/build/services/otaManifestPolicy.js.map +1 -0
  135. package/build/services/otaManifestUrl.d.ts +2 -1
  136. package/build/services/otaManifestUrl.d.ts.map +1 -1
  137. package/build/services/otaManifestUrl.js +24 -32
  138. package/build/services/otaManifestUrl.js.map +1 -1
  139. package/build/services/otaReleaseVersion.d.ts +10 -0
  140. package/build/services/otaReleaseVersion.d.ts.map +1 -0
  141. package/build/services/otaReleaseVersion.js +14 -0
  142. package/build/services/otaReleaseVersion.js.map +1 -0
  143. package/build/stores/appVisibility.d.ts +3 -0
  144. package/build/stores/appVisibility.d.ts.map +1 -0
  145. package/build/stores/appVisibility.js +3 -0
  146. package/build/stores/appVisibility.js.map +1 -0
  147. package/build/stores/apps.d.ts.map +1 -1
  148. package/build/stores/apps.js +7 -1
  149. package/build/stores/apps.js.map +1 -1
  150. package/build/stores/core.d.ts +3 -3
  151. package/build/stores/core.d.ts.map +1 -1
  152. package/build/stores/core.js.map +1 -1
  153. package/build/stores/glasses.d.ts +10 -4
  154. package/build/stores/glasses.d.ts.map +1 -1
  155. package/build/stores/glasses.js.map +1 -1
  156. package/build/stores/settings.js +3 -3
  157. package/build/stores/settings.js.map +1 -1
  158. package/build/types/applet.d.ts +1 -1
  159. package/build/types/applet.js +1 -1
  160. package/build/types/applet.js.map +1 -1
  161. package/build/types/capabilities/even-realities-g1.d.ts.map +1 -1
  162. package/build/types/capabilities/even-realities-g1.js +2 -0
  163. package/build/types/capabilities/even-realities-g1.js.map +1 -1
  164. package/build/types/capabilities/even-realities-g2.d.ts.map +1 -1
  165. package/build/types/capabilities/even-realities-g2.js +2 -0
  166. package/build/types/capabilities/even-realities-g2.js.map +1 -1
  167. package/build/types/capabilities/mentra-display.d.ts.map +1 -1
  168. package/build/types/capabilities/mentra-display.js +2 -0
  169. package/build/types/capabilities/mentra-display.js.map +1 -1
  170. package/build/types/capabilities/mentra-live.d.ts.map +1 -1
  171. package/build/types/capabilities/mentra-live.js +2 -0
  172. package/build/types/capabilities/mentra-live.js.map +1 -1
  173. package/build/types/capabilities/nimo.d.ts +9 -0
  174. package/build/types/capabilities/nimo.d.ts.map +1 -0
  175. package/build/types/capabilities/nimo.js +57 -0
  176. package/build/types/capabilities/nimo.js.map +1 -0
  177. package/build/types/capabilities/none.d.ts.map +1 -1
  178. package/build/types/capabilities/none.js +2 -0
  179. package/build/types/capabilities/none.js.map +1 -1
  180. package/build/types/capabilities/simulated-glasses.d.ts.map +1 -1
  181. package/build/types/capabilities/simulated-glasses.js +2 -0
  182. package/build/types/capabilities/simulated-glasses.js.map +1 -1
  183. package/build/types/capabilities/vuzix-z100.d.ts.map +1 -1
  184. package/build/types/capabilities/vuzix-z100.js +2 -0
  185. package/build/types/capabilities/vuzix-z100.js.map +1 -1
  186. package/build/types/enums.d.ts +3 -26
  187. package/build/types/enums.d.ts.map +1 -1
  188. package/build/types/enums.js +2 -27
  189. package/build/types/enums.js.map +1 -1
  190. package/build/types/hardware.d.ts +6 -15
  191. package/build/types/hardware.d.ts.map +1 -1
  192. package/build/types/hardware.js +4 -4
  193. package/build/types/hardware.js.map +1 -1
  194. package/build/types/index.d.ts +3 -7
  195. package/build/types/index.d.ts.map +1 -1
  196. package/build/types/index.js +3 -7
  197. package/build/types/index.js.map +1 -1
  198. package/build/utils/display/composer/ColumnComposer.d.ts +1 -1
  199. package/build/utils/display/composer/ColumnComposer.js +1 -1
  200. package/build/utils/display/composer/ColumnComposer.js.map +1 -1
  201. package/package.json +47 -22
  202. package/src/bluetooth-sdk/debug.ts +1 -0
  203. package/src/bluetooth-sdk/index.ts +2 -0
  204. package/src/bluetooth-sdk/ota-transport.ts +1 -0
  205. package/src/bluetooth-sdk/photo-receiver.ts +2 -0
  206. package/src/bluetooth-sdk/react.ts +1 -0
  207. package/src/bluetooth-sdk/types.ts +1 -0
  208. package/src/engine.ts +2 -2
  209. package/src/facades/display.ts +1 -1
  210. package/src/facades/glasses.ts +4 -4
  211. package/src/facades/ota.ts +23 -10
  212. package/src/facades/pairing.ts +92 -16
  213. package/src/facades/speech.ts +21 -7
  214. package/src/generated/releaseMetadata.ts +20 -0
  215. package/src/index.ts +16 -11
  216. package/src/react/MentraLiveOtaFlow.tsx +378 -480
  217. package/src/react/index.ts +14 -0
  218. package/src/react/useMentraLiveOta.ts +793 -0
  219. package/src/services/AppRegistry.ts +16 -0
  220. package/src/services/BlobStore.ts +57 -10
  221. package/src/services/DisplayProcessor.ts +3 -3
  222. package/src/services/GlassesStatusProjection.ts +7 -6
  223. package/src/services/HotspotOtaTransport.ts +8 -7
  224. package/src/services/LocalDisplayManager.ts +2 -3
  225. package/src/services/OtaAutoChain.ts +26 -2
  226. package/src/services/OtaInstallCoordinator.ts +40 -13
  227. package/src/services/OtaService.ts +1 -2
  228. package/src/services/OtaUpdateCheckService.ts +45 -27
  229. package/src/services/PhonePhotoCoordinator.ts +1 -1
  230. package/src/services/PhoneStreamCoordinator.ts +10 -6
  231. package/src/services/StreamLifecycleController.ts +3 -3
  232. package/src/services/asg/localNetworkTransport.ts +20 -19
  233. package/src/services/glassesClockSync.ts +5 -1
  234. package/src/services/otaDisplayState.ts +1 -1
  235. package/src/services/otaInstallPolicy.ts +5 -1
  236. package/src/services/otaLegacyMapping.ts +1 -1
  237. package/src/services/otaManifestPolicy.ts +42 -0
  238. package/src/services/otaManifestUrl.ts +27 -36
  239. package/src/services/otaReleaseVersion.ts +22 -0
  240. package/src/stores/appVisibility.ts +3 -0
  241. package/src/stores/apps.ts +7 -1
  242. package/src/stores/core.ts +4 -4
  243. package/src/stores/glasses.ts +13 -6
  244. package/src/stores/settings.ts +3 -3
  245. package/src/types/applet.ts +1 -1
  246. package/src/types/capabilities/even-realities-g1.ts +3 -0
  247. package/src/types/capabilities/even-realities-g2.ts +3 -0
  248. package/src/types/capabilities/mentra-display.ts +3 -0
  249. package/src/types/capabilities/mentra-live.ts +3 -0
  250. package/src/types/capabilities/nimo.ts +59 -0
  251. package/src/types/capabilities/none.ts +3 -0
  252. package/src/types/capabilities/simulated-glasses.ts +3 -0
  253. package/src/types/capabilities/vuzix-z100.ts +3 -0
  254. package/src/types/enums.ts +2 -27
  255. package/src/types/hardware.ts +7 -15
  256. package/src/types/index.ts +3 -6
  257. package/src/utils/display/composer/ColumnComposer.ts +1 -1
  258. package/build/devtools.d.ts +0 -11
  259. package/build/devtools.d.ts.map +0 -1
  260. package/build/devtools.js +0 -13
  261. package/build/devtools.js.map +0 -1
  262. package/build/internal.d.ts +0 -67
  263. package/build/internal.d.ts.map +0 -1
  264. package/build/internal.js +0 -90
  265. package/build/internal.js.map +0 -1
  266. package/src/devtools.ts +0 -13
  267. package/src/internal.ts +0 -160
@@ -17,13 +17,13 @@
17
17
  * state written mid-pass queues a follow-up pass — the same way a setState
18
18
  * during React effects scheduled a re-render after the current effect batch.
19
19
  */
20
- import BluetoothSdk from "@mentra/bluetooth-sdk/internal";
20
+ import BluetoothSdk from "@mentra/bluetooth-sdk";
21
21
  import GlobalEventEmitter from "../utils/GlobalEventEmitter";
22
22
  import { isGlassesConnected, useGlassesStore } from "../stores/glasses";
23
23
  import { resolveOtaManifestUrl } from "./otaManifestUrl";
24
24
  import { hotspotOtaTransport } from "./HotspotOtaTransport";
25
25
  import { deriveDisplayState } from "./otaDisplayState";
26
- import { BES_CONTINUE_LOCKOUT_MS, DOWNLOAD_STUCK_TIMEOUT_MS, GLOBAL_OTA_TIMEOUT_MS, LEGACY_APK_COMPLETION_SETTLE_MS, LEGACY_BES_CONTINUE_LOCKOUT_MS, LEGACY_DOWNLOAD_STUCK_TIMEOUT_MS, LEGACY_GLOBAL_OTA_TIMEOUT_MS, LEGACY_MTK_INSTALL_TIMEOUT_MS, LEGACY_MTK_SIM_CAP_PERCENT, LEGACY_MTK_SIM_FLOOR_PERCENT, LEGACY_MTK_SIM_TICK_MS, LEGACY_MTK_STALL_DETECT_MS, LEGACY_MTK_STALL_ZONE_MAX_PERCENT, LEGACY_MTK_STALL_ZONE_MIN_PERCENT, LEGACY_PING_INTERVAL_MS, LEGACY_PROGRESS_TIMEOUT_MS, LEGACY_RETRY_INTERVAL_MS, MAX_RETRIES, MTK_INSTALL_TIMEOUT_MS, OtaProgressMessages, PING_INTERVAL_MS, PROGRESS_TIMEOUT_MS, QUERY_REPLY_TIMEOUT_MS, RETRY_INTERVAL_MS, isLegacyShapedOtaSession, isLegacyShapedOtaStatus, selectOtaProtocolProfile, } from "./otaInstallPolicy";
26
+ import { BES_CONTINUE_LOCKOUT_MS, BES_RESTART_TIMEOUT_MS, DOWNLOAD_STUCK_TIMEOUT_MS, GLOBAL_OTA_TIMEOUT_MS, LEGACY_APK_COMPLETION_SETTLE_MS, LEGACY_BES_CONTINUE_LOCKOUT_MS, LEGACY_BES_RESTART_TIMEOUT_MS, LEGACY_DOWNLOAD_STUCK_TIMEOUT_MS, LEGACY_GLOBAL_OTA_TIMEOUT_MS, LEGACY_MTK_INSTALL_TIMEOUT_MS, LEGACY_MTK_SIM_CAP_PERCENT, LEGACY_MTK_SIM_FLOOR_PERCENT, LEGACY_MTK_SIM_TICK_MS, LEGACY_MTK_STALL_DETECT_MS, LEGACY_MTK_STALL_ZONE_MAX_PERCENT, LEGACY_MTK_STALL_ZONE_MIN_PERCENT, LEGACY_PING_INTERVAL_MS, LEGACY_PROGRESS_TIMEOUT_MS, LEGACY_RETRY_INTERVAL_MS, MAX_RETRIES, MTK_INSTALL_TIMEOUT_MS, OtaProgressMessages, PING_INTERVAL_MS, PROGRESS_TIMEOUT_MS, QUERY_REPLY_TIMEOUT_MS, RETRY_INTERVAL_MS, isLegacyShapedOtaSession, isLegacyShapedOtaStatus, selectOtaProtocolProfile, } from "./otaInstallPolicy";
27
27
  function isTerminalForWatchdog(d) {
28
28
  return d === "complete" || d === "failed" || d === "restarting";
29
29
  }
@@ -156,6 +156,7 @@ class OtaInstallCoordinator {
156
156
  pingInterval = null;
157
157
  queryReplyTimeout = null;
158
158
  continueLockoutTimer = null;
159
+ restartRecoveryTimeout = null;
159
160
  legacyApkSettleTimer = null;
160
161
  mtkStallDetectTimer = null;
161
162
  mtkSimTickTimer = null;
@@ -306,7 +307,7 @@ class OtaInstallCoordinator {
306
307
  void this.sendOtaStartWithWatchdogs();
307
308
  }
308
309
  else {
309
- void BluetoothSdk.sendOtaQueryStatus().catch(() => { });
310
+ void BluetoothSdk.queryOtaStatus().catch(() => { });
310
311
  this.armQueryReplyFallback("retry");
311
312
  }
312
313
  }
@@ -349,16 +350,17 @@ class OtaInstallCoordinator {
349
350
  * stays in the screen): clear the selected update, and after an APK step
350
351
  * clear the stale build number so the next check re-reads version_info.
351
352
  */
352
- finish() {
353
+ async finish() {
353
354
  if (this.otaStartOwnership?.outcome !== "pending") {
354
355
  this.otaStartOwnership = null;
355
356
  }
356
357
  useGlassesStore.getState().setOtaUpdateAvailable(null);
357
358
  if (this.apkStepSeen) {
358
- BluetoothSdk.updateGlasses({ buildNumber: "" });
359
359
  useGlassesStore.getState().setGlassesInfo({ buildNumber: "" });
360
360
  }
361
- void this.teardownHotspotTransport();
361
+ // The post-install check needs internet again. Do not let callers leave the
362
+ // terminal screen while Android still owns the no-internet hotspot route.
363
+ await this.teardownHotspotTransport();
362
364
  }
363
365
  /**
364
366
  * Abandon an interrupted session (the super-mode skip): terminal cleanup
@@ -366,8 +368,8 @@ class OtaInstallCoordinator {
366
368
  * deriveDisplayState doesn't resurrect the stale install when the host
367
369
  * navigates away and back through /ota routes.
368
370
  */
369
- discard() {
370
- this.finish();
371
+ async discard() {
372
+ await this.finish();
371
373
  const store = useGlassesStore.getState();
372
374
  store.setOtaStatus(null);
373
375
  store.setOtaProgress(null);
@@ -403,6 +405,7 @@ class OtaInstallCoordinator {
403
405
  versionChangePhase: this.deriveVersionChangePhase(connected),
404
406
  hotspotPhase: this.hotspotPhase,
405
407
  hotspotArtifactPercent: this.hotspotArtifactPercent,
408
+ transport: this.selectedTransport,
406
409
  };
407
410
  }
408
411
  /**
@@ -848,12 +851,24 @@ class OtaInstallCoordinator {
848
851
  // (15s unified, 35s for legacy-shaped sessions — WP 8C-f).
849
852
  if (displayStateChanged && displayState === "restarting") {
850
853
  this.clearContinueLockoutTimer();
854
+ this.clearRestartRecoveryTimeout();
851
855
  const lockoutMs = legacySession ? LEGACY_BES_CONTINUE_LOCKOUT_MS : BES_CONTINUE_LOCKOUT_MS;
856
+ const restartTimeoutMs = legacySession ? LEGACY_BES_RESTART_TIMEOUT_MS : BES_RESTART_TIMEOUT_MS;
852
857
  this.setContinueButtonDisabled(true);
853
858
  this.continueLockoutTimer = setTimeout(() => {
854
859
  this.continueLockoutTimer = null;
855
860
  this.setContinueButtonDisabled(false);
856
861
  }, lockoutMs);
862
+ this.restartRecoveryTimeout = setTimeout(() => {
863
+ this.restartRecoveryTimeout = null;
864
+ if (this.computeDisplayStateNow() !== "restarting")
865
+ return;
866
+ console.log(`[OTA_PROGRESS] watchdog: glasses did not finish restarting in ${restartTimeoutMs}ms`);
867
+ this.setErrorMsg(OtaProgressMessages.restartTimeout);
868
+ }, restartTimeoutMs);
869
+ }
870
+ else if (displayStateChanged) {
871
+ this.clearRestartRecoveryTimeout();
857
872
  }
858
873
  // Legacy MTK install stall simulation (WP 8C-e): display-only. The simulation
859
874
  // timers only ever touch the projected snapshot percent — they never feed back
@@ -908,7 +923,7 @@ class OtaInstallCoordinator {
908
923
  if (this.otaStartOwnership?.outcome === "pending") {
909
924
  void this.sendOtaStartWithWatchdogs();
910
925
  }
911
- void BluetoothSdk.sendOtaQueryStatus();
926
+ void BluetoothSdk.queryOtaStatus().catch(() => { });
912
927
  this.armQueryReplyFallback("reconnect");
913
928
  return true;
914
929
  }
@@ -946,7 +961,7 @@ class OtaInstallCoordinator {
946
961
  if (noSessionYet) {
947
962
  if (!isIdleStatus && this.otaStartOwnership?.outcome === "acknowledged") {
948
963
  console.log("[OTA_PROGRESS] initial mount, acknowledged session has no cached status — reconciling");
949
- void BluetoothSdk.sendOtaQueryStatus().catch(() => { });
964
+ void BluetoothSdk.queryOtaStatus().catch(() => { });
950
965
  this.armQueryReplyFallback("initial-mount");
951
966
  return;
952
967
  }
@@ -961,7 +976,7 @@ class OtaInstallCoordinator {
961
976
  }
962
977
  else {
963
978
  console.log("[OTA_PROGRESS] initial mount, session exists, sending ota_query_status");
964
- void BluetoothSdk.sendOtaQueryStatus();
979
+ void BluetoothSdk.queryOtaStatus().catch(() => { });
965
980
  this.armQueryReplyFallback("initial-mount");
966
981
  }
967
982
  }
@@ -988,7 +1003,7 @@ class OtaInstallCoordinator {
988
1003
  this.clearProgressTimeout();
989
1004
  this.onFirstActivity();
990
1005
  this.onFirstNonZeroProgress();
991
- void BluetoothSdk.sendOtaQueryStatus();
1006
+ void BluetoothSdk.queryOtaStatus().catch(() => { });
992
1007
  useGlassesStore.getState().setMtkUpdatedThisSession(true);
993
1008
  };
994
1009
  // --- legacy (< 37) compatibility, ported from progress-legacy.tsx (WP 8C) ---
@@ -1148,7 +1163,7 @@ class OtaInstallCoordinator {
1148
1163
  const s = useGlassesStore.getState().otaStatus;
1149
1164
  if (s?.stepType === "apk" && s.phase === "install" && s.status === "in_progress") {
1150
1165
  this.apkInstallPollInFlight = true;
1151
- void BluetoothSdk.sendOtaQueryStatus()
1166
+ void BluetoothSdk.queryOtaStatus()
1152
1167
  .catch(() => { })
1153
1168
  .finally(() => {
1154
1169
  this.apkInstallPollInFlight = false;
@@ -1290,6 +1305,9 @@ class OtaInstallCoordinator {
1290
1305
  otaVersionUrl = this.hotspotManifestUrl;
1291
1306
  this.maybeArmStuckWatchdog();
1292
1307
  }
1308
+ if (!otaVersionUrl) {
1309
+ throw new Error("OTA is disabled because this build has no immutable manifest pin");
1310
+ }
1293
1311
  console.log(`[OTA_PROGRESS] sending ota_start with ${this.selectedTransport} manifest URL: ${otaVersionUrl}`);
1294
1312
  nativeStartAttempted = true;
1295
1313
  await BluetoothSdk.startOtaUpdate(otaVersionUrl);
@@ -1449,6 +1467,12 @@ class OtaInstallCoordinator {
1449
1467
  this.continueLockoutTimer = null;
1450
1468
  }
1451
1469
  }
1470
+ clearRestartRecoveryTimeout() {
1471
+ if (this.restartRecoveryTimeout) {
1472
+ clearTimeout(this.restartRecoveryTimeout);
1473
+ this.restartRecoveryTimeout = null;
1474
+ }
1475
+ }
1452
1476
  clearLegacyApkSettleTimer() {
1453
1477
  if (this.legacyApkSettleTimer) {
1454
1478
  clearTimeout(this.legacyApkSettleTimer);
@@ -1484,6 +1508,7 @@ class OtaInstallCoordinator {
1484
1508
  this.clearPingInterval();
1485
1509
  this.clearLegacyApkSettleTimer();
1486
1510
  this.clearMtkSimulationTimers();
1511
+ this.clearRestartRecoveryTimeout();
1487
1512
  }
1488
1513
  }
1489
1514
  /** Singleton — one install session machine per app process (matches the single progress screen). */