@glassly/engine 0.3.7 → 0.3.8-beta.1013
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 +4 -0
- package/build/engine.d.ts +18 -2
- package/build/engine.d.ts.map +1 -1
- package/build/engine.js +7 -4
- package/build/engine.js.map +1 -1
- package/build/facades/ai.d.ts +3 -0
- package/build/facades/ai.d.ts.map +1 -1
- package/build/facades/ai.js +3 -0
- package/build/facades/ai.js.map +1 -1
- package/build/facades/backup.d.ts +14 -0
- package/build/facades/backup.d.ts.map +1 -0
- package/build/facades/backup.js +22 -0
- package/build/facades/backup.js.map +1 -0
- package/build/facades/glasses.d.ts +13 -5
- package/build/facades/glasses.d.ts.map +1 -1
- package/build/facades/glasses.js +17 -4
- package/build/facades/glasses.js.map +1 -1
- package/build/generated/releaseMetadata.js +4 -4
- package/build/generated/releaseMetadata.js.map +1 -1
- package/build/index.d.ts +3 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js.map +1 -1
- package/build/services/AppRegistry.d.ts +2 -1
- package/build/services/AppRegistry.d.ts.map +1 -1
- package/build/services/AppRegistry.js +38 -8
- package/build/services/AppRegistry.js.map +1 -1
- package/build/services/AppStateBackup.d.ts +98 -0
- package/build/services/AppStateBackup.d.ts.map +1 -0
- package/build/services/AppStateBackup.js +224 -0
- package/build/services/AppStateBackup.js.map +1 -0
- package/build/services/BlobStore.d.ts.map +1 -1
- package/build/services/BlobStore.js +5 -12
- package/build/services/BlobStore.js.map +1 -1
- package/build/services/CloudClientService.d.ts +3 -1
- package/build/services/CloudClientService.d.ts.map +1 -1
- package/build/services/CloudClientService.js +42 -2
- package/build/services/CloudClientService.js.map +1 -1
- package/build/services/DeviceEventRouter.d.ts.map +1 -1
- package/build/services/DeviceEventRouter.js +1 -0
- package/build/services/DeviceEventRouter.js.map +1 -1
- package/build/services/DisplayDiagnostics.d.ts.map +1 -1
- package/build/services/DisplayDiagnostics.js +4 -2
- package/build/services/DisplayDiagnostics.js.map +1 -1
- package/build/services/DisplayProcessor.d.ts +2 -0
- package/build/services/DisplayProcessor.d.ts.map +1 -1
- package/build/services/DisplayProcessor.js +15 -1
- package/build/services/DisplayProcessor.js.map +1 -1
- package/build/services/GlassesTouchInput.d.ts.map +1 -1
- package/build/services/GlassesTouchInput.js +4 -2
- package/build/services/GlassesTouchInput.js.map +1 -1
- package/build/services/JSCrashloopReportService.d.ts.map +1 -1
- package/build/services/JSCrashloopReportService.js +5 -0
- package/build/services/JSCrashloopReportService.js.map +1 -1
- package/build/services/JSRouter.d.ts +11 -3
- package/build/services/JSRouter.d.ts.map +1 -1
- package/build/services/JSRouter.js +36 -6
- package/build/services/JSRouter.js.map +1 -1
- package/build/services/LocalDisplayManager.d.ts.map +1 -1
- package/build/services/LocalDisplayManager.js +5 -2
- package/build/services/LocalDisplayManager.js.map +1 -1
- package/build/services/LocalMiniappRuntime.d.ts +13 -0
- package/build/services/LocalMiniappRuntime.d.ts.map +1 -1
- package/build/services/LocalMiniappRuntime.js +61 -22
- package/build/services/LocalMiniappRuntime.js.map +1 -1
- package/build/services/LocalSttFallbackCoordinator.d.ts.map +1 -1
- package/build/services/LocalSttFallbackCoordinator.js +2 -0
- package/build/services/LocalSttFallbackCoordinator.js.map +1 -1
- package/build/services/LocalTranslationService.d.ts +2 -0
- package/build/services/LocalTranslationService.d.ts.map +1 -1
- package/build/services/LocalTranslationService.js +22 -0
- package/build/services/LocalTranslationService.js.map +1 -1
- package/build/services/MiniappEngine.d.ts +9 -0
- package/build/services/MiniappEngine.d.ts.map +1 -1
- package/build/services/MiniappEngine.js +60 -27
- package/build/services/MiniappEngine.js.map +1 -1
- package/build/services/MiniappLauncher.d.ts +2 -0
- package/build/services/MiniappLauncher.d.ts.map +1 -1
- package/build/services/MiniappLauncher.js +6 -0
- package/build/services/MiniappLauncher.js.map +1 -1
- package/build/services/NavigationService.d.ts +1 -0
- package/build/services/NavigationService.d.ts.map +1 -1
- package/build/services/NavigationService.js +20 -6
- package/build/services/NavigationService.js.map +1 -1
- package/build/services/OfflineActivity.d.ts +54 -0
- package/build/services/OfflineActivity.d.ts.map +1 -0
- package/build/services/OfflineActivity.js +86 -0
- package/build/services/OfflineActivity.js.map +1 -0
- package/build/services/PhoneCalendarService.d.ts.map +1 -1
- package/build/services/PhoneCalendarService.js +8 -0
- package/build/services/PhoneCalendarService.js.map +1 -1
- package/build/services/PhoneNotificationsSync.d.ts.map +1 -1
- package/build/services/PhoneNotificationsSync.js +7 -3
- package/build/services/PhoneNotificationsSync.js.map +1 -1
- package/build/services/STTModelManager.d.ts +1 -0
- package/build/services/STTModelManager.d.ts.map +1 -1
- package/build/services/STTModelManager.js +6 -0
- package/build/services/STTModelManager.js.map +1 -1
- package/build/services/SceneRenderer.js +1 -1
- package/build/services/SceneRenderer.js.map +1 -1
- package/build/services/appStateBackupFile.d.ts +32 -0
- package/build/services/appStateBackupFile.d.ts.map +1 -0
- package/build/services/appStateBackupFile.js +135 -0
- package/build/services/appStateBackupFile.js.map +1 -0
- package/build/services/controllers.d.ts.map +1 -1
- package/build/services/controllers.js +13 -3
- package/build/services/controllers.js.map +1 -1
- package/build/services/effectiveCapabilities.js +6 -1
- package/build/services/effectiveCapabilities.js.map +1 -1
- package/build/services/neuralBand/NeuralBandInput.d.ts +12 -1
- package/build/services/neuralBand/NeuralBandInput.d.ts.map +1 -1
- package/build/services/neuralBand/NeuralBandInput.js +27 -0
- package/build/services/neuralBand/NeuralBandInput.js.map +1 -1
- package/build/services/neuralBand/NeuralBandSettingsSync.d.ts.map +1 -1
- package/build/services/neuralBand/NeuralBandSettingsSync.js +6 -0
- package/build/services/neuralBand/NeuralBandSettingsSync.js.map +1 -1
- package/build/services/pages/pageEligibility.d.ts.map +1 -1
- package/build/services/pages/pageEligibility.js +8 -1
- package/build/services/pages/pageEligibility.js.map +1 -1
- package/build/services/settingsBridge.d.ts.map +1 -1
- package/build/services/settingsBridge.js +1 -0
- package/build/services/settingsBridge.js.map +1 -1
- package/build/services/{appleWatch/AppleWatchLink.d.ts → watch/WatchLink.d.ts} +8 -7
- package/build/services/watch/WatchLink.d.ts.map +1 -0
- package/build/services/{appleWatch/AppleWatchLink.js → watch/WatchLink.js} +14 -15
- package/build/services/watch/WatchLink.js.map +1 -0
- package/build/stores/appVisibility.d.ts.map +1 -1
- package/build/stores/appVisibility.js +0 -1
- package/build/stores/appVisibility.js.map +1 -1
- package/build/stores/apps.d.ts.map +1 -1
- package/build/stores/apps.js +22 -10
- package/build/stores/apps.js.map +1 -1
- package/build/stores/settings.d.ts.map +1 -1
- package/build/stores/settings.js +71 -6
- package/build/stores/settings.js.map +1 -1
- package/build/types/capabilities/even-realities-g1.d.ts.map +1 -1
- package/build/types/capabilities/even-realities-g1.js +3 -0
- package/build/types/capabilities/even-realities-g1.js.map +1 -1
- package/build/types/capabilities/memomind-one.d.ts +3 -0
- package/build/types/capabilities/memomind-one.d.ts.map +1 -0
- package/build/types/capabilities/memomind-one.js +42 -0
- package/build/types/capabilities/memomind-one.js.map +1 -0
- package/build/types/capabilities/rayneo-io.d.ts.map +1 -1
- package/build/types/capabilities/rayneo-io.js +3 -2
- package/build/types/capabilities/rayneo-io.js.map +1 -1
- package/build/types/enums.d.ts +8 -2
- package/build/types/enums.d.ts.map +1 -1
- package/build/types/enums.js +6 -0
- package/build/types/enums.js.map +1 -1
- package/build/types/hardware.d.ts +3 -1
- package/build/types/hardware.d.ts.map +1 -1
- package/build/types/hardware.js +3 -1
- package/build/types/hardware.js.map +1 -1
- package/build/utils/display/index.d.ts +2 -1
- package/build/utils/display/index.d.ts.map +1 -1
- package/build/utils/display/index.js +3 -2
- package/build/utils/display/index.js.map +1 -1
- package/build/utils/display/profiles/index.d.ts +2 -1
- package/build/utils/display/profiles/index.d.ts.map +1 -1
- package/build/utils/display/profiles/index.js +3 -2
- package/build/utils/display/profiles/index.js.map +1 -1
- package/build/utils/display/profiles/rayneo-io.d.ts +1 -1
- package/build/utils/display/profiles/rayneo-io.d.ts.map +1 -1
- package/build/utils/display/profiles/rayneo-io.js +1 -1
- package/build/utils/display/profiles/rayneo-io.js.map +1 -1
- package/build/utils/display/scene/index.d.ts +1 -1
- package/build/utils/display/scene/index.d.ts.map +1 -1
- package/build/utils/display/scene/index.js +1 -1
- package/build/utils/display/scene/index.js.map +1 -1
- package/build/utils/display/scene/process.d.ts +6 -0
- package/build/utils/display/scene/process.d.ts.map +1 -1
- package/build/utils/display/scene/process.js +22 -7
- package/build/utils/display/scene/process.js.map +1 -1
- package/build/utils/miniappGlobals.d.ts +13 -17
- package/build/utils/miniappGlobals.d.ts.map +1 -1
- package/build/utils/miniappGlobals.js +24 -56
- package/build/utils/miniappGlobals.js.map +1 -1
- package/package.json +7 -7
- package/src/engine.ts +7 -4
- package/src/facades/ai.ts +4 -0
- package/src/facades/backup.ts +28 -0
- package/src/facades/glasses.ts +22 -5
- package/src/generated/releaseMetadata.ts +4 -4
- package/src/index.ts +10 -0
- package/src/services/AppRegistry.ts +36 -9
- package/src/services/AppStateBackup.ts +283 -0
- package/src/services/BlobStore.ts +5 -11
- package/src/services/CloudClientService.ts +43 -4
- package/src/services/DeviceEventRouter.ts +1 -0
- package/src/services/DisplayDiagnostics.ts +4 -2
- package/src/services/DisplayProcessor.ts +20 -8
- package/src/services/GlassesTouchInput.ts +6 -2
- package/src/services/JSCrashloopReportService.ts +5 -0
- package/src/services/JSRouter.ts +37 -6
- package/src/services/LocalDisplayManager.ts +5 -2
- package/src/services/LocalMiniappRuntime.ts +61 -22
- package/src/services/LocalSttFallbackCoordinator.ts +4 -0
- package/src/services/LocalTranslationService.ts +20 -0
- package/src/services/MiniappEngine.ts +62 -27
- package/src/services/MiniappLauncher.ts +7 -0
- package/src/services/NavigationService.ts +28 -8
- package/src/services/OfflineActivity.ts +131 -0
- package/src/services/PhoneCalendarService.ts +7 -0
- package/src/services/PhoneNotificationsSync.ts +8 -3
- package/src/services/STTModelManager.ts +6 -0
- package/src/services/SceneRenderer.ts +1 -1
- package/src/services/appStateBackupFile.ts +171 -0
- package/src/services/controllers.ts +14 -3
- package/src/services/effectiveCapabilities.ts +6 -1
- package/src/services/neuralBand/NeuralBandInput.ts +37 -1
- package/src/services/neuralBand/NeuralBandSettingsSync.ts +12 -0
- package/src/services/pages/pageEligibility.ts +9 -1
- package/src/services/settingsBridge.ts +1 -0
- package/src/services/{appleWatch/AppleWatchLink.ts → watch/WatchLink.ts} +20 -20
- package/src/stores/appVisibility.ts +0 -1
- package/src/stores/apps.ts +22 -11
- package/src/stores/settings.ts +78 -10
- package/src/types/capabilities/even-realities-g1.ts +4 -0
- package/src/types/capabilities/memomind-one.ts +43 -0
- package/src/types/capabilities/rayneo-io.ts +3 -2
- package/src/types/enums.ts +6 -0
- package/src/types/hardware.ts +14 -1
- package/src/utils/display/index.ts +4 -2
- package/src/utils/display/profiles/index.ts +9 -2
- package/src/utils/display/profiles/rayneo-io.ts +6 -1
- package/src/utils/display/scene/index.ts +1 -1
- package/src/utils/display/scene/process.ts +22 -7
- package/src/utils/miniappGlobals.ts +32 -64
- package/build/services/appleWatch/AppleWatchLink.d.ts.map +0 -1
- package/build/services/appleWatch/AppleWatchLink.js.map +0 -1
package/README.md
CHANGED
|
@@ -138,6 +138,10 @@ tells the settings UI whether the glasses may read the phone's notifications
|
|
|
138
138
|
(`not_needed` where the phone captures); `popupSecondsOptions()` lists the
|
|
139
139
|
durations the connected firmware accepts.
|
|
140
140
|
|
|
141
|
+
`notifications_batch_seconds` (0 = off) is the viewer's alone: a burst from
|
|
142
|
+
one app pops up once that app has been quiet that long, at most a minute
|
|
143
|
+
after its first notification, behind a summary card.
|
|
144
|
+
|
|
141
145
|
## Imports
|
|
142
146
|
|
|
143
147
|
Inside `mobile/modules/engine/src/`, use **relative paths** (`./services/...`,
|
package/build/engine.d.ts
CHANGED
|
@@ -83,9 +83,17 @@ export declare const engine: {
|
|
|
83
83
|
onHandwritingStatus: (cb: (update: import(".").NeuralBandHandwritingUpdate) => void) => (() => void);
|
|
84
84
|
setPointer: (id: string, enabled: boolean) => Promise<void>;
|
|
85
85
|
setHand: (id: string, hand: "left" | "right") => Promise<void>;
|
|
86
|
+
firmwareStatus: (id: string) => import(".").NeuralBandFirmwareStatus;
|
|
87
|
+
onFirmwareStatus: (cb: (update: {
|
|
88
|
+
id: string;
|
|
89
|
+
status: import(".").NeuralBandFirmwareStatus;
|
|
90
|
+
}) => void) => (() => void);
|
|
91
|
+
refreshFirmware: (id: string) => Promise<import(".").NeuralBandFirmwareStatus>;
|
|
92
|
+
checkFirmware: (id: string) => Promise<void>;
|
|
93
|
+
updateFirmware: (id: string, mode: "update" | "cancel" | "key" | "send" | "trial" | "install") => Promise<void>;
|
|
86
94
|
};
|
|
87
|
-
|
|
88
|
-
availability: () => Promise<import("@glassly/bluetooth-sdk").
|
|
95
|
+
watch: {
|
|
96
|
+
availability: () => Promise<import("@glassly/bluetooth-sdk").WatchAvailability>;
|
|
89
97
|
};
|
|
90
98
|
audio: {
|
|
91
99
|
getMediaVolume: () => Promise<import("@glassly/bluetooth-sdk").GlassesMediaVolumeGetResult>;
|
|
@@ -166,6 +174,8 @@ export declare const engine: {
|
|
|
166
174
|
unload: () => Promise<void>;
|
|
167
175
|
formatBytes: (bytes: number) => string;
|
|
168
176
|
};
|
|
177
|
+
offlineActivity: () => import(".").OfflineActivity;
|
|
178
|
+
onOfflineActivity: (listener: (activity: import(".").OfflineActivity) => void) => (() => void);
|
|
169
179
|
};
|
|
170
180
|
/** Cloud live-session status + account ops — engine owns the client. */
|
|
171
181
|
session: {
|
|
@@ -372,6 +382,12 @@ export declare const engine: {
|
|
|
372
382
|
isBackupError: (err: unknown) => boolean;
|
|
373
383
|
onChanged: (listener: () => void) => (() => void);
|
|
374
384
|
};
|
|
385
|
+
/** Whole-app backup file: settings, miniapp storage, installed list, memory (Settings > Profile). */
|
|
386
|
+
backup: {
|
|
387
|
+
exportFile: () => Promise<import(".").AppStateExportResult>;
|
|
388
|
+
importFile: (opts?: import(".").AppStateRestoreOptions) => Promise<import(".").AppStateRestoreResult | null>;
|
|
389
|
+
isBackupError: (err: unknown) => boolean;
|
|
390
|
+
};
|
|
375
391
|
/** Device-local voice profiles for on-device speaker ID (Settings > Speakers). */
|
|
376
392
|
speakers: {
|
|
377
393
|
getSelf: () => Promise<import(".").SpeakerProfile | null>;
|
package/build/engine.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAC,SAAS,EAAkD,aAAa,EAAC,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAC,SAAS,EAAkD,aAAa,EAAC,MAAM,qBAAqB,CAAA;AAgD5G,eAAO,MAAM,MAAM;IACjB,2EAA2E;;IAE3E,8EAA8E;;IAE9E;iDAC6C;;IAyG7C;;yCAEqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoCrC,kEAAkE;;;;;;;;;;;;;;;;;;;;IAElE,wEAAwE;;;;;;;;IAExE,sEAAsE;;;;;;;;;;;;IAEtE,qFAAqF;;;;gBA3IpE,CAAC;mBAAiB,CAAC;;;gBAMlC,CAFF;mBAAiB,CAAC;;;;;;;;;;;;;;;;;IAyIlB,qEAAqE;;;;IAErE,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEtF,6EAA6E;;;;;;;;;;;;IAE7E,iFAAiF;;;;;;;;;;;;;;;;;;;;;;;;IAEjF,8CAA8C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAE9C,uDAAuD;;;;;;;;;;;;;;;;IAEvD,8EAA8E;;;;;;;;IAE9E,qFAAqF;;;;IAErF,4EAA4E;;;;;;;;;;;IAE5E,+EAA+E;;;;;;;;;;;;;;;IAE/E,qGAAqG;;;;;;IAErG,kFAAkF;;;;;+BArKjE,CAAC;;;+BAUiC,CAAC;;;;;;;;;;;;IA6JpD,mFAAmF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGpF,CAAA"}
|
package/build/engine.js
CHANGED
|
@@ -25,7 +25,7 @@ import { startPhoneActivityTracking, stopPhoneActivityTracking } from "./service
|
|
|
25
25
|
import { startPhoneNotificationsSync, stopPhoneNotificationsSync } from "./services/PhoneNotificationsSync";
|
|
26
26
|
import { startSpeakerIdSync, stopSpeakerIdSync } from "./services/SpeakerIdSync";
|
|
27
27
|
import { startNeuralBandSettingsSync, stopNeuralBandSettingsSync } from "./services/neuralBand/NeuralBandSettingsSync";
|
|
28
|
-
import {
|
|
28
|
+
import { startWatchLink, stopWatchLink } from "./services/watch/WatchLink";
|
|
29
29
|
import { startCaptionsTesterReportService, stopCaptionsTesterReportService } from "./services/CaptionsTesterReportService";
|
|
30
30
|
import { startJSCrashloopReportService, stopJSCrashloopReportService } from "./services/JSCrashloopReportService";
|
|
31
31
|
import { ensureMiniappEngine, stopMiniappEngine } from "./services/MiniappEngine";
|
|
@@ -49,6 +49,7 @@ import { permissions } from "./facades/permissions";
|
|
|
49
49
|
import { notifications } from "./facades/notifications";
|
|
50
50
|
import { maps } from "./facades/maps";
|
|
51
51
|
import { memory } from "./facades/memory";
|
|
52
|
+
import { backup } from "./facades/backup";
|
|
52
53
|
import { speakers } from "./facades/speakers";
|
|
53
54
|
import { providerKeys } from "./facades/providerKeys";
|
|
54
55
|
import { logBuffer } from "./utils/devLogging";
|
|
@@ -143,8 +144,8 @@ export const engine = {
|
|
|
143
144
|
startSpeakerIdSync();
|
|
144
145
|
// Meta Neural Band: push the air mouse and wearing-hand settings to the band on connect.
|
|
145
146
|
startNeuralBandSettingsSync();
|
|
146
|
-
// Apple Watch
|
|
147
|
-
|
|
147
|
+
// Watch remote (Apple Watch on iOS, Wear OS on Android): status and mirror frames out, wrist commands in.
|
|
148
|
+
startWatchLink();
|
|
148
149
|
// Android internal/e2e: laptop captions tester can broadcast a failure intent;
|
|
149
150
|
// engine owns turning that into a Cloud report.
|
|
150
151
|
startCaptionsTesterReportService();
|
|
@@ -190,7 +191,7 @@ export const engine = {
|
|
|
190
191
|
await safely("phone activity tracking", stopPhoneActivityTracking);
|
|
191
192
|
await safely("speaker id sync", stopSpeakerIdSync);
|
|
192
193
|
await safely("neural band settings sync", stopNeuralBandSettingsSync);
|
|
193
|
-
await safely("
|
|
194
|
+
await safely("watch link", stopWatchLink);
|
|
194
195
|
await safely("captions tester report service", stopCaptionsTesterReportService);
|
|
195
196
|
await safely("js crashloop report service", stopJSCrashloopReportService);
|
|
196
197
|
await safely("miniapp engine", stopMiniappEngine);
|
|
@@ -230,6 +231,8 @@ export const engine = {
|
|
|
230
231
|
maps,
|
|
231
232
|
/** Shared user-scoped memory timeline (Settings > Memory + session.memory). */
|
|
232
233
|
memory,
|
|
234
|
+
/** Whole-app backup file: settings, miniapp storage, installed list, memory (Settings > Profile). */
|
|
235
|
+
backup,
|
|
233
236
|
/** Device-local voice profiles for on-device speaker ID (Settings > Speakers). */
|
|
234
237
|
speakers,
|
|
235
238
|
/** AI/voice provider key validation — user-supplied keys (Settings > API Keys). */
|
package/build/engine.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAC,SAAS,EAAE,KAAK,IAAI,cAAc,EAAE,IAAI,IAAI,aAAa,EAAE,aAAa,EAAC,MAAM,qBAAqB,CAAA;AAC5G,OAAO,EAAC,kBAAkB,EAAC,MAAM,+BAA+B,CAAA;AAChE,OAAO,EAAC,kBAAkB,EAAE,6BAA6B,EAAC,MAAM,iCAAiC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FAAmF;IACnF,YAAY;IACZ,OAAO;CACR,CAAA","sourcesContent":["/**\n * `engine` — the namespaced OEM-facing engine API (the \"(A) host API\" from the\n * Phase-1 contract). Host UI calls `engine.<domain>.<method>()`; each domain is a\n * typed facade over the runtime. (Exported from the `@glassly/engine` module, whose\n * name stays `engine` in code; the public API surface is `engine`.)\n *\n * It grows one facade at a time. The migration-era flat store/service exports\n * remain in a private Glassly host package; they shrink as screens move onto\n * `engine.*`.\n */\nimport {configure, start as bootstrapStart, stop as bootstrapStop, updateUiSeams} from \"./runtime/bootstrap\"\nimport {cloudClientService} from \"./services/CloudClientService\"\nimport {hydrateDeviceStore, demoteOrphanedDefaultWearable} from \"./services/DeviceStoreHydration\"\nimport {startPairedGlassesLatch, stopPairedGlassesLatch} from \"./services/PairedGlassesLatch\"\nimport {startMiniappPauseCoordinator, stopMiniappPauseCoordinator} from \"./services/MiniappPauseCoordinator\"\nimport {nativeRestoreLaunchQuery, reconnectAfterBluetoothRestoreLaunch} from \"./services/BluetoothRestoreLaunch\"\nimport {startGlassesSettingsSync, stopGlassesSettingsSync} from \"./services/GlassesSettingsSync\"\nimport {startGlassesStatusProjection, stopGlassesStatusProjection} from \"./services/GlassesStatusProjection\"\nimport {startOtaService, stopOtaService} from \"./services/OtaService\"\nimport {startAudioCloudUplink, stopAudioCloudUplink} from \"./services/AudioCloudUplink\"\nimport sonioxDirectService from \"./services/soniox/SonioxDirectService\"\nimport {startSupportProfileSync, stopSupportProfileSync} from \"./services/SupportProfileSync\"\nimport {startDeviceEventRouter, stopDeviceEventRouter} from \"./services/DeviceEventRouter\"\nimport {startPhoneActivityTracking, stopPhoneActivityTracking} from \"./services/PhoneActivity\"\nimport {startPhoneNotificationsSync, stopPhoneNotificationsSync} from \"./services/PhoneNotificationsSync\"\nimport {startSpeakerIdSync, stopSpeakerIdSync} from \"./services/SpeakerIdSync\"\nimport {startNeuralBandSettingsSync, stopNeuralBandSettingsSync} from \"./services/neuralBand/NeuralBandSettingsSync\"\nimport {startAppleWatchLink, stopAppleWatchLink} from \"./services/appleWatch/AppleWatchLink\"\nimport {startCaptionsTesterReportService, stopCaptionsTesterReportService} from \"./services/CaptionsTesterReportService\"\nimport {startJSCrashloopReportService, stopJSCrashloopReportService} from \"./services/JSCrashloopReportService\"\nimport {ensureMiniappEngine, stopMiniappEngine} from \"./services/MiniappEngine\"\nimport localMiniappRuntime from \"./services/LocalMiniappRuntime\"\nimport displayProcessor from \"./services/DisplayProcessor\"\nimport {gallerySyncService} from \"./services/asg/gallerySyncService\"\nimport {glasses} from \"./facades/glasses\"\nimport {display} from \"./facades/display\"\nimport {speech} from \"./facades/speech\"\nimport {ai} from \"./facades/ai\"\nimport {session} from \"./facades/session\"\nimport {settings} from \"./facades/settings\"\nimport {dev} from \"./facades/dev\"\nimport {reports} from \"./facades/reports\"\nimport {ota} from \"./facades/ota\"\nimport {gallery} from \"./facades/gallery\"\nimport {miniapps} from \"./facades/miniapps\"\nimport {pairing} from \"./facades/pairing\"\nimport {phoneNotifications} from \"./facades/phoneNotifications\"\nimport {permissions} from \"./facades/permissions\"\nimport {notifications} from \"./facades/notifications\"\nimport {maps} from \"./facades/maps\"\nimport {memory} from \"./facades/memory\"\nimport {speakers} from \"./facades/speakers\"\nimport {providerKeys} from \"./facades/providerKeys\"\nimport {logBuffer} from \"./utils/devLogging\"\nimport pageHost from \"./services/pages/PageHost\"\nimport gestureDotsService from \"./services/GestureDotsService\"\n\nexport const engine = {\n /** Front door — hand engine auth + config, then start/stop the runtime. */\n configure,\n /** Merge host-UI seams on a running runtime (scan overlay, wifi setup, …). */\n updateUiSeams,\n /** Start the runtime: mark started + construct/connect the cloud client + begin\n * syncing device settings to the glasses. */\n async start() {\n // Reports attach recent phone logs, so engine owns console interception for\n // OEM hosts too. Idempotent; the Glassly host may start it earlier.\n logBuffer.startConsoleInterception()\n await bootstrapStart()\n // Construct + connect the cloud client so the documented configure()+start()\n // lifecycle yields a live engine.session for OEMs. Idempotent for repeated\n // start() calls.\n cloudClientService.init()\n // Project native device status -> the engine stores (the inbound feed the rest\n // of the runtime reads). Established first so the stores are live before the\n // syncs below react to them.\n startGlassesStatusProjection((changed) => localMiniappRuntime.forwardEvent(\"glasses_connection_state\", changed))\n // Lock + foreground state, read by the dashboard's notification gate and\n // the G2 notification ctrl below; up before either consumer.\n startPhoneActivityTracking()\n // The overlay slot's owner: the designated dashboard miniapp's page shows\n // through it (ADR-0006), so it is up before the miniapp runtime.\n pageHost.start()\n gestureDotsService.start()\n // Route the rest of the inbound device events (wifi/hotspot/gallery -> stores+bus,\n // photo/stream -> coordinators, button/touch/accel/head -> miniapps, save_setting ->\n // store, miniapp_selected -> launcher) so a bare OEM gets device data, not just the\n // Glassly app's MantleManager.\n startDeviceEventRouter()\n // Hydration contract: the native DeviceStore is in-memory and starts empty\n // every launch; seed it from the persisted settings BEFORE start() resolves\n // so every post-start getDefaultDevice() read is a trustworthy two-state\n // answer (no false \"absent\" for genuinely-paired users at cold start).\n // Ordered before startGlassesSettingsSync so the settings load can't\n // double-push through the change subscription. A failed hydration must not\n // brick the runtime: start() continues, and the guards that consume\n // hasDefaultDevice() see the rejection and fail open.\n try {\n await hydrateDeviceStore()\n // Boot repair: a persisted default_wearable without a native default\n // device (identity abandoned mid-pairing, or resurrected from the server\n // before identity stopped syncing) demotes to pending_wearable so hosts\n // render finish-pairing instead of a connect that would throw.\n await demoteOrphanedDefaultWearable()\n } catch (error) {\n console.warn(\"engine.start: device-store hydration failed:\", error instanceof Error ? error.message : error)\n }\n // After the settings load so an already-paired phone latches on this start.\n startPairedGlassesLatch()\n // Pause local miniapps while the paired glasses stay disconnected. Reads\n // the pairing identity, so after the settings load like the latch.\n startMiniappPauseCoordinator()\n // iOS relaunched the app in the background to hand back a preserved glasses link:\n // no screen will ask to connect, so the engine does. Not awaited; start() must not\n // wait on a BLE handshake.\n void reconnectAfterBluetoothRestoreLaunch({\n launchedForRestore: nativeRestoreLaunchQuery(),\n connectDefault: () => glasses.connectDefault(),\n })\n // Project the glasses' OTA events into the store for the engine.ota read surface.\n startOtaService()\n // Forward glasses mic_lc3 frames to the v2 cloud session so cloud transcription\n // works for any host (not just the Glassly app's host-side MantleManager fork).\n startAudioCloudUplink()\n // Phone -> Soniox direct transcription (user-supplied API key). Started\n // after device-store hydration so the persisted key is already loaded.\n sonioxDirectService.start()\n // Not awaited: the exchange behind it is a Core round trip with no client\n // deadline, and start() must resolve offline. The glasses get the token\n // when it lands; identity resolution joins the same single-flight exchange.\n void cloudClientService.syncCoreTokenToBluetooth().catch((error) => {\n console.warn(\n \"engine.start: initial Cloud core token sync failed:\",\n error instanceof Error ? error.message : error,\n )\n })\n startSupportProfileSync()\n // Push device-setting changes to the glasses for ANY host, so\n // engine.glasses.settings.set() reaches the device (not just the Glassly app).\n startGlassesSettingsSync()\n // Same for phone-notification config -> the native listener (Android).\n startPhoneNotificationsSync()\n // On-device speaker identification: sync the enabled setting + enrolled\n // profile centroids to the native SpeakerIdEngine, and start the resolver\n // that annotates cloud transcripts with resolved speaker identities.\n startSpeakerIdSync()\n // Meta Neural Band: push the air mouse and wearing-hand settings to the band on connect.\n startNeuralBandSettingsSync()\n // Apple Watch remote (iOS): status and mirror frames out, wrist commands in.\n startAppleWatchLink()\n // Android internal/e2e: laptop captions tester can broadcast a failure intent;\n // engine owns turning that into a Cloud report.\n startCaptionsTesterReportService()\n // JSRuntime crashloop-disabled is runtime state; engine owns filing the\n // automatic report while hosts only render alert/telemetry side effects.\n startJSCrashloopReportService()\n // Bring up the local-miniapp engine so a bare OEM can run JSRuntime miniapps:\n // the LocalMiniappRuntime (registry + WebView bridge), the JSRuntime router\n // (crust-bound spawn/dispatch pump + launcher wiring), the DisplayProcessor\n // (layout arbitration over the engine stores), and the gallery-sync service.\n // All idempotent — when the Glassly app's host bootstrap also calls these, the\n // second call is a no-op. Host-only crashloop telemetry is attached\n // separately by the Glassly app.\n localMiniappRuntime.initialize()\n ensureMiniappEngine()\n displayProcessor.attachToRuntime()\n gallerySyncService.initialize()\n },\n /** Stop the runtime: tear down the settings sync + cloud client + mark stopped.\n * Each step is guarded so one failing teardown can't skip the rest and leak\n * the remaining runtime services. */\n async stop() {\n const safely = async (label: string, step: () => unknown): Promise<void> => {\n try {\n await step()\n } catch (error) {\n console.warn(`engine.stop: ${label} failed:`, error)\n }\n }\n await safely(\"glasses settings sync\", stopGlassesSettingsSync)\n await safely(\"paired glasses latch\", stopPairedGlassesLatch)\n await safely(\"miniapp pause coordinator\", stopMiniappPauseCoordinator)\n await safely(\"glasses status projection\", stopGlassesStatusProjection)\n await safely(\"device event router\", stopDeviceEventRouter)\n await safely(\"page host\", () => pageHost.stop())\n await safely(\"gesture dots service\", () => gestureDotsService.stop())\n await safely(\"ota service\", stopOtaService)\n await safely(\"audio cloud uplink\", stopAudioCloudUplink)\n await safely(\"soniox direct service\", () => sonioxDirectService.stop())\n await safely(\"support profile sync\", stopSupportProfileSync)\n await safely(\"phone notifications sync\", stopPhoneNotificationsSync)\n await safely(\"phone activity tracking\", stopPhoneActivityTracking)\n await safely(\"speaker id sync\", stopSpeakerIdSync)\n await safely(\"neural band settings sync\", stopNeuralBandSettingsSync)\n await safely(\"apple watch link\", stopAppleWatchLink)\n await safely(\"captions tester report service\", stopCaptionsTesterReportService)\n await safely(\"js crashloop report service\", stopJSCrashloopReportService)\n await safely(\"miniapp engine\", stopMiniappEngine)\n await safely(\"local miniapp runtime\", () => localMiniappRuntime.cleanup())\n await safely(\"display processor\", () => displayProcessor.detachFromRuntime())\n await safely(\"gallery sync service\", () => gallerySyncService.cleanup())\n await safely(\"cloud client\", () => cloudClientService.shutdown())\n await safely(\"bootstrap\", bootstrapStop)\n },\n glasses,\n speech,\n /** On-device LLM model management (Settings > Offline Models). */\n ai,\n /** Cloud live-session status + account ops — engine owns the client. */\n session,\n /** Typed keyed user settings over the engine-owned settings store. */\n settings,\n /** Developer/debug surface (backend+cloud URL overrides, reconnect, min version). */\n dev,\n /** Bug-report, automatic runtime report, and feedback submission. */\n reports,\n /** Firmware OTA read/observe surface (updateAvailable/status + on* subscriptions). */\n ota,\n /** Gallery sync: status/onStatus · onNotice (host renders) · sync/cancel. */\n gallery,\n /** Miniapp lifecycle (the WebView bridge primitives are exported separately). */\n miniapps,\n /** First-time glasses discovery + pairing. */\n pairing,\n /** Phone→glasses notification forwarding (Android). */\n phoneNotifications,\n /** OS permissions (check/request/openSettings + per-miniapp requirements). */\n permissions,\n /** Inbound alerts engine→host (crashloop, version-incompatible, connection loss). */\n notifications,\n /** Maps providers — user-supplied Mapbox access token (Settings > Keys). */\n maps,\n /** Shared user-scoped memory timeline (Settings > Memory + session.memory). */\n memory,\n /** Device-local voice profiles for on-device speaker ID (Settings > Speakers). */\n speakers,\n /** AI/voice provider key validation — user-supplied keys (Settings > API Keys). */\n providerKeys,\n display,\n}\n"]}
|
|
1
|
+
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAC,SAAS,EAAE,KAAK,IAAI,cAAc,EAAE,IAAI,IAAI,aAAa,EAAE,aAAa,EAAC,MAAM,qBAAqB,CAAA;AAC5G,OAAO,EAAC,kBAAkB,EAAC,MAAM,+BAA+B,CAAA;AAChE,OAAO,EAAC,kBAAkB,EAAE,6BAA6B,EAAC,MAAM,iCAAiC,CAAA;AACjG,OAAO,EAAC,uBAAuB,EAAE,sBAAsB,EAAC,MAAM,+BAA+B,CAAA;AAC7F,OAAO,EAAC,4BAA4B,EAAE,2BAA2B,EAAC,MAAM,oCAAoC,CAAA;AAC5G,OAAO,EAAC,wBAAwB,EAAE,oCAAoC,EAAC,MAAM,mCAAmC,CAAA;AAChH,OAAO,EAAC,wBAAwB,EAAE,uBAAuB,EAAC,MAAM,gCAAgC,CAAA;AAChG,OAAO,EAAC,4BAA4B,EAAE,2BAA2B,EAAC,MAAM,oCAAoC,CAAA;AAC5G,OAAO,EAAC,eAAe,EAAE,cAAc,EAAC,MAAM,uBAAuB,CAAA;AACr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,CAAC,uBAAuB,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,OAAO,EAAE,CAAC,CAAA;QAC1E,MAAM,MAAM,CAAC,mBAAmB,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,CAAC,CAAA;QAC7E,MAAM,MAAM,CAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,OAAO,EAAE,CAAC,CAAA;QACxE,MAAM,MAAM,CAAC,cAAc,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,QAAQ,EAAE,CAAC,CAAA;QACjE,MAAM,MAAM,CAAC,WAAW,EAAE,aAAa,CAAC,CAAA;IAC1C,CAAC;IACD,OAAO;IACP,MAAM;IACN,kEAAkE;IAClE,EAAE;IACF,wEAAwE;IACxE,OAAO;IACP,sEAAsE;IACtE,QAAQ;IACR,qFAAqF;IACrF,GAAG;IACH,qEAAqE;IACrE,OAAO;IACP,sFAAsF;IACtF,GAAG;IACH,6EAA6E;IAC7E,OAAO;IACP,iFAAiF;IACjF,QAAQ;IACR,8CAA8C;IAC9C,OAAO;IACP,uDAAuD;IACvD,kBAAkB;IAClB,8EAA8E;IAC9E,WAAW;IACX,qFAAqF;IACrF,aAAa;IACb,4EAA4E;IAC5E,IAAI;IACJ,+EAA+E;IAC/E,MAAM;IACN,qGAAqG;IACrG,MAAM;IACN,kFAAkF;IAClF,QAAQ;IACR,mFAAmF;IACnF,YAAY;IACZ,OAAO;CACR,CAAA","sourcesContent":["/**\n * `engine` — the namespaced OEM-facing engine API (the \"(A) host API\" from the\n * Phase-1 contract). Host UI calls `engine.<domain>.<method>()`; each domain is a\n * typed facade over the runtime. (Exported from the `@glassly/engine` module, whose\n * name stays `engine` in code; the public API surface is `engine`.)\n *\n * It grows one facade at a time. The migration-era flat store/service exports\n * remain in a private Glassly host package; they shrink as screens move onto\n * `engine.*`.\n */\nimport {configure, start as bootstrapStart, stop as bootstrapStop, updateUiSeams} from \"./runtime/bootstrap\"\nimport {cloudClientService} from \"./services/CloudClientService\"\nimport {hydrateDeviceStore, demoteOrphanedDefaultWearable} from \"./services/DeviceStoreHydration\"\nimport {startPairedGlassesLatch, stopPairedGlassesLatch} from \"./services/PairedGlassesLatch\"\nimport {startMiniappPauseCoordinator, stopMiniappPauseCoordinator} from \"./services/MiniappPauseCoordinator\"\nimport {nativeRestoreLaunchQuery, reconnectAfterBluetoothRestoreLaunch} from \"./services/BluetoothRestoreLaunch\"\nimport {startGlassesSettingsSync, stopGlassesSettingsSync} from \"./services/GlassesSettingsSync\"\nimport {startGlassesStatusProjection, stopGlassesStatusProjection} from \"./services/GlassesStatusProjection\"\nimport {startOtaService, stopOtaService} from \"./services/OtaService\"\nimport {startAudioCloudUplink, stopAudioCloudUplink} from \"./services/AudioCloudUplink\"\nimport sonioxDirectService from \"./services/soniox/SonioxDirectService\"\nimport {startSupportProfileSync, stopSupportProfileSync} from \"./services/SupportProfileSync\"\nimport {startDeviceEventRouter, stopDeviceEventRouter} from \"./services/DeviceEventRouter\"\nimport {startPhoneActivityTracking, stopPhoneActivityTracking} from \"./services/PhoneActivity\"\nimport {startPhoneNotificationsSync, stopPhoneNotificationsSync} from \"./services/PhoneNotificationsSync\"\nimport {startSpeakerIdSync, stopSpeakerIdSync} from \"./services/SpeakerIdSync\"\nimport {startNeuralBandSettingsSync, stopNeuralBandSettingsSync} from \"./services/neuralBand/NeuralBandSettingsSync\"\nimport {startWatchLink, stopWatchLink} from \"./services/watch/WatchLink\"\nimport {startCaptionsTesterReportService, stopCaptionsTesterReportService} from \"./services/CaptionsTesterReportService\"\nimport {startJSCrashloopReportService, stopJSCrashloopReportService} from \"./services/JSCrashloopReportService\"\nimport {ensureMiniappEngine, stopMiniappEngine} from \"./services/MiniappEngine\"\nimport localMiniappRuntime from \"./services/LocalMiniappRuntime\"\nimport displayProcessor from \"./services/DisplayProcessor\"\nimport {gallerySyncService} from \"./services/asg/gallerySyncService\"\nimport {glasses} from \"./facades/glasses\"\nimport {display} from \"./facades/display\"\nimport {speech} from \"./facades/speech\"\nimport {ai} from \"./facades/ai\"\nimport {session} from \"./facades/session\"\nimport {settings} from \"./facades/settings\"\nimport {dev} from \"./facades/dev\"\nimport {reports} from \"./facades/reports\"\nimport {ota} from \"./facades/ota\"\nimport {gallery} from \"./facades/gallery\"\nimport {miniapps} from \"./facades/miniapps\"\nimport {pairing} from \"./facades/pairing\"\nimport {phoneNotifications} from \"./facades/phoneNotifications\"\nimport {permissions} from \"./facades/permissions\"\nimport {notifications} from \"./facades/notifications\"\nimport {maps} from \"./facades/maps\"\nimport {memory} from \"./facades/memory\"\nimport {backup} from \"./facades/backup\"\nimport {speakers} from \"./facades/speakers\"\nimport {providerKeys} from \"./facades/providerKeys\"\nimport {logBuffer} from \"./utils/devLogging\"\nimport pageHost from \"./services/pages/PageHost\"\nimport gestureDotsService from \"./services/GestureDotsService\"\n\nexport const engine = {\n /** Front door — hand engine auth + config, then start/stop the runtime. */\n configure,\n /** Merge host-UI seams on a running runtime (scan overlay, wifi setup, …). */\n updateUiSeams,\n /** Start the runtime: mark started + construct/connect the cloud client + begin\n * syncing device settings to the glasses. */\n async start() {\n // Reports attach recent phone logs, so engine owns console interception for\n // OEM hosts too. Idempotent; the Glassly host may start it earlier.\n logBuffer.startConsoleInterception()\n await bootstrapStart()\n // Construct + connect the cloud client so the documented configure()+start()\n // lifecycle yields a live engine.session for OEMs. Idempotent for repeated\n // start() calls.\n cloudClientService.init()\n // Project native device status -> the engine stores (the inbound feed the rest\n // of the runtime reads). Established first so the stores are live before the\n // syncs below react to them.\n startGlassesStatusProjection((changed) => localMiniappRuntime.forwardEvent(\"glasses_connection_state\", changed))\n // Lock + foreground state, read by the dashboard's notification gate and\n // the G2 notification ctrl below; up before either consumer.\n startPhoneActivityTracking()\n // The overlay slot's owner: the designated dashboard miniapp's page shows\n // through it (ADR-0006), so it is up before the miniapp runtime.\n pageHost.start()\n gestureDotsService.start()\n // Route the rest of the inbound device events (wifi/hotspot/gallery -> stores+bus,\n // photo/stream -> coordinators, button/touch/accel/head -> miniapps, save_setting ->\n // store, miniapp_selected -> launcher) so a bare OEM gets device data, not just the\n // Glassly app's MantleManager.\n startDeviceEventRouter()\n // Hydration contract: the native DeviceStore is in-memory and starts empty\n // every launch; seed it from the persisted settings BEFORE start() resolves\n // so every post-start getDefaultDevice() read is a trustworthy two-state\n // answer (no false \"absent\" for genuinely-paired users at cold start).\n // Ordered before startGlassesSettingsSync so the settings load can't\n // double-push through the change subscription. A failed hydration must not\n // brick the runtime: start() continues, and the guards that consume\n // hasDefaultDevice() see the rejection and fail open.\n try {\n await hydrateDeviceStore()\n // Boot repair: a persisted default_wearable without a native default\n // device (identity abandoned mid-pairing, or resurrected from the server\n // before identity stopped syncing) demotes to pending_wearable so hosts\n // render finish-pairing instead of a connect that would throw.\n await demoteOrphanedDefaultWearable()\n } catch (error) {\n console.warn(\"engine.start: device-store hydration failed:\", error instanceof Error ? error.message : error)\n }\n // After the settings load so an already-paired phone latches on this start.\n startPairedGlassesLatch()\n // Pause local miniapps while the paired glasses stay disconnected. Reads\n // the pairing identity, so after the settings load like the latch.\n startMiniappPauseCoordinator()\n // iOS relaunched the app in the background to hand back a preserved glasses link:\n // no screen will ask to connect, so the engine does. Not awaited; start() must not\n // wait on a BLE handshake.\n void reconnectAfterBluetoothRestoreLaunch({\n launchedForRestore: nativeRestoreLaunchQuery(),\n connectDefault: () => glasses.connectDefault(),\n })\n // Project the glasses' OTA events into the store for the engine.ota read surface.\n startOtaService()\n // Forward glasses mic_lc3 frames to the v2 cloud session so cloud transcription\n // works for any host (not just the Glassly app's host-side MantleManager fork).\n startAudioCloudUplink()\n // Phone -> Soniox direct transcription (user-supplied API key). Started\n // after device-store hydration so the persisted key is already loaded.\n sonioxDirectService.start()\n // Not awaited: the exchange behind it is a Core round trip with no client\n // deadline, and start() must resolve offline. The glasses get the token\n // when it lands; identity resolution joins the same single-flight exchange.\n void cloudClientService.syncCoreTokenToBluetooth().catch((error) => {\n console.warn(\n \"engine.start: initial Cloud core token sync failed:\",\n error instanceof Error ? error.message : error,\n )\n })\n startSupportProfileSync()\n // Push device-setting changes to the glasses for ANY host, so\n // engine.glasses.settings.set() reaches the device (not just the Glassly app).\n startGlassesSettingsSync()\n // Same for phone-notification config -> the native listener (Android).\n startPhoneNotificationsSync()\n // On-device speaker identification: sync the enabled setting + enrolled\n // profile centroids to the native SpeakerIdEngine, and start the resolver\n // that annotates cloud transcripts with resolved speaker identities.\n startSpeakerIdSync()\n // Meta Neural Band: push the air mouse and wearing-hand settings to the band on connect.\n startNeuralBandSettingsSync()\n // Watch remote (Apple Watch on iOS, Wear OS on Android): status and mirror frames out, wrist commands in.\n startWatchLink()\n // Android internal/e2e: laptop captions tester can broadcast a failure intent;\n // engine owns turning that into a Cloud report.\n startCaptionsTesterReportService()\n // JSRuntime crashloop-disabled is runtime state; engine owns filing the\n // automatic report while hosts only render alert/telemetry side effects.\n startJSCrashloopReportService()\n // Bring up the local-miniapp engine so a bare OEM can run JSRuntime miniapps:\n // the LocalMiniappRuntime (registry + WebView bridge), the JSRuntime router\n // (crust-bound spawn/dispatch pump + launcher wiring), the DisplayProcessor\n // (layout arbitration over the engine stores), and the gallery-sync service.\n // All idempotent — when the Glassly app's host bootstrap also calls these, the\n // second call is a no-op. Host-only crashloop telemetry is attached\n // separately by the Glassly app.\n localMiniappRuntime.initialize()\n ensureMiniappEngine()\n displayProcessor.attachToRuntime()\n gallerySyncService.initialize()\n },\n /** Stop the runtime: tear down the settings sync + cloud client + mark stopped.\n * Each step is guarded so one failing teardown can't skip the rest and leak\n * the remaining runtime services. */\n async stop() {\n const safely = async (label: string, step: () => unknown): Promise<void> => {\n try {\n await step()\n } catch (error) {\n console.warn(`engine.stop: ${label} failed:`, error)\n }\n }\n await safely(\"glasses settings sync\", stopGlassesSettingsSync)\n await safely(\"paired glasses latch\", stopPairedGlassesLatch)\n await safely(\"miniapp pause coordinator\", stopMiniappPauseCoordinator)\n await safely(\"glasses status projection\", stopGlassesStatusProjection)\n await safely(\"device event router\", stopDeviceEventRouter)\n await safely(\"page host\", () => pageHost.stop())\n await safely(\"gesture dots service\", () => gestureDotsService.stop())\n await safely(\"ota service\", stopOtaService)\n await safely(\"audio cloud uplink\", stopAudioCloudUplink)\n await safely(\"soniox direct service\", () => sonioxDirectService.stop())\n await safely(\"support profile sync\", stopSupportProfileSync)\n await safely(\"phone notifications sync\", stopPhoneNotificationsSync)\n await safely(\"phone activity tracking\", stopPhoneActivityTracking)\n await safely(\"speaker id sync\", stopSpeakerIdSync)\n await safely(\"neural band settings sync\", stopNeuralBandSettingsSync)\n await safely(\"watch link\", stopWatchLink)\n await safely(\"captions tester report service\", stopCaptionsTesterReportService)\n await safely(\"js crashloop report service\", stopJSCrashloopReportService)\n await safely(\"miniapp engine\", stopMiniappEngine)\n await safely(\"local miniapp runtime\", () => localMiniappRuntime.cleanup())\n await safely(\"display processor\", () => displayProcessor.detachFromRuntime())\n await safely(\"gallery sync service\", () => gallerySyncService.cleanup())\n await safely(\"cloud client\", () => cloudClientService.shutdown())\n await safely(\"bootstrap\", bootstrapStop)\n },\n glasses,\n speech,\n /** On-device LLM model management (Settings > Offline Models). */\n ai,\n /** Cloud live-session status + account ops — engine owns the client. */\n session,\n /** Typed keyed user settings over the engine-owned settings store. */\n settings,\n /** Developer/debug surface (backend+cloud URL overrides, reconnect, min version). */\n dev,\n /** Bug-report, automatic runtime report, and feedback submission. */\n reports,\n /** Firmware OTA read/observe surface (updateAvailable/status + on* subscriptions). */\n ota,\n /** Gallery sync: status/onStatus · onNotice (host renders) · sync/cancel. */\n gallery,\n /** Miniapp lifecycle (the WebView bridge primitives are exported separately). */\n miniapps,\n /** First-time glasses discovery + pairing. */\n pairing,\n /** Phone→glasses notification forwarding (Android). */\n phoneNotifications,\n /** OS permissions (check/request/openSettings + per-miniapp requirements). */\n permissions,\n /** Inbound alerts engine→host (crashloop, version-incompatible, connection loss). */\n notifications,\n /** Maps providers — user-supplied Mapbox access token (Settings > Keys). */\n maps,\n /** Shared user-scoped memory timeline (Settings > Memory + session.memory). */\n memory,\n /** Whole-app backup file: settings, miniapp storage, installed list, memory (Settings > Profile). */\n backup,\n /** Device-local voice profiles for on-device speaker ID (Settings > Speakers). */\n speakers,\n /** AI/voice provider key validation — user-supplied keys (Settings > API Keys). */\n providerKeys,\n display,\n}\n"]}
|
package/build/facades/ai.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* reaching into engine internals.
|
|
7
7
|
*/
|
|
8
8
|
import { type LocalLlmDownloadStatus, type LocalLlmModelConfig, type LocalLlmModelId } from "../services/LocalLlmModelManager";
|
|
9
|
+
import { type OfflineActivity } from "../services/OfflineActivity";
|
|
9
10
|
export declare const ai: {
|
|
10
11
|
local: {
|
|
11
12
|
/** The catalog, in dropdown order. */
|
|
@@ -28,5 +29,7 @@ export declare const ai: {
|
|
|
28
29
|
unload: () => Promise<void>;
|
|
29
30
|
formatBytes: (bytes: number) => string;
|
|
30
31
|
};
|
|
32
|
+
offlineActivity: () => OfflineActivity;
|
|
33
|
+
onOfflineActivity: (listener: (activity: OfflineActivity) => void) => (() => void);
|
|
31
34
|
};
|
|
32
35
|
//# sourceMappingURL=ai.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../../src/facades/ai.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAA6B,EAE3B,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACrB,MAAM,kCAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../../src/facades/ai.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAA6B,EAE3B,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACrB,MAAM,kCAAkC,CAAA;AAEzC,OAAwB,EAAC,KAAK,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAEjF,eAAO,MAAM,EAAE;;QAEX,sCAAsC;sBAC1B,mBAAmB,EAAE;QACjC,0CAA0C;+BACrB,eAAe;qBACvB,eAAe,KAAG,OAAO,CAAC,IAAI,CAAC;4BACxB,eAAe,KAAG,OAAO,CAAC,OAAO,CAAC;kCAC9B,OAAO,CAAC,eAAe,EAAE,CAAC;wBAClC,eAAe,KAAG,OAAO,CAAC,IAAI,CAAC;8BAC3B,OAAO,CAAC,IAAI,CAAC;QACjC,4EAA4E;2BACnD,eAAe,KAAG,OAAO,CAAC,IAAI,CAAC;sBAK5C,sBAAsB,GAAG,IAAI;QACzC,uFAAuF;oCAC3D,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC;QAE1F,uDAAuD;wBACzC,OAAO;QACrB,4DAA4D;sBAChD,OAAO,CAAC,IAAI,CAAC;6BACJ,MAAM,KAAG,MAAM;;2BAEjB,eAAe;kCACN,CAAC,QAAQ,EAAE,eAAe,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC;CAEjF,CAAA"}
|
package/build/facades/ai.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import localLlmModelManager, { LocalLlmModelManager, } from "../services/LocalLlmModelManager";
|
|
9
9
|
import localLlmProvider from "../services/LocalLlmProvider";
|
|
10
|
+
import offlineActivity from "../services/OfflineActivity";
|
|
10
11
|
export const ai = {
|
|
11
12
|
local: {
|
|
12
13
|
/** The catalog, in dropdown order. */
|
|
@@ -34,5 +35,7 @@ export const ai = {
|
|
|
34
35
|
unload: () => localLlmProvider.unload(),
|
|
35
36
|
formatBytes: (bytes) => LocalLlmModelManager.formatBytes(bytes),
|
|
36
37
|
},
|
|
38
|
+
offlineActivity: () => offlineActivity.current(),
|
|
39
|
+
onOfflineActivity: (listener) => offlineActivity.subscribe(listener),
|
|
37
40
|
};
|
|
38
41
|
//# sourceMappingURL=ai.js.map
|
package/build/facades/ai.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.js","sourceRoot":"","sources":["../../src/facades/ai.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,oBAAoB,EAAE,EAC3B,oBAAoB,GAIrB,MAAM,kCAAkC,CAAA;AACzC,OAAO,gBAAgB,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"ai.js","sourceRoot":"","sources":["../../src/facades/ai.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,oBAAoB,EAAE,EAC3B,oBAAoB,GAIrB,MAAM,kCAAkC,CAAA;AACzC,OAAO,gBAAgB,MAAM,8BAA8B,CAAA;AAC3D,OAAO,eAAuC,MAAM,6BAA6B,CAAA;AAEjF,MAAM,CAAC,MAAM,EAAE,GAAG;IAChB,KAAK,EAAE;QACL,sCAAsC;QACtC,MAAM,EAAE,GAA0B,EAAE,CAAC,oBAAoB,CAAC,MAAM,EAAE;QAClE,0CAA0C;QAC1C,eAAe,EAAE,GAAoB,EAAE,CAAC,oBAAoB,CAAC,eAAe,EAAE;QAC9E,MAAM,EAAE,CAAC,EAAmB,EAAiB,EAAE,CAAC,oBAAoB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC/E,YAAY,EAAE,CAAC,EAAoB,EAAoB,EAAE,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACnG,kBAAkB,EAAE,GAA+B,EAAE,CAAC,oBAAoB,CAAC,kBAAkB,EAAE;QAC/F,QAAQ,EAAE,CAAC,EAAoB,EAAiB,EAAE,CAAC,oBAAoB,CAAC,aAAa,CAAC,EAAE,CAAC;QACzF,cAAc,EAAE,GAAkB,EAAE,CAAC,oBAAoB,CAAC,cAAc,EAAE;QAC1E,4EAA4E;QAC5E,WAAW,EAAE,KAAK,EAAE,EAAoB,EAAiB,EAAE;YACzD,MAAM,MAAM,GAAG,EAAE,IAAI,oBAAoB,CAAC,eAAe,EAAE,CAAA;YAC3D,IAAI,gBAAgB,CAAC,aAAa,EAAE,KAAK,MAAM;gBAAE,MAAM,gBAAgB,CAAC,MAAM,EAAE,CAAA;YAChF,MAAM,oBAAoB,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;QAChD,CAAC;QACD,MAAM,EAAE,GAAkC,EAAE,CAAC,oBAAoB,CAAC,SAAS,EAAE;QAC7E,uFAAuF;QACvF,eAAe,EAAE,CAAC,QAAyD,EAAgB,EAAE,CAC3F,oBAAoB,CAAC,SAAS,CAAC,QAAQ,CAAC;QAC1C,uDAAuD;QACvD,QAAQ,EAAE,GAAY,EAAE,CAAC,gBAAgB,CAAC,QAAQ,EAAE;QACpD,4DAA4D;QAC5D,MAAM,EAAE,GAAkB,EAAE,CAAC,gBAAgB,CAAC,MAAM,EAAE;QACtD,WAAW,EAAE,CAAC,KAAa,EAAU,EAAE,CAAC,oBAAoB,CAAC,WAAW,CAAC,KAAK,CAAC;KAChF;IACD,eAAe,EAAE,GAAoB,EAAE,CAAC,eAAe,CAAC,OAAO,EAAE;IACjE,iBAAiB,EAAE,CAAC,QAA6C,EAAgB,EAAE,CACjF,eAAe,CAAC,SAAS,CAAC,QAAQ,CAAC;CACtC,CAAA","sourcesContent":["/**\n * ai facade — `engine.ai.local`: the on-device LLM model that serves\n * session.ai calls routed to the phone (forceLocal / localFallback). Thin\n * passthrough over LocalLlmModelManager and LocalLlmProvider so Settings >\n * Offline Models can list, pick, download, and delete models without\n * reaching into engine internals.\n */\nimport localLlmModelManager, {\n LocalLlmModelManager,\n type LocalLlmDownloadStatus,\n type LocalLlmModelConfig,\n type LocalLlmModelId,\n} from \"../services/LocalLlmModelManager\"\nimport localLlmProvider from \"../services/LocalLlmProvider\"\nimport offlineActivity, {type OfflineActivity} from \"../services/OfflineActivity\"\n\nexport const ai = {\n local: {\n /** The catalog, in dropdown order. */\n models: (): LocalLlmModelConfig[] => localLlmModelManager.models(),\n /** The Settings > Offline Models pick. */\n selectedModelId: (): LocalLlmModelId => localLlmModelManager.selectedModelId(),\n select: (id: LocalLlmModelId): Promise<void> => localLlmModelManager.select(id),\n isDownloaded: (id?: LocalLlmModelId): Promise<boolean> => localLlmModelManager.isModelAvailable(id),\n downloadedModelIds: (): Promise<LocalLlmModelId[]> => localLlmModelManager.downloadedModelIds(),\n download: (id?: LocalLlmModelId): Promise<void> => localLlmModelManager.downloadModel(id),\n cancelDownload: (): Promise<void> => localLlmModelManager.cancelDownload(),\n /** Removes the files and drops the resident runner if it was this model. */\n deleteModel: async (id?: LocalLlmModelId): Promise<void> => {\n const target = id ?? localLlmModelManager.selectedModelId()\n if (localLlmProvider.loadedModelId() === target) await localLlmProvider.unload()\n await localLlmModelManager.deleteModel(target)\n },\n status: (): LocalLlmDownloadStatus | null => localLlmModelManager.getStatus(),\n /** Subscribe to download status changes; fires immediately, returns an unsubscribe. */\n onStatusChanged: (listener: (status: LocalLlmDownloadStatus | null) => void): (() => void) =>\n localLlmModelManager.subscribe(listener),\n /** Whether a model is resident in memory right now. */\n isLoaded: (): boolean => localLlmProvider.isLoaded(),\n /** Drop the resident model (memory pressure, debugging). */\n unload: (): Promise<void> => localLlmProvider.unload(),\n formatBytes: (bytes: number): string => LocalLlmModelManager.formatBytes(bytes),\n },\n offlineActivity: (): OfflineActivity => offlineActivity.current(),\n onOfflineActivity: (listener: (activity: OfflineActivity) => void): (() => void) =>\n offlineActivity.subscribe(listener),\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type AppStateExportResult, type AppStateRestoreOptions, type AppStateRestoreResult } from "../services/appStateBackupFile";
|
|
2
|
+
export declare const backup: {
|
|
3
|
+
/** Share the app state as a JSON backup file. */
|
|
4
|
+
exportFile: () => Promise<AppStateExportResult>;
|
|
5
|
+
/**
|
|
6
|
+
* Pick a backup file and restore it: backup values overwrite per key, and
|
|
7
|
+
* running miniapps whose storage changed restart after `opts.reinstall` has
|
|
8
|
+
* installed the ones this phone lacks. Resolves null on cancel.
|
|
9
|
+
*/
|
|
10
|
+
importFile: (opts?: AppStateRestoreOptions) => Promise<AppStateRestoreResult | null>;
|
|
11
|
+
/** True for a file that isn't a backup this build can read. */
|
|
12
|
+
isBackupError: (err: unknown) => boolean;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=backup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backup.d.ts","sourceRoot":"","sources":["../../src/facades/backup.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC3B,MAAM,gCAAgC,CAAA;AAGvC,eAAO,MAAM,MAAM;IACjB,iDAAiD;sBACjC,OAAO,CAAC,oBAAoB,CAAC;IAC7C;;;;OAIG;wBACiB,sBAAsB,KAAG,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC;IAClF,+DAA+D;yBAC1C,OAAO,KAAG,OAAO;CACvC,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* backup facade — `engine.backup`: the whole-app backup behind Settings >
|
|
3
|
+
* Profile > Backup. One JSON file carries system settings, every miniapp's
|
|
4
|
+
* storage (so their sign-ins survive a logout or reinstall), the installed
|
|
5
|
+
* miniapp list, and the memory timeline.
|
|
6
|
+
*/
|
|
7
|
+
import { AppStateBackupError } from "../services/AppStateBackup";
|
|
8
|
+
import { exportAppStateFile, importAppStateFile, } from "../services/appStateBackupFile";
|
|
9
|
+
import { MemoryBackupError } from "../services/MemoryStore";
|
|
10
|
+
export const backup = {
|
|
11
|
+
/** Share the app state as a JSON backup file. */
|
|
12
|
+
exportFile: () => exportAppStateFile(),
|
|
13
|
+
/**
|
|
14
|
+
* Pick a backup file and restore it: backup values overwrite per key, and
|
|
15
|
+
* running miniapps whose storage changed restart after `opts.reinstall` has
|
|
16
|
+
* installed the ones this phone lacks. Resolves null on cancel.
|
|
17
|
+
*/
|
|
18
|
+
importFile: (opts) => importAppStateFile(opts),
|
|
19
|
+
/** True for a file that isn't a backup this build can read. */
|
|
20
|
+
isBackupError: (err) => err instanceof AppStateBackupError || err instanceof MemoryBackupError,
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=backup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backup.js","sourceRoot":"","sources":["../../src/facades/backup.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAC,mBAAmB,EAAC,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GAInB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAA;AAEzD,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,iDAAiD;IACjD,UAAU,EAAE,GAAkC,EAAE,CAAC,kBAAkB,EAAE;IACrE;;;;OAIG;IACH,UAAU,EAAE,CAAC,IAA6B,EAAyC,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC;IAC9G,+DAA+D;IAC/D,aAAa,EAAE,CAAC,GAAY,EAAW,EAAE,CAAC,GAAG,YAAY,mBAAmB,IAAI,GAAG,YAAY,iBAAiB;CACjH,CAAA","sourcesContent":["/**\n * backup facade — `engine.backup`: the whole-app backup behind Settings >\n * Profile > Backup. One JSON file carries system settings, every miniapp's\n * storage (so their sign-ins survive a logout or reinstall), the installed\n * miniapp list, and the memory timeline.\n */\nimport {AppStateBackupError} from \"../services/AppStateBackup\"\nimport {\n exportAppStateFile,\n importAppStateFile,\n type AppStateExportResult,\n type AppStateRestoreOptions,\n type AppStateRestoreResult,\n} from \"../services/appStateBackupFile\"\nimport {MemoryBackupError} from \"../services/MemoryStore\"\n\nexport const backup = {\n /** Share the app state as a JSON backup file. */\n exportFile: (): Promise<AppStateExportResult> => exportAppStateFile(),\n /**\n * Pick a backup file and restore it: backup values overwrite per key, and\n * running miniapps whose storage changed restart after `opts.reinstall` has\n * installed the ones this phone lacks. Resolves null on cancel.\n */\n importFile: (opts?: AppStateRestoreOptions): Promise<AppStateRestoreResult | null> => importAppStateFile(opts),\n /** True for a file that isn't a backup this build can read. */\n isBackupError: (err: unknown): boolean => err instanceof AppStateBackupError || err instanceof MemoryBackupError,\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { type NeuralBandClaimStatus, type NeuralBandHandwritingStatus, type NeuralBandHandwritingUpdate } from "../services/neuralBand/NeuralBandInput";
|
|
1
|
+
import type { WatchAvailability, ButtonPressEvent, ConnectOptions, ControllerStatus, Device, KeyboardAdvertEvent, KeyboardPairingEvent, PairedController, TouchEvent } from "@glassly/bluetooth-sdk";
|
|
2
|
+
import { type NeuralBandClaimStatus, type NeuralBandFirmwareStatus, type NeuralBandHandwritingStatus, type NeuralBandHandwritingUpdate } from "../services/neuralBand/NeuralBandInput";
|
|
3
3
|
declare function projectStatus(): {
|
|
4
4
|
state: "connecting" | "connected" | "disconnected" | "scanning" | "bonding";
|
|
5
5
|
fullyBooted: boolean;
|
|
@@ -164,10 +164,18 @@ export declare const glasses: {
|
|
|
164
164
|
/** The band's air mouse; movement reaches miniapps on the pointer stream. */
|
|
165
165
|
setPointer: (id: string, enabled: boolean) => Promise<void>;
|
|
166
166
|
setHand: (id: string, hand: "left" | "right") => Promise<void>;
|
|
167
|
+
firmwareStatus: (id: string) => NeuralBandFirmwareStatus;
|
|
168
|
+
onFirmwareStatus: (cb: (update: {
|
|
169
|
+
id: string;
|
|
170
|
+
status: NeuralBandFirmwareStatus;
|
|
171
|
+
}) => void) => (() => void);
|
|
172
|
+
refreshFirmware: (id: string) => Promise<NeuralBandFirmwareStatus>;
|
|
173
|
+
checkFirmware: (id: string) => Promise<void>;
|
|
174
|
+
updateFirmware: (id: string, mode: "update" | "cancel" | "key" | "send" | "trial" | "install") => Promise<void>;
|
|
167
175
|
};
|
|
168
|
-
|
|
169
|
-
/** Whether this
|
|
170
|
-
availability: () => Promise<
|
|
176
|
+
watch: {
|
|
177
|
+
/** Whether this phone has a paired watch and the Glassly watch app is on it. */
|
|
178
|
+
availability: () => Promise<WatchAvailability>;
|
|
171
179
|
};
|
|
172
180
|
audio: {
|
|
173
181
|
/** Read the glasses' current media volume. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glasses.d.ts","sourceRoot":"","sources":["../../src/facades/glasses.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"glasses.d.ts","sourceRoot":"","sources":["../../src/facades/glasses.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,MAAM,EACN,mBAAmB,EACnB,oBAAoB,EAEpB,gBAAgB,EAChB,UAAU,EACX,MAAM,wBAAwB,CAAA;AAgB/B,OAAwB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EACjC,MAAM,wCAAwC,CAAA;AAW/C,iBAAS,aAAa;;;;;;;;;;;;;;;;EAkBrB;AAsCD,iBAAS,qBAAqB;IAG1B,sFAAsF;;;;IAItF,6DAA6D;;;;EAKhE;AAED,iBAAS,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGnB;AA4BD,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAA;AACpE,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAC7E,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAA;AAEhE,eAAO,MAAM,OAAO;IAElB;;;;OAIG;0BACuB,OAAO,CAAC,IAAI,CAAC;sBASvB,OAAO,CAAC,IAAI,CAAC;kBACjB,OAAO,CAAC,IAAI,CAAC;IACzB,iDAAiD;sBACzB,MAAM,YAAY,cAAc,KAAG,OAAO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QAAQ,MAAM,GAAG,OAAO,KAAG,OAAO,CAAC,IAAI,CAAC;6BACvC,MAAM,KAAG,wBAAwB;+BAC/B,CAAC,MAAM,EAAE;YAAC,EAAE,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,wBAAwB,CAAA;SAAC,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC;8BAE1E,MAAM,KAAG,OAAO,CAAC,wBAAwB,CAAC;4BASlD,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;6BACrB,MAAM,QAAQ,QAAQ,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,KAAG,OAAO,CAAC,IAAI,CAAC;;;QAM7G,gFAAgF;4BAC9D,OAAO,CAAC,iBAAiB,CAAC;;;QAK5C,8CAA8C;;QAE9C,qCAAqC;gCACb,MAAM;QAC9B,6EAA6E;oCACjD,OAAO,KAAG,OAAO,CAAC,IAAI,CAAC;QACnD;;;;WAIG;yBACc,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC;;;;;;;;;;;;;;;;;CAgBzD,CAAA"}
|
package/build/facades/glasses.js
CHANGED
|
@@ -301,11 +301,24 @@ export const glasses = {
|
|
|
301
301
|
/** The band's air mouse; movement reaches miniapps on the pointer stream. */
|
|
302
302
|
setPointer: (id, enabled) => BluetoothSdk.neuralBandSetPointer(id, enabled),
|
|
303
303
|
setHand: (id, hand) => BluetoothSdk.neuralBandSetHand(id, hand),
|
|
304
|
+
firmwareStatus: (id) => ({ ...neuralBandInput.firmwareStatus(id) }),
|
|
305
|
+
onFirmwareStatus: (cb) => neuralBandInput.onFirmwareStatus(cb),
|
|
306
|
+
refreshFirmware: async (id) => {
|
|
307
|
+
const info = await BluetoothSdk.neuralBandFirmwareInfo(id);
|
|
308
|
+
neuralBandInput.handleFirmware({
|
|
309
|
+
...info,
|
|
310
|
+
type: "neural_band_firmware",
|
|
311
|
+
controllerId: id,
|
|
312
|
+
});
|
|
313
|
+
return neuralBandInput.firmwareStatus(id);
|
|
314
|
+
},
|
|
315
|
+
checkFirmware: (id) => BluetoothSdk.neuralBandCheckFirmware(id),
|
|
316
|
+
updateFirmware: (id, mode) => BluetoothSdk.neuralBandUpdateFirmware(id, mode),
|
|
304
317
|
},
|
|
305
|
-
// --- Apple Watch (iOS)
|
|
306
|
-
|
|
307
|
-
/** Whether this
|
|
308
|
-
availability: () => BluetoothSdk.
|
|
318
|
+
// --- watch: an Apple Watch over WatchConnectivity (iOS), a Wear OS watch over the Data Layer (Android) ---
|
|
319
|
+
watch: {
|
|
320
|
+
/** Whether this phone has a paired watch and the Glassly watch app is on it. */
|
|
321
|
+
availability: () => BluetoothSdk.watchAvailability(),
|
|
309
322
|
},
|
|
310
323
|
// --- audio (glasses media-volume, own-app playback hint, live mic level) ---
|
|
311
324
|
audio: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glasses.js","sourceRoot":"","sources":["../../src/facades/glasses.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,kFAAkF;AAClF,sFAAsF;AACtF,uEAAuE;AACvE,OAAO,YAAY,MAAM,iCAAiC,CAAA;AAY1D,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAC,gBAAgB,EAAE,QAAQ,EAAC,MAAM,oBAAoB,CAAA;AAC7D,OAAO,EAAC,gBAAgB,EAAC,MAAM,kCAAkC,CAAA;AACjE,OAAO,mBAAmB,MAAM,iCAAiC,CAAA;AACjE,OAAO,EAAC,sBAAsB,EAAC,MAAM,6BAA6B,CAAA;AAClE,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,WAAW,EACX,aAAa,EACb,gBAAgB,GACjB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAC,kBAAkB,EAAE,cAAc,EAAC,MAAM,8BAA8B,CAAA;AAC/E,OAAO,EAAC,wBAAwB,EAAC,MAAM,iCAAiC,CAAA;AACxE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* glasses facade — the core `engine.glasses.*` surface: connection actions (over\n * the bluetooth-sdk passthrough), a curated status/info read-model (projected from\n * the engine-owned glasses store), capabilities (from the model table), and the\n * discrete input events. The `wifi` sub-facade is nested here.\n *\n * Read-models project the raw glasses store into the stable shape OEM UIs consume,\n * so the device store's field layout doesn't leak into every screen.\n */\n// Internal btsdk surface — connectSimulated/reconnect/controller live on the full\n// surface, not the public entry. Relative path (the alias doesn't resolve in engine's\n// standalone build); jest moduleNameMapper + tsconfig both resolve it.\nimport BluetoothSdk from \"@glassly/bluetooth-sdk/internal\"\nimport type {\n AppleWatchAvailability,\n ButtonPressEvent,\n ConnectOptions,\n ControllerStatus,\n Device,\n KeyboardAdvertEvent,\n KeyboardPairingEvent,\n PairedController,\n TouchEvent,\n} from \"@glassly/bluetooth-sdk\"\nimport {useGlassesStore} from \"../stores/glasses\"\nimport {useSettingsStore, SETTINGS} from \"../stores/settings\"\nimport {hasDefaultDevice} from \"../services/DeviceStoreHydration\"\nimport micStateCoordinator from \"../services/MicStateCoordinator\"\nimport {projectPairingIdentity} from \"../services/PairingIdentity\"\nimport {\n fixtureControllerList,\n fixtureControllerStatuses,\n fixtureInfo,\n fixtureStatus,\n isScreenshotMode,\n} from \"../services/ScreenshotFixture\"\nimport {isGlassesConnected, isGlassesReady} from \"../services/GlassesReadiness\"\nimport {pushAllBluetoothSettings} from \"../services/GlassesSettingsSync\"\nimport {isControllerReady, pairedControllersFrom, readyControllers} from \"../services/controllers\"\nimport neuralBandInput, {\n type NeuralBandClaimStatus,\n type NeuralBandHandwritingStatus,\n type NeuralBandHandwritingUpdate,\n} from \"../services/neuralBand/NeuralBandInput\"\nimport {recordSupportProfileConnectionFailure} from \"../services/SupportProfileSync\"\nimport {getModelCapabilities, type DeviceTypes} from \"../types\"\nimport {pcmLevelDbfs} from \"../utils/audio/pcmLevel\"\nimport {glassesWifi} from \"./glassesWifi\"\nimport {glassesSettings} from \"./glassesSettings\"\n\nlet micLevelSubscriptions = 0\n\n// The screenshot fixture (ScreenshotFixture.ts) dresses these read-models\n// while the identity is the simulated device; it is a no-op outside that build.\nfunction projectStatus() {\n const s = useGlassesStore.getState()\n return fixtureStatus(\n {\n state: s.connection.state,\n fullyBooted: isGlassesReady(s.connection),\n battery: s.batteryLevel,\n charging: s.charging,\n case: {battery: s.caseBatteryLevel, charging: s.caseCharging, open: s.caseOpen, removed: s.caseRemoved},\n signal: s.signalStrength,\n micEnabled: s.micEnabled,\n vadEnabled: s.voiceActivityDetectionEnabled,\n btClassic: s.bluetoothClassicConnected,\n // iOS: glasses may read the phone's ANCS stream (\"Share System Notifications\").\n ancsAuthorized: Boolean(s.ancsAuthorized),\n },\n projectPairingIdentity(),\n )\n}\n\nfunction projectControllerList(): PairedController[] {\n return fixtureControllerList(\n pairedControllersFrom(useSettingsStore.getState().getSetting(SETTINGS.controllers.key)),\n projectPairingIdentity(),\n )\n}\n\n// Copies: snapshots must not hand callers mutable references into the store.\nfunction projectControllerStatuses(): Record<string, ControllerStatus> {\n const statuses: Record<string, ControllerStatus> = {}\n for (const [id, status] of Object.entries(useGlassesStore.getState().controllers ?? {})) {\n statuses[id] = {...status}\n }\n return fixtureControllerStatuses(statuses, projectPairingIdentity())\n}\n\n// Dedupe on the projected snapshot: the store updates on many fields; fire\n// only when the projection changes. The fixture's read-models also follow the\n// identity (a settings key), so that build watches the settings store too.\nfunction subscribeProjection<T>(project: () => T, cb: (snapshot: T) => void): () => void {\n let last = JSON.stringify(project())\n const notify = () => {\n const snap = project()\n const key = JSON.stringify(snap)\n if (key === last) return\n last = key\n cb(snap)\n }\n const unsubscribeGlasses = useGlassesStore.subscribe(notify)\n const unsubscribeSettings = isScreenshotMode() ? useSettingsStore.subscribe(notify) : () => {}\n return () => {\n unsubscribeGlasses()\n unsubscribeSettings()\n }\n}\n\nfunction projectKeyboardStatus() {\n const s = useGlassesStore.getState()\n return {\n /** Connected glasses run a firmware that can host a keyboard (G2 Glassly CFW 39+). */\n available: s.keyboardBridge === true,\n connected: s.keyboardConnected === true,\n name: s.keyboardName ?? \"\",\n /** A keyboard is remembered and reconnects automatically. */\n saved: s.keyboardSaved === true,\n state: s.keyboardState ?? \"idle\",\n error: s.keyboardError ?? \"\",\n }\n}\n\nfunction projectInfo() {\n const s = useGlassesStore.getState()\n return fixtureInfo(projectRawInfo(s), projectPairingIdentity())\n}\n\nfunction projectRawInfo(s: ReturnType<typeof useGlassesStore.getState>) {\n return {\n model: s.deviceModel,\n style: s.style,\n color: s.color,\n bluetoothName: s.bluetoothName,\n firmwareVersion: s.firmwareVersion,\n mtkFirmware: s.mtkFirmwareVersion,\n besFirmware: s.besFirmwareVersion,\n appVersion: s.appVersion,\n androidVersion: s.androidVersion,\n serialNumber: s.serialNumber,\n buildNumber: s.buildNumber,\n btMac: s.bluetoothMacAddress,\n wifiMac: s.wifiMacAddress,\n leftMac: s.leftMacAddress,\n rightMac: s.rightMacAddress,\n sceneCanvasWidth: s.sceneCanvasWidth,\n sceneCanvasHeight: s.sceneCanvasHeight,\n volumeGate: s.volumeGate === true,\n firmwareUpdateAvailable: s.firmwareUpdateAvailable === true,\n // Copy: the snapshot must not hand callers a mutable reference into the store.\n wifi: {...s.wifi},\n }\n}\n\nexport type GlassesStatusSnapshot = ReturnType<typeof projectStatus>\nexport type KeyboardStatusSnapshot = ReturnType<typeof projectKeyboardStatus>\nexport type GlassesInfoSnapshot = ReturnType<typeof projectInfo>\n\nexport const glasses = {\n // --- connection (bluetooth-sdk passthrough) ---\n /**\n * Reconnect the default wearable. Seeds the phone's current device settings to\n * native first, so they're primed before the connect handshake replays them to\n * the glasses (this used to be a host-side step before `connectDefault`).\n */\n connectDefault: async (): Promise<void> => {\n try {\n await pushAllBluetoothSettings()\n await BluetoothSdk.connectDefault()\n } catch (error) {\n recordSupportProfileConnectionFailure(error, \"connect_default\")\n throw error\n }\n },\n disconnect: (): Promise<void> => BluetoothSdk.disconnect(),\n forget: (): Promise<void> => BluetoothSdk.forget(),\n /** Connect to a specific (discovered) device. */\n connect: async (device: Device, options?: ConnectOptions): Promise<void> => {\n try {\n await pushAllBluetoothSettings()\n await BluetoothSdk.connect(device, options)\n } catch (error) {\n recordSupportProfileConnectionFailure(error, \"connect\")\n throw error\n }\n },\n /** Connect the built-in simulated glasses (dev/testing). */\n connectSimulated: (): Promise<void> => BluetoothSdk.connectSimulated(),\n /** Set a device as the `connectDefault()` target. */\n setDefault: (device: Device | null): Promise<void> => BluetoothSdk.setDefaultDevice(device),\n /**\n * Reconnect to the saved default glasses. Resolves `false` when there's nothing to\n * reconnect to (no default paired) or the connect attempt fails (e.g. BLE powered\n * off), `true` when already connected or after kicking off the connect. Never\n * rejects — the boolean contract holds. The host gates connectivity/permissions\n * (its UI) before calling.\n */\n reconnect: async (): Promise<boolean> => {\n const defaultWearable = useSettingsStore.getState().getSetting(SETTINGS.default_wearable.key)\n if (!defaultWearable) return false\n if (isGlassesConnected(useGlassesStore.getState().connection)) return true\n try {\n await pushAllBluetoothSettings()\n await BluetoothSdk.connectDefault()\n } catch (error) {\n recordSupportProfileConnectionFailure(error, \"reconnect\")\n console.warn(\"engine.glasses.reconnect failed:\", error)\n return false\n }\n return true\n },\n /** True when no glasses has ever been paired NOR selected (the pairing-identity\n * lifecycle is in its `none` state) — e.g. to route a first-run host into the\n * pairing/onboarding flow. A pending selection is not \"first\" — the host should\n * offer finish-pairing (see `engine.pairing.identity()`). */\n isFirstPairing: (): boolean => projectPairingIdentity().kind === \"none\",\n /**\n * True when the SDK has an actual default DEVICE to reconnect to. Distinct from\n * `default_wearable` (a model string that a pending or orphaned selection can\n * hold without any paired device): connectDefault() throws without a device, so\n * hosts should route to the pairing flow when this is false.\n *\n * Hydration-aware: awaits the device-store seed internally, so a cold-start\n * read can't see a false \"absent\" for genuinely-paired users. Rejects if\n * hydration failed — callers guarding destructive or routing decisions must\n * fail open (treat as \"has a device\").\n */\n hasDefaultDevice: (): Promise<boolean> => hasDefaultDevice(),\n\n // --- read-model (projected from the engine-owned glasses store) ---\n status: (): GlassesStatusSnapshot => projectStatus(),\n onStatus: (cb: (status: GlassesStatusSnapshot) => void): (() => void) => subscribeProjection(projectStatus, cb),\n info: (): GlassesInfoSnapshot => projectInfo(),\n onInfo: (cb: (info: GlassesInfoSnapshot) => void): (() => void) => subscribeProjection(projectInfo, cb),\n capabilities: () => getModelCapabilities(useGlassesStore.getState().deviceModel as DeviceTypes),\n /** Ask the glasses to report fresh firmware/version info (updates the store). */\n requestVersionInfo: () => BluetoothSdk.requestVersionInfo(),\n\n // --- discrete input events (passthrough listeners) ---\n onButtonPress: (cb: (event: ButtonPressEvent) => void): (() => void) => {\n const sub = BluetoothSdk.addListener(\"button_press\", cb)\n return () => sub.remove()\n },\n onTouchGesture: (cb: (event: TouchEvent) => void): (() => void) => {\n const sub = BluetoothSdk.addListener(\"touch_event\", cb)\n return () => sub.remove()\n },\n\n // --- BLE keyboard bridged through G2 Glassly CFW (revision 39+) ---\n keyboard: {\n /** Five-second scan; distinct advertisers, HID ones flagged. Also streams via onAdvert. */\n scan: (): Promise<KeyboardAdvertEvent[]> => BluetoothSdk.g2KeyboardScan(),\n /** Connect, pair and subscribe; the keyboard is remembered and auto-reconnected. */\n connect: async (device: {address: string; addressType: number; name: string}): Promise<void> => {\n await BluetoothSdk.g2KeyboardConnect(device.address, device.addressType, device.name)\n useSettingsStore.getState().setSetting(SETTINGS.keyboard_name.key, device.name)\n },\n reconnect: (): Promise<void> => BluetoothSdk.g2KeyboardReconnect(),\n disconnect: (): Promise<void> => BluetoothSdk.g2KeyboardDisconnect(),\n forget: async (): Promise<void> => {\n await BluetoothSdk.g2KeyboardForget()\n useSettingsStore.getState().setSetting(SETTINGS.keyboard_name.key, \"\")\n },\n passkey: (pin: number): Promise<void> => BluetoothSdk.g2KeyboardPasskey(pin),\n compare: (accept: boolean): Promise<void> => BluetoothSdk.g2KeyboardCompare(accept),\n status: (): KeyboardStatusSnapshot => projectKeyboardStatus(),\n onStatus: (cb: (status: KeyboardStatusSnapshot) => void): (() => void) => {\n let last = JSON.stringify(projectKeyboardStatus())\n return useGlassesStore.subscribe(() => {\n const snap = projectKeyboardStatus()\n const key = JSON.stringify(snap)\n if (key === last) return\n last = key\n cb(snap)\n })\n },\n onAdvert: (cb: (advert: KeyboardAdvertEvent) => void): (() => void) => {\n const sub = BluetoothSdk.addListener(\"keyboard_advert\", cb)\n return () => sub.remove()\n },\n onPairing: (cb: (prompt: KeyboardPairingEvent) => void): (() => void) => {\n const sub = BluetoothSdk.addListener(\"keyboard_pairing\", cb)\n return () => sub.remove()\n },\n },\n\n // --- controllers (input accessories linked to the phone), by registry id ---\n controllers: {\n /** Paired controllers in pairing order. */\n list: (): PairedController[] => projectControllerList(),\n onList: (cb: (controllers: PairedController[]) => void): (() => void) => {\n let last = JSON.stringify(projectControllerList())\n return useSettingsStore.subscribe(() => {\n const list = projectControllerList()\n const key = JSON.stringify(list)\n if (key === last) return\n last = key\n cb(list)\n })\n },\n /** Live driver statuses by id; a paired controller without an entry is idle. */\n statuses: (): Record<string, ControllerStatus> => projectControllerStatuses(),\n status: (id: string): ControllerStatus | undefined => projectControllerStatuses()[id],\n onStatus: (cb: (statuses: Record<string, ControllerStatus>) => void): (() => void) =>\n subscribeProjection(projectControllerStatuses, cb),\n /** Controllers delivering input (linked, route or claim done). */\n connected: (): ControllerStatus[] => readyControllers(projectControllerStatuses()),\n isConnected: (model?: string): boolean =>\n Object.values(projectControllerStatuses()).some(\n (status) => isControllerReady(status) && (model === undefined || status.model === model),\n ),\n connect: (id: string): Promise<void> => BluetoothSdk.connectController(id),\n /** Reconnect every paired controller that is not connected. */\n connectAll: (): Promise<void> => BluetoothSdk.connectControllers(),\n /** Drop an in-flight controller scan or pairing; paired records are untouched. */\n cancelAttempt: (): Promise<void> => BluetoothSdk.cancelControllerAttempt(),\n /** Disconnect; the controller stays paired. */\n disconnect: (id: string): Promise<void> => BluetoothSdk.disconnectController(id),\n forget: async (id: string): Promise<void> => {\n await BluetoothSdk.forgetController(id)\n neuralBandInput.forget(id)\n },\n },\n\n // --- Meta Neural Band (a controller with a claim step and its own features), by controller id ---\n neuralBand: {\n /** Store the Meta account session the one-time band claim uses (account-wide). */\n setMetaSession: (accessToken: string, userId: string): Promise<void> =>\n BluetoothSdk.neuralBandSetMetaSession(accessToken, userId),\n clearMetaSession: (): Promise<void> => BluetoothSdk.neuralBandClearMetaSession(),\n hasMetaSession: (): Promise<boolean> => BluetoothSdk.neuralBandHasMetaSession(),\n /** This band's identity is stored on this phone, so it reconnects without a claim. */\n isClaimed: (id: string): Promise<boolean> => BluetoothSdk.neuralBandIsClaimed(id),\n /** The latest claim progress of any band (with its `controllerId`), kept across screens. */\n claimStatus: (): NeuralBandClaimStatus => ({...neuralBandInput.claimStatus()}),\n resetClaim: (): void => neuralBandInput.resetClaim(),\n onClaimStatus: (cb: (status: NeuralBandClaimStatus) => void): (() => void) => neuralBandInput.onClaimStatus(cb),\n /** The band's handwriting model; writing arrives on the miniapp keyboard stream. */\n setHandwriting: (id: string, enabled: boolean): Promise<void> => BluetoothSdk.neuralBandSetHandwriting(id, enabled),\n handwritingStatus: (id: string): NeuralBandHandwritingStatus => ({...neuralBandInput.handwritingStatus(id)}),\n onHandwritingStatus: (cb: (update: NeuralBandHandwritingUpdate) => void): (() => void) =>\n neuralBandInput.onHandwritingStatus(cb),\n /** The band's air mouse; movement reaches miniapps on the pointer stream. */\n setPointer: (id: string, enabled: boolean): Promise<void> => BluetoothSdk.neuralBandSetPointer(id, enabled),\n setHand: (id: string, hand: \"left\" | \"right\"): Promise<void> => BluetoothSdk.neuralBandSetHand(id, hand),\n },\n\n // --- Apple Watch (iOS): pairs through the Glassly watch app over WatchConnectivity ---\n appleWatch: {\n /** Whether this iPhone has a paired watch and the Glassly watch app is on it. */\n availability: (): Promise<AppleWatchAvailability> => BluetoothSdk.appleWatchAvailability(),\n },\n\n // --- audio (glasses media-volume, own-app playback hint, live mic level) ---\n audio: {\n /** Read the glasses' current media volume. */\n getMediaVolume: () => BluetoothSdk.getGlassesMediaVolume(),\n /** Set the glasses' media volume. */\n setMediaVolume: (level: number) => BluetoothSdk.setGlassesMediaVolume(level),\n /** Tell native whether THIS app is currently playing audio (for ducking). */\n setOwnAppPlaying: (playing: boolean): Promise<void> => BluetoothSdk.setOwnAppAudioPlaying(playing),\n /**\n * Stream the active mic's level in dBFS, one reading per PCM chunk. Holds\n * raw PCM open while subscribed, so the mic runs with no miniapp listening,\n * and holds the G2 volume gate open so the meter shows the ambient level.\n */\n onMicLevel: (cb: (dbfs: number) => void): (() => void) => {\n const owner = `mic_level_${++micLevelSubscriptions}`\n micStateCoordinator.acquireHostPcm(owner)\n const sub = BluetoothSdk.addListener(\"mic_pcm\", (event: {pcm: ArrayBuffer | Uint8Array}) => {\n if (event?.pcm) cb(pcmLevelDbfs(event.pcm))\n })\n return () => {\n sub.remove()\n micStateCoordinator.releaseHostPcm(owner)\n }\n },\n },\n\n // --- sub-facades ---\n wifi: glassesWifi,\n settings: glassesSettings,\n}\n"]}
|
|
1
|
+
{"version":3,"file":"glasses.js","sourceRoot":"","sources":["../../src/facades/glasses.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,kFAAkF;AAClF,sFAAsF;AACtF,uEAAuE;AACvE,OAAO,YAAY,MAAM,iCAAiC,CAAA;AAa1D,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAC,gBAAgB,EAAE,QAAQ,EAAC,MAAM,oBAAoB,CAAA;AAC7D,OAAO,EAAC,gBAAgB,EAAC,MAAM,kCAAkC,CAAA;AACjE,OAAO,mBAAmB,MAAM,iCAAiC,CAAA;AACjE,OAAO,EAAC,sBAAsB,EAAC,MAAM,6BAA6B,CAAA;AAClE,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,WAAW,EACX,aAAa,EACb,gBAAgB,GACjB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAC,kBAAkB,EAAE,cAAc,EAAC,MAAM,8BAA8B,CAAA;AAC/E,OAAO,EAA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,CAAC,YAAY,CAAC,qBAAqB,CAAC,KAAK,CAAC;QAC5E,6EAA6E;QAC7E,gBAAgB,EAAE,CAAC,OAAgB,EAAiB,EAAE,CAAC,YAAY,CAAC,qBAAqB,CAAC,OAAO,CAAC;QAClG;;;;WAIG;QACH,UAAU,EAAE,CAAC,EAA0B,EAAgB,EAAE;YACvD,MAAM,KAAK,GAAG,aAAa,EAAE,qBAAqB,EAAE,CAAA;YACpD,mBAAmB,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;YACzC,MAAM,GAAG,GAAG,YAAY,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC,KAAsC,EAAE,EAAE;gBACzF,IAAI,KAAK,EAAE,GAAG;oBAAE,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAA;YAC7C,CAAC,CAAC,CAAA;YACF,OAAO,GAAG,EAAE;gBACV,GAAG,CAAC,MAAM,EAAE,CAAA;gBACZ,mBAAmB,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;YAC3C,CAAC,CAAA;QACH,CAAC;KACF;IAED,sBAAsB;IACtB,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE,eAAe;CAC1B,CAAA","sourcesContent":["/**\n * glasses facade — the core `engine.glasses.*` surface: connection actions (over\n * the bluetooth-sdk passthrough), a curated status/info read-model (projected from\n * the engine-owned glasses store), capabilities (from the model table), and the\n * discrete input events. The `wifi` sub-facade is nested here.\n *\n * Read-models project the raw glasses store into the stable shape OEM UIs consume,\n * so the device store's field layout doesn't leak into every screen.\n */\n// Internal btsdk surface — connectSimulated/reconnect/controller live on the full\n// surface, not the public entry. Relative path (the alias doesn't resolve in engine's\n// standalone build); jest moduleNameMapper + tsconfig both resolve it.\nimport BluetoothSdk from \"@glassly/bluetooth-sdk/internal\"\nimport type {\n WatchAvailability,\n ButtonPressEvent,\n ConnectOptions,\n ControllerStatus,\n Device,\n KeyboardAdvertEvent,\n KeyboardPairingEvent,\n NeuralBandFirmwareEvent,\n PairedController,\n TouchEvent,\n} from \"@glassly/bluetooth-sdk\"\nimport {useGlassesStore} from \"../stores/glasses\"\nimport {useSettingsStore, SETTINGS} from \"../stores/settings\"\nimport {hasDefaultDevice} from \"../services/DeviceStoreHydration\"\nimport micStateCoordinator from \"../services/MicStateCoordinator\"\nimport {projectPairingIdentity} from \"../services/PairingIdentity\"\nimport {\n fixtureControllerList,\n fixtureControllerStatuses,\n fixtureInfo,\n fixtureStatus,\n isScreenshotMode,\n} from \"../services/ScreenshotFixture\"\nimport {isGlassesConnected, isGlassesReady} from \"../services/GlassesReadiness\"\nimport {pushAllBluetoothSettings} from \"../services/GlassesSettingsSync\"\nimport {isControllerReady, pairedControllersFrom, readyControllers} from \"../services/controllers\"\nimport neuralBandInput, {\n type NeuralBandClaimStatus,\n type NeuralBandFirmwareStatus,\n type NeuralBandHandwritingStatus,\n type NeuralBandHandwritingUpdate,\n} from \"../services/neuralBand/NeuralBandInput\"\nimport {recordSupportProfileConnectionFailure} from \"../services/SupportProfileSync\"\nimport {getModelCapabilities, type DeviceTypes} from \"../types\"\nimport {pcmLevelDbfs} from \"../utils/audio/pcmLevel\"\nimport {glassesWifi} from \"./glassesWifi\"\nimport {glassesSettings} from \"./glassesSettings\"\n\nlet micLevelSubscriptions = 0\n\n// The screenshot fixture (ScreenshotFixture.ts) dresses these read-models\n// while the identity is the simulated device; it is a no-op outside that build.\nfunction projectStatus() {\n const s = useGlassesStore.getState()\n return fixtureStatus(\n {\n state: s.connection.state,\n fullyBooted: isGlassesReady(s.connection),\n battery: s.batteryLevel,\n charging: s.charging,\n case: {battery: s.caseBatteryLevel, charging: s.caseCharging, open: s.caseOpen, removed: s.caseRemoved},\n signal: s.signalStrength,\n micEnabled: s.micEnabled,\n vadEnabled: s.voiceActivityDetectionEnabled,\n btClassic: s.bluetoothClassicConnected,\n // iOS: glasses may read the phone's ANCS stream (\"Share System Notifications\").\n ancsAuthorized: Boolean(s.ancsAuthorized),\n },\n projectPairingIdentity(),\n )\n}\n\nfunction projectControllerList(): PairedController[] {\n return fixtureControllerList(\n pairedControllersFrom(useSettingsStore.getState().getSetting(SETTINGS.controllers.key)),\n projectPairingIdentity(),\n )\n}\n\n// Copies: snapshots must not hand callers mutable references into the store.\nfunction projectControllerStatuses(): Record<string, ControllerStatus> {\n const statuses: Record<string, ControllerStatus> = {}\n for (const [id, status] of Object.entries(useGlassesStore.getState().controllers ?? {})) {\n statuses[id] = {...status}\n }\n return fixtureControllerStatuses(statuses, projectPairingIdentity())\n}\n\n// Dedupe on the projected snapshot: the store updates on many fields; fire\n// only when the projection changes. The fixture's read-models also follow the\n// identity (a settings key), so that build watches the settings store too.\nfunction subscribeProjection<T>(project: () => T, cb: (snapshot: T) => void): () => void {\n let last = JSON.stringify(project())\n const notify = () => {\n const snap = project()\n const key = JSON.stringify(snap)\n if (key === last) return\n last = key\n cb(snap)\n }\n const unsubscribeGlasses = useGlassesStore.subscribe(notify)\n const unsubscribeSettings = isScreenshotMode() ? useSettingsStore.subscribe(notify) : () => {}\n return () => {\n unsubscribeGlasses()\n unsubscribeSettings()\n }\n}\n\nfunction projectKeyboardStatus() {\n const s = useGlassesStore.getState()\n return {\n /** Connected glasses run a firmware that can host a keyboard (G2 Glassly CFW 39+). */\n available: s.keyboardBridge === true,\n connected: s.keyboardConnected === true,\n name: s.keyboardName ?? \"\",\n /** A keyboard is remembered and reconnects automatically. */\n saved: s.keyboardSaved === true,\n state: s.keyboardState ?? \"idle\",\n error: s.keyboardError ?? \"\",\n }\n}\n\nfunction projectInfo() {\n const s = useGlassesStore.getState()\n return fixtureInfo(projectRawInfo(s), projectPairingIdentity())\n}\n\nfunction projectRawInfo(s: ReturnType<typeof useGlassesStore.getState>) {\n return {\n model: s.deviceModel,\n style: s.style,\n color: s.color,\n bluetoothName: s.bluetoothName,\n firmwareVersion: s.firmwareVersion,\n mtkFirmware: s.mtkFirmwareVersion,\n besFirmware: s.besFirmwareVersion,\n appVersion: s.appVersion,\n androidVersion: s.androidVersion,\n serialNumber: s.serialNumber,\n buildNumber: s.buildNumber,\n btMac: s.bluetoothMacAddress,\n wifiMac: s.wifiMacAddress,\n leftMac: s.leftMacAddress,\n rightMac: s.rightMacAddress,\n sceneCanvasWidth: s.sceneCanvasWidth,\n sceneCanvasHeight: s.sceneCanvasHeight,\n volumeGate: s.volumeGate === true,\n firmwareUpdateAvailable: s.firmwareUpdateAvailable === true,\n // Copy: the snapshot must not hand callers a mutable reference into the store.\n wifi: {...s.wifi},\n }\n}\n\nexport type GlassesStatusSnapshot = ReturnType<typeof projectStatus>\nexport type KeyboardStatusSnapshot = ReturnType<typeof projectKeyboardStatus>\nexport type GlassesInfoSnapshot = ReturnType<typeof projectInfo>\n\nexport const glasses = {\n // --- connection (bluetooth-sdk passthrough) ---\n /**\n * Reconnect the default wearable. Seeds the phone's current device settings to\n * native first, so they're primed before the connect handshake replays them to\n * the glasses (this used to be a host-side step before `connectDefault`).\n */\n connectDefault: async (): Promise<void> => {\n try {\n await pushAllBluetoothSettings()\n await BluetoothSdk.connectDefault()\n } catch (error) {\n recordSupportProfileConnectionFailure(error, \"connect_default\")\n throw error\n }\n },\n disconnect: (): Promise<void> => BluetoothSdk.disconnect(),\n forget: (): Promise<void> => BluetoothSdk.forget(),\n /** Connect to a specific (discovered) device. */\n connect: async (device: Device, options?: ConnectOptions): Promise<void> => {\n try {\n await pushAllBluetoothSettings()\n await BluetoothSdk.connect(device, options)\n } catch (error) {\n recordSupportProfileConnectionFailure(error, \"connect\")\n throw error\n }\n },\n /** Connect the built-in simulated glasses (dev/testing). */\n connectSimulated: (): Promise<void> => BluetoothSdk.connectSimulated(),\n /** Set a device as the `connectDefault()` target. */\n setDefault: (device: Device | null): Promise<void> => BluetoothSdk.setDefaultDevice(device),\n /**\n * Reconnect to the saved default glasses. Resolves `false` when there's nothing to\n * reconnect to (no default paired) or the connect attempt fails (e.g. BLE powered\n * off), `true` when already connected or after kicking off the connect. Never\n * rejects — the boolean contract holds. The host gates connectivity/permissions\n * (its UI) before calling.\n */\n reconnect: async (): Promise<boolean> => {\n const defaultWearable = useSettingsStore.getState().getSetting(SETTINGS.default_wearable.key)\n if (!defaultWearable) return false\n if (isGlassesConnected(useGlassesStore.getState().connection)) return true\n try {\n await pushAllBluetoothSettings()\n await BluetoothSdk.connectDefault()\n } catch (error) {\n recordSupportProfileConnectionFailure(error, \"reconnect\")\n console.warn(\"engine.glasses.reconnect failed:\", error)\n return false\n }\n return true\n },\n /** True when no glasses has ever been paired NOR selected (the pairing-identity\n * lifecycle is in its `none` state) — e.g. to route a first-run host into the\n * pairing/onboarding flow. A pending selection is not \"first\" — the host should\n * offer finish-pairing (see `engine.pairing.identity()`). */\n isFirstPairing: (): boolean => projectPairingIdentity().kind === \"none\",\n /**\n * True when the SDK has an actual default DEVICE to reconnect to. Distinct from\n * `default_wearable` (a model string that a pending or orphaned selection can\n * hold without any paired device): connectDefault() throws without a device, so\n * hosts should route to the pairing flow when this is false.\n *\n * Hydration-aware: awaits the device-store seed internally, so a cold-start\n * read can't see a false \"absent\" for genuinely-paired users. Rejects if\n * hydration failed — callers guarding destructive or routing decisions must\n * fail open (treat as \"has a device\").\n */\n hasDefaultDevice: (): Promise<boolean> => hasDefaultDevice(),\n\n // --- read-model (projected from the engine-owned glasses store) ---\n status: (): GlassesStatusSnapshot => projectStatus(),\n onStatus: (cb: (status: GlassesStatusSnapshot) => void): (() => void) => subscribeProjection(projectStatus, cb),\n info: (): GlassesInfoSnapshot => projectInfo(),\n onInfo: (cb: (info: GlassesInfoSnapshot) => void): (() => void) => subscribeProjection(projectInfo, cb),\n capabilities: () => getModelCapabilities(useGlassesStore.getState().deviceModel as DeviceTypes),\n /** Ask the glasses to report fresh firmware/version info (updates the store). */\n requestVersionInfo: () => BluetoothSdk.requestVersionInfo(),\n\n // --- discrete input events (passthrough listeners) ---\n onButtonPress: (cb: (event: ButtonPressEvent) => void): (() => void) => {\n const sub = BluetoothSdk.addListener(\"button_press\", cb)\n return () => sub.remove()\n },\n onTouchGesture: (cb: (event: TouchEvent) => void): (() => void) => {\n const sub = BluetoothSdk.addListener(\"touch_event\", cb)\n return () => sub.remove()\n },\n\n // --- BLE keyboard bridged through G2 Glassly CFW (revision 39+) ---\n keyboard: {\n /** Five-second scan; distinct advertisers, HID ones flagged. Also streams via onAdvert. */\n scan: (): Promise<KeyboardAdvertEvent[]> => BluetoothSdk.g2KeyboardScan(),\n /** Connect, pair and subscribe; the keyboard is remembered and auto-reconnected. */\n connect: async (device: {address: string; addressType: number; name: string}): Promise<void> => {\n await BluetoothSdk.g2KeyboardConnect(device.address, device.addressType, device.name)\n useSettingsStore.getState().setSetting(SETTINGS.keyboard_name.key, device.name)\n },\n reconnect: (): Promise<void> => BluetoothSdk.g2KeyboardReconnect(),\n disconnect: (): Promise<void> => BluetoothSdk.g2KeyboardDisconnect(),\n forget: async (): Promise<void> => {\n await BluetoothSdk.g2KeyboardForget()\n useSettingsStore.getState().setSetting(SETTINGS.keyboard_name.key, \"\")\n },\n passkey: (pin: number): Promise<void> => BluetoothSdk.g2KeyboardPasskey(pin),\n compare: (accept: boolean): Promise<void> => BluetoothSdk.g2KeyboardCompare(accept),\n status: (): KeyboardStatusSnapshot => projectKeyboardStatus(),\n onStatus: (cb: (status: KeyboardStatusSnapshot) => void): (() => void) => {\n let last = JSON.stringify(projectKeyboardStatus())\n return useGlassesStore.subscribe(() => {\n const snap = projectKeyboardStatus()\n const key = JSON.stringify(snap)\n if (key === last) return\n last = key\n cb(snap)\n })\n },\n onAdvert: (cb: (advert: KeyboardAdvertEvent) => void): (() => void) => {\n const sub = BluetoothSdk.addListener(\"keyboard_advert\", cb)\n return () => sub.remove()\n },\n onPairing: (cb: (prompt: KeyboardPairingEvent) => void): (() => void) => {\n const sub = BluetoothSdk.addListener(\"keyboard_pairing\", cb)\n return () => sub.remove()\n },\n },\n\n // --- controllers (input accessories linked to the phone), by registry id ---\n controllers: {\n /** Paired controllers in pairing order. */\n list: (): PairedController[] => projectControllerList(),\n onList: (cb: (controllers: PairedController[]) => void): (() => void) => {\n let last = JSON.stringify(projectControllerList())\n return useSettingsStore.subscribe(() => {\n const list = projectControllerList()\n const key = JSON.stringify(list)\n if (key === last) return\n last = key\n cb(list)\n })\n },\n /** Live driver statuses by id; a paired controller without an entry is idle. */\n statuses: (): Record<string, ControllerStatus> => projectControllerStatuses(),\n status: (id: string): ControllerStatus | undefined => projectControllerStatuses()[id],\n onStatus: (cb: (statuses: Record<string, ControllerStatus>) => void): (() => void) =>\n subscribeProjection(projectControllerStatuses, cb),\n /** Controllers delivering input (linked, route or claim done). */\n connected: (): ControllerStatus[] => readyControllers(projectControllerStatuses()),\n isConnected: (model?: string): boolean =>\n Object.values(projectControllerStatuses()).some(\n (status) => isControllerReady(status) && (model === undefined || status.model === model),\n ),\n connect: (id: string): Promise<void> => BluetoothSdk.connectController(id),\n /** Reconnect every paired controller that is not connected. */\n connectAll: (): Promise<void> => BluetoothSdk.connectControllers(),\n /** Drop an in-flight controller scan or pairing; paired records are untouched. */\n cancelAttempt: (): Promise<void> => BluetoothSdk.cancelControllerAttempt(),\n /** Disconnect; the controller stays paired. */\n disconnect: (id: string): Promise<void> => BluetoothSdk.disconnectController(id),\n forget: async (id: string): Promise<void> => {\n await BluetoothSdk.forgetController(id)\n neuralBandInput.forget(id)\n },\n },\n\n // --- Meta Neural Band (a controller with a claim step and its own features), by controller id ---\n neuralBand: {\n /** Store the Meta account session the one-time band claim uses (account-wide). */\n setMetaSession: (accessToken: string, userId: string): Promise<void> =>\n BluetoothSdk.neuralBandSetMetaSession(accessToken, userId),\n clearMetaSession: (): Promise<void> => BluetoothSdk.neuralBandClearMetaSession(),\n hasMetaSession: (): Promise<boolean> => BluetoothSdk.neuralBandHasMetaSession(),\n /** This band's identity is stored on this phone, so it reconnects without a claim. */\n isClaimed: (id: string): Promise<boolean> => BluetoothSdk.neuralBandIsClaimed(id),\n /** The latest claim progress of any band (with its `controllerId`), kept across screens. */\n claimStatus: (): NeuralBandClaimStatus => ({...neuralBandInput.claimStatus()}),\n resetClaim: (): void => neuralBandInput.resetClaim(),\n onClaimStatus: (cb: (status: NeuralBandClaimStatus) => void): (() => void) => neuralBandInput.onClaimStatus(cb),\n /** The band's handwriting model; writing arrives on the miniapp keyboard stream. */\n setHandwriting: (id: string, enabled: boolean): Promise<void> => BluetoothSdk.neuralBandSetHandwriting(id, enabled),\n handwritingStatus: (id: string): NeuralBandHandwritingStatus => ({...neuralBandInput.handwritingStatus(id)}),\n onHandwritingStatus: (cb: (update: NeuralBandHandwritingUpdate) => void): (() => void) =>\n neuralBandInput.onHandwritingStatus(cb),\n /** The band's air mouse; movement reaches miniapps on the pointer stream. */\n setPointer: (id: string, enabled: boolean): Promise<void> => BluetoothSdk.neuralBandSetPointer(id, enabled),\n setHand: (id: string, hand: \"left\" | \"right\"): Promise<void> => BluetoothSdk.neuralBandSetHand(id, hand),\n firmwareStatus: (id: string): NeuralBandFirmwareStatus => ({...neuralBandInput.firmwareStatus(id)}),\n onFirmwareStatus: (cb: (update: {id: string; status: NeuralBandFirmwareStatus}) => void): (() => void) =>\n neuralBandInput.onFirmwareStatus(cb),\n refreshFirmware: async (id: string): Promise<NeuralBandFirmwareStatus> => {\n const info = await BluetoothSdk.neuralBandFirmwareInfo(id)\n neuralBandInput.handleFirmware({\n ...(info as object),\n type: \"neural_band_firmware\",\n controllerId: id,\n } as NeuralBandFirmwareEvent)\n return neuralBandInput.firmwareStatus(id)\n },\n checkFirmware: (id: string): Promise<void> => BluetoothSdk.neuralBandCheckFirmware(id),\n updateFirmware: (id: string, mode: \"update\" | \"cancel\" | \"key\" | \"send\" | \"trial\" | \"install\"): Promise<void> =>\n BluetoothSdk.neuralBandUpdateFirmware(id, mode),\n },\n\n // --- watch: an Apple Watch over WatchConnectivity (iOS), a Wear OS watch over the Data Layer (Android) ---\n watch: {\n /** Whether this phone has a paired watch and the Glassly watch app is on it. */\n availability: (): Promise<WatchAvailability> => BluetoothSdk.watchAvailability(),\n },\n\n // --- audio (glasses media-volume, own-app playback hint, live mic level) ---\n audio: {\n /** Read the glasses' current media volume. */\n getMediaVolume: () => BluetoothSdk.getGlassesMediaVolume(),\n /** Set the glasses' media volume. */\n setMediaVolume: (level: number) => BluetoothSdk.setGlassesMediaVolume(level),\n /** Tell native whether THIS app is currently playing audio (for ducking). */\n setOwnAppPlaying: (playing: boolean): Promise<void> => BluetoothSdk.setOwnAppAudioPlaying(playing),\n /**\n * Stream the active mic's level in dBFS, one reading per PCM chunk. Holds\n * raw PCM open while subscribed, so the mic runs with no miniapp listening,\n * and holds the G2 volume gate open so the meter shows the ambient level.\n */\n onMicLevel: (cb: (dbfs: number) => void): (() => void) => {\n const owner = `mic_level_${++micLevelSubscriptions}`\n micStateCoordinator.acquireHostPcm(owner)\n const sub = BluetoothSdk.addListener(\"mic_pcm\", (event: {pcm: ArrayBuffer | Uint8Array}) => {\n if (event?.pcm) cb(pcmLevelDbfs(event.pcm))\n })\n return () => {\n sub.remove()\n micStateCoordinator.releaseHostPcm(owner)\n }\n },\n },\n\n // --- sub-facades ---\n wifi: glassesWifi,\n settings: glassesSettings,\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export const ENGINE_RELEASE_METADATA = Object.freeze({
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"familyBaseVersion": "0.3.
|
|
4
|
-
"releaseIdentity": "0.3.
|
|
5
|
-
"releaseSetId": "glassly-0.3.
|
|
6
|
-
"sourceCommit": "
|
|
3
|
+
"familyBaseVersion": "0.3.8",
|
|
4
|
+
"releaseIdentity": "0.3.8-beta.1013",
|
|
5
|
+
"releaseSetId": "glassly-0.3.8-beta.1013",
|
|
6
|
+
"sourceCommit": "35a6df924b5f3a9f3b15e5f25d4a263c6d0b82ee",
|
|
7
7
|
"otaManifestUrl": null,
|
|
8
8
|
"otaManifestSha256": null
|
|
9
9
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"releaseMetadata.js","sourceRoot":"","sources":["../../src/generated/releaseMetadata.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,uBAAuB,GAAoC,MAAM,CAAC,MAAM,CAAC;IACpF,eAAe,EAAE,CAAC;IAClB,mBAAmB,EAAE,OAAO;IAC5B,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"releaseMetadata.js","sourceRoot":"","sources":["../../src/generated/releaseMetadata.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,uBAAuB,GAAoC,MAAM,CAAC,MAAM,CAAC;IACpF,eAAe,EAAE,CAAC;IAClB,mBAAmB,EAAE,OAAO;IAC5B,iBAAiB,EAAE,iBAAiB;IACpC,cAAc,EAAE,yBAAyB;IACzC,cAAc,EAAE,0CAA0C;IAC1D,gBAAgB,EAAE,IAAI;IACtB,mBAAmB,EAAE,IAAI;CAC1B,CAAC,CAAA","sourcesContent":["/** Generated by release CI. Do not edit in a release checkout. */\nexport interface EngineReleaseMetadata {\n schemaVersion: 1\n familyBaseVersion: string | null\n releaseIdentity: string | null\n releaseSetId: string | null\n sourceCommit: string | null\n otaManifestUrl: string | null\n otaManifestSha256: string | null\n}\n\nexport const ENGINE_RELEASE_METADATA: Readonly<EngineReleaseMetadata> = Object.freeze({\n \"schemaVersion\": 1,\n \"familyBaseVersion\": \"0.3.8\",\n \"releaseIdentity\": \"0.3.8-beta.1013\",\n \"releaseSetId\": \"glassly-0.3.8-beta.1013\",\n \"sourceCommit\": \"35a6df924b5f3a9f3b15e5f25d4a263c6d0b82ee\",\n \"otaManifestUrl\": null,\n \"otaManifestSha256\": null\n})\n"]}
|