@glassly/engine 0.1.0-dev.99 → 0.2.8-dev.445

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 (501) hide show
  1. package/README.md +28 -0
  2. package/build/engine.d.ts +32 -10
  3. package/build/engine.d.ts.map +1 -1
  4. package/build/engine.js +24 -16
  5. package/build/engine.js.map +1 -1
  6. package/build/facades/dev.d.ts +9 -0
  7. package/build/facades/dev.d.ts.map +1 -1
  8. package/build/facades/dev.js +9 -0
  9. package/build/facades/dev.js.map +1 -1
  10. package/build/facades/display.d.ts +10 -3
  11. package/build/facades/display.d.ts.map +1 -1
  12. package/build/facades/display.js +22 -8
  13. package/build/facades/display.js.map +1 -1
  14. package/build/facades/displayMirror.d.ts +11 -0
  15. package/build/facades/displayMirror.d.ts.map +1 -1
  16. package/build/facades/displayMirror.js +22 -0
  17. package/build/facades/displayMirror.js.map +1 -1
  18. package/build/facades/glasses.d.ts +31 -1
  19. package/build/facades/glasses.d.ts.map +1 -1
  20. package/build/facades/glasses.js +51 -0
  21. package/build/facades/glasses.js.map +1 -1
  22. package/build/facades/memory.d.ts +0 -6
  23. package/build/facades/memory.d.ts.map +1 -1
  24. package/build/facades/memory.js +1 -9
  25. package/build/facades/memory.js.map +1 -1
  26. package/build/facades/miniapps.d.ts +3 -1
  27. package/build/facades/miniapps.d.ts.map +1 -1
  28. package/build/facades/miniapps.js +3 -1
  29. package/build/facades/miniapps.js.map +1 -1
  30. package/build/facades/pairing.d.ts.map +1 -1
  31. package/build/facades/pairing.js +5 -4
  32. package/build/facades/pairing.js.map +1 -1
  33. package/build/facades/permissions.d.ts +2 -0
  34. package/build/facades/permissions.d.ts.map +1 -1
  35. package/build/facades/permissions.js +48 -0
  36. package/build/facades/permissions.js.map +1 -1
  37. package/build/facades/phoneNotifications.d.ts +20 -9
  38. package/build/facades/phoneNotifications.d.ts.map +1 -1
  39. package/build/facades/phoneNotifications.js +33 -26
  40. package/build/facades/phoneNotifications.js.map +1 -1
  41. package/build/facades/settings.d.ts.map +1 -1
  42. package/build/facades/settings.js +1 -2
  43. package/build/facades/settings.js.map +1 -1
  44. package/build/generated/releaseMetadata.js +4 -4
  45. package/build/generated/releaseMetadata.js.map +1 -1
  46. package/build/index.d.ts +6 -4
  47. package/build/index.d.ts.map +1 -1
  48. package/build/index.js +5 -4
  49. package/build/index.js.map +1 -1
  50. package/build/react/MentraLiveOtaFlow.js +2 -2
  51. package/build/react/MentraLiveOtaFlow.js.map +1 -1
  52. package/build/react/useMentraLiveOta.d.ts.map +1 -1
  53. package/build/react/useMentraLiveOta.js +8 -7
  54. package/build/react/useMentraLiveOta.js.map +1 -1
  55. package/build/runtime/config.d.ts +1 -1
  56. package/build/runtime/config.d.ts.map +1 -1
  57. package/build/runtime/config.js.map +1 -1
  58. package/build/services/AppRegistry.d.ts +4 -1
  59. package/build/services/AppRegistry.d.ts.map +1 -1
  60. package/build/services/AppRegistry.js +21 -1
  61. package/build/services/AppRegistry.js.map +1 -1
  62. package/build/services/BlobStore.d.ts +2 -2
  63. package/build/services/BlobStore.js +3 -3
  64. package/build/services/BlobStore.js.map +1 -1
  65. package/build/services/CloudClientService.d.ts +7 -3
  66. package/build/services/CloudClientService.d.ts.map +1 -1
  67. package/build/services/CloudClientService.js +34 -9
  68. package/build/services/CloudClientService.js.map +1 -1
  69. package/build/services/DevServerBridge.d.ts +1 -18
  70. package/build/services/DevServerBridge.d.ts.map +1 -1
  71. package/build/services/DevServerBridge.js +9 -8
  72. package/build/services/DevServerBridge.js.map +1 -1
  73. package/build/services/DeviceEventRouter.d.ts.map +1 -1
  74. package/build/services/DeviceEventRouter.js +58 -71
  75. package/build/services/DeviceEventRouter.js.map +1 -1
  76. package/build/services/DisplayDiagnostics.d.ts +5 -0
  77. package/build/services/DisplayDiagnostics.d.ts.map +1 -0
  78. package/build/services/DisplayDiagnostics.js +105 -0
  79. package/build/services/DisplayDiagnostics.js.map +1 -0
  80. package/build/services/DisplayProcessor.d.ts +6 -7
  81. package/build/services/DisplayProcessor.d.ts.map +1 -1
  82. package/build/services/DisplayProcessor.js +17 -45
  83. package/build/services/DisplayProcessor.js.map +1 -1
  84. package/build/services/GestureDotsService.d.ts +10 -4
  85. package/build/services/GestureDotsService.d.ts.map +1 -1
  86. package/build/services/GestureDotsService.js +70 -16
  87. package/build/services/GestureDotsService.js.map +1 -1
  88. package/build/services/GlassesKeyboardInput.d.ts +77 -0
  89. package/build/services/GlassesKeyboardInput.d.ts.map +1 -0
  90. package/build/services/GlassesKeyboardInput.js +261 -0
  91. package/build/services/GlassesKeyboardInput.js.map +1 -0
  92. package/build/services/GlassesSensorService.d.ts +47 -0
  93. package/build/services/GlassesSensorService.d.ts.map +1 -0
  94. package/build/services/GlassesSensorService.js +242 -0
  95. package/build/services/GlassesSensorService.js.map +1 -0
  96. package/build/services/GlassesTouchInput.d.ts +14 -0
  97. package/build/services/GlassesTouchInput.d.ts.map +1 -0
  98. package/build/services/GlassesTouchInput.js +107 -0
  99. package/build/services/GlassesTouchInput.js.map +1 -0
  100. package/build/services/HeadingService.d.ts +0 -6
  101. package/build/services/HeadingService.d.ts.map +1 -1
  102. package/build/services/HeadingService.js +0 -27
  103. package/build/services/HeadingService.js.map +1 -1
  104. package/build/services/HotspotShutdown.d.ts.map +1 -1
  105. package/build/services/HotspotShutdown.js +2 -1
  106. package/build/services/HotspotShutdown.js.map +1 -1
  107. package/build/services/JSCrashloopReportService.js +2 -2
  108. package/build/services/JSCrashloopReportService.js.map +1 -1
  109. package/build/services/JSRouter.d.ts +6 -4
  110. package/build/services/JSRouter.d.ts.map +1 -1
  111. package/build/services/JSRouter.js +15 -13
  112. package/build/services/JSRouter.js.map +1 -1
  113. package/build/services/LocalDisplayManager.d.ts +35 -7
  114. package/build/services/LocalDisplayManager.d.ts.map +1 -1
  115. package/build/services/LocalDisplayManager.js +105 -27
  116. package/build/services/LocalDisplayManager.js.map +1 -1
  117. package/build/services/LocalMiniappDataMigration.d.ts +1 -1
  118. package/build/services/LocalMiniappDataMigration.js +1 -1
  119. package/build/services/LocalMiniappDataMigration.js.map +1 -1
  120. package/build/services/LocalMiniappRuntime.d.ts +64 -11
  121. package/build/services/LocalMiniappRuntime.d.ts.map +1 -1
  122. package/build/services/LocalMiniappRuntime.js +441 -35
  123. package/build/services/LocalMiniappRuntime.js.map +1 -1
  124. package/build/services/LocalSttFallbackCoordinator.d.ts +3 -0
  125. package/build/services/LocalSttFallbackCoordinator.d.ts.map +1 -1
  126. package/build/services/LocalSttFallbackCoordinator.js +27 -8
  127. package/build/services/LocalSttFallbackCoordinator.js.map +1 -1
  128. package/build/services/MemoryStore.d.ts +8 -33
  129. package/build/services/MemoryStore.d.ts.map +1 -1
  130. package/build/services/MemoryStore.js +30 -56
  131. package/build/services/MemoryStore.js.map +1 -1
  132. package/build/services/MiniappEngine.d.ts +3 -3
  133. package/build/services/MiniappEngine.js +7 -7
  134. package/build/services/MiniappEngine.js.map +1 -1
  135. package/build/services/MiniappLauncher.d.ts +8 -0
  136. package/build/services/MiniappLauncher.d.ts.map +1 -1
  137. package/build/services/MiniappLauncher.js +19 -1
  138. package/build/services/MiniappLauncher.js.map +1 -1
  139. package/build/services/MirrorService.d.ts +24 -0
  140. package/build/services/MirrorService.d.ts.map +1 -0
  141. package/build/services/MirrorService.js +132 -0
  142. package/build/services/MirrorService.js.map +1 -0
  143. package/build/services/NativeNavigationService.d.ts +2 -3
  144. package/build/services/NativeNavigationService.d.ts.map +1 -1
  145. package/build/services/NativeNavigationService.js +24 -21
  146. package/build/services/NativeNavigationService.js.map +1 -1
  147. package/build/services/NavigationHandlers.d.ts.map +1 -1
  148. package/build/services/NavigationHandlers.js +10 -5
  149. package/build/services/NavigationHandlers.js.map +1 -1
  150. package/build/services/OtaInstallCoordinator.d.ts.map +1 -1
  151. package/build/services/OtaInstallCoordinator.js +24 -23
  152. package/build/services/OtaInstallCoordinator.js.map +1 -1
  153. package/build/services/PairedGlassesLatch.d.ts +7 -0
  154. package/build/services/PairedGlassesLatch.d.ts.map +1 -0
  155. package/build/services/PairedGlassesLatch.js +38 -0
  156. package/build/services/PairedGlassesLatch.js.map +1 -0
  157. package/build/services/PhoneActivity.d.ts +23 -0
  158. package/build/services/PhoneActivity.d.ts.map +1 -0
  159. package/build/services/PhoneActivity.js +111 -0
  160. package/build/services/PhoneActivity.js.map +1 -0
  161. package/build/services/PhoneCameraFovCoordinator.d.ts.map +1 -1
  162. package/build/services/PhoneCameraFovCoordinator.js +4 -3
  163. package/build/services/PhoneCameraFovCoordinator.js.map +1 -1
  164. package/build/services/PhoneNotificationsSync.d.ts +40 -6
  165. package/build/services/PhoneNotificationsSync.d.ts.map +1 -1
  166. package/build/services/PhoneNotificationsSync.js +160 -84
  167. package/build/services/PhoneNotificationsSync.js.map +1 -1
  168. package/build/services/PhonePhotoCoordinator.d.ts.map +1 -1
  169. package/build/services/PhonePhotoCoordinator.js +6 -5
  170. package/build/services/PhonePhotoCoordinator.js.map +1 -1
  171. package/build/services/PhoneStreamCoordinator.d.ts.map +1 -1
  172. package/build/services/PhoneStreamCoordinator.js +8 -7
  173. package/build/services/PhoneStreamCoordinator.js.map +1 -1
  174. package/build/services/STTModelManager.d.ts +3 -0
  175. package/build/services/STTModelManager.d.ts.map +1 -1
  176. package/build/services/STTModelManager.js +15 -1
  177. package/build/services/STTModelManager.js.map +1 -1
  178. package/build/services/SceneRenderer.d.ts +43 -2
  179. package/build/services/SceneRenderer.d.ts.map +1 -1
  180. package/build/services/SceneRenderer.js +123 -8
  181. package/build/services/SceneRenderer.js.map +1 -1
  182. package/build/services/StreamLifecycleController.d.ts.map +1 -1
  183. package/build/services/StreamLifecycleController.js +6 -14
  184. package/build/services/StreamLifecycleController.js.map +1 -1
  185. package/build/services/TTSModelManager.js +1 -1
  186. package/build/services/TTSModelManager.js.map +1 -1
  187. package/build/services/UIRouter.d.ts +2 -2
  188. package/build/services/UIRouter.js +5 -5
  189. package/build/services/UIRouter.js.map +1 -1
  190. package/build/services/asg/galleryPathMigration.js +1 -1
  191. package/build/services/asg/galleryPathMigration.js.map +1 -1
  192. package/build/services/asg/gallerySyncService.js +2 -2
  193. package/build/services/asg/gallerySyncService.js.map +1 -1
  194. package/build/services/asg/localStorageService.d.ts.map +1 -1
  195. package/build/services/asg/localStorageService.js +3 -3
  196. package/build/services/asg/localStorageService.js.map +1 -1
  197. package/build/services/debug/DashboardOpenTrace.d.ts +32 -0
  198. package/build/services/debug/DashboardOpenTrace.d.ts.map +1 -0
  199. package/build/services/debug/DashboardOpenTrace.js +128 -0
  200. package/build/services/debug/DashboardOpenTrace.js.map +1 -0
  201. package/build/services/debug/dashboardOpenTimeline.d.ts +77 -0
  202. package/build/services/debug/dashboardOpenTimeline.d.ts.map +1 -0
  203. package/build/services/debug/dashboardOpenTimeline.js +195 -0
  204. package/build/services/debug/dashboardOpenTimeline.js.map +1 -0
  205. package/build/services/effectiveCapabilities.d.ts.map +1 -1
  206. package/build/services/effectiveCapabilities.js +25 -13
  207. package/build/services/effectiveCapabilities.js.map +1 -1
  208. package/build/services/gestureClaims.d.ts +34 -15
  209. package/build/services/gestureClaims.d.ts.map +1 -1
  210. package/build/services/gestureClaims.js +42 -21
  211. package/build/services/gestureClaims.js.map +1 -1
  212. package/build/services/manifestFields.d.ts +9 -0
  213. package/build/services/manifestFields.d.ts.map +1 -0
  214. package/build/services/manifestFields.js +26 -0
  215. package/build/services/manifestFields.js.map +1 -0
  216. package/build/services/memoryStoreInstance.d.ts +0 -10
  217. package/build/services/memoryStoreInstance.d.ts.map +1 -1
  218. package/build/services/memoryStoreInstance.js +2 -31
  219. package/build/services/memoryStoreInstance.js.map +1 -1
  220. package/build/services/mirrorSnapshot.d.ts +16 -0
  221. package/build/services/mirrorSnapshot.d.ts.map +1 -0
  222. package/build/services/mirrorSnapshot.js +102 -0
  223. package/build/services/mirrorSnapshot.js.map +1 -0
  224. package/build/services/nativeNavigationGate.d.ts +8 -0
  225. package/build/services/nativeNavigationGate.d.ts.map +1 -0
  226. package/build/services/nativeNavigationGate.js +12 -0
  227. package/build/services/nativeNavigationGate.js.map +1 -0
  228. package/build/services/notificationAppCatalog.d.ts +7 -0
  229. package/build/services/notificationAppCatalog.d.ts.map +1 -0
  230. package/build/services/notificationAppCatalog.js +16 -0
  231. package/build/services/notificationAppCatalog.js.map +1 -0
  232. package/build/services/notifications/notificationPolicy.d.ts +55 -0
  233. package/build/services/notifications/notificationPolicy.d.ts.map +1 -0
  234. package/build/services/notifications/notificationPolicy.js +41 -0
  235. package/build/services/notifications/notificationPolicy.js.map +1 -0
  236. package/build/services/pages/OverlayPages.d.ts +26 -0
  237. package/build/services/pages/OverlayPages.d.ts.map +1 -0
  238. package/build/services/pages/OverlayPages.js +80 -0
  239. package/build/services/pages/OverlayPages.js.map +1 -0
  240. package/build/services/pages/PageHost.d.ts +32 -0
  241. package/build/services/pages/PageHost.d.ts.map +1 -0
  242. package/build/services/pages/PageHost.js +99 -0
  243. package/build/services/pages/PageHost.js.map +1 -0
  244. package/build/services/pages/overlayApps.d.ts +25 -0
  245. package/build/services/pages/overlayApps.d.ts.map +1 -0
  246. package/build/services/pages/overlayApps.js +66 -0
  247. package/build/services/pages/overlayApps.js.map +1 -0
  248. package/build/services/pages/pageEligibility.d.ts +9 -0
  249. package/build/services/pages/pageEligibility.d.ts.map +1 -0
  250. package/build/services/pages/pageEligibility.js +27 -0
  251. package/build/services/pages/pageEligibility.js.map +1 -0
  252. package/build/services/settingsBridge.d.ts +58 -0
  253. package/build/services/settingsBridge.d.ts.map +1 -0
  254. package/build/services/settingsBridge.js +90 -0
  255. package/build/services/settingsBridge.js.map +1 -0
  256. package/build/services/speakerProfileStoreInstance.js +1 -1
  257. package/build/services/speakerProfileStoreInstance.js.map +1 -1
  258. package/build/services/uiShim.d.ts +1 -1
  259. package/build/services/uiShim.js +4 -4
  260. package/build/services/uiShim.js.map +1 -1
  261. package/build/stores/appVisibility.d.ts +28 -0
  262. package/build/stores/appVisibility.d.ts.map +1 -1
  263. package/build/stores/appVisibility.js +34 -0
  264. package/build/stores/appVisibility.js.map +1 -1
  265. package/build/stores/apps.d.ts +13 -0
  266. package/build/stores/apps.d.ts.map +1 -1
  267. package/build/stores/apps.js +66 -12
  268. package/build/stores/apps.js.map +1 -1
  269. package/build/stores/bluetoothSettingKeys.js +1 -1
  270. package/build/stores/bluetoothSettingKeys.js.map +1 -1
  271. package/build/stores/display.d.ts +3 -3
  272. package/build/stores/display.d.ts.map +1 -1
  273. package/build/stores/display.js +16 -4
  274. package/build/stores/display.js.map +1 -1
  275. package/build/stores/glasses.d.ts.map +1 -1
  276. package/build/stores/glasses.js +14 -1
  277. package/build/stores/glasses.js.map +1 -1
  278. package/build/stores/settings.d.ts +1 -0
  279. package/build/stores/settings.d.ts.map +1 -1
  280. package/build/stores/settings.js +170 -44
  281. package/build/stores/settings.js.map +1 -1
  282. package/build/types/applet.d.ts +14 -1
  283. package/build/types/applet.d.ts.map +1 -1
  284. package/build/types/applet.js.map +1 -1
  285. package/build/types/capabilities/even-realities-g2.d.ts.map +1 -1
  286. package/build/types/capabilities/even-realities-g2.js +5 -0
  287. package/build/types/capabilities/even-realities-g2.js.map +1 -1
  288. package/build/types/capabilities/simulated-glasses.d.ts +1 -1
  289. package/build/types/capabilities/simulated-glasses.d.ts.map +1 -1
  290. package/build/types/capabilities/simulated-glasses.js +7 -4
  291. package/build/types/capabilities/simulated-glasses.js.map +1 -1
  292. package/build/types/hardware.d.ts +20 -1
  293. package/build/types/hardware.d.ts.map +1 -1
  294. package/build/types/hardware.js +2 -0
  295. package/build/types/hardware.js.map +1 -1
  296. package/build/types/index.d.ts +1 -0
  297. package/build/types/index.d.ts.map +1 -1
  298. package/build/types/index.js +1 -0
  299. package/build/types/index.js.map +1 -1
  300. package/build/utils/debouncedPatch.d.ts +3 -1
  301. package/build/utils/debouncedPatch.d.ts.map +1 -1
  302. package/build/utils/debouncedPatch.js +6 -3
  303. package/build/utils/debouncedPatch.js.map +1 -1
  304. package/build/utils/devMiniappLaunch.d.ts.map +1 -1
  305. package/build/utils/devMiniappLaunch.js +4 -3
  306. package/build/utils/devMiniappLaunch.js.map +1 -1
  307. package/build/utils/display/measurer/TextMeasurer.d.ts +2 -159
  308. package/build/utils/display/measurer/TextMeasurer.d.ts.map +1 -1
  309. package/build/utils/display/measurer/TextMeasurer.js +2 -272
  310. package/build/utils/display/measurer/TextMeasurer.js.map +1 -1
  311. package/build/utils/display/measurer/script-detection.d.ts +1 -52
  312. package/build/utils/display/measurer/script-detection.d.ts.map +1 -1
  313. package/build/utils/display/measurer/script-detection.js +2 -183
  314. package/build/utils/display/measurer/script-detection.js.map +1 -1
  315. package/build/utils/display/pixelArt.d.ts +3 -0
  316. package/build/utils/display/pixelArt.d.ts.map +1 -0
  317. package/build/utils/display/pixelArt.js +3 -0
  318. package/build/utils/display/pixelArt.js.map +1 -0
  319. package/build/utils/display/profiles/g1.d.ts +1 -32
  320. package/build/utils/display/profiles/g1.d.ts.map +1 -1
  321. package/build/utils/display/profiles/g1.js +2 -212
  322. package/build/utils/display/profiles/g1.js.map +1 -1
  323. package/build/utils/display/profiles/g2.d.ts +1 -12
  324. package/build/utils/display/profiles/g2.d.ts.map +1 -1
  325. package/build/utils/display/profiles/g2.js +2 -33
  326. package/build/utils/display/profiles/g2.js.map +1 -1
  327. package/build/utils/display/profiles/nex.d.ts +1 -9
  328. package/build/utils/display/profiles/nex.d.ts.map +1 -1
  329. package/build/utils/display/profiles/nex.js +2 -149
  330. package/build/utils/display/profiles/nex.js.map +1 -1
  331. package/build/utils/display/profiles/types.d.ts +1 -102
  332. package/build/utils/display/profiles/types.d.ts.map +1 -1
  333. package/build/utils/display/profiles/types.js.map +1 -1
  334. package/build/utils/display/profiles/z100.d.ts +1 -32
  335. package/build/utils/display/profiles/z100.d.ts.map +1 -1
  336. package/build/utils/display/profiles/z100.js +2 -181
  337. package/build/utils/display/profiles/z100.js.map +1 -1
  338. package/build/utils/display/scene/degrade.d.ts.map +1 -1
  339. package/build/utils/display/scene/degrade.js +4 -1
  340. package/build/utils/display/scene/degrade.js.map +1 -1
  341. package/build/utils/display/scene/differ.d.ts +13 -1
  342. package/build/utils/display/scene/differ.d.ts.map +1 -1
  343. package/build/utils/display/scene/differ.js +22 -0
  344. package/build/utils/display/scene/differ.js.map +1 -1
  345. package/build/utils/display/scene/index.d.ts +1 -1
  346. package/build/utils/display/scene/index.d.ts.map +1 -1
  347. package/build/utils/display/scene/index.js.map +1 -1
  348. package/build/utils/display/scene/process.d.ts.map +1 -1
  349. package/build/utils/display/scene/process.js +183 -11
  350. package/build/utils/display/scene/process.js.map +1 -1
  351. package/build/utils/display/scene/store.d.ts +1 -1
  352. package/build/utils/display/scene/store.d.ts.map +1 -1
  353. package/build/utils/display/scene/store.js +0 -0
  354. package/build/utils/display/scene/store.js.map +1 -1
  355. package/build/utils/display/scene/svgPath.d.ts +9 -0
  356. package/build/utils/display/scene/svgPath.d.ts.map +1 -0
  357. package/build/utils/display/scene/svgPath.js +167 -0
  358. package/build/utils/display/scene/svgPath.js.map +1 -0
  359. package/build/utils/display/scene/types.d.ts +2 -142
  360. package/build/utils/display/scene/types.d.ts.map +1 -1
  361. package/build/utils/display/scene/types.js +0 -0
  362. package/build/utils/display/scene/types.js.map +1 -1
  363. package/build/utils/display/wrapper/TextWrapper.d.ts +1 -101
  364. package/build/utils/display/wrapper/TextWrapper.d.ts.map +1 -1
  365. package/build/utils/display/wrapper/TextWrapper.js +2 -470
  366. package/build/utils/display/wrapper/TextWrapper.js.map +1 -1
  367. package/build/utils/display/wrapper/types.d.ts +2 -74
  368. package/build/utils/display/wrapper/types.d.ts.map +1 -1
  369. package/build/utils/display/wrapper/types.js +2 -10
  370. package/build/utils/display/wrapper/types.js.map +1 -1
  371. package/build/utils/hardware/hardware.js +1 -1
  372. package/build/utils/hardware/hardware.js.map +1 -1
  373. package/build/utils/timers/timers.d.ts.map +1 -1
  374. package/build/utils/timers/timers.js +26 -4
  375. package/build/utils/timers/timers.js.map +1 -1
  376. package/package.json +8 -8
  377. package/src/engine.ts +24 -15
  378. package/src/facades/dev.ts +10 -0
  379. package/src/facades/display.ts +21 -8
  380. package/src/facades/displayMirror.ts +29 -0
  381. package/src/facades/glasses.ts +61 -1
  382. package/src/facades/memory.ts +1 -12
  383. package/src/facades/miniapps.ts +4 -1
  384. package/src/facades/pairing.ts +8 -6
  385. package/src/facades/permissions.ts +46 -0
  386. package/src/facades/phoneNotifications.ts +45 -26
  387. package/src/facades/settings.ts +1 -2
  388. package/src/generated/releaseMetadata.ts +4 -4
  389. package/src/index.ts +6 -9
  390. package/src/react/MentraLiveOtaFlow.tsx +2 -2
  391. package/src/react/useMentraLiveOta.ts +14 -8
  392. package/src/runtime/config.ts +1 -1
  393. package/src/services/AppRegistry.ts +43 -7
  394. package/src/services/BlobStore.ts +3 -3
  395. package/src/services/CloudClientService.ts +37 -10
  396. package/src/services/DevServerBridge.ts +12 -10
  397. package/src/services/DeviceEventRouter.ts +73 -74
  398. package/src/services/DisplayDiagnostics.ts +107 -0
  399. package/src/services/DisplayProcessor.ts +20 -55
  400. package/src/services/GestureDotsService.ts +77 -16
  401. package/src/services/GlassesKeyboardInput.ts +306 -0
  402. package/src/services/GlassesSensorService.ts +233 -0
  403. package/src/services/GlassesTouchInput.ts +128 -0
  404. package/src/services/HeadingService.ts +0 -24
  405. package/src/services/HotspotShutdown.ts +3 -1
  406. package/src/services/JSCrashloopReportService.ts +2 -2
  407. package/src/services/JSRouter.ts +29 -14
  408. package/src/services/LocalDisplayManager.ts +112 -26
  409. package/src/services/LocalMiniappDataMigration.ts +1 -1
  410. package/src/services/LocalMiniappRuntime.ts +500 -43
  411. package/src/services/LocalSttFallbackCoordinator.ts +28 -7
  412. package/src/services/MemoryStore.ts +32 -80
  413. package/src/services/MiniappEngine.ts +7 -7
  414. package/src/services/MiniappLauncher.ts +25 -1
  415. package/src/services/MirrorService.ts +139 -0
  416. package/src/services/NativeNavigationService.ts +29 -25
  417. package/src/services/NavigationHandlers.ts +10 -5
  418. package/src/services/OtaInstallCoordinator.ts +36 -34
  419. package/src/services/PairedGlassesLatch.ts +39 -0
  420. package/src/services/PhoneActivity.ts +116 -0
  421. package/src/services/PhoneCameraFovCoordinator.ts +6 -4
  422. package/src/services/PhoneNotificationsSync.ts +185 -103
  423. package/src/services/PhonePhotoCoordinator.ts +9 -10
  424. package/src/services/PhoneStreamCoordinator.ts +13 -11
  425. package/src/services/STTModelManager.ts +15 -1
  426. package/src/services/SceneRenderer.ts +148 -10
  427. package/src/services/StreamLifecycleController.ts +9 -7
  428. package/src/services/TTSModelManager.ts +1 -1
  429. package/src/services/UIRouter.ts +5 -5
  430. package/src/services/asg/galleryPathMigration.ts +1 -1
  431. package/src/services/asg/gallerySyncService.ts +2 -2
  432. package/src/services/asg/localStorageService.ts +3 -3
  433. package/src/services/debug/DashboardOpenTrace.ts +153 -0
  434. package/src/services/debug/dashboardOpenTimeline.ts +237 -0
  435. package/src/services/effectiveCapabilities.ts +32 -13
  436. package/src/services/gestureClaims.ts +72 -23
  437. package/src/services/manifestFields.ts +23 -0
  438. package/src/services/memoryStoreInstance.ts +2 -34
  439. package/src/services/mirrorSnapshot.ts +116 -0
  440. package/src/services/nativeNavigationGate.ts +14 -0
  441. package/src/services/notificationAppCatalog.ts +21 -0
  442. package/src/services/notifications/notificationPolicy.ts +87 -0
  443. package/src/services/pages/OverlayPages.ts +86 -0
  444. package/src/services/pages/PageHost.ts +116 -0
  445. package/src/services/pages/overlayApps.ts +72 -0
  446. package/src/services/pages/pageEligibility.ts +30 -0
  447. package/src/services/settingsBridge.ts +111 -0
  448. package/src/services/speakerProfileStoreInstance.ts +1 -1
  449. package/src/services/uiShim.ts +4 -4
  450. package/src/stores/appVisibility.ts +45 -0
  451. package/src/stores/apps.ts +110 -32
  452. package/src/stores/bluetoothSettingKeys.ts +1 -1
  453. package/src/stores/display.ts +18 -7
  454. package/src/stores/glasses.ts +15 -1
  455. package/src/stores/settings.ts +175 -51
  456. package/src/types/applet.ts +14 -1
  457. package/src/types/capabilities/even-realities-g2.ts +6 -0
  458. package/src/types/capabilities/simulated-glasses.ts +8 -4
  459. package/src/types/hardware.ts +34 -1
  460. package/src/types/index.ts +1 -0
  461. package/src/utils/debouncedPatch.ts +8 -4
  462. package/src/utils/devMiniappLaunch.ts +5 -3
  463. package/src/utils/display/measurer/TextMeasurer.ts +3 -346
  464. package/src/utils/display/measurer/script-detection.ts +10 -218
  465. package/src/utils/display/pixelArt.ts +3 -0
  466. package/src/utils/display/profiles/g1.ts +2 -236
  467. package/src/utils/display/profiles/g2.ts +2 -39
  468. package/src/utils/display/profiles/nex.ts +2 -166
  469. package/src/utils/display/profiles/types.ts +9 -132
  470. package/src/utils/display/profiles/z100.ts +2 -198
  471. package/src/utils/display/scene/degrade.ts +4 -1
  472. package/src/utils/display/scene/differ.ts +25 -1
  473. package/src/utils/display/scene/index.ts +5 -0
  474. package/src/utils/display/scene/process.ts +196 -13
  475. package/src/utils/display/scene/store.ts +0 -0
  476. package/src/utils/display/scene/svgPath.ts +163 -0
  477. package/src/utils/display/scene/types.ts +0 -0
  478. package/src/utils/display/wrapper/TextWrapper.ts +2 -546
  479. package/src/utils/display/wrapper/types.ts +3 -102
  480. package/src/utils/hardware/hardware.ts +1 -1
  481. package/src/utils/timers/timers.ts +32 -4
  482. package/build/services/CustomDashboardModel.d.ts +0 -48
  483. package/build/services/CustomDashboardModel.d.ts.map +0 -1
  484. package/build/services/CustomDashboardModel.js +0 -73
  485. package/build/services/CustomDashboardModel.js.map +0 -1
  486. package/build/services/CustomDashboardService.d.ts +0 -63
  487. package/build/services/CustomDashboardService.d.ts.map +0 -1
  488. package/build/services/CustomDashboardService.js +0 -576
  489. package/build/services/CustomDashboardService.js.map +0 -1
  490. package/build/services/DashboardCoordinator.d.ts +0 -26
  491. package/build/services/DashboardCoordinator.d.ts.map +0 -1
  492. package/build/services/DashboardCoordinator.js +0 -125
  493. package/build/services/DashboardCoordinator.js.map +0 -1
  494. package/build/services/iosNotificationAppCatalog.d.ts +0 -13
  495. package/build/services/iosNotificationAppCatalog.d.ts.map +0 -1
  496. package/build/services/iosNotificationAppCatalog.js +0 -28
  497. package/build/services/iosNotificationAppCatalog.js.map +0 -1
  498. package/src/services/CustomDashboardModel.ts +0 -83
  499. package/src/services/CustomDashboardService.ts +0 -598
  500. package/src/services/DashboardCoordinator.ts +0 -121
  501. package/src/services/iosNotificationAppCatalog.ts +0 -39
