@glassly/engine 0.3.2-dev.566 → 0.3.2-dev.573

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.
Files changed (81) hide show
  1. package/README.md +1 -1
  2. package/build/engine.d.ts +1 -1
  3. package/build/engine.d.ts.map +1 -1
  4. package/build/engine.js +3 -3
  5. package/build/engine.js.map +1 -1
  6. package/build/facades/dev.d.ts +2 -2
  7. package/build/facades/dev.d.ts.map +1 -1
  8. package/build/facades/dev.js +2 -2
  9. package/build/facades/dev.js.map +1 -1
  10. package/build/facades/reports.js +2 -2
  11. package/build/facades/reports.js.map +1 -1
  12. package/build/facades/session.d.ts +1 -1
  13. package/build/facades/session.js +2 -2
  14. package/build/facades/session.js.map +1 -1
  15. package/build/generated/releaseMetadata.js +3 -3
  16. package/build/generated/releaseMetadata.js.map +1 -1
  17. package/build/index.d.ts +1 -1
  18. package/build/index.js +1 -1
  19. package/build/index.js.map +1 -1
  20. package/build/runtime/bootstrap.d.ts +2 -2
  21. package/build/runtime/bootstrap.d.ts.map +1 -1
  22. package/build/runtime/bootstrap.js.map +1 -1
  23. package/build/services/CloudAudioSubscriptionSync.d.ts +2 -2
  24. package/build/services/CloudAudioSubscriptionSync.js +2 -2
  25. package/build/services/CloudAudioSubscriptionSync.js.map +1 -1
  26. package/build/services/CloudClientService.d.ts +2 -2
  27. package/build/services/CloudClientService.d.ts.map +1 -1
  28. package/build/services/CloudClientService.js +4 -4
  29. package/build/services/CloudClientService.js.map +1 -1
  30. package/build/services/CloudTranscriptE2EMetrics.d.ts +2 -2
  31. package/build/services/CloudTranscriptE2EMetrics.d.ts.map +1 -1
  32. package/build/services/CloudTranscriptE2EMetrics.js +3 -3
  33. package/build/services/CloudTranscriptE2EMetrics.js.map +1 -1
  34. package/build/services/LocalMiniappRuntime.d.ts +1 -1
  35. package/build/services/LocalMiniappRuntime.js +3 -3
  36. package/build/services/LocalMiniappRuntime.js.map +1 -1
  37. package/build/services/PhonePhotoCoordinator.d.ts +1 -1
  38. package/build/services/PhonePhotoCoordinator.js +4 -4
  39. package/build/services/PhonePhotoCoordinator.js.map +1 -1
  40. package/build/services/PhoneStreamCoordinator.d.ts +1 -1
  41. package/build/services/PhoneStreamCoordinator.js +1 -1
  42. package/build/services/PhoneStreamCoordinator.js.map +1 -1
  43. package/build/services/SupportProfileSync.d.ts +1 -1
  44. package/build/services/SupportProfileSync.js +2 -2
  45. package/build/services/SupportProfileSync.js.map +1 -1
  46. package/build/services/cloudStreamApi.d.ts +2 -2
  47. package/build/services/cloudStreamApi.js +2 -2
  48. package/build/services/cloudStreamApi.js.map +1 -1
  49. package/build/services/soniox/SonioxRealtimeClient.d.ts +2 -2
  50. package/build/services/soniox/SonioxRealtimeClient.js +2 -2
  51. package/build/services/soniox/SonioxRealtimeClient.js.map +1 -1
  52. package/build/services/soniox/SonioxTokenAssembler.d.ts +1 -1
  53. package/build/services/soniox/SonioxTokenAssembler.js +1 -1
  54. package/build/services/soniox/SonioxTokenAssembler.js.map +1 -1
  55. package/build/stores/cloudClientStatus.js +1 -1
  56. package/build/stores/cloudClientStatus.js.map +1 -1
  57. package/build/stores/settings.js +3 -3
  58. package/build/stores/settings.js.map +1 -1
  59. package/build/utils/cloudClient/cloudSecureStore.js +2 -2
  60. package/build/utils/cloudClient/cloudSecureStore.js.map +1 -1
  61. package/package.json +7 -7
  62. package/src/engine.ts +3 -3
  63. package/src/facades/dev.ts +2 -2
  64. package/src/facades/reports.ts +2 -2
  65. package/src/facades/session.ts +2 -2
  66. package/src/generated/releaseMetadata.ts +3 -3
  67. package/src/index.ts +1 -1
  68. package/src/runtime/bootstrap.ts +2 -2
  69. package/src/services/CloudAudioSubscriptionSync.ts +2 -2
  70. package/src/services/CloudClientService.ts +4 -4
  71. package/src/services/CloudTranscriptE2EMetrics.ts +3 -3
  72. package/src/services/LocalMiniappRuntime.ts +3 -3
  73. package/src/services/PhonePhotoCoordinator.ts +4 -4
  74. package/src/services/PhoneStreamCoordinator.ts +1 -1
  75. package/src/services/SupportProfileSync.ts +2 -2
  76. package/src/services/cloudStreamApi.ts +3 -3
  77. package/src/services/soniox/SonioxRealtimeClient.ts +2 -2
  78. package/src/services/soniox/SonioxTokenAssembler.ts +1 -1
  79. package/src/stores/cloudClientStatus.ts +1 -1
  80. package/src/stores/settings.ts +3 -3
  81. package/src/utils/cloudClient/cloudSecureStore.ts +2 -2
package/README.md CHANGED
@@ -43,7 +43,7 @@ resolve live TypeScript source):
43
43
  SDK `react`, `types`, `photo-receiver`, `ota-transport`, and `debug` subpaths are mirrored
44
44
  below this path. The SDK's `internal` entrypoint is deliberately not exposed.
45
45
 
46
- See `cloud-v2/docs/issues/020-glasses-status-boundary/integration-review.md`
46
+ See `cloud/docs/issues/020-glasses-status-boundary/integration-review.md`
47
47
  §D for the burn-down plan.
48
48
 
49
49
  This module owns the pieces of miniapp logic and handling that aren't tied to
package/build/engine.d.ts CHANGED
@@ -124,7 +124,7 @@ export declare const engine: {
124
124
  deleteModel: (_code?: string | undefined) => Promise<void>;
125
125
  };
126
126
  };
