@glassly/engine 0.1.0-dev.1 → 0.1.0-dev.26

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 (277) hide show
  1. package/README.md +53 -19
  2. package/build/bluetooth-sdk/debug.d.ts +2 -0
  3. package/build/bluetooth-sdk/debug.d.ts.map +1 -0
  4. package/build/bluetooth-sdk/debug.js +2 -0
  5. package/build/bluetooth-sdk/debug.js.map +1 -0
  6. package/build/bluetooth-sdk/index.d.ts +3 -0
  7. package/build/bluetooth-sdk/index.d.ts.map +1 -0
  8. package/build/bluetooth-sdk/index.js +3 -0
  9. package/build/bluetooth-sdk/index.js.map +1 -0
  10. package/build/bluetooth-sdk/ota-transport.d.ts +2 -0
  11. package/build/bluetooth-sdk/ota-transport.d.ts.map +1 -0
  12. package/build/bluetooth-sdk/ota-transport.js +2 -0
  13. package/build/bluetooth-sdk/ota-transport.js.map +1 -0
  14. package/build/bluetooth-sdk/photo-receiver.d.ts +3 -0
  15. package/build/bluetooth-sdk/photo-receiver.d.ts.map +1 -0
  16. package/build/bluetooth-sdk/photo-receiver.js +3 -0
  17. package/build/bluetooth-sdk/photo-receiver.js.map +1 -0
  18. package/build/bluetooth-sdk/react.d.ts +2 -0
  19. package/build/bluetooth-sdk/react.d.ts.map +1 -0
  20. package/build/bluetooth-sdk/react.js +2 -0
  21. package/build/bluetooth-sdk/react.js.map +1 -0
  22. package/build/bluetooth-sdk/types.d.ts +2 -0
  23. package/build/bluetooth-sdk/types.d.ts.map +1 -0
  24. package/build/bluetooth-sdk/types.js +2 -0
  25. package/build/bluetooth-sdk/types.js.map +1 -0
  26. package/build/engine.d.ts +23 -16
  27. package/build/engine.d.ts.map +1 -1
  28. package/build/engine.js +9 -3
  29. package/build/engine.js.map +1 -1
  30. package/build/facades/dev.d.ts +1 -1
  31. package/build/facades/display.d.ts +1 -1
  32. package/build/facades/display.d.ts.map +1 -1
  33. package/build/facades/display.js +1 -1
  34. package/build/facades/display.js.map +1 -1
  35. package/build/facades/glasses.d.ts +5 -13
  36. package/build/facades/glasses.d.ts.map +1 -1
  37. package/build/facades/glasses.js +5 -3
  38. package/build/facades/glasses.js.map +1 -1
  39. package/build/facades/ota.d.ts +19 -21
  40. package/build/facades/ota.d.ts.map +1 -1
  41. package/build/facades/ota.js +23 -9
  42. package/build/facades/ota.js.map +1 -1
  43. package/build/facades/pairing.d.ts +11 -5
  44. package/build/facades/pairing.d.ts.map +1 -1
  45. package/build/facades/pairing.js +93 -17
  46. package/build/facades/pairing.js.map +1 -1
  47. package/build/facades/speakers.d.ts +1 -1
  48. package/build/facades/speakers.d.ts.map +1 -1
  49. package/build/facades/speakers.js.map +1 -1
  50. package/build/facades/speech.d.ts +7 -6
  51. package/build/facades/speech.d.ts.map +1 -1
  52. package/build/facades/speech.js +1 -1
  53. package/build/facades/speech.js.map +1 -1
  54. package/build/generated/releaseMetadata.d.ts +12 -0
  55. package/build/generated/releaseMetadata.d.ts.map +1 -0
  56. package/build/generated/releaseMetadata.js +10 -0
  57. package/build/generated/releaseMetadata.js.map +1 -0
  58. package/build/index.d.ts +7 -4
  59. package/build/index.d.ts.map +1 -1
  60. package/build/index.js +5 -3
  61. package/build/index.js.map +1 -1
  62. package/build/react/MentraLiveOtaFlow.d.ts +39 -0
  63. package/build/react/MentraLiveOtaFlow.d.ts.map +1 -0
  64. package/build/react/MentraLiveOtaFlow.js +200 -0
  65. package/build/react/MentraLiveOtaFlow.js.map +1 -0
  66. package/build/react/index.d.ts +3 -0
  67. package/build/react/index.d.ts.map +1 -0
  68. package/build/react/index.js +3 -0
  69. package/build/react/index.js.map +1 -0
  70. package/build/react/useEngineSnapshot.d.ts +2 -0
  71. package/build/react/useEngineSnapshot.d.ts.map +1 -0
  72. package/build/react/useEngineSnapshot.js +14 -0
  73. package/build/react/useEngineSnapshot.js.map +1 -0
  74. package/build/react/useMentraLiveOta.d.ts +80 -0
  75. package/build/react/useMentraLiveOta.d.ts.map +1 -0
  76. package/build/react/useMentraLiveOta.js +550 -0
  77. package/build/react/useMentraLiveOta.js.map +1 -0
  78. package/build/services/AppRegistry.d.ts +8 -0
  79. package/build/services/AppRegistry.d.ts.map +1 -1
  80. package/build/services/AppRegistry.js +15 -0
  81. package/build/services/AppRegistry.js.map +1 -1
  82. package/build/services/BlobStore.d.ts +2 -0
  83. package/build/services/BlobStore.d.ts.map +1 -1
  84. package/build/services/BlobStore.js +63 -10
  85. package/build/services/BlobStore.js.map +1 -1
  86. package/build/services/CustomDashboardModel.d.ts +48 -0
  87. package/build/services/CustomDashboardModel.d.ts.map +1 -0
  88. package/build/services/CustomDashboardModel.js +73 -0
  89. package/build/services/CustomDashboardModel.js.map +1 -0
  90. package/build/services/CustomDashboardService.d.ts +61 -0
  91. package/build/services/CustomDashboardService.d.ts.map +1 -0
  92. package/build/services/CustomDashboardService.js +552 -0
  93. package/build/services/CustomDashboardService.js.map +1 -0
  94. package/build/services/DeviceEventRouter.d.ts.map +1 -1
  95. package/build/services/DeviceEventRouter.js +44 -3
  96. package/build/services/DeviceEventRouter.js.map +1 -1
  97. package/build/services/GestureDotsService.d.ts +35 -0
  98. package/build/services/GestureDotsService.d.ts.map +1 -0
  99. package/build/services/GestureDotsService.js +149 -0
  100. package/build/services/GestureDotsService.js.map +1 -0
  101. package/build/services/GlassesStatusProjection.d.ts +15 -1
  102. package/build/services/GlassesStatusProjection.d.ts.map +1 -1
  103. package/build/services/GlassesStatusProjection.js +18 -11
  104. package/build/services/GlassesStatusProjection.js.map +1 -1
  105. package/build/services/HotspotOtaTransport.d.ts.map +1 -1
  106. package/build/services/HotspotOtaTransport.js +8 -7
  107. package/build/services/HotspotOtaTransport.js.map +1 -1
  108. package/build/services/LocalDisplayManager.d.ts +43 -1
  109. package/build/services/LocalDisplayManager.d.ts.map +1 -1
  110. package/build/services/LocalDisplayManager.js +128 -2
  111. package/build/services/LocalDisplayManager.js.map +1 -1
  112. package/build/services/LocalMiniappRuntime.d.ts +13 -0
  113. package/build/services/LocalMiniappRuntime.d.ts.map +1 -1
  114. package/build/services/LocalMiniappRuntime.js +32 -0
  115. package/build/services/LocalMiniappRuntime.js.map +1 -1
  116. package/build/services/MiniappExitGesture.d.ts +33 -0
  117. package/build/services/MiniappExitGesture.d.ts.map +1 -0
  118. package/build/services/MiniappExitGesture.js +54 -0
  119. package/build/services/MiniappExitGesture.js.map +1 -0
  120. package/build/services/OtaAutoChain.d.ts +41 -0
  121. package/build/services/OtaAutoChain.d.ts.map +1 -0
  122. package/build/services/OtaAutoChain.js +91 -0
  123. package/build/services/OtaAutoChain.js.map +1 -0
  124. package/build/services/OtaErrorMapping.d.ts +18 -0
  125. package/build/services/OtaErrorMapping.d.ts.map +1 -0
  126. package/build/services/OtaErrorMapping.js +63 -0
  127. package/build/services/OtaErrorMapping.js.map +1 -0
  128. package/build/services/OtaInstallCoordinator.d.ts +24 -3
  129. package/build/services/OtaInstallCoordinator.d.ts.map +1 -1
  130. package/build/services/OtaInstallCoordinator.js +17 -12
  131. package/build/services/OtaInstallCoordinator.js.map +1 -1
  132. package/build/services/OtaService.d.ts.map +1 -1
  133. package/build/services/OtaService.js +1 -1
  134. package/build/services/OtaService.js.map +1 -1
  135. package/build/services/OtaUpdateCheckService.d.ts +4 -1
  136. package/build/services/OtaUpdateCheckService.d.ts.map +1 -1
  137. package/build/services/OtaUpdateCheckService.js +28 -16
  138. package/build/services/OtaUpdateCheckService.js.map +1 -1
  139. package/build/services/asg/localNetworkTransport.d.ts.map +1 -1
  140. package/build/services/asg/localNetworkTransport.js +13 -12
  141. package/build/services/asg/localNetworkTransport.js.map +1 -1
  142. package/build/services/gestureClaims.d.ts +18 -0
  143. package/build/services/gestureClaims.d.ts.map +1 -0
  144. package/build/services/gestureClaims.js +24 -0
  145. package/build/services/gestureClaims.js.map +1 -0
  146. package/build/services/gestureDotGlyphs.d.ts +8 -0
  147. package/build/services/gestureDotGlyphs.d.ts.map +1 -0
  148. package/build/services/gestureDotGlyphs.js +12 -0
  149. package/build/services/gestureDotGlyphs.js.map +1 -0
  150. package/build/services/glassesClockSync.d.ts.map +1 -1
  151. package/build/services/glassesClockSync.js +5 -1
  152. package/build/services/glassesClockSync.js.map +1 -1
  153. package/build/services/otaDisplayState.d.ts +1 -1
  154. package/build/services/otaDisplayState.d.ts.map +1 -1
  155. package/build/services/otaDisplayState.js.map +1 -1
  156. package/build/services/otaInstallPolicy.d.ts +1 -1
  157. package/build/services/otaInstallPolicy.d.ts.map +1 -1
  158. package/build/services/otaInstallPolicy.js.map +1 -1
  159. package/build/services/otaLegacyMapping.d.ts +1 -1
  160. package/build/services/otaLegacyMapping.d.ts.map +1 -1
  161. package/build/services/otaLegacyMapping.js.map +1 -1
  162. package/build/services/otaManifestPolicy.d.ts +14 -0
  163. package/build/services/otaManifestPolicy.d.ts.map +1 -0
  164. package/build/services/otaManifestPolicy.js +20 -0
  165. package/build/services/otaManifestPolicy.js.map +1 -0
  166. package/build/services/otaManifestUrl.d.ts +2 -1
  167. package/build/services/otaManifestUrl.d.ts.map +1 -1
  168. package/build/services/otaManifestUrl.js +24 -32
  169. package/build/services/otaManifestUrl.js.map +1 -1
  170. package/build/services/otaReleaseVersion.d.ts +10 -0
  171. package/build/services/otaReleaseVersion.d.ts.map +1 -0
  172. package/build/services/otaReleaseVersion.js +14 -0
  173. package/build/services/otaReleaseVersion.js.map +1 -0
  174. package/build/stores/appVisibility.d.ts +3 -0
  175. package/build/stores/appVisibility.d.ts.map +1 -0
  176. package/build/stores/appVisibility.js +3 -0
  177. package/build/stores/appVisibility.js.map +1 -0
  178. package/build/stores/apps.d.ts.map +1 -1
  179. package/build/stores/apps.js +7 -1
  180. package/build/stores/apps.js.map +1 -1
  181. package/build/stores/core.d.ts +3 -3
  182. package/build/stores/core.d.ts.map +1 -1
  183. package/build/stores/core.js.map +1 -1
  184. package/build/stores/glasses.d.ts +10 -4
  185. package/build/stores/glasses.d.ts.map +1 -1
  186. package/build/stores/glasses.js.map +1 -1
  187. package/build/stores/settings.d.ts.map +1 -1
  188. package/build/stores/settings.js +87 -3
  189. package/build/stores/settings.js.map +1 -1
  190. package/build/types/applet.d.ts +2 -0
  191. package/build/types/applet.d.ts.map +1 -1
  192. package/build/types/applet.js +0 -3
  193. package/build/types/applet.js.map +1 -1
  194. package/build/types/enums.d.ts +1 -5
  195. package/build/types/enums.d.ts.map +1 -1
  196. package/build/types/enums.js +1 -8
  197. package/build/types/enums.js.map +1 -1
  198. package/build/types/hardware.d.ts +1 -1
  199. package/build/types/hardware.d.ts.map +1 -1
  200. package/build/types/hardware.js.map +1 -1
  201. package/build/types/index.d.ts +2 -6
  202. package/build/types/index.d.ts.map +1 -1
  203. package/build/types/index.js +2 -6
  204. package/build/types/index.js.map +1 -1
  205. package/build/utils/display/scene/process.d.ts.map +1 -1
  206. package/build/utils/display/scene/process.js +4 -3
  207. package/build/utils/display/scene/process.js.map +1 -1
  208. package/build/utils/display/scene/types.d.ts +6 -2
  209. package/build/utils/display/scene/types.d.ts.map +1 -1
  210. package/build/utils/display/scene/types.js.map +1 -1
  211. package/package.json +65 -33
  212. package/src/bluetooth-sdk/debug.ts +1 -0
  213. package/src/bluetooth-sdk/index.ts +2 -0
  214. package/src/bluetooth-sdk/ota-transport.ts +1 -0
  215. package/src/bluetooth-sdk/photo-receiver.ts +2 -0
  216. package/src/bluetooth-sdk/react.ts +1 -0
  217. package/src/bluetooth-sdk/types.ts +1 -0
  218. package/src/engine.ts +9 -3
  219. package/src/facades/display.ts +1 -1
  220. package/src/facades/glasses.ts +6 -4
  221. package/src/facades/ota.ts +33 -10
  222. package/src/facades/pairing.ts +103 -23
  223. package/src/facades/speakers.ts +1 -1
  224. package/src/facades/speech.ts +21 -7
  225. package/src/generated/releaseMetadata.ts +20 -0
  226. package/src/index.ts +29 -4
  227. package/src/react/MentraLiveOtaFlow.tsx +569 -0
  228. package/src/react/index.ts +21 -0
  229. package/src/react/useEngineSnapshot.ts +16 -0
  230. package/src/react/useMentraLiveOta.ts +707 -0
  231. package/src/services/AppRegistry.ts +16 -0
  232. package/src/services/BlobStore.ts +57 -10
  233. package/src/services/CustomDashboardModel.ts +83 -0
  234. package/src/services/CustomDashboardService.ts +575 -0
  235. package/src/services/DeviceEventRouter.ts +47 -5
  236. package/src/services/GestureDotsService.ts +147 -0
  237. package/src/services/GlassesStatusProjection.ts +20 -11
  238. package/src/services/HotspotOtaTransport.ts +8 -7
  239. package/src/services/LocalDisplayManager.ts +130 -2
  240. package/src/services/LocalMiniappRuntime.ts +37 -0
  241. package/src/services/MiniappExitGesture.ts +76 -0
  242. package/src/services/OtaAutoChain.ts +130 -0
  243. package/src/services/OtaErrorMapping.ts +80 -0
  244. package/src/services/OtaInstallCoordinator.ts +19 -13
  245. package/src/services/OtaService.ts +1 -2
  246. package/src/services/OtaUpdateCheckService.ts +33 -19
  247. package/src/services/asg/localNetworkTransport.ts +20 -19
  248. package/src/services/gestureClaims.ts +28 -0
  249. package/src/services/gestureDotGlyphs.ts +14 -0
  250. package/src/services/glassesClockSync.ts +5 -1
  251. package/src/services/otaDisplayState.ts +1 -1
  252. package/src/services/otaInstallPolicy.ts +1 -1
  253. package/src/services/otaLegacyMapping.ts +1 -1
  254. package/src/services/otaManifestPolicy.ts +43 -0
  255. package/src/services/otaManifestUrl.ts +27 -36
  256. package/src/services/otaReleaseVersion.ts +22 -0
  257. package/src/stores/appVisibility.ts +3 -0
  258. package/src/stores/apps.ts +7 -1
  259. package/src/stores/core.ts +4 -4
  260. package/src/stores/glasses.ts +13 -6
  261. package/src/stores/settings.ts +87 -3
  262. package/src/types/applet.ts +2 -0
  263. package/src/types/enums.ts +1 -9
  264. package/src/types/hardware.ts +1 -1
  265. package/src/types/index.ts +2 -6
  266. package/src/utils/display/scene/process.ts +4 -3
  267. package/src/utils/display/scene/types.ts +0 -0
  268. package/build/devtools.d.ts +0 -11
  269. package/build/devtools.d.ts.map +0 -1
  270. package/build/devtools.js +0 -13
  271. package/build/devtools.js.map +0 -1
  272. package/build/internal.d.ts +0 -67
  273. package/build/internal.d.ts.map +0 -1
  274. package/build/internal.js +0 -90
  275. package/build/internal.js.map +0 -1
  276. package/src/devtools.ts +0 -13
  277. package/src/internal.ts +0 -155