package/README.md CHANGED
@@ -110,6 +110,34 @@ disabled unless an Expo/React Native host explicitly sets
110
110
  debug `setOtaVersionUrl` surface. Pre-39 glasses retain their separate legacy
111
111
  path because those clients ignore the URL sent by the phone.
112
112
 
113
+ ## Phone notifications
114
+
115
+ `engine.phoneNotifications` owns the notification policy for every host.
116
+ Capture (Android's listener, or glasses that read the phone's stream) is never
117
+ gated by it. Presentation has one owner per event, from
118
+ `presentationOwner(hostActive)`:
119
+
120
+ - `viewer` — the engine's notifications page, on connected Glassly CFW glasses
121
+ - `firmware` — glasses whose firmware presents notifications
122
+ (`hasNativeNotifications`); on Android the host hands the event over with
123
+ `uploadToGlasses(event)`, on iOS the glasses already have it
124
+ - `host` — the host's own card and speech, while its surface (Notify) runs
125
+ - `none` — notifications are off, or nothing is there to show them
126
+
127
+ Miniapp forwarding is not presentation and stays independent.
128
+
129
+ Four settings drive firmware and viewer alike: `notifications_enabled`,
130
+ `notifications_popups`, `notifications_popup_seconds` (0 = the presenter's
131
+ default) and `notifications_hold_during_apps`, plus the shared
132
+ `notifications_blocklist` and the phone-activity gate
133
+ `notifications_ignore_while_active`. `PhoneNotificationsSync` folds them into
134
+ one `GlassesNotificationConfig` and pushes it through the Bluetooth SDK on
135
+ every change and every connection; the pure mapping lives in
136
+ `services/notifications/notificationPolicy.ts`. `captureAuthorization()`
137
+ tells the settings UI whether the glasses may read the phone's notifications
138
+ (`not_needed` where the phone captures); `popupSecondsOptions()` lists the
139
+ durations the connected firmware accepts.
140
+
113
141
  ## Imports