127
- /** Cloud (cloud-v2) live-session status + account ops — engine owns the client. */
127
+ /** Cloud live-session status + account ops — engine owns the client. */
128
128
  session: {
129
129
  status: () => import(".").CloudClientStatusSnapshot;
130
130
  onStatus: (cb: (status: import(".").CloudClientStatusSnapshot) => void) => (() => void);
@@ -1 +1 @@
1
- {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAC,SAAS,EAAkD,aAAa,EAAC,MAAM,qBAAqB,CAAA;AA2C5G,eAAO,MAAM,MAAM;IACjB,2EAA2E;;IAE3E,8EAA8E;;IAE9E;iDAC6C;;IA8F7C;;yCAEqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkCrC,m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AiF;;;;;;;;;;;;;;;;;;;;;;;IAEjF,8CAA8C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAE9C,uDAAuD;;;;;;;;;;;;;;;;IAEvD,8EAA8E;;;;;;;;IAE9E,qFAAqF;;;;IAErF,4EAA4E;;;;;;;;;;;IAE5E,+EAA+E;;;;;;;;;;;;IAE/E,kFAAkF;;;;;+BA9I3D,CAAC;;;+BAWtB,CAAA;;;;;;;;;;;;IAqIF,mFAAmF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGpF,CAAA"}
package/build/engine.js CHANGED
@@ -118,7 +118,7 @@ export const engine = {
118
118
  // deadline, and start() must resolve offline. The glasses get the token
119
119
  // when it lands; identity resolution joins the same single-flight exchange.
120
120
  void cloudClientService.syncCoreTokenToBluetooth().catch((error) => {
121
- console.warn("engine.start: initial Cloud V2 core token sync failed:", error instanceof Error ? error.message : error);
121
+ console.warn("engine.start: initial Cloud core token sync failed:", error instanceof Error ? error.message : error);
122
122
  });
123
123
  startSupportProfileSync();
124
124
  // Push device-setting changes to the glasses for ANY host, so
@@ -131,7 +131,7 @@ export const engine = {
131
131
  // that annotates cloud transcripts with resolved speaker identities.
132
132
  startSpeakerIdSync();
133
133
  // Android internal/e2e: laptop captions tester can broadcast a failure intent;
134
- // engine owns turning that into a Cloud V2 report.
134
+ // engine owns turning that into a Cloud report.
135
135
  startCaptionsTesterReportService();
136
136
  // JSRuntime crashloop-disabled is runtime state; engine owns filing the
137
137
  // automatic report while hosts only render alert/telemetry side effects.
@@ -185,7 +185,7 @@ export const engine = {
185
185
  },
186
186
  glasses,
187
187
  speech,
188
- /** Cloud (cloud-v2) live-session status + account ops — engine owns the client. */
188
+ /** Cloud live-session status + account ops — engine owns the client. */
189
189
  session,
190
190
  /** Typed keyed user settings over the engine-owned settings store. */
191
191
  settings,
@@ -1 +1 @@
1
- {"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;;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E,CAAC,mBAAmB,CAAC,OAAO,EAAE,CAAC,CAAA;QAC1E,MAAM,MAAM,CAAC,mBAAmB,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,CAAC,CAAA;QAC7E,MAAM,MAAM,CAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,OAAO,EAAE,CAAC,CAAA;QACxE,MAAM,MAAM,CAAC,cAAc,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,QAAQ,EAAE,CAAC,CAAA;QACjE,MAAM,MAAM,CAAC,WAAW,EAAE,aAAa,CAAC,CAAA;IAC1C,CAAC;IACD,OAAO;IACP,MAAM;IACN,mFAAmF;IACnF,OAAO;IACP,sEAAsE;IACtE,QAAQ;IACR,qFAAqF;IACrF,GAAG;IACH,qEAAqE;IACrE,OAAO;IACP,sFAAsF;IACtF,GAAG;IACH,6EAA6E;IAC7E,OAAO;IACP,iFAAiF;IACjF,QAAQ;IACR,8CAA8C;IAC9C,OAAO;IACP,uDAAuD;IACvD,kBAAkB;IAClB,8EAA8E;IAC9E,WAAW;IACX,qFAAqF;IACrF,aAAa;IACb,4EAA4E;IAC5E,IAAI;IACJ,+EAA+E;IAC/E,MAAM;IACN,kFAAkF;IAClF,QAAQ;IACR,mFAAmF;IACnF,YAAY;IACZ,OAAO;CACR,CAAA","sourcesContent":["/**\n * `engine` — the namespaced OEM-facing engine API (the \"(A) host API\" from the\n * Phase-1 contract). Host UI calls `engine.<domain>.<method>()`; each domain is a\n * typed facade over the runtime. (Exported from the `@glassly/engine` module, whose\n * name stays `engine` in code; the public API surface is `engine`.)\n *\n * It grows one facade at a time. The migration-era flat store/service exports\n * remain in a private Glassly host package; they shrink as screens move onto\n * `engine.*`.\n */\nimport {configure, start as bootstrapStart, stop as bootstrapStop, updateUiSeams} from \"./runtime/bootstrap\"\nimport {cloudClientService} from \"./services/CloudClientService\"\nimport {hydrateDeviceStore, demoteOrphanedDefaultWearable} from \"./services/DeviceStoreHydration\"\nimport {startPairedGlassesLatch, stopPairedGlassesLatch} from \"./services/PairedGlassesLatch\"\nimport {startMiniappPauseCoordinator, stopMiniappPauseCoordinator} from \"./services/MiniappPauseCoordinator\"\nimport {startGlassesSettingsSync, stopGlassesSettingsSync} from \"./services/GlassesSettingsSync\"\nimport {startGlassesStatusProjection, stopGlassesStatusProjection} from \"./services/GlassesStatusProjection\"\nimport {startOtaService, stopOtaService} from \"./services/OtaService\"\nimport {startAudioCloudUplink, stopAudioCloudUplink} from \"./services/AudioCloudUplink\"\nimport sonioxDirectService from \"./services/soniox/SonioxDirectService\"\nimport {startSupportProfileSync, stopSupportProfileSync} from \"./services/SupportProfileSync\"\nimport {startDeviceEventRouter, stopDeviceEventRouter} from \"./services/DeviceEventRouter\"\nimport {startPhoneActivityTracking, stopPhoneActivityTracking} from \"./services/PhoneActivity\"\nimport {startPhoneNotificationsSync, stopPhoneNotificationsSync} from \"./services/PhoneNotificationsSync\"\nimport {startSpeakerIdSync, stopSpeakerIdSync} from \"./services/SpeakerIdSync\"\nimport {startCaptionsTesterReportService, stopCaptionsTesterReportService} from \"./services/CaptionsTesterReportService\"\nimport {startJSCrashloopReportService, stopJSCrashloopReportService} from \"./services/JSCrashloopReportService\"\nimport {ensureMiniappEngine, stopMiniappEngine} from \"./services/MiniappEngine\"\nimport localMiniappRuntime from \"./services/LocalMiniappRuntime\"\nimport displayProcessor from \"./services/DisplayProcessor\"\nimport {gallerySyncService} from \"./services/asg/gallerySyncService\"\nimport {glasses} from \"./facades/glasses\"\nimport {display} from \"./facades/display\"\nimport {speech} from \"./facades/speech\"\nimport {session} from \"./facades/session\"\nimport {settings} from \"./facades/settings\"\nimport {dev} from \"./facades/dev\"\nimport {reports} from \"./facades/reports\"\nimport {ota} from \"./facades/ota\"\nimport {gallery} from \"./facades/gallery\"\nimport {miniapps} from \"./facades/miniapps\"\nimport {pairing} from \"./facades/pairing\"\nimport {phoneNotifications} from \"./facades/phoneNotifications\"\nimport {permissions} from \"./facades/permissions\"\nimport {notifications} from \"./facades/notifications\"\nimport {maps} from \"./facades/maps\"\nimport {memory} from \"./facades/memory\"\nimport {speakers} from \"./facades/speakers\"\nimport {providerKeys} from \"./facades/providerKeys\"\nimport {logBuffer} from \"./utils/devLogging\"\nimport pageHost from \"./services/pages/PageHost\"\nimport gestureDotsService from \"./services/GestureDotsService\"\n\nexport const engine = {\n /** Front door — hand engine auth + config, then start/stop the runtime. */\n configure,\n /** Merge host-UI seams on a running runtime (scan overlay, wifi setup, …). */\n updateUiSeams,\n /** Start the runtime: mark started + construct/connect the cloud client + begin\n * syncing device settings to the glasses. */\n async start() {\n // Reports attach recent phone logs, so engine owns console interception for\n // OEM hosts too. Idempotent; the Glassly host may start it earlier.\n logBuffer.startConsoleInterception()\n await bootstrapStart()\n // Construct + connect the cloud client so the documented configure()+start()\n // lifecycle yields a live engine.session for OEMs. Idempotent for repeated\n // start() calls.\n cloudClientService.init()\n // Project native device status -> the engine stores (the inbound feed the rest\n // of the runtime reads). Established first so the stores are live before the\n // syncs below react to them.\n startGlassesStatusProjection((changed) => localMiniappRuntime.forwardEvent(\"glasses_connection_state\", changed))\n // Lock + foreground state, read by the dashboard's notification gate and\n // the G2 notification ctrl below; up before either consumer.\n startPhoneActivityTracking()\n // The overlay slot's owner: the designated dashboard miniapp's page shows\n // through it (ADR-0006), so it is up before the miniapp runtime.\n pageHost.start()\n gestureDotsService.start()\n // Route the rest of the inbound device events (wifi/hotspot/gallery -> stores+bus,\n // photo/stream -> coordinators, button/touch/accel/head -> miniapps, save_setting ->\n // store, miniapp_selected -> launcher) so a bare OEM gets device data, not just the\n // Glassly app's MantleManager.\n startDeviceEventRouter()\n // Hydration contract: the native DeviceStore is in-memory and starts empty\n // every launch; seed it from the persisted settings BEFORE start() resolves\n // so every post-start getDefaultDevice() read is a trustworthy two-state\n // answer (no false \"absent\" for genuinely-paired users at cold start).\n // Ordered before startGlassesSettingsSync so the settings load can't\n // double-push through the change subscription. A failed hydration must not\n // brick the runtime: start() continues, and the guards that consume\n // hasDefaultDevice() see the rejection and fail open.\n try {\n await hydrateDeviceStore()\n // Boot repair: a persisted default_wearable without a native default\n // device (identity abandoned mid-pairing, or resurrected from the server\n // before identity stopped syncing) demotes to pending_wearable so hosts\n // render finish-pairing instead of a connect that would throw.\n await demoteOrphanedDefaultWearable()\n } catch (error) {\n console.warn(\"engine.start: device-store hydration failed:\", error instanceof Error ? error.message : error)\n }\n // After the settings load so an already-paired phone latches on this start.\n startPairedGlassesLatch()\n // Pause local miniapps while the paired glasses stay disconnected. Reads\n // the pairing identity, so after the settings load like the latch.\n startMiniappPauseCoordinator()\n // Project the glasses' OTA events into the store for the engine.ota read surface.\n startOtaService()\n // Forward glasses mic_lc3 frames to the v2 cloud session so cloud transcription\n // works for any host (not just the Glassly app's host-side MantleManager fork).\n startAudioCloudUplink()\n // Phone -> Soniox direct transcription (user-supplied API key). Started\n // after device-store hydration so the persisted key is already loaded.\n sonioxDirectService.start()\n // Not awaited: the exchange behind it is a Core round trip with no client\n // deadline, and start() must resolve offline. The glasses get the token\n // when it lands; identity resolution joins the same single-flight exchange.\n void cloudClientService.syncCoreTokenToBluetooth().catch((error) => {\n console.warn(\n \"engine.start: initial Cloud V2 core token sync failed:\",\n error instanceof Error ? error.message : error,\n )\n })\n startSupportProfileSync()\n // Push device-setting changes to the glasses for ANY host, so\n // engine.glasses.settings.set() reaches the device (not just the Glassly app).\n startGlassesSettingsSync()\n // Same for phone-notification config -> the native listener (Android).\n startPhoneNotificationsSync()\n // On-device speaker identification: sync the enabled setting + enrolled\n // profile centroids to the native SpeakerIdEngine, and start the resolver\n // that annotates cloud transcripts with resolved speaker identities.\n startSpeakerIdSync()\n // Android internal/e2e: laptop captions tester can broadcast a failure intent;\n // engine owns turning that into a Cloud V2 report.\n startCaptionsTesterReportService()\n // JSRuntime crashloop-disabled is runtime state; engine owns filing the\n // automatic report while hosts only render alert/telemetry side effects.\n startJSCrashloopReportService()\n // Bring up the local-miniapp engine so a bare OEM can run JSRuntime miniapps:\n // the LocalMiniappRuntime (registry + WebView bridge), the JSRuntime router\n // (crust-bound spawn/dispatch pump + launcher wiring), the DisplayProcessor\n // (layout arbitration over the engine stores), and the gallery-sync service.\n // All idempotent — when the Glassly app's host bootstrap also calls these, the\n // second call is a no-op. Host-only crashloop telemetry is attached\n // separately by the Glassly app.\n localMiniappRuntime.initialize()\n ensureMiniappEngine()\n displayProcessor.attachToRuntime()\n gallerySyncService.initialize()\n },\n /** Stop the runtime: tear down the settings sync + cloud client + mark stopped.\n * Each step is guarded so one failing teardown can't skip the rest and leak\n * the remaining runtime services. */\n async stop() {\n const safely = async (label: string, step: () => unknown): Promise<void> => {\n try {\n await step()\n } catch (error) {\n console.warn(`engine.stop: ${label} failed:`, error)\n }\n }\n await safely(\"glasses settings sync\", stopGlassesSettingsSync)\n await safely(\"paired glasses latch\", stopPairedGlassesLatch)\n await safely(\"miniapp pause coordinator\", stopMiniappPauseCoordinator)\n await safely(\"glasses status projection\", stopGlassesStatusProjection)\n await safely(\"device event router\", stopDeviceEventRouter)\n await safely(\"page host\", () => pageHost.stop())\n await safely(\"gesture dots service\", () => gestureDotsService.stop())\n await safely(\"ota service\", stopOtaService)\n await safely(\"audio cloud uplink\", stopAudioCloudUplink)\n await safely(\"soniox direct service\", () => sonioxDirectService.stop())\n await safely(\"support profile sync\", stopSupportProfileSync)\n await safely(\"phone notifications sync\", stopPhoneNotificationsSync)\n await safely(\"phone activity tracking\", stopPhoneActivityTracking)\n await safely(\"speaker id sync\", stopSpeakerIdSync)\n await safely(\"captions tester report service\", stopCaptionsTesterReportService)\n await safely(\"js crashloop report service\", stopJSCrashloopReportService)\n await safely(\"miniapp engine\", stopMiniappEngine)\n await safely(\"local miniapp runtime\", () => localMiniappRuntime.cleanup())\n await safely(\"display processor\", () => displayProcessor.detachFromRuntime())\n await safely(\"gallery sync service\", () => gallerySyncService.cleanup())\n await safely(\"cloud client\", () => cloudClientService.shutdown())\n await safely(\"bootstrap\", bootstrapStop)\n },\n glasses,\n speech,\n /** Cloud (cloud-v2) live-session status + account ops — engine owns the client. */\n session,\n /** Typed keyed user settings over the engine-owned settings store. */\n settings,\n /** Developer/debug surface (backend+cloud URL overrides, reconnect, min version). */\n dev,\n /** Bug-report, automatic runtime report, and feedback submission. */\n reports,\n /** Firmware OTA read/observe surface (updateAvailable/status + on* subscriptions). */\n ota,\n /** Gallery sync: status/onStatus · onNotice (host renders) · sync/cancel. */\n gallery,\n /** Miniapp lifecycle (the WebView bridge primitives are exported separately). */\n miniapps,\n /** First-time glasses discovery + pairing. */\n pairing,\n /** Phone→glasses notification forwarding (Android). */\n phoneNotifications,\n /** OS permissions (check/request/openSettings + per-miniapp requirements). */\n permissions,\n /** Inbound alerts engine→host (crashloop, version-incompatible, connection loss). */\n notifications,\n /** Maps providers — user-supplied Mapbox access token (Settings > Keys). */\n maps,\n /** Shared user-scoped memory timeline (Settings > Memory + session.memory). */\n memory,\n /** Device-local voice profiles for on-device speaker ID (Settings > Speakers). */\n speakers,\n /** AI/voice provider key validation — user-supplied keys (Settings > API Keys). */\n providerKeys,\n display,\n}\n"]}
1
+ {"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAC,SAAS,EAAE,KAAK,IAAI,cAAc,EAAE,IAAI,IAAI,aAAa,EAAE,aAAa,EAAC,MAAM,qBAAqB,CAAA;AAC5G,OAAO,EAAC,kBAAkB,EAAC,MAAM,+BAA+B,CAAA;AAChE,OAAO,EAAC,kBAAkB,EAAE,6BAA6B,EAAC,MAAM,iCAAiC,CAAA;AACjG,OAAO,EAAC,uBAAuB,EAAE,sBAAsB,EAAC,MAAM,+BAA+B,CAAA;AAC7F,OAAO,EAAC,4BAA4B,EAAE,2BAA2B,EAAC,MAAM,oCAAoC,CAAA;AAC5G,OAAO,EAAC,wBAAwB,EAAE,uBAAuB,EAAC,MAAM,gCAAgC,CAAA;AAChG,OAAO,E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AAsE;IACtE,QAAQ;IACR,qFAAqF;IACrF,GAAG;IACH,qEAAqE;IACrE,OAAO;IACP,sFAAsF;IACtF,GAAG;IACH,6EAA6E;IAC7E,OAAO;IACP,iFAAiF;IACjF,QAAQ;IACR,8CAA8C;IAC9C,OAAO;IACP,uDAAuD;IACvD,kBAAkB;IAClB,8EAA8E;IAC9E,WAAW;IACX,qFAAqF;IACrF,aAAa;IACb,4EAA4E;IAC5E,IAAI;IACJ,+EAA+E;IAC/E,MAAM;IACN,kFAAkF;IAClF,QAAQ;IACR,mFAAmF;IACnF,YAAY;IACZ,OAAO;CACR,CAAA","sourcesContent":["/**\n * `engine` — the namespaced OEM-facing engine API (the \"(A) host API\" from the\n * Phase-1 contract). Host UI calls `engine.<domain>.<method>()`; each domain is a\n * typed facade over the runtime. (Exported from the `@glassly/engine` module, whose\n * name stays `engine` in code; the public API surface is `engine`.)\n *\n * It grows one facade at a time. The migration-era flat store/service exports\n * remain in a private Glassly host package; they shrink as screens move onto\n * `engine.*`.\n */\nimport {configure, start as bootstrapStart, stop as bootstrapStop, updateUiSeams} from \"./runtime/bootstrap\"\nimport {cloudClientService} from \"./services/CloudClientService\"\nimport {hydrateDeviceStore, demoteOrphanedDefaultWearable} from \"./services/DeviceStoreHydration\"\nimport {startPairedGlassesLatch, stopPairedGlassesLatch} from \"./services/PairedGlassesLatch\"\nimport {startMiniappPauseCoordinator, stopMiniappPauseCoordinator} from \"./services/MiniappPauseCoordinator\"\nimport {startGlassesSettingsSync, stopGlassesSettingsSync} from \"./services/GlassesSettingsSync\"\nimport {startGlassesStatusProjection, stopGlassesStatusProjection} from \"./services/GlassesStatusProjection\"\nimport {startOtaService, stopOtaService} from \"./services/OtaService\"\nimport {startAudioCloudUplink, stopAudioCloudUplink} from \"./services/AudioCloudUplink\"\nimport sonioxDirectService from \"./services/soniox/SonioxDirectService\"\nimport {startSupportProfileSync, stopSupportProfileSync} from \"./services/SupportProfileSync\"\nimport {startDeviceEventRouter, stopDeviceEventRouter} from \"./services/DeviceEventRouter\"\nimport {startPhoneActivityTracking, stopPhoneActivityTracking} from \"./services/PhoneActivity\"\nimport {startPhoneNotificationsSync, stopPhoneNotificationsSync} from \"./services/PhoneNotificationsSync\"\nimport {startSpeakerIdSync, stopSpeakerIdSync} from \"./services/SpeakerIdSync\"\nimport {startCaptionsTesterReportService, stopCaptionsTesterReportService} from \"./services/CaptionsTesterReportService\"\nimport {startJSCrashloopReportService, stopJSCrashloopReportService} from \"./services/JSCrashloopReportService\"\nimport {ensureMiniappEngine, stopMiniappEngine} from \"./services/MiniappEngine\"\nimport localMiniappRuntime from \"./services/LocalMiniappRuntime\"\nimport displayProcessor from \"./services/DisplayProcessor\"\nimport {gallerySyncService} from \"./services/asg/gallerySyncService\"\nimport {glasses} from \"./facades/glasses\"\nimport {display} from \"./facades/display\"\nimport {speech} from \"./facades/speech\"\nimport {session} from \"./facades/session\"\nimport {settings} from \"./facades/settings\"\nimport {dev} from \"./facades/dev\"\nimport {reports} from \"./facades/reports\"\nimport {ota} from \"./facades/ota\"\nimport {gallery} from \"./facades/gallery\"\nimport {miniapps} from \"./facades/miniapps\"\nimport {pairing} from \"./facades/pairing\"\nimport {phoneNotifications} from \"./facades/phoneNotifications\"\nimport {permissions} from \"./facades/permissions\"\nimport {notifications} from \"./facades/notifications\"\nimport {maps} from \"./facades/maps\"\nimport {memory} from \"./facades/memory\"\nimport {speakers} from \"./facades/speakers\"\nimport {providerKeys} from \"./facades/providerKeys\"\nimport {logBuffer} from \"./utils/devLogging\"\nimport pageHost from \"./services/pages/PageHost\"\nimport gestureDotsService from \"./services/GestureDotsService\"\n\nexport const engine = {\n /** Front door — hand engine auth + config, then start/stop the runtime. */\n configure,\n /** Merge host-UI seams on a running runtime (scan overlay, wifi setup, …). */\n updateUiSeams,\n /** Start the runtime: mark started + construct/connect the cloud client + begin\n * syncing device settings to the glasses. */\n async start() {\n // Reports attach recent phone logs, so engine owns console interception for\n // OEM hosts too. Idempotent; the Glassly host may start it earlier.\n logBuffer.startConsoleInterception()\n await bootstrapStart()\n // Construct + connect the cloud client so the documented configure()+start()\n // lifecycle yields a live engine.session for OEMs. Idempotent for repeated\n // start() calls.\n cloudClientService.init()\n // Project native device status -> the engine stores (the inbound feed the rest\n // of the runtime reads). Established first so the stores are live before the\n // syncs below react to them.\n startGlassesStatusProjection((changed) => localMiniappRuntime.forwardEvent(\"glasses_connection_state\", changed))\n // Lock + foreground state, read by the dashboard's notification gate and\n // the G2 notification ctrl below; up before either consumer.\n startPhoneActivityTracking()\n // The overlay slot's owner: the designated dashboard miniapp's page shows\n // through it (ADR-0006), so it is up before the miniapp runtime.\n pageHost.start()\n gestureDotsService.start()\n // Route the rest of the inbound device events (wifi/hotspot/gallery -> stores+bus,\n // photo/stream -> coordinators, button/touch/accel/head -> miniapps, save_setting ->\n // store, miniapp_selected -> launcher) so a bare OEM gets device data, not just the\n // Glassly app's MantleManager.\n startDeviceEventRouter()\n // Hydration contract: the native DeviceStore is in-memory and starts empty\n // every launch; seed it from the persisted settings BEFORE start() resolves\n // so every post-start getDefaultDevice() read is a trustworthy two-state\n // answer (no false \"absent\" for genuinely-paired users at cold start).\n // Ordered before startGlassesSettingsSync so the settings load can't\n // double-push through the change subscription. A failed hydration must not\n // brick the runtime: start() continues, and the guards that consume\n // hasDefaultDevice() see the rejection and fail open.\n try {\n await hydrateDeviceStore()\n // Boot repair: a persisted default_wearable without a native default\n // device (identity abandoned mid-pairing, or resurrected from the server\n // before identity stopped syncing) demotes to pending_wearable so hosts\n // render finish-pairing instead of a connect that would throw.\n await demoteOrphanedDefaultWearable()\n } catch (error) {\n console.warn(\"engine.start: device-store hydration failed:\", error instanceof Error ? error.message : error)\n }\n // After the settings load so an already-paired phone latches on this start.\n startPairedGlassesLatch()\n // Pause local miniapps while the paired glasses stay disconnected. Reads\n // the pairing identity, so after the settings load like the latch.\n startMiniappPauseCoordinator()\n // Project the glasses' OTA events into the store for the engine.ota read surface.\n startOtaService()\n // Forward glasses mic_lc3 frames to the v2 cloud session so cloud transcription\n // works for any host (not just the Glassly app's host-side MantleManager fork).\n startAudioCloudUplink()\n // Phone -> Soniox direct transcription (user-supplied API key). Started\n // after device-store hydration so the persisted key is already loaded.\n sonioxDirectService.start()\n // Not awaited: the exchange behind it is a Core round trip with no client\n // deadline, and start() must resolve offline. The glasses get the token\n // when it lands; identity resolution joins the same single-flight exchange.\n void cloudClientService.syncCoreTokenToBluetooth().catch((error) => {\n console.warn(\n \"engine.start: initial Cloud core token sync failed:\",\n error instanceof Error ? error.message : error,\n )\n })\n startSupportProfileSync()\n // Push device-setting changes to the glasses for ANY host, so\n // engine.glasses.settings.set() reaches the device (not just the Glassly app).\n startGlassesSettingsSync()\n // Same for phone-notification config -> the native listener (Android).\n startPhoneNotificationsSync()\n // On-device speaker identification: sync the enabled setting + enrolled\n // profile centroids to the native SpeakerIdEngine, and start the resolver\n // that annotates cloud transcripts with resolved speaker identities.\n startSpeakerIdSync()\n // Android internal/e2e: laptop captions tester can broadcast a failure intent;\n // engine owns turning that into a Cloud report.\n startCaptionsTesterReportService()\n // JSRuntime crashloop-disabled is runtime state; engine owns filing the\n // automatic report while hosts only render alert/telemetry side effects.\n startJSCrashloopReportService()\n // Bring up the local-miniapp engine so a bare OEM can run JSRuntime miniapps:\n // the LocalMiniappRuntime (registry + WebView bridge), the JSRuntime router\n // (crust-bound spawn/dispatch pump + launcher wiring), the DisplayProcessor\n // (layout arbitration over the engine stores), and the gallery-sync service.\n // All idempotent — when the Glassly app's host bootstrap also calls these, the\n // second call is a no-op. Host-only crashloop telemetry is attached\n // separately by the Glassly app.\n localMiniappRuntime.initialize()\n ensureMiniappEngine()\n displayProcessor.attachToRuntime()\n gallerySyncService.initialize()\n },\n /** Stop the runtime: tear down the settings sync + cloud client + mark stopped.\n * Each step is guarded so one failing teardown can't skip the rest and leak\n * the remaining runtime services. */\n async stop() {\n const safely = async (label: string, step: () => unknown): Promise<void> => {\n try {\n await step()\n } catch (error) {\n console.warn(`engine.stop: ${label} failed:`, error)\n }\n }\n await safely(\"glasses settings sync\", stopGlassesSettingsSync)\n await safely(\"paired glasses latch\", stopPairedGlassesLatch)\n await safely(\"miniapp pause coordinator\", stopMiniappPauseCoordinator)\n await safely(\"glasses status projection\", stopGlassesStatusProjection)\n await safely(\"device event router\", stopDeviceEventRouter)\n await safely(\"page host\", () => pageHost.stop())\n await safely(\"gesture dots service\", () => gestureDotsService.stop())\n await safely(\"ota service\", stopOtaService)\n await safely(\"audio cloud uplink\", stopAudioCloudUplink)\n await safely(\"soniox direct service\", () => sonioxDirectService.stop())\n await safely(\"support profile sync\", stopSupportProfileSync)\n await safely(\"phone notifications sync\", stopPhoneNotificationsSync)\n await safely(\"phone activity tracking\", stopPhoneActivityTracking)\n await safely(\"speaker id sync\", stopSpeakerIdSync)\n await safely(\"captions tester report service\", stopCaptionsTesterReportService)\n await safely(\"js crashloop report service\", stopJSCrashloopReportService)\n await safely(\"miniapp engine\", stopMiniappEngine)\n await safely(\"local miniapp runtime\", () => localMiniappRuntime.cleanup())\n await safely(\"display processor\", () => displayProcessor.detachFromRuntime())\n await safely(\"gallery sync service\", () => gallerySyncService.cleanup())\n await safely(\"cloud client\", () => cloudClientService.shutdown())\n await safely(\"bootstrap\", bootstrapStop)\n },\n glasses,\n speech,\n /** Cloud live-session status + account ops — engine owns the client. */\n session,\n /** Typed keyed user settings over the engine-owned settings store. */\n settings,\n /** Developer/debug surface (backend+cloud URL overrides, reconnect, min version). */\n dev,\n /** Bug-report, automatic runtime report, and feedback submission. */\n reports,\n /** Firmware OTA read/observe surface (updateAvailable/status + on* subscriptions). */\n ota,\n /** Gallery sync: status/onStatus · onNotice (host renders) · sync/cancel. */\n gallery,\n /** Miniapp lifecycle (the WebView bridge primitives are exported separately). */\n miniapps,\n /** First-time glasses discovery + pairing. */\n pairing,\n /** Phone→glasses notification forwarding (Android). */\n phoneNotifications,\n /** OS permissions (check/request/openSettings + per-miniapp requirements). */\n permissions,\n /** Inbound alerts engine→host (crashloop, version-incompatible, connection loss). */\n notifications,\n /** Maps providers — user-supplied Mapbox access token (Settings > Keys). */\n maps,\n /** Shared user-scoped memory timeline (Settings > Memory + session.memory). */\n memory,\n /** Device-local voice profiles for on-device speaker ID (Settings > Speakers). */\n speakers,\n /** AI/voice provider key validation — user-supplied keys (Settings > API Keys). */\n providerKeys,\n display,\n}\n"]}
@@ -27,12 +27,12 @@ export type DevRuntimeStatusSnapshot = ReturnType<typeof projectRuntimeStatus>;
27
27
  export declare const dev: {
28
28
  /** Inject a glasses gesture through the normal dashboard/miniapp input policy. */
29
29
  sendGesture: typeof sendGesture;
30
- /** The cloud-v2 core/runtime URL overrides. */
30
+ /** The cloud core/runtime URL overrides. */
31
31
  cloudUrls: () => {
32
32
  core?: string;
33
33
  runtime?: string;
34
34
  };
35
- /** Override the cloud-v2 URLs and reconnect the live client onto them. */
35
+ /** Override the cloud URLs and reconnect the live client onto them. */
36
36
  setCloudUrls: (urls: {
37
37
  core?: string;
38
38
  runtime?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/facades/dev.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAC,WAAW,EAAC,MAAM,+BAA+B,CAAA;AACzD,OAA2B,EAAC,KAAK,mBAAmB,EAAC,MAAM,sCAAsC,CAAA;AA2CjG,iBAAS,oBAAoB;;;;;;;;;;;;;;;;;;;;;;EAuB5B;AAED,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAE9E,eAAO,MAAM,GAAG;IACd,kFAAkF;;IAElF,+CAA+C;qBAChC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAC;IAIhD,0EAA0E;yBACrD;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAC;IAkBtD,8EAA8E;0BAC1D,IAAI;IAExB,iFAAiF;uB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0BAEI,MAAM,SACJ,MAAM,KACZ,OAAO,CAAC;QAAC,EAAE,EAAE,IAAI,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,GAAG;QAAC,EAAE,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC;IA6CtF,qEAAqE;yBAClD,wBAAwB;IAE3C,gFAAgF;0BAC1D,CAAC,MAAM,EAAE,wBAAwB,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC;IAqB/E;;;OAGG;+BACwB,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC;CAChF,CAAA"}
@@ -86,12 +86,12 @@ function projectRuntimeStatus() {
86
86
  export const dev = {
87
87
  /** Inject a glasses gesture through the normal dashboard/miniapp input policy. */
88
88
  sendGesture,
89
- /** The cloud-v2 core/runtime URL overrides. */
89
+ /** The cloud core/runtime URL overrides. */
90
90
  cloudUrls: () => {
91
91
  const s = useSettingsStore.getState();
92
92
  return { core: s.getSetting(SETTINGS.cloud_core_url.key), runtime: s.getSetting(SETTINGS.cloud_runtime_url.key) };
93
93
  },
94
- /** Override the cloud-v2 URLs and reconnect the live client onto them. */
94
+ /** Override the cloud URLs and reconnect the live client onto them. */
95
95
  setCloudUrls: (urls) => {
96
96
  const next = { ...currentCloudUrlOverrides(), ...urls };
97
97
  const resolved = resolveCloudUrlReconnectTarget(next);
@@ -1 +1 @@
1
- {"version":3,"file":"dev.js","sourceRoot":"","sources":["../../src/facades/dev.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,YAAY,MAAM,iCAAiC,CAAA;AAC1D,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAC,yBAAyB,EAAC,MAAM,6BAA6B,CAAA;AACrE,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAA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AG;YACpB,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC;YAC9B,eAAe,CAAC,SAAS,CAAC,MAAM,CAAC;YACjC,kBAAkB,CAAC,SAAS,CAAC,MAAM,CAAC;YACpC,yBAAyB,CAAC,SAAS,CAAC,MAAM,CAAC;YAC3C,0BAA0B,CAAC,SAAS,CAAC,MAAM,CAAC;SAC7C,CAAA;QACD,OAAO,GAAG,EAAE;YACV,aAAa,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,EAAE,CAAC,CAAA;QACvD,CAAC,CAAA;IACH,CAAC;IAED;;;OAGG;IACH,oBAAoB,EAAE,CAAC,EAAyC,EAAgB,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC;CACnH,CAAA","sourcesContent":["/**\n * dev facade — `engine.dev`: developer/debug surface over engine-owned state.\n * Backend/cloud URL overrides read+write the engine settings store; the cloud\n * URL setters reconnect the engine-owned cloud client onto the new endpoints;\n *\n * NOTE: the dev-time endpoint *resolution* (Metro-host auto-detect, env defaults)\n * still lives host-side in `@/services/cloudClient` during the migration; this\n * facade manages the explicit overrides + reconnect.\n */\nimport BluetoothSdk from \"@glassly/bluetooth-sdk/internal\"\nimport {isGlassesReady} from \"../services/GlassesReadiness\"\nimport {useCloudClientStatusStore} from \"../stores/cloudClientStatus\"\nimport {useConnectionStore} from \"../stores/connection\"\nimport {useCoreStore} from \"../stores/core\"\nimport {useGlassesStore} from \"../stores/glasses\"\nimport {useSettingsStore, SETTINGS} from \"../stores/settings\"\nimport {useTranscriptionDebugStore} from \"../stores/transcriptionDebug\"\nimport {cloudClientService} from \"../services/CloudClientService\"\nimport {getConfigValues} from \"../runtime/bootstrap\"\nimport {decideDevLaunchRoute} from \"../utils/devMiniappLaunch\"\nimport {deriveDevPackageId, registerDevApp, DEV_APP_PACKAGE_NAME, type DevAppRecord} from \"../services/AppRegistry\"\nimport {useAppStatusStore} from \"../stores/apps\"\nimport {sendGesture} from \"../services/GlassesTouchInput\"\nimport dashboardOpenTrace, {type DashboardOpenReport} from \"../services/debug/DashboardOpenTrace\"\n\ntype CloudUrlOverrides = {core?: string; runtime?: string}\n\n/**\n * Reconnect the cloud client onto the current cloud-URL overrides. Explicit\n * partial overrides merge over the boot-resolved config (which carries the\n * host's Metro/env URL resolution); both empty clears the live override.\n */\nfunction applyCloudUrlReconnect(urls: CloudUrlOverrides = currentCloudUrlOverrides()): void {\n const resolved = resolveCloudUrlReconnectTarget(urls)\n if (resolved === undefined) {\n cloudClientService.reconnect(null)\n } else if (resolved) {\n cloudClientService.reconnect(resolved)\n } else {\n console.warn(\"engine.dev.setCloudUrls: partial cloud override missing boot-resolved sibling endpoint\")\n }\n}\n\nfunction currentCloudUrlOverrides(): CloudUrlOverrides {\n const s = useSettingsStore.getState()\n return {\n core: trimSetting(s.getSetting(SETTINGS.cloud_core_url.key)),\n runtime: trimSetting(s.getSetting(SETTINGS.cloud_runtime_url.key)),\n }\n}\n\nfunction resolveCloudUrlReconnectTarget(urls: CloudUrlOverrides): {core: string; runtime: string} | null | undefined {\n const core = trimSetting(urls.core)\n const runtime = trimSetting(urls.runtime)\n if (!core && !runtime) return undefined\n\n const config = getConfigValues()\n const resolvedCore = core || config.coreUrl?.trim()\n const resolvedRuntime = runtime || config.runtimeUrl?.trim()\n return resolvedCore && resolvedRuntime ? {core: resolvedCore, runtime: resolvedRuntime} : null\n}\n\nfunction trimSetting(value: unknown): string | undefined {\n return typeof value === \"string\" && value.trim().length > 0 ? value.trim() : undefined\n}\n\nfunction projectRuntimeStatus() {\n const core = useCoreStore.getState()\n const glasses = useGlassesStore.getState()\n const connection = useConnectionStore.getState()\n const cloudClient = useCloudClientStatusStore.getState()\n const transcriptionDebug = useTranscriptionDebugStore.getState()\n return {\n searching: core.searching,\n // Copy: the snapshot must not hand callers a mutable reference into the store.\n micRanking: [...core.micRanking],\n currentMic: core.currentMic,\n systemMicUnavailable: core.systemMicUnavailable,\n glassesConnected: glasses.connection.state === \"connected\",\n glassesFullyBooted: isGlassesReady(glasses.connection),\n bluetoothClassicConnected: glasses.bluetoothClassicConnected,\n coreStatus: connection.status,\n cloudClientStatus: cloudClient.status,\n cloudClientAudioTransport: cloudClient.audioTransport,\n transcriptionSubscribers: [...transcriptionDebug.transcriptionSubscribers],\n translationSubscribers: [...transcriptionDebug.translationSubscribers],\n recentTranscriptSources: {...transcriptionDebug.recentTranscriptSources},\n cloudAudioSubscriptionWrite: {...transcriptionDebug.cloudAudioSubscriptionWrite},\n }\n}\n\nexport type DevRuntimeStatusSnapshot = ReturnType<typeof projectRuntimeStatus>\n\nexport const dev = {\n /** Inject a glasses gesture through the normal dashboard/miniapp input policy. */\n sendGesture,\n /** The cloud-v2 core/runtime URL overrides. */\n cloudUrls: (): {core?: string; runtime?: string} => {\n const s = useSettingsStore.getState()\n return {core: s.getSetting(SETTINGS.cloud_core_url.key), runtime: s.getSetting(SETTINGS.cloud_runtime_url.key)}\n },\n /** Override the cloud-v2 URLs and reconnect the live client onto them. */\n setCloudUrls: (urls: {core?: string; runtime?: string}) => {\n const next = {...currentCloudUrlOverrides(), ...urls}\n const resolved = resolveCloudUrlReconnectTarget(next)\n if (resolved === null) {\n console.warn(\"engine.dev.setCloudUrls: ignoring partial cloud override without a resolvable sibling endpoint\")\n return\n }\n\n const s = useSettingsStore.getState()\n if (urls.core !== undefined) s.setSetting(SETTINGS.cloud_core_url.key, urls.core)\n if (urls.runtime !== undefined) s.setSetting(SETTINGS.cloud_runtime_url.key, urls.runtime)\n if (resolved === undefined) {\n cloudClientService.reconnect(null)\n } else {\n cloudClientService.reconnect(resolved)\n }\n },\n\n /** Tear down + rebuild the live cloud client (the dev \"reconnect\" button). */\n reconnectCloud: (): void => applyCloudUrlReconnect(),\n\n /** Current native (BLE-process) memory usage in MB — a dev/diagnostics gauge. */\n getMemoryMB: (): number => BluetoothSdk.getMemoryMB(),\n /**\n * Phone-side bluetooth runtime snapshot (the core store read-model: scan/mic/\n * search state) — the diagnostics/data-export surface. Shallow copy.\n */\n bluetoothStatus: (): Record<string, unknown> => {\n const {setCoreInfo: _setCoreInfo, reset: _reset, ...state} = useCoreStore.getState()\n return {...state}\n },\n\n /**\n * Side-load a miniapp being served from a dev machine (the `glassly dev` / CLI\n * flow) by its URL: probes `<url>/miniapp.json`, and on a reachable manifest\n * registers it under its manifest package so it appears in `engine.miniapps`\n * and can coexist with other dev miniapps. This is the OEM-host equivalent\n * of the first-party\n * developer-URL screen — the registration itself is engine-internal, so a\n * host reaches it here rather than the internal registry. Rendering still\n * flows through the normal display path once the miniapp is started.\n */\n loadDevMiniapp: async (\n url: string,\n name?: string,\n ): Promise<{ok: true; packageName: string; name: string} | {ok: false; error: string}> => {\n const devUrl = url.trim().replace(/\\/+$/, \"\")\n if (!devUrl) return {ok: false, error: \"empty url\"}\n const result = await decideDevLaunchRoute(\"\", devUrl)\n if (result.decision !== \"live\") {\n return {ok: false, error: \"dev server unreachable, or no miniapp.json served there\"}\n }\n const manifest = result.manifest\n const appName = name ?? manifest.name ?? \"Dev Miniapp\"\n const packageName = (manifest.packageName as string | undefined) ?? DEV_APP_PACKAGE_NAME\n // Persist the host that answered — not the stale input IP — so home-tile\n // relaunches skip a dead LAN address after mDNS/Metro failover.\n const resolvedUrl = result.resolvedUrl || devUrl\n // The `glassly dev` server puts the hot-reload/log sidecar on the\n // user port PLUS ONE — same convention as the first-party developer-URL\n // screen's deriveDevPort.\n let devPort: number | undefined\n try {\n const parsed = Number(new URL(resolvedUrl).port)\n devPort = Number.isFinite(parsed) && parsed > 0 ? parsed + 1 : undefined\n } catch {\n devPort = undefined\n }\n // The record is stored under a namespaced dev id (deriveDevPackageId) so\n // it survives release installs of the manifest package — stop/refresh and\n // the returned packageName must use that id, which registerDevApp returns.\n const devPackageId = deriveDevPackageId(packageName)\n const existing = useAppStatusStore.getState().apps.find((app) => app.packageName === devPackageId)\n if (existing?.running) await useAppStatusStore.getState().stop(devPackageId)\n const record = await registerDevApp({\n packageName,\n name: appName,\n iconUrl: manifest.icon ? new URL(manifest.icon, `${resolvedUrl}/`).toString() : `${resolvedUrl}/icon.png`,\n // Persist the host that answered — not the stale input IP.\n devUrl: resolvedUrl,\n devPort,\n type: manifest.type as DevAppRecord[\"type\"],\n permissions: manifest.permissions as DevAppRecord[\"permissions\"],\n hardwareRequirements: manifest.hardwareRequirements as DevAppRecord[\"hardwareRequirements\"],\n actions: manifest.actions as DevAppRecord[\"actions\"],\n })\n await useAppStatusStore.getState().refresh()\n return {ok: true, packageName: record.packageName, name: appName}\n },\n\n /** Current engine runtime status for engine-owned debug surfaces. */\n runtimeStatus: (): DevRuntimeStatusSnapshot => projectRuntimeStatus(),\n\n /** Subscribe to the projected engine runtime status; returns an unsubscribe. */\n onRuntimeStatus: (cb: (status: DevRuntimeStatusSnapshot) => void): (() => void) => {\n let last = JSON.stringify(projectRuntimeStatus())\n const notify = () => {\n const snap = projectRuntimeStatus()\n const key = JSON.stringify(snap)\n if (key === last) return\n last = key\n cb(snap)\n }\n const unsubscribers = [\n useCoreStore.subscribe(notify),\n useGlassesStore.subscribe(notify),\n useConnectionStore.subscribe(notify),\n useCloudClientStatusStore.subscribe(notify),\n useTranscriptionDebugStore.subscribe(notify),\n ]\n return () => {\n unsubscribers.forEach((unsubscribe) => unsubscribe())\n }\n },\n\n /**\n * Each finished dashboard open while the debug_dashboard_open_timing setting\n * is on: a ready-made title/body plus the stage timings. Returns an unsubscribe.\n */\n onDashboardOpenTrace: (cb: (report: DashboardOpenReport) => void): (() => void) => dashboardOpenTrace.onReport(cb),\n}\n"]}
1
+ {"version":3,"file":"dev.js","sourceRoot":"","sources":["../../src/facades/dev.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,YAAY,MAAM,iCAAiC,CAAA;AAC1D,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAC,yBAAyB,EAAC,MAAM,6BAA6B,CAAA;AACrE,OAAO,EAAC,kBAAkB,EAAC,MA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,CAAC,CAAA;QACD,MAAM,aAAa,GAAG;YACpB,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC;YAC9B,eAAe,CAAC,SAAS,CAAC,MAAM,CAAC;YACjC,kBAAkB,CAAC,SAAS,CAAC,MAAM,CAAC;YACpC,yBAAyB,CAAC,SAAS,CAAC,MAAM,CAAC;YAC3C,0BAA0B,CAAC,SAAS,CAAC,MAAM,CAAC;SAC7C,CAAA;QACD,OAAO,GAAG,EAAE;YACV,aAAa,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,EAAE,CAAC,CAAA;QACvD,CAAC,CAAA;IACH,CAAC;IAED;;;OAGG;IACH,oBAAoB,EAAE,CAAC,EAAyC,EAAgB,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC;CACnH,CAAA","sourcesContent":["/**\n * dev facade — `engine.dev`: developer/debug surface over engine-owned state.\n * Backend/cloud URL overrides read+write the engine settings store; the cloud\n * URL setters reconnect the engine-owned cloud client onto the new endpoints;\n *\n * NOTE: the dev-time endpoint *resolution* (Metro-host auto-detect, env defaults)\n * still lives host-side in `@/services/cloudClient` during the migration; this\n * facade manages the explicit overrides + reconnect.\n */\nimport BluetoothSdk from \"@glassly/bluetooth-sdk/internal\"\nimport {isGlassesReady} from \"../services/GlassesReadiness\"\nimport {useCloudClientStatusStore} from \"../stores/cloudClientStatus\"\nimport {useConnectionStore} from \"../stores/connection\"\nimport {useCoreStore} from \"../stores/core\"\nimport {useGlassesStore} from \"../stores/glasses\"\nimport {useSettingsStore, SETTINGS} from \"../stores/settings\"\nimport {useTranscriptionDebugStore} from \"../stores/transcriptionDebug\"\nimport {cloudClientService} from \"../services/CloudClientService\"\nimport {getConfigValues} from \"../runtime/bootstrap\"\nimport {decideDevLaunchRoute} from \"../utils/devMiniappLaunch\"\nimport {deriveDevPackageId, registerDevApp, DEV_APP_PACKAGE_NAME, type DevAppRecord} from \"../services/AppRegistry\"\nimport {useAppStatusStore} from \"../stores/apps\"\nimport {sendGesture} from \"../services/GlassesTouchInput\"\nimport dashboardOpenTrace, {type DashboardOpenReport} from \"../services/debug/DashboardOpenTrace\"\n\ntype CloudUrlOverrides = {core?: string; runtime?: string}\n\n/**\n * Reconnect the cloud client onto the current cloud-URL overrides. Explicit\n * partial overrides merge over the boot-resolved config (which carries the\n * host's Metro/env URL resolution); both empty clears the live override.\n */\nfunction applyCloudUrlReconnect(urls: CloudUrlOverrides = currentCloudUrlOverrides()): void {\n const resolved = resolveCloudUrlReconnectTarget(urls)\n if (resolved === undefined) {\n cloudClientService.reconnect(null)\n } else if (resolved) {\n cloudClientService.reconnect(resolved)\n } else {\n console.warn(\"engine.dev.setCloudUrls: partial cloud override missing boot-resolved sibling endpoint\")\n }\n}\n\nfunction currentCloudUrlOverrides(): CloudUrlOverrides {\n const s = useSettingsStore.getState()\n return {\n core: trimSetting(s.getSetting(SETTINGS.cloud_core_url.key)),\n runtime: trimSetting(s.getSetting(SETTINGS.cloud_runtime_url.key)),\n }\n}\n\nfunction resolveCloudUrlReconnectTarget(urls: CloudUrlOverrides): {core: string; runtime: string} | null | undefined {\n const core = trimSetting(urls.core)\n const runtime = trimSetting(urls.runtime)\n if (!core && !runtime) return undefined\n\n const config = getConfigValues()\n const resolvedCore = core || config.coreUrl?.trim()\n const resolvedRuntime = runtime || config.runtimeUrl?.trim()\n return resolvedCore && resolvedRuntime ? {core: resolvedCore, runtime: resolvedRuntime} : null\n}\n\nfunction trimSetting(value: unknown): string | undefined {\n return typeof value === \"string\" && value.trim().length > 0 ? value.trim() : undefined\n}\n\nfunction projectRuntimeStatus() {\n const core = useCoreStore.getState()\n const glasses = useGlassesStore.getState()\n const connection = useConnectionStore.getState()\n const cloudClient = useCloudClientStatusStore.getState()\n const transcriptionDebug = useTranscriptionDebugStore.getState()\n return {\n searching: core.searching,\n // Copy: the snapshot must not hand callers a mutable reference into the store.\n micRanking: [...core.micRanking],\n currentMic: core.currentMic,\n systemMicUnavailable: core.systemMicUnavailable,\n glassesConnected: glasses.connection.state === \"connected\",\n glassesFullyBooted: isGlassesReady(glasses.connection),\n bluetoothClassicConnected: glasses.bluetoothClassicConnected,\n coreStatus: connection.status,\n cloudClientStatus: cloudClient.status,\n cloudClientAudioTransport: cloudClient.audioTransport,\n transcriptionSubscribers: [...transcriptionDebug.transcriptionSubscribers],\n translationSubscribers: [...transcriptionDebug.translationSubscribers],\n recentTranscriptSources: {...transcriptionDebug.recentTranscriptSources},\n cloudAudioSubscriptionWrite: {...transcriptionDebug.cloudAudioSubscriptionWrite},\n }\n}\n\nexport type DevRuntimeStatusSnapshot = ReturnType<typeof projectRuntimeStatus>\n\nexport const dev = {\n /** Inject a glasses gesture through the normal dashboard/miniapp input policy. */\n sendGesture,\n /** The cloud core/runtime URL overrides. */\n cloudUrls: (): {core?: string; runtime?: string} => {\n const s = useSettingsStore.getState()\n return {core: s.getSetting(SETTINGS.cloud_core_url.key), runtime: s.getSetting(SETTINGS.cloud_runtime_url.key)}\n },\n /** Override the cloud URLs and reconnect the live client onto them. */\n setCloudUrls: (urls: {core?: string; runtime?: string}) => {\n const next = {...currentCloudUrlOverrides(), ...urls}\n const resolved = resolveCloudUrlReconnectTarget(next)\n if (resolved === null) {\n console.warn(\"engine.dev.setCloudUrls: ignoring partial cloud override without a resolvable sibling endpoint\")\n return\n }\n\n const s = useSettingsStore.getState()\n if (urls.core !== undefined) s.setSetting(SETTINGS.cloud_core_url.key, urls.core)\n if (urls.runtime !== undefined) s.setSetting(SETTINGS.cloud_runtime_url.key, urls.runtime)\n if (resolved === undefined) {\n cloudClientService.reconnect(null)\n } else {\n cloudClientService.reconnect(resolved)\n }\n },\n\n /** Tear down + rebuild the live cloud client (the dev \"reconnect\" button). */\n reconnectCloud: (): void => applyCloudUrlReconnect(),\n\n /** Current native (BLE-process) memory usage in MB — a dev/diagnostics gauge. */\n getMemoryMB: (): number => BluetoothSdk.getMemoryMB(),\n /**\n * Phone-side bluetooth runtime snapshot (the core store read-model: scan/mic/\n * search state) — the diagnostics/data-export surface. Shallow copy.\n */\n bluetoothStatus: (): Record<string, unknown> => {\n const {setCoreInfo: _setCoreInfo, reset: _reset, ...state} = useCoreStore.getState()\n return {...state}\n },\n\n /**\n * Side-load a miniapp being served from a dev machine (the `glassly dev` / CLI\n * flow) by its URL: probes `<url>/miniapp.json`, and on a reachable manifest\n * registers it under its manifest package so it appears in `engine.miniapps`\n * and can coexist with other dev miniapps. This is the OEM-host equivalent\n * of the first-party\n * developer-URL screen — the registration itself is engine-internal, so a\n * host reaches it here rather than the internal registry. Rendering still\n * flows through the normal display path once the miniapp is started.\n */\n loadDevMiniapp: async (\n url: string,\n name?: string,\n ): Promise<{ok: true; packageName: string; name: string} | {ok: false; error: string}> => {\n const devUrl = url.trim().replace(/\\/+$/, \"\")\n if (!devUrl) return {ok: false, error: \"empty url\"}\n const result = await decideDevLaunchRoute(\"\", devUrl)\n if (result.decision !== \"live\") {\n return {ok: false, error: \"dev server unreachable, or no miniapp.json served there\"}\n }\n const manifest = result.manifest\n const appName = name ?? manifest.name ?? \"Dev Miniapp\"\n const packageName = (manifest.packageName as string | undefined) ?? DEV_APP_PACKAGE_NAME\n // Persist the host that answered — not the stale input IP — so home-tile\n // relaunches skip a dead LAN address after mDNS/Metro failover.\n const resolvedUrl = result.resolvedUrl || devUrl\n // The `glassly dev` server puts the hot-reload/log sidecar on the\n // user port PLUS ONE — same convention as the first-party developer-URL\n // screen's deriveDevPort.\n let devPort: number | undefined\n try {\n const parsed = Number(new URL(resolvedUrl).port)\n devPort = Number.isFinite(parsed) && parsed > 0 ? parsed + 1 : undefined\n } catch {\n devPort = undefined\n }\n // The record is stored under a namespaced dev id (deriveDevPackageId) so\n // it survives release installs of the manifest package — stop/refresh and\n // the returned packageName must use that id, which registerDevApp returns.\n const devPackageId = deriveDevPackageId(packageName)\n const existing = useAppStatusStore.getState().apps.find((app) => app.packageName === devPackageId)\n if (existing?.running) await useAppStatusStore.getState().stop(devPackageId)\n const record = await registerDevApp({\n packageName,\n name: appName,\n iconUrl: manifest.icon ? new URL(manifest.icon, `${resolvedUrl}/`).toString() : `${resolvedUrl}/icon.png`,\n // Persist the host that answered — not the stale input IP.\n devUrl: resolvedUrl,\n devPort,\n type: manifest.type as DevAppRecord[\"type\"],\n permissions: manifest.permissions as DevAppRecord[\"permissions\"],\n hardwareRequirements: manifest.hardwareRequirements as DevAppRecord[\"hardwareRequirements\"],\n actions: manifest.actions as DevAppRecord[\"actions\"],\n })\n await useAppStatusStore.getState().refresh()\n return {ok: true, packageName: record.packageName, name: appName}\n },\n\n /** Current engine runtime status for engine-owned debug surfaces. */\n runtimeStatus: (): DevRuntimeStatusSnapshot => projectRuntimeStatus(),\n\n /** Subscribe to the projected engine runtime status; returns an unsubscribe. */\n onRuntimeStatus: (cb: (status: DevRuntimeStatusSnapshot) => void): (() => void) => {\n let last = JSON.stringify(projectRuntimeStatus())\n const notify = () => {\n const snap = projectRuntimeStatus()\n const key = JSON.stringify(snap)\n if (key === last) return\n last = key\n cb(snap)\n }\n const unsubscribers = [\n useCoreStore.subscribe(notify),\n useGlassesStore.subscribe(notify),\n useConnectionStore.subscribe(notify),\n useCloudClientStatusStore.subscribe(notify),\n useTranscriptionDebugStore.subscribe(notify),\n ]\n return () => {\n unsubscribers.forEach((unsubscribe) => unsubscribe())\n }\n },\n\n /**\n * Each finished dashboard open while the debug_dashboard_open_timing setting\n * is on: a ready-made title/body plus the stage timings. Returns an unsubscribe.\n */\n onDashboardOpenTrace: (cb: (report: DashboardOpenReport) => void): (() => void) => dashboardOpenTrace.onReport(cb),\n}\n"]}
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * reports facade — `engine.reports`: user/system report submission over the
3
- * Cloud V2 core client.
3
+ * Cloud core client.
4
4
  *
5
5
  * Host/OEM code owns UI and wording. Engine owns Glassly mechanics: context
6
- * collection, recent phone logs, Cloud V2 calls, local automatic throttling,
6
+ * collection, recent phone logs, Cloud calls, local automatic throttling,
7
7
  * screenshots, and notifying connected glasses.
8
8
  */
9
9
  import BluetoothSdk from "@glassly/bluetooth-sdk/internal";
@@ -1 +1 @@
1
- {"version":3,"file":"reports.js","sourceRoot":"","sources":["../../src/facades/reports.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,YAAY,MAAM,iCAAiC,CAAA;AAE1D,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAC,kBAAkB,EAAC,MAAM,8BAA8B,CAAA;AAC/D,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAA;AACjE,OAAO,EAAC,wBAAwB,EAAC,MAAM,4BAA4B,CAAA;AACnE,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAA;AAiC7C,MAAM,oCAAoC,GAAG,MAAM,CAAA;AACnD,MAAM,+BAA+B,GAAG,IAAI,GAAG,EAAkB,CAAA;AAEjE,SAAS,2BAA2B,CAAC,GAAW,EAAE,KAAa,EAAE,QAAgB;IAC/E,MAAM,QAAQ,GAAG,+BAA+B,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACzD,IAAI,QAAQ,KAAK,SAAS,IAAI,KAAK,GAAG,QAAQ,GAAG,QAAQ,EAAE,CAAC;QAC1D,OAAO,IAAI,CAAA;IACb,CAAC;IACD,8BAA8B,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IAC/C,OAAO,KAAK,CAAA;AACd,CAAC;AAED,SAAS,4BAA4B,CAAC,GAAW,EAAE,KAAa,EAAE,QAAgB;IAChF,+BAA+B,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IAC/C,8BAA8B,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;AACjD,CAAC;AAED,SAAS,8BAA8B,CAAC,KAAa,EAAE,QAAgB;IACrE,KAAK,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,IAAI,+BAA+B,EAAE,CAAC;QACpE,IAAI,KAAK,GAAG,SAAS,GAAG,QAAQ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O,CAAC,IAAI,CAAC,yCAAyC,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;QACzG,CAAC;IACH,CAAC;IAED,IAAI,QAAQ,IAAI,iBAAiB,EAAE,CAAC;QAClC,4BAA4B,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAC3E,CAAC;IAED,OAAO,EAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAC,CAAA;AACtD,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,MAAM,CAAC,KAA8B;QACnC,OAAO,oBAAoB,CAAC,KAAK,CAAC,CAAA;IACpC,CAAC;CACF,CAAA;AAED,MAAM,UAAU,qBAAqB,CAAC,KAAuC;IAC3E,OAAO,oBAAoB,CAAC,KAAK,CAAC,CAAA;AACpC,CAAC","sourcesContent":["/**\n * reports facade — `engine.reports`: user/system report submission over the\n * Cloud V2 core client.\n *\n * Host/OEM code owns UI and wording. Engine owns Glassly mechanics: context\n * collection, recent phone logs, Cloud V2 calls, local automatic throttling,\n * screenshots, and notifying connected glasses.\n */\nimport BluetoothSdk from \"@glassly/bluetooth-sdk/internal\"\nimport type {ReportAttachmentInput, ReportContext, ReportStatus, SubmitReportInput} from \"@glassly/cloud-client\"\nimport {useGlassesStore} from \"../stores/glasses\"\nimport {isGlassesConnected} from \"../services/GlassesReadiness\"\nimport {cloudClientService} from \"../services/CloudClientService\"\nimport {collectDiagnosticContext} from \"../utils/diagnosticContext\"\nimport {logBuffer} from \"../utils/devLogging\"\n\nexport type {\n ReportAttachmentInput,\n ReportContext,\n ReportDetails,\n ReportStatus,\n ReportTrigger,\n} from \"@glassly/cloud-client\"\n\nexport type EngineSubmitReportInput =\n | (Omit<Extract<SubmitReportInput, {kind: \"bug\"}>, \"context\"> & {\n context?: Partial<ReportContext>\n screenshots?: ReportAttachmentInput[]\n })\n | (Omit<Extract<SubmitReportInput, {kind: \"feedback\"}>, \"context\"> & {\n context?: Partial<ReportContext>\n })\n\nexport type EngineSubmitAutomaticReportInput = Omit<Extract<SubmitReportInput, {kind: \"automatic\"}>, \"context\"> & {\n context?: Partial<ReportContext>\n screenshots?: ReportAttachmentInput[]\n throttleKey?: string\n throttleWindowMs?: number\n}\n\ntype InternalSubmitReportInput = EngineSubmitReportInput | EngineSubmitAutomaticReportInput\n\nexport type ReportSubmitResult =\n | {status: \"submitted\"; reportId: string; reportStatus: ReportStatus}\n | {status: \"skipped\"; reason: \"throttled_within_window\"}\n | {status: \"failed\"; error: string}\n\nconst DEFAULT_AUTOMATIC_REPORT_THROTTLE_MS = 90_000\nconst automaticReportThrottleRegistry = new Map<string, number>()\n\nfunction automaticThrottleShouldSkip(key: string, nowMs: number, windowMs: number): boolean {\n const previous = automaticReportThrottleRegistry.get(key)\n if (previous !== undefined && nowMs - previous < windowMs) {\n return true\n }\n pruneAutomaticThrottleRegistry(nowMs, windowMs)\n return false\n}\n\nfunction markAutomaticThrottleSuccess(key: string, nowMs: number, windowMs: number): void {\n automaticReportThrottleRegistry.set(key, nowMs)\n pruneAutomaticThrottleRegistry(nowMs, windowMs)\n}\n\nfunction pruneAutomaticThrottleRegistry(nowMs: number, windowMs: number): void {\n for (const [entryKey, entryTime] of automaticReportThrottleRegistry) {\n if (nowMs - entryTime > windowMs * 3) {\n automaticReportThrottleRegistry.delete(entryKey)\n }\n }\n}\n\nfunction notifyGlasses(reportId: string, apiBaseUrl?: string | null): void {\n if (!isGlassesConnected(useGlassesStore.getState().connection)) return\n void (async () => {\n try {\n await cloudClientService.syncCoreTokenToBluetooth()\n await BluetoothSdk.sendIncidentId(reportId, apiBaseUrl ?? cloudClientService.getCoreUrl())\n } catch (error) {\n console.warn(\"reports.submit: notify glasses failed:\", error instanceof Error ? error.message : error)\n }\n })()\n}\n\nasync function submitReportInternal(input: InternalSubmitReportInput): Promise<ReportSubmitResult> {\n const throttle =\n input.kind === \"automatic\" && input.throttleKey\n ? {\n key: input.throttleKey,\n windowMs: input.throttleWindowMs ?? DEFAULT_AUTOMATIC_REPORT_THROTTLE_MS,\n }\n : null\n\n if (input.kind === \"automatic\" && input.throttleKey) {\n const shouldSkip = automaticThrottleShouldSkip(\n input.throttleKey,\n Date.now(),\n throttle?.windowMs ?? DEFAULT_AUTOMATIC_REPORT_THROTTLE_MS,\n )\n if (shouldSkip) return {status: \"skipped\", reason: \"throttled_within_window\"}\n }\n\n const context = await collectDiagnosticContext(input.context)\n let reportId: string\n let reportStatus: ReportStatus\n let artifactsComplete = true\n try {\n const res =\n input.kind === \"feedback\"\n ? await cloudClientService.core.reports.submit({\n kind: \"feedback\",\n feedback: input.feedback,\n context,\n })\n : input.kind === \"bug\"\n ? await cloudClientService.core.reports.submit({\n kind: \"bug\",\n trigger: input.trigger,\n report: input.report,\n context,\n })\n : await cloudClientService.core.reports.submit({\n kind: \"automatic\",\n trigger: input.trigger,\n report: input.report,\n context,\n })\n reportId = res.reportId\n reportStatus = res.status\n } catch (error) {\n return {status: \"failed\", error: error instanceof Error ? error.message : String(error)}\n }\n\n if (input.kind !== \"feedback\") {\n const logs = logBuffer.getRecentLogs()\n if (logs.length > 0) {\n try {\n await cloudClientService.core.reports.addLogs(reportId, \"phone\", logs)\n } catch (error) {\n artifactsComplete = false\n console.warn(\"reports.submit: add phone logs failed:\", error instanceof Error ? error.message : error)\n }\n }\n\n notifyGlasses(reportId, cloudClientService.getCoreUrl())\n\n if (input.screenshots && input.screenshots.length > 0) {\n try {\n await cloudClientService.core.reports.addScreenshots(reportId, input.screenshots)\n } catch (error) {\n artifactsComplete = false\n console.warn(\"reports.submit: add screenshots failed:\", error instanceof Error ? error.message : error)\n }\n }\n\n try {\n const completed = await cloudClientService.core.reports.complete(reportId)\n reportStatus = completed.status\n } catch (error) {\n artifactsComplete = false\n console.warn(\"reports.submit: complete report failed:\", error instanceof Error ? error.message : error)\n }\n }\n\n if (throttle && artifactsComplete) {\n markAutomaticThrottleSuccess(throttle.key, Date.now(), throttle.windowMs)\n }\n\n return {status: \"submitted\", reportId, reportStatus}\n}\n\nexport const reports = {\n submit(input: EngineSubmitReportInput): Promise<ReportSubmitResult> {\n return submitReportInternal(input)\n },\n}\n\nexport function submitAutomaticReport(input: EngineSubmitAutomaticReportInput): Promise<ReportSubmitResult> {\n return submitReportInternal(input)\n}\n"]}
1
+ {"version":3,"file":"reports.js","sourceRoot":"","sources":["../../src/facades/reports.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,YAAY,MAAM,iCAAiC,CAAA;AAE1D,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAC,kBAAkB,EAAC,MAAM,8BAA8B,CAAA;AAC/D,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAA;AACjE,OAAO,EAAC,wBAAwB,EAAC,MAAM,4BAA4B,CAAA;AACnE,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAA;AAiC7C,MAAM,oCAAoC,GAAG,MAAM,CAAA;AACnD,MAAM,+BAA+B,GAAG,IAAI,GAAG,EAAkB,CAAA;AAEjE,SAAS,2BAA2B,CAAC,GAAW,EAAE,KAAa,EAAE,QAAgB;IAC/E,MAAM,QAAQ,GAAG,+BAA+B,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACzD,IAAI,QAAQ,KAAK,SAAS,IAAI,KAAK,GAAG,QAAQ,GAAG,QAAQ,EAAE,CAAC;QAC1D,OAAO,IAAI,CAAA;IACb,CAAC;IACD,8BAA8B,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IAC/C,OAAO,KAAK,CAAA;AACd,CAAC;AAED,SAAS,4BAA4B,CAAC,GAAW,EAAE,KAAa,EAAE,QAAgB;IAChF,+BAA+B,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IAC/C,8BAA8B,CA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AAG,MAAM,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;YAC1E,YAAY,GAAG,SAAS,CAAC,MAAM,CAAA;QACjC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,iBAAiB,GAAG,KAAK,CAAA;YACzB,OAAO,CAAC,IAAI,CAAC,yCAAyC,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;QACzG,CAAC;IACH,CAAC;IAED,IAAI,QAAQ,IAAI,iBAAiB,EAAE,CAAC;QAClC,4BAA4B,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAC3E,CAAC;IAED,OAAO,EAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAC,CAAA;AACtD,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,MAAM,CAAC,KAA8B;QACnC,OAAO,oBAAoB,CAAC,KAAK,CAAC,CAAA;IACpC,CAAC;CACF,CAAA;AAED,MAAM,UAAU,qBAAqB,CAAC,KAAuC;IAC3E,OAAO,oBAAoB,CAAC,KAAK,CAAC,CAAA;AACpC,CAAC","sourcesContent":["/**\n * reports facade — `engine.reports`: user/system report submission over the\n * Cloud core client.\n *\n * Host/OEM code owns UI and wording. Engine owns Glassly mechanics: context\n * collection, recent phone logs, Cloud calls, local automatic throttling,\n * screenshots, and notifying connected glasses.\n */\nimport BluetoothSdk from \"@glassly/bluetooth-sdk/internal\"\nimport type {ReportAttachmentInput, ReportContext, ReportStatus, SubmitReportInput} from \"@glassly/cloud-client\"\nimport {useGlassesStore} from \"../stores/glasses\"\nimport {isGlassesConnected} from \"../services/GlassesReadiness\"\nimport {cloudClientService} from \"../services/CloudClientService\"\nimport {collectDiagnosticContext} from \"../utils/diagnosticContext\"\nimport {logBuffer} from \"../utils/devLogging\"\n\nexport type {\n ReportAttachmentInput,\n ReportContext,\n ReportDetails,\n ReportStatus,\n ReportTrigger,\n} from \"@glassly/cloud-client\"\n\nexport type EngineSubmitReportInput =\n | (Omit<Extract<SubmitReportInput, {kind: \"bug\"}>, \"context\"> & {\n context?: Partial<ReportContext>\n screenshots?: ReportAttachmentInput[]\n })\n | (Omit<Extract<SubmitReportInput, {kind: \"feedback\"}>, \"context\"> & {\n context?: Partial<ReportContext>\n })\n\nexport type EngineSubmitAutomaticReportInput = Omit<Extract<SubmitReportInput, {kind: \"automatic\"}>, \"context\"> & {\n context?: Partial<ReportContext>\n screenshots?: ReportAttachmentInput[]\n throttleKey?: string\n throttleWindowMs?: number\n}\n\ntype InternalSubmitReportInput = EngineSubmitReportInput | EngineSubmitAutomaticReportInput\n\nexport type ReportSubmitResult =\n | {status: \"submitted\"; reportId: string; reportStatus: ReportStatus}\n | {status: \"skipped\"; reason: \"throttled_within_window\"}\n | {status: \"failed\"; error: string}\n\nconst DEFAULT_AUTOMATIC_REPORT_THROTTLE_MS = 90_000\nconst automaticReportThrottleRegistry = new Map<string, number>()\n\nfunction automaticThrottleShouldSkip(key: string, nowMs: number, windowMs: number): boolean {\n const previous = automaticReportThrottleRegistry.get(key)\n if (previous !== undefined && nowMs - previous < windowMs) {\n return true\n }\n pruneAutomaticThrottleRegistry(nowMs, windowMs)\n return false\n}\n\nfunction markAutomaticThrottleSuccess(key: string, nowMs: number, windowMs: number): void {\n automaticReportThrottleRegistry.set(key, nowMs)\n pruneAutomaticThrottleRegistry(nowMs, windowMs)\n}\n\nfunction pruneAutomaticThrottleRegistry(nowMs: number, windowMs: number): void {\n for (const [entryKey, entryTime] of automaticReportThrottleRegistry) {\n if (nowMs - entryTime > windowMs * 3) {\n automaticReportThrottleRegistry.delete(entryKey)\n }\n }\n}\n\nfunction notifyGlasses(reportId: string, apiBaseUrl?: string | null): void {\n if (!isGlassesConnected(useGlassesStore.getState().connection)) return\n void (async () => {\n try {\n await cloudClientService.syncCoreTokenToBluetooth()\n await BluetoothSdk.sendIncidentId(reportId, apiBaseUrl ?? cloudClientService.getCoreUrl())\n } catch (error) {\n console.warn(\"reports.submit: notify glasses failed:\", error instanceof Error ? error.message : error)\n }\n })()\n}\n\nasync function submitReportInternal(input: InternalSubmitReportInput): Promise<ReportSubmitResult> {\n const throttle =\n input.kind === \"automatic\" && input.throttleKey\n ? {\n key: input.throttleKey,\n windowMs: input.throttleWindowMs ?? DEFAULT_AUTOMATIC_REPORT_THROTTLE_MS,\n }\n : null\n\n if (input.kind === \"automatic\" && input.throttleKey) {\n const shouldSkip = automaticThrottleShouldSkip(\n input.throttleKey,\n Date.now(),\n throttle?.windowMs ?? DEFAULT_AUTOMATIC_REPORT_THROTTLE_MS,\n )\n if (shouldSkip) return {status: \"skipped\", reason: \"throttled_within_window\"}\n }\n\n const context = await collectDiagnosticContext(input.context)\n let reportId: string\n let reportStatus: ReportStatus\n let artifactsComplete = true\n try {\n const res =\n input.kind === \"feedback\"\n ? await cloudClientService.core.reports.submit({\n kind: \"feedback\",\n feedback: input.feedback,\n context,\n })\n : input.kind === \"bug\"\n ? await cloudClientService.core.reports.submit({\n kind: \"bug\",\n trigger: input.trigger,\n report: input.report,\n context,\n })\n : await cloudClientService.core.reports.submit({\n kind: \"automatic\",\n trigger: input.trigger,\n report: input.report,\n context,\n })\n reportId = res.reportId\n reportStatus = res.status\n } catch (error) {\n return {status: \"failed\", error: error instanceof Error ? error.message : String(error)}\n }\n\n if (input.kind !== \"feedback\") {\n const logs = logBuffer.getRecentLogs()\n if (logs.length > 0) {\n try {\n await cloudClientService.core.reports.addLogs(reportId, \"phone\", logs)\n } catch (error) {\n artifactsComplete = false\n console.warn(\"reports.submit: add phone logs failed:\", error instanceof Error ? error.message : error)\n }\n }\n\n notifyGlasses(reportId, cloudClientService.getCoreUrl())\n\n if (input.screenshots && input.screenshots.length > 0) {\n try {\n await cloudClientService.core.reports.addScreenshots(reportId, input.screenshots)\n } catch (error) {\n artifactsComplete = false\n console.warn(\"reports.submit: add screenshots failed:\", error instanceof Error ? error.message : error)\n }\n }\n\n try {\n const completed = await cloudClientService.core.reports.complete(reportId)\n reportStatus = completed.status\n } catch (error) {\n artifactsComplete = false\n console.warn(\"reports.submit: complete report failed:\", error instanceof Error ? error.message : error)\n }\n }\n\n if (throttle && artifactsComplete) {\n markAutomaticThrottleSuccess(throttle.key, Date.now(), throttle.windowMs)\n }\n\n return {status: \"submitted\", reportId, reportStatus}\n}\n\nexport const reports = {\n submit(input: EngineSubmitReportInput): Promise<ReportSubmitResult> {\n return submitReportInternal(input)\n },\n}\n\nexport function submitAutomaticReport(input: EngineSubmitAutomaticReportInput): Promise<ReportSubmitResult> {\n return submitReportInternal(input)\n}\n"]}
@@ -11,7 +11,7 @@ export declare const session: {
11
11
  * Legacy Cloud-V1 websocket status. The socket's writer (the host
12
12
  * WebSocketManager) was deleted in the Cloud V1 ripout, so this now always
13
13
  * reports the store's initial DISCONNECTED; the host connection banners
14
- * render `status()` (the cloud-v2 runtime) instead. Kept, with the backing
14
+ * render `status()` (the cloud runtime) instead. Kept, with the backing
15
15
  * connection store, for the engine-side legacy-surface removal (issue #3392).
16
16
  */
17
17
  legacyWebsocketStatus: () => WebSocketStatus;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * session facade — `engine.session`: the cloud-v2 live-session surface engine
2
+ * session facade — `engine.session`: the cloud live-session surface engine
3
3
  * now owns (keystone #5). Exposes the connection status read-model (status +
4
4
  * audio transport, projected from the engine-owned cloud-status store) and the
5
5
  * liveness flag.
@@ -34,7 +34,7 @@ export const session = {
34
34
  * Legacy Cloud-V1 websocket status. The socket's writer (the host
35
35
  * WebSocketManager) was deleted in the Cloud V1 ripout, so this now always
36
36
  * reports the store's initial DISCONNECTED; the host connection banners
37
- * render `status()` (the cloud-v2 runtime) instead. Kept, with the backing
37
+ * render `status()` (the cloud runtime) instead. Kept, with the backing
38
38
  * connection store, for the engine-side legacy-surface removal (issue #3392).
39
39
  */
40
40
  legacyWebsocketStatus: () => useConnectionStore.getState().status,
@@ -1 +1 @@
1
- {"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/facades/session.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAA;AACjE,OAAO,EAAC,yBAAyB,EAAC,MAAM,6BAA6B,CAAA;AACrE,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAA;AAIvD,SAAS,OAAO;IACd,MAAM,CAAC,GAAG,yBAAyB,CAAC,QAAQ,EAAE,CAAA;IAC9C,OAAO,EAAC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC,cAAc,EAAC,CAAA;AAC7D,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,8EAA8E;IAC9E,MAAM,EAAE,GAA8B,EAAE,CAAC,OAAO,EAAE;IAClD,yEAAyE;IACzE,QAAQ,EAAE,CAAC,EAA+C,EAAgB,EAAE;QAC1E,yEAAyE;QACzE,IAAI,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAA;QACpC,OAAO,yBAAyB,CAAC,SAAS,CAAC,GAAG,EAAE;YAC9C,MAAM,IAAI,GAAG,OAAO,EAAE,CAAA;YACtB,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;YAChC,IAAI,GAAG,KAAK,IAAI;gBAAE,OAAM;YACxB,IAAI,GAAG,GAAG,CAAA;YACV,EAAE,CAAC,IAAI,CAAC,CAAA;QACV,CAAC,CAAC,CAAA;IACJ,CAAC;IACD,wDAAwD;IACxD,WAAW,EAAE,GAAY,EAAE,CAAC,kBAAkB,CAAC,WAAW,EAAE;IAE5D;;;;;;OAMG;IACH,qBAAqB,EAAE,GAAoB,EAAE,CAAC,kBAAkB,CAAC,QAAQ,EAAE,CAAC,MAAM;IAClF,wGAAwG;IACxG,uBAAuB,EAAE,CAAC,EAAqC,EAAgB,EAAE;QAC/E,IAAI,IAAI,GAAG,kBAAkB,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAA;QAC/C,OAAO,kBAAkB,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;YAC5C,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI;gBAAE,OAAM;YACjC,IAAI,GAAG,KAAK,CAAC,MAAM,CAAA;YACnB,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QAClB,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA","sourcesContent":["/**\n * session facade — `engine.session`: the cloud-v2 live-session surface engine\n * now owns (keystone #5). Exposes the connection status read-model (status +\n * audio transport, projected from the engine-owned cloud-status store) and the\n * liveness flag.\n *\n */\nimport {cloudClientService} from \"../services/CloudClientService\"\nimport {useCloudClientStatusStore} from \"../stores/cloudClientStatus\"\nimport {useConnectionStore} from \"../stores/connection\"\nimport type {WebSocketStatus} from \"../stores/connection\"\nimport type {CloudClientStatusSnapshot} from \"../runtime/config\"\n\nfunction project(): CloudClientStatusSnapshot {\n const s = useCloudClientStatusStore.getState()\n return {status: s.status, audioTransport: s.audioTransport}\n}\n\nexport const session = {\n /** Current cloud live-session status (connection state + audio transport). */\n status: (): CloudClientStatusSnapshot => project(),\n /** Subscribe to cloud session-status changes; returns an unsubscribe. */\n onStatus: (cb: (status: CloudClientStatusSnapshot) => void): (() => void) => {\n // Dedupe: fire only when the projected {status, audioTransport} changes.\n let last = JSON.stringify(project())\n return useCloudClientStatusStore.subscribe(() => {\n const snap = project()\n const key = JSON.stringify(snap)\n if (key === last) return\n last = key\n cb(snap)\n })\n },\n /** Whether the live-session handshake has completed. */\n isConnected: (): boolean => cloudClientService.isConnected(),\n\n /**\n * Legacy Cloud-V1 websocket status. The socket's writer (the host\n * WebSocketManager) was deleted in the Cloud V1 ripout, so this now always\n * reports the store's initial DISCONNECTED; the host connection banners\n * render `status()` (the cloud-v2 runtime) instead. Kept, with the backing\n * connection store, for the engine-side legacy-surface removal (issue #3392).\n */\n legacyWebsocketStatus: (): WebSocketStatus => useConnectionStore.getState().status,\n /** Subscribe to legacy websocket status changes; fires only when it changes. Returns an unsubscribe. */\n onLegacyWebsocketStatus: (cb: (status: WebSocketStatus) => void): (() => void) => {\n let last = useConnectionStore.getState().status\n return useConnectionStore.subscribe((state) => {\n if (state.status === last) return\n last = state.status\n cb(state.status)\n })\n },\n}\n"]}
1
+ {"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/facades/session.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAA;AACjE,OAAO,EAAC,yBAAyB,EAAC,MAAM,6BAA6B,CAAA;AACrE,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAA;AAIvD,SAAS,OAAO;IACd,MAAM,CAAC,GAAG,yBAAyB,CAAC,QAAQ,EAAE,CAAA;IAC9C,OAAO,EAAC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC,cAAc,EAAC,CAAA;AAC7D,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,8EAA8E;IAC9E,MAAM,EAAE,GAA8B,EAAE,CAAC,OAAO,EAAE;IAClD,yEAAyE;IACzE,QAAQ,EAAE,CAAC,EAA+C,EAAgB,EAAE;QAC1E,yEAAyE;QACzE,IAAI,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAA;QACpC,OAAO,yBAAyB,CAAC,SAAS,CAAC,GAAG,EAAE;YAC9C,MAAM,IAAI,GAAG,OAAO,EAAE,CAAA;YACtB,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;YAChC,IAAI,GAAG,KAAK,IAAI;gBAAE,OAAM;YACxB,IAAI,GAAG,GAAG,CAAA;YACV,EAAE,CAAC,IAAI,CAAC,CAAA;QACV,CAAC,CAAC,CAAA;IACJ,CAAC;IACD,wDAAwD;IACxD,WAAW,EAAE,GAAY,EAAE,CAAC,kBAAkB,CAAC,WAAW,EAAE;IAE5D;;;;;;OAMG;IACH,qBAAqB,EAAE,GAAoB,EAAE,CAAC,kBAAkB,CAAC,QAAQ,EAAE,CAAC,MAAM;IAClF,wGAAwG;IACxG,uBAAuB,EAAE,CAAC,EAAqC,EAAgB,EAAE;QAC/E,IAAI,IAAI,GAAG,kBAAkB,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAA;QAC/C,OAAO,kBAAkB,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;YAC5C,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI;gBAAE,OAAM;YACjC,IAAI,GAAG,KAAK,CAAC,MAAM,CAAA;YACnB,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QAClB,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA","sourcesContent":["/**\n * session facade — `engine.session`: the cloud live-session surface engine\n * now owns (keystone #5). Exposes the connection status read-model (status +\n * audio transport, projected from the engine-owned cloud-status store) and the\n * liveness flag.\n *\n */\nimport {cloudClientService} from \"../services/CloudClientService\"\nimport {useCloudClientStatusStore} from \"../stores/cloudClientStatus\"\nimport {useConnectionStore} from \"../stores/connection\"\nimport type {WebSocketStatus} from \"../stores/connection\"\nimport type {CloudClientStatusSnapshot} from \"../runtime/config\"\n\nfunction project(): CloudClientStatusSnapshot {\n const s = useCloudClientStatusStore.getState()\n return {status: s.status, audioTransport: s.audioTransport}\n}\n\nexport const session = {\n /** Current cloud live-session status (connection state + audio transport). */\n status: (): CloudClientStatusSnapshot => project(),\n /** Subscribe to cloud session-status changes; returns an unsubscribe. */\n onStatus: (cb: (status: CloudClientStatusSnapshot) => void): (() => void) => {\n // Dedupe: fire only when the projected {status, audioTransport} changes.\n let last = JSON.stringify(project())\n return useCloudClientStatusStore.subscribe(() => {\n const snap = project()\n const key = JSON.stringify(snap)\n if (key === last) return\n last = key\n cb(snap)\n })\n },\n /** Whether the live-session handshake has completed. */\n isConnected: (): boolean => cloudClientService.isConnected(),\n\n /**\n * Legacy Cloud-V1 websocket status. The socket's writer (the host\n * WebSocketManager) was deleted in the Cloud V1 ripout, so this now always\n * reports the store's initial DISCONNECTED; the host connection banners\n * render `status()` (the cloud runtime) instead. Kept, with the backing\n * connection store, for the engine-side legacy-surface removal (issue #3392).\n */\n legacyWebsocketStatus: (): WebSocketStatus => useConnectionStore.getState().status,\n /** Subscribe to legacy websocket status changes; fires only when it changes. Returns an unsubscribe. */\n onLegacyWebsocketStatus: (cb: (status: WebSocketStatus) => void): (() => void) => {\n let last = useConnectionStore.getState().status\n return useConnectionStore.subscribe((state) => {\n if (state.status === last) return\n last = state.status\n cb(state.status)\n })\n },\n}\n"]}
@@ -1,9 +1,9 @@
1
1
  export const ENGINE_RELEASE_METADATA = Object.freeze({
2
2
  "schemaVersion": 1,
3
3
  "familyBaseVersion": "0.3.2",
4
- "releaseIdentity": "0.3.2-dev.566",
5
- "releaseSetId": "glassly-0.3.2-dev.566",
6
- "sourceCommit": "86bb1ba25f42f9efe2aaf740792f5cf787b98f35",
4
+ "releaseIdentity": "0.3.2-dev.573",
5
+ "releaseSetId": "glassly-0.3.2-dev.573",
6
+ "sourceCommit": "17f385427afced4d2acdde359bb933b85e0893c1",
7
7
  "otaManifestUrl": null,
8
8
  "otaManifestSha256": null
9
9
  });
@@ -1 +1 @@
1
- {"version":3,"file":"releaseMetadata.js","sourceRoot":"","sources":["../../src/generated/releaseMetadata.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,uBAAuB,GAAoC,MAAM,CAAC,MAAM,CAAC;IACpF,eAAe,EAAE,CAAC;IAClB,mBAAmB,EAAE,OAAO;IAC5B,iBAAiB,EAAE,eAAe;IAClC,cAAc,EAAE,uBAAuB;IACvC,cAAc,EAAE,0CAA0C;IAC1D,gBAAgB,EAAE,IAAI;IACtB,mBAAmB,EAAE,IAAI;CAC1B,CAAC,CAAA","sourcesContent":["/** Generated by release CI. Do not edit in a release checkout. */\nexport interface EngineReleaseMetadata {\n schemaVersion: 1\n familyBaseVersion: string | null\n releaseIdentity: string | null\n releaseSetId: string | null\n sourceCommit: string | null\n otaManifestUrl: string | null\n otaManifestSha256: string | null\n}\n\nexport const ENGINE_RELEASE_METADATA: Readonly<EngineReleaseMetadata> = Object.freeze({\n \"schemaVersion\": 1,\n \"familyBaseVersion\": \"0.3.2\",\n \"releaseIdentity\": \"0.3.2-dev.566\",\n \"releaseSetId\": \"glassly-0.3.2-dev.566\",\n \"sourceCommit\": \"86bb1ba25f42f9efe2aaf740792f5cf787b98f35\",\n \"otaManifestUrl\": null,\n \"otaManifestSha256\": null\n})\n"]}
1
+ {"version":3,"file":"releaseMetadata.js","sourceRoot":"","sources":["../../src/generated/releaseMetadata.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,uBAAuB,GAAoC,MAAM,CAAC,MAAM,CAAC;IACpF,eAAe,EAAE,CAAC;IAClB,mBAAmB,EAAE,OAAO;IAC5B,iBAAiB,EAAE,eAAe;IAClC,cAAc,EAAE,uBAAuB;IACvC,cAAc,EAAE,0CAA0C;IAC1D,gBAAgB,EAAE,IAAI;IACtB,mBAAmB,EAAE,IAAI;CAC1B,CAAC,CAAA","sourcesContent":["/** Generated by release CI. Do not edit in a release checkout. */\nexport interface EngineReleaseMetadata {\n schemaVersion: 1\n familyBaseVersion: string | null\n releaseIdentity: string | null\n releaseSetId: string | null\n sourceCommit: string | null\n otaManifestUrl: string | null\n otaManifestSha256: string | null\n}\n\nexport const ENGINE_RELEASE_METADATA: Readonly<EngineReleaseMetadata> = Object.freeze({\n \"schemaVersion\": 1,\n \"familyBaseVersion\": \"0.3.2\",\n \"releaseIdentity\": \"0.3.2-dev.573\",\n \"releaseSetId\": \"glassly-0.3.2-dev.573\",\n \"sourceCommit\": \"17f385427afced4d2acdde359bb933b85e0893c1\",\n \"otaManifestUrl\": null,\n \"otaManifestSha256\": null\n})\n"]}
package/build/index.d.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  * capability tables, timers). Judgment rule: read models, commands, pure
8
8
  * functions and types belong here; anything that mutates runtime state or
9
9
  * exposes a raw store/service remains private to the Glassly host.
10
- * See cloud-v2/docs/issues/020-glasses-status-boundary/integration-review.md §D.
10
+ * See cloud/docs/issues/020-glasses-status-boundary/integration-review.md §D.
11
11
  */
12
12
  export { engine } from "./engine";
13
13
  export type { ReportAttachmentInput, ReportContext, ReportDetails, ReportStatus, ReportTrigger, ReportSubmitResult, EngineSubmitReportInput, } from "./facades/reports";
package/build/index.js CHANGED
@@ -7,7 +7,7 @@
7
7
  * capability tables, timers). Judgment rule: read models, commands, pure
8
8
  * functions and types belong here; anything that mutates runtime state or
9
9
  * exposes a raw store/service remains private to the Glassly host.
10
- * See cloud-v2/docs/issues/020-glasses-status-boundary/integration-review.md §D.
10
+ * See cloud/docs/issues/020-glasses-status-boundary/integration-review.md §D.
11
11
  */
12
12
  // The namespaced OEM-facing engine API (the "(A) host API"). See ./engine.
13
13
  export { engine } from "./engine";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,2EAA2E;AAC3E,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAA;AAY/B,OAAO,EAAC,uBAAuB,EAAE,iBAAiB,EAAE,eAAe,EAAC,MAAM,wBAAwB,CAAA;AAelG,2EAA2E;AAC3E,6EAA6E;AAC7E,yEAAyE;AACzE,qEAAqE;AACrE,kDAAkD;AAClD,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAE,uBAAuB,EAAC,MAAM,mBAAmB,CAAA;AAC/E,OAAO,EAAC,oBAAoB,EAAE,yBAAyB,EAAC,MAAM,kCAAkC,CAAA;AAEhG,4EAA4E;AAC5E,yEAAyE;AACzE,6EAA6E;AAC7E,OAAO,EAAC,QAA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B,EACtB,OAAO,EACP,QAAQ,EACR,OAAO,EACP,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACZ,aAAa,EACb,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,4BAA4B,EAC5B,gBAAgB,GAGjB,MAAM,eAAe,CAAA;AAEtB,4EAA4E;AAC5E,OAAO,EACL,oBAAoB,GAIrB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAC,qBAAqB,EAA2B,MAAM,kBAAkB,CAAA;AAChF,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAA;AAE1D,0CAA0C;AAC1C,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,aAAa,GACd,MAAM,SAAS,CAAA","sourcesContent":["/**\n * `@glassly/engine` — the OEM-facing main entry.\n *\n * The `engine` namespace (configure/start/stop + typed domain facades), the\n * public contract/read-model types, and the pure helpers host UI legitimately\n * renders with (decision functions, sort/order helpers, policy constants,\n * capability tables, timers). Judgment rule: read models, commands, pure\n * functions and types belong here; anything that mutates runtime state or\n * exposes a raw store/service remains private to the Glassly host.\n * See cloud-v2/docs/issues/020-glasses-status-boundary/integration-review.md §D.\n */\n\n// The namespaced OEM-facing engine API (the \"(A) host API\"). See ./engine.\nexport {engine} from \"./engine\"\nexport type {\n ReportAttachmentInput,\n ReportContext,\n ReportDetails,\n ReportStatus,\n ReportTrigger,\n ReportSubmitResult,\n EngineSubmitReportInput,\n} from \"./facades/reports\"\nexport type {IslandNotification, IslandNotificationKind} from \"./facades/notifications\"\nexport type {PresentationOwner} from \"./services/notifications/notificationPolicy\"\nexport {DEFAULT_HIDDEN_PACKAGES, isGatedByDevTools, isSystemMiniapp} from \"./stores/appVisibility\"\nexport type {WifiSearchResult} from \"./facades/glassesWifi\"\nexport type {IdentitySnapshot} from \"./services/PairingIdentity\"\nexport type {DisplayMirrorEvent} from \"./facades/displayMirror\"\nexport type {\n IslandConfigureOptions,\n IslandAuth,\n IslandConfigValues,\n IslandAnalytics,\n IslandUiSeams,\n ScanQrOptions,\n ScanQrResult,\n SubjectTokenType,\n} from \"./runtime/bootstrap\"\n\n// Settings contract: the typed key registry (schema descriptors — the same\n// surface engine.settings.descriptor()/keys() reads), the per-key React hook\n// (the hook layer, same precedent as the apps hooks below), and the pure\n// device-model key helpers. The raw useSettingsStore stays internal;\n// imperative access goes through engine.settings.\nexport {SETTINGS, useSetting, AI_DATA_CONSENT_VERSION} from \"./stores/settings\"\nexport {isCfwFirmwareVersion, isCustomDashboardEligible} from \"./services/pages/pageEligibility\"\n\n// AI tier registry: the curated per-tier model dropdown options and helpers\n// the Settings > AI Models screen renders. Resolution itself runs inside\n// LocalMiniappRuntime; the screen only reads/writes the ai_model_* settings.\nexport {AI_TIERS, TIER_MODEL_OPTIONS, parseTierSetting} from \"./services/AiTierResolution\"\nexport type {AiTier, AiTierProvider, TierModelOption} from \"./services/AiTierResolution\"\n\n// Shared user memory timeline (engine.memory / Settings > Memory). Entry and\n// session shapes are canonical in @glassly/miniapp (the session.memory\n// surface); the stats read model is engine-side.\nexport type {MemoryStats} from \"./services/MemoryStore\"\nexport type {SpeakerProfile} from \"./services/SpeakerProfileStore\"\nexport type {EnrollOutcome} from \"./facades/speakers\"\nexport {MENTRA_LIVE_SETTING_KEYS, getBluetoothSettingKeysForDevice} from \"./stores/bluetoothSettingKeys\"\n\n// Runtime-shared constants and contract DTOs.\nexport {ISLAND_SETTINGS_KEYS} from \"./runtime/config\"\nexport type {CloudClientStatusSnapshot, MiniappAuthToken, InteropAuditEvent, TtsSynthesisResult} from \"./runtime/config\"\n\n// Pure readiness predicates over glasses connection state.\nexport {\n isGlassesConnected,\n isGlassesReady,\n isGlassesLinkLayerBusy,\n waitForGlassesReady,\n type GlassesConnectionStatus,\n type WaitForGlassesReadyOptions,\n} from \"./services/GlassesReadiness\"\n// Pure connect/reconnect decision helpers (host UI renders the outcome).\nexport {\n decideReconnect,\n decideConnectButtonAction,\n type ReconnectDecision,\n type ReconnectDecisionInput,\n type ConnectButtonAction,\n} from \"./services/ConnectionCoordinator\"\n\n// OTA read-model types for host OTA UI (progress screen, error mapping,\n// progress section) — the check/install machinery itself is internal.\nexport type {\n VersionInfo,\n MtkPatch,\n BesFirmware,\n VersionJson,\n OtaCheckResult,\n OtaCheckCurrentGlassesResult,\n OtaCheckCurrentGlassesOptions,\n} from \"./services/OtaUpdateCheckService\"\n// OTA install policy (watchdog timings + failure copy) + display-state\n// derivation, consumed by the OTA screens and their tests.\nexport {\n MINIMUM_OTA_STATUS_BUILD,\n MAX_RETRIES,\n RETRY_INTERVAL_MS,\n PROGRESS_TIMEOUT_MS,\n DOWNLOAD_STUCK_TIMEOUT_MS,\n MTK_INSTALL_TIMEOUT_MS,\n GLOBAL_OTA_TIMEOUT_MS,\n PING_INTERVAL_MS,\n QUERY_REPLY_TIMEOUT_MS,\n BES_RESTART_TIMEOUT_MS,\n OtaProgressMessages,\n} from \"./services/otaInstallPolicy\"\nexport {deriveDisplayState} from \"./services/otaDisplayState\"\nexport type {DisplayState} from \"./services/otaDisplayState\"\nexport type {\n OtaProgress,\n OtaProgressStatus,\n OtaStatus,\n OtaUpdateInfo,\n ReleaseChangelog,\n OtaSnapshot,\n OtaInstallSnapshot,\n} from \"./facades/ota\"\nexport {\n beginOtaAutoChain,\n clearOtaAutoChainReconnectWait,\n isOtaAutoChainActive,\n otaAutoChainFingerprint,\n otaAutoChainReconnectWaitRemaining,\n stopOtaAutoChain,\n tryAdvanceOtaAutoChain,\n MAX_OTA_AUTO_CHAIN_PASSES,\n OTA_AUTO_CHAIN_RECONNECT_TIMEOUT_MS,\n} from \"./services/OtaAutoChain\"\nexport type {OtaAutoChainAdvanceResult} from \"./services/OtaAutoChain\"\nexport {\n BES_INSTALL_RESTART_MESSAGE,\n getOtaErrorMessage,\n shouldRequireGlassesRebootForBesFailure,\n shouldShowChangeWifiForOtaDownloadFailure,\n} from \"./services/OtaErrorMapping\"\n\n// Gallery read models: engine.gallery.onNotice payload types, the media\n// permission helper + display-name derivation host gallery UI uses, and the\n// glasses-camera DTO types (re-exported through the host @/types/asg shim).\nexport type {GalleryNotice, GalleryNoticeCode} from \"./services/asg/galleryNotices\"\nexport {MediaLibraryPermissions} from \"./utils/permissions/MediaLibraryPermissions\"\nexport {deriveGalleryDisplayName} from \"./utils/permissions/galleryDisplayName\"\nexport type {\n PhotoInfo,\n CaptureFile,\n CaptureGroup,\n GalleryResponse,\n ServerStatus,\n HealthResponse,\n GalleryEvent,\n} from \"./types/asg\"\n\n// Bluetooth SDK event types host UI subscribes to via engine facades (the\n// BluetoothSdk singleton passthrough itself is internal).\nexport type {PairFailureEvent, GlassesNotReadyEvent} from \"@glassly/bluetooth-sdk\"\n\n// Cloud connection status enum (read model; the connection store is internal).\nexport {WebSocketStatus} from \"./stores/connection\"\n\n// App-list hook layer + pure list helpers (the raw useAppStatusStore and\n// installAppStoreHooks wiring are internal).\nexport {\n DUMMY_APPLET,\n saveAppsOrder,\n getAppsOrder,\n sortAppsByPackageNamePriority,\n saveLastOpenTime,\n getLastOpenTime,\n sortAppsByLastOpenTime,\n useApps,\n useStart,\n useStop,\n useSetForeground,\n useClearForeground,\n useRefresh,\n useStopAll,\n useInstall,\n useUninstall,\n useActiveApps,\n useRunningAlwaysOnApps,\n useActiveBackgroundApps,\n useBackgroundApps,\n useActiveForegroundApp,\n useForegroundApp,\n useActiveBackgroundAppsCount,\n useLocalMiniApps,\n type StartOptions,\n type OrderMap,\n} from \"./stores/apps\"\n\n// Pure dev-miniapp launch-route decision (registration itself is internal).\nexport {\n decideDevLaunchRoute,\n type DecideDevLaunchOptions,\n type DevLaunchResult,\n type DevManifest,\n} from \"./utils/devMiniappLaunch\"\nexport {HardwareCompatibility, type CompatibilityResult} from \"./utils/hardware\"\nexport {BgTimer, throttle, debounce} from \"./utils/timers\"\n\n// Hardware types and capability profiles.\nexport {\n HardwareType,\n HardwareRequirementLevel,\n DeviceTypes,\n ControllerTypes,\n HARDWARE_CAPABILITIES,\n getModelCapabilities,\n simulatedGlasses,\n evenRealitiesG1,\n evenRealitiesG2,\n mentraLive,\n nimo,\n rayneoIO,\n vuzixZ100,\n mentraDisplay,\n} from \"./types\"\nexport type {\n HardwareRequirement,\n CameraCapabilities,\n DisplayCapabilities,\n MicrophoneCapabilities,\n SpeakerCapabilities,\n IMUCapabilities,\n ButtonCapabilities,\n LightCapabilities,\n PowerCapabilities,\n Capabilities,\n AppletType,\n AppPermissionType,\n AppletPermission,\n AppletInterface,\n ClientApp,\n} from \"./types\"\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,2EAA2E;AAC3E,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAA;AAY/B,OAAO,EAAC,uBAAuB,EAAE,iBAAiB,EAAE,eAAe,EAAC,MAAM,wBAAwB,CAAA;AAelG,2EAA2E;AAC3E,6EAA6E;AAC7E,yEAAyE;AACzE,qEAAqE;AACrE,kDAAkD;AAClD,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAE,uBAAuB,EAAC,MAAM,mBAAmB,CAAA;AAC/E,OAAO,EAAC,oBAAoB,EAAE,yBAAyB,EAAC,MAAM,kCAAkC,CAAA;AAEhG,4EAA4E;AAC5E,yEAAyE;AACzE,6EAA6E;AAC7E,OAAO,EAAC,QAAQ,EAAE,kBAAkB,EAAE,gBAAgB,EAAC,MAAM,6BAA6B,CAAA;AAS1F,OAAO,EAAC,wBAAwB,EAAE,gCAAgC,EAAC,MAAM,+BAA+B,CAAA;AAExG,8CAA8C;AAC9C,OAAO,EAAC,oBAAoB,EAAC,MAAM,k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,gBAAgB,EAChB,4BAA4B,EAC5B,gBAAgB,GAGjB,MAAM,eAAe,CAAA;AAEtB,4EAA4E;AAC5E,OAAO,EACL,oBAAoB,GAIrB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAC,qBAAqB,EAA2B,MAAM,kBAAkB,CAAA;AAChF,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAA;AAE1D,0CAA0C;AAC1C,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,aAAa,GACd,MAAM,SAAS,CAAA","sourcesContent":["/**\n * `@glassly/engine` — the OEM-facing main entry.\n *\n * The `engine` namespace (configure/start/stop + typed domain facades), the\n * public contract/read-model types, and the pure helpers host UI legitimately\n * renders with (decision functions, sort/order helpers, policy constants,\n * capability tables, timers). Judgment rule: read models, commands, pure\n * functions and types belong here; anything that mutates runtime state or\n * exposes a raw store/service remains private to the Glassly host.\n * See cloud/docs/issues/020-glasses-status-boundary/integration-review.md §D.\n */\n\n// The namespaced OEM-facing engine API (the \"(A) host API\"). See ./engine.\nexport {engine} from \"./engine\"\nexport type {\n ReportAttachmentInput,\n ReportContext,\n ReportDetails,\n ReportStatus,\n ReportTrigger,\n ReportSubmitResult,\n EngineSubmitReportInput,\n} from \"./facades/reports\"\nexport type {IslandNotification, IslandNotificationKind} from \"./facades/notifications\"\nexport type {PresentationOwner} from \"./services/notifications/notificationPolicy\"\nexport {DEFAULT_HIDDEN_PACKAGES, isGatedByDevTools, isSystemMiniapp} from \"./stores/appVisibility\"\nexport type {WifiSearchResult} from \"./facades/glassesWifi\"\nexport type {IdentitySnapshot} from \"./services/PairingIdentity\"\nexport type {DisplayMirrorEvent} from \"./facades/displayMirror\"\nexport type {\n IslandConfigureOptions,\n IslandAuth,\n IslandConfigValues,\n IslandAnalytics,\n IslandUiSeams,\n ScanQrOptions,\n ScanQrResult,\n SubjectTokenType,\n} from \"./runtime/bootstrap\"\n\n// Settings contract: the typed key registry (schema descriptors — the same\n// surface engine.settings.descriptor()/keys() reads), the per-key React hook\n// (the hook layer, same precedent as the apps hooks below), and the pure\n// device-model key helpers. The raw useSettingsStore stays internal;\n// imperative access goes through engine.settings.\nexport {SETTINGS, useSetting, AI_DATA_CONSENT_VERSION} from \"./stores/settings\"\nexport {isCfwFirmwareVersion, isCustomDashboardEligible} from \"./services/pages/pageEligibility\"\n\n// AI tier registry: the curated per-tier model dropdown options and helpers\n// the Settings > AI Models screen renders. Resolution itself runs inside\n// LocalMiniappRuntime; the screen only reads/writes the ai_model_* settings.\nexport {AI_TIERS, TIER_MODEL_OPTIONS, parseTierSetting} from \"./services/AiTierResolution\"\nexport type {AiTier, AiTierProvider, TierModelOption} from \"./services/AiTierResolution\"\n\n// Shared user memory timeline (engine.memory / Settings > Memory). Entry and\n// session shapes are canonical in @glassly/miniapp (the session.memory\n// surface); the stats read model is engine-side.\nexport type {MemoryStats} from \"./services/MemoryStore\"\nexport type {SpeakerProfile} from \"./services/SpeakerProfileStore\"\nexport type {EnrollOutcome} from \"./facades/speakers\"\nexport {MENTRA_LIVE_SETTING_KEYS, getBluetoothSettingKeysForDevice} from \"./stores/bluetoothSettingKeys\"\n\n// Runtime-shared constants and contract DTOs.\nexport {ISLAND_SETTINGS_KEYS} from \"./runtime/config\"\nexport type {CloudClientStatusSnapshot, MiniappAuthToken, InteropAuditEvent, TtsSynthesisResult} from \"./runtime/config\"\n\n// Pure readiness predicates over glasses connection state.\nexport {\n isGlassesConnected,\n isGlassesReady,\n isGlassesLinkLayerBusy,\n waitForGlassesReady,\n type GlassesConnectionStatus,\n type WaitForGlassesReadyOptions,\n} from \"./services/GlassesReadiness\"\n// Pure connect/reconnect decision helpers (host UI renders the outcome).\nexport {\n decideReconnect,\n decideConnectButtonAction,\n type ReconnectDecision,\n type ReconnectDecisionInput,\n type ConnectButtonAction,\n} from \"./services/ConnectionCoordinator\"\n\n// OTA read-model types for host OTA UI (progress screen, error mapping,\n// progress section) — the check/install machinery itself is internal.\nexport type {\n VersionInfo,\n MtkPatch,\n BesFirmware,\n VersionJson,\n OtaCheckResult,\n OtaCheckCurrentGlassesResult,\n OtaCheckCurrentGlassesOptions,\n} from \"./services/OtaUpdateCheckService\"\n// OTA install policy (watchdog timings + failure copy) + display-state\n// derivation, consumed by the OTA screens and their tests.\nexport {\n MINIMUM_OTA_STATUS_BUILD,\n MAX_RETRIES,\n RETRY_INTERVAL_MS,\n PROGRESS_TIMEOUT_MS,\n DOWNLOAD_STUCK_TIMEOUT_MS,\n MTK_INSTALL_TIMEOUT_MS,\n GLOBAL_OTA_TIMEOUT_MS,\n PING_INTERVAL_MS,\n QUERY_REPLY_TIMEOUT_MS,\n BES_RESTART_TIMEOUT_MS,\n OtaProgressMessages,\n} from \"./services/otaInstallPolicy\"\nexport {deriveDisplayState} from \"./services/otaDisplayState\"\nexport type {DisplayState} from \"./services/otaDisplayState\"\nexport type {\n OtaProgress,\n OtaProgressStatus,\n OtaStatus,\n OtaUpdateInfo,\n ReleaseChangelog,\n OtaSnapshot,\n OtaInstallSnapshot,\n} from \"./facades/ota\"\nexport {\n beginOtaAutoChain,\n clearOtaAutoChainReconnectWait,\n isOtaAutoChainActive,\n otaAutoChainFingerprint,\n otaAutoChainReconnectWaitRemaining,\n stopOtaAutoChain,\n tryAdvanceOtaAutoChain,\n MAX_OTA_AUTO_CHAIN_PASSES,\n OTA_AUTO_CHAIN_RECONNECT_TIMEOUT_MS,\n} from \"./services/OtaAutoChain\"\nexport type {OtaAutoChainAdvanceResult} from \"./services/OtaAutoChain\"\nexport {\n BES_INSTALL_RESTART_MESSAGE,\n getOtaErrorMessage,\n shouldRequireGlassesRebootForBesFailure,\n shouldShowChangeWifiForOtaDownloadFailure,\n} from \"./services/OtaErrorMapping\"\n\n// Gallery read models: engine.gallery.onNotice payload types, the media\n// permission helper + display-name derivation host gallery UI uses, and the\n// glasses-camera DTO types (re-exported through the host @/types/asg shim).\nexport type {GalleryNotice, GalleryNoticeCode} from \"./services/asg/galleryNotices\"\nexport {MediaLibraryPermissions} from \"./utils/permissions/MediaLibraryPermissions\"\nexport {deriveGalleryDisplayName} from \"./utils/permissions/galleryDisplayName\"\nexport type {\n PhotoInfo,\n CaptureFile,\n CaptureGroup,\n GalleryResponse,\n ServerStatus,\n HealthResponse,\n GalleryEvent,\n} from \"./types/asg\"\n\n// Bluetooth SDK event types host UI subscribes to via engine facades (the\n// BluetoothSdk singleton passthrough itself is internal).\nexport type {PairFailureEvent, GlassesNotReadyEvent} from \"@glassly/bluetooth-sdk\"\n\n// Cloud connection status enum (read model; the connection store is internal).\nexport {WebSocketStatus} from \"./stores/connection\"\n\n// App-list hook layer + pure list helpers (the raw useAppStatusStore and\n// installAppStoreHooks wiring are internal).\nexport {\n DUMMY_APPLET,\n saveAppsOrder,\n getAppsOrder,\n sortAppsByPackageNamePriority,\n saveLastOpenTime,\n getLastOpenTime,\n sortAppsByLastOpenTime,\n useApps,\n useStart,\n useStop,\n useSetForeground,\n useClearForeground,\n useRefresh,\n useStopAll,\n useInstall,\n useUninstall,\n useActiveApps,\n useRunningAlwaysOnApps,\n useActiveBackgroundApps,\n useBackgroundApps,\n useActiveForegroundApp,\n useForegroundApp,\n useActiveBackgroundAppsCount,\n useLocalMiniApps,\n type StartOptions,\n type OrderMap,\n} from \"./stores/apps\"\n\n// Pure dev-miniapp launch-route decision (registration itself is internal).\nexport {\n decideDevLaunchRoute,\n type DecideDevLaunchOptions,\n type DevLaunchResult,\n type DevManifest,\n} from \"./utils/devMiniappLaunch\"\nexport {HardwareCompatibility, type CompatibilityResult} from \"./utils/hardware\"\nexport {BgTimer, throttle, debounce} from \"./utils/timers\"\n\n// Hardware types and capability profiles.\nexport {\n HardwareType,\n HardwareRequirementLevel,\n DeviceTypes,\n ControllerTypes,\n HARDWARE_CAPABILITIES,\n getModelCapabilities,\n simulatedGlasses,\n evenRealitiesG1,\n evenRealitiesG2,\n mentraLive,\n nimo,\n rayneoIO,\n vuzixZ100,\n mentraDisplay,\n} from \"./types\"\nexport type {\n HardwareRequirement,\n CameraCapabilities,\n DisplayCapabilities,\n MicrophoneCapabilities,\n SpeakerCapabilities,\n IMUCapabilities,\n ButtonCapabilities,\n LightCapabilities,\n PowerCapabilities,\n Capabilities,\n AppletType,\n AppPermissionType,\n AppletPermission,\n AppletInterface,\n ClientApp,\n} from \"./types\"\n"]}
@@ -31,9 +31,9 @@ export interface IslandAuth {
31
31
  onSessionExpired?: () => void;
32
32
  }
33
33
  export interface IslandConfigValues {
34
- /** cloud-v2 core service base URL (defaults resolved by the cloud client). */
34
+ /** cloud core service base URL (defaults resolved by the cloud client). */
35
35
  coreUrl?: string;
36
- /** cloud-v2 runtime service base URL. */
36
+ /** cloud runtime service base URL. */
37
37
  runtimeUrl?: string;
38
38
  /** OEM identifier (Glassly is OEM #0); reserved for OEM auth/telemetry. */
39
39
  oemId?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../src/runtime/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,SAAS,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAErE,MAAM,WAAW,UAAU;IACzB,iFAAiF;IACjF,eAAe,EAAE,MAAM,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,gBAAgB,CAAA;KAAC,CAAC,CAAA;IACvE;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAC,GAAG,IAAI,KAAK,IAAI,KAAK,OAAO,CAAA;IACvG;;;;;;;OAO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,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAA;IACpE,CAAC;IACD,OAAO,GAAG,IAAI,CAAA;AAChB,CAAC;AAED,6BAA6B;AAC7B,MAAM,CAAC,KAAK,UAAU,IAAI;IACxB,OAAO,GAAG,KAAK,CAAA;AACjB,CAAC;AAED,MAAM,UAAU,SAAS;IACvB,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,aAAa;IAC3B,OAAO,GAAG,IAAI,CAAA;IACd,OAAO,GAAG,KAAK,CAAA;AACjB,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,OAAO;IACrB,OAAO,OAAO,EAAE,IAAI,IAAI,IAAI,CAAA;AAC9B,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,OAAO,OAAO,EAAE,MAAM,IAAI,EAAE,CAAA;AAC9B,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,OAAO,OAAO,EAAE,SAAS,IAAI,IAAI,CAAA;AACnC,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,UAAU;IACxB,OAAO,OAAO,EAAE,EAAE,IAAI,EAAE,CAAA;AAC1B,CAAC","sourcesContent":["/**\n * Bootstrap — the engine's single front door (`engine.configure` / `start` / `stop`).\n *\n * The host hands engine auth + config + analytics in one call; engine owns the\n * runtime construction behind `start()`. Internal services read this holder\n * directly instead of exposing host-facing adapter bags.\n */\n\nexport type SubjectTokenType = \"supabase\" | \"authing\" | (string & {})\n\nexport interface IslandAuth {\n /** Returns the host's current (auto-refreshed) subject token for the backend. */\n getSubjectToken: () => Promise<{token: string; type: SubjectTokenType}>\n /**\n * Optional auth-session listener. Hosts that can emit auth changes should\n * wire this so engine can reconnect backend sessions after restored login\n * state lands post-boot.\n */\n onStateChange?: (callback: (event: string, session: {token?: string | null} | null) => void) => unknown\n /**\n * Optional dead-session hook. Fired when the cloud client's credentials are\n * unrecoverable (refresh AND subject-token exchange both failed — e.g. the\n * backend rejected tokens minted by a different environment, or the session\n * was revoked). The host should sign the user out and route back to login;\n * without this the app keeps looking signed-in while every cloud feature\n * silently fails.\n */\n onSessionExpired?: () => void\n}\n\nexport interface IslandConfigValues {\n /** cloud-v2 core service base URL (defaults resolved by the cloud client). */\n coreUrl?: string\n /** cloud-v2 runtime service base URL. */\n runtimeUrl?: string\n /** OEM identifier (Glassly is OEM #0); reserved for OEM auth/telemetry. */\n oemId?: string\n /**\n * LC3 frame size (bytes) the phone's mic encoder emits — announced to the\n * cloud on connect (20 for G1, 40 for G2, …). Defaults to 20 if unset.\n */\n audioFrameSizeBytes?: number\n /**\n * Dev-only live Metro/LAN host used to repair persisted local-miniapp dev URLs\n * after the laptop changes networks. Omitted in production/OEM builds.\n */\n devServerHost?: () => string | undefined\n}\n\nexport type IslandAnalytics = (event: string, props?: Record<string, unknown>) => void\n\n/**\n * Named host-UI seams: engine dispatches the runtime request, the host owns the\n * screen/navigation/branding. Keep each entry a single narrow purpose — this is\n * a contract of specific UI capabilities, not a generic runtime-hook bag.\n */\nexport interface IslandUiSeams {\n /**\n * `session.glasses.requestWifiSetup` — open the host's glasses Wi-Fi setup\n * flow. Absent ⇒ miniapps get NOT_IMPLEMENTED for the request.\n */\n requestWifiSetup?: (reason?: string, packageName?: string) => Promise<void> | void\n /**\n * `session.system.scanQr` — open a phone-camera QR scanner overlay. Must NOT\n * clear miniapp foreground: UI_CLOSE on a live call hangs it up. Absent ⇒\n * miniapps get NOT_IMPLEMENTED.\n */\n scanQr?: (options?: ScanQrOptions) => Promise<ScanQrResult>\n}\n\nexport interface ScanQrOptions {\n title?: string\n hint?: string\n}\n\nexport type ScanQrResult = {data: string} | {cancelled: true}\n\nexport interface IslandConfigureOptions {\n /** REQUIRED — the only must-have seam. The host owns login; engine owns the rest. */\n auth: IslandAuth\n config?: IslandConfigValues\n analytics?: IslandAnalytics\n ui?: IslandUiSeams\n}\n\nlet options: IslandConfigureOptions | null = null\nlet started = false\n\n/**\n * Hand engine its auth + config + analytics. Call once, before `start()`.\n *\n * Reconfiguring a RUNNING runtime is not supported: services capture pieces of\n * this config as they build (e.g. the cloud client's endpoints), so swapping the\n * options mid-run would split-brain the runtime (`getAuth()`/`getConfigValues()`\n * report values the running services never consumed). Ignored with a warning\n * while started; after `stop()`, `configure()` + `start()` begin a fresh cycle.\n */\nexport function configure(opts: IslandConfigureOptions): void {\n if (started) {\n console.warn(\"engine.configure() called after engine.start(); ignored — stop() the runtime before reconfiguring\")\n return\n }\n options = opts\n}\n\n/**\n * Merge host-UI seams after configure/start. UI capabilities (scan overlay,\n * wifi setup) are looked up per request, so this is safe on a running runtime.\n * Used so Metro reloads can attach seams that missed the original configure().\n */\nexport function updateUiSeams(ui: IslandUiSeams): void {\n if (!options) {\n console.warn(\"engine.updateUiSeams() called before engine.configure(); ignored\")\n return\n }\n options = {...options, ui: {...options.ui, ...ui}}\n}\n\n/** Mark the runtime started. Idempotent. */\nexport async function start(): Promise<void> {\n if (started) return\n if (!options) {\n throw new Error(\"engine.start() called before engine.configure()\")\n }\n started = true\n}\n\n/** Tear down. Idempotent. */\nexport async function stop(): Promise<void> {\n started = false\n}\n\nexport function isStarted(): boolean {\n return started\n}\n\n/** Test-only: wipe configure state so suites can start from a cold host. */\nexport function resetForTests(): void {\n options = null\n started = false\n}\n\n/** The host-supplied auth provider, or null if not configured yet. */\nexport function getAuth(): IslandAuth | null {\n return options?.auth ?? null\n}\n\nexport function getConfigValues(): IslandConfigValues {\n return options?.config ?? {}\n}\n\nexport function getAnalytics(): IslandAnalytics | null {\n return options?.analytics ?? null\n}\n\n/** The host-supplied UI seams ({} until configure() provides them). */\nexport function getUiSeams(): IslandUiSeams {\n return options?.ui ?? {}\n}\n"]}
1
+ {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../src/runtime/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA+EH,IAAI,OAAO,GAAkC,IAAI,CAAA;AACjD,IAAI,OAAO,G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AI,IAAI,CAAA;AACnC,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,UAAU;IACxB,OAAO,OAAO,EAAE,EAAE,IAAI,EAAE,CAAA;AAC1B,CAAC","sourcesContent":["/**\n * Bootstrap — the engine's single front door (`engine.configure` / `start` / `stop`).\n *\n * The host hands engine auth + config + analytics in one call; engine owns the\n * runtime construction behind `start()`. Internal services read this holder\n * directly instead of exposing host-facing adapter bags.\n */\n\nexport type SubjectTokenType = \"supabase\" | \"authing\" | (string & {})\n\nexport interface IslandAuth {\n /** Returns the host's current (auto-refreshed) subject token for the backend. */\n getSubjectToken: () => Promise<{token: string; type: SubjectTokenType}>\n /**\n * Optional auth-session listener. Hosts that can emit auth changes should\n * wire this so engine can reconnect backend sessions after restored login\n * state lands post-boot.\n */\n onStateChange?: (callback: (event: string, session: {token?: string | null} | null) => void) => unknown\n /**\n * Optional dead-session hook. Fired when the cloud client's credentials are\n * unrecoverable (refresh AND subject-token exchange both failed — e.g. the\n * backend rejected tokens minted by a different environment, or the session\n * was revoked). The host should sign the user out and route back to login;\n * without this the app keeps looking signed-in while every cloud feature\n * silently fails.\n */\n onSessionExpired?: () => void\n}\n\nexport interface IslandConfigValues {\n /** cloud core service base URL (defaults resolved by the cloud client). */\n coreUrl?: string\n /** cloud runtime service base URL. */\n runtimeUrl?: string\n /** OEM identifier (Glassly is OEM #0); reserved for OEM auth/telemetry. */\n oemId?: string\n /**\n * LC3 frame size (bytes) the phone's mic encoder emits — announced to the\n * cloud on connect (20 for G1, 40 for G2, …). Defaults to 20 if unset.\n */\n audioFrameSizeBytes?: number\n /**\n * Dev-only live Metro/LAN host used to repair persisted local-miniapp dev URLs\n * after the laptop changes networks. Omitted in production/OEM builds.\n */\n devServerHost?: () => string | undefined\n}\n\nexport type IslandAnalytics = (event: string, props?: Record<string, unknown>) => void\n\n/**\n * Named host-UI seams: engine dispatches the runtime request, the host owns the\n * screen/navigation/branding. Keep each entry a single narrow purpose — this is\n * a contract of specific UI capabilities, not a generic runtime-hook bag.\n */\nexport interface IslandUiSeams {\n /**\n * `session.glasses.requestWifiSetup` — open the host's glasses Wi-Fi setup\n * flow. Absent ⇒ miniapps get NOT_IMPLEMENTED for the request.\n */\n requestWifiSetup?: (reason?: string, packageName?: string) => Promise<void> | void\n /**\n * `session.system.scanQr` — open a phone-camera QR scanner overlay. Must NOT\n * clear miniapp foreground: UI_CLOSE on a live call hangs it up. Absent ⇒\n * miniapps get NOT_IMPLEMENTED.\n */\n scanQr?: (options?: ScanQrOptions) => Promise<ScanQrResult>\n}\n\nexport interface ScanQrOptions {\n title?: string\n hint?: string\n}\n\nexport type ScanQrResult = {data: string} | {cancelled: true}\n\nexport interface IslandConfigureOptions {\n /** REQUIRED — the only must-have seam. The host owns login; engine owns the rest. */\n auth: IslandAuth\n config?: IslandConfigValues\n analytics?: IslandAnalytics\n ui?: IslandUiSeams\n}\n\nlet options: IslandConfigureOptions | null = null\nlet started = false\n\n/**\n * Hand engine its auth + config + analytics. Call once, before `start()`.\n *\n * Reconfiguring a RUNNING runtime is not supported: services capture pieces of\n * this config as they build (e.g. the cloud client's endpoints), so swapping the\n * options mid-run would split-brain the runtime (`getAuth()`/`getConfigValues()`\n * report values the running services never consumed). Ignored with a warning\n * while started; after `stop()`, `configure()` + `start()` begin a fresh cycle.\n */\nexport function configure(opts: IslandConfigureOptions): void {\n if (started) {\n console.warn(\"engine.configure() called after engine.start(); ignored — stop() the runtime before reconfiguring\")\n return\n }\n options = opts\n}\n\n/**\n * Merge host-UI seams after configure/start. UI capabilities (scan overlay,\n * wifi setup) are looked up per request, so this is safe on a running runtime.\n * Used so Metro reloads can attach seams that missed the original configure().\n */\nexport function updateUiSeams(ui: IslandUiSeams): void {\n if (!options) {\n console.warn(\"engine.updateUiSeams() called before engine.configure(); ignored\")\n return\n }\n options = {...options, ui: {...options.ui, ...ui}}\n}\n\n/** Mark the runtime started. Idempotent. */\nexport async function start(): Promise<void> {\n if (started) return\n if (!options) {\n throw new Error(\"engine.start() called before engine.configure()\")\n }\n started = true\n}\n\n/** Tear down. Idempotent. */\nexport async function stop(): Promise<void> {\n started = false\n}\n\nexport function isStarted(): boolean {\n return started\n}\n\n/** Test-only: wipe configure state so suites can start from a cold host. */\nexport function resetForTests(): void {\n options = null\n started = false\n}\n\n/** The host-supplied auth provider, or null if not configured yet. */\nexport function getAuth(): IslandAuth | null {\n return options?.auth ?? null\n}\n\nexport function getConfigValues(): IslandConfigValues {\n return options?.config ?? {}\n}\n\nexport function getAnalytics(): IslandAnalytics | null {\n return options?.analytics ?? null\n}\n\n/** The host-supplied UI seams ({} until configure() provides them). */\nexport function getUiSeams(): IslandUiSeams {\n return options?.ui ?? {}\n}\n"]}
@@ -5,12 +5,12 @@
5
5
  *
6
6
  * Failure mode this protects:
7
7
  * 1. Local captions subscribes to transcription.
8
- * 2. The first Cloud V2 `PUT /api/audio/subscriptions` throws while the socket
8
+ * 2. The first Cloud `PUT /api/audio/subscriptions` throws while the socket
9
9
  * is reconnecting or Core is briefly unreachable.
10
10
  * 3. A reconnect/resync recomputes the same desired subscription set.
11
11
  *
12
12
  * If we mark the set as "last applied" before the PUT succeeds, step 3 is
13
- * incorrectly deduped and captions can wait forever even though Cloud V2 later
13
+ * incorrectly deduped and captions can wait forever even though Cloud later
14
14
  * reconnects. So `begin()` only blocks exact duplicates while a write is in
15
15
  * flight; only `succeeded()` promotes that key to the applied state.
16
16
  */