@glassly/engine 0.3.2-beta.572 → 0.3.2-beta.602

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 (151) hide show
  1. package/README.md +1 -1
  2. package/build/engine.d.ts +15 -1
  3. package/build/engine.d.ts.map +1 -1
  4. package/build/engine.js +7 -3
  5. package/build/engine.js.map +1 -1
  6. package/build/facades/dev.d.ts +2 -2
  7. package/build/facades/dev.d.ts.map +1 -1
  8. package/build/facades/dev.js +2 -2
  9. package/build/facades/dev.js.map +1 -1
  10. package/build/facades/glasses.d.ts +20 -0
  11. package/build/facades/glasses.d.ts.map +1 -1
  12. package/build/facades/glasses.js +21 -0
  13. package/build/facades/glasses.js.map +1 -1
  14. package/build/facades/pairing.js +1 -1
  15. package/build/facades/pairing.js.map +1 -1
  16. package/build/facades/reports.js +2 -2
  17. package/build/facades/reports.js.map +1 -1
  18. package/build/facades/session.d.ts +1 -1
  19. package/build/facades/session.js +2 -2
  20. package/build/facades/session.js.map +1 -1
  21. package/build/generated/releaseMetadata.js +3 -3
  22. package/build/generated/releaseMetadata.js.map +1 -1
  23. package/build/index.d.ts +3 -1
  24. package/build/index.d.ts.map +1 -1
  25. package/build/index.js +3 -1
  26. package/build/index.js.map +1 -1
  27. package/build/runtime/bootstrap.d.ts +2 -2
  28. package/build/runtime/bootstrap.d.ts.map +1 -1
  29. package/build/runtime/bootstrap.js.map +1 -1
  30. package/build/services/CloudAudioSubscriptionSync.d.ts +2 -2
  31. package/build/services/CloudAudioSubscriptionSync.js +2 -2
  32. package/build/services/CloudAudioSubscriptionSync.js.map +1 -1
  33. package/build/services/CloudClientService.d.ts +2 -2
  34. package/build/services/CloudClientService.d.ts.map +1 -1
  35. package/build/services/CloudClientService.js +4 -4
  36. package/build/services/CloudClientService.js.map +1 -1
  37. package/build/services/CloudTranscriptE2EMetrics.d.ts +2 -2
  38. package/build/services/CloudTranscriptE2EMetrics.d.ts.map +1 -1
  39. package/build/services/CloudTranscriptE2EMetrics.js +3 -3
  40. package/build/services/CloudTranscriptE2EMetrics.js.map +1 -1
  41. package/build/services/DeviceEventRouter.d.ts.map +1 -1
  42. package/build/services/DeviceEventRouter.js +5 -0
  43. package/build/services/DeviceEventRouter.js.map +1 -1
  44. package/build/services/GestureDotsService.d.ts +9 -9
  45. package/build/services/GestureDotsService.d.ts.map +1 -1
  46. package/build/services/GestureDotsService.js +75 -50
  47. package/build/services/GestureDotsService.js.map +1 -1
  48. package/build/services/GlassesTouchInput.d.ts +1 -1
  49. package/build/services/GlassesTouchInput.d.ts.map +1 -1
  50. package/build/services/GlassesTouchInput.js +7 -4
  51. package/build/services/GlassesTouchInput.js.map +1 -1
  52. package/build/services/LocalMiniappRuntime.d.ts +1 -1
  53. package/build/services/LocalMiniappRuntime.d.ts.map +1 -1
  54. package/build/services/LocalMiniappRuntime.js +32 -8
  55. package/build/services/LocalMiniappRuntime.js.map +1 -1
  56. package/build/services/LocalSttFallbackCoordinator.d.ts +5 -2
  57. package/build/services/LocalSttFallbackCoordinator.d.ts.map +1 -1
  58. package/build/services/LocalSttFallbackCoordinator.js +7 -3
  59. package/build/services/LocalSttFallbackCoordinator.js.map +1 -1
  60. package/build/services/PhonePhotoCoordinator.d.ts +1 -1
  61. package/build/services/PhonePhotoCoordinator.js +4 -4
  62. package/build/services/PhonePhotoCoordinator.js.map +1 -1
  63. package/build/services/PhoneStreamCoordinator.d.ts +1 -1
  64. package/build/services/PhoneStreamCoordinator.js +1 -1
  65. package/build/services/PhoneStreamCoordinator.js.map +1 -1
  66. package/build/services/SupportProfileSync.d.ts +1 -1
  67. package/build/services/SupportProfileSync.js +2 -2
  68. package/build/services/SupportProfileSync.js.map +1 -1
  69. package/build/services/TranscriptionRouting.d.ts +6 -1
  70. package/build/services/TranscriptionRouting.d.ts.map +1 -1
  71. package/build/services/TranscriptionRouting.js +7 -3
  72. package/build/services/TranscriptionRouting.js.map +1 -1
  73. package/build/services/cloudStreamApi.d.ts +2 -2
  74. package/build/services/cloudStreamApi.js +2 -2
  75. package/build/services/cloudStreamApi.js.map +1 -1
  76. package/build/services/gestureDotGlyphs.d.ts +1 -1
  77. package/build/services/gestureDotGlyphs.d.ts.map +1 -1
  78. package/build/services/gestureDotGlyphs.js +5 -0
  79. package/build/services/gestureDotGlyphs.js.map +1 -1
  80. package/build/services/neuralBand/MetaAuth.d.ts +31 -0
  81. package/build/services/neuralBand/MetaAuth.d.ts.map +1 -0
  82. package/build/services/neuralBand/MetaAuth.js +161 -0
  83. package/build/services/neuralBand/MetaAuth.js.map +1 -0
  84. package/build/services/neuralBand/NeuralBandInput.d.ts +50 -0
  85. package/build/services/neuralBand/NeuralBandInput.d.ts.map +1 -0
  86. package/build/services/neuralBand/NeuralBandInput.js +114 -0
  87. package/build/services/neuralBand/NeuralBandInput.js.map +1 -0
  88. package/build/services/neuralBand/NeuralBandSettingsSync.d.ts +3 -0
  89. package/build/services/neuralBand/NeuralBandSettingsSync.d.ts.map +1 -0
  90. package/build/services/neuralBand/NeuralBandSettingsSync.js +52 -0
  91. package/build/services/neuralBand/NeuralBandSettingsSync.js.map +1 -0
  92. package/build/services/neuralBand/sha256.d.ts +7 -0
  93. package/build/services/neuralBand/sha256.d.ts.map +1 -0
  94. package/build/services/neuralBand/sha256.js +68 -0
  95. package/build/services/neuralBand/sha256.js.map +1 -0
  96. package/build/services/settingsBridge.d.ts +12 -4
  97. package/build/services/settingsBridge.d.ts.map +1 -1
  98. package/build/services/settingsBridge.js +13 -4
  99. package/build/services/settingsBridge.js.map +1 -1
  100. package/build/services/soniox/SonioxRealtimeClient.d.ts +2 -2
  101. package/build/services/soniox/SonioxRealtimeClient.js +2 -2
  102. package/build/services/soniox/SonioxRealtimeClient.js.map +1 -1
  103. package/build/services/soniox/SonioxTokenAssembler.d.ts +1 -1
  104. package/build/services/soniox/SonioxTokenAssembler.js +1 -1
  105. package/build/services/soniox/SonioxTokenAssembler.js.map +1 -1
  106. package/build/stores/cloudClientStatus.js +1 -1
  107. package/build/stores/cloudClientStatus.js.map +1 -1
  108. package/build/stores/settings.d.ts.map +1 -1
  109. package/build/stores/settings.js +25 -7
  110. package/build/stores/settings.js.map +1 -1
  111. package/build/types/enums.d.ts +2 -1
  112. package/build/types/enums.d.ts.map +1 -1
  113. package/build/types/enums.js +1 -0
  114. package/build/types/enums.js.map +1 -1
  115. package/build/utils/cloudClient/cloudSecureStore.js +2 -2
  116. package/build/utils/cloudClient/cloudSecureStore.js.map +1 -1
  117. package/package.json +7 -7
  118. package/src/engine.ts +7 -3
  119. package/src/facades/dev.ts +2 -2
  120. package/src/facades/glasses.ts +27 -0
  121. package/src/facades/pairing.ts +1 -1
  122. package/src/facades/reports.ts +2 -2
  123. package/src/facades/session.ts +2 -2
  124. package/src/generated/releaseMetadata.ts +3 -3
  125. package/src/index.ts +15 -1
  126. package/src/runtime/bootstrap.ts +2 -2
  127. package/src/services/CloudAudioSubscriptionSync.ts +2 -2
  128. package/src/services/CloudClientService.ts +4 -4
  129. package/src/services/CloudTranscriptE2EMetrics.ts +3 -3
  130. package/src/services/DeviceEventRouter.ts +5 -0
  131. package/src/services/GestureDotsService.ts +72 -49
  132. package/src/services/GlassesTouchInput.ts +13 -5
  133. package/src/services/LocalMiniappRuntime.ts +52 -24
  134. package/src/services/LocalSttFallbackCoordinator.ts +18 -4
  135. package/src/services/PhonePhotoCoordinator.ts +4 -4
  136. package/src/services/PhoneStreamCoordinator.ts +1 -1
  137. package/src/services/SupportProfileSync.ts +2 -2
  138. package/src/services/TranscriptionRouting.ts +12 -4
  139. package/src/services/cloudStreamApi.ts +3 -3
  140. package/src/services/gestureDotGlyphs.ts +6 -1
  141. package/src/services/neuralBand/MetaAuth.ts +192 -0
  142. package/src/services/neuralBand/NeuralBandInput.ts +148 -0
  143. package/src/services/neuralBand/NeuralBandSettingsSync.ts +63 -0
  144. package/src/services/neuralBand/sha256.ts +70 -0
  145. package/src/services/settingsBridge.ts +15 -4
  146. package/src/services/soniox/SonioxRealtimeClient.ts +2 -2
  147. package/src/services/soniox/SonioxTokenAssembler.ts +1 -1
  148. package/src/stores/cloudClientStatus.ts +1 -1
  149. package/src/stores/settings.ts +25 -7
  150. package/src/types/enums.ts +1 -0
  151. package/src/utils/cloudClient/cloudSecureStore.ts +2 -2