114
142
 
115
143
  Inside `mobile/modules/engine/src/`, use **relative paths** (`./services/...`,
package/build/engine.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * name stays `engine` in code; the public API surface is `engine`.)
6
6
  *
7
7
  * It grows one facade at a time. The migration-era flat store/service exports
8
- * remain in a private GlasslyOS host package; they shrink as screens move onto
8
+ * remain in a private Glassly host package; they shrink as screens move onto
9
9
  * `engine.*`.
10
10
  */
11
11
  import { configure, updateUiSeams } from "./runtime/bootstrap";
@@ -39,6 +39,23 @@ export declare const engine: {
39
39
  requestVersionInfo: () => Promise<import("@glassly/bluetooth-sdk").VersionInfoResult>;
40
40
  onButtonPress: (cb: (event: import("@glassly/bluetooth-sdk").ButtonPressEvent) => void) => (() => void);
41
41
  onTouchGesture: (cb: (event: import("@glassly/bluetooth-sdk").TouchEvent) => void) => (() => void);
42
+ keyboard: {
43
+ scan: () => Promise<import("@glassly/bluetooth-sdk").KeyboardAdvertEvent[]>;
44
+ connect: (device: {
45
+ address: string;
46
+ addressType: number;
47
+ name: string;
48
+ }) => Promise<void>;
49
+ reconnect: () => Promise<void>;
50
+ disconnect: () => Promise<void>;
51
+ forget: () => Promise<void>;
52
+ passkey: (pin: number) => Promise<void>;
53
+ compare: (accept: boolean) => Promise<void>;
54
+ status: () => import("./facades/glasses").KeyboardStatusSnapshot;
55
+ onStatus: (cb: (status: import("./facades/glasses").KeyboardStatusSnapshot) => void) => (() => void);
56
+ onAdvert: (cb: (advert: import("@glassly/bluetooth-sdk").KeyboardAdvertEvent) => void) => (() => void);
57
+ onPairing: (cb: (prompt: import("@glassly/bluetooth-sdk").KeyboardPairingEvent) => void) => (() => void);
58
+ };
42
59
  controller: {
43
60
  connectDefault: () => Promise<void>;
44
61
  disconnect: () => Promise<void>;
@@ -122,6 +139,7 @@ export declare const engine: {
122
139
  };
123
140
  /** Developer/debug surface (backend+cloud URL overrides, reconnect, min version). */
124
141
  dev: {
142
+ sendGesture: typeof import("./services/GlassesTouchInput").sendGesture;
125
143
  cloudUrls: () => {
126
144
  core?: string;
127
145
  runtime?: string;
@@ -143,6 +161,7 @@ export declare const engine: {
143
161
  }>;
144
162
  runtimeStatus: () => import("./facades/dev").DevRuntimeStatusSnapshot;
145
163
  onRuntimeStatus: (cb: (status: import("./facades/dev").DevRuntimeStatusSnapshot) => void) => (() => void);
164
+ onDashboardOpenTrace: (cb: (report: import("./services/debug/DashboardOpenTrace").DashboardOpenReport) => void) => (() => void);
146
165
  };
147
166
  /** Bug-report, automatic runtime report, and feedback submission. */
148
167
  reports: {
@@ -207,6 +226,7 @@ export declare const engine: {
207
226
  uninstall: (packageName: string, version?: string | undefined) => import("typesafe-ts").AsyncResult<void, Error>;
208
227
  saveScreenshot: (packageName: string, screenshot: string) => Promise<void>;
209
228
  setHiddenStatus: (packageName: string, status: boolean) => void;
229
+ setPersistent: (packageName: string, status: boolean) => Promise<void>;
210
230
  };
211
231
  /** First-time glasses discovery + pairing. */
212
232
  pairing: {
@@ -247,19 +267,23 @@ export declare const engine: {
247
267
  };
248
268
  /** Phone→glasses notification forwarding (Android). */
249
269
  phoneNotifications: {
250
- installedApps: () => Promise<Array<{
251
- packageName: string;
252
- appName: string;
253
- icon: string | null;
254
- }>>;
270
+ installedApps: typeof import("./services/PhoneNotificationsSync").installedNotificationApps;
255
271
  blocklist: () => string[];
256
272
  setBlocklist: (packageNames: string[]) => import("typesafe-ts").AsyncResult<void, Error>;
257
273
  hasListenerPermission: () => Promise<boolean>;
258
274
  requestListenerPermission: () => Promise<boolean> | undefined;
259
- ancsAuthorized: () => boolean;
275
+ captureAuthorization: typeof import("./services/PhoneNotificationsSync").captureAuthorization;
276
+ nativeNotifications: typeof import("./services/PhoneNotificationsSync").nativeNotificationsSupported;
277
+ popupSecondsOptions: typeof import("./services/PhoneNotificationsSync").nativeNotificationPopupSeconds;
278
+ presentationOwner: typeof import("./services/PhoneNotificationsSync").currentPresentationOwner;
279
+ uploadToGlasses: (event: import("@glassly/crust").PhoneNotificationEvent) => Promise<void>;
280
+ glassesStatus: () => Promise<import("@glassly/bluetooth-sdk").GlassesNotificationStatus>;
281
+ onGlassesStatus: (listener: (status: import("@glassly/bluetooth-sdk").GlassesNotificationStatus) => void) => (() => void);
282
+ onUploadResult: (listener: (result: import("@glassly/bluetooth-sdk").NotificationUploadResult) => void) => (() => void);
260
283
  };
261
284
  /** OS permissions (check/request/openSettings + per-miniapp requirements). */
262
285
  permissions: {
286
+ missingRequired(requirements: readonly import("./types").AppletPermission[]): Promise<string[]>;
263
287
  check(feature: string): Promise<boolean>;
264
288
  request(feature: string): Promise<boolean>;
265
289
  openSettings: () => Promise<void>;
@@ -291,9 +315,6 @@ export declare const engine: {
291
315
  stats: () => Promise<import(".").MemoryStats>;
292
316
  clearAll: () => Promise<void>;
293
317
  onChanged: (listener: () => void) => (() => void);
294
- retentionExtended: () => boolean;
295
- retentionDays: (extended?: boolean) => number;
296
- setRetentionExtended: (extended: boolean) => void;
297
318
  };
298
319
  /** Device-local voice profiles for on-device speaker ID (Settings > Speakers). */
299
320
  speakers: {
@@ -334,6 +355,7 @@ export declare const engine: {
334
355
  mirror: {
335
356
  current(): import(".").DisplayMirrorEvent;
336
357
  onMirror(cb: (event: import(".").DisplayMirrorEvent) => void): () => void;
358
+ canvas(previewModel?: string): import("./facades/displayMirror").DisplayMirrorCanvas;
337
359
  };
338
360
  dashboard: {
339
361
  isOpen: () => boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAC,SAAS,EAAkD,aAAa,EAAC,MAAM,qBAAqB,CAAA;AAyC5G,eAAO,MAAM,MAAM;IACjB,2EAA2E;;IAE3E,8EAA8E;;IAE9E;iDAC6C;;IAoF7C;;yCAEqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgCrC,mFAAmF;;;;;;;;IAEnF,sEAAsE;;;;;;;;;;;;IAEtE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;;;;;;;;;;;;;;;;;;;IAE9C,uDAAuD;;;;;;;;;;;;;;;;IAEvD,8EAA8E;;;;;;;;IAE9E,qFAAqF;;;;IAErF,4EAA4E;;;;;;;;;;;IAE5E,+EAA+E;;;;;;;;;;;;IAE/E,kFAAkF;;;;;+BAzI5B,CAAC;;;+BAmBrD,CAPA;;;;;;;;;;;;IA+HF,mFAAmF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGpF,CAAA"}
package/build/engine.js CHANGED
@@ -5,12 +5,13 @@
5
5
  * name stays `engine` in code; the public API surface is `engine`.)
6
6
  *
7
7
  * It grows one facade at a time. The migration-era flat store/service exports
8
- * remain in a private GlasslyOS host package; they shrink as screens move onto
8
+ * remain in a private Glassly host package; they shrink as screens move onto
9
9
  * `engine.*`.
10
10
  */
11
11
  import { configure, start as bootstrapStart, stop as bootstrapStop, updateUiSeams } from "./runtime/bootstrap";
12
12
  import { cloudClientService } from "./services/CloudClientService";
13
13
  import { hydrateDeviceStore, demoteOrphanedDefaultWearable } from "./services/DeviceStoreHydration";
14
+ import { startPairedGlassesLatch, stopPairedGlassesLatch } from "./services/PairedGlassesLatch";
14
15
  import { startGlassesSettingsSync, stopGlassesSettingsSync } from "./services/GlassesSettingsSync";
15
16
  import { startGlassesStatusProjection, stopGlassesStatusProjection } from "./services/GlassesStatusProjection";
16
17
  import { startOtaService, stopOtaService } from "./services/OtaService";
@@ -18,6 +19,7 @@ import { startAudioCloudUplink, stopAudioCloudUplink } from "./services/AudioClo
18
19
  import sonioxDirectService from "./services/soniox/SonioxDirectService";
19
20
  import { startSupportProfileSync, stopSupportProfileSync } from "./services/SupportProfileSync";
20
21
  import { startDeviceEventRouter, stopDeviceEventRouter } from "./services/DeviceEventRouter";
22
+ import { startPhoneActivityTracking, stopPhoneActivityTracking } from "./services/PhoneActivity";
21
23
  import { startPhoneNotificationsSync, stopPhoneNotificationsSync } from "./services/PhoneNotificationsSync";
22
24
  import { startSpeakerIdSync, stopSpeakerIdSync } from "./services/SpeakerIdSync";
23
25
  import { startCaptionsTesterReportService, stopCaptionsTesterReportService } from "./services/CaptionsTesterReportService";
@@ -45,8 +47,7 @@ import { memory } from "./facades/memory";
45
47
  import { speakers } from "./facades/speakers";
46
48
  import { providerKeys } from "./facades/providerKeys";
47
49
  import { logBuffer } from "./utils/devLogging";
48
- import customDashboardService from "./services/CustomDashboardService";
49
- import dashboardCoordinator from "./services/DashboardCoordinator";
50
+ import pageHost from "./services/pages/PageHost";
50
51
  import gestureDotsService from "./services/GestureDotsService";
51
52
  export const engine = {
52
53
  /** Front door — hand engine auth + config, then start/stop the runtime. */
@@ -68,8 +69,12 @@ export const engine = {
68
69
  // of the runtime reads). Established first so the stores are live before the
69
70
  // syncs below react to them.
70
71
  startGlassesStatusProjection((changed) => localMiniappRuntime.forwardEvent("glasses_connection_state", changed));
71
- customDashboardService.start();
72
- dashboardCoordinator.start();
72
+ // Lock + foreground state, read by the dashboard's notification gate and
73
+ // the G2 notification ctrl below; up before either consumer.
74
+ startPhoneActivityTracking();
75
+ // The overlay slot's owner: the designated dashboard miniapp's page shows
76
+ // through it (ADR-0006), so it is up before the miniapp runtime.
77
+ pageHost.start();
73
78
  gestureDotsService.start();
74
79
  // Route the rest of the inbound device events (wifi/hotspot/gallery -> stores+bus,
75
80
  // photo/stream -> coordinators, button/touch/accel/head -> miniapps, save_setting ->
@@ -95,6 +100,8 @@ export const engine = {
95
100
  catch (error) {
96
101
  console.warn("engine.start: device-store hydration failed:", error instanceof Error ? error.message : error);
97
102
  }
103
+ // After the settings load so an already-paired phone latches on this start.
104
+ startPairedGlassesLatch();
98
105
  // Project the glasses' OTA events into the store for the engine.ota read surface.
99
106
  startOtaService();
100
107
  // Forward glasses mic_lc3 frames to the v2 cloud session so cloud transcription
@@ -103,12 +110,12 @@ export const engine = {
103
110
  // Phone -> Soniox direct transcription (user-supplied API key). Started
104
111
  // after device-store hydration so the persisted key is already loaded.
105
112
  sonioxDirectService.start();
106
- try {
107
- await cloudClientService.syncCoreTokenToBluetooth();
108
- }
109
- catch (error) {
113
+ // Not awaited: the exchange behind it is a Core round trip with no client
114
+ // deadline, and start() must resolve offline. The glasses get the token
115
+ // when it lands; identity resolution joins the same single-flight exchange.
116
+ void cloudClientService.syncCoreTokenToBluetooth().catch((error) => {
110
117
  console.warn("engine.start: initial Cloud V2 core token sync failed:", error instanceof Error ? error.message : error);
111
- }
118
+ });
112
119
  startSupportProfileSync();
113
120
  // Push device-setting changes to the glasses for ANY host, so
114
121
  // engine.glasses.settings.set() reaches the device (not just the Glassly app).
@@ -122,11 +129,11 @@ export const engine = {
122
129
  // Android internal/e2e: laptop captions tester can broadcast a failure intent;
123
130
  // engine owns turning that into a Cloud V2 report.
124
131
  startCaptionsTesterReportService();
125
- // GlasslyJS crashloop-disabled is runtime state; engine owns filing the
132
+ // JSRuntime crashloop-disabled is runtime state; engine owns filing the
126
133
  // automatic report while hosts only render alert/telemetry side effects.
127
134
  startJSCrashloopReportService();
128
- // Bring up the local-miniapp engine so a bare OEM can run GlasslyJS miniapps:
129
- // the LocalMiniappRuntime (registry + WebView bridge), the GlasslyJS router
135
+ // Bring up the local-miniapp engine so a bare OEM can run JSRuntime miniapps:
136
+ // the LocalMiniappRuntime (registry + WebView bridge), the JSRuntime router
130
137
  // (crust-bound spawn/dispatch pump + launcher wiring), the DisplayProcessor
131
138
  // (layout arbitration over the engine stores), and the gallery-sync service.
132
139
  // All idempotent — when the Glassly app's host bootstrap also calls these, the
@@ -150,19 +157,20 @@ export const engine = {
150
157
  }
151
158
  };
152
159
  await safely("glasses settings sync", stopGlassesSettingsSync);
160
+ await safely("paired glasses latch", stopPairedGlassesLatch);
153
161
  await safely("glasses status projection", stopGlassesStatusProjection);
154
162
  await safely("device event router", stopDeviceEventRouter);
155
- await safely("dashboard coordinator", () => dashboardCoordinator.stop());
156
- await safely("custom dashboard service", () => customDashboardService.stop());
163
+ await safely("page host", () => pageHost.stop());
157
164
  await safely("gesture dots service", () => gestureDotsService.stop());
158
165
  await safely("ota service", stopOtaService);
159
166
  await safely("audio cloud uplink", stopAudioCloudUplink);
160
167
  await safely("soniox direct service", () => sonioxDirectService.stop());
161
168
  await safely("support profile sync", stopSupportProfileSync);
162
169
  await safely("phone notifications sync", stopPhoneNotificationsSync);
170
+ await safely("phone activity tracking", stopPhoneActivityTracking);
163
171
  await safely("speaker id sync", stopSpeakerIdSync);
164
172
  await safely("captions tester report service", stopCaptionsTesterReportService);
165
- await safely("glasslyjs crashloop report service", stopJSCrashloopReportService);
173
+ await safely("js crashloop report service", stopJSCrashloopReportService);
166
174
  await safely("miniapp engine", stopMiniappEngine);
167
175
  await safely("local miniapp runtime", () => localMiniappRuntime.cleanup());
168
176
  await safely("display processor", () => displayProcessor.detachFromRuntime());
@@ -1 +1 @@
1
- {"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAC,SAAS,EAAE,KAAK,IAAI,cAAc,EAAE,IAAI,IAAI,aAAa,EAAE,aAAa,EAAC,MAAM,qBAAqB,CAAA;AAC5G,OAAO,EAAC,kBAAkB,EAAC,MAAM,+BAA+B,CAAA;AAChE,OAAO,EAAC,kBAAkB,EAAE,6BAA6B,EAAC,MAAM,iCAAiC,CAAA;AACjG,OAAO,EAAC,wBAAwB,EAAE,uBAAuB,EAAC,MAAM,gCAAgC,CAAA;AAChG,OAAO,EAAC,4BAA4B,EAAE,2BAA2B,EAAC,MAAM,oCAAoC,CAAA;AAC5G,OAAO,EAAC,eAAe,EAAE,cAAc,EAAC,MAAM,uBAAuB,CAAA;AACrE,OAAO,EAAC,qBAAqB,EAAE,oBAAoB,EAAC,MAAM,6BAA6B,CAAA;AACvF,OAAO,mBAAmB,MAAM,uCAAuC,CAAA;AACvE,OAAO,EAAC,uBAAuB,EAAE,sBAAsB,EAAC,MAAM,+BAA+B,CAAA;AAC7F,OAAO,EAAC,sBAAsB,EAAE,qBAAqB,EAAC,MAAM,8BAA8B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,EAAE,4BAA4B,CAAC,CAAA;QAChF,MAAM,MAAM,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAA;QACjD,MAAM,MAAM,CAAC,uBAAuB,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,OAAO,EAAE,CAAC,CAAA;QAC1E,MAAM,MAAM,CAAC,mBAAmB,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,CAAC,CAAA;QAC7E,MAAM,MAAM,CAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,OAAO,EAAE,CAAC,CAAA;QACxE,MAAM,MAAM,CAAC,cAAc,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,QAAQ,EAAE,CAAC,CAAA;QACjE,MAAM,MAAM,CAAC,WAAW,EAAE,aAAa,CAAC,CAAA;IAC1C,CAAC;IACD,OAAO;IACP,MAAM;IACN,mFAAmF;IACnF,OAAO;IACP,sEAAsE;IACtE,QAAQ;IACR,qFAAqF;IACrF,GAAG;IACH,qEAAqE;IACrE,OAAO;IACP,sFAAsF;IACtF,GAAG;IACH,6EAA6E;IAC7E,OAAO;IACP,iFAAiF;IACjF,QAAQ;IACR,8CAA8C;IAC9C,OAAO;IACP,uDAAuD;IACvD,kBAAkB;IAClB,8EAA8E;IAC9E,WAAW;IACX,qFAAqF;IACrF,aAAa;IACb,4EAA4E;IAC5E,IAAI;IACJ,+EAA+E;IAC/E,MAAM;IACN,kFAAkF;IAClF,QAAQ;IACR,mFAAmF;IACnF,YAAY;IACZ,OAAO;CACR,CAAA","sourcesContent":["/**\n * `engine` — the namespaced OEM-facing engine API (the \"(A) host API\" from the\n * Phase-1 contract). Host UI calls `engine.<domain>.<method>()`; each domain is a\n * typed facade over the runtime. (Exported from the `@glassly/engine` module, whose\n * name stays `engine` in code; the public API surface is `engine`.)\n *\n * It grows one facade at a time. The migration-era flat store/service exports\n * remain in a private GlasslyOS host package; they shrink as screens move onto\n * `engine.*`.\n */\nimport {configure, start as bootstrapStart, stop as bootstrapStop, updateUiSeams} from \"./runtime/bootstrap\"\nimport {cloudClientService} from \"./services/CloudClientService\"\nimport {hydrateDeviceStore, demoteOrphanedDefaultWearable} from \"./services/DeviceStoreHydration\"\nimport {startGlassesSettingsSync, stopGlassesSettingsSync} from \"./services/GlassesSettingsSync\"\nimport {startGlassesStatusProjection, stopGlassesStatusProjection} from \"./services/GlassesStatusProjection\"\nimport {startOtaService, stopOtaService} from \"./services/OtaService\"\nimport {startAudioCloudUplink, stopAudioCloudUplink} from \"./services/AudioCloudUplink\"\nimport sonioxDirectService from \"./services/soniox/SonioxDirectService\"\nimport {startSupportProfileSync, stopSupportProfileSync} from \"./services/SupportProfileSync\"\nimport {startDeviceEventRouter, stopDeviceEventRouter} from \"./services/DeviceEventRouter\"\nimport {startPhoneNotificationsSync, stopPhoneNotificationsSync} from \"./services/PhoneNotificationsSync\"\nimport {startSpeakerIdSync, stopSpeakerIdSync} from \"./services/SpeakerIdSync\"\nimport {startCaptionsTesterReportService, stopCaptionsTesterReportService} from \"./services/CaptionsTesterReportService\"\nimport {startJSCrashloopReportService, stopJSCrashloopReportService} from \"./services/JSCrashloopReportService\"\nimport {ensureMiniappEngine, stopMiniappEngine} from \"./services/MiniappEngine\"\nimport localMiniappRuntime from \"./services/LocalMiniappRuntime\"\nimport displayProcessor from \"./services/DisplayProcessor\"\nimport {gallerySyncService} from \"./services/asg/gallerySyncService\"\nimport {glasses} from \"./facades/glasses\"\nimport {display} from \"./facades/display\"\nimport {speech} from \"./facades/speech\"\nimport {session} from \"./facades/session\"\nimport {settings} from \"./facades/settings\"\nimport {dev} from \"./facades/dev\"\nimport {reports} from \"./facades/reports\"\nimport {ota} from \"./facades/ota\"\nimport {gallery} from \"./facades/gallery\"\nimport {miniapps} from \"./facades/miniapps\"\nimport {pairing} from \"./facades/pairing\"\nimport {phoneNotifications} from \"./facades/phoneNotifications\"\nimport {permissions} from \"./facades/permissions\"\nimport {notifications} from \"./facades/notifications\"\nimport {maps} from \"./facades/maps\"\nimport {memory} from \"./facades/memory\"\nimport {speakers} from \"./facades/speakers\"\nimport {providerKeys} from \"./facades/providerKeys\"\nimport {logBuffer} from \"./utils/devLogging\"\nimport customDashboardService from \"./services/CustomDashboardService\"\nimport dashboardCoordinator from \"./services/DashboardCoordinator\"\nimport gestureDotsService from \"./services/GestureDotsService\"\n\nexport const engine = {\n /** Front door — hand engine auth + config, then start/stop the runtime. */\n configure,\n /** Merge host-UI seams on a running runtime (scan overlay, wifi setup, …). */\n updateUiSeams,\n /** Start the runtime: mark started + construct/connect the cloud client + begin\n * syncing device settings to the glasses. */\n async start() {\n // Reports attach recent phone logs, so engine owns console interception for\n // OEM hosts too. Idempotent; the Glassly host may start it earlier.\n logBuffer.startConsoleInterception()\n await bootstrapStart()\n // Construct + connect the cloud client so the documented configure()+start()\n // lifecycle yields a live engine.session for OEMs. Idempotent for repeated\n // start() calls.\n cloudClientService.init()\n // Project native device status -> the engine stores (the inbound feed the rest\n // of the runtime reads). Established first so the stores are live before the\n // syncs below react to them.\n startGlassesStatusProjection((changed) => localMiniappRuntime.forwardEvent(\"glasses_connection_state\", changed))\n customDashboardService.start()\n dashboardCoordinator.start()\n gestureDotsService.start()\n // Route the rest of the inbound device events (wifi/hotspot/gallery -> stores+bus,\n // photo/stream -> coordinators, button/touch/accel/head -> miniapps, save_setting ->\n // store, miniapp_selected -> launcher) so a bare OEM gets device data, not just the\n // Glassly app's MantleManager.\n startDeviceEventRouter()\n // Hydration contract: the native DeviceStore is in-memory and starts empty\n // every launch; seed it from the persisted settings BEFORE start() resolves\n // so every post-start getDefaultDevice() read is a trustworthy two-state\n // answer (no false \"absent\" for genuinely-paired users at cold start).\n // Ordered before startGlassesSettingsSync so the settings load can't\n // double-push through the change subscription. A failed hydration must not\n // brick the runtime: start() continues, and the guards that consume\n // hasDefaultDevice() see the rejection and fail open.\n try {\n await hydrateDeviceStore()\n // Boot repair: a persisted default_wearable without a native default\n // device (identity abandoned mid-pairing, or resurrected from the server\n // before identity stopped syncing) demotes to pending_wearable so hosts\n // render finish-pairing instead of a connect that would throw.\n await demoteOrphanedDefaultWearable()\n } catch (error) {\n console.warn(\"engine.start: device-store hydration failed:\", error instanceof Error ? error.message : error)\n }\n // Project the glasses' OTA events into the store for the engine.ota read surface.\n startOtaService()\n // Forward glasses mic_lc3 frames to the v2 cloud session so cloud transcription\n // works for any host (not just the Glassly app's host-side MantleManager fork).\n startAudioCloudUplink()\n // Phone -> Soniox direct transcription (user-supplied API key). Started\n // after device-store hydration so the persisted key is already loaded.\n sonioxDirectService.start()\n try {\n await cloudClientService.syncCoreTokenToBluetooth()\n } catch (error) {\n console.warn(\n \"engine.start: initial Cloud V2 core token sync failed:\",\n error instanceof Error ? error.message : error,\n )\n }\n startSupportProfileSync()\n // Push device-setting changes to the glasses for ANY host, so\n // engine.glasses.settings.set() reaches the device (not just the Glassly app).\n startGlassesSettingsSync()\n // Same for phone-notification config -> the native listener (Android).\n startPhoneNotificationsSync()\n // On-device speaker identification: sync the enabled setting + enrolled\n // profile centroids to the native SpeakerIdEngine, and start the resolver\n // that annotates cloud transcripts with resolved speaker identities.\n startSpeakerIdSync()\n // Android internal/e2e: laptop captions tester can broadcast a failure intent;\n // engine owns turning that into a Cloud V2 report.\n startCaptionsTesterReportService()\n // GlasslyJS crashloop-disabled is runtime state; engine owns filing the\n // automatic report while hosts only render alert/telemetry side effects.\n startJSCrashloopReportService()\n // Bring up the local-miniapp engine so a bare OEM can run GlasslyJS miniapps:\n // the LocalMiniappRuntime (registry + WebView bridge), the GlasslyJS router\n // (crust-bound spawn/dispatch pump + launcher wiring), the DisplayProcessor\n // (layout arbitration over the engine stores), and the gallery-sync service.\n // All idempotent — when the Glassly app's host bootstrap also calls these, the\n // second call is a no-op. Host-only crashloop telemetry is attached\n // separately by the Glassly app.\n localMiniappRuntime.initialize()\n ensureMiniappEngine()\n displayProcessor.attachToRuntime()\n gallerySyncService.initialize()\n },\n /** Stop the runtime: tear down the settings sync + cloud client + mark stopped.\n * Each step is guarded so one failing teardown can't skip the rest and leak\n * the remaining runtime services. */\n async stop() {\n const safely = async (label: string, step: () => unknown): Promise<void> => {\n try {\n await step()\n } catch (error) {\n console.warn(`engine.stop: ${label} failed:`, error)\n }\n }\n await safely(\"glasses settings sync\", stopGlassesSettingsSync)\n await safely(\"glasses status projection\", stopGlassesStatusProjection)\n await safely(\"device event router\", stopDeviceEventRouter)\n await safely(\"dashboard coordinator\", () => dashboardCoordinator.stop())\n await safely(\"custom dashboard service\", () => customDashboardService.stop())\n await safely(\"gesture dots service\", () => gestureDotsService.stop())\n await safely(\"ota service\", stopOtaService)\n await safely(\"audio cloud uplink\", stopAudioCloudUplink)\n await safely(\"soniox direct service\", () => sonioxDirectService.stop())\n await safely(\"support profile sync\", stopSupportProfileSync)\n await safely(\"phone notifications sync\", stopPhoneNotificationsSync)\n await safely(\"speaker id sync\", stopSpeakerIdSync)\n await safely(\"captions tester report service\", stopCaptionsTesterReportService)\n await safely(\"glasslyjs crashloop report service\", stopJSCrashloopReportService)\n await safely(\"miniapp engine\", stopMiniappEngine)\n await safely(\"local miniapp runtime\", () => localMiniappRuntime.cleanup())\n await safely(\"display processor\", () => displayProcessor.detachFromRuntime())\n await safely(\"gallery sync service\", () => gallerySyncService.cleanup())\n await safely(\"cloud client\", () => cloudClientService.shutdown())\n await safely(\"bootstrap\", bootstrapStop)\n },\n glasses,\n speech,\n /** Cloud (cloud-v2) live-session status + account ops — engine owns the client. */\n session,\n /** Typed keyed user settings over the engine-owned settings store. */\n settings,\n /** Developer/debug surface (backend+cloud URL overrides, reconnect, min version). */\n dev,\n /** Bug-report, automatic runtime report, and feedback submission. */\n reports,\n /** Firmware OTA read/observe surface (updateAvailable/status + on* subscriptions). */\n ota,\n /** Gallery sync: status/onStatus · onNotice (host renders) · sync/cancel. */\n gallery,\n /** Miniapp lifecycle (the WebView bridge primitives are exported separately). */\n miniapps,\n /** First-time glasses discovery + pairing. */\n pairing,\n /** Phone→glasses notification forwarding (Android). */\n phoneNotifications,\n /** OS permissions (check/request/openSettings + per-miniapp requirements). */\n permissions,\n /** Inbound alerts engine→host (crashloop, version-incompatible, connection loss). */\n notifications,\n /** Maps providers — user-supplied Mapbox access token (Settings > Keys). */\n maps,\n /** Shared user-scoped memory timeline (Settings > Memory + session.memory). */\n memory,\n /** Device-local voice profiles for on-device speaker ID (Settings > Speakers). */\n speakers,\n /** AI/voice provider key validation — user-supplied keys (Settings > API Keys). */\n providerKeys,\n display,\n}\n"]}
1
+ {"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAC,SAAS,EAAE,KAAK,IAAI,cAAc,EAAE,IAAI,IAAI,aAAa,EAAE,aAAa,EAAC,MAAM,qBAAqB,CAAA;AAC5G,OAAO,EAAC,kBAAkB,EAAC,MAAM,+BAA+B,CAAA;AAChE,OAAO,EAAC,kBAAkB,EAAE,6BAA6B,EAAC,MAAM,iCAAiC,CAAA;AACjG,OAAO,EAAC,uBAAuB,EAAE,sBAAsB,EAAC,MAAM,+BAA+B,CAAA;AAC7F,OAAO,EAAC,wBAAwB,EAAE,uBAAuB,EAAC,MAAM,gCAAgC,CAAA;AAChG,OAAO,EAAC,4BAA4B,EAAE,2BAA2B,EAAC,MAAM,oCAAoC,CAAA;AAC5G,OAAO,EAAC,eAAe,EAAE,cAAc,EAAC,MAAM,uBAAuB,CAAA;AACrE,OAAO,EAAC,qBAAqB,EAAE,oBAAoB,EAAC,MAAM,6BAA6B,CAAA;AACvF,OAAO,mBAAmB,MAAM,uCAAuC,CAAA;AACvE,OAAO,EAAC,uBAAuB,EAAE,sBAAsB,EAAC,MAAM,+BAA+B,CAAA;AAC7F,OAAO,EAAC,sBAAsB,EAAE,qBAAqB,EAAC,MAAM,8BAA8B,CAAA;AAC1F,OAAO,EAAC,0BAA0B,EAAE,yBAAyB,EAAC,MAAM,0BAA0B,CAAA;AAC9F,OAAO,EAAC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M,CAAC,gCAAgC,EAAE,+BAA+B,CAAC,CAAA;QAC/E,MAAM,MAAM,CAAC,6BAA6B,EAAE,4BAA4B,CAAC,CAAA;QACzE,MAAM,MAAM,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAA;QACjD,MAAM,MAAM,CAAC,uBAAuB,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,OAAO,EAAE,CAAC,CAAA;QAC1E,MAAM,MAAM,CAAC,mBAAmB,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,CAAC,CAAA;QAC7E,MAAM,MAAM,CAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,OAAO,EAAE,CAAC,CAAA;QACxE,MAAM,MAAM,CAAC,cAAc,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,QAAQ,EAAE,CAAC,CAAA;QACjE,MAAM,MAAM,CAAC,WAAW,EAAE,aAAa,CAAC,CAAA;IAC1C,CAAC;IACD,OAAO;IACP,MAAM;IACN,mFAAmF;IACnF,OAAO;IACP,sEAAsE;IACtE,QAAQ;IACR,qFAAqF;IACrF,GAAG;IACH,qEAAqE;IACrE,OAAO;IACP,sFAAsF;IACtF,GAAG;IACH,6EAA6E;IAC7E,OAAO;IACP,iFAAiF;IACjF,QAAQ;IACR,8CAA8C;IAC9C,OAAO;IACP,uDAAuD;IACvD,kBAAkB;IAClB,8EAA8E;IAC9E,WAAW;IACX,qFAAqF;IACrF,aAAa;IACb,4EAA4E;IAC5E,IAAI;IACJ,+EAA+E;IAC/E,MAAM;IACN,kFAAkF;IAClF,QAAQ;IACR,mFAAmF;IACnF,YAAY;IACZ,OAAO;CACR,CAAA","sourcesContent":["/**\n * `engine` — the namespaced OEM-facing engine API (the \"(A) host API\" from the\n * Phase-1 contract). Host UI calls `engine.<domain>.<method>()`; each domain is a\n * typed facade over the runtime. (Exported from the `@glassly/engine` module, whose\n * name stays `engine` in code; the public API surface is `engine`.)\n *\n * It grows one facade at a time. The migration-era flat store/service exports\n * remain in a private Glassly host package; they shrink as screens move onto\n * `engine.*`.\n */\nimport {configure, start as bootstrapStart, stop as bootstrapStop, updateUiSeams} from \"./runtime/bootstrap\"\nimport {cloudClientService} from \"./services/CloudClientService\"\nimport {hydrateDeviceStore, demoteOrphanedDefaultWearable} from \"./services/DeviceStoreHydration\"\nimport {startPairedGlassesLatch, stopPairedGlassesLatch} from \"./services/PairedGlassesLatch\"\nimport {startGlassesSettingsSync, stopGlassesSettingsSync} from \"./services/GlassesSettingsSync\"\nimport {startGlassesStatusProjection, stopGlassesStatusProjection} from \"./services/GlassesStatusProjection\"\nimport {startOtaService, stopOtaService} from \"./services/OtaService\"\nimport {startAudioCloudUplink, stopAudioCloudUplink} from \"./services/AudioCloudUplink\"\nimport sonioxDirectService from \"./services/soniox/SonioxDirectService\"\nimport {startSupportProfileSync, stopSupportProfileSync} from \"./services/SupportProfileSync\"\nimport {startDeviceEventRouter, stopDeviceEventRouter} from \"./services/DeviceEventRouter\"\nimport {startPhoneActivityTracking, stopPhoneActivityTracking} from \"./services/PhoneActivity\"\nimport {startPhoneNotificationsSync, stopPhoneNotificationsSync} from \"./services/PhoneNotificationsSync\"\nimport {startSpeakerIdSync, stopSpeakerIdSync} from \"./services/SpeakerIdSync\"\nimport {startCaptionsTesterReportService, stopCaptionsTesterReportService} from \"./services/CaptionsTesterReportService\"\nimport {startJSCrashloopReportService, stopJSCrashloopReportService} from \"./services/JSCrashloopReportService\"\nimport {ensureMiniappEngine, stopMiniappEngine} from \"./services/MiniappEngine\"\nimport localMiniappRuntime from \"./services/LocalMiniappRuntime\"\nimport displayProcessor from \"./services/DisplayProcessor\"\nimport {gallerySyncService} from \"./services/asg/gallerySyncService\"\nimport {glasses} from \"./facades/glasses\"\nimport {display} from \"./facades/display\"\nimport {speech} from \"./facades/speech\"\nimport {session} from \"./facades/session\"\nimport {settings} from \"./facades/settings\"\nimport {dev} from \"./facades/dev\"\nimport {reports} from \"./facades/reports\"\nimport {ota} from \"./facades/ota\"\nimport {gallery} from \"./facades/gallery\"\nimport {miniapps} from \"./facades/miniapps\"\nimport {pairing} from \"./facades/pairing\"\nimport {phoneNotifications} from \"./facades/phoneNotifications\"\nimport {permissions} from \"./facades/permissions\"\nimport {notifications} from \"./facades/notifications\"\nimport {maps} from \"./facades/maps\"\nimport {memory} from \"./facades/memory\"\nimport {speakers} from \"./facades/speakers\"\nimport {providerKeys} from \"./facades/providerKeys\"\nimport {logBuffer} from \"./utils/devLogging\"\nimport pageHost from \"./services/pages/PageHost\"\nimport gestureDotsService from \"./services/GestureDotsService\"\n\nexport const engine = {\n /** Front door — hand engine auth + config, then start/stop the runtime. */\n configure,\n /** Merge host-UI seams on a running runtime (scan overlay, wifi setup, …). */\n updateUiSeams,\n /** Start the runtime: mark started + construct/connect the cloud client + begin\n * syncing device settings to the glasses. */\n async start() {\n // Reports attach recent phone logs, so engine owns console interception for\n // OEM hosts too. Idempotent; the Glassly host may start it earlier.\n logBuffer.startConsoleInterception()\n await bootstrapStart()\n // Construct + connect the cloud client so the documented configure()+start()\n // lifecycle yields a live engine.session for OEMs. Idempotent for repeated\n // start() calls.\n cloudClientService.init()\n // Project native device status -> the engine stores (the inbound feed the rest\n // of the runtime reads). Established first so the stores are live before the\n // syncs below react to them.\n startGlassesStatusProjection((changed) => localMiniappRuntime.forwardEvent(\"glasses_connection_state\", changed))\n // Lock + foreground state, read by the dashboard's notification gate and\n // the G2 notification ctrl below; up before either consumer.\n startPhoneActivityTracking()\n // The overlay slot's owner: the designated dashboard miniapp's page shows\n // through it (ADR-0006), so it is up before the miniapp runtime.\n pageHost.start()\n gestureDotsService.start()\n // Route the rest of the inbound device events (wifi/hotspot/gallery -> stores+bus,\n // photo/stream -> coordinators, button/touch/accel/head -> miniapps, save_setting ->\n // store, miniapp_selected -> launcher) so a bare OEM gets device data, not just the\n // Glassly app's MantleManager.\n startDeviceEventRouter()\n // Hydration contract: the native DeviceStore is in-memory and starts empty\n // every launch; seed it from the persisted settings BEFORE start() resolves\n // so every post-start getDefaultDevice() read is a trustworthy two-state\n // answer (no false \"absent\" for genuinely-paired users at cold start).\n // Ordered before startGlassesSettingsSync so the settings load can't\n // double-push through the change subscription. A failed hydration must not\n // brick the runtime: start() continues, and the guards that consume\n // hasDefaultDevice() see the rejection and fail open.\n try {\n await hydrateDeviceStore()\n // Boot repair: a persisted default_wearable without a native default\n // device (identity abandoned mid-pairing, or resurrected from the server\n // before identity stopped syncing) demotes to pending_wearable so hosts\n // render finish-pairing instead of a connect that would throw.\n await demoteOrphanedDefaultWearable()\n } catch (error) {\n console.warn(\"engine.start: device-store hydration failed:\", error instanceof Error ? error.message : error)\n }\n // After the settings load so an already-paired phone latches on this start.\n startPairedGlassesLatch()\n // Project the glasses' OTA events into the store for the engine.ota read surface.\n startOtaService()\n // Forward glasses mic_lc3 frames to the v2 cloud session so cloud transcription\n // works for any host (not just the Glassly app's host-side MantleManager fork).\n startAudioCloudUplink()\n // Phone -> Soniox direct transcription (user-supplied API key). Started\n // after device-store hydration so the persisted key is already loaded.\n sonioxDirectService.start()\n // Not awaited: the exchange behind it is a Core round trip with no client\n // deadline, and start() must resolve offline. The glasses get the token\n // when it lands; identity resolution joins the same single-flight exchange.\n void cloudClientService.syncCoreTokenToBluetooth().catch((error) => {\n console.warn(\n \"engine.start: initial Cloud V2 core token sync failed:\",\n error instanceof Error ? error.message : error,\n )\n })\n startSupportProfileSync()\n // Push device-setting changes to the glasses for ANY host, so\n // engine.glasses.settings.set() reaches the device (not just the Glassly app).\n startGlassesSettingsSync()\n // Same for phone-notification config -> the native listener (Android).\n startPhoneNotificationsSync()\n // On-device speaker identification: sync the enabled setting + enrolled\n // profile centroids to the native SpeakerIdEngine, and start the resolver\n // that annotates cloud transcripts with resolved speaker identities.\n startSpeakerIdSync()\n // Android internal/e2e: laptop captions tester can broadcast a failure intent;\n // engine owns turning that into a Cloud V2 report.\n startCaptionsTesterReportService()\n // JSRuntime crashloop-disabled is runtime state; engine owns filing the\n // automatic report while hosts only render alert/telemetry side effects.\n startJSCrashloopReportService()\n // Bring up the local-miniapp engine so a bare OEM can run JSRuntime miniapps:\n // the LocalMiniappRuntime (registry + WebView bridge), the JSRuntime router\n // (crust-bound spawn/dispatch pump + launcher wiring), the DisplayProcessor\n // (layout arbitration over the engine stores), and the gallery-sync service.\n // All idempotent — when the Glassly app's host bootstrap also calls these, the\n // second call is a no-op. Host-only crashloop telemetry is attached\n // separately by the Glassly app.\n localMiniappRuntime.initialize()\n ensureMiniappEngine()\n displayProcessor.attachToRuntime()\n gallerySyncService.initialize()\n },\n /** Stop the runtime: tear down the settings sync + cloud client + mark stopped.\n * Each step is guarded so one failing teardown can't skip the rest and leak\n * the remaining runtime services. */\n async stop() {\n const safely = async (label: string, step: () => unknown): Promise<void> => {\n try {\n await step()\n } catch (error) {\n console.warn(`engine.stop: ${label} failed:`, error)\n }\n }\n await safely(\"glasses settings sync\", stopGlassesSettingsSync)\n await safely(\"paired glasses latch\", stopPairedGlassesLatch)\n await safely(\"glasses status projection\", stopGlassesStatusProjection)\n await safely(\"device event router\", stopDeviceEventRouter)\n await safely(\"page host\", () => pageHost.stop())\n await safely(\"gesture dots service\", () => gestureDotsService.stop())\n await safely(\"ota service\", stopOtaService)\n await safely(\"audio cloud uplink\", stopAudioCloudUplink)\n await safely(\"soniox direct service\", () => sonioxDirectService.stop())\n await safely(\"support profile sync\", stopSupportProfileSync)\n await safely(\"phone notifications sync\", stopPhoneNotificationsSync)\n await safely(\"phone activity tracking\", stopPhoneActivityTracking)\n await safely(\"speaker id sync\", stopSpeakerIdSync)\n await safely(\"captions tester report service\", stopCaptionsTesterReportService)\n await safely(\"js crashloop report service\", stopJSCrashloopReportService)\n await safely(\"miniapp engine\", stopMiniappEngine)\n await safely(\"local miniapp runtime\", () => localMiniappRuntime.cleanup())\n await safely(\"display processor\", () => displayProcessor.detachFromRuntime())\n await safely(\"gallery sync service\", () => gallerySyncService.cleanup())\n await safely(\"cloud client\", () => cloudClientService.shutdown())\n await safely(\"bootstrap\", bootstrapStop)\n },\n glasses,\n speech,\n /** Cloud (cloud-v2) live-session status + account ops — engine owns the client. */\n session,\n /** Typed keyed user settings over the engine-owned settings store. */\n settings,\n /** Developer/debug surface (backend+cloud URL overrides, reconnect, min version). */\n dev,\n /** Bug-report, automatic runtime report, and feedback submission. */\n reports,\n /** Firmware OTA read/observe surface (updateAvailable/status + on* subscriptions). */\n ota,\n /** Gallery sync: status/onStatus · onNotice (host renders) · sync/cancel. */\n gallery,\n /** Miniapp lifecycle (the WebView bridge primitives are exported separately). */\n miniapps,\n /** First-time glasses discovery + pairing. */\n pairing,\n /** Phone→glasses notification forwarding (Android). */\n phoneNotifications,\n /** OS permissions (check/request/openSettings + per-miniapp requirements). */\n permissions,\n /** Inbound alerts engine→host (crashloop, version-incompatible, connection loss). */\n notifications,\n /** Maps providers — user-supplied Mapbox access token (Settings > Keys). */\n maps,\n /** Shared user-scoped memory timeline (Settings > Memory + session.memory). */\n memory,\n /** Device-local voice profiles for on-device speaker ID (Settings > Speakers). */\n speakers,\n /** AI/voice provider key validation — user-supplied keys (Settings > API Keys). */\n providerKeys,\n display,\n}\n"]}
@@ -1,3 +1,5 @@
1
+ import { sendGesture } from "../services/GlassesTouchInput";
2
+ import { type DashboardOpenReport } from "../services/debug/DashboardOpenTrace";
1
3
  declare function projectRuntimeStatus(): {
2
4
  searching: boolean;
3
5
  micRanking: import("@glassly/bluetooth-sdk").MicMode[];
@@ -23,6 +25,8 @@ declare function projectRuntimeStatus(): {
23
25
  };
24
26
  export type DevRuntimeStatusSnapshot = ReturnType<typeof projectRuntimeStatus>;
25
27
  export declare const dev: {
28
+ /** Inject a glasses gesture through the normal dashboard/miniapp input policy. */
29
+ sendGesture: typeof sendGesture;
26
30
  /** The cloud-v2 core/runtime URL overrides. */
27
31
  cloudUrls: () => {
28
32
  core?: string;
@@ -64,6 +68,11 @@ export declare const dev: {
64
68
  runtimeStatus: () => DevRuntimeStatusSnapshot;
65
69
  /** Subscribe to the projected engine runtime status; returns an unsubscribe. */
66
70
  onRuntimeStatus: (cb: (status: DevRuntimeStatusSnapshot) => void) => (() => void);
71
+ /**
72
+ * Each finished dashboard open while the debug_dashboard_open_timing setting
73
+ * is on: a ready-made title/body plus the stage timings. Returns an unsubscribe.
74
+ */
75
+ onDashboardOpenTrace: (cb: (report: DashboardOpenReport) => void) => (() => void);
67
76
  };
68
77
  export {};
69
78
  //# sourceMappingURL=dev.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/facades/dev.ts"],"names":[],"mappings":"AAgEA,iBAAS,oBAAoB;;;;;;;;;;;;;;;;;;;;;;EAuB5B;AAED,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAE9E,eAAO,MAAM,GAAG;IACd,+CAA+C;qBAChC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAC;IAIhD,0EAA0E;yBACrD;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAC;IAkBtD,8EAA8E;0BAC1D,IAAI;IAExB,iFAAiF;uBAChE,MAAM;IACvB;;;OAGG;2BACkB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAK5C;;;;;;;;;OASG;0BAEI,MAAM,SACJ,MAAM,KACZ,OAAO,CAAC;QAAC,EAAE,EAAE,IAAI,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,GAAG;QAAC,EAAE,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC;IA6CtF,qEAAqE;yBAClD,wBAAwB;IAE3C,gFAAgF;0BAC1D,CAAC,MAAM,EAAE,wBAAwB,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC;CAoBhF,CAAA"}
1
+ {"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/facades/dev.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAC,WAAW,EAAC,MAAM,+BAA+B,CAAA;AACzD,OAA2B,EAAC,KAAK,mBAAmB,EAAC,MAAM,sCAAsC,CAAA;AA2CjG,iBAAS,oBAAoB;;;;;;;;;;;;;;;;;;;;;;EAuB5B;AAED,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAE9E,eAAO,MAAM,GAAG;IACd,kFAAkF;;IAElF,+CAA+C;qBAChC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAC;IAIhD,0EAA0E;yBACrD;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAC;IAkBtD,8EAA8E;0BAC1D,IAAI;IAExB,iFAAiF;uBAChE,MAAM;IACvB;;;OAGG;2BACkB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAK5C;;;;;;;;;OASG;0BAEI,MAAM,SACJ,MAAM,KACZ,OAAO,CAAC;QAAC,EAAE,EAAE,IAAI,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,GAAG;QAAC,EAAE,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC;IA6CtF,qEAAqE;yBAClD,wBAAwB;IAE3C,gFAAgF;0BAC1D,CAAC,MAAM,EAAE,wBAAwB,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC;IAqB/E;;;OAGG;+BACwB,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC;CAChF,CAAA"}
@@ -20,6 +20,8 @@ import { getConfigValues } from "../runtime/bootstrap";
20
20
  import { decideDevLaunchRoute } from "../utils/devMiniappLaunch";
21
21
  import { deriveDevPackageId, registerDevApp, DEV_APP_PACKAGE_NAME } from "../services/AppRegistry";
22
22
  import { useAppStatusStore } from "../stores/apps";
23
+ import { sendGesture } from "../services/GlassesTouchInput";
24
+ import dashboardOpenTrace from "../services/debug/DashboardOpenTrace";
23
25
  /**
24
26
  * Reconnect the cloud client onto the current cloud-URL overrides. Explicit
25
27
  * partial overrides merge over the boot-resolved config (which carries the
@@ -82,6 +84,8 @@ function projectRuntimeStatus() {
82
84
  };
83
85
  }
84
86
  export const dev = {
87
+ /** Inject a glasses gesture through the normal dashboard/miniapp input policy. */
88
+ sendGesture,
85
89
  /** The cloud-v2 core/runtime URL overrides. */
86
90
  cloudUrls: () => {
87
91
  const s = useSettingsStore.getState();
@@ -200,5 +204,10 @@ export const dev = {
200
204
  unsubscribers.forEach((unsubscribe) => unsubscribe());
201
205
  };
202
206
  },
207
+ /**
208
+ * Each finished dashboard open while the debug_dashboard_open_timing setting
209
+ * is on: a ready-made title/body plus the stage timings. Returns an unsubscribe.
210
+ */
211
+ onDashboardOpenTrace: (cb) => dashboardOpenTrace.onReport(cb),
203
212
  };
204
213
  //# sourceMappingURL=dev.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dev.js","sourceRoot":"","sources":["../../src/facades/dev.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,YAAY,MAAM,iCAAiC,CAAA;AAC1D,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAC,yBAAyB,EAAC,MAAM,6BAA6B,CAAA;AACrE,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAC,gBAAgB,EAAE,QAAQ,EAAC,MAAM,oBAAoB,CAAA;AAC7D,OAAO,EAAC,0BAA0B,EAAC,MAAM,8BAA8B,CA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WAAW,EAAE,CAAC,CAAA;QACvD,CAAC,CAAA;IACH,CAAC;CACF,CAAA","sourcesContent":["/**\n * dev facade — `engine.dev`: developer/debug surface over engine-owned state.\n * Backend/cloud URL overrides read+write the engine settings store; the cloud\n * URL setters reconnect the engine-owned cloud client onto the new endpoints;\n *\n * NOTE: the dev-time endpoint *resolution* (Metro-host auto-detect, env defaults)\n * still lives host-side in `@/services/cloudClient` during the migration; this\n * facade manages the explicit overrides + reconnect.\n */\nimport BluetoothSdk from \"@glassly/bluetooth-sdk/internal\"\nimport {isGlassesReady} from \"../services/GlassesReadiness\"\nimport {useCloudClientStatusStore} from \"../stores/cloudClientStatus\"\nimport {useConnectionStore} from \"../stores/connection\"\nimport {useCoreStore} from \"../stores/core\"\nimport {useGlassesStore} from \"../stores/glasses\"\nimport {useSettingsStore, SETTINGS} from \"../stores/settings\"\nimport {useTranscriptionDebugStore} from \"../stores/transcriptionDebug\"\nimport {cloudClientService} from \"../services/CloudClientService\"\nimport {getConfigValues} from \"../runtime/bootstrap\"\nimport {decideDevLaunchRoute} from \"../utils/devMiniappLaunch\"\nimport {deriveDevPackageId, registerDevApp, DEV_APP_PACKAGE_NAME, type DevAppRecord} from \"../services/AppRegistry\"\nimport {useAppStatusStore} from \"../stores/apps\"\n\ntype CloudUrlOverrides = {core?: string; runtime?: string}\n\n/**\n * Reconnect the cloud client onto the current cloud-URL overrides. Explicit\n * partial overrides merge over the boot-resolved config (which carries the\n * host's Metro/env URL resolution); both empty clears the live override.\n */\nfunction applyCloudUrlReconnect(urls: CloudUrlOverrides = currentCloudUrlOverrides()): void {\n const resolved = resolveCloudUrlReconnectTarget(urls)\n if (resolved === undefined) {\n cloudClientService.reconnect(null)\n } else if (resolved) {\n cloudClientService.reconnect(resolved)\n } else {\n console.warn(\"engine.dev.setCloudUrls: partial cloud override missing boot-resolved sibling endpoint\")\n }\n}\n\nfunction currentCloudUrlOverrides(): CloudUrlOverrides {\n const s = useSettingsStore.getState()\n return {\n core: trimSetting(s.getSetting(SETTINGS.cloud_core_url.key)),\n runtime: trimSetting(s.getSetting(SETTINGS.cloud_runtime_url.key)),\n }\n}\n\nfunction resolveCloudUrlReconnectTarget(urls: CloudUrlOverrides): {core: string; runtime: string} | null | undefined {\n const core = trimSetting(urls.core)\n const runtime = trimSetting(urls.runtime)\n if (!core && !runtime) return undefined\n\n const config = getConfigValues()\n const resolvedCore = core || config.coreUrl?.trim()\n const resolvedRuntime = runtime || config.runtimeUrl?.trim()\n return resolvedCore && resolvedRuntime ? {core: resolvedCore, runtime: resolvedRuntime} : null\n}\n\nfunction trimSetting(value: unknown): string | undefined {\n return typeof value === \"string\" && value.trim().length > 0 ? value.trim() : undefined\n}\n\nfunction projectRuntimeStatus() {\n const core = useCoreStore.getState()\n const glasses = useGlassesStore.getState()\n const connection = useConnectionStore.getState()\n const cloudClient = useCloudClientStatusStore.getState()\n const transcriptionDebug = useTranscriptionDebugStore.getState()\n return {\n searching: core.searching,\n // Copy: the snapshot must not hand callers a mutable reference into the store.\n micRanking: [...core.micRanking],\n currentMic: core.currentMic,\n systemMicUnavailable: core.systemMicUnavailable,\n glassesConnected: glasses.connection.state === \"connected\",\n glassesFullyBooted: isGlassesReady(glasses.connection),\n bluetoothClassicConnected: glasses.bluetoothClassicConnected,\n coreStatus: connection.status,\n cloudClientStatus: cloudClient.status,\n cloudClientAudioTransport: cloudClient.audioTransport,\n transcriptionSubscribers: [...transcriptionDebug.transcriptionSubscribers],\n translationSubscribers: [...transcriptionDebug.translationSubscribers],\n recentTranscriptSources: {...transcriptionDebug.recentTranscriptSources},\n cloudAudioSubscriptionWrite: {...transcriptionDebug.cloudAudioSubscriptionWrite},\n }\n}\n\nexport type DevRuntimeStatusSnapshot = ReturnType<typeof projectRuntimeStatus>\n\nexport const dev = {\n /** The cloud-v2 core/runtime URL overrides. */\n cloudUrls: (): {core?: string; runtime?: string} => {\n const s = useSettingsStore.getState()\n return {core: s.getSetting(SETTINGS.cloud_core_url.key), runtime: s.getSetting(SETTINGS.cloud_runtime_url.key)}\n },\n /** Override the cloud-v2 URLs and reconnect the live client onto them. */\n setCloudUrls: (urls: {core?: string; runtime?: string}) => {\n const next = {...currentCloudUrlOverrides(), ...urls}\n const resolved = resolveCloudUrlReconnectTarget(next)\n if (resolved === null) {\n console.warn(\"engine.dev.setCloudUrls: ignoring partial cloud override without a resolvable sibling endpoint\")\n return\n }\n\n const s = useSettingsStore.getState()\n if (urls.core !== undefined) s.setSetting(SETTINGS.cloud_core_url.key, urls.core)\n if (urls.runtime !== undefined) s.setSetting(SETTINGS.cloud_runtime_url.key, urls.runtime)\n if (resolved === undefined) {\n cloudClientService.reconnect(null)\n } else {\n cloudClientService.reconnect(resolved)\n }\n },\n\n /** Tear down + rebuild the live cloud client (the dev \"reconnect\" button). */\n reconnectCloud: (): void => applyCloudUrlReconnect(),\n\n /** Current native (BLE-process) memory usage in MB — a dev/diagnostics gauge. */\n getMemoryMB: (): number => BluetoothSdk.getMemoryMB(),\n /**\n * Phone-side bluetooth runtime snapshot (the core store read-model: scan/mic/\n * search state) — the diagnostics/data-export surface. Shallow copy.\n */\n bluetoothStatus: (): Record<string, unknown> => {\n const {setCoreInfo: _setCoreInfo, reset: _reset, ...state} = useCoreStore.getState()\n return {...state}\n },\n\n /**\n * Side-load a miniapp being served from a dev machine (the `glassly dev` / CLI\n * flow) by its URL: probes `<url>/miniapp.json`, and on a reachable manifest\n * registers it under its manifest package so it appears in `engine.miniapps`\n * and can coexist with other dev miniapps. This is the OEM-host equivalent\n * of the first-party\n * developer-URL screen — the registration itself is engine-internal, so a\n * host reaches it here rather than the internal registry. Rendering still\n * flows through the normal display path once the miniapp is started.\n */\n loadDevMiniapp: async (\n url: string,\n name?: string,\n ): Promise<{ok: true; packageName: string; name: string} | {ok: false; error: string}> => {\n const devUrl = url.trim().replace(/\\/+$/, \"\")\n if (!devUrl) return {ok: false, error: \"empty url\"}\n const result = await decideDevLaunchRoute(\"\", devUrl)\n if (result.decision !== \"live\") {\n return {ok: false, error: \"dev server unreachable, or no miniapp.json served there\"}\n }\n const manifest = result.manifest\n const appName = name ?? manifest.name ?? \"Dev Miniapp\"\n const packageName = (manifest.packageName as string | undefined) ?? DEV_APP_PACKAGE_NAME\n // Persist the host that answered — not the stale input IP — so home-tile\n // relaunches skip a dead LAN address after mDNS/Metro failover.\n const resolvedUrl = result.resolvedUrl || devUrl\n // The `glassly-miniapp dev` server puts the hot-reload/log sidecar on the\n // user port PLUS ONE — same convention as the first-party developer-URL\n // screen's deriveDevPort.\n let devPort: number | undefined\n try {\n const parsed = Number(new URL(resolvedUrl).port)\n devPort = Number.isFinite(parsed) && parsed > 0 ? parsed + 1 : undefined\n } catch {\n devPort = undefined\n }\n // The record is stored under a namespaced dev id (deriveDevPackageId) so\n // it survives release installs of the manifest package — stop/refresh and\n // the returned packageName must use that id, which registerDevApp returns.\n const devPackageId = deriveDevPackageId(packageName)\n const existing = useAppStatusStore.getState().apps.find((app) => app.packageName === devPackageId)\n if (existing?.running) await useAppStatusStore.getState().stop(devPackageId)\n const record = await registerDevApp({\n packageName,\n name: appName,\n iconUrl: manifest.icon ? new URL(manifest.icon, `${resolvedUrl}/`).toString() : `${resolvedUrl}/icon.png`,\n // Persist the host that answered — not the stale input IP.\n devUrl: resolvedUrl,\n devPort,\n type: manifest.type as DevAppRecord[\"type\"],\n permissions: manifest.permissions as DevAppRecord[\"permissions\"],\n hardwareRequirements: manifest.hardwareRequirements as DevAppRecord[\"hardwareRequirements\"],\n actions: manifest.actions as DevAppRecord[\"actions\"],\n })\n await useAppStatusStore.getState().refresh()\n return {ok: true, packageName: record.packageName, name: appName}\n },\n\n /** Current engine runtime status for engine-owned debug surfaces. */\n runtimeStatus: (): DevRuntimeStatusSnapshot => projectRuntimeStatus(),\n\n /** Subscribe to the projected engine runtime status; returns an unsubscribe. */\n onRuntimeStatus: (cb: (status: DevRuntimeStatusSnapshot) => void): (() => void) => {\n let last = JSON.stringify(projectRuntimeStatus())\n const notify = () => {\n const snap = projectRuntimeStatus()\n const key = JSON.stringify(snap)\n if (key === last) return\n last = key\n cb(snap)\n }\n const unsubscribers = [\n useCoreStore.subscribe(notify),\n useGlassesStore.subscribe(notify),\n useConnectionStore.subscribe(notify),\n useCloudClientStatusStore.subscribe(notify),\n useTranscriptionDebugStore.subscribe(notify),\n ]\n return () => {\n unsubscribers.forEach((unsubscribe) => unsubscribe())\n }\n },\n}\n"]}
1
+ {"version":3,"file":"dev.js","sourceRoot":"","sources":["../../src/facades/dev.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,YAAY,MAAM,iCAAiC,CAAA;AAC1D,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAC,yBAAyB,EAAC,MAAM,6BAA6B,CAAA;AACrE,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAC,gBAAgB,EAAE,QAAQ,EAAC,MAAM,oBAAoB,CAAA;AAC7D,OAAO,EAAC,0BAA0B,EAAC,MAAM,8BAA8B,CAAA;AACvE,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAA;AACjE,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAC,kBAAkB,EAAE,cAAc,EAAE,oBAAoB,EAAoB,MAAM,yBAAyB,CAAA;AACnH,OAAO,EAAC,iBAAiB,EAAC,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAC,WAAW,EAAC,MAAM,+BAA+B,CAAA;AACzD,OAAO,kBAA8C,MAAM,sCAAsC,CAAA;AAIjG;;;;GAIG;AACH,SAAS,sBAAsB,CAAC,OAA0B,wBAAwB,EAAE;IAClF,MAAM,QAAQ,GAAG,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AAM,CAAC,WAAW,EAAE,IAAI,EAAE,OAAO,EAAC,CAAA;IACnE,CAAC;IAED,qEAAqE;IACrE,aAAa,EAAE,GAA6B,EAAE,CAAC,oBAAoB,EAAE;IAErE,gFAAgF;IAChF,eAAe,EAAE,CAAC,EAA8C,EAAgB,EAAE;QAChF,IAAI,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,oBAAoB,EAAE,CAAC,CAAA;QACjD,MAAM,MAAM,GAAG,GAAG,EAAE;YAClB,MAAM,IAAI,GAAG,oBAAoB,EAAE,CAAA;YACnC,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;YAChC,IAAI,GAAG,KAAK,IAAI;gBAAE,OAAM;YACxB,IAAI,GAAG,GAAG,CAAA;YACV,EAAE,CAAC,IAAI,CAAC,CAAA;QACV,CAAC,CAAA;QACD,MAAM,aAAa,GAAG;YACpB,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC;YAC9B,eAAe,CAAC,SAAS,CAAC,MAAM,CAAC;YACjC,kBAAkB,CAAC,SAAS,CAAC,MAAM,CAAC;YACpC,yBAAyB,CAAC,SAAS,CAAC,MAAM,CAAC;YAC3C,0BAA0B,CAAC,SAAS,CAAC,MAAM,CAAC;SAC7C,CAAA;QACD,OAAO,GAAG,EAAE;YACV,aAAa,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,EAAE,CAAC,CAAA;QACvD,CAAC,CAAA;IACH,CAAC;IAED;;;OAGG;IACH,oBAAoB,EAAE,CAAC,EAAyC,EAAgB,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC;CACnH,CAAA","sourcesContent":["/**\n * dev facade — `engine.dev`: developer/debug surface over engine-owned state.\n * Backend/cloud URL overrides read+write the engine settings store; the cloud\n * URL setters reconnect the engine-owned cloud client onto the new endpoints;\n *\n * NOTE: the dev-time endpoint *resolution* (Metro-host auto-detect, env defaults)\n * still lives host-side in `@/services/cloudClient` during the migration; this\n * facade manages the explicit overrides + reconnect.\n */\nimport BluetoothSdk from \"@glassly/bluetooth-sdk/internal\"\nimport {isGlassesReady} from \"../services/GlassesReadiness\"\nimport {useCloudClientStatusStore} from \"../stores/cloudClientStatus\"\nimport {useConnectionStore} from \"../stores/connection\"\nimport {useCoreStore} from \"../stores/core\"\nimport {useGlassesStore} from \"../stores/glasses\"\nimport {useSettingsStore, SETTINGS} from \"../stores/settings\"\nimport {useTranscriptionDebugStore} from \"../stores/transcriptionDebug\"\nimport {cloudClientService} from \"../services/CloudClientService\"\nimport {getConfigValues} from \"../runtime/bootstrap\"\nimport {decideDevLaunchRoute} from \"../utils/devMiniappLaunch\"\nimport {deriveDevPackageId, registerDevApp, DEV_APP_PACKAGE_NAME, type DevAppRecord} from \"../services/AppRegistry\"\nimport {useAppStatusStore} from \"../stores/apps\"\nimport {sendGesture} from \"../services/GlassesTouchInput\"\nimport dashboardOpenTrace, {type DashboardOpenReport} from \"../services/debug/DashboardOpenTrace\"\n\ntype CloudUrlOverrides = {core?: string; runtime?: string}\n\n/**\n * Reconnect the cloud client onto the current cloud-URL overrides. Explicit\n * partial overrides merge over the boot-resolved config (which carries the\n * host's Metro/env URL resolution); both empty clears the live override.\n */\nfunction applyCloudUrlReconnect(urls: CloudUrlOverrides = currentCloudUrlOverrides()): void {\n const resolved = resolveCloudUrlReconnectTarget(urls)\n if (resolved === undefined) {\n cloudClientService.reconnect(null)\n } else if (resolved) {\n cloudClientService.reconnect(resolved)\n } else {\n console.warn(\"engine.dev.setCloudUrls: partial cloud override missing boot-resolved sibling endpoint\")\n }\n}\n\nfunction currentCloudUrlOverrides(): CloudUrlOverrides {\n const s = useSettingsStore.getState()\n return {\n core: trimSetting(s.getSetting(SETTINGS.cloud_core_url.key)),\n runtime: trimSetting(s.getSetting(SETTINGS.cloud_runtime_url.key)),\n }\n}\n\nfunction resolveCloudUrlReconnectTarget(urls: CloudUrlOverrides): {core: string; runtime: string} | null | undefined {\n const core = trimSetting(urls.core)\n const runtime = trimSetting(urls.runtime)\n if (!core && !runtime) return undefined\n\n const config = getConfigValues()\n const resolvedCore = core || config.coreUrl?.trim()\n const resolvedRuntime = runtime || config.runtimeUrl?.trim()\n return resolvedCore && resolvedRuntime ? {core: resolvedCore, runtime: resolvedRuntime} : null\n}\n\nfunction trimSetting(value: unknown): string | undefined {\n return typeof value === \"string\" && value.trim().length > 0 ? value.trim() : undefined\n}\n\nfunction projectRuntimeStatus() {\n const core = useCoreStore.getState()\n const glasses = useGlassesStore.getState()\n const connection = useConnectionStore.getState()\n const cloudClient = useCloudClientStatusStore.getState()\n const transcriptionDebug = useTranscriptionDebugStore.getState()\n return {\n searching: core.searching,\n // Copy: the snapshot must not hand callers a mutable reference into the store.\n micRanking: [...core.micRanking],\n currentMic: core.currentMic,\n systemMicUnavailable: core.systemMicUnavailable,\n glassesConnected: glasses.connection.state === \"connected\",\n glassesFullyBooted: isGlassesReady(glasses.connection),\n bluetoothClassicConnected: glasses.bluetoothClassicConnected,\n coreStatus: connection.status,\n cloudClientStatus: cloudClient.status,\n cloudClientAudioTransport: cloudClient.audioTransport,\n transcriptionSubscribers: [...transcriptionDebug.transcriptionSubscribers],\n translationSubscribers: [...transcriptionDebug.translationSubscribers],\n recentTranscriptSources: {...transcriptionDebug.recentTranscriptSources},\n cloudAudioSubscriptionWrite: {...transcriptionDebug.cloudAudioSubscriptionWrite},\n }\n}\n\nexport type DevRuntimeStatusSnapshot = ReturnType<typeof projectRuntimeStatus>\n\nexport const dev = {\n /** Inject a glasses gesture through the normal dashboard/miniapp input policy. */\n sendGesture,\n /** The cloud-v2 core/runtime URL overrides. */\n cloudUrls: (): {core?: string; runtime?: string} => {\n const s = useSettingsStore.getState()\n return {core: s.getSetting(SETTINGS.cloud_core_url.key), runtime: s.getSetting(SETTINGS.cloud_runtime_url.key)}\n },\n /** Override the cloud-v2 URLs and reconnect the live client onto them. */\n setCloudUrls: (urls: {core?: string; runtime?: string}) => {\n const next = {...currentCloudUrlOverrides(), ...urls}\n const resolved = resolveCloudUrlReconnectTarget(next)\n if (resolved === null) {\n console.warn(\"engine.dev.setCloudUrls: ignoring partial cloud override without a resolvable sibling endpoint\")\n return\n }\n\n const s = useSettingsStore.getState()\n if (urls.core !== undefined) s.setSetting(SETTINGS.cloud_core_url.key, urls.core)\n if (urls.runtime !== undefined) s.setSetting(SETTINGS.cloud_runtime_url.key, urls.runtime)\n if (resolved === undefined) {\n cloudClientService.reconnect(null)\n } else {\n cloudClientService.reconnect(resolved)\n }\n },\n\n /** Tear down + rebuild the live cloud client (the dev \"reconnect\" button). */\n reconnectCloud: (): void => applyCloudUrlReconnect(),\n\n /** Current native (BLE-process) memory usage in MB — a dev/diagnostics gauge. */\n getMemoryMB: (): number => BluetoothSdk.getMemoryMB(),\n /**\n * Phone-side bluetooth runtime snapshot (the core store read-model: scan/mic/\n * search state) — the diagnostics/data-export surface. Shallow copy.\n */\n bluetoothStatus: (): Record<string, unknown> => {\n const {setCoreInfo: _setCoreInfo, reset: _reset, ...state} = useCoreStore.getState()\n return {...state}\n },\n\n /**\n * Side-load a miniapp being served from a dev machine (the `glassly dev` / CLI\n * flow) by its URL: probes `<url>/miniapp.json`, and on a reachable manifest\n * registers it under its manifest package so it appears in `engine.miniapps`\n * and can coexist with other dev miniapps. This is the OEM-host equivalent\n * of the first-party\n * developer-URL screen — the registration itself is engine-internal, so a\n * host reaches it here rather than the internal registry. Rendering still\n * flows through the normal display path once the miniapp is started.\n */\n loadDevMiniapp: async (\n url: string,\n name?: string,\n ): Promise<{ok: true; packageName: string; name: string} | {ok: false; error: string}> => {\n const devUrl = url.trim().replace(/\\/+$/, \"\")\n if (!devUrl) return {ok: false, error: \"empty url\"}\n const result = await decideDevLaunchRoute(\"\", devUrl)\n if (result.decision !== \"live\") {\n return {ok: false, error: \"dev server unreachable, or no miniapp.json served there\"}\n }\n const manifest = result.manifest\n const appName = name ?? manifest.name ?? \"Dev Miniapp\"\n const packageName = (manifest.packageName as string | undefined) ?? DEV_APP_PACKAGE_NAME\n // Persist the host that answered — not the stale input IP — so home-tile\n // relaunches skip a dead LAN address after mDNS/Metro failover.\n const resolvedUrl = result.resolvedUrl || devUrl\n // The `glassly-miniapp dev` server puts the hot-reload/log sidecar on the\n // user port PLUS ONE — same convention as the first-party developer-URL\n // screen's deriveDevPort.\n let devPort: number | undefined\n try {\n const parsed = Number(new URL(resolvedUrl).port)\n devPort = Number.isFinite(parsed) && parsed > 0 ? parsed + 1 : undefined\n } catch {\n devPort = undefined\n }\n // The record is stored under a namespaced dev id (deriveDevPackageId) so\n // it survives release installs of the manifest package — stop/refresh and\n // the returned packageName must use that id, which registerDevApp returns.\n const devPackageId = deriveDevPackageId(packageName)\n const existing = useAppStatusStore.getState().apps.find((app) => app.packageName === devPackageId)\n if (existing?.running) await useAppStatusStore.getState().stop(devPackageId)\n const record = await registerDevApp({\n packageName,\n name: appName,\n iconUrl: manifest.icon ? new URL(manifest.icon, `${resolvedUrl}/`).toString() : `${resolvedUrl}/icon.png`,\n // Persist the host that answered — not the stale input IP.\n devUrl: resolvedUrl,\n devPort,\n type: manifest.type as DevAppRecord[\"type\"],\n permissions: manifest.permissions as DevAppRecord[\"permissions\"],\n hardwareRequirements: manifest.hardwareRequirements as DevAppRecord[\"hardwareRequirements\"],\n actions: manifest.actions as DevAppRecord[\"actions\"],\n })\n await useAppStatusStore.getState().refresh()\n return {ok: true, packageName: record.packageName, name: appName}\n },\n\n /** Current engine runtime status for engine-owned debug surfaces. */\n runtimeStatus: (): DevRuntimeStatusSnapshot => projectRuntimeStatus(),\n\n /** Subscribe to the projected engine runtime status; returns an unsubscribe. */\n onRuntimeStatus: (cb: (status: DevRuntimeStatusSnapshot) => void): (() => void) => {\n let last = JSON.stringify(projectRuntimeStatus())\n const notify = () => {\n const snap = projectRuntimeStatus()\n const key = JSON.stringify(snap)\n if (key === last) return\n last = key\n cb(snap)\n }\n const unsubscribers = [\n useCoreStore.subscribe(notify),\n useGlassesStore.subscribe(notify),\n useConnectionStore.subscribe(notify),\n useCloudClientStatusStore.subscribe(notify),\n useTranscriptionDebugStore.subscribe(notify),\n ]\n return () => {\n unsubscribers.forEach((unsubscribe) => unsubscribe())\n }\n },\n\n /**\n * Each finished dashboard open while the debug_dashboard_open_timing setting\n * is on: a ready-made title/body plus the stage timings. Returns an unsubscribe.\n */\n onDashboardOpenTrace: (cb: (report: DashboardOpenReport) => void): (() => void) => dashboardOpenTrace.onReport(cb),\n}\n"]}
@@ -10,14 +10,21 @@ export declare const display: {
10
10
  mirror: {
11
11
  current(): import("./displayMirror").DisplayMirrorEvent;
12
12
  onMirror(cb: (event: import("./displayMirror").DisplayMirrorEvent) => void): () => void;
13
+ canvas(previewModel?: string): import("./displayMirror").DisplayMirrorCanvas;
13
14
  };
14
- /** Phone-composed dashboard controls (simulated head-up, dev tools). */
15
+ /**
16
+ * Dashboard controls for the simulator and dev tools. The dashboard is a
17
+ * miniapp's (ADR-0006): these replay the wearer's own inputs, so they do
18
+ * whatever the running apps make of them.
19
+ */
15
20
  dashboard: {
21
+ /** An overlay app holds the slot. */
16
22
  isOpen: () => boolean;
17
- /** Open/close as if the head was raised/lowered (respects contextual_dashboard). */
23
+ /** As if the head was raised/lowered (the dashboard app applies contextual_dashboard). */
18
24
  setHeadUp: (up: boolean) => void;
19
- /** Force open/close, ignoring contextual_dashboard (simulator button). */
25
+ /** A double tap on the empty screen: the dashboard app opens (simulator button). */
20
26
  open: () => void;
27
+ /** A double tap on the showing page: it closes. */
21
28
  close: () => void;
22
29
  };
23
30
  /** Write raw text to the glasses display at (x, y) with a font size. */
@@ -1 +1 @@
1
- {"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../src/facades/display.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,YAAY,MAAM,wBAAwB,CAAA;AAIjD,eAAO,MAAM,OAAO;IAClB,mDAAmD;;;;;IAEnD,wEAAwE;;sBAE1D,OAAO;QACnB,oFAAoF;wBACpE,OAAO,KAAG,IAAI;QAC9B,0EAA0E;oBAChE,IAAI;qBACH,IAAI;;IAEjB,wEAAwE;;IAExE,iCAAiC;iBACtB,OAAO,CAAC,IAAI,CAAC;CACzB,CAAA"}
1
+ {"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../src/facades/display.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,YAAY,MAAM,wBAAwB,CAAA;AAMjD,eAAO,MAAM,OAAO;IAClB,mDAAmD;;;;;;IAEnD;;;;OAIG;;QAED,qCAAqC;sBACzB,OAAO;QACnB,0FAA0F;wBAC1E,OAAO,KAAG,IAAI;QAE9B,oFAAoF;oBAC1E,IAAI;QAGd,mDAAmD;qBACxC,IAAI;;IAIjB,wEAAwE;;IAExE,iCAAiC;iBACtB,OAAO,CAAC,IAAI,CAAC;CACzB,CAAA"}
@@ -5,19 +5,33 @@
5
5
  * the engine DisplayProcessor / layout system, not these).
6
6
  */
7
7
  import BluetoothSdk from "@glassly/bluetooth-sdk";
8
- import dashboardCoordinator from "../services/DashboardCoordinator";
8
+ import { sendGesture } from "../services/GlassesTouchInput";
9
+ import localMiniappRuntime from "../services/LocalMiniappRuntime";
10
+ import { useDisplayStore } from "../stores/display";
9
11
  import { displayMirror } from "./displayMirror";
10
12
  export const display = {
11
13
  /** Mirrored-view read-model (current/onMirror). */
12
14
  mirror: displayMirror,
13
- /** Phone-composed dashboard controls (simulated head-up, dev tools). */
15
+ /**
16
+ * Dashboard controls for the simulator and dev tools. The dashboard is a
17
+ * miniapp's (ADR-0006): these replay the wearer's own inputs, so they do
18
+ * whatever the running apps make of them.
19
+ */
14
20
  dashboard: {
15
- isOpen: () => dashboardCoordinator.isOpen,
16
- /** Open/close as if the head was raised/lowered (respects contextual_dashboard). */
17
- setHeadUp: (up) => dashboardCoordinator.setHeadUp(up),
18
- /** Force open/close, ignoring contextual_dashboard (simulator button). */
19
- open: () => dashboardCoordinator.open(),
20
- close: () => dashboardCoordinator.close(),
21
+ /** An overlay app holds the slot. */
22
+ isOpen: () => useDisplayStore.getState().overlayOwner !== null,
23
+ /** As if the head was raised/lowered (the dashboard app applies contextual_dashboard). */
24
+ setHeadUp: (up) => localMiniappRuntime.forwardEvent("head_up", { position: up ? "up" : "down", timestamp: Date.now() }),
25
+ /** A double tap on the empty screen: the dashboard app opens (simulator button). */
26
+ open: () => {
27
+ if (!display.dashboard.isOpen())
28
+ sendGesture("double_tap");
29
+ },
30
+ /** A double tap on the showing page: it closes. */
31
+ close: () => {
32
+ if (display.dashboard.isOpen())
33
+ sendGesture("double_tap");
34
+ },
21
35
  },
22
36
  /** Write raw text to the glasses display at (x, y) with a font size. */
23
37
  text: (...args) => BluetoothSdk.displayText(...args),
@@ -1 +1 @@
1
- {"version":3,"file":"display.js","sourceRoot":"","sources":["../../src/facades/display.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,YAAY,MAAM,wBAAwB,CAAA;AACjD,OAAO,oBAAoB,MAAM,kCAAkC,CAAA;AACnE,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAA;AAE7C,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,mDAAmD;IACnD,MAAM,EAAE,aAAa;IACrB,wEAAwE;IACxE,SAAS,EAAE;QACT,MAAM,EAAE,GAAY,EAAE,CAAC,oBAAoB,CAAC,MAAM;QAClD,oFAAoF;QACpF,SAAS,EAAE,CAAC,EAAW,EAAQ,EAAE,CAAC,oBAAoB,CAAC,SAAS,CAAC,EAAE,CAAC;QACpE,0EAA0E;QAC1E,IAAI,EAAE,GAAS,EAAE,CAAC,oBAAoB,CAAC,IAAI,EAAE;QAC7C,KAAK,EAAE,GAAS,EAAE,CAAC,oBAAoB,CAAC,KAAK,EAAE;KAChD;IACD,wEAAwE;IACxE,IAAI,EAAE,CAAC,GAAG,IAAiD,EAAE,EAAE,CAAC,YAAY,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;IACjG,iCAAiC;IACjC,KAAK,EAAE,GAAkB,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE;CACxD,CAAA","sourcesContent":["/**\n * display facade — `engine.display`: the host/OEM display surface. `mirror`\n * exposes the mirrored-view read-model; `text`/`clear` are raw passthroughs to the\n * glasses display for dev tools and escape-hatch use (normal rendering goes through\n * the engine DisplayProcessor / layout system, not these).\n */\nimport BluetoothSdk from \"@glassly/bluetooth-sdk\"\nimport dashboardCoordinator from \"../services/DashboardCoordinator\"\nimport {displayMirror} from \"./displayMirror\"\n\nexport const display = {\n /** Mirrored-view read-model (current/onMirror). */\n mirror: displayMirror,\n /** Phone-composed dashboard controls (simulated head-up, dev tools). */\n dashboard: {\n isOpen: (): boolean => dashboardCoordinator.isOpen,\n /** Open/close as if the head was raised/lowered (respects contextual_dashboard). */\n setHeadUp: (up: boolean): void => dashboardCoordinator.setHeadUp(up),\n /** Force open/close, ignoring contextual_dashboard (simulator button). */\n open: (): void => dashboardCoordinator.open(),\n close: (): void => dashboardCoordinator.close(),\n },\n /** Write raw text to the glasses display at (x, y) with a font size. */\n text: (...args: Parameters<typeof BluetoothSdk.displayText>) => BluetoothSdk.displayText(...args),\n /** Clear the glasses display. */\n clear: (): Promise<void> => BluetoothSdk.clearDisplay(),\n}\n"]}
1
+ {"version":3,"file":"display.js","sourceRoot":"","sources":["../../src/facades/display.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,YAAY,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAAC,WAAW,EAAC,MAAM,+BAA+B,CAAA;AACzD,OAAO,mBAAmB,MAAM,iCAAiC,CAAA;AACjE,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAA;AAE7C,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,mDAAmD;IACnD,MAAM,EAAE,aAAa;IACrB;;;;OAIG;IACH,SAAS,EAAE;QACT,qCAAqC;QACrC,MAAM,EAAE,GAAY,EAAE,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,YAAY,KAAK,IAAI;QACvE,0FAA0F;QAC1F,SAAS,EAAE,CAAC,EAAW,EAAQ,EAAE,CAC/B,mBAAmB,CAAC,YAAY,CAAC,SAAS,EAAE,EAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAC,CAAC;QACpG,oFAAoF;QACpF,IAAI,EAAE,GAAS,EAAE;YACf,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE;gBAAE,WAAW,CAAC,YAAY,CAAC,CAAA;QAC5D,CAAC;QACD,mDAAmD;QACnD,KAAK,EAAE,GAAS,EAAE;YAChB,IAAI,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE;gBAAE,WAAW,CAAC,YAAY,CAAC,CAAA;QAC3D,CAAC;KACF;IACD,wEAAwE;IACxE,IAAI,EAAE,CAAC,GAAG,IAAiD,EAAE,EAAE,CAAC,YAAY,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;IACjG,iCAAiC;IACjC,KAAK,EAAE,GAAkB,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE;CACxD,CAAA","sourcesContent":["/**\n * display facade — `engine.display`: the host/OEM display surface. `mirror`\n * exposes the mirrored-view read-model; `text`/`clear` are raw passthroughs to the\n * glasses display for dev tools and escape-hatch use (normal rendering goes through\n * the engine DisplayProcessor / layout system, not these).\n */\nimport BluetoothSdk from \"@glassly/bluetooth-sdk\"\nimport {sendGesture} from \"../services/GlassesTouchInput\"\nimport localMiniappRuntime from \"../services/LocalMiniappRuntime\"\nimport {useDisplayStore} from \"../stores/display\"\nimport {displayMirror} from \"./displayMirror\"\n\nexport const display = {\n /** Mirrored-view read-model (current/onMirror). */\n mirror: displayMirror,\n /**\n * Dashboard controls for the simulator and dev tools. The dashboard is a\n * miniapp's (ADR-0006): these replay the wearer's own inputs, so they do\n * whatever the running apps make of them.\n */\n dashboard: {\n /** An overlay app holds the slot. */\n isOpen: (): boolean => useDisplayStore.getState().overlayOwner !== null,\n /** As if the head was raised/lowered (the dashboard app applies contextual_dashboard). */\n setHeadUp: (up: boolean): void =>\n localMiniappRuntime.forwardEvent(\"head_up\", {position: up ? \"up\" : \"down\", timestamp: Date.now()}),\n /** A double tap on the empty screen: the dashboard app opens (simulator button). */\n open: (): void => {\n if (!display.dashboard.isOpen()) sendGesture(\"double_tap\")\n },\n /** A double tap on the showing page: it closes. */\n close: (): void => {\n if (display.dashboard.isOpen()) sendGesture(\"double_tap\")\n },\n },\n /** Write raw text to the glasses display at (x, y) with a font size. */\n text: (...args: Parameters<typeof BluetoothSdk.displayText>) => BluetoothSdk.displayText(...args),\n /** Clear the glasses display. */\n clear: (): Promise<void> => BluetoothSdk.clearDisplay(),\n}\n"]}