@glassly/engine 0.4.0-beta.1079 → 0.4.0-beta.1091
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/facades/display.d.ts +1 -1
- package/build/facades/display.d.ts.map +1 -1
- package/build/facades/display.js +1 -1
- package/build/facades/display.js.map +1 -1
- package/build/facades/settings.js +1 -1
- package/build/facades/settings.js.map +1 -1
- package/build/generated/releaseMetadata.js +3 -3
- package/build/generated/releaseMetadata.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/services/LocalMiniappRuntime.d.ts +1 -1
- package/build/services/LocalMiniappRuntime.d.ts.map +1 -1
- package/build/services/LocalMiniappRuntime.js +15 -3
- package/build/services/LocalMiniappRuntime.js.map +1 -1
- package/build/services/neuralBand/MetaAuth.d.ts +1 -0
- package/build/services/neuralBand/MetaAuth.d.ts.map +1 -1
- package/build/services/neuralBand/MetaAuth.js +36 -8
- package/build/services/neuralBand/MetaAuth.js.map +1 -1
- package/build/services/settingsBridge.d.ts.map +1 -1
- package/build/services/settingsBridge.js +0 -2
- package/build/services/settingsBridge.js.map +1 -1
- package/build/stores/settings.d.ts.map +1 -1
- package/build/stores/settings.js +1 -18
- 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 +4 -0
- package/build/types/capabilities/even-realities-g1.js.map +1 -1
- package/package.json +7 -7
- package/src/facades/display.ts +1 -1
- package/src/facades/settings.ts +1 -1
- package/src/generated/releaseMetadata.ts +3 -3
- package/src/index.ts +1 -0
- package/src/services/LocalMiniappRuntime.ts +18 -12
- package/src/services/neuralBand/MetaAuth.ts +37 -8
- package/src/services/settingsBridge.ts +0 -2
- package/src/stores/settings.ts +1 -18
- package/src/types/capabilities/even-realities-g1.ts +5 -0
package/src/facades/display.ts
CHANGED
|
@@ -20,7 +20,7 @@ export const display = {
|
|
|
20
20
|
dashboard: {
|
|
21
21
|
/** An overlay app holds the slot. */
|
|
22
22
|
isOpen: (): boolean => useDisplayStore.getState().overlayOwner !== null,
|
|
23
|
-
/** As if the head was raised/lowered (the dashboard app
|
|
23
|
+
/** As if the head was raised/lowered (the dashboard app decides whether head-up opens it). */
|
|
24
24
|
setHeadUp: (up: boolean): void => sendGesture(up ? "head_up" : "head_down"),
|
|
25
25
|
/** A double tap on the empty screen: the dashboard app opens (simulator button). */
|
|
26
26
|
open: (): void => {
|
package/src/facades/settings.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* settings facade — `engine.settings`: the typed keyed user-settings surface over
|
|
3
3
|
* the engine-owned settings store. This is the OEM contract.
|
|
4
4
|
*
|
|
5
|
-
* Keys + their schema live in `SETTINGS` (theme, devMode,
|
|
5
|
+
* Keys + their schema live in `SETTINGS` (theme, devMode, metric_system,
|
|
6
6
|
* notifications, onboarding flags, …); `descriptor(key)`/`keys()` expose them.
|
|
7
7
|
*/
|
|
8
8
|
import {useSettingsStore, SETTINGS} from "../stores/settings"
|
|
@@ -12,9 +12,9 @@ export interface EngineReleaseMetadata {
|
|
|
12
12
|
export const ENGINE_RELEASE_METADATA: Readonly<EngineReleaseMetadata> = Object.freeze({
|
|
13
13
|
"schemaVersion": 1,
|
|
14
14
|
"familyBaseVersion": "0.4.0",
|
|
15
|
-
"releaseIdentity": "0.4.0-beta.
|
|
16
|
-
"releaseSetId": "glassly-0.4.0-beta.
|
|
17
|
-
"sourceCommit": "
|
|
15
|
+
"releaseIdentity": "0.4.0-beta.1091",
|
|
16
|
+
"releaseSetId": "glassly-0.4.0-beta.1091",
|
|
17
|
+
"sourceCommit": "7e4bf2595c212f7b7b33a09b3a88ff2592c45111",
|
|
18
18
|
"otaManifestUrl": null,
|
|
19
19
|
"otaManifestSha256": null
|
|
20
20
|
})
|
package/src/index.ts
CHANGED
|
@@ -14,6 +14,7 @@ import {AppState, Linking} from "react-native"
|
|
|
14
14
|
import {logBuffer} from "../utils/devLogging"
|
|
15
15
|
import {collectDisplayDiagnostics} from "./DisplayDiagnostics"
|
|
16
16
|
import Share from "react-native-share"
|
|
17
|
+
import {uses24HourClock} from "react-native-localize"
|
|
17
18
|
import * as Battery from "expo-battery"
|
|
18
19
|
import * as Clipboard from "expo-clipboard"
|
|
19
20
|
import {File, Paths} from "expo-file-system"
|
|
@@ -5813,28 +5814,33 @@ class LocalMiniappRuntime {
|
|
|
5813
5814
|
}
|
|
5814
5815
|
}
|
|
5815
5816
|
|
|
5816
|
-
/** Host user preferences miniapps follow by default
|
|
5817
|
+
/** Host user preferences miniapps follow by default: the metric toggle and the phone's own clock format. */
|
|
5817
5818
|
private currentPreferences(): MiniappPreferences {
|
|
5818
5819
|
const settings = useSettingsStore.getState()
|
|
5819
5820
|
return {
|
|
5820
5821
|
unitSystem: settings.getSetting(SETTINGS.metric_system.key) === true ? "metric" : "imperial",
|
|
5821
|
-
twelveHourTime:
|
|
5822
|
+
twelveHourTime: !uses24HourClock(),
|
|
5822
5823
|
}
|
|
5823
5824
|
}
|
|
5824
5825
|
|
|
5825
5826
|
private ensurePreferencesWired(): void {
|
|
5826
5827
|
if (this.preferencesWired) return
|
|
5827
5828
|
this.preferencesWired = true
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
()
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
}
|
|
5836
|
-
}
|
|
5837
|
-
|
|
5829
|
+
let sent = JSON.stringify(this.currentPreferences())
|
|
5830
|
+
const pushIfChanged = () => {
|
|
5831
|
+
const preferences = this.currentPreferences()
|
|
5832
|
+
const key = JSON.stringify(preferences)
|
|
5833
|
+
if (key === sent) return
|
|
5834
|
+
sent = key
|
|
5835
|
+
for (const packageName of this.handshookApps) {
|
|
5836
|
+
this.sendToMiniapp(packageName, {type: MiniappResponseType.PREFERENCES_UPDATE, preferences})
|
|
5837
|
+
}
|
|
5838
|
+
}
|
|
5839
|
+
useSettingsStore.subscribe((s) => s.getSetting(SETTINGS.metric_system.key) === true, pushIfChanged)
|
|
5840
|
+
// The clock format is an OS setting, so it can only have changed while the app was in the background.
|
|
5841
|
+
AppState.addEventListener("change", (state) => {
|
|
5842
|
+
if (state === "active") pushIfChanged()
|
|
5843
|
+
})
|
|
5838
5844
|
}
|
|
5839
5845
|
|
|
5840
5846
|
private currentCloudStatus(): MiniappCloudStatus {
|
|
@@ -41,17 +41,45 @@ export function isLoginCallback(url: string): boolean {
|
|
|
41
41
|
return url.toLowerCase().startsWith("fb-viewapp:") || url.includes("frl_login")
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
function queryPairs(url: string): [string, string][] {
|
|
45
|
+
const withoutFragment = url.includes("#") ? url.slice(0, url.indexOf("#")) : url
|
|
46
|
+
const query = withoutFragment.includes("?") ? withoutFragment.slice(withoutFragment.indexOf("?") + 1) : ""
|
|
47
|
+
const pairs: [string, string][] = []
|
|
48
|
+
for (const pair of query.split("&")) {
|
|
49
|
+
if (!pair) continue
|
|
50
|
+
const eq = pair.indexOf("=")
|
|
51
|
+
pairs.push(eq === -1 ? [pair, ""] : [pair.slice(0, eq), pair.slice(eq + 1)])
|
|
52
|
+
}
|
|
53
|
+
return pairs
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function decodeValue(value: string): string {
|
|
57
|
+
try {
|
|
58
|
+
return decodeURIComponent(value)
|
|
59
|
+
} catch {
|
|
60
|
+
return value
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
44
64
|
export function callbackQuery(url: string): {token?: string; blob?: string} {
|
|
45
|
-
const query = url.includes("?") ? url.slice(url.indexOf("?") + 1) : ""
|
|
46
65
|
const out: {token?: string; blob?: string} = {}
|
|
47
|
-
for (const
|
|
48
|
-
|
|
49
|
-
if (key === "
|
|
50
|
-
if (key === "blob") out.blob = decodeURIComponent(value)
|
|
66
|
+
for (const [key, value] of queryPairs(url)) {
|
|
67
|
+
if (key === "token") out.token = decodeValue(value)
|
|
68
|
+
if (key === "blob") out.blob = decodeValue(value)
|
|
51
69
|
}
|
|
52
70
|
return out
|
|
53
71
|
}
|
|
54
72
|
|
|
73
|
+
export function callbackShape(url: string): string {
|
|
74
|
+
const scheme = url.includes(":") ? url.slice(0, url.indexOf(":")) : "-"
|
|
75
|
+
const afterScheme = url.slice(scheme.length + 1)
|
|
76
|
+
const pathEnd = afterScheme.search(/[?#]/)
|
|
77
|
+
const path = pathEnd === -1 ? afterScheme : afterScheme.slice(0, pathEnd)
|
|
78
|
+
const keys = queryPairs(url).map(([key, value]) => `${key}:${value.length}`)
|
|
79
|
+
const fragment = url.includes("#") ? ` fragment=${url.slice(url.indexOf("#") + 1).length}` : ""
|
|
80
|
+
return `${scheme}:${path} query=[${keys.join(",")}]${fragment}`
|
|
81
|
+
}
|
|
82
|
+
|
|
55
83
|
/** The first 16 hex digits of the request token's SHA-256, which the callback must present. */
|
|
56
84
|
export function expectedCallbackToken(nativeSsoToken: string): string {
|
|
57
85
|
return sha256Hex(nativeSsoToken).slice(0, 16)
|
|
@@ -99,11 +127,12 @@ async function post(url: string, headers: Record<string, string>, body: string):
|
|
|
99
127
|
} catch {
|
|
100
128
|
json = null
|
|
101
129
|
}
|
|
130
|
+
const error = json?.error as {code?: number; error_subcode?: number} | null | undefined
|
|
102
131
|
if (response.status !== 200 || json === null) {
|
|
103
|
-
|
|
132
|
+
const code = error ? `, code ${error.code ?? "-"}` : ""
|
|
133
|
+
throw new MetaAuthError(`Meta sign-in failed (HTTP ${response.status}${code}). Try again.`)
|
|
104
134
|
}
|
|
105
|
-
if (
|
|
106
|
-
const error = json.error as {code?: number; error_subcode?: number} | null
|
|
135
|
+
if (error !== undefined) {
|
|
107
136
|
throw new MetaAuthError(
|
|
108
137
|
`Meta sign-in failed (code ${error?.code ?? "-"}, subcode ${error?.error_subcode ?? "-"}). Try again.`,
|
|
109
138
|
)
|
|
@@ -23,7 +23,6 @@ export type SettingsBridgeAccess = "read" | "write"
|
|
|
23
23
|
export const SETTINGS_BRIDGE_KEYS: Readonly<Record<string, SettingsBridgeAccess>> = {
|
|
24
24
|
// The dashboard's master switch is a phone-side debug knob.
|
|
25
25
|
custom_dashboard_enabled: "read",
|
|
26
|
-
contextual_dashboard: "write",
|
|
27
26
|
head_up_angle: "write",
|
|
28
27
|
// Where the glasses draw; each model's steps are its display.positionRange.
|
|
29
28
|
dashboard_depth: "write",
|
|
@@ -33,7 +32,6 @@ export const SETTINGS_BRIDGE_KEYS: Readonly<Record<string, SettingsBridgeAccess>
|
|
|
33
32
|
auto_brightness: "write",
|
|
34
33
|
// Per paired model: the store resolves the indexed key.
|
|
35
34
|
preferred_mic: "write",
|
|
36
|
-
twelve_hour_time: "write",
|
|
37
35
|
menu_apps: "write",
|
|
38
36
|
notifications_enabled: "write",
|
|
39
37
|
notifications_popups: "write",
|
package/src/stores/settings.ts
CHANGED
|
@@ -708,13 +708,6 @@ export const SETTINGS: Record<string, Setting> = {
|
|
|
708
708
|
saveOnServer: true,
|
|
709
709
|
persist: true,
|
|
710
710
|
},
|
|
711
|
-
twelve_hour_time: {
|
|
712
|
-
key: "twelve_hour_time",
|
|
713
|
-
defaultValue: () => true,
|
|
714
|
-
writable: true,
|
|
715
|
-
saveOnServer: true,
|
|
716
|
-
persist: true,
|
|
717
|
-
},
|
|
718
711
|
enforce_local_transcription: {
|
|
719
712
|
key: "enforce_local_transcription",
|
|
720
713
|
defaultValue: () => false,
|
|
@@ -764,14 +757,6 @@ export const SETTINGS: Record<string, Setting> = {
|
|
|
764
757
|
saveOnServer: false,
|
|
765
758
|
persist: false,
|
|
766
759
|
},
|
|
767
|
-
// glasses settings:
|
|
768
|
-
contextual_dashboard: {
|
|
769
|
-
key: "contextual_dashboard",
|
|
770
|
-
defaultValue: () => false,
|
|
771
|
-
writable: true,
|
|
772
|
-
saveOnServer: true,
|
|
773
|
-
persist: true,
|
|
774
|
-
},
|
|
775
760
|
// Debug escape hatch: G2 scene rendering through the Glassly CFW
|
|
776
761
|
// direct-framebuffer path (rasterized mode-3 frames into the carrier).
|
|
777
762
|
// ON by default — the working production path on CFW glasses; OFF falls
|
|
@@ -1268,8 +1253,7 @@ export const BLUETOOTH_SETTING_KEYS: string[] = [
|
|
|
1268
1253
|
SETTINGS.screen_disabled.key,
|
|
1269
1254
|
SETTINGS.auth_email.key,
|
|
1270
1255
|
SETTINGS.core_token.key,
|
|
1271
|
-
// glasses settings
|
|
1272
|
-
// no longer reads it):
|
|
1256
|
+
// glasses settings:
|
|
1273
1257
|
SETTINGS.head_up_angle.key,
|
|
1274
1258
|
SETTINGS.brightness.key,
|
|
1275
1259
|
SETTINGS.auto_brightness.key,
|
|
@@ -1283,7 +1267,6 @@ export const BLUETOOTH_SETTING_KEYS: string[] = [
|
|
|
1283
1267
|
SETTINGS.perf_logs.key,
|
|
1284
1268
|
SETTINGS.ring_via_glasses.key,
|
|
1285
1269
|
SETTINGS.display_max_fps.key,
|
|
1286
|
-
SETTINGS.twelve_hour_time.key,
|
|
1287
1270
|
SETTINGS.metric_system.key,
|
|
1288
1271
|
// button:
|
|
1289
1272
|
SETTINGS.button_photo_size.key,
|
|
@@ -72,4 +72,9 @@ export const evenRealitiesG1: Capabilities = {
|
|
|
72
72
|
// The app flashes the bundled Glassly CFW over MCUmgr SMP (see
|
|
73
73
|
// bluetooth-sdk/ios/Source/Resources/G1Firmware/README.md).
|
|
74
74
|
hasCustomFirmware: true,
|
|
75
|
+
|
|
76
|
+
// On iOS the Glassly CFW (G1CFW/51) relays the notifications the phone shares
|
|
77
|
+
// with the glasses over ANCS; the dashboard presents them.
|
|
78
|
+
hasNativeNotifications: false,
|
|
79
|
+
hasNotificationRelay: true,
|
|
75
80
|
}
|