@mentra/engine 3.1.0-dev.10 → 3.1.0-dev.101
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/README.md +24 -6
- package/build/bluetooth-sdk/ota-transport.d.ts +2 -0
- package/build/bluetooth-sdk/ota-transport.d.ts.map +1 -0
- package/build/bluetooth-sdk/ota-transport.js +2 -0
- package/build/bluetooth-sdk/ota-transport.js.map +1 -0
- package/build/engine.d.ts +5 -2
- package/build/engine.d.ts.map +1 -1
- package/build/facades/ota.d.ts +12 -7
- package/build/facades/ota.d.ts.map +1 -1
- package/build/facades/ota.js +10 -6
- package/build/facades/ota.js.map +1 -1
- package/build/facades/pairing.d.ts +4 -0
- package/build/facades/pairing.d.ts.map +1 -1
- package/build/facades/pairing.js +81 -7
- package/build/facades/pairing.js.map +1 -1
- package/build/generated/releaseMetadata.js +5 -5
- package/build/generated/releaseMetadata.js.map +1 -1
- package/build/index.d.ts +3 -3
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/react/MentraLiveOtaFlow.d.ts +8 -2
- package/build/react/MentraLiveOtaFlow.d.ts.map +1 -1
- package/build/react/MentraLiveOtaFlow.js +256 -354
- package/build/react/MentraLiveOtaFlow.js.map +1 -1
- package/build/react/index.d.ts +1 -0
- package/build/react/index.d.ts.map +1 -1
- package/build/react/index.js +1 -0
- package/build/react/index.js.map +1 -1
- package/build/react/useMentraLiveOta.d.ts +84 -0
- package/build/react/useMentraLiveOta.d.ts.map +1 -0
- package/build/react/useMentraLiveOta.js +627 -0
- package/build/react/useMentraLiveOta.js.map +1 -0
- package/build/services/BlobStore.d.ts +2 -0
- package/build/services/BlobStore.d.ts.map +1 -1
- package/build/services/BlobStore.js +63 -10
- package/build/services/BlobStore.js.map +1 -1
- package/build/services/DisplayProcessor.d.ts +3 -3
- package/build/services/DisplayProcessor.js +3 -3
- package/build/services/DisplayProcessor.js.map +1 -1
- package/build/services/GlassesStatusProjection.d.ts +15 -2
- package/build/services/GlassesStatusProjection.d.ts.map +1 -1
- package/build/services/GlassesStatusProjection.js +3 -3
- package/build/services/GlassesStatusProjection.js.map +1 -1
- package/build/services/HotspotOtaTransport.d.ts.map +1 -1
- package/build/services/HotspotOtaTransport.js +8 -7
- package/build/services/HotspotOtaTransport.js.map +1 -1
- package/build/services/LocalDisplayManager.d.ts +2 -3
- package/build/services/LocalDisplayManager.d.ts.map +1 -1
- package/build/services/LocalDisplayManager.js +2 -3
- package/build/services/LocalDisplayManager.js.map +1 -1
- package/build/services/OtaAutoChain.d.ts +9 -2
- package/build/services/OtaAutoChain.d.ts.map +1 -1
- package/build/services/OtaAutoChain.js +10 -2
- package/build/services/OtaAutoChain.js.map +1 -1
- package/build/services/OtaInstallCoordinator.d.ts +26 -3
- package/build/services/OtaInstallCoordinator.d.ts.map +1 -1
- package/build/services/OtaInstallCoordinator.js +35 -13
- package/build/services/OtaInstallCoordinator.js.map +1 -1
- package/build/services/OtaService.d.ts.map +1 -1
- package/build/services/OtaService.js +1 -1
- package/build/services/OtaService.js.map +1 -1
- package/build/services/OtaUpdateCheckService.d.ts +4 -1
- package/build/services/OtaUpdateCheckService.d.ts.map +1 -1
- package/build/services/OtaUpdateCheckService.js +21 -5
- package/build/services/OtaUpdateCheckService.js.map +1 -1
- package/build/services/PhonePhotoCoordinator.js +1 -1
- package/build/services/PhonePhotoCoordinator.js.map +1 -1
- package/build/services/StreamLifecycleController.d.ts +3 -3
- package/build/services/StreamLifecycleController.js +3 -3
- package/build/services/StreamLifecycleController.js.map +1 -1
- package/build/services/asg/localNetworkTransport.d.ts.map +1 -1
- package/build/services/asg/localNetworkTransport.js +13 -12
- package/build/services/asg/localNetworkTransport.js.map +1 -1
- package/build/services/glassesClockSync.js +1 -1
- package/build/services/glassesClockSync.js.map +1 -1
- package/build/services/otaInstallPolicy.d.ts +4 -0
- package/build/services/otaInstallPolicy.d.ts.map +1 -1
- package/build/services/otaInstallPolicy.js +4 -0
- package/build/services/otaInstallPolicy.js.map +1 -1
- package/build/services/otaReleaseVersion.d.ts +10 -0
- package/build/services/otaReleaseVersion.d.ts.map +1 -0
- package/build/services/otaReleaseVersion.js +14 -0
- package/build/services/otaReleaseVersion.js.map +1 -0
- package/build/stores/appVisibility.d.ts +3 -0
- package/build/stores/appVisibility.d.ts.map +1 -0
- package/build/stores/appVisibility.js +3 -0
- package/build/stores/appVisibility.js.map +1 -0
- package/build/stores/apps.d.ts.map +1 -1
- package/build/stores/apps.js +7 -1
- package/build/stores/apps.js.map +1 -1
- package/build/stores/core.d.ts +3 -3
- package/build/stores/core.d.ts.map +1 -1
- package/build/stores/core.js.map +1 -1
- package/build/stores/glasses.d.ts +10 -4
- package/build/stores/glasses.d.ts.map +1 -1
- package/build/stores/glasses.js.map +1 -1
- package/build/types/applet.d.ts +1 -1
- package/build/types/applet.js +1 -1
- package/build/types/applet.js.map +1 -1
- package/build/types/capabilities/even-realities-g1.d.ts.map +1 -1
- package/build/types/capabilities/even-realities-g1.js +2 -0
- package/build/types/capabilities/even-realities-g1.js.map +1 -1
- package/build/types/capabilities/even-realities-g2.d.ts.map +1 -1
- package/build/types/capabilities/even-realities-g2.js +2 -0
- package/build/types/capabilities/even-realities-g2.js.map +1 -1
- package/build/types/capabilities/mentra-display.d.ts.map +1 -1
- package/build/types/capabilities/mentra-display.js +2 -0
- package/build/types/capabilities/mentra-display.js.map +1 -1
- package/build/types/capabilities/mentra-live.d.ts.map +1 -1
- package/build/types/capabilities/mentra-live.js +2 -0
- package/build/types/capabilities/mentra-live.js.map +1 -1
- package/build/types/capabilities/nimo.d.ts +9 -0
- package/build/types/capabilities/nimo.d.ts.map +1 -0
- package/build/types/capabilities/nimo.js +57 -0
- package/build/types/capabilities/nimo.js.map +1 -0
- package/build/types/capabilities/none.d.ts.map +1 -1
- package/build/types/capabilities/none.js +2 -0
- package/build/types/capabilities/none.js.map +1 -1
- package/build/types/capabilities/simulated-glasses.d.ts.map +1 -1
- package/build/types/capabilities/simulated-glasses.js +2 -0
- package/build/types/capabilities/simulated-glasses.js.map +1 -1
- package/build/types/capabilities/vuzix-z100.d.ts.map +1 -1
- package/build/types/capabilities/vuzix-z100.js +2 -0
- package/build/types/capabilities/vuzix-z100.js.map +1 -1
- package/build/types/enums.d.ts +2 -1
- package/build/types/enums.d.ts.map +1 -1
- package/build/types/enums.js +1 -0
- package/build/types/enums.js.map +1 -1
- package/build/types/hardware.d.ts +3 -2
- package/build/types/hardware.d.ts.map +1 -1
- package/build/types/hardware.js +3 -1
- package/build/types/hardware.js.map +1 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/index.js +1 -1
- package/build/types/index.js.map +1 -1
- package/build/utils/display/composer/ColumnComposer.d.ts +1 -1
- package/build/utils/display/composer/ColumnComposer.js +1 -1
- package/build/utils/display/composer/ColumnComposer.js.map +1 -1
- package/package.json +13 -6
- package/src/bluetooth-sdk/ota-transport.ts +1 -0
- package/src/facades/ota.ts +20 -7
- package/src/facades/pairing.ts +88 -12
- package/src/generated/releaseMetadata.ts +5 -5
- package/src/index.ts +3 -0
- package/src/react/MentraLiveOtaFlow.tsx +378 -480
- package/src/react/index.ts +14 -0
- package/src/react/useMentraLiveOta.ts +793 -0
- package/src/services/BlobStore.ts +57 -10
- package/src/services/DisplayProcessor.ts +3 -3
- package/src/services/GlassesStatusProjection.ts +7 -6
- package/src/services/HotspotOtaTransport.ts +8 -7
- package/src/services/LocalDisplayManager.ts +2 -3
- package/src/services/OtaAutoChain.ts +26 -2
- package/src/services/OtaInstallCoordinator.ts +37 -13
- package/src/services/OtaService.ts +1 -2
- package/src/services/OtaUpdateCheckService.ts +26 -8
- package/src/services/PhonePhotoCoordinator.ts +1 -1
- package/src/services/StreamLifecycleController.ts +3 -3
- package/src/services/asg/localNetworkTransport.ts +20 -19
- package/src/services/glassesClockSync.ts +1 -1
- package/src/services/otaInstallPolicy.ts +4 -0
- package/src/services/otaReleaseVersion.ts +22 -0
- package/src/stores/appVisibility.ts +3 -0
- package/src/stores/apps.ts +7 -1
- package/src/stores/core.ts +4 -4
- package/src/stores/glasses.ts +13 -6
- package/src/types/applet.ts +1 -1
- package/src/types/capabilities/even-realities-g1.ts +3 -0
- package/src/types/capabilities/even-realities-g2.ts +3 -0
- package/src/types/capabilities/mentra-display.ts +3 -0
- package/src/types/capabilities/mentra-live.ts +3 -0
- package/src/types/capabilities/nimo.ts +59 -0
- package/src/types/capabilities/none.ts +3 -0
- package/src/types/capabilities/simulated-glasses.ts +3 -0
- package/src/types/capabilities/vuzix-z100.ts +3 -0
- package/src/types/enums.ts +1 -0
- package/src/types/hardware.ts +4 -2
- package/src/types/index.ts +1 -0
- package/src/utils/display/composer/ColumnComposer.ts +1 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview NIMO hardware capabilities.
|
|
3
|
+
*
|
|
4
|
+
* NIMO uses framed UART-over-BLE for widget content and a separate Opus
|
|
5
|
+
* microphone channel.
|
|
6
|
+
*/
|
|
7
|
+
export const nimo = {
|
|
8
|
+
modelName: "NIMO",
|
|
9
|
+
hasCamera: false,
|
|
10
|
+
camera: null,
|
|
11
|
+
hasDisplay: true,
|
|
12
|
+
display: {
|
|
13
|
+
count: 2,
|
|
14
|
+
isColor: false,
|
|
15
|
+
color: "green",
|
|
16
|
+
canDisplayBitmap: true,
|
|
17
|
+
// Bitmaps render into the 160x160 2bpp navigation widget. The resolution
|
|
18
|
+
// below remains the existing text-display placeholder until hardware
|
|
19
|
+
// screen information is available.
|
|
20
|
+
resolution: { width: 640, height: 400 },
|
|
21
|
+
maxTextLines: 5,
|
|
22
|
+
adjustBrightness: true,
|
|
23
|
+
},
|
|
24
|
+
hasMicrophone: true,
|
|
25
|
+
microphone: {
|
|
26
|
+
count: 2,
|
|
27
|
+
hasVAD: false,
|
|
28
|
+
},
|
|
29
|
+
hasSpeaker: false,
|
|
30
|
+
speaker: null,
|
|
31
|
+
hasIMU: true,
|
|
32
|
+
imu: null,
|
|
33
|
+
hasButton: true,
|
|
34
|
+
button: {
|
|
35
|
+
count: 2,
|
|
36
|
+
buttons: [
|
|
37
|
+
{
|
|
38
|
+
type: "press",
|
|
39
|
+
events: ["press", "double_press", "long_press"],
|
|
40
|
+
isCapacitive: true,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
type: "press",
|
|
44
|
+
events: ["press", "double_press", "long_press"],
|
|
45
|
+
isCapacitive: true,
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
hasLight: false,
|
|
50
|
+
light: null,
|
|
51
|
+
power: {
|
|
52
|
+
hasExternalBattery: false,
|
|
53
|
+
},
|
|
54
|
+
hasWifi: false,
|
|
55
|
+
hasOta: false,
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=nimo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nimo.js","sourceRoot":"","sources":["../../../src/types/capabilities/nimo.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,CAAC,MAAM,IAAI,GAAiB;IAChC,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,KAAK;IAChB,MAAM,EAAE,IAAI;IACZ,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE;QACP,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,OAAO;QACd,gBAAgB,EAAE,IAAI;QACtB,yEAAyE;QACzE,qEAAqE;QACrE,mCAAmC;QACnC,UAAU,EAAE,EAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAC;QACrC,YAAY,EAAE,CAAC;QACf,gBAAgB,EAAE,IAAI;KACvB;IACD,aAAa,EAAE,IAAI;IACnB,UAAU,EAAE;QACV,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,KAAK;KACd;IACD,UAAU,EAAE,KAAK;IACjB,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,IAAI;IACZ,GAAG,EAAE,IAAI;IACT,SAAS,EAAE,IAAI;IACf,MAAM,EAAE;QACN,KAAK,EAAE,CAAC;QACR,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,OAAO;gBACb,MAAM,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,YAAY,CAAC;gBAC/C,YAAY,EAAE,IAAI;aACnB;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,MAAM,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,YAAY,CAAC;gBAC/C,YAAY,EAAE,IAAI;aACnB;SACF;KACF;IACD,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,IAAI;IACX,KAAK,EAAE;QACL,kBAAkB,EAAE,KAAK;KAC1B;IACD,OAAO,EAAE,KAAK;IACd,MAAM,EAAE,KAAK;CACd,CAAA","sourcesContent":["/**\n * @fileoverview NIMO hardware capabilities.\n *\n * NIMO uses framed UART-over-BLE for widget content and a separate Opus\n * microphone channel.\n */\n\nimport type {Capabilities} from \"../hardware\"\n\nexport const nimo: Capabilities = {\n modelName: \"NIMO\",\n hasCamera: false,\n camera: null,\n hasDisplay: true,\n display: {\n count: 2,\n isColor: false,\n color: \"green\",\n canDisplayBitmap: true,\n // Bitmaps render into the 160x160 2bpp navigation widget. The resolution\n // below remains the existing text-display placeholder until hardware\n // screen information is available.\n resolution: {width: 640, height: 400},\n maxTextLines: 5,\n adjustBrightness: true,\n },\n hasMicrophone: true,\n microphone: {\n count: 2,\n hasVAD: false,\n },\n hasSpeaker: false,\n speaker: null,\n hasIMU: true,\n imu: null,\n hasButton: true,\n button: {\n count: 2,\n buttons: [\n {\n type: \"press\",\n events: [\"press\", \"double_press\", \"long_press\"],\n isCapacitive: true,\n },\n {\n type: \"press\",\n events: [\"press\", \"double_press\", \"long_press\"],\n isCapacitive: true,\n },\n ],\n },\n hasLight: false,\n light: null,\n power: {\n hasExternalBattery: false,\n },\n hasWifi: false,\n hasOta: false,\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"none.d.ts","sourceRoot":"","sources":["../../../src/types/capabilities/none.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"none.d.ts","sourceRoot":"","sources":["../../../src/types/capabilities/none.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,IAAI,EAAE,YAiElB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"none.js","sourceRoot":"","sources":["../../../src/types/capabilities/none.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAiB;IAChC,SAAS,EAAE,MAAM;IAEjB,+CAA+C;IAC/C,SAAS,EAAE,KAAK;IAChB,MAAM,EAAE,IAAI;IAEZ,wDAAwD;IACxD,UAAU,EAAE,KAAK;IACjB,OAAO,EAAE;QACP,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,OAAO;QACd,gBAAgB,EAAE,KAAK;QACvB,UAAU,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;QACvC,WAAW,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;QAC/B,YAAY,EAAE,CAAC;QACf,gBAAgB,EAAE,IAAI;KACvB;IAED,yDAAyD;IACzD,aAAa,EAAE,KAAK;IACpB,UAAU,EAAE;QACV,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,KAAK;KACd;IAED,uDAAuD;IACvD,UAAU,EAAE,KAAK;IACjB,OAAO,EAAE;QACP,KAAK,EAAE,CAAC;QACR,SAAS,EAAE,KAAK;KACjB;IAED,0CAA0C;IAC1C,MAAM,EAAE,KAAK;IACb,GAAG,EAAE,IAAI;IAET,iDAAiD;IACjD,SAAS,EAAE,KAAK;IAChB,MAAM,EAAE;QACN,KAAK,EAAE,CAAC;QACR,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,OAAO;gBACb,MAAM,EAAE,CAAC,OAAO,CAAC;gBACjB,YAAY,EAAE,KAAK;aACpB;SACF;KACF;IAED,4CAA4C;IAC5C,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,IAAI;IAEX,sDAAsD;IACtD,KAAK,EAAE;QACL,kBAAkB,EAAE,KAAK;KAC1B;IAED,4CAA4C;IAC5C,OAAO,EAAE,KAAK;
|
|
1
|
+
{"version":3,"file":"none.js","sourceRoot":"","sources":["../../../src/types/capabilities/none.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAiB;IAChC,SAAS,EAAE,MAAM;IAEjB,+CAA+C;IAC/C,SAAS,EAAE,KAAK;IAChB,MAAM,EAAE,IAAI;IAEZ,wDAAwD;IACxD,UAAU,EAAE,KAAK;IACjB,OAAO,EAAE;QACP,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,OAAO;QACd,gBAAgB,EAAE,KAAK;QACvB,UAAU,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;QACvC,WAAW,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;QAC/B,YAAY,EAAE,CAAC;QACf,gBAAgB,EAAE,IAAI;KACvB;IAED,yDAAyD;IACzD,aAAa,EAAE,KAAK;IACpB,UAAU,EAAE;QACV,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,KAAK;KACd;IAED,uDAAuD;IACvD,UAAU,EAAE,KAAK;IACjB,OAAO,EAAE;QACP,KAAK,EAAE,CAAC;QACR,SAAS,EAAE,KAAK;KACjB;IAED,0CAA0C;IAC1C,MAAM,EAAE,KAAK;IACb,GAAG,EAAE,IAAI;IAET,iDAAiD;IACjD,SAAS,EAAE,KAAK;IAChB,MAAM,EAAE;QACN,KAAK,EAAE,CAAC;QACR,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,OAAO;gBACb,MAAM,EAAE,CAAC,OAAO,CAAC;gBACjB,YAAY,EAAE,KAAK;aACpB;SACF;KACF;IAED,4CAA4C;IAC5C,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,IAAI;IAEX,sDAAsD;IACtD,KAAK,EAAE;QACL,kBAAkB,EAAE,KAAK;KAC1B;IAED,4CAA4C;IAC5C,OAAO,EAAE,KAAK;IAEd,uDAAuD;IACvD,MAAM,EAAE,KAAK;CACd,CAAC","sourcesContent":["/**\n * @fileoverview Simulated Glasses Hardware Capabilities\n *\n * Capability profile for the Simulated Glasses model.\n * Defines the hardware and software features available on this device.\n * This profile matches the Vuzix Z100 capabilities for testing purposes.\n */\n\nimport type { Capabilities } from \"../hardware\";\n\n/**\n * Simulated Glasses capability profile\n */\nexport const none: Capabilities = {\n modelName: \"None\",\n\n // Camera capabilities - does not have a camera\n hasCamera: false,\n camera: null,\n\n // Display capabilities - has a green monochrome display\n hasDisplay: false,\n display: {\n count: 1,\n isColor: false,\n color: \"green\",\n canDisplayBitmap: false,\n resolution: { width: 640, height: 480 },\n fieldOfView: { horizontal: 30 },\n maxTextLines: 7,\n adjustBrightness: true,\n },\n\n // Microphone capabilities - has a microphone (phone mic)\n hasMicrophone: false,\n microphone: {\n count: 1,\n hasVAD: false,\n },\n\n // Speaker capabilities - has a speaker (phone speaker)\n hasSpeaker: false,\n speaker: {\n count: 1,\n isPrivate: false,\n },\n\n // IMU capabilities - does not have an IMU\n hasIMU: false,\n imu: null,\n\n // Button capabilities - Has one simulated button\n hasButton: false,\n button: {\n count: 1,\n buttons: [\n {\n type: \"press\",\n events: [\"press\"],\n isCapacitive: false,\n },\n ],\n },\n\n // Light capabilities - does not have lights\n hasLight: false,\n light: null,\n\n // Power capabilities - does not have external battery\n power: {\n hasExternalBattery: false,\n },\n\n // WiFi capabilities - does not support WiFi\n hasWifi: false,\n\n // OTA capabilities - none profile does not support OTA\n hasOta: false,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simulated-glasses.d.ts","sourceRoot":"","sources":["../../../src/types/capabilities/simulated-glasses.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"simulated-glasses.d.ts","sourceRoot":"","sources":["../../../src/types/capabilities/simulated-glasses.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,YAiE9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simulated-glasses.js","sourceRoot":"","sources":["../../../src/types/capabilities/simulated-glasses.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAiB;IAC5C,SAAS,EAAE,mBAAmB;IAE9B,+CAA+C;IAC/C,SAAS,EAAE,KAAK;IAChB,MAAM,EAAE,IAAI;IAEZ,wDAAwD;IACxD,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE;QACP,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,OAAO;QACd,gBAAgB,EAAE,KAAK;QACvB,UAAU,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;QACvC,WAAW,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;QAC/B,YAAY,EAAE,CAAC;QACf,gBAAgB,EAAE,IAAI;KACvB;IAED,yDAAyD;IACzD,aAAa,EAAE,IAAI;IACnB,UAAU,EAAE;QACV,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,KAAK;KACd;IAED,uDAAuD;IACvD,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE;QACP,KAAK,EAAE,CAAC;QACR,SAAS,EAAE,KAAK;KACjB;IAED,0CAA0C;IAC1C,MAAM,EAAE,KAAK;IACb,GAAG,EAAE,IAAI;IAET,iDAAiD;IACjD,SAAS,EAAE,IAAI;IACf,MAAM,EAAE;QACN,KAAK,EAAE,CAAC;QACR,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,OAAO;gBACb,MAAM,EAAE,CAAC,OAAO,CAAC;gBACjB,YAAY,EAAE,KAAK;aACpB;SACF;KACF;IAED,4CAA4C;IAC5C,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,IAAI;IAEX,sDAAsD;IACtD,KAAK,EAAE;QACL,kBAAkB,EAAE,KAAK;KAC1B;IAED,4CAA4C;IAC5C,OAAO,EAAE,KAAK;
|
|
1
|
+
{"version":3,"file":"simulated-glasses.js","sourceRoot":"","sources":["../../../src/types/capabilities/simulated-glasses.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAiB;IAC5C,SAAS,EAAE,mBAAmB;IAE9B,+CAA+C;IAC/C,SAAS,EAAE,KAAK;IAChB,MAAM,EAAE,IAAI;IAEZ,wDAAwD;IACxD,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE;QACP,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,OAAO;QACd,gBAAgB,EAAE,KAAK;QACvB,UAAU,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;QACvC,WAAW,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;QAC/B,YAAY,EAAE,CAAC;QACf,gBAAgB,EAAE,IAAI;KACvB;IAED,yDAAyD;IACzD,aAAa,EAAE,IAAI;IACnB,UAAU,EAAE;QACV,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,KAAK;KACd;IAED,uDAAuD;IACvD,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE;QACP,KAAK,EAAE,CAAC;QACR,SAAS,EAAE,KAAK;KACjB;IAED,0CAA0C;IAC1C,MAAM,EAAE,KAAK;IACb,GAAG,EAAE,IAAI;IAET,iDAAiD;IACjD,SAAS,EAAE,IAAI;IACf,MAAM,EAAE;QACN,KAAK,EAAE,CAAC;QACR,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,OAAO;gBACb,MAAM,EAAE,CAAC,OAAO,CAAC;gBACjB,YAAY,EAAE,KAAK;aACpB;SACF;KACF;IAED,4CAA4C;IAC5C,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,IAAI;IAEX,sDAAsD;IACtD,KAAK,EAAE;QACL,kBAAkB,EAAE,KAAK;KAC1B;IAED,4CAA4C;IAC5C,OAAO,EAAE,KAAK;IAEd,0DAA0D;IAC1D,MAAM,EAAE,KAAK;CACd,CAAC","sourcesContent":["/**\n * @fileoverview Simulated Glasses Hardware Capabilities\n *\n * Capability profile for the Simulated Glasses model.\n * Defines the hardware and software features available on this device.\n * This profile matches the Vuzix Z100 capabilities for testing purposes.\n */\n\nimport type { Capabilities } from \"../hardware\";\n\n/**\n * Simulated Glasses capability profile\n */\nexport const simulatedGlasses: Capabilities = {\n modelName: \"Simulated Glasses\",\n\n // Camera capabilities - does not have a camera\n hasCamera: false,\n camera: null,\n\n // Display capabilities - has a green monochrome display\n hasDisplay: true,\n display: {\n count: 1,\n isColor: false,\n color: \"green\",\n canDisplayBitmap: false,\n resolution: { width: 640, height: 480 },\n fieldOfView: { horizontal: 30 },\n maxTextLines: 7,\n adjustBrightness: true,\n },\n\n // Microphone capabilities - has a microphone (phone mic)\n hasMicrophone: true,\n microphone: {\n count: 1,\n hasVAD: false,\n },\n\n // Speaker capabilities - has a speaker (phone speaker)\n hasSpeaker: true,\n speaker: {\n count: 1,\n isPrivate: false,\n },\n\n // IMU capabilities - does not have an IMU\n hasIMU: false,\n imu: null,\n\n // Button capabilities - Has one simulated button\n hasButton: true,\n button: {\n count: 1,\n buttons: [\n {\n type: \"press\",\n events: [\"press\"],\n isCapacitive: false,\n },\n ],\n },\n\n // Light capabilities - does not have lights\n hasLight: false,\n light: null,\n\n // Power capabilities - does not have external battery\n power: {\n hasExternalBattery: false,\n },\n\n // WiFi capabilities - does not support WiFi\n hasWifi: false,\n\n // OTA capabilities - simulated glasses do not support OTA\n hasOta: false,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vuzix-z100.d.ts","sourceRoot":"","sources":["../../../src/types/capabilities/vuzix-z100.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"vuzix-z100.d.ts","sourceRoot":"","sources":["../../../src/types/capabilities/vuzix-z100.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,YAsDvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vuzix-z100.js","sourceRoot":"","sources":["../../../src/types/capabilities/vuzix-z100.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAiB;IACrC,SAAS,EAAE,YAAY;IAEvB,+CAA+C;IAC/C,SAAS,EAAE,KAAK;IAChB,MAAM,EAAE,IAAI;IAEZ,wDAAwD;IACxD,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE;QACP,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,OAAO;QACd,gBAAgB,EAAE,KAAK;QACvB,UAAU,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EAA4E;QAC5E,WAAW,EAAE,KAAK;QAClB,gBAAgB,EAAE,CAAC;KACpB;IAED,uDAAuD;IACvD,aAAa,EAAE,KAAK;IACpB,UAAU,EAAE,IAAI;IAEhB,iDAAiD;IACjD,UAAU,EAAE,KAAK;IACjB,OAAO,EAAE,IAAI;IAEb,0CAA0C;IAC1C,MAAM,EAAE,KAAK;IACb,GAAG,EAAE,IAAI;IAET,8CAA8C;IAC9C,SAAS,EAAE,KAAK;IAChB,MAAM,EAAE,IAAI;IAEZ,4CAA4C;IAC5C,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,IAAI;IAEX,sDAAsD;IACtD,KAAK,EAAE;QACL,kBAAkB,EAAE,KAAK;KAC1B;IAED,4CAA4C;IAC5C,OAAO,EAAE,KAAK;IAEd,8EAA8E;IAC9E,MAAM,EAAE,KAAK;CACd,CAAC","sourcesContent":["/**\n * @fileoverview Vuzix Z100 Hardware Capabilities\n *\n * Capability profile for the Vuzix Z100 smart glasses model.\n * Defines the hardware and software features available on this device.\n */\n\nimport type { Capabilities } from \"../hardware\";\n\n/**\n * Vuzix Z100 capability profile\n */\nexport const vuzixZ100: Capabilities = {\n modelName: \"Vuzix Z100\",\n\n // Camera capabilities - does not have a camera\n hasCamera: false,\n camera: null,\n\n // Display capabilities - has a green monochrome display\n hasDisplay: true,\n display: {\n count: 1,\n isColor: false,\n color: \"green\",\n canDisplayBitmap: false,\n resolution: { width: 640, height: 480 },\n fieldOfView: { horizontal: 30 },\n maxTextLines: 7,\n adjustBrightness: true,\n\n // Scene display API — no positioned elements; scenes degrade to text walls.\n canPosition: false,\n maxImageElements: 0,\n },\n\n // Microphone capabilities - does not have a microphone\n hasMicrophone: false,\n microphone: null,\n\n // Speaker capabilities - does not have a speaker\n hasSpeaker: false,\n speaker: null,\n\n // IMU capabilities - does not have an IMU\n hasIMU: false,\n imu: null,\n\n // Button capabilities - does not have buttons\n hasButton: false,\n button: null,\n\n // Light capabilities - does not have lights\n hasLight: false,\n light: null,\n\n // Power capabilities - does not have external battery\n power: {\n hasExternalBattery: false,\n },\n\n // WiFi capabilities - does not support WiFi\n hasWifi: false,\n\n // OTA capabilities - Z100 firmware updates are not driven by the ASG OTA flow\n hasOta: false,\n};\n"]}
|
package/build/types/enums.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../src/types/enums.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,wBAAwB,EAAC,MAAM,0BAA0B,CAAA;AAE/E,oBAAY,WAAW;IACrB,IAAI,SAAS;IACb,SAAS,sBAAsB;IAC/B,IAAI,SAAS;IACb,EAAE,sBAAsB;IACxB,EAAE,sBAAsB;IACxB,IAAI,gBAAgB;IACpB,KAAK,iBAAiB;IACtB,IAAI,eAAe;IACnB,GAAG,mBAAmB;IACtB,KAAK,oBAAoB;
|
|
1
|
+
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../src/types/enums.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,wBAAwB,EAAC,MAAM,0BAA0B,CAAA;AAE/E,oBAAY,WAAW;IACrB,IAAI,SAAS;IACb,SAAS,sBAAsB;IAC/B,IAAI,SAAS;IACb,EAAE,sBAAsB;IACxB,EAAE,sBAAsB;IACxB,IAAI,gBAAgB;IACpB,KAAK,iBAAiB;IACtB,IAAI,eAAe;IACnB,GAAG,mBAAmB;IACtB,KAAK,oBAAoB;IACzB,IAAI,SAAS;CACd;AAED,oBAAY,eAAe;IACzB,EAAE,sBAAsB;CACzB"}
|
package/build/types/enums.js
CHANGED
|
@@ -11,6 +11,7 @@ export var DeviceTypes;
|
|
|
11
11
|
DeviceTypes["Z100"] = "Vuzix Z100";
|
|
12
12
|
DeviceTypes["NEX"] = "Mentra Display";
|
|
13
13
|
DeviceTypes["FRAME"] = "Brilliant Frame";
|
|
14
|
+
DeviceTypes["NIMO"] = "NIMO";
|
|
14
15
|
})(DeviceTypes || (DeviceTypes = {}));
|
|
15
16
|
export var ControllerTypes;
|
|
16
17
|
(function (ControllerTypes) {
|
package/build/types/enums.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enums.js","sourceRoot":"","sources":["../../src/types/enums.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,wBAAwB,EAAC,MAAM,0BAA0B,CAAA;AAE/E,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"enums.js","sourceRoot":"","sources":["../../src/types/enums.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,wBAAwB,EAAC,MAAM,0BAA0B,CAAA;AAE/E,MAAM,CAAN,IAAY,WAYX;AAZD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,8CAA+B,CAAA;IAC/B,4BAAa,CAAA;IACb,uCAAwB,CAAA;IACxB,uCAAwB,CAAA;IACxB,mCAAoB,CAAA;IACpB,qCAAsB,CAAA;IACtB,kCAAmB,CAAA;IACnB,qCAAsB,CAAA;IACtB,wCAAyB,CAAA;IACzB,4BAAa,CAAA;AACf,CAAC,EAZW,WAAW,KAAX,WAAW,QAYtB;AAED,MAAM,CAAN,IAAY,eAEX;AAFD,WAAY,eAAe;IACzB,2CAAwB,CAAA;AAC1B,CAAC,EAFW,eAAe,KAAf,eAAe,QAE1B","sourcesContent":["export {HardwareType, HardwareRequirementLevel} from \"@mentra/miniapp/hardware\"\n\nexport enum DeviceTypes {\n NONE = \"None\",\n SIMULATED = \"Simulated Glasses\",\n AR99 = \"AR99\",\n G1 = \"Even Realities G1\",\n G2 = \"Even Realities G2\",\n LIVE = \"Mentra Live\",\n MACH1 = \"Mentra Mach1\",\n Z100 = \"Vuzix Z100\",\n NEX = \"Mentra Display\",\n FRAME = \"Brilliant Frame\",\n NIMO = \"NIMO\",\n}\n\nexport enum ControllerTypes {\n R1 = \"Even Realities R1\",\n}\n"]}
|
|
@@ -3,6 +3,7 @@ import { evenRealitiesG1 } from "./capabilities/even-realities-g1";
|
|
|
3
3
|
import { evenRealitiesG2 } from "./capabilities/even-realities-g2";
|
|
4
4
|
import { mentraDisplay } from "./capabilities/mentra-display";
|
|
5
5
|
import { mentraLive } from "./capabilities/mentra-live";
|
|
6
|
+
import { nimo } from "./capabilities/nimo";
|
|
6
7
|
import { simulatedGlasses } from "./capabilities/simulated-glasses";
|
|
7
8
|
import { vuzixZ100 } from "./capabilities/vuzix-z100";
|
|
8
9
|
import { DeviceTypes } from "./enums";
|
|
@@ -137,7 +138,7 @@ export interface Capabilities {
|
|
|
137
138
|
light: LightCapabilities | null;
|
|
138
139
|
power: PowerCapabilities;
|
|
139
140
|
hasWifi: boolean;
|
|
140
|
-
hasOta
|
|
141
|
+
hasOta: boolean;
|
|
141
142
|
hasNativeDashboard?: boolean;
|
|
142
143
|
}
|
|
143
144
|
/**
|
|
@@ -147,5 +148,5 @@ export interface Capabilities {
|
|
|
147
148
|
*/
|
|
148
149
|
export declare const HARDWARE_CAPABILITIES: Record<string, Capabilities>;
|
|
149
150
|
export declare const getModelCapabilities: (deviceType: DeviceTypes) => Capabilities;
|
|
150
|
-
export { simulatedGlasses, evenRealitiesG1, evenRealitiesG2, mentraLive, vuzixZ100, mentraDisplay };
|
|
151
|
+
export { simulatedGlasses, evenRealitiesG1, evenRealitiesG2, mentraLive, nimo, vuzixZ100, mentraDisplay };
|
|
151
152
|
//# sourceMappingURL=hardware.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hardware.d.ts","sourceRoot":"","sources":["../../src/types/hardware.ts"],"names":[],"mappings":"AAAA,oDAAoD;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAA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 @@ import { evenRealitiesG1 } from "./capabilities/even-realities-g1";
|
|
|
3
3
|
import { evenRealitiesG2 } from "./capabilities/even-realities-g2";
|
|
4
4
|
import { mentraDisplay } from "./capabilities/mentra-display";
|
|
5
5
|
import { mentraLive } from "./capabilities/mentra-live";
|
|
6
|
+
import { nimo } from "./capabilities/nimo";
|
|
6
7
|
import { simulatedGlasses } from "./capabilities/simulated-glasses";
|
|
7
8
|
import { vuzixZ100 } from "./capabilities/vuzix-z100";
|
|
8
9
|
import { none } from "./capabilities/none";
|
|
@@ -19,6 +20,7 @@ export const HARDWARE_CAPABILITIES = {
|
|
|
19
20
|
[mentraLive.modelName]: mentraLive,
|
|
20
21
|
[simulatedGlasses.modelName]: simulatedGlasses,
|
|
21
22
|
[vuzixZ100.modelName]: vuzixZ100,
|
|
23
|
+
[nimo.modelName]: nimo,
|
|
22
24
|
[DeviceTypes.MACH1]: vuzixZ100, // Mach1 uses same Vuzix Ultralite hardware as Z100
|
|
23
25
|
[DeviceTypes.AR99]: {
|
|
24
26
|
...evenRealitiesG1,
|
|
@@ -44,5 +46,5 @@ export const getModelCapabilities = (deviceType) => {
|
|
|
44
46
|
return HARDWARE_CAPABILITIES[modelName];
|
|
45
47
|
};
|
|
46
48
|
// export * from "./capabilities"
|
|
47
|
-
export { simulatedGlasses, evenRealitiesG1, evenRealitiesG2, mentraLive, vuzixZ100, mentraDisplay };
|
|
49
|
+
export { simulatedGlasses, evenRealitiesG1, evenRealitiesG2, mentraLive, nimo, vuzixZ100, mentraDisplay };
|
|
48
50
|
//# sourceMappingURL=hardware.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hardware.js","sourceRoot":"","sources":["../../src/types/hardware.ts"],"names":[],"mappings":"AAAA,oDAAoD;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,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AW,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,qBAAqB,CAAC,SAAS,CAAC,CAAC;AAC1C,CAAC,CAAC;AAEF,iCAAiC;AACjC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC","sourcesContent":["/** Hardware capability types used by the Engine. */\n\nimport { evenRealitiesG1 } from \"./capabilities/even-realities-g1\";\nimport { evenRealitiesG2 } from \"./capabilities/even-realities-g2\";\nimport { mentraDisplay } from \"./capabilities/mentra-display\";\nimport { mentraLive } from \"./capabilities/mentra-live\";\nimport { simulatedGlasses } from \"./capabilities/simulated-glasses\";\nimport { vuzixZ100 } from \"./capabilities/vuzix-z100\";\nimport { none } from \"./capabilities/none\";\nimport { DeviceTypes } from \"./enums\";\n\nexport type { HardwareRequirement } from \"@mentra/miniapp/hardware\";\n\n/**\n * Camera capabilities\n */\nexport interface CameraCapabilities {\n resolution?: { width: number; height: number };\n hasHDR?: boolean;\n hasFocus?: boolean;\n video: {\n canRecord: boolean;\n canStream: boolean;\n supportedStreamTypes?: string[];\n supportedResolutions?: { width: number; height: number }[];\n };\n}\n\n/**\n * Display capabilities\n */\nexport interface DisplayCapabilities {\n count?: number;\n isColor?: boolean;\n color?: string; // e.g., \"green\", \"full_color\", \"pallet\"\n canDisplayBitmap?: boolean;\n resolution?: { width: number; height: number };\n fieldOfView?: { horizontal?: number; vertical?: number };\n maxTextLines?: number;\n adjustBrightness?: boolean;\n\n // --- Scene display API (display.render()) — typed capabilities ---\n // Pure DATA the host scene pipeline acts on generically; a device without\n // canPosition renders scenes via the host degrade path instead.\n /** Public drawable canvas in px — the raw coordinate space for render() boxes. */\n width?: number;\n height?: number;\n /** True ⇒ the device renders positioned elements (containers / canvas components). */\n canPosition?: boolean;\n /** Element budgets. Rects share the text pool on container-based devices. */\n maxTextElements?: number;\n maxImageElements?: number;\n /** Per-image dimension cap (box-level), when the firmware has one. */\n maxImagePx?: { width: number; height: number };\n shapes?: \"rect\"[];\n intensityLevels?: number;\n partialUpdate?: boolean;\n}\n\n/**\n * Microphone capabilities\n */\nexport interface MicrophoneCapabilities {\n count?: number;\n hasVAD?: boolean; // Voice Activity Detection\n}\n\n/**\n * Speaker capabilities\n */\nexport interface SpeakerCapabilities {\n count?: number;\n isPrivate?: boolean; // e.g., bone conduction\n}\n\n/**\n * IMU (Inertial Measurement Unit) capabilities\n */\nexport interface IMUCapabilities {\n axisCount?: number;\n hasAccelerometer?: boolean;\n hasCompass?: boolean;\n hasGyroscope?: boolean;\n}\n\n/**\n * Button capabilities\n */\nexport interface ButtonCapabilities {\n count?: number;\n buttons?: {\n type: \"press\" | \"swipe1d\" | \"swipe2d\";\n events: string[]; // e.g., \"press\", \"double_press\", \"long_press\", \"swipe_up\", \"swipe_down\"\n isCapacitive?: boolean;\n }[];\n}\n\n/**\n * Light capabilities\n */\nexport interface LightCapabilities {\n count?: number;\n lights?: {\n id: string; // Unique identifier for the LED (e.g., \"privacy\", \"user_feedback\")\n purpose: \"privacy\" | \"user_feedback\" | \"general\"; // LED purpose/function\n isFullColor: boolean;\n color?: string; // e.g., \"white\", \"rgb\"\n position?: \"front_facing\" | \"user_facing\" | \"side\" | \"unknown\"; // LED physical position\n }[];\n}\n\n/**\n * Power capabilities\n */\nexport interface PowerCapabilities {\n hasExternalBattery: boolean; // e.g., a case or puck\n}\n\n/**\n * Device hardware capabilities\n * Complete information about what hardware a device has\n */\nexport interface Capabilities {\n modelName: string;\n\n // Camera capabilities\n hasCamera: boolean;\n camera: CameraCapabilities | null;\n\n // Display capabilities\n hasDisplay: boolean;\n display: DisplayCapabilities | null;\n\n // Microphone capabilities\n hasMicrophone: boolean;\n microphone: MicrophoneCapabilities | null;\n\n // Speaker capabilities\n hasSpeaker: boolean;\n speaker: SpeakerCapabilities | null;\n\n // IMU capabilities\n hasIMU: boolean;\n imu: IMUCapabilities | null;\n\n // Button capabilities\n hasButton: boolean;\n button: ButtonCapabilities | null;\n\n // Light capabilities\n hasLight: boolean;\n light: LightCapabilities | null;\n\n // Power capabilities\n power: PowerCapabilities;\n\n // WiFi capability\n hasWifi: boolean;\n\n // OTA capability\n hasOta
|
|
1
|
+
{"version":3,"file":"hardware.js","sourceRoot":"","sources":["../../src/types/hardware.ts"],"names":[],"mappings":"AAAA,oDAAoD;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAiKtC;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAiC;IACjE,CAAC,eAAe,CAAC,SAAS,CAAC,EAAE,eAAe;IAC5C,CAAC,eAAe,CAAC,SAAS,CAAC,EAAE,eAAe;IAC5C,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE,aAAa;IACxC,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,UAAU;IAClC,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAAE,gBAAgB;IAC9C,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,SAAS;IAChC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI;IACtB,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,mDAAmD;IACnF,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE;QAClB,GAAG,eAAe;QAClB,SAAS,EAAE,WAAW,CAAC,IAAI;QAC3B,OAAO,EAAE;YACP,GAAG,eAAe,CAAC,OAAO;YAC1B,gBAAgB,EAAE,KAAK;SACxB;QACD,aAAa,EAAE,IAAI;QACnB,MAAM,EAAE,IAAI;QACZ,UAAU,EAAE;YACV,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,KAAK;SACd;KACF;IACD,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,UAAuB,EAAgB,EAAE;IAC5E,MAAM,SAAS,GAAG,UAAoB,CAAC;IACvC,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAC,EAAE,CAAC;QACtC,OAAO,qBAAqB,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,qBAAqB,CAAC,SAAS,CAAC,CAAC;AAC1C,CAAC,CAAC;AAEF,iCAAiC;AACjC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC","sourcesContent":["/** Hardware capability types used by the Engine. */\n\nimport { evenRealitiesG1 } from \"./capabilities/even-realities-g1\";\nimport { evenRealitiesG2 } from \"./capabilities/even-realities-g2\";\nimport { mentraDisplay } from \"./capabilities/mentra-display\";\nimport { mentraLive } from \"./capabilities/mentra-live\";\nimport { nimo } from \"./capabilities/nimo\";\nimport { simulatedGlasses } from \"./capabilities/simulated-glasses\";\nimport { vuzixZ100 } from \"./capabilities/vuzix-z100\";\nimport { none } from \"./capabilities/none\";\nimport { DeviceTypes } from \"./enums\";\n\nexport type { HardwareRequirement } from \"@mentra/miniapp/hardware\";\n\n/**\n * Camera capabilities\n */\nexport interface CameraCapabilities {\n resolution?: { width: number; height: number };\n hasHDR?: boolean;\n hasFocus?: boolean;\n video: {\n canRecord: boolean;\n canStream: boolean;\n supportedStreamTypes?: string[];\n supportedResolutions?: { width: number; height: number }[];\n };\n}\n\n/**\n * Display capabilities\n */\nexport interface DisplayCapabilities {\n count?: number;\n isColor?: boolean;\n color?: string; // e.g., \"green\", \"full_color\", \"pallet\"\n canDisplayBitmap?: boolean;\n resolution?: { width: number; height: number };\n fieldOfView?: { horizontal?: number; vertical?: number };\n maxTextLines?: number;\n adjustBrightness?: boolean;\n\n // --- Scene display API (display.render()) — typed capabilities ---\n // Pure DATA the host scene pipeline acts on generically; a device without\n // canPosition renders scenes via the host degrade path instead.\n /** Public drawable canvas in px — the raw coordinate space for render() boxes. */\n width?: number;\n height?: number;\n /** True ⇒ the device renders positioned elements (containers / canvas components). */\n canPosition?: boolean;\n /** Element budgets. Rects share the text pool on container-based devices. */\n maxTextElements?: number;\n maxImageElements?: number;\n /** Per-image dimension cap (box-level), when the firmware has one. */\n maxImagePx?: { width: number; height: number };\n shapes?: \"rect\"[];\n intensityLevels?: number;\n partialUpdate?: boolean;\n}\n\n/**\n * Microphone capabilities\n */\nexport interface MicrophoneCapabilities {\n count?: number;\n hasVAD?: boolean; // Voice Activity Detection\n}\n\n/**\n * Speaker capabilities\n */\nexport interface SpeakerCapabilities {\n count?: number;\n isPrivate?: boolean; // e.g., bone conduction\n}\n\n/**\n * IMU (Inertial Measurement Unit) capabilities\n */\nexport interface IMUCapabilities {\n axisCount?: number;\n hasAccelerometer?: boolean;\n hasCompass?: boolean;\n hasGyroscope?: boolean;\n}\n\n/**\n * Button capabilities\n */\nexport interface ButtonCapabilities {\n count?: number;\n buttons?: {\n type: \"press\" | \"swipe1d\" | \"swipe2d\";\n events: string[]; // e.g., \"press\", \"double_press\", \"long_press\", \"swipe_up\", \"swipe_down\"\n isCapacitive?: boolean;\n }[];\n}\n\n/**\n * Light capabilities\n */\nexport interface LightCapabilities {\n count?: number;\n lights?: {\n id: string; // Unique identifier for the LED (e.g., \"privacy\", \"user_feedback\")\n purpose: \"privacy\" | \"user_feedback\" | \"general\"; // LED purpose/function\n isFullColor: boolean;\n color?: string; // e.g., \"white\", \"rgb\"\n position?: \"front_facing\" | \"user_facing\" | \"side\" | \"unknown\"; // LED physical position\n }[];\n}\n\n/**\n * Power capabilities\n */\nexport interface PowerCapabilities {\n hasExternalBattery: boolean; // e.g., a case or puck\n}\n\n/**\n * Device hardware capabilities\n * Complete information about what hardware a device has\n */\nexport interface Capabilities {\n modelName: string;\n\n // Camera capabilities\n hasCamera: boolean;\n camera: CameraCapabilities | null;\n\n // Display capabilities\n hasDisplay: boolean;\n display: DisplayCapabilities | null;\n\n // Microphone capabilities\n hasMicrophone: boolean;\n microphone: MicrophoneCapabilities | null;\n\n // Speaker capabilities\n hasSpeaker: boolean;\n speaker: SpeakerCapabilities | null;\n\n // IMU capabilities\n hasIMU: boolean;\n imu: IMUCapabilities | null;\n\n // Button capabilities\n hasButton: boolean;\n button: ButtonCapabilities | null;\n\n // Light capabilities\n hasLight: boolean;\n light: LightCapabilities | null;\n\n // Power capabilities\n power: PowerCapabilities;\n\n // WiFi capability\n hasWifi: boolean;\n\n // OTA capability\n hasOta: boolean;\n\n // Native dashboard capability\n // True when the device renders its own dashboard in firmware (e.g. Even\n // Realities' built-in dashboard on G2). MentraOS does not manage or expose\n // dashboard settings for these devices. Absent/false means MentraOS owns the\n // dashboard.\n hasNativeDashboard?: boolean;\n}\n\n/**\n * Hardware capability profiles for supported glasses models\n * Key: model_name string (e.g., \"Even Realities G1\", \"Mentra Live\")\n * Value: Capabilities object defining device features\n */\nexport const HARDWARE_CAPABILITIES: Record<string, Capabilities> = {\n [evenRealitiesG1.modelName]: evenRealitiesG1,\n [evenRealitiesG2.modelName]: evenRealitiesG2,\n [mentraDisplay.modelName]: mentraDisplay,\n [mentraLive.modelName]: mentraLive,\n [simulatedGlasses.modelName]: simulatedGlasses,\n [vuzixZ100.modelName]: vuzixZ100,\n [nimo.modelName]: nimo,\n [DeviceTypes.MACH1]: vuzixZ100, // Mach1 uses same Vuzix Ultralite hardware as Z100\n [DeviceTypes.AR99]: {\n ...evenRealitiesG1,\n modelName: DeviceTypes.AR99,\n display: {\n ...evenRealitiesG1.display,\n canDisplayBitmap: false,\n },\n hasMicrophone: true,\n hasOta: true,\n microphone: {\n count: 1,\n hasVAD: false,\n },\n },\n [none.modelName]: none,\n};\n\nexport const getModelCapabilities = (deviceType: DeviceTypes): Capabilities => {\n const modelName = deviceType as string;\n if (!HARDWARE_CAPABILITIES[modelName]) {\n return HARDWARE_CAPABILITIES[DeviceTypes.NONE];\n }\n return HARDWARE_CAPABILITIES[modelName];\n};\n\n// export * from \"./capabilities\"\nexport { simulatedGlasses, evenRealitiesG1, evenRealitiesG2, mentraLive, nimo, vuzixZ100, mentraDisplay };\n"]}
|
package/build/types/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* are re-exported from @mentra/miniapp, their canonical owner. */
|
|
3
3
|
export { HardwareType, HardwareRequirementLevel, DeviceTypes, ControllerTypes } from "./enums";
|
|
4
4
|
export type { HardwareRequirement, CameraCapabilities, DisplayCapabilities, MicrophoneCapabilities, SpeakerCapabilities, IMUCapabilities, ButtonCapabilities, LightCapabilities, PowerCapabilities, Capabilities, } from "./hardware";
|
|
5
|
-
export { HARDWARE_CAPABILITIES, getModelCapabilities, simulatedGlasses, evenRealitiesG1, evenRealitiesG2, mentraLive, vuzixZ100, mentraDisplay, } from "./hardware";
|
|
5
|
+
export { HARDWARE_CAPABILITIES, getModelCapabilities, simulatedGlasses, evenRealitiesG1, evenRealitiesG2, mentraLive, nimo, vuzixZ100, mentraDisplay, } from "./hardware";
|
|
6
6
|
export type { AppletType, AppPermissionType, AppletPermission, AppletInterface, ClientApp } from "./applet";
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;kEACkE;AAGlE,OAAO,EAAC,YAAY,EAAE,wBAAwB,EAAE,WAAW,EAAE,eAAe,EAAC,MAAM,SAAS,CAAA;AAG5F,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,GACb,MAAM,YAAY,CAAA;AAEnB,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,UAAU,EACV,SAAS,EACT,aAAa,GACd,MAAM,YAAY,CAAA;AAGnB,YAAY,EAAC,UAAU,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,eAAe,EAAE,SAAS,EAAC,MAAM,UAAU,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;kEACkE;AAGlE,OAAO,EAAC,YAAY,EAAE,wBAAwB,EAAE,WAAW,EAAE,eAAe,EAAC,MAAM,SAAS,CAAA;AAG5F,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,GACb,MAAM,YAAY,CAAA;AAEnB,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,UAAU,EACV,IAAI,EACJ,SAAS,EACT,aAAa,GACd,MAAM,YAAY,CAAA;AAGnB,YAAY,EAAC,UAAU,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,eAAe,EAAE,SAAS,EAAC,MAAM,UAAU,CAAA"}
|
package/build/types/index.js
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* are re-exported from @mentra/miniapp, their canonical owner. */
|
|
3
3
|
// Enums (runtime values)
|
|
4
4
|
export { HardwareType, HardwareRequirementLevel, DeviceTypes, ControllerTypes } from "./enums";
|
|
5
|
-
export { HARDWARE_CAPABILITIES, getModelCapabilities, simulatedGlasses, evenRealitiesG1, evenRealitiesG2, mentraLive, vuzixZ100, mentraDisplay, } from "./hardware";
|
|
5
|
+
export { HARDWARE_CAPABILITIES, getModelCapabilities, simulatedGlasses, evenRealitiesG1, evenRealitiesG2, mentraLive, nimo, vuzixZ100, mentraDisplay, } from "./hardware";
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/build/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;kEACkE;AAElE,yBAAyB;AACzB,OAAO,EAAC,YAAY,EAAE,wBAAwB,EAAE,WAAW,EAAE,eAAe,EAAC,MAAM,SAAS,CAAA;AAgB5F,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,UAAU,EACV,SAAS,EACT,aAAa,GACd,MAAM,YAAY,CAAA","sourcesContent":["/** Engine capability types and profiles. Miniapp manifest requirement types\n * are re-exported from @mentra/miniapp, their canonical owner. */\n\n// Enums (runtime values)\nexport {HardwareType, HardwareRequirementLevel, DeviceTypes, ControllerTypes} from \"./enums\"\n\n// Hardware types\nexport type {\n HardwareRequirement,\n CameraCapabilities,\n DisplayCapabilities,\n MicrophoneCapabilities,\n SpeakerCapabilities,\n IMUCapabilities,\n ButtonCapabilities,\n LightCapabilities,\n PowerCapabilities,\n Capabilities,\n} from \"./hardware\"\n\nexport {\n HARDWARE_CAPABILITIES,\n getModelCapabilities,\n simulatedGlasses,\n evenRealitiesG1,\n evenRealitiesG2,\n mentraLive,\n vuzixZ100,\n mentraDisplay,\n} from \"./hardware\"\n\n// Applet types\nexport type {AppletType, AppPermissionType, AppletPermission, AppletInterface, ClientApp} from \"./applet\"\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;kEACkE;AAElE,yBAAyB;AACzB,OAAO,EAAC,YAAY,EAAE,wBAAwB,EAAE,WAAW,EAAE,eAAe,EAAC,MAAM,SAAS,CAAA;AAgB5F,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,UAAU,EACV,IAAI,EACJ,SAAS,EACT,aAAa,GACd,MAAM,YAAY,CAAA","sourcesContent":["/** Engine capability types and profiles. Miniapp manifest requirement types\n * are re-exported from @mentra/miniapp, their canonical owner. */\n\n// Enums (runtime values)\nexport {HardwareType, HardwareRequirementLevel, DeviceTypes, ControllerTypes} from \"./enums\"\n\n// Hardware types\nexport type {\n HardwareRequirement,\n CameraCapabilities,\n DisplayCapabilities,\n MicrophoneCapabilities,\n SpeakerCapabilities,\n IMUCapabilities,\n ButtonCapabilities,\n LightCapabilities,\n PowerCapabilities,\n Capabilities,\n} from \"./hardware\"\n\nexport {\n HARDWARE_CAPABILITIES,\n getModelCapabilities,\n simulatedGlasses,\n evenRealitiesG1,\n evenRealitiesG2,\n mentraLive,\n nimo,\n vuzixZ100,\n mentraDisplay,\n} from \"./hardware\"\n\n// Applet types\nexport type {AppletType, AppPermissionType, AppletPermission, AppletInterface, ClientApp} from \"./applet\"\n"]}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* 2. Merges columns line-by-line with pixel-precise space padding
|
|
12
12
|
* 3. Returns a single pre-composed string ready for native to chunk & send
|
|
13
13
|
*
|
|
14
|
-
* @see
|
|
14
|
+
* @see notes/miniapp-display-api-redesign.md for the current display design
|
|
15
15
|
*/
|
|
16
16
|
import type { DisplayProfile } from "../profiles/types";
|
|
17
17
|
import type { BreakMode } from "../wrapper/types";
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* 2. Merges columns line-by-line with pixel-precise space padding
|
|
12
12
|
* 3. Returns a single pre-composed string ready for native to chunk & send
|
|
13
13
|
*
|
|
14
|
-
* @see
|
|
14
|
+
* @see notes/miniapp-display-api-redesign.md for the current display design
|
|
15
15
|
*/
|
|
16
16
|
import { TextMeasurer } from "../measurer/TextMeasurer";
|
|
17
17
|
import { TextWrapper } from "../wrapper/TextWrapper";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnComposer.js","sourceRoot":"","sources":["../../../../src/utils/display/composer/ColumnComposer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AA+CrD,gFAAgF;AAChF,uBAAuB;AACvB,gFAAgF;AAEhF;;;;;;;;;GASG;AACH,MAAM,OAAO,cAAc;IACjB,OAAO,CAAiB;IACxB,QAAQ,CAAe;IACvB,OAAO,CAAc;IACrB,YAAY,CAAS;IAE7B,YAAY,OAAuB,EAAE,YAAuB,qBAAqB;QAC/E,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC;QAC1C,IAAI,CAAC,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE;YAC5C,SAAS;SACV,CAAC,CAAC;QAEH,+CAA+C;QAC/C,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACrD,CAAC;IAED,8EAA8E;IAC9E,aAAa;IACb,8EAA8E;IAE9E;;;;;;;;;;OAUG;IACI,qBAAqB,CAAC,QAAgB,EAAE,SAAiB,EAAE,UAA0B,EAAE;QAC5F,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAE1D,iCAAiC;QACjC,MAAM,eAAe,GAAgB;YACnC,UAAU,EAAE,MAAM,CAAC,iBAAiB;YACpC,QAAQ,EAAE,MAAM,CAAC,QAAQ;SAC1B,CAAC;QAEF,MAAM,gBAAgB,GAAgB;YACpC,U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AC,CAAC;AAChD,CAAC","sourcesContent":["/**\n * ColumnComposer\n *\n * Handles composition of multi-column layouts like double_text_wall.\n * This is the single source of truth for column layout logic, replacing\n * the duplicate implementations in native iOS (G1Text.swift) and\n * Android (G1Text.kt, G1.java).\n *\n * The composer:\n * 1. Wraps each column's text to its allocated width\n * 2. Merges columns line-by-line with pixel-precise space padding\n * 3. Returns a single pre-composed string ready for native to chunk & send\n *\n * @see cloud/issues/026-mobile-display-processor for design docs\n */\n\nimport type { DisplayProfile } from \"../profiles/types\";\nimport { TextMeasurer } from \"../measurer/TextMeasurer\";\nimport { TextWrapper } from \"../wrapper/TextWrapper\";\nimport type { WrapOptions, BreakMode } from \"../wrapper/types\";\n\n// =============================================================================\n// Types\n// =============================================================================\n\n/**\n * Configuration for column layout\n */\nexport interface ColumnConfig {\n /** Width of the left column in pixels */\n leftColumnWidthPx: number;\n /** X position where the right column starts in pixels */\n rightColumnStartPx: number;\n /** Width of the right column in pixels (calculated from start position) */\n rightColumnWidthPx: number;\n /** Maximum number of lines to display */\n maxLines: number;\n /** Left margin in spaces (for indentation) */\n leftMarginSpaces?: number;\n}\n\n/**\n * Options for composing double text wall\n */\nexport interface ComposeOptions {\n /** Break mode for text wrapping */\n breakMode?: BreakMode;\n /** Custom column configuration (overrides profile defaults) */\n columnConfig?: Partial<ColumnConfig>;\n}\n\n/**\n * Result of column composition\n */\nexport interface ComposeResult {\n /** The fully composed text with both columns merged */\n composedText: string;\n /** Lines from the left column (for debugging/preview) */\n leftLines: string[];\n /** Lines from the right column (for debugging/preview) */\n rightLines: string[];\n /** The column configuration that was used */\n config: ColumnConfig;\n}\n\n// =============================================================================\n// ColumnComposer Class\n// =============================================================================\n\n/**\n * Composes multi-column layouts for smart glasses displays.\n *\n * Usage:\n * ```typescript\n * const composer = new ColumnComposer(G1_PROFILE)\n * const result = composer.composeDoubleTextWall(\"Left content\", \"Right content\")\n * // result.composedText is ready to send to native SGC\n * ```\n */\nexport class ColumnComposer {\n private profile: DisplayProfile;\n private measurer: TextMeasurer;\n private wrapper: TextWrapper;\n private spaceWidthPx: number;\n\n constructor(profile: DisplayProfile, breakMode: BreakMode = \"character-no-hyphen\") {\n this.profile = profile;\n this.measurer = new TextMeasurer(profile);\n this.wrapper = new TextWrapper(this.measurer, {\n breakMode,\n });\n\n // Cache space width for alignment calculations\n this.spaceWidthPx = this.measurer.measureText(\" \");\n }\n\n // ===========================================================================\n // Public API\n // ===========================================================================\n\n /**\n * Compose a double text wall layout.\n *\n * Takes left and right text, wraps each to their column width,\n * and merges them with pixel-precise space alignment.\n *\n * @param leftText - Text for the left column\n * @param rightText - Text for the right column\n * @param options - Optional composition settings\n * @returns Composed result with merged text and metadata\n */\n public composeDoubleTextWall(leftText: string, rightText: string, options: ComposeOptions = {}): ComposeResult {\n const config = this.getColumnConfig(options.columnConfig);\n\n // Wrap each column independently\n const leftWrapOptions: WrapOptions = {\n maxWidthPx: config.leftColumnWidthPx,\n maxLines: config.maxLines,\n };\n\n const rightWrapOptions: WrapOptions = {\n maxWidthPx: config.rightColumnWidthPx,\n maxLines: config.maxLines,\n };\n\n const leftResult = this.wrapper.wrap(leftText || \"\", leftWrapOptions);\n const rightResult = this.wrapper.wrap(rightText || \"\", rightWrapOptions);\n\n // Pad arrays to have exactly maxLines entries\n const leftLines = this.padLines(leftResult.lines, config.maxLines);\n const rightLines = this.padLines(rightResult.lines, config.maxLines);\n\n // Merge columns with space alignment\n const composedText = this.mergeColumns(leftLines, rightLines, config);\n\n return {\n composedText,\n leftLines,\n rightLines,\n config,\n };\n }\n\n /**\n * Get the default column configuration for the current profile.\n */\n public getDefaultColumnConfig(): ColumnConfig {\n return this.getColumnConfig();\n }\n\n /**\n * Update the break mode for text wrapping.\n */\n public setBreakMode(breakMode: BreakMode): void {\n this.wrapper = new TextWrapper(this.measurer, {\n breakMode,\n });\n }\n\n // ===========================================================================\n // Private Methods\n // ===========================================================================\n\n /**\n * Get column configuration, merging defaults with overrides.\n */\n private getColumnConfig(overrides?: Partial<ColumnConfig>): ColumnConfig {\n const displayWidth = this.profile.displayWidthPx;\n\n // Default layout: 50% for left column, right starts at 55%\n // This matches the native G1Text implementations\n const defaults: ColumnConfig = {\n leftColumnWidthPx: Math.floor(displayWidth * 0.5),\n rightColumnStartPx: Math.floor(displayWidth * 0.55),\n rightColumnWidthPx: displayWidth - Math.floor(displayWidth * 0.55),\n maxLines: this.profile.maxLines,\n leftMarginSpaces: 0,\n };\n\n return {\n ...defaults,\n ...overrides,\n };\n }\n\n /**\n * Pad lines array to exactly `count` entries.\n */\n private padLines(lines: string[], count: number): string[] {\n const result = [...lines];\n while (result.length < count) {\n result.push(\"\");\n }\n return result.slice(0, count);\n }\n\n /**\n * Merge left and right columns with pixel-precise space alignment.\n *\n * For each line:\n * 1. Take the left column text\n * 2. Calculate its pixel width\n * 3. Calculate how many spaces needed to reach rightColumnStartPx\n * 4. Append spaces and right column text\n */\n private mergeColumns(leftLines: string[], rightLines: string[], config: ColumnConfig): string {\n const lines: string[] = [];\n\n for (let i = 0; i < config.maxLines; i++) {\n const leftText = this.cleanEnspaces(leftLines[i] || \"\");\n const rightText = this.cleanEnspaces(rightLines[i] || \"\");\n\n // Calculate pixel width of left text\n const leftWidthPx = this.measurer.measureText(leftText);\n\n // Calculate spaces needed to reach the right column start\n const spacesNeeded = this.calculateSpacesForAlignment(leftWidthPx, config.rightColumnStartPx);\n\n // Build the merged line\n let line = \"\";\n\n // Add left margin if configured\n if (config.leftMarginSpaces && config.leftMarginSpaces > 0) {\n line += \" \".repeat(config.leftMarginSpaces);\n }\n\n line += leftText;\n line += \" \".repeat(spacesNeeded);\n line += rightText;\n\n lines.push(line);\n }\n\n return lines.join(\"\\n\");\n }\n\n /**\n * Calculate the number of spaces needed to align to a target position.\n *\n * @param currentWidthPx - Current position in pixels\n * @param targetPositionPx - Target position in pixels\n * @returns Number of space characters needed\n */\n private calculateSpacesForAlignment(currentWidthPx: number, targetPositionPx: number): number {\n const pixelsNeeded = targetPositionPx - currentWidthPx;\n\n // Ensure at least one space for separation\n if (pixelsNeeded <= 0) {\n return 1;\n }\n\n // Calculate spaces needed. Use Math.floor (not Math.ceil) to ensure the\n // right column never starts past rightColumnStartPx. Rounding up caused\n // the right column to start 1–5px further right than planned, shrinking\n // its usable width and causing the last character to wrap onto the next\n // line's left position.\n const spaces = Math.max(1, Math.floor(pixelsNeeded / this.spaceWidthPx));\n\n // Cap at a reasonable maximum to prevent runaway spacing\n return Math.min(spaces, 100);\n }\n\n /**\n * Remove en-space characters (U+2002) that may have been added during wrapping.\n * Native implementations do this cleanup before merging.\n */\n private cleanEnspaces(text: string): string {\n return text.replace(/\\u2002/g, \"\");\n }\n}\n\n// =============================================================================\n// Factory Function\n// =============================================================================\n\n/**\n * Create a ColumnComposer for a given profile.\n *\n * @param profile - Display profile to use\n * @param breakMode - Break mode for text wrapping (default: \"word\")\n * @returns Configured ColumnComposer instance\n */\nexport function createColumnComposer(profile: DisplayProfile, breakMode: BreakMode = \"word\"): ColumnComposer {\n return new ColumnComposer(profile, breakMode);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ColumnComposer.js","sourceRoot":"","sources":["../../../../src/utils/display/composer/ColumnComposer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AA+CrD,gFAAgF;AAChF,uBAAuB;AACvB,gFAAgF;AAEhF;;;;;;;;;GASG;AACH,MAAM,OAAO,cAAc;IACjB,OAAO,CAAiB;IACxB,QAAQ,CAAe;IACvB,OAAO,CAAc;IACrB,YAAY,CAAS;IAE7B,YAAY,OAAuB,EAAE,YAAuB,qBAAqB;QAC/E,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC;QAC1C,IAAI,CAAC,OAAO,GAAG,IAA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AAwE;QACxE,wEAAwE;QACxE,wBAAwB;QACxB,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;QAEzE,yDAAyD;QACzD,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACK,aAAa,CAAC,IAAY;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IACrC,CAAC;CACF;AAED,gFAAgF;AAChF,mBAAmB;AACnB,gFAAgF;AAEhF;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAuB,EAAE,YAAuB,MAAM;IACzF,OAAO,IAAI,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AAChD,CAAC","sourcesContent":["/**\n * ColumnComposer\n *\n * Handles composition of multi-column layouts like double_text_wall.\n * This is the single source of truth for column layout logic, replacing\n * the duplicate implementations in native iOS (G1Text.swift) and\n * Android (G1Text.kt, G1.java).\n *\n * The composer:\n * 1. Wraps each column's text to its allocated width\n * 2. Merges columns line-by-line with pixel-precise space padding\n * 3. Returns a single pre-composed string ready for native to chunk & send\n *\n * @see notes/miniapp-display-api-redesign.md for the current display design\n */\n\nimport type { DisplayProfile } from \"../profiles/types\";\nimport { TextMeasurer } from \"../measurer/TextMeasurer\";\nimport { TextWrapper } from \"../wrapper/TextWrapper\";\nimport type { WrapOptions, BreakMode } from \"../wrapper/types\";\n\n// =============================================================================\n// Types\n// =============================================================================\n\n/**\n * Configuration for column layout\n */\nexport interface ColumnConfig {\n /** Width of the left column in pixels */\n leftColumnWidthPx: number;\n /** X position where the right column starts in pixels */\n rightColumnStartPx: number;\n /** Width of the right column in pixels (calculated from start position) */\n rightColumnWidthPx: number;\n /** Maximum number of lines to display */\n maxLines: number;\n /** Left margin in spaces (for indentation) */\n leftMarginSpaces?: number;\n}\n\n/**\n * Options for composing double text wall\n */\nexport interface ComposeOptions {\n /** Break mode for text wrapping */\n breakMode?: BreakMode;\n /** Custom column configuration (overrides profile defaults) */\n columnConfig?: Partial<ColumnConfig>;\n}\n\n/**\n * Result of column composition\n */\nexport interface ComposeResult {\n /** The fully composed text with both columns merged */\n composedText: string;\n /** Lines from the left column (for debugging/preview) */\n leftLines: string[];\n /** Lines from the right column (for debugging/preview) */\n rightLines: string[];\n /** The column configuration that was used */\n config: ColumnConfig;\n}\n\n// =============================================================================\n// ColumnComposer Class\n// =============================================================================\n\n/**\n * Composes multi-column layouts for smart glasses displays.\n *\n * Usage:\n * ```typescript\n * const composer = new ColumnComposer(G1_PROFILE)\n * const result = composer.composeDoubleTextWall(\"Left content\", \"Right content\")\n * // result.composedText is ready to send to native SGC\n * ```\n */\nexport class ColumnComposer {\n private profile: DisplayProfile;\n private measurer: TextMeasurer;\n private wrapper: TextWrapper;\n private spaceWidthPx: number;\n\n constructor(profile: DisplayProfile, breakMode: BreakMode = \"character-no-hyphen\") {\n this.profile = profile;\n this.measurer = new TextMeasurer(profile);\n this.wrapper = new TextWrapper(this.measurer, {\n breakMode,\n });\n\n // Cache space width for alignment calculations\n this.spaceWidthPx = this.measurer.measureText(\" \");\n }\n\n // ===========================================================================\n // Public API\n // ===========================================================================\n\n /**\n * Compose a double text wall layout.\n *\n * Takes left and right text, wraps each to their column width,\n * and merges them with pixel-precise space alignment.\n *\n * @param leftText - Text for the left column\n * @param rightText - Text for the right column\n * @param options - Optional composition settings\n * @returns Composed result with merged text and metadata\n */\n public composeDoubleTextWall(leftText: string, rightText: string, options: ComposeOptions = {}): ComposeResult {\n const config = this.getColumnConfig(options.columnConfig);\n\n // Wrap each column independently\n const leftWrapOptions: WrapOptions = {\n maxWidthPx: config.leftColumnWidthPx,\n maxLines: config.maxLines,\n };\n\n const rightWrapOptions: WrapOptions = {\n maxWidthPx: config.rightColumnWidthPx,\n maxLines: config.maxLines,\n };\n\n const leftResult = this.wrapper.wrap(leftText || \"\", leftWrapOptions);\n const rightResult = this.wrapper.wrap(rightText || \"\", rightWrapOptions);\n\n // Pad arrays to have exactly maxLines entries\n const leftLines = this.padLines(leftResult.lines, config.maxLines);\n const rightLines = this.padLines(rightResult.lines, config.maxLines);\n\n // Merge columns with space alignment\n const composedText = this.mergeColumns(leftLines, rightLines, config);\n\n return {\n composedText,\n leftLines,\n rightLines,\n config,\n };\n }\n\n /**\n * Get the default column configuration for the current profile.\n */\n public getDefaultColumnConfig(): ColumnConfig {\n return this.getColumnConfig();\n }\n\n /**\n * Update the break mode for text wrapping.\n */\n public setBreakMode(breakMode: BreakMode): void {\n this.wrapper = new TextWrapper(this.measurer, {\n breakMode,\n });\n }\n\n // ===========================================================================\n // Private Methods\n // ===========================================================================\n\n /**\n * Get column configuration, merging defaults with overrides.\n */\n private getColumnConfig(overrides?: Partial<ColumnConfig>): ColumnConfig {\n const displayWidth = this.profile.displayWidthPx;\n\n // Default layout: 50% for left column, right starts at 55%\n // This matches the native G1Text implementations\n const defaults: ColumnConfig = {\n leftColumnWidthPx: Math.floor(displayWidth * 0.5),\n rightColumnStartPx: Math.floor(displayWidth * 0.55),\n rightColumnWidthPx: displayWidth - Math.floor(displayWidth * 0.55),\n maxLines: this.profile.maxLines,\n leftMarginSpaces: 0,\n };\n\n return {\n ...defaults,\n ...overrides,\n };\n }\n\n /**\n * Pad lines array to exactly `count` entries.\n */\n private padLines(lines: string[], count: number): string[] {\n const result = [...lines];\n while (result.length < count) {\n result.push(\"\");\n }\n return result.slice(0, count);\n }\n\n /**\n * Merge left and right columns with pixel-precise space alignment.\n *\n * For each line:\n * 1. Take the left column text\n * 2. Calculate its pixel width\n * 3. Calculate how many spaces needed to reach rightColumnStartPx\n * 4. Append spaces and right column text\n */\n private mergeColumns(leftLines: string[], rightLines: string[], config: ColumnConfig): string {\n const lines: string[] = [];\n\n for (let i = 0; i < config.maxLines; i++) {\n const leftText = this.cleanEnspaces(leftLines[i] || \"\");\n const rightText = this.cleanEnspaces(rightLines[i] || \"\");\n\n // Calculate pixel width of left text\n const leftWidthPx = this.measurer.measureText(leftText);\n\n // Calculate spaces needed to reach the right column start\n const spacesNeeded = this.calculateSpacesForAlignment(leftWidthPx, config.rightColumnStartPx);\n\n // Build the merged line\n let line = \"\";\n\n // Add left margin if configured\n if (config.leftMarginSpaces && config.leftMarginSpaces > 0) {\n line += \" \".repeat(config.leftMarginSpaces);\n }\n\n line += leftText;\n line += \" \".repeat(spacesNeeded);\n line += rightText;\n\n lines.push(line);\n }\n\n return lines.join(\"\\n\");\n }\n\n /**\n * Calculate the number of spaces needed to align to a target position.\n *\n * @param currentWidthPx - Current position in pixels\n * @param targetPositionPx - Target position in pixels\n * @returns Number of space characters needed\n */\n private calculateSpacesForAlignment(currentWidthPx: number, targetPositionPx: number): number {\n const pixelsNeeded = targetPositionPx - currentWidthPx;\n\n // Ensure at least one space for separation\n if (pixelsNeeded <= 0) {\n return 1;\n }\n\n // Calculate spaces needed. Use Math.floor (not Math.ceil) to ensure the\n // right column never starts past rightColumnStartPx. Rounding up caused\n // the right column to start 1–5px further right than planned, shrinking\n // its usable width and causing the last character to wrap onto the next\n // line's left position.\n const spaces = Math.max(1, Math.floor(pixelsNeeded / this.spaceWidthPx));\n\n // Cap at a reasonable maximum to prevent runaway spacing\n return Math.min(spaces, 100);\n }\n\n /**\n * Remove en-space characters (U+2002) that may have been added during wrapping.\n * Native implementations do this cleanup before merging.\n */\n private cleanEnspaces(text: string): string {\n return text.replace(/\\u2002/g, \"\");\n }\n}\n\n// =============================================================================\n// Factory Function\n// =============================================================================\n\n/**\n * Create a ColumnComposer for a given profile.\n *\n * @param profile - Display profile to use\n * @param breakMode - Break mode for text wrapping (default: \"word\")\n * @returns Configured ColumnComposer instance\n */\nexport function createColumnComposer(profile: DisplayProfile, breakMode: BreakMode = \"word\"): ColumnComposer {\n return new ColumnComposer(profile, breakMode);\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mentra/engine",
|
|
3
|
-
"version": "3.1.0-dev.
|
|
3
|
+
"version": "3.1.0-dev.101",
|
|
4
4
|
"description": "Mentra Engine — miniapp registry, WebView bridge, and miniapp store",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"react-native": "src/index.ts",
|
|
@@ -36,6 +36,11 @@
|
|
|
36
36
|
"react-native": "./src/bluetooth-sdk/photo-receiver.ts",
|
|
37
37
|
"default": "./build/bluetooth-sdk/photo-receiver.js"
|
|
38
38
|
},
|
|
39
|
+
"./bluetooth-sdk/ota-transport": {
|
|
40
|
+
"types": "./build/bluetooth-sdk/ota-transport.d.ts",
|
|
41
|
+
"react-native": "./src/bluetooth-sdk/ota-transport.ts",
|
|
42
|
+
"default": "./build/bluetooth-sdk/ota-transport.js"
|
|
43
|
+
},
|
|
39
44
|
"./bluetooth-sdk/debug": {
|
|
40
45
|
"types": "./build/bluetooth-sdk/debug.d.ts",
|
|
41
46
|
"react-native": "./src/bluetooth-sdk/debug.ts",
|
|
@@ -64,6 +69,7 @@
|
|
|
64
69
|
"write:release-metadata": "node scripts/write-release-metadata.mjs",
|
|
65
70
|
"verify:release-package": "node scripts/verify-release-package.mjs",
|
|
66
71
|
"test:public-api": "bun test src/bluetooth-sdk/__tests__/publicApi.test.ts",
|
|
72
|
+
"test:public-ota-consumer": "tsc --noEmit --strict --skipLibCheck --jsx react-jsx --moduleResolution bundler --module esnext --target es2022 scripts/fixtures/public-ota-consumer.tsx",
|
|
67
73
|
"build:module": "expo-module prepare",
|
|
68
74
|
"prepublishOnly": "expo-module prepublishOnly",
|
|
69
75
|
"expo-module": "expo-module"
|
|
@@ -91,13 +97,14 @@
|
|
|
91
97
|
"registry": "https://registry.npmjs.org/"
|
|
92
98
|
},
|
|
93
99
|
"dependencies": {
|
|
94
|
-
"@mentra/bluetooth-sdk": "3.1.0-dev.
|
|
95
|
-
"@mentra/cloud-client": "3.1.0-dev.
|
|
96
|
-
"@mentra/cloud-protocol": "3.1.0-dev.
|
|
97
|
-
"@mentra/crust": "3.1.0-dev.
|
|
98
|
-
"@mentra/miniapp": "3.1.0-dev.
|
|
100
|
+
"@mentra/bluetooth-sdk": "3.1.0-dev.101",
|
|
101
|
+
"@mentra/cloud-client": "3.1.0-dev.101",
|
|
102
|
+
"@mentra/cloud-protocol": "3.1.0-dev.101",
|
|
103
|
+
"@mentra/crust": "3.1.0-dev.101",
|
|
104
|
+
"@mentra/miniapp": "3.1.0-dev.101",
|
|
99
105
|
"buffer": "^6.0.3",
|
|
100
106
|
"events": "^3.3.0",
|
|
107
|
+
"react-native-marked": "8.1.1",
|
|
101
108
|
"semver": "^7.7.4",
|
|
102
109
|
"typesafe-ts": "^1.7.1"
|
|
103
110
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@mentra/bluetooth-sdk/ota-transport"
|
package/src/facades/ota.ts
CHANGED
|
@@ -8,9 +8,16 @@
|
|
|
8
8
|
* `installSession` fronts the OtaInstallCoordinator state machine (WP 8B) — the host
|
|
9
9
|
* progress screen is a pure renderer over its snapshot + attach/detach/retry/finish.
|
|
10
10
|
*/
|
|
11
|
-
import BluetoothSdk from "@mentra/bluetooth-sdk
|
|
12
|
-
import type {
|
|
13
|
-
|
|
11
|
+
import BluetoothSdk from "@mentra/bluetooth-sdk"
|
|
12
|
+
import type {
|
|
13
|
+
OtaProgress,
|
|
14
|
+
OtaProgressStatus,
|
|
15
|
+
OtaStartAckEvent,
|
|
16
|
+
OtaStatus,
|
|
17
|
+
OtaUpdateInfo,
|
|
18
|
+
ReleaseChangelog,
|
|
19
|
+
} from "@mentra/bluetooth-sdk"
|
|
20
|
+
import {isGlassesConnected, isGlassesReady, useGlassesStore} from "../stores/glasses"
|
|
14
21
|
import {resolveOtaManifestUrl} from "../services/otaManifestUrl"
|
|
15
22
|
import {otaInstallCoordinator, type OtaInstallSnapshot} from "../services/OtaInstallCoordinator"
|
|
16
23
|
import {startGlassesStatusProjection} from "../services/GlassesStatusProjection"
|
|
@@ -25,9 +32,12 @@ function projectSnapshot() {
|
|
|
25
32
|
const s = useGlassesStore.getState()
|
|
26
33
|
return {
|
|
27
34
|
connected: isGlassesConnected(s.connection),
|
|
35
|
+
ready: isGlassesReady(s.connection),
|
|
28
36
|
buildNumber: s.buildNumber || null,
|
|
37
|
+
appVersion: s.appVersion || null,
|
|
29
38
|
mtkFirmwareVersion: s.mtkFirmwareVersion || null,
|
|
30
39
|
besFirmwareVersion: s.besFirmwareVersion || null,
|
|
40
|
+
batteryLevel: s.batteryLevel >= 0 ? s.batteryLevel : null,
|
|
31
41
|
hotspotOtaVersion: s.hotspotOtaVersion ?? 0,
|
|
32
42
|
wifiConnected: s.wifi.state === "connected",
|
|
33
43
|
wifiStatusKnown: s.wifiStatusKnown,
|
|
@@ -46,6 +56,7 @@ export type {
|
|
|
46
56
|
OtaProgressStatus,
|
|
47
57
|
OtaStatus,
|
|
48
58
|
OtaUpdateInfo,
|
|
59
|
+
ReleaseChangelog,
|
|
49
60
|
OtaInstallSnapshot,
|
|
50
61
|
OtaCheckCurrentGlassesOptions,
|
|
51
62
|
OtaCheckCurrentGlassesResult,
|
|
@@ -55,7 +66,7 @@ export const ota = {
|
|
|
55
66
|
// --- actions ---
|
|
56
67
|
/**
|
|
57
68
|
* Start the device-status and OTA projections without starting the authenticated
|
|
58
|
-
* cloud
|
|
69
|
+
* cloud connection or miniapp runtime. This is the explicit entry point for Bluetooth-only hosts.
|
|
59
70
|
* Idempotent and safe when the full engine runtime is already running.
|
|
60
71
|
*/
|
|
61
72
|
initialize: async () => {
|
|
@@ -84,6 +95,9 @@ export const ota = {
|
|
|
84
95
|
ping: () => BluetoothSdk.ping(),
|
|
85
96
|
/** Resolve and compare the current glasses against the OTA manifest, then update the OTA snapshot. */
|
|
86
97
|
checkForUpdates: (options?: OtaCheckCurrentGlassesOptions) => checkCurrentGlassesForUpdate(options),
|
|
98
|
+
/** Return bundled release changelogs crossed between two coordinated product versions, newest first. */
|
|
99
|
+
getReleaseChangelogs: (fromVersion?: string | null, toVersion?: string | null): ReleaseChangelog[] =>
|
|
100
|
+
BluetoothSdk.getReleaseChangelogs(fromVersion, toVersion),
|
|
87
101
|
/** Clear the available-update prompt state. */
|
|
88
102
|
clearUpdateAvailable: () => useGlassesStore.getState().setOtaUpdateAvailable(null),
|
|
89
103
|
/** Clear active progress/status before entering a fresh install flow. */
|
|
@@ -113,7 +127,6 @@ export const ota = {
|
|
|
113
127
|
* @deprecated Legacy progress route (build < 37) only — removed with WP 8D.
|
|
114
128
|
*/
|
|
115
129
|
clearBuildNumberForNextCheck: () => {
|
|
116
|
-
BluetoothSdk.updateGlasses({buildNumber: ""})
|
|
117
130
|
useGlassesStore.getState().setGlassesInfo({buildNumber: ""})
|
|
118
131
|
},
|
|
119
132
|
/**
|
|
@@ -136,9 +149,9 @@ export const ota = {
|
|
|
136
149
|
detach: () => otaInstallCoordinator.detach(),
|
|
137
150
|
/** Retry after a failure: clear state and re-send ota_start (if connected). */
|
|
138
151
|
retry: () => otaInstallCoordinator.retry(),
|
|
139
|
-
/** Terminal cleanup for Continue/Done
|
|
152
|
+
/** Terminal cleanup for Continue/Done, including hotspot route teardown. */
|
|
140
153
|
finish: () => otaInstallCoordinator.finish(),
|
|
141
|
-
/** Abandon an interrupted session
|
|
154
|
+
/** Abandon an interrupted session: await finish() then drop the session's status/progress. */
|
|
142
155
|
discard: () => otaInstallCoordinator.discard(),
|
|
143
156
|
/** Current install read model (displayState/errorMsg/lockout + glasses OTA data). */
|
|
144
157
|
snapshot: (): OtaInstallSnapshot => otaInstallCoordinator.snapshot(),
|