@mentra/sdk 3.0.0-alpha.1 → 3.0.0-alpha.4

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 (45) hide show
  1. package/dist/app/server/index.d.ts +3 -12
  2. package/dist/app/server/index.d.ts.map +1 -1
  3. package/dist/display-utils.js +102 -102
  4. package/dist/display-utils.js.map +3 -3
  5. package/dist/index.js +163 -117
  6. package/dist/index.js.map +16 -16
  7. package/dist/internal/_SessionManager.d.ts.map +1 -1
  8. package/dist/session/MentraSession.d.ts.map +1 -1
  9. package/dist/session/internal/_V2CameraShim.d.ts +0 -1
  10. package/dist/session/internal/_V2CameraShim.d.ts.map +1 -1
  11. package/dist/session/internal/_V2EventManagerShim.d.ts +0 -1
  12. package/dist/session/internal/_V2EventManagerShim.d.ts.map +1 -1
  13. package/dist/session/internal/_V2SessionShim.d.ts +0 -4
  14. package/dist/session/internal/_V2SessionShim.d.ts.map +1 -1
  15. package/dist/session/managers/CameraManager.d.ts +0 -1
  16. package/dist/session/managers/CameraManager.d.ts.map +1 -1
  17. package/dist/session/managers/DeviceManager.d.ts +1 -17
  18. package/dist/session/managers/DeviceManager.d.ts.map +1 -1
  19. package/dist/session/managers/LedManager.d.ts +19 -4
  20. package/dist/session/managers/LedManager.d.ts.map +1 -1
  21. package/dist/session/managers/LocationManager.d.ts +41 -10
  22. package/dist/session/managers/LocationManager.d.ts.map +1 -1
  23. package/dist/session/managers/PermissionsManager.d.ts +43 -0
  24. package/dist/session/managers/PermissionsManager.d.ts.map +1 -1
  25. package/dist/session/managers/PhoneManager.d.ts +1 -57
  26. package/dist/session/managers/PhoneManager.d.ts.map +1 -1
  27. package/dist/session/managers/SpeakerManager.d.ts.map +1 -1
  28. package/dist/session.js +145 -87
  29. package/dist/session.js.map +10 -10
  30. package/node_modules/@mentra/types/src/applet.ts +55 -0
  31. package/node_modules/@mentra/types/src/capabilities/even-realities-g1.ts +63 -0
  32. package/node_modules/@mentra/types/src/capabilities/even-realities-g2.ts +70 -0
  33. package/node_modules/@mentra/types/src/capabilities/mentra-display.ts +63 -0
  34. package/node_modules/@mentra/types/src/capabilities/mentra-live.ts +103 -0
  35. package/node_modules/@mentra/types/src/capabilities/none.ts +76 -0
  36. package/node_modules/@mentra/types/src/capabilities/simulated-glasses.ts +76 -0
  37. package/node_modules/@mentra/types/src/capabilities/vuzix-z100.ts +60 -0
  38. package/node_modules/@mentra/types/src/cli.ts +169 -0
  39. package/node_modules/@mentra/types/src/device.ts +43 -0
  40. package/node_modules/@mentra/types/src/enums.ts +43 -0
  41. package/node_modules/@mentra/types/src/hardware.ts +179 -0
  42. package/node_modules/@mentra/types/src/index.ts +64 -0
  43. package/node_modules/@mentra/types/tsconfig.json +22 -0
  44. package/node_modules/@mentra/types/tsconfig.tsbuildinfo +1 -0
  45. package/package.json +1 -1