@@ -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,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,OAAO,EAAC,eAAe,EAAC,MAAM,UAAU,CAAA;AACxC,OAAO,EAAC,qBAAqB,EAAC,MAAM,WAAW,CAAA;AAE/C,OAAO,EAAC,OAAO,EAAC,MAAM,iBAAiB,CAAA;AAYvC,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,Q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AAiB,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\nimport {BgTimer} from \"../utils/timers\"\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: number | 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) BgTimer.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 = BgTimer.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: number | 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) BgTimer.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 = BgTimer.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
+ {"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,OAAO,EAAC,eAAe,EAAC,MAAM,UAAU,CAAA;AACxC,OAAO,EAAC,qBAAqB,EAAC,MAAM,WAAW,CAAA;AAE/C,OAAO,EA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,CAAC,8FAA8F,CAAC,CAAA;QAC3G,MAAM,YAAY,CAAC,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\nimport {BgTimer} from \"../utils/timers\"\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 !== undefined && (Object.values(ControllerTypes) as string[]).includes(deviceModel)) {\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: number | 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) BgTimer.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 = BgTimer.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: number | 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) BgTimer.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 = BgTimer.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,9 +1,9 @@
1
1
  /**
2
2
  * reports facade — `engine.reports`: user/system report submission over the
3
- * Cloud V2 core client.
3
+ * Cloud core client.
4
4
  *
5
5
  * Host/OEM code owns UI and wording. Engine owns Glassly mechanics: context
6
- * collection, recent phone logs, Cloud V2 calls, local automatic throttling,
6
+ * collection, recent phone logs, Cloud calls, local automatic throttling,
7
7
  * screenshots, and notifying connected glasses.
8
8
  */
9
9
  import BluetoothSdk from "@glassly/bluetooth-sdk/internal";
@@ -1 +1 @@
1
- {"version":3,"file":"reports.js","sourceRoot":"","sources":["../../src/facades/reports.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,YAAY,MAAM,iCAAiC,CAAA;AAE1D,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B,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAC3E,CAAC;IAED,OAAO,EAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAC,CAAA;AACtD,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,MAAM,CAAC,KAA8B;QACnC,OAAO,oBAAoB,CAAC,KAAK,CAAC,CAAA;IACpC,CAAC;CACF,CAAA;AAED,MAAM,UAAU,qBAAqB,CAAC,KAAuC;IAC3E,OAAO,oBAAoB,CAAC,KAAK,CAAC,CAAA;AACpC,CAAC","sourcesContent":["/**\n * reports facade — `engine.reports`: user/system report submission over the\n * Cloud V2 core client.\n *\n * Host/OEM code owns UI and wording. Engine owns Glassly mechanics: context\n * collection, recent phone logs, Cloud V2 calls, local automatic throttling,\n * screenshots, and notifying connected glasses.\n */\nimport BluetoothSdk from \"@glassly/bluetooth-sdk/internal\"\nimport type {ReportAttachmentInput, ReportContext, ReportStatus, SubmitReportInput} from \"@glassly/cloud-client\"\nimport {useGlassesStore} from \"../stores/glasses\"\nimport {isGlassesConnected} from \"../services/GlassesReadiness\"\nimport {cloudClientService} from \"../services/CloudClientService\"\nimport {collectDiagnosticContext} from \"../utils/diagnosticContext\"\nimport {logBuffer} from \"../utils/devLogging\"\n\nexport type {\n ReportAttachmentInput,\n ReportContext,\n ReportDetails,\n ReportStatus,\n ReportTrigger,\n} from \"@glassly/cloud-client\"\n\nexport type EngineSubmitReportInput =\n | (Omit<Extract<SubmitReportInput, {kind: \"bug\"}>, \"context\"> & {\n context?: Partial<ReportContext>\n screenshots?: ReportAttachmentInput[]\n })\n | (Omit<Extract<SubmitReportInput, {kind: \"feedback\"}>, \"context\"> & {\n context?: Partial<ReportContext>\n })\n\nexport type EngineSubmitAutomaticReportInput = Omit<Extract<SubmitReportInput, {kind: \"automatic\"}>, \"context\"> & {\n context?: Partial<ReportContext>\n screenshots?: ReportAttachmentInput[]\n throttleKey?: string\n throttleWindowMs?: number\n}\n\ntype InternalSubmitReportInput = EngineSubmitReportInput | EngineSubmitAutomaticReportInput\n\nexport type ReportSubmitResult =\n | {status: \"submitted\"; reportId: string; reportStatus: ReportStatus}\n | {status: \"skipped\"; reason: \"throttled_within_window\"}\n | {status: \"failed\"; error: string}\n\nconst DEFAULT_AUTOMATIC_REPORT_THROTTLE_MS = 90_000\nconst automaticReportThrottleRegistry = new Map<string, number>()\n\nfunction automaticThrottleShouldSkip(key: string, nowMs: number, windowMs: number): boolean {\n const previous = automaticReportThrottleRegistry.get(key)\n if (previous !== undefined && nowMs - previous < windowMs) {\n return true\n }\n pruneAutomaticThrottleRegistry(nowMs, windowMs)\n return false\n}\n\nfunction markAutomaticThrottleSuccess(key: string, nowMs: number, windowMs: number): void {\n automaticReportThrottleRegistry.set(key, nowMs)\n pruneAutomaticThrottleRegistry(nowMs, windowMs)\n}\n\nfunction pruneAutomaticThrottleRegistry(nowMs: number, windowMs: number): void {\n for (const [entryKey, entryTime] of automaticReportThrottleRegistry) {\n if (nowMs - entryTime > windowMs * 3) {\n automaticReportThrottleRegistry.delete(entryKey)\n }\n }\n}\n\nfunction notifyGlasses(reportId: string, apiBaseUrl?: string | null): void {\n if (!isGlassesConnected(useGlassesStore.getState().connection)) return\n void (async () => {\n try {\n await cloudClientService.syncCoreTokenToBluetooth()\n await BluetoothSdk.sendIncidentId(reportId, apiBaseUrl ?? cloudClientService.getCoreUrl())\n } catch (error) {\n console.warn(\"reports.submit: notify glasses failed:\", error instanceof Error ? error.message : error)\n }\n })()\n}\n\nasync function submitReportInternal(input: InternalSubmitReportInput): Promise<ReportSubmitResult> {\n const throttle =\n input.kind === \"automatic\" && input.throttleKey\n ? {\n key: input.throttleKey,\n windowMs: input.throttleWindowMs ?? DEFAULT_AUTOMATIC_REPORT_THROTTLE_MS,\n }\n : null\n\n if (input.kind === \"automatic\" && input.throttleKey) {\n const shouldSkip = automaticThrottleShouldSkip(\n input.throttleKey,\n Date.now(),\n throttle?.windowMs ?? DEFAULT_AUTOMATIC_REPORT_THROTTLE_MS,\n )\n if (shouldSkip) return {status: \"skipped\", reason: \"throttled_within_window\"}\n }\n\n const context = await collectDiagnosticContext(input.context)\n let reportId: string\n let reportStatus: ReportStatus\n let artifactsComplete = true\n try {\n const res =\n input.kind === \"feedback\"\n ? await cloudClientService.core.reports.submit({\n kind: \"feedback\",\n feedback: input.feedback,\n context,\n })\n : input.kind === \"bug\"\n ? await cloudClientService.core.reports.submit({\n kind: \"bug\",\n trigger: input.trigger,\n report: input.report,\n context,\n })\n : await cloudClientService.core.reports.submit({\n kind: \"automatic\",\n trigger: input.trigger,\n report: input.report,\n context,\n })\n reportId = res.reportId\n reportStatus = res.status\n } catch (error) {\n return {status: \"failed\", error: error instanceof Error ? error.message : String(error)}\n }\n\n if (input.kind !== \"feedback\") {\n const logs = logBuffer.getRecentLogs()\n if (logs.length > 0) {\n try {\n await cloudClientService.core.reports.addLogs(reportId, \"phone\", logs)\n } catch (error) {\n artifactsComplete = false\n console.warn(\"reports.submit: add phone logs failed:\", error instanceof Error ? error.message : error)\n }\n }\n\n notifyGlasses(reportId, cloudClientService.getCoreUrl())\n\n if (input.screenshots && input.screenshots.length > 0) {\n try {\n await cloudClientService.core.reports.addScreenshots(reportId, input.screenshots)\n } catch (error) {\n artifactsComplete = false\n console.warn(\"reports.submit: add screenshots failed:\", error instanceof Error ? error.message : error)\n }\n }\n\n try {\n const completed = await cloudClientService.core.reports.complete(reportId)\n reportStatus = completed.status\n } catch (error) {\n artifactsComplete = false\n console.warn(\"reports.submit: complete report failed:\", error instanceof Error ? error.message : error)\n }\n }\n\n if (throttle && artifactsComplete) {\n markAutomaticThrottleSuccess(throttle.key, Date.now(), throttle.windowMs)\n }\n\n return {status: \"submitted\", reportId, reportStatus}\n}\n\nexport const reports = {\n submit(input: EngineSubmitReportInput): Promise<ReportSubmitResult> {\n return submitReportInternal(input)\n },\n}\n\nexport function submitAutomaticReport(input: EngineSubmitAutomaticReportInput): Promise<ReportSubmitResult> {\n return submitReportInternal(input)\n}\n"]}
1
+ {"version":3,"file":"reports.js","sourceRoot":"","sources":["../../src/facades/reports.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,YAAY,MAAM,iCAAiC,CAAA;AAE1D,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAC,kBAAkB,EAAC,MAAM,8BAA8B,CAAA;AAC/D,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAA;AACjE,OAAO,EAAC,wBAAwB,EAAC,MAAM,4BAA4B,CAAA;AACnE,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAA;AAiC7C,MAAM,oCAAoC,GAAG,MAAM,CAAA;AACnD,MAAM,+BAA+B,GAAG,IAAI,GAAG,EAAkB,CAAA;AAEjE,SAAS,2BAA2B,CAAC,GAAW,EAAE,KAAa,EAAE,QAAgB;IAC/E,MAAM,QAAQ,GAAG,+BAA+B,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACzD,IAAI,QAAQ,KAAK,SAAS,IAAI,KAAK,GAAG,QAAQ,GAAG,QAAQ,EAAE,CAAC;QAC1D,OAAO,IAAI,CAAA;IACb,CAAC;IACD,8BAA8B,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IAC/C,OAAO,KAAK,CAAA;AACd,CAAC;AAED,SAAS,4BAA4B,CAAC,GAAW,EAAE,KAAa,EAAE,QAAgB;IAChF,+BAA+B,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IAC/C,8BAA8B,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;AACjD,CAAC;AAED,SAAS,8BAA8B,CAAC,KAAa,EAAE,QAAgB;IACrE,KAAK,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,IAAI,+BAA+B,EAAE,CAAC;QACpE,IAAI,KAAK,GAAG,SAAS,GAAG,Q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OAAO,CAAC,IAAI,CAAC,yCAAyC,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;QACzG,CAAC;IACH,CAAC;IAED,IAAI,QAAQ,IAAI,iBAAiB,EAAE,CAAC;QAClC,4BAA4B,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAC3E,CAAC;IAED,OAAO,EAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAC,CAAA;AACtD,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,MAAM,CAAC,KAA8B;QACnC,OAAO,oBAAoB,CAAC,KAAK,CAAC,CAAA;IACpC,CAAC;CACF,CAAA;AAED,MAAM,UAAU,qBAAqB,CAAC,KAAuC;IAC3E,OAAO,oBAAoB,CAAC,KAAK,CAAC,CAAA;AACpC,CAAC","sourcesContent":["/**\n * reports facade — `engine.reports`: user/system report submission over the\n * Cloud core client.\n *\n * Host/OEM code owns UI and wording. Engine owns Glassly mechanics: context\n * collection, recent phone logs, Cloud calls, local automatic throttling,\n * screenshots, and notifying connected glasses.\n */\nimport BluetoothSdk from \"@glassly/bluetooth-sdk/internal\"\nimport type {ReportAttachmentInput, ReportContext, ReportStatus, SubmitReportInput} from \"@glassly/cloud-client\"\nimport {useGlassesStore} from \"../stores/glasses\"\nimport {isGlassesConnected} from \"../services/GlassesReadiness\"\nimport {cloudClientService} from \"../services/CloudClientService\"\nimport {collectDiagnosticContext} from \"../utils/diagnosticContext\"\nimport {logBuffer} from \"../utils/devLogging\"\n\nexport type {\n ReportAttachmentInput,\n ReportContext,\n ReportDetails,\n ReportStatus,\n ReportTrigger,\n} from \"@glassly/cloud-client\"\n\nexport type EngineSubmitReportInput =\n | (Omit<Extract<SubmitReportInput, {kind: \"bug\"}>, \"context\"> & {\n context?: Partial<ReportContext>\n screenshots?: ReportAttachmentInput[]\n })\n | (Omit<Extract<SubmitReportInput, {kind: \"feedback\"}>, \"context\"> & {\n context?: Partial<ReportContext>\n })\n\nexport type EngineSubmitAutomaticReportInput = Omit<Extract<SubmitReportInput, {kind: \"automatic\"}>, \"context\"> & {\n context?: Partial<ReportContext>\n screenshots?: ReportAttachmentInput[]\n throttleKey?: string\n throttleWindowMs?: number\n}\n\ntype InternalSubmitReportInput = EngineSubmitReportInput | EngineSubmitAutomaticReportInput\n\nexport type ReportSubmitResult =\n | {status: \"submitted\"; reportId: string; reportStatus: ReportStatus}\n | {status: \"skipped\"; reason: \"throttled_within_window\"}\n | {status: \"failed\"; error: string}\n\nconst DEFAULT_AUTOMATIC_REPORT_THROTTLE_MS = 90_000\nconst automaticReportThrottleRegistry = new Map<string, number>()\n\nfunction automaticThrottleShouldSkip(key: string, nowMs: number, windowMs: number): boolean {\n const previous = automaticReportThrottleRegistry.get(key)\n if (previous !== undefined && nowMs - previous < windowMs) {\n return true\n }\n pruneAutomaticThrottleRegistry(nowMs, windowMs)\n return false\n}\n\nfunction markAutomaticThrottleSuccess(key: string, nowMs: number, windowMs: number): void {\n automaticReportThrottleRegistry.set(key, nowMs)\n pruneAutomaticThrottleRegistry(nowMs, windowMs)\n}\n\nfunction pruneAutomaticThrottleRegistry(nowMs: number, windowMs: number): void {\n for (const [entryKey, entryTime] of automaticReportThrottleRegistry) {\n if (nowMs - entryTime > windowMs * 3) {\n automaticReportThrottleRegistry.delete(entryKey)\n }\n }\n}\n\nfunction notifyGlasses(reportId: string, apiBaseUrl?: string | null): void {\n if (!isGlassesConnected(useGlassesStore.getState().connection)) return\n void (async () => {\n try {\n await cloudClientService.syncCoreTokenToBluetooth()\n await BluetoothSdk.sendIncidentId(reportId, apiBaseUrl ?? cloudClientService.getCoreUrl())\n } catch (error) {\n console.warn(\"reports.submit: notify glasses failed:\", error instanceof Error ? error.message : error)\n }\n })()\n}\n\nasync function submitReportInternal(input: InternalSubmitReportInput): Promise<ReportSubmitResult> {\n const throttle =\n input.kind === \"automatic\" && input.throttleKey\n ? {\n key: input.throttleKey,\n windowMs: input.throttleWindowMs ?? DEFAULT_AUTOMATIC_REPORT_THROTTLE_MS,\n }\n : null\n\n if (input.kind === \"automatic\" && input.throttleKey) {\n const shouldSkip = automaticThrottleShouldSkip(\n input.throttleKey,\n Date.now(),\n throttle?.windowMs ?? DEFAULT_AUTOMATIC_REPORT_THROTTLE_MS,\n )\n if (shouldSkip) return {status: \"skipped\", reason: \"throttled_within_window\"}\n }\n\n const context = await collectDiagnosticContext(input.context)\n let reportId: string\n let reportStatus: ReportStatus\n let artifactsComplete = true\n try {\n const res =\n input.kind === \"feedback\"\n ? await cloudClientService.core.reports.submit({\n kind: \"feedback\",\n feedback: input.feedback,\n context,\n })\n : input.kind === \"bug\"\n ? await cloudClientService.core.reports.submit({\n kind: \"bug\",\n trigger: input.trigger,\n report: input.report,\n context,\n })\n : await cloudClientService.core.reports.submit({\n kind: \"automatic\",\n trigger: input.trigger,\n report: input.report,\n context,\n })\n reportId = res.reportId\n reportStatus = res.status\n } catch (error) {\n return {status: \"failed\", error: error instanceof Error ? error.message : String(error)}\n }\n\n if (input.kind !== \"feedback\") {\n const logs = logBuffer.getRecentLogs()\n if (logs.length > 0) {\n try {\n await cloudClientService.core.reports.addLogs(reportId, \"phone\", logs)\n } catch (error) {\n artifactsComplete = false\n console.warn(\"reports.submit: add phone logs failed:\", error instanceof Error ? error.message : error)\n }\n }\n\n notifyGlasses(reportId, cloudClientService.getCoreUrl())\n\n if (input.screenshots && input.screenshots.length > 0) {\n try {\n await cloudClientService.core.reports.addScreenshots(reportId, input.screenshots)\n } catch (error) {\n artifactsComplete = false\n console.warn(\"reports.submit: add screenshots failed:\", error instanceof Error ? error.message : error)\n }\n }\n\n try {\n const completed = await cloudClientService.core.reports.complete(reportId)\n reportStatus = completed.status\n } catch (error) {\n artifactsComplete = false\n console.warn(\"reports.submit: complete report failed:\", error instanceof Error ? error.message : error)\n }\n }\n\n if (throttle && artifactsComplete) {\n markAutomaticThrottleSuccess(throttle.key, Date.now(), throttle.windowMs)\n }\n\n return {status: \"submitted\", reportId, reportStatus}\n}\n\nexport const reports = {\n submit(input: EngineSubmitReportInput): Promise<ReportSubmitResult> {\n return submitReportInternal(input)\n },\n}\n\nexport function submitAutomaticReport(input: EngineSubmitAutomaticReportInput): Promise<ReportSubmitResult> {\n return submitReportInternal(input)\n}\n"]}
@@ -11,7 +11,7 @@ export declare const session: {
11
11
  * Legacy Cloud-V1 websocket status. The socket's writer (the host
12
12
  * WebSocketManager) was deleted in the Cloud V1 ripout, so this now always
13
13
  * reports the store's initial DISCONNECTED; the host connection banners
14
- * render `status()` (the cloud-v2 runtime) instead. Kept, with the backing
14
+ * render `status()` (the cloud runtime) instead. Kept, with the backing
15
15
  * connection store, for the engine-side legacy-surface removal (issue #3392).
16
16
  */
17
17
  legacyWebsocketStatus: () => WebSocketStatus;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * session facade — `engine.session`: the cloud-v2 live-session surface engine
2
+ * session facade — `engine.session`: the cloud live-session surface engine
3
3
  * now owns (keystone #5). Exposes the connection status read-model (status +
4
4
  * audio transport, projected from the engine-owned cloud-status store) and the
5
5
  * liveness flag.
@@ -34,7 +34,7 @@ export const session = {
34
34
  * Legacy Cloud-V1 websocket status. The socket's writer (the host
35
35
  * WebSocketManager) was deleted in the Cloud V1 ripout, so this now always
36
36
  * reports the store's initial DISCONNECTED; the host connection banners
37
- * render `status()` (the cloud-v2 runtime) instead. Kept, with the backing
37
+ * render `status()` (the cloud runtime) instead. Kept, with the backing
38
38
  * connection store, for the engine-side legacy-surface removal (issue #3392).
39
39
  */
40
40
  legacyWebsocketStatus: () => useConnectionStore.getState().status,
@@ -1 +1 @@
1
- {"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/facades/session.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAA;A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AAC,MAAM,KAAK,IAAI;gBAAE,OAAM;YACjC,IAAI,GAAG,KAAK,CAAC,MAAM,CAAA;YACnB,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QAClB,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA","sourcesContent":["/**\n * session facade — `engine.session`: the cloud-v2 live-session surface engine\n * now owns (keystone #5). Exposes the connection status read-model (status +\n * audio transport, projected from the engine-owned cloud-status store) and the\n * liveness flag.\n *\n */\nimport {cloudClientService} from \"../services/CloudClientService\"\nimport {useCloudClientStatusStore} from \"../stores/cloudClientStatus\"\nimport {useConnectionStore} from \"../stores/connection\"\nimport type {WebSocketStatus} from \"../stores/connection\"\nimport type {CloudClientStatusSnapshot} from \"../runtime/config\"\n\nfunction project(): CloudClientStatusSnapshot {\n const s = useCloudClientStatusStore.getState()\n return {status: s.status, audioTransport: s.audioTransport}\n}\n\nexport const session = {\n /** Current cloud live-session status (connection state + audio transport). */\n status: (): CloudClientStatusSnapshot => project(),\n /** Subscribe to cloud session-status changes; returns an unsubscribe. */\n onStatus: (cb: (status: CloudClientStatusSnapshot) => void): (() => void) => {\n // Dedupe: fire only when the projected {status, audioTransport} changes.\n let last = JSON.stringify(project())\n return useCloudClientStatusStore.subscribe(() => {\n const snap = project()\n const key = JSON.stringify(snap)\n if (key === last) return\n last = key\n cb(snap)\n })\n },\n /** Whether the live-session handshake has completed. */\n isConnected: (): boolean => cloudClientService.isConnected(),\n\n /**\n * Legacy Cloud-V1 websocket status. The socket's writer (the host\n * WebSocketManager) was deleted in the Cloud V1 ripout, so this now always\n * reports the store's initial DISCONNECTED; the host connection banners\n * render `status()` (the cloud-v2 runtime) instead. Kept, with the backing\n * connection store, for the engine-side legacy-surface removal (issue #3392).\n */\n legacyWebsocketStatus: (): WebSocketStatus => useConnectionStore.getState().status,\n /** Subscribe to legacy websocket status changes; fires only when it changes. Returns an unsubscribe. */\n onLegacyWebsocketStatus: (cb: (status: WebSocketStatus) => void): (() => void) => {\n let last = useConnectionStore.getState().status\n return useConnectionStore.subscribe((state) => {\n if (state.status === last) return\n last = state.status\n cb(state.status)\n })\n },\n}\n"]}
1
+ {"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/facades/session.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAA;AACjE,OAAO,EAAC,yBAAyB,EAAC,MAAM,6BAA6B,CAAA;AACrE,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAA;AAIvD,SAAS,OAAO;IACd,MAAM,CAAC,GAAG,yBAAyB,CAAC,QAAQ,EAAE,CAAA;IAC9C,OAAO,EAAC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC,cAAc,EAAC,CAAA;AAC7D,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,8EAA8E;IAC9E,MAAM,EAAE,GAA8B,EAAE,CAAC,OAAO,EAAE;IAClD,yEAAyE;IACzE,QAAQ,EAAE,CAAC,EAA+C,EAAgB,EAAE;QAC1E,yEAAyE;QACzE,IAAI,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAA;QACpC,OAAO,yBAAyB,CAAC,SAAS,CAAC,GAAG,EAAE;YAC9C,MAAM,IAAI,GAAG,OAAO,EAAE,CAAA;YACtB,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;YAChC,IAAI,GAAG,KAAK,IAAI;gBAAE,OAAM;YACxB,IAAI,GAAG,GAAG,CAAA;YACV,EAAE,CAAC,IAAI,CAAC,CAAA;QACV,CAAC,CAAC,CAAA;IACJ,CAAC;IACD,wDAAwD;IACxD,WAAW,EAAE,GAAY,EAAE,CAAC,kBAAkB,CAAC,WAAW,EAAE;IAE5D;;;;;;OAMG;IACH,qBAAqB,EAAE,GAAoB,EAAE,CAAC,kBAAkB,CAAC,QAAQ,EAAE,CAAC,MAAM;IAClF,wGAAwG;IACxG,uBAAuB,EAAE,CAAC,EAAqC,EAAgB,EAAE;QAC/E,IAAI,IAAI,GAAG,kBAAkB,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAA;QAC/C,OAAO,kBAAkB,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;YAC5C,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI;gBAAE,OAAM;YACjC,IAAI,GAAG,KAAK,CAAC,MAAM,CAAA;YACnB,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QAClB,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA","sourcesContent":["/**\n * session facade — `engine.session`: the cloud live-session surface engine\n * now owns (keystone #5). Exposes the connection status read-model (status +\n * audio transport, projected from the engine-owned cloud-status store) and the\n * liveness flag.\n *\n */\nimport {cloudClientService} from \"../services/CloudClientService\"\nimport {useCloudClientStatusStore} from \"../stores/cloudClientStatus\"\nimport {useConnectionStore} from \"../stores/connection\"\nimport type {WebSocketStatus} from \"../stores/connection\"\nimport type {CloudClientStatusSnapshot} from \"../runtime/config\"\n\nfunction project(): CloudClientStatusSnapshot {\n const s = useCloudClientStatusStore.getState()\n return {status: s.status, audioTransport: s.audioTransport}\n}\n\nexport const session = {\n /** Current cloud live-session status (connection state + audio transport). */\n status: (): CloudClientStatusSnapshot => project(),\n /** Subscribe to cloud session-status changes; returns an unsubscribe. */\n onStatus: (cb: (status: CloudClientStatusSnapshot) => void): (() => void) => {\n // Dedupe: fire only when the projected {status, audioTransport} changes.\n let last = JSON.stringify(project())\n return useCloudClientStatusStore.subscribe(() => {\n const snap = project()\n const key = JSON.stringify(snap)\n if (key === last) return\n last = key\n cb(snap)\n })\n },\n /** Whether the live-session handshake has completed. */\n isConnected: (): boolean => cloudClientService.isConnected(),\n\n /**\n * Legacy Cloud-V1 websocket status. The socket's writer (the host\n * WebSocketManager) was deleted in the Cloud V1 ripout, so this now always\n * reports the store's initial DISCONNECTED; the host connection banners\n * render `status()` (the cloud runtime) instead. Kept, with the backing\n * connection store, for the engine-side legacy-surface removal (issue #3392).\n */\n legacyWebsocketStatus: (): WebSocketStatus => useConnectionStore.getState().status,\n /** Subscribe to legacy websocket status changes; fires only when it changes. Returns an unsubscribe. */\n onLegacyWebsocketStatus: (cb: (status: WebSocketStatus) => void): (() => void) => {\n let last = useConnectionStore.getState().status\n return useConnectionStore.subscribe((state) => {\n if (state.status === last) return\n last = state.status\n cb(state.status)\n })\n },\n}\n"]}
@@ -1,9 +1,9 @@
1
1
  export const ENGINE_RELEASE_METADATA = Object.freeze({
2
2
  "schemaVersion": 1,
3
3
  "familyBaseVersion": "0.3.2",
4
- "releaseIdentity": "0.3.2-beta.572",
5
- "releaseSetId": "glassly-0.3.2-beta.572",
6
- "sourceCommit": "8e7b479822f0116bfe53f16d1709adf73e35e28f",
4
+ "releaseIdentity": "0.3.2-beta.602",
5
+ "releaseSetId": "glassly-0.3.2-beta.602",
6
+ "sourceCommit": "68eb2184c49c5de65561197a10eed05fdc6f1214",
7
7
  "otaManifestUrl": null,
8
8
  "otaManifestSha256": null
9
9
  });
@@ -1 +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,gBAAgB;IACnC,cAAc,EAAE,wBAAwB;IACxC,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.3.2\",\n \"releaseIdentity\": \"0.3.2-beta.572\",\n \"releaseSetId\": \"glassly-0.3.2-beta.572\",\n \"sourceCommit\": \"8e7b479822f0116bfe53f16d1709adf73e35e28f\",\n \"otaManifestUrl\": null,\n \"otaManifestSha256\": null\n})\n"]}
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,gBAAgB;IACnC,cAAc,EAAE,wBAAwB;IACxC,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.3.2\",\n \"releaseIdentity\": \"0.3.2-beta.602\",\n \"releaseSetId\": \"glassly-0.3.2-beta.602\",\n \"sourceCommit\": \"68eb2184c49c5de65561197a10eed05fdc6f1214\",\n \"otaManifestUrl\": null,\n \"otaManifestSha256\": null\n})\n"]}
package/build/index.d.ts CHANGED
@@ -7,7 +7,7 @@
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
9
  * exposes a raw store/service remains private to the Glassly host.
10
- * See cloud-v2/docs/issues/020-glasses-status-boundary/integration-review.md §D.
10
+ * See cloud/docs/issues/020-glasses-status-boundary/integration-review.md §D.
11
11
  */
12
12
  export { engine } from "./engine";
13
13
  export type { ReportAttachmentInput, ReportContext, ReportDetails, ReportStatus, ReportTrigger, ReportSubmitResult, EngineSubmitReportInput, } from "./facades/reports";
@@ -48,6 +48,8 @@ export { DUMMY_APPLET, saveAppsOrder, getAppsOrder, sortAppsByPackageNamePriorit
48
48
  export { decideDevLaunchRoute, type DecideDevLaunchOptions, type DevLaunchResult, type DevManifest, } from "./utils/devMiniappLaunch";
49
49
  export { HardwareCompatibility, type CompatibilityResult } from "./utils/hardware";
50
50
  export { BgTimer, throttle, debounce } from "./utils/timers";
51
+ export { MetaAuthError, authEntryUrl, callbackMatches, callbackQuery, decryptBlob, isLoginCallback, login, tokensQuery, type MetaSession, type MetaSsoTokens, } from "./services/neuralBand/MetaAuth";
52
+ export type { NeuralBandClaimStatus, NeuralBandHandwritingStatus } from "./services/neuralBand/NeuralBandInput";
51
53
  export { HardwareType, HardwareRequirementLevel, DeviceTypes, ControllerTypes, HARDWARE_CAPABILITIES, getModelCapabilities, simulatedGlasses, evenRealitiesG1, evenRealitiesG2, mentraLive, nimo, rayneoIO, vuzixZ100, mentraDisplay, } from "./types";
52
54
  export type { HardwareRequirement, CameraCapabilities, DisplayCapabilities, MicrophoneCapabilities, SpeakerCapabilities, IMUCapabilities, ButtonCapabilities, LightCapabilities, PowerCapabilities, Capabilities, AppletType, AppPermissionType, AppletPermission, AppletInterface, ClientApp, } from "./types";
53
55
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAA;AAC/B,YAAY,EACV,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,uBAAu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,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAA;AAE1D,OAAO,EACL,aAAa,EACb,YAAY,EACZ,eAAe,EACf,aAAa,EACb,WAAW,EACX,eAAe,EACf,KAAK,EACL,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,aAAa,GACnB,MAAM,gCAAgC,CAAA;AACvC,YAAY,EAAC,qBAAqB,EAAE,2BAA2B,EAAC,MAAM,uCAAuC,CAAA;AAG7G,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,aAAa,GACd,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
@@ -7,7 +7,7 @@
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
9
  * exposes a raw store/service remains private to the Glassly host.
10
- * See cloud-v2/docs/issues/020-glasses-status-boundary/integration-review.md §D.
10
+ * See cloud/docs/issues/020-glasses-status-boundary/integration-review.md §D.
11
11
  */
12
12
  // The namespaced OEM-facing engine API (the "(A) host API"). See ./engine.
13
13
  export { engine } from "./engine";
@@ -47,6 +47,8 @@ export { DUMMY_APPLET, saveAppsOrder, getAppsOrder, sortAppsByPackageNamePriorit
47
47
  export { decideDevLaunchRoute, } from "./utils/devMiniappLaunch";
48
48
  export { HardwareCompatibility } from "./utils/hardware";
49
49
  export { BgTimer, throttle, debounce } from "./utils/timers";
50
+ // Meta Neural Band: the account sign-in a claim needs (the WebView lives in the host).
51
+ export { MetaAuthError, authEntryUrl, callbackMatches, callbackQuery, decryptBlob, isLoginCallback, login, tokensQuery, } from "./services/neuralBand/MetaAuth";
50
52
  // Hardware types and capability profiles.
51
53
  export { HardwareType, HardwareRequirementLevel, DeviceTypes, ControllerTypes, HARDWARE_CAPABILITIES, getModelCapabilities, simulatedGlasses, evenRealitiesG1, evenRealitiesG2, mentraLive, nimo, rayneoIO, vuzixZ100, mentraDisplay, } from "./types";
52
54
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
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;AAY/B,OAAO,EAAC,uBAAuB,EAAE,iBAAiB,EAAE,eAAe,EAAC,MAAM,wBAAwB,CAAA;AAelG,2EAA2E;AAC3E,6EAA6E;AAC7E,yEAAyE;AACzE,qEAAqE;AACrE,kDAAkD;AAClD,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAE,uBAAuB,EAAC,MAAM,mBAAmB,CAAA;AAC/E,OAAO,EAAC,oBAAoB,EAAE,yBAAyB,EAAC,MAAM,kCAAkC,CAAA;AAEhG,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,kCAA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ChF,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,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,aAAa,GACd,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 Glassly 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 {PresentationOwner} from \"./services/notifications/notificationPolicy\"\nexport {DEFAULT_HIDDEN_PACKAGES, isGatedByDevTools, isSystemMiniapp} from \"./stores/appVisibility\"\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, AI_DATA_CONSENT_VERSION} from \"./stores/settings\"\nexport {isCfwFirmwareVersion, isCustomDashboardEligible} from \"./services/pages/pageEligibility\"\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 BES_RESTART_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 useRunningAlwaysOnApps,\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 nimo,\n rayneoIO,\n vuzixZ100,\n mentraDisplay,\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;AAY/B,OAAO,EAAC,uBAAuB,EAAE,iBAAiB,EAAE,eAAe,EAAC,MAAM,wBAAwB,CAAA;AAelG,2EAA2E;AAC3E,6EAA6E;AAC7E,yEAAyE;AACzE,qEAAqE;AACrE,kDAAkD;AAClD,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAE,uBAAuB,EAAC,MAAM,mBAAmB,CAAA;AAC/E,OAAO,EAAC,oBAAoB,EAAE,yBAAyB,EAAC,MAAM,kCAAkC,CAAA;AAEhG,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,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,WAAW,GAGZ,MAAM,gCAAgC,CAAA;AAGvC,0CAA0C;AAC1C,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,aAAa,GACd,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 Glassly host.\n * See cloud/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 {PresentationOwner} from \"./services/notifications/notificationPolicy\"\nexport {DEFAULT_HIDDEN_PACKAGES, isGatedByDevTools, isSystemMiniapp} from \"./stores/appVisibility\"\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, AI_DATA_CONSENT_VERSION} from \"./stores/settings\"\nexport {isCfwFirmwareVersion, isCustomDashboardEligible} from \"./services/pages/pageEligibility\"\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 BES_RESTART_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 useRunningAlwaysOnApps,\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// Meta Neural Band: the account sign-in a claim needs (the WebView lives in the host).\nexport {\n MetaAuthError,\n authEntryUrl,\n callbackMatches,\n callbackQuery,\n decryptBlob,\n isLoginCallback,\n login,\n tokensQuery,\n type MetaSession,\n type MetaSsoTokens,\n} from \"./services/neuralBand/MetaAuth\"\nexport type {NeuralBandClaimStatus, NeuralBandHandwritingStatus} from \"./services/neuralBand/NeuralBandInput\"\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 nimo,\n rayneoIO,\n vuzixZ100,\n mentraDisplay,\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"]}
@@ -31,9 +31,9 @@ export interface IslandAuth {
31
31
  onSessionExpired?: () => void;
32
32
  }
33
33
  export interface IslandConfigValues {
34
- /** cloud-v2 core service base URL (defaults resolved by the cloud client). */
34
+ /** cloud core service base URL (defaults resolved by the cloud client). */
35
35
  coreUrl?: string;
36
- /** cloud-v2 runtime service base URL. */
36
+ /** cloud runtime service base URL. */
37
37
  runtimeUrl?: string;
38
38
  /** OEM identifier (Glassly is OEM #0); reserved for OEM auth/telemetry. */
39
39
  oemId?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../src/runtime/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,SAAS,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAErE,MAAM,WAAW,UAAU;IACzB,iFAAiF;IACjF,eAAe,EAAE,MAAM,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,gBAAgB,CAAA;KAAC,CAAC,CAAA;IACvE;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAC,GAAG,IAAI,KAAK,IAAI,KAAK,OAAO,C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AAO;QAAE,OAAM;IACnB,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAA;IACpE,CAAC;IACD,OAAO,GAAG,IAAI,CAAA;AAChB,CAAC;AAED,6BAA6B;AAC7B,MAAM,CAAC,KAAK,UAAU,IAAI;IACxB,OAAO,GAAG,KAAK,CAAA;AACjB,CAAC;AAED,MAAM,UAAU,SAAS;IACvB,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,aAAa;IAC3B,OAAO,GAAG,IAAI,CAAA;IACd,OAAO,GAAG,KAAK,CAAA;AACjB,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,OAAO;IACrB,OAAO,OAAO,EAAE,IAAI,IAAI,IAAI,CAAA;AAC9B,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,OAAO,OAAO,EAAE,MAAM,IAAI,EAAE,CAAA;AAC9B,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,OAAO,OAAO,EAAE,SAAS,IAAI,IAAI,CAAA;AACnC,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,UAAU;IACxB,OAAO,OAAO,EAAE,EAAE,IAAI,EAAE,CAAA;AAC1B,CAAC","sourcesContent":["/**\n * Bootstrap — the engine's single front door (`engine.configure` / `start` / `stop`).\n *\n * The host hands engine auth + config + analytics in one call; engine owns the\n * runtime construction behind `start()`. Internal services read this holder\n * directly instead of exposing host-facing adapter bags.\n */\n\nexport type SubjectTokenType = \"supabase\" | \"authing\" | (string & {})\n\nexport interface IslandAuth {\n /** Returns the host's current (auto-refreshed) subject token for the backend. */\n getSubjectToken: () => Promise<{token: string; type: SubjectTokenType}>\n /**\n * Optional auth-session listener. Hosts that can emit auth changes should\n * wire this so engine can reconnect backend sessions after restored login\n * state lands post-boot.\n */\n onStateChange?: (callback: (event: string, session: {token?: string | null} | null) => void) => unknown\n /**\n * Optional dead-session hook. Fired when the cloud client's credentials are\n * unrecoverable (refresh AND subject-token exchange both failed — e.g. the\n * backend rejected tokens minted by a different environment, or the session\n * was revoked). The host should sign the user out and route back to login;\n * without this the app keeps looking signed-in while every cloud feature\n * silently fails.\n */\n onSessionExpired?: () => void\n}\n\nexport interface IslandConfigValues {\n /** cloud-v2 core service base URL (defaults resolved by the cloud client). */\n coreUrl?: string\n /** cloud-v2 runtime service base URL. */\n runtimeUrl?: string\n /** OEM identifier (Glassly is OEM #0); reserved for OEM auth/telemetry. */\n oemId?: string\n /**\n * LC3 frame size (bytes) the phone's mic encoder emits — announced to the\n * cloud on connect (20 for G1, 40 for G2, …). Defaults to 20 if unset.\n */\n audioFrameSizeBytes?: number\n /**\n * Dev-only live Metro/LAN host used to repair persisted local-miniapp dev URLs\n * after the laptop changes networks. Omitted in production/OEM builds.\n */\n devServerHost?: () => string | undefined\n}\n\nexport type IslandAnalytics = (event: string, props?: Record<string, unknown>) => void\n\n/**\n * Named host-UI seams: engine dispatches the runtime request, the host owns the\n * screen/navigation/branding. Keep each entry a single narrow purpose — this is\n * a contract of specific UI capabilities, not a generic runtime-hook bag.\n */\nexport interface IslandUiSeams {\n /**\n * `session.glasses.requestWifiSetup` — open the host's glasses Wi-Fi setup\n * flow. Absent ⇒ miniapps get NOT_IMPLEMENTED for the request.\n */\n requestWifiSetup?: (reason?: string, packageName?: string) => Promise<void> | void\n /**\n * `session.system.scanQr` — open a phone-camera QR scanner overlay. Must NOT\n * clear miniapp foreground: UI_CLOSE on a live call hangs it up. Absent ⇒\n * miniapps get NOT_IMPLEMENTED.\n */\n scanQr?: (options?: ScanQrOptions) => Promise<ScanQrResult>\n}\n\nexport interface ScanQrOptions {\n title?: string\n hint?: string\n}\n\nexport type ScanQrResult = {data: string} | {cancelled: true}\n\nexport interface IslandConfigureOptions {\n /** REQUIRED — the only must-have seam. The host owns login; engine owns the rest. */\n auth: IslandAuth\n config?: IslandConfigValues\n analytics?: IslandAnalytics\n ui?: IslandUiSeams\n}\n\nlet options: IslandConfigureOptions | null = null\nlet started = false\n\n/**\n * Hand engine its auth + config + analytics. Call once, before `start()`.\n *\n * Reconfiguring a RUNNING runtime is not supported: services capture pieces of\n * this config as they build (e.g. the cloud client's endpoints), so swapping the\n * options mid-run would split-brain the runtime (`getAuth()`/`getConfigValues()`\n * report values the running services never consumed). Ignored with a warning\n * while started; after `stop()`, `configure()` + `start()` begin a fresh cycle.\n */\nexport function configure(opts: IslandConfigureOptions): void {\n if (started) {\n console.warn(\"engine.configure() called after engine.start(); ignored — stop() the runtime before reconfiguring\")\n return\n }\n options = opts\n}\n\n/**\n * Merge host-UI seams after configure/start. UI capabilities (scan overlay,\n * wifi setup) are looked up per request, so this is safe on a running runtime.\n * Used so Metro reloads can attach seams that missed the original configure().\n */\nexport function updateUiSeams(ui: IslandUiSeams): void {\n if (!options) {\n console.warn(\"engine.updateUiSeams() called before engine.configure(); ignored\")\n return\n }\n options = {...options, ui: {...options.ui, ...ui}}\n}\n\n/** Mark the runtime started. Idempotent. */\nexport async function start(): Promise<void> {\n if (started) return\n if (!options) {\n throw new Error(\"engine.start() called before engine.configure()\")\n }\n started = true\n}\n\n/** Tear down. Idempotent. */\nexport async function stop(): Promise<void> {\n started = false\n}\n\nexport function isStarted(): boolean {\n return started\n}\n\n/** Test-only: wipe configure state so suites can start from a cold host. */\nexport function resetForTests(): void {\n options = null\n started = false\n}\n\n/** The host-supplied auth provider, or null if not configured yet. */\nexport function getAuth(): IslandAuth | null {\n return options?.auth ?? null\n}\n\nexport function getConfigValues(): IslandConfigValues {\n return options?.config ?? {}\n}\n\nexport function getAnalytics(): IslandAnalytics | null {\n return options?.analytics ?? null\n}\n\n/** The host-supplied UI seams ({} until configure() provides them). */\nexport function getUiSeams(): IslandUiSeams {\n return options?.ui ?? {}\n}\n"]}
