@mentra/engine 0.1.0-dev.0

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 (787) hide show
  1. package/README.md +79 -0
  2. package/build/devtools.d.ts +11 -0
  3. package/build/devtools.d.ts.map +1 -0
  4. package/build/devtools.js +13 -0
  5. package/build/devtools.js.map +1 -0
  6. package/build/engine.d.ts +261 -0
  7. package/build/engine.d.ts.map +1 -0
  8. package/build/engine.js +170 -0
  9. package/build/engine.js.map +1 -0
  10. package/build/facades/dev.d.ts +57 -0
  11. package/build/facades/dev.d.ts.map +1 -0
  12. package/build/facades/dev.js +187 -0
  13. package/build/facades/dev.js.map +1 -0
  14. package/build/facades/display.d.ts +21 -0
  15. package/build/facades/display.d.ts.map +1 -0
  16. package/build/facades/display.js +17 -0
  17. package/build/facades/display.js.map +1 -0
  18. package/build/facades/displayMirror.d.ts +15 -0
  19. package/build/facades/displayMirror.d.ts.map +1 -0
  20. package/build/facades/displayMirror.js +29 -0
  21. package/build/facades/displayMirror.js.map +1 -0
  22. package/build/facades/gallery.d.ts +62 -0
  23. package/build/facades/gallery.d.ts.map +1 -0
  24. package/build/facades/gallery.js +61 -0
  25. package/build/facades/gallery.js.map +1 -0
  26. package/build/facades/glasses.d.ts +141 -0
  27. package/build/facades/glasses.d.ts.map +1 -0
  28. package/build/facades/glasses.js +199 -0
  29. package/build/facades/glasses.js.map +1 -0
  30. package/build/facades/glassesSettings.d.ts +13 -0
  31. package/build/facades/glassesSettings.d.ts.map +1 -0
  32. package/build/facades/glassesSettings.js +54 -0
  33. package/build/facades/glassesSettings.js.map +1 -0
  34. package/build/facades/glassesWifi.d.ts +25 -0
  35. package/build/facades/glassesWifi.d.ts.map +1 -0
  36. package/build/facades/glassesWifi.js +57 -0
  37. package/build/facades/glassesWifi.js.map +1 -0
  38. package/build/facades/miniapps.d.ts +43 -0
  39. package/build/facades/miniapps.d.ts.map +1 -0
  40. package/build/facades/miniapps.js +49 -0
  41. package/build/facades/miniapps.js.map +1 -0
  42. package/build/facades/notifications.d.ts +13 -0
  43. package/build/facades/notifications.d.ts.map +1 -0
  44. package/build/facades/notifications.js +12 -0
  45. package/build/facades/notifications.js.map +1 -0
  46. package/build/facades/ota.d.ts +103 -0
  47. package/build/facades/ota.d.ts.map +1 -0
  48. package/build/facades/ota.js +156 -0
  49. package/build/facades/ota.js.map +1 -0
  50. package/build/facades/pairing.d.ts +114 -0
  51. package/build/facades/pairing.d.ts.map +1 -0
  52. package/build/facades/pairing.js +275 -0
  53. package/build/facades/pairing.js.map +1 -0
  54. package/build/facades/permissions.d.ts +23 -0
  55. package/build/facades/permissions.d.ts.map +1 -0
  56. package/build/facades/permissions.js +145 -0
  57. package/build/facades/permissions.js.map +1 -0
  58. package/build/facades/phoneNotifications.d.ts +21 -0
  59. package/build/facades/phoneNotifications.d.ts.map +1 -0
  60. package/build/facades/phoneNotifications.js +51 -0
  61. package/build/facades/phoneNotifications.js.map +1 -0
  62. package/build/facades/reports.d.ts +36 -0
  63. package/build/facades/reports.d.ts.map +1 -0
  64. package/build/facades/reports.js +134 -0
  65. package/build/facades/reports.js.map +1 -0
  66. package/build/facades/session.d.ts +21 -0
  67. package/build/facades/session.d.ts.map +1 -0
  68. package/build/facades/session.js +52 -0
  69. package/build/facades/session.js.map +1 -0
  70. package/build/facades/settings.d.ts +37 -0
  71. package/build/facades/settings.d.ts.map +1 -0
  72. package/build/facades/settings.js +55 -0
  73. package/build/facades/settings.js.map +1 -0
  74. package/build/facades/speech.d.ts +30 -0
  75. package/build/facades/speech.d.ts.map +1 -0
  76. package/build/facades/speech.js +37 -0
  77. package/build/facades/speech.js.map +1 -0
  78. package/build/index.d.ts +43 -0
  79. package/build/index.d.ts.map +1 -0
  80. package/build/index.js +45 -0
  81. package/build/index.js.map +1 -0
  82. package/build/internal.d.ts +66 -0
  83. package/build/internal.d.ts.map +1 -0
  84. package/build/internal.js +89 -0
  85. package/build/internal.js.map +1 -0
  86. package/build/runtime/bootstrap.d.ts +83 -0
  87. package/build/runtime/bootstrap.d.ts.map +1 -0
  88. package/build/runtime/bootstrap.js +56 -0
  89. package/build/runtime/bootstrap.js.map +1 -0
  90. package/build/runtime/config.d.ts +146 -0
  91. package/build/runtime/config.d.ts.map +1 -0
  92. package/build/runtime/config.js +18 -0
  93. package/build/runtime/config.js.map +1 -0
  94. package/build/runtime/streamConfig.d.ts +4 -0
  95. package/build/runtime/streamConfig.d.ts.map +1 -0
  96. package/build/runtime/streamConfig.js +38 -0
  97. package/build/runtime/streamConfig.js.map +1 -0
  98. package/build/services/AppRegistry.d.ts +303 -0
  99. package/build/services/AppRegistry.d.ts.map +1 -0
  100. package/build/services/AppRegistry.js +1029 -0
  101. package/build/services/AppRegistry.js.map +1 -0
  102. package/build/services/AudioCloudUplink.d.ts +3 -0
  103. package/build/services/AudioCloudUplink.d.ts.map +1 -0
  104. package/build/services/AudioCloudUplink.js +33 -0
  105. package/build/services/AudioCloudUplink.js.map +1 -0
  106. package/build/services/AudioPlaybackService.d.ts +144 -0
  107. package/build/services/AudioPlaybackService.d.ts.map +1 -0
  108. package/build/services/AudioPlaybackService.js +533 -0
  109. package/build/services/AudioPlaybackService.js.map +1 -0
  110. package/build/services/AutomaticReportResult.d.ts +20 -0
  111. package/build/services/AutomaticReportResult.d.ts.map +1 -0
  112. package/build/services/AutomaticReportResult.js +29 -0
  113. package/build/services/AutomaticReportResult.js.map +1 -0
  114. package/build/services/BlobStore.d.ts +91 -0
  115. package/build/services/BlobStore.d.ts.map +1 -0
  116. package/build/services/BlobStore.js +668 -0
  117. package/build/services/BlobStore.js.map +1 -0
  118. package/build/services/CaptionsTesterReportService.d.ts +4 -0
  119. package/build/services/CaptionsTesterReportService.d.ts.map +1 -0
  120. package/build/services/CaptionsTesterReportService.js +80 -0
  121. package/build/services/CaptionsTesterReportService.js.map +1 -0
  122. package/build/services/CloudAudioSubscriptionSync.d.ts +24 -0
  123. package/build/services/CloudAudioSubscriptionSync.d.ts.map +1 -0
  124. package/build/services/CloudAudioSubscriptionSync.js +39 -0
  125. package/build/services/CloudAudioSubscriptionSync.js.map +1 -0
  126. package/build/services/CloudClientService.d.ts +143 -0
  127. package/build/services/CloudClientService.d.ts.map +1 -0
  128. package/build/services/CloudClientService.js +627 -0
  129. package/build/services/CloudClientService.js.map +1 -0
  130. package/build/services/CloudTranscriptE2EMetrics.d.ts +4 -0
  131. package/build/services/CloudTranscriptE2EMetrics.d.ts.map +1 -0
  132. package/build/services/CloudTranscriptE2EMetrics.js +24 -0
  133. package/build/services/CloudTranscriptE2EMetrics.js.map +1 -0
  134. package/build/services/ConnectionCoordinator.d.ts +51 -0
  135. package/build/services/ConnectionCoordinator.d.ts.map +1 -0
  136. package/build/services/ConnectionCoordinator.js +34 -0
  137. package/build/services/ConnectionCoordinator.js.map +1 -0
  138. package/build/services/DevServerBridge.d.ts +63 -0
  139. package/build/services/DevServerBridge.d.ts.map +1 -0
  140. package/build/services/DevServerBridge.js +294 -0
  141. package/build/services/DevServerBridge.js.map +1 -0
  142. package/build/services/DeviceEventRouter.d.ts +3 -0
  143. package/build/services/DeviceEventRouter.d.ts.map +1 -0
  144. package/build/services/DeviceEventRouter.js +190 -0
  145. package/build/services/DeviceEventRouter.js.map +1 -0
  146. package/build/services/DeviceStoreHydration.d.ts +38 -0
  147. package/build/services/DeviceStoreHydration.d.ts.map +1 -0
  148. package/build/services/DeviceStoreHydration.js +124 -0
  149. package/build/services/DeviceStoreHydration.js.map +1 -0
  150. package/build/services/DisplayProcessor.d.ts +223 -0
  151. package/build/services/DisplayProcessor.d.ts.map +1 -0
  152. package/build/services/DisplayProcessor.js +552 -0
  153. package/build/services/DisplayProcessor.js.map +1 -0
  154. package/build/services/GlassesReadiness.d.ts +41 -0
  155. package/build/services/GlassesReadiness.d.ts.map +1 -0
  156. package/build/services/GlassesReadiness.js +82 -0
  157. package/build/services/GlassesReadiness.js.map +1 -0
  158. package/build/services/GlassesSettingsSync.d.ts +33 -0
  159. package/build/services/GlassesSettingsSync.d.ts.map +1 -0
  160. package/build/services/GlassesSettingsSync.js +121 -0
  161. package/build/services/GlassesSettingsSync.js.map +1 -0
  162. package/build/services/GlassesStatusProjection.d.ts +3 -0
  163. package/build/services/GlassesStatusProjection.d.ts.map +1 -0
  164. package/build/services/GlassesStatusProjection.js +65 -0
  165. package/build/services/GlassesStatusProjection.js.map +1 -0
  166. package/build/services/HeadingService.d.ts +27 -0
  167. package/build/services/HeadingService.d.ts.map +1 -0
  168. package/build/services/HeadingService.js +96 -0
  169. package/build/services/HeadingService.js.map +1 -0
  170. package/build/services/LocalDisplayManager.d.ts +139 -0
  171. package/build/services/LocalDisplayManager.d.ts.map +1 -0
  172. package/build/services/LocalDisplayManager.js +579 -0
  173. package/build/services/LocalDisplayManager.js.map +1 -0
  174. package/build/services/LocalMiniappRuntime.d.ts +433 -0
  175. package/build/services/LocalMiniappRuntime.d.ts.map +1 -0
  176. package/build/services/LocalMiniappRuntime.js +3561 -0
  177. package/build/services/LocalMiniappRuntime.js.map +1 -0
  178. package/build/services/LocalSttFallbackCoordinator.d.ts +54 -0
  179. package/build/services/LocalSttFallbackCoordinator.d.ts.map +1 -0
  180. package/build/services/LocalSttFallbackCoordinator.js +131 -0
  181. package/build/services/LocalSttFallbackCoordinator.js.map +1 -0
  182. package/build/services/MentraJSCrashController.d.ts +97 -0
  183. package/build/services/MentraJSCrashController.d.ts.map +1 -0
  184. package/build/services/MentraJSCrashController.js +138 -0
  185. package/build/services/MentraJSCrashController.js.map +1 -0
  186. package/build/services/MentraJSCrashloopReportService.d.ts +9 -0
  187. package/build/services/MentraJSCrashloopReportService.d.ts.map +1 -0
  188. package/build/services/MentraJSCrashloopReportService.js +54 -0
  189. package/build/services/MentraJSCrashloopReportService.js.map +1 -0
  190. package/build/services/MentraJSLogPipeline.d.ts +87 -0
  191. package/build/services/MentraJSLogPipeline.d.ts.map +1 -0
  192. package/build/services/MentraJSLogPipeline.js +137 -0
  193. package/build/services/MentraJSLogPipeline.js.map +1 -0
  194. package/build/services/MentraJSRouter.d.ts +203 -0
  195. package/build/services/MentraJSRouter.d.ts.map +1 -0
  196. package/build/services/MentraJSRouter.js +480 -0
  197. package/build/services/MentraJSRouter.js.map +1 -0
  198. package/build/services/MentraUIRouter.d.ts +137 -0
  199. package/build/services/MentraUIRouter.d.ts.map +1 -0
  200. package/build/services/MentraUIRouter.js +210 -0
  201. package/build/services/MentraUIRouter.js.map +1 -0
  202. package/build/services/MicStateCoordinator.d.ts +37 -0
  203. package/build/services/MicStateCoordinator.d.ts.map +1 -0
  204. package/build/services/MicStateCoordinator.js +81 -0
  205. package/build/services/MicStateCoordinator.js.map +1 -0
  206. package/build/services/MiniappEngine.d.ts +31 -0
  207. package/build/services/MiniappEngine.d.ts.map +1 -0
  208. package/build/services/MiniappEngine.js +119 -0
  209. package/build/services/MiniappEngine.js.map +1 -0
  210. package/build/services/MiniappLauncher.d.ts +129 -0
  211. package/build/services/MiniappLauncher.d.ts.map +1 -0
  212. package/build/services/MiniappLauncher.js +291 -0
  213. package/build/services/MiniappLauncher.js.map +1 -0
  214. package/build/services/MiniappRunningRegistry.d.ts +24 -0
  215. package/build/services/MiniappRunningRegistry.d.ts.map +1 -0
  216. package/build/services/MiniappRunningRegistry.js +52 -0
  217. package/build/services/MiniappRunningRegistry.js.map +1 -0
  218. package/build/services/NavigationHandlers.d.ts +90 -0
  219. package/build/services/NavigationHandlers.d.ts.map +1 -0
  220. package/build/services/NavigationHandlers.js +379 -0
  221. package/build/services/NavigationHandlers.js.map +1 -0
  222. package/build/services/NavigationService.d.ts +254 -0
  223. package/build/services/NavigationService.d.ts.map +1 -0
  224. package/build/services/NavigationService.js +553 -0
  225. package/build/services/NavigationService.js.map +1 -0
  226. package/build/services/NotificationsEmitter.d.ts +28 -0
  227. package/build/services/NotificationsEmitter.d.ts.map +1 -0
  228. package/build/services/NotificationsEmitter.js +22 -0
  229. package/build/services/NotificationsEmitter.js.map +1 -0
  230. package/build/services/OfflineSpeechModelService.d.ts +33 -0
  231. package/build/services/OfflineSpeechModelService.d.ts.map +1 -0
  232. package/build/services/OfflineSpeechModelService.js +136 -0
  233. package/build/services/OfflineSpeechModelService.js.map +1 -0
  234. package/build/services/OtaInstallCoordinator.d.ts +195 -0
  235. package/build/services/OtaInstallCoordinator.d.ts.map +1 -0
  236. package/build/services/OtaInstallCoordinator.js +1047 -0
  237. package/build/services/OtaInstallCoordinator.js.map +1 -0
  238. package/build/services/OtaService.d.ts +3 -0
  239. package/build/services/OtaService.d.ts.map +1 -0
  240. package/build/services/OtaService.js +65 -0
  241. package/build/services/OtaService.js.map +1 -0
  242. package/build/services/OtaUpdateCheckService.d.ts +65 -0
  243. package/build/services/OtaUpdateCheckService.d.ts.map +1 -0
  244. package/build/services/OtaUpdateCheckService.js +260 -0
  245. package/build/services/OtaUpdateCheckService.js.map +1 -0
  246. package/build/services/PairingIdentity.d.ts +80 -0
  247. package/build/services/PairingIdentity.d.ts.map +1 -0
  248. package/build/services/PairingIdentity.js +145 -0
  249. package/build/services/PairingIdentity.js.map +1 -0
  250. package/build/services/PhoneLocationService.d.ts +36 -0
  251. package/build/services/PhoneLocationService.d.ts.map +1 -0
  252. package/build/services/PhoneLocationService.js +115 -0
  253. package/build/services/PhoneLocationService.js.map +1 -0
  254. package/build/services/PhoneNotificationsSync.d.ts +3 -0
  255. package/build/services/PhoneNotificationsSync.d.ts.map +1 -0
  256. package/build/services/PhoneNotificationsSync.js +35 -0
  257. package/build/services/PhoneNotificationsSync.js.map +1 -0
  258. package/build/services/PhonePhotoCoordinator.d.ts +86 -0
  259. package/build/services/PhonePhotoCoordinator.d.ts.map +1 -0
  260. package/build/services/PhonePhotoCoordinator.js +274 -0
  261. package/build/services/PhonePhotoCoordinator.js.map +1 -0
  262. package/build/services/PhoneStreamCoordinator.d.ts +168 -0
  263. package/build/services/PhoneStreamCoordinator.d.ts.map +1 -0
  264. package/build/services/PhoneStreamCoordinator.js +632 -0
  265. package/build/services/PhoneStreamCoordinator.js.map +1 -0
  266. package/build/services/PhoneVideoCoordinator.d.ts +50 -0
  267. package/build/services/PhoneVideoCoordinator.d.ts.map +1 -0
  268. package/build/services/PhoneVideoCoordinator.js +147 -0
  269. package/build/services/PhoneVideoCoordinator.js.map +1 -0
  270. package/build/services/STTModelManager.d.ts +65 -0
  271. package/build/services/STTModelManager.d.ts.map +1 -0
  272. package/build/services/STTModelManager.js +292 -0
  273. package/build/services/STTModelManager.js.map +1 -0
  274. package/build/services/SceneRenderer.d.ts +90 -0
  275. package/build/services/SceneRenderer.d.ts.map +1 -0
  276. package/build/services/SceneRenderer.js +248 -0
  277. package/build/services/SceneRenderer.js.map +1 -0
  278. package/build/services/StreamLifecycleController.d.ts +67 -0
  279. package/build/services/StreamLifecycleController.d.ts.map +1 -0
  280. package/build/services/StreamLifecycleController.js +152 -0
  281. package/build/services/StreamLifecycleController.js.map +1 -0
  282. package/build/services/TTSModelManager.d.ts +90 -0
  283. package/build/services/TTSModelManager.d.ts.map +1 -0
  284. package/build/services/TTSModelManager.js +366 -0
  285. package/build/services/TTSModelManager.js.map +1 -0
  286. package/build/services/WebviewBridge.d.ts +22 -0
  287. package/build/services/WebviewBridge.d.ts.map +1 -0
  288. package/build/services/WebviewBridge.js +47 -0
  289. package/build/services/WebviewBridge.js.map +1 -0
  290. package/build/services/asg/GalleryMediaIntegrityReportService.d.ts +17 -0
  291. package/build/services/asg/GalleryMediaIntegrityReportService.d.ts.map +1 -0
  292. package/build/services/asg/GalleryMediaIntegrityReportService.js +43 -0
  293. package/build/services/asg/GalleryMediaIntegrityReportService.js.map +1 -0
  294. package/build/services/asg/asgCameraApi.d.ts +165 -0
  295. package/build/services/asg/asgCameraApi.d.ts.map +1 -0
  296. package/build/services/asg/asgCameraApi.js +997 -0
  297. package/build/services/asg/asgCameraApi.js.map +1 -0
  298. package/build/services/asg/galleryMediaValidation.d.ts +29 -0
  299. package/build/services/asg/galleryMediaValidation.d.ts.map +1 -0
  300. package/build/services/asg/galleryMediaValidation.js +149 -0
  301. package/build/services/asg/galleryMediaValidation.js.map +1 -0
  302. package/build/services/asg/galleryNotices.d.ts +33 -0
  303. package/build/services/asg/galleryNotices.d.ts.map +1 -0
  304. package/build/services/asg/galleryNotices.js +29 -0
  305. package/build/services/asg/galleryNotices.js.map +1 -0
  306. package/build/services/asg/gallerySettingsService.d.ts +19 -0
  307. package/build/services/asg/gallerySettingsService.d.ts.map +1 -0
  308. package/build/services/asg/gallerySettingsService.js +51 -0
  309. package/build/services/asg/gallerySettingsService.js.map +1 -0
  310. package/build/services/asg/gallerySyncNotifications.d.ts +56 -0
  311. package/build/services/asg/gallerySyncNotifications.d.ts.map +1 -0
  312. package/build/services/asg/gallerySyncNotifications.js +198 -0
  313. package/build/services/asg/gallerySyncNotifications.js.map +1 -0
  314. package/build/services/asg/gallerySyncService.d.ts +137 -0
  315. package/build/services/asg/gallerySyncService.d.ts.map +1 -0
  316. package/build/services/asg/gallerySyncService.js +1839 -0
  317. package/build/services/asg/gallerySyncService.js.map +1 -0
  318. package/build/services/asg/localStorageService.d.ts +128 -0
  319. package/build/services/asg/localStorageService.d.ts.map +1 -0
  320. package/build/services/asg/localStorageService.js +423 -0
  321. package/build/services/asg/localStorageService.js.map +1 -0
  322. package/build/services/asg/mediaProcessingQueue.d.ts +60 -0
  323. package/build/services/asg/mediaProcessingQueue.d.ts.map +1 -0
  324. package/build/services/asg/mediaProcessingQueue.js +320 -0
  325. package/build/services/asg/mediaProcessingQueue.js.map +1 -0
  326. package/build/services/asgOtaVersionUrl.d.ts +2 -0
  327. package/build/services/asgOtaVersionUrl.d.ts.map +1 -0
  328. package/build/services/asgOtaVersionUrl.js +36 -0
  329. package/build/services/asgOtaVersionUrl.js.map +1 -0
  330. package/build/services/blobPaths.d.ts +31 -0
  331. package/build/services/blobPaths.d.ts.map +1 -0
  332. package/build/services/blobPaths.js +86 -0
  333. package/build/services/blobPaths.js.map +1 -0
  334. package/build/services/cloudStreamApi.d.ts +59 -0
  335. package/build/services/cloudStreamApi.d.ts.map +1 -0
  336. package/build/services/cloudStreamApi.js +81 -0
  337. package/build/services/cloudStreamApi.js.map +1 -0
  338. package/build/services/gallerySyncClock.d.ts +17 -0
  339. package/build/services/gallerySyncClock.d.ts.map +1 -0
  340. package/build/services/gallerySyncClock.js +21 -0
  341. package/build/services/gallerySyncClock.js.map +1 -0
  342. package/build/services/glassesClockSync.d.ts +20 -0
  343. package/build/services/glassesClockSync.d.ts.map +1 -0
  344. package/build/services/glassesClockSync.js +97 -0
  345. package/build/services/glassesClockSync.js.map +1 -0
  346. package/build/services/manifestVersionGate.d.ts +28 -0
  347. package/build/services/manifestVersionGate.d.ts.map +1 -0
  348. package/build/services/manifestVersionGate.js +41 -0
  349. package/build/services/manifestVersionGate.js.map +1 -0
  350. package/build/services/mentraUiShim.d.ts +38 -0
  351. package/build/services/mentraUiShim.d.ts.map +1 -0
  352. package/build/services/mentraUiShim.js +360 -0
  353. package/build/services/mentraUiShim.js.map +1 -0
  354. package/build/services/navigation/roadNameResolver.d.ts +67 -0
  355. package/build/services/navigation/roadNameResolver.d.ts.map +1 -0
  356. package/build/services/navigation/roadNameResolver.js +96 -0
  357. package/build/services/navigation/roadNameResolver.js.map +1 -0
  358. package/build/services/navigation/routesApiCodec.d.ts +38 -0
  359. package/build/services/navigation/routesApiCodec.d.ts.map +1 -0
  360. package/build/services/navigation/routesApiCodec.js +68 -0
  361. package/build/services/navigation/routesApiCodec.js.map +1 -0
  362. package/build/services/otaDisplayState.d.ts +42 -0
  363. package/build/services/otaDisplayState.d.ts.map +1 -0
  364. package/build/services/otaDisplayState.js +92 -0
  365. package/build/services/otaDisplayState.js.map +1 -0
  366. package/build/services/otaInstallPolicy.d.ts +81 -0
  367. package/build/services/otaInstallPolicy.d.ts.map +1 -0
  368. package/build/services/otaInstallPolicy.js +96 -0
  369. package/build/services/otaInstallPolicy.js.map +1 -0
  370. package/build/services/otaLegacyMapping.d.ts +22 -0
  371. package/build/services/otaLegacyMapping.d.ts.map +1 -0
  372. package/build/services/otaLegacyMapping.js +56 -0
  373. package/build/services/otaLegacyMapping.js.map +1 -0
  374. package/build/services/slimStreamStatus.d.ts +7 -0
  375. package/build/services/slimStreamStatus.d.ts.map +1 -0
  376. package/build/services/slimStreamStatus.js +26 -0
  377. package/build/services/slimStreamStatus.js.map +1 -0
  378. package/build/stores/apps.d.ts +104 -0
  379. package/build/stores/apps.d.ts.map +1 -0
  380. package/build/stores/apps.js +492 -0
  381. package/build/stores/apps.js.map +1 -0
  382. package/build/stores/bluetoothSettingKeys.d.ts +4 -0
  383. package/build/stores/bluetoothSettingKeys.d.ts.map +1 -0
  384. package/build/stores/bluetoothSettingKeys.js +31 -0
  385. package/build/stores/bluetoothSettingKeys.js.map +1 -0
  386. package/build/stores/cloudClientStatus.d.ts +9 -0
  387. package/build/stores/cloudClientStatus.d.ts.map +1 -0
  388. package/build/stores/cloudClientStatus.js +24 -0
  389. package/build/stores/cloudClientStatus.js.map +1 -0
  390. package/build/stores/connection.d.ts +22 -0
  391. package/build/stores/connection.d.ts.map +1 -0
  392. package/build/stores/connection.js +43 -0
  393. package/build/stores/connection.js.map +1 -0
  394. package/build/stores/core.d.ts +15 -0
  395. package/build/stores/core.d.ts.map +1 -0
  396. package/build/stores/core.js +21 -0
  397. package/build/stores/core.js.map +1 -0
  398. package/build/stores/display.d.ts +24 -0
  399. package/build/stores/display.d.ts.map +1 -0
  400. package/build/stores/display.js +96 -0
  401. package/build/stores/display.js.map +1 -0
  402. package/build/stores/gallerySync.d.ts +101 -0
  403. package/build/stores/gallerySync.d.ts.map +1 -0
  404. package/build/stores/gallerySync.js +217 -0
  405. package/build/stores/gallerySync.js.map +1 -0
  406. package/build/stores/glasses.d.ts +62 -0
  407. package/build/stores/glasses.d.ts.map +1 -0
  408. package/build/stores/glasses.js +203 -0
  409. package/build/stores/glasses.js.map +1 -0
  410. package/build/stores/settings.d.ts +37 -0
  411. package/build/stores/settings.d.ts.map +1 -0
  412. package/build/stores/settings.js +915 -0
  413. package/build/stores/settings.js.map +1 -0
  414. package/build/types/applet.d.ts +96 -0
  415. package/build/types/applet.d.ts.map +1 -0
  416. package/build/types/applet.js +5 -0
  417. package/build/types/applet.js.map +1 -0
  418. package/build/types/asg.d.ts +46 -0
  419. package/build/types/asg.d.ts.map +1 -0
  420. package/build/types/asg.js +2 -0
  421. package/build/types/asg.js.map +1 -0
  422. package/build/types/capabilities/even-realities-g1.d.ts +12 -0
  423. package/build/types/capabilities/even-realities-g1.d.ts.map +1 -0
  424. package/build/types/capabilities/even-realities-g1.js +55 -0
  425. package/build/types/capabilities/even-realities-g1.js.map +1 -0
  426. package/build/types/capabilities/even-realities-g2.d.ts +12 -0
  427. package/build/types/capabilities/even-realities-g2.d.ts.map +1 -0
  428. package/build/types/capabilities/even-realities-g2.js +75 -0
  429. package/build/types/capabilities/even-realities-g2.js.map +1 -0
  430. package/build/types/capabilities/mentra-display.d.ts +12 -0
  431. package/build/types/capabilities/mentra-display.d.ts.map +1 -0
  432. package/build/types/capabilities/mentra-display.js +63 -0
  433. package/build/types/capabilities/mentra-display.js.map +1 -0
  434. package/build/types/capabilities/mentra-live.d.ts +12 -0
  435. package/build/types/capabilities/mentra-live.d.ts.map +1 -0
  436. package/build/types/capabilities/mentra-live.js +92 -0
  437. package/build/types/capabilities/mentra-live.js.map +1 -0
  438. package/build/types/capabilities/none.d.ts +13 -0
  439. package/build/types/capabilities/none.d.ts.map +1 -0
  440. package/build/types/capabilities/none.js +65 -0
  441. package/build/types/capabilities/none.js.map +1 -0
  442. package/build/types/capabilities/simulated-glasses.d.ts +13 -0
  443. package/build/types/capabilities/simulated-glasses.d.ts.map +1 -0
  444. package/build/types/capabilities/simulated-glasses.js +65 -0
  445. package/build/types/capabilities/simulated-glasses.js.map +1 -0
  446. package/build/types/capabilities/vuzix-z100.d.ts +12 -0
  447. package/build/types/capabilities/vuzix-z100.d.ts.map +1 -0
  448. package/build/types/capabilities/vuzix-z100.js +52 -0
  449. package/build/types/capabilities/vuzix-z100.js.map +1 -0
  450. package/build/types/enums.d.ts +40 -0
  451. package/build/types/enums.d.ts.map +1 -0
  452. package/build/types/enums.js +44 -0
  453. package/build/types/enums.js.map +1 -0
  454. package/build/types/hardware.d.ts +160 -0
  455. package/build/types/hardware.d.ts.map +1 -0
  456. package/build/types/hardware.js +36 -0
  457. package/build/types/hardware.js.map +1 -0
  458. package/build/types/index.d.ts +11 -0
  459. package/build/types/index.d.ts.map +1 -0
  460. package/build/types/index.js +10 -0
  461. package/build/types/index.js.map +1 -0
  462. package/build/utils/GlobalEventEmitter.d.ts +10 -0
  463. package/build/utils/GlobalEventEmitter.d.ts.map +1 -0
  464. package/build/utils/GlobalEventEmitter.js +13 -0
  465. package/build/utils/GlobalEventEmitter.js.map +1 -0
  466. package/build/utils/cloudClient/RnUdpAdapter.d.ts +3 -0
  467. package/build/utils/cloudClient/RnUdpAdapter.d.ts.map +1 -0
  468. package/build/utils/cloudClient/RnUdpAdapter.js +41 -0
  469. package/build/utils/cloudClient/RnUdpAdapter.js.map +1 -0
  470. package/build/utils/cloudClient/cloudSecureStore.d.ts +3 -0
  471. package/build/utils/cloudClient/cloudSecureStore.d.ts.map +1 -0
  472. package/build/utils/cloudClient/cloudSecureStore.js +26 -0
  473. package/build/utils/cloudClient/cloudSecureStore.js.map +1 -0
  474. package/build/utils/debouncedPatch.d.ts +6 -0
  475. package/build/utils/debouncedPatch.d.ts.map +1 -0
  476. package/build/utils/debouncedPatch.js +25 -0
  477. package/build/utils/debouncedPatch.js.map +1 -0
  478. package/build/utils/devLogging.d.ts +26 -0
  479. package/build/utils/devLogging.d.ts.map +1 -0
  480. package/build/utils/devLogging.js +116 -0
  481. package/build/utils/devLogging.js.map +1 -0
  482. package/build/utils/devMiniappLaunch.d.ts +44 -0
  483. package/build/utils/devMiniappLaunch.d.ts.map +1 -0
  484. package/build/utils/devMiniappLaunch.js +52 -0
  485. package/build/utils/devMiniappLaunch.js.map +1 -0
  486. package/build/utils/diagnosticContext.d.ts +3 -0
  487. package/build/utils/diagnosticContext.d.ts.map +1 -0
  488. package/build/utils/diagnosticContext.js +119 -0
  489. package/build/utils/diagnosticContext.js.map +1 -0
  490. package/build/utils/display/composer/ColumnComposer.d.ts +131 -0
  491. package/build/utils/display/composer/ColumnComposer.d.ts.map +1 -0
  492. package/build/utils/display/composer/ColumnComposer.js +204 -0
  493. package/build/utils/display/composer/ColumnComposer.js.map +1 -0
  494. package/build/utils/display/composer/index.d.ts +9 -0
  495. package/build/utils/display/composer/index.d.ts.map +1 -0
  496. package/build/utils/display/composer/index.js +9 -0
  497. package/build/utils/display/composer/index.js.map +1 -0
  498. package/build/utils/display/helpers/DisplayHelpers.d.ts +165 -0
  499. package/build/utils/display/helpers/DisplayHelpers.d.ts.map +1 -0
  500. package/build/utils/display/helpers/DisplayHelpers.js +312 -0
  501. package/build/utils/display/helpers/DisplayHelpers.js.map +1 -0
  502. package/build/utils/display/helpers/ScrollView.d.ts +183 -0
  503. package/build/utils/display/helpers/ScrollView.d.ts.map +1 -0
  504. package/build/utils/display/helpers/ScrollView.js +257 -0
  505. package/build/utils/display/helpers/ScrollView.js.map +1 -0
  506. package/build/utils/display/helpers/index.d.ts +11 -0
  507. package/build/utils/display/helpers/index.d.ts.map +1 -0
  508. package/build/utils/display/helpers/index.js +10 -0
  509. package/build/utils/display/helpers/index.js.map +1 -0
  510. package/build/utils/display/index.d.ts +174 -0
  511. package/build/utils/display/index.d.ts.map +1 -0
  512. package/build/utils/display/index.js +185 -0
  513. package/build/utils/display/index.js.map +1 -0
  514. package/build/utils/display/measurer/TextMeasurer.d.ts +160 -0
  515. package/build/utils/display/measurer/TextMeasurer.d.ts.map +1 -0
  516. package/build/utils/display/measurer/TextMeasurer.js +273 -0
  517. package/build/utils/display/measurer/TextMeasurer.js.map +1 -0
  518. package/build/utils/display/measurer/index.d.ts +10 -0
  519. package/build/utils/display/measurer/index.d.ts.map +1 -0
  520. package/build/utils/display/measurer/index.js +11 -0
  521. package/build/utils/display/measurer/index.js.map +1 -0
  522. package/build/utils/display/measurer/script-detection.d.ts +53 -0
  523. package/build/utils/display/measurer/script-detection.d.ts.map +1 -0
  524. package/build/utils/display/measurer/script-detection.js +184 -0
  525. package/build/utils/display/measurer/script-detection.js.map +1 -0
  526. package/build/utils/display/profiles/g1.d.ts +33 -0
  527. package/build/utils/display/profiles/g1.d.ts.map +1 -0
  528. package/build/utils/display/profiles/g1.js +213 -0
  529. package/build/utils/display/profiles/g1.js.map +1 -0
  530. package/build/utils/display/profiles/g2.d.ts +13 -0
  531. package/build/utils/display/profiles/g2.d.ts.map +1 -0
  532. package/build/utils/display/profiles/g2.js +34 -0
  533. package/build/utils/display/profiles/g2.js.map +1 -0
  534. package/build/utils/display/profiles/index.d.ts +12 -0
  535. package/build/utils/display/profiles/index.d.ts.map +1 -0
  536. package/build/utils/display/profiles/index.js +15 -0
  537. package/build/utils/display/profiles/index.js.map +1 -0
  538. package/build/utils/display/profiles/nex.d.ts +10 -0
  539. package/build/utils/display/profiles/nex.d.ts.map +1 -0
  540. package/build/utils/display/profiles/nex.js +150 -0
  541. package/build/utils/display/profiles/nex.js.map +1 -0
  542. package/build/utils/display/profiles/types.d.ts +103 -0
  543. package/build/utils/display/profiles/types.d.ts.map +1 -0
  544. package/build/utils/display/profiles/types.js +2 -0
  545. package/build/utils/display/profiles/types.js.map +1 -0
  546. package/build/utils/display/profiles/z100.d.ts +33 -0
  547. package/build/utils/display/profiles/z100.d.ts.map +1 -0
  548. package/build/utils/display/profiles/z100.js +182 -0
  549. package/build/utils/display/profiles/z100.js.map +1 -0
  550. package/build/utils/display/scene/degrade.d.ts +25 -0
  551. package/build/utils/display/scene/degrade.d.ts.map +1 -0
  552. package/build/utils/display/scene/degrade.js +64 -0
  553. package/build/utils/display/scene/degrade.js.map +1 -0
  554. package/build/utils/display/scene/differ.d.ts +38 -0
  555. package/build/utils/display/scene/differ.d.ts.map +1 -0
  556. package/build/utils/display/scene/differ.js +107 -0
  557. package/build/utils/display/scene/differ.js.map +1 -0
  558. package/build/utils/display/scene/index.d.ts +10 -0
  559. package/build/utils/display/scene/index.d.ts.map +1 -0
  560. package/build/utils/display/scene/index.js +6 -0
  561. package/build/utils/display/scene/index.js.map +1 -0
  562. package/build/utils/display/scene/process.d.ts +35 -0
  563. package/build/utils/display/scene/process.d.ts.map +1 -0
  564. package/build/utils/display/scene/process.js +187 -0
  565. package/build/utils/display/scene/process.js.map +1 -0
  566. package/build/utils/display/scene/store.d.ts +48 -0
  567. package/build/utils/display/scene/store.d.ts.map +1 -0
  568. package/build/utils/display/scene/store.js +0 -0
  569. package/build/utils/display/scene/store.js.map +1 -0
  570. package/build/utils/display/scene/types.d.ts +120 -0
  571. package/build/utils/display/scene/types.d.ts.map +1 -0
  572. package/build/utils/display/scene/types.js +0 -0
  573. package/build/utils/display/scene/types.js.map +1 -0
  574. package/build/utils/display/wrapper/TextWrapper.d.ts +102 -0
  575. package/build/utils/display/wrapper/TextWrapper.d.ts.map +1 -0
  576. package/build/utils/display/wrapper/TextWrapper.js +471 -0
  577. package/build/utils/display/wrapper/TextWrapper.js.map +1 -0
  578. package/build/utils/display/wrapper/index.d.ts +12 -0
  579. package/build/utils/display/wrapper/index.d.ts.map +1 -0
  580. package/build/utils/display/wrapper/index.js +12 -0
  581. package/build/utils/display/wrapper/index.js.map +1 -0
  582. package/build/utils/display/wrapper/types.d.ts +75 -0
  583. package/build/utils/display/wrapper/types.d.ts.map +1 -0
  584. package/build/utils/display/wrapper/types.js +11 -0
  585. package/build/utils/display/wrapper/types.js.map +1 -0
  586. package/build/utils/e2eMetrics.d.ts +6 -0
  587. package/build/utils/e2eMetrics.d.ts.map +1 -0
  588. package/build/utils/e2eMetrics.js +27 -0
  589. package/build/utils/e2eMetrics.js.map +1 -0
  590. package/build/utils/hardware/hardware.d.ts +42 -0
  591. package/build/utils/hardware/hardware.d.ts.map +1 -0
  592. package/build/utils/hardware/hardware.js +127 -0
  593. package/build/utils/hardware/hardware.js.map +1 -0
  594. package/build/utils/hardware/index.d.ts +2 -0
  595. package/build/utils/hardware/index.d.ts.map +1 -0
  596. package/build/utils/hardware/index.js +2 -0
  597. package/build/utils/hardware/index.js.map +1 -0
  598. package/build/utils/miniappGlobals.d.ts +60 -0
  599. package/build/utils/miniappGlobals.d.ts.map +1 -0
  600. package/build/utils/miniappGlobals.js +224 -0
  601. package/build/utils/miniappGlobals.js.map +1 -0
  602. package/build/utils/permissions/MediaLibraryPermissions.d.ts +34 -0
  603. package/build/utils/permissions/MediaLibraryPermissions.d.ts.map +1 -0
  604. package/build/utils/permissions/MediaLibraryPermissions.js +122 -0
  605. package/build/utils/permissions/MediaLibraryPermissions.js.map +1 -0
  606. package/build/utils/permissions/galleryDisplayName.d.ts +8 -0
  607. package/build/utils/permissions/galleryDisplayName.d.ts.map +1 -0
  608. package/build/utils/permissions/galleryDisplayName.js +25 -0
  609. package/build/utils/permissions/galleryDisplayName.js.map +1 -0
  610. package/build/utils/storage/index.d.ts +3 -0
  611. package/build/utils/storage/index.d.ts.map +1 -0
  612. package/build/utils/storage/index.js +3 -0
  613. package/build/utils/storage/index.js.map +1 -0
  614. package/build/utils/storage/storage.d.ts +24 -0
  615. package/build/utils/storage/storage.d.ts.map +1 -0
  616. package/build/utils/storage/storage.js +85 -0
  617. package/build/utils/storage/storage.js.map +1 -0
  618. package/build/utils/storage/zip.d.ts +3 -0
  619. package/build/utils/storage/zip.d.ts.map +1 -0
  620. package/build/utils/storage/zip.js +14 -0
  621. package/build/utils/storage/zip.js.map +1 -0
  622. package/build/utils/timers/index.d.ts +3 -0
  623. package/build/utils/timers/index.d.ts.map +1 -0
  624. package/build/utils/timers/index.js +3 -0
  625. package/build/utils/timers/index.js.map +1 -0
  626. package/build/utils/timers/timers.d.ts +9 -0
  627. package/build/utils/timers/timers.d.ts.map +1 -0
  628. package/build/utils/timers/timers.js +105 -0
  629. package/build/utils/timers/timers.js.map +1 -0
  630. package/package.json +119 -0
  631. package/src/devtools.ts +13 -0
  632. package/src/engine.ts +173 -0
  633. package/src/facades/dev.ts +197 -0
  634. package/src/facades/display.ts +17 -0
  635. package/src/facades/displayMirror.ts +33 -0
  636. package/src/facades/gallery.ts +69 -0
  637. package/src/facades/glasses.ts +206 -0
  638. package/src/facades/glassesSettings.ts +56 -0
  639. package/src/facades/glassesWifi.ts +68 -0
  640. package/src/facades/miniapps.ts +55 -0
  641. package/src/facades/notifications.ts +15 -0
  642. package/src/facades/ota.ts +174 -0
  643. package/src/facades/pairing.ts +329 -0
  644. package/src/facades/permissions.ts +151 -0
  645. package/src/facades/phoneNotifications.ts +50 -0
  646. package/src/facades/reports.ts +185 -0
  647. package/src/facades/session.ts +55 -0
  648. package/src/facades/settings.ts +57 -0
  649. package/src/facades/speech.ts +38 -0
  650. package/src/index.ts +191 -0
  651. package/src/internal.ts +158 -0
  652. package/src/runtime/bootstrap.ts +118 -0
  653. package/src/runtime/config.ts +147 -0
  654. package/src/runtime/streamConfig.ts +34 -0
  655. package/src/services/AppRegistry.ts +1139 -0
  656. package/src/services/AudioCloudUplink.ts +34 -0
  657. package/src/services/AudioPlaybackService.ts +624 -0
  658. package/src/services/AutomaticReportResult.ts +48 -0
  659. package/src/services/BlobStore.ts +746 -0
  660. package/src/services/CaptionsTesterReportService.ts +107 -0
  661. package/src/services/CloudAudioSubscriptionSync.ts +41 -0
  662. package/src/services/CloudClientService.ts +668 -0
  663. package/src/services/CloudTranscriptE2EMetrics.ts +27 -0
  664. package/src/services/ConnectionCoordinator.ts +65 -0
  665. package/src/services/DevServerBridge.ts +332 -0
  666. package/src/services/DeviceEventRouter.ts +238 -0
  667. package/src/services/DeviceStoreHydration.ts +130 -0
  668. package/src/services/DisplayProcessor.ts +775 -0
  669. package/src/services/GlassesReadiness.ts +103 -0
  670. package/src/services/GlassesSettingsSync.ts +134 -0
  671. package/src/services/GlassesStatusProjection.ts +73 -0
  672. package/src/services/HeadingService.ts +98 -0
  673. package/src/services/LocalDisplayManager.ts +703 -0
  674. package/src/services/LocalMiniappRuntime.ts +4038 -0
  675. package/src/services/LocalSttFallbackCoordinator.ts +140 -0
  676. package/src/services/MentraJSCrashController.ts +189 -0
  677. package/src/services/MentraJSCrashloopReportService.ts +66 -0
  678. package/src/services/MentraJSLogPipeline.ts +166 -0
  679. package/src/services/MentraJSRouter.ts +557 -0
  680. package/src/services/MentraUIRouter.ts +244 -0
  681. package/src/services/MicStateCoordinator.ts +94 -0
  682. package/src/services/MiniappEngine.ts +143 -0
  683. package/src/services/MiniappLauncher.ts +340 -0
  684. package/src/services/MiniappRunningRegistry.ts +57 -0
  685. package/src/services/NavigationHandlers.ts +423 -0
  686. package/src/services/NavigationService.ts +731 -0
  687. package/src/services/NotificationsEmitter.ts +48 -0
  688. package/src/services/OfflineSpeechModelService.ts +168 -0
  689. package/src/services/OtaInstallCoordinator.ts +1205 -0
  690. package/src/services/OtaService.ts +83 -0
  691. package/src/services/OtaUpdateCheckService.ts +386 -0
  692. package/src/services/PairingIdentity.ts +154 -0
  693. package/src/services/PhoneLocationService.ts +122 -0
  694. package/src/services/PhoneNotificationsSync.ts +44 -0
  695. package/src/services/PhonePhotoCoordinator.ts +337 -0
  696. package/src/services/PhoneStreamCoordinator.ts +777 -0
  697. package/src/services/PhoneVideoCoordinator.ts +189 -0
  698. package/src/services/STTModelManager.ts +360 -0
  699. package/src/services/SceneRenderer.ts +292 -0
  700. package/src/services/StreamLifecycleController.ts +213 -0
  701. package/src/services/TTSModelManager.ts +466 -0
  702. package/src/services/WebviewBridge.ts +50 -0
  703. package/src/services/asg/GalleryMediaIntegrityReportService.ts +70 -0
  704. package/src/services/asg/asgCameraApi.ts +1204 -0
  705. package/src/services/asg/galleryMediaValidation.ts +183 -0
  706. package/src/services/asg/galleryNotices.ts +60 -0
  707. package/src/services/asg/gallerySettingsService.ts +65 -0
  708. package/src/services/asg/gallerySyncNotifications.ts +236 -0
  709. package/src/services/asg/gallerySyncService.ts +2167 -0
  710. package/src/services/asg/localStorageService.ts +497 -0
  711. package/src/services/asg/mediaProcessingQueue.ts +371 -0
  712. package/src/services/asgOtaVersionUrl.ts +41 -0
  713. package/src/services/blobPaths.ts +86 -0
  714. package/src/services/cloudStreamApi.ts +154 -0
  715. package/src/services/gallerySyncClock.ts +39 -0
  716. package/src/services/glassesClockSync.ts +115 -0
  717. package/src/services/manifestVersionGate.ts +43 -0
  718. package/src/services/mentraUiShim.ts +366 -0
  719. package/src/services/navigation/roadNameResolver.ts +112 -0
  720. package/src/services/navigation/routesApiCodec.ts +69 -0
  721. package/src/services/otaDisplayState.ts +115 -0
  722. package/src/services/otaInstallPolicy.ts +106 -0
  723. package/src/services/otaLegacyMapping.ts +71 -0
  724. package/src/services/slimStreamStatus.ts +28 -0
  725. package/src/stores/apps.ts +614 -0
  726. package/src/stores/bluetoothSettingKeys.ts +36 -0
  727. package/src/stores/cloudClientStatus.ts +37 -0
  728. package/src/stores/connection.ts +69 -0
  729. package/src/stores/core.ts +32 -0
  730. package/src/stores/display.ts +121 -0
  731. package/src/stores/gallerySync.ts +380 -0
  732. package/src/stores/glasses.ts +309 -0
  733. package/src/stores/settings.ts +993 -0
  734. package/src/types/applet.ts +112 -0
  735. package/src/types/asg.ts +51 -0
  736. package/src/types/capabilities/even-realities-g1.ts +67 -0
  737. package/src/types/capabilities/even-realities-g2.ts +88 -0
  738. package/src/types/capabilities/mentra-display.ts +75 -0
  739. package/src/types/capabilities/mentra-live.ts +103 -0
  740. package/src/types/capabilities/none.ts +76 -0
  741. package/src/types/capabilities/simulated-glasses.ts +76 -0
  742. package/src/types/capabilities/vuzix-z100.ts +64 -0
  743. package/src/types/enums.ts +43 -0
  744. package/src/types/hardware.ts +203 -0
  745. package/src/types/index.ts +37 -0
  746. package/src/utils/GlobalEventEmitter.ts +14 -0
  747. package/src/utils/cloudClient/RnUdpAdapter.ts +47 -0
  748. package/src/utils/cloudClient/cloudSecureStore.ts +28 -0
  749. package/src/utils/debouncedPatch.ts +28 -0
  750. package/src/utils/devLogging.ts +140 -0
  751. package/src/utils/devMiniappLaunch.ts +68 -0
  752. package/src/utils/diagnosticContext.ts +155 -0
  753. package/src/utils/display/composer/ColumnComposer.ts +285 -0
  754. package/src/utils/display/composer/index.ts +15 -0
  755. package/src/utils/display/helpers/DisplayHelpers.ts +413 -0
  756. package/src/utils/display/helpers/ScrollView.ts +337 -0
  757. package/src/utils/display/helpers/index.ts +14 -0
  758. package/src/utils/display/index.ts +273 -0
  759. package/src/utils/display/measurer/TextMeasurer.ts +346 -0
  760. package/src/utils/display/measurer/index.ts +21 -0
  761. package/src/utils/display/measurer/script-detection.ts +218 -0
  762. package/src/utils/display/profiles/g1.ts +236 -0
  763. package/src/utils/display/profiles/g2.ts +39 -0
  764. package/src/utils/display/profiles/index.ts +28 -0
  765. package/src/utils/display/profiles/nex.ts +166 -0
  766. package/src/utils/display/profiles/types.ts +132 -0
  767. package/src/utils/display/profiles/z100.ts +198 -0
  768. package/src/utils/display/scene/degrade.ts +80 -0
  769. package/src/utils/display/scene/differ.ts +128 -0
  770. package/src/utils/display/scene/index.ts +21 -0
  771. package/src/utils/display/scene/process.ts +214 -0
  772. package/src/utils/display/scene/store.ts +0 -0
  773. package/src/utils/display/scene/types.ts +0 -0
  774. package/src/utils/display/wrapper/TextWrapper.ts +546 -0
  775. package/src/utils/display/wrapper/index.ts +15 -0
  776. package/src/utils/display/wrapper/types.ts +102 -0
  777. package/src/utils/e2eMetrics.ts +30 -0
  778. package/src/utils/hardware/hardware.ts +166 -0
  779. package/src/utils/hardware/index.ts +1 -0
  780. package/src/utils/miniappGlobals.ts +260 -0
  781. package/src/utils/permissions/MediaLibraryPermissions.ts +130 -0
  782. package/src/utils/permissions/galleryDisplayName.ts +28 -0
  783. package/src/utils/storage/index.ts +2 -0
  784. package/src/utils/storage/storage.ts +101 -0
  785. package/src/utils/storage/zip.ts +13 -0
  786. package/src/utils/timers/index.ts +2 -0
  787. package/src/utils/timers/timers.ts +139 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OtaUpdateCheckService.js","sourceRoot":"","sources":["../../src/services/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CAAC,sCAAsC;YAC9F,uCAAuC,CAC1C,CAAA;IACH,CAAC;IACD,MAAM,eAAe,GAAG,eAAe,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAA;IAChF,MAAM,UAAU,GAAG,eAAe;QAChC,CAAC,CAAC;YACE,SAAS,EAAE,IAAI;YACf,WAAW,EAAE,MAAM,CAAC,iBAAiB,EAAE,WAAW,IAAI,CAAC;YACvD,WAAW,EAAE,MAAM,CAAC,iBAAiB,EAAE,WAAW,IAAI,EAAE;YACxD,OAAO,EAAE,eAAe;YACxB,SAAS,EAAE,CAAC;SACb;QACH,CAAC,CAAC,IAAI,CAAA;IAER,eAAe,CAAC,QAAQ,EAAE,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAA;IAE5D,OAAO;QACL,GAAG,MAAM;QACT,eAAe;QACf,OAAO,EAAE,eAAe;QACxB,UAAU;QACV,UAAU,EAAE,MAAM,CAAC,iBAAiB,EAAE,UAAU,KAAK,KAAK;QAC1D,WAAW;QACX,WAAW;QACX,kBAAkB;QAClB,kBAAkB;KACnB,CAAA;AACH,CAAC","sourcesContent":["import BluetoothSdk from \"@mentra/bluetooth-sdk/internal\"\nimport type {OtaUpdateInfo} from \"@mentra/bluetooth-sdk/internal\"\nimport {getGlassesSystemTimeMs, isGlassesConnected, useGlassesStore, waitForGlassesState} from \"../stores/glasses\"\nimport {maybeFixGlassesClockFromVersionInfo} from \"./glassesClockSync\"\nimport {getAsgOtaVersionUrl} from \"./asgOtaVersionUrl\"\n\nexport interface VersionInfo {\n versionCode: number\n versionName: string\n downloadUrl: string\n apkSize: number\n sha256: string\n releaseNotes: string\n isRequired?: boolean\n}\n\nexport interface MtkPatch {\n start_firmware: string\n end_firmware: string\n url: string\n}\n\nexport interface BesFirmware {\n version: string\n url: string\n}\n\nexport interface VersionJson {\n apps?: {\n [packageName: string]: VersionInfo\n }\n mtk_patches?: MtkPatch[]\n bes_firmware?: BesFirmware\n versionCode?: number\n versionName?: string\n downloadUrl?: string\n apkSize?: number\n sha256?: string\n releaseNotes?: string\n}\n\nexport interface OtaCheckResult {\n hasCheckCompleted: boolean\n updateAvailable: boolean\n latestVersionInfo: VersionInfo | null\n updates: string[]\n mtkPatch: MtkPatch | null\n besVersion: string | null\n}\n\nexport type OtaCheckSkippedReason = \"disconnected\" | \"missing_build\"\n\nexport interface OtaCheckCurrentGlassesResult extends OtaCheckResult {\n updateInfo: OtaUpdateInfo | null\n isRequired: boolean\n skippedReason?: OtaCheckSkippedReason\n manifestUrl?: string\n buildNumber?: string\n mtkFirmwareVersion?: string\n besFirmwareVersion?: string\n}\n\nexport interface OtaCheckCurrentGlassesOptions {\n waitForBuildNumberMs?: number\n waitForBesVersionMs?: number\n waitForMtkVersionMs?: number\n refreshVersionInfo?: boolean\n fixClockBeforeCheck?: boolean\n}\n\nfunction emptyCheckResult(skippedReason?: OtaCheckSkippedReason): OtaCheckCurrentGlassesResult {\n return {\n hasCheckCompleted: false,\n updateAvailable: false,\n latestVersionInfo: null,\n updates: [],\n mtkPatch: null,\n besVersion: null,\n updateInfo: null,\n isRequired: true,\n skippedReason,\n }\n}\n\nfunction glassesConnectedNow(): boolean {\n return isGlassesConnected(useGlassesStore.getState().connection)\n}\n\nexport async function fetchVersionInfo(url: string): Promise<VersionJson | null> {\n try {\n const response = await fetch(url)\n if (!response.ok) {\n console.error(\"Failed to fetch version info:\", response.status)\n return null\n }\n return await response.json()\n } catch (error) {\n console.error(\"OTA: Error fetching version info:\", error)\n return null\n }\n}\n\nexport function checkVersionUpdateAvailable(\n currentBuildNumber: string | undefined,\n versionJson: VersionJson | null,\n): boolean {\n if (!currentBuildNumber || !versionJson) {\n return false\n }\n\n const currentVersion = parseInt(currentBuildNumber, 10)\n if (isNaN(currentVersion)) {\n return false\n }\n\n let serverVersion: number | undefined\n\n if (versionJson.apps?.[\"com.mentra.asg_client\"]) {\n serverVersion = versionJson.apps[\"com.mentra.asg_client\"].versionCode\n } else if (versionJson.versionCode) {\n serverVersion = versionJson.versionCode\n }\n\n if (!serverVersion || isNaN(serverVersion)) {\n return false\n }\n\n return serverVersion > currentVersion\n}\n\nexport function getLatestVersionInfo(versionJson: VersionJson | null): VersionInfo | null {\n if (!versionJson) {\n return null\n }\n\n if (versionJson.apps?.[\"com.mentra.asg_client\"]) {\n return versionJson.apps[\"com.mentra.asg_client\"]\n }\n\n if (versionJson.versionCode) {\n return {\n versionCode: versionJson.versionCode,\n versionName: versionJson.versionName || \"\",\n downloadUrl: versionJson.downloadUrl || \"\",\n apkSize: versionJson.apkSize || 0,\n sha256: versionJson.sha256 || \"\",\n releaseNotes: versionJson.releaseNotes || \"\",\n }\n }\n\n return null\n}\n\nexport function findMatchingMtkPatch(\n patches: MtkPatch[] | undefined,\n currentVersion: string | undefined,\n): MtkPatch | null {\n if (!patches || !currentVersion) {\n return null\n }\n\n return (\n patches.find((patch) => {\n if (patch.start_firmware === currentVersion) {\n return true\n }\n const serverDate = patch.start_firmware.includes(\"_\")\n ? patch.start_firmware.split(\"_\").pop()\n : patch.start_firmware\n return serverDate === currentVersion\n }) || null\n )\n}\n\nexport function checkBesUpdate(besFirmware: BesFirmware | undefined, currentVersion: string | undefined): boolean {\n if (!besFirmware) {\n return false\n }\n\n if (!currentVersion) {\n console.log(`📱 BES current version unknown - assuming update needed (server: ${besFirmware.version})`)\n return true\n }\n return compareVersions(besFirmware.version, currentVersion) > 0\n}\n\nfunction compareVersions(version1: string, version2: string): number {\n if (version1.includes(\".\") && version2.includes(\".\")) {\n const parts1 = version1.split(\".\")\n const parts2 = version2.split(\".\")\n const maxLen = Math.max(parts1.length, parts2.length)\n\n for (let i = 0; i < maxLen; i++) {\n const v1 = i < parts1.length ? parseInt(parts1[i], 10) : 0\n const v2 = i < parts2.length ? parseInt(parts2[i], 10) : 0\n if (v1 !== v2) {\n return v1 - v2\n }\n }\n return 0\n }\n\n return version1.localeCompare(version2)\n}\n\nexport async function checkForOtaUpdate(\n otaVersionUrl: string,\n currentBuildNumber: string,\n currentMtkVersion?: string,\n currentBesVersion?: string,\n): Promise<OtaCheckResult> {\n try {\n console.log(\"OTA: Checking for OTA update - URL: \" + otaVersionUrl + \", current build: \" + currentBuildNumber)\n const versionJson = await fetchVersionInfo(otaVersionUrl)\n const latestVersionInfo = getLatestVersionInfo(versionJson)\n\n const apkUpdateAvailable = checkVersionUpdateAvailable(currentBuildNumber, versionJson)\n console.log(`OTA: APK update available: ${apkUpdateAvailable} (current: ${currentBuildNumber})`)\n\n const mtkPatch = findMatchingMtkPatch(versionJson?.mtk_patches, currentMtkVersion)\n const mtkUpdateAvailable = mtkPatch !== null\n if (!currentMtkVersion && versionJson?.mtk_patches?.length) {\n console.log(`OTA: MTK current version unknown - skipping MTK patch check`)\n }\n console.log(\n `OTA: MTK patch available: ${mtkUpdateAvailable ? \"yes\" : \"no\"} (current MTK: ${currentMtkVersion || \"unknown\"})`,\n )\n\n const besUpdateAvailable = checkBesUpdate(versionJson?.bes_firmware, currentBesVersion)\n console.log(`OTA: BES update available: ${besUpdateAvailable} (current BES: ${currentBesVersion || \"unknown\"})`)\n\n const updates: string[] = []\n if (apkUpdateAvailable) updates.push(\"apk\")\n if (mtkUpdateAvailable) updates.push(\"mtk\")\n if (besUpdateAvailable) updates.push(\"bes\")\n\n console.log(`OTA: OTA check result - updates available: ${updates.length > 0}, updates: [${updates.join(\", \")}]`)\n\n return {\n hasCheckCompleted: true,\n updateAvailable: updates.length > 0,\n latestVersionInfo,\n updates,\n mtkPatch,\n besVersion: versionJson?.bes_firmware?.version || null,\n }\n } catch (error) {\n console.error(\"Error checking for OTA update:\", error)\n return {\n hasCheckCompleted: false,\n updateAvailable: false,\n latestVersionInfo: null,\n updates: [],\n mtkPatch: null,\n besVersion: null,\n }\n }\n}\n\nexport async function checkCurrentGlassesForUpdate(\n options: OtaCheckCurrentGlassesOptions = {},\n): Promise<OtaCheckCurrentGlassesResult> {\n const {\n waitForBuildNumberMs = 0,\n waitForBesVersionMs = 5000,\n waitForMtkVersionMs = 2000,\n refreshVersionInfo = true,\n fixClockBeforeCheck = true,\n } = options\n\n if (!glassesConnectedNow()) {\n return emptyCheckResult(\"disconnected\")\n }\n\n if (refreshVersionInfo) {\n void BluetoothSdk.requestVersionInfo().catch((error) => {\n console.warn(\"OTA: Failed to request version_info from glasses:\", error)\n })\n }\n\n let buildNumber = useGlassesStore.getState().buildNumber\n if (!buildNumber && waitForBuildNumberMs > 0) {\n await waitForGlassesState(\"buildNumber\", (value) => !!value, waitForBuildNumberMs)\n buildNumber = useGlassesStore.getState().buildNumber\n }\n\n if (!buildNumber) {\n return emptyCheckResult(\"missing_build\")\n }\n\n if (!glassesConnectedNow()) {\n return emptyCheckResult(\"disconnected\")\n }\n\n let besFirmwareVersion = useGlassesStore.getState().besFirmwareVersion\n if (!besFirmwareVersion && waitForBesVersionMs > 0) {\n console.log(\"OTA: BES version still unknown - waiting up to 5s for it to arrive...\")\n await waitForGlassesState(\"besFirmwareVersion\", (value) => !!value, waitForBesVersionMs)\n besFirmwareVersion = useGlassesStore.getState().besFirmwareVersion\n if (besFirmwareVersion) {\n console.log(`OTA: BES version arrived: ${besFirmwareVersion}`)\n } else {\n console.log(\"OTA: BES version still unknown after extended wait - will assume BES update if published\")\n }\n }\n\n if (!glassesConnectedNow()) {\n return emptyCheckResult(\"disconnected\")\n }\n\n let mtkFirmwareVersion = useGlassesStore.getState().mtkFirmwareVersion\n if (!mtkFirmwareVersion && waitForMtkVersionMs > 0) {\n await waitForGlassesState(\"mtkFirmwareVersion\", (value) => !!value, waitForMtkVersionMs)\n mtkFirmwareVersion = useGlassesStore.getState().mtkFirmwareVersion\n }\n\n if (!glassesConnectedNow()) {\n return emptyCheckResult(\"disconnected\")\n }\n\n if (fixClockBeforeCheck) {\n const systemTimeMs = getGlassesSystemTimeMs()\n await maybeFixGlassesClockFromVersionInfo(systemTimeMs > 0 ? systemTimeMs : undefined).catch((error) => {\n console.warn(\"OTA: clock fix attempt failed; continuing OTA check\", error)\n })\n }\n\n const manifestUrl = getAsgOtaVersionUrl(useGlassesStore.getState().otaVersionUrl, buildNumber)\n const result = await checkForOtaUpdate(manifestUrl, buildNumber, mtkFirmwareVersion, besFirmwareVersion)\n\n if (!result.hasCheckCompleted) {\n return {\n ...result,\n updateInfo: null,\n isRequired: true,\n manifestUrl,\n buildNumber,\n mtkFirmwareVersion,\n besFirmwareVersion,\n }\n }\n\n const mtkUpdatedThisSession = useGlassesStore.getState().mtkUpdatedThisSession\n let filteredUpdates = result.updates\n if (mtkUpdatedThisSession && filteredUpdates.includes(\"mtk\")) {\n console.log(\"OTA: Filtering out MTK - already updated this session (pending reboot)\")\n filteredUpdates = filteredUpdates.filter((update) => update !== \"mtk\")\n }\n\n // Pre-migration parity: an update is only surfaced when the manifest also\n // carries APK version metadata. A firmware-only manifest (mtk_patches /\n // bes_firmware with no APK entry) is therefore dropped here — same as the\n // legacy host check. Loud-log it so the case is visible in the field;\n // surfacing firmware-only updates is a deliberate behavior change to make\n // separately, not silently inside the boundary migration.\n if (filteredUpdates.length > 0 && !result.latestVersionInfo) {\n console.warn(\n `OTA: manifest lists updates [${filteredUpdates.join(\", \")}] but has no APK version metadata - ` +\n \"reporting no update (legacy behavior)\",\n )\n }\n const updateAvailable = filteredUpdates.length > 0 && !!result.latestVersionInfo\n const updateInfo = updateAvailable\n ? {\n available: true,\n versionCode: result.latestVersionInfo?.versionCode || 0,\n versionName: result.latestVersionInfo?.versionName || \"\",\n updates: filteredUpdates,\n totalSize: 0,\n }\n : null\n\n useGlassesStore.getState().setOtaUpdateAvailable(updateInfo)\n\n return {\n ...result,\n updateAvailable,\n updates: filteredUpdates,\n updateInfo,\n isRequired: result.latestVersionInfo?.isRequired !== false,\n manifestUrl,\n buildNumber,\n mtkFirmwareVersion,\n besFirmwareVersion,\n }\n}\n"]}
