@mentra/engine 0.1.0-beta.0 → 0.1.0-dev.1

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 (355) hide show
  1. package/README.md +42 -1
  2. package/build/engine.d.ts +11 -3
  3. package/build/engine.d.ts.map +1 -1
  4. package/build/engine.js +7 -2
  5. package/build/engine.js.map +1 -1
  6. package/build/facades/dev.d.ts.map +1 -1
  7. package/build/facades/dev.js +9 -5
  8. package/build/facades/dev.js.map +1 -1
  9. package/build/facades/gallery.js +1 -1
  10. package/build/facades/gallery.js.map +1 -1
  11. package/build/facades/glasses.d.ts +1 -0
  12. package/build/facades/glasses.d.ts.map +1 -1
  13. package/build/facades/glasses.js +19 -4
  14. package/build/facades/glasses.js.map +1 -1
  15. package/build/facades/glassesSettings.d.ts.map +1 -1
  16. package/build/facades/glassesSettings.js +1 -0
  17. package/build/facades/glassesSettings.js.map +1 -1
  18. package/build/facades/miniapps.d.ts +4 -0
  19. package/build/facades/miniapps.d.ts.map +1 -1
  20. package/build/facades/miniapps.js +5 -0
  21. package/build/facades/miniapps.js.map +1 -1
  22. package/build/facades/ota.d.ts +11 -2
  23. package/build/facades/ota.d.ts.map +1 -1
  24. package/build/facades/ota.js +19 -4
  25. package/build/facades/ota.js.map +1 -1
  26. package/build/facades/pairing.d.ts +4 -0
  27. package/build/facades/pairing.d.ts.map +1 -1
  28. package/build/facades/pairing.js +10 -8
  29. package/build/facades/pairing.js.map +1 -1
  30. package/build/facades/phoneNotifications.d.ts +0 -4
  31. package/build/facades/phoneNotifications.d.ts.map +1 -1
  32. package/build/facades/phoneNotifications.js +4 -14
  33. package/build/facades/phoneNotifications.js.map +1 -1
  34. package/build/index.d.ts +6 -3
  35. package/build/index.d.ts.map +1 -1
  36. package/build/index.js +4 -2
  37. package/build/index.js.map +1 -1
  38. package/build/internal.d.ts +2 -2
  39. package/build/internal.d.ts.map +1 -1
  40. package/build/internal.js +1 -1
  41. package/build/internal.js.map +1 -1
  42. package/build/react/MentraLiveOtaFlow.d.ts +38 -0
  43. package/build/react/MentraLiveOtaFlow.d.ts.map +1 -0
  44. package/build/react/MentraLiveOtaFlow.js +528 -0
  45. package/build/react/MentraLiveOtaFlow.js.map +1 -0
  46. package/build/react/index.d.ts +2 -0
  47. package/build/react/index.d.ts.map +1 -0
  48. package/build/react/index.js +2 -0
  49. package/build/react/index.js.map +1 -0
  50. package/build/react/useEngineSnapshot.d.ts +2 -0
  51. package/build/react/useEngineSnapshot.d.ts.map +1 -0
  52. package/build/react/useEngineSnapshot.js +14 -0
  53. package/build/react/useEngineSnapshot.js.map +1 -0
  54. package/build/runtime/bootstrap.d.ts +24 -1
  55. package/build/runtime/bootstrap.d.ts.map +1 -1
  56. package/build/runtime/bootstrap.js +17 -0
  57. package/build/runtime/bootstrap.js.map +1 -1
  58. package/build/runtime/scanQrSeam.d.ts +7 -0
  59. package/build/runtime/scanQrSeam.d.ts.map +1 -0
  60. package/build/runtime/scanQrSeam.js +16 -0
  61. package/build/runtime/scanQrSeam.js.map +1 -0
  62. package/build/services/AppRegistry.d.ts +18 -8
  63. package/build/services/AppRegistry.d.ts.map +1 -1
  64. package/build/services/AppRegistry.js +44 -45
  65. package/build/services/AppRegistry.js.map +1 -1
  66. package/build/services/AudioCloudUplink.d.ts +9 -3
  67. package/build/services/AudioCloudUplink.d.ts.map +1 -1
  68. package/build/services/AudioCloudUplink.js +9 -3
  69. package/build/services/AudioCloudUplink.js.map +1 -1
  70. package/build/services/AudioPlaybackService.d.ts +9 -1
  71. package/build/services/AudioPlaybackService.d.ts.map +1 -1
  72. package/build/services/AudioPlaybackService.js +77 -32
  73. package/build/services/AudioPlaybackService.js.map +1 -1
  74. package/build/services/BlobStore.d.ts +2 -1
  75. package/build/services/BlobStore.d.ts.map +1 -1
  76. package/build/services/BlobStore.js +17 -9
  77. package/build/services/BlobStore.js.map +1 -1
  78. package/build/services/CloudAudioSubscriptionSync.d.ts.map +1 -1
  79. package/build/services/CloudAudioSubscriptionSync.js +13 -1
  80. package/build/services/CloudAudioSubscriptionSync.js.map +1 -1
  81. package/build/services/CloudClientService.d.ts +15 -0
  82. package/build/services/CloudClientService.d.ts.map +1 -1
  83. package/build/services/CloudClientService.js +75 -0
  84. package/build/services/CloudClientService.js.map +1 -1
  85. package/build/services/ForegroundLocationPermission.d.ts +13 -0
  86. package/build/services/ForegroundLocationPermission.d.ts.map +1 -0
  87. package/build/services/ForegroundLocationPermission.js +12 -0
  88. package/build/services/ForegroundLocationPermission.js.map +1 -0
  89. package/build/services/GlassesSettingsSync.d.ts.map +1 -1
  90. package/build/services/GlassesSettingsSync.js +9 -3
  91. package/build/services/GlassesSettingsSync.js.map +1 -1
  92. package/build/services/GlassesStatusProjection.d.ts +2 -1
  93. package/build/services/GlassesStatusProjection.d.ts.map +1 -1
  94. package/build/services/GlassesStatusProjection.js +15 -8
  95. package/build/services/GlassesStatusProjection.js.map +1 -1
  96. package/build/services/HotspotOtaTransport.d.ts +29 -0
  97. package/build/services/HotspotOtaTransport.d.ts.map +1 -0
  98. package/build/services/HotspotOtaTransport.js +146 -0
  99. package/build/services/HotspotOtaTransport.js.map +1 -0
  100. package/build/services/HotspotShutdown.d.ts +17 -0
  101. package/build/services/HotspotShutdown.d.ts.map +1 -0
  102. package/build/services/HotspotShutdown.js +29 -0
  103. package/build/services/HotspotShutdown.js.map +1 -0
  104. package/build/services/LocalDisplayManager.d.ts +15 -0
  105. package/build/services/LocalDisplayManager.d.ts.map +1 -1
  106. package/build/services/LocalDisplayManager.js +106 -20
  107. package/build/services/LocalDisplayManager.js.map +1 -1
  108. package/build/services/LocalMiniappRuntime.d.ts +67 -1
  109. package/build/services/LocalMiniappRuntime.d.ts.map +1 -1
  110. package/build/services/LocalMiniappRuntime.js +486 -126
  111. package/build/services/LocalMiniappRuntime.js.map +1 -1
  112. package/build/services/LocalMiniappStorage.d.ts +32 -0
  113. package/build/services/LocalMiniappStorage.d.ts.map +1 -0
  114. package/build/services/LocalMiniappStorage.js +66 -0
  115. package/build/services/LocalMiniappStorage.js.map +1 -0
  116. package/build/services/LocalMiniappUserIdentity.d.ts +20 -0
  117. package/build/services/LocalMiniappUserIdentity.d.ts.map +1 -0
  118. package/build/services/LocalMiniappUserIdentity.js +43 -0
  119. package/build/services/LocalMiniappUserIdentity.js.map +1 -0
  120. package/build/services/MicStateCoordinator.d.ts +42 -1
  121. package/build/services/MicStateCoordinator.d.ts.map +1 -1
  122. package/build/services/MicStateCoordinator.js +141 -3
  123. package/build/services/MicStateCoordinator.js.map +1 -1
  124. package/build/services/MiniappLauncher.d.ts.map +1 -1
  125. package/build/services/MiniappLauncher.js +23 -3
  126. package/build/services/MiniappLauncher.js.map +1 -1
  127. package/build/services/MiniappLiveness.d.ts +12 -0
  128. package/build/services/MiniappLiveness.d.ts.map +1 -0
  129. package/build/services/MiniappLiveness.js +16 -0
  130. package/build/services/MiniappLiveness.js.map +1 -0
  131. package/build/services/OtaArtifactDownloader.d.ts +65 -0
  132. package/build/services/OtaArtifactDownloader.d.ts.map +1 -0
  133. package/build/services/OtaArtifactDownloader.js +226 -0
  134. package/build/services/OtaArtifactDownloader.js.map +1 -0
  135. package/build/services/OtaAutoChain.d.ts +34 -0
  136. package/build/services/OtaAutoChain.d.ts.map +1 -0
  137. package/build/services/OtaAutoChain.js +83 -0
  138. package/build/services/OtaAutoChain.js.map +1 -0
  139. package/build/services/OtaErrorMapping.d.ts +18 -0
  140. package/build/services/OtaErrorMapping.d.ts.map +1 -0
  141. package/build/services/OtaErrorMapping.js +63 -0
  142. package/build/services/OtaErrorMapping.js.map +1 -0
  143. package/build/services/OtaInstallCoordinator.d.ts +94 -14
  144. package/build/services/OtaInstallCoordinator.d.ts.map +1 -1
  145. package/build/services/OtaInstallCoordinator.js +574 -130
  146. package/build/services/OtaInstallCoordinator.js.map +1 -1
  147. package/build/services/OtaService.d.ts.map +1 -1
  148. package/build/services/OtaService.js +8 -1
  149. package/build/services/OtaService.js.map +1 -1
  150. package/build/services/OtaUpdateCheckService.d.ts +38 -3
  151. package/build/services/OtaUpdateCheckService.d.ts.map +1 -1
  152. package/build/services/OtaUpdateCheckService.js +142 -22
  153. package/build/services/OtaUpdateCheckService.js.map +1 -1
  154. package/build/services/PhoneCalendarService.d.ts.map +1 -1
  155. package/build/services/PhoneCalendarService.js +22 -1
  156. package/build/services/PhoneCalendarService.js.map +1 -1
  157. package/build/services/PhoneCameraFovCoordinator.d.ts +2 -0
  158. package/build/services/PhoneCameraFovCoordinator.d.ts.map +1 -1
  159. package/build/services/PhoneCameraFovCoordinator.js +14 -0
  160. package/build/services/PhoneCameraFovCoordinator.js.map +1 -1
  161. package/build/services/PhoneNotificationsSync.d.ts.map +1 -1
  162. package/build/services/PhoneNotificationsSync.js +12 -10
  163. package/build/services/PhoneNotificationsSync.js.map +1 -1
  164. package/build/services/PhonePhotoCoordinator.d.ts +10 -3
  165. package/build/services/PhonePhotoCoordinator.d.ts.map +1 -1
  166. package/build/services/PhonePhotoCoordinator.js +21 -3
  167. package/build/services/PhonePhotoCoordinator.js.map +1 -1
  168. package/build/services/PhoneStreamCoordinator.d.ts +8 -1
  169. package/build/services/PhoneStreamCoordinator.d.ts.map +1 -1
  170. package/build/services/PhoneStreamCoordinator.js +125 -13
  171. package/build/services/PhoneStreamCoordinator.js.map +1 -1
  172. package/build/services/PhoneVideoCoordinator.d.ts +2 -0
  173. package/build/services/PhoneVideoCoordinator.d.ts.map +1 -1
  174. package/build/services/PhoneVideoCoordinator.js +10 -0
  175. package/build/services/PhoneVideoCoordinator.js.map +1 -1
  176. package/build/services/SceneRenderer.d.ts.map +1 -1
  177. package/build/services/SceneRenderer.js +15 -0
  178. package/build/services/SceneRenderer.js.map +1 -1
  179. package/build/services/SupportProfileSync.d.ts +22 -0
  180. package/build/services/SupportProfileSync.d.ts.map +1 -0
  181. package/build/services/SupportProfileSync.js +213 -0
  182. package/build/services/SupportProfileSync.js.map +1 -0
  183. package/build/services/TtsTextSanitizer.d.ts +5 -0
  184. package/build/services/TtsTextSanitizer.d.ts.map +1 -0
  185. package/build/services/TtsTextSanitizer.js +61 -0
  186. package/build/services/TtsTextSanitizer.js.map +1 -0
  187. package/build/services/WifiAdbRequest.d.ts +17 -0
  188. package/build/services/WifiAdbRequest.d.ts.map +1 -0
  189. package/build/services/WifiAdbRequest.js +35 -0
  190. package/build/services/WifiAdbRequest.js.map +1 -0
  191. package/build/services/asg/asgCameraApi.d.ts +3 -0
  192. package/build/services/asg/asgCameraApi.d.ts.map +1 -1
  193. package/build/services/asg/asgCameraApi.js +72 -2
  194. package/build/services/asg/asgCameraApi.js.map +1 -1
  195. package/build/services/asg/gallerySyncService.d.ts.map +1 -1
  196. package/build/services/asg/gallerySyncService.js +26 -14
  197. package/build/services/asg/gallerySyncService.js.map +1 -1
  198. package/build/services/asg/localNetworkTransport.d.ts +2 -2
  199. package/build/services/asg/localNetworkTransport.d.ts.map +1 -1
  200. package/build/services/asg/localNetworkTransport.js +6 -6
  201. package/build/services/asg/localNetworkTransport.js.map +1 -1
  202. package/build/services/audioPlaybackAssets.d.ts +8 -0
  203. package/build/services/audioPlaybackAssets.d.ts.map +1 -0
  204. package/build/services/audioPlaybackAssets.js +7 -0
  205. package/build/services/audioPlaybackAssets.js.map +1 -0
  206. package/build/services/glassesClockSync.js +2 -2
  207. package/build/services/glassesClockSync.js.map +1 -1
  208. package/build/services/manifestActions.d.ts +7 -0
  209. package/build/services/manifestActions.d.ts.map +1 -0
  210. package/build/services/manifestActions.js +25 -0
  211. package/build/services/manifestActions.js.map +1 -0
  212. package/build/services/otaDisplayState.d.ts +22 -11
  213. package/build/services/otaDisplayState.d.ts.map +1 -1
  214. package/build/services/otaDisplayState.js +36 -14
  215. package/build/services/otaDisplayState.js.map +1 -1
  216. package/build/services/otaInstallPolicy.d.ts +15 -3
  217. package/build/services/otaInstallPolicy.d.ts.map +1 -1
  218. package/build/services/otaInstallPolicy.js +24 -3
  219. package/build/services/otaInstallPolicy.js.map +1 -1
  220. package/build/services/otaManifestUrl.d.ts +2 -0
  221. package/build/services/otaManifestUrl.d.ts.map +1 -0
  222. package/build/services/{asgOtaVersionUrl.js → otaManifestUrl.js} +15 -5
  223. package/build/services/otaManifestUrl.js.map +1 -0
  224. package/build/services/slimStreamStatus.d.ts +11 -0
  225. package/build/services/slimStreamStatus.d.ts.map +1 -1
  226. package/build/services/slimStreamStatus.js +14 -4
  227. package/build/services/slimStreamStatus.js.map +1 -1
  228. package/build/stores/apps.d.ts.map +1 -1
  229. package/build/stores/apps.js +11 -0
  230. package/build/stores/apps.js.map +1 -1
  231. package/build/stores/bluetoothSettingKeys.d.ts.map +1 -1
  232. package/build/stores/bluetoothSettingKeys.js +2 -0
  233. package/build/stores/bluetoothSettingKeys.js.map +1 -1
  234. package/build/stores/gallerySync.d.ts +2 -0
  235. package/build/stores/gallerySync.d.ts.map +1 -1
  236. package/build/stores/gallerySync.js +2 -0
  237. package/build/stores/gallerySync.js.map +1 -1
  238. package/build/stores/glasses.d.ts.map +1 -1
  239. package/build/stores/glasses.js +3 -0
  240. package/build/stores/glasses.js.map +1 -1
  241. package/build/stores/settings.d.ts +17 -0
  242. package/build/stores/settings.d.ts.map +1 -1
  243. package/build/stores/settings.js +152 -19
  244. package/build/stores/settings.js.map +1 -1
  245. package/build/types/applet.d.ts +2 -0
  246. package/build/types/applet.d.ts.map +1 -1
  247. package/build/types/applet.js.map +1 -1
  248. package/build/types/enums.d.ts +1 -0
  249. package/build/types/enums.d.ts.map +1 -1
  250. package/build/types/enums.js +1 -0
  251. package/build/types/enums.js.map +1 -1
  252. package/build/types/hardware.d.ts +1 -0
  253. package/build/types/hardware.d.ts.map +1 -1
  254. package/build/types/hardware.js +14 -0
  255. package/build/types/hardware.js.map +1 -1
  256. package/build/utils/configuredDevHost.d.ts +6 -0
  257. package/build/utils/configuredDevHost.d.ts.map +1 -0
  258. package/build/utils/configuredDevHost.js +19 -0
  259. package/build/utils/configuredDevHost.js.map +1 -0
  260. package/build/utils/devMiniappLaunch.d.ts +19 -8
  261. package/build/utils/devMiniappLaunch.d.ts.map +1 -1
  262. package/build/utils/devMiniappLaunch.js +144 -21
  263. package/build/utils/devMiniappLaunch.js.map +1 -1
  264. package/build/utils/diagnosticContext.d.ts.map +1 -1
  265. package/build/utils/diagnosticContext.js +15 -17
  266. package/build/utils/diagnosticContext.js.map +1 -1
  267. package/build/utils/hardware/hardware.d.ts.map +1 -1
  268. package/build/utils/hardware/hardware.js +7 -3
  269. package/build/utils/hardware/hardware.js.map +1 -1
  270. package/build/utils/miniappDiagnostics.d.ts +64 -0
  271. package/build/utils/miniappDiagnostics.d.ts.map +1 -0
  272. package/build/utils/miniappDiagnostics.js +173 -0
  273. package/build/utils/miniappDiagnostics.js.map +1 -0
  274. package/build/utils/timers/timers.d.ts.map +1 -1
  275. package/build/utils/timers/timers.js +55 -18
  276. package/build/utils/timers/timers.js.map +1 -1
  277. package/package.json +27 -18
  278. package/src/assets/silence.wav +0 -0
  279. package/src/engine.ts +7 -2
  280. package/src/facades/dev.ts +9 -5
  281. package/src/facades/gallery.ts +1 -1
  282. package/src/facades/glasses.ts +17 -4
  283. package/src/facades/glassesSettings.ts +5 -0
  284. package/src/facades/miniapps.ts +7 -0
  285. package/src/facades/ota.ts +19 -4
  286. package/src/facades/pairing.ts +11 -7
  287. package/src/facades/phoneNotifications.ts +4 -13
  288. package/src/index.ts +26 -2
  289. package/src/internal.ts +2 -1
  290. package/src/react/MentraLiveOtaFlow.tsx +856 -0
  291. package/src/react/index.ts +7 -0
  292. package/src/react/useEngineSnapshot.ts +16 -0
  293. package/src/runtime/bootstrap.ts +33 -1
  294. package/src/runtime/scanQrSeam.ts +20 -0
  295. package/src/services/AppRegistry.ts +72 -48
  296. package/src/services/AudioCloudUplink.ts +9 -3
  297. package/src/services/AudioPlaybackService.ts +94 -34
  298. package/src/services/BlobStore.ts +22 -9
  299. package/src/services/CloudAudioSubscriptionSync.ts +13 -1
  300. package/src/services/CloudClientService.ts +74 -0
  301. package/src/services/ForegroundLocationPermission.ts +24 -0
  302. package/src/services/GlassesSettingsSync.ts +9 -3
  303. package/src/services/GlassesStatusProjection.ts +16 -8
  304. package/src/services/HotspotOtaTransport.ts +184 -0
  305. package/src/services/HotspotShutdown.ts +41 -0
  306. package/src/services/LocalDisplayManager.ts +112 -21
  307. package/src/services/LocalMiniappRuntime.ts +576 -130
  308. package/src/services/LocalMiniappStorage.ts +82 -0
  309. package/src/services/LocalMiniappUserIdentity.ts +46 -0
  310. package/src/services/MicStateCoordinator.ts +169 -4
  311. package/src/services/MiniappLauncher.ts +30 -3
  312. package/src/services/MiniappLiveness.ts +24 -0
  313. package/src/services/OtaArtifactDownloader.ts +312 -0
  314. package/src/services/OtaAutoChain.ts +106 -0
  315. package/src/services/OtaErrorMapping.ts +80 -0
  316. package/src/services/OtaInstallCoordinator.ts +645 -143
  317. package/src/services/OtaService.ts +11 -5
  318. package/src/services/OtaUpdateCheckService.ts +180 -20
  319. package/src/services/PhoneCalendarService.ts +27 -4
  320. package/src/services/PhoneCameraFovCoordinator.ts +15 -0
  321. package/src/services/PhoneNotificationsSync.ts +12 -10
  322. package/src/services/PhonePhotoCoordinator.ts +33 -7
  323. package/src/services/PhoneStreamCoordinator.ts +139 -25
  324. package/src/services/PhoneVideoCoordinator.ts +11 -0
  325. package/src/services/SceneRenderer.ts +16 -0
  326. package/src/services/SupportProfileSync.ts +218 -0
  327. package/src/services/TtsTextSanitizer.ts +66 -0
  328. package/src/services/WifiAdbRequest.ts +53 -0
  329. package/src/services/asg/asgCameraApi.ts +99 -8
  330. package/src/services/asg/gallerySyncService.ts +28 -19
  331. package/src/services/asg/localNetworkTransport.ts +7 -11
  332. package/src/services/audioPlaybackAssets.ts +8 -0
  333. package/src/services/glassesClockSync.ts +2 -2
  334. package/src/services/manifestActions.ts +30 -0
  335. package/src/services/otaDisplayState.ts +57 -16
  336. package/src/services/otaInstallPolicy.ts +29 -3
  337. package/src/services/{asgOtaVersionUrl.ts → otaManifestUrl.ts} +16 -4
  338. package/src/services/slimStreamStatus.ts +16 -5
  339. package/src/stores/apps.ts +12 -0
  340. package/src/stores/bluetoothSettingKeys.ts +2 -0
  341. package/src/stores/gallerySync.ts +4 -0
  342. package/src/stores/glasses.ts +3 -0
  343. package/src/stores/settings.ts +174 -21
  344. package/src/types/applet.ts +2 -0
  345. package/src/types/enums.ts +2 -1
  346. package/src/types/hardware.ts +17 -0
  347. package/src/utils/configuredDevHost.ts +17 -0
  348. package/src/utils/devMiniappLaunch.ts +151 -23
  349. package/src/utils/diagnosticContext.ts +17 -17
  350. package/src/utils/hardware/hardware.ts +7 -9
  351. package/src/utils/miniappDiagnostics.ts +226 -0
  352. package/src/utils/timers/timers.ts +57 -21
  353. package/build/services/asgOtaVersionUrl.d.ts +0 -2
  354. package/build/services/asgOtaVersionUrl.d.ts.map +0 -1
  355. package/build/services/asgOtaVersionUrl.js.map +0 -1
