@mentra/engine 3.2.1-dev.278 → 3.2.1-dev.282
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/generated/releaseMetadata.js +5 -5
- package/build/generated/releaseMetadata.js.map +1 -1
- package/build/services/AcsMeetingService.d.ts +56 -6
- package/build/services/AcsMeetingService.d.ts.map +1 -1
- package/build/services/AcsMeetingService.js +162 -40
- package/build/services/AcsMeetingService.js.map +1 -1
- package/build/services/CallGainSweep.d.ts +97 -0
- package/build/services/CallGainSweep.d.ts.map +1 -0
- package/build/services/CallGainSweep.js +249 -0
- package/build/services/CallGainSweep.js.map +1 -0
- package/build/services/GlassesMicProbe.d.ts +2 -0
- package/build/services/GlassesMicProbe.d.ts.map +1 -1
- package/build/services/GlassesMicProbe.js +20 -19
- package/build/services/GlassesMicProbe.js.map +1 -1
- package/build/services/LocalMiniappRuntime.d.ts +18 -0
- package/build/services/LocalMiniappRuntime.d.ts.map +1 -1
- package/build/services/LocalMiniappRuntime.js +131 -1
- package/build/services/LocalMiniappRuntime.js.map +1 -1
- package/build/services/MicSessionManager.d.ts +83 -0
- package/build/services/MicSessionManager.d.ts.map +1 -0
- package/build/services/MicSessionManager.js +201 -0
- package/build/services/MicSessionManager.js.map +1 -0
- package/build/services/MicStateCoordinator.d.ts +71 -5
- package/build/services/MicStateCoordinator.d.ts.map +1 -1
- package/build/services/MicStateCoordinator.js +161 -10
- package/build/services/MicStateCoordinator.js.map +1 -1
- package/build/services/micPolicy.d.ts +131 -0
- package/build/services/micPolicy.d.ts.map +1 -0
- package/build/services/micPolicy.js +140 -0
- package/build/services/micPolicy.js.map +1 -0
- package/build/stores/bluetoothSettingKeys.d.ts.map +1 -1
- package/build/stores/bluetoothSettingKeys.js +3 -0
- package/build/stores/bluetoothSettingKeys.js.map +1 -1
- package/build/stores/settings.d.ts +5 -0
- package/build/stores/settings.d.ts.map +1 -1
- package/build/stores/settings.js +62 -0
- package/build/stores/settings.js.map +1 -1
- package/build/utils/pcm16.d.ts +20 -0
- package/build/utils/pcm16.d.ts.map +1 -1
- package/build/utils/pcm16.js +32 -1
- package/build/utils/pcm16.js.map +1 -1
- package/package.json +8 -8
- package/src/generated/releaseMetadata.ts +5 -5
- package/src/services/AcsMeetingService.ts +167 -40
- package/src/services/CallGainSweep.ts +318 -0
- package/src/services/GlassesMicProbe.ts +20 -17
- package/src/services/LocalMiniappRuntime.ts +152 -3
- package/src/services/MicSessionManager.ts +258 -0
- package/src/services/MicStateCoordinator.ts +153 -10
- package/src/services/micPolicy.ts +198 -0
- package/src/stores/bluetoothSettingKeys.ts +3 -0
- package/src/stores/settings.ts +66 -0
- package/src/utils/pcm16.ts +43 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"micPolicy.js","sourceRoot":"","sources":["../../src/services/micPolicy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAsBH,4EAA4E;AAC5E,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;AAEnF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,IAAI,EAAE,EAAE;IACR,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,GAAG;IACV,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,IAAI;CACN,CAAA;AAEV;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CA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qBAAqB,GAA0B,CAAC,YAAY,CAAC,CAAA;AAE1E;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAC9B,QAAmC,EACnC,IAAqB;IAErB,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAA;IAEnG,IAAI,UAAU,GAAG,KAAK,CAAA;IACtB,IAAI,YAAY,GAAG,KAAK,CAAA;IACxB,IAAI,OAAO,GAA4B,IAAI,CAAA;IAC3C,KAAK,MAAM,OAAO,IAAI,SAAS,EAAE,CAAC;QAChC,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS;YAAE,SAAQ;QAC1C,UAAU,GAAG,IAAI,CAAA;QACjB,IAAI,0BAA0B,CAAC,OAAO,CAAC,OAAO,CAAC;YAAE,YAAY,GAAG,IAAI,CAAA;QACpE,MAAM,OAAO,GAAG,qBAAqB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QACtD,IAAI,OAAO,OAAO,EAAE,IAAI,KAAK,QAAQ;YAAE,SAAQ;QAC/C,sEAAsE;QACtE,yEAAyE;QACzE,kDAAkD;QAClD,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,IAAK;YAAE,OAAO,GAAG,OAAO,CAAA;IACzE,CAAC;IAED,OAAO;QACL,MAAM,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC;QAC5B,UAAU;QACV,SAAS,EAAE,OAAO;QAClB,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI;KAC/C,CAAA;AACH,CAAC","sourcesContent":["/**\n * Microphone use-case policy.\n *\n * Applications say what they are doing (\"voice_call\"); the engine decides what\n * that requires of the hardware. Nothing above this file knows that a voice\n * call means ADC index 14, and no miniapp can ask for a gain directly.\n *\n * Pure: every function here is a function of the live session set. The lease\n * bookkeeping lives in MicSessionManager, the merge with OS preferences lives\n * in MicStateCoordinator, and the wire write lives below that again.\n */\n\n/** What an application is doing with the microphone. */\nexport type MicUseCase = \"voice_call\" | \"transcription\" | \"voice_assistant\" | \"diagnostic\"\n\n/** Which microphone the audio comes from. */\nexport type MicSource = \"glasses\" | \"phone\"\n\n/** Subset of the `mic_tuning` wire payload. Fields left out keep firmware defaults. */\nexport type MicTuningProfile = {\n /** codec_adc_vol index, 0-15. */\n gain?: number\n /** Center-mic RMS to open the gate. */\n open?: number\n /** Center-mic RMS to close it again. */\n close?: number\n /** Open threshold while the speaker is elevated. */\n sp_open?: number\n /** Close threshold while the speaker is elevated. */\n sp_close?: number\n}\n\n/** `codec_adc_vol[]`: index to dB. Index 0 is mute and is never offered. */\nexport const GAIN_DB = [-99, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 32]\n\n/**\n * Mirrored from `center_mic_vad_get_default_config` and `CODEC_SADC_VOL`.\n *\n * The four RMS numbers are measured *after* the ADC gain, so they are only\n * meaningful next to the gain they were calibrated at, which is index 15.\n */\nexport const MIC_TUNING_FIRMWARE_DEFAULTS = {\n gain: 15,\n open: 1350,\n close: 945,\n sp_open: 2900,\n sp_close: 1600,\n} as const\n\n/**\n * Re-express the firmware's thresholds at a different gain.\n *\n * The gate compares post-gain RMS, so moving the gain without moving the\n * thresholds silently changes what the gate means: at -8 dB the wearer has to\n * be 2.5x louder to clear a number that was chosen for +32 dB. Scaling both by\n * the same factor keeps the *acoustic* trip point the profile was tuned for,\n * for the wearer and for speaker leak alike.\n */\nexport function scaleMicTuningToGain(gain: number): Required<MicTuningProfile> {\n const index = Math.min(GAIN_DB.length - 1, Math.max(1, Math.round(gain)))\n const factor = Math.pow(10, (GAIN_DB[index]! - GAIN_DB[MIC_TUNING_FIRMWARE_DEFAULTS.gain]!) / 20)\n return {\n gain: index,\n open: Math.round(MIC_TUNING_FIRMWARE_DEFAULTS.open * factor),\n close: Math.round(MIC_TUNING_FIRMWARE_DEFAULTS.close * factor),\n sp_open: Math.round(MIC_TUNING_FIRMWARE_DEFAULTS.sp_open * factor),\n sp_close: Math.round(MIC_TUNING_FIRMWARE_DEFAULTS.sp_close * factor),\n }\n}\n\n/** A live microphone lease. */\nexport type MicSessionSpec = {\n useCase: MicUseCase\n source: MicSource\n}\n\n/** What the hardware should do, given every live session. */\nexport type ResolvedMicPolicy = {\n /** Someone needs a continuous raw-PCM timeline, which also forces hardware VAD off. */\n rawPcm: boolean\n /** Pin the Bluetooth SDK to the glasses microphone. Only the glasses can be pinned. */\n pinGlasses: boolean\n /** Tuning override for the glasses, or null to leave the OS value in force. */\n micTuning: MicTuningProfile | null\n /** Run the center-mic loudness gate, or null to leave the OS value in force. */\n loudnessGate: boolean | null\n}\n\n/** Platform facts the policy cannot infer from the sessions alone. */\nexport type MicPlatformCaps = {\n /**\n * Whether this platform can take the wearer's voice off the glasses as raw\n * PCM over BLE LC3. False on iOS, which has no `setMicSourcePin` and never\n * selects the `ble-lc3` uplink.\n */\n glassesPcmUplink: boolean\n}\n\n/**\n * Mentra Live ships CODEC_SADC_VOL = 15, the last entry of codec_adc_vol[] and\n * +32 dB. That table steps 2 dB at a time everywhere except the final step,\n * which jumps 6 dB from +26, so the default sits at the ceiling one oversized\n * step above everything else. It suits a wearer dictating to a transcription\n * miniapp across a room; it clips a wearer talking into a Teams call.\n *\n * Index 14 is +26 dB: one step down, and the step that removes the table's\n * anomalous jump. A same-voice sweep showed 15 rails hard (2.5–4.2% clip);\n * 14/13/12 still kiss the rail on syllable tips. 13 is +24 dB, the middle\n * of that band, while we listen for loudness vs residual clip.\n *\n * The thresholds ride along with the gain rather than being stated here, so\n * changing the index above cannot leave the gate calibrated for a level the\n * ADC no longer produces.\n */\nexport const MIC_USE_CASE_PROFILES: Record<MicUseCase, MicTuningProfile> = {\n voice_call: scaleMicTuningToGain(13),\n transcription: {},\n voice_assistant: {},\n diagnostic: {},\n}\n\n/**\n * Use cases that run the center-mic loudness gate (\"Barrier\").\n *\n * A voice call is the one place it earns its keep. There is no echo canceller\n * on the LC3 uplink — `MENTRA_LC3_SPEECH_PROCESSING` is 0 and the capture path\n * ignores the playback reference — so without a gate the far end hears itself\n * through the wearer's speaker. Barrier is the safe half of the firmware's two\n * gates: it zeroes a quiet frame but never stops transmitting, where VAD drops\n * the stream outright. Paired with the speaker-elevated thresholds above, that\n * suppresses leak while the far end is talking and costs the wearer nothing.\n */\nexport const MIC_USE_CASE_LOUDNESS_GATE: Record<MicUseCase, boolean> = {\n voice_call: true,\n transcription: false,\n voice_assistant: false,\n diagnostic: false,\n}\n\n/**\n * Packages allowed to hold a `voice_call` session.\n *\n * Which app may make a voice call is policy, so it lives beside the profiles\n * rather than in the request handler that enforces it.\n */\nexport const VOICE_CALL_PACKAGES: readonly string[] = [\"com.mentra.call\"]\n\n/** Every use case, for validating an inbound request. */\nexport const MIC_USE_CASES: readonly MicUseCase[] = [\n \"voice_call\",\n \"transcription\",\n \"voice_assistant\",\n \"diagnostic\",\n]\n\n/** Owners of engine-internal sessions. Miniapps cannot claim these use cases. */\nexport const ENGINE_OWNER_PREFIX = \"engine:\"\n\n/** Use cases only engine features may acquire. */\nexport const ENGINE_ONLY_USE_CASES: readonly MicUseCase[] = [\"diagnostic\"]\n\n/**\n * Resolve every live session into one hardware state.\n *\n * On a platform without a glasses PCM uplink a glasses session is a lease and\n * nothing more: it satisfies ownership checks so an iOS call can still be\n * modelled the same way, but it claims no PCM, pins nothing, and applies no\n * gain, because the wearer's voice does not reach the call through the BES\n * BLE path there.\n */\nexport function resolveMicPolicy(\n sessions: readonly MicSessionSpec[],\n caps: MicPlatformCaps,\n): ResolvedMicPolicy {\n const effective = caps.glassesPcmUplink ? sessions : sessions.filter((s) => s.source !== \"glasses\")\n\n let pinGlasses = false\n let loudnessGate = false\n let winning: MicTuningProfile | null = null\n for (const session of effective) {\n if (session.source !== \"glasses\") continue\n pinGlasses = true\n if (MIC_USE_CASE_LOUDNESS_GATE[session.useCase]) loudnessGate = true\n const profile = MIC_USE_CASE_PROFILES[session.useCase]\n if (typeof profile?.gain !== \"number\") continue\n // Lowest index wins: clipping is the irreversible failure, a slightly\n // quiet assistant is not. The whole profile travels with it, because its\n // thresholds are only meaningful at its own gain.\n if (winning === null || profile.gain < winning.gain!) winning = profile\n }\n\n return {\n rawPcm: effective.length > 0,\n pinGlasses,\n micTuning: winning,\n loudnessGate: pinGlasses ? loudnessGate : null,\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bluetoothSettingKeys.d.ts","sourceRoot":"","sources":["../../src/stores/bluetoothSettingKeys.ts"],"names":[],"mappings":"AAEA,iFAAiF;AACjF,eAAO,MAAM,wBAAwB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"bluetoothSettingKeys.d.ts","sourceRoot":"","sources":["../../src/stores/bluetoothSettingKeys.ts"],"names":[],"mappings":"AAEA,iFAAiF;AACjF,eAAO,MAAM,wBAAwB,EAAE,MAAM,EA0B5C,CAAA;AAMD,wBAAgB,gCAAgC,CAC9C,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,QAAQ,EAAE,MAAM,EAAE,GACjB,MAAM,EAAE,CAEV"}
|
|
@@ -6,6 +6,9 @@ export const MENTRA_LIVE_SETTING_KEYS = [
|
|
|
6
6
|
"preferred_mic",
|
|
7
7
|
"voice_activity_detection_enabled",
|
|
8
8
|
"loudness_gate_enabled",
|
|
9
|
+
// Effective tuning only. mic_tuning_desired is engine-side state and must
|
|
10
|
+
// never appear here, or a persisted super-mode value would reach the glasses.
|
|
11
|
+
"mic_tuning",
|
|
9
12
|
"core_token",
|
|
10
13
|
"auth_email",
|
|
11
14
|
"button_photo_size",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bluetoothSettingKeys.js","sourceRoot":"","sources":["../../src/stores/bluetoothSettingKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,UAAU,CAAA;AAEpC,iFAAiF;AACjF,MAAM,CAAC,MAAM,wBAAwB,GAAa;IAChD,iBAAiB;IACjB,gBAAgB;IAChB,eAAe;IACf,kCAAkC;IAClC,uBAAuB;IACvB,YAAY;IACZ,YAAY;IACZ,mBAAmB;IACnB,uBAAuB;IACvB,2BAA2B;IAC3B,YAAY;IACZ,cAAc;IACd,2BAA2B;IAC3B,cAAc;IACd,kBAAkB;IAClB,kBAAkB;IAClB,aAAa;IACb,gBAAgB;IAChB,oBAAoB;IACpB,oBAAoB;IACpB,wBAAwB;IACxB,oBAAoB;CACrB,CAAA;AAED,SAAS,kBAAkB,CAAC,KAAyB;IACnD,OAAO,KAAK,KAAK,WAAW,CAAC,IAAI,IAAI,KAAK,KAAK,aAAa,CAAA;AAC9D,CAAC;AAED,MAAM,UAAU,gCAAgC,CAC9C,WAA+B,EAC/B,QAAkB;IAElB,OAAO,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,QAAQ,CAAA;AAC9E,CAAC","sourcesContent":["import {DeviceTypes} from \"../types\"\n\n/** Mentra Live has no display — omit dashboard/brightness keys from BLE sync. */\nexport const MENTRA_LIVE_SETTING_KEYS: string[] = [\n \"sensing_enabled\",\n \"lc3_frame_size\",\n \"preferred_mic\",\n \"voice_activity_detection_enabled\",\n \"loudness_gate_enabled\",\n \"core_token\",\n \"auth_email\",\n \"button_photo_size\",\n \"button_video_settings\",\n \"button_max_recording_time\",\n \"camera_fov\",\n \"offline_mode\",\n \"local_stt_fallback_active\",\n \"gallery_mode\",\n \"default_wearable\",\n \"pending_wearable\",\n \"device_name\",\n \"device_address\",\n \"default_controller\",\n \"pending_controller\",\n \"controller_device_name\",\n \"controller_address\",\n]\n\nfunction isMentraLiveDevice(model: string | undefined): boolean {\n return model === DeviceTypes.LIVE || model === \"Mentra Live\"\n}\n\nexport function getBluetoothSettingKeysForDevice(\n deviceModel: string | undefined,\n fullKeys: string[],\n): string[] {\n return isMentraLiveDevice(deviceModel) ? MENTRA_LIVE_SETTING_KEYS : fullKeys\n}\n"]}
|
|
1
|
+
{"version":3,"file":"bluetoothSettingKeys.js","sourceRoot":"","sources":["../../src/stores/bluetoothSettingKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,UAAU,CAAA;AAEpC,iFAAiF;AACjF,MAAM,CAAC,MAAM,wBAAwB,GAAa;IAChD,iBAAiB;IACjB,gBAAgB;IAChB,eAAe;IACf,kCAAkC;IAClC,uBAAuB;IACvB,0EAA0E;IAC1E,8EAA8E;IAC9E,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,mBAAmB;IACnB,uBAAuB;IACvB,2BAA2B;IAC3B,YAAY;IACZ,cAAc;IACd,2BAA2B;IAC3B,cAAc;IACd,kBAAkB;IAClB,kBAAkB;IAClB,aAAa;IACb,gBAAgB;IAChB,oBAAoB;IACpB,oBAAoB;IACpB,wBAAwB;IACxB,oBAAoB;CACrB,CAAA;AAED,SAAS,kBAAkB,CAAC,KAAyB;IACnD,OAAO,KAAK,KAAK,WAAW,CAAC,IAAI,IAAI,KAAK,KAAK,aAAa,CAAA;AAC9D,CAAC;AAED,MAAM,UAAU,gCAAgC,CAC9C,WAA+B,EAC/B,QAAkB;IAElB,OAAO,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,QAAQ,CAAA;AAC9E,CAAC","sourcesContent":["import {DeviceTypes} from \"../types\"\n\n/** Mentra Live has no display — omit dashboard/brightness keys from BLE sync. */\nexport const MENTRA_LIVE_SETTING_KEYS: string[] = [\n \"sensing_enabled\",\n \"lc3_frame_size\",\n \"preferred_mic\",\n \"voice_activity_detection_enabled\",\n \"loudness_gate_enabled\",\n // Effective tuning only. mic_tuning_desired is engine-side state and must\n // never appear here, or a persisted super-mode value would reach the glasses.\n \"mic_tuning\",\n \"core_token\",\n \"auth_email\",\n \"button_photo_size\",\n \"button_video_settings\",\n \"button_max_recording_time\",\n \"camera_fov\",\n \"offline_mode\",\n \"local_stt_fallback_active\",\n \"gallery_mode\",\n \"default_wearable\",\n \"pending_wearable\",\n \"device_name\",\n \"device_address\",\n \"default_controller\",\n \"pending_controller\",\n \"controller_device_name\",\n \"controller_address\",\n]\n\nfunction isMentraLiveDevice(model: string | undefined): boolean {\n return model === DeviceTypes.LIVE || model === \"Mentra Live\"\n}\n\nexport function getBluetoothSettingKeysForDevice(\n deviceModel: string | undefined,\n fullKeys: string[],\n): string[] {\n return isMentraLiveDevice(deviceModel) ? MENTRA_LIVE_SETTING_KEYS : fullKeys\n}\n"]}
|
|
@@ -39,6 +39,11 @@ export interface SettingsState {
|
|
|
39
39
|
getSetting: (key: string) => any;
|
|
40
40
|
loadAllSettings: () => AsyncResult<void, Error>;
|
|
41
41
|
getBluetoothSettings: () => Record<string, any>;
|
|
42
|
+
/**
|
|
43
|
+
* The mic tuning native is allowed to send: the desired value while super
|
|
44
|
+
* mode is on, `{}` (meaning "reset to firmware defaults") otherwise.
|
|
45
|
+
*/
|
|
46
|
+
getEffectiveMicTuning: () => Record<string, number>;
|
|
42
47
|
resetAllSettingsLocally: () => void;
|
|
43
48
|
}
|
|
44
49
|
export declare const useSettingsStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SettingsState>, "subscribe"> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/stores/settings.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,WAAW,EAAwB,MAAM,aAAa,CAAA;AAQ9D,OAAO,EAAC,wBAAwB,EAAE,gCAAgC,EAAC,MAAM,wBAAwB,CAAA;AAEjG,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,MAAM,CAAA;IACX,YAAY,EAAE,MAAM,GAAG,CAAA;IACvB,QAAQ,EAAE,OAAO,CAAA;IACjB,YAAY,EAAE,OAAO,CAAA;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CAAC,CAAA;IAE7B,aAAa,EAAE,OAAO,CAAA;IAEtB,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,YAAY,CAAC,EAAE,OAAO,KAAK,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IACzF,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IAC3E,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,GAAG,CAAA;IAEhC,eAAe,EAAE,MAAM,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IAE/C,oBAAoB,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC/C;;;OAGG;IACH,qBAAqB,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACnD,uBAAuB,EAAE,MAAM,IAAI,CAAA;CACpC;AAkBD,eAAO,MAAM,gBAAgB;;;;;;;;EAmX5B,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,CAAC,GAAG,GAAG,EAAE,KAAK,MAAM,KAAG,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAK3F,CAAA"}
|
package/build/stores/settings.js
CHANGED
|
@@ -421,6 +421,42 @@ export const SETTINGS = {
|
|
|
421
421
|
saveOnServer: true,
|
|
422
422
|
persist: true,
|
|
423
423
|
},
|
|
424
|
+
/*
|
|
425
|
+
* Mentra Live mic tuning, split in two on purpose.
|
|
426
|
+
*
|
|
427
|
+
* `mic_tuning_desired` is what the super user set. It persists so that
|
|
428
|
+
* turning super mode off and on again does not lose the calibration, and it
|
|
429
|
+
* stays out of BLUETOOTH_SETTING_KEYS so it can never reach the glasses on
|
|
430
|
+
* its own. It is device-local: this is a hardware calibration aid, not
|
|
431
|
+
* something that should follow an account onto another pair of glasses.
|
|
432
|
+
*
|
|
433
|
+
* `mic_tuning` is the effective value, derived in getBluetoothSettings as
|
|
434
|
+
* `super_mode ? desired : {}`. It is the only one native ever sees. Because
|
|
435
|
+
* it is not persisted and native seeds no default for it, a process that
|
|
436
|
+
* connects before the engine has authorized anything can only send a reset
|
|
437
|
+
* -- the super-mode guarantee is then a property of what native can hold,
|
|
438
|
+
* not of which initialiser happened to run first.
|
|
439
|
+
*
|
|
440
|
+
* `{}` rather than null for "no tuning": the native store drops null writes,
|
|
441
|
+
* so null would leave a previously applied value in place.
|
|
442
|
+
*
|
|
443
|
+
* The empty object is a stable singleton so GlassesSettingsSync's reference
|
|
444
|
+
* diff does not treat every unrelated settings write as a mic_tuning change.
|
|
445
|
+
*/
|
|
446
|
+
mic_tuning_desired: {
|
|
447
|
+
key: "mic_tuning_desired",
|
|
448
|
+
defaultValue: () => null,
|
|
449
|
+
writable: true,
|
|
450
|
+
saveOnServer: false,
|
|
451
|
+
persist: true,
|
|
452
|
+
},
|
|
453
|
+
mic_tuning: {
|
|
454
|
+
key: "mic_tuning",
|
|
455
|
+
defaultValue: () => ({}),
|
|
456
|
+
writable: true,
|
|
457
|
+
saveOnServer: false,
|
|
458
|
+
persist: false,
|
|
459
|
+
},
|
|
424
460
|
always_on_status_bar: {
|
|
425
461
|
key: "always_on_status_bar",
|
|
426
462
|
defaultValue: () => false,
|
|
@@ -711,6 +747,8 @@ export const BLUETOOTH_SETTING_KEYS = [
|
|
|
711
747
|
SETTINGS.power_saving_mode.key,
|
|
712
748
|
SETTINGS.voice_activity_detection_enabled.key,
|
|
713
749
|
SETTINGS.loudness_gate_enabled.key,
|
|
750
|
+
// Effective tuning only; mic_tuning_desired deliberately stays engine-side.
|
|
751
|
+
SETTINGS.mic_tuning.key,
|
|
714
752
|
SETTINGS.lc3_frame_size.key,
|
|
715
753
|
SETTINGS.preferred_mic.key,
|
|
716
754
|
SETTINGS.screen_disabled.key,
|
|
@@ -771,6 +809,8 @@ export const BLUETOOTH_SETTING_KEYS = [
|
|
|
771
809
|
export const PAIRING_IDENTITY_KEYS = Object.values(SETTINGS)
|
|
772
810
|
.filter((setting) => setting.nativeAuthoritative)
|
|
773
811
|
.map((setting) => setting.key);
|
|
812
|
+
/** Stable empty effective tuning. Native reads this as `{"reset":1}`. */
|
|
813
|
+
const EMPTY_MIC_TUNING = Object.freeze({});
|
|
774
814
|
const getDefaultSettings = () => Object.keys(SETTINGS).reduce((acc, key) => {
|
|
775
815
|
acc[key] = SETTINGS[key].defaultValue();
|
|
776
816
|
return acc;
|
|
@@ -1100,10 +1140,32 @@ export const useSettingsStore = create()(subscribeWithSelector((set, get) => ({
|
|
|
1100
1140
|
if (key === SETTINGS.core_token.key && (typeof value !== "string" || value.trim().length === 0)) {
|
|
1101
1141
|
continue;
|
|
1102
1142
|
}
|
|
1143
|
+
if (key === SETTINGS.mic_tuning.key) {
|
|
1144
|
+
// Derived here rather than stored, so there is no path that can push
|
|
1145
|
+
// a persisted tuning to the glasses while super mode is off. Every
|
|
1146
|
+
// sync route (change diff, on-connect replay, full seed) reads this.
|
|
1147
|
+
bluetoothSettings[key] = state.getEffectiveMicTuning();
|
|
1148
|
+
continue;
|
|
1149
|
+
}
|
|
1103
1150
|
bluetoothSettings[key] = value;
|
|
1104
1151
|
}
|
|
1105
1152
|
return bluetoothSettings;
|
|
1106
1153
|
},
|
|
1154
|
+
getEffectiveMicTuning: () => {
|
|
1155
|
+
const state = get();
|
|
1156
|
+
if (!state.getSetting(SETTINGS.super_mode.key))
|
|
1157
|
+
return EMPTY_MIC_TUNING;
|
|
1158
|
+
const desired = state.getSetting(SETTINGS.mic_tuning_desired.key);
|
|
1159
|
+
if (!desired || typeof desired !== "object")
|
|
1160
|
+
return EMPTY_MIC_TUNING;
|
|
1161
|
+
const effective = {};
|
|
1162
|
+
for (const [key, value] of Object.entries(desired)) {
|
|
1163
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
1164
|
+
effective[key] = Math.round(value);
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
return Object.keys(effective).length === 0 ? EMPTY_MIC_TUNING : effective;
|
|
1168
|
+
},
|
|
1107
1169
|
resetAllSettingsLocally: () => {
|
|
1108
1170
|
set((_state) => ({
|
|
1109
1171
|
settings: getDefaultSettings(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/stores/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAC,WAAW,EAAC,MAAM,OAAO,CAAA;AACjC,OAAO,EAAc,MAAM,IAAI,GAAG,EAAS,MAAM,aAAa,CAAA;AAC9D,OAAO,EAAC,MAAM,EAAC,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAC,qBAAqB,EAAC,MAAM,oBAAoB,CAAA;AAExD,OAAO,EAAC,OAAO,EAAC,MAAM,kBAAkB,CAAA;AACxC,OAAO,EAAC,gCAAgC,EAAC,MAAM,wBAAwB,CAAA;AACvE,OAAO,EAAC,eAAe,EAAC,MAAM,WAAW,CAAA;AAEzC,OAAO,EAAC,wBAAwB,EAAE,gCAAgC,EAAC,MAAM,wBAAwB,CAAA;AAyCjG,MAAM,CAAC,MAAM,QAAQ,GAA4B;IAC/C,mCAAmC;IACnC,QAAQ,EAAE,EAAC,GAAG,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAC,EAAE,aAAa;IAC1H,UAAU,EAAE,EAAC,GAAG,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAC;IAC/G,oBAAoB,EAAE;QACpB,GAAG,EAAE,sBAAsB;Q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AAA;YACnC,IAAI,GAAG,KAAK,QAAQ,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC;gBAChG,SAAQ;YACV,CAAC;YACD,iBAAiB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;QAChC,CAAC;QACD,OAAO,iBAAiB,CAAA;IAC1B,CAAC;IACD,uBAAuB,EAAE,GAAG,EAAE;QAC5B,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YACf,QAAQ,EAAE,kBAAkB,EAAE;YAC9B,aAAa,EAAE,IAAI;SACpB,CAAC,CAAC,CAAA;IACL,CAAC;CACF,CAAC,CAAC,CACJ,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,CAAU,GAAW,EAA+C,EAAE;IAC9F,MAAM,KAAK,GAAG,gBAAgB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAA;IAChE,MAAM,UAAU,GAAG,gBAAgB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;IAChE,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,QAAW,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,CAAA;IAC3F,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;AAC1B,CAAC,CAAA","sourcesContent":["import {getTimeZone} from \"react-native-localize\"\nimport {useCallback} from \"react\"\nimport {AsyncResult, result as Res, Result} from \"typesafe-ts\"\nimport {create} from \"zustand\"\nimport {subscribeWithSelector} from \"zustand/middleware\"\n\nimport {storage} from \"../utils/storage\"\nimport {getBluetoothSettingKeysForDevice} from \"./bluetoothSettingKeys\"\nimport {useGlassesStore} from \"./glasses\"\n\nexport {MENTRA_LIVE_SETTING_KEYS, getBluetoothSettingKeysForDevice} from \"./bluetoothSettingKeys\"\n\nexport interface Setting {\n key: string\n defaultValue: () => any\n writable: boolean\n saveOnServer: boolean\n // change the key to a different key based on the indexer\n // NEVER do any network calls in the indexer (or performance will suffer greatly\n indexer?: (key: string) => string\n // optionally override the value of the setting when it's accessed\n override?: () => any\n // onWrite?: () => void\n persist: boolean\n // Pairing-identity keys are NATIVE-authoritative: the native layer writes\n // them on pairing success (handleDeviceReady) / forget and echoes them down\n // via save_setting; JS鈫抧ative they travel only in the explicit SEEDS\n // (hydration, pre-connect, post-demotion, abandon re-seed) — never the\n // change-push and never the on-connect replay, whose mid-relay snapshot can\n // overwrite a just-promoted identity. PAIRING_IDENTITY_KEYS is derived from\n // this flag so the sync exclusions can't drift from the descriptors.\n nativeAuthoritative?: true\n /**\n * Clear this setting when the build's environment changes.\n *\n * A persisted override normally outranks both the build's env and the\n * compiled default, which is right within one environment: a developer's\n * METRO_AUTO pin should survive a rebuild. It is wrong across environments,\n * where an override pinned under a dev build would silently follow the\n * install onto a store build pointed at production.\n *\n * Note this keys off the build's environment label, so it does NOT fire on a\n * TestFlight to App Store promotion: that ships the same binary with the same\n * label. Promotion is safe because the publishing lane bakes prod URLs, not\n * because this reset runs. See the resolution block in loadSettings.\n *\n * Absent means the value is never invalidated automatically.\n */\n resetOnBuildEnvChange?: true\n}\n\nexport const SETTINGS: Record<string, Setting> = {\n // feature flags / mantle settings:\n dev_mode: {key: \"dev_mode\", defaultValue: () => __DEV__, writable: true, saveOnServer: true, persist: true}, // deprecated\n debug_mode: {key: \"debug_mode\", defaultValue: () => __DEV__, writable: true, saveOnServer: true, persist: true},\n show_mentra_call_ios: {\n key: \"show_mentra_call_ios\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n android_notification_listener_enabled: {\n key: \"android_notification_listener_enabled\",\n // Operational kill switch. The listener now runs in a guarded lightweight\n // process, so normal installs can safely capture notifications by default.\n defaultValue: () => true,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n super_mode: {key: \"super_mode\", defaultValue: () => false, writable: true, saveOnServer: true, persist: true},\n appearance_menu_enabled: {\n key: \"appearance_menu_enabled\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n app_boot_extra_info: {\n key: \"app_boot_extra_info\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n miniapp_dev_mode: {\n key: \"miniapp_dev_mode\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n enable_squircles: {\n key: \"enable_squircles\",\n defaultValue: () => true,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n android_blur: {\n key: \"android_blur\",\n defaultValue: () => {\n return false\n },\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n android_inner_shadow: {\n key: \"android_inner_shadow\",\n defaultValue: () => {\n return false\n },\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n ios_glass_effect: {\n key: \"ios_glass_effect\",\n defaultValue: () => true,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n ios_app_switcher_bottom_swipe: {\n key: \"ios_app_switcher_bottom_swipe\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n debug_console: {\n key: \"debug_console\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n debug_navigation_history: {\n key: \"debug_navigation_history\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n debug_core_status_bar: {\n key: \"debug_core_status_bar\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n // Mentra Nex feature flags (off by default; toggled from Nex Developer Settings).\n // When on, the Nex display skips ASCII-only text sanitization so CJK/Chinese\n // captions render on glasses. Synced to the Bluetooth SDK via BLUETOOTH_SETTING_KEYS.\n nex_chinese_captions: {\n key: \"nex_chinese_captions\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n // When on, LC3 audio received from Nex glasses is played back (Android only).\n // Local-only dev toggle: defaults off and never synced to the cloud account\n // (saveOnServer: false); persists locally so it survives app restarts.\n // Key renamed from the legacy `nex_audio_playback` so stale server/local\n // values (saved back when this was saveOnServer:true) can't re-enable it.\n nex_lc3_audio_playback: {\n key: \"nex_lc3_audio_playback\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n // Select firmware-owned presentation instead of the Mentra card. Notify still\n // controls whether presentation is running on either phone platform.\n native_notifications_enabled: {\n key: \"native_notifications_enabled\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n native_notifications_auto_display: {\n key: \"native_notifications_auto_display\",\n defaultValue: () => true,\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n native_notifications_duration: {\n key: \"native_notifications_duration\",\n defaultValue: () => 5,\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n native_notifications_do_not_disturb: {\n key: \"native_notifications_do_not_disturb\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n china_deployment: {\n key: \"china_deployment\",\n defaultValue: () => (process.env.EXPO_PUBLIC_DEPLOYMENT_REGION === \"china\" ? true : false),\n override: () => (process.env.EXPO_PUBLIC_DEPLOYMENT_REGION === \"china\" ? true : false),\n writable: false,\n saveOnServer: false,\n persist: true,\n },\n // Cloud V2 endpoint OVERRIDES. Empty = no override; cloudClient's resolveUrl\n // owns the full precedence (override -> env -> Metro-derived dev default).\n // The value may be an explicit URL or the METRO_AUTO sentinel (\"my dev\n // laptop\", resolved live from Metro so it survives network changes). Never\n // bake an env var or a personal LAN IP into the default here: that makes the\n // override branch always-truthy and strands devs on a stale address.\n cloud_core_url: {\n key: \"cloud_core_url\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n resetOnBuildEnvChange: true,\n },\n cloud_runtime_url: {\n key: \"cloud_runtime_url\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n resetOnBuildEnvChange: true,\n },\n cloud_url_deployment: {\n key: \"cloud_url_deployment\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n resetOnBuildEnvChange: true,\n },\n // Bookmarked Cloud V2 endpoint pairs. Each entry is {label, coreUrl,\n // runtimeUrl} — core + runtime are saved together because they are always\n // applied as a matched set (presets fill both; Save & Test verifies both).\n saved_cloud_url_pairs: {\n key: \"saved_cloud_url_pairs\",\n defaultValue: () => [],\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n // Developer override for the ASG OTA manifest URL. null/empty = no override;\n // the normal selection applies (legacy-glasses gate, EXPO_PUBLIC_ASG_OTA_VERSION_URL,\n // glasses-reported URL, then production). See resolveOtaManifestUrl.\n ota_version_url: {\n key: \"ota_version_url\",\n defaultValue: () => null,\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n saved_ota_version_urls: {\n key: \"saved_ota_version_urls\",\n defaultValue: () => [],\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n reconnect_on_app_foreground: {\n key: \"reconnect_on_app_foreground\",\n defaultValue: () => true,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n location_tier: {key: \"location_tier\", defaultValue: () => \"\", writable: true, saveOnServer: true, persist: true},\n // Volatile bearer synced to Bluetooth for glasses-side Cloud V2 calls. The\n // key name is kept for BLE compatibility, but the value must never be loaded\n // from or saved to the legacy Cloud V1 settings store.\n core_token: {key: \"core_token\", defaultValue: () => \"\", writable: true, saveOnServer: false, persist: false},\n auth_email: {key: \"auth_email\", defaultValue: () => \"\", writable: true, saveOnServer: false, persist: true},\n // Pairing identity is per-phone, not per-account: two phones on one account\n // can be paired to different glasses, so none of these keys may sync to the\n // server (saveOnServer: false — a stale server copy resurrecting a local\n // pairing identity is exactly the desync this group's flags prevent).\n //\n // Two-phase identity: pending_wearable is the model the user last STARTED\n // pairing (written at selection, rendered as a finish-pairing card);\n // default_wearable + device_name + device_address are only promoted by the\n // native layer when pairing actually succeeds (handleDeviceReady).\n // pending_wearable persists so an abandoned selection still shows its\n // finish-pairing card after an app restart.\n pending_wearable: {\n key: \"pending_wearable\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n nativeAuthoritative: true,\n },\n default_wearable: {\n key: \"default_wearable\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n nativeAuthoritative: true,\n },\n device_name: {\n key: \"device_name\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n nativeAuthoritative: true,\n },\n device_address: {\n key: \"device_address\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n nativeAuthoritative: true,\n },\n project_name: {\n key: \"project_name\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n nativeAuthoritative: true,\n },\n default_controller: {\n key: \"default_controller\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n nativeAuthoritative: true,\n },\n pending_controller: {\n key: \"pending_controller\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n nativeAuthoritative: true,\n },\n controller_device_name: {\n key: \"controller_device_name\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n nativeAuthoritative: true,\n },\n controller_address: {\n key: \"controller_address\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n nativeAuthoritative: true,\n },\n // ui state:\n home_background: {\n key: \"home_background\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n theme_preference: {\n key: \"theme_preference\",\n defaultValue: () => \"light\",\n // Force light mode - i mode is not complete yet\n // override: () => \"light\",\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n enable_phone_notifications: {\n key: \"enable_phone_notifications\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n settings_access_count: {\n key: \"settings_access_count\",\n defaultValue: () => 0,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n show_advanced_settings: {\n key: \"show_advanced_settings\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n onboarding_completed: {\n key: \"onboarding_completed\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n onboarding_live_completed: {\n key: \"onboarding_live_completed\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n onboarding_os_completed: {\n key: \"onboarding_os_completed\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n has_ever_activated_app: {\n key: \"has_ever_activated_app\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n\n // Bluetooth SDK settings:\n sensing_enabled: {\n key: \"sensing_enabled\",\n defaultValue: () => true,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n power_saving_mode: {\n key: \"power_saving_mode\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n // The Mentra App intentionally preserves Mentra Live's historical VAD-on\n // product default. Standalone public Bluetooth SDK hosts default VAD off so\n // their microphone audio remains continuous.\n voice_activity_detection_enabled: {\n key: \"voice_activity_detection_enabled\",\n defaultValue: () => true,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n // Mentra Live center-mic loudness / \"Barrier\" gate (cs_swit type 10). Opt-in.\n loudness_gate_enabled: {\n key: \"loudness_gate_enabled\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n always_on_status_bar: {\n key: \"always_on_status_bar\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n // Legacy cloud/mobile setting name. Locally it maps to glasses-side Voice Activity Detection.\n bypass_vad_for_debugging: {\n key: \"bypass_vad_for_debugging\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n bypass_audio_encoding_for_debugging: {\n key: \"bypass_audio_encoding_for_debugging\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n metric_system: {\n key: \"metric_system\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n twelve_hour_time: {\n key: \"twelve_hour_time\",\n defaultValue: () => true,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n enforce_local_transcription: {\n key: \"enforce_local_transcription\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n // LC3 audio quality setting (frame size in bytes)\n // 20 = 16kbps (low bandwidth), 40 = 32kbps (balanced), 60 = 48kbps (high quality)\n lc3_frame_size: {\n key: \"lc3_frame_size\",\n defaultValue: () => 60,\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n preferred_mic: {\n key: \"preferred_mic\",\n defaultValue: () => \"auto\",\n writable: true,\n indexer: (key: string) => {\n const glasses = useSettingsStore.getState().getSetting(SETTINGS.default_wearable.key)\n if (glasses) {\n return `${key}:${glasses}`\n }\n return key\n },\n saveOnServer: true,\n persist: true,\n },\n screen_disabled: {\n key: \"screen_disabled\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n // glasses settings:\n contextual_dashboard: {\n key: \"contextual_dashboard\",\n defaultValue: () => true,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n use_native_dashboard: {\n key: \"use_native_dashboard\",\n defaultValue: () => true,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n head_up_angle: {key: \"head_up_angle\", defaultValue: () => 45, writable: true, saveOnServer: true, persist: true},\n brightness: {key: \"brightness\", defaultValue: () => 50, writable: true, saveOnServer: true, persist: true},\n auto_brightness: {\n key: \"auto_brightness\",\n defaultValue: () => true,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n dashboard_height: {\n key: \"dashboard_height\",\n defaultValue: () => 4,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n dashboard_depth: {\n key: \"dashboard_depth\",\n defaultValue: () => 2,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n menu_apps: {\n key: \"menu_apps\",\n defaultValue: () => null,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n calendar_events: {\n key: \"calendar_events\",\n defaultValue: () => [],\n writable: true,\n saveOnServer: false,\n persist: false,\n },\n // button settings\n // Legacy persisted/cloud key; hardware behavior is now controlled by gallery_mode plus capture settings.\n button_mode: {key: \"button_mode\", defaultValue: () => \"photo\", writable: true, saveOnServer: true, persist: true},\n button_photo_size: {\n key: \"button_photo_size\",\n defaultValue: () => \"max\",\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n button_video_settings: {\n key: \"button_video_settings\",\n defaultValue: () => ({width: 1920, height: 1080, fps: 30}),\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n button_max_recording_time: {\n key: \"button_max_recording_time\",\n defaultValue: () => 10,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n camera_fov: {\n key: \"camera_fov\",\n defaultValue: () => ({fov: 118, roi_position: 0}),\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n media_post_processing: {\n key: \"media_post_processing\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n\n // time zone settings\n time_zone: {\n key: \"time_zone\",\n defaultValue: () => \"\",\n writable: true,\n override: () => {\n const override = useSettingsStore.getState().getSetting(SETTINGS.time_zone_override.key)\n if (override) {\n return override\n }\n return getTimeZone()\n },\n saveOnServer: true,\n persist: true,\n },\n time_zone_override: {\n key: \"time_zone_override\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n // offline applets\n offline_mode: {key: \"offline_mode\", defaultValue: () => false, writable: true, saveOnServer: true, persist: true},\n // Runtime flag: coordinator flips this on when cloud STT has failed and fallback is active.\n // Native GlassesStore watches it to gate PCM 鈫?Sherpa feeding. Not user-facing.\n local_stt_fallback_active: {\n key: \"local_stt_fallback_active\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: false,\n persist: false,\n },\n gallery_mode: {key: \"gallery_mode\", defaultValue: () => true, writable: true, saveOnServer: true, persist: true},\n gallery_sync_explained: {\n key: \"gallery_sync_explained\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n offline_camera_running: {\n key: \"offline_camera_running\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n // offline translation\n offline_translation_running: {\n key: \"offline_translation_running\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n offline_translation_source: {\n key: \"offline_translation_source\",\n defaultValue: () => \"en\",\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n offline_translation_target: {\n key: \"offline_translation_target\",\n defaultValue: () => \"es\",\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n // button action settings\n default_button_action_enabled: {\n key: \"default_button_action_enabled\",\n defaultValue: () => true,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n default_button_action_app: {\n key: \"default_button_action_app\",\n defaultValue: () => \"com.mentra.camera\",\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n // notifications\n notifications_blocklist: {\n key: \"notifications_blocklist\",\n defaultValue: () => [],\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n // Cached required version from server - used to enforce updates even when offline\n cached_required_version: {\n key: \"cached_required_version\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n // OTA update dismissal - stores the version code user dismissed (not persisted so resets on app restart)\n dismissed_ota_version: {\n key: \"dismissed_ota_version\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: false,\n },\n // Contact email for feedback (persisted for Apple private relay users)\n contact_email: {\n key: \"contact_email\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n} as const\n\nexport const OFFLINE_APPLETS: string[] = [\"com.mentra.livecaptions\", \"com.mentra.camera\"]\n\n// These settings are automatically synced to the Bluetooth SDK.\n// Keep this list hardware-facing; app/UI/cloud-only preferences should stay in JS/Crust.\nexport const BLUETOOTH_SETTING_KEYS: string[] = [\n // Bluetooth settings:\n SETTINGS.sensing_enabled.key,\n SETTINGS.power_saving_mode.key,\n SETTINGS.voice_activity_detection_enabled.key,\n SETTINGS.loudness_gate_enabled.key,\n SETTINGS.lc3_frame_size.key,\n SETTINGS.preferred_mic.key,\n SETTINGS.screen_disabled.key,\n SETTINGS.auth_email.key,\n SETTINGS.core_token.key,\n // glasses settings:\n SETTINGS.contextual_dashboard.key,\n SETTINGS.head_up_angle.key,\n SETTINGS.brightness.key,\n SETTINGS.auto_brightness.key,\n SETTINGS.dashboard_height.key,\n SETTINGS.dashboard_depth.key,\n SETTINGS.menu_apps.key,\n SETTINGS.calendar_events.key,\n SETTINGS.use_native_dashboard.key,\n SETTINGS.twelve_hour_time.key,\n SETTINGS.metric_system.key,\n // button:\n SETTINGS.button_photo_size.key,\n // Legacy MentraLive native code reads the object form when syncing video settings.\n SETTINGS.button_video_settings.key,\n SETTINGS.button_max_recording_time.key,\n SETTINGS.camera_fov.key,\n // device / pairing:\n SETTINGS.pending_wearable.key,\n SETTINGS.default_wearable.key,\n SETTINGS.device_name.key,\n SETTINGS.device_address.key,\n SETTINGS.project_name.key,\n SETTINGS.default_controller.key,\n SETTINGS.pending_controller.key,\n SETTINGS.controller_device_name.key,\n SETTINGS.controller_address.key,\n // offline applets:\n SETTINGS.offline_mode.key,\n // Runtime flag flipped by LocalSttFallbackCoordinator. Native reads it from\n // GlassesStore to gate PCM 鈫?Sherpa feeding in handlePcm and to keep the\n // mic on while local STT is the active engine.\n SETTINGS.local_stt_fallback_active.key,\n SETTINGS.gallery_mode.key,\n // Mentra Nex feature flags:\n SETTINGS.nex_chinese_captions.key,\n SETTINGS.nex_lc3_audio_playback.key,\n]\n\n// Pairing identity is NATIVE-authoritative: the native layer writes it on\n// pairing success (handleDeviceReady) / forget and echoes it down via\n// save_setting; JS persists those echoes. JS鈫抧ative, identity travels ONLY in\n// the explicit full seeds (device-store hydration, pre-connect push,\n// post-demotion re-push) — never in the change-push subscription. Relaying an\n// echoed identity change back up would make the sync bidirectional with loop\n// gain 1: two identity values in flight (e.g. a boot demotion crossing a\n// native promotion) then chase each other through push鈫抋pply鈫抏cho鈫抪ush\n// forever, flapping the UI.\n//\n// Derived from the `nativeAuthoritative` descriptor flag (not maintained as a\n// parallel list) so the change-push exclusion in GlassesSettingsSync can't\n// drift from the setting declarations.\nexport const PAIRING_IDENTITY_KEYS: string[] = Object.values(SETTINGS)\n .filter((setting) => setting.nativeAuthoritative)\n .map((setting) => setting.key)\n\n// const PER_GLASSES_SETTINGS_KEYS: string[] = [SETTINGS.preferred_mic.key]\n\nexport interface SettingsState {\n // Settings values\n settings: Record<string, any>\n // Loading states\n isInitialized: boolean\n // Actions\n setSetting: (key: string, value: any, updateServer?: boolean) => AsyncResult<void, Error>\n setManyLocally: (settings: Record<string, any>) => AsyncResult<void, Error>\n getSetting: (key: string) => any\n // loadSetting: (key: string) => AsyncResult<void, Error>\n loadAllSettings: () => AsyncResult<void, Error>\n // Utility methods\n getBluetoothSettings: () => Record<string, any>\n resetAllSettingsLocally: () => void\n}\n\nconst getDefaultSettings = () =>\n Object.keys(SETTINGS).reduce((acc, key) => {\n acc[key] = SETTINGS[key].defaultValue()\n return acc\n }, {} as Record<string, any>)\n\n// Single-flight for loadAllSettings: the host fires it at module load and\n// engine.start()'s device-store hydration awaits it — without the memo the\n// second caller runs a duplicate full disk load while the first is still in\n// flight. Cleared on failure so a later call can retry.\nlet loadAllSettingsInFlight: AsyncResult<void, Error> | null = null\n\nfunction printableSettingValue(key: string, value: unknown): string {\n return key.includes(\"token\") || key.includes(\"email\") ? \"<redacted>\" : JSON.stringify(value)\n}\n\nexport const useSettingsStore = create<SettingsState>()(\n subscribeWithSelector((set, get) => ({\n settings: getDefaultSettings(),\n isInitialized: false,\n loadingKeys: new Set(),\n setSetting: (key: string, value: any, _updateServer = true): AsyncResult<void, Error> => {\n return Res.try_async(async () => {\n const setting = SETTINGS[key]\n const originalKey = key\n\n if (!setting) {\n throw new Error(`SETTINGS: SET: ${originalKey} is not a valid setting!`)\n }\n\n if (setting.indexer) {\n key = setting.indexer(originalKey)\n }\n\n if (!setting.writable) {\n throw new Error(`SETTINGS: ${originalKey} is not writable!`)\n }\n\n // Update store immediately for optimistic UI\n console.log(`SETTINGS: SET: ${key} = ${printableSettingValue(key, value)}`)\n set((state) => ({\n settings: {...state.settings, [key]: value},\n }))\n\n if (setting.persist) {\n let res = await storage.save(key, value)\n if (res.is_error()) {\n throw new Error(`SETTINGS: couldn't save setting to storage: ${res.error}`)\n }\n\n // Cloud V1 per-change server sync removed with the V1 ripout (issue\n // #3392). Settings are local-first until a V2 sync lands; the\n // saveOnServer flags are retained as intent markers for that work.\n }\n })\n },\n getSetting: (key: string) => {\n const state = get()\n const originalKey = key\n const setting = SETTINGS[originalKey]\n\n if (!setting) {\n console.error(`SETTINGS: GET: ${originalKey} is not a valid setting!`)\n return undefined\n }\n\n if (setting.override) {\n let override = setting.override()\n if (override !== undefined) {\n return override\n }\n }\n\n if (setting.indexer) {\n key = setting.indexer(originalKey)\n }\n\n // console.log(`GET SETTING: ${key} = ${state.settings[key]}`)\n\n try {\n const raw = state.settings[key] ?? SETTINGS[originalKey].defaultValue()\n return raw\n } catch (e) {\n // for dynamically created settings, we need to create a new setting in SETTINGS:\n console.log(`Failed to get setting, creating new setting:(${key}):`, e)\n SETTINGS[key] = {key: key, defaultValue: () => undefined, writable: true, saveOnServer: false, persist: true}\n return SETTINGS[key].defaultValue()\n }\n },\n // batch update many settings from the server:\n setManyLocally: (settings: Record<string, any>): AsyncResult<void, Error> => {\n return Res.try_async(async () => {\n const settingsToLoad: Record<string, any> = {}\n // if a setting should not persist, don't load it:\n for (const [key, value] of Object.entries(settings)) {\n const stg: Setting | undefined = SETTINGS[key.toLowerCase()]\n if (!stg) {\n continue\n }\n if (!stg.persist) {\n continue\n }\n settingsToLoad[key.toLowerCase()] = value\n }\n // console.log(\"SETTINGS: SET MANY LOCALLY: \", settingsToLoad)\n\n // MMKV writes are synchronous Results, not rejecting Promises. Check\n // each result before publishing the new in-memory settings.\n for (const [key, value] of Object.entries(settingsToLoad)) {\n const saved = storage.save(key, value)\n if (saved.is_error()) throw saved.error\n }\n set((state) => ({settings: {...state.settings, ...settingsToLoad}}))\n })\n },\n // loads any preferences that have been changed from the default and saved to DISK!\n loadAllSettings: (): AsyncResult<void, Error> => {\n console.log(\"SETTINGS: loadAllSettings()\")\n if (loadAllSettingsInFlight) {\n return loadAllSettingsInFlight\n }\n const inFlight = Res.try_async(async () => {\n const state = get()\n let loadedSettings: Record<string, any> = {}\n\n if (state.isInitialized) {\n return undefined\n }\n\n for (const setting of Object.values(SETTINGS)) {\n // if the settings should not persist, don't load it:\n if (!setting.persist) {\n continue\n }\n\n // load all subkeys for an indexed setting:\n if (setting?.indexer) {\n console.log(`SETTINGS: LOAD: ${setting.key} with indexer!`)\n\n let res: Result<Record<string, unknown>, Error> = storage.loadSubKeys(setting.key)\n if (res.is_error()) {\n console.log(`SETTINGS: LOAD: ${setting.key}`, res.error)\n continue\n }\n\n let subKeys: Record<string, unknown> = res.value\n console.log(`SETTINGS: LOAD: ${setting.key} subkeys are set!`, subKeys)\n loadedSettings = {...loadedSettings, ...subKeys}\n continue\n }\n\n let res = storage.load<any>(setting.key)\n if (res.is_error()) {\n console.log(`SETTINGS: LOAD: ${setting.key} is not set!`, res.error)\n // this setting isn't set from the default, so we don't load anything\n continue\n }\n // normal key:value pair:\n let value = res.value\n // res.value IS the stored value; logging value.value printed\n // \"undefined\" for every loaded setting and disguised present\n // values as missing. Redact token- and email-bearing keys: console\n // logs are uploaded in bug-report artifacts (same keys\n // diagnosticContext's SENSITIVE_SETTINGS_KEYS strips, minus an\n // import that would cycle stores <-> utils).\n console.log(`SETTINGS: LOAD: ${setting.key} = ${printableSettingValue(setting.key, value)}`)\n loadedSettings[setting.key] = value\n }\n\n // console.log(\"##############################################\")\n // console.log(loadedSettings)\n // console.log(\"##############################################\")\n\n set((state) => ({\n isInitialized: true,\n settings: {...state.settings, ...loadedSettings},\n }))\n\n // This hidden debug switch originally shipped default-off while the\n // notification-listener cold-start ANR was being investigated. Now\n // that the listener runs in its own guarded process, migrate existing\n // installs to the new default once; later explicit debug changes still\n // persist normally.\n // Reset the cloud backend override when the build's environment changes.\n //\n // cloud_core_url / cloud_runtime_url are persist:true and outrank both\n // the build's env and the compiled default (see resolveUrl in\n // cloudClient.ts). That is what we want inside one environment: a\n // developer's METRO_AUTO pin should survive a rebuild. It is wrong\n // across environments.\n //\n // The concrete case is an install that moves BETWEEN environments: an\n // internal tester running a dev build with a pinned override who then\n // installs the store build. The override outranks that build's prod\n // URLs, so without this they keep talking to dev with nothing\n // surfacing it.\n //\n // Note what this deliberately does NOT do, because the distinction is\n // easy to get backwards. TestFlight and the App Store receive the SAME\n // binary, so promotion does not change EXPO_PUBLIC_BUILD_ENV and this\n // reset never fires on it. Promotion is safe for a different reason:\n // the publishing lane bakes the selected release cloud environment, and\n // production promotes the already-tested binary. The same holds for\n // Android beta-track to production.\n //\n // The residual gap is therefore an override pinned while already on a\n // prod-labelled build, which no label comparison can see. That is a\n // deliberate limit: reaching it means typing a URL into a dev-only\n // screen, VersionInfo renders the current value, and the same screen\n // clears it.\n //\n // Comparing the baked EXPO_PUBLIC_BUILD_ENV against the last one seen\n // on this device covers those environment switches and fresh installs\n // without touching the setting write path. A reinstall needs no\n // handling: it drops the marker and the override together\n // (android:allowBackup=\"false\", and iOS deletes the container).\n const BUILD_ENV_KEY = \"settings.lastBuildEnv\"\n const buildEnv = (process.env.EXPO_PUBLIC_BUILD_ENV ?? \"dev\").trim() || \"dev\"\n const lastBuildEnv = storage.load<string>(BUILD_ENV_KEY)\n const previousBuildEnv = lastBuildEnv.is_error() ? undefined : lastBuildEnv.value\n if (previousBuildEnv !== buildEnv) {\n // Clear when there is no marker yet, not just on a recorded change.\n // The first build carrying this code meets every existing install\n // with previousBuildEnv === undefined, and those are exactly the\n // installs that may hold an override set before the pin existed --\n // the population this is here to repair. Treating \"no marker\" as a\n // fresh install would record the marker and never look again. A\n // genuinely fresh install has nothing persisted, so the clear below\n // writes each default over itself and costs nothing.\n //\n // Driven by the descriptors rather than a hardcoded key list, so a\n // setting that needs this behaviour declares it in one place and\n // cannot be missed here.\n const scoped = Object.values(SETTINGS).filter((setting) => setting.resetOnBuildEnvChange)\n console.log(\n `SETTINGS: build env ${previousBuildEnv ?? \"(none recorded)\"} -> ${buildEnv}, ` +\n `clearing ${scoped.length} build-scoped setting(s)`,\n )\n let allCleared = true\n for (const setting of scoped) {\n const cleared = await get().setSetting(setting.key, setting.defaultValue(), false)\n if (cleared.is_error()) {\n allCleared = false\n console.log(`SETTINGS: could not clear ${setting.key}:`, cleared.error)\n }\n }\n // Advance the marker only once the reset actually landed. Recording\n // it after a failed write would retire the retry and leave the stale\n // override for the life of the install; leaving it unset costs one\n // repeated attempt per launch until a write succeeds.\n if (allCleared) {\n storage.save(BUILD_ENV_KEY, buildEnv)\n }\n }\n\n // Reset existing installs once; later user/app opt-ins remain available.\n const LOUDNESS_GATE_MIGRATION_KEY = \"migration:loudness_gate_default_off_v1\"\n const loudnessGateMigrationDone = storage.load<boolean>(LOUDNESS_GATE_MIGRATION_KEY)\n if (loudnessGateMigrationDone.is_error() || !loudnessGateMigrationDone.value) {\n // updateServer: true, matching the android_blur / camera_fov migrations. The flag is\n // inert until the Cloud V2 settings sync lands, but this setting is saveOnServer, so\n // the intent recorded here is the one that should carry over.\n const result = await get().setSetting(SETTINGS.loudness_gate_enabled.key, false, true)\n if (result.is_error()) {\n console.log(\"SETTINGS: loudness gate migration failed:\", result.error)\n } else {\n storage.save(LOUDNESS_GATE_MIGRATION_KEY, true)\n }\n }\n\n const NOTIFICATION_LISTENER_MIGRATION_KEY = \"migration:android_notification_listener_default_on_v1\"\n const notificationListenerMigrationDone = storage.load<boolean>(NOTIFICATION_LISTENER_MIGRATION_KEY)\n if (notificationListenerMigrationDone.is_error() || !notificationListenerMigrationDone.value) {\n const result = await get().setSetting(SETTINGS.android_notification_listener_enabled.key, true, false)\n if (result.is_error()) {\n console.log(\"SETTINGS: notification listener migration failed:\", result.error)\n } else {\n storage.save(NOTIFICATION_LISTENER_MIGRATION_KEY, true)\n }\n }\n\n // One-time migration: force android_blur=false for existing users.\n // The setting's default is already false; this migration covers users\n // who explicitly opted into Android blur effects before we discovered\n // they're a major source of frame drops on cheap Android phones.\n // The dimezisBlurViewSdk31Plus blur each costs ~5-10ms/frame; with\n // multiple blurs on home (top fade + AppSwitcherButton x2) a low-end\n // device misses the 16ms budget consistently. Users can turn it back\n // on under Settings 鈫?Appearance once we've optimized further.\n //\n // The setSetting call also pushes to the server (saveOnServer: true)\n // so the server-stored value flips too — otherwise the next sync\n // from the user's server-stored prefs would re-enable blur.\n // Best-effort: a server failure (offline, 5xx) shouldn't block boot;\n // we still mark the migration done locally so we don't loop.\n const MIGRATION_KEY = \"migration:android_blur_default_false_v1\"\n const migrationDone = storage.load<boolean>(MIGRATION_KEY)\n if (migrationDone.is_error() || !migrationDone.value) {\n const current = get().getSetting(SETTINGS.android_blur.key)\n if (current === true) {\n const result = await get().setSetting(SETTINGS.android_blur.key, false, true)\n if (result.is_error()) {\n // Server push failed (offline / 5xx). Local storage was still\n // updated, so the user immediately gets the new behavior. The\n // server-side stale `true` will be overwritten the next time\n // the user opens Appearance settings and the auto-sync runs.\n console.log(\"SETTINGS: android_blur migration server-push failed:\", result.error)\n }\n }\n // Mark done unconditionally — even on server-push failure we don't\n // want to retry the migration on every boot. The local value is\n // already correct.\n storage.save(MIGRATION_KEY, true)\n }\n\n // The old camera default cropped the sensor to 102掳. Move existing\n // default-shaped values to the full 118掳 sensor once; named miniapp\n // requests for the 102掳 \"standard\" preset remain available.\n const CAMERA_FOV_MIGRATION_KEY = \"migration:camera_fov_full_sensor_v1\"\n const cameraFovMigrationDone = storage.load<boolean>(CAMERA_FOV_MIGRATION_KEY)\n if (cameraFovMigrationDone.is_error() || !cameraFovMigrationDone.value) {\n const current = get().getSetting(SETTINGS.camera_fov.key) as {fov?: number; roi_position?: number} | undefined\n let migrationSucceeded = true\n if (current?.fov === 102 && (current.roi_position ?? 0) === 0) {\n const result = await get().setSetting(SETTINGS.camera_fov.key, {fov: 118, roi_position: 0}, true)\n if (result.is_error()) {\n console.log(\"SETTINGS: camera FOV migration failed:\", result.error)\n migrationSucceeded = false\n }\n }\n // Unlike the blur migration above, a failed camera set may leave the\n // local value unchanged. Only mark this migration complete once the\n // desired value was applied so a transient failure retries on boot.\n if (migrationSucceeded) storage.save(CAMERA_FOV_MIGRATION_KEY, true)\n }\n })\n loadAllSettingsInFlight = inFlight\n void Promise.resolve(inFlight).then((result) => {\n if (result.is_error()) {\n loadAllSettingsInFlight = null\n }\n })\n return inFlight\n },\n getBluetoothSettings: () => {\n const state = get()\n // Device-model-filtered key set (wire v2): Mentra Live (no display) gets\n // the reduced MENTRA_LIVE_SETTING_KEYS; display glasses get the full set.\n const deviceModel = useGlassesStore.getState().deviceModel || state.getSetting(SETTINGS.default_wearable.key)\n const keys = getBluetoothSettingKeysForDevice(deviceModel, BLUETOOTH_SETTING_KEYS)\n const bluetoothSettings: Record<string, any> = {}\n for (const key of keys) {\n const value = state.getSetting(key)\n if (key === SETTINGS.core_token.key && (typeof value !== \"string\" || value.trim().length === 0)) {\n continue\n }\n bluetoothSettings[key] = value\n }\n return bluetoothSettings\n },\n resetAllSettingsLocally: () => {\n set((_state) => ({\n settings: getDefaultSettings(),\n isInitialized: true,\n }))\n },\n })),\n)\n\nexport const useSetting = <T = any>(key: string): [T, (value: T) => AsyncResult<void, Error>] => {\n const value = useSettingsStore((state) => state.getSetting(key))\n const setSetting = useSettingsStore((state) => state.setSetting)\n const setValue = useCallback((newValue: T) => setSetting(key, newValue), [key, setSetting])\n return [value, setValue]\n}\n"]}
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/stores/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,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AAE,CAAC;gBACxD,SAAS,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;YACpC,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAA;IAC3E,CAAC;IACD,uBAAuB,EAAE,GAAG,EAAE;QAC5B,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YACf,QAAQ,EAAE,kBAAkB,EAAE;YAC9B,aAAa,EAAE,IAAI;SACpB,CAAC,CAAC,CAAA;IACL,CAAC;CACF,CAAC,CAAC,CACJ,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,CAAU,GAAW,EAA+C,EAAE;IAC9F,MAAM,KAAK,GAAG,gBAAgB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAA;IAChE,MAAM,UAAU,GAAG,gBAAgB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;IAChE,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,QAAW,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,CAAA;IAC3F,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;AAC1B,CAAC,CAAA","sourcesContent":["import {getTimeZone} from \"react-native-localize\"\nimport {useCallback} from \"react\"\nimport {AsyncResult, result as Res, Result} from \"typesafe-ts\"\nimport {create} from \"zustand\"\nimport {subscribeWithSelector} from \"zustand/middleware\"\n\nimport {storage} from \"../utils/storage\"\nimport {getBluetoothSettingKeysForDevice} from \"./bluetoothSettingKeys\"\nimport {useGlassesStore} from \"./glasses\"\n\nexport {MENTRA_LIVE_SETTING_KEYS, getBluetoothSettingKeysForDevice} from \"./bluetoothSettingKeys\"\n\nexport interface Setting {\n key: string\n defaultValue: () => any\n writable: boolean\n saveOnServer: boolean\n // change the key to a different key based on the indexer\n // NEVER do any network calls in the indexer (or performance will suffer greatly\n indexer?: (key: string) => string\n // optionally override the value of the setting when it's accessed\n override?: () => any\n // onWrite?: () => void\n persist: boolean\n // Pairing-identity keys are NATIVE-authoritative: the native layer writes\n // them on pairing success (handleDeviceReady) / forget and echoes them down\n // via save_setting; JS鈫抧ative they travel only in the explicit SEEDS\n // (hydration, pre-connect, post-demotion, abandon re-seed) — never the\n // change-push and never the on-connect replay, whose mid-relay snapshot can\n // overwrite a just-promoted identity. PAIRING_IDENTITY_KEYS is derived from\n // this flag so the sync exclusions can't drift from the descriptors.\n nativeAuthoritative?: true\n /**\n * Clear this setting when the build's environment changes.\n *\n * A persisted override normally outranks both the build's env and the\n * compiled default, which is right within one environment: a developer's\n * METRO_AUTO pin should survive a rebuild. It is wrong across environments,\n * where an override pinned under a dev build would silently follow the\n * install onto a store build pointed at production.\n *\n * Note this keys off the build's environment label, so it does NOT fire on a\n * TestFlight to App Store promotion: that ships the same binary with the same\n * label. Promotion is safe because the publishing lane bakes prod URLs, not\n * because this reset runs. See the resolution block in loadSettings.\n *\n * Absent means the value is never invalidated automatically.\n */\n resetOnBuildEnvChange?: true\n}\n\nexport const SETTINGS: Record<string, Setting> = {\n // feature flags / mantle settings:\n dev_mode: {key: \"dev_mode\", defaultValue: () => __DEV__, writable: true, saveOnServer: true, persist: true}, // deprecated\n debug_mode: {key: \"debug_mode\", defaultValue: () => __DEV__, writable: true, saveOnServer: true, persist: true},\n show_mentra_call_ios: {\n key: \"show_mentra_call_ios\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n android_notification_listener_enabled: {\n key: \"android_notification_listener_enabled\",\n // Operational kill switch. The listener now runs in a guarded lightweight\n // process, so normal installs can safely capture notifications by default.\n defaultValue: () => true,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n super_mode: {key: \"super_mode\", defaultValue: () => false, writable: true, saveOnServer: true, persist: true},\n appearance_menu_enabled: {\n key: \"appearance_menu_enabled\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n app_boot_extra_info: {\n key: \"app_boot_extra_info\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n miniapp_dev_mode: {\n key: \"miniapp_dev_mode\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n enable_squircles: {\n key: \"enable_squircles\",\n defaultValue: () => true,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n android_blur: {\n key: \"android_blur\",\n defaultValue: () => {\n return false\n },\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n android_inner_shadow: {\n key: \"android_inner_shadow\",\n defaultValue: () => {\n return false\n },\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n ios_glass_effect: {\n key: \"ios_glass_effect\",\n defaultValue: () => true,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n ios_app_switcher_bottom_swipe: {\n key: \"ios_app_switcher_bottom_swipe\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n debug_console: {\n key: \"debug_console\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n debug_navigation_history: {\n key: \"debug_navigation_history\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n debug_core_status_bar: {\n key: \"debug_core_status_bar\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n // Mentra Nex feature flags (off by default; toggled from Nex Developer Settings).\n // When on, the Nex display skips ASCII-only text sanitization so CJK/Chinese\n // captions render on glasses. Synced to the Bluetooth SDK via BLUETOOTH_SETTING_KEYS.\n nex_chinese_captions: {\n key: \"nex_chinese_captions\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n // When on, LC3 audio received from Nex glasses is played back (Android only).\n // Local-only dev toggle: defaults off and never synced to the cloud account\n // (saveOnServer: false); persists locally so it survives app restarts.\n // Key renamed from the legacy `nex_audio_playback` so stale server/local\n // values (saved back when this was saveOnServer:true) can't re-enable it.\n nex_lc3_audio_playback: {\n key: \"nex_lc3_audio_playback\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n // Select firmware-owned presentation instead of the Mentra card. Notify still\n // controls whether presentation is running on either phone platform.\n native_notifications_enabled: {\n key: \"native_notifications_enabled\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n native_notifications_auto_display: {\n key: \"native_notifications_auto_display\",\n defaultValue: () => true,\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n native_notifications_duration: {\n key: \"native_notifications_duration\",\n defaultValue: () => 5,\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n native_notifications_do_not_disturb: {\n key: \"native_notifications_do_not_disturb\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n china_deployment: {\n key: \"china_deployment\",\n defaultValue: () => (process.env.EXPO_PUBLIC_DEPLOYMENT_REGION === \"china\" ? true : false),\n override: () => (process.env.EXPO_PUBLIC_DEPLOYMENT_REGION === \"china\" ? true : false),\n writable: false,\n saveOnServer: false,\n persist: true,\n },\n // Cloud V2 endpoint OVERRIDES. Empty = no override; cloudClient's resolveUrl\n // owns the full precedence (override -> env -> Metro-derived dev default).\n // The value may be an explicit URL or the METRO_AUTO sentinel (\"my dev\n // laptop\", resolved live from Metro so it survives network changes). Never\n // bake an env var or a personal LAN IP into the default here: that makes the\n // override branch always-truthy and strands devs on a stale address.\n cloud_core_url: {\n key: \"cloud_core_url\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n resetOnBuildEnvChange: true,\n },\n cloud_runtime_url: {\n key: \"cloud_runtime_url\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n resetOnBuildEnvChange: true,\n },\n cloud_url_deployment: {\n key: \"cloud_url_deployment\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n resetOnBuildEnvChange: true,\n },\n // Bookmarked Cloud V2 endpoint pairs. Each entry is {label, coreUrl,\n // runtimeUrl} — core + runtime are saved together because they are always\n // applied as a matched set (presets fill both; Save & Test verifies both).\n saved_cloud_url_pairs: {\n key: \"saved_cloud_url_pairs\",\n defaultValue: () => [],\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n // Developer override for the ASG OTA manifest URL. null/empty = no override;\n // the normal selection applies (legacy-glasses gate, EXPO_PUBLIC_ASG_OTA_VERSION_URL,\n // glasses-reported URL, then production). See resolveOtaManifestUrl.\n ota_version_url: {\n key: \"ota_version_url\",\n defaultValue: () => null,\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n saved_ota_version_urls: {\n key: \"saved_ota_version_urls\",\n defaultValue: () => [],\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n reconnect_on_app_foreground: {\n key: \"reconnect_on_app_foreground\",\n defaultValue: () => true,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n location_tier: {key: \"location_tier\", defaultValue: () => \"\", writable: true, saveOnServer: true, persist: true},\n // Volatile bearer synced to Bluetooth for glasses-side Cloud V2 calls. The\n // key name is kept for BLE compatibility, but the value must never be loaded\n // from or saved to the legacy Cloud V1 settings store.\n core_token: {key: \"core_token\", defaultValue: () => \"\", writable: true, saveOnServer: false, persist: false},\n auth_email: {key: \"auth_email\", defaultValue: () => \"\", writable: true, saveOnServer: false, persist: true},\n // Pairing identity is per-phone, not per-account: two phones on one account\n // can be paired to different glasses, so none of these keys may sync to the\n // server (saveOnServer: false — a stale server copy resurrecting a local\n // pairing identity is exactly the desync this group's flags prevent).\n //\n // Two-phase identity: pending_wearable is the model the user last STARTED\n // pairing (written at selection, rendered as a finish-pairing card);\n // default_wearable + device_name + device_address are only promoted by the\n // native layer when pairing actually succeeds (handleDeviceReady).\n // pending_wearable persists so an abandoned selection still shows its\n // finish-pairing card after an app restart.\n pending_wearable: {\n key: \"pending_wearable\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n nativeAuthoritative: true,\n },\n default_wearable: {\n key: \"default_wearable\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n nativeAuthoritative: true,\n },\n device_name: {\n key: \"device_name\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n nativeAuthoritative: true,\n },\n device_address: {\n key: \"device_address\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n nativeAuthoritative: true,\n },\n project_name: {\n key: \"project_name\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n nativeAuthoritative: true,\n },\n default_controller: {\n key: \"default_controller\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n nativeAuthoritative: true,\n },\n pending_controller: {\n key: \"pending_controller\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n nativeAuthoritative: true,\n },\n controller_device_name: {\n key: \"controller_device_name\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n nativeAuthoritative: true,\n },\n controller_address: {\n key: \"controller_address\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n nativeAuthoritative: true,\n },\n // ui state:\n home_background: {\n key: \"home_background\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n theme_preference: {\n key: \"theme_preference\",\n defaultValue: () => \"light\",\n // Force light mode - i mode is not complete yet\n // override: () => \"light\",\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n enable_phone_notifications: {\n key: \"enable_phone_notifications\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n settings_access_count: {\n key: \"settings_access_count\",\n defaultValue: () => 0,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n show_advanced_settings: {\n key: \"show_advanced_settings\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n onboarding_completed: {\n key: \"onboarding_completed\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n onboarding_live_completed: {\n key: \"onboarding_live_completed\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n onboarding_os_completed: {\n key: \"onboarding_os_completed\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n has_ever_activated_app: {\n key: \"has_ever_activated_app\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n\n // Bluetooth SDK settings:\n sensing_enabled: {\n key: \"sensing_enabled\",\n defaultValue: () => true,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n power_saving_mode: {\n key: \"power_saving_mode\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n // The Mentra App intentionally preserves Mentra Live's historical VAD-on\n // product default. Standalone public Bluetooth SDK hosts default VAD off so\n // their microphone audio remains continuous.\n voice_activity_detection_enabled: {\n key: \"voice_activity_detection_enabled\",\n defaultValue: () => true,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n // Mentra Live center-mic loudness / \"Barrier\" gate (cs_swit type 10). Opt-in.\n loudness_gate_enabled: {\n key: \"loudness_gate_enabled\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n /*\n * Mentra Live mic tuning, split in two on purpose.\n *\n * `mic_tuning_desired` is what the super user set. It persists so that\n * turning super mode off and on again does not lose the calibration, and it\n * stays out of BLUETOOTH_SETTING_KEYS so it can never reach the glasses on\n * its own. It is device-local: this is a hardware calibration aid, not\n * something that should follow an account onto another pair of glasses.\n *\n * `mic_tuning` is the effective value, derived in getBluetoothSettings as\n * `super_mode ? desired : {}`. It is the only one native ever sees. Because\n * it is not persisted and native seeds no default for it, a process that\n * connects before the engine has authorized anything can only send a reset\n * -- the super-mode guarantee is then a property of what native can hold,\n * not of which initialiser happened to run first.\n *\n * `{}` rather than null for \"no tuning\": the native store drops null writes,\n * so null would leave a previously applied value in place.\n *\n * The empty object is a stable singleton so GlassesSettingsSync's reference\n * diff does not treat every unrelated settings write as a mic_tuning change.\n */\n mic_tuning_desired: {\n key: \"mic_tuning_desired\",\n defaultValue: () => null,\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n mic_tuning: {\n key: \"mic_tuning\",\n defaultValue: () => ({}),\n writable: true,\n saveOnServer: false,\n persist: false,\n },\n always_on_status_bar: {\n key: \"always_on_status_bar\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n // Legacy cloud/mobile setting name. Locally it maps to glasses-side Voice Activity Detection.\n bypass_vad_for_debugging: {\n key: \"bypass_vad_for_debugging\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n bypass_audio_encoding_for_debugging: {\n key: \"bypass_audio_encoding_for_debugging\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n metric_system: {\n key: \"metric_system\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n twelve_hour_time: {\n key: \"twelve_hour_time\",\n defaultValue: () => true,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n enforce_local_transcription: {\n key: \"enforce_local_transcription\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n // LC3 audio quality setting (frame size in bytes)\n // 20 = 16kbps (low bandwidth), 40 = 32kbps (balanced), 60 = 48kbps (high quality)\n lc3_frame_size: {\n key: \"lc3_frame_size\",\n defaultValue: () => 60,\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n preferred_mic: {\n key: \"preferred_mic\",\n defaultValue: () => \"auto\",\n writable: true,\n indexer: (key: string) => {\n const glasses = useSettingsStore.getState().getSetting(SETTINGS.default_wearable.key)\n if (glasses) {\n return `${key}:${glasses}`\n }\n return key\n },\n saveOnServer: true,\n persist: true,\n },\n screen_disabled: {\n key: \"screen_disabled\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n // glasses settings:\n contextual_dashboard: {\n key: \"contextual_dashboard\",\n defaultValue: () => true,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n use_native_dashboard: {\n key: \"use_native_dashboard\",\n defaultValue: () => true,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n head_up_angle: {key: \"head_up_angle\", defaultValue: () => 45, writable: true, saveOnServer: true, persist: true},\n brightness: {key: \"brightness\", defaultValue: () => 50, writable: true, saveOnServer: true, persist: true},\n auto_brightness: {\n key: \"auto_brightness\",\n defaultValue: () => true,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n dashboard_height: {\n key: \"dashboard_height\",\n defaultValue: () => 4,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n dashboard_depth: {\n key: \"dashboard_depth\",\n defaultValue: () => 2,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n menu_apps: {\n key: \"menu_apps\",\n defaultValue: () => null,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n calendar_events: {\n key: \"calendar_events\",\n defaultValue: () => [],\n writable: true,\n saveOnServer: false,\n persist: false,\n },\n // button settings\n // Legacy persisted/cloud key; hardware behavior is now controlled by gallery_mode plus capture settings.\n button_mode: {key: \"button_mode\", defaultValue: () => \"photo\", writable: true, saveOnServer: true, persist: true},\n button_photo_size: {\n key: \"button_photo_size\",\n defaultValue: () => \"max\",\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n button_video_settings: {\n key: \"button_video_settings\",\n defaultValue: () => ({width: 1920, height: 1080, fps: 30}),\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n button_max_recording_time: {\n key: \"button_max_recording_time\",\n defaultValue: () => 10,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n camera_fov: {\n key: \"camera_fov\",\n defaultValue: () => ({fov: 118, roi_position: 0}),\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n media_post_processing: {\n key: \"media_post_processing\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n\n // time zone settings\n time_zone: {\n key: \"time_zone\",\n defaultValue: () => \"\",\n writable: true,\n override: () => {\n const override = useSettingsStore.getState().getSetting(SETTINGS.time_zone_override.key)\n if (override) {\n return override\n }\n return getTimeZone()\n },\n saveOnServer: true,\n persist: true,\n },\n time_zone_override: {\n key: \"time_zone_override\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n // offline applets\n offline_mode: {key: \"offline_mode\", defaultValue: () => false, writable: true, saveOnServer: true, persist: true},\n // Runtime flag: coordinator flips this on when cloud STT has failed and fallback is active.\n // Native GlassesStore watches it to gate PCM 鈫?Sherpa feeding. Not user-facing.\n local_stt_fallback_active: {\n key: \"local_stt_fallback_active\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: false,\n persist: false,\n },\n gallery_mode: {key: \"gallery_mode\", defaultValue: () => true, writable: true, saveOnServer: true, persist: true},\n gallery_sync_explained: {\n key: \"gallery_sync_explained\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n offline_camera_running: {\n key: \"offline_camera_running\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n // offline translation\n offline_translation_running: {\n key: \"offline_translation_running\",\n defaultValue: () => false,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n offline_translation_source: {\n key: \"offline_translation_source\",\n defaultValue: () => \"en\",\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n offline_translation_target: {\n key: \"offline_translation_target\",\n defaultValue: () => \"es\",\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n // button action settings\n default_button_action_enabled: {\n key: \"default_button_action_enabled\",\n defaultValue: () => true,\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n default_button_action_app: {\n key: \"default_button_action_app\",\n defaultValue: () => \"com.mentra.camera\",\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n // notifications\n notifications_blocklist: {\n key: \"notifications_blocklist\",\n defaultValue: () => [],\n writable: true,\n saveOnServer: true,\n persist: true,\n },\n // Cached required version from server - used to enforce updates even when offline\n cached_required_version: {\n key: \"cached_required_version\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n // OTA update dismissal - stores the version code user dismissed (not persisted so resets on app restart)\n dismissed_ota_version: {\n key: \"dismissed_ota_version\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: false,\n },\n // Contact email for feedback (persisted for Apple private relay users)\n contact_email: {\n key: \"contact_email\",\n defaultValue: () => \"\",\n writable: true,\n saveOnServer: false,\n persist: true,\n },\n} as const\n\nexport const OFFLINE_APPLETS: string[] = [\"com.mentra.livecaptions\", \"com.mentra.camera\"]\n\n// These settings are automatically synced to the Bluetooth SDK.\n// Keep this list hardware-facing; app/UI/cloud-only preferences should stay in JS/Crust.\nexport const BLUETOOTH_SETTING_KEYS: string[] = [\n // Bluetooth settings:\n SETTINGS.sensing_enabled.key,\n SETTINGS.power_saving_mode.key,\n SETTINGS.voice_activity_detection_enabled.key,\n SETTINGS.loudness_gate_enabled.key,\n // Effective tuning only; mic_tuning_desired deliberately stays engine-side.\n SETTINGS.mic_tuning.key,\n SETTINGS.lc3_frame_size.key,\n SETTINGS.preferred_mic.key,\n SETTINGS.screen_disabled.key,\n SETTINGS.auth_email.key,\n SETTINGS.core_token.key,\n // glasses settings:\n SETTINGS.contextual_dashboard.key,\n SETTINGS.head_up_angle.key,\n SETTINGS.brightness.key,\n SETTINGS.auto_brightness.key,\n SETTINGS.dashboard_height.key,\n SETTINGS.dashboard_depth.key,\n SETTINGS.menu_apps.key,\n SETTINGS.calendar_events.key,\n SETTINGS.use_native_dashboard.key,\n SETTINGS.twelve_hour_time.key,\n SETTINGS.metric_system.key,\n // button:\n SETTINGS.button_photo_size.key,\n // Legacy MentraLive native code reads the object form when syncing video settings.\n SETTINGS.button_video_settings.key,\n SETTINGS.button_max_recording_time.key,\n SETTINGS.camera_fov.key,\n // device / pairing:\n SETTINGS.pending_wearable.key,\n SETTINGS.default_wearable.key,\n SETTINGS.device_name.key,\n SETTINGS.device_address.key,\n SETTINGS.project_name.key,\n SETTINGS.default_controller.key,\n SETTINGS.pending_controller.key,\n SETTINGS.controller_device_name.key,\n SETTINGS.controller_address.key,\n // offline applets:\n SETTINGS.offline_mode.key,\n // Runtime flag flipped by LocalSttFallbackCoordinator. Native reads it from\n // GlassesStore to gate PCM 鈫?Sherpa feeding in handlePcm and to keep the\n // mic on while local STT is the active engine.\n SETTINGS.local_stt_fallback_active.key,\n SETTINGS.gallery_mode.key,\n // Mentra Nex feature flags:\n SETTINGS.nex_chinese_captions.key,\n SETTINGS.nex_lc3_audio_playback.key,\n]\n\n// Pairing identity is NATIVE-authoritative: the native layer writes it on\n// pairing success (handleDeviceReady) / forget and echoes it down via\n// save_setting; JS persists those echoes. JS鈫抧ative, identity travels ONLY in\n// the explicit full seeds (device-store hydration, pre-connect push,\n// post-demotion re-push) — never in the change-push subscription. Relaying an\n// echoed identity change back up would make the sync bidirectional with loop\n// gain 1: two identity values in flight (e.g. a boot demotion crossing a\n// native promotion) then chase each other through push鈫抋pply鈫抏cho鈫抪ush\n// forever, flapping the UI.\n//\n// Derived from the `nativeAuthoritative` descriptor flag (not maintained as a\n// parallel list) so the change-push exclusion in GlassesSettingsSync can't\n// drift from the setting declarations.\nexport const PAIRING_IDENTITY_KEYS: string[] = Object.values(SETTINGS)\n .filter((setting) => setting.nativeAuthoritative)\n .map((setting) => setting.key)\n\n/** Stable empty effective tuning. Native reads this as `{\"reset\":1}`. */\nconst EMPTY_MIC_TUNING: Record<string, number> = Object.freeze({})\n\n// const PER_GLASSES_SETTINGS_KEYS: string[] = [SETTINGS.preferred_mic.key]\n\nexport interface SettingsState {\n // Settings values\n settings: Record<string, any>\n // Loading states\n isInitialized: boolean\n // Actions\n setSetting: (key: string, value: any, updateServer?: boolean) => AsyncResult<void, Error>\n setManyLocally: (settings: Record<string, any>) => AsyncResult<void, Error>\n getSetting: (key: string) => any\n // loadSetting: (key: string) => AsyncResult<void, Error>\n loadAllSettings: () => AsyncResult<void, Error>\n // Utility methods\n getBluetoothSettings: () => Record<string, any>\n /**\n * The mic tuning native is allowed to send: the desired value while super\n * mode is on, `{}` (meaning \"reset to firmware defaults\") otherwise.\n */\n getEffectiveMicTuning: () => Record<string, number>\n resetAllSettingsLocally: () => void\n}\n\nconst getDefaultSettings = () =>\n Object.keys(SETTINGS).reduce((acc, key) => {\n acc[key] = SETTINGS[key].defaultValue()\n return acc\n }, {} as Record<string, any>)\n\n// Single-flight for loadAllSettings: the host fires it at module load and\n// engine.start()'s device-store hydration awaits it — without the memo the\n// second caller runs a duplicate full disk load while the first is still in\n// flight. Cleared on failure so a later call can retry.\nlet loadAllSettingsInFlight: AsyncResult<void, Error> | null = null\n\nfunction printableSettingValue(key: string, value: unknown): string {\n return key.includes(\"token\") || key.includes(\"email\") ? \"<redacted>\" : JSON.stringify(value)\n}\n\nexport const useSettingsStore = create<SettingsState>()(\n subscribeWithSelector((set, get) => ({\n settings: getDefaultSettings(),\n isInitialized: false,\n loadingKeys: new Set(),\n setSetting: (key: string, value: any, _updateServer = true): AsyncResult<void, Error> => {\n return Res.try_async(async () => {\n const setting = SETTINGS[key]\n const originalKey = key\n\n if (!setting) {\n throw new Error(`SETTINGS: SET: ${originalKey} is not a valid setting!`)\n }\n\n if (setting.indexer) {\n key = setting.indexer(originalKey)\n }\n\n if (!setting.writable) {\n throw new Error(`SETTINGS: ${originalKey} is not writable!`)\n }\n\n // Update store immediately for optimistic UI\n console.log(`SETTINGS: SET: ${key} = ${printableSettingValue(key, value)}`)\n set((state) => ({\n settings: {...state.settings, [key]: value},\n }))\n\n if (setting.persist) {\n let res = await storage.save(key, value)\n if (res.is_error()) {\n throw new Error(`SETTINGS: couldn't save setting to storage: ${res.error}`)\n }\n\n // Cloud V1 per-change server sync removed with the V1 ripout (issue\n // #3392). Settings are local-first until a V2 sync lands; the\n // saveOnServer flags are retained as intent markers for that work.\n }\n })\n },\n getSetting: (key: string) => {\n const state = get()\n const originalKey = key\n const setting = SETTINGS[originalKey]\n\n if (!setting) {\n console.error(`SETTINGS: GET: ${originalKey} is not a valid setting!`)\n return undefined\n }\n\n if (setting.override) {\n let override = setting.override()\n if (override !== undefined) {\n return override\n }\n }\n\n if (setting.indexer) {\n key = setting.indexer(originalKey)\n }\n\n // console.log(`GET SETTING: ${key} = ${state.settings[key]}`)\n\n try {\n const raw = state.settings[key] ?? SETTINGS[originalKey].defaultValue()\n return raw\n } catch (e) {\n // for dynamically created settings, we need to create a new setting in SETTINGS:\n console.log(`Failed to get setting, creating new setting:(${key}):`, e)\n SETTINGS[key] = {key: key, defaultValue: () => undefined, writable: true, saveOnServer: false, persist: true}\n return SETTINGS[key].defaultValue()\n }\n },\n // batch update many settings from the server:\n setManyLocally: (settings: Record<string, any>): AsyncResult<void, Error> => {\n return Res.try_async(async () => {\n const settingsToLoad: Record<string, any> = {}\n // if a setting should not persist, don't load it:\n for (const [key, value] of Object.entries(settings)) {\n const stg: Setting | undefined = SETTINGS[key.toLowerCase()]\n if (!stg) {\n continue\n }\n if (!stg.persist) {\n continue\n }\n settingsToLoad[key.toLowerCase()] = value\n }\n // console.log(\"SETTINGS: SET MANY LOCALLY: \", settingsToLoad)\n\n // MMKV writes are synchronous Results, not rejecting Promises. Check\n // each result before publishing the new in-memory settings.\n for (const [key, value] of Object.entries(settingsToLoad)) {\n const saved = storage.save(key, value)\n if (saved.is_error()) throw saved.error\n }\n set((state) => ({settings: {...state.settings, ...settingsToLoad}}))\n })\n },\n // loads any preferences that have been changed from the default and saved to DISK!\n loadAllSettings: (): AsyncResult<void, Error> => {\n console.log(\"SETTINGS: loadAllSettings()\")\n if (loadAllSettingsInFlight) {\n return loadAllSettingsInFlight\n }\n const inFlight = Res.try_async(async () => {\n const state = get()\n let loadedSettings: Record<string, any> = {}\n\n if (state.isInitialized) {\n return undefined\n }\n\n for (const setting of Object.values(SETTINGS)) {\n // if the settings should not persist, don't load it:\n if (!setting.persist) {\n continue\n }\n\n // load all subkeys for an indexed setting:\n if (setting?.indexer) {\n console.log(`SETTINGS: LOAD: ${setting.key} with indexer!`)\n\n let res: Result<Record<string, unknown>, Error> = storage.loadSubKeys(setting.key)\n if (res.is_error()) {\n console.log(`SETTINGS: LOAD: ${setting.key}`, res.error)\n continue\n }\n\n let subKeys: Record<string, unknown> = res.value\n console.log(`SETTINGS: LOAD: ${setting.key} subkeys are set!`, subKeys)\n loadedSettings = {...loadedSettings, ...subKeys}\n continue\n }\n\n let res = storage.load<any>(setting.key)\n if (res.is_error()) {\n console.log(`SETTINGS: LOAD: ${setting.key} is not set!`, res.error)\n // this setting isn't set from the default, so we don't load anything\n continue\n }\n // normal key:value pair:\n let value = res.value\n // res.value IS the stored value; logging value.value printed\n // \"undefined\" for every loaded setting and disguised present\n // values as missing. Redact token- and email-bearing keys: console\n // logs are uploaded in bug-report artifacts (same keys\n // diagnosticContext's SENSITIVE_SETTINGS_KEYS strips, minus an\n // import that would cycle stores <-> utils).\n console.log(`SETTINGS: LOAD: ${setting.key} = ${printableSettingValue(setting.key, value)}`)\n loadedSettings[setting.key] = value\n }\n\n // console.log(\"##############################################\")\n // console.log(loadedSettings)\n // console.log(\"##############################################\")\n\n set((state) => ({\n isInitialized: true,\n settings: {...state.settings, ...loadedSettings},\n }))\n\n // This hidden debug switch originally shipped default-off while the\n // notification-listener cold-start ANR was being investigated. Now\n // that the listener runs in its own guarded process, migrate existing\n // installs to the new default once; later explicit debug changes still\n // persist normally.\n // Reset the cloud backend override when the build's environment changes.\n //\n // cloud_core_url / cloud_runtime_url are persist:true and outrank both\n // the build's env and the compiled default (see resolveUrl in\n // cloudClient.ts). That is what we want inside one environment: a\n // developer's METRO_AUTO pin should survive a rebuild. It is wrong\n // across environments.\n //\n // The concrete case is an install that moves BETWEEN environments: an\n // internal tester running a dev build with a pinned override who then\n // installs the store build. The override outranks that build's prod\n // URLs, so without this they keep talking to dev with nothing\n // surfacing it.\n //\n // Note what this deliberately does NOT do, because the distinction is\n // easy to get backwards. TestFlight and the App Store receive the SAME\n // binary, so promotion does not change EXPO_PUBLIC_BUILD_ENV and this\n // reset never fires on it. Promotion is safe for a different reason:\n // the publishing lane bakes the selected release cloud environment, and\n // production promotes the already-tested binary. The same holds for\n // Android beta-track to production.\n //\n // The residual gap is therefore an override pinned while already on a\n // prod-labelled build, which no label comparison can see. That is a\n // deliberate limit: reaching it means typing a URL into a dev-only\n // screen, VersionInfo renders the current value, and the same screen\n // clears it.\n //\n // Comparing the baked EXPO_PUBLIC_BUILD_ENV against the last one seen\n // on this device covers those environment switches and fresh installs\n // without touching the setting write path. A reinstall needs no\n // handling: it drops the marker and the override together\n // (android:allowBackup=\"false\", and iOS deletes the container).\n const BUILD_ENV_KEY = \"settings.lastBuildEnv\"\n const buildEnv = (process.env.EXPO_PUBLIC_BUILD_ENV ?? \"dev\").trim() || \"dev\"\n const lastBuildEnv = storage.load<string>(BUILD_ENV_KEY)\n const previousBuildEnv = lastBuildEnv.is_error() ? undefined : lastBuildEnv.value\n if (previousBuildEnv !== buildEnv) {\n // Clear when there is no marker yet, not just on a recorded change.\n // The first build carrying this code meets every existing install\n // with previousBuildEnv === undefined, and those are exactly the\n // installs that may hold an override set before the pin existed --\n // the population this is here to repair. Treating \"no marker\" as a\n // fresh install would record the marker and never look again. A\n // genuinely fresh install has nothing persisted, so the clear below\n // writes each default over itself and costs nothing.\n //\n // Driven by the descriptors rather than a hardcoded key list, so a\n // setting that needs this behaviour declares it in one place and\n // cannot be missed here.\n const scoped = Object.values(SETTINGS).filter((setting) => setting.resetOnBuildEnvChange)\n console.log(\n `SETTINGS: build env ${previousBuildEnv ?? \"(none recorded)\"} -> ${buildEnv}, ` +\n `clearing ${scoped.length} build-scoped setting(s)`,\n )\n let allCleared = true\n for (const setting of scoped) {\n const cleared = await get().setSetting(setting.key, setting.defaultValue(), false)\n if (cleared.is_error()) {\n allCleared = false\n console.log(`SETTINGS: could not clear ${setting.key}:`, cleared.error)\n }\n }\n // Advance the marker only once the reset actually landed. Recording\n // it after a failed write would retire the retry and leave the stale\n // override for the life of the install; leaving it unset costs one\n // repeated attempt per launch until a write succeeds.\n if (allCleared) {\n storage.save(BUILD_ENV_KEY, buildEnv)\n }\n }\n\n // Reset existing installs once; later user/app opt-ins remain available.\n const LOUDNESS_GATE_MIGRATION_KEY = \"migration:loudness_gate_default_off_v1\"\n const loudnessGateMigrationDone = storage.load<boolean>(LOUDNESS_GATE_MIGRATION_KEY)\n if (loudnessGateMigrationDone.is_error() || !loudnessGateMigrationDone.value) {\n // updateServer: true, matching the android_blur / camera_fov migrations. The flag is\n // inert until the Cloud V2 settings sync lands, but this setting is saveOnServer, so\n // the intent recorded here is the one that should carry over.\n const result = await get().setSetting(SETTINGS.loudness_gate_enabled.key, false, true)\n if (result.is_error()) {\n console.log(\"SETTINGS: loudness gate migration failed:\", result.error)\n } else {\n storage.save(LOUDNESS_GATE_MIGRATION_KEY, true)\n }\n }\n\n const NOTIFICATION_LISTENER_MIGRATION_KEY = \"migration:android_notification_listener_default_on_v1\"\n const notificationListenerMigrationDone = storage.load<boolean>(NOTIFICATION_LISTENER_MIGRATION_KEY)\n if (notificationListenerMigrationDone.is_error() || !notificationListenerMigrationDone.value) {\n const result = await get().setSetting(SETTINGS.android_notification_listener_enabled.key, true, false)\n if (result.is_error()) {\n console.log(\"SETTINGS: notification listener migration failed:\", result.error)\n } else {\n storage.save(NOTIFICATION_LISTENER_MIGRATION_KEY, true)\n }\n }\n\n // One-time migration: force android_blur=false for existing users.\n // The setting's default is already false; this migration covers users\n // who explicitly opted into Android blur effects before we discovered\n // they're a major source of frame drops on cheap Android phones.\n // The dimezisBlurViewSdk31Plus blur each costs ~5-10ms/frame; with\n // multiple blurs on home (top fade + AppSwitcherButton x2) a low-end\n // device misses the 16ms budget consistently. Users can turn it back\n // on under Settings 鈫?Appearance once we've optimized further.\n //\n // The setSetting call also pushes to the server (saveOnServer: true)\n // so the server-stored value flips too — otherwise the next sync\n // from the user's server-stored prefs would re-enable blur.\n // Best-effort: a server failure (offline, 5xx) shouldn't block boot;\n // we still mark the migration done locally so we don't loop.\n const MIGRATION_KEY = \"migration:android_blur_default_false_v1\"\n const migrationDone = storage.load<boolean>(MIGRATION_KEY)\n if (migrationDone.is_error() || !migrationDone.value) {\n const current = get().getSetting(SETTINGS.android_blur.key)\n if (current === true) {\n const result = await get().setSetting(SETTINGS.android_blur.key, false, true)\n if (result.is_error()) {\n // Server push failed (offline / 5xx). Local storage was still\n // updated, so the user immediately gets the new behavior. The\n // server-side stale `true` will be overwritten the next time\n // the user opens Appearance settings and the auto-sync runs.\n console.log(\"SETTINGS: android_blur migration server-push failed:\", result.error)\n }\n }\n // Mark done unconditionally — even on server-push failure we don't\n // want to retry the migration on every boot. The local value is\n // already correct.\n storage.save(MIGRATION_KEY, true)\n }\n\n // The old camera default cropped the sensor to 102掳. Move existing\n // default-shaped values to the full 118掳 sensor once; named miniapp\n // requests for the 102掳 \"standard\" preset remain available.\n const CAMERA_FOV_MIGRATION_KEY = \"migration:camera_fov_full_sensor_v1\"\n const cameraFovMigrationDone = storage.load<boolean>(CAMERA_FOV_MIGRATION_KEY)\n if (cameraFovMigrationDone.is_error() || !cameraFovMigrationDone.value) {\n const current = get().getSetting(SETTINGS.camera_fov.key) as {fov?: number; roi_position?: number} | undefined\n let migrationSucceeded = true\n if (current?.fov === 102 && (current.roi_position ?? 0) === 0) {\n const result = await get().setSetting(SETTINGS.camera_fov.key, {fov: 118, roi_position: 0}, true)\n if (result.is_error()) {\n console.log(\"SETTINGS: camera FOV migration failed:\", result.error)\n migrationSucceeded = false\n }\n }\n // Unlike the blur migration above, a failed camera set may leave the\n // local value unchanged. Only mark this migration complete once the\n // desired value was applied so a transient failure retries on boot.\n if (migrationSucceeded) storage.save(CAMERA_FOV_MIGRATION_KEY, true)\n }\n })\n loadAllSettingsInFlight = inFlight\n void Promise.resolve(inFlight).then((result) => {\n if (result.is_error()) {\n loadAllSettingsInFlight = null\n }\n })\n return inFlight\n },\n getBluetoothSettings: () => {\n const state = get()\n // Device-model-filtered key set (wire v2): Mentra Live (no display) gets\n // the reduced MENTRA_LIVE_SETTING_KEYS; display glasses get the full set.\n const deviceModel = useGlassesStore.getState().deviceModel || state.getSetting(SETTINGS.default_wearable.key)\n const keys = getBluetoothSettingKeysForDevice(deviceModel, BLUETOOTH_SETTING_KEYS)\n const bluetoothSettings: Record<string, any> = {}\n for (const key of keys) {\n const value = state.getSetting(key)\n if (key === SETTINGS.core_token.key && (typeof value !== \"string\" || value.trim().length === 0)) {\n continue\n }\n if (key === SETTINGS.mic_tuning.key) {\n // Derived here rather than stored, so there is no path that can push\n // a persisted tuning to the glasses while super mode is off. Every\n // sync route (change diff, on-connect replay, full seed) reads this.\n bluetoothSettings[key] = state.getEffectiveMicTuning()\n continue\n }\n bluetoothSettings[key] = value\n }\n return bluetoothSettings\n },\n getEffectiveMicTuning: () => {\n const state = get()\n if (!state.getSetting(SETTINGS.super_mode.key)) return EMPTY_MIC_TUNING\n const desired = state.getSetting(SETTINGS.mic_tuning_desired.key)\n if (!desired || typeof desired !== \"object\") return EMPTY_MIC_TUNING\n const effective: Record<string, number> = {}\n for (const [key, value] of Object.entries(desired as Record<string, unknown>)) {\n if (typeof value === \"number\" && Number.isFinite(value)) {\n effective[key] = Math.round(value)\n }\n }\n return Object.keys(effective).length === 0 ? EMPTY_MIC_TUNING : effective\n },\n resetAllSettingsLocally: () => {\n set((_state) => ({\n settings: getDefaultSettings(),\n isInitialized: true,\n }))\n },\n })),\n)\n\nexport const useSetting = <T = any>(key: string): [T, (value: T) => AsyncResult<void, Error>] => {\n const value = useSettingsStore((state) => state.getSetting(key))\n const setSetting = useSettingsStore((state) => state.setSetting)\n const setValue = useCallback((newValue: T) => setSetting(key, newValue), [key, setSetting])\n return [value, setValue]\n}\n"]}
|
package/build/utils/pcm16.d.ts
CHANGED
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
* attributed to whatever screen happens to be up (wifi scan, home, …).
|
|
11
11
|
*/
|
|
12
12
|
export declare function pcmDataView(frame: unknown): DataView | null;
|
|
13
|
+
/** Signed 16-bit full scale. `-32768` abs-counts as 32768 and is also a rail. */
|
|
14
|
+
export declare const PCM16_FULL_SCALE = 32767;
|
|
15
|
+
/** Headroom line: loud speech that is not yet hard-clipped. */
|
|
16
|
+
export declare const PCM16_NEAR_CLIP = 30000;
|
|
13
17
|
export type Pcm16Level = {
|
|
14
18
|
/** Mean absolute sample value (16-bit scale). ~30–60 is a quiet room on Mentra Live LC3. */
|
|
15
19
|
meanAbs: number;
|
|
@@ -17,7 +21,21 @@ export type Pcm16Level = {
|
|
|
17
21
|
peak: number;
|
|
18
22
|
/** Samples counted. */
|
|
19
23
|
samples: number;
|
|
24
|
+
/** Samples at the int16 rail (`>= 32767`). */
|
|
25
|
+
clipped: number;
|
|
26
|
+
/** Samples at or above [PCM16_NEAR_CLIP]. */
|
|
27
|
+
nearClip: number;
|
|
20
28
|
};
|
|
29
|
+
export type Pcm16WindowStats = Pcm16Level & {
|
|
30
|
+
/** `peak / 32767`, percent. */
|
|
31
|
+
peakPct: number;
|
|
32
|
+
/** `clipped / samples`, percent. */
|
|
33
|
+
clipPct: number;
|
|
34
|
+
/** `nearClip / samples`, percent. */
|
|
35
|
+
nearClipPct: number;
|
|
36
|
+
};
|
|
37
|
+
/** Percentages for a closed window. Zero samples → all percents 0. */
|
|
38
|
+
export declare function pcm16WindowStats(level: Pcm16Level): Pcm16WindowStats;
|
|
21
39
|
/** Level statistics over a batch of PCM16 frames. Unreadable frames are skipped, never thrown on. */
|
|
22
40
|
export declare function summarizePcm16(frames: unknown[]): Pcm16Level;
|
|
23
41
|
/**
|
|
@@ -28,6 +46,8 @@ export declare class Pcm16LevelMeter {
|
|
|
28
46
|
private sum;
|
|
29
47
|
private peakValue;
|
|
30
48
|
private count;
|
|
49
|
+
private clipped;
|
|
50
|
+
private nearClip;
|
|
31
51
|
add(frame: unknown): void;
|
|
32
52
|
/** Read the window and start a new one. */
|
|
33
53
|
take(): Pcm16Level;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pcm16.d.ts","sourceRoot":"","sources":["../../src/utils/pcm16.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,IAAI,CAiB3D;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,4FAA4F;IAC5F,OAAO,EAAE,MAAM,CAAA;IACf,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"pcm16.d.ts","sourceRoot":"","sources":["../../src/utils/pcm16.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,IAAI,CAiB3D;AAED,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,QAAQ,CAAA;AACrC,+DAA+D;AAC/D,eAAO,MAAM,eAAe,QAAQ,CAAA;AAEpC,MAAM,MAAM,UAAU,GAAG;IACvB,4FAA4F;IAC5F,OAAO,EAAE,MAAM,CAAA;IACf,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAA;IACf,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAA;IACf,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG;IAC1C,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAA;IACf,oCAAoC;IACpC,OAAO,EAAE,MAAM,CAAA;IACf,qCAAqC;IACrC,WAAW,EAAE,MAAM,CAAA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