@glassly/engine 0.3.5 → 0.3.6-dev.848
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/build/engine.d.ts +11 -1
- package/build/engine.d.ts.map +1 -1
- package/build/engine.js +13 -1
- package/build/engine.js.map +1 -1
- package/build/facades/ai.d.ts +3 -3
- package/build/facades/ai.d.ts.map +1 -1
- package/build/facades/ai.js +3 -3
- package/build/facades/ai.js.map +1 -1
- package/build/facades/glasses.d.ts +5 -1
- package/build/facades/glasses.d.ts.map +1 -1
- package/build/facades/glasses.js +39 -30
- package/build/facades/glasses.js.map +1 -1
- package/build/facades/memory.d.ts +10 -2
- package/build/facades/memory.d.ts.map +1 -1
- package/build/facades/memory.js +10 -0
- package/build/facades/memory.js.map +1 -1
- package/build/facades/miniapps.d.ts +2 -0
- package/build/facades/miniapps.d.ts.map +1 -1
- package/build/facades/miniapps.js +2 -0
- package/build/facades/miniapps.js.map +1 -1
- package/build/facades/pairing.d.ts.map +1 -1
- package/build/facades/pairing.js +3 -2
- package/build/facades/pairing.js.map +1 -1
- package/build/facades/providerKeys.d.ts +6 -2
- package/build/facades/providerKeys.d.ts.map +1 -1
- package/build/facades/providerKeys.js +6 -2
- package/build/facades/providerKeys.js.map +1 -1
- package/build/generated/releaseMetadata.js +4 -4
- package/build/generated/releaseMetadata.js.map +1 -1
- package/build/services/AiTierResolution.d.ts +3 -2
- package/build/services/AiTierResolution.d.ts.map +1 -1
- package/build/services/AiTierResolution.js +7 -2
- package/build/services/AiTierResolution.js.map +1 -1
- package/build/services/AppRegistry.d.ts +4 -1
- package/build/services/AppRegistry.d.ts.map +1 -1
- package/build/services/AppRegistry.js +16 -2
- package/build/services/AppRegistry.js.map +1 -1
- package/build/services/BlobStore.js +3 -3
- package/build/services/BlobStore.js.map +1 -1
- package/build/services/BluetoothRestoreLaunch.d.ts +8 -0
- package/build/services/BluetoothRestoreLaunch.d.ts.map +1 -0
- package/build/services/BluetoothRestoreLaunch.js +34 -0
- package/build/services/BluetoothRestoreLaunch.js.map +1 -0
- package/build/services/CloudClientService.d.ts +4 -4
- package/build/services/ForegroundLocationPermission.d.ts +1 -1
- package/build/services/ForegroundLocationPermission.d.ts.map +1 -1
- package/build/services/ForegroundLocationPermission.js.map +1 -1
- package/build/services/GestureDotsService.d.ts.map +1 -1
- package/build/services/GestureDotsService.js +2 -1
- package/build/services/GestureDotsService.js.map +1 -1
- package/build/services/GlassesTouchInput.d.ts +6 -4
- package/build/services/GlassesTouchInput.d.ts.map +1 -1
- package/build/services/GlassesTouchInput.js +81 -41
- package/build/services/GlassesTouchInput.js.map +1 -1
- package/build/services/LocalDisplayManager.d.ts +12 -4
- package/build/services/LocalDisplayManager.d.ts.map +1 -1
- package/build/services/LocalDisplayManager.js +21 -7
- package/build/services/LocalDisplayManager.js.map +1 -1
- package/build/services/LocalLlmModelManager.d.ts +3 -1
- package/build/services/LocalLlmModelManager.d.ts.map +1 -1
- package/build/services/LocalLlmModelManager.js +13 -5
- package/build/services/LocalLlmModelManager.js.map +1 -1
- package/build/services/LocalLlmPrompt.d.ts +10 -9
- package/build/services/LocalLlmPrompt.d.ts.map +1 -1
- package/build/services/LocalLlmPrompt.js +43 -32
- package/build/services/LocalLlmPrompt.js.map +1 -1
- package/build/services/LocalLlmProvider.d.ts +1 -0
- package/build/services/LocalLlmProvider.d.ts.map +1 -1
- package/build/services/LocalLlmProvider.js +62 -22
- package/build/services/LocalLlmProvider.js.map +1 -1
- package/build/services/LocalMiniappRuntime.d.ts +28 -6
- package/build/services/LocalMiniappRuntime.d.ts.map +1 -1
- package/build/services/LocalMiniappRuntime.js +190 -148
- package/build/services/LocalMiniappRuntime.js.map +1 -1
- package/build/services/MemoryStore.d.ts +13 -1
- package/build/services/MemoryStore.d.ts.map +1 -1
- package/build/services/MemoryStore.js +98 -1
- package/build/services/MemoryStore.js.map +1 -1
- package/build/services/MiniappExitGesture.d.ts +6 -3
- package/build/services/MiniappExitGesture.d.ts.map +1 -1
- package/build/services/MiniappExitGesture.js +4 -4
- package/build/services/MiniappExitGesture.js.map +1 -1
- package/build/services/MiniappWidgetMode.d.ts +6 -4
- package/build/services/MiniappWidgetMode.d.ts.map +1 -1
- package/build/services/MiniappWidgetMode.js +7 -6
- package/build/services/MiniappWidgetMode.js.map +1 -1
- package/build/services/ProviderKeyValidation.d.ts +2 -0
- package/build/services/ProviderKeyValidation.d.ts.map +1 -1
- package/build/services/ProviderKeyValidation.js +4 -0
- package/build/services/ProviderKeyValidation.js.map +1 -1
- package/build/services/SceneRenderer.d.ts.map +1 -1
- package/build/services/SceneRenderer.js +3 -1
- package/build/services/SceneRenderer.js.map +1 -1
- package/build/services/ScreenshotFixture.d.ts +56 -0
- package/build/services/ScreenshotFixture.d.ts.map +1 -0
- package/build/services/ScreenshotFixture.js +72 -0
- package/build/services/ScreenshotFixture.js.map +1 -0
- package/build/services/actionInvoke.d.ts +37 -0
- package/build/services/actionInvoke.d.ts.map +1 -0
- package/build/services/actionInvoke.js +89 -0
- package/build/services/actionInvoke.js.map +1 -0
- package/build/services/appleWatch/AppleWatchLink.d.ts +42 -0
- package/build/services/appleWatch/AppleWatchLink.d.ts.map +1 -0
- package/build/services/appleWatch/AppleWatchLink.js +259 -0
- package/build/services/appleWatch/AppleWatchLink.js.map +1 -0
- package/build/services/controllers.d.ts.map +1 -1
- package/build/services/controllers.js +16 -0
- package/build/services/controllers.js.map +1 -1
- package/build/services/manifestActions.d.ts +4 -2
- package/build/services/manifestActions.d.ts.map +1 -1
- package/build/services/manifestActions.js +9 -3
- package/build/services/manifestActions.js.map +1 -1
- package/build/services/memoryBackupFile.d.ts +9 -0
- package/build/services/memoryBackupFile.d.ts.map +1 -0
- package/build/services/memoryBackupFile.js +47 -0
- package/build/services/memoryBackupFile.js.map +1 -0
- package/build/services/settingsBridge.d.ts +4 -4
- package/build/services/settingsBridge.d.ts.map +1 -1
- package/build/services/settingsBridge.js +9 -4
- package/build/services/settingsBridge.js.map +1 -1
- package/build/services/widgetPlacements.d.ts +8 -7
- package/build/services/widgetPlacements.d.ts.map +1 -1
- package/build/services/widgetPlacements.js +7 -6
- package/build/services/widgetPlacements.js.map +1 -1
- package/build/stores/apps.d.ts +6 -0
- package/build/stores/apps.d.ts.map +1 -1
- package/build/stores/apps.js +29 -12
- package/build/stores/apps.js.map +1 -1
- package/build/stores/bluetoothSettingKeys.d.ts +2 -0
- package/build/stores/bluetoothSettingKeys.d.ts.map +1 -1
- package/build/stores/bluetoothSettingKeys.js +17 -0
- package/build/stores/bluetoothSettingKeys.js.map +1 -1
- package/build/stores/settings.d.ts.map +1 -1
- package/build/stores/settings.js +42 -2
- package/build/stores/settings.js.map +1 -1
- package/build/types/applet.d.ts +5 -1
- package/build/types/applet.d.ts.map +1 -1
- package/build/types/applet.js.map +1 -1
- package/build/types/capabilities/rayneo-io.d.ts.map +1 -1
- package/build/types/capabilities/rayneo-io.js +2 -0
- package/build/types/capabilities/rayneo-io.js.map +1 -1
- package/build/types/enums.d.ts +2 -1
- package/build/types/enums.d.ts.map +1 -1
- package/build/types/enums.js +1 -0
- package/build/types/enums.js.map +1 -1
- package/build/utils/cloudClient/RnUdpAdapter.d.ts.map +1 -1
- package/build/utils/cloudClient/RnUdpAdapter.js +13 -2
- package/build/utils/cloudClient/RnUdpAdapter.js.map +1 -1
- package/build/utils/display/scene/index.d.ts +1 -1
- package/build/utils/display/scene/index.d.ts.map +1 -1
- package/build/utils/display/scene/index.js.map +1 -1
- package/build/utils/display/scene/process.d.ts.map +1 -1
- package/build/utils/display/scene/process.js +20 -1
- package/build/utils/display/scene/process.js.map +1 -1
- package/build/utils/display/scene/types.d.ts +1 -1
- package/build/utils/display/scene/types.d.ts.map +1 -1
- package/build/utils/display/scene/types.js.map +1 -1
- package/build/utils/miniappGlobals.d.ts +6 -0
- package/build/utils/miniappGlobals.d.ts.map +1 -1
- package/build/utils/miniappGlobals.js +28 -4
- package/build/utils/miniappGlobals.js.map +1 -1
- package/package.json +9 -9
- package/src/engine.ts +13 -1
- package/src/facades/ai.ts +3 -3
- package/src/facades/glasses.ts +65 -42
- package/src/facades/memory.ts +11 -2
- package/src/facades/miniapps.ts +3 -0
- package/src/facades/pairing.ts +4 -2
- package/src/facades/providerKeys.ts +6 -1
- package/src/generated/releaseMetadata.ts +4 -4
- package/src/services/AiTierResolution.ts +9 -3
- package/src/services/AppRegistry.ts +18 -3
- package/src/services/BlobStore.ts +3 -3
- package/src/services/BluetoothRestoreLaunch.ts +37 -0
- package/src/services/ForegroundLocationPermission.ts +1 -1
- package/src/services/GestureDotsService.ts +2 -1
- package/src/services/GlassesTouchInput.ts +86 -38
- package/src/services/LocalDisplayManager.ts +22 -8
- package/src/services/LocalLlmModelManager.ts +16 -6
- package/src/services/LocalLlmPrompt.ts +56 -37
- package/src/services/LocalLlmProvider.ts +74 -24
- package/src/services/LocalMiniappRuntime.ts +228 -147
- package/src/services/MemoryStore.ts +111 -2
- package/src/services/MiniappExitGesture.ts +8 -5
- package/src/services/MiniappWidgetMode.ts +9 -7
- package/src/services/ProviderKeyValidation.ts +5 -0
- package/src/services/SceneRenderer.ts +3 -1
- package/src/services/ScreenshotFixture.ts +113 -0
- package/src/services/actionInvoke.ts +105 -0
- package/src/services/appleWatch/AppleWatchLink.ts +297 -0
- package/src/services/controllers.ts +17 -0
- package/src/services/manifestActions.ts +16 -4
- package/src/services/memoryBackupFile.ts +50 -0
- package/src/services/settingsBridge.ts +9 -4
- package/src/services/widgetPlacements.ts +23 -9
- package/src/stores/apps.ts +35 -11
- package/src/stores/bluetoothSettingKeys.ts +20 -0
- package/src/stores/settings.ts +44 -2
- package/src/types/applet.ts +5 -1
- package/src/types/capabilities/rayneo-io.ts +2 -0
- package/src/types/enums.ts +1 -0
- package/src/utils/cloudClient/RnUdpAdapter.ts +13 -1
- package/src/utils/display/scene/index.ts +1 -0
- package/src/utils/display/scene/process.ts +17 -1
- package/src/utils/display/scene/types.ts +1 -0
- package/src/utils/miniappGlobals.ts +30 -4
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* purge everything; the full timeline surface (lines, sessions, summaries)
|
|
5
5
|
* is what miniapps reach through session.memory with the MEMORY permission.
|
|
6
6
|
*/
|
|
7
|
-
import type { MemoryEntry, MemorySession } from "@glassly/miniapp";
|
|
8
|
-
import type
|
|
7
|
+
import type { MemoryEntry, MemoryExportResult, MemoryImportResult, MemorySession } from "@glassly/miniapp";
|
|
8
|
+
import { type MemoryStats } from "../services/MemoryStore";
|
|
9
9
|
export declare const memory: {
|
|
10
10
|
/** All note entries, newest first. */
|
|
11
11
|
notes: () => Promise<MemoryEntry[]>;
|
|
@@ -26,6 +26,14 @@ export declare const memory: {
|
|
|
26
26
|
stats: () => Promise<MemoryStats>;
|
|
27
27
|
/** Drop the entire timeline: every entry and every summary. */
|
|
28
28
|
clearAll: () => Promise<void>;
|
|
29
|
+
/** Share the whole timeline as a JSON backup file. */
|
|
30
|
+
exportFile: () => Promise<MemoryExportResult>;
|
|
31
|
+
/**
|
|
32
|
+
* Pick a backup file and merge it in, skipping what's already stored.
|
|
33
|
+
* Resolves null on cancel; rejects with a MemoryBackupError for a non-backup file.
|
|
34
|
+
*/
|
|
35
|
+
importFile: () => Promise<MemoryImportResult | null>;
|
|
36
|
+
isBackupError: (err: unknown) => boolean;
|
|
29
37
|
/** Subscribe to store mutations (from miniapps or Settings). */
|
|
30
38
|
onChanged: (listener: () => void) => (() => void);
|
|
31
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/facades/memory.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAC,WAAW,EAAE,aAAa,EAAC,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/facades/memory.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAC,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,aAAa,EAAC,MAAM,kBAAkB,CAAA;AAGxG,OAAO,EAAoB,KAAK,WAAW,EAAC,MAAM,yBAAyB,CAAA;AAG3E,eAAO,MAAM,MAAM;IACjB,sCAAsC;iBAC3B,OAAO,CAAC,WAAW,EAAE,CAAC;IACjC;;;OAGG;oBACa,MAAM,OAAO,MAAM,KAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAEjE,sEAAsE;qBACrD,MAAM,QAAQ,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;IACxD,6CAA6C;sBAC3B,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;IAC3C,mFAAmF;oBACrE,OAAO,CAAC,aAAa,EAAE,CAAC;IACtC,4EAA4E;yBACvD,SAAS,GAAG,KAAK,MAAM,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;IAClE,yEAAyE;iBAC9D,OAAO,CAAC,WAAW,CAAC;IAC/B,+DAA+D;oBACjD,OAAO,CAAC,IAAI,CAAC;IAC3B,sDAAsD;sBACtC,OAAO,CAAC,kBAAkB,CAAC;IAC3C;;;OAGG;sBACa,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;yBAC7B,OAAO,KAAG,OAAO;IACtC,gEAAgE;0BAC1C,MAAM,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC;CAChD,CAAA"}
|
package/build/facades/memory.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { exportMemoryFile, importMemoryFile } from "../services/memoryBackupFile";
|
|
2
|
+
import { MemoryBackupError } from "../services/MemoryStore";
|
|
1
3
|
import { memoryStore } from "../services/memoryStoreInstance";
|
|
2
4
|
export const memory = {
|
|
3
5
|
/** All note entries, newest first. */
|
|
@@ -19,6 +21,14 @@ export const memory = {
|
|
|
19
21
|
stats: () => memoryStore.stats(),
|
|
20
22
|
/** Drop the entire timeline: every entry and every summary. */
|
|
21
23
|
clearAll: () => memoryStore.clear(),
|
|
24
|
+
/** Share the whole timeline as a JSON backup file. */
|
|
25
|
+
exportFile: () => exportMemoryFile(),
|
|
26
|
+
/**
|
|
27
|
+
* Pick a backup file and merge it in, skipping what's already stored.
|
|
28
|
+
* Resolves null on cancel; rejects with a MemoryBackupError for a non-backup file.
|
|
29
|
+
*/
|
|
30
|
+
importFile: () => importMemoryFile(),
|
|
31
|
+
isBackupError: (err) => err instanceof MemoryBackupError,
|
|
22
32
|
/** Subscribe to store mutations (from miniapps or Settings). */
|
|
23
33
|
onChanged: (listener) => memoryStore.onChanged(listener),
|
|
24
34
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../src/facades/memory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../src/facades/memory.ts"],"names":[],"mappings":"AAQA,OAAO,EAAC,gBAAgB,EAAE,gBAAgB,EAAC,MAAM,8BAA8B,CAAA;AAC/E,OAAO,EAAC,iBAAiB,EAAmB,MAAM,yBAAyB,CAAA;AAC3E,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAA;AAE3D,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,sCAAsC;IACtC,KAAK,EAAE,GAA2B,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE;IACxD;;;OAGG;IACH,OAAO,EAAE,CAAC,IAAY,EAAE,EAAW,EAA+B,EAAE,CAClE,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;IACnD,sEAAsE;IACtE,UAAU,EAAE,CAAC,EAAU,EAAE,IAAY,EAAoB,EAAE,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC;IAC5F,6CAA6C;IAC7C,WAAW,EAAE,CAAC,EAAU,EAAoB,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,CAAC;IAC1E,mFAAmF;IACnF,QAAQ,EAAE,GAA6B,EAAE,CAAC,WAAW,CAAC,WAAW,EAAE;IACnE,4EAA4E;IAC5E,WAAW,EAAE,CAAC,KAAwB,EAAE,EAAU,EAAiB,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC,KAAK,EAAE,EAAE,CAAC;IACxG,yEAAyE;IACzE,KAAK,EAAE,GAAyB,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE;IACtD,+DAA+D;IAC/D,QAAQ,EAAE,GAAkB,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE;IAClD,sDAAsD;IACtD,UAAU,EAAE,GAAgC,EAAE,CAAC,gBAAgB,EAAE;IACjE;;;OAGG;IACH,UAAU,EAAE,GAAuC,EAAE,CAAC,gBAAgB,EAAE;IACxE,aAAa,EAAE,CAAC,GAAY,EAAW,EAAE,CAAC,GAAG,YAAY,iBAAiB;IAC1E,gEAAgE;IAChE,SAAS,EAAE,CAAC,QAAoB,EAAgB,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC;CACnF,CAAA","sourcesContent":["/**\n * memory facade — `engine.memory`: the user's shared phone-local memory\n * timeline (Settings > Memory). Host UI manages the note entries and can\n * purge everything; the full timeline surface (lines, sessions, summaries)\n * is what miniapps reach through session.memory with the MEMORY permission.\n */\nimport type {MemoryEntry, MemoryExportResult, MemoryImportResult, MemorySession} from \"@glassly/miniapp\"\n\nimport {exportMemoryFile, importMemoryFile} from \"../services/memoryBackupFile\"\nimport {MemoryBackupError, type MemoryStats} from \"../services/MemoryStore\"\nimport {memoryStore} from \"../services/memoryStoreInstance\"\n\nexport const memory = {\n /** All note entries, newest first. */\n notes: (): Promise<MemoryEntry[]> => memoryStore.notes(),\n /**\n * Add a manual note (\"ui\" source). Pass `at` inside a past hour to append\n * to that session. Resolves null on duplicate/empty.\n */\n addNote: (text: string, at?: number): Promise<MemoryEntry | null> =>\n memoryStore.addNote(text, \"ui\", at ?? Date.now()),\n /** Rewrite a note's text. Resolves false when the id isn't a note. */\n updateNote: (id: string, text: string): Promise<boolean> => memoryStore.updateNote(id, text),\n /** Delete one entry (note or line) by id. */\n removeEntry: (id: string): Promise<boolean> => memoryStore.removeEntry(id),\n /** All sessions (hours with entries + summary), newest first (history browser). */\n sessions: (): Promise<MemorySession[]> => memoryStore.sessionList(),\n /** Delete every entry (and summary) in an hour, or a whole day of hours. */\n removeScope: (scope: \"session\" | \"day\", at: number): Promise<void> => memoryStore.removeScope(scope, at),\n /** Counts for the Settings screen (entries, lines, notes, summaries). */\n stats: (): Promise<MemoryStats> => memoryStore.stats(),\n /** Drop the entire timeline: every entry and every summary. */\n clearAll: (): Promise<void> => memoryStore.clear(),\n /** Share the whole timeline as a JSON backup file. */\n exportFile: (): Promise<MemoryExportResult> => exportMemoryFile(),\n /**\n * Pick a backup file and merge it in, skipping what's already stored.\n * Resolves null on cancel; rejects with a MemoryBackupError for a non-backup file.\n */\n importFile: (): Promise<MemoryImportResult | null> => importMemoryFile(),\n isBackupError: (err: unknown): boolean => err instanceof MemoryBackupError,\n /** Subscribe to store mutations (from miniapps or Settings). */\n onChanged: (listener: () => void): (() => void) => memoryStore.onChanged(listener),\n}\n"]}
|
|
@@ -46,6 +46,8 @@ export declare const miniapps: {
|
|
|
46
46
|
setHiddenStatus: (packageName: string, status: boolean) => void;
|
|
47
47
|
/** Mark a miniapp Always On (starts at launch, stops only from the switcher pill), persisted for the next boot. */
|
|
48
48
|
setAlwaysOn: (packageName: string, status: boolean) => Promise<void>;
|
|
49
|
+
/** Whether a tap expands one of the miniapp's `EX` widgets to the full screen, persisted. */
|
|
50
|
+
setWidgetExpand: (packageName: string, widgetId: string, expandOnTap: boolean) => boolean;
|
|
49
51
|
/** Installed dashboard miniapps (manifest type "dashboard"); one runs at a time. */
|
|
50
52
|
dashboards: () => ClientApp[];
|
|
51
53
|
/** The running dashboard miniapp, or null when none is. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"miniapps.d.ts","sourceRoot":"","sources":["../../src/facades/miniapps.ts"],"names":[],"mappings":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;IACpC,qEAAqE;0CAC/B,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC;IAGrF,wDAAwD;;IAExD,oCAAoC;;IAEpC,sBAAsB;;IAEtB,iDAAiD;;IAGjD,6FAA6F;+BAClE,MAAM,UAAU,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAEjE,4CAA4C;;IAE5C,iCAAiC;;IAEjC,2CAA2C;;;;IAE3C,2BAA2B;;IAE3B,2EAA2E;;IAG3E,gDAAgD;;IAGhD,mHAAmH;;IAEnH,6FAA6F;;IAI7F,oFAAoF;sBACpE,SAAS,EAAE;IAC3B,2DAA2D;4BACrC,SAAS,GAAG,IAAI;CAEvC,CAAA"}
|
|
@@ -54,6 +54,8 @@ export const miniapps = {
|
|
|
54
54
|
setHiddenStatus: (...args) => useAppStatusStore.getState().setHiddenStatus(...args),
|
|
55
55
|
/** Mark a miniapp Always On (starts at launch, stops only from the switcher pill), persisted for the next boot. */
|
|
56
56
|
setAlwaysOn: (...args) => useAppStatusStore.getState().setAlwaysOn(...args),
|
|
57
|
+
/** Whether a tap expands one of the miniapp's `EX` widgets to the full screen, persisted. */
|
|
58
|
+
setWidgetExpand: (...args) => useAppStatusStore.getState().setWidgetExpand(...args),
|
|
57
59
|
/** Installed dashboard miniapps (manifest type "dashboard"); one runs at a time. */
|
|
58
60
|
dashboards: () => useAppStatusStore.getState().apps.filter((app) => app.type === "dashboard"),
|
|
59
61
|
/** The running dashboard miniapp, or null when none is. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"miniapps.js","sourceRoot":"","sources":["../../src/facades/miniapps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAC,iBAAiB,EAAC,MAAM,gBAAgB,CAAA;AAChD,OAAO,mBAAmB,MAAM,iCAAiC,CAAA;AAKjE,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,yCAAyC;IACzC,+EAA+E;IAC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GAAG,IAAI,CAAC;IAEvD,oFAAoF;IACpF,UAAU,EAAE,GAAgB,EAAE,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,WAAW,CAAC;IAC1G,2DAA2D;IAC3D,gBAAgB,EAAE,GAAqB,EAAE,CACvC,iBAAiB,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,WAAW,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI;CACnG,CAAA","sourcesContent":["/**\n * miniapps facade — `engine.miniapps`: miniapp lifecycle over the engine-owned\n * apps store. Thin forwarding (args via Parameters<>), so the facade never drifts\n * from the store's actions.\n *\n * The miniapp WebView is a HOST component (engine ships the bridge, not the view) —\n * the bridge primitives (`buildMiniappGlobalsScript`, `buildUiShim`, the\n * JSRuntime router) are exported from `@glassly/engine` directly; the host mounts a\n * `<WebView>` wired to them. This facade is the lifecycle half.\n */\nimport {useAppStatusStore} from \"../stores/apps\"\nimport localMiniappRuntime from \"../services/LocalMiniappRuntime\"\nimport type {ClientApp} from \"../types\"\n\ntype AppsState = ReturnType<typeof useAppStatusStore.getState>\n\nexport const miniapps = {\n /** All installed miniapps (snapshot). */\n // Copy: the snapshot must not hand callers a mutable reference into the store.\n list: (): ClientApp[] => [...useAppStatusStore.getState().apps],\n /** Subscribe to the installed-app set; fires only when it changes. Returns an unsubscribe. */\n onChanged: (cb: (apps: ClientApp[]) => void): (() => void) => {\n let last = JSON.stringify(useAppStatusStore.getState().apps)\n return useAppStatusStore.subscribe(() => {\n const apps = useAppStatusStore.getState().apps\n const key = JSON.stringify(apps)\n if (key === last) return\n last = key\n cb(apps)\n })\n },\n\n /** Miniapps actively subscribed to Mentra Live hardware-button events. */\n buttonPressSubscribers: (): string[] => localMiniappRuntime.getButtonPressSubscribers(),\n /** Observe the active Mentra Live hardware-button subscriber set. */\n onButtonPressSubscribersChanged: (cb: (packageNames: string[]) => void): (() => void) =>\n localMiniappRuntime.onButtonPressSubscribersChanged(cb),\n\n /** Re-fetch the installed-app list from the backend. */\n refresh: () => useAppStatusStore.getState().refresh(),\n /** Start (foreground) a miniapp. */\n start: (...args: Parameters<AppsState[\"start\"]>) => useAppStatusStore.getState().start(...args),\n /** Stop a miniapp. */\n stop: (...args: Parameters<AppsState[\"stop\"]>) => useAppStatusStore.getState().stop(...args),\n /** Bring a running miniapp to the foreground. */\n setForeground: (...args: Parameters<AppsState[\"setForeground\"]>) =>\n useAppStatusStore.getState().setForeground(...args),\n /** Hand an external link's query parameters to a miniapp (queued until it has connected). */\n deliverLink: (packageName: string, params: Record<string, string>) =>\n localMiniappRuntime.deliverLink(packageName, params),\n /** Clear the current foreground miniapp. */\n clearForeground: () => useAppStatusStore.getState().clearForeground(),\n /** Stop all running miniapps. */\n stopAll: () => useAppStatusStore.getState().stopAll(),\n /** Install a miniapp from a bundle URL. */\n install: (...args: Parameters<AppsState[\"install\"]>) => useAppStatusStore.getState().install(...args),\n /** Uninstall a miniapp. */\n uninstall: (...args: Parameters<AppsState[\"uninstall\"]>) => useAppStatusStore.getState().uninstall(...args),\n /** Persist a miniapp's captured screenshot (the switcher/card preview). */\n saveScreenshot: (...args: Parameters<AppsState[\"saveScreenshot\"]>) =>\n useAppStatusStore.getState().saveScreenshot(...args),\n /** Hide/show a miniapp on the home surfaces. */\n setHiddenStatus: (...args: Parameters<AppsState[\"setHiddenStatus\"]>) =>\n useAppStatusStore.getState().setHiddenStatus(...args),\n /** Mark a miniapp Always On (starts at launch, stops only from the switcher pill), persisted for the next boot. */\n setAlwaysOn: (...args: Parameters<AppsState[\"setAlwaysOn\"]>) => useAppStatusStore.getState().setAlwaysOn(...args),\n /** Whether a tap expands one of the miniapp's `EX` widgets to the full screen, persisted. */\n setWidgetExpand: (...args: Parameters<AppsState[\"setWidgetExpand\"]>) =>\n useAppStatusStore.getState().setWidgetExpand(...args),\n\n /** Installed dashboard miniapps (manifest type \"dashboard\"); one runs at a time. */\n dashboards: (): ClientApp[] => useAppStatusStore.getState().apps.filter((app) => app.type === \"dashboard\"),\n /** The running dashboard miniapp, or null when none is. */\n runningDashboard: (): ClientApp | null =>\n useAppStatusStore.getState().apps.find((app) => app.type === \"dashboard\" && app.running) ?? null,\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pairing.d.ts","sourceRoot":"","sources":["../../src/facades/pairing.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,oBAAoB,EAAC,MAAM,wBAAwB,CAAA;AAKvH,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"pairing.d.ts","sourceRoot":"","sources":["../../src/facades/pairing.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,oBAAoB,EAAC,MAAM,wBAAwB,CAAA;AAKvH,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,6BAA6B,CAAA;AAGpC,OAAO,EAGL,KAAK,+BAA+B,EACrC,MAAM,mCAAmC,CAAA;AAO1C,YAAY,EAAC,gBAAgB,EAAC,MAAM,6BAA6B,CAAA;AAEjE,MAAM,WAAW,uBAAuB;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB;AAOD,iBAAS,gBAAgB;;;;;;EASxB;AAiFD,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAE1E,wBAAs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CAAC,MAAM,IAAI,CAAC;IAEpE,2CAA2C;;;;;;;;;;;;IAI3C,6FAA6F;kBAC/E,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC;IAYxD;;;;;;OAMG;mBACkB,MAAM,YAAY,cAAc,KAAG,OAAO,CAAC,IAAI,CAAC;IAIrE,6EAA6E;yBACxD,MAAM,GAAG,IAAI,KAAG,OAAO,CAAC,IAAI,CAAC;IAClD;;;;;;;;OAQG;wCACiC,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;IAE1D;;;;;;;;;;;;;;;;;;OAkBG;0BACuB,OAAO,CAAC,IAAI,CAAC;IAmCvC;;;OAGG;oCAC2B,OAAO,CAAC,IAAI,CAAC;IAE3C,6DAA6D;wBACzC,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC;IAIpE,oFAAoF;4BAC5D,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC;IAI5E,sFAAsF;;IAEtF,uEAAuE;;CAExE,CAAA"}
|
package/build/facades/pairing.js
CHANGED
|
@@ -15,6 +15,7 @@ import { useGlassesStore } from "../stores/glasses";
|
|
|
15
15
|
import { useSettingsStore } from "../stores/settings";
|
|
16
16
|
import { hasDefaultDevice } from "../services/DeviceStoreHydration";
|
|
17
17
|
import { markPendingSelection, projectPairingIdentity, subscribePairingIdentity, } from "../services/PairingIdentity";
|
|
18
|
+
import { fixtureIdentity } from "../services/ScreenshotFixture";
|
|
18
19
|
import { isGlassesConnected, isGlassesLinkLayerBusy, isGlassesReady } from "../services/GlassesReadiness";
|
|
19
20
|
import { logAutomaticReportSubmissionStatus, toAutomaticReportSubmissionStatus, } from "../services/AutomaticReportResult";
|
|
20
21
|
import { pushAllBluetoothSettings } from "../services/GlassesSettingsSync";
|
|
@@ -219,10 +220,10 @@ export const pairing = {
|
|
|
219
220
|
// --- pairing-identity lifecycle (the PairingIdentity read-model + the JS-owned
|
|
220
221
|
// identity writes; promotion to `paired` only ever happens natively) ---
|
|
221
222
|
/** The identity lifecycle snapshot: none | pending (chosen, never paired) | paired. */
|
|
222
|
-
identity: () => projectPairingIdentity(),
|
|
223
|
+
identity: () => fixtureIdentity(projectPairingIdentity()),
|
|
223
224
|
/** Subscribe to identity changes; fires only when the projected snapshot changes.
|
|
224
225
|
* Returns an unsubscribe. */
|
|
225
|
-
onIdentity: (cb) => subscribePairingIdentity(cb),
|
|
226
|
+
onIdentity: (cb) => subscribePairingIdentity((identity) => cb(fixtureIdentity(identity))),
|
|
226
227
|
/** Mark the chosen model as the pending selection (the scan-entry write); the
|
|
227
228
|
* host renders it as a finish-pairing affordance until pairing succeeds. */
|
|
228
229
|
markPendingSelection: (model) => markPendingSelection(model),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pairing.js","sourceRoot":"","sources":["../../src/facades/pairing.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,0EAA0E;AAC1E,4EAA4E;AAC5E,wCAAwC;AACxC,OAAO,YAAY,MAAM,iCAAiC,CAAA;AAE1D,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAC,gBAAgB,EAAC,MAAM,kCAAkC,CAAA;AACjE,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,GAEzB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAC,kBAAkB,EAAE,sBAAsB,EAAE,cAAc,EAAC,MAAM,8BAA8B,CAAA;AACvG,OAAO,EACL,kCAAkC,EAClC,iCAAiC,GAElC,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAC,wBAAwB,EAAC,MAAM,iCAAiC,CAAA;AACxE,OAAO,EAAC,iBAAiB,E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,CAAA;IAC3B,CAAC;IACD,oFAAoF;IACpF,iBAAiB,EAAE,CAAC,EAAyC,EAAgB,EAAE;QAC7E,MAAM,GAAG,GAAG,YAAY,CAAC,WAAW,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAA;QAC7D,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAA;IAC3B,CAAC;IACD,sFAAsF;IACtF,YAAY,EAAE,yBAAyB;IACvC,uEAAuE;IACvE,uBAAuB;CACxB,CAAA","sourcesContent":["/**\n * pairing facade — `engine.pairing`: scan for nearby glasses + pair. Scan state\n * (searching + results) comes from the engine core store; scan/connect go over the\n * bluetooth-sdk; pair-failure / not-ready are the bluetooth-sdk events.\n *\n * (Connect-the-already-paired-default is `engine.glasses.connectDefault()`; this\n * facade is the first-time discovery + pair flow.)\n */\n// Internal btsdk surface — updateBluetoothSettings (the Bluetooth Classic\n// target hint) lives on the full surface, not the public entry (same reason\n// the glasses facade imports internal).\nimport BluetoothSdk from \"@glassly/bluetooth-sdk/internal\"\nimport type {ConnectOptions, Device, DeviceModel, PairFailureEvent, GlassesNotReadyEvent} from \"@glassly/bluetooth-sdk\"\nimport {useCoreStore} from \"../stores/core\"\nimport {useGlassesStore} from \"../stores/glasses\"\nimport {useSettingsStore} from \"../stores/settings\"\nimport {hasDefaultDevice} from \"../services/DeviceStoreHydration\"\nimport {\n markPendingSelection,\n projectPairingIdentity,\n subscribePairingIdentity,\n type IdentitySnapshot,\n} from \"../services/PairingIdentity\"\nimport {isGlassesConnected, isGlassesLinkLayerBusy, isGlassesReady} from \"../services/GlassesReadiness\"\nimport {\n logAutomaticReportSubmissionStatus,\n toAutomaticReportSubmissionStatus,\n type AutomaticReportSubmissionStatus,\n} from \"../services/AutomaticReportResult\"\nimport {pushAllBluetoothSettings} from \"../services/GlassesSettingsSync\"\nimport {isControllerModel, isControllerReady} from \"../services/controllers\"\nimport {submitAutomaticReport} from \"./reports\"\n\nimport {BgTimer} from \"../utils/timers\"\n\nexport type {IdentitySnapshot} from \"../services/PairingIdentity\"\n\nexport interface PairingReadyWaitOptions {\n deviceModel?: string\n deviceName?: string\n timeoutMs?: number\n route?: string\n signal?: AbortSignal\n}\n\nconst DEFAULT_PAIRING_BOOT_TIMEOUT_MS = 35_000\nconst DEFAULT_BT_CLASSIC_TIMEOUT_MS = 1_000\nconst DEFAULT_PAIRING_ROUTE = \"/pairing/loading\"\nconst LOG_TAG = \"PairingTimeoutReport\"\n\nfunction projectReadiness() {\n const s = useGlassesStore.getState()\n return {\n state: s.connection.state,\n connected: s.connection.state === \"connected\",\n fullyBooted: isGlassesReady(s.connection),\n bluetoothClassicConnected: s.bluetoothClassicConnected,\n nativeLinkBusy: isGlassesLinkLayerBusy(s.connection),\n }\n}\n\nfunction projectTargetReady(options: Pick<PairingReadyWaitOptions, \"deviceModel\" | \"deviceName\">): boolean {\n const {deviceModel, deviceName} = options\n const glasses = useGlassesStore.getState()\n\n // A controller target is ready once some driver of that model delivers input;\n // the scan's device name is the R1's ring id or the band's Bluetooth name.\n if (isControllerModel(deviceModel)) {\n return Object.values(glasses.controllers ?? {}).some(\n (status) =>\n status.model === deviceModel &&\n isControllerReady(status) &&\n (!deviceName || status.name === deviceName || status.id === deviceName),\n )\n }\n\n if (!isGlassesReady(glasses.connection)) return false\n const identity = projectPairingIdentity()\n if (!deviceModel && !deviceName) return true\n return (\n identity.kind === \"paired\" &&\n (!deviceModel || identity.model === deviceModel) &&\n (!deviceName || identity.name === deviceName)\n )\n}\n\nfunction subscribeTargetReady(\n options: Pick<PairingReadyWaitOptions, \"deviceModel\" | \"deviceName\">,\n cb: (ready: boolean) => void,\n): () => void {\n let last = projectTargetReady(options)\n const notify = () => {\n const ready = projectTargetReady(options)\n if (ready === last) return\n last = ready\n cb(ready)\n }\n const unsubscribeGlasses = useGlassesStore.subscribe(notify)\n const unsubscribeSettings = useSettingsStore.subscribe(notify)\n return () => {\n unsubscribeGlasses()\n unsubscribeSettings()\n }\n}\n\nasync function waitForTargetReady(options: PairingReadyWaitOptions, timeoutMs: number): Promise<boolean> {\n return new Promise((resolve) => {\n if (options.signal?.aborted) {\n resolve(false)\n return\n }\n if (projectTargetReady(options)) {\n resolve(true)\n return\n }\n\n let settled = false\n let timeout: number | null = null\n let unsubscribe: (() => void) | null = null\n let onAbort: (() => void) | null = null\n const finish = (ready: boolean) => {\n if (settled) return\n settled = true\n if (timeout) BgTimer.clearTimeout(timeout)\n if (unsubscribe) unsubscribe()\n if (onAbort && options.signal) options.signal.removeEventListener(\"abort\", onAbort)\n resolve(ready)\n }\n\n unsubscribe = subscribeTargetReady(options, (ready) => {\n if (ready) finish(true)\n })\n if (options.signal) {\n onAbort = () => finish(false)\n options.signal.addEventListener(\"abort\", onAbort)\n }\n timeout = BgTimer.setTimeout(() => finish(projectTargetReady(options)), timeoutMs)\n })\n}\n\nexport type PairingReadinessSnapshot = ReturnType<typeof projectReadiness>\n\nexport async function submitPairingBootTimeoutReport(params: {\n deviceModel?: string\n deviceName?: string\n showGlassesBooting: boolean\n elapsedMs: number\n route?: string\n}): Promise<AutomaticReportSubmissionStatus> {\n const {deviceModel, deviceName, showGlassesBooting, elapsedMs, route = DEFAULT_PAIRING_ROUTE} = params\n const result = await submitAutomaticReport({\n kind: \"automatic\",\n trigger: {\n type: \"automatic\",\n source: \"pairing_loading\",\n reason: \"glasses_connect_timeout\",\n },\n report: {\n expectedBehavior: `Glasses should connect successfully within ${Math.round(elapsedMs / 1000)} seconds.`,\n actualBehavior: JSON.stringify(\n {\n deviceModel,\n deviceName,\n showGlassesBooting,\n elapsedMs,\n route,\n },\n null,\n 2,\n ),\n systemPriority: \"medium\",\n },\n throttleKey: `pairing_timeout|${deviceModel || \"unknown\"}|${deviceName || \"unknown\"}`,\n })\n\n const status = toAutomaticReportSubmissionStatus(result)\n logAutomaticReportSubmissionStatus(LOG_TAG, status, deviceModel, deviceName)\n return status\n}\n\nasync function waitForReadyDuringPairing(options: PairingReadyWaitOptions = {}): Promise<boolean> {\n const timeoutMs = options.timeoutMs ?? DEFAULT_PAIRING_BOOT_TIMEOUT_MS\n let showGlassesBooting = false\n const notReadySub = BluetoothSdk.addListener(\"glasses_not_ready\", () => {\n showGlassesBooting = true\n })\n\n try {\n const ready = await waitForTargetReady(options, timeoutMs)\n\n if (!ready && !options.signal?.aborted) {\n void submitPairingBootTimeoutReport({\n deviceModel: options.deviceModel,\n deviceName: options.deviceName,\n showGlassesBooting,\n elapsedMs: timeoutMs,\n route: options.route,\n }).catch((error) => {\n console.error(`[${LOG_TAG}] Unexpected error:`, error)\n })\n }\n\n return ready\n } finally {\n notReadySub.remove()\n }\n}\n\nasync function waitForBluetoothClassic(\n options: Pick<PairingReadyWaitOptions, \"timeoutMs\" | \"signal\"> = {},\n): Promise<boolean> {\n const timeoutMs = options.timeoutMs ?? DEFAULT_BT_CLASSIC_TIMEOUT_MS\n return new Promise((resolve) => {\n if (options.signal?.aborted) {\n resolve(false)\n return\n }\n\n const initial = useGlassesStore.getState().bluetoothClassicConnected\n if (initial) {\n resolve(true)\n return\n }\n\n let settled = false\n let timeout: number | null = null\n let unsubscribe: (() => void) | null = null\n let onAbort: (() => void) | null = null\n\n const finish = (value: boolean) => {\n if (settled) return\n settled = true\n if (timeout) BgTimer.clearTimeout(timeout)\n if (unsubscribe) unsubscribe()\n if (onAbort && options.signal) options.signal.removeEventListener(\"abort\", onAbort)\n resolve(value)\n }\n\n if (options.signal) {\n onAbort = () => finish(false)\n options.signal.addEventListener(\"abort\", onAbort)\n }\n\n unsubscribe = useGlassesStore.subscribe(\n (s) => s.bluetoothClassicConnected,\n (connected) => {\n if (connected) finish(true)\n },\n )\n\n timeout = BgTimer.setTimeout(() => {\n finish(useGlassesStore.getState().bluetoothClassicConnected)\n }, timeoutMs)\n })\n}\n\nexport const pairing = {\n readiness: (): PairingReadinessSnapshot => projectReadiness(),\n onReadiness: (cb: (readiness: PairingReadinessSnapshot) => void): (() => void) => {\n let last = JSON.stringify(projectReadiness())\n return useGlassesStore.subscribe(() => {\n const snap = projectReadiness()\n const key = JSON.stringify(snap)\n if (key === last) return\n last = key\n cb(snap)\n })\n },\n /** Whether the exact wearable or controller selected on the scan screen is ready. */\n targetReady: (options: Pick<PairingReadyWaitOptions, \"deviceModel\" | \"deviceName\">): boolean =>\n projectTargetReady(options),\n /** Subscribe to readiness for the exact selected target, excluding stale devices. */\n onTargetReady: (\n options: Pick<PairingReadyWaitOptions, \"deviceModel\" | \"deviceName\">,\n cb: (ready: boolean) => void,\n ): (() => void) => subscribeTargetReady(options, cb),\n\n // --- pairing-identity lifecycle (the PairingIdentity read-model + the JS-owned\n // identity writes; promotion to `paired` only ever happens natively) ---\n /** The identity lifecycle snapshot: none | pending (chosen, never paired) | paired. */\n identity: (): IdentitySnapshot => projectPairingIdentity(),\n /** Subscribe to identity changes; fires only when the projected snapshot changes.\n * Returns an unsubscribe. */\n onIdentity: (cb: (identity: IdentitySnapshot) => void): (() => void) => subscribePairingIdentity(cb),\n /** Mark the chosen model as the pending selection (the scan-entry write); the\n * host renders it as a finish-pairing affordance until pairing succeeds. */\n markPendingSelection: (model: string) => markPendingSelection(model),\n\n /** Start scanning for nearby glasses or controllers of `model`. Results land on `searchResults()`/`onFound()`. */\n scan: (model: DeviceModel): Promise<void> => BluetoothSdk.startScan(model),\n /** Whether a scan is currently in progress. */\n scanning: (): boolean => useCoreStore.getState().searching,\n /** Subscribe to scan-in-progress changes; fires only when it changes. Returns an unsubscribe. */\n onScanning: (cb: (scanning: boolean) => void): (() => void) => useCoreStore.subscribe((s) => s.searching, cb),\n /** Whether the phone has another Bluetooth (audio) device connected — the BT Classic pairing hint. */\n otherBtConnected: (): boolean => useCoreStore.getState().otherBtConnected,\n /** Subscribe to other-Bluetooth-device-connected changes; fires only when it changes. Returns an unsubscribe. */\n onOtherBtConnected: (cb: (connected: boolean) => void): (() => void) =>\n useCoreStore.subscribe((s) => s.otherBtConnected, cb),\n /** The current scan results (snapshot). */\n // Copy the array AND each entry: neither the list nor the Device objects may\n // leak as mutable references into the store.\n searchResults: () => useCoreStore.getState().searchResults.map((result) => ({...result})),\n /** Subscribe to scan-result changes; fires only when they change. Returns an unsubscribe. */\n onFound: (cb: (results: Device[]) => void): (() => void) => {\n let last = JSON.stringify(useCoreStore.getState().searchResults)\n return useCoreStore.subscribe(() => {\n const results = useCoreStore.getState().searchResults\n const key = JSON.stringify(results)\n if (key === last) return\n last = key\n // Copy like searchResults(): listeners must not mutate shared scan state.\n cb(results.map((result) => ({...result})))\n })\n },\n\n /**\n * Pair with (connect to) a discovered device. Two-phase identity: the connect\n * attempt only marks the device as pending (`saveAsDefault: false` — no eager\n * default-device write); the native layer promotes it to the default wearable\n * when pairing actually succeeds (handleDeviceReady), so an abandoned or\n * failed attempt can't leave a default identity with no paired device behind.\n */\n pair: async (device: Device, options?: ConnectOptions): Promise<void> => {\n await pushAllBluetoothSettings()\n return BluetoothSdk.connect(device, {...options, saveAsDefault: false})\n },\n /** Set a device as the default for subsequent `glasses.connectDefault()`. */\n setDefault: (device: Device | null): Promise<void> => BluetoothSdk.setDefaultDevice(device),\n /**\n * Prime the native Bluetooth Classic audio watcher with the picked device.\n * The iOS Mentra Live flow pairs Classic audio BEFORE any BLE connect\n * exists, and native detects the pairing by matching the connected audio\n * route against its device_name — which two-phase identity no longer sets\n * at selection time. This is native-only routing state (device_name has no\n * native→JS echo): the phone's persisted identity is untouched, and\n * promotion still happens only at pairing success.\n */\n setBluetoothClassicTarget: (device: Device): Promise<void> =>\n BluetoothSdk.updateBluetoothSettings({device_name: device.name}),\n /**\n * Abandon an in-flight pairing attempt (back-out, failure retry, conflict\n * retry) without destroying an existing pairing. The decision comes from the\n * LIVE hydrated default-device read — never from flow-entry state, because a\n * pairing can PROMOTE while the flow is open (the glasses finish pairing\n * even as the user backs out of the UI), and an entry snapshot would forget\n * that brand-new pairing:\n * - Default device exists and glasses are connected (nothing in flight — an\n * attempt drops the link first): stop the scan, touch nothing else.\n * - Default device exists with an attempt in flight: cancel it, then re-seed\n * the native identity from the phone's persisted settings — the attempt's\n * connect-by-name overwrote the native device_name, so a later\n * connectDefault() would otherwise target the abandoned device.\n * - No default device (genuinely unpaired attempt): also forget, clearing\n * the partial native pairing state.\n * The read fails OPEN to \"preserve\" — a transient failure must never wipe a\n * real pairing. The `pending_wearable` marker is deliberately left alone —\n * the host renders it as a finish-pairing affordance.\n */\n abandonAttempt: async (): Promise<void> => {\n const nativeHasDefault = await hasDefaultDevice().catch(() => true)\n if (nativeHasDefault && isGlassesConnected(useGlassesStore.getState().connection)) {\n // Still connected means no connect attempt is in flight (an attempt drops\n // the existing link first): the user browsed the scan and backed out.\n // Stop the scan and leave the live pairing untouched.\n console.log(\"PairingIdentity: abandonAttempt — pairing intact and connected; stopping scan only\")\n await BluetoothSdk.stopScan()\n return\n }\n if (projectPairingIdentity().kind === \"paired\") {\n // The persisted settings describe a COMPLETE pairing: restore it to\n // native (the attempt's connect-by-name overwrote the native\n // device_name; and if native somehow lost its default entirely, this\n // repairs the divergence instead of forgetting a real pairing).\n console.log(\"PairingIdentity: abandonAttempt — preserving pairing; attempt cancelled, native identity re-seeded\")\n await BluetoothSdk.disconnect()\n await pushAllBluetoothSettings()\n return\n }\n if (nativeHasDefault) {\n // Mid-relay: native promoted and its echoes are still landing — the\n // incomplete JS snapshot must not be pushed over the fresher native\n // identity (the on-connect replay's race). Native holds the truth.\n console.log(\"PairingIdentity: abandonAttempt — preserving pairing; JS identity mid-relay, native kept as-is\")\n await BluetoothSdk.disconnect()\n return\n }\n // Partial attempt: forget owns teardown. Do NOT disconnect() first — that\n // nulls the MentraLive SGC and used to skip Classic removeBond, leaving\n // IBRT ACL up so glasses never re-advertise for the next scan.\n console.log(\"PairingIdentity: abandonAttempt — no pairing on either layer; forgetting the partial attempt\")\n await BluetoothSdk.forget()\n },\n\n /**\n * Abandon an in-flight controller pairing (back-out, failure retry). Only the\n * attempt's driver is dropped; paired controllers and the glasses are untouched.\n */\n abandonControllerAttempt: (): Promise<void> => BluetoothSdk.cancelControllerAttempt(),\n\n /** Subscribe to pairing failures; returns an unsubscribe. */\n onPairFailure: (cb: (event: PairFailureEvent) => void): (() => void) => {\n const sub = BluetoothSdk.addListener(\"pair_failure\", cb)\n return () => sub.remove()\n },\n /** Subscribe to glasses-not-ready events during pairing; returns an unsubscribe. */\n onGlassesNotReady: (cb: (event: GlassesNotReadyEvent) => void): (() => void) => {\n const sub = BluetoothSdk.addListener(\"glasses_not_ready\", cb)\n return () => sub.remove()\n },\n /** Wait for paired glasses to finish booting; engine files the timeout diagnostic. */\n waitForReady: waitForReadyDuringPairing,\n /** Wait briefly for Bluetooth Classic to come up after BLE pairing. */\n waitForBluetoothClassic,\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pairing.js","sourceRoot":"","sources":["../../src/facades/pairing.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,0EAA0E;AAC1E,4EAA4E;AAC5E,wCAAwC;AACxC,OAAO,YAAY,MAAM,iCAAiC,CAAA;AAE1D,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAC,gBAAgB,EAAC,MAAM,kCAAkC,CAAA;AACjE,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,GAEzB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAC,eAAe,EAAC,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAC,kBAAkB,EAAE,sBAAsB,EAAE,cAAc,EAAC,MAAM,8BAA8B,CAAA;AACvG,OAAO,EACL,kCAAkC,EAClC,iCAAiC,GAElC,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAC,wBAAwB,EAAC,MAAM,iCAAiC,CAAA;AACxE,OAAO,EAAC,iBAAiB,EAAE,iBAAiB,EAAC,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAA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,CAAC,GAAG,CAAC,MAAM,EAAE,CAAA;IAC3B,CAAC;IACD,oFAAoF;IACpF,iBAAiB,EAAE,CAAC,EAAyC,EAAgB,EAAE;QAC7E,MAAM,GAAG,GAAG,YAAY,CAAC,WAAW,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAA;QAC7D,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAA;IAC3B,CAAC;IACD,sFAAsF;IACtF,YAAY,EAAE,yBAAyB;IACvC,uEAAuE;IACvE,uBAAuB;CACxB,CAAA","sourcesContent":["/**\n * pairing facade — `engine.pairing`: scan for nearby glasses + pair. Scan state\n * (searching + results) comes from the engine core store; scan/connect go over the\n * bluetooth-sdk; pair-failure / not-ready are the bluetooth-sdk events.\n *\n * (Connect-the-already-paired-default is `engine.glasses.connectDefault()`; this\n * facade is the first-time discovery + pair flow.)\n */\n// Internal btsdk surface — updateBluetoothSettings (the Bluetooth Classic\n// target hint) lives on the full surface, not the public entry (same reason\n// the glasses facade imports internal).\nimport BluetoothSdk from \"@glassly/bluetooth-sdk/internal\"\nimport type {ConnectOptions, Device, DeviceModel, PairFailureEvent, GlassesNotReadyEvent} from \"@glassly/bluetooth-sdk\"\nimport {useCoreStore} from \"../stores/core\"\nimport {useGlassesStore} from \"../stores/glasses\"\nimport {useSettingsStore} from \"../stores/settings\"\nimport {hasDefaultDevice} from \"../services/DeviceStoreHydration\"\nimport {\n markPendingSelection,\n projectPairingIdentity,\n subscribePairingIdentity,\n type IdentitySnapshot,\n} from \"../services/PairingIdentity\"\nimport {fixtureIdentity} from \"../services/ScreenshotFixture\"\nimport {isGlassesConnected, isGlassesLinkLayerBusy, isGlassesReady} from \"../services/GlassesReadiness\"\nimport {\n logAutomaticReportSubmissionStatus,\n toAutomaticReportSubmissionStatus,\n type AutomaticReportSubmissionStatus,\n} from \"../services/AutomaticReportResult\"\nimport {pushAllBluetoothSettings} from \"../services/GlassesSettingsSync\"\nimport {isControllerModel, isControllerReady} from \"../services/controllers\"\nimport {submitAutomaticReport} from \"./reports\"\n\nimport {BgTimer} from \"../utils/timers\"\n\nexport type {IdentitySnapshot} from \"../services/PairingIdentity\"\n\nexport interface PairingReadyWaitOptions {\n deviceModel?: string\n deviceName?: string\n timeoutMs?: number\n route?: string\n signal?: AbortSignal\n}\n\nconst DEFAULT_PAIRING_BOOT_TIMEOUT_MS = 35_000\nconst DEFAULT_BT_CLASSIC_TIMEOUT_MS = 1_000\nconst DEFAULT_PAIRING_ROUTE = \"/pairing/loading\"\nconst LOG_TAG = \"PairingTimeoutReport\"\n\nfunction projectReadiness() {\n const s = useGlassesStore.getState()\n return {\n state: s.connection.state,\n connected: s.connection.state === \"connected\",\n fullyBooted: isGlassesReady(s.connection),\n bluetoothClassicConnected: s.bluetoothClassicConnected,\n nativeLinkBusy: isGlassesLinkLayerBusy(s.connection),\n }\n}\n\nfunction projectTargetReady(options: Pick<PairingReadyWaitOptions, \"deviceModel\" | \"deviceName\">): boolean {\n const {deviceModel, deviceName} = options\n const glasses = useGlassesStore.getState()\n\n // A controller target is ready once some driver of that model delivers input;\n // the scan's device name is the R1's ring id or the band's Bluetooth name.\n if (isControllerModel(deviceModel)) {\n return Object.values(glasses.controllers ?? {}).some(\n (status) =>\n status.model === deviceModel &&\n isControllerReady(status) &&\n (!deviceName || status.name === deviceName || status.id === deviceName),\n )\n }\n\n if (!isGlassesReady(glasses.connection)) return false\n const identity = projectPairingIdentity()\n if (!deviceModel && !deviceName) return true\n return (\n identity.kind === \"paired\" &&\n (!deviceModel || identity.model === deviceModel) &&\n (!deviceName || identity.name === deviceName)\n )\n}\n\nfunction subscribeTargetReady(\n options: Pick<PairingReadyWaitOptions, \"deviceModel\" | \"deviceName\">,\n cb: (ready: boolean) => void,\n): () => void {\n let last = projectTargetReady(options)\n const notify = () => {\n const ready = projectTargetReady(options)\n if (ready === last) return\n last = ready\n cb(ready)\n }\n const unsubscribeGlasses = useGlassesStore.subscribe(notify)\n const unsubscribeSettings = useSettingsStore.subscribe(notify)\n return () => {\n unsubscribeGlasses()\n unsubscribeSettings()\n }\n}\n\nasync function waitForTargetReady(options: PairingReadyWaitOptions, timeoutMs: number): Promise<boolean> {\n return new Promise((resolve) => {\n if (options.signal?.aborted) {\n resolve(false)\n return\n }\n if (projectTargetReady(options)) {\n resolve(true)\n return\n }\n\n let settled = false\n let timeout: number | null = null\n let unsubscribe: (() => void) | null = null\n let onAbort: (() => void) | null = null\n const finish = (ready: boolean) => {\n if (settled) return\n settled = true\n if (timeout) BgTimer.clearTimeout(timeout)\n if (unsubscribe) unsubscribe()\n if (onAbort && options.signal) options.signal.removeEventListener(\"abort\", onAbort)\n resolve(ready)\n }\n\n unsubscribe = subscribeTargetReady(options, (ready) => {\n if (ready) finish(true)\n })\n if (options.signal) {\n onAbort = () => finish(false)\n options.signal.addEventListener(\"abort\", onAbort)\n }\n timeout = BgTimer.setTimeout(() => finish(projectTargetReady(options)), timeoutMs)\n })\n}\n\nexport type PairingReadinessSnapshot = ReturnType<typeof projectReadiness>\n\nexport async function submitPairingBootTimeoutReport(params: {\n deviceModel?: string\n deviceName?: string\n showGlassesBooting: boolean\n elapsedMs: number\n route?: string\n}): Promise<AutomaticReportSubmissionStatus> {\n const {deviceModel, deviceName, showGlassesBooting, elapsedMs, route = DEFAULT_PAIRING_ROUTE} = params\n const result = await submitAutomaticReport({\n kind: \"automatic\",\n trigger: {\n type: \"automatic\",\n source: \"pairing_loading\",\n reason: \"glasses_connect_timeout\",\n },\n report: {\n expectedBehavior: `Glasses should connect successfully within ${Math.round(elapsedMs / 1000)} seconds.`,\n actualBehavior: JSON.stringify(\n {\n deviceModel,\n deviceName,\n showGlassesBooting,\n elapsedMs,\n route,\n },\n null,\n 2,\n ),\n systemPriority: \"medium\",\n },\n throttleKey: `pairing_timeout|${deviceModel || \"unknown\"}|${deviceName || \"unknown\"}`,\n })\n\n const status = toAutomaticReportSubmissionStatus(result)\n logAutomaticReportSubmissionStatus(LOG_TAG, status, deviceModel, deviceName)\n return status\n}\n\nasync function waitForReadyDuringPairing(options: PairingReadyWaitOptions = {}): Promise<boolean> {\n const timeoutMs = options.timeoutMs ?? DEFAULT_PAIRING_BOOT_TIMEOUT_MS\n let showGlassesBooting = false\n const notReadySub = BluetoothSdk.addListener(\"glasses_not_ready\", () => {\n showGlassesBooting = true\n })\n\n try {\n const ready = await waitForTargetReady(options, timeoutMs)\n\n if (!ready && !options.signal?.aborted) {\n void submitPairingBootTimeoutReport({\n deviceModel: options.deviceModel,\n deviceName: options.deviceName,\n showGlassesBooting,\n elapsedMs: timeoutMs,\n route: options.route,\n }).catch((error) => {\n console.error(`[${LOG_TAG}] Unexpected error:`, error)\n })\n }\n\n return ready\n } finally {\n notReadySub.remove()\n }\n}\n\nasync function waitForBluetoothClassic(\n options: Pick<PairingReadyWaitOptions, \"timeoutMs\" | \"signal\"> = {},\n): Promise<boolean> {\n const timeoutMs = options.timeoutMs ?? DEFAULT_BT_CLASSIC_TIMEOUT_MS\n return new Promise((resolve) => {\n if (options.signal?.aborted) {\n resolve(false)\n return\n }\n\n const initial = useGlassesStore.getState().bluetoothClassicConnected\n if (initial) {\n resolve(true)\n return\n }\n\n let settled = false\n let timeout: number | null = null\n let unsubscribe: (() => void) | null = null\n let onAbort: (() => void) | null = null\n\n const finish = (value: boolean) => {\n if (settled) return\n settled = true\n if (timeout) BgTimer.clearTimeout(timeout)\n if (unsubscribe) unsubscribe()\n if (onAbort && options.signal) options.signal.removeEventListener(\"abort\", onAbort)\n resolve(value)\n }\n\n if (options.signal) {\n onAbort = () => finish(false)\n options.signal.addEventListener(\"abort\", onAbort)\n }\n\n unsubscribe = useGlassesStore.subscribe(\n (s) => s.bluetoothClassicConnected,\n (connected) => {\n if (connected) finish(true)\n },\n )\n\n timeout = BgTimer.setTimeout(() => {\n finish(useGlassesStore.getState().bluetoothClassicConnected)\n }, timeoutMs)\n })\n}\n\nexport const pairing = {\n readiness: (): PairingReadinessSnapshot => projectReadiness(),\n onReadiness: (cb: (readiness: PairingReadinessSnapshot) => void): (() => void) => {\n let last = JSON.stringify(projectReadiness())\n return useGlassesStore.subscribe(() => {\n const snap = projectReadiness()\n const key = JSON.stringify(snap)\n if (key === last) return\n last = key\n cb(snap)\n })\n },\n /** Whether the exact wearable or controller selected on the scan screen is ready. */\n targetReady: (options: Pick<PairingReadyWaitOptions, \"deviceModel\" | \"deviceName\">): boolean =>\n projectTargetReady(options),\n /** Subscribe to readiness for the exact selected target, excluding stale devices. */\n onTargetReady: (\n options: Pick<PairingReadyWaitOptions, \"deviceModel\" | \"deviceName\">,\n cb: (ready: boolean) => void,\n ): (() => void) => subscribeTargetReady(options, cb),\n\n // --- pairing-identity lifecycle (the PairingIdentity read-model + the JS-owned\n // identity writes; promotion to `paired` only ever happens natively) ---\n /** The identity lifecycle snapshot: none | pending (chosen, never paired) | paired. */\n identity: (): IdentitySnapshot => fixtureIdentity(projectPairingIdentity()),\n /** Subscribe to identity changes; fires only when the projected snapshot changes.\n * Returns an unsubscribe. */\n onIdentity: (cb: (identity: IdentitySnapshot) => void): (() => void) =>\n subscribePairingIdentity((identity) => cb(fixtureIdentity(identity))),\n /** Mark the chosen model as the pending selection (the scan-entry write); the\n * host renders it as a finish-pairing affordance until pairing succeeds. */\n markPendingSelection: (model: string) => markPendingSelection(model),\n\n /** Start scanning for nearby glasses or controllers of `model`. Results land on `searchResults()`/`onFound()`. */\n scan: (model: DeviceModel): Promise<void> => BluetoothSdk.startScan(model),\n /** Whether a scan is currently in progress. */\n scanning: (): boolean => useCoreStore.getState().searching,\n /** Subscribe to scan-in-progress changes; fires only when it changes. Returns an unsubscribe. */\n onScanning: (cb: (scanning: boolean) => void): (() => void) => useCoreStore.subscribe((s) => s.searching, cb),\n /** Whether the phone has another Bluetooth (audio) device connected — the BT Classic pairing hint. */\n otherBtConnected: (): boolean => useCoreStore.getState().otherBtConnected,\n /** Subscribe to other-Bluetooth-device-connected changes; fires only when it changes. Returns an unsubscribe. */\n onOtherBtConnected: (cb: (connected: boolean) => void): (() => void) =>\n useCoreStore.subscribe((s) => s.otherBtConnected, cb),\n /** The current scan results (snapshot). */\n // Copy the array AND each entry: neither the list nor the Device objects may\n // leak as mutable references into the store.\n searchResults: () => useCoreStore.getState().searchResults.map((result) => ({...result})),\n /** Subscribe to scan-result changes; fires only when they change. Returns an unsubscribe. */\n onFound: (cb: (results: Device[]) => void): (() => void) => {\n let last = JSON.stringify(useCoreStore.getState().searchResults)\n return useCoreStore.subscribe(() => {\n const results = useCoreStore.getState().searchResults\n const key = JSON.stringify(results)\n if (key === last) return\n last = key\n // Copy like searchResults(): listeners must not mutate shared scan state.\n cb(results.map((result) => ({...result})))\n })\n },\n\n /**\n * Pair with (connect to) a discovered device. Two-phase identity: the connect\n * attempt only marks the device as pending (`saveAsDefault: false` — no eager\n * default-device write); the native layer promotes it to the default wearable\n * when pairing actually succeeds (handleDeviceReady), so an abandoned or\n * failed attempt can't leave a default identity with no paired device behind.\n */\n pair: async (device: Device, options?: ConnectOptions): Promise<void> => {\n await pushAllBluetoothSettings()\n return BluetoothSdk.connect(device, {...options, saveAsDefault: false})\n },\n /** Set a device as the default for subsequent `glasses.connectDefault()`. */\n setDefault: (device: Device | null): Promise<void> => BluetoothSdk.setDefaultDevice(device),\n /**\n * Prime the native Bluetooth Classic audio watcher with the picked device.\n * The iOS Mentra Live flow pairs Classic audio BEFORE any BLE connect\n * exists, and native detects the pairing by matching the connected audio\n * route against its device_name — which two-phase identity no longer sets\n * at selection time. This is native-only routing state (device_name has no\n * native→JS echo): the phone's persisted identity is untouched, and\n * promotion still happens only at pairing success.\n */\n setBluetoothClassicTarget: (device: Device): Promise<void> =>\n BluetoothSdk.updateBluetoothSettings({device_name: device.name}),\n /**\n * Abandon an in-flight pairing attempt (back-out, failure retry, conflict\n * retry) without destroying an existing pairing. The decision comes from the\n * LIVE hydrated default-device read — never from flow-entry state, because a\n * pairing can PROMOTE while the flow is open (the glasses finish pairing\n * even as the user backs out of the UI), and an entry snapshot would forget\n * that brand-new pairing:\n * - Default device exists and glasses are connected (nothing in flight — an\n * attempt drops the link first): stop the scan, touch nothing else.\n * - Default device exists with an attempt in flight: cancel it, then re-seed\n * the native identity from the phone's persisted settings — the attempt's\n * connect-by-name overwrote the native device_name, so a later\n * connectDefault() would otherwise target the abandoned device.\n * - No default device (genuinely unpaired attempt): also forget, clearing\n * the partial native pairing state.\n * The read fails OPEN to \"preserve\" — a transient failure must never wipe a\n * real pairing. The `pending_wearable` marker is deliberately left alone —\n * the host renders it as a finish-pairing affordance.\n */\n abandonAttempt: async (): Promise<void> => {\n const nativeHasDefault = await hasDefaultDevice().catch(() => true)\n if (nativeHasDefault && isGlassesConnected(useGlassesStore.getState().connection)) {\n // Still connected means no connect attempt is in flight (an attempt drops\n // the existing link first): the user browsed the scan and backed out.\n // Stop the scan and leave the live pairing untouched.\n console.log(\"PairingIdentity: abandonAttempt — pairing intact and connected; stopping scan only\")\n await BluetoothSdk.stopScan()\n return\n }\n if (projectPairingIdentity().kind === \"paired\") {\n // The persisted settings describe a COMPLETE pairing: restore it to\n // native (the attempt's connect-by-name overwrote the native\n // device_name; and if native somehow lost its default entirely, this\n // repairs the divergence instead of forgetting a real pairing).\n console.log(\"PairingIdentity: abandonAttempt — preserving pairing; attempt cancelled, native identity re-seeded\")\n await BluetoothSdk.disconnect()\n await pushAllBluetoothSettings()\n return\n }\n if (nativeHasDefault) {\n // Mid-relay: native promoted and its echoes are still landing — the\n // incomplete JS snapshot must not be pushed over the fresher native\n // identity (the on-connect replay's race). Native holds the truth.\n console.log(\"PairingIdentity: abandonAttempt — preserving pairing; JS identity mid-relay, native kept as-is\")\n await BluetoothSdk.disconnect()\n return\n }\n // Partial attempt: forget owns teardown. Do NOT disconnect() first — that\n // nulls the MentraLive SGC and used to skip Classic removeBond, leaving\n // IBRT ACL up so glasses never re-advertise for the next scan.\n console.log(\"PairingIdentity: abandonAttempt — no pairing on either layer; forgetting the partial attempt\")\n await BluetoothSdk.forget()\n },\n\n /**\n * Abandon an in-flight controller pairing (back-out, failure retry). Only the\n * attempt's driver is dropped; paired controllers and the glasses are untouched.\n */\n abandonControllerAttempt: (): Promise<void> => BluetoothSdk.cancelControllerAttempt(),\n\n /** Subscribe to pairing failures; returns an unsubscribe. */\n onPairFailure: (cb: (event: PairFailureEvent) => void): (() => void) => {\n const sub = BluetoothSdk.addListener(\"pair_failure\", cb)\n return () => sub.remove()\n },\n /** Subscribe to glasses-not-ready events during pairing; returns an unsubscribe. */\n onGlassesNotReady: (cb: (event: GlassesNotReadyEvent) => void): (() => void) => {\n const sub = BluetoothSdk.addListener(\"glasses_not_ready\", cb)\n return () => sub.remove()\n },\n /** Wait for paired glasses to finish booting; engine files the timeout diagnostic. */\n waitForReady: waitForReadyDuringPairing,\n /** Wait briefly for Bluetooth Classic to come up after BLE pairing. */\n waitForBluetoothClassic,\n}\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* providerKeys facade — `engine.providerKeys.{anthropic,gemini,elevenlabs}`:
|
|
2
|
+
* providerKeys facade — `engine.providerKeys.{anthropic,gemini,openai,deepseek,elevenlabs}`:
|
|
3
3
|
* validate-before-save probes for the user-supplied AI/voice provider keys
|
|
4
4
|
* (Settings > API Keys). Same per-provider shape as `engine.maps.mapbox` /
|
|
5
5
|
* `engine.speech.sonioxDirect` so the Keys screen treats providers uniformly.
|
|
6
6
|
*/
|
|
7
|
-
import { validateAnthropicApiKey, validateElevenLabsApiKey, validateGeminiApiKey, validateOpenAiApiKey } from "../services/ProviderKeyValidation";
|
|
7
|
+
import { validateAnthropicApiKey, validateDeepSeekApiKey, validateElevenLabsApiKey, validateGeminiApiKey, validateOpenAiApiKey } from "../services/ProviderKeyValidation";
|
|
8
8
|
export declare const providerKeys: {
|
|
9
9
|
anthropic: {
|
|
10
10
|
/** Probe a key against the Anthropic API without saving it. */
|
|
@@ -18,6 +18,10 @@ export declare const providerKeys: {
|
|
|
18
18
|
/** Probe a key against the OpenAI API without saving it. */
|
|
19
19
|
validateKey: (apiKey: string) => Promise<import("../services/ProviderKeyValidation").KeyValidationResult>;
|
|
20
20
|
};
|
|
21
|
+
deepseek: {
|
|
22
|
+
/** Probe a key against the DeepSeek API without saving it. */
|
|
23
|
+
validateKey: (apiKey: string) => Promise<import("../services/ProviderKeyValidation").KeyValidationResult>;
|
|
24
|
+
};
|
|
21
25
|
elevenlabs: {
|
|
22
26
|
/** Probe a key against the ElevenLabs API without saving it. */
|
|
23
27
|
validateKey: (apiKey: string) => Promise<import("../services/ProviderKeyValidation").KeyValidationResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providerKeys.d.ts","sourceRoot":"","sources":["../../src/facades/providerKeys.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,mCAAmC,CAAA;AAE1C,eAAO,MAAM,YAAY;;QAErB,+DAA+D;;;;QAI/D,4DAA4D;;;;QAI5D,4DAA4D;;;;QAI5D,gEAAgE;;;CAGnE,CAAA"}
|
|
1
|
+
{"version":3,"file":"providerKeys.d.ts","sourceRoot":"","sources":["../../src/facades/providerKeys.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,mCAAmC,CAAA;AAE1C,eAAO,MAAM,YAAY;;QAErB,+DAA+D;;;;QAI/D,4DAA4D;;;;QAI5D,4DAA4D;;;;QAI5D,8DAA8D;;;;QAI9D,gEAAgE;;;CAGnE,CAAA"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* providerKeys facade — `engine.providerKeys.{anthropic,gemini,elevenlabs}`:
|
|
2
|
+
* providerKeys facade — `engine.providerKeys.{anthropic,gemini,openai,deepseek,elevenlabs}`:
|
|
3
3
|
* validate-before-save probes for the user-supplied AI/voice provider keys
|
|
4
4
|
* (Settings > API Keys). Same per-provider shape as `engine.maps.mapbox` /
|
|
5
5
|
* `engine.speech.sonioxDirect` so the Keys screen treats providers uniformly.
|
|
6
6
|
*/
|
|
7
|
-
import { validateAnthropicApiKey, validateElevenLabsApiKey, validateGeminiApiKey, validateOpenAiApiKey, } from "../services/ProviderKeyValidation";
|
|
7
|
+
import { validateAnthropicApiKey, validateDeepSeekApiKey, validateElevenLabsApiKey, validateGeminiApiKey, validateOpenAiApiKey, } from "../services/ProviderKeyValidation";
|
|
8
8
|
export const providerKeys = {
|
|
9
9
|
anthropic: {
|
|
10
10
|
/** Probe a key against the Anthropic API without saving it. */
|
|
@@ -18,6 +18,10 @@ export const providerKeys = {
|
|
|
18
18
|
/** Probe a key against the OpenAI API without saving it. */
|
|
19
19
|
validateKey: (...args) => validateOpenAiApiKey(...args),
|
|
20
20
|
},
|
|
21
|
+
deepseek: {
|
|
22
|
+
/** Probe a key against the DeepSeek API without saving it. */
|
|
23
|
+
validateKey: (...args) => validateDeepSeekApiKey(...args),
|
|
24
|
+
},
|
|
21
25
|
elevenlabs: {
|
|
22
26
|
/** Probe a key against the ElevenLabs API without saving it. */
|
|
23
27
|
validateKey: (...args) => validateElevenLabsApiKey(...args),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providerKeys.js","sourceRoot":"","sources":["../../src/facades/providerKeys.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,mCAAmC,CAAA;AAE1C,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,SAAS,EAAE;QACT,+DAA+D;QAC/D,WAAW,EAAE,CAAC,GAAG,IAAgD,EAAE,EAAE,CAAC,uBAAuB,CAAC,GAAG,IAAI,CAAC;KACvG;IACD,MAAM,EAAE;QACN,4DAA4D;QAC5D,WAAW,EAAE,CAAC,GAAG,IAA6C,EAAE,EAAE,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC;KACjG;IACD,MAAM,EAAE;QACN,4DAA4D;QAC5D,WAAW,EAAE,CAAC,GAAG,IAA6C,EAAE,EAAE,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC;KACjG;IACD,UAAU,EAAE;QACV,gEAAgE;QAChE,WAAW,EAAE,CAAC,GAAG,IAAiD,EAAE,EAAE,CAAC,wBAAwB,CAAC,GAAG,IAAI,CAAC;KACzG;CACF,CAAA","sourcesContent":["/**\n * providerKeys facade — `engine.providerKeys.{anthropic,gemini,elevenlabs}`:\n * validate-before-save probes for the user-supplied AI/voice provider keys\n * (Settings > API Keys). Same per-provider shape as `engine.maps.mapbox` /\n * `engine.speech.sonioxDirect` so the Keys screen treats providers uniformly.\n */\nimport {\n validateAnthropicApiKey,\n validateElevenLabsApiKey,\n validateGeminiApiKey,\n validateOpenAiApiKey,\n} from \"../services/ProviderKeyValidation\"\n\nexport const providerKeys = {\n anthropic: {\n /** Probe a key against the Anthropic API without saving it. */\n validateKey: (...args: Parameters<typeof validateAnthropicApiKey>) => validateAnthropicApiKey(...args),\n },\n gemini: {\n /** Probe a key against the Gemini API without saving it. */\n validateKey: (...args: Parameters<typeof validateGeminiApiKey>) => validateGeminiApiKey(...args),\n },\n openai: {\n /** Probe a key against the OpenAI API without saving it. */\n validateKey: (...args: Parameters<typeof validateOpenAiApiKey>) => validateOpenAiApiKey(...args),\n },\n elevenlabs: {\n /** Probe a key against the ElevenLabs API without saving it. */\n validateKey: (...args: Parameters<typeof validateElevenLabsApiKey>) => validateElevenLabsApiKey(...args),\n },\n}\n"]}
|
|
1
|
+
{"version":3,"file":"providerKeys.js","sourceRoot":"","sources":["../../src/facades/providerKeys.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,mCAAmC,CAAA;AAE1C,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,SAAS,EAAE;QACT,+DAA+D;QAC/D,WAAW,EAAE,CAAC,GAAG,IAAgD,EAAE,EAAE,CAAC,uBAAuB,CAAC,GAAG,IAAI,CAAC;KACvG;IACD,MAAM,EAAE;QACN,4DAA4D;QAC5D,WAAW,EAAE,CAAC,GAAG,IAA6C,EAAE,EAAE,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC;KACjG;IACD,MAAM,EAAE;QACN,4DAA4D;QAC5D,WAAW,EAAE,CAAC,GAAG,IAA6C,EAAE,EAAE,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC;KACjG;IACD,QAAQ,EAAE;QACR,8DAA8D;QAC9D,WAAW,EAAE,CAAC,GAAG,IAA+C,EAAE,EAAE,CAAC,sBAAsB,CAAC,GAAG,IAAI,CAAC;KACrG;IACD,UAAU,EAAE;QACV,gEAAgE;QAChE,WAAW,EAAE,CAAC,GAAG,IAAiD,EAAE,EAAE,CAAC,wBAAwB,CAAC,GAAG,IAAI,CAAC;KACzG;CACF,CAAA","sourcesContent":["/**\n * providerKeys facade — `engine.providerKeys.{anthropic,gemini,openai,deepseek,elevenlabs}`:\n * validate-before-save probes for the user-supplied AI/voice provider keys\n * (Settings > API Keys). Same per-provider shape as `engine.maps.mapbox` /\n * `engine.speech.sonioxDirect` so the Keys screen treats providers uniformly.\n */\nimport {\n validateAnthropicApiKey,\n validateDeepSeekApiKey,\n validateElevenLabsApiKey,\n validateGeminiApiKey,\n validateOpenAiApiKey,\n} from \"../services/ProviderKeyValidation\"\n\nexport const providerKeys = {\n anthropic: {\n /** Probe a key against the Anthropic API without saving it. */\n validateKey: (...args: Parameters<typeof validateAnthropicApiKey>) => validateAnthropicApiKey(...args),\n },\n gemini: {\n /** Probe a key against the Gemini API without saving it. */\n validateKey: (...args: Parameters<typeof validateGeminiApiKey>) => validateGeminiApiKey(...args),\n },\n openai: {\n /** Probe a key against the OpenAI API without saving it. */\n validateKey: (...args: Parameters<typeof validateOpenAiApiKey>) => validateOpenAiApiKey(...args),\n },\n deepseek: {\n /** Probe a key against the DeepSeek API without saving it. */\n validateKey: (...args: Parameters<typeof validateDeepSeekApiKey>) => validateDeepSeekApiKey(...args),\n },\n elevenlabs: {\n /** Probe a key against the ElevenLabs API without saving it. */\n validateKey: (...args: Parameters<typeof validateElevenLabsApiKey>) => validateElevenLabsApiKey(...args),\n },\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.6",
|
|
4
|
+
"releaseIdentity": "0.3.6-dev.848",
|
|
5
|
+
"releaseSetId": "glassly-0.3.6-dev.848",
|
|
6
|
+
"sourceCommit": "71bd7fcd21b9a022ddcde5d9a3596379ad42b071",
|
|
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,eAAe;IAClC,cAAc,EAAE,uBAAuB;IACvC,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.6\",\n \"releaseIdentity\": \"0.3.6-dev.848\",\n \"releaseSetId\": \"glassly-0.3.6-dev.848\",\n \"sourceCommit\": \"71bd7fcd21b9a022ddcde5d9a3596379ad42b071\",\n \"otaManifestUrl\": null,\n \"otaManifestSha256\": null\n})\n"]}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* supplies settings/keys and does the side effects.
|
|
11
11
|
*/
|
|
12
12
|
export type AiTier = "quick" | "balanced" | "frontier";
|
|
13
|
-
export type AiTierProvider = "anthropic" | "gemini" | "openai";
|
|
13
|
+
export type AiTierProvider = "anthropic" | "gemini" | "openai" | "deepseek";
|
|
14
14
|
export declare const AI_TIERS: readonly AiTier[];
|
|
15
15
|
/** One curated dropdown entry for a tier. */
|
|
16
16
|
export interface TierModelOption {
|
|
@@ -23,7 +23,8 @@ export interface TierModelOption {
|
|
|
23
23
|
* Curated per-tier model registry — the only place model ids live on the
|
|
24
24
|
* phone. Order within a tier is the "auto" preference order: first entry
|
|
25
25
|
* whose provider has a saved key wins. Anthropic leads (matching the cloud's
|
|
26
|
-
* default provider), then Gemini (the pre-tier quick default), then OpenAI
|
|
26
|
+
* default provider), then Gemini (the pre-tier quick default), then OpenAI,
|
|
27
|
+
* then DeepSeek.
|
|
27
28
|
*/
|
|
28
29
|
export declare const TIER_MODEL_OPTIONS: Record<AiTier, TierModelOption[]>;
|
|
29
30
|
/** Which providers currently have a user key saved (Settings > API Keys). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AiTierResolution.d.ts","sourceRoot":"","sources":["../../src/services/AiTierResolution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,CAAA;AACtD,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"AiTierResolution.d.ts","sourceRoot":"","sources":["../../src/services/AiTierResolution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,CAAA;AACtD,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAA;AAE3E,eAAO,MAAM,QAAQ,EAAE,SAAS,MAAM,EAAsC,CAAA;AAE5E,6CAA6C;AAC7C,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,cAAc,CAAA;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,CAmBhE,CAAA;AAED,6EAA6E;AAC7E,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC,CAAA;AAE1D;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,cAAc,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAUD,+EAA+E;AAC/E,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEtD;AAED,mFAAmF;AACnF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG;IAAC,QAAQ,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,GAAG,IAAI,CAYjG;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,GAAG,iBAAiB,CAaxG"}
|
|
@@ -14,23 +14,27 @@ export const AI_TIERS = ["quick", "balanced", "frontier"];
|
|
|
14
14
|
* Curated per-tier model registry — the only place model ids live on the
|
|
15
15
|
* phone. Order within a tier is the "auto" preference order: first entry
|
|
16
16
|
* whose provider has a saved key wins. Anthropic leads (matching the cloud's
|
|
17
|
-
* default provider), then Gemini (the pre-tier quick default), then OpenAI
|
|
17
|
+
* default provider), then Gemini (the pre-tier quick default), then OpenAI,
|
|
18
|
+
* then DeepSeek.
|
|
18
19
|
*/
|
|
19
20
|
export const TIER_MODEL_OPTIONS = {
|
|
20
21
|
quick: [
|
|
21
22
|
{ provider: "anthropic", model: "claude-haiku-4-5", label: "Claude Haiku 4.5" },
|
|
22
23
|
{ provider: "gemini", model: "gemini-3.5-flash-lite", label: "Gemini 3.5 Flash Lite" },
|
|
23
24
|
{ provider: "openai", model: "gpt-5-mini", label: "GPT-5 mini" },
|
|
25
|
+
{ provider: "deepseek", model: "deepseek-chat", label: "DeepSeek Chat" },
|
|
24
26
|
],
|
|
25
27
|
balanced: [
|
|
26
28
|
{ provider: "anthropic", model: "claude-haiku-4-5", label: "Claude Haiku 4.5" },
|
|
27
29
|
{ provider: "gemini", model: "gemini-3.5-flash", label: "Gemini 3.5 Flash" },
|
|
28
30
|
{ provider: "openai", model: "gpt-5.1", label: "GPT-5.1" },
|
|
31
|
+
{ provider: "deepseek", model: "deepseek-chat", label: "DeepSeek Chat" },
|
|
29
32
|
],
|
|
30
33
|
frontier: [
|
|
31
34
|
{ provider: "anthropic", model: "claude-sonnet-5", label: "Claude Sonnet 5" },
|
|
32
35
|
{ provider: "gemini", model: "gemini-3.1-pro-preview", label: "Gemini 3.1 Pro" },
|
|
33
36
|
{ provider: "openai", model: "gpt-5.1", label: "GPT-5.1" },
|
|
37
|
+
{ provider: "deepseek", model: "deepseek-reasoner", label: "DeepSeek Reasoner" },
|
|
34
38
|
],
|
|
35
39
|
};
|
|
36
40
|
/**
|
|
@@ -56,8 +60,9 @@ export function parseTierSetting(value) {
|
|
|
56
60
|
if (!stored)
|
|
57
61
|
return null;
|
|
58
62
|
const model = RETIRED_MODELS[stored] ?? stored;
|
|
59
|
-
if (provider !== "anthropic" && provider !== "gemini" && provider !== "openai")
|
|
63
|
+
if (provider !== "anthropic" && provider !== "gemini" && provider !== "openai" && provider !== "deepseek") {
|
|
60
64
|
return null;
|
|
65
|
+
}
|
|
61
66
|
return { provider, model };
|
|
62
67
|
}
|
|
63
68
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AiTierResolution.js","sourceRoot":"","sources":["../../src/services/AiTierResolution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,MAAM,CAAC,MAAM,QAAQ,GAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC,CAAA;AAU5E
|
|
1
|
+
{"version":3,"file":"AiTierResolution.js","sourceRoot":"","sources":["../../src/services/AiTierResolution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,MAAM,CAAC,MAAM,QAAQ,GAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC,CAAA;AAU5E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAsC;IACnE,KAAK,EAAE;QACL,EAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,kBAAkB,EAAC;QAC7E,EAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,uBAAuB,EAAE,KAAK,EAAE,uBAAuB,EAAC;QACpF,EAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE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Q,KAAK,QAAQ,CAAC,CAAA;QAC5E,IAAI,MAAM;YAAE,OAAO,EAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAC,CAAA;IACrE,CAAC;IACD,OAAO,EAAE,CAAA;AACX,CAAC","sourcesContent":["/**\n * AiTierResolution — pure decision logic for mapping a miniapp's requested AI\n * tier (\"quick\" / \"balanced\" / \"frontier\") to a concrete provider+model.\n *\n * Miniapps never name a provider or model (the session.ai contract is\n * tier-only); the user picks per-tier models in Settings > AI Models, or\n * leaves \"auto\" and the pick follows from whichever provider keys they saved.\n * Extracted from LocalMiniappRuntime as pure functions so the routing rules\n * are unit-testable (the TranscriptionRouting.ts pattern) — the singleton\n * supplies settings/keys and does the side effects.\n */\n\nexport type AiTier = \"quick\" | \"balanced\" | \"frontier\"\nexport type AiTierProvider = \"anthropic\" | \"gemini\" | \"openai\" | \"deepseek\"\n\nexport const AI_TIERS: readonly AiTier[] = [\"quick\", \"balanced\", \"frontier\"]\n\n/** One curated dropdown entry for a tier. */\nexport interface TierModelOption {\n provider: AiTierProvider\n model: string\n /** Human label for the Settings dropdown. */\n label: string\n}\n\n/**\n * Curated per-tier model registry — the only place model ids live on the\n * phone. Order within a tier is the \"auto\" preference order: first entry\n * whose provider has a saved key wins. Anthropic leads (matching the cloud's\n * default provider), then Gemini (the pre-tier quick default), then OpenAI,\n * then DeepSeek.\n */\nexport const TIER_MODEL_OPTIONS: Record<AiTier, TierModelOption[]> = {\n quick: [\n {provider: \"anthropic\", model: \"claude-haiku-4-5\", label: \"Claude Haiku 4.5\"},\n {provider: \"gemini\", model: \"gemini-3.5-flash-lite\", label: \"Gemini 3.5 Flash Lite\"},\n {provider: \"openai\", model: \"gpt-5-mini\", label: \"GPT-5 mini\"},\n {provider: \"deepseek\", model: \"deepseek-chat\", label: \"DeepSeek Chat\"},\n ],\n balanced: [\n {provider: \"anthropic\", model: \"claude-haiku-4-5\", label: \"Claude Haiku 4.5\"},\n {provider: \"gemini\", model: \"gemini-3.5-flash\", label: \"Gemini 3.5 Flash\"},\n {provider: \"openai\", model: \"gpt-5.1\", label: \"GPT-5.1\"},\n {provider: \"deepseek\", model: \"deepseek-chat\", label: \"DeepSeek Chat\"},\n ],\n frontier: [\n {provider: \"anthropic\", model: \"claude-sonnet-5\", label: \"Claude Sonnet 5\"},\n {provider: \"gemini\", model: \"gemini-3.1-pro-preview\", label: \"Gemini 3.1 Pro\"},\n {provider: \"openai\", model: \"gpt-5.1\", label: \"GPT-5.1\"},\n {provider: \"deepseek\", model: \"deepseek-reasoner\", label: \"DeepSeek Reasoner\"},\n ],\n}\n\n/** Which providers currently have a user key saved (Settings > API Keys). */\nexport type SavedLlmKeys = Record<AiTierProvider, boolean>\n\n/**\n * A resolved pick. `provider`/`model` may both be absent: that means \"no\n * opinion — let the cloud's default provider serve it\", which is the right\n * answer for platform-funded balanced/frontier calls with no keys saved.\n */\nexport interface ResolvedTierModel {\n provider?: AiTierProvider\n model?: string\n}\n\n/**\n * Stored dropdown picks for model ids the provider never served, mapped to the\n * curated replacement. gemini-3.5-pro 404s on generateContent.\n */\nconst RETIRED_MODELS: Record<string, string> = {\n \"gemini-3.5-pro\": \"gemini-3.1-pro-preview\",\n}\n\n/** Coerce an untrusted wire value into a tier; anything else is \"balanced\". */\nexport function normalizeAiTier(value: unknown): AiTier {\n return value === \"quick\" || value === \"frontier\" ? value : \"balanced\"\n}\n\n/** Parse a stored \"<provider>:<model>\" dropdown value; null for \"auto\"/garbage. */\nexport function parseTierSetting(value: unknown): {provider: AiTierProvider; model: string} | null {\n if (typeof value !== \"string\") return null\n const sep = value.indexOf(\":\")\n if (sep <= 0) return null\n const provider = value.slice(0, sep)\n const stored = value.slice(sep + 1).trim()\n if (!stored) return null\n const model = RETIRED_MODELS[stored] ?? stored\n if (provider !== \"anthropic\" && provider !== \"gemini\" && provider !== \"openai\" && provider !== \"deepseek\") {\n return null\n }\n return {provider, model}\n}\n\n/**\n * Resolve one tier to a provider+model.\n *\n * Explicit dropdown pick wins verbatim — even if that provider's key was\n * since removed (the call falls through to the cloud path, which may serve it\n * on the platform key or fail loudly; silently substituting a different model\n * the user didn't pick would be worse).\n *\n * \"auto\": first curated entry whose provider has a saved key. With no keys at\n * all, quick still pins its cheapest curated model on the cloud's Gemini key\n * (high-volume triage on the default Sonnet would burn platform credit ~30x\n * faster), while balanced/frontier stay unpinned and take the cloud default.\n */\nexport function resolveAiTier(tier: AiTier, settingValue: unknown, keys: SavedLlmKeys): ResolvedTierModel {\n const explicit = parseTierSetting(settingValue)\n if (explicit) return explicit\n\n for (const option of TIER_MODEL_OPTIONS[tier]) {\n if (keys[option.provider]) return {provider: option.provider, model: option.model}\n }\n\n if (tier === \"quick\") {\n const gemini = TIER_MODEL_OPTIONS.quick.find((o) => o.provider === \"gemini\")\n if (gemini) return {provider: gemini.provider, model: gemini.model}\n }\n return {}\n}\n"]}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* - subscribe(fn) register a refresh listener
|
|
18
18
|
*/
|
|
19
19
|
import { AsyncResult, Result } from "typesafe-ts";
|
|
20
|
-
import type { AppletPermission, AppletType, ClientApp } from "../types/applet";
|
|
20
|
+
import type { AppletPermission, AppletType, ClientApp, DeclaredWidget } from "../types/applet";
|
|
21
21
|
import { HardwareRequirement } from "../types";
|
|
22
22
|
export { normalizeManifestActions, normalizeManifestWidgets } from "./manifestActions";
|
|
23
23
|
/**
|
|
@@ -222,6 +222,9 @@ declare class AppRegistry {
|
|
|
222
222
|
/** The wearer's Always On choice for a miniapp, beside the `_hidden` flag; null when they never chose. */
|
|
223
223
|
export declare function getAlwaysOnOverride(packageName: string): boolean | null;
|
|
224
224
|
export declare function saveAlwaysOnOverride(packageName: string, status: boolean): void;
|
|
225
|
+
/** Applies the wearer's tap-to-expand choice to each expandable widget; expansion is on until they turn it off. */
|
|
226
|
+
export declare function withWidgetExpandChoices(packageName: string, widgets: DeclaredWidget[]): DeclaredWidget[];
|
|
227
|
+
export declare function saveWidgetExpandChoice(packageName: string, widgetId: string, expandOnTap: boolean): void;
|
|
225
228
|
export declare function getLocalAppScreenshot(packageName: string): string | undefined;
|
|
226
229
|
/**
|
|
227
230
|
* Persisted metadata for a dev miniapp's home tile.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppRegistry.d.ts","sourceRoot":"","sources":["../../src/services/AppRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,OAAO,EAAC,WAAW,EAAE,MAAM,EAAgB,MAAM,aAAa,CAAA;AAE9D,OAAO,KAAK,EAAC,gBAAgB,EAAqB,UAAU,EAAE,SAAS,EAAC,MAAM,iBAAiB,CAAA;AAC/
|
|
1
|
+
{"version":3,"file":"AppRegistry.d.ts","sourceRoot":"","sources":["../../src/services/AppRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,OAAO,EAAC,WAAW,EAAE,MAAM,EAAgB,MAAM,aAAa,CAAA;AAE9D,OAAO,KAAK,EAAC,gBAAgB,EAAqB,UAAU,EAAE,SAAS,EAAE,cAAc,EAAC,MAAM,iBAAiB,CAAA;AAC/G,OAAO,EAAC,mBAAmB,EAAyC,MAAM,UAAU,CAAA;AASpF,OAAO,EAAC,wBAAwB,EAAE,wBAAwB,EAAC,MAAM,mBAAmB,CAAA;AAcpF;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,KAAK,CAAC,MAAM,GAAG;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,GAAG,SAAS,GACxF,gBAAgB,EAAE,CAmBpB;AAMD;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC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