@@ -9,6 +9,7 @@
9
9
  * `<WebView>` wired to them. This facade is the lifecycle half.
10
10
  */
11
11
  import {useAppStatusStore} from "../stores/apps"
12
+ import localMiniappRuntime from "../services/LocalMiniappRuntime"
12
13
  import type {ClientApp} from "../types"
13
14
 
14
15
  type AppsState = ReturnType<typeof useAppStatusStore.getState>
@@ -29,6 +30,12 @@ export const miniapps = {
29
30
  })
30
31
  },
31
32
 
33
+ /** Miniapps actively subscribed to Mentra Live hardware-button events. */
34
+ buttonPressSubscribers: (): string[] => localMiniappRuntime.getButtonPressSubscribers(),
35
+ /** Observe the active Mentra Live hardware-button subscriber set. */
36
+ onButtonPressSubscribersChanged: (cb: (packageNames: string[]) => void): (() => void) =>
37
+ localMiniappRuntime.onButtonPressSubscribersChanged(cb),
38
+
32
39
  /** Re-fetch the installed-app list from the backend. */
33
40
  refresh: () => useAppStatusStore.getState().refresh(),
34
41
  /** Start (foreground) a miniapp. */
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * ota facade — `engine.ota`: the OEM-facing OTA read/observe surface. Engine's
3
3
  * OtaService projects the glasses' OTA BLE events into the engine store; this facade
