@glassly/engine 0.1.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -0
- package/build/devtools.d.ts +11 -0
- package/build/devtools.d.ts.map +1 -0
- package/build/devtools.js +13 -0
- package/build/devtools.js.map +1 -0
- package/build/engine.d.ts +336 -0
- package/build/engine.d.ts.map +1 -0
- package/build/engine.js +198 -0
- package/build/engine.js.map +1 -0
- package/build/facades/dev.d.ts +69 -0
- package/build/facades/dev.d.ts.map +1 -0
- package/build/facades/dev.js +204 -0
- package/build/facades/dev.js.map +1 -0
- package/build/facades/display.d.ts +21 -0
- package/build/facades/display.d.ts.map +1 -0
- package/build/facades/display.js +17 -0
- package/build/facades/display.js.map +1 -0
- package/build/facades/displayMirror.d.ts +15 -0
- package/build/facades/displayMirror.d.ts.map +1 -0
- package/build/facades/displayMirror.js +29 -0
- package/build/facades/displayMirror.js.map +1 -0
- package/build/facades/gallery.d.ts +62 -0
- package/build/facades/gallery.d.ts.map +1 -0
- package/build/facades/gallery.js +61 -0
- package/build/facades/gallery.js.map +1 -0
- package/build/facades/glasses.d.ts +142 -0
- package/build/facades/glasses.d.ts.map +1 -0
- package/build/facades/glasses.js +214 -0
- package/build/facades/glasses.js.map +1 -0
- package/build/facades/glassesSettings.d.ts +13 -0
- package/build/facades/glassesSettings.d.ts.map +1 -0
- package/build/facades/glassesSettings.js +55 -0
- package/build/facades/glassesSettings.js.map +1 -0
- package/build/facades/glassesWifi.d.ts +25 -0
- package/build/facades/glassesWifi.d.ts.map +1 -0
- package/build/facades/glassesWifi.js +57 -0
- package/build/facades/glassesWifi.js.map +1 -0
- package/build/facades/maps.d.ts +18 -0
- package/build/facades/maps.d.ts.map +1 -0
- package/build/facades/maps.js +13 -0
- package/build/facades/maps.js.map +1 -0
- package/build/facades/memory.d.ts +38 -0
- package/build/facades/memory.d.ts.map +1 -0
- package/build/facades/memory.js +33 -0
- package/build/facades/memory.js.map +1 -0
- package/build/facades/miniapps.d.ts +47 -0
- package/build/facades/miniapps.d.ts.map +1 -0
- package/build/facades/miniapps.js +54 -0
- package/build/facades/miniapps.js.map +1 -0
- package/build/facades/notifications.d.ts +13 -0
- package/build/facades/notifications.d.ts.map +1 -0
- package/build/facades/notifications.js +12 -0
- package/build/facades/notifications.js.map +1 -0
- package/build/facades/ota.d.ts +106 -0
- package/build/facades/ota.d.ts.map +1 -0
- package/build/facades/ota.js +159 -0
- package/build/facades/ota.js.map +1 -0
- package/build/facades/pairing.d.ts +115 -0
- package/build/facades/pairing.d.ts.map +1 -0
- package/build/facades/pairing.js +275 -0
- package/build/facades/pairing.js.map +1 -0
- package/build/facades/permissions.d.ts +33 -0
- package/build/facades/permissions.d.ts.map +1 -0
- package/build/facades/permissions.js +155 -0
- package/build/facades/permissions.js.map +1 -0
- package/build/facades/phoneNotifications.d.ts +17 -0
- package/build/facades/phoneNotifications.d.ts.map +1 -0
- package/build/facades/phoneNotifications.js +41 -0
- package/build/facades/phoneNotifications.js.map +1 -0
- package/build/facades/providerKeys.d.ts +26 -0
- package/build/facades/providerKeys.d.ts.map +1 -0
- package/build/facades/providerKeys.js +26 -0
- package/build/facades/providerKeys.js.map +1 -0
- package/build/facades/reports.d.ts +36 -0
- package/build/facades/reports.d.ts.map +1 -0
- package/build/facades/reports.js +134 -0
- package/build/facades/reports.js.map +1 -0
- package/build/facades/session.d.ts +21 -0
- package/build/facades/session.d.ts.map +1 -0
- package/build/facades/session.js +52 -0
- package/build/facades/session.js.map +1 -0
- package/build/facades/settings.d.ts +37 -0
- package/build/facades/settings.d.ts.map +1 -0
- package/build/facades/settings.js +55 -0
- package/build/facades/settings.js.map +1 -0
- package/build/facades/speakers.d.ts +41 -0
- package/build/facades/speakers.d.ts.map +1 -0
- package/build/facades/speakers.js +139 -0
- package/build/facades/speakers.js.map +1 -0
- package/build/facades/speech.d.ts +44 -0
- package/build/facades/speech.d.ts.map +1 -0
- package/build/facades/speech.js +46 -0
- package/build/facades/speech.js.map +1 -0
- package/build/index.d.ts +48 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +49 -0
- package/build/index.js.map +1 -0
- package/build/internal.d.ts +67 -0
- package/build/internal.d.ts.map +1 -0
- package/build/internal.js +90 -0
- package/build/internal.js.map +1 -0
- package/build/runtime/bootstrap.d.ts +115 -0
- package/build/runtime/bootstrap.d.ts.map +1 -0
- package/build/runtime/bootstrap.js +73 -0
- package/build/runtime/bootstrap.js.map +1 -0
- package/build/runtime/config.d.ts +152 -0
- package/build/runtime/config.d.ts.map +1 -0
- package/build/runtime/config.js +19 -0
- package/build/runtime/config.js.map +1 -0
- package/build/runtime/scanQrSeam.d.ts +7 -0
- package/build/runtime/scanQrSeam.d.ts.map +1 -0
- package/build/runtime/scanQrSeam.js +16 -0
- package/build/runtime/scanQrSeam.js.map +1 -0
- package/build/runtime/streamConfig.d.ts +4 -0
- package/build/runtime/streamConfig.d.ts.map +1 -0
- package/build/runtime/streamConfig.js +38 -0
- package/build/runtime/streamConfig.js.map +1 -0
- package/build/services/AiTierResolution.d.ts +61 -0
- package/build/services/AiTierResolution.d.ts.map +1 -0
- package/build/services/AiTierResolution.js +83 -0
- package/build/services/AiTierResolution.js.map +1 -0
- package/build/services/AppRegistry.d.ts +303 -0
- package/build/services/AppRegistry.d.ts.map +1 -0
- package/build/services/AppRegistry.js +1108 -0
- package/build/services/AppRegistry.js.map +1 -0
- package/build/services/AudioCloudUplink.d.ts +15 -0
- package/build/services/AudioCloudUplink.d.ts.map +1 -0
- package/build/services/AudioCloudUplink.js +54 -0
- package/build/services/AudioCloudUplink.js.map +1 -0
- package/build/services/AudioPlaybackService.d.ts +183 -0
- package/build/services/AudioPlaybackService.d.ts.map +1 -0
- package/build/services/AudioPlaybackService.js +750 -0
- package/build/services/AudioPlaybackService.js.map +1 -0
- package/build/services/AutomaticReportResult.d.ts +20 -0
- package/build/services/AutomaticReportResult.d.ts.map +1 -0
- package/build/services/AutomaticReportResult.js +29 -0
- package/build/services/AutomaticReportResult.js.map +1 -0
- package/build/services/BlobStore.d.ts +106 -0
- package/build/services/BlobStore.d.ts.map +1 -0
- package/build/services/BlobStore.js +741 -0
- package/build/services/BlobStore.js.map +1 -0
- package/build/services/CaptionsTesterReportService.d.ts +4 -0
- package/build/services/CaptionsTesterReportService.d.ts.map +1 -0
- package/build/services/CaptionsTesterReportService.js +80 -0
- package/build/services/CaptionsTesterReportService.js.map +1 -0
- package/build/services/CloudAudioSubscriptionSync.d.ts +24 -0
- package/build/services/CloudAudioSubscriptionSync.d.ts.map +1 -0
- package/build/services/CloudAudioSubscriptionSync.js +51 -0
- package/build/services/CloudAudioSubscriptionSync.js.map +1 -0
- package/build/services/CloudClientService.d.ts +293 -0
- package/build/services/CloudClientService.d.ts.map +1 -0
- package/build/services/CloudClientService.js +965 -0
- package/build/services/CloudClientService.js.map +1 -0
- package/build/services/CloudTranscriptE2EMetrics.d.ts +4 -0
- package/build/services/CloudTranscriptE2EMetrics.d.ts.map +1 -0
- package/build/services/CloudTranscriptE2EMetrics.js +24 -0
- package/build/services/CloudTranscriptE2EMetrics.js.map +1 -0
- package/build/services/ConnectionCoordinator.d.ts +51 -0
- package/build/services/ConnectionCoordinator.d.ts.map +1 -0
- package/build/services/ConnectionCoordinator.js +34 -0
- package/build/services/ConnectionCoordinator.js.map +1 -0
- package/build/services/DevServerBridge.d.ts +63 -0
- package/build/services/DevServerBridge.d.ts.map +1 -0
- package/build/services/DevServerBridge.js +296 -0
- package/build/services/DevServerBridge.js.map +1 -0
- package/build/services/DeviceEventRouter.d.ts +3 -0
- package/build/services/DeviceEventRouter.d.ts.map +1 -0
- package/build/services/DeviceEventRouter.js +214 -0
- package/build/services/DeviceEventRouter.js.map +1 -0
- package/build/services/DeviceStoreHydration.d.ts +38 -0
- package/build/services/DeviceStoreHydration.d.ts.map +1 -0
- package/build/services/DeviceStoreHydration.js +124 -0
- package/build/services/DeviceStoreHydration.js.map +1 -0
- package/build/services/DisplayProcessor.d.ts +223 -0
- package/build/services/DisplayProcessor.d.ts.map +1 -0
- package/build/services/DisplayProcessor.js +552 -0
- package/build/services/DisplayProcessor.js.map +1 -0
- package/build/services/ForegroundLocationPermission.d.ts +13 -0
- package/build/services/ForegroundLocationPermission.d.ts.map +1 -0
- package/build/services/ForegroundLocationPermission.js +12 -0
- package/build/services/ForegroundLocationPermission.js.map +1 -0
- package/build/services/GlassesReadiness.d.ts +41 -0
- package/build/services/GlassesReadiness.d.ts.map +1 -0
- package/build/services/GlassesReadiness.js +82 -0
- package/build/services/GlassesReadiness.js.map +1 -0
- package/build/services/GlassesSettingsSync.d.ts +33 -0
- package/build/services/GlassesSettingsSync.d.ts.map +1 -0
- package/build/services/GlassesSettingsSync.js +127 -0
- package/build/services/GlassesSettingsSync.js.map +1 -0
- package/build/services/GlassesStatusProjection.d.ts +3 -0
- package/build/services/GlassesStatusProjection.d.ts.map +1 -0
- package/build/services/GlassesStatusProjection.js +65 -0
- package/build/services/GlassesStatusProjection.js.map +1 -0
- package/build/services/HeadingService.d.ts +33 -0
- package/build/services/HeadingService.d.ts.map +1 -0
- package/build/services/HeadingService.js +123 -0
- package/build/services/HeadingService.js.map +1 -0
- package/build/services/HotspotOtaTransport.d.ts +29 -0
- package/build/services/HotspotOtaTransport.d.ts.map +1 -0
- package/build/services/HotspotOtaTransport.js +146 -0
- package/build/services/HotspotOtaTransport.js.map +1 -0
- package/build/services/HotspotShutdown.d.ts +17 -0
- package/build/services/HotspotShutdown.d.ts.map +1 -0
- package/build/services/HotspotShutdown.js +29 -0
- package/build/services/HotspotShutdown.js.map +1 -0
- package/build/services/JSCrashController.d.ts +97 -0
- package/build/services/JSCrashController.d.ts.map +1 -0
- package/build/services/JSCrashController.js +138 -0
- package/build/services/JSCrashController.js.map +1 -0
- package/build/services/JSCrashloopReportService.d.ts +9 -0
- package/build/services/JSCrashloopReportService.d.ts.map +1 -0
- package/build/services/JSCrashloopReportService.js +54 -0
- package/build/services/JSCrashloopReportService.js.map +1 -0
- package/build/services/JSLogPipeline.d.ts +87 -0
- package/build/services/JSLogPipeline.d.ts.map +1 -0
- package/build/services/JSLogPipeline.js +137 -0
- package/build/services/JSLogPipeline.js.map +1 -0
- package/build/services/JSRouter.d.ts +203 -0
- package/build/services/JSRouter.d.ts.map +1 -0
- package/build/services/JSRouter.js +482 -0
- package/build/services/JSRouter.js.map +1 -0
- package/build/services/LocalDisplayManager.d.ts +162 -0
- package/build/services/LocalDisplayManager.d.ts.map +1 -0
- package/build/services/LocalDisplayManager.js +687 -0
- package/build/services/LocalDisplayManager.js.map +1 -0
- package/build/services/LocalMiniappDataMigration.d.ts +46 -0
- package/build/services/LocalMiniappDataMigration.d.ts.map +1 -0
- package/build/services/LocalMiniappDataMigration.js +78 -0
- package/build/services/LocalMiniappDataMigration.js.map +1 -0
- package/build/services/LocalMiniappRuntime.d.ts +677 -0
- package/build/services/LocalMiniappRuntime.d.ts.map +1 -0
- package/build/services/LocalMiniappRuntime.js +5068 -0
- package/build/services/LocalMiniappRuntime.js.map +1 -0
- package/build/services/LocalMiniappStorage.d.ts +32 -0
- package/build/services/LocalMiniappStorage.d.ts.map +1 -0
- package/build/services/LocalMiniappStorage.js +66 -0
- package/build/services/LocalMiniappStorage.js.map +1 -0
- package/build/services/LocalMiniappUserIdentity.d.ts +41 -0
- package/build/services/LocalMiniappUserIdentity.d.ts.map +1 -0
- package/build/services/LocalMiniappUserIdentity.js +73 -0
- package/build/services/LocalMiniappUserIdentity.js.map +1 -0
- package/build/services/LocalSttFallbackCoordinator.d.ts +101 -0
- package/build/services/LocalSttFallbackCoordinator.d.ts.map +1 -0
- package/build/services/LocalSttFallbackCoordinator.js +210 -0
- package/build/services/LocalSttFallbackCoordinator.js.map +1 -0
- package/build/services/MapboxTokenService.d.ts +33 -0
- package/build/services/MapboxTokenService.d.ts.map +1 -0
- package/build/services/MapboxTokenService.js +115 -0
- package/build/services/MapboxTokenService.js.map +1 -0
- package/build/services/MemoryCapture.d.ts +40 -0
- package/build/services/MemoryCapture.d.ts.map +1 -0
- package/build/services/MemoryCapture.js +42 -0
- package/build/services/MemoryCapture.js.map +1 -0
- package/build/services/MemoryStore.d.ts +184 -0
- package/build/services/MemoryStore.d.ts.map +1 -0
- package/build/services/MemoryStore.js +541 -0
- package/build/services/MemoryStore.js.map +1 -0
- package/build/services/MicStateCoordinator.d.ts +78 -0
- package/build/services/MicStateCoordinator.d.ts.map +1 -0
- package/build/services/MicStateCoordinator.js +219 -0
- package/build/services/MicStateCoordinator.js.map +1 -0
- package/build/services/MiniappEngine.d.ts +31 -0
- package/build/services/MiniappEngine.d.ts.map +1 -0
- package/build/services/MiniappEngine.js +119 -0
- package/build/services/MiniappEngine.js.map +1 -0
- package/build/services/MiniappLauncher.d.ts +127 -0
- package/build/services/MiniappLauncher.d.ts.map +1 -0
- package/build/services/MiniappLauncher.js +309 -0
- package/build/services/MiniappLauncher.js.map +1 -0
- package/build/services/MiniappLiveness.d.ts +12 -0
- package/build/services/MiniappLiveness.d.ts.map +1 -0
- package/build/services/MiniappLiveness.js +16 -0
- package/build/services/MiniappLiveness.js.map +1 -0
- package/build/services/MiniappRunningRegistry.d.ts +24 -0
- package/build/services/MiniappRunningRegistry.d.ts.map +1 -0
- package/build/services/MiniappRunningRegistry.js +52 -0
- package/build/services/MiniappRunningRegistry.js.map +1 -0
- package/build/services/NativeHttpResponse.d.ts +3 -0
- package/build/services/NativeHttpResponse.d.ts.map +1 -0
- package/build/services/NativeHttpResponse.js +6 -0
- package/build/services/NativeHttpResponse.js.map +1 -0
- package/build/services/NativeNavigationService.d.ts +51 -0
- package/build/services/NativeNavigationService.d.ts.map +1 -0
- package/build/services/NativeNavigationService.js +154 -0
- package/build/services/NativeNavigationService.js.map +1 -0
- package/build/services/NavigationHandlers.d.ts +107 -0
- package/build/services/NavigationHandlers.d.ts.map +1 -0
- package/build/services/NavigationHandlers.js +479 -0
- package/build/services/NavigationHandlers.js.map +1 -0
- package/build/services/NavigationService.d.ts +283 -0
- package/build/services/NavigationService.d.ts.map +1 -0
- package/build/services/NavigationService.js +696 -0
- package/build/services/NavigationService.js.map +1 -0
- package/build/services/NotificationsEmitter.d.ts +28 -0
- package/build/services/NotificationsEmitter.d.ts.map +1 -0
- package/build/services/NotificationsEmitter.js +22 -0
- package/build/services/NotificationsEmitter.js.map +1 -0
- package/build/services/OfflineSpeechModelService.d.ts +33 -0
- package/build/services/OfflineSpeechModelService.d.ts.map +1 -0
- package/build/services/OfflineSpeechModelService.js +136 -0
- package/build/services/OfflineSpeechModelService.js.map +1 -0
- package/build/services/OtaArtifactDownloader.d.ts +65 -0
- package/build/services/OtaArtifactDownloader.d.ts.map +1 -0
- package/build/services/OtaArtifactDownloader.js +226 -0
- package/build/services/OtaArtifactDownloader.js.map +1 -0
- package/build/services/OtaInstallCoordinator.d.ts +275 -0
- package/build/services/OtaInstallCoordinator.d.ts.map +1 -0
- package/build/services/OtaInstallCoordinator.js +1491 -0
- package/build/services/OtaInstallCoordinator.js.map +1 -0
- package/build/services/OtaService.d.ts +3 -0
- package/build/services/OtaService.d.ts.map +1 -0
- package/build/services/OtaService.js +72 -0
- package/build/services/OtaService.js.map +1 -0
- package/build/services/OtaUpdateCheckService.d.ts +100 -0
- package/build/services/OtaUpdateCheckService.d.ts.map +1 -0
- package/build/services/OtaUpdateCheckService.js +380 -0
- package/build/services/OtaUpdateCheckService.js.map +1 -0
- package/build/services/PairingIdentity.d.ts +80 -0
- package/build/services/PairingIdentity.d.ts.map +1 -0
- package/build/services/PairingIdentity.js +145 -0
- package/build/services/PairingIdentity.js.map +1 -0
- package/build/services/PhoneCalendarHelpers.d.ts +32 -0
- package/build/services/PhoneCalendarHelpers.d.ts.map +1 -0
- package/build/services/PhoneCalendarHelpers.js +157 -0
- package/build/services/PhoneCalendarHelpers.js.map +1 -0
- package/build/services/PhoneCalendarService.d.ts +5 -0
- package/build/services/PhoneCalendarService.d.ts.map +1 -0
- package/build/services/PhoneCalendarService.js +45 -0
- package/build/services/PhoneCalendarService.js.map +1 -0
- package/build/services/PhoneCameraFovCoordinator.d.ts +30 -0
- package/build/services/PhoneCameraFovCoordinator.d.ts.map +1 -0
- package/build/services/PhoneCameraFovCoordinator.js +194 -0
- package/build/services/PhoneCameraFovCoordinator.js.map +1 -0
- package/build/services/PhoneLocationService.d.ts +36 -0
- package/build/services/PhoneLocationService.d.ts.map +1 -0
- package/build/services/PhoneLocationService.js +115 -0
- package/build/services/PhoneLocationService.js.map +1 -0
- package/build/services/PhoneNotificationsSync.d.ts +3 -0
- package/build/services/PhoneNotificationsSync.d.ts.map +1 -0
- package/build/services/PhoneNotificationsSync.js +37 -0
- package/build/services/PhoneNotificationsSync.js.map +1 -0
- package/build/services/PhonePhotoCoordinator.d.ts +110 -0
- package/build/services/PhonePhotoCoordinator.d.ts.map +1 -0
- package/build/services/PhonePhotoCoordinator.js +344 -0
- package/build/services/PhonePhotoCoordinator.js.map +1 -0
- package/build/services/PhoneStreamCoordinator.d.ts +175 -0
- package/build/services/PhoneStreamCoordinator.d.ts.map +1 -0
- package/build/services/PhoneStreamCoordinator.js +740 -0
- package/build/services/PhoneStreamCoordinator.js.map +1 -0
- package/build/services/PhoneVideoCoordinator.d.ts +52 -0
- package/build/services/PhoneVideoCoordinator.d.ts.map +1 -0
- package/build/services/PhoneVideoCoordinator.js +157 -0
- package/build/services/PhoneVideoCoordinator.js.map +1 -0
- package/build/services/ProviderKeyValidation.d.ts +27 -0
- package/build/services/ProviderKeyValidation.d.ts.map +1 -0
- package/build/services/ProviderKeyValidation.js +42 -0
- package/build/services/ProviderKeyValidation.js.map +1 -0
- package/build/services/STTModelManager.d.ts +65 -0
- package/build/services/STTModelManager.d.ts.map +1 -0
- package/build/services/STTModelManager.js +366 -0
- package/build/services/STTModelManager.js.map +1 -0
- package/build/services/SceneRenderer.d.ts +90 -0
- package/build/services/SceneRenderer.d.ts.map +1 -0
- package/build/services/SceneRenderer.js +274 -0
- package/build/services/SceneRenderer.js.map +1 -0
- package/build/services/SentenceTtsPipeline.d.ts +31 -0
- package/build/services/SentenceTtsPipeline.d.ts.map +1 -0
- package/build/services/SentenceTtsPipeline.js +67 -0
- package/build/services/SentenceTtsPipeline.js.map +1 -0
- package/build/services/SpeakerIdModelManager.d.ts +36 -0
- package/build/services/SpeakerIdModelManager.d.ts.map +1 -0
- package/build/services/SpeakerIdModelManager.js +132 -0
- package/build/services/SpeakerIdModelManager.js.map +1 -0
- package/build/services/SpeakerIdSync.d.ts +14 -0
- package/build/services/SpeakerIdSync.d.ts.map +1 -0
- package/build/services/SpeakerIdSync.js +62 -0
- package/build/services/SpeakerIdSync.js.map +1 -0
- package/build/services/SpeakerLabelResolver.d.ts +80 -0
- package/build/services/SpeakerLabelResolver.d.ts.map +1 -0
- package/build/services/SpeakerLabelResolver.js +108 -0
- package/build/services/SpeakerLabelResolver.js.map +1 -0
- package/build/services/SpeakerProfileStore.d.ts +90 -0
- package/build/services/SpeakerProfileStore.d.ts.map +1 -0
- package/build/services/SpeakerProfileStore.js +213 -0
- package/build/services/SpeakerProfileStore.js.map +1 -0
- package/build/services/SpeakerSegmentResolver.d.ts +87 -0
- package/build/services/SpeakerSegmentResolver.d.ts.map +1 -0
- package/build/services/SpeakerSegmentResolver.js +137 -0
- package/build/services/SpeakerSegmentResolver.js.map +1 -0
- package/build/services/StreamLifecycleController.d.ts +63 -0
- package/build/services/StreamLifecycleController.d.ts.map +1 -0
- package/build/services/StreamLifecycleController.js +148 -0
- package/build/services/StreamLifecycleController.js.map +1 -0
- package/build/services/SupportProfileSync.d.ts +22 -0
- package/build/services/SupportProfileSync.d.ts.map +1 -0
- package/build/services/SupportProfileSync.js +213 -0
- package/build/services/SupportProfileSync.js.map +1 -0
- package/build/services/TTSModelManager.d.ts +90 -0
- package/build/services/TTSModelManager.d.ts.map +1 -0
- package/build/services/TTSModelManager.js +366 -0
- package/build/services/TTSModelManager.js.map +1 -0
- package/build/services/TranscriptionRouting.d.ts +22 -0
- package/build/services/TranscriptionRouting.d.ts.map +1 -0
- package/build/services/TranscriptionRouting.js +34 -0
- package/build/services/TranscriptionRouting.js.map +1 -0
- package/build/services/TtsTextSanitizer.d.ts +5 -0
- package/build/services/TtsTextSanitizer.d.ts.map +1 -0
- package/build/services/TtsTextSanitizer.js +61 -0
- package/build/services/TtsTextSanitizer.js.map +1 -0
- package/build/services/UIRouter.d.ts +137 -0
- package/build/services/UIRouter.d.ts.map +1 -0
- package/build/services/UIRouter.js +210 -0
- package/build/services/UIRouter.js.map +1 -0
- package/build/services/WebviewBridge.d.ts +22 -0
- package/build/services/WebviewBridge.d.ts.map +1 -0
- package/build/services/WebviewBridge.js +47 -0
- package/build/services/WebviewBridge.js.map +1 -0
- package/build/services/WifiAdbRequest.d.ts +17 -0
- package/build/services/WifiAdbRequest.d.ts.map +1 -0
- package/build/services/WifiAdbRequest.js +35 -0
- package/build/services/WifiAdbRequest.js.map +1 -0
- package/build/services/asg/GalleryMediaIntegrityReportService.d.ts +17 -0
- package/build/services/asg/GalleryMediaIntegrityReportService.d.ts.map +1 -0
- package/build/services/asg/GalleryMediaIntegrityReportService.js +43 -0
- package/build/services/asg/GalleryMediaIntegrityReportService.js.map +1 -0
- package/build/services/asg/asgCameraApi.d.ts +208 -0
- package/build/services/asg/asgCameraApi.d.ts.map +1 -0
- package/build/services/asg/asgCameraApi.js +1480 -0
- package/build/services/asg/asgCameraApi.js.map +1 -0
- package/build/services/asg/cameraRollExportCoordinator.d.ts +60 -0
- package/build/services/asg/cameraRollExportCoordinator.d.ts.map +1 -0
- package/build/services/asg/cameraRollExportCoordinator.js +618 -0
- package/build/services/asg/cameraRollExportCoordinator.js.map +1 -0
- package/build/services/asg/cameraRollExportLedger.d.ts +44 -0
- package/build/services/asg/cameraRollExportLedger.d.ts.map +1 -0
- package/build/services/asg/cameraRollExportLedger.js +78 -0
- package/build/services/asg/cameraRollExportLedger.js.map +1 -0
- package/build/services/asg/galleryMediaValidation.d.ts +29 -0
- package/build/services/asg/galleryMediaValidation.d.ts.map +1 -0
- package/build/services/asg/galleryMediaValidation.js +149 -0
- package/build/services/asg/galleryMediaValidation.js.map +1 -0
- package/build/services/asg/galleryNotices.d.ts +33 -0
- package/build/services/asg/galleryNotices.d.ts.map +1 -0
- package/build/services/asg/galleryNotices.js +29 -0
- package/build/services/asg/galleryNotices.js.map +1 -0
- package/build/services/asg/galleryPathMigration.d.ts +3 -0
- package/build/services/asg/galleryPathMigration.d.ts.map +1 -0
- package/build/services/asg/galleryPathMigration.js +26 -0
- package/build/services/asg/galleryPathMigration.js.map +1 -0
- package/build/services/asg/gallerySettingsService.d.ts +20 -0
- package/build/services/asg/gallerySettingsService.d.ts.map +1 -0
- package/build/services/asg/gallerySettingsService.js +53 -0
- package/build/services/asg/gallerySettingsService.js.map +1 -0
- package/build/services/asg/gallerySyncNotifications.d.ts +56 -0
- package/build/services/asg/gallerySyncNotifications.d.ts.map +1 -0
- package/build/services/asg/gallerySyncNotifications.js +198 -0
- package/build/services/asg/gallerySyncNotifications.js.map +1 -0
- package/build/services/asg/gallerySyncService.d.ts +137 -0
- package/build/services/asg/gallerySyncService.d.ts.map +1 -0
- package/build/services/asg/gallerySyncService.js +1945 -0
- package/build/services/asg/gallerySyncService.js.map +1 -0
- package/build/services/asg/galleryTransferLedger.d.ts +58 -0
- package/build/services/asg/galleryTransferLedger.d.ts.map +1 -0
- package/build/services/asg/galleryTransferLedger.js +225 -0
- package/build/services/asg/galleryTransferLedger.js.map +1 -0
- package/build/services/asg/localNetworkTransport.d.ts +15 -0
- package/build/services/asg/localNetworkTransport.d.ts.map +1 -0
- package/build/services/asg/localNetworkTransport.js +144 -0
- package/build/services/asg/localNetworkTransport.js.map +1 -0
- package/build/services/asg/localStorageService.d.ts +146 -0
- package/build/services/asg/localStorageService.d.ts.map +1 -0
- package/build/services/asg/localStorageService.js +572 -0
- package/build/services/asg/localStorageService.js.map +1 -0
- package/build/services/asg/mediaProcessingQueue.d.ts +70 -0
- package/build/services/asg/mediaProcessingQueue.d.ts.map +1 -0
- package/build/services/asg/mediaProcessingQueue.js +451 -0
- package/build/services/asg/mediaProcessingQueue.js.map +1 -0
- package/build/services/audioPlaybackAssets.d.ts +8 -0
- package/build/services/audioPlaybackAssets.d.ts.map +1 -0
- package/build/services/audioPlaybackAssets.js +7 -0
- package/build/services/audioPlaybackAssets.js.map +1 -0
- package/build/services/blobPaths.d.ts +31 -0
- package/build/services/blobPaths.d.ts.map +1 -0
- package/build/services/blobPaths.js +86 -0
- package/build/services/blobPaths.js.map +1 -0
- package/build/services/cloudStreamApi.d.ts +59 -0
- package/build/services/cloudStreamApi.d.ts.map +1 -0
- package/build/services/cloudStreamApi.js +81 -0
- package/build/services/cloudStreamApi.js.map +1 -0
- package/build/services/effectiveCapabilities.d.ts +8 -0
- package/build/services/effectiveCapabilities.d.ts.map +1 -0
- package/build/services/effectiveCapabilities.js +23 -0
- package/build/services/effectiveCapabilities.js.map +1 -0
- package/build/services/gallerySyncClock.d.ts +17 -0
- package/build/services/gallerySyncClock.d.ts.map +1 -0
- package/build/services/gallerySyncClock.js +21 -0
- package/build/services/gallerySyncClock.js.map +1 -0
- package/build/services/glassesClockSync.d.ts +20 -0
- package/build/services/glassesClockSync.d.ts.map +1 -0
- package/build/services/glassesClockSync.js +97 -0
- package/build/services/glassesClockSync.js.map +1 -0
- package/build/services/manifestActions.d.ts +31 -0
- package/build/services/manifestActions.d.ts.map +1 -0
- package/build/services/manifestActions.js +54 -0
- package/build/services/manifestActions.js.map +1 -0
- package/build/services/manifestVersionGate.d.ts +28 -0
- package/build/services/manifestVersionGate.d.ts.map +1 -0
- package/build/services/manifestVersionGate.js +41 -0
- package/build/services/manifestVersionGate.js.map +1 -0
- package/build/services/memoryStoreInstance.d.ts +19 -0
- package/build/services/memoryStoreInstance.d.ts.map +1 -0
- package/build/services/memoryStoreInstance.js +65 -0
- package/build/services/memoryStoreInstance.js.map +1 -0
- package/build/services/navigation/roadNameResolver.d.ts +67 -0
- package/build/services/navigation/roadNameResolver.d.ts.map +1 -0
- package/build/services/navigation/roadNameResolver.js +87 -0
- package/build/services/navigation/roadNameResolver.js.map +1 -0
- package/build/services/navigation/routesApiCodec.d.ts +38 -0
- package/build/services/navigation/routesApiCodec.d.ts.map +1 -0
- package/build/services/navigation/routesApiCodec.js +68 -0
- package/build/services/navigation/routesApiCodec.js.map +1 -0
- package/build/services/otaDisplayState.d.ts +53 -0
- package/build/services/otaDisplayState.d.ts.map +1 -0
- package/build/services/otaDisplayState.js +114 -0
- package/build/services/otaDisplayState.js.map +1 -0
- package/build/services/otaInstallPolicy.d.ts +93 -0
- package/build/services/otaInstallPolicy.d.ts.map +1 -0
- package/build/services/otaInstallPolicy.js +117 -0
- package/build/services/otaInstallPolicy.js.map +1 -0
- package/build/services/otaLegacyMapping.d.ts +22 -0
- package/build/services/otaLegacyMapping.d.ts.map +1 -0
- package/build/services/otaLegacyMapping.js +56 -0
- package/build/services/otaLegacyMapping.js.map +1 -0
- package/build/services/otaManifestUrl.d.ts +2 -0
- package/build/services/otaManifestUrl.d.ts.map +1 -0
- package/build/services/otaManifestUrl.js +46 -0
- package/build/services/otaManifestUrl.js.map +1 -0
- package/build/services/slimStreamStatus.d.ts +18 -0
- package/build/services/slimStreamStatus.d.ts.map +1 -0
- package/build/services/slimStreamStatus.js +36 -0
- package/build/services/slimStreamStatus.js.map +1 -0
- package/build/services/soniox/SonioxDirectService.d.ts +109 -0
- package/build/services/soniox/SonioxDirectService.d.ts.map +1 -0
- package/build/services/soniox/SonioxDirectService.js +449 -0
- package/build/services/soniox/SonioxDirectService.js.map +1 -0
- package/build/services/soniox/SonioxRealtimeClient.d.ts +121 -0
- package/build/services/soniox/SonioxRealtimeClient.d.ts.map +1 -0
- package/build/services/soniox/SonioxRealtimeClient.js +301 -0
- package/build/services/soniox/SonioxRealtimeClient.js.map +1 -0
- package/build/services/soniox/SonioxTokenAssembler.d.ts +98 -0
- package/build/services/soniox/SonioxTokenAssembler.d.ts.map +1 -0
- package/build/services/soniox/SonioxTokenAssembler.js +394 -0
- package/build/services/soniox/SonioxTokenAssembler.js.map +1 -0
- package/build/services/speakerProfileStoreInstance.d.ts +8 -0
- package/build/services/speakerProfileStoreInstance.d.ts.map +1 -0
- package/build/services/speakerProfileStoreInstance.js +24 -0
- package/build/services/speakerProfileStoreInstance.js.map +1 -0
- package/build/services/uiShim.d.ts +38 -0
- package/build/services/uiShim.d.ts.map +1 -0
- package/build/services/uiShim.js +369 -0
- package/build/services/uiShim.js.map +1 -0
- package/build/stores/apps.d.ts +104 -0
- package/build/stores/apps.d.ts.map +1 -0
- package/build/stores/apps.js +503 -0
- package/build/stores/apps.js.map +1 -0
- package/build/stores/bluetoothSettingKeys.d.ts +4 -0
- package/build/stores/bluetoothSettingKeys.d.ts.map +1 -0
- package/build/stores/bluetoothSettingKeys.js +33 -0
- package/build/stores/bluetoothSettingKeys.js.map +1 -0
- package/build/stores/cloudClientStatus.d.ts +9 -0
- package/build/stores/cloudClientStatus.d.ts.map +1 -0
- package/build/stores/cloudClientStatus.js +24 -0
- package/build/stores/cloudClientStatus.js.map +1 -0
- package/build/stores/connection.d.ts +22 -0
- package/build/stores/connection.d.ts.map +1 -0
- package/build/stores/connection.js +43 -0
- package/build/stores/connection.js.map +1 -0
- package/build/stores/core.d.ts +15 -0
- package/build/stores/core.d.ts.map +1 -0
- package/build/stores/core.js +21 -0
- package/build/stores/core.js.map +1 -0
- package/build/stores/display.d.ts +24 -0
- package/build/stores/display.d.ts.map +1 -0
- package/build/stores/display.js +96 -0
- package/build/stores/display.js.map +1 -0
- package/build/stores/gallerySync.d.ts +103 -0
- package/build/stores/gallerySync.d.ts.map +1 -0
- package/build/stores/gallerySync.js +219 -0
- package/build/stores/gallerySync.js.map +1 -0
- package/build/stores/glasses.d.ts +62 -0
- package/build/stores/glasses.d.ts.map +1 -0
- package/build/stores/glasses.js +208 -0
- package/build/stores/glasses.js.map +1 -0
- package/build/stores/settings.d.ts +54 -0
- package/build/stores/settings.d.ts.map +1 -0
- package/build/stores/settings.js +1200 -0
- package/build/stores/settings.js.map +1 -0
- package/build/stores/transcriptionDebug.d.ts +25 -0
- package/build/stores/transcriptionDebug.d.ts.map +1 -0
- package/build/stores/transcriptionDebug.js +0 -0
- package/build/stores/transcriptionDebug.js.map +1 -0
- package/build/types/applet.d.ts +101 -0
- package/build/types/applet.d.ts.map +1 -0
- package/build/types/applet.js +5 -0
- package/build/types/applet.js.map +1 -0
- package/build/types/asg.d.ts +53 -0
- package/build/types/asg.d.ts.map +1 -0
- package/build/types/asg.js +2 -0
- package/build/types/asg.js.map +1 -0
- package/build/types/capabilities/even-realities-g1.d.ts +12 -0
- package/build/types/capabilities/even-realities-g1.d.ts.map +1 -0
- package/build/types/capabilities/even-realities-g1.js +57 -0
- package/build/types/capabilities/even-realities-g1.js.map +1 -0
- package/build/types/capabilities/even-realities-g2.d.ts +12 -0
- package/build/types/capabilities/even-realities-g2.d.ts.map +1 -0
- package/build/types/capabilities/even-realities-g2.js +83 -0
- package/build/types/capabilities/even-realities-g2.js.map +1 -0
- package/build/types/capabilities/mentra-display.d.ts +12 -0
- package/build/types/capabilities/mentra-display.d.ts.map +1 -0
- package/build/types/capabilities/mentra-display.js +65 -0
- package/build/types/capabilities/mentra-display.js.map +1 -0
- package/build/types/capabilities/mentra-live.d.ts +12 -0
- package/build/types/capabilities/mentra-live.d.ts.map +1 -0
- package/build/types/capabilities/mentra-live.js +94 -0
- package/build/types/capabilities/mentra-live.js.map +1 -0
- package/build/types/capabilities/nimo.d.ts +13 -0
- package/build/types/capabilities/nimo.d.ts.map +1 -0
- package/build/types/capabilities/nimo.js +72 -0
- package/build/types/capabilities/nimo.js.map +1 -0
- package/build/types/capabilities/none.d.ts +13 -0
- package/build/types/capabilities/none.d.ts.map +1 -0
- package/build/types/capabilities/none.js +67 -0
- package/build/types/capabilities/none.js.map +1 -0
- package/build/types/capabilities/simulated-glasses.d.ts +13 -0
- package/build/types/capabilities/simulated-glasses.d.ts.map +1 -0
- package/build/types/capabilities/simulated-glasses.js +82 -0
- package/build/types/capabilities/simulated-glasses.js.map +1 -0
- package/build/types/capabilities/vuzix-z100.d.ts +12 -0
- package/build/types/capabilities/vuzix-z100.d.ts.map +1 -0
- package/build/types/capabilities/vuzix-z100.js +54 -0
- package/build/types/capabilities/vuzix-z100.js.map +1 -0
- package/build/types/enums.d.ts +22 -0
- package/build/types/enums.d.ts.map +1 -0
- package/build/types/enums.js +27 -0
- package/build/types/enums.js.map +1 -0
- package/build/types/hardware.d.ts +155 -0
- package/build/types/hardware.d.ts.map +1 -0
- package/build/types/hardware.js +52 -0
- package/build/types/hardware.js.map +1 -0
- package/build/types/index.d.ts +11 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/index.js +10 -0
- package/build/types/index.js.map +1 -0
- package/build/utils/GlobalEventEmitter.d.ts +11 -0
- package/build/utils/GlobalEventEmitter.d.ts.map +1 -0
- package/build/utils/GlobalEventEmitter.js +14 -0
- package/build/utils/GlobalEventEmitter.js.map +1 -0
- package/build/utils/cloudClient/RnUdpAdapter.d.ts +3 -0
- package/build/utils/cloudClient/RnUdpAdapter.d.ts.map +1 -0
- package/build/utils/cloudClient/RnUdpAdapter.js +41 -0
- package/build/utils/cloudClient/RnUdpAdapter.js.map +1 -0
- package/build/utils/cloudClient/cloudSecureStore.d.ts +3 -0
- package/build/utils/cloudClient/cloudSecureStore.d.ts.map +1 -0
- package/build/utils/cloudClient/cloudSecureStore.js +26 -0
- package/build/utils/cloudClient/cloudSecureStore.js.map +1 -0
- package/build/utils/configuredDevHost.d.ts +6 -0
- package/build/utils/configuredDevHost.d.ts.map +1 -0
- package/build/utils/configuredDevHost.js +19 -0
- package/build/utils/configuredDevHost.js.map +1 -0
- package/build/utils/debouncedPatch.d.ts +6 -0
- package/build/utils/debouncedPatch.d.ts.map +1 -0
- package/build/utils/debouncedPatch.js +25 -0
- package/build/utils/debouncedPatch.js.map +1 -0
- package/build/utils/devLogging.d.ts +26 -0
- package/build/utils/devLogging.d.ts.map +1 -0
- package/build/utils/devLogging.js +116 -0
- package/build/utils/devLogging.js.map +1 -0
- package/build/utils/devMiniappLaunch.d.ts +55 -0
- package/build/utils/devMiniappLaunch.d.ts.map +1 -0
- package/build/utils/devMiniappLaunch.js +175 -0
- package/build/utils/devMiniappLaunch.js.map +1 -0
- package/build/utils/diagnosticContext.d.ts +3 -0
- package/build/utils/diagnosticContext.d.ts.map +1 -0
- package/build/utils/diagnosticContext.js +122 -0
- package/build/utils/diagnosticContext.js.map +1 -0
- package/build/utils/display/composer/ColumnComposer.d.ts +131 -0
- package/build/utils/display/composer/ColumnComposer.d.ts.map +1 -0
- package/build/utils/display/composer/ColumnComposer.js +204 -0
- package/build/utils/display/composer/ColumnComposer.js.map +1 -0
- package/build/utils/display/composer/index.d.ts +9 -0
- package/build/utils/display/composer/index.d.ts.map +1 -0
- package/build/utils/display/composer/index.js +9 -0
- package/build/utils/display/composer/index.js.map +1 -0
- package/build/utils/display/helpers/DisplayHelpers.d.ts +165 -0
- package/build/utils/display/helpers/DisplayHelpers.d.ts.map +1 -0
- package/build/utils/display/helpers/DisplayHelpers.js +312 -0
- package/build/utils/display/helpers/DisplayHelpers.js.map +1 -0
- package/build/utils/display/helpers/ScrollView.d.ts +183 -0
- package/build/utils/display/helpers/ScrollView.d.ts.map +1 -0
- package/build/utils/display/helpers/ScrollView.js +257 -0
- package/build/utils/display/helpers/ScrollView.js.map +1 -0
- package/build/utils/display/helpers/index.d.ts +11 -0
- package/build/utils/display/helpers/index.d.ts.map +1 -0
- package/build/utils/display/helpers/index.js +10 -0
- package/build/utils/display/helpers/index.js.map +1 -0
- package/build/utils/display/index.d.ts +174 -0
- package/build/utils/display/index.d.ts.map +1 -0
- package/build/utils/display/index.js +188 -0
- package/build/utils/display/index.js.map +1 -0
- package/build/utils/display/measurer/TextMeasurer.d.ts +160 -0
- package/build/utils/display/measurer/TextMeasurer.d.ts.map +1 -0
- package/build/utils/display/measurer/TextMeasurer.js +273 -0
- package/build/utils/display/measurer/TextMeasurer.js.map +1 -0
- package/build/utils/display/measurer/index.d.ts +10 -0
- package/build/utils/display/measurer/index.d.ts.map +1 -0
- package/build/utils/display/measurer/index.js +11 -0
- package/build/utils/display/measurer/index.js.map +1 -0
- package/build/utils/display/measurer/script-detection.d.ts +53 -0
- package/build/utils/display/measurer/script-detection.d.ts.map +1 -0
- package/build/utils/display/measurer/script-detection.js +184 -0
- package/build/utils/display/measurer/script-detection.js.map +1 -0
- package/build/utils/display/profiles/g1.d.ts +33 -0
- package/build/utils/display/profiles/g1.d.ts.map +1 -0
- package/build/utils/display/profiles/g1.js +213 -0
- package/build/utils/display/profiles/g1.js.map +1 -0
- package/build/utils/display/profiles/g2.d.ts +13 -0
- package/build/utils/display/profiles/g2.d.ts.map +1 -0
- package/build/utils/display/profiles/g2.js +34 -0
- package/build/utils/display/profiles/g2.js.map +1 -0
- package/build/utils/display/profiles/index.d.ts +12 -0
- package/build/utils/display/profiles/index.d.ts.map +1 -0
- package/build/utils/display/profiles/index.js +15 -0
- package/build/utils/display/profiles/index.js.map +1 -0
- package/build/utils/display/profiles/nex.d.ts +10 -0
- package/build/utils/display/profiles/nex.d.ts.map +1 -0
- package/build/utils/display/profiles/nex.js +150 -0
- package/build/utils/display/profiles/nex.js.map +1 -0
- package/build/utils/display/profiles/types.d.ts +103 -0
- package/build/utils/display/profiles/types.d.ts.map +1 -0
- package/build/utils/display/profiles/types.js +2 -0
- package/build/utils/display/profiles/types.js.map +1 -0
- package/build/utils/display/profiles/z100.d.ts +33 -0
- package/build/utils/display/profiles/z100.d.ts.map +1 -0
- package/build/utils/display/profiles/z100.js +182 -0
- package/build/utils/display/profiles/z100.js.map +1 -0
- package/build/utils/display/scene/anchor.d.ts +17 -0
- package/build/utils/display/scene/anchor.d.ts.map +1 -0
- package/build/utils/display/scene/anchor.js +33 -0
- package/build/utils/display/scene/anchor.js.map +1 -0
- package/build/utils/display/scene/degrade.d.ts +25 -0
- package/build/utils/display/scene/degrade.d.ts.map +1 -0
- package/build/utils/display/scene/degrade.js +64 -0
- package/build/utils/display/scene/degrade.js.map +1 -0
- package/build/utils/display/scene/differ.d.ts +38 -0
- package/build/utils/display/scene/differ.d.ts.map +1 -0
- package/build/utils/display/scene/differ.js +107 -0
- package/build/utils/display/scene/differ.js.map +1 -0
- package/build/utils/display/scene/index.d.ts +11 -0
- package/build/utils/display/scene/index.d.ts.map +1 -0
- package/build/utils/display/scene/index.js +7 -0
- package/build/utils/display/scene/index.js.map +1 -0
- package/build/utils/display/scene/process.d.ts +35 -0
- package/build/utils/display/scene/process.d.ts.map +1 -0
- package/build/utils/display/scene/process.js +201 -0
- package/build/utils/display/scene/process.js.map +1 -0
- package/build/utils/display/scene/store.d.ts +48 -0
- package/build/utils/display/scene/store.d.ts.map +1 -0
- package/build/utils/display/scene/store.js +0 -0
- package/build/utils/display/scene/store.js.map +1 -0
- package/build/utils/display/scene/types.d.ts +139 -0
- package/build/utils/display/scene/types.d.ts.map +1 -0
- package/build/utils/display/scene/types.js +0 -0
- package/build/utils/display/scene/types.js.map +1 -0
- package/build/utils/display/wrapper/TextWrapper.d.ts +102 -0
- package/build/utils/display/wrapper/TextWrapper.d.ts.map +1 -0
- package/build/utils/display/wrapper/TextWrapper.js +471 -0
- package/build/utils/display/wrapper/TextWrapper.js.map +1 -0
- package/build/utils/display/wrapper/index.d.ts +12 -0
- package/build/utils/display/wrapper/index.d.ts.map +1 -0
- package/build/utils/display/wrapper/index.js +12 -0
- package/build/utils/display/wrapper/index.js.map +1 -0
- package/build/utils/display/wrapper/types.d.ts +75 -0
- package/build/utils/display/wrapper/types.d.ts.map +1 -0
- package/build/utils/display/wrapper/types.js +11 -0
- package/build/utils/display/wrapper/types.js.map +1 -0
- package/build/utils/e2eMetrics.d.ts +6 -0
- package/build/utils/e2eMetrics.d.ts.map +1 -0
- package/build/utils/e2eMetrics.js +27 -0
- package/build/utils/e2eMetrics.js.map +1 -0
- package/build/utils/hardware/hardware.d.ts +42 -0
- package/build/utils/hardware/hardware.d.ts.map +1 -0
- package/build/utils/hardware/hardware.js +131 -0
- package/build/utils/hardware/hardware.js.map +1 -0
- package/build/utils/hardware/index.d.ts +2 -0
- package/build/utils/hardware/index.d.ts.map +1 -0
- package/build/utils/hardware/index.js +2 -0
- package/build/utils/hardware/index.js.map +1 -0
- package/build/utils/memory/search.d.ts +72 -0
- package/build/utils/memory/search.d.ts.map +1 -0
- package/build/utils/memory/search.js +178 -0
- package/build/utils/memory/search.js.map +1 -0
- package/build/utils/miniappDiagnostics.d.ts +64 -0
- package/build/utils/miniappDiagnostics.d.ts.map +1 -0
- package/build/utils/miniappDiagnostics.js +173 -0
- package/build/utils/miniappDiagnostics.js.map +1 -0
- package/build/utils/miniappGlobals.d.ts +59 -0
- package/build/utils/miniappGlobals.d.ts.map +1 -0
- package/build/utils/miniappGlobals.js +223 -0
- package/build/utils/miniappGlobals.js.map +1 -0
- package/build/utils/permissions/MediaLibraryPermissions.d.ts +45 -0
- package/build/utils/permissions/MediaLibraryPermissions.d.ts.map +1 -0
- package/build/utils/permissions/MediaLibraryPermissions.js +145 -0
- package/build/utils/permissions/MediaLibraryPermissions.js.map +1 -0
- package/build/utils/permissions/galleryDisplayName.d.ts +8 -0
- package/build/utils/permissions/galleryDisplayName.d.ts.map +1 -0
- package/build/utils/permissions/galleryDisplayName.js +25 -0
- package/build/utils/permissions/galleryDisplayName.js.map +1 -0
- package/build/utils/speakerEmbedding.d.ts +8 -0
- package/build/utils/speakerEmbedding.d.ts.map +1 -0
- package/build/utils/speakerEmbedding.js +63 -0
- package/build/utils/speakerEmbedding.js.map +1 -0
- package/build/utils/storage/index.d.ts +3 -0
- package/build/utils/storage/index.d.ts.map +1 -0
- package/build/utils/storage/index.js +3 -0
- package/build/utils/storage/index.js.map +1 -0
- package/build/utils/storage/storage.d.ts +24 -0
- package/build/utils/storage/storage.d.ts.map +1 -0
- package/build/utils/storage/storage.js +85 -0
- package/build/utils/storage/storage.js.map +1 -0
- package/build/utils/storage/zip.d.ts +3 -0
- package/build/utils/storage/zip.d.ts.map +1 -0
- package/build/utils/storage/zip.js +14 -0
- package/build/utils/storage/zip.js.map +1 -0
- package/build/utils/timers/index.d.ts +3 -0
- package/build/utils/timers/index.d.ts.map +1 -0
- package/build/utils/timers/index.js +3 -0
- package/build/utils/timers/index.js.map +1 -0
- package/build/utils/timers/timers.d.ts +9 -0
- package/build/utils/timers/timers.d.ts.map +1 -0
- package/build/utils/timers/timers.js +142 -0
- package/build/utils/timers/timers.js.map +1 -0
- package/package.json +122 -0
- package/src/assets/silence.wav +0 -0
- package/src/devtools.ts +13 -0
- package/src/engine.ts +198 -0
- package/src/facades/dev.ts +213 -0
- package/src/facades/display.ts +17 -0
- package/src/facades/displayMirror.ts +33 -0
- package/src/facades/gallery.ts +69 -0
- package/src/facades/glasses.ts +219 -0
- package/src/facades/glassesSettings.ts +57 -0
- package/src/facades/glassesWifi.ts +68 -0
- package/src/facades/maps.ts +13 -0
- package/src/facades/memory.ts +46 -0
- package/src/facades/miniapps.ts +62 -0
- package/src/facades/notifications.ts +14 -0
- package/src/facades/ota.ts +177 -0
- package/src/facades/pairing.ts +329 -0
- package/src/facades/permissions.ts +165 -0
- package/src/facades/phoneNotifications.ts +41 -0
- package/src/facades/providerKeys.ts +31 -0
- package/src/facades/reports.ts +180 -0
- package/src/facades/session.ts +54 -0
- package/src/facades/settings.ts +57 -0
- package/src/facades/speakers.ts +152 -0
- package/src/facades/speech.ts +49 -0
- package/src/index.ts +214 -0
- package/src/internal.ts +155 -0
- package/src/runtime/bootstrap.ts +159 -0
- package/src/runtime/config.ts +155 -0
- package/src/runtime/scanQrSeam.ts +20 -0
- package/src/runtime/streamConfig.ts +34 -0
- package/src/services/AiTierResolution.ts +106 -0
- package/src/services/AppRegistry.ts +1245 -0
- package/src/services/AudioCloudUplink.ts +56 -0
- package/src/services/AudioPlaybackService.ts +873 -0
- package/src/services/AutomaticReportResult.ts +50 -0
- package/src/services/BlobStore.ts +823 -0
- package/src/services/CaptionsTesterReportService.ts +107 -0
- package/src/services/CloudAudioSubscriptionSync.ts +53 -0
- package/src/services/CloudClientService.ts +1031 -0
- package/src/services/CloudTranscriptE2EMetrics.ts +27 -0
- package/src/services/ConnectionCoordinator.ts +65 -0
- package/src/services/DevServerBridge.ts +334 -0
- package/src/services/DeviceEventRouter.ts +266 -0
- package/src/services/DeviceStoreHydration.ts +130 -0
- package/src/services/DisplayProcessor.ts +775 -0
- package/src/services/ForegroundLocationPermission.ts +24 -0
- package/src/services/GlassesReadiness.ts +103 -0
- package/src/services/GlassesSettingsSync.ts +140 -0
- package/src/services/GlassesStatusProjection.ts +73 -0
- package/src/services/HeadingService.ts +122 -0
- package/src/services/HotspotOtaTransport.ts +184 -0
- package/src/services/HotspotShutdown.ts +41 -0
- package/src/services/JSCrashController.ts +189 -0
- package/src/services/JSCrashloopReportService.ts +66 -0
- package/src/services/JSLogPipeline.ts +166 -0
- package/src/services/JSRouter.ts +555 -0
- package/src/services/LocalDisplayManager.ts +815 -0
- package/src/services/LocalMiniappDataMigration.ts +102 -0
- package/src/services/LocalMiniappRuntime.ts +5747 -0
- package/src/services/LocalMiniappStorage.ts +82 -0
- package/src/services/LocalMiniappUserIdentity.ts +79 -0
- package/src/services/LocalSttFallbackCoordinator.ts +247 -0
- package/src/services/MapboxTokenService.ts +118 -0
- package/src/services/MemoryCapture.ts +61 -0
- package/src/services/MemoryStore.ts +633 -0
- package/src/services/MicStateCoordinator.ts +259 -0
- package/src/services/MiniappEngine.ts +143 -0
- package/src/services/MiniappLauncher.ts +365 -0
- package/src/services/MiniappLiveness.ts +24 -0
- package/src/services/MiniappRunningRegistry.ts +57 -0
- package/src/services/NativeHttpResponse.ts +6 -0
- package/src/services/NativeNavigationService.ts +176 -0
- package/src/services/NavigationHandlers.ts +527 -0
- package/src/services/NavigationService.ts +926 -0
- package/src/services/NotificationsEmitter.ts +49 -0
- package/src/services/OfflineSpeechModelService.ts +168 -0
- package/src/services/OtaArtifactDownloader.ts +312 -0
- package/src/services/OtaInstallCoordinator.ts +1707 -0
- package/src/services/OtaService.ts +89 -0
- package/src/services/OtaUpdateCheckService.ts +550 -0
- package/src/services/PairingIdentity.ts +154 -0
- package/src/services/PhoneCalendarHelpers.ts +212 -0
- package/src/services/PhoneCalendarService.ts +61 -0
- package/src/services/PhoneCameraFovCoordinator.ts +210 -0
- package/src/services/PhoneLocationService.ts +120 -0
- package/src/services/PhoneNotificationsSync.ts +46 -0
- package/src/services/PhonePhotoCoordinator.ts +435 -0
- package/src/services/PhoneStreamCoordinator.ts +874 -0
- package/src/services/PhoneVideoCoordinator.ts +203 -0
- package/src/services/ProviderKeyValidation.ts +57 -0
- package/src/services/STTModelManager.ts +434 -0
- package/src/services/SceneRenderer.ts +320 -0
- package/src/services/SentenceTtsPipeline.ts +106 -0
- package/src/services/SpeakerIdModelManager.ts +151 -0
- package/src/services/SpeakerIdSync.ts +79 -0
- package/src/services/SpeakerLabelResolver.ts +140 -0
- package/src/services/SpeakerProfileStore.ts +265 -0
- package/src/services/SpeakerSegmentResolver.ts +194 -0
- package/src/services/StreamLifecycleController.ts +203 -0
- package/src/services/SupportProfileSync.ts +218 -0
- package/src/services/TTSModelManager.ts +466 -0
- package/src/services/TranscriptionRouting.ts +47 -0
- package/src/services/TtsTextSanitizer.ts +66 -0
- package/src/services/UIRouter.ts +250 -0
- package/src/services/WebviewBridge.ts +50 -0
- package/src/services/WifiAdbRequest.ts +53 -0
- package/src/services/asg/GalleryMediaIntegrityReportService.ts +72 -0
- package/src/services/asg/asgCameraApi.ts +1786 -0
- package/src/services/asg/cameraRollExportCoordinator.ts +627 -0
- package/src/services/asg/cameraRollExportLedger.ts +122 -0
- package/src/services/asg/galleryMediaValidation.ts +185 -0
- package/src/services/asg/galleryNotices.ts +61 -0
- package/src/services/asg/galleryPathMigration.ts +22 -0
- package/src/services/asg/gallerySettingsService.ts +68 -0
- package/src/services/asg/gallerySyncNotifications.ts +235 -0
- package/src/services/asg/gallerySyncService.ts +2278 -0
- package/src/services/asg/galleryTransferLedger.ts +312 -0
- package/src/services/asg/localNetworkTransport.ts +169 -0
- package/src/services/asg/localStorageService.ts +652 -0
- package/src/services/asg/mediaProcessingQueue.ts +518 -0
- package/src/services/audioPlaybackAssets.ts +8 -0
- package/src/services/blobPaths.ts +86 -0
- package/src/services/cloudStreamApi.ts +142 -0
- package/src/services/effectiveCapabilities.ts +27 -0
- package/src/services/gallerySyncClock.ts +39 -0
- package/src/services/glassesClockSync.ts +115 -0
- package/src/services/manifestActions.ts +80 -0
- package/src/services/manifestVersionGate.ts +43 -0
- package/src/services/memoryStoreInstance.ts +70 -0
- package/src/services/navigation/roadNameResolver.ts +103 -0
- package/src/services/navigation/routesApiCodec.ts +69 -0
- package/src/services/otaDisplayState.ts +156 -0
- package/src/services/otaInstallPolicy.ts +132 -0
- package/src/services/otaLegacyMapping.ts +71 -0
- package/src/services/otaManifestUrl.ts +53 -0
- package/src/services/slimStreamStatus.ts +39 -0
- package/src/services/soniox/SonioxDirectService.ts +517 -0
- package/src/services/soniox/SonioxRealtimeClient.ts +349 -0
- package/src/services/soniox/SonioxTokenAssembler.ts +451 -0
- package/src/services/speakerProfileStoreInstance.ts +25 -0
- package/src/services/uiShim.ts +375 -0
- package/src/stores/apps.ts +626 -0
- package/src/stores/bluetoothSettingKeys.ts +35 -0
- package/src/stores/cloudClientStatus.ts +37 -0
- package/src/stores/connection.ts +69 -0
- package/src/stores/core.ts +32 -0
- package/src/stores/display.ts +121 -0
- package/src/stores/gallerySync.ts +384 -0
- package/src/stores/glasses.ts +314 -0
- package/src/stores/settings.ts +1299 -0
- package/src/stores/transcriptionDebug.ts +0 -0
- package/src/types/applet.ts +121 -0
- package/src/types/asg.ts +58 -0
- package/src/types/capabilities/even-realities-g1.ts +70 -0
- package/src/types/capabilities/even-realities-g2.ts +98 -0
- package/src/types/capabilities/mentra-display.ts +78 -0
- package/src/types/capabilities/mentra-live.ts +106 -0
- package/src/types/capabilities/nimo.ts +84 -0
- package/src/types/capabilities/none.ts +79 -0
- package/src/types/capabilities/simulated-glasses.ts +95 -0
- package/src/types/capabilities/vuzix-z100.ts +67 -0
- package/src/types/enums.ts +27 -0
- package/src/types/hardware.ts +220 -0
- package/src/types/index.ts +38 -0
- package/src/utils/GlobalEventEmitter.ts +15 -0
- package/src/utils/cloudClient/RnUdpAdapter.ts +47 -0
- package/src/utils/cloudClient/cloudSecureStore.ts +28 -0
- package/src/utils/configuredDevHost.ts +17 -0
- package/src/utils/debouncedPatch.ts +28 -0
- package/src/utils/devLogging.ts +140 -0
- package/src/utils/devMiniappLaunch.ts +196 -0
- package/src/utils/diagnosticContext.ts +159 -0
- package/src/utils/display/composer/ColumnComposer.ts +285 -0
- package/src/utils/display/composer/index.ts +15 -0
- package/src/utils/display/helpers/DisplayHelpers.ts +409 -0
- package/src/utils/display/helpers/ScrollView.ts +326 -0
- package/src/utils/display/helpers/index.ts +14 -0
- package/src/utils/display/index.ts +273 -0
- package/src/utils/display/measurer/TextMeasurer.ts +346 -0
- package/src/utils/display/measurer/index.ts +21 -0
- package/src/utils/display/measurer/script-detection.ts +218 -0
- package/src/utils/display/profiles/g1.ts +236 -0
- package/src/utils/display/profiles/g2.ts +39 -0
- package/src/utils/display/profiles/index.ts +28 -0
- package/src/utils/display/profiles/nex.ts +166 -0
- package/src/utils/display/profiles/types.ts +132 -0
- package/src/utils/display/profiles/z100.ts +198 -0
- package/src/utils/display/scene/anchor.ts +39 -0
- package/src/utils/display/scene/degrade.ts +80 -0
- package/src/utils/display/scene/differ.ts +128 -0
- package/src/utils/display/scene/index.ts +24 -0
- package/src/utils/display/scene/process.ts +228 -0
- package/src/utils/display/scene/store.ts +0 -0
- package/src/utils/display/scene/types.ts +0 -0
- package/src/utils/display/wrapper/TextWrapper.ts +546 -0
- package/src/utils/display/wrapper/index.ts +15 -0
- package/src/utils/display/wrapper/types.ts +102 -0
- package/src/utils/e2eMetrics.ts +30 -0
- package/src/utils/hardware/hardware.ts +171 -0
- package/src/utils/hardware/index.ts +1 -0
- package/src/utils/memory/search.ts +204 -0
- package/src/utils/miniappDiagnostics.ts +226 -0
- package/src/utils/miniappGlobals.ts +259 -0
- package/src/utils/permissions/MediaLibraryPermissions.ts +161 -0
- package/src/utils/permissions/galleryDisplayName.ts +28 -0
- package/src/utils/speakerEmbedding.ts +58 -0
- package/src/utils/storage/index.ts +2 -0
- package/src/utils/storage/storage.ts +101 -0
- package/src/utils/storage/zip.ts +13 -0
- package/src/utils/timers/index.ts +2 -0
- package/src/utils/timers/timers.ts +175 -0
|
@@ -0,0 +1,541 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MemoryStore — the user's shared, phone-local memory timeline.
|
|
3
|
+
*
|
|
4
|
+
* One unified per-hour stream of what happened around the user — spoken
|
|
5
|
+
* transcript lines AND notes (manual, voice, auto) in one timeline — plus the
|
|
6
|
+
* hourly conversation summary that heads each session. Scoped to the Glassly
|
|
7
|
+
* USER (not to a miniapp): every miniapp that declares the MEMORY manifest
|
|
8
|
+
* permission reads and writes the same store through LocalMiniappRuntime's
|
|
9
|
+
* MEMORY_* handlers, and Settings > Memory manages it via engine.memory.
|
|
10
|
+
*
|
|
11
|
+
* A "session" is one clock hour that has entries, derived from entry
|
|
12
|
+
* timestamps at read time — nothing is stored per-session, so there is no
|
|
13
|
+
* session id to keep in sync.
|
|
14
|
+
*
|
|
15
|
+
* The store began life inside the Assist miniapp (its SessionStore); on first
|
|
16
|
+
* load it migrates Assist's per-app storage namespace into the shared
|
|
17
|
+
* user-scoped keys so existing history survives the move.
|
|
18
|
+
*/
|
|
19
|
+
import { searchMemoryEntries } from "../utils/memory/search";
|
|
20
|
+
const KEY_ROOT = "memory_";
|
|
21
|
+
const LOG_SUFFIX = "log";
|
|
22
|
+
const SUMMARY_SUFFIX = "summaries";
|
|
23
|
+
/** The pre-memory-layer Assist miniapp whose storage namespace we migrate. */
|
|
24
|
+
const LEGACY_ASSIST_PACKAGE = "com.tetramo.assistant";
|
|
25
|
+
const LEGACY_STORAGE_ROOT = "localstorage_";
|
|
26
|
+
const LEGACY_LOG_KEY = "assistant:session-log";
|
|
27
|
+
const LEGACY_SUMMARY_KEY = "assistant:hourly-summaries";
|
|
28
|
+
// Assist's own pre-unification keys, migrated for users who never ran the
|
|
29
|
+
// unified-schema Assist build.
|
|
30
|
+
const LEGACY_TRANSCRIPT_KEY = "assistant:transcript-log";
|
|
31
|
+
const LEGACY_NOTES_KEY = "assistant:notes";
|
|
32
|
+
const HOUR_MS = 60 * 60 * 1000;
|
|
33
|
+
const DAY_MS = 24 * HOUR_MS;
|
|
34
|
+
/** Free-tier visibility: a 14-day rolling window. */
|
|
35
|
+
export const STANDARD_RETENTION = {
|
|
36
|
+
maxAgeMs: 14 * DAY_MS,
|
|
37
|
+
maxEntries: 4000,
|
|
38
|
+
maxSummaries: 24 * 14,
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Plus/Pro visibility — and the store's PHYSICAL bounds for every tier. The
|
|
42
|
+
* entry cap also bounds the write cost — every persist re-serializes the
|
|
43
|
+
* whole timeline, so this cap is a perf ceiling as much as a product number.
|
|
44
|
+
*/
|
|
45
|
+
export const EXTENDED_RETENTION = {
|
|
46
|
+
maxAgeMs: 180 * DAY_MS,
|
|
47
|
+
maxEntries: 24_000,
|
|
48
|
+
maxSummaries: 24 * 180,
|
|
49
|
+
};
|
|
50
|
+
const QUERY_LIMIT_CAP = 200;
|
|
51
|
+
const QUERY_LIMIT_DEFAULT = 60;
|
|
52
|
+
/**
|
|
53
|
+
* How long transcript appends coalesce before hitting disk. Each write
|
|
54
|
+
* re-serializes the entire timeline, so at conversational pace (a final
|
|
55
|
+
* utterance every few seconds) this turns O(n) work per line into O(n) per
|
|
56
|
+
* window. Short enough that an unexpected kill loses only the last few lines.
|
|
57
|
+
*/
|
|
58
|
+
const DEFAULT_WRITE_DEBOUNCE_MS = 3000;
|
|
59
|
+
export function hourStartOf(ms) {
|
|
60
|
+
return Math.floor(ms / HOUR_MS) * HOUR_MS;
|
|
61
|
+
}
|
|
62
|
+
export function dayStartOf(ms) {
|
|
63
|
+
const d = new Date(ms);
|
|
64
|
+
d.setHours(0, 0, 0, 0);
|
|
65
|
+
return d.getTime();
|
|
66
|
+
}
|
|
67
|
+
function makeId() {
|
|
68
|
+
return `e-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
69
|
+
}
|
|
70
|
+
export class MemoryStore {
|
|
71
|
+
hooks;
|
|
72
|
+
entries = [];
|
|
73
|
+
summaries = [];
|
|
74
|
+
/** User the in-memory cache was loaded for; reload when identity changes. */
|
|
75
|
+
loadedUserId = null;
|
|
76
|
+
loadPromise = null;
|
|
77
|
+
changeListeners = new Set();
|
|
78
|
+
/** Pending debounced log write (transcript appends), if any. */
|
|
79
|
+
logFlushTimer = null;
|
|
80
|
+
logDirty = false;
|
|
81
|
+
constructor(hooks) {
|
|
82
|
+
this.hooks = hooks;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Write any debounced changes out now. Call before the app backgrounds or
|
|
86
|
+
* terminates so a crash can't lose the coalesced tail of the timeline.
|
|
87
|
+
*/
|
|
88
|
+
async flush() {
|
|
89
|
+
if (this.logFlushTimer) {
|
|
90
|
+
clearTimeout(this.logFlushTimer);
|
|
91
|
+
this.logFlushTimer = null;
|
|
92
|
+
}
|
|
93
|
+
if (this.logDirty)
|
|
94
|
+
await this.persistLog();
|
|
95
|
+
}
|
|
96
|
+
/** Subscribe to mutations (adds, edits, deletes, clears). */
|
|
97
|
+
onChanged(listener) {
|
|
98
|
+
this.changeListeners.add(listener);
|
|
99
|
+
return () => this.changeListeners.delete(listener);
|
|
100
|
+
}
|
|
101
|
+
// === Writes ===
|
|
102
|
+
async appendLine(input) {
|
|
103
|
+
if (!input.text.trim())
|
|
104
|
+
return;
|
|
105
|
+
await this.ensureLoaded();
|
|
106
|
+
this.entries.push({
|
|
107
|
+
id: makeId(),
|
|
108
|
+
kind: "line",
|
|
109
|
+
text: input.text.trim(),
|
|
110
|
+
at: input.at,
|
|
111
|
+
speakerId: input.speakerId,
|
|
112
|
+
...(input.resolvedSpeakerName ? { resolvedSpeakerName: input.resolvedSpeakerName } : {}),
|
|
113
|
+
language: input.language,
|
|
114
|
+
});
|
|
115
|
+
this.prune();
|
|
116
|
+
// Transcript lines are the hot path (one per final utterance) and each
|
|
117
|
+
// persist re-serializes the whole timeline, so coalesce them. Everything
|
|
118
|
+
// else — notes, edits, deletes, summaries — still writes through
|
|
119
|
+
// immediately; those are user-visible and rare.
|
|
120
|
+
this.schedulePersistLog();
|
|
121
|
+
this.emitChanged();
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Add a note. `at` targets the hour it belongs to — pass a timestamp inside
|
|
125
|
+
* a past hour to append to that session. Dedupes on normalized text within
|
|
126
|
+
* the same hour (auto-notes re-extract); resolves null on duplicate/empty.
|
|
127
|
+
*/
|
|
128
|
+
async addNote(text, source, at = Date.now()) {
|
|
129
|
+
const body = text.trim();
|
|
130
|
+
if (!body)
|
|
131
|
+
return null;
|
|
132
|
+
await this.ensureLoaded();
|
|
133
|
+
const hour = hourStartOf(at);
|
|
134
|
+
const key = normalize(body);
|
|
135
|
+
if (this.entries.some((e) => e.kind === "note" && hourStartOf(e.at) === hour && normalize(e.text) === key)) {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
const entry = { id: makeId(), kind: "note", text: body, at, speakerId: null, language: null, source };
|
|
139
|
+
this.entries.push(entry);
|
|
140
|
+
this.entries.sort((a, b) => a.at - b.at);
|
|
141
|
+
this.prune();
|
|
142
|
+
await this.persistLog();
|
|
143
|
+
this.emitChanged();
|
|
144
|
+
return entry;
|
|
145
|
+
}
|
|
146
|
+
/** Rewrite a note's text in place (Settings > Memory edit). */
|
|
147
|
+
async updateNote(id, text) {
|
|
148
|
+
const body = text.trim();
|
|
149
|
+
if (!body)
|
|
150
|
+
return false;
|
|
151
|
+
await this.ensureLoaded();
|
|
152
|
+
const entry = this.entries.find((e) => e.id === id && e.kind === "note");
|
|
153
|
+
if (!entry)
|
|
154
|
+
return false;
|
|
155
|
+
entry.text = body;
|
|
156
|
+
await this.persistLog();
|
|
157
|
+
this.emitChanged();
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
160
|
+
async removeEntry(id) {
|
|
161
|
+
await this.ensureLoaded();
|
|
162
|
+
const before = this.entries.length;
|
|
163
|
+
this.entries = this.entries.filter((e) => e.id !== id);
|
|
164
|
+
if (this.entries.length === before)
|
|
165
|
+
return false;
|
|
166
|
+
await this.persistLog();
|
|
167
|
+
this.emitChanged();
|
|
168
|
+
return true;
|
|
169
|
+
}
|
|
170
|
+
/** Delete every entry (and summary) in an hour, or a whole day of hours. */
|
|
171
|
+
async removeScope(scope, at) {
|
|
172
|
+
await this.ensureLoaded();
|
|
173
|
+
const inScope = scope === "day"
|
|
174
|
+
? (ms) => dayStartOf(ms) === dayStartOf(at)
|
|
175
|
+
: (ms) => hourStartOf(ms) === hourStartOf(at);
|
|
176
|
+
this.entries = this.entries.filter((e) => !inScope(e.at));
|
|
177
|
+
this.summaries = this.summaries.filter((s) => !inScope(s.hourStart));
|
|
178
|
+
await this.persistLog();
|
|
179
|
+
await this.persistSummaries();
|
|
180
|
+
this.emitChanged();
|
|
181
|
+
}
|
|
182
|
+
/** Drop the entire timeline: every entry and every summary. */
|
|
183
|
+
async clear() {
|
|
184
|
+
await this.ensureLoaded();
|
|
185
|
+
this.entries = [];
|
|
186
|
+
this.summaries = [];
|
|
187
|
+
await this.persistLog();
|
|
188
|
+
await this.persistSummaries();
|
|
189
|
+
this.emitChanged();
|
|
190
|
+
}
|
|
191
|
+
async addSummary(summary) {
|
|
192
|
+
await this.ensureLoaded();
|
|
193
|
+
const { maxSummaries } = EXTENDED_RETENTION;
|
|
194
|
+
this.summaries = this.summaries.filter((s) => s.hourStart !== summary.hourStart);
|
|
195
|
+
this.summaries.push(summary);
|
|
196
|
+
if (this.summaries.length > maxSummaries) {
|
|
197
|
+
this.summaries = this.summaries.sort((a, b) => a.hourStart - b.hourStart).slice(-maxSummaries);
|
|
198
|
+
}
|
|
199
|
+
await this.persistSummaries();
|
|
200
|
+
this.emitChanged();
|
|
201
|
+
}
|
|
202
|
+
// === Reads ===
|
|
203
|
+
//
|
|
204
|
+
// Every read goes through the VISIBLE view: entries inside the active
|
|
205
|
+
// tier's window. Older data may still be stored (see prune) — it is frozen,
|
|
206
|
+
// not deleted, so an upgrade widens these views instantly.
|
|
207
|
+
/** Entries in [sinceMs, untilMs), newest last. */
|
|
208
|
+
async window(sinceMs, untilMs = Date.now()) {
|
|
209
|
+
await this.ensureLoaded();
|
|
210
|
+
return this.visibleEntries().filter((e) => e.at >= sinceMs && e.at < untilMs);
|
|
211
|
+
}
|
|
212
|
+
/** All note entries, newest first (Settings > Memory list). */
|
|
213
|
+
async notes() {
|
|
214
|
+
await this.ensureLoaded();
|
|
215
|
+
return this.visibleEntries()
|
|
216
|
+
.filter((e) => e.kind === "note")
|
|
217
|
+
.sort((a, b) => b.at - a.at);
|
|
218
|
+
}
|
|
219
|
+
async stats() {
|
|
220
|
+
await this.ensureLoaded();
|
|
221
|
+
const visible = this.visibleEntries();
|
|
222
|
+
const noteCount = visible.filter((e) => e.kind === "note").length;
|
|
223
|
+
return {
|
|
224
|
+
entryCount: visible.length,
|
|
225
|
+
lineCount: visible.length - noteCount,
|
|
226
|
+
noteCount,
|
|
227
|
+
summaryCount: this.visibleSummaries().filter((s) => s.text.trim()).length,
|
|
228
|
+
oldestAt: visible.length > 0 ? visible[0].at : null,
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
/** All sessions (hours with entries), newest hour first. */
|
|
232
|
+
async sessionList() {
|
|
233
|
+
await this.ensureLoaded();
|
|
234
|
+
const byHour = new Map();
|
|
235
|
+
for (const e of this.visibleEntries()) {
|
|
236
|
+
const h = hourStartOf(e.at);
|
|
237
|
+
const list = byHour.get(h) ?? [];
|
|
238
|
+
list.push(e);
|
|
239
|
+
byHour.set(h, list);
|
|
240
|
+
}
|
|
241
|
+
const summaryByHour = new Map(this.visibleSummaries().map((s) => [s.hourStart, s.text]));
|
|
242
|
+
return [...byHour.entries()]
|
|
243
|
+
.map(([hourStart, entries]) => {
|
|
244
|
+
entries.sort((a, b) => a.at - b.at);
|
|
245
|
+
return {
|
|
246
|
+
hourStart,
|
|
247
|
+
entries,
|
|
248
|
+
summary: (summaryByHour.get(hourStart) ?? "").trim() || null,
|
|
249
|
+
lineCount: entries.filter((e) => e.kind === "line").length,
|
|
250
|
+
noteCount: entries.filter((e) => e.kind === "note").length,
|
|
251
|
+
};
|
|
252
|
+
})
|
|
253
|
+
.sort((a, b) => b.hourStart - a.hourStart);
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Query the FULL store by absolute-time window and keyword — the executor
|
|
257
|
+
* behind LLM history-search tools. Newest last, so the limit keeps the most
|
|
258
|
+
* recent matches. `contains` is an exact substring; `terms` is fuzzy any-of
|
|
259
|
+
* matching (mistranscribed-name tolerant) — see utils/memory/search.ts.
|
|
260
|
+
*/
|
|
261
|
+
async query(q) {
|
|
262
|
+
return (await this.search(q)).entries;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* query() plus `windowCount` — how many entries the TIME window held before
|
|
266
|
+
* keyword filtering, so an LLM caller can distinguish "keyword matched
|
|
267
|
+
* nothing" from "history doesn't reach that far back" without a retry.
|
|
268
|
+
*/
|
|
269
|
+
async search(q) {
|
|
270
|
+
await this.ensureLoaded();
|
|
271
|
+
const limit = q.limit && q.limit > 0 ? Math.min(q.limit, QUERY_LIMIT_CAP) : QUERY_LIMIT_DEFAULT;
|
|
272
|
+
return searchMemoryEntries(this.visibleEntries(), {
|
|
273
|
+
sinceMs: q.sinceMs,
|
|
274
|
+
untilMs: q.untilMs,
|
|
275
|
+
contains: q.contains,
|
|
276
|
+
terms: q.terms,
|
|
277
|
+
limit,
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
async summaryList() {
|
|
281
|
+
await this.ensureLoaded();
|
|
282
|
+
return this.visibleSummaries().sort((a, b) => b.hourStart - a.hourStart);
|
|
283
|
+
}
|
|
284
|
+
/** Most recent COMPLETED hour with lines but no summary, or null. */
|
|
285
|
+
async pendingSummaryHour(nowMs = Date.now()) {
|
|
286
|
+
await this.ensureLoaded();
|
|
287
|
+
const currentHour = hourStartOf(nowMs);
|
|
288
|
+
const summarized = new Set(this.summaries.map((s) => s.hourStart));
|
|
289
|
+
const hours = new Set();
|
|
290
|
+
for (const e of this.visibleEntries()) {
|
|
291
|
+
if (e.kind !== "line")
|
|
292
|
+
continue;
|
|
293
|
+
const h = hourStartOf(e.at);
|
|
294
|
+
if (h < currentHour && !summarized.has(h))
|
|
295
|
+
hours.add(h);
|
|
296
|
+
}
|
|
297
|
+
if (hours.size === 0)
|
|
298
|
+
return null;
|
|
299
|
+
return Math.max(...hours);
|
|
300
|
+
}
|
|
301
|
+
/** Plain-text export of a scope, for the OS share sheet. */
|
|
302
|
+
async exportText(scope, at) {
|
|
303
|
+
const sessions = (await this.sessionList()).filter((s) => {
|
|
304
|
+
if (scope === "all")
|
|
305
|
+
return true;
|
|
306
|
+
if (at == null)
|
|
307
|
+
return false;
|
|
308
|
+
if (scope === "day")
|
|
309
|
+
return dayStartOf(s.hourStart) === dayStartOf(at);
|
|
310
|
+
return s.hourStart === hourStartOf(at);
|
|
311
|
+
});
|
|
312
|
+
if (sessions.length === 0)
|
|
313
|
+
return "No session history to export.";
|
|
314
|
+
const dayFmt = (ms) => new Date(ms).toLocaleDateString(undefined, { weekday: "long", year: "numeric", month: "long", day: "numeric" });
|
|
315
|
+
const hourFmt = (ms) => new Date(ms).toLocaleTimeString(undefined, { hour: "numeric" });
|
|
316
|
+
const timeFmt = (ms) => new Date(ms).toLocaleTimeString(undefined, { hour: "numeric", minute: "2-digit" });
|
|
317
|
+
const parts = [];
|
|
318
|
+
let lastDay = null;
|
|
319
|
+
for (const s of [...sessions].sort((a, b) => a.hourStart - b.hourStart)) {
|
|
320
|
+
const day = dayStartOf(s.hourStart);
|
|
321
|
+
if (day !== lastDay) {
|
|
322
|
+
parts.push(`\n=== ${dayFmt(day)} ===`);
|
|
323
|
+
lastDay = day;
|
|
324
|
+
}
|
|
325
|
+
parts.push(`\n[${hourFmt(s.hourStart)}–${hourFmt(s.hourStart + HOUR_MS)}]`);
|
|
326
|
+
if (s.summary)
|
|
327
|
+
parts.push(`Summary: ${s.summary}`);
|
|
328
|
+
for (const e of s.entries) {
|
|
329
|
+
const who = e.kind === "note" ? "NOTE" : (e.speakerId ?? "—");
|
|
330
|
+
parts.push(` ${timeFmt(e.at)} ${who}: ${e.text}`);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
return `Memory session history\n${parts.join("\n").trim()}\n`;
|
|
334
|
+
}
|
|
335
|
+
// === Load / persist ===
|
|
336
|
+
async ensureLoaded() {
|
|
337
|
+
const userId = (await this.hooks.getUserId()).trim();
|
|
338
|
+
if (!userId)
|
|
339
|
+
throw new Error("Glassly user identity is unavailable");
|
|
340
|
+
if (this.loadedUserId === userId)
|
|
341
|
+
return;
|
|
342
|
+
if (!this.loadPromise) {
|
|
343
|
+
this.loadPromise = this.loadFor(userId).finally(() => {
|
|
344
|
+
this.loadPromise = null;
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
await this.loadPromise;
|
|
348
|
+
}
|
|
349
|
+
async loadFor(userId) {
|
|
350
|
+
// Don't let an identity switch discard lines still sitting in the debounce
|
|
351
|
+
// window — they belong to the OUTGOING user, whose key is still loaded.
|
|
352
|
+
await this.flush();
|
|
353
|
+
this.entries = [];
|
|
354
|
+
this.summaries = [];
|
|
355
|
+
const rawLog = this.hooks.backend.get(this.key(userId, LOG_SUFFIX));
|
|
356
|
+
if (rawLog != null) {
|
|
357
|
+
this.entries = parseArray(rawLog).filter(isEntry);
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
this.migrateFromAssist(userId);
|
|
361
|
+
}
|
|
362
|
+
const rawSummaries = this.hooks.backend.get(this.key(userId, SUMMARY_SUFFIX));
|
|
363
|
+
if (rawSummaries != null) {
|
|
364
|
+
this.summaries = parseArray(rawSummaries).filter(isSummary);
|
|
365
|
+
}
|
|
366
|
+
this.loadedUserId = userId;
|
|
367
|
+
this.prune();
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* One-time migration: fold the Assist miniapp's per-app store (the previous
|
|
371
|
+
* home of this timeline) into the shared user-scoped keys. Assist's old keys
|
|
372
|
+
* are left in place; its new build reads through the memory bridge instead.
|
|
373
|
+
*/
|
|
374
|
+
migrateFromAssist(userId) {
|
|
375
|
+
const legacyPrefix = `${LEGACY_STORAGE_ROOT}${userId}_${LEGACY_ASSIST_PACKAGE}_`;
|
|
376
|
+
try {
|
|
377
|
+
const migrated = [];
|
|
378
|
+
const rawLog = this.hooks.backend.get(legacyPrefix + LEGACY_LOG_KEY);
|
|
379
|
+
if (rawLog != null) {
|
|
380
|
+
migrated.push(...parseArray(rawLog).filter(isEntry));
|
|
381
|
+
}
|
|
382
|
+
else {
|
|
383
|
+
// Pre-unification Assist: separate transcript log + notes stores.
|
|
384
|
+
for (const v of parseArray(this.hooks.backend.get(legacyPrefix + LEGACY_TRANSCRIPT_KEY))) {
|
|
385
|
+
const e = v;
|
|
386
|
+
if (typeof e.text === "string" && typeof e.at === "number") {
|
|
387
|
+
migrated.push({
|
|
388
|
+
id: makeId(),
|
|
389
|
+
kind: "line",
|
|
390
|
+
text: e.text,
|
|
391
|
+
at: e.at,
|
|
392
|
+
speakerId: typeof e.speakerId === "string" ? e.speakerId : null,
|
|
393
|
+
language: typeof e.language === "string" ? e.language : null,
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
for (const v of parseArray(this.hooks.backend.get(legacyPrefix + LEGACY_NOTES_KEY))) {
|
|
398
|
+
const n = v;
|
|
399
|
+
if (typeof n.text === "string" && typeof n.createdAt === "number") {
|
|
400
|
+
migrated.push({
|
|
401
|
+
id: makeId(),
|
|
402
|
+
kind: "note",
|
|
403
|
+
text: n.text,
|
|
404
|
+
at: n.createdAt,
|
|
405
|
+
speakerId: null,
|
|
406
|
+
language: null,
|
|
407
|
+
source: n.source === "voice" || n.source === "auto" ? n.source : "ui",
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
migrated.sort((a, b) => a.at - b.at);
|
|
413
|
+
this.entries = migrated;
|
|
414
|
+
if (migrated.length > 0)
|
|
415
|
+
this.hooks.backend.set(this.key(userId, LOG_SUFFIX), JSON.stringify(migrated));
|
|
416
|
+
const rawSummaries = this.hooks.backend.get(legacyPrefix + LEGACY_SUMMARY_KEY);
|
|
417
|
+
if (rawSummaries != null) {
|
|
418
|
+
const summaries = parseArray(rawSummaries).filter(isSummary);
|
|
419
|
+
this.summaries = summaries;
|
|
420
|
+
if (summaries.length > 0)
|
|
421
|
+
this.hooks.backend.set(this.key(userId, SUMMARY_SUFFIX), JSON.stringify(summaries));
|
|
422
|
+
}
|
|
423
|
+
if (this.entries.length > 0 || this.summaries.length > 0) {
|
|
424
|
+
console.log(`MemoryStore: migrated ${this.entries.length} entries + ${this.summaries.length} summaries from Assist`);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
catch (err) {
|
|
428
|
+
console.warn("MemoryStore: Assist migration failed:", err instanceof Error ? err.message : err);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
retention() {
|
|
432
|
+
return this.hooks.getRetention?.() ?? STANDARD_RETENTION;
|
|
433
|
+
}
|
|
434
|
+
/** Entries inside the active tier's visibility window, oldest first. */
|
|
435
|
+
visibleEntries() {
|
|
436
|
+
const cutoff = Date.now() - this.retention().maxAgeMs;
|
|
437
|
+
return this.entries.filter((e) => e.at >= cutoff);
|
|
438
|
+
}
|
|
439
|
+
visibleSummaries() {
|
|
440
|
+
const cutoff = Date.now() - this.retention().maxAgeMs;
|
|
441
|
+
return this.summaries.filter((s) => s.hourStart >= cutoff);
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Physical bounds, ALWAYS the extended policy regardless of tier. A free or
|
|
445
|
+
* lapsed user's older timeline stays on disk (reads just can't see past
|
|
446
|
+
* their window) so upgrading — or re-upgrading — restores it rather than
|
|
447
|
+
* finding it deleted. Deleting remains the user's call: clear()/removeScope
|
|
448
|
+
* operate on the physical store.
|
|
449
|
+
*/
|
|
450
|
+
prune() {
|
|
451
|
+
const { maxAgeMs, maxEntries } = EXTENDED_RETENTION;
|
|
452
|
+
const cutoff = Date.now() - maxAgeMs;
|
|
453
|
+
this.entries = this.entries.filter((e) => e.at >= cutoff);
|
|
454
|
+
if (this.entries.length > maxEntries)
|
|
455
|
+
this.entries = this.entries.slice(-maxEntries);
|
|
456
|
+
}
|
|
457
|
+
key(userId, suffix) {
|
|
458
|
+
return `${KEY_ROOT}${userId}_${suffix}`;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Mark the log dirty and arm the debounce timer. Repeated appends inside the
|
|
462
|
+
* window collapse into a single serialization; the first append after a
|
|
463
|
+
* flush starts a fresh window (trailing-edge, so a steady stream of speech
|
|
464
|
+
* still lands on disk every `writeDebounceMs`).
|
|
465
|
+
*/
|
|
466
|
+
schedulePersistLog() {
|
|
467
|
+
const delay = this.hooks.writeDebounceMs ?? DEFAULT_WRITE_DEBOUNCE_MS;
|
|
468
|
+
if (delay <= 0) {
|
|
469
|
+
void this.persistLog();
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
this.logDirty = true;
|
|
473
|
+
if (this.logFlushTimer)
|
|
474
|
+
return;
|
|
475
|
+
this.logFlushTimer = setTimeout(() => {
|
|
476
|
+
this.logFlushTimer = null;
|
|
477
|
+
void this.persistLog().catch((err) => console.warn("MemoryStore: debounced log write failed:", err instanceof Error ? err.message : err));
|
|
478
|
+
}, delay);
|
|
479
|
+
}
|
|
480
|
+
async persistLog() {
|
|
481
|
+
// Any write of the full array satisfies whatever the debounce was holding.
|
|
482
|
+
this.logDirty = false;
|
|
483
|
+
if (this.logFlushTimer) {
|
|
484
|
+
clearTimeout(this.logFlushTimer);
|
|
485
|
+
this.logFlushTimer = null;
|
|
486
|
+
}
|
|
487
|
+
if (this.loadedUserId == null)
|
|
488
|
+
return;
|
|
489
|
+
this.hooks.backend.set(this.key(this.loadedUserId, LOG_SUFFIX), JSON.stringify(this.entries));
|
|
490
|
+
}
|
|
491
|
+
async persistSummaries() {
|
|
492
|
+
if (this.loadedUserId == null)
|
|
493
|
+
return;
|
|
494
|
+
this.hooks.backend.set(this.key(this.loadedUserId, SUMMARY_SUFFIX), JSON.stringify(this.summaries));
|
|
495
|
+
}
|
|
496
|
+
emitChanged() {
|
|
497
|
+
for (const listener of this.changeListeners) {
|
|
498
|
+
try {
|
|
499
|
+
listener();
|
|
500
|
+
}
|
|
501
|
+
catch (err) {
|
|
502
|
+
console.warn("MemoryStore: onChanged listener threw:", err instanceof Error ? err.message : err);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
/** Stored values may be a JSON string (SimpleStorage writes) or a raw array. */
|
|
508
|
+
function parseArray(raw) {
|
|
509
|
+
try {
|
|
510
|
+
if (typeof raw === "string") {
|
|
511
|
+
const parsed = JSON.parse(raw);
|
|
512
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
513
|
+
}
|
|
514
|
+
return Array.isArray(raw) ? raw : [];
|
|
515
|
+
}
|
|
516
|
+
catch {
|
|
517
|
+
return [];
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
function normalize(text) {
|
|
521
|
+
return text
|
|
522
|
+
.toLowerCase()
|
|
523
|
+
.replace(/[^a-z0-9]+/g, " ")
|
|
524
|
+
.trim();
|
|
525
|
+
}
|
|
526
|
+
function isEntry(v) {
|
|
527
|
+
if (!v || typeof v !== "object")
|
|
528
|
+
return false;
|
|
529
|
+
const e = v;
|
|
530
|
+
return (typeof e.id === "string" &&
|
|
531
|
+
(e.kind === "line" || e.kind === "note") &&
|
|
532
|
+
typeof e.text === "string" &&
|
|
533
|
+
typeof e.at === "number");
|
|
534
|
+
}
|
|
535
|
+
function isSummary(v) {
|
|
536
|
+
if (!v || typeof v !== "object")
|
|
537
|
+
return false;
|
|
538
|
+
const s = v;
|
|
539
|
+
return typeof s.hourStart === "number" && typeof s.text === "string" && typeof s.createdAt === "number";
|
|
540
|
+
}
|
|
541
|
+
//# sourceMappingURL=MemoryStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemoryStore.js","sourceRoot":"","sources":["../../src/services/MemoryStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,OAAO,EAAC,mBAAmB,EAAC,MAAM,wBAAwB,CAAA;AAE1D,MAAM,QAAQ,GAAG,SAAS,CAAA;AAC1B,MAAM,UAAU,GAAG,KAAK,CAAA;AACxB,MAAM,cAAc,GAAG,WAAW,CAAA;AAElC,8EAA8E;AAC9E,MAAM,qBAAqB,GAAG,uBAAuB,CAAA;AACrD,MAAM,mBAAmB,GAAG,eAAe,CAAA;AAC3C,MAAM,cAAc,GAAG,uBAAuB,CAAA;AAC9C,MAAM,kBAAkB,GAAG,4BAA4B,CAAA;AACvD,0EAA0E;AAC1E,+BAA+B;AAC/B,MAAM,qBAAqB,GAAG,0BAA0B,CAAA;AACxD,MAAM,gBAAgB,GAAG,iBAAiB,CAAA;AAE1C,MAAM,OAAO,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;AAC9B,MAAM,MAAM,GAAG,EAAE,GAAG,OAAO,CAAA;AAc3B,qDAAqD;AACrD,MAAM,CAAC,MAAM,kBAAkB,GAA0B;IACvD,QAAQ,EAAE,EAAE,GAAG,MAAM;IACrB,UAAU,EAAE,IAAI;IAChB,YAAY,EAAE,EAAE,GAAG,EAAE;CACtB,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAA0B;IACvD,QAAQ,EAAE,GAAG,GAAG,MAAM;IACtB,UAAU,EAAE,MAAM;IAClB,YAAY,EA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AC,CAAC,CAAC,EAAE,CAAA;QAC5C,CAAC;QACD,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;IACtC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAA;IACX,CAAC;AACH,CAAC;AAED,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,IAAI;SACR,WAAW,EAAE;SACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,IAAI,EAAE,CAAA;AACX,CAAC;AAED,SAAS,OAAO,CAAC,CAAU;IACzB,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC7C,MAAM,CAAC,GAAG,CAA4B,CAAA;IACtC,OAAO,CACL,OAAO,CAAC,CAAC,EAAE,KAAK,QAAQ;QACxB,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC;QACxC,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ;QAC1B,OAAO,CAAC,CAAC,EAAE,KAAK,QAAQ,CACzB,CAAA;AACH,CAAC;AAED,SAAS,SAAS,CAAC,CAAU;IAC3B,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC7C,MAAM,CAAC,GAAG,CAA4B,CAAA;IACtC,OAAO,OAAO,CAAC,CAAC,SAAS,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,SAAS,KAAK,QAAQ,CAAA;AACzG,CAAC","sourcesContent":["/**\n * MemoryStore — the user's shared, phone-local memory timeline.\n *\n * One unified per-hour stream of what happened around the user — spoken\n * transcript lines AND notes (manual, voice, auto) in one timeline — plus the\n * hourly conversation summary that heads each session. Scoped to the Glassly\n * USER (not to a miniapp): every miniapp that declares the MEMORY manifest\n * permission reads and writes the same store through LocalMiniappRuntime's\n * MEMORY_* handlers, and Settings > Memory manages it via engine.memory.\n *\n * A \"session\" is one clock hour that has entries, derived from entry\n * timestamps at read time — nothing is stored per-session, so there is no\n * session id to keep in sync.\n *\n * The store began life inside the Assist miniapp (its SessionStore); on first\n * load it migrates Assist's per-app storage namespace into the shared\n * user-scoped keys so existing history survives the move.\n */\n\nimport type {MemoryEntry, MemoryNoteSource, MemorySession, MemorySummary} from \"@glassly/miniapp\"\n\nimport {searchMemoryEntries} from \"../utils/memory/search\"\n\nconst KEY_ROOT = \"memory_\"\nconst LOG_SUFFIX = \"log\"\nconst SUMMARY_SUFFIX = \"summaries\"\n\n/** The pre-memory-layer Assist miniapp whose storage namespace we migrate. */\nconst LEGACY_ASSIST_PACKAGE = \"com.tetramo.assistant\"\nconst LEGACY_STORAGE_ROOT = \"localstorage_\"\nconst LEGACY_LOG_KEY = \"assistant:session-log\"\nconst LEGACY_SUMMARY_KEY = \"assistant:hourly-summaries\"\n// Assist's own pre-unification keys, migrated for users who never ran the\n// unified-schema Assist build.\nconst LEGACY_TRANSCRIPT_KEY = \"assistant:transcript-log\"\nconst LEGACY_NOTES_KEY = \"assistant:notes\"\n\nconst HOUR_MS = 60 * 60 * 1000\nconst DAY_MS = 24 * HOUR_MS\n\n/**\n * How much timeline a tier can SEE. Retention gating is a read window, not a\n * delete: pruning always keeps {@link EXTENDED_RETENTION}'s worth of data, and\n * the active policy decides how far back reads reach. A lapsed subscriber's\n * older timeline is frozen, not lost — upgrading again restores it instantly.\n */\nexport interface MemoryRetentionPolicy {\n maxAgeMs: number\n maxEntries: number\n maxSummaries: number\n}\n\n/** Free-tier visibility: a 14-day rolling window. */\nexport const STANDARD_RETENTION: MemoryRetentionPolicy = {\n maxAgeMs: 14 * DAY_MS,\n maxEntries: 4000,\n maxSummaries: 24 * 14,\n}\n\n/**\n * Plus/Pro visibility — and the store's PHYSICAL bounds for every tier. The\n * entry cap also bounds the write cost — every persist re-serializes the\n * whole timeline, so this cap is a perf ceiling as much as a product number.\n */\nexport const EXTENDED_RETENTION: MemoryRetentionPolicy = {\n maxAgeMs: 180 * DAY_MS,\n maxEntries: 24_000,\n maxSummaries: 24 * 180,\n}\nconst QUERY_LIMIT_CAP = 200\nconst QUERY_LIMIT_DEFAULT = 60\n/**\n * How long transcript appends coalesce before hitting disk. Each write\n * re-serializes the entire timeline, so at conversational pace (a final\n * utterance every few seconds) this turns O(n) work per line into O(n) per\n * window. Short enough that an unexpected kill loses only the last few lines.\n */\nconst DEFAULT_WRITE_DEBOUNCE_MS = 3000\n\nexport interface MemoryStoreBackend {\n get(key: string): unknown | null\n set(key: string, value: unknown): void\n remove(key: string): void\n}\n\nexport interface MemoryStoreHooks {\n getUserId: () => Promise<string>\n backend: MemoryStoreBackend\n /**\n * Debounce window for transcript-line writes, in ms. Appends coalesce into\n * one serialization instead of re-stringifying the whole timeline per\n * utterance. Set to 0 to persist synchronously (tests).\n */\n writeDebounceMs?: number\n /**\n * Visibility policy resolver, consulted at every read. A function (not a\n * value) so the host can flip between STANDARD and EXTENDED as the user's\n * subscription changes without rebuilding the store. Absent = standard.\n * Never affects what is STORED — pruning is fixed at EXTENDED bounds.\n */\n getRetention?: () => MemoryRetentionPolicy\n}\n\nexport interface MemoryStats {\n entryCount: number\n lineCount: number\n noteCount: number\n summaryCount: number\n /** Epoch ms of the oldest entry, or null when empty. */\n oldestAt: number | null\n}\n\nexport function hourStartOf(ms: number): number {\n return Math.floor(ms / HOUR_MS) * HOUR_MS\n}\n\nexport function dayStartOf(ms: number): number {\n const d = new Date(ms)\n d.setHours(0, 0, 0, 0)\n return d.getTime()\n}\n\nfunction makeId(): string {\n return `e-${Date.now()}-${Math.random().toString(36).slice(2)}`\n}\n\nexport class MemoryStore {\n private entries: MemoryEntry[] = []\n private summaries: MemorySummary[] = []\n /** User the in-memory cache was loaded for; reload when identity changes. */\n private loadedUserId: string | null = null\n private loadPromise: Promise<void> | null = null\n private readonly changeListeners = new Set<() => void>()\n /** Pending debounced log write (transcript appends), if any. */\n private logFlushTimer: ReturnType<typeof setTimeout> | null = null\n private logDirty = false\n\n constructor(private readonly hooks: MemoryStoreHooks) {}\n\n /**\n * Write any debounced changes out now. Call before the app backgrounds or\n * terminates so a crash can't lose the coalesced tail of the timeline.\n */\n async flush(): Promise<void> {\n if (this.logFlushTimer) {\n clearTimeout(this.logFlushTimer)\n this.logFlushTimer = null\n }\n if (this.logDirty) await this.persistLog()\n }\n\n /** Subscribe to mutations (adds, edits, deletes, clears). */\n onChanged(listener: () => void): () => void {\n this.changeListeners.add(listener)\n return () => this.changeListeners.delete(listener)\n }\n\n // === Writes ===\n\n async appendLine(input: {\n text: string\n speakerId: string | null\n /** Resolved enrolled-speaker name (on-device speaker ID), when known. */\n resolvedSpeakerName?: string | null\n language: string | null\n at: number\n }): Promise<void> {\n if (!input.text.trim()) return\n await this.ensureLoaded()\n this.entries.push({\n id: makeId(),\n kind: \"line\",\n text: input.text.trim(),\n at: input.at,\n speakerId: input.speakerId,\n ...(input.resolvedSpeakerName ? {resolvedSpeakerName: input.resolvedSpeakerName} : {}),\n language: input.language,\n })\n this.prune()\n // Transcript lines are the hot path (one per final utterance) and each\n // persist re-serializes the whole timeline, so coalesce them. Everything\n // else — notes, edits, deletes, summaries — still writes through\n // immediately; those are user-visible and rare.\n this.schedulePersistLog()\n this.emitChanged()\n }\n\n /**\n * Add a note. `at` targets the hour it belongs to — pass a timestamp inside\n * a past hour to append to that session. Dedupes on normalized text within\n * the same hour (auto-notes re-extract); resolves null on duplicate/empty.\n */\n async addNote(text: string, source: MemoryNoteSource, at: number = Date.now()): Promise<MemoryEntry | null> {\n const body = text.trim()\n if (!body) return null\n await this.ensureLoaded()\n const hour = hourStartOf(at)\n const key = normalize(body)\n if (this.entries.some((e) => e.kind === \"note\" && hourStartOf(e.at) === hour && normalize(e.text) === key)) {\n return null\n }\n const entry: MemoryEntry = {id: makeId(), kind: \"note\", text: body, at, speakerId: null, language: null, source}\n this.entries.push(entry)\n this.entries.sort((a, b) => a.at - b.at)\n this.prune()\n await this.persistLog()\n this.emitChanged()\n return entry\n }\n\n /** Rewrite a note's text in place (Settings > Memory edit). */\n async updateNote(id: string, text: string): Promise<boolean> {\n const body = text.trim()\n if (!body) return false\n await this.ensureLoaded()\n const entry = this.entries.find((e) => e.id === id && e.kind === \"note\")\n if (!entry) return false\n entry.text = body\n await this.persistLog()\n this.emitChanged()\n return true\n }\n\n async removeEntry(id: string): Promise<boolean> {\n await this.ensureLoaded()\n const before = this.entries.length\n this.entries = this.entries.filter((e) => e.id !== id)\n if (this.entries.length === before) return false\n await this.persistLog()\n this.emitChanged()\n return true\n }\n\n /** Delete every entry (and summary) in an hour, or a whole day of hours. */\n async removeScope(scope: \"session\" | \"day\", at: number): Promise<void> {\n await this.ensureLoaded()\n const inScope =\n scope === \"day\"\n ? (ms: number) => dayStartOf(ms) === dayStartOf(at)\n : (ms: number) => hourStartOf(ms) === hourStartOf(at)\n this.entries = this.entries.filter((e) => !inScope(e.at))\n this.summaries = this.summaries.filter((s) => !inScope(s.hourStart))\n await this.persistLog()\n await this.persistSummaries()\n this.emitChanged()\n }\n\n /** Drop the entire timeline: every entry and every summary. */\n async clear(): Promise<void> {\n await this.ensureLoaded()\n this.entries = []\n this.summaries = []\n await this.persistLog()\n await this.persistSummaries()\n this.emitChanged()\n }\n\n async addSummary(summary: MemorySummary): Promise<void> {\n await this.ensureLoaded()\n const {maxSummaries} = EXTENDED_RETENTION\n this.summaries = this.summaries.filter((s) => s.hourStart !== summary.hourStart)\n this.summaries.push(summary)\n if (this.summaries.length > maxSummaries) {\n this.summaries = this.summaries.sort((a, b) => a.hourStart - b.hourStart).slice(-maxSummaries)\n }\n await this.persistSummaries()\n this.emitChanged()\n }\n\n // === Reads ===\n //\n // Every read goes through the VISIBLE view: entries inside the active\n // tier's window. Older data may still be stored (see prune) — it is frozen,\n // not deleted, so an upgrade widens these views instantly.\n\n /** Entries in [sinceMs, untilMs), newest last. */\n async window(sinceMs: number, untilMs: number = Date.now()): Promise<MemoryEntry[]> {\n await this.ensureLoaded()\n return this.visibleEntries().filter((e) => e.at >= sinceMs && e.at < untilMs)\n }\n\n /** All note entries, newest first (Settings > Memory list). */\n async notes(): Promise<MemoryEntry[]> {\n await this.ensureLoaded()\n return this.visibleEntries()\n .filter((e) => e.kind === \"note\")\n .sort((a, b) => b.at - a.at)\n }\n\n async stats(): Promise<MemoryStats> {\n await this.ensureLoaded()\n const visible = this.visibleEntries()\n const noteCount = visible.filter((e) => e.kind === \"note\").length\n return {\n entryCount: visible.length,\n lineCount: visible.length - noteCount,\n noteCount,\n summaryCount: this.visibleSummaries().filter((s) => s.text.trim()).length,\n oldestAt: visible.length > 0 ? visible[0].at : null,\n }\n }\n\n /** All sessions (hours with entries), newest hour first. */\n async sessionList(): Promise<MemorySession[]> {\n await this.ensureLoaded()\n const byHour = new Map<number, MemoryEntry[]>()\n for (const e of this.visibleEntries()) {\n const h = hourStartOf(e.at)\n const list = byHour.get(h) ?? []\n list.push(e)\n byHour.set(h, list)\n }\n const summaryByHour = new Map(this.visibleSummaries().map((s) => [s.hourStart, s.text]))\n return [...byHour.entries()]\n .map(([hourStart, entries]) => {\n entries.sort((a, b) => a.at - b.at)\n return {\n hourStart,\n entries,\n summary: (summaryByHour.get(hourStart) ?? \"\").trim() || null,\n lineCount: entries.filter((e) => e.kind === \"line\").length,\n noteCount: entries.filter((e) => e.kind === \"note\").length,\n }\n })\n .sort((a, b) => b.hourStart - a.hourStart)\n }\n\n /**\n * Query the FULL store by absolute-time window and keyword — the executor\n * behind LLM history-search tools. Newest last, so the limit keeps the most\n * recent matches. `contains` is an exact substring; `terms` is fuzzy any-of\n * matching (mistranscribed-name tolerant) — see utils/memory/search.ts.\n */\n async query(q: {\n sinceMs?: number\n untilMs?: number\n contains?: string\n terms?: string[]\n limit?: number\n }): Promise<MemoryEntry[]> {\n return (await this.search(q)).entries\n }\n\n /**\n * query() plus `windowCount` — how many entries the TIME window held before\n * keyword filtering, so an LLM caller can distinguish \"keyword matched\n * nothing\" from \"history doesn't reach that far back\" without a retry.\n */\n async search(q: {\n sinceMs?: number\n untilMs?: number\n contains?: string\n terms?: string[]\n limit?: number\n }): Promise<{entries: MemoryEntry[]; windowCount: number}> {\n await this.ensureLoaded()\n const limit = q.limit && q.limit > 0 ? Math.min(q.limit, QUERY_LIMIT_CAP) : QUERY_LIMIT_DEFAULT\n return searchMemoryEntries(this.visibleEntries(), {\n sinceMs: q.sinceMs,\n untilMs: q.untilMs,\n contains: q.contains,\n terms: q.terms,\n limit,\n })\n }\n\n async summaryList(): Promise<MemorySummary[]> {\n await this.ensureLoaded()\n return this.visibleSummaries().sort((a, b) => b.hourStart - a.hourStart)\n }\n\n /** Most recent COMPLETED hour with lines but no summary, or null. */\n async pendingSummaryHour(nowMs: number = Date.now()): Promise<number | null> {\n await this.ensureLoaded()\n const currentHour = hourStartOf(nowMs)\n const summarized = new Set(this.summaries.map((s) => s.hourStart))\n const hours = new Set<number>()\n for (const e of this.visibleEntries()) {\n if (e.kind !== \"line\") continue\n const h = hourStartOf(e.at)\n if (h < currentHour && !summarized.has(h)) hours.add(h)\n }\n if (hours.size === 0) return null\n return Math.max(...hours)\n }\n\n /** Plain-text export of a scope, for the OS share sheet. */\n async exportText(scope: \"session\" | \"day\" | \"all\", at?: number): Promise<string> {\n const sessions = (await this.sessionList()).filter((s) => {\n if (scope === \"all\") return true\n if (at == null) return false\n if (scope === \"day\") return dayStartOf(s.hourStart) === dayStartOf(at)\n return s.hourStart === hourStartOf(at)\n })\n if (sessions.length === 0) return \"No session history to export.\"\n\n const dayFmt = (ms: number) =>\n new Date(ms).toLocaleDateString(undefined, {weekday: \"long\", year: \"numeric\", month: \"long\", day: \"numeric\"})\n const hourFmt = (ms: number) => new Date(ms).toLocaleTimeString(undefined, {hour: \"numeric\"})\n const timeFmt = (ms: number) => new Date(ms).toLocaleTimeString(undefined, {hour: \"numeric\", minute: \"2-digit\"})\n\n const parts: string[] = []\n let lastDay: number | null = null\n for (const s of [...sessions].sort((a, b) => a.hourStart - b.hourStart)) {\n const day = dayStartOf(s.hourStart)\n if (day !== lastDay) {\n parts.push(`\\n=== ${dayFmt(day)} ===`)\n lastDay = day\n }\n parts.push(`\\n[${hourFmt(s.hourStart)}–${hourFmt(s.hourStart + HOUR_MS)}]`)\n if (s.summary) parts.push(`Summary: ${s.summary}`)\n for (const e of s.entries) {\n const who = e.kind === \"note\" ? \"NOTE\" : (e.speakerId ?? \"—\")\n parts.push(` ${timeFmt(e.at)} ${who}: ${e.text}`)\n }\n }\n return `Memory session history\\n${parts.join(\"\\n\").trim()}\\n`\n }\n\n // === Load / persist ===\n\n private async ensureLoaded(): Promise<void> {\n const userId = (await this.hooks.getUserId()).trim()\n if (!userId) throw new Error(\"Glassly user identity is unavailable\")\n if (this.loadedUserId === userId) return\n if (!this.loadPromise) {\n this.loadPromise = this.loadFor(userId).finally(() => {\n this.loadPromise = null\n })\n }\n await this.loadPromise\n }\n\n private async loadFor(userId: string): Promise<void> {\n // Don't let an identity switch discard lines still sitting in the debounce\n // window — they belong to the OUTGOING user, whose key is still loaded.\n await this.flush()\n this.entries = []\n this.summaries = []\n const rawLog = this.hooks.backend.get(this.key(userId, LOG_SUFFIX))\n if (rawLog != null) {\n this.entries = parseArray(rawLog).filter(isEntry)\n } else {\n this.migrateFromAssist(userId)\n }\n const rawSummaries = this.hooks.backend.get(this.key(userId, SUMMARY_SUFFIX))\n if (rawSummaries != null) {\n this.summaries = parseArray(rawSummaries).filter(isSummary)\n }\n this.loadedUserId = userId\n this.prune()\n }\n\n /**\n * One-time migration: fold the Assist miniapp's per-app store (the previous\n * home of this timeline) into the shared user-scoped keys. Assist's old keys\n * are left in place; its new build reads through the memory bridge instead.\n */\n private migrateFromAssist(userId: string): void {\n const legacyPrefix = `${LEGACY_STORAGE_ROOT}${userId}_${LEGACY_ASSIST_PACKAGE}_`\n try {\n const migrated: MemoryEntry[] = []\n const rawLog = this.hooks.backend.get(legacyPrefix + LEGACY_LOG_KEY)\n if (rawLog != null) {\n migrated.push(...parseArray(rawLog).filter(isEntry))\n } else {\n // Pre-unification Assist: separate transcript log + notes stores.\n for (const v of parseArray(this.hooks.backend.get(legacyPrefix + LEGACY_TRANSCRIPT_KEY))) {\n const e = v as Record<string, unknown>\n if (typeof e.text === \"string\" && typeof e.at === \"number\") {\n migrated.push({\n id: makeId(),\n kind: \"line\",\n text: e.text,\n at: e.at,\n speakerId: typeof e.speakerId === \"string\" ? e.speakerId : null,\n language: typeof e.language === \"string\" ? e.language : null,\n })\n }\n }\n for (const v of parseArray(this.hooks.backend.get(legacyPrefix + LEGACY_NOTES_KEY))) {\n const n = v as Record<string, unknown>\n if (typeof n.text === \"string\" && typeof n.createdAt === \"number\") {\n migrated.push({\n id: makeId(),\n kind: \"note\",\n text: n.text,\n at: n.createdAt,\n speakerId: null,\n language: null,\n source: n.source === \"voice\" || n.source === \"auto\" ? n.source : \"ui\",\n })\n }\n }\n }\n migrated.sort((a, b) => a.at - b.at)\n this.entries = migrated\n if (migrated.length > 0) this.hooks.backend.set(this.key(userId, LOG_SUFFIX), JSON.stringify(migrated))\n\n const rawSummaries = this.hooks.backend.get(legacyPrefix + LEGACY_SUMMARY_KEY)\n if (rawSummaries != null) {\n const summaries = parseArray(rawSummaries).filter(isSummary)\n this.summaries = summaries\n if (summaries.length > 0) this.hooks.backend.set(this.key(userId, SUMMARY_SUFFIX), JSON.stringify(summaries))\n }\n if (this.entries.length > 0 || this.summaries.length > 0) {\n console.log(\n `MemoryStore: migrated ${this.entries.length} entries + ${this.summaries.length} summaries from Assist`,\n )\n }\n } catch (err) {\n console.warn(\"MemoryStore: Assist migration failed:\", err instanceof Error ? err.message : err)\n }\n }\n\n private retention(): MemoryRetentionPolicy {\n return this.hooks.getRetention?.() ?? STANDARD_RETENTION\n }\n\n /** Entries inside the active tier's visibility window, oldest first. */\n private visibleEntries(): MemoryEntry[] {\n const cutoff = Date.now() - this.retention().maxAgeMs\n return this.entries.filter((e) => e.at >= cutoff)\n }\n\n private visibleSummaries(): MemorySummary[] {\n const cutoff = Date.now() - this.retention().maxAgeMs\n return this.summaries.filter((s) => s.hourStart >= cutoff)\n }\n\n /**\n * Physical bounds, ALWAYS the extended policy regardless of tier. A free or\n * lapsed user's older timeline stays on disk (reads just can't see past\n * their window) so upgrading — or re-upgrading — restores it rather than\n * finding it deleted. Deleting remains the user's call: clear()/removeScope\n * operate on the physical store.\n */\n private prune(): void {\n const {maxAgeMs, maxEntries} = EXTENDED_RETENTION\n const cutoff = Date.now() - maxAgeMs\n this.entries = this.entries.filter((e) => e.at >= cutoff)\n if (this.entries.length > maxEntries) this.entries = this.entries.slice(-maxEntries)\n }\n\n private key(userId: string, suffix: string): string {\n return `${KEY_ROOT}${userId}_${suffix}`\n }\n\n /**\n * Mark the log dirty and arm the debounce timer. Repeated appends inside the\n * window collapse into a single serialization; the first append after a\n * flush starts a fresh window (trailing-edge, so a steady stream of speech\n * still lands on disk every `writeDebounceMs`).\n */\n private schedulePersistLog(): void {\n const delay = this.hooks.writeDebounceMs ?? DEFAULT_WRITE_DEBOUNCE_MS\n if (delay <= 0) {\n void this.persistLog()\n return\n }\n this.logDirty = true\n if (this.logFlushTimer) return\n this.logFlushTimer = setTimeout(() => {\n this.logFlushTimer = null\n void this.persistLog().catch((err) =>\n console.warn(\"MemoryStore: debounced log write failed:\", err instanceof Error ? err.message : err),\n )\n }, delay)\n }\n\n private async persistLog(): Promise<void> {\n // Any write of the full array satisfies whatever the debounce was holding.\n this.logDirty = false\n if (this.logFlushTimer) {\n clearTimeout(this.logFlushTimer)\n this.logFlushTimer = null\n }\n if (this.loadedUserId == null) return\n this.hooks.backend.set(this.key(this.loadedUserId, LOG_SUFFIX), JSON.stringify(this.entries))\n }\n\n private async persistSummaries(): Promise<void> {\n if (this.loadedUserId == null) return\n this.hooks.backend.set(this.key(this.loadedUserId, SUMMARY_SUFFIX), JSON.stringify(this.summaries))\n }\n\n private emitChanged(): void {\n for (const listener of this.changeListeners) {\n try {\n listener()\n } catch (err) {\n console.warn(\"MemoryStore: onChanged listener threw:\", err instanceof Error ? err.message : err)\n }\n }\n }\n}\n\n/** Stored values may be a JSON string (SimpleStorage writes) or a raw array. */\nfunction parseArray(raw: unknown): unknown[] {\n try {\n if (typeof raw === \"string\") {\n const parsed = JSON.parse(raw) as unknown\n return Array.isArray(parsed) ? parsed : []\n }\n return Array.isArray(raw) ? raw : []\n } catch {\n return []\n }\n}\n\nfunction normalize(text: string): string {\n return text\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \" \")\n .trim()\n}\n\nfunction isEntry(v: unknown): v is MemoryEntry {\n if (!v || typeof v !== \"object\") return false\n const e = v as Record<string, unknown>\n return (\n typeof e.id === \"string\" &&\n (e.kind === \"line\" || e.kind === \"note\") &&\n typeof e.text === \"string\" &&\n typeof e.at === \"number\"\n )\n}\n\nfunction isSummary(v: unknown): v is MemorySummary {\n if (!v || typeof v !== \"object\") return false\n const s = v as Record<string, unknown>\n return typeof s.hourStart === \"number\" && typeof s.text === \"string\" && typeof s.createdAt === \"number\"\n}\n"]}
|