@glassly/engine 0.1.0-dev.99 → 0.2.8-dev.445
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -0
- package/build/engine.d.ts +32 -10
- package/build/engine.d.ts.map +1 -1
- package/build/engine.js +24 -16
- package/build/engine.js.map +1 -1
- package/build/facades/dev.d.ts +9 -0
- package/build/facades/dev.d.ts.map +1 -1
- package/build/facades/dev.js +9 -0
- package/build/facades/dev.js.map +1 -1
- package/build/facades/display.d.ts +10 -3
- package/build/facades/display.d.ts.map +1 -1
- package/build/facades/display.js +22 -8
- package/build/facades/display.js.map +1 -1
- package/build/facades/displayMirror.d.ts +11 -0
- package/build/facades/displayMirror.d.ts.map +1 -1
- package/build/facades/displayMirror.js +22 -0
- package/build/facades/displayMirror.js.map +1 -1
- package/build/facades/glasses.d.ts +31 -1
- package/build/facades/glasses.d.ts.map +1 -1
- package/build/facades/glasses.js +51 -0
- package/build/facades/glasses.js.map +1 -1
- package/build/facades/memory.d.ts +0 -6
- package/build/facades/memory.d.ts.map +1 -1
- package/build/facades/memory.js +1 -9
- package/build/facades/memory.js.map +1 -1
- package/build/facades/miniapps.d.ts +3 -1
- package/build/facades/miniapps.d.ts.map +1 -1
- package/build/facades/miniapps.js +3 -1
- package/build/facades/miniapps.js.map +1 -1
- package/build/facades/pairing.d.ts.map +1 -1
- package/build/facades/pairing.js +5 -4
- package/build/facades/pairing.js.map +1 -1
- package/build/facades/permissions.d.ts +2 -0
- package/build/facades/permissions.d.ts.map +1 -1
- package/build/facades/permissions.js +48 -0
- package/build/facades/permissions.js.map +1 -1
- package/build/facades/phoneNotifications.d.ts +20 -9
- package/build/facades/phoneNotifications.d.ts.map +1 -1
- package/build/facades/phoneNotifications.js +33 -26
- package/build/facades/phoneNotifications.js.map +1 -1
- package/build/facades/settings.d.ts.map +1 -1
- package/build/facades/settings.js +1 -2
- package/build/facades/settings.js.map +1 -1
- package/build/generated/releaseMetadata.js +4 -4
- package/build/generated/releaseMetadata.js.map +1 -1
- package/build/index.d.ts +6 -4
- package/build/index.d.ts.map +1 -1
- package/build/index.js +5 -4
- package/build/index.js.map +1 -1
- package/build/react/MentraLiveOtaFlow.js +2 -2
- package/build/react/MentraLiveOtaFlow.js.map +1 -1
- package/build/react/useMentraLiveOta.d.ts.map +1 -1
- package/build/react/useMentraLiveOta.js +8 -7
- package/build/react/useMentraLiveOta.js.map +1 -1
- package/build/runtime/config.d.ts +1 -1
- package/build/runtime/config.d.ts.map +1 -1
- package/build/runtime/config.js.map +1 -1
- package/build/services/AppRegistry.d.ts +4 -1
- package/build/services/AppRegistry.d.ts.map +1 -1
- package/build/services/AppRegistry.js +21 -1
- package/build/services/AppRegistry.js.map +1 -1
- package/build/services/BlobStore.d.ts +2 -2
- package/build/services/BlobStore.js +3 -3
- package/build/services/BlobStore.js.map +1 -1
- package/build/services/CloudClientService.d.ts +7 -3
- package/build/services/CloudClientService.d.ts.map +1 -1
- package/build/services/CloudClientService.js +34 -9
- package/build/services/CloudClientService.js.map +1 -1
- package/build/services/DevServerBridge.d.ts +1 -18
- package/build/services/DevServerBridge.d.ts.map +1 -1
- package/build/services/DevServerBridge.js +9 -8
- package/build/services/DevServerBridge.js.map +1 -1
- package/build/services/DeviceEventRouter.d.ts.map +1 -1
- package/build/services/DeviceEventRouter.js +58 -71
- package/build/services/DeviceEventRouter.js.map +1 -1
- package/build/services/DisplayDiagnostics.d.ts +5 -0
- package/build/services/DisplayDiagnostics.d.ts.map +1 -0
- package/build/services/DisplayDiagnostics.js +105 -0
- package/build/services/DisplayDiagnostics.js.map +1 -0
- package/build/services/DisplayProcessor.d.ts +6 -7
- package/build/services/DisplayProcessor.d.ts.map +1 -1
- package/build/services/DisplayProcessor.js +17 -45
- package/build/services/DisplayProcessor.js.map +1 -1
- package/build/services/GestureDotsService.d.ts +10 -4
- package/build/services/GestureDotsService.d.ts.map +1 -1
- package/build/services/GestureDotsService.js +70 -16
- package/build/services/GestureDotsService.js.map +1 -1
- package/build/services/GlassesKeyboardInput.d.ts +77 -0
- package/build/services/GlassesKeyboardInput.d.ts.map +1 -0
- package/build/services/GlassesKeyboardInput.js +261 -0
- package/build/services/GlassesKeyboardInput.js.map +1 -0
- package/build/services/GlassesSensorService.d.ts +47 -0
- package/build/services/GlassesSensorService.d.ts.map +1 -0
- package/build/services/GlassesSensorService.js +242 -0
- package/build/services/GlassesSensorService.js.map +1 -0
- package/build/services/GlassesTouchInput.d.ts +14 -0
- package/build/services/GlassesTouchInput.d.ts.map +1 -0
- package/build/services/GlassesTouchInput.js +107 -0
- package/build/services/GlassesTouchInput.js.map +1 -0
- package/build/services/HeadingService.d.ts +0 -6
- package/build/services/HeadingService.d.ts.map +1 -1
- package/build/services/HeadingService.js +0 -27
- package/build/services/HeadingService.js.map +1 -1
- package/build/services/HotspotShutdown.d.ts.map +1 -1
- package/build/services/HotspotShutdown.js +2 -1
- package/build/services/HotspotShutdown.js.map +1 -1
- package/build/services/JSCrashloopReportService.js +2 -2
- package/build/services/JSCrashloopReportService.js.map +1 -1
- package/build/services/JSRouter.d.ts +6 -4
- package/build/services/JSRouter.d.ts.map +1 -1
- package/build/services/JSRouter.js +15 -13
- package/build/services/JSRouter.js.map +1 -1
- package/build/services/LocalDisplayManager.d.ts +35 -7
- package/build/services/LocalDisplayManager.d.ts.map +1 -1
- package/build/services/LocalDisplayManager.js +105 -27
- package/build/services/LocalDisplayManager.js.map +1 -1
- package/build/services/LocalMiniappDataMigration.d.ts +1 -1
- package/build/services/LocalMiniappDataMigration.js +1 -1
- package/build/services/LocalMiniappDataMigration.js.map +1 -1
- package/build/services/LocalMiniappRuntime.d.ts +64 -11
- package/build/services/LocalMiniappRuntime.d.ts.map +1 -1
- package/build/services/LocalMiniappRuntime.js +441 -35
- package/build/services/LocalMiniappRuntime.js.map +1 -1
- package/build/services/LocalSttFallbackCoordinator.d.ts +3 -0
- package/build/services/LocalSttFallbackCoordinator.d.ts.map +1 -1
- package/build/services/LocalSttFallbackCoordinator.js +27 -8
- package/build/services/LocalSttFallbackCoordinator.js.map +1 -1
- package/build/services/MemoryStore.d.ts +8 -33
- package/build/services/MemoryStore.d.ts.map +1 -1
- package/build/services/MemoryStore.js +30 -56
- package/build/services/MemoryStore.js.map +1 -1
- package/build/services/MiniappEngine.d.ts +3 -3
- package/build/services/MiniappEngine.js +7 -7
- package/build/services/MiniappEngine.js.map +1 -1
- package/build/services/MiniappLauncher.d.ts +8 -0
- package/build/services/MiniappLauncher.d.ts.map +1 -1
- package/build/services/MiniappLauncher.js +19 -1
- package/build/services/MiniappLauncher.js.map +1 -1
- package/build/services/MirrorService.d.ts +24 -0
- package/build/services/MirrorService.d.ts.map +1 -0
- package/build/services/MirrorService.js +132 -0
- package/build/services/MirrorService.js.map +1 -0
- package/build/services/NativeNavigationService.d.ts +2 -3
- package/build/services/NativeNavigationService.d.ts.map +1 -1
- package/build/services/NativeNavigationService.js +24 -21
- package/build/services/NativeNavigationService.js.map +1 -1
- package/build/services/NavigationHandlers.d.ts.map +1 -1
- package/build/services/NavigationHandlers.js +10 -5
- package/build/services/NavigationHandlers.js.map +1 -1
- package/build/services/OtaInstallCoordinator.d.ts.map +1 -1
- package/build/services/OtaInstallCoordinator.js +24 -23
- package/build/services/OtaInstallCoordinator.js.map +1 -1
- package/build/services/PairedGlassesLatch.d.ts +7 -0
- package/build/services/PairedGlassesLatch.d.ts.map +1 -0
- package/build/services/PairedGlassesLatch.js +38 -0
- package/build/services/PairedGlassesLatch.js.map +1 -0
- package/build/services/PhoneActivity.d.ts +23 -0
- package/build/services/PhoneActivity.d.ts.map +1 -0
- package/build/services/PhoneActivity.js +111 -0
- package/build/services/PhoneActivity.js.map +1 -0
- package/build/services/PhoneCameraFovCoordinator.d.ts.map +1 -1
- package/build/services/PhoneCameraFovCoordinator.js +4 -3
- package/build/services/PhoneCameraFovCoordinator.js.map +1 -1
- package/build/services/PhoneNotificationsSync.d.ts +40 -6
- package/build/services/PhoneNotificationsSync.d.ts.map +1 -1
- package/build/services/PhoneNotificationsSync.js +160 -84
- package/build/services/PhoneNotificationsSync.js.map +1 -1
- package/build/services/PhonePhotoCoordinator.d.ts.map +1 -1
- package/build/services/PhonePhotoCoordinator.js +6 -5
- package/build/services/PhonePhotoCoordinator.js.map +1 -1
- package/build/services/PhoneStreamCoordinator.d.ts.map +1 -1
- package/build/services/PhoneStreamCoordinator.js +8 -7
- package/build/services/PhoneStreamCoordinator.js.map +1 -1
- package/build/services/STTModelManager.d.ts +3 -0
- package/build/services/STTModelManager.d.ts.map +1 -1
- package/build/services/STTModelManager.js +15 -1
- package/build/services/STTModelManager.js.map +1 -1
- package/build/services/SceneRenderer.d.ts +43 -2
- package/build/services/SceneRenderer.d.ts.map +1 -1
- package/build/services/SceneRenderer.js +123 -8
- package/build/services/SceneRenderer.js.map +1 -1
- package/build/services/StreamLifecycleController.d.ts.map +1 -1
- package/build/services/StreamLifecycleController.js +6 -14
- package/build/services/StreamLifecycleController.js.map +1 -1
- package/build/services/TTSModelManager.js +1 -1
- package/build/services/TTSModelManager.js.map +1 -1
- package/build/services/UIRouter.d.ts +2 -2
- package/build/services/UIRouter.js +5 -5
- package/build/services/UIRouter.js.map +1 -1
- package/build/services/asg/galleryPathMigration.js +1 -1
- package/build/services/asg/galleryPathMigration.js.map +1 -1
- package/build/services/asg/gallerySyncService.js +2 -2
- package/build/services/asg/gallerySyncService.js.map +1 -1
- package/build/services/asg/localStorageService.d.ts.map +1 -1
- package/build/services/asg/localStorageService.js +3 -3
- package/build/services/asg/localStorageService.js.map +1 -1
- package/build/services/debug/DashboardOpenTrace.d.ts +32 -0
- package/build/services/debug/DashboardOpenTrace.d.ts.map +1 -0
- package/build/services/debug/DashboardOpenTrace.js +128 -0
- package/build/services/debug/DashboardOpenTrace.js.map +1 -0
- package/build/services/debug/dashboardOpenTimeline.d.ts +77 -0
- package/build/services/debug/dashboardOpenTimeline.d.ts.map +1 -0
- package/build/services/debug/dashboardOpenTimeline.js +195 -0
- package/build/services/debug/dashboardOpenTimeline.js.map +1 -0
- package/build/services/effectiveCapabilities.d.ts.map +1 -1
- package/build/services/effectiveCapabilities.js +25 -13
- package/build/services/effectiveCapabilities.js.map +1 -1
- package/build/services/gestureClaims.d.ts +34 -15
- package/build/services/gestureClaims.d.ts.map +1 -1
- package/build/services/gestureClaims.js +42 -21
- package/build/services/gestureClaims.js.map +1 -1
- package/build/services/manifestFields.d.ts +9 -0
- package/build/services/manifestFields.d.ts.map +1 -0
- package/build/services/manifestFields.js +26 -0
- package/build/services/manifestFields.js.map +1 -0
- package/build/services/memoryStoreInstance.d.ts +0 -10
- package/build/services/memoryStoreInstance.d.ts.map +1 -1
- package/build/services/memoryStoreInstance.js +2 -31
- package/build/services/memoryStoreInstance.js.map +1 -1
- package/build/services/mirrorSnapshot.d.ts +16 -0
- package/build/services/mirrorSnapshot.d.ts.map +1 -0
- package/build/services/mirrorSnapshot.js +102 -0
- package/build/services/mirrorSnapshot.js.map +1 -0
- package/build/services/nativeNavigationGate.d.ts +8 -0
- package/build/services/nativeNavigationGate.d.ts.map +1 -0
- package/build/services/nativeNavigationGate.js +12 -0
- package/build/services/nativeNavigationGate.js.map +1 -0
- package/build/services/notificationAppCatalog.d.ts +7 -0
- package/build/services/notificationAppCatalog.d.ts.map +1 -0
- package/build/services/notificationAppCatalog.js +16 -0
- package/build/services/notificationAppCatalog.js.map +1 -0
- package/build/services/notifications/notificationPolicy.d.ts +55 -0
- package/build/services/notifications/notificationPolicy.d.ts.map +1 -0
- package/build/services/notifications/notificationPolicy.js +41 -0
- package/build/services/notifications/notificationPolicy.js.map +1 -0
- package/build/services/pages/OverlayPages.d.ts +26 -0
- package/build/services/pages/OverlayPages.d.ts.map +1 -0
- package/build/services/pages/OverlayPages.js +80 -0
- package/build/services/pages/OverlayPages.js.map +1 -0
- package/build/services/pages/PageHost.d.ts +32 -0
- package/build/services/pages/PageHost.d.ts.map +1 -0
- package/build/services/pages/PageHost.js +99 -0
- package/build/services/pages/PageHost.js.map +1 -0
- package/build/services/pages/overlayApps.d.ts +25 -0
- package/build/services/pages/overlayApps.d.ts.map +1 -0
- package/build/services/pages/overlayApps.js +66 -0
- package/build/services/pages/overlayApps.js.map +1 -0
- package/build/services/pages/pageEligibility.d.ts +9 -0
- package/build/services/pages/pageEligibility.d.ts.map +1 -0
- package/build/services/pages/pageEligibility.js +27 -0
- package/build/services/pages/pageEligibility.js.map +1 -0
- package/build/services/settingsBridge.d.ts +58 -0
- package/build/services/settingsBridge.d.ts.map +1 -0
- package/build/services/settingsBridge.js +90 -0
- package/build/services/settingsBridge.js.map +1 -0
- package/build/services/speakerProfileStoreInstance.js +1 -1
- package/build/services/speakerProfileStoreInstance.js.map +1 -1
- package/build/services/uiShim.d.ts +1 -1
- package/build/services/uiShim.js +4 -4
- package/build/services/uiShim.js.map +1 -1
- package/build/stores/appVisibility.d.ts +28 -0
- package/build/stores/appVisibility.d.ts.map +1 -1
- package/build/stores/appVisibility.js +34 -0
- package/build/stores/appVisibility.js.map +1 -1
- package/build/stores/apps.d.ts +13 -0
- package/build/stores/apps.d.ts.map +1 -1
- package/build/stores/apps.js +66 -12
- package/build/stores/apps.js.map +1 -1
- package/build/stores/bluetoothSettingKeys.js +1 -1
- package/build/stores/bluetoothSettingKeys.js.map +1 -1
- package/build/stores/display.d.ts +3 -3
- package/build/stores/display.d.ts.map +1 -1
- package/build/stores/display.js +16 -4
- package/build/stores/display.js.map +1 -1
- package/build/stores/glasses.d.ts.map +1 -1
- package/build/stores/glasses.js +14 -1
- package/build/stores/glasses.js.map +1 -1
- package/build/stores/settings.d.ts +1 -0
- package/build/stores/settings.d.ts.map +1 -1
- package/build/stores/settings.js +170 -44
- package/build/stores/settings.js.map +1 -1
- package/build/types/applet.d.ts +14 -1
- package/build/types/applet.d.ts.map +1 -1
- package/build/types/applet.js.map +1 -1
- package/build/types/capabilities/even-realities-g2.d.ts.map +1 -1
- package/build/types/capabilities/even-realities-g2.js +5 -0
- package/build/types/capabilities/even-realities-g2.js.map +1 -1
- package/build/types/capabilities/simulated-glasses.d.ts +1 -1
- package/build/types/capabilities/simulated-glasses.d.ts.map +1 -1
- package/build/types/capabilities/simulated-glasses.js +7 -4
- package/build/types/capabilities/simulated-glasses.js.map +1 -1
- package/build/types/hardware.d.ts +20 -1
- package/build/types/hardware.d.ts.map +1 -1
- package/build/types/hardware.js +2 -0
- package/build/types/hardware.js.map +1 -1
- package/build/types/index.d.ts +1 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/index.js +1 -0
- package/build/types/index.js.map +1 -1
- package/build/utils/debouncedPatch.d.ts +3 -1
- package/build/utils/debouncedPatch.d.ts.map +1 -1
- package/build/utils/debouncedPatch.js +6 -3
- package/build/utils/debouncedPatch.js.map +1 -1
- package/build/utils/devMiniappLaunch.d.ts.map +1 -1
- package/build/utils/devMiniappLaunch.js +4 -3
- package/build/utils/devMiniappLaunch.js.map +1 -1
- package/build/utils/display/measurer/TextMeasurer.d.ts +2 -159
- package/build/utils/display/measurer/TextMeasurer.d.ts.map +1 -1
- package/build/utils/display/measurer/TextMeasurer.js +2 -272
- package/build/utils/display/measurer/TextMeasurer.js.map +1 -1
- package/build/utils/display/measurer/script-detection.d.ts +1 -52
- package/build/utils/display/measurer/script-detection.d.ts.map +1 -1
- package/build/utils/display/measurer/script-detection.js +2 -183
- package/build/utils/display/measurer/script-detection.js.map +1 -1
- package/build/utils/display/pixelArt.d.ts +3 -0
- package/build/utils/display/pixelArt.d.ts.map +1 -0
- package/build/utils/display/pixelArt.js +3 -0
- package/build/utils/display/pixelArt.js.map +1 -0
- package/build/utils/display/profiles/g1.d.ts +1 -32
- package/build/utils/display/profiles/g1.d.ts.map +1 -1
- package/build/utils/display/profiles/g1.js +2 -212
- package/build/utils/display/profiles/g1.js.map +1 -1
- package/build/utils/display/profiles/g2.d.ts +1 -12
- package/build/utils/display/profiles/g2.d.ts.map +1 -1
- package/build/utils/display/profiles/g2.js +2 -33
- package/build/utils/display/profiles/g2.js.map +1 -1
- package/build/utils/display/profiles/nex.d.ts +1 -9
- package/build/utils/display/profiles/nex.d.ts.map +1 -1
- package/build/utils/display/profiles/nex.js +2 -149
- package/build/utils/display/profiles/nex.js.map +1 -1
- package/build/utils/display/profiles/types.d.ts +1 -102
- package/build/utils/display/profiles/types.d.ts.map +1 -1
- package/build/utils/display/profiles/types.js.map +1 -1
- package/build/utils/display/profiles/z100.d.ts +1 -32
- package/build/utils/display/profiles/z100.d.ts.map +1 -1
- package/build/utils/display/profiles/z100.js +2 -181
- package/build/utils/display/profiles/z100.js.map +1 -1
- package/build/utils/display/scene/degrade.d.ts.map +1 -1
- package/build/utils/display/scene/degrade.js +4 -1
- package/build/utils/display/scene/degrade.js.map +1 -1
- package/build/utils/display/scene/differ.d.ts +13 -1
- package/build/utils/display/scene/differ.d.ts.map +1 -1
- package/build/utils/display/scene/differ.js +22 -0
- package/build/utils/display/scene/differ.js.map +1 -1
- package/build/utils/display/scene/index.d.ts +1 -1
- package/build/utils/display/scene/index.d.ts.map +1 -1
- package/build/utils/display/scene/index.js.map +1 -1
- package/build/utils/display/scene/process.d.ts.map +1 -1
- package/build/utils/display/scene/process.js +183 -11
- package/build/utils/display/scene/process.js.map +1 -1
- package/build/utils/display/scene/store.d.ts +1 -1
- package/build/utils/display/scene/store.d.ts.map +1 -1
- package/build/utils/display/scene/store.js +0 -0
- package/build/utils/display/scene/store.js.map +1 -1
- package/build/utils/display/scene/svgPath.d.ts +9 -0
- package/build/utils/display/scene/svgPath.d.ts.map +1 -0
- package/build/utils/display/scene/svgPath.js +167 -0
- package/build/utils/display/scene/svgPath.js.map +1 -0
- package/build/utils/display/scene/types.d.ts +2 -142
- package/build/utils/display/scene/types.d.ts.map +1 -1
- package/build/utils/display/scene/types.js +0 -0
- package/build/utils/display/scene/types.js.map +1 -1
- package/build/utils/display/wrapper/TextWrapper.d.ts +1 -101
- package/build/utils/display/wrapper/TextWrapper.d.ts.map +1 -1
- package/build/utils/display/wrapper/TextWrapper.js +2 -470
- package/build/utils/display/wrapper/TextWrapper.js.map +1 -1
- package/build/utils/display/wrapper/types.d.ts +2 -74
- package/build/utils/display/wrapper/types.d.ts.map +1 -1
- package/build/utils/display/wrapper/types.js +2 -10
- package/build/utils/display/wrapper/types.js.map +1 -1
- package/build/utils/hardware/hardware.js +1 -1
- package/build/utils/hardware/hardware.js.map +1 -1
- package/build/utils/timers/timers.d.ts.map +1 -1
- package/build/utils/timers/timers.js +26 -4
- package/build/utils/timers/timers.js.map +1 -1
- package/package.json +8 -8
- package/src/engine.ts +24 -15
- package/src/facades/dev.ts +10 -0
- package/src/facades/display.ts +21 -8
- package/src/facades/displayMirror.ts +29 -0
- package/src/facades/glasses.ts +61 -1
- package/src/facades/memory.ts +1 -12
- package/src/facades/miniapps.ts +4 -1
- package/src/facades/pairing.ts +8 -6
- package/src/facades/permissions.ts +46 -0
- package/src/facades/phoneNotifications.ts +45 -26
- package/src/facades/settings.ts +1 -2
- package/src/generated/releaseMetadata.ts +4 -4
- package/src/index.ts +6 -9
- package/src/react/MentraLiveOtaFlow.tsx +2 -2
- package/src/react/useMentraLiveOta.ts +14 -8
- package/src/runtime/config.ts +1 -1
- package/src/services/AppRegistry.ts +43 -7
- package/src/services/BlobStore.ts +3 -3
- package/src/services/CloudClientService.ts +37 -10
- package/src/services/DevServerBridge.ts +12 -10
- package/src/services/DeviceEventRouter.ts +73 -74
- package/src/services/DisplayDiagnostics.ts +107 -0
- package/src/services/DisplayProcessor.ts +20 -55
- package/src/services/GestureDotsService.ts +77 -16
- package/src/services/GlassesKeyboardInput.ts +306 -0
- package/src/services/GlassesSensorService.ts +233 -0
- package/src/services/GlassesTouchInput.ts +128 -0
- package/src/services/HeadingService.ts +0 -24
- package/src/services/HotspotShutdown.ts +3 -1
- package/src/services/JSCrashloopReportService.ts +2 -2
- package/src/services/JSRouter.ts +29 -14
- package/src/services/LocalDisplayManager.ts +112 -26
- package/src/services/LocalMiniappDataMigration.ts +1 -1
- package/src/services/LocalMiniappRuntime.ts +500 -43
- package/src/services/LocalSttFallbackCoordinator.ts +28 -7
- package/src/services/MemoryStore.ts +32 -80
- package/src/services/MiniappEngine.ts +7 -7
- package/src/services/MiniappLauncher.ts +25 -1
- package/src/services/MirrorService.ts +139 -0
- package/src/services/NativeNavigationService.ts +29 -25
- package/src/services/NavigationHandlers.ts +10 -5
- package/src/services/OtaInstallCoordinator.ts +36 -34
- package/src/services/PairedGlassesLatch.ts +39 -0
- package/src/services/PhoneActivity.ts +116 -0
- package/src/services/PhoneCameraFovCoordinator.ts +6 -4
- package/src/services/PhoneNotificationsSync.ts +185 -103
- package/src/services/PhonePhotoCoordinator.ts +9 -10
- package/src/services/PhoneStreamCoordinator.ts +13 -11
- package/src/services/STTModelManager.ts +15 -1
- package/src/services/SceneRenderer.ts +148 -10
- package/src/services/StreamLifecycleController.ts +9 -7
- package/src/services/TTSModelManager.ts +1 -1
- package/src/services/UIRouter.ts +5 -5
- package/src/services/asg/galleryPathMigration.ts +1 -1
- package/src/services/asg/gallerySyncService.ts +2 -2
- package/src/services/asg/localStorageService.ts +3 -3
- package/src/services/debug/DashboardOpenTrace.ts +153 -0
- package/src/services/debug/dashboardOpenTimeline.ts +237 -0
- package/src/services/effectiveCapabilities.ts +32 -13
- package/src/services/gestureClaims.ts +72 -23
- package/src/services/manifestFields.ts +23 -0
- package/src/services/memoryStoreInstance.ts +2 -34
- package/src/services/mirrorSnapshot.ts +116 -0
- package/src/services/nativeNavigationGate.ts +14 -0
- package/src/services/notificationAppCatalog.ts +21 -0
- package/src/services/notifications/notificationPolicy.ts +87 -0
- package/src/services/pages/OverlayPages.ts +86 -0
- package/src/services/pages/PageHost.ts +116 -0
- package/src/services/pages/overlayApps.ts +72 -0
- package/src/services/pages/pageEligibility.ts +30 -0
- package/src/services/settingsBridge.ts +111 -0
- package/src/services/speakerProfileStoreInstance.ts +1 -1
- package/src/services/uiShim.ts +4 -4
- package/src/stores/appVisibility.ts +45 -0
- package/src/stores/apps.ts +110 -32
- package/src/stores/bluetoothSettingKeys.ts +1 -1
- package/src/stores/display.ts +18 -7
- package/src/stores/glasses.ts +15 -1
- package/src/stores/settings.ts +175 -51
- package/src/types/applet.ts +14 -1
- package/src/types/capabilities/even-realities-g2.ts +6 -0
- package/src/types/capabilities/simulated-glasses.ts +8 -4
- package/src/types/hardware.ts +34 -1
- package/src/types/index.ts +1 -0
- package/src/utils/debouncedPatch.ts +8 -4
- package/src/utils/devMiniappLaunch.ts +5 -3
- package/src/utils/display/measurer/TextMeasurer.ts +3 -346
- package/src/utils/display/measurer/script-detection.ts +10 -218
- package/src/utils/display/pixelArt.ts +3 -0
- package/src/utils/display/profiles/g1.ts +2 -236
- package/src/utils/display/profiles/g2.ts +2 -39
- package/src/utils/display/profiles/nex.ts +2 -166
- package/src/utils/display/profiles/types.ts +9 -132
- package/src/utils/display/profiles/z100.ts +2 -198
- package/src/utils/display/scene/degrade.ts +4 -1
- package/src/utils/display/scene/differ.ts +25 -1
- package/src/utils/display/scene/index.ts +5 -0
- package/src/utils/display/scene/process.ts +196 -13
- package/src/utils/display/scene/store.ts +0 -0
- package/src/utils/display/scene/svgPath.ts +163 -0
- package/src/utils/display/scene/types.ts +0 -0
- package/src/utils/display/wrapper/TextWrapper.ts +2 -546
- package/src/utils/display/wrapper/types.ts +3 -102
- package/src/utils/hardware/hardware.ts +1 -1
- package/src/utils/timers/timers.ts +32 -4
- package/build/services/CustomDashboardModel.d.ts +0 -48
- package/build/services/CustomDashboardModel.d.ts.map +0 -1
- package/build/services/CustomDashboardModel.js +0 -73
- package/build/services/CustomDashboardModel.js.map +0 -1
- package/build/services/CustomDashboardService.d.ts +0 -63
- package/build/services/CustomDashboardService.d.ts.map +0 -1
- package/build/services/CustomDashboardService.js +0 -576
- package/build/services/CustomDashboardService.js.map +0 -1
- package/build/services/DashboardCoordinator.d.ts +0 -26
- package/build/services/DashboardCoordinator.d.ts.map +0 -1
- package/build/services/DashboardCoordinator.js +0 -125
- package/build/services/DashboardCoordinator.js.map +0 -1
- package/build/services/iosNotificationAppCatalog.d.ts +0 -13
- package/build/services/iosNotificationAppCatalog.d.ts.map +0 -1
- package/build/services/iosNotificationAppCatalog.js +0 -28
- package/build/services/iosNotificationAppCatalog.js.map +0 -1
- package/src/services/CustomDashboardModel.ts +0 -83
- package/src/services/CustomDashboardService.ts +0 -598
- package/src/services/DashboardCoordinator.ts +0 -121
- package/src/services/iosNotificationAppCatalog.ts +0 -39
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* │ │
|
|
17
17
|
* ▼ ▼
|
|
18
18
|
* ──── UIRouter.routeFromWebView ──── UIRouter.routeFromBackground
|
|
19
|
-
* ──► Crust.jsDispatchToJs ──► webView.injectJavaScript("window.
|
|
19
|
+
* ──► Crust.jsDispatchToJs ──► webView.injectJavaScript("window.__host.recv(...)")
|
|
20
20
|
* {kind:"bridge", raw: JSON({
|
|
21
21
|
* payload:{
|
|
22
22
|
* type:"EVENT", streamType:"_ui",
|
|
@@ -59,7 +59,7 @@ export declare class UIRouter {
|
|
|
59
59
|
/**
|
|
60
60
|
* Called when a UI WebView mounts. `injectFn` wraps
|
|
61
61
|
* `webView.injectJavaScript` — the router calls it with prebuilt
|
|
62
|
-
* `window.
|
|
62
|
+
* `window.__host.recv(...)` strings to deliver background-side
|
|
63
63
|
* frames into the WebView's glassly global.
|
|
64
64
|
*
|
|
65
65
|
* The router also pushes a UI_OPEN envelope to the background side
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* │ │
|
|
17
17
|
* ▼ ▼
|
|
18
18
|
* ──── UIRouter.routeFromWebView ──── UIRouter.routeFromBackground
|
|
19
|
-
* ──► Crust.jsDispatchToJs ──► webView.injectJavaScript("window.
|
|
19
|
+
* ──► Crust.jsDispatchToJs ──► webView.injectJavaScript("window.__host.recv(...)")
|
|
20
20
|
* {kind:"bridge", raw: JSON({
|
|
21
21
|
* payload:{
|
|
22
22
|
* type:"EVENT", streamType:"_ui",
|
|
@@ -51,7 +51,7 @@ export class UIRouter {
|
|
|
51
51
|
/**
|
|
52
52
|
* Called when a UI WebView mounts. `injectFn` wraps
|
|
53
53
|
* `webView.injectJavaScript` — the router calls it with prebuilt
|
|
54
|
-
* `window.
|
|
54
|
+
* `window.__host.recv(...)` strings to deliver background-side
|
|
55
55
|
* frames into the WebView's glassly global.
|
|
56
56
|
*
|
|
57
57
|
* The router also pushes a UI_OPEN envelope to the background side
|
|
@@ -158,7 +158,7 @@ export class UIRouter {
|
|
|
158
158
|
const cancel = { type: "cancel", requestId: uiSendPayload.requestId };
|
|
159
159
|
const literal = JSON.stringify(cancel);
|
|
160
160
|
const escaped = JSON.stringify(literal);
|
|
161
|
-
binding.inject(`if (window.
|
|
161
|
+
binding.inject(`if (window.__host && window.__host.recv) window.__host.recv(JSON.parse(${escaped})); true;`);
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
164
|
const outbound = {
|
|
@@ -171,7 +171,7 @@ export class UIRouter {
|
|
|
171
171
|
outbound.requestId = uiSendPayload.requestId;
|
|
172
172
|
const literal = JSON.stringify(outbound);
|
|
173
173
|
const escaped = JSON.stringify(literal);
|
|
174
|
-
binding.inject(`if (window.
|
|
174
|
+
binding.inject(`if (window.__host && window.__host.recv) window.__host.recv(JSON.parse(${escaped})); true;`);
|
|
175
175
|
}
|
|
176
176
|
/**
|
|
177
177
|
* Send a synthetic frame to the WebView. Used for host-initiated
|
|
@@ -184,7 +184,7 @@ export class UIRouter {
|
|
|
184
184
|
return;
|
|
185
185
|
const literal = JSON.stringify(frame);
|
|
186
186
|
const escaped = JSON.stringify(literal);
|
|
187
|
-
binding.inject(`if (window.
|
|
187
|
+
binding.inject(`if (window.__host && window.__host.recv) window.__host.recv(JSON.parse(${escaped})); true;`);
|
|
188
188
|
}
|
|
189
189
|
/**
|
|
190
190
|
* Wrap an EVENT envelope and push it to background via the bridge.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UIRouter.js","sourceRoot":"","sources":["../../src/services/UIRouter.ts"],"names":[],"mappings":"AA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,mFAAmF,OAAO,WAAW,CACtG,CAAA;IACH,CAAC;IAED;;;;;;OAMG;IACK,mBAAmB,CAAC,WAAmB,EAAE,IAA6B;QAC5E,MAAM,aAAa,GAAG;YACpB,OAAO,EAAE;gBACP,IAAI,EAAE,eAAe;gBACrB,UAAU,EAAE,KAAK;gBACjB,IAAI;aACL;SACF,CAAA;QACD,KAAK,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,EAAE;YAC1C,IAAI,EAAE,QAAQ;YACd,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC;SACnC,CAAC,CAAA;IACJ,CAAC;CACF","sourcesContent":["/**\n * UIRouter — bidirectional bus between a per-miniapp UI WebView\n * and its bound background JSContext.\n *\n * The flow:\n *\n * WebView (glassly.send/on) Background (session.ui.send/on)\n * │ │\n * │ window.ReactNativeWebView │\n * │ .postMessage(jsonEnvelope) │ session.sendOneShot({\n * │ │ type: \"UI_SEND\", channel, payload, seq\n * │ │ })\n * │ │\n * ▼ ▼\n * MiniappHost.onMessage JSRouter (recognises payload.type===\"UI_SEND\")\n * │ │\n * ▼ ▼\n * ──── UIRouter.routeFromWebView ──── UIRouter.routeFromBackground\n * ──► Crust.jsDispatchToJs ──► webView.injectJavaScript(\"window.__glassly.recv(...)\")\n * {kind:\"bridge\", raw: JSON({\n * payload:{\n * type:\"EVENT\", streamType:\"_ui\",\n * data:{type:\"UI_MESSAGE\", channel, payload, seq}\n * }})}\n *\n * The router is a singleton — one instance for the whole host process —\n * because only one WebView is allowed open at a time per spec. The\n * binding map is therefore N entries (one per \"currently has a UI\n * WebView mounted\" miniapp), but in practice it's 0 or 1.\n *\n * UI_OPEN / UI_CLOSE lifecycle envelopes are pushed by the WebView's\n * `glassly.ready()` and the host's WebView teardown handler; the router\n * forwards them to background via the same EVENT/_ui envelope shape.\n */\n\ninterface UIInjectFn {\n (jsSource: string): void\n}\n\n/**\n * Subset of the Crust native module that UIRouter touches.\n * Loose binding keeps tests free of Expo imports.\n */\nexport interface UICrustBinding {\n jsDispatchToJs(packageName: string, envelope: Record<string, unknown>): Promise<void> | void\n}\n\ninterface BoundWebView {\n inject: UIInjectFn\n}\n\n/**\n * NOTE: the WebView ↔ host heartbeat was removed when the lifecycle\n * inversion landed. The current model is **at most one WebView at a\n * time, foreground UI with an always-on background JSContext** (same\n * shape as the cloud-WebView miniapps). User navigation closes it\n * explicitly and `onContentProcessDidTerminate` catches OS-level\n * crashes, but the host may still re-announce UI_OPEN for an already\n * mounted WebView after app resume/dev respawn so the background can\n * push a fresh authoritative snapshot.\n */\n\nexport class UIRouter {\n private readonly bindings: Map<string, BoundWebView> = new Map()\n private readonly crust: UICrustBinding\n\n constructor(crust: UICrustBinding) {\n this.crust = crust\n }\n\n /**\n * Called when a UI WebView mounts. `injectFn` wraps\n * `webView.injectJavaScript` — the router calls it with prebuilt\n * `window.__glassly.recv(...)` strings to deliver background-side\n * frames into the WebView's glassly global.\n *\n * The router also pushes a UI_OPEN envelope to the background side\n * once the WebView signals ready (see {@link routeFromWebView}).\n * Calling bindWebView on a packageName that already has a binding\n * replaces the previous one (defensive — should not happen in\n * practice because only one WebView is open at a time).\n */\n bindWebView(packageName: string, injectFn: UIInjectFn): void {\n this.bindings.set(packageName, {inject: injectFn})\n }\n\n /**\n * Called when the WebView unmounts (user navigated away or the host\n * tore it down on heartbeat timeout). Pushes UI_CLOSE to background\n * so handlers can flush state, then drops the binding.\n */\n unbindWebView(packageName: string): void {\n if (!this.bindings.has(packageName)) return\n this.bindings.delete(packageName)\n this.deliverToBackground(packageName, {type: \"UI_CLOSE\"})\n }\n\n /** True iff a WebView is currently bound to the named package. */\n isBound(packageName: string): boolean {\n return this.bindings.has(packageName)\n }\n\n /**\n * Re-announce the already-mounted WebView to the background JSContext.\n * This covers dev background hot-reload, app resume, and thawed WebViews\n * whose injected UI_SEND frames may have been missed while the host was\n * suspended. Re-emitting UI_OPEN flips `ui.bound` back to true if needed\n * and lets background code push a fresh snapshot via session.ui.onOpen.\n *\n * No-op if no WebView is currently bound for the package.\n */\n notifyReopen(packageName: string): void {\n if (!this.bindings.has(packageName)) return\n this.deliverToBackground(packageName, {type: \"UI_OPEN\"})\n }\n\n /**\n * Forward a WebView-originated postMessage envelope to the JSContext.\n * `rawJson` is the raw string from `event.nativeEvent.data` — the\n * caller hasn't parsed it yet so the router controls the wire format\n * end-to-end.\n *\n * Recognised envelope types from the WebView shim:\n * - {type: \"ready\"} → fire UI_OPEN\n * - {type: \"msg\", seq, channel, payload} → fire UI_MESSAGE\n * - {type: \"heartbeat\", seq} → silently ack\n */\n routeFromWebView(packageName: string, rawJson: string): void {\n let env: {\n type?: string\n seq?: number\n channel?: string\n payload?: unknown\n requestId?: string\n }\n try {\n env = JSON.parse(rawJson)\n } catch {\n return\n }\n if (typeof env.type !== \"string\") return\n\n if (env.type === \"ready\") {\n this.deliverToBackground(packageName, {type: \"UI_OPEN\"})\n return\n }\n if (env.type === \"msg\" && typeof env.channel === \"string\") {\n const out: Record<string, unknown> = {\n type: \"UI_MESSAGE\",\n channel: env.channel,\n payload: env.payload,\n seq: env.seq,\n }\n if (typeof env.requestId === \"string\") out.requestId = env.requestId\n this.deliverToBackground(packageName, out)\n return\n }\n if (env.type === \"cancel\" && typeof env.requestId === \"string\") {\n this.deliverToBackground(packageName, {type: \"UI_CANCEL\", requestId: env.requestId})\n return\n }\n // NOTE: console.* logs do NOT come through this router. The\n // miniappGlobals console-tap shim posts {payload:{type:\"dev_log\"}}\n // envelopes which LocalMiniappRuntime handles and forwards to the\n // dev sidecar tagged source:\"ui\". Keeping that path one-way means\n // we don't have two console-capture pipelines competing.\n //\n // Unknown envelope — drop silently.\n }\n\n /**\n * Called by JSRouter when it sees a `__bridge.send` outbound\n * frame whose parsed payload is a UI_SEND envelope. The router\n * forwards it as a `msg` frame to the bound WebView (or drops if no\n * WebView is currently mounted).\n *\n * `uiSendPayload` is the raw `{type:\"UI_SEND\", channel, payload, seq}`\n * shape produced by `session.ui.send` on the background side.\n */\n routeFromBackground(\n packageName: string,\n uiSendPayload: {\n type: string\n channel?: string\n payload?: unknown\n seq?: number\n requestId?: string\n },\n ): void {\n const binding = this.bindings.get(packageName)\n if (!binding) return\n if (uiSendPayload.type === \"UI_CANCEL\" && typeof uiSendPayload.requestId === \"string\") {\n const cancel = {type: \"cancel\", requestId: uiSendPayload.requestId}\n const literal = JSON.stringify(cancel)\n const escaped = JSON.stringify(literal)\n binding.inject(\n `if (window.__glassly && window.__glassly.recv) window.__glassly.recv(JSON.parse(${escaped})); true;`,\n )\n return\n }\n const outbound: Record<string, unknown> = {\n type: \"msg\",\n seq: uiSendPayload.seq ?? 0,\n channel: uiSendPayload.channel,\n payload: uiSendPayload.payload,\n }\n if (typeof uiSendPayload.requestId === \"string\") outbound.requestId = uiSendPayload.requestId\n const literal = JSON.stringify(outbound)\n const escaped = JSON.stringify(literal)\n binding.inject(\n `if (window.__glassly && window.__glassly.recv) window.__glassly.recv(JSON.parse(${escaped})); true;`,\n )\n }\n\n /**\n * Send a synthetic frame to the WebView. Used for host-initiated\n * lifecycle events (`open`, `close`, `ack`). The wire shape is the\n * same as the WebView shim's recv handler expects.\n */\n pushLifecycleFrame(packageName: string, frame: {type: \"open\" | \"close\" | \"ack\"; seq?: number}): void {\n const binding = this.bindings.get(packageName)\n if (!binding) return\n const literal = JSON.stringify(frame)\n const escaped = JSON.stringify(literal)\n binding.inject(\n `if (window.__glassly && window.__glassly.recv) window.__glassly.recv(JSON.parse(${escaped})); true;`,\n )\n }\n\n /**\n * Wrap an EVENT envelope and push it to background via the bridge.\n * Background's UIModule listens for stream `_ui`. The `type` is the\n * wire value `miniapp_event` — must match `MiniappResponseType.EVENT`\n * exactly, otherwise the SDK's session switch falls through and the\n * `_ui` fan-out never fires (bound stays false; `ui.send` drops).\n */\n private deliverToBackground(packageName: string, data: Record<string, unknown>): void {\n const innerEnvelope = {\n payload: {\n type: \"miniapp_event\",\n streamType: \"_ui\",\n data,\n },\n }\n void this.crust.jsDispatchToJs(packageName, {\n kind: \"bridge\",\n raw: JSON.stringify(innerEnvelope),\n })\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"UIRouter.js","sourceRoot":"","sources":["../../src/services/UIRouter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAkBH;;;;;;;;;GASG;AAEH,MAAM,OAAO,QAAQ;IACF,QAAQ,GAA8B,IAAI,GAAG,EAAE,CAAA;IAC/C,KAAK,CAAgB;IAEtC,YAAY,KAAqB;QAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IAED;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,WAAmB,EAAE,QAAoB;QACnD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,EAAC,MAAM,EAAE,QAAQ,EAAC,CAAC,CAAA;IACpD,CAAC;IAED;;;;OAIG;IACH,aAAa,CAAC,WAAmB;QAC/B,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC;YAAE,OAAM;QAC3C,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;QACjC,IAAI,CAAC,mBAAmB,CAAC,WAAW,EAAE,EAAC,IAAI,EAAE,UAAU,EAAC,CAAC,CAAA;IAC3D,CAAC;IAED,kEAAkE;IAClE,OAAO,CAAC,WAAmB;QACzB,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;IACvC,CAAC;IAED;;;;;;;;OAQG;IACH,YAAY,CAAC,WAAmB;QAC9B,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC;YAAE,OAAM;QAC3C,IAAI,CAAC,mBAAmB,CAAC,WAAW,EAAE,EAAC,IAAI,EAAE,SAAS,EAAC,CAAC,CAAA;IAC1D,CAAC;IAED;;;;;;;;;;OAUG;IACH,gBAAgB,CAAC,WAAmB,EAA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M,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;QACrC,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;QACvC,OAAO,CAAC,MAAM,CACZ,0EAA0E,OAAO,WAAW,CAC7F,CAAA;IACH,CAAC;IAED;;;;;;OAMG;IACK,mBAAmB,CAAC,WAAmB,EAAE,IAA6B;QAC5E,MAAM,aAAa,GAAG;YACpB,OAAO,EAAE;gBACP,IAAI,EAAE,eAAe;gBACrB,UAAU,EAAE,KAAK;gBACjB,IAAI;aACL;SACF,CAAA;QACD,KAAK,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,EAAE;YAC1C,IAAI,EAAE,QAAQ;YACd,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC;SACnC,CAAC,CAAA;IACJ,CAAC;CACF","sourcesContent":["/**\n * UIRouter — bidirectional bus between a per-miniapp UI WebView\n * and its bound background JSContext.\n *\n * The flow:\n *\n * WebView (glassly.send/on) Background (session.ui.send/on)\n * │ │\n * │ window.ReactNativeWebView │\n * │ .postMessage(jsonEnvelope) │ session.sendOneShot({\n * │ │ type: \"UI_SEND\", channel, payload, seq\n * │ │ })\n * │ │\n * ▼ ▼\n * MiniappHost.onMessage JSRouter (recognises payload.type===\"UI_SEND\")\n * │ │\n * ▼ ▼\n * ──── UIRouter.routeFromWebView ──── UIRouter.routeFromBackground\n * ──► Crust.jsDispatchToJs ──► webView.injectJavaScript(\"window.__host.recv(...)\")\n * {kind:\"bridge\", raw: JSON({\n * payload:{\n * type:\"EVENT\", streamType:\"_ui\",\n * data:{type:\"UI_MESSAGE\", channel, payload, seq}\n * }})}\n *\n * The router is a singleton — one instance for the whole host process —\n * because only one WebView is allowed open at a time per spec. The\n * binding map is therefore N entries (one per \"currently has a UI\n * WebView mounted\" miniapp), but in practice it's 0 or 1.\n *\n * UI_OPEN / UI_CLOSE lifecycle envelopes are pushed by the WebView's\n * `glassly.ready()` and the host's WebView teardown handler; the router\n * forwards them to background via the same EVENT/_ui envelope shape.\n */\n\ninterface UIInjectFn {\n (jsSource: string): void\n}\n\n/**\n * Subset of the Crust native module that UIRouter touches.\n * Loose binding keeps tests free of Expo imports.\n */\nexport interface UICrustBinding {\n jsDispatchToJs(packageName: string, envelope: Record<string, unknown>): Promise<void> | void\n}\n\ninterface BoundWebView {\n inject: UIInjectFn\n}\n\n/**\n * NOTE: the WebView ↔ host heartbeat was removed when the lifecycle\n * inversion landed. The current model is **at most one WebView at a\n * time, foreground UI with an always-on background JSContext** (same\n * shape as the cloud-WebView miniapps). User navigation closes it\n * explicitly and `onContentProcessDidTerminate` catches OS-level\n * crashes, but the host may still re-announce UI_OPEN for an already\n * mounted WebView after app resume/dev respawn so the background can\n * push a fresh authoritative snapshot.\n */\n\nexport class UIRouter {\n private readonly bindings: Map<string, BoundWebView> = new Map()\n private readonly crust: UICrustBinding\n\n constructor(crust: UICrustBinding) {\n this.crust = crust\n }\n\n /**\n * Called when a UI WebView mounts. `injectFn` wraps\n * `webView.injectJavaScript` — the router calls it with prebuilt\n * `window.__host.recv(...)` strings to deliver background-side\n * frames into the WebView's glassly global.\n *\n * The router also pushes a UI_OPEN envelope to the background side\n * once the WebView signals ready (see {@link routeFromWebView}).\n * Calling bindWebView on a packageName that already has a binding\n * replaces the previous one (defensive — should not happen in\n * practice because only one WebView is open at a time).\n */\n bindWebView(packageName: string, injectFn: UIInjectFn): void {\n this.bindings.set(packageName, {inject: injectFn})\n }\n\n /**\n * Called when the WebView unmounts (user navigated away or the host\n * tore it down on heartbeat timeout). Pushes UI_CLOSE to background\n * so handlers can flush state, then drops the binding.\n */\n unbindWebView(packageName: string): void {\n if (!this.bindings.has(packageName)) return\n this.bindings.delete(packageName)\n this.deliverToBackground(packageName, {type: \"UI_CLOSE\"})\n }\n\n /** True iff a WebView is currently bound to the named package. */\n isBound(packageName: string): boolean {\n return this.bindings.has(packageName)\n }\n\n /**\n * Re-announce the already-mounted WebView to the background JSContext.\n * This covers dev background hot-reload, app resume, and thawed WebViews\n * whose injected UI_SEND frames may have been missed while the host was\n * suspended. Re-emitting UI_OPEN flips `ui.bound` back to true if needed\n * and lets background code push a fresh snapshot via session.ui.onOpen.\n *\n * No-op if no WebView is currently bound for the package.\n */\n notifyReopen(packageName: string): void {\n if (!this.bindings.has(packageName)) return\n this.deliverToBackground(packageName, {type: \"UI_OPEN\"})\n }\n\n /**\n * Forward a WebView-originated postMessage envelope to the JSContext.\n * `rawJson` is the raw string from `event.nativeEvent.data` — the\n * caller hasn't parsed it yet so the router controls the wire format\n * end-to-end.\n *\n * Recognised envelope types from the WebView shim:\n * - {type: \"ready\"} → fire UI_OPEN\n * - {type: \"msg\", seq, channel, payload} → fire UI_MESSAGE\n * - {type: \"heartbeat\", seq} → silently ack\n */\n routeFromWebView(packageName: string, rawJson: string): void {\n let env: {\n type?: string\n seq?: number\n channel?: string\n payload?: unknown\n requestId?: string\n }\n try {\n env = JSON.parse(rawJson)\n } catch {\n return\n }\n if (typeof env.type !== \"string\") return\n\n if (env.type === \"ready\") {\n this.deliverToBackground(packageName, {type: \"UI_OPEN\"})\n return\n }\n if (env.type === \"msg\" && typeof env.channel === \"string\") {\n const out: Record<string, unknown> = {\n type: \"UI_MESSAGE\",\n channel: env.channel,\n payload: env.payload,\n seq: env.seq,\n }\n if (typeof env.requestId === \"string\") out.requestId = env.requestId\n this.deliverToBackground(packageName, out)\n return\n }\n if (env.type === \"cancel\" && typeof env.requestId === \"string\") {\n this.deliverToBackground(packageName, {type: \"UI_CANCEL\", requestId: env.requestId})\n return\n }\n // NOTE: console.* logs do NOT come through this router. The\n // miniappGlobals console-tap shim posts {payload:{type:\"dev_log\"}}\n // envelopes which LocalMiniappRuntime handles and forwards to the\n // dev sidecar tagged source:\"ui\". Keeping that path one-way means\n // we don't have two console-capture pipelines competing.\n //\n // Unknown envelope — drop silently.\n }\n\n /**\n * Called by JSRouter when it sees a `__bridge.send` outbound\n * frame whose parsed payload is a UI_SEND envelope. The router\n * forwards it as a `msg` frame to the bound WebView (or drops if no\n * WebView is currently mounted).\n *\n * `uiSendPayload` is the raw `{type:\"UI_SEND\", channel, payload, seq}`\n * shape produced by `session.ui.send` on the background side.\n */\n routeFromBackground(\n packageName: string,\n uiSendPayload: {\n type: string\n channel?: string\n payload?: unknown\n seq?: number\n requestId?: string\n },\n ): void {\n const binding = this.bindings.get(packageName)\n if (!binding) return\n if (uiSendPayload.type === \"UI_CANCEL\" && typeof uiSendPayload.requestId === \"string\") {\n const cancel = {type: \"cancel\", requestId: uiSendPayload.requestId}\n const literal = JSON.stringify(cancel)\n const escaped = JSON.stringify(literal)\n binding.inject(\n `if (window.__host && window.__host.recv) window.__host.recv(JSON.parse(${escaped})); true;`,\n )\n return\n }\n const outbound: Record<string, unknown> = {\n type: \"msg\",\n seq: uiSendPayload.seq ?? 0,\n channel: uiSendPayload.channel,\n payload: uiSendPayload.payload,\n }\n if (typeof uiSendPayload.requestId === \"string\") outbound.requestId = uiSendPayload.requestId\n const literal = JSON.stringify(outbound)\n const escaped = JSON.stringify(literal)\n binding.inject(\n `if (window.__host && window.__host.recv) window.__host.recv(JSON.parse(${escaped})); true;`,\n )\n }\n\n /**\n * Send a synthetic frame to the WebView. Used for host-initiated\n * lifecycle events (`open`, `close`, `ack`). The wire shape is the\n * same as the WebView shim's recv handler expects.\n */\n pushLifecycleFrame(packageName: string, frame: {type: \"open\" | \"close\" | \"ack\"; seq?: number}): void {\n const binding = this.bindings.get(packageName)\n if (!binding) return\n const literal = JSON.stringify(frame)\n const escaped = JSON.stringify(literal)\n binding.inject(\n `if (window.__host && window.__host.recv) window.__host.recv(JSON.parse(${escaped})); true;`,\n )\n }\n\n /**\n * Wrap an EVENT envelope and push it to background via the bridge.\n * Background's UIModule listens for stream `_ui`. The `type` is the\n * wire value `miniapp_event` — must match `MiniappResponseType.EVENT`\n * exactly, otherwise the SDK's session switch falls through and the\n * `_ui` fan-out never fires (bound stays false; `ui.send` drops).\n */\n private deliverToBackground(packageName: string, data: Record<string, unknown>): void {\n const innerEnvelope = {\n payload: {\n type: \"miniapp_event\",\n streamType: \"_ui\",\n data,\n },\n }\n void this.crust.jsDispatchToJs(packageName, {\n kind: \"bridge\",\n raw: JSON.stringify(innerEnvelope),\n })\n }\n}\n"]}
|
|
@@ -18,7 +18,7 @@ export function toPortableGalleryPath(path, documentDirectoryPath) {
|
|
|
18
18
|
if (!candidate || candidate.includes("\0"))
|
|
19
19
|
return null;
|
|
20
20
|
const segments = candidate.split("/");
|
|
21
|
-
if (segments[0] !== "
|
|
21
|
+
if (segments[0] !== "Photos" || segments.some((segment) => !segment || segment === "." || segment === "..")) {
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
24
24
|
return segments.join("/");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"galleryPathMigration.js","sourceRoot":"","sources":["../../../src/services/asg/galleryPathMigration.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,MAAM,UAAU,qBAAqB,CAAC,IAAY,EAAE,qBAA6B;IAC/E,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAA;IACtB,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAA;IAChD,MAAM,OAAO,GAAG,qBAAqB,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IACxD,IAAI,SAAS,GAAkB,IAAI,CAAA;IACnC,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,OAAO,GAAG,CAAC;QAAE,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;SACvF,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;IAE9E,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,eAAe,GAAG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AAI,cAAc,IAAI,CAAC;YAAE,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC,cAAc,GAAG,eAAe,CAAC,MAAM,CAAC,CAAA;IACnG,CAAC;IAED,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAA;IACvD,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACrC,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,IAAI,OAAO,KAAK,GAAG,IAAI,OAAO,KAAK,IAAI,CAAC,EAAE,CAAC;QAC5G,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC3B,CAAC","sourcesContent":["/** Convert current or legacy app-container paths into a portable Documents-relative path. */\nexport function toPortableGalleryPath(path: string, documentDirectoryPath: string): string | null {\n if (!path) return null\n const cleanPath = path.replace(/^file:\\/\\//, \"\")\n const docPath = documentDirectoryPath.replace(/\\/$/, \"\")\n let candidate: string | null = null\n if (cleanPath.startsWith(`${docPath}/`)) candidate = cleanPath.substring(docPath.length + 1)\n else if (!cleanPath.startsWith(\"/\")) candidate = cleanPath.replace(/^\\/+/, \"\")\n\n if (!candidate) {\n const documentsMarker = \"/Documents/\"\n const documentsIndex = cleanPath.indexOf(documentsMarker)\n if (documentsIndex >= 0) candidate = cleanPath.substring(documentsIndex + documentsMarker.length)\n }\n\n if (!candidate || candidate.includes(\"\\0\")) return null\n const segments = candidate.split(\"/\")\n if (segments[0] !== \"Photos\" || segments.some((segment) => !segment || segment === \".\" || segment === \"..\")) {\n return null\n }\n return segments.join(\"/\")\n}\n"]}
|
|
@@ -330,7 +330,7 @@ class GallerySyncService {
|
|
|
330
330
|
try {
|
|
331
331
|
return await Promise.race([
|
|
332
332
|
CrustModule.isLocationServicesEnabled(),
|
|
333
|
-
new Promise((_, reject) => setTimeout(() => reject(new Error("Location services check timed out")), TIMING.LOCATION_SERVICES_CHECK_TIMEOUT_MS)),
|
|
333
|
+
new Promise((_, reject) => BgTimer.setTimeout(() => reject(new Error("Location services check timed out")), TIMING.LOCATION_SERVICES_CHECK_TIMEOUT_MS)),
|
|
334
334
|
]);
|
|
335
335
|
}
|
|
336
336
|
catch (error) {
|
|
@@ -356,7 +356,7 @@ class GallerySyncService {
|
|
|
356
356
|
if (state !== "unknown") {
|
|
357
357
|
return state === "on";
|
|
358
358
|
}
|
|
359
|
-
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
359
|
+
await new Promise((resolve) => BgTimer.setTimeout(resolve, 50));
|
|
360
360
|
}
|
|
361
361
|
console.warn("[GallerySyncService] Bluetooth state still unknown after 500ms - assuming enabled");
|
|
362
362
|
return true;
|