4
- * exposes the snapshot + change subscriptions the host renders its update prompt and
5
- * progress UI from. No host-injected UI the host owns all alerts/navigation/i18n.
4
+ * exposes the snapshot + change subscriptions behind the shared OTA flow exported by
5
+ * `@mentra/engine/ota`. Hosts retain only their surrounding navigation and theme/i18n adapters.
6
6
  *
7
7
  * Availability checks live in engine. Install orchestration lives in engine too:
8
8
  * `installSession` fronts the OtaInstallCoordinator state machine (WP 8B) — the host
@@ -11,8 +11,10 @@
11
11
  import BluetoothSdk from "@mentra/bluetooth-sdk/internal"
12
12
  import type {OtaProgress, OtaProgressStatus, OtaStatus, OtaUpdateInfo} from "@mentra/bluetooth-sdk/internal"
13
13
  import {isGlassesConnected, useGlassesStore} from "../stores/glasses"
14
- import {getAsgOtaVersionUrl} from "../services/asgOtaVersionUrl"
14
+ import {resolveOtaManifestUrl} from "../services/otaManifestUrl"
15
15
  import {otaInstallCoordinator, type OtaInstallSnapshot} from "../services/OtaInstallCoordinator"
16
+ import {startGlassesStatusProjection} from "../services/GlassesStatusProjection"
17
+ import {startOtaService} from "../services/OtaService"
16
18
  import {
17
19
  checkCurrentGlassesForUpdate,
18
20
  type OtaCheckCurrentGlassesOptions,
@@ -26,9 +28,10 @@ function projectSnapshot() {
26
28
  buildNumber: s.buildNumber || null,
27
29
  mtkFirmwareVersion: s.mtkFirmwareVersion || null,
28
30
  besFirmwareVersion: s.besFirmwareVersion || null,
31
+ hotspotOtaVersion: s.hotspotOtaVersion ?? 0,
29
32
  wifiConnected: s.wifi.state === "connected",
30
33
  wifiStatusKnown: s.wifiStatusKnown,
31
- manifestUrl: getAsgOtaVersionUrl(s.otaVersionUrl, s.buildNumber),
34
+ manifestUrl: resolveOtaManifestUrl(s.otaVersionUrl, s.buildNumber),
32
35
  updateAvailable: s.otaUpdateAvailable,
33
36
  status: s.otaStatus,
34
37
  legacyProgress: s.otaProgress,
@@ -50,6 +53,16 @@ export type {
50
53
 
51
54
  export const ota = {
52
55
  // --- actions ---
56
+ /**
57
+ * Start the device-status and OTA projections without starting the authenticated
58
+ * cloud/miniapp runtime. This is the explicit entry point for Bluetooth-only hosts.
59
+ * Idempotent and safe when the full engine runtime is already running.
60
+ */
61
+ initialize: async () => {
62
+ const hydrated = startGlassesStatusProjection()
63
+ startOtaService()
64
+ await hydrated
65
+ },
53
66
  /**
54
67
  * Start the firmware install with the resolved OTA manifest URL. Progress lands on
55
68
  * `status()`/`onStatus()`. (The host resolves the manifest URL — dev-override/env/prod
@@ -115,6 +128,8 @@ export const ota = {
115
128
  * the snapshot; every watchdog/retry/reconnect rule lives in the coordinator.
116
129
  */
117
130
  installSession: {
131
+ /** Select Wi-Fi or capability-gated hotspot transport for this checked manifest. */
132
+ prepare: (result: OtaCheckCurrentGlassesResult) => otaInstallCoordinator.prepare(result),
118
133
  /** Bind the machine to the mounted progress screen. Idempotent per attach/detach cycle. */
119
134
  attach: () => otaInstallCoordinator.attach(),
120
135
  /** Unbind on unmount: clears all timers/listeners and resets session state. */
@@ -291,25 +291,29 @@ export const pairing = {
291
291
  await BluetoothSdk.stopScan()
292
292
  return
293
293
  }
294
- await BluetoothSdk.disconnect()
295
294
  if (projectPairingIdentity().kind === "paired") {
296
295
  // The persisted settings describe a COMPLETE pairing: restore it to
297
296
  // native (the attempt's connect-by-name overwrote the native
298
297
  // device_name; and if native somehow lost its default entirely, this
299
298
  // repairs the divergence instead of forgetting a real pairing).
300
299
  console.log("PairingIdentity: abandonAttempt — preserving pairing; attempt cancelled, native identity re-seeded")
300
+ await BluetoothSdk.disconnect()
301
301
  await pushAllBluetoothSettings()
302
- } else if (nativeHasDefault) {
302
+ return
303
+ }
304
+ if (nativeHasDefault) {
303
305
  // Mid-relay: native promoted and its echoes are still landing — the
304
306
  // incomplete JS snapshot must not be pushed over the fresher native
305
307
  // identity (the on-connect replay's race). Native holds the truth.
306
308
  console.log("PairingIdentity: abandonAttempt — preserving pairing; JS identity mid-relay, native kept as-is")
307
- } else {
308
- // Forgetting requires CONSENSUS: no native default AND no complete
309
- // persisted pairing — a genuinely partial attempt.
310
- console.log("PairingIdentity: abandonAttempt — no pairing on either layer; forgetting the partial attempt")
311
- await BluetoothSdk.forget()
309
+ await BluetoothSdk.disconnect()
310
+ return
312
311
  }
312
+ // Partial attempt: forget owns teardown. Do NOT disconnect() first — that
313
+ // nulls the MentraLive SGC and used to skip Classic removeBond, leaving
314
+ // IBRT ACL up so glasses never re-advertise for the next scan.
315
+ console.log("PairingIdentity: abandonAttempt — no pairing on either layer; forgetting the partial attempt")
316
+ await BluetoothSdk.forget()
313
317
  },
314
318
 
315
319
  /** Subscribe to pairing failures; returns an unsubscribe. */
@@ -3,25 +3,16 @@
3
3
  * notifications to the glasses, with a per-app blocklist. Android-only (the
4
4
  * NotificationListenerService); the getters return sensible defaults on iOS.
5
5
  *
6
- * Enabled-state + blocklist are engine settings (auto-synced to the native
7
- * listener); the installed-apps list + the listener permission are CrustModule.
6
+ * The per-app blocklist is an engine setting (auto-synced to the native
7
+ * listener); the installed-apps list + listener permission are CrustModule.
8
+ * Capture itself is controlled only by Android notification access and the
9
+ * hidden operational kill switch.
8
10
  */
9
11
  import {Platform} from "react-native"
10
12
  import CrustModule from "@mentra/crust"
11
13
  import {useSettingsStore, SETTINGS} from "../stores/settings"
12
14
 
13
15
  export const phoneNotifications = {
14
- /** Is phone-notification forwarding enabled? (false on iOS) */
15
- enabled: (): boolean => {
16
- if (Platform.OS !== "android") return false
17
- return useSettingsStore.getState().getSetting(SETTINGS.notifications_enabled.key) ?? true
18
- },
19
- /** Enable/disable phone-notification forwarding. (no-op on iOS) */
20
- setEnabled: (enabled: boolean) => {
21
- if (Platform.OS !== "android") return
22
- return useSettingsStore.getState().setSetting(SETTINGS.notifications_enabled.key, enabled)
23
- },
24
-
25
16
  /** The phone's installed apps (package, name, icon). (empty on iOS) */
26
17
  installedApps: (): Promise<Array<{packageName: string; appName: string; icon: string | null}>> => {
27
18
  if (Platform.OS !== "android") return Promise.resolve([])
package/src/index.ts CHANGED
@@ -32,6 +32,8 @@ export type {
32
32
  IslandConfigValues,
33
33
  IslandAnalytics,
34
34
  IslandUiSeams,
35
+ ScanQrOptions,
36
+ ScanQrResult,
35
37
  SubjectTokenType,
36
38
  } from "./runtime/bootstrap"
37
39
 
@@ -91,7 +93,6 @@ export {
91
93
  DOWNLOAD_STUCK_TIMEOUT_MS,
92
94
  MTK_INSTALL_TIMEOUT_MS,
93
95
  GLOBAL_OTA_TIMEOUT_MS,
94
- POST_APK_OTA_START_DELAY_MS,
95
96
  PING_INTERVAL_MS,
96
97
  QUERY_REPLY_TIMEOUT_MS,
97
98
  OtaProgressMessages,
@@ -106,6 +107,24 @@ export type {
106
107
  OtaSnapshot,
107
108
  OtaInstallSnapshot,
108
109
  } from "./facades/ota"
110
+ export {
111
+ beginOtaAutoChain,
112
+ clearOtaAutoChainReconnectWait,
113
+ isOtaAutoChainActive,
114
+ otaAutoChainFingerprint,
115
+ otaAutoChainReconnectWaitRemaining,
116
+ stopOtaAutoChain,
117
+ tryAdvanceOtaAutoChain,
118
+ MAX_OTA_AUTO_CHAIN_PASSES,
119
+ OTA_AUTO_CHAIN_RECONNECT_TIMEOUT_MS,
120
+ } from "./services/OtaAutoChain"
121
+ export type {OtaAutoChainAdvanceResult} from "./services/OtaAutoChain"
122
+ export {
123
+ BES_INSTALL_RESTART_MESSAGE,
124
+ getOtaErrorMessage,
125
+ shouldRequireGlassesRebootForBesFailure,
126
+ shouldShowChangeWifiForOtaDownloadFailure,
127
+ } from "./services/OtaErrorMapping"
109
128
 
110
129
  // Gallery read models: engine.gallery.onNotice payload types, the media
111
130
  // permission helper + display-name derivation host gallery UI uses, and the
@@ -153,7 +172,12 @@ export {
153
172
  } from "./stores/apps"
154
173
 
155
174
  // Pure dev-miniapp launch-route decision (registration itself is internal).
156
- export {decideDevLaunchRoute, type DevLaunchResult, type DevManifest} from "./utils/devMiniappLaunch"
175
+ export {
176
+ decideDevLaunchRoute,
177
+ type DecideDevLaunchOptions,
178
+ type DevLaunchResult,
179
+ type DevManifest,
180
+ } from "./utils/devMiniappLaunch"
157
181
  export {HardwareCompatibility, type CompatibilityResult} from "./utils/hardware"
158
182
  export {BgTimer, throttle, debounce} from "./utils/timers"
159
183
 
package/src/internal.ts CHANGED
@@ -30,6 +30,7 @@ export {
30
30
  getDevAppAttestation,
31
31
  DEV_APP_PACKAGE_NAME,
32
32
  type DevAppRecord,
33
+ type MiniappReleaseIdentity,
33
34
  } from "./services/AppRegistry"
34
35
  export {default as displayProcessor} from "./services/DisplayProcessor"
35
36
  export {default as localDisplayManager, type DisplayPayload} from "./services/LocalDisplayManager"
@@ -93,7 +94,7 @@ export {phoneLocationService, stopPhoneLocation} from "./services/PhoneLocationS
93
94
  // Clock-skew fix commands (BLE writes) used by OTA + gallery sync.
94
95
  export {fixGlassesClockIfSkewed, maybeFixGlassesClockFromVersionInfo} from "./services/glassesClockSync"
95
96
  // OTA manifest-URL resolution (dev-override/legacy-build/env/prod).
96
- export {getAsgOtaVersionUrl} from "./services/asgOtaVersionUrl"
97
+ export {resolveOtaManifestUrl} from "./services/otaManifestUrl"
97
98
  // Flat OTA check helpers (network + BLE state). Host usage is a tracked
98
99
  // burn-down surface (§F); the sanctioned path is engine.ota.checkForUpdates().
99
100
  export {