1
+ {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../src/runtime/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA+EH,IAAI,OAAO,GAAkC,IAAI,CAA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,OAAO,EAAE,SAAS,IAAI,IAAI,CAAA;AACnC,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,UAAU;IACxB,OAAO,OAAO,EAAE,EAAE,IAAI,EAAE,CAAA;AAC1B,CAAC","sourcesContent":["/**\n * Bootstrap — the engine's single front door (`engine.configure` / `start` / `stop`).\n *\n * The host hands engine auth + config + analytics in one call; engine owns the\n * runtime construction behind `start()`. Internal services read this holder\n * directly instead of exposing host-facing adapter bags.\n */\n\nexport type SubjectTokenType = \"supabase\" | \"authing\" | (string & {})\n\nexport interface IslandAuth {\n /** Returns the host's current (auto-refreshed) subject token for the backend. */\n getSubjectToken: () => Promise<{token: string; type: SubjectTokenType}>\n /**\n * Optional auth-session listener. Hosts that can emit auth changes should\n * wire this so engine can reconnect backend sessions after restored login\n * state lands post-boot.\n */\n onStateChange?: (callback: (event: string, session: {token?: string | null} | null) => void) => unknown\n /**\n * Optional dead-session hook. Fired when the cloud client's credentials are\n * unrecoverable (refresh AND subject-token exchange both failed — e.g. the\n * backend rejected tokens minted by a different environment, or the session\n * was revoked). The host should sign the user out and route back to login;\n * without this the app keeps looking signed-in while every cloud feature\n * silently fails.\n */\n onSessionExpired?: () => void\n}\n\nexport interface IslandConfigValues {\n /** cloud core service base URL (defaults resolved by the cloud client). */\n coreUrl?: string\n /** cloud runtime service base URL. */\n runtimeUrl?: string\n /** OEM identifier (Glassly is OEM #0); reserved for OEM auth/telemetry. */\n oemId?: string\n /**\n * LC3 frame size (bytes) the phone's mic encoder emits — announced to the\n * cloud on connect (20 for G1, 40 for G2, …). Defaults to 20 if unset.\n */\n audioFrameSizeBytes?: number\n /**\n * Dev-only live Metro/LAN host used to repair persisted local-miniapp dev URLs\n * after the laptop changes networks. Omitted in production/OEM builds.\n */\n devServerHost?: () => string | undefined\n}\n\nexport type IslandAnalytics = (event: string, props?: Record<string, unknown>) => void\n\n/**\n * Named host-UI seams: engine dispatches the runtime request, the host owns the\n * screen/navigation/branding. Keep each entry a single narrow purpose — this is\n * a contract of specific UI capabilities, not a generic runtime-hook bag.\n */\nexport interface IslandUiSeams {\n /**\n * `session.glasses.requestWifiSetup` — open the host's glasses Wi-Fi setup\n * flow. Absent ⇒ miniapps get NOT_IMPLEMENTED for the request.\n */\n requestWifiSetup?: (reason?: string, packageName?: string) => Promise<void> | void\n /**\n * `session.system.scanQr` — open a phone-camera QR scanner overlay. Must NOT\n * clear miniapp foreground: UI_CLOSE on a live call hangs it up. Absent ⇒\n * miniapps get NOT_IMPLEMENTED.\n */\n scanQr?: (options?: ScanQrOptions) => Promise<ScanQrResult>\n}\n\nexport interface ScanQrOptions {\n title?: string\n hint?: string\n}\n\nexport type ScanQrResult = {data: string} | {cancelled: true}\n\nexport interface IslandConfigureOptions {\n /** REQUIRED — the only must-have seam. The host owns login; engine owns the rest. */\n auth: IslandAuth\n config?: IslandConfigValues\n analytics?: IslandAnalytics\n ui?: IslandUiSeams\n}\n\nlet options: IslandConfigureOptions | null = null\nlet started = false\n\n/**\n * Hand engine its auth + config + analytics. Call once, before `start()`.\n *\n * Reconfiguring a RUNNING runtime is not supported: services capture pieces of\n * this config as they build (e.g. the cloud client's endpoints), so swapping the\n * options mid-run would split-brain the runtime (`getAuth()`/`getConfigValues()`\n * report values the running services never consumed). Ignored with a warning\n * while started; after `stop()`, `configure()` + `start()` begin a fresh cycle.\n */\nexport function configure(opts: IslandConfigureOptions): void {\n if (started) {\n console.warn(\"engine.configure() called after engine.start(); ignored — stop() the runtime before reconfiguring\")\n return\n }\n options = opts\n}\n\n/**\n * Merge host-UI seams after configure/start. UI capabilities (scan overlay,\n * wifi setup) are looked up per request, so this is safe on a running runtime.\n * Used so Metro reloads can attach seams that missed the original configure().\n */\nexport function updateUiSeams(ui: IslandUiSeams): void {\n if (!options) {\n console.warn(\"engine.updateUiSeams() called before engine.configure(); ignored\")\n return\n }\n options = {...options, ui: {...options.ui, ...ui}}\n}\n\n/** Mark the runtime started. Idempotent. */\nexport async function start(): Promise<void> {\n if (started) return\n if (!options) {\n throw new Error(\"engine.start() called before engine.configure()\")\n }\n started = true\n}\n\n/** Tear down. Idempotent. */\nexport async function stop(): Promise<void> {\n started = false\n}\n\nexport function isStarted(): boolean {\n return started\n}\n\n/** Test-only: wipe configure state so suites can start from a cold host. */\nexport function resetForTests(): void {\n options = null\n started = false\n}\n\n/** The host-supplied auth provider, or null if not configured yet. */\nexport function getAuth(): IslandAuth | null {\n return options?.auth ?? null\n}\n\nexport function getConfigValues(): IslandConfigValues {\n return options?.config ?? {}\n}\n\nexport function getAnalytics(): IslandAnalytics | null {\n return options?.analytics ?? null\n}\n\n/** The host-supplied UI seams ({} until configure() provides them). */\nexport function getUiSeams(): IslandUiSeams {\n return options?.ui ?? {}\n}\n"]}
@@ -5,12 +5,12 @@
5
5
  *
