@mentra/engine 3.2.0-dev.255 → 3.2.0-dev.261
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/facades/displayMirror.js +1 -1
- package/build/facades/displayMirror.js.map +1 -1
- package/build/generated/releaseMetadata.js +5 -5
- package/build/generated/releaseMetadata.js.map +1 -1
- package/build/services/DisplayProcessor.d.ts +1 -1
- package/build/services/DisplayProcessor.js.map +1 -1
- package/build/services/LocalDisplayManager.d.ts +0 -4
- package/build/services/LocalDisplayManager.d.ts.map +1 -1
- package/build/services/LocalDisplayManager.js +2 -7
- package/build/services/LocalDisplayManager.js.map +1 -1
- package/build/services/LocalMiniappRuntime.d.ts +7 -21
- package/build/services/LocalMiniappRuntime.d.ts.map +1 -1
- package/build/services/LocalMiniappRuntime.js +9 -93
- package/build/services/LocalMiniappRuntime.js.map +1 -1
- package/build/services/MentraJSRouter.d.ts +5 -9
- package/build/services/MentraJSRouter.d.ts.map +1 -1
- package/build/services/MentraJSRouter.js +5 -9
- package/build/services/MentraJSRouter.js.map +1 -1
- package/build/services/MentraUIRouter.d.ts +9 -12
- package/build/services/MentraUIRouter.d.ts.map +1 -1
- package/build/services/MentraUIRouter.js +9 -12
- package/build/services/MentraUIRouter.js.map +1 -1
- package/build/services/MiniappLauncher.d.ts +6 -9
- package/build/services/MiniappLauncher.d.ts.map +1 -1
- package/build/services/MiniappLauncher.js +6 -9
- package/build/services/MiniappLauncher.js.map +1 -1
- package/build/services/PhoneLocationService.d.ts +2 -2
- package/build/services/PhoneLocationService.d.ts.map +1 -1
- package/build/services/PhoneLocationService.js +5 -9
- package/build/services/PhoneLocationService.js.map +1 -1
- package/build/services/PhoneStreamCoordinator.d.ts +1 -2
- package/build/services/PhoneStreamCoordinator.d.ts.map +1 -1
- package/build/services/PhoneStreamCoordinator.js +1 -2
- package/build/services/PhoneStreamCoordinator.js.map +1 -1
- package/build/services/slimStreamStatus.d.ts +4 -1
- package/build/services/slimStreamStatus.d.ts.map +1 -1
- package/build/services/slimStreamStatus.js +4 -1
- package/build/services/slimStreamStatus.js.map +1 -1
- package/build/stores/apps.js +2 -2
- package/build/stores/apps.js.map +1 -1
- package/build/utils/miniappGlobals.d.ts +3 -5
- package/build/utils/miniappGlobals.d.ts.map +1 -1
- package/build/utils/miniappGlobals.js +3 -5
- package/build/utils/miniappGlobals.js.map +1 -1
- package/package.json +8 -8
- package/src/facades/displayMirror.ts +1 -1
- package/src/generated/releaseMetadata.ts +5 -5
- package/src/services/DisplayProcessor.ts +1 -1
- package/src/services/LocalDisplayManager.ts +2 -7
- package/src/services/LocalMiniappRuntime.ts +9 -103
- package/src/services/MentraJSRouter.ts +5 -9
- package/src/services/MentraUIRouter.ts +9 -12
- package/src/services/MiniappLauncher.ts +6 -9
- package/src/services/PhoneLocationService.ts +5 -9
- package/src/services/PhoneStreamCoordinator.ts +1 -2
- package/src/services/slimStreamStatus.ts +4 -1
- package/src/stores/apps.ts +2 -2
- package/src/utils/miniappGlobals.ts +3 -5
|
@@ -50,14 +50,13 @@ interface BoundWebView {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* push a fresh authoritative snapshot.
|
|
53
|
+
* The host mounts at most one miniapp UI WebView at a time. Its background
|
|
54
|
+
* JSContext runs separately on the phone and can remain alive after UI closure.
|
|
55
|
+
* UI closure unbinds the WebView and sends UI_CLOSE; on iOS the host also exits
|
|
56
|
+
* the UI when `onContentProcessDidTerminate` reports a content-process exit.
|
|
57
|
+
* The host may re-announce UI_OPEN after app resume or background dev respawn
|
|
58
|
+
* so the background can push a fresh snapshot. This router has no WebView
|
|
59
|
+
* heartbeat timeout.
|
|
61
60
|
*/
|
|
62
61
|
|
|
63
62
|
export class MentraUIRouter {
|
|
@@ -85,9 +84,8 @@ export class MentraUIRouter {
|
|
|
85
84
|
}
|
|
86
85
|
|
|
87
86
|
/**
|
|
88
|
-
* Called when the
|
|
89
|
-
*
|
|
90
|
-
* so handlers can flush state, then drops the binding.
|
|
87
|
+
* Called when the host tears down the WebView. Drops the binding and
|
|
88
|
+
* sends UI_CLOSE to the background so handlers can flush state.
|
|
91
89
|
*/
|
|
92
90
|
unbindWebView(packageName: string): void {
|
|
93
91
|
if (!this.bindings.has(packageName)) return
|
|
@@ -123,7 +121,6 @@ export class MentraUIRouter {
|
|
|
123
121
|
* Recognised envelope types from the WebView shim:
|
|
124
122
|
* - {type: "ready"} → fire UI_OPEN
|
|
125
123
|
* - {type: "msg", seq, channel, payload} → fire UI_MESSAGE
|
|
126
|
-
* - {type: "heartbeat", seq} → silently ack
|
|
127
124
|
*/
|
|
128
125
|
routeFromWebView(packageName: string, rawJson: string): void {
|
|
129
126
|
let env: {
|
|
@@ -317,12 +317,9 @@ class MiniappLauncher {
|
|
|
317
317
|
/**
|
|
318
318
|
* Re-spawn local miniapps that were running when the app was last killed.
|
|
319
319
|
*
|
|
320
|
-
*
|
|
321
|
-
*
|
|
322
|
-
*
|
|
323
|
-
* the phone's own JS engine — a host-process kill tears down their JSContext
|
|
324
|
-
* and there is no server to resurrect them, so without this they silently
|
|
325
|
-
* stay stopped on the next launch even though the user left them running.
|
|
320
|
+
* Every miniapp runs as local JavaScript in the Mentra App on the phone.
|
|
321
|
+
* A host-process kill tears down its JSContext, so without this restoration
|
|
322
|
+
* it stays stopped on the next launch even though the user left it running.
|
|
326
323
|
*
|
|
327
324
|
* Each local miniapp persists its running flag to disk on start/stop
|
|
328
325
|
* (`saveLocalAppRunningState`, via the applet's `onStart`/`onStop`). We read
|
|
@@ -331,9 +328,9 @@ class MiniappLauncher {
|
|
|
331
328
|
* tray/switcher project it as running, exactly as a normal start would. The
|
|
332
329
|
* WebView, if any, re-attaches lazily when the user opens the app.
|
|
333
330
|
*
|
|
334
|
-
* Idempotent and best-effort: skips already-spawned contexts
|
|
335
|
-
* persisted flag
|
|
336
|
-
*
|
|
331
|
+
* Idempotent and best-effort: skips already-spawned contexts and clears the
|
|
332
|
+
* persisted running flag if ensureRunning fails (for example, bundle resolution,
|
|
333
|
+
* deployment policy, or context spawning) so it does not retry every boot.
|
|
337
334
|
* Not compatibility-gated: a previously-running background app shouldn't be
|
|
338
335
|
* dropped just because glasses are momentarily disconnected at boot — it
|
|
339
336
|
* resumes when they reconnect, same as mid-session.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Phone location service — engine-owned. Owns the background phone-GPS task: the
|
|
3
3
|
* accuracy-tier control (`setLocationTier`), the accuracy mapping, and the
|
|
4
|
-
* `expo-task-manager` background task that
|
|
5
|
-
* local miniapps (`location_update`). Cloud upload was V1 (removed).
|
|
4
|
+
* `expo-task-manager` background task that forwards the first fix in each batch
|
|
5
|
+
* to subscribed local miniapps (`location_update`). Cloud upload was V1 (removed).
|
|
6
6
|
*
|
|
7
7
|
* This used to be the host-injected `locationTier` runtime hook + a MantleManager
|
|
8
8
|
* `TaskManager.defineTask`. It's device/OS plumbing (no UI), so it moved into engine:
|
|
@@ -21,8 +21,7 @@ import localMiniappRuntime from "./LocalMiniappRuntime"
|
|
|
21
21
|
|
|
22
22
|
export const LOCATION_TASK_NAME = "handleLocationUpdates"
|
|
23
23
|
|
|
24
|
-
// Background location task —
|
|
25
|
-
// miniapps. (The v1 SocketComms leg was already removed/commented before the move.)
|
|
24
|
+
// Background location task — forwards the first fix from each non-empty batch.
|
|
26
25
|
TaskManager.defineTask<{locations?: Location.LocationObject[]}>(LOCATION_TASK_NAME, async ({data, error}) => {
|
|
27
26
|
if (error) {
|
|
28
27
|
// OS-level failure (permission revoked, GPS unavailable, …) — log it so
|
|
@@ -36,11 +35,8 @@ TaskManager.defineTask<{locations?: Location.LocationObject[]}>(LOCATION_TASK_NA
|
|
|
36
35
|
return
|
|
37
36
|
}
|
|
38
37
|
const first = locs[0]!
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
// Local miniapps get the update directly (the cloud relay never reaches
|
|
42
|
-
// __phone__). The Cloud V1 upload that used to run here was removed with the
|
|
43
|
-
// V1 ripout (issue #3392); a V2 location channel is separate product work.
|
|
38
|
+
// Deliver directly to local miniapps. The Cloud V1 upload that used to run
|
|
39
|
+
// here was removed with the V1 ripout (issue #3392).
|
|
44
40
|
localMiniappRuntime.forwardEvent("location_update", {
|
|
45
41
|
lat: first.coords.latitude,
|
|
46
42
|
lng: first.coords.longitude,
|
|
@@ -23,8 +23,7 @@
|
|
|
23
23
|
*
|
|
24
24
|
* Important: this is the ONLY place that mints `streamId`s for phone-owned
|
|
25
25
|
* streams. We use a `phone-` prefix so they're trivially distinguishable from
|
|
26
|
-
* cloud-minted IDs in logs
|
|
27
|
-
* the legacy path.
|
|
26
|
+
* cloud-minted managed-stream resource IDs in logs.
|
|
28
27
|
*
|
|
29
28
|
* BLE link loss is a SUSPENDED state, not a failure:
|
|
30
29
|
* ASG owns the ten-second phone/controller liveness deadline. The coordinator
|
|
@@ -11,7 +11,10 @@ import type {StreamStatusEvent} from "@mentra/bluetooth-sdk/internal"
|
|
|
11
11
|
*/
|
|
12
12
|
export const ENABLE_PIPELINE_FPS_TELEMETRY = false
|
|
13
13
|
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Select stream-status fields for local miniapps. Include resolvedConfig only
|
|
16
|
+
* when requested by the caller; include stats only when FPS telemetry is enabled.
|
|
17
|
+
*/
|
|
15
18
|
export function slimStreamStatusEvent(
|
|
16
19
|
event: StreamStatusEvent,
|
|
17
20
|
options: {includeResolvedConfig?: boolean; enableFpsTelemetry?: boolean} = {},
|
package/src/stores/apps.ts
CHANGED
|
@@ -381,8 +381,8 @@ export const useAppStatusStore = create<AppStatusState>((set, get) => ({
|
|
|
381
381
|
// side effect of LocalMiniappView mounting on foreground; pulling it here
|
|
382
382
|
// lets start() actually run the app even when nothing foregrounds it (e.g.
|
|
383
383
|
// a system app launching another miniapp via session.miniapps). Idempotent
|
|
384
|
-
// with the view's own ensureRunning;
|
|
385
|
-
//
|
|
384
|
+
// with the view's own ensureRunning; skipped for native offline built-ins
|
|
385
|
+
// (no JS bundle).
|
|
386
386
|
if (app.local) {
|
|
387
387
|
try {
|
|
388
388
|
await miniappLauncher.ensureRunning(packageName)
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* miniappGlobals — shared builder for the window.MentraOS globals injected
|
|
3
|
-
* into
|
|
3
|
+
* into miniapp WebViews in the Mentra App on the phone.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* (webview.tsx for cloud miniapps, MiniappHost.tsx for local miniapps) funnel
|
|
8
|
-
* through this util.
|
|
5
|
+
* Miniapps run locally. This util gives their WebView UI a consistent API
|
|
6
|
+
* for host capabilities, safe-area insets, and capsule-menu geometry.
|
|
9
7
|
*/
|
|
10
8
|
|
|
11
9
|
import {Dimensions, Platform} from "react-native"
|