@glassly/engine 0.3.8-dev.977 → 0.3.8-dev.980

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.
@@ -4,6 +4,7 @@ import type {DisplayDiagnostic} from "@glassly/miniapp"
4
4
  // messages, packet bytes, or arbitrary application content to another miniapp.
5
5
  const fields = new Set([
6
6
  "v",
7
+ "device",
7
8
  "run",
8
9
  "id",
9
10
  "t",
@@ -72,10 +73,11 @@ export function collectDisplayDiagnostics(
72
73
  const seen = new Set<string>()
73
74
  for (let i = entries.length - 1; i >= 0 && records.length < 180; i--) {
74
75
  const message = entries[i].message
75
- const offset = message.indexOf("G2PERF ")
76
+ const prefix = message.includes("MEMOMINDPERF ") ? "MEMOMINDPERF " : "G2PERF "
77
+ const offset = message.indexOf(prefix)
76
78
  if (offset < 0 || message.length > 8192) continue
77
79
  try {
78
- const raw = JSON.parse(message.slice(offset + 7))
80
+ const raw = JSON.parse(message.slice(offset + prefix.length))
79
81
  if (
80
82
  !raw ||
81
83
  raw.v !== 1 ||
@@ -1680,11 +1680,11 @@ class LocalMiniappRuntime {
1680
1680
  this.handleOpenUrl(packageName, payload)
1681
1681
  break
1682
1682
  case MiniappRequestType.DISPLAY_DIAGNOSTICS: {
1683
- // The records are parsed out of the G2PERF lines, which the SDK only logs while g2_perf_logs is on.
1683
+ // The records are parsed out of the G2PERF lines, which the SDK only logs while perf_logs is on.
1684
1684
  const settings = useSettingsStore.getState()
1685
1685
  const enabled =
1686
1686
  settings.getSetting(SETTINGS.debug_console.key) === true &&
1687
- settings.getSetting(SETTINGS.g2_perf_logs.key) === true
1687
+ settings.getSetting(SETTINGS.perf_logs.key) === true
1688
1688
  this.sendResult(packageName, requestId, true, {
1689
1689
  enabled,
1690
1690
  generatedAt: Date.now(),
@@ -810,8 +810,8 @@ export const SETTINGS: Record<string, Setting> = {
810
810
  // OFF by default: they crowd out everything else in the ten-minute buffer.
811
811
  // Synced to the Bluetooth SDK, which keeps counting either way and only
812
812
  // logs while this is on. Device-local debug knob, so not saved on the server.
813
- g2_perf_logs: {
814
- key: "g2_perf_logs",
813
+ perf_logs: {
814
+ key: "perf_logs",
815
815
  defaultValue: () => false,
816
816
  writable: true,
817
817
  saveOnServer: false,
@@ -1238,7 +1238,7 @@ export const BLUETOOTH_SETTING_KEYS: string[] = [
1238
1238
  SETTINGS.calendar_events.key,
1239
1239
  SETTINGS.cfw_scene_renderer.key,
1240
1240
  SETTINGS.cfw_fast_ble.key,
1241
- SETTINGS.g2_perf_logs.key,
1241
+ SETTINGS.perf_logs.key,
1242
1242
  SETTINGS.memomind_accessory_picker.key,
1243
1243
  SETTINGS.ring_via_glasses.key,
1244
1244
  SETTINGS.display_max_fps.key,