@@ -0,0 +1,80 @@
1
+ /**
2
+ * PairingIdentity — the pairing-identity lifecycle, reified. The two-phase
3
+ * identity rules (see the pending/default group in stores/settings.ts) exist
4
+ * as a three-state machine over the identity settings keys:
5
+ *
6
+ * none ──markPendingSelection()──▶ pending ──native promotion──▶ paired
7
+ * ▲ │
8
+ * └───────boot demotion────────┘
9
+ *
10
+ * - `none` — no model ever selected: hosts route to model selection.
11
+ * - `pending` — a model was CHOSEN (the one JS-owned identity write, made at
12
+ * scan entry) but pairing never completed: hosts render
13
+ * finish-pairing affordances.
14
+ * - `paired` — the native layer promoted the identity at pairing success
15
+ * (handleDeviceReady) and echoed it down via save_setting:
16
+ * hosts render the device card / connect surfaces.
17
+ *
18
+ * Projection law, mirroring native currentDefaultDevice() on both platforms:
19
+ * `paired` requires default_wearable AND device_name; device_address is
20
+ * optional. Two read-time alignments with the demotion's own write rules:
21
+ * - The simulated device is its own identity (its name mirrors the model at
22
+ * connectSimulated, and the boot demotion never touches it), so a simulated
23
+ * default_wearable projects as `paired` even without a device_name echo.
24
+ * - A non-simulated default_wearable WITHOUT a device_name is the orphan
25
+ * population `demoteOrphanedDefaultWearable` repairs into pending_wearable
26
+ * at boot; the projection already reads it as `pending` (a fresher
27
+ * pending_wearable wins, matching the demotion's latest-selection-wins
28
+ * backfill).
29
+ *
30
+ * JS-initiated identity writes live here and only here — the scan screen
31
+ * (markPendingSelection), the device-event router (promotion retires the
32
+ * pending marker), and the boot demotion (demoteDefaultToPending) invoke
33
+ * these methods instead of writing the raw keys. The router's generic
34
+ * save_setting persistence is the inbound native→JS echo leg, not a
35
+ * JS-initiated write, and stays with the router.
36
+ */
37
+ import { type AsyncResult } from "typesafe-ts";
38
+ export type IdentitySnapshot = {
39
+ kind: "none";
40
+ } | {
41
+ kind: "pending";
42
+ model: string;
43
+ } | {
44
+ kind: "paired";
45
+ model: string;
46
+ name: string;
47
+ address?: string;
48
+ };
49
+ /** Project the identity settings keys into the lifecycle snapshot. */
50
+ export declare function projectPairingIdentity(): IdentitySnapshot;
51
+ /**
52
+ * Subscribe to identity changes, deduped on the projected snapshot (same
53
+ * style as glasses.onStatus): the settings store updates on many keys; the
54
+ * callback fires only when the identity snapshot actually changes.
55
+ */
56
+ export declare function subscribePairingIdentity(cb: (identity: IdentitySnapshot) => void): () => void;
57
+ /**
58
+ * Selection: mark the model the user chose as the PENDING wearable (written
59
+ * at scan entry). Promotion to `paired` only ever happens natively at pairing
60
+ * success. The marker persists so an abandoned selection still renders its
61
+ * finish-pairing card after an app restart.
62
+ */
63
+ export declare function markPendingSelection(model: string): AsyncResult<void, Error>;
64
+ /**
65
+ * Promotion retires the selection: when the native layer promotes the default
66
+ * wearable at pairing success and its save_setting echo lands, the pending
67
+ * marker has served its purpose. Invoked by DeviceEventRouter for every echo;
68
+ * a no-op for other keys, empty promotions, and an already-clear marker.
69
+ */
70
+ export declare function retirePendingSelectionOnPromotion(echoedKey: string, echoedValue: unknown): Promise<void>;
71
+ /**
72
+ * Demotion: turn an orphaned default identity back into a pending selection.
73
+ * The guards (hydration, the native default-device read, link-layer state)
74
+ * live with the boot repair in demoteOrphanedDefaultWearable — this is only
75
+ * the identity write set: backfill the pending marker unless a fresher
76
+ * selection already holds it (the user's LATEST selection wins), then clear
77
+ * the promoted identity triplet.
78
+ */
79
+ export declare function demoteDefaultToPending(model: string): Promise<void>;
80
+ //# sourceMappingURL=PairingIdentity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PairingIdentity.d.ts","sourceRoot":"","sources":["../../src/services/PairingIdentity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,OAAO,EAAgB,KAAK,WAAW,EAAC,MAAM,aAAa,CAAA;AAK3D,MAAM,MAAM,gBAAgB,GACxB;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,GACd;IAAC,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,GAChC;IAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAC,CAAA;AAUnE,sEAAsE;AACtE,wBAAgB,sBAAsB,IAAI,gBAAgB,CAezD;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,GAAG,MAAM,IAAI,CAS7F;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAgB5E;AAED;;;;;GAKG;AACH,wBAAsB,iCAAiC,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ9G;AAED;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBzE"}
@@ -0,0 +1,145 @@
1
+ /**
2
+ * PairingIdentity — the pairing-identity lifecycle, reified. The two-phase
3
+ * identity rules (see the pending/default group in stores/settings.ts) exist
4
+ * as a three-state machine over the identity settings keys:
5
+ *
6
+ * none ──markPendingSelection()──▶ pending ──native promotion──▶ paired
7
+ * ▲ │
8
+ * └───────boot demotion────────┘
9
+ *
10
+ * - `none` — no model ever selected: hosts route to model selection.
11
+ * - `pending` — a model was CHOSEN (the one JS-owned identity write, made at
12
+ * scan entry) but pairing never completed: hosts render
13
+ * finish-pairing affordances.
14
+ * - `paired` — the native layer promoted the identity at pairing success
15
+ * (handleDeviceReady) and echoed it down via save_setting:
16
+ * hosts render the device card / connect surfaces.
17
+ *
18
+ * Projection law, mirroring native currentDefaultDevice() on both platforms:
19
+ * `paired` requires default_wearable AND device_name; device_address is
20
+ * optional. Two read-time alignments with the demotion's own write rules:
21
+ * - The simulated device is its own identity (its name mirrors the model at
22
+ * connectSimulated, and the boot demotion never touches it), so a simulated
23
+ * default_wearable projects as `paired` even without a device_name echo.
24
+ * - A non-simulated default_wearable WITHOUT a device_name is the orphan
25
+ * population `demoteOrphanedDefaultWearable` repairs into pending_wearable
26
+ * at boot; the projection already reads it as `pending` (a fresher
27
+ * pending_wearable wins, matching the demotion's latest-selection-wins
28
+ * backfill).
29
+ *
30
+ * JS-initiated identity writes live here and only here — the scan screen
31
+ * (markPendingSelection), the device-event router (promotion retires the
32
+ * pending marker), and the boot demotion (demoteDefaultToPending) invoke
33
+ * these methods instead of writing the raw keys. The router's generic
34
+ * save_setting persistence is the inbound native→JS echo leg, not a
35
+ * JS-initiated write, and stays with the router.
36
+ */
37
+ import { result as Res } from "typesafe-ts";
38
+ import { useSettingsStore, SETTINGS } from "../stores/settings";
39
+ import { DeviceTypes } from "../types";
40
+ // Identity keys hold model/name strings; anything else (legacy null, a stray
41
+ // non-string) reads as absent, matching native currentDefaultDevice()'s
42
+ // blank checks.
43
+ function readIdentityString(key) {
44
+ const value = useSettingsStore.getState().getSetting(key);
45
+ return typeof value === "string" ? value : "";
46
+ }
47
+ /** Project the identity settings keys into the lifecycle snapshot. */
48
+ export function projectPairingIdentity() {
49
+ const model = readIdentityString(SETTINGS.default_wearable.key);
50
+ const name = readIdentityString(SETTINGS.device_name.key);
51
+ if (model && name) {
52
+ const address = readIdentityString(SETTINGS.device_address.key);
53
+ return address ? { kind: "paired", model, name, address } : { kind: "paired", model, name };
54
+ }
55
+ if (model && model.includes(DeviceTypes.SIMULATED)) {
56
+ return { kind: "paired", model, name: model };
57
+ }
58
+ const pending = readIdentityString(SETTINGS.pending_wearable.key);
59
+ if (pending)
60
+ return { kind: "pending", model: pending };
61
+ if (model)
62
+ return { kind: "pending", model };
63
+ return { kind: "none" };
64
+ }
65
+ /**
66
+ * Subscribe to identity changes, deduped on the projected snapshot (same
67
+ * style as glasses.onStatus): the settings store updates on many keys; the
68
+ * callback fires only when the identity snapshot actually changes.
69
+ */
70
+ export function subscribePairingIdentity(cb) {
71
+ let last = JSON.stringify(projectPairingIdentity());
72
+ return useSettingsStore.subscribe(() => {
73
+ const snap = projectPairingIdentity();
74
+ const key = JSON.stringify(snap);
75
+ if (key === last)
76
+ return;
77
+ last = key;
78
+ cb(snap);
79
+ });
80
+ }
81
+ /**
82
+ * Selection: mark the model the user chose as the PENDING wearable (written
83
+ * at scan entry). Promotion to `paired` only ever happens natively at pairing
84
+ * success. The marker persists so an abandoned selection still renders its
85
+ * finish-pairing card after an app restart.
86
+ */
87
+ export function markPendingSelection(model) {
88
+ // Guard the public write-path: an empty/whitespace model would persist a
89
+ // pending identity that renders a blank finish-pairing card.
90
+ const trimmed = typeof model === "string" ? model.trim() : "";
91
+ if (!trimmed) {
92
+ console.warn(`PairingIdentity: ignoring pending selection with empty model (got ${JSON.stringify(model)})`);
93
+ return Res.try_async(async () => { });
94
+ }
95
+ console.log(`PairingIdentity: pending selection -> "${trimmed}"`);
96
+ const result = useSettingsStore.getState().setSetting(SETTINGS.pending_wearable.key, trimmed);
97
+ // setSetting resolves to a Result (never rejects); a persist failure would
98
+ // silently drop the finish-pairing affordance on restart — surface it.
99
+ void Promise.resolve(result).then((r) => {
100
+ if (r.is_error())
101
+ console.warn("PairingIdentity: pending selection failed to persist:", r.error);
102
+ });
103
+ return result;
104
+ }
105
+ /**
106
+ * Promotion retires the selection: when the native layer promotes the default
107
+ * wearable at pairing success and its save_setting echo lands, the pending
108
+ * marker has served its purpose. Invoked by DeviceEventRouter for every echo;
109
+ * a no-op for other keys, empty promotions, and an already-clear marker.
110
+ */
111
+ export async function retirePendingSelectionOnPromotion(echoedKey, echoedValue) {
112
+ if (echoedKey !== SETTINGS.default_wearable.key || !echoedValue)
113
+ return;
114
+ const settings = useSettingsStore.getState();
115
+ const pending = settings.getSetting(SETTINGS.pending_wearable.key);
116
+ if (pending) {
117
+ console.log(`PairingIdentity: promotion "${String(echoedValue)}" retires pending "${pending}"`);
118
+ await settings.setSetting(SETTINGS.pending_wearable.key, "");
119
+ }
120
+ }
121
+ /**
122
+ * Demotion: turn an orphaned default identity back into a pending selection.
123
+ * The guards (hydration, the native default-device read, link-layer state)
124
+ * live with the boot repair in demoteOrphanedDefaultWearable — this is only
125
+ * the identity write set: backfill the pending marker unless a fresher
126
+ * selection already holds it (the user's LATEST selection wins), then clear
127
+ * the promoted identity triplet.
128
+ */
129
+ export async function demoteDefaultToPending(model) {
130
+ const settings = useSettingsStore.getState();
131
+ // readIdentityString, not raw getSetting: a truthy non-string legacy value
132
+ // must read as absent here too, or the orphaned model is never backfilled
133
+ // while the projection reads the same junk as no pending at all.
134
+ const fresher = readIdentityString(SETTINGS.pending_wearable.key);
135
+ console.log(fresher
136
+ ? `PairingIdentity: demote "${model}" — fresher pending "${fresher}" kept`
137
+ : `PairingIdentity: demote "${model}" -> pending`);
138
+ if (!fresher) {
139
+ await settings.setSetting(SETTINGS.pending_wearable.key, model);
140
+ }
141
+ await settings.setSetting(SETTINGS.default_wearable.key, "");
142
+ await settings.setSetting(SETTINGS.device_name.key, "");
143
+ await settings.setSetting(SETTINGS.device_address.key, "");
144
+ }
145
+ //# sourceMappingURL=PairingIdentity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PairingIdentity.js","sourceRoot":"","sources":["../../src/services/PairingIdentity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,OAAO,EAAC,MAAM,IAAI,GAAG,EAAmB,MAAM,aAAa,CAAA;AAE3D,OAAO,EAAC,gBAAgB,EAAE,QAAQ,EAAC,MAAM,oBAAoB,CAAA;AAC7D,OAAO,EAAC,WAAW,EAAC,MAAM,UAAU,CAAA;AAOpC,6EAA6E;AAC7E,wEAAwE;AACxE,gBAAgB;AAChB,SAAS,kBAAkB,CAAC,GAAW;IACrC,MAAM,KAAK,GAAG,gBAAgB,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;IACzD,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;AAC/C,CAAC;AAED,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AAC,cAAc,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AAC5D,CAAC","sourcesContent":["/**\n * PairingIdentity — the pairing-identity lifecycle, reified. The two-phase\n * identity rules (see the pending/default group in stores/settings.ts) exist\n * as a three-state machine over the identity settings keys:\n *\n * none ──markPendingSelection()──▶ pending ──native promotion──▶ paired\n * ▲ │\n * └───────boot demotion────────┘\n *\n * - `none` — no model ever selected: hosts route to model selection.\n * - `pending` — a model was CHOSEN (the one JS-owned identity write, made at\n * scan entry) but pairing never completed: hosts render\n * finish-pairing affordances.\n * - `paired` — the native layer promoted the identity at pairing success\n * (handleDeviceReady) and echoed it down via save_setting:\n * hosts render the device card / connect surfaces.\n *\n * Projection law, mirroring native currentDefaultDevice() on both platforms:\n * `paired` requires default_wearable AND device_name; device_address is\n * optional. Two read-time alignments with the demotion's own write rules:\n * - The simulated device is its own identity (its name mirrors the model at\n * connectSimulated, and the boot demotion never touches it), so a simulated\n * default_wearable projects as `paired` even without a device_name echo.\n * - A non-simulated default_wearable WITHOUT a device_name is the orphan\n * population `demoteOrphanedDefaultWearable` repairs into pending_wearable\n * at boot; the projection already reads it as `pending` (a fresher\n * pending_wearable wins, matching the demotion's latest-selection-wins\n * backfill).\n *\n * JS-initiated identity writes live here and only here — the scan screen\n * (markPendingSelection), the device-event router (promotion retires the\n * pending marker), and the boot demotion (demoteDefaultToPending) invoke\n * these methods instead of writing the raw keys. The router's generic\n * save_setting persistence is the inbound native→JS echo leg, not a\n * JS-initiated write, and stays with the router.\n */\nimport {result as Res, type AsyncResult} from \"typesafe-ts\"\n\nimport {useSettingsStore, SETTINGS} from \"../stores/settings\"\nimport {DeviceTypes} from \"../types\"\n\nexport type IdentitySnapshot =\n | {kind: \"none\"}\n | {kind: \"pending\"; model: string}\n | {kind: \"paired\"; model: string; name: string; address?: string}\n\n// Identity keys hold model/name strings; anything else (legacy null, a stray\n// non-string) reads as absent, matching native currentDefaultDevice()'s\n// blank checks.\nfunction readIdentityString(key: string): string {\n const value = useSettingsStore.getState().getSetting(key)\n return typeof value === \"string\" ? value : \"\"\n}\n\n/** Project the identity settings keys into the lifecycle snapshot. */\nexport function projectPairingIdentity(): IdentitySnapshot {\n const model = readIdentityString(SETTINGS.default_wearable.key)\n const name = readIdentityString(SETTINGS.device_name.key)\n\n if (model && name) {\n const address = readIdentityString(SETTINGS.device_address.key)\n return address ? {kind: \"paired\", model, name, address} : {kind: \"paired\", model, name}\n }\n if (model && model.includes(DeviceTypes.SIMULATED)) {\n return {kind: \"paired\", model, name: model}\n }\n const pending = readIdentityString(SETTINGS.pending_wearable.key)\n if (pending) return {kind: \"pending\", model: pending}\n if (model) return {kind: \"pending\", model}\n return {kind: \"none\"}\n}\n\n/**\n * Subscribe to identity changes, deduped on the projected snapshot (same\n * style as glasses.onStatus): the settings store updates on many keys; the\n * callback fires only when the identity snapshot actually changes.\n */\nexport function subscribePairingIdentity(cb: (identity: IdentitySnapshot) => void): () => void {\n let last = JSON.stringify(projectPairingIdentity())\n return useSettingsStore.subscribe(() => {\n const snap = projectPairingIdentity()\n const key = JSON.stringify(snap)\n if (key === last) return\n last = key\n cb(snap)\n })\n}\n\n/**\n * Selection: mark the model the user chose as the PENDING wearable (written\n * at scan entry). Promotion to `paired` only ever happens natively at pairing\n * success. The marker persists so an abandoned selection still renders its\n * finish-pairing card after an app restart.\n */\nexport function markPendingSelection(model: string): AsyncResult<void, Error> {\n // Guard the public write-path: an empty/whitespace model would persist a\n // pending identity that renders a blank finish-pairing card.\n const trimmed = typeof model === \"string\" ? model.trim() : \"\"\n if (!trimmed) {\n console.warn(`PairingIdentity: ignoring pending selection with empty model (got ${JSON.stringify(model)})`)\n return Res.try_async(async () => {})\n }\n console.log(`PairingIdentity: pending selection -> \"${trimmed}\"`)\n const result = useSettingsStore.getState().setSetting(SETTINGS.pending_wearable.key, trimmed)\n // setSetting resolves to a Result (never rejects); a persist failure would\n // silently drop the finish-pairing affordance on restart — surface it.\n void Promise.resolve(result).then((r) => {\n if (r.is_error()) console.warn(\"PairingIdentity: pending selection failed to persist:\", r.error)\n })\n return result\n}\n\n/**\n * Promotion retires the selection: when the native layer promotes the default\n * wearable at pairing success and its save_setting echo lands, the pending\n * marker has served its purpose. Invoked by DeviceEventRouter for every echo;\n * a no-op for other keys, empty promotions, and an already-clear marker.\n */\nexport async function retirePendingSelectionOnPromotion(echoedKey: string, echoedValue: unknown): Promise<void> {\n if (echoedKey !== SETTINGS.default_wearable.key || !echoedValue) return\n const settings = useSettingsStore.getState()\n const pending = settings.getSetting(SETTINGS.pending_wearable.key)\n if (pending) {\n console.log(`PairingIdentity: promotion \"${String(echoedValue)}\" retires pending \"${pending}\"`)\n await settings.setSetting(SETTINGS.pending_wearable.key, \"\")\n }\n}\n\n/**\n * Demotion: turn an orphaned default identity back into a pending selection.\n * The guards (hydration, the native default-device read, link-layer state)\n * live with the boot repair in demoteOrphanedDefaultWearable — this is only\n * the identity write set: backfill the pending marker unless a fresher\n * selection already holds it (the user's LATEST selection wins), then clear\n * the promoted identity triplet.\n */\nexport async function demoteDefaultToPending(model: string): Promise<void> {\n const settings = useSettingsStore.getState()\n // readIdentityString, not raw getSetting: a truthy non-string legacy value\n // must read as absent here too, or the orphaned model is never backfilled\n // while the projection reads the same junk as no pending at all.\n const fresher = readIdentityString(SETTINGS.pending_wearable.key)\n console.log(\n fresher\n ? `PairingIdentity: demote \"${model}\" — fresher pending \"${fresher}\" kept`\n : `PairingIdentity: demote \"${model}\" -> pending`,\n )\n if (!fresher) {\n await settings.setSetting(SETTINGS.pending_wearable.key, model)\n }\n await settings.setSetting(SETTINGS.default_wearable.key, \"\")\n await settings.setSetting(SETTINGS.device_name.key, \"\")\n await settings.setSetting(SETTINGS.device_address.key, \"\")\n}\n"]}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Phone location service — engine-owned. Owns the background phone-GPS task: the
3
+ * accuracy-tier control (`setLocationTier`), the accuracy mapping, and the
4
+ * `expo-task-manager` background task that fans each fix to the v2 cloud
5
+ * local miniapps (`location_update`). Cloud upload was V1 (removed).
6
+ *
7
+ * This used to be the host-injected `locationTier` runtime hook + a MantleManager
8
+ * `TaskManager.defineTask`. It's device/OS plumbing (no UI), so it moved into engine:
9
+ * the runtime drives `setLocationTier` directly off miniapp demand, and any host —
10
+ * including a bare OEM — gets phone location without wiring a hook. The host keeps the
11
+ * permission *UI* (it gates `setLocationTier` on the OS permission before calling).
12
+ *
13
+ * The task is registered at module load (the export from `index.ts` evaluates this
14
+ * file as soon as `@mentra/engine` is imported), matching the old MantleManager
15
+ * top-level `defineTask` timing — including on a headless background relaunch.
16
+ */
17
+ import * as Location from "expo-location";
18
+ export declare const LOCATION_TASK_NAME = "handleLocationUpdates";
19
+ /** Map a MentraOS location tier/accuracy string to an expo-location accuracy. */
20
+ export declare function getLocationAccuracy(accuracy: string | undefined): Location.LocationAccuracy;
21
+ /**
22
+ * Apply a location tier (the aggregate of what miniapps request). "off" means no app
23
+ * is asking — stop the task so the OS can power GPS down; anything else (re)starts the
24
+ * background task at the matching accuracy. Callers gate this on the OS location
25
+ * permission (host UI concern).
26
+ */
27
+ export declare function setLocationTier(tier: "off" | "passive" | "low" | "high" | "realtime" | string): Promise<void>;
28
+ /** Stop the background location task (host cleanup). */
29
+ export declare function stopPhoneLocation(): void;
30
+ export declare const phoneLocationService: {
31
+ LOCATION_TASK_NAME: string;
32
+ getLocationAccuracy: typeof getLocationAccuracy;
33
+ setLocationTier: typeof setLocationTier;
34
+ stopPhoneLocation: typeof stopPhoneLocation;
35
+ };
36
+ //# sourceMappingURL=PhoneLocationService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PhoneLocationService.d.ts","sourceRoot":"","sources":["../../src/services/PhoneLocationService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AAKzC,eAAO,MAAM,kBAAkB,0BAA0B,CAAA;AA8BzD,iFAAiF;AACjF,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC,gBAAgB,CA4B3F;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAC7D,OAAO,CAAC,IAAI,CAAC,CAmBf;AAED,wDAAwD;AACxD,wBAAgB,iBAAiB,IAAI,IAAI,CAExC;AAED,eAAO,MAAM,oBAAoB;;;;;CAKhC,CAAA"}
@@ -0,0 +1,115 @@
1
+ /**
2
+ * Phone location service — engine-owned. Owns the background phone-GPS task: the
3
+ * accuracy-tier control (`setLocationTier`), the accuracy mapping, and the
4
+ * `expo-task-manager` background task that fans each fix to the v2 cloud
5
+ * local miniapps (`location_update`). Cloud upload was V1 (removed).
6
+ *
7
+ * This used to be the host-injected `locationTier` runtime hook + a MantleManager
8
+ * `TaskManager.defineTask`. It's device/OS plumbing (no UI), so it moved into engine:
9
+ * the runtime drives `setLocationTier` directly off miniapp demand, and any host —
10
+ * including a bare OEM — gets phone location without wiring a hook. The host keeps the
11
+ * permission *UI* (it gates `setLocationTier` on the OS permission before calling).
12
+ *
13
+ * The task is registered at module load (the export from `index.ts` evaluates this
14
+ * file as soon as `@mentra/engine` is imported), matching the old MantleManager
15
+ * top-level `defineTask` timing — including on a headless background relaunch.
16
+ */
17
+ import * as Location from "expo-location";
18
+ import * as TaskManager from "expo-task-manager";
19
+ import localMiniappRuntime from "./LocalMiniappRuntime";
20
+ export const LOCATION_TASK_NAME = "handleLocationUpdates";
21
+ // Background location task — sends each fix to the v2 cloud (RestComms) + local
22
+ // miniapps. (The v1 SocketComms leg was already removed/commented before the move.)
23
+ TaskManager.defineTask(LOCATION_TASK_NAME, async ({ data, error }) => {
24
+ if (error) {
25
+ // OS-level failure (permission revoked, GPS unavailable, …) — log it so
26
+ // background location dropouts are diagnosable.
27
+ console.warn("ISLAND: LOCATION: background task error:", error);
28
+ return;
29
+ }
30
+ const locs = data?.locations ?? [];
31
+ if (locs.length === 0) {
32
+ console.log("ISLAND: LOCATION: No locations received");
33
+ return;
34
+ }
35
+ const first = locs[0];
36
+ // Cloud path (relayMessageToApps) never reaches __phone__, so local miniapps rely
37
+ // on this direct push.
38
+ // Local miniapps get the update directly (the cloud relay never reaches
39
+ // __phone__). The Cloud V1 upload that used to run here was removed with the
40
+ // V1 ripout (issue #3392); a V2 location channel is separate product work.
41
+ localMiniappRuntime.forwardEvent("location_update", {
42
+ lat: first.coords.latitude,
43
+ lng: first.coords.longitude,
44
+ accuracy: first.coords.accuracy ?? undefined,
45
+ timestamp: first.timestamp,
46
+ });
47
+ });
48
+ /** Map a MentraOS location tier/accuracy string to an expo-location accuracy. */
49
+ export function getLocationAccuracy(accuracy) {
50
+ switch (accuracy) {
51
+ // Aggregate miniapp tiers (LocalMiniappRuntime.recomputeLocation → "passive" |
52
+ // "low" | "high" | "realtime"). Previously only "realtime" mapped; "passive"/"low"/
53
+ // "high" fell through to Lowest, so a miniapp asking for high-rate GPS got the
54
+ // coarsest accuracy.
55
+ case "realtime":
56
+ return Location.LocationAccuracy.BestForNavigation;
57
+ case "high":
58
+ return Location.LocationAccuracy.High;
59
+ case "low":
60
+ return Location.LocationAccuracy.Low;
61
+ case "passive":
62
+ return Location.LocationAccuracy.Lowest;
63
+ // Accuracy-string vocabulary (persisted location_tier setting / boot path).
64
+ case "tenMeters":
65
+ return Location.LocationAccuracy.High;
66
+ case "hundredMeters":
67
+ return Location.LocationAccuracy.Balanced;
68
+ case "kilometer":
69
+ return Location.LocationAccuracy.Low;
70
+ case "threeKilometers":
71
+ return Location.LocationAccuracy.Lowest;
72
+ case "reduced":
73
+ return Location.LocationAccuracy.Lowest;
74
+ default:
75
+ return Location.LocationAccuracy.Lowest;
76
+ }
77
+ }
78
+ /**
79
+ * Apply a location tier (the aggregate of what miniapps request). "off" means no app
80
+ * is asking — stop the task so the OS can power GPS down; anything else (re)starts the
81
+ * background task at the matching accuracy. Callers gate this on the OS location
82
+ * permission (host UI concern).
83
+ */
84
+ export async function setLocationTier(tier) {
85
+ console.log("ISLAND: setLocationTier()", tier);
86
+ try {
87
+ const isRegistered = await Location.hasStartedLocationUpdatesAsync(LOCATION_TASK_NAME).catch(() => false);
88
+ if (isRegistered) {
89
+ await Location.stopLocationUpdatesAsync(LOCATION_TASK_NAME);
90
+ }
91
+ if (tier === "off") {
92
+ console.log("ISLAND: setLocationTier() stopped — no active subscribers");
93
+ return;
94
+ }
95
+ await Location.startLocationUpdatesAsync(LOCATION_TASK_NAME, {
96
+ accuracy: getLocationAccuracy(tier),
97
+ pausesUpdatesAutomatically: false,
98
+ });
99
+ console.log("ISLAND: setLocationTier() success —", tier);
100
+ }
101
+ catch (error) {
102
+ console.log("ISLAND: Error setting location tier", error);
103
+ }
104
+ }
105
+ /** Stop the background location task (host cleanup). */
106
+ export function stopPhoneLocation() {
107
+ Location.stopLocationUpdatesAsync(LOCATION_TASK_NAME).catch(() => { });
108
+ }
109
+ export const phoneLocationService = {
110
+ LOCATION_TASK_NAME,
111
+ getLocationAccuracy,
112
+ setLocationTier,
113
+ stopPhoneLocation,
114
+ };
115
+ //# sourceMappingURL=PhoneLocationService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PhoneLocationService.js","sourceRoot":"","sources":["../../src/services/PhoneLocationService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAA;AAEhD,OAAO,mBAAmB,MAAM,uBAAuB,CAAA;AAEvD,MAAM,CAAC,MAAM,kBAAkB,GAAG,uBAAuB,CAAA;AAEzD,gFAAgF;AAChF,oFAAoF;AACpF,WAAW,CAAC,UAAU,CAA0C,kBAAkB,EAAE,KAAK,EAAE,EAAC,IAAI,EAAE,KAAK,EAAC,EAAE,EAAE;IAC1G,IAAI,KAAK,EAAE,CAAC;QACV,wEAAw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,wBAAwB,CAAC,kBAAkB,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;AACvE,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,kBAAkB;IAClB,mBAAmB;IACnB,eAAe;IACf,iBAAiB;CAClB,CAAA","sourcesContent":["/**\n * Phone location service — engine-owned. Owns the background phone-GPS task: the\n * accuracy-tier control (`setLocationTier`), the accuracy mapping, and the\n * `expo-task-manager` background task that fans each fix to the v2 cloud\n * local miniapps (`location_update`). Cloud upload was V1 (removed).\n *\n * This used to be the host-injected `locationTier` runtime hook + a MantleManager\n * `TaskManager.defineTask`. It's device/OS plumbing (no UI), so it moved into engine:\n * the runtime drives `setLocationTier` directly off miniapp demand, and any host —\n * including a bare OEM — gets phone location without wiring a hook. The host keeps the\n * permission *UI* (it gates `setLocationTier` on the OS permission before calling).\n *\n * The task is registered at module load (the export from `index.ts` evaluates this\n * file as soon as `@mentra/engine` is imported), matching the old MantleManager\n * top-level `defineTask` timing — including on a headless background relaunch.\n */\nimport * as Location from \"expo-location\"\nimport * as TaskManager from \"expo-task-manager\"\n\nimport localMiniappRuntime from \"./LocalMiniappRuntime\"\n\nexport const LOCATION_TASK_NAME = \"handleLocationUpdates\"\n\n// Background location task — sends each fix to the v2 cloud (RestComms) + local\n// miniapps. (The v1 SocketComms leg was already removed/commented before the move.)\nTaskManager.defineTask<{locations?: Location.LocationObject[]}>(LOCATION_TASK_NAME, async ({data, error}) => {\n if (error) {\n // OS-level failure (permission revoked, GPS unavailable, …) — log it so\n // background location dropouts are diagnosable.\n console.warn(\"ISLAND: LOCATION: background task error:\", error)\n return\n }\n const locs = data?.locations ?? []\n if (locs.length === 0) {\n console.log(\"ISLAND: LOCATION: No locations received\")\n return\n }\n const first = locs[0]!\n // Cloud path (relayMessageToApps) never reaches __phone__, so local miniapps rely\n // on this direct push.\n // Local miniapps get the update directly (the cloud relay never reaches\n // __phone__). The Cloud V1 upload that used to run here was removed with the\n // V1 ripout (issue #3392); a V2 location channel is separate product work.\n localMiniappRuntime.forwardEvent(\"location_update\", {\n lat: first.coords.latitude,\n lng: first.coords.longitude,\n accuracy: first.coords.accuracy ?? undefined,\n timestamp: first.timestamp,\n })\n})\n\n/** Map a MentraOS location tier/accuracy string to an expo-location accuracy. */\nexport function getLocationAccuracy(accuracy: string | undefined): Location.LocationAccuracy {\n switch (accuracy) {\n // Aggregate miniapp tiers (LocalMiniappRuntime.recomputeLocation → \"passive\" |\n // \"low\" | \"high\" | \"realtime\"). Previously only \"realtime\" mapped; \"passive\"/\"low\"/\n // \"high\" fell through to Lowest, so a miniapp asking for high-rate GPS got the\n // coarsest accuracy.\n case \"realtime\":\n return Location.LocationAccuracy.BestForNavigation\n case \"high\":\n return Location.LocationAccuracy.High\n case \"low\":\n return Location.LocationAccuracy.Low\n case \"passive\":\n return Location.LocationAccuracy.Lowest\n // Accuracy-string vocabulary (persisted location_tier setting / boot path).\n case \"tenMeters\":\n return Location.LocationAccuracy.High\n case \"hundredMeters\":\n return Location.LocationAccuracy.Balanced\n case \"kilometer\":\n return Location.LocationAccuracy.Low\n case \"threeKilometers\":\n return Location.LocationAccuracy.Lowest\n case \"reduced\":\n return Location.LocationAccuracy.Lowest\n default:\n return Location.LocationAccuracy.Lowest\n }\n}\n\n/**\n * Apply a location tier (the aggregate of what miniapps request). \"off\" means no app\n * is asking — stop the task so the OS can power GPS down; anything else (re)starts the\n * background task at the matching accuracy. Callers gate this on the OS location\n * permission (host UI concern).\n */\nexport async function setLocationTier(\n tier: \"off\" | \"passive\" | \"low\" | \"high\" | \"realtime\" | string,\n): Promise<void> {\n console.log(\"ISLAND: setLocationTier()\", tier)\n try {\n const isRegistered = await Location.hasStartedLocationUpdatesAsync(LOCATION_TASK_NAME).catch(() => false)\n if (isRegistered) {\n await Location.stopLocationUpdatesAsync(LOCATION_TASK_NAME)\n }\n if (tier === \"off\") {\n console.log(\"ISLAND: setLocationTier() stopped — no active subscribers\")\n return\n }\n await Location.startLocationUpdatesAsync(LOCATION_TASK_NAME, {\n accuracy: getLocationAccuracy(tier),\n pausesUpdatesAutomatically: false,\n })\n console.log(\"ISLAND: setLocationTier() success —\", tier)\n } catch (error) {\n console.log(\"ISLAND: Error setting location tier\", error)\n }\n}\n\n/** Stop the background location task (host cleanup). */\nexport function stopPhoneLocation(): void {\n Location.stopLocationUpdatesAsync(LOCATION_TASK_NAME).catch(() => {})\n}\n\nexport const phoneLocationService = {\n LOCATION_TASK_NAME,\n getLocationAccuracy,\n setLocationTier,\n stopPhoneLocation,\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export declare function startPhoneNotificationsSync(): void;
2
+ export declare function stopPhoneNotificationsSync(): void;
3
+ //# sourceMappingURL=PhoneNotificationsSync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PhoneNotificationsSync.d.ts","sourceRoot":"","sources":["../../src/services/PhoneNotificationsSync.ts"],"names":[],"mappings":"AA2BA,wBAAgB,2BAA2B,IAAI,IAAI,CAWlD;AAED,wBAAgB,0BAA0B,IAAI,IAAI,CAGjD"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Phone-notifications sync — engine-owned. Pushes the notification-forwarding
3
+ * config (`notifications_enabled` + `notifications_blocklist`) to the native
4
+ * NotificationListener via `CrustModule.setNotificationConfig`, so
5
+ * `engine.phoneNotifications.setEnabled()/setBlocklist()` actually reach the
6
+ * listener for ANY host — not just the Mentra app, where this used to live in
7
+ * MantleManager. Android-only; a no-op elsewhere. Started by `engine.start()`.
8
+ */
9
+ import { shallow } from "zustand/shallow";
10
+ import CrustModule from "@mentra/crust";
11
+ import { useSettingsStore, SETTINGS } from "../stores/settings";
12
+ let unsubscribe = null;
13
+ function pushConfig() {
14
+ const s = useSettingsStore.getState();
15
+ const enabled = Boolean(s.getSetting(SETTINGS.notifications_enabled.key));
16
+ const blocklist = s.getSetting(SETTINGS.notifications_blocklist.key);
17
+ // Unconditional (matches the prior MantleManager sync) — the listener is
18
+ // Android-only, but CrustModule.setNotificationConfig is a safe no-op elsewhere;
19
+ // the Android-only gating lives on the facade's setEnabled/setBlocklist.
20
+ CrustModule.setNotificationConfig(enabled, Array.isArray(blocklist) ? blocklist : []).catch((err) => console.warn(`PhoneNotificationsSync: setNotificationConfig failed: ${err?.message ?? err}`));
21
+ }
22
+ export function startPhoneNotificationsSync() {
23
+ if (unsubscribe)
24
+ return;
25
+ pushConfig(); // initial sync so the listener has the current config
26
+ unsubscribe = useSettingsStore.subscribe((state) => ({
27
+ enabled: state.getSetting(SETTINGS.notifications_enabled.key),
28
+ blocklist: state.getSetting(SETTINGS.notifications_blocklist.key),
29
+ }), () => pushConfig(), { equalityFn: shallow });
30
+ }
31
+ export function stopPhoneNotificationsSync() {
32
+ unsubscribe?.();
33
+ unsubscribe = null;
34
+ }
35
+ //# sourceMappingURL=PhoneNotificationsSync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PhoneNotificationsSync.js","sourceRoot":"","sources":["../../src/services/PhoneNotificationsSync.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAC,OAAO,EAAC,MAAM,iBAAiB,CAAA;AACvC,OAAO,WAAW,MAAM,eAAe,CAAA;AAEvC,OAAO,EAAC,gBAAgB,EAAE,QAAQ,EAAC,MAAM,oBAAoB,CAAA;AAE7D,IAAI,WAAW,GAAwB,IAAI,CAAA;AAE3C,SAAS,UAAU;IACjB,MAAM,CAAC,GAAG,gBAAgB,CAAC,QAAQ,EAAE,CAAA;IACrC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAA;IACzE,MAAM,SAAS,GAAG,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAA;IACpE,yEAAyE;IACzE,iFAAiF;IACjF,yEAAyE;IACzE,WAAW,CAAC,qBAAqB,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE,CAC3G,OAAO,CAAC,IAAI,CAAC,yDAA0D,GAAa,EAAE,OAAO,IAAI,GAAG,EAAE,CAAC,CACxG,CAAA;AACH,CAAC;AAED,MAAM,UAAU,2BAA2B;IACzC,IAAI,WAAW;QAAE,OAAM;IACvB,UAAU,EAAE,CAAA,CAAC,sDAAsD;IACnE,WAAW,GAAG,gBAAgB,CAAC,SAAS,CACtC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACV,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,qBAAqB,CAAC,GAAG,CAAC;QAC7D,SAAS,EAAE,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,uBAAuB,CAAC,GAAG,CAAC;KAClE,CAAC,EACF,GAAG,EAAE,CAAC,UAAU,EAAE,EAClB,EAAC,UAAU,EAAE,OAAO,EAAC,CACtB,CAAA;AACH,CAAC;AAED,MAAM,UAAU,0BAA0B;IACxC,WAAW,EAAE,EAAE,CAAA;IACf,WAAW,GAAG,IAAI,CAAA;AACpB,CAAC","sourcesContent":["/**\n * Phone-notifications sync — engine-owned. Pushes the notification-forwarding\n * config (`notifications_enabled` + `notifications_blocklist`) to the native\n * NotificationListener via `CrustModule.setNotificationConfig`, so\n * `engine.phoneNotifications.setEnabled()/setBlocklist()` actually reach the\n * listener for ANY host — not just the Mentra app, where this used to live in\n * MantleManager. Android-only; a no-op elsewhere. Started by `engine.start()`.\n */\nimport {shallow} from \"zustand/shallow\"\nimport CrustModule from \"@mentra/crust\"\n\nimport {useSettingsStore, SETTINGS} from \"../stores/settings\"\n\nlet unsubscribe: (() => void) | null = null\n\nfunction pushConfig(): void {\n const s = useSettingsStore.getState()\n const enabled = Boolean(s.getSetting(SETTINGS.notifications_enabled.key))\n const blocklist = s.getSetting(SETTINGS.notifications_blocklist.key)\n // Unconditional (matches the prior MantleManager sync) — the listener is\n // Android-only, but CrustModule.setNotificationConfig is a safe no-op elsewhere;\n // the Android-only gating lives on the facade's setEnabled/setBlocklist.\n CrustModule.setNotificationConfig(enabled, Array.isArray(blocklist) ? blocklist : []).catch((err: unknown) =>\n console.warn(`PhoneNotificationsSync: setNotificationConfig failed: ${(err as Error)?.message ?? err}`),\n )\n}\n\nexport function startPhoneNotificationsSync(): void {\n if (unsubscribe) return\n pushConfig() // initial sync so the listener has the current config\n unsubscribe = useSettingsStore.subscribe(\n (state) => ({\n enabled: state.getSetting(SETTINGS.notifications_enabled.key),\n blocklist: state.getSetting(SETTINGS.notifications_blocklist.key),\n }),\n () => pushConfig(),\n {equalityFn: shallow},\n )\n}\n\nexport function stopPhoneNotificationsSync(): void {\n unsubscribe?.()\n unsubscribe = null\n}\n"]}
@@ -0,0 +1,86 @@
1
+ /**
2
+ * PhonePhotoCoordinator — owns local-miniapp takePhoto() end-to-end.
3
+ *
4
+ * Architecture:
5
+ * miniapp → SDK → LocalMiniappRuntime → photo runtime hook
6
+ * → coordinator.takePhoto(packageName, opts)
7
+ * ├── (precheck) glasses connected + hasCamera
8
+ * ├── cloudClientService.startManagedPhoto → {requestId, uploadUrl, readUrl} (cloud-v2 runtime presign)
9
+ * ├── BluetoothSdk.requestPhoto(requestId, size, uploadUrl, compress, sound)
10
+ * └── race:
11
+ * - cloudClientService.awaitManagedPhotoReady(requestId) resolves on photo.ready push
12
+ * - BluetoothSdk.requestPhoto rejects if terminal photo_response is an error
13
+ * - handlePhotoError(requestId, code, message) rejects if MantleManager observes
14
+ * the same BLE photo_response error before the native promise crosses the bridge
15
+ *
16
+ * `activeRequests` lets MantleManager's gated `photo_response` listener
17
+ * short-circuit our long-poll with a typed error (CAMERA_BUSY, BATTERY_LOW,
18
+ * etc.) instead of waiting 30s for cloud's timeout.
19
+ */
20
+ export interface PhotoOpts {
21
+ /** Legacy cloud size names are normalized before the native take_photo command. */
22
+ size?: "low" | "medium" | "high" | "max" | "small" | "large" | "full";
23
+ mode?: "photo" | "text";
24
+ compress?: "none" | "low" | "medium" | "high";
25
+ sound?: boolean;
26
+ saveToGallery?: boolean;
27
+ exposureTimeNs?: number;
28
+ }
29
+ export interface PhotoTaken {
30
+ photoUrl: string;
31
+ mimeType: string;
32
+ size: number;
33
+ requestId: string;
34
+ }
35
+ /** Pipeline stage a photo request failed at — surfaced to the miniapp so a dev
36
+ * sees exactly where it broke, not just a flattened message. */
37
+ export type PhotoStage = "presign" | "command" | "capture" | "upload" | "push";
38
+ /** Transport in play at the point of failure. */
39
+ export type PhotoTransport = "cloud-rest" | "ble" | "wifi" | "ws";
40
+ export declare class PhotoError extends Error {
41
+ readonly code: string;
42
+ readonly stage?: PhotoStage | undefined;
43
+ readonly transport?: PhotoTransport | undefined;
44
+ constructor(code: string, message: string, stage?: PhotoStage | undefined, transport?: PhotoTransport | undefined);
45
+ }
46
+ /**
47
+ * Last-resort ceiling for the complete capture + encode + transfer + upload
48
+ * pipeline. This must exceed the managed-photo service's 30s ready-push
49
+ * timeout so the cloud can return its more specific failure first.
50
+ *
51
+ * Text mode commonly spends several seconds detecting/cropping the region and
52
+ * can take another 10s+ to transfer over BLE. A 15s ceiling incorrectly
53
+ * rejected successful captures while their upload was still in progress.
54
+ */
55
+ export declare const CAPTURE_PIPELINE_TIMEOUT_MS = 45000;
56
+ export declare class PhonePhotoCoordinator {
57
+ private readonly activeRequests;
58
+ /** Short BLE correlation id (4-char hex) → full cloud requestId. */
59
+ private readonly bleIdToCloud;
60
+ takePhoto(packageName: string, opts: PhotoOpts): Promise<PhotoTaken>;
61
+ /** Map a short BLE requestId from photo_response back to the cloud requestId. */
62
+ resolveCloudRequestId(bleOrCloudId: string): string;
63
+ /**
64
+ * Pre-warm the glasses camera so the next takePhoto() is near-instant.
65
+ *
66
+ * Pure BLE — NO cloud presign, NO upload, NO long-poll. The SDK mints the
67
+ * requestId, sends the warm-up command, and resolves when the camera reports
68
+ * ready (the native promise resolves on the ready status event).
69
+ */
70
+ warmUpCamera(packageName: string, opts: {
71
+ size?: "low" | "medium" | "high" | "max";
72
+ exposureTimeNs?: number;
73
+ durationMs?: number;
74
+ }): Promise<void>;
75
+ /** True iff this requestId (short BLE id or cloud id) is one we're currently waiting on. */
76
+ owns(requestId: string): boolean;
77
+ /**
78
+ * Called by MantleManager's gated photo_response listener when glasses
79
+ * report an error (BATTERY_LOW, CAMERA_BUSY, etc.) for a phone-owned
80
+ * requestId. Rejects the in-flight takePhoto Promise immediately.
81
+ */
82
+ handlePhotoError(requestId: string, errorCode: string, errorMessage: string): void;
83
+ private toPhotoError;
84
+ }
85
+ export declare const phonePhotoCoordinator: PhonePhotoCoordinator;
86
+ //# sourceMappingURL=PhonePhotoCoordinator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PhonePhotoCoordinator.d.ts","sourceRoot":"","sources":["../../src/services/PhonePhotoCoordinator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AA6BH,MAAM,WAAW,SAAS;IACxB,mFAAmF;IACnF,IAAI,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAA;IACrE,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAA;IAC7C,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;iEACiE;AACjE,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG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