@@ -0,0 +1,55 @@
1
+ /**
2
+ * @mentra/types - App/Applet types for client interfaces
3
+ */
4
+
5
+ import { HardwareRequirement } from "./hardware";
6
+
7
+ /**
8
+ * App execution model types
9
+ */
10
+ export type AppletType = "standard" | "background" | "system_dashboard";
11
+
12
+ /**
13
+ * Permission types that apps can request
14
+ */
15
+ export type AppPermissionType =
16
+ | "ALL"
17
+ | "MICROPHONE"
18
+ | "CAMERA"
19
+ | "CALENDAR"
20
+ | "LOCATION"
21
+ | "BACKGROUND_LOCATION"
22
+ | "READ_NOTIFICATIONS"
23
+ | "POST_NOTIFICATIONS";
24
+
25
+ /**
26
+ * Permission object with type and description
27
+ */
28
+ export interface AppletPermission {
29
+ type: AppPermissionType;
30
+ description?: string;
31
+ required?: boolean;
32
+ }
33
+
34
+ /**
35
+ * Minimal app interface for client home screen display
36
+ * Optimized for fast rendering - only essential fields
37
+ *
38
+ * This is the client-facing interface used by mobile apps.
39
+ * Internal cloud services use AppI from models (more fields).
40
+ */
41
+ export interface AppletInterface {
42
+ packageName: string;
43
+ name: string;
44
+ webviewUrl: string;
45
+ logoUrl: string;
46
+ type: AppletType;
47
+ permissions: AppletPermission[];
48
+ running: boolean;
49
+ healthy: boolean;
50
+ hardwareRequirements: HardwareRequirement[];
51
+ /** ISO date string when the app was installed */
52
+ installedDate?: string;
53
+ /** ISO date string when the app was last run. Undefined if never run (app is "new") */
54
+ lastActiveAt?: string;
55
+ }
@@ -0,0 +1,63 @@
1
+ /**
2
+ * @fileoverview Even Realities G1 Hardware Capabilities
3
+ *
4
+ * Capability profile for the Even Realities G1 smart glasses model.
5
+ * Defines the hardware and software features available on this device.
6
+ */
7
+
8
+ import type { Capabilities } from "../hardware";
9
+
10
+ /**
11
+ * Even Realities G1 capability profile
12
+ */
13
+ export const evenRealitiesG1: Capabilities = {
14
+ modelName: "Even Realities G1",
15
+
16
+ // Camera capabilities - G1 does not have a camera
17
+ hasCamera: false,
18
+ camera: null,
19
+
20
+ // Display capabilities - G1 has a green monochrome display
21
+ hasDisplay: true,
22
+ display: {
23
+ count: 2,
24
+ isColor: false,
25
+ color: "green",
26
+ canDisplayBitmap: true,
27
+ resolution: { width: 640, height: 200 },
28
+ fieldOfView: { horizontal: 25 },
29
+ maxTextLines: 5,
30
+ adjustBrightness: true,
31
+ },
32
+
33
+ // Microphone capabilities - G1 has one microphone without VAD
34
+ hasMicrophone: true,
35
+ microphone: {
36
+ count: 1,
37
+ hasVAD: false,
38
+ },
39
+
40
+ // Speaker capabilities - G1 does not have a speaker
41
+ hasSpeaker: false,
42
+ speaker: null,
43
+
44
+ // IMU capabilities - G1 has IMU for head-up/down detection but raw data not exposed to apps
45
+ hasIMU: true,
46
+ imu: null,
47
+
48
+ // Button capabilities - G1 does not have buttons
49
+ hasButton: false,
50
+ button: null,
51
+
52
+ // Light capabilities - G1 does not have lights
53
+ hasLight: false,
54
+ light: null,
55
+
56
+ // Power capabilities - G1 does not have external battery
57
+ power: {
58
+ hasExternalBattery: false,
59
+ },
60
+
61
+ // WiFi capabilities - G1 does not support WiFi
62
+ hasWifi: false,
63
+ };
@@ -0,0 +1,70 @@
1
+ /**
2
+ * @fileoverview Even Realities G2 Hardware Capabilities
3
+ *
4
+ * Capability profile for the Even Realities G2 smart glasses model.
5
+ * G2 uses the EvenHub protocol with protobuf-based commands.
6
+ */
7
+
8
+ import type { Capabilities } from "../hardware";
9
+
10
+ /**
11
+ * Even Realities G2 capability profile
12
+ */
13
+ export const evenRealitiesG2: Capabilities = {
14
+ modelName: "Even Realities G2",
15
+
16
+ // Camera capabilities - G2 does not have a camera
17
+ hasCamera: false,
18
+ camera: null,
19
+
20
+ // Display capabilities - G2 has a green monochrome display (similar to G1)
21
+ hasDisplay: true,
22
+ display: {
23
+ count: 2,
24
+ isColor: false,
25
+ color: "green",
26
+ canDisplayBitmap: true,
27
+ resolution: { width: 640, height: 200 },
28
+ fieldOfView: { horizontal: 25 },
29
+ maxTextLines: 5,
30
+ adjustBrightness: true,
31
+ },
32
+
33
+ // Microphone capabilities - G2 has one microphone (right side), LC3 codec
34
+ hasMicrophone: true,
35
+ microphone: {
36
+ count: 1,
37
+ hasVAD: false,
38
+ },
39
+
40
+ // Speaker capabilities - G2 does not have a speaker
41
+ hasSpeaker: false,
42
+ speaker: null,
43
+
44
+ // IMU capabilities - G2 has IMU
45
+ hasIMU: true,
46
+ imu: null,
47
+
48
+ // Button capabilities - G2 has a capacitive touchbar
49
+ hasButton: true,
50
+ button: {
51
+ count: 1,
52
+ buttons: [{
53
+ type: "swipe1d",
54
+ events: ["TAP", "DOUBLE_TAP", "TRIPLE_TAP", "PRESS_HOLD", "SWIPE_UP", "SWIPE_DOWN"],
55
+ isCapacitive: true,
56
+ }],
57
+ },
58
+
59
+ // Light capabilities - G2 does not have lights
60
+ hasLight: false,
61
+ light: null,
62
+
63
+ // Power capabilities
64
+ power: {
65
+ hasExternalBattery: false,
66
+ },
67
+
68
+ // WiFi capabilities - G2 does not support WiFi
69
+ hasWifi: false,
70
+ };
@@ -0,0 +1,63 @@
1
+ /**
2
+ * @fileoverview Mentra Display Hardware Capabilities
3
+ *
4
+ * Capability profile for the Mentra Display smart glasses model.
5
+ * Defines the hardware and software features available on this device.
6
+ */
7
+
8
+ import type { Capabilities } from "../hardware";
9
+
10
+ /**
11
+ * Mentra Display capability profile
12
+ */
13
+ export const mentraDisplay: Capabilities = {
14
+ modelName: "Mentra Display",
15
+
16
+ // Camera capabilities - Mentra Display does not have a camera
17
+ hasCamera: false,
18
+ camera: null,
19
+
20
+ // Display capabilities - Mentra Display has a green monochrome display
21
+ hasDisplay: true,
22
+ display: {
23
+ count: 2,
24
+ isColor: false,
25
+ color: "green",
26
+ canDisplayBitmap: true,
27
+ resolution: { width: 640, height: 200 },
28
+ fieldOfView: { horizontal: 25 },
29
+ maxTextLines: 5,
30
+ adjustBrightness: true,
31
+ },
32
+
33
+ // Microphone capabilities - Mentra Display has one microphone without VAD
34
+ hasMicrophone: true,
35
+ microphone: {
36
+ count: 1,
37
+ hasVAD: false,
38
+ },
39
+
40
+ // Speaker capabilities - Mentra Display does not have a speaker
41
+ hasSpeaker: false,
42
+ speaker: null,
43
+
44
+ // IMU capabilities - Mentra Display has IMU for head-up/down detection but raw data not exposed to apps
45
+ hasIMU: true,
46
+ imu: null,
47
+
48
+ // Button capabilities - Mentra Display does not have buttons
49
+ hasButton: false,
50
+ button: null,
51
+
52
+ // Light capabilities - Mentra Display does not have lights
53
+ hasLight: false,
54
+ light: null,
55
+
56
+ // Power capabilities - Mentra Display does not have external battery
57
+ power: {
58
+ hasExternalBattery: false,
59
+ },
60
+
61
+ // WiFi capabilities - Mentra Display does not support WiFi
62
+ hasWifi: false,
63
+ };
@@ -0,0 +1,103 @@
1
+ /**
2
+ * @fileoverview Mentra Live Hardware Capabilities
3
+ *
4
+ * Capability profile for the Mentra Live smart glasses model.
5
+ * Defines the hardware and software features available on this device.
6
+ */
7
+
8
+ import type { Capabilities } from "../hardware";
9
+
10
+ /**
11
+ * Mentra Live capability profile
12
+ */
13
+ export const mentraLive: Capabilities = {
14
+ modelName: "Mentra Live",
15
+
16
+ // Camera capabilities - Mentra Live has camera with streaming
17
+ hasCamera: true,
18
+ camera: {
19
+ resolution: { width: 1920, height: 1080 },
20
+ hasHDR: false,
21
+ hasFocus: true,
22
+ video: {
23
+ canRecord: true,
24
+ canStream: true,
25
+ supportedStreamTypes: ["rtmp"],
26
+ supportedResolutions: [
27
+ { width: 1920, height: 1080 },
28
+ { width: 1280, height: 720 },
29
+ { width: 640, height: 480 },
30
+ ],
31
+ },
32
+ },
33
+
34
+ // Display capabilities - Mentra Live does not have a display
35
+ hasDisplay: false,
36
+ display: null,
37
+
38
+ // Microphone capabilities - Mentra Live has one microphone with VAD
39
+ hasMicrophone: true,
40
+ microphone: {
41
+ count: 1,
42
+ hasVAD: true,
43
+ },
44
+
45
+ // Speaker capabilities - Mentra Live has one standard speaker
46
+ hasSpeaker: true,
47
+ speaker: {
48
+ count: 1,
49
+ isPrivate: false,
50
+ },
51
+
52
+ // IMU capabilities - Mentra Live has 6-axis IMU
53
+ hasIMU: true,
54
+ imu: {
55
+ axisCount: 6,
56
+ hasAccelerometer: true,
57
+ hasCompass: false,
58
+ hasGyroscope: true,
59
+ },
60
+
61
+ // Button capabilities - Mentra Live has one physical button
62
+ hasButton: true,
63
+ button: {
64
+ count: 1,
65
+ buttons: [
66
+ {
67
+ type: "press",
68
+ events: ["press", "double_press", "long_press"],
69
+ isCapacitive: false,
70
+ },
71
+ ],
72
+ },
73
+
74
+ // Light capabilities - Mentra Live has two lights: privacy light + RGB LED
75
+ hasLight: true,
76
+ light: {
77
+ count: 2,
78
+ lights: [
79
+ {
80
+ id: "privacy",
81
+ purpose: "privacy",
82
+ isFullColor: false,
83
+ color: "white",
84
+ position: "front_facing",
85
+ },
86
+ {
87
+ id: "user_feedback",
88
+ purpose: "user_feedback",
89
+ isFullColor: true,
90
+ color: "rgb",
91
+ position: "user_facing",
92
+ },
93
+ ],
94
+ },
95
+
96
+ // Power capabilities - Mentra Live does not have external battery
97
+ power: {
98
+ hasExternalBattery: false,
99
+ },
100
+
101
+ // WiFi capabilities - Mentra Live supports WiFi
102
+ hasWifi: true,
103
+ };
@@ -0,0 +1,76 @@
1
+ /**
2
+ * @fileoverview Simulated Glasses Hardware Capabilities
3
+ *
4
+ * Capability profile for the Simulated Glasses model.
5
+ * Defines the hardware and software features available on this device.
6
+ * This profile matches the Vuzix Z100 capabilities for testing purposes.
7
+ */
8
+
9
+ import type { Capabilities } from "../hardware";
10
+
11
+ /**
12
+ * Simulated Glasses capability profile
13
+ */
14
+ export const none: Capabilities = {
15
+ modelName: "None",
16
+
17
+ // Camera capabilities - does not have a camera
18
+ hasCamera: false,
19
+ camera: null,
20
+
21
+ // Display capabilities - has a green monochrome display
22
+ hasDisplay: false,
23
+ display: {
24
+ count: 1,
25
+ isColor: false,
26
+ color: "green",
27
+ canDisplayBitmap: false,
28
+ resolution: { width: 640, height: 480 },
29
+ fieldOfView: { horizontal: 30 },
30
+ maxTextLines: 7,
31
+ adjustBrightness: true,
32
+ },
33
+
34
+ // Microphone capabilities - has a microphone (phone mic)
35
+ hasMicrophone: false,
36
+ microphone: {
37
+ count: 1,
38
+ hasVAD: false,
39
+ },
40
+
41
+ // Speaker capabilities - has a speaker (phone speaker)
42
+ hasSpeaker: false,
43
+ speaker: {
44
+ count: 1,
45
+ isPrivate: false,
46
+ },
47
+
48
+ // IMU capabilities - does not have an IMU
49
+ hasIMU: false,
50
+ imu: null,
51
+
52
+ // Button capabilities - Has one simulated button
53
+ hasButton: false,
54
+ button: {
55
+ count: 1,
56
+ buttons: [
57
+ {
58
+ type: "press",
59
+ events: ["press"],
60
+ isCapacitive: false,
61
+ },
62
+ ],
63
+ },
64
+
65
+ // Light capabilities - does not have lights
66
+ hasLight: false,
67
+ light: null,
68
+
69
+ // Power capabilities - does not have external battery
70
+ power: {
71
+ hasExternalBattery: false,
72
+ },
73
+
74
+ // WiFi capabilities - does not support WiFi
75
+ hasWifi: false,
76
+ };
@@ -0,0 +1,76 @@
1
+ /**
2
+ * @fileoverview Simulated Glasses Hardware Capabilities
3
+ *
4
+ * Capability profile for the Simulated Glasses model.
5
+ * Defines the hardware and software features available on this device.
6
+ * This profile matches the Vuzix Z100 capabilities for testing purposes.
7
+ */
8
+
9
+ import type { Capabilities } from "../hardware";
10
+
11
+ /**
12
+ * Simulated Glasses capability profile
13
+ */
14
+ export const simulatedGlasses: Capabilities = {
15
+ modelName: "Simulated Glasses",
16
+
17
+ // Camera capabilities - does not have a camera
18
+ hasCamera: false,
19
+ camera: null,
20
+
21
+ // Display capabilities - has a green monochrome display
22
+ hasDisplay: true,
23
+ display: {
24
+ count: 1,
25
+ isColor: false,
26
+ color: "green",
27
+ canDisplayBitmap: false,
28
+ resolution: { width: 640, height: 480 },
29
+ fieldOfView: { horizontal: 30 },
30
+ maxTextLines: 7,
31
+ adjustBrightness: true,
32
+ },
33
+
34
+ // Microphone capabilities - has a microphone (phone mic)
35
+ hasMicrophone: true,
36
+ microphone: {
37
+ count: 1,
38
+ hasVAD: false,
39
+ },
40
+
41
+ // Speaker capabilities - has a speaker (phone speaker)
42
+ hasSpeaker: true,
43
+ speaker: {
44
+ count: 1,
45
+ isPrivate: false,
46
+ },
47
+
48
+ // IMU capabilities - does not have an IMU
49
+ hasIMU: false,
50
+ imu: null,
51
+
52
+ // Button capabilities - Has one simulated button
53
+ hasButton: true,
54
+ button: {
55
+ count: 1,
56
+ buttons: [
57
+ {
58
+ type: "press",
59
+ events: ["press"],
60
+ isCapacitive: false,
61
+ },
62
+ ],
63
+ },
64
+
65
+ // Light capabilities - does not have lights
66
+ hasLight: false,
67
+ light: null,
68
+
69
+ // Power capabilities - does not have external battery
70
+ power: {
71
+ hasExternalBattery: false,
72
+ },
73
+
74
+ // WiFi capabilities - does not support WiFi
75
+ hasWifi: false,
76
+ };
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @fileoverview Vuzix Z100 Hardware Capabilities
3
+ *
4
+ * Capability profile for the Vuzix Z100 smart glasses model.
5
+ * Defines the hardware and software features available on this device.
6
+ */
7
+
8
+ import type { Capabilities } from "../hardware";
9
+
10
+ /**
11
+ * Vuzix Z100 capability profile
12
+ */
13
+ export const vuzixZ100: Capabilities = {
14
+ modelName: "Vuzix Z100",
15
+
16
+ // Camera capabilities - does not have a camera
17
+ hasCamera: false,
18
+ camera: null,
19
+
20
+ // Display capabilities - has a green monochrome display
21
+ hasDisplay: true,
22
+ display: {
23
+ count: 1,
24
+ isColor: false,
25
+ color: "green",
26
+ canDisplayBitmap: false,
27
+ resolution: { width: 640, height: 480 },
28
+ fieldOfView: { horizontal: 30 },
29
+ maxTextLines: 7,
30
+ adjustBrightness: true,
31
+ },
32
+
33
+ // Microphone capabilities - does not have a microphone
34
+ hasMicrophone: false,
35
+ microphone: null,
36
+
37
+ // Speaker capabilities - does not have a speaker
38
+ hasSpeaker: false,
39
+ speaker: null,
40
+
41
+ // IMU capabilities - does not have an IMU
42
+ hasIMU: false,
43
+ imu: null,
44
+
45
+ // Button capabilities - does not have buttons
46
+ hasButton: false,
47
+ button: null,
48
+
49
+ // Light capabilities - does not have lights
50
+ hasLight: false,
51
+ light: null,
52
+
53
+ // Power capabilities - does not have external battery
54
+ power: {
55
+ hasExternalBattery: false,
56
+ },
57
+
58
+ // WiFi capabilities - does not support WiFi
59
+ hasWifi: false,
60
+ };