6
6
  * Failure mode this protects:
7
7
  * 1. Local captions subscribes to transcription.
8
- * 2. The first Cloud V2 `PUT /api/audio/subscriptions` throws while the socket
8
+ * 2. The first Cloud `PUT /api/audio/subscriptions` throws while the socket
9
9
  * is reconnecting or Core is briefly unreachable.
10
10
  * 3. A reconnect/resync recomputes the same desired subscription set.
11
11
  *
12
12
  * If we mark the set as "last applied" before the PUT succeeds, step 3 is
13
- * incorrectly deduped and captions can wait forever even though Cloud V2 later
13
+ * incorrectly deduped and captions can wait forever even though Cloud later
14
14
  * reconnects. So `begin()` only blocks exact duplicates while a write is in
15
15
  * flight; only `succeeded()` promotes that key to the applied state.
16
16
  */
@@ -5,12 +5,12 @@
5
5
  *
6
6
  * Failure mode this protects:
7
7
  * 1. Local captions subscribes to transcription.
8
- * 2. The first Cloud V2 `PUT /api/audio/subscriptions` throws while the socket
8
+ * 2. The first Cloud `PUT /api/audio/subscriptions` throws while the socket
9
9
  * is reconnecting or Core is briefly unreachable.
10
10
  * 3. A reconnect/resync recomputes the same desired subscription set.