@@ -1 +1 @@
1
- {"version":3,"file":"pairing.js","sourceRoot":"","sources":["../../src/facades/pairing.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,0EAA0E;AAC1E,4EAA4E;AAC5E,wCAAwC;AACxC,OAAO,YAAY,MAAM,iCAAiC,CAAA;AAE1D,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAC,gBAAgB,EAAC,MAAM,kCAAkC,CAAA;AACjE,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,GAEzB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,cAAc,EACd,mBAAmB,GACpB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACL,kCAAkC,EAClC,iCAAiC,GAElC,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAC,wBAAwB,EAAC,MAAM,iCAAiC,CAAA;AACxE,OAAO,EAAC,qBAAqB,EAAC,MAAM,WAAW,CAAA;AAY/C,MAAM,+BAA+B,GAAG,MAAM,CAAA;AAC9C,MAAM,6BAA6B,GAAG,KAAK,CAAA;AAC3C,MAAM,qBAAqB,GAAG,kBAAkB,CAAA;AAChD,MAAM,OAAO,GAAG,sBAAsB,CAAA;AAEtC,SAAS,gBAAgB;IACvB,MAAM,CAAC,GAAG,eAAe,CAAC,QAAQ,EAAE,CAAA;IACpC,OAAO;QACL,KAAK,EAAE,CAAC,CAAC,UAAU,CAAC,KAAK;QACzB,SAAS,EAAE,CAAC,CAAC,UAAU,CAAC,KAAK,KAAK,WAAW;QAC7C,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC,UAAU,CAAC;QACzC,yBAAyB,EAAE,CAAC,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AG,CAAC,gGAAgG,CAAC,CAAA;QAC/G,CAAC;aAAM,CAAC;YACN,mEAAmE;YACnE,mDAAmD;YACnD,OAAO,CAAC,GAAG,CAAC,8FAA8F,CAAC,CAAA;YAC3G,MAAM,YAAY,CAAC,MAAM,EAAE,CAAA;QAC7B,CAAC;IACH,CAAC;IAED,6DAA6D;IAC7D,aAAa,EAAE,CAAC,EAAqC,EAAgB,EAAE;QACrE,MAAM,GAAG,GAAG,YAAY,CAAC,WAAW,CAAC,cAAc,EAAE,EAAE,CAAC,CAAA;QACxD,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAA;IAC3B,CAAC;IACD,oFAAoF;IACpF,iBAAiB,EAAE,CAAC,EAAyC,EAAgB,EAAE;QAC7E,MAAM,GAAG,GAAG,YAAY,CAAC,WAAW,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAA;QAC7D,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAA;IAC3B,CAAC;IACD,sFAAsF;IACtF,YAAY,EAAE,yBAAyB;IACvC,uEAAuE;IACvE,uBAAuB;CACxB,CAAA","sourcesContent":["/**\n * pairing facade — `engine.pairing`: scan for nearby glasses + pair. Scan state\n * (searching + results) comes from the engine core store; scan/connect go over the\n * bluetooth-sdk; pair-failure / not-ready are the bluetooth-sdk events.\n *\n * (Connect-the-already-paired-default is `engine.glasses.connectDefault()`; this\n * facade is the first-time discovery + pair flow.)\n */\n// Internal btsdk surface — updateBluetoothSettings (the Bluetooth Classic\n// target hint) lives on the full surface, not the public entry (same reason\n// the glasses facade imports internal).\nimport BluetoothSdk from \"@glassly/bluetooth-sdk/internal\"\nimport type {ConnectOptions, Device, PairFailureEvent, GlassesNotReadyEvent} from \"@glassly/bluetooth-sdk\"\nimport {useCoreStore} from \"../stores/core\"\nimport {useGlassesStore} from \"../stores/glasses\"\nimport {hasDefaultDevice} from \"../services/DeviceStoreHydration\"\nimport {\n markPendingSelection,\n projectPairingIdentity,\n subscribePairingIdentity,\n type IdentitySnapshot,\n} from \"../services/PairingIdentity\"\nimport {\n isGlassesConnected,\n isGlassesLinkLayerBusy,\n isGlassesReady,\n waitForGlassesReady,\n} from \"../services/GlassesReadiness\"\nimport {\n logAutomaticReportSubmissionStatus,\n toAutomaticReportSubmissionStatus,\n type AutomaticReportSubmissionStatus,\n} from \"../services/AutomaticReportResult\"\nimport {pushAllBluetoothSettings} from \"../services/GlassesSettingsSync\"\nimport {submitAutomaticReport} from \"./reports\"\n\nexport type {IdentitySnapshot} from \"../services/PairingIdentity\"\n\nexport interface PairingReadyWaitOptions {\n deviceModel?: string\n deviceName?: string\n timeoutMs?: number\n route?: string\n signal?: AbortSignal\n}\n\nconst DEFAULT_PAIRING_BOOT_TIMEOUT_MS = 35_000\nconst DEFAULT_BT_CLASSIC_TIMEOUT_MS = 1_000\nconst DEFAULT_PAIRING_ROUTE = \"/pairing/loading\"\nconst LOG_TAG = \"PairingTimeoutReport\"\n\nfunction projectReadiness() {\n const s = useGlassesStore.getState()\n return {\n state: s.connection.state,\n connected: s.connection.state === \"connected\",\n fullyBooted: isGlassesReady(s.connection),\n bluetoothClassicConnected: s.bluetoothClassicConnected,\n nativeLinkBusy: isGlassesLinkLayerBusy(s.connection),\n }\n}\n\nexport type PairingReadinessSnapshot = ReturnType<typeof projectReadiness>\n\nexport async function submitPairingBootTimeoutReport(params: {\n deviceModel?: string\n deviceName?: string\n showGlassesBooting: boolean\n elapsedMs: number\n route?: string\n}): Promise<AutomaticReportSubmissionStatus> {\n const {deviceModel, deviceName, showGlassesBooting, elapsedMs, route = DEFAULT_PAIRING_ROUTE} = params\n const result = await submitAutomaticReport({\n kind: \"automatic\",\n trigger: {\n type: \"automatic\",\n source: \"pairing_loading\",\n reason: \"glasses_connect_timeout\",\n },\n report: {\n expectedBehavior: `Glasses should connect successfully within ${Math.round(elapsedMs / 1000)} seconds.`,\n actualBehavior: JSON.stringify(\n {\n deviceModel,\n deviceName,\n showGlassesBooting,\n elapsedMs,\n route,\n },\n null,\n 2,\n ),\n systemPriority: \"medium\",\n },\n throttleKey: `pairing_timeout|${deviceModel || \"unknown\"}|${deviceName || \"unknown\"}`,\n })\n\n const status = toAutomaticReportSubmissionStatus(result)\n logAutomaticReportSubmissionStatus(LOG_TAG, status, deviceModel, deviceName)\n return status\n}\n\nasync function waitForReadyDuringPairing(options: PairingReadyWaitOptions = {}): Promise<boolean> {\n const timeoutMs = options.timeoutMs ?? DEFAULT_PAIRING_BOOT_TIMEOUT_MS\n let showGlassesBooting = false\n const notReadySub = BluetoothSdk.addListener(\"glasses_not_ready\", () => {\n showGlassesBooting = true\n })\n\n try {\n const ready = await waitForGlassesReady({\n getConnection: () => useGlassesStore.getState().connection,\n subscribe: (listener) => useGlassesStore.subscribe((state) => state.connection, listener),\n timeoutMs,\n signal: options.signal,\n })\n\n if (!ready && !options.signal?.aborted) {\n void submitPairingBootTimeoutReport({\n deviceModel: options.deviceModel,\n deviceName: options.deviceName,\n showGlassesBooting,\n elapsedMs: timeoutMs,\n route: options.route,\n }).catch((error) => {\n console.error(`[${LOG_TAG}] Unexpected error:`, error)\n })\n }\n\n return ready\n } finally {\n notReadySub.remove()\n }\n}\n\nasync function waitForBluetoothClassic(\n options: Pick<PairingReadyWaitOptions, \"timeoutMs\" | \"signal\"> = {},\n): Promise<boolean> {\n const timeoutMs = options.timeoutMs ?? DEFAULT_BT_CLASSIC_TIMEOUT_MS\n return new Promise((resolve) => {\n if (options.signal?.aborted) {\n resolve(false)\n return\n }\n\n const initial = useGlassesStore.getState().bluetoothClassicConnected\n if (initial) {\n resolve(true)\n return\n }\n\n let settled = false\n let timeout: ReturnType<typeof setTimeout> | null = null\n let unsubscribe: (() => void) | null = null\n let onAbort: (() => void) | null = null\n\n const finish = (value: boolean) => {\n if (settled) return\n settled = true\n if (timeout) clearTimeout(timeout)\n if (unsubscribe) unsubscribe()\n if (onAbort && options.signal) options.signal.removeEventListener(\"abort\", onAbort)\n resolve(value)\n }\n\n if (options.signal) {\n onAbort = () => finish(false)\n options.signal.addEventListener(\"abort\", onAbort)\n }\n\n unsubscribe = useGlassesStore.subscribe(\n (s) => s.bluetoothClassicConnected,\n (connected) => {\n if (connected) finish(true)\n },\n )\n\n timeout = setTimeout(() => {\n finish(useGlassesStore.getState().bluetoothClassicConnected)\n }, timeoutMs)\n })\n}\n\nexport const pairing = {\n readiness: (): PairingReadinessSnapshot => projectReadiness(),\n onReadiness: (cb: (readiness: PairingReadinessSnapshot) => void): (() => void) => {\n let last = JSON.stringify(projectReadiness())\n return useGlassesStore.subscribe(() => {\n const snap = projectReadiness()\n const key = JSON.stringify(snap)\n if (key === last) return\n last = key\n cb(snap)\n })\n },\n\n // --- pairing-identity lifecycle (the PairingIdentity read-model + the JS-owned\n // identity writes; promotion to `paired` only ever happens natively) ---\n /** The identity lifecycle snapshot: none | pending (chosen, never paired) | paired. */\n identity: (): IdentitySnapshot => projectPairingIdentity(),\n /** Subscribe to identity changes; fires only when the projected snapshot changes.\n * Returns an unsubscribe. */\n onIdentity: (cb: (identity: IdentitySnapshot) => void): (() => void) => subscribePairingIdentity(cb),\n /** Mark the chosen model as the pending selection (the scan-entry write); the\n * host renders it as a finish-pairing affordance until pairing succeeds. */\n markPendingSelection: (model: string) => markPendingSelection(model),\n\n /** Start scanning for nearby glasses. Results land on `searchResults()`/`onFound()`. */\n scan: (...args: Parameters<typeof BluetoothSdk.startScan>) => BluetoothSdk.startScan(...args),\n /** Whether a scan is currently in progress. */\n scanning: (): boolean => useCoreStore.getState().searching,\n /** Subscribe to scan-in-progress changes; fires only when it changes. Returns an unsubscribe. */\n onScanning: (cb: (scanning: boolean) => void): (() => void) => useCoreStore.subscribe((s) => s.searching, cb),\n /** Whether a controller scan is currently in progress. */\n scanningController: (): boolean => useCoreStore.getState().searchingController,\n /** Subscribe to controller-scan-in-progress changes; fires only when it changes. Returns an unsubscribe. */\n onScanningController: (cb: (scanning: boolean) => void): (() => void) =>\n useCoreStore.subscribe((s) => s.searchingController, cb),\n /** Whether the phone has another Bluetooth (audio) device connected — the BT Classic pairing hint. */\n otherBtConnected: (): boolean => useCoreStore.getState().otherBtConnected,\n /** Subscribe to other-Bluetooth-device-connected changes; fires only when it changes. Returns an unsubscribe. */\n onOtherBtConnected: (cb: (connected: boolean) => void): (() => void) =>\n useCoreStore.subscribe((s) => s.otherBtConnected, cb),\n /** The current scan results (snapshot). */\n // Copy the array AND each entry: neither the list nor the Device objects may\n // leak as mutable references into the store.\n searchResults: () => useCoreStore.getState().searchResults.map((result) => ({...result})),\n /** Subscribe to scan-result changes; fires only when they change. Returns an unsubscribe. */\n onFound: (cb: (results: ReturnType<typeof useCoreStore.getState>[\"searchResults\"]) => void): (() => void) => {\n let last = JSON.stringify(useCoreStore.getState().searchResults)\n return useCoreStore.subscribe(() => {\n const results = useCoreStore.getState().searchResults\n const key = JSON.stringify(results)\n if (key === last) return\n last = key\n // Copy like searchResults(): listeners must not mutate shared scan state.\n cb(results.map((result) => ({...result})))\n })\n },\n\n /**\n * Pair with (connect to) a discovered device. Two-phase identity: the connect\n * attempt only marks the device as pending (`saveAsDefault: false` — no eager\n * default-device write); the native layer promotes it to the default wearable\n * when pairing actually succeeds (handleDeviceReady), so an abandoned or\n * failed attempt can't leave a default identity with no paired device behind.\n */\n pair: async (device: Device, options?: ConnectOptions): Promise<void> => {\n await pushAllBluetoothSettings()\n return BluetoothSdk.connect(device, {...options, saveAsDefault: false})\n },\n /** Set a device as the default for subsequent `glasses.connectDefault()`. */\n setDefault: (...args: Parameters<typeof BluetoothSdk.setDefaultDevice>) => BluetoothSdk.setDefaultDevice(...args),\n /**\n * Prime the native Bluetooth Classic audio watcher with the picked device.\n * The iOS Mentra Live flow pairs Classic audio BEFORE any BLE connect\n * exists, and native detects the pairing by matching the connected audio\n * route against its device_name — which two-phase identity no longer sets\n * at selection time. This is native-only routing state (device_name has no\n * native→JS echo): the phone's persisted identity is untouched, and\n * promotion still happens only at pairing success.\n */\n setBluetoothClassicTarget: (device: Device): Promise<void> =>\n BluetoothSdk.updateBluetoothSettings({device_name: device.name}),\n /**\n * Abandon an in-flight pairing attempt (back-out, failure retry, conflict\n * retry) without destroying an existing pairing. The decision comes from the\n * LIVE hydrated default-device read — never from flow-entry state, because a\n * pairing can PROMOTE while the flow is open (the glasses finish pairing\n * even as the user backs out of the UI), and an entry snapshot would forget\n * that brand-new pairing:\n * - Default device exists and glasses are connected (nothing in flight — an\n * attempt drops the link first): stop the scan, touch nothing else.\n * - Default device exists with an attempt in flight: cancel it, then re-seed\n * the native identity from the phone's persisted settings — the attempt's\n * connect-by-name overwrote the native device_name, so a later\n * connectDefault() would otherwise target the abandoned device.\n * - No default device (genuinely unpaired attempt): also forget, clearing\n * the partial native pairing state.\n * The read fails OPEN to \"preserve\" — a transient failure must never wipe a\n * real pairing. The `pending_wearable` marker is deliberately left alone —\n * the host renders it as a finish-pairing affordance.\n */\n abandonAttempt: async (): Promise<void> => {\n const nativeHasDefault = await hasDefaultDevice().catch(() => true)\n if (nativeHasDefault && isGlassesConnected(useGlassesStore.getState().connection)) {\n // Still connected means no connect attempt is in flight (an attempt drops\n // the existing link first): the user browsed the scan and backed out.\n // Stop the scan and leave the live pairing untouched.\n console.log(\"PairingIdentity: abandonAttempt — pairing intact and connected; stopping scan only\")\n await BluetoothSdk.stopScan()\n return\n }\n await BluetoothSdk.disconnect()\n if (projectPairingIdentity().kind === \"paired\") {\n // The persisted settings describe a COMPLETE pairing: restore it to\n // native (the attempt's connect-by-name overwrote the native\n // device_name; and if native somehow lost its default entirely, this\n // repairs the divergence instead of forgetting a real pairing).\n console.log(\"PairingIdentity: abandonAttempt — preserving pairing; attempt cancelled, native identity re-seeded\")\n await pushAllBluetoothSettings()\n } else if (nativeHasDefault) {\n // Mid-relay: native promoted and its echoes are still landing — the\n // incomplete JS snapshot must not be pushed over the fresher native\n // identity (the on-connect replay's race). Native holds the truth.\n console.log(\"PairingIdentity: abandonAttempt — preserving pairing; JS identity mid-relay, native kept as-is\")\n } else {\n // Forgetting requires CONSENSUS: no native default AND no complete\n // persisted pairing — a genuinely partial attempt.\n console.log(\"PairingIdentity: abandonAttempt — no pairing on either layer; forgetting the partial attempt\")\n await BluetoothSdk.forget()\n }\n },\n\n /** Subscribe to pairing failures; returns an unsubscribe. */\n onPairFailure: (cb: (event: PairFailureEvent) => void): (() => void) => {\n const sub = BluetoothSdk.addListener(\"pair_failure\", cb)\n return () => sub.remove()\n },\n /** Subscribe to glasses-not-ready events during pairing; returns an unsubscribe. */\n onGlassesNotReady: (cb: (event: GlassesNotReadyEvent) => void): (() => void) => {\n const sub = BluetoothSdk.addListener(\"glasses_not_ready\", cb)\n return () => sub.remove()\n },\n /** Wait for paired glasses to finish booting; engine files the timeout diagnostic. */\n waitForReady: waitForReadyDuringPairing,\n /** Wait briefly for Bluetooth Classic to come up after BLE pairing. */\n waitForBluetoothClassic,\n}\n"]}
1
+ {"version":3,"file":"pairing.js","sourceRoot":"","sources":["../../src/facades/pairing.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,0EAA0E;AAC1E,4EAA4E;AAC5E,wCAAwC;AACxC,OAAO,YAAY,MAAM,iCAAiC,CAAA;AAE1D,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAC,QAAQ,EAAE,gBAAgB,EAAC,MAAM,oBAAoB,CAAA;AAC7D,OAAO,EAAC,gBAAgB,EAAC,MAAM,kCAAkC,CAAA;AACjE,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,GAEzB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAC,kBAAkB,EAAE,sBAAsB,EAAE,cAAc,EAAC,MAAM,8BAA8B,CAAA;AACvG,OAAO,EACL,kCAAkC,EAClC,iCAAiC,GAElC,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAC,wBAAwB,EAAC,MAAM,iCAAiC,CAAA;AACxE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MAAM,EAAE,CAAA;IAC7B,CAAC;IAED,6DAA6D;IAC7D,aAAa,EAAE,CAAC,EAAqC,EAAgB,EAAE;QACrE,MAAM,GAAG,GAAG,YAAY,CAAC,WAAW,CAAC,cAAc,EAAE,EAAE,CAAC,CAAA;QACxD,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAA;IAC3B,CAAC;IACD,oFAAoF;IACpF,iBAAiB,EAAE,CAAC,EAAyC,EAAgB,EAAE;QAC7E,MAAM,GAAG,GAAG,YAAY,CAAC,WAAW,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAA;QAC7D,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAA;IAC3B,CAAC;IACD,sFAAsF;IACtF,YAAY,EAAE,yBAAyB;IACvC,uEAAuE;IACvE,uBAAuB;CACxB,CAAA","sourcesContent":["/**\n * pairing facade — `engine.pairing`: scan for nearby glasses + pair. Scan state\n * (searching + results) comes from the engine core store; scan/connect go over the\n * bluetooth-sdk; pair-failure / not-ready are the bluetooth-sdk events.\n *\n * (Connect-the-already-paired-default is `engine.glasses.connectDefault()`; this\n * facade is the first-time discovery + pair flow.)\n */\n// Internal btsdk surface — updateBluetoothSettings (the Bluetooth Classic\n// target hint) lives on the full surface, not the public entry (same reason\n// the glasses facade imports internal).\nimport BluetoothSdk from \"@glassly/bluetooth-sdk/internal\"\nimport type {ConnectOptions, Device, DeviceModel, PairFailureEvent, GlassesNotReadyEvent} from \"@glassly/bluetooth-sdk\"\nimport {useCoreStore} from \"../stores/core\"\nimport {useGlassesStore} from \"../stores/glasses\"\nimport {SETTINGS, useSettingsStore} from \"../stores/settings\"\nimport {hasDefaultDevice} from \"../services/DeviceStoreHydration\"\nimport {\n markPendingSelection,\n projectPairingIdentity,\n subscribePairingIdentity,\n type IdentitySnapshot,\n} from \"../services/PairingIdentity\"\nimport {isGlassesConnected, isGlassesLinkLayerBusy, isGlassesReady} from \"../services/GlassesReadiness\"\nimport {\n logAutomaticReportSubmissionStatus,\n toAutomaticReportSubmissionStatus,\n type AutomaticReportSubmissionStatus,\n} from \"../services/AutomaticReportResult\"\nimport {pushAllBluetoothSettings} from \"../services/GlassesSettingsSync\"\nimport {ControllerTypes} from \"../types\"\nimport {submitAutomaticReport} from \"./reports\"\n\nexport type {IdentitySnapshot} from \"../services/PairingIdentity\"\n\nexport interface PairingReadyWaitOptions {\n deviceModel?: string\n deviceName?: string\n timeoutMs?: number\n route?: string\n signal?: AbortSignal\n}\n\nconst DEFAULT_PAIRING_BOOT_TIMEOUT_MS = 35_000\nconst DEFAULT_BT_CLASSIC_TIMEOUT_MS = 1_000\nconst DEFAULT_PAIRING_ROUTE = \"/pairing/loading\"\nconst LOG_TAG = \"PairingTimeoutReport\"\n\nfunction projectReadiness() {\n const s = useGlassesStore.getState()\n return {\n state: s.connection.state,\n connected: s.connection.state === \"connected\",\n fullyBooted: isGlassesReady(s.connection),\n bluetoothClassicConnected: s.bluetoothClassicConnected,\n nativeLinkBusy: isGlassesLinkLayerBusy(s.connection),\n }\n}\n\nfunction projectTargetReady(options: Pick<PairingReadyWaitOptions, \"deviceModel\" | \"deviceName\">): boolean {\n const {deviceModel, deviceName} = options\n const glasses = useGlassesStore.getState()\n\n if (deviceModel === ControllerTypes.R1) {\n if (!glasses.controllerConnected || !glasses.controllerFullyBooted) return false\n const settings = useSettingsStore.getState()\n const pairedModel = settings.getSetting(SETTINGS.default_controller.key)\n const pairedName = settings.getSetting(SETTINGS.controller_device_name.key)\n return (!deviceModel || pairedModel === deviceModel) && (!deviceName || pairedName === deviceName)\n }\n\n if (!isGlassesReady(glasses.connection)) return false\n const identity = projectPairingIdentity()\n if (!deviceModel && !deviceName) return true\n return (\n identity.kind === \"paired\" &&\n (!deviceModel || identity.model === deviceModel) &&\n (!deviceName || identity.name === deviceName)\n )\n}\n\nfunction subscribeTargetReady(\n options: Pick<PairingReadyWaitOptions, \"deviceModel\" | \"deviceName\">,\n cb: (ready: boolean) => void,\n): () => void {\n let last = projectTargetReady(options)\n const notify = () => {\n const ready = projectTargetReady(options)\n if (ready === last) return\n last = ready\n cb(ready)\n }\n const unsubscribeGlasses = useGlassesStore.subscribe(notify)\n const unsubscribeSettings = useSettingsStore.subscribe(notify)\n return () => {\n unsubscribeGlasses()\n unsubscribeSettings()\n }\n}\n\nasync function waitForTargetReady(options: PairingReadyWaitOptions, timeoutMs: number): Promise<boolean> {\n return new Promise((resolve) => {\n if (options.signal?.aborted) {\n resolve(false)\n return\n }\n if (projectTargetReady(options)) {\n resolve(true)\n return\n }\n\n let settled = false\n let timeout: ReturnType<typeof setTimeout> | null = null\n let unsubscribe: (() => void) | null = null\n let onAbort: (() => void) | null = null\n const finish = (ready: boolean) => {\n if (settled) return\n settled = true\n if (timeout) clearTimeout(timeout)\n if (unsubscribe) unsubscribe()\n if (onAbort && options.signal) options.signal.removeEventListener(\"abort\", onAbort)\n resolve(ready)\n }\n\n unsubscribe = subscribeTargetReady(options, (ready) => {\n if (ready) finish(true)\n })\n if (options.signal) {\n onAbort = () => finish(false)\n options.signal.addEventListener(\"abort\", onAbort)\n }\n timeout = setTimeout(() => finish(projectTargetReady(options)), timeoutMs)\n })\n}\n\nexport type PairingReadinessSnapshot = ReturnType<typeof projectReadiness>\n\nexport async function submitPairingBootTimeoutReport(params: {\n deviceModel?: string\n deviceName?: string\n showGlassesBooting: boolean\n elapsedMs: number\n route?: string\n}): Promise<AutomaticReportSubmissionStatus> {\n const {deviceModel, deviceName, showGlassesBooting, elapsedMs, route = DEFAULT_PAIRING_ROUTE} = params\n const result = await submitAutomaticReport({\n kind: \"automatic\",\n trigger: {\n type: \"automatic\",\n source: \"pairing_loading\",\n reason: \"glasses_connect_timeout\",\n },\n report: {\n expectedBehavior: `Glasses should connect successfully within ${Math.round(elapsedMs / 1000)} seconds.`,\n actualBehavior: JSON.stringify(\n {\n deviceModel,\n deviceName,\n showGlassesBooting,\n elapsedMs,\n route,\n },\n null,\n 2,\n ),\n systemPriority: \"medium\",\n },\n throttleKey: `pairing_timeout|${deviceModel || \"unknown\"}|${deviceName || \"unknown\"}`,\n })\n\n const status = toAutomaticReportSubmissionStatus(result)\n logAutomaticReportSubmissionStatus(LOG_TAG, status, deviceModel, deviceName)\n return status\n}\n\nasync function waitForReadyDuringPairing(options: PairingReadyWaitOptions = {}): Promise<boolean> {\n const timeoutMs = options.timeoutMs ?? DEFAULT_PAIRING_BOOT_TIMEOUT_MS\n let showGlassesBooting = false\n const notReadySub = BluetoothSdk.addListener(\"glasses_not_ready\", () => {\n showGlassesBooting = true\n })\n\n try {\n const ready = await waitForTargetReady(options, timeoutMs)\n\n if (!ready && !options.signal?.aborted) {\n void submitPairingBootTimeoutReport({\n deviceModel: options.deviceModel,\n deviceName: options.deviceName,\n showGlassesBooting,\n elapsedMs: timeoutMs,\n route: options.route,\n }).catch((error) => {\n console.error(`[${LOG_TAG}] Unexpected error:`, error)\n })\n }\n\n return ready\n } finally {\n notReadySub.remove()\n }\n}\n\nasync function waitForBluetoothClassic(\n options: Pick<PairingReadyWaitOptions, \"timeoutMs\" | \"signal\"> = {},\n): Promise<boolean> {\n const timeoutMs = options.timeoutMs ?? DEFAULT_BT_CLASSIC_TIMEOUT_MS\n return new Promise((resolve) => {\n if (options.signal?.aborted) {\n resolve(false)\n return\n }\n\n const initial = useGlassesStore.getState().bluetoothClassicConnected\n if (initial) {\n resolve(true)\n return\n }\n\n let settled = false\n let timeout: ReturnType<typeof setTimeout> | null = null\n let unsubscribe: (() => void) | null = null\n let onAbort: (() => void) | null = null\n\n const finish = (value: boolean) => {\n if (settled) return\n settled = true\n if (timeout) clearTimeout(timeout)\n if (unsubscribe) unsubscribe()\n if (onAbort && options.signal) options.signal.removeEventListener(\"abort\", onAbort)\n resolve(value)\n }\n\n if (options.signal) {\n onAbort = () => finish(false)\n options.signal.addEventListener(\"abort\", onAbort)\n }\n\n unsubscribe = useGlassesStore.subscribe(\n (s) => s.bluetoothClassicConnected,\n (connected) => {\n if (connected) finish(true)\n },\n )\n\n timeout = setTimeout(() => {\n finish(useGlassesStore.getState().bluetoothClassicConnected)\n }, timeoutMs)\n })\n}\n\nexport const pairing = {\n readiness: (): PairingReadinessSnapshot => projectReadiness(),\n onReadiness: (cb: (readiness: PairingReadinessSnapshot) => void): (() => void) => {\n let last = JSON.stringify(projectReadiness())\n return useGlassesStore.subscribe(() => {\n const snap = projectReadiness()\n const key = JSON.stringify(snap)\n if (key === last) return\n last = key\n cb(snap)\n })\n },\n /** Whether the exact wearable or controller selected on the scan screen is ready. */\n targetReady: (options: Pick<PairingReadyWaitOptions, \"deviceModel\" | \"deviceName\">): boolean =>\n projectTargetReady(options),\n /** Subscribe to readiness for the exact selected target, excluding stale devices. */\n onTargetReady: (\n options: Pick<PairingReadyWaitOptions, \"deviceModel\" | \"deviceName\">,\n cb: (ready: boolean) => void,\n ): (() => void) => subscribeTargetReady(options, cb),\n\n // --- pairing-identity lifecycle (the PairingIdentity read-model + the JS-owned\n // identity writes; promotion to `paired` only ever happens natively) ---\n /** The identity lifecycle snapshot: none | pending (chosen, never paired) | paired. */\n identity: (): IdentitySnapshot => projectPairingIdentity(),\n /** Subscribe to identity changes; fires only when the projected snapshot changes.\n * Returns an unsubscribe. */\n onIdentity: (cb: (identity: IdentitySnapshot) => void): (() => void) => subscribePairingIdentity(cb),\n /** Mark the chosen model as the pending selection (the scan-entry write); the\n * host renders it as a finish-pairing affordance until pairing succeeds. */\n markPendingSelection: (model: string) => markPendingSelection(model),\n\n /** Start scanning for nearby glasses. Results land on `searchResults()`/`onFound()`. */\n scan: (model: DeviceModel): Promise<void> => BluetoothSdk.startScan(model),\n /** Whether a scan is currently in progress. */\n scanning: (): boolean => useCoreStore.getState().searching,\n /** Subscribe to scan-in-progress changes; fires only when it changes. Returns an unsubscribe. */\n onScanning: (cb: (scanning: boolean) => void): (() => void) => useCoreStore.subscribe((s) => s.searching, cb),\n /** Whether a controller scan is currently in progress. */\n scanningController: (): boolean => useCoreStore.getState().searchingController,\n /** Subscribe to controller-scan-in-progress changes; fires only when it changes. Returns an unsubscribe. */\n onScanningController: (cb: (scanning: boolean) => void): (() => void) =>\n useCoreStore.subscribe((s) => s.searchingController, cb),\n /** Whether the phone has another Bluetooth (audio) device connected — the BT Classic pairing hint. */\n otherBtConnected: (): boolean => useCoreStore.getState().otherBtConnected,\n /** Subscribe to other-Bluetooth-device-connected changes; fires only when it changes. Returns an unsubscribe. */\n onOtherBtConnected: (cb: (connected: boolean) => void): (() => void) =>\n useCoreStore.subscribe((s) => s.otherBtConnected, cb),\n /** The current scan results (snapshot). */\n // Copy the array AND each entry: neither the list nor the Device objects may\n // leak as mutable references into the store.\n searchResults: () => useCoreStore.getState().searchResults.map((result) => ({...result})),\n /** Subscribe to scan-result changes; fires only when they change. Returns an unsubscribe. */\n onFound: (cb: (results: Device[]) => void): (() => void) => {\n let last = JSON.stringify(useCoreStore.getState().searchResults)\n return useCoreStore.subscribe(() => {\n const results = useCoreStore.getState().searchResults\n const key = JSON.stringify(results)\n if (key === last) return\n last = key\n // Copy like searchResults(): listeners must not mutate shared scan state.\n cb(results.map((result) => ({...result})))\n })\n },\n\n /**\n * Pair with (connect to) a discovered device. Two-phase identity: the connect\n * attempt only marks the device as pending (`saveAsDefault: false` — no eager\n * default-device write); the native layer promotes it to the default wearable\n * when pairing actually succeeds (handleDeviceReady), so an abandoned or\n * failed attempt can't leave a default identity with no paired device behind.\n */\n pair: async (device: Device, options?: ConnectOptions): Promise<void> => {\n await pushAllBluetoothSettings()\n return BluetoothSdk.connect(device, {...options, saveAsDefault: false})\n },\n /** Set a device as the default for subsequent `glasses.connectDefault()`. */\n setDefault: (device: Device | null): Promise<void> => BluetoothSdk.setDefaultDevice(device),\n /**\n * Prime the native Bluetooth Classic audio watcher with the picked device.\n * The iOS Mentra Live flow pairs Classic audio BEFORE any BLE connect\n * exists, and native detects the pairing by matching the connected audio\n * route against its device_name — which two-phase identity no longer sets\n * at selection time. This is native-only routing state (device_name has no\n * native→JS echo): the phone's persisted identity is untouched, and\n * promotion still happens only at pairing success.\n */\n setBluetoothClassicTarget: (device: Device): Promise<void> =>\n BluetoothSdk.updateBluetoothSettings({device_name: device.name}),\n /**\n * Abandon an in-flight pairing attempt (back-out, failure retry, conflict\n * retry) without destroying an existing pairing. The decision comes from the\n * LIVE hydrated default-device read — never from flow-entry state, because a\n * pairing can PROMOTE while the flow is open (the glasses finish pairing\n * even as the user backs out of the UI), and an entry snapshot would forget\n * that brand-new pairing:\n * - Default device exists and glasses are connected (nothing in flight — an\n * attempt drops the link first): stop the scan, touch nothing else.\n * - Default device exists with an attempt in flight: cancel it, then re-seed\n * the native identity from the phone's persisted settings — the attempt's\n * connect-by-name overwrote the native device_name, so a later\n * connectDefault() would otherwise target the abandoned device.\n * - No default device (genuinely unpaired attempt): also forget, clearing\n * the partial native pairing state.\n * The read fails OPEN to \"preserve\" — a transient failure must never wipe a\n * real pairing. The `pending_wearable` marker is deliberately left alone —\n * the host renders it as a finish-pairing affordance.\n */\n abandonAttempt: async (): Promise<void> => {\n const nativeHasDefault = await hasDefaultDevice().catch(() => true)\n if (nativeHasDefault && isGlassesConnected(useGlassesStore.getState().connection)) {\n // Still connected means no connect attempt is in flight (an attempt drops\n // the existing link first): the user browsed the scan and backed out.\n // Stop the scan and leave the live pairing untouched.\n console.log(\"PairingIdentity: abandonAttempt — pairing intact and connected; stopping scan only\")\n await BluetoothSdk.stopScan()\n return\n }\n if (projectPairingIdentity().kind === \"paired\") {\n // The persisted settings describe a COMPLETE pairing: restore it to\n // native (the attempt's connect-by-name overwrote the native\n // device_name; and if native somehow lost its default entirely, this\n // repairs the divergence instead of forgetting a real pairing).\n console.log(\"PairingIdentity: abandonAttempt — preserving pairing; attempt cancelled, native identity re-seeded\")\n await BluetoothSdk.disconnect()\n await pushAllBluetoothSettings()\n return\n }\n if (nativeHasDefault) {\n // Mid-relay: native promoted and its echoes are still landing — the\n // incomplete JS snapshot must not be pushed over the fresher native\n // identity (the on-connect replay's race). Native holds the truth.\n console.log(\"PairingIdentity: abandonAttempt — preserving pairing; JS identity mid-relay, native kept as-is\")\n await BluetoothSdk.disconnect()\n return\n }\n // Partial attempt: forget owns teardown. Do NOT disconnect() first — that\n // nulls the MentraLive SGC and used to skip Classic removeBond, leaving\n // IBRT ACL up so glasses never re-advertise for the next scan.\n console.log(\"PairingIdentity: abandonAttempt — no pairing on either layer; forgetting the partial attempt\")\n await BluetoothSdk.forget()\n },\n\n /** Subscribe to pairing failures; returns an unsubscribe. */\n onPairFailure: (cb: (event: PairFailureEvent) => void): (() => void) => {\n const sub = BluetoothSdk.addListener(\"pair_failure\", cb)\n return () => sub.remove()\n },\n /** Subscribe to glasses-not-ready events during pairing; returns an unsubscribe. */\n onGlassesNotReady: (cb: (event: GlassesNotReadyEvent) => void): (() => void) => {\n const sub = BluetoothSdk.addListener(\"glasses_not_ready\", cb)\n return () => sub.remove()\n },\n /** Wait for paired glasses to finish booting; engine files the timeout diagnostic. */\n waitForReady: waitForReadyDuringPairing,\n /** Wait briefly for Bluetooth Classic to come up after BLE pairing. */\n waitForBluetoothClassic,\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { SpeakerEnrollProgressEvent } from "@glassly/bluetooth-sdk/internal";
1
+ import type { SpeakerEnrollProgressEvent } from "@glassly/bluetooth-sdk";
2
2
  import { type SpeakerIdModelProgress } from "../services/SpeakerIdModelManager";
3
3
  import type { SpeakerProfile } from "../services/SpeakerProfileStore";
4
4
  export type EnrollOutcome = {
@@ -1 +1 @@
1
- {"version":3,"file":"speakers.d.ts","sourceRoot":"","sources":["../../src/facades/speakers.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAC,0BAA0B,EAA2B,MAAM,iCAAiC,CAAA;AAEzG,OAA8B,EAAC,KAAK,sBAAsB,EAAC,MAAM,mCAAmC,CAAA;AACpG,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAWnE,MAAM,MAAM,aAAa,GACrB;IAAC,EAAE,EAAE,IAAI,CA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AAC,IAAI;YAAE,OAAO,EAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAC,CAAA;QACrD,OAAO,aAAa,CAAC,EAAC,gBAAgB,EAAE,IAAI,CAAC,EAAE,EAAE,mBAAmB,EAAE,IAAI,EAAE,mBAAmB,EAAC,CAAC,CAAA;IACnG,CAAC;IACD,iFAAiF;IACjF,UAAU,EAAE,KAAK,IAAsB,EAAE;QACvC,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,OAAO,EAAE,CAAA;QACrC,IAAI,CAAC,IAAI;YAAE,OAAO,KAAK,CAAA;QACvB,OAAO,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAC5C,CAAC;IACD,uDAAuD;IACvD,gBAAgB,EAAE,GAAS,EAAE;QAC3B,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC5B,CAAC;IACD,8DAA8D;IAC9D,gBAAgB,EAAE,CAAC,QAAwD,EAAgB,EAAE;QAC3F,MAAM,GAAG,GAAG,YAAY,CAAC,WAAW,CAAC,yBAAyB,EAAE,QAAQ,CAAC,CAAA;QACzE,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAA;IAC3B,CAAC;IACD,2DAA2D;IAC3D,KAAK,EAAE;QACL,WAAW,EAAE,GAAqB,EAAE,CAAC,qBAAqB,CAAC,gBAAgB,EAAE;QAC7E,SAAS,EAAE,GAAW,EAAE,CAAC,qBAAqB,CAAC,SAAS;QACxD,QAAQ,EAAE,CAAC,UAAgD,EAAiB,EAAE,CAC5E,qBAAqB,CAAC,aAAa,CAAC,UAAU,CAAC;QACjD,cAAc,EAAE,GAAkB,EAAE,CAAC,qBAAqB,CAAC,cAAc,EAAE;KAC5E;CACF,CAAA","sourcesContent":["/**\n * speakers facade — `engine.speakers`: the device owner's voice profile for\n * on-device voice recognition (Settings > Voice Recognition).\n *\n * Owner-only surface: the user enrolls their OWN voice once (`enrollSelf`);\n * transcripts are then labeled user / other / unknown. The profile store\n * keeps its generic multi-profile shape underneath, but this facade only\n * exposes the self profile.\n *\n * Enrollment is a guided recording through whichever mic is currently active\n * (native holds the mic open for the session). Raw audio never reaches JS —\n * native returns chunk embeddings, which land in the profile store here; the\n * store push back to native happens via SpeakerIdSync.\n */\nimport BluetoothSdk from \"@glassly/bluetooth-sdk/internal\"\nimport type {SpeakerEnrollProgressEvent, SpeakerEnrollResultEvent} from \"@glassly/bluetooth-sdk/internal\"\n\nimport speakerIdModelManager, {type SpeakerIdModelProgress} from \"../services/SpeakerIdModelManager\"\nimport type {SpeakerProfile} from \"../services/SpeakerProfileStore\"\nimport {speakerProfileStore} from \"../services/speakerProfileStoreInstance\"\n\nconst DEFAULT_TARGET_SPEECH_SECONDS = 20\n\n/**\n * Display name of the self profile. Shown on the memory timeline (which\n * renders `resolvedSpeakerName`); miniapps never see it (PII strip).\n */\nconst SELF_PROFILE_NAME = \"You\"\n\nexport type EnrollOutcome =\n | {ok: true; profile: SpeakerProfile}\n | {ok: false; reason: \"inconsistent\" | \"too_short\" | \"model_unavailable\" | \"unsupported\" | \"cancelled\" | string}\n\nlet activeEnrollment: {cancel: () => void} | null = null\n\n/**\n * Run one enrollment session to completion. Resolves when native reports the\n * result; on success the embeddings are stored (new profile, or appended to\n * `improveProfileId` for \"Improve recognition\").\n */\nasync function runEnrollment(input: {\n name?: string\n improveProfileId?: string\n targetSpeechSeconds?: number\n}): Promise<EnrollOutcome> {\n if (activeEnrollment) return {ok: false, reason: \"already_enrolling\"}\n\n return new Promise<EnrollOutcome>((resolve) => {\n let settled = false\n const settle = (outcome: EnrollOutcome) => {\n if (settled) return\n settled = true\n sub.remove()\n activeEnrollment = null\n console.log(\n outcome.ok\n ? `SpeakerID: enrollment stored — profile \"${outcome.profile.name}\" (${outcome.profile.samples.length} samples)`\n : `SpeakerID: enrollment not stored — ${outcome.reason}`,\n )\n resolve(outcome)\n }\n\n const sub = BluetoothSdk.addListener(\"speaker_enroll_result\", (event: SpeakerEnrollResultEvent) => {\n void (async () => {\n if (!event.ok) {\n settle({ok: false, reason: event.reason ?? \"failed\"})\n return\n }\n const embeddings = event.embeddings ?? []\n const source = event.source === \"glasses\" ? \"glasses\" : \"phone\"\n try {\n if (input.improveProfileId) {\n const profile = await speakerProfileStore.addSamples(input.improveProfileId, embeddings, source)\n if (profile) settle({ok: true, profile})\n else settle({ok: false, reason: \"profile_not_found\"})\n } else {\n const profile = await speakerProfileStore.add(input.name ?? \"\", embeddings, source)\n settle({ok: true, profile})\n }\n } catch (err) {\n settle({ok: false, reason: err instanceof Error ? err.message : \"store_failed\"})\n }\n })()\n })\n\n activeEnrollment = {\n cancel: () => {\n void BluetoothSdk.cancelSpeakerEnrollment().catch(() => {})\n settle({ok: false, reason: \"cancelled\"})\n },\n }\n\n void BluetoothSdk.startSpeakerEnrollment({\n targetSpeechSeconds: input.targetSpeechSeconds ?? DEFAULT_TARGET_SPEECH_SECONDS,\n }).catch((err) => {\n settle({ok: false, reason: err instanceof Error ? err.message : \"start_failed\"})\n })\n })\n}\n\nexport const speakers = {\n /** The owner's enrolled voice profile, or null before enrollment. */\n getSelf: async (): Promise<SpeakerProfile | null> => {\n const profiles = await speakerProfileStore.list()\n return profiles[0] ?? null\n },\n /** Subscribe to profile-store mutations. */\n onChanged: (listener: () => void): (() => void) => speakerProfileStore.onChanged(listener),\n /**\n * Enroll (or re-enroll) the owner's voice via guided recording on the\n * active mic. Replaces any existing self profile on success.\n */\n enrollSelf: async (opts?: {targetSpeechSeconds?: number}): Promise<EnrollOutcome> => {\n const outcome = await runEnrollment({name: SELF_PROFILE_NAME, targetSpeechSeconds: opts?.targetSpeechSeconds})\n if (outcome.ok) {\n // Drop any previous self profile — one owner voice at a time. Done\n // after the new profile is stored so a failed session can't delete.\n const stale = (await speakerProfileStore.list()).filter((p) => p.id !== outcome.profile.id)\n for (const profile of stale) await speakerProfileStore.remove(profile.id)\n }\n return outcome\n },\n /** \"Improve recognition\": record more samples onto the self profile. */\n improveSelf: async (opts?: {targetSpeechSeconds?: number}): Promise<EnrollOutcome> => {\n const self = await speakers.getSelf()\n if (!self) return {ok: false, reason: \"not_enrolled\"}\n return runEnrollment({improveProfileId: self.id, targetSpeechSeconds: opts?.targetSpeechSeconds})\n },\n /** Delete the self profile (also drops it from native via store-change push). */\n removeSelf: async (): Promise<boolean> => {\n const self = await speakers.getSelf()\n if (!self) return false\n return speakerProfileStore.remove(self.id)\n },\n /** Cancel the in-flight enrollment session, if any. */\n cancelEnrollment: (): void => {\n activeEnrollment?.cancel()\n },\n /** Live recording meter + progress ring during enrollment. */\n onEnrollProgress: (listener: (progress: SpeakerEnrollProgressEvent) => void): (() => void) => {\n const sub = BluetoothSdk.addListener(\"speaker_enroll_progress\", listener)\n return () => sub.remove()\n },\n /** Embedding-model delivery (one-time ~28 MB download). */\n model: {\n isAvailable: (): Promise<boolean> => speakerIdModelManager.isModelAvailable(),\n sizeBytes: (): number => speakerIdModelManager.sizeBytes,\n download: (onProgress?: (p: SpeakerIdModelProgress) => void): Promise<void> =>\n speakerIdModelManager.downloadModel(onProgress),\n cancelDownload: (): Promise<void> => speakerIdModelManager.cancelDownload(),\n },\n}\n"]}
1
+ {"version":3,"file":"speakers.js","sourceRoot":"","sources":["../../src/facades/speakers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,YAAY,MAAM,iCAAiC,CAAA;AAG1D,OAAO,qBAAoD,MAAM,mCAAmC,CAAA;AAEpG,OAAO,EAAC,mBAAmB,EAAC,MAAM,yCAAyC,CAAA;AAE3E,MAAM,6BAA6B,GAAG,EAAE,CAAA;AAExC;;;GAGG;AACH,MAAM,iBAAiB,GAAG,KAAK,CAAA;AAM/B,IAAI,gBAAgB,GAAgC,IAAI,CAAA;AAExD;;;;GAIG;AACH,KAAK,UAAU,aAAa,CAAC,KAI5B;IACC,IAAI,gBAAgB;QAAE,OAAO,EAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,mBAAmB,EA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,EAAE,IAAI,CAAC,EAAE,EAAE,mBAAmB,EAAE,IAAI,EAAE,mBAAmB,EAAC,CAAC,CAAA;IACnG,CAAC;IACD,iFAAiF;IACjF,UAAU,EAAE,KAAK,IAAsB,EAAE;QACvC,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,OAAO,EAAE,CAAA;QACrC,IAAI,CAAC,IAAI;YAAE,OAAO,KAAK,CAAA;QACvB,OAAO,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAC5C,CAAC;IACD,uDAAuD;IACvD,gBAAgB,EAAE,GAAS,EAAE;QAC3B,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC5B,CAAC;IACD,8DAA8D;IAC9D,gBAAgB,EAAE,CAAC,QAAwD,EAAgB,EAAE;QAC3F,MAAM,GAAG,GAAG,YAAY,CAAC,WAAW,CAAC,yBAAyB,EAAE,QAAQ,CAAC,CAAA;QACzE,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAA;IAC3B,CAAC;IACD,2DAA2D;IAC3D,KAAK,EAAE;QACL,WAAW,EAAE,GAAqB,EAAE,CAAC,qBAAqB,CAAC,gBAAgB,EAAE;QAC7E,SAAS,EAAE,GAAW,EAAE,CAAC,qBAAqB,CAAC,SAAS;QACxD,QAAQ,EAAE,CAAC,UAAgD,EAAiB,EAAE,CAC5E,qBAAqB,CAAC,aAAa,CAAC,UAAU,CAAC;QACjD,cAAc,EAAE,GAAkB,EAAE,CAAC,qBAAqB,CAAC,cAAc,EAAE;KAC5E;CACF,CAAA","sourcesContent":["/**\n * speakers facade — `engine.speakers`: the device owner's voice profile for\n * on-device voice recognition (Settings > Voice Recognition).\n *\n * Owner-only surface: the user enrolls their OWN voice once (`enrollSelf`);\n * transcripts are then labeled user / other / unknown. The profile store\n * keeps its generic multi-profile shape underneath, but this facade only\n * exposes the self profile.\n *\n * Enrollment is a guided recording through whichever mic is currently active\n * (native holds the mic open for the session). Raw audio never reaches JS —\n * native returns chunk embeddings, which land in the profile store here; the\n * store push back to native happens via SpeakerIdSync.\n */\nimport BluetoothSdk from \"@glassly/bluetooth-sdk/internal\"\nimport type {SpeakerEnrollProgressEvent, SpeakerEnrollResultEvent} from \"@glassly/bluetooth-sdk\"\n\nimport speakerIdModelManager, {type SpeakerIdModelProgress} from \"../services/SpeakerIdModelManager\"\nimport type {SpeakerProfile} from \"../services/SpeakerProfileStore\"\nimport {speakerProfileStore} from \"../services/speakerProfileStoreInstance\"\n\nconst DEFAULT_TARGET_SPEECH_SECONDS = 20\n\n/**\n * Display name of the self profile. Shown on the memory timeline (which\n * renders `resolvedSpeakerName`); miniapps never see it (PII strip).\n */\nconst SELF_PROFILE_NAME = \"You\"\n\nexport type EnrollOutcome =\n | {ok: true; profile: SpeakerProfile}\n | {ok: false; reason: \"inconsistent\" | \"too_short\" | \"model_unavailable\" | \"unsupported\" | \"cancelled\" | string}\n\nlet activeEnrollment: {cancel: () => void} | null = null\n\n/**\n * Run one enrollment session to completion. Resolves when native reports the\n * result; on success the embeddings are stored (new profile, or appended to\n * `improveProfileId` for \"Improve recognition\").\n */\nasync function runEnrollment(input: {\n name?: string\n improveProfileId?: string\n targetSpeechSeconds?: number\n}): Promise<EnrollOutcome> {\n if (activeEnrollment) return {ok: false, reason: \"already_enrolling\"}\n\n return new Promise<EnrollOutcome>((resolve) => {\n let settled = false\n const settle = (outcome: EnrollOutcome) => {\n if (settled) return\n settled = true\n sub.remove()\n activeEnrollment = null\n console.log(\n outcome.ok\n ? `SpeakerID: enrollment stored — profile \"${outcome.profile.name}\" (${outcome.profile.samples.length} samples)`\n : `SpeakerID: enrollment not stored — ${outcome.reason}`,\n )\n resolve(outcome)\n }\n\n const sub = BluetoothSdk.addListener(\"speaker_enroll_result\", (event: SpeakerEnrollResultEvent) => {\n void (async () => {\n if (!event.ok) {\n settle({ok: false, reason: event.reason ?? \"failed\"})\n return\n }\n const embeddings = event.embeddings ?? []\n const source = event.source === \"glasses\" ? \"glasses\" : \"phone\"\n try {\n if (input.improveProfileId) {\n const profile = await speakerProfileStore.addSamples(input.improveProfileId, embeddings, source)\n if (profile) settle({ok: true, profile})\n else settle({ok: false, reason: \"profile_not_found\"})\n } else {\n const profile = await speakerProfileStore.add(input.name ?? \"\", embeddings, source)\n settle({ok: true, profile})\n }\n } catch (err) {\n settle({ok: false, reason: err instanceof Error ? err.message : \"store_failed\"})\n }\n })()\n })\n\n activeEnrollment = {\n cancel: () => {\n void BluetoothSdk.cancelSpeakerEnrollment().catch(() => {})\n settle({ok: false, reason: \"cancelled\"})\n },\n }\n\n void BluetoothSdk.startSpeakerEnrollment({\n targetSpeechSeconds: input.targetSpeechSeconds ?? DEFAULT_TARGET_SPEECH_SECONDS,\n }).catch((err) => {\n settle({ok: false, reason: err instanceof Error ? err.message : \"start_failed\"})\n })\n })\n}\n\nexport const speakers = {\n /** The owner's enrolled voice profile, or null before enrollment. */\n getSelf: async (): Promise<SpeakerProfile | null> => {\n const profiles = await speakerProfileStore.list()\n return profiles[0] ?? null\n },\n /** Subscribe to profile-store mutations. */\n onChanged: (listener: () => void): (() => void) => speakerProfileStore.onChanged(listener),\n /**\n * Enroll (or re-enroll) the owner's voice via guided recording on the\n * active mic. Replaces any existing self profile on success.\n */\n enrollSelf: async (opts?: {targetSpeechSeconds?: number}): Promise<EnrollOutcome> => {\n const outcome = await runEnrollment({name: SELF_PROFILE_NAME, targetSpeechSeconds: opts?.targetSpeechSeconds})\n if (outcome.ok) {\n // Drop any previous self profile — one owner voice at a time. Done\n // after the new profile is stored so a failed session can't delete.\n const stale = (await speakerProfileStore.list()).filter((p) => p.id !== outcome.profile.id)\n for (const profile of stale) await speakerProfileStore.remove(profile.id)\n }\n return outcome\n },\n /** \"Improve recognition\": record more samples onto the self profile. */\n improveSelf: async (opts?: {targetSpeechSeconds?: number}): Promise<EnrollOutcome> => {\n const self = await speakers.getSelf()\n if (!self) return {ok: false, reason: \"not_enrolled\"}\n return runEnrollment({improveProfileId: self.id, targetSpeechSeconds: opts?.targetSpeechSeconds})\n },\n /** Delete the self profile (also drops it from native via store-change push). */\n removeSelf: async (): Promise<boolean> => {\n const self = await speakers.getSelf()\n if (!self) return false\n return speakerProfileStore.remove(self.id)\n },\n /** Cancel the in-flight enrollment session, if any. */\n cancelEnrollment: (): void => {\n activeEnrollment?.cancel()\n },\n /** Live recording meter + progress ring during enrollment. */\n onEnrollProgress: (listener: (progress: SpeakerEnrollProgressEvent) => void): (() => void) => {\n const sub = BluetoothSdk.addListener(\"speaker_enroll_progress\", listener)\n return () => sub.remove()\n },\n /** Embedding-model delivery (one-time ~28 MB download). */\n model: {\n isAvailable: (): Promise<boolean> => speakerIdModelManager.isModelAvailable(),\n sizeBytes: (): number => speakerIdModelManager.sizeBytes,\n download: (onProgress?: (p: SpeakerIdModelProgress) => void): Promise<void> =>\n speakerIdModelManager.downloadModel(onProgress),\n cancelDownload: (): Promise<void> => speakerIdModelManager.cancelDownload(),\n },\n}\n"]}
@@ -1,22 +1,23 @@
1
1
  import sttModelManager from "../services/STTModelManager";
2
2
  import ttsModelManager from "../services/TTSModelManager";
3
- import offlineSpeechModelService from "../services/OfflineSpeechModelService";
3
+ import { type DownloadStatus as OfflineModelDownloadStatus } from "../services/OfflineSpeechModelService";
4
4
  import sonioxDirectService from "../services/soniox/SonioxDirectService";
5
+ import type { DownloadProgress as SttDownloadProgress, ExtractionProgress as SttExtractionProgress, LanguageConfig as SttLanguageConfig, LanguageInfo as SttLanguageInfo } from "../services/STTModelManager";
5
6
  export declare const speech: {
6
7
  /** Restart the glasses' on-device transcriber (e.g. after switching STT language). */
7
8
  restartTranscriber: () => Promise<void>;
8
9
  stt: {
9
10
  currentLanguage: () => string;
10
- languages: () => import("../internal").SttLanguageConfig[];
11
- languageInfo: () => Promise<import("../internal").SttLanguageInfo[]>;
12
- download: (code?: string | undefined, onProgress?: ((progress: import("../internal").SttDownloadProgress) => void) | undefined, onExtractionProgress?: ((progress: import("../internal").SttExtractionProgress) => void) | undefined) => Promise<void>;
11
+ languages: () => SttLanguageConfig[];
12
+ languageInfo: () => Promise<SttLanguageInfo[]>;
13
+ download: (code?: string | undefined, onProgress?: ((progress: SttDownloadProgress) => void) | undefined, onExtractionProgress?: ((progress: SttExtractionProgress) => void) | undefined) => Promise<void>;
13
14
  activate: (code: string) => void;
14
15
  cancelDownload: () => Promise<void>;
15
16
  deleteModel: (code?: string | undefined) => Promise<void>;
16
17
  /** Current auto-download status of the offline STT model. */
17
- status: () => import("../internal").OfflineModelDownloadStatus | null;
18
+ status: () => OfflineModelDownloadStatus | null;
18
19
  /** Subscribe to auto-download status changes; returns an unsubscribe. */
19
- onStatusChanged: (listener: (status: import("../internal").OfflineModelDownloadStatus | null) => void) => () => void;
20
+ onStatusChanged: (listener: (status: OfflineModelDownloadStatus | null) => void) => (() => void);
20
21
  };
21
22
  /** Phone → Soniox direct transcription (user-supplied API key, Settings > Keys). */
22
23
  sonioxDirect: {
@@ -1 +1 @@
1
- {"version":3,"file":"speech.d.ts","sourceRoot":"","sources":["../../src/facades/speech.ts"],"names":[],"mappings":"AAOA,OAAO,eAAe,MAAM,6BAA6B,CAAA;AACzD,OAAO,eAAe,MAAM,6BAA6B,CAAA;AACzD,OAAO,yBAAyB,MAAM,uCAAuC,CAAA;AAC7E,OAAO,mBAAmB,MAAM,wCAAwC,CAAA;AAExE,eAAO,MAAM,MAAM;IACjB,sFAAsF;8BAC9D,OAAO,CAAC,IAAI,CAAC;;;;;;yBAMlB,MAAM;;;QAGvB,6DAA6D;;QAE7D,yEAAyE;;;IAI3E,oFAAoF;;;QAGlF,2DAA2D;;QAG3D,4DAA4D;;;;;;;;;;;;;yBAS3C,MAAM;;;;CAI1B,CAAA"}
1
+ {"version":3,"file":"speech.d.ts","sourceRoot":"","sources":["../../src/facades/speech.ts"],"names":[],"mappings":"AAOA,OAAO,eAAe,MAAM,6BAA6B,CAAA;AACzD,OAAO,eAAe,MAAM,6BAA6B,CAAA;AACzD,OAAkC,EAChC,KAAK,cAAc,IAAI,0BAA0B,EAClD,MAAM,uCAAuC,CAAA;AAC9C,OAAO,mBAAmB,MAAM,wCAAwC,CAAA;AACxE,OAAO,KAAK,EACV,gBAAgB,IAAI,mBAAmB,EACvC,kBAAkB,IAAI,qBAAqB,EAC3C,cAAc,IAAI,iBAAiB,EACnC,YAAY,IAAI,eAAe,EAChC,MAAM,6BAA6B,CAAA;AAEpC,eAAO,MAAM,MAAM;IACjB,sFAAsF;8BAC9D,OAAO,CAAC,IAAI,CAAC;;;yBAGpB,iBAAiB,EAAE;4BAChB,OAAO,CAAC,eAAe,EAAE,CAAC;uEAIhB,mBAAmB,KAAK,IAAI,kDAClB,qBAAqB,KAAK,IAAI,kBAEjE,OAAO,CAAC,IAAI,CAAC;yBACC,MAAM;;;QAGvB,6DAA6D;sBACjD,0BAA0B,GAAG,IAAI;QAC7C,yEAAyE;oCAC7C,CAAC,MAAM,EAAE,0BAA0B,GAAG,IAAI,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC;;IAGhG,oFAAoF;;;QAGlF,2DAA2D;;QAG3D,4DAA4D;;;;;;;;;;;;;yBAS3C,MAAM;;;;CAI1B,CAAA"}
@@ -23,7 +23,7 @@ export const speech = {
23
23
  /** Current auto-download status of the offline STT model. */
24
24
  status: () => offlineSpeechModelService.getStatus(),
25
25
  /** Subscribe to auto-download status changes; returns an unsubscribe. */
26
- onStatusChanged: (...args) => offlineSpeechModelService.subscribe(...args),
26
+ onStatusChanged: (listener) => offlineSpeechModelService.subscribe(listener),
27
27
  },
28
28
  /** Phone → Soniox direct transcription (user-supplied API key, Settings > Keys). */
29
29
  sonioxDirect: {
@@ -1 +1 @@
1
- {"version":3,"file":"speech.js","sourceRoot":"","sources":["../../src/facades/speech.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,YAAY,MAAM,iCAAiC,CAAA;AAC1D,OAAO,eAAe,MAAM,6BAA6B,CAAA;AACzD,OAAO,eAAe,MAAM,6BAA6B,CAA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AC9E,mBAAmB,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC;KAC9C;IACD,GAAG,EAAE;QACH,eAAe,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,kBAAkB,EAAE;QAC3D,SAAS,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,qBAAqB,EAAE;QACxD,YAAY,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,kBAAkB,EAAE;QACxD,QAAQ,EAAE,CAAC,GAAG,IAAsD,EAAE,EAAE,CAAC,eAAe,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC;QAC/G,QAAQ,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,eAAe,CAAC,kBAAkB,CAAC,IAAI,CAAC;QACpE,cAAc,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,cAAc,EAAE;QACtD,WAAW,EAAE,CAAC,GAAG,IAAoD,EAAE,EAAE,CAAC,eAAe,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;KAC/G;CACF,CAAA","sourcesContent":["/**\n * speech facade — `engine.speech.{stt,tts}`: on-device STT/TTS model management,\n * wrapping the in-engine model managers. Thin passthrough (args forwarded with\n * exact types via Parameters<>), so the facade never drifts from the managers.\n * STT additionally exposes the auto-download status stream (the TTS path has none).\n */\nimport BluetoothSdk from \"@glassly/bluetooth-sdk/internal\"\nimport sttModelManager from \"../services/STTModelManager\"\nimport ttsModelManager from \"../services/TTSModelManager\"\nimport offlineSpeechModelService from \"../services/OfflineSpeechModelService\"\nimport sonioxDirectService from \"../services/soniox/SonioxDirectService\"\n\nexport const speech = {\n /** Restart the glasses' on-device transcriber (e.g. after switching STT language). */\n restartTranscriber: (): Promise<void> => BluetoothSdk.restartTranscriber(),\n stt: {\n currentLanguage: () => sttModelManager.getCurrentLanguage(),\n languages: () => sttModelManager.getAvailableLanguages(),\n languageInfo: () => sttModelManager.getAllLanguageInfo(),\n download: (...args: Parameters<typeof sttModelManager.downloadModel>) => sttModelManager.downloadModel(...args),\n activate: (code: string) => sttModelManager.setCurrentLanguage(code),\n cancelDownload: () => sttModelManager.cancelDownload(),\n deleteModel: (...args: Parameters<typeof sttModelManager.deleteModel>) => sttModelManager.deleteModel(...args),\n /** Current auto-download status of the offline STT model. */\n status: () => offlineSpeechModelService.getStatus(),\n /** Subscribe to auto-download status changes; returns an unsubscribe. */\n onStatusChanged: (...args: Parameters<typeof offlineSpeechModelService.subscribe>) =>\n offlineSpeechModelService.subscribe(...args),\n },\n /** Phone → Soniox direct transcription (user-supplied API key, Settings > Keys). */\n sonioxDirect: {\n getStatus: () => sonioxDirectService.getStatus(),\n /** Subscribe to status changes; returns an unsubscribe. */\n onStatusChanged: (...args: Parameters<typeof sonioxDirectService.onStatusChanged>) =>\n sonioxDirectService.onStatusChanged(...args),\n /** Probe a key against the Soniox API without saving it. */\n validateKey: (...args: Parameters<typeof sonioxDirectService.validateApiKey>) =>\n sonioxDirectService.validateApiKey(...args),\n },\n tts: {\n currentLanguage: () => ttsModelManager.getCurrentLanguage(),\n languages: () => ttsModelManager.getAvailableLanguages(),\n languageInfo: () => ttsModelManager.getAllLanguageInfo(),\n download: (...args: Parameters<typeof ttsModelManager.downloadModel>) => ttsModelManager.downloadModel(...args),\n activate: (code: string) => ttsModelManager.setCurrentLanguage(code),\n cancelDownload: () => ttsModelManager.cancelDownload(),\n deleteModel: (...args: Parameters<typeof ttsModelManager.deleteModel>) => ttsModelManager.deleteModel(...args),\n },\n}\n"]}
1
+ {"version":3,"file":"speech.js","sourceRoot":"","sources":["../../src/facades/speech.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,YAAY,MAAM,iCAAiC,CAAA;AAC1D,OAAO,eAAe,MAAM,6BAA6B,CAAA;AACzD,OAAO,eAAe,MAAM,6BAA6B,CAAA;AACzD,OAAO,yBAEN,MAAM,uCAAuC,CAAA;AAC9C,OAAO,mBAAmB,MAAM,wCAAwC,CAAA;AAQxE,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,sFAAsF;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AAS,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,qBAAqB,EAAE;QACxD,YAAY,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,kBAAkB,EAAE;QACxD,QAAQ,EAAE,CAAC,GAAG,IAAsD,EAAE,EAAE,CAAC,eAAe,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC;QAC/G,QAAQ,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,eAAe,CAAC,kBAAkB,CAAC,IAAI,CAAC;QACpE,cAAc,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,cAAc,EAAE;QACtD,WAAW,EAAE,CAAC,GAAG,IAAoD,EAAE,EAAE,CAAC,eAAe,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;KAC/G;CACF,CAAA","sourcesContent":["/**\n * speech facade — `engine.speech.{stt,tts}`: on-device STT/TTS model management,\n * wrapping the in-engine model managers. Thin passthrough (args forwarded with\n * exact types via Parameters<>), so the facade never drifts from the managers.\n * STT additionally exposes the auto-download status stream (the TTS path has none).\n */\nimport BluetoothSdk from \"@glassly/bluetooth-sdk/internal\"\nimport sttModelManager from \"../services/STTModelManager\"\nimport ttsModelManager from \"../services/TTSModelManager\"\nimport offlineSpeechModelService, {\n type DownloadStatus as OfflineModelDownloadStatus,\n} from \"../services/OfflineSpeechModelService\"\nimport sonioxDirectService from \"../services/soniox/SonioxDirectService\"\nimport type {\n DownloadProgress as SttDownloadProgress,\n ExtractionProgress as SttExtractionProgress,\n LanguageConfig as SttLanguageConfig,\n LanguageInfo as SttLanguageInfo,\n} from \"../services/STTModelManager\"\n\nexport const speech = {\n /** Restart the glasses' on-device transcriber (e.g. after switching STT language). */\n restartTranscriber: (): Promise<void> => BluetoothSdk.restartTranscriber(),\n stt: {\n currentLanguage: () => sttModelManager.getCurrentLanguage(),\n languages: (): SttLanguageConfig[] => sttModelManager.getAvailableLanguages(),\n languageInfo: (): Promise<SttLanguageInfo[]> => sttModelManager.getAllLanguageInfo(),\n download: (\n ...args: [\n code?: string,\n onProgress?: (progress: SttDownloadProgress) => void,\n onExtractionProgress?: (progress: SttExtractionProgress) => void,\n ]\n ): Promise<void> => sttModelManager.downloadModel(...args),\n activate: (code: string) => sttModelManager.setCurrentLanguage(code),\n cancelDownload: () => sttModelManager.cancelDownload(),\n deleteModel: (...args: Parameters<typeof sttModelManager.deleteModel>) => sttModelManager.deleteModel(...args),\n /** Current auto-download status of the offline STT model. */\n status: (): OfflineModelDownloadStatus | null => offlineSpeechModelService.getStatus(),\n /** Subscribe to auto-download status changes; returns an unsubscribe. */\n onStatusChanged: (listener: (status: OfflineModelDownloadStatus | null) => void): (() => void) =>\n offlineSpeechModelService.subscribe(listener),\n },\n /** Phone → Soniox direct transcription (user-supplied API key, Settings > Keys). */\n sonioxDirect: {\n getStatus: () => sonioxDirectService.getStatus(),\n /** Subscribe to status changes; returns an unsubscribe. */\n onStatusChanged: (...args: Parameters<typeof sonioxDirectService.onStatusChanged>) =>\n sonioxDirectService.onStatusChanged(...args),\n /** Probe a key against the Soniox API without saving it. */\n validateKey: (...args: Parameters<typeof sonioxDirectService.validateApiKey>) =>\n sonioxDirectService.validateApiKey(...args),\n },\n tts: {\n currentLanguage: () => ttsModelManager.getCurrentLanguage(),\n languages: () => ttsModelManager.getAvailableLanguages(),\n languageInfo: () => ttsModelManager.getAllLanguageInfo(),\n download: (...args: Parameters<typeof ttsModelManager.downloadModel>) => ttsModelManager.downloadModel(...args),\n activate: (code: string) => ttsModelManager.setCurrentLanguage(code),\n cancelDownload: () => ttsModelManager.cancelDownload(),\n deleteModel: (...args: Parameters<typeof ttsModelManager.deleteModel>) => ttsModelManager.deleteModel(...args),\n },\n}\n"]}
@@ -0,0 +1,12 @@
1
+ /** Generated by release CI. Do not edit in a release checkout. */
2
+ export interface EngineReleaseMetadata {
3
+ schemaVersion: 1;
4
+ familyBaseVersion: string | null;
5
+ releaseIdentity: string | null;
6
+ releaseSetId: string | null;
7
+ sourceCommit: string | null;
8
+ otaManifestUrl: string | null;
9
+ otaManifestSha256: string | null;
10
+ }
11
+ export declare const ENGINE_RELEASE_METADATA: Readonly<EngineReleaseMetadata>;
12
+ //# sourceMappingURL=releaseMetadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"releaseMetadata.d.ts","sourceRoot":"","sources":["../../src/generated/releaseMetadata.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,CAAC,CAAA;IAChB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;CACjC;AAED,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,qBAAqB,CAQlE,CAAA"}
@@ -0,0 +1,10 @@
1
+ export const ENGINE_RELEASE_METADATA = Object.freeze({
2
+ "schemaVersion": 1,
3
+ "familyBaseVersion": "0.1.0",
4
+ "releaseIdentity": "0.1.0-dev.26",
5
+ "releaseSetId": "glassly-0.1.0-dev.26",
6
+ "sourceCommit": "b63f66924c61de31540b5093d05ff036c756ed74",
7
+ "otaManifestUrl": null,
8
+ "otaManifestSha256": null
9
+ });
10
+ //# sourceMappingURL=releaseMetadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"releaseMetadata.js","sourceRoot":"","sources":["../../src/generated/releaseMetadata.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,uBAAuB,GAAoC,MAAM,CAAC,MAAM,CAAC;IACpF,eAAe,EAAE,CAAC;IAClB,mBAAmB,EAAE,OAAO;IAC5B,iBAAiB,EAAE,cAAc;IACjC,cAAc,EAAE,sBAAsB;IACtC,cAAc,EAAE,0CAA0C;IAC1D,gBAAgB,EAAE,IAAI;IACtB,mBAAmB,EAAE,IAAI;CAC1B,CAAC,CAAA","sourcesContent":["/** Generated by release CI. Do not edit in a release checkout. */\nexport interface EngineReleaseMetadata {\n schemaVersion: 1\n familyBaseVersion: string | null\n releaseIdentity: string | null\n releaseSetId: string | null\n sourceCommit: string | null\n otaManifestUrl: string | null\n otaManifestSha256: string | null\n}\n\nexport const ENGINE_RELEASE_METADATA: Readonly<EngineReleaseMetadata> = Object.freeze({\n \"schemaVersion\": 1,\n \"familyBaseVersion\": \"0.1.0\",\n \"releaseIdentity\": \"0.1.0-dev.26\",\n \"releaseSetId\": \"glassly-0.1.0-dev.26\",\n \"sourceCommit\": \"b63f66924c61de31540b5093d05ff036c756ed74\",\n \"otaManifestUrl\": null,\n \"otaManifestSha256\": null\n})\n"]}
package/build/index.d.ts CHANGED
@@ -6,8 +6,7 @@
6
6
  * renders with (decision functions, sort/order helpers, policy constants,
7
7
  * capability tables, timers). Judgment rule: read models, commands, pure
8
8
  * functions and types belong here; anything that mutates runtime state or
9
- * exposes a raw store/service lives on `@glassly/engine/internal`
10
- * (migration-era surface) or `@glassly/engine/devtools` (debug-only) instead.
9
+ * exposes a raw store/service remains private to the GlasslyOS host.
11
10
  * See cloud-v2/docs/issues/020-glasses-status-boundary/integration-review.md §D.
12
11
  */
13
12
  export { engine } from "./engine";
@@ -18,6 +17,7 @@ export type { IdentitySnapshot } from "./services/PairingIdentity";
18
17
  export type { DisplayMirrorEvent } from "./facades/displayMirror";
19
18
  export type { IslandConfigureOptions, IslandAuth, IslandConfigValues, IslandAnalytics, IslandUiSeams, ScanQrOptions, ScanQrResult, SubjectTokenType, } from "./runtime/bootstrap";
20
19
  export { SETTINGS, useSetting } from "./stores/settings";
20
+ export { isCustomDashboardEligible, normalizeDashboardWidgets, DASHBOARD_WIDGET_IDS, type DashboardWidgetId, type DashboardWidgetSetting, } from "./services/CustomDashboardModel";
21
21
  export { AI_TIERS, TIER_MODEL_OPTIONS, parseTierSetting } from "./services/AiTierResolution";
22
22
  export type { AiTier, AiTierProvider, TierModelOption } from "./services/AiTierResolution";
23
23
  export type { MemoryStats } from "./services/MemoryStore";
@@ -32,12 +32,15 @@ export type { VersionInfo, MtkPatch, BesFirmware, VersionJson, OtaCheckResult, O
32
32
  export { MINIMUM_OTA_STATUS_BUILD, MAX_RETRIES, RETRY_INTERVAL_MS, PROGRESS_TIMEOUT_MS, DOWNLOAD_STUCK_TIMEOUT_MS, MTK_INSTALL_TIMEOUT_MS, GLOBAL_OTA_TIMEOUT_MS, PING_INTERVAL_MS, QUERY_REPLY_TIMEOUT_MS, OtaProgressMessages, } from "./services/otaInstallPolicy";
33
33
  export { deriveDisplayState } from "./services/otaDisplayState";
34
34
  export type { DisplayState } from "./services/otaDisplayState";
35
- export type { OtaProgress, OtaProgressStatus, OtaStatus, OtaUpdateInfo, OtaSnapshot, OtaInstallSnapshot, } from "./facades/ota";
35
+ export type { OtaProgress, OtaProgressStatus, OtaStatus, OtaUpdateInfo, ReleaseChangelog, OtaSnapshot, OtaInstallSnapshot, } from "./facades/ota";
36
+ export { beginOtaAutoChain, clearOtaAutoChainReconnectWait, isOtaAutoChainActive, otaAutoChainFingerprint, otaAutoChainReconnectWaitRemaining, stopOtaAutoChain, tryAdvanceOtaAutoChain, MAX_OTA_AUTO_CHAIN_PASSES, OTA_AUTO_CHAIN_RECONNECT_TIMEOUT_MS, } from "./services/OtaAutoChain";
37
+ export type { OtaAutoChainAdvanceResult } from "./services/OtaAutoChain";
38
+ export { BES_INSTALL_RESTART_MESSAGE, getOtaErrorMessage, shouldRequireGlassesRebootForBesFailure, shouldShowChangeWifiForOtaDownloadFailure, } from "./services/OtaErrorMapping";
36
39
  export type { GalleryNotice, GalleryNoticeCode } from "./services/asg/galleryNotices";
37
40
  export { MediaLibraryPermissions } from "./utils/permissions/MediaLibraryPermissions";
38
41
  export { deriveGalleryDisplayName } from "./utils/permissions/galleryDisplayName";
39
42
  export type { PhotoInfo, CaptureFile, CaptureGroup, GalleryResponse, ServerStatus, HealthResponse, GalleryEvent, } from "./types/asg";
40
- export type { PairFailureEvent, GlassesNotReadyEvent } from "@glassly/bluetooth-sdk/internal";
43
+ export type { PairFailureEvent, GlassesNotReadyEvent } from "@glassly/bluetooth-sdk";
41
44
  export { WebSocketStatus } from "./stores/connection";
42
45
  export { DUMMY_APPLET, saveAppsOrder, getAppsOrder, sortAppsByPackageNamePriority, saveLastOpenTime, getLastOpenTime, sortAppsByLastOpenTime, useApps, useStart, useStop, useSetForeground, useClearForeground, useRefresh, useStopAll, useInstall, useUninstall, useActiveApps, useActiveBackgroundApps, useBackgroundApps, useActiveForegroundApp, useForegroundApp, useActiveBackgroundAppsCount, useLocalMiniApps, type StartOptions, type OrderMap, } from "./stores/apps";
43
46
  export { decideDevLaunchRoute, type DecideDevLaunchOptions, type DevLaunchResult, type DevManifest, } from "./utils/devMiniappLaunch";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAA;AAC/B,YAAY,EACV,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EAAC,kBAAkB,EAAE,sBAAsB,EAAC,MAAM,yBAAyB,CAAA;AACvF,YAAY,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAA;AAC3D,YAAY,EAAC,gBAAgB,EAAC,MAAM,4BAA4B,CAAA;AAChE,YAAY,EAAC,kBAAkB,EAAC,MAAM,yBAAyB,CAAA;AAC/D,YAAY,EACV,sBAAsB,EACtB,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,aAAa,EACb,YAAY,EACZ,gBAAgB,GACjB,MAAM,qBAAqB,CAAA;AAO5B,OAAO,EAAC,QAAQ,EAAE,UAAU,EA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,EAAE,KAAK,mBAAmB,EAAC,MAAM,kBAAkB,CAAA;AAChF,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAA;AAG1D,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,UAAU,EACV,SAAS,EACT,aAAa,EACb,IAAI,GACL,MAAM,SAAS,CAAA;AAChB,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,SAAS,GACV,MAAM,SAAS,CAAA"}
package/build/index.js CHANGED
@@ -6,8 +6,7 @@
6
6
  * renders with (decision functions, sort/order helpers, policy constants,
7
7
  * capability tables, timers). Judgment rule: read models, commands, pure
8
8
  * functions and types belong here; anything that mutates runtime state or
9
- * exposes a raw store/service lives on `@glassly/engine/internal`
10
- * (migration-era surface) or `@glassly/engine/devtools` (debug-only) instead.
9
+ * exposes a raw store/service remains private to the GlasslyOS host.
11
10
  * See cloud-v2/docs/issues/020-glasses-status-boundary/integration-review.md §D.
12
11
  */
13
12
  // The namespaced OEM-facing engine API (the "(A) host API"). See ./engine.
@@ -18,6 +17,7 @@ export { engine } from "./engine";
18
17
  // device-model key helpers. The raw useSettingsStore stays internal;
19
18
  // imperative access goes through engine.settings.
20
19
  export { SETTINGS, useSetting } from "./stores/settings";
20
+ export { isCustomDashboardEligible, normalizeDashboardWidgets, DASHBOARD_WIDGET_IDS, } from "./services/CustomDashboardModel";
21
21
  // AI tier registry: the curated per-tier model dropdown options and helpers
22
22
  // the Settings > AI Models screen renders. Resolution itself runs inside
23
23
  // LocalMiniappRuntime; the screen only reads/writes the ai_model_* settings.
@@ -33,6 +33,8 @@ export { decideReconnect, decideConnectButtonAction, } from "./services/Connecti
33
33
  // derivation, consumed by the OTA screens and their tests.
34
34
  export { MINIMUM_OTA_STATUS_BUILD, MAX_RETRIES, RETRY_INTERVAL_MS, PROGRESS_TIMEOUT_MS, DOWNLOAD_STUCK_TIMEOUT_MS, MTK_INSTALL_TIMEOUT_MS, GLOBAL_OTA_TIMEOUT_MS, PING_INTERVAL_MS, QUERY_REPLY_TIMEOUT_MS, OtaProgressMessages, } from "./services/otaInstallPolicy";
35
35
  export { deriveDisplayState } from "./services/otaDisplayState";
36
+ export { beginOtaAutoChain, clearOtaAutoChainReconnectWait, isOtaAutoChainActive, otaAutoChainFingerprint, otaAutoChainReconnectWaitRemaining, stopOtaAutoChain, tryAdvanceOtaAutoChain, MAX_OTA_AUTO_CHAIN_PASSES, OTA_AUTO_CHAIN_RECONNECT_TIMEOUT_MS, } from "./services/OtaAutoChain";
37
+ export { BES_INSTALL_RESTART_MESSAGE, getOtaErrorMessage, shouldRequireGlassesRebootForBesFailure, shouldShowChangeWifiForOtaDownloadFailure, } from "./services/OtaErrorMapping";
36
38
  export { MediaLibraryPermissions } from "./utils/permissions/MediaLibraryPermissions";
37
39
  export { deriveGalleryDisplayName } from "./utils/permissions/galleryDisplayName";
38
40
  // Cloud connection status enum (read model; the connection store is internal).
@@ -44,6 +46,6 @@ export { DUMMY_APPLET, saveAppsOrder, getAppsOrder, sortAppsByPackageNamePriorit
44
46
  export { decideDevLaunchRoute, } from "./utils/devMiniappLaunch";
45
47
  export { HardwareCompatibility } from "./utils/hardware";
46
48
  export { BgTimer, throttle, debounce } from "./utils/timers";
47
- // Types (hardware requirement types are canonical in @glassly/miniapp; the rest are engine-owned)
49
+ // Hardware types and capability profiles.
48
50
  export { HardwareType, HardwareRequirementLevel, DeviceTypes, ControllerTypes, HARDWARE_CAPABILITIES, getModelCapabilities, simulatedGlasses, evenRealitiesG1, evenRealitiesG2, mentraLive, vuzixZ100, mentraDisplay, nimo, } from "./types";
49
51
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,2EAA2E;AAC3E,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAA;AAyB/B,2EAA2E;AAC3E,6EAA6E;AAC7E,yEAAyE;AACzE,qEAAqE;AACrE,kDAAkD;AAClD,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAA;AAEtD,4EAA4E;AAC5E,yEAAyE;AACzE,6EAA6E;AAC7E,OAAO,EAAC,QAAQ,EAAE,kBAAkB,EAAE,gBAAgB,EAAC,MAAM,6BAA6B,CAAA;AAS1F,OAAO,EAAC,wBAAwB,EAAE,gCAAgC,EAAC,MAAM,+BAA+B,CAAA;AAExG,8CAA8C;AAC9C,OAAO,EAAC,oBAAoB,EAAC,MAAM,kBAAkB,CAAA;AAGrD,2DAA2D;AAC3D,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,mBAAmB,GAGpB,MAAM,6BAA6B,CAAA;AACpC,yEAAyE;AACzE,OAAO,EACL,eAAe,EACf,yBAAyB,GAI1B,MAAM,kCAAkC,CAAA;AAazC,uEAAuE;AACvE,2DAA2D;AAC3D,OAAO,EACL,wBAAwB,EACxB,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAC,kBAAkB,EAAC,MAAM,4BAA4B,CAAA;AAe7D,OAAO,EAAC,uBAAuB,EAAC,MAAM,6CAA6C,CAAA;AACnF,OAAO,EAAC,wBAAwB,EAAC,MAAM,wCAAwC,CAAA;AAe/E,+EAA+E;AAC/E,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAA;AAEnD,yEAAyE;AACzE,6CAA6C;AAC7C,OAAO,EACL,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,6BAA6B,EAC7B,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,OAAO,EACP,QAAQ,EACR,OAAO,EACP,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACZ,aAAa,EACb,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,4BAA4B,EAC5B,gBAAgB,GAGjB,MAAM,eAAe,CAAA;AAEtB,4EAA4E;AAC5E,OAAO,EACL,oBAAoB,GAIrB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAC,qBAAqB,EAA2B,MAAM,kBAAkB,CAAA;AAChF,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAA;AAE1D,kGAAkG;AAClG,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,UAAU,EACV,SAAS,EACT,aAAa,EACb,IAAI,GACL,MAAM,SAAS,CAAA","sourcesContent":["/**\n * `@glassly/engine` — the OEM-facing main entry.\n *\n * The `engine` namespace (configure/start/stop + typed domain facades), the\n * public contract/read-model types, and the pure helpers host UI legitimately\n * renders with (decision functions, sort/order helpers, policy constants,\n * capability tables, timers). Judgment rule: read models, commands, pure\n * functions and types belong here; anything that mutates runtime state or\n * exposes a raw store/service lives on `@glassly/engine/internal`\n * (migration-era surface) or `@glassly/engine/devtools` (debug-only) instead.\n * See cloud-v2/docs/issues/020-glasses-status-boundary/integration-review.md §D.\n */\n\n// The namespaced OEM-facing engine API (the \"(A) host API\"). See ./engine.\nexport {engine} from \"./engine\"\nexport type {\n ReportAttachmentInput,\n ReportContext,\n ReportDetails,\n ReportStatus,\n ReportTrigger,\n ReportSubmitResult,\n EngineSubmitReportInput,\n} from \"./facades/reports\"\nexport type {IslandNotification, IslandNotificationKind} from \"./facades/notifications\"\nexport type {WifiSearchResult} from \"./facades/glassesWifi\"\nexport type {IdentitySnapshot} from \"./services/PairingIdentity\"\nexport type {DisplayMirrorEvent} from \"./facades/displayMirror\"\nexport type {\n IslandConfigureOptions,\n IslandAuth,\n IslandConfigValues,\n IslandAnalytics,\n IslandUiSeams,\n ScanQrOptions,\n ScanQrResult,\n SubjectTokenType,\n} from \"./runtime/bootstrap\"\n\n// Settings contract: the typed key registry (schema descriptors — the same\n// surface engine.settings.descriptor()/keys() reads), the per-key React hook\n// (the hook layer, same precedent as the apps hooks below), and the pure\n// device-model key helpers. The raw useSettingsStore stays internal;\n// imperative access goes through engine.settings.\nexport {SETTINGS, useSetting} from \"./stores/settings\"\n\n// AI tier registry: the curated per-tier model dropdown options and helpers\n// the Settings > AI Models screen renders. Resolution itself runs inside\n// LocalMiniappRuntime; the screen only reads/writes the ai_model_* settings.\nexport {AI_TIERS, TIER_MODEL_OPTIONS, parseTierSetting} from \"./services/AiTierResolution\"\nexport type {AiTier, AiTierProvider, TierModelOption} from \"./services/AiTierResolution\"\n\n// Shared user memory timeline (engine.memory / Settings > Memory). Entry and\n// session shapes are canonical in @glassly/miniapp (the session.memory\n// surface); the stats read model is engine-side.\nexport type {MemoryStats} from \"./services/MemoryStore\"\nexport type {SpeakerProfile} from \"./services/SpeakerProfileStore\"\nexport type {EnrollOutcome} from \"./facades/speakers\"\nexport {MENTRA_LIVE_SETTING_KEYS, getBluetoothSettingKeysForDevice} from \"./stores/bluetoothSettingKeys\"\n\n// Runtime-shared constants and contract DTOs.\nexport {ISLAND_SETTINGS_KEYS} from \"./runtime/config\"\nexport type {CloudClientStatusSnapshot, MiniappAuthToken, InteropAuditEvent, TtsSynthesisResult} from \"./runtime/config\"\n\n// Pure readiness predicates over glasses connection state.\nexport {\n isGlassesConnected,\n isGlassesReady,\n isGlassesLinkLayerBusy,\n waitForGlassesReady,\n type GlassesConnectionStatus,\n type WaitForGlassesReadyOptions,\n} from \"./services/GlassesReadiness\"\n// Pure connect/reconnect decision helpers (host UI renders the outcome).\nexport {\n decideReconnect,\n decideConnectButtonAction,\n type ReconnectDecision,\n type ReconnectDecisionInput,\n type ConnectButtonAction,\n} from \"./services/ConnectionCoordinator\"\n\n// OTA read-model types for host OTA UI (progress screen, error mapping,\n// progress section) — the check/install machinery itself is internal.\nexport type {\n VersionInfo,\n MtkPatch,\n BesFirmware,\n VersionJson,\n OtaCheckResult,\n OtaCheckCurrentGlassesResult,\n OtaCheckCurrentGlassesOptions,\n} from \"./services/OtaUpdateCheckService\"\n// OTA install policy (watchdog timings + failure copy) + display-state\n// derivation, consumed by the OTA screens and their tests.\nexport {\n MINIMUM_OTA_STATUS_BUILD,\n MAX_RETRIES,\n RETRY_INTERVAL_MS,\n PROGRESS_TIMEOUT_MS,\n DOWNLOAD_STUCK_TIMEOUT_MS,\n MTK_INSTALL_TIMEOUT_MS,\n GLOBAL_OTA_TIMEOUT_MS,\n PING_INTERVAL_MS,\n QUERY_REPLY_TIMEOUT_MS,\n OtaProgressMessages,\n} from \"./services/otaInstallPolicy\"\nexport {deriveDisplayState} from \"./services/otaDisplayState\"\nexport type {DisplayState} from \"./services/otaDisplayState\"\nexport type {\n OtaProgress,\n OtaProgressStatus,\n OtaStatus,\n OtaUpdateInfo,\n OtaSnapshot,\n OtaInstallSnapshot,\n} from \"./facades/ota\"\n\n// Gallery read models: engine.gallery.onNotice payload types, the media\n// permission helper + display-name derivation host gallery UI uses, and the\n// glasses-camera DTO types (re-exported through the host @/types/asg shim).\nexport type {GalleryNotice, GalleryNoticeCode} from \"./services/asg/galleryNotices\"\nexport {MediaLibraryPermissions} from \"./utils/permissions/MediaLibraryPermissions\"\nexport {deriveGalleryDisplayName} from \"./utils/permissions/galleryDisplayName\"\nexport type {\n PhotoInfo,\n CaptureFile,\n CaptureGroup,\n GalleryResponse,\n ServerStatus,\n HealthResponse,\n GalleryEvent,\n} from \"./types/asg\"\n\n// Bluetooth SDK event types host UI subscribes to via engine facades (the\n// BluetoothSdk singleton passthrough itself is internal).\nexport type {PairFailureEvent, GlassesNotReadyEvent} from \"@glassly/bluetooth-sdk/internal\"\n\n// Cloud connection status enum (read model; the connection store is internal).\nexport {WebSocketStatus} from \"./stores/connection\"\n\n// App-list hook layer + pure list helpers (the raw useAppStatusStore and\n// installAppStoreHooks wiring are internal).\nexport {\n DUMMY_APPLET,\n saveAppsOrder,\n getAppsOrder,\n sortAppsByPackageNamePriority,\n saveLastOpenTime,\n getLastOpenTime,\n sortAppsByLastOpenTime,\n useApps,\n useStart,\n useStop,\n useSetForeground,\n useClearForeground,\n useRefresh,\n useStopAll,\n useInstall,\n useUninstall,\n useActiveApps,\n useActiveBackgroundApps,\n useBackgroundApps,\n useActiveForegroundApp,\n useForegroundApp,\n useActiveBackgroundAppsCount,\n useLocalMiniApps,\n type StartOptions,\n type OrderMap,\n} from \"./stores/apps\"\n\n// Pure dev-miniapp launch-route decision (registration itself is internal).\nexport {\n decideDevLaunchRoute,\n type DecideDevLaunchOptions,\n type DevLaunchResult,\n type DevManifest,\n} from \"./utils/devMiniappLaunch\"\nexport {HardwareCompatibility, type CompatibilityResult} from \"./utils/hardware\"\nexport {BgTimer, throttle, debounce} from \"./utils/timers\"\n\n// Types (hardware requirement types are canonical in @glassly/miniapp; the rest are engine-owned)\nexport {\n HardwareType,\n HardwareRequirementLevel,\n DeviceTypes,\n ControllerTypes,\n HARDWARE_CAPABILITIES,\n getModelCapabilities,\n simulatedGlasses,\n evenRealitiesG1,\n evenRealitiesG2,\n mentraLive,\n vuzixZ100,\n mentraDisplay,\n nimo,\n} from \"./types\"\nexport type {\n HardwareRequirement,\n CameraCapabilities,\n DisplayCapabilities,\n MicrophoneCapabilities,\n SpeakerCapabilities,\n IMUCapabilities,\n ButtonCapabilities,\n LightCapabilities,\n PowerCapabilities,\n Capabilities,\n AppletType,\n AppPermissionType,\n AppletPermission,\n AppletInterface,\n ClientApp,\n} from \"./types\"\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,2EAA2E;AAC3E,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAA;AAyB/B,2EAA2E;AAC3E,6EAA6E;AAC7E,yEAAyE;AACzE,qEAAqE;AACrE,kDAAkD;AAClD,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAA;AACtD,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,GAGrB,MAAM,iCAAiC,CAAA;AAExC,4EAA4E;AAC5E,yEAAyE;AACzE,6EAA6E;AAC7E,OAAO,EAAC,QAAQ,EAAE,kBAAkB,EAAE,gBAAgB,EAAC,MAAM,6BAA6B,CAAA;AAS1F,OAAO,EAAC,wBAAwB,EAAE,gCAAgC,EAAC,MAAM,+BAA+B,CAAA;AAExG,8CAA8C;AAC9C,OAAO,EAAC,oBAAoB,EAAC,MAAM,kBAAkB,CAAA;AAGrD,2DAA2D;AAC3D,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,mBAAmB,GAGpB,MAAM,6BAA6B,CAAA;AACpC,yEAAyE;AACzE,OAAO,EACL,eAAe,EACf,yBAAyB,GAI1B,MAAM,kCAAkC,CAAA;AAazC,uEAAuE;AACvE,2DAA2D;AAC3D,OAAO,EACL,wBAAwB,EACxB,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAC,kBAAkB,EAAC,MAAM,4BAA4B,CAAA;AAW7D,OAAO,EACL,iBAAiB,EACjB,8BAA8B,EAC9B,oBAAoB,EACpB,uBAAuB,EACvB,kCAAkC,EAClC,gBAAgB,EAChB,sBAAsB,EACtB,yBAAyB,EACzB,mCAAmC,GACpC,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EAClB,uCAAuC,EACvC,yCAAyC,GAC1C,MAAM,4BAA4B,CAAA;AAMnC,OAAO,EAAC,uBAAuB,EAAC,MAAM,6CAA6C,CAAA;AACnF,OAAO,EAAC,wBAAwB,EAAC,MAAM,wCAAwC,CAAA;AAe/E,+EAA+E;AAC/E,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAA;AAEnD,yEAAyE;AACzE,6CAA6C;AAC7C,OAAO,EACL,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,6BAA6B,EAC7B,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,OAAO,EACP,QAAQ,EACR,OAAO,EACP,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACZ,aAAa,EACb,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,4BAA4B,EAC5B,gBAAgB,GAGjB,MAAM,eAAe,CAAA;AAEtB,4EAA4E;AAC5E,OAAO,EACL,oBAAoB,GAIrB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAC,qBAAqB,EAA2B,MAAM,kBAAkB,CAAA;AAChF,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAA;AAE1D,0CAA0C;AAC1C,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,UAAU,EACV,SAAS,EACT,aAAa,EACb,IAAI,GACL,MAAM,SAAS,CAAA","sourcesContent":["/**\n * `@glassly/engine` — the OEM-facing main entry.\n *\n * The `engine` namespace (configure/start/stop + typed domain facades), the\n * public contract/read-model types, and the pure helpers host UI legitimately\n * renders with (decision functions, sort/order helpers, policy constants,\n * capability tables, timers). Judgment rule: read models, commands, pure\n * functions and types belong here; anything that mutates runtime state or\n * exposes a raw store/service remains private to the GlasslyOS host.\n * See cloud-v2/docs/issues/020-glasses-status-boundary/integration-review.md §D.\n */\n\n// The namespaced OEM-facing engine API (the \"(A) host API\"). See ./engine.\nexport {engine} from \"./engine\"\nexport type {\n ReportAttachmentInput,\n ReportContext,\n ReportDetails,\n ReportStatus,\n ReportTrigger,\n ReportSubmitResult,\n EngineSubmitReportInput,\n} from \"./facades/reports\"\nexport type {IslandNotification, IslandNotificationKind} from \"./facades/notifications\"\nexport type {WifiSearchResult} from \"./facades/glassesWifi\"\nexport type {IdentitySnapshot} from \"./services/PairingIdentity\"\nexport type {DisplayMirrorEvent} from \"./facades/displayMirror\"\nexport type {\n IslandConfigureOptions,\n IslandAuth,\n IslandConfigValues,\n IslandAnalytics,\n IslandUiSeams,\n ScanQrOptions,\n ScanQrResult,\n SubjectTokenType,\n} from \"./runtime/bootstrap\"\n\n// Settings contract: the typed key registry (schema descriptors — the same\n// surface engine.settings.descriptor()/keys() reads), the per-key React hook\n// (the hook layer, same precedent as the apps hooks below), and the pure\n// device-model key helpers. The raw useSettingsStore stays internal;\n// imperative access goes through engine.settings.\nexport {SETTINGS, useSetting} from \"./stores/settings\"\nexport {\n isCustomDashboardEligible,\n normalizeDashboardWidgets,\n DASHBOARD_WIDGET_IDS,\n type DashboardWidgetId,\n type DashboardWidgetSetting,\n} from \"./services/CustomDashboardModel\"\n\n// AI tier registry: the curated per-tier model dropdown options and helpers\n// the Settings > AI Models screen renders. Resolution itself runs inside\n// LocalMiniappRuntime; the screen only reads/writes the ai_model_* settings.\nexport {AI_TIERS, TIER_MODEL_OPTIONS, parseTierSetting} from \"./services/AiTierResolution\"\nexport type {AiTier, AiTierProvider, TierModelOption} from \"./services/AiTierResolution\"\n\n// Shared user memory timeline (engine.memory / Settings > Memory). Entry and\n// session shapes are canonical in @glassly/miniapp (the session.memory\n// surface); the stats read model is engine-side.\nexport type {MemoryStats} from \"./services/MemoryStore\"\nexport type {SpeakerProfile} from \"./services/SpeakerProfileStore\"\nexport type {EnrollOutcome} from \"./facades/speakers\"\nexport {MENTRA_LIVE_SETTING_KEYS, getBluetoothSettingKeysForDevice} from \"./stores/bluetoothSettingKeys\"\n\n// Runtime-shared constants and contract DTOs.\nexport {ISLAND_SETTINGS_KEYS} from \"./runtime/config\"\nexport type {CloudClientStatusSnapshot, MiniappAuthToken, InteropAuditEvent, TtsSynthesisResult} from \"./runtime/config\"\n\n// Pure readiness predicates over glasses connection state.\nexport {\n isGlassesConnected,\n isGlassesReady,\n isGlassesLinkLayerBusy,\n waitForGlassesReady,\n type GlassesConnectionStatus,\n type WaitForGlassesReadyOptions,\n} from \"./services/GlassesReadiness\"\n// Pure connect/reconnect decision helpers (host UI renders the outcome).\nexport {\n decideReconnect,\n decideConnectButtonAction,\n type ReconnectDecision,\n type ReconnectDecisionInput,\n type ConnectButtonAction,\n} from \"./services/ConnectionCoordinator\"\n\n// OTA read-model types for host OTA UI (progress screen, error mapping,\n// progress section) — the check/install machinery itself is internal.\nexport type {\n VersionInfo,\n MtkPatch,\n BesFirmware,\n VersionJson,\n OtaCheckResult,\n OtaCheckCurrentGlassesResult,\n OtaCheckCurrentGlassesOptions,\n} from \"./services/OtaUpdateCheckService\"\n// OTA install policy (watchdog timings + failure copy) + display-state\n// derivation, consumed by the OTA screens and their tests.\nexport {\n MINIMUM_OTA_STATUS_BUILD,\n MAX_RETRIES,\n RETRY_INTERVAL_MS,\n PROGRESS_TIMEOUT_MS,\n DOWNLOAD_STUCK_TIMEOUT_MS,\n MTK_INSTALL_TIMEOUT_MS,\n GLOBAL_OTA_TIMEOUT_MS,\n PING_INTERVAL_MS,\n QUERY_REPLY_TIMEOUT_MS,\n OtaProgressMessages,\n} from \"./services/otaInstallPolicy\"\nexport {deriveDisplayState} from \"./services/otaDisplayState\"\nexport type {DisplayState} from \"./services/otaDisplayState\"\nexport type {\n OtaProgress,\n OtaProgressStatus,\n OtaStatus,\n OtaUpdateInfo,\n ReleaseChangelog,\n OtaSnapshot,\n OtaInstallSnapshot,\n} from \"./facades/ota\"\nexport {\n beginOtaAutoChain,\n clearOtaAutoChainReconnectWait,\n isOtaAutoChainActive,\n otaAutoChainFingerprint,\n otaAutoChainReconnectWaitRemaining,\n stopOtaAutoChain,\n tryAdvanceOtaAutoChain,\n MAX_OTA_AUTO_CHAIN_PASSES,\n OTA_AUTO_CHAIN_RECONNECT_TIMEOUT_MS,\n} from \"./services/OtaAutoChain\"\nexport type {OtaAutoChainAdvanceResult} from \"./services/OtaAutoChain\"\nexport {\n BES_INSTALL_RESTART_MESSAGE,\n getOtaErrorMessage,\n shouldRequireGlassesRebootForBesFailure,\n shouldShowChangeWifiForOtaDownloadFailure,\n} from \"./services/OtaErrorMapping\"\n\n// Gallery read models: engine.gallery.onNotice payload types, the media\n// permission helper + display-name derivation host gallery UI uses, and the\n// glasses-camera DTO types (re-exported through the host @/types/asg shim).\nexport type {GalleryNotice, GalleryNoticeCode} from \"./services/asg/galleryNotices\"\nexport {MediaLibraryPermissions} from \"./utils/permissions/MediaLibraryPermissions\"\nexport {deriveGalleryDisplayName} from \"./utils/permissions/galleryDisplayName\"\nexport type {\n PhotoInfo,\n CaptureFile,\n CaptureGroup,\n GalleryResponse,\n ServerStatus,\n HealthResponse,\n GalleryEvent,\n} from \"./types/asg\"\n\n// Bluetooth SDK event types host UI subscribes to via engine facades (the\n// BluetoothSdk singleton passthrough itself is internal).\nexport type {PairFailureEvent, GlassesNotReadyEvent} from \"@glassly/bluetooth-sdk\"\n\n// Cloud connection status enum (read model; the connection store is internal).\nexport {WebSocketStatus} from \"./stores/connection\"\n\n// App-list hook layer + pure list helpers (the raw useAppStatusStore and\n// installAppStoreHooks wiring are internal).\nexport {\n DUMMY_APPLET,\n saveAppsOrder,\n getAppsOrder,\n sortAppsByPackageNamePriority,\n saveLastOpenTime,\n getLastOpenTime,\n sortAppsByLastOpenTime,\n useApps,\n useStart,\n useStop,\n useSetForeground,\n useClearForeground,\n useRefresh,\n useStopAll,\n useInstall,\n useUninstall,\n useActiveApps,\n useActiveBackgroundApps,\n useBackgroundApps,\n useActiveForegroundApp,\n useForegroundApp,\n useActiveBackgroundAppsCount,\n useLocalMiniApps,\n type StartOptions,\n type OrderMap,\n} from \"./stores/apps\"\n\n// Pure dev-miniapp launch-route decision (registration itself is internal).\nexport {\n decideDevLaunchRoute,\n type DecideDevLaunchOptions,\n type DevLaunchResult,\n type DevManifest,\n} from \"./utils/devMiniappLaunch\"\nexport {HardwareCompatibility, type CompatibilityResult} from \"./utils/hardware\"\nexport {BgTimer, throttle, debounce} from \"./utils/timers\"\n\n// Hardware types and capability profiles.\nexport {\n HardwareType,\n HardwareRequirementLevel,\n DeviceTypes,\n ControllerTypes,\n HARDWARE_CAPABILITIES,\n getModelCapabilities,\n simulatedGlasses,\n evenRealitiesG1,\n evenRealitiesG2,\n mentraLive,\n vuzixZ100,\n mentraDisplay,\n nimo,\n} from \"./types\"\nexport type {\n HardwareRequirement,\n CameraCapabilities,\n DisplayCapabilities,\n MicrophoneCapabilities,\n SpeakerCapabilities,\n IMUCapabilities,\n ButtonCapabilities,\n LightCapabilities,\n PowerCapabilities,\n Capabilities,\n AppletType,\n AppPermissionType,\n AppletPermission,\n AppletInterface,\n ClientApp,\n} from \"./types\"\n"]}
@@ -0,0 +1,39 @@
1
+ import React from "react";
2
+ import { type StyleProp, type ViewStyle } from "react-native";
3
+ import { type MentraLiveOtaFlowPage } from "./useMentraLiveOta";
4
+ export type { MentraLiveOtaFlowPage } from "./useMentraLiveOta";
5
+ export type MentraLiveOtaFlowTheme = {
6
+ background: string;
7
+ border: string;
8
+ error: string;
9
+ foreground: string;
10
+ primary: string;
11
+ primaryText: string;
12
+ textDim: string;
13
+ };
14
+ export type MentraLiveOtaFlowTranslate = (key: string, options?: Record<string, string>) => string;
15
+ export type MentraLiveOtaFlowProps = {
16
+ /** Display name used in update copy. */
17
+ deviceName?: string;
18
+ /** Entry page. `progress` exists for recovery/deep-link compatibility. */
19
+ initialPage?: MentraLiveOtaFlowPage;
20
+ /** Start the OTA-only projections. Full Engine hosts should pass false. */
21
+ initializeRuntime?: boolean;
22
+ /** Called after the final check or when the user leaves an optional update. */
23
+ onFinished: () => void;
24
+ /** Host-owned Wi-Fi setup for glasses that do not support hotspot OTA. */
25
+ onOpenWifiSetup: () => void;
26
+ /** Lets a host coordinate its global connection overlay with OTA progress and firmware restarts. */
27
+ onFirmwareRestartingChange?: (restarting: boolean, progressActive: boolean) => void;
28
+ /** Enables the existing developer-only escape hatches. */
29
+ allowDevSkip?: boolean;
30
+ /** Enables the existing super-mode interrupted-session escape hatch. */
31
+ superMode?: boolean;
32
+ /** Optional host localization. Defaults to the Glassly App English OTA copy. */
33
+ translate?: MentraLiveOtaFlowTranslate;
34
+ /** Optional host theme. Both hosts use the same layout and state machine. */
35
+ theme?: Partial<MentraLiveOtaFlowTheme>;
36
+ style?: StyleProp<ViewStyle>;
37
+ };
38
+ export declare function MentraLiveOtaFlow({ allowDevSkip, deviceName, initialPage, initializeRuntime, onFinished, onFirmwareRestartingChange, onOpenWifiSetup, style, superMode, theme, translate, }: MentraLiveOtaFlowProps): React.JSX.Element;
39
+ //# sourceMappingURL=MentraLiveOtaFlow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MentraLiveOtaFlow.d.ts","sourceRoot":"","sources":["../../src/react/MentraLiveOtaFlow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAgB,MAAM,OAAO,CAAA;AACpC,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAA;AAIrB,OAAO,EAAiD,KAAK,qBAAqB,EAAC,MAAM,oBAAoB,CAAA;AAE7G,YAAY,EAAC,qBAAqB,EAAC,MAAM,oBAAoB,CAAA;AAE7D,MAAM,MAAM,sBAAsB,GAAG;IACnC,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAA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