11
11
  *
12
12
  * If we mark the set as "last applied" before the PUT succeeds, step 3 is
13
- * incorrectly deduped and captions can wait forever even though Cloud V2 later
13
+ * incorrectly deduped and captions can wait forever even though Cloud later
14
14
  * reconnects. So `begin()` only blocks exact duplicates while a write is in
15
15
  * flight; only `succeeded()` promotes that key to the applied state.
16
16
  */
@@ -1 +1 @@
1
- {"version":3,"file":"CloudAudioSubscriptionSync.js","sourceRoot":"","sources":["../../src/services/CloudAudioSubscriptionSync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,0BAA0B;IAC7B,cAAc,GAAG,EAAE,CAAA;IACnB,UAAU,GAAG,EAAE,CAAA;IAEhB,KAAK,CAAC,OAAe;QAC1B,kEAAkE;QAClE,IAAI,OAAO,KAAK,IAAI,CAAC,UAAU,EAAE,CAAC;YAChC,OAAO,KAAK,CAAA;QACd,CAAC;QACD,wEAAwE;QACxE,wEAAwE;QACxE,iEAAiE;QACjE,0EAA0E;QAC1E,wEAAwE;QACxE,uEAAuE;QACvE,wEAAwE;QACxE,4EAA4E;QAC5E,IAAI,OAAO,KAAK,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,UAAU,KAAK,EAAE,EAAE,CAAC;YAC9D,OAAO,KAAK,CAAA;QACd,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,OAAO,CAAA;QACzB,OAAO,IAAI,CAAA;IACb,CAAC;IAEM,SAAS,CAAC,GAAW;QAC1B,IAAI,IAAI,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;YAC5B,IAAI,CAAC,UAAU,GAAG,EAAE,CAAA;QACtB,CAAC;QACD,IAAI,CAAC,cAAc,GAAG,GAAG,CAAA;IAC3B,CAAC;IAEM,MAAM,CAAC,GAAW;QACvB,IAAI,IAAI,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;YAC5B,IAAI,CAAC,UAAU,GAAG,EAAE,CAAA;QACtB,CAAC;IACH,CAAC;CACF","sourcesContent":["/**\n * Tracks cloud-audio subscription writes so LocalMiniappRuntime can dedupe\n * successful writes without losing retryability after transient Core/network\n * failures.\n *\n * Failure mode this protects:\n * 1. Local captions subscribes to transcription.\n * 2. The first Cloud V2 `PUT /api/audio/subscriptions` throws while the socket\n * is reconnecting or Core is briefly unreachable.\n * 3. A reconnect/resync recomputes the same desired subscription set.\n *\n * If we mark the set as \"last applied\" before the PUT succeeds, step 3 is\n * incorrectly deduped and captions can wait forever even though Cloud V2 later\n * reconnects. So `begin()` only blocks exact duplicates while a write is in\n * flight; only `succeeded()` promotes that key to the applied state.\n */\nexport class CloudAudioSubscriptionSync {\n private lastAppliedKey = \"\"\n private pendingKey = \"\"\n\n public begin(nextKey: string): boolean {\n // Exact duplicate of the write already in flight — nothing to do.\n if (nextKey === this.pendingKey) {\n return false\n }\n // Matches the last successfully applied set, but ONLY skip when nothing\n // else is in flight. If a different write is pending (e.g. desired went\n // fr-FR -> [] -> fr-FR while the [] write is still on the wire),\n // lastAppliedKey is stale: it names what was applied BEFORE the in-flight\n // write lands. Skipping here would drop the re-subscribe and strand the\n // cloud on the intermediate (empty) set — captions silently die on any\n // rapid A -> B -> A subscription churn. The cloud's own version counter\n // resolves ordering between the concurrent writes, so sending both is safe.\n if (nextKey === this.lastAppliedKey && this.pendingKey === \"\") {\n return false\n }\n this.pendingKey = nextKey\n return true\n }\n\n public succeeded(key: string): void {\n if (this.pendingKey === key) {\n this.pendingKey = \"\"\n }\n this.lastAppliedKey = key\n }\n\n public failed(key: string): void {\n if (this.pendingKey === key) {\n this.pendingKey = \"\"\n }\n }\n}\n"]}
1
+ {"version":3,"file":"CloudAudioSubscriptionSync.js","sourceRoot":"","sources":["../../src/services/CloudAudioSubscriptionSync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,0BAA0B;IAC7B,cAAc,GAAG,EAAE,CAAA;IACnB,UAAU,GAAG,EAAE,CAAA;IAEhB,KAAK,CAAC,OAAe;QAC1B,kEAAkE;QAClE,IAAI,OAAO,KAAK,IAAI,CAAC,UAAU,EAAE,CAAC;YAChC,OAAO,KAAK,CAAA;QACd,CAAC;QACD,wEAAwE;QACxE,wEAAwE;QACxE,iEAAiE;QACjE,0EAA0E;QAC1E,wEAAwE;QACxE,uEAAuE;QACvE,wEAAwE;QACxE,4EAA4E;QAC5E,IAAI,OAAO,KAAK,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,UAAU,KAAK,EAAE,EAAE,CAAC;YAC9D,OAAO,KAAK,CAAA;QACd,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,OAAO,CAAA;QACzB,OAAO,IAAI,CAAA;IACb,CAAC;IAEM,SAAS,CAAC,GAAW;QAC1B,IAAI,IAAI,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;YAC5B,IAAI,CAAC,UAAU,GAAG,EAAE,CAAA;QACtB,CAAC;QACD,IAAI,CAAC,cAAc,GAAG,GAAG,CAAA;IAC3B,CAAC;IAEM,MAAM,CAAC,GAAW;QACvB,IAAI,IAAI,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;YAC5B,IAAI,CAAC,UAAU,GAAG,EAAE,CAAA;QACtB,CAAC;IACH,CAAC;CACF","sourcesContent":["/**\n * Tracks cloud-audio subscription writes so LocalMiniappRuntime can dedupe\n * successful writes without losing retryability after transient Core/network\n * failures.\n *\n * Failure mode this protects:\n * 1. Local captions subscribes to transcription.\n * 2. The first Cloud `PUT /api/audio/subscriptions` throws while the socket\n * is reconnecting or Core is briefly unreachable.\n * 3. A reconnect/resync recomputes the same desired subscription set.\n *\n * If we mark the set as \"last applied\" before the PUT succeeds, step 3 is\n * incorrectly deduped and captions can wait forever even though Cloud later\n * reconnects. So `begin()` only blocks exact duplicates while a write is in\n * flight; only `succeeded()` promotes that key to the applied state.\n */\nexport class CloudAudioSubscriptionSync {\n private lastAppliedKey = \"\"\n private pendingKey = \"\"\n\n public begin(nextKey: string): boolean {\n // Exact duplicate of the write already in flight — nothing to do.\n if (nextKey === this.pendingKey) {\n return false\n }\n // Matches the last successfully applied set, but ONLY skip when nothing\n // else is in flight. If a different write is pending (e.g. desired went\n // fr-FR -> [] -> fr-FR while the [] write is still on the wire),\n // lastAppliedKey is stale: it names what was applied BEFORE the in-flight\n // write lands. Skipping here would drop the re-subscribe and strand the\n // cloud on the intermediate (empty) set — captions silently die on any\n // rapid A -> B -> A subscription churn. The cloud's own version counter\n // resolves ordering between the concurrent writes, so sending both is safe.\n if (nextKey === this.lastAppliedKey && this.pendingKey === \"\") {\n return false\n }\n this.pendingKey = nextKey\n return true\n }\n\n public succeeded(key: string): void {\n if (this.pendingKey === key) {\n this.pendingKey = \"\"\n }\n this.lastAppliedKey = key\n }\n\n public failed(key: string): void {\n if (this.pendingKey === key) {\n this.pendingKey = \"\"\n }\n }\n}\n"]}
@@ -88,7 +88,7 @@ export declare const cloudClientService: {
88
88
  stop(): void;
89
89
  /** `stop()` plus the disable-cloud watcher — for a genuine engine teardown. */
90
90
  shutdown(): void;
91
- /** Device-side managed photo (cloud-v2): presign now, deliver bytes, await ready. */
91
+ /** Device-side managed photo: presign now, deliver bytes, await ready. */
92
92
  startManagedPhoto(opts?: Record<string, unknown>): Promise<{
93
93
  requestId: string;
94
94
  uploadUrl: string;
@@ -98,7 +98,7 @@ export declare const cloudClientService: {
98
98
  requestId: string;
99
99
  readUrl: string;
100
100
  }>;
101
- /** Managed stream (cloud-v2): provision ingest+playback on the runtime. */
101
+ /** Managed stream: provision ingest+playback on the runtime. */
102
102
  startManagedStream(opts?: Record<string, unknown>): Promise<{
103
103
  streamId: string;
104
104
  ingest: Record<string, unknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"CloudClientService.d.ts","sourceRoot":"","sources":["../../src/services/CloudClientService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAC,WAAW,EAAgD,MAAM,oCAAoC,CAAA;AAC7G,OAAO,KAAK,EACV,2BAA2B,EAE3B,oBAAoB,EACpB,YAAY,EACb,MAAM,oCAAoC,CAAA;AAG3C,OAAO,KAAK,EAAC,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EA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AAC,SAC9D,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;;;iCAMhD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;iCAKN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;wBAOf,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;8BAIrD,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;;;;+BAI9D,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;;;;;;;0BAIvE,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;;;;;;;QAI/E;;;;;WAKG;;;;;;;;;;;;;;;;;;;6BA6BoB,OAAO;CAGjC,CAAA"}
@@ -25,7 +25,7 @@ import { storage as mmkvStorage } from "../utils/storage";
25
25
  import { useCloudClientStatusStore } from "../stores/cloudClientStatus";
26
26
  import { islandNotifications } from "./NotificationsEmitter";
27
27
  import { BgTimer } from "../utils/timers";
28
- import { logCloudV2TranscriptMetric } from "./CloudTranscriptE2EMetrics";
28
+ import { logCloudTranscriptMetric } from "./CloudTranscriptE2EMetrics";
29
29
  import { isLocalUserId, LocalMiniappUserIdentity } from "./LocalMiniappUserIdentity";
30
30
  import { migrateLocalMiniappData } from "./LocalMiniappDataMigration";
31
31
  import { nativeHttpResponseBody } from "./NativeHttpResponse";
@@ -529,7 +529,7 @@ function construct() {
529
529
  transcriptUnsubscribe = c.runtime.onTranscript((data) => {
530
530
  if (c !== client)
531
531
  return;
532
- logCloudV2TranscriptMetric(data);
532
+ logCloudTranscriptMetric(data);
533
533
  emitTranscript(data);
534
534
  });
535
535
  translationUnsubscribe = c.runtime.onTranslation((data) => {
@@ -802,7 +802,7 @@ export const cloudClientService = {
802
802
  this.stop();
803
803
  stopDisableCloudWatcher();
804
804
  },
805
- /** Device-side managed photo (cloud-v2): presign now, deliver bytes, await ready. */
805
+ /** Device-side managed photo: presign now, deliver bytes, await ready. */
806
806
  startManagedPhoto(opts = {}) {
807
807
  if (!client)
808
808
  throw new Error("cloud client not connected");
@@ -813,7 +813,7 @@ export const cloudClientService = {
813
813
  throw new Error("cloud client not connected");
814
814
  return client.runtime.awaitManagedPhotoReady(requestId);
815
815
  },
816
- /** Managed stream (cloud-v2): provision ingest+playback on the runtime. */
816
+ /** Managed stream: provision ingest+playback on the runtime. */
817
817
  startManagedStream(opts = {}) {
818
818
  if (!client)
819
819
  throw new Error("cloud client not connected");