@mentra/sdk 2.1.31-beta.6 → 3.0.0-alpha.3
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 +54 -9
- package/dist/MiniAppServer.d.ts +58 -0
- package/dist/MiniAppServer.d.ts.map +1 -0
- package/dist/app/server/index.d.ts +143 -88
- package/dist/app/server/index.d.ts.map +1 -1
- package/dist/app/session/events.d.ts +20 -3
- package/dist/app/session/events.d.ts.map +1 -1
- package/dist/app/session/index.d.ts +56 -3
- package/dist/app/session/index.d.ts.map +1 -1
- package/dist/app/session/modules/audio-output-stream.d.ts +108 -0
- package/dist/app/session/modules/audio-output-stream.d.ts.map +1 -0
- package/dist/app/session/modules/audio.d.ts +36 -1
- package/dist/app/session/modules/audio.d.ts.map +1 -1
- package/dist/app/session/modules/camera-managed-extension.d.ts +37 -33
- package/dist/app/session/modules/camera-managed-extension.d.ts.map +1 -1
- package/dist/app/session/modules/camera.d.ts +108 -50
- package/dist/app/session/modules/camera.d.ts.map +1 -1
- package/dist/app/session/modules/index.d.ts +4 -3
- package/dist/app/session/modules/index.d.ts.map +1 -1
- package/dist/app/session/modules/led.d.ts.map +1 -1
- package/dist/app/session/modules/location.d.ts.map +1 -1
- package/dist/app/session/settings.d.ts +5 -1
- package/dist/app/session/settings.d.ts.map +1 -1
- package/dist/app/webview/index.d.ts +67 -9
- package/dist/app/webview/index.d.ts.map +1 -1
- package/dist/constants/log-messages/updates.d.ts +32 -9
- package/dist/constants/log-messages/updates.d.ts.map +1 -1
- package/dist/constants/log-messages/warning.d.ts +12 -0
- package/dist/constants/log-messages/warning.d.ts.map +1 -1
- package/dist/display-utils.d.ts +3 -1
- package/dist/display-utils.d.ts.map +1 -1
- package/dist/display-utils.js +443 -26
- package/dist/display-utils.js.map +10 -6
- package/dist/index.d.ts +22 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8877 -4236
- package/dist/index.js.map +63 -31
- package/dist/internal/_SessionManager.d.ts +76 -0
- package/dist/internal/_SessionManager.d.ts.map +1 -0
- package/dist/logging/clean-transport.d.ts +50 -0
- package/dist/logging/clean-transport.d.ts.map +1 -0
- package/dist/logging/errors.d.ts +90 -0
- package/dist/logging/errors.d.ts.map +1 -0
- package/dist/logging/logger.d.ts +72 -1
- package/dist/logging/logger.d.ts.map +1 -1
- package/dist/logging/telemetry-transport.d.ts +51 -0
- package/dist/logging/telemetry-transport.d.ts.map +1 -0
- package/dist/session/DataStreamRouter.d.ts +219 -0
- package/dist/session/DataStreamRouter.d.ts.map +1 -0
- package/dist/session/MentraSession.d.ts +102 -0
- package/dist/session/MentraSession.d.ts.map +1 -0
- package/dist/session/index.d.ts +2 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/internal/_ConnectionManager.d.ts +43 -0
- package/dist/session/internal/_ConnectionManager.d.ts.map +1 -0
- package/dist/session/internal/_MessageRouter.d.ts +11 -0
- package/dist/session/internal/_MessageRouter.d.ts.map +1 -0
- package/dist/session/internal/_SubscriptionManager.d.ts +32 -0
- package/dist/session/internal/_SubscriptionManager.d.ts.map +1 -0
- package/dist/session/internal/_V2AudioStreamShim.d.ts +12 -0
- package/dist/session/internal/_V2AudioStreamShim.d.ts.map +1 -0
- package/dist/session/internal/_V2CameraShim.d.ts +51 -0
- package/dist/session/internal/_V2CameraShim.d.ts.map +1 -0
- package/dist/session/internal/_V2EventManagerShim.d.ts +51 -0
- package/dist/session/internal/_V2EventManagerShim.d.ts.map +1 -0
- package/dist/session/internal/_V2SessionShim.d.ts +165 -0
- package/dist/session/internal/_V2SessionShim.d.ts.map +1 -0
- package/dist/session/internal/_V2SettingsShim.d.ts +17 -0
- package/dist/session/internal/_V2SettingsShim.d.ts.map +1 -0
- package/dist/session/managers/CameraManager.d.ts +197 -0
- package/dist/session/managers/CameraManager.d.ts.map +1 -0
- package/dist/session/managers/DashboardManager.d.ts +131 -0
- package/dist/session/managers/DashboardManager.d.ts.map +1 -0
- package/dist/session/managers/DeviceManager.d.ts +332 -0
- package/dist/session/managers/DeviceManager.d.ts.map +1 -0
- package/dist/session/managers/DisplayManager.d.ts +171 -0
- package/dist/session/managers/DisplayManager.d.ts.map +1 -0
- package/dist/session/managers/LedManager.d.ts +131 -0
- package/dist/session/managers/LedManager.d.ts.map +1 -0
- package/dist/session/managers/LocationManager.d.ts +255 -0
- package/dist/session/managers/LocationManager.d.ts.map +1 -0
- package/dist/session/managers/MicManager.d.ts +252 -0
- package/dist/session/managers/MicManager.d.ts.map +1 -0
- package/dist/session/managers/PermissionsManager.d.ts +182 -0
- package/dist/session/managers/PermissionsManager.d.ts.map +1 -0
- package/dist/session/managers/PhoneManager.d.ts +295 -0
- package/dist/session/managers/PhoneManager.d.ts.map +1 -0
- package/dist/session/managers/SpeakerManager.d.ts +285 -0
- package/dist/session/managers/SpeakerManager.d.ts.map +1 -0
- package/dist/session/managers/StorageManager.d.ts +289 -0
- package/dist/session/managers/StorageManager.d.ts.map +1 -0
- package/dist/session/managers/TimeUtils.d.ts +175 -0
- package/dist/session/managers/TimeUtils.d.ts.map +1 -0
- package/dist/session/managers/TranscriptionManager.d.ts +195 -0
- package/dist/session/managers/TranscriptionManager.d.ts.map +1 -0
- package/dist/session/managers/TranslationManager.d.ts +189 -0
- package/dist/session/managers/TranslationManager.d.ts.map +1 -0
- package/dist/session.d.ts +41 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +4168 -0
- package/dist/session.js.map +44 -0
- package/dist/transport/Transport.d.ts +119 -0
- package/dist/transport/Transport.d.ts.map +1 -0
- package/dist/transport/WebSocketTransport.d.ts +73 -0
- package/dist/transport/WebSocketTransport.d.ts.map +1 -0
- package/dist/types/index.d.ts +31 -5
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/message-types.d.ts +25 -9
- package/dist/types/message-types.d.ts.map +1 -1
- package/dist/types/messages/app-to-cloud.d.ts +113 -16
- package/dist/types/messages/app-to-cloud.d.ts.map +1 -1
- package/dist/types/messages/cloud-to-app.d.ts +50 -4
- package/dist/types/messages/cloud-to-app.d.ts.map +1 -1
- package/dist/types/messages/cloud-to-glasses.d.ts +43 -14
- package/dist/types/messages/cloud-to-glasses.d.ts.map +1 -1
- package/dist/types/messages/glasses-to-cloud.d.ts +5 -5
- package/dist/types/messages/glasses-to-cloud.d.ts.map +1 -1
- package/dist/types/models.d.ts +17 -0
- package/dist/types/models.d.ts.map +1 -1
- package/dist/types/rtmp-stream.d.ts +4 -4
- package/dist/types/rtmp-stream.d.ts.map +1 -1
- package/dist/types/streams.d.ts +6 -1
- package/dist/types/streams.d.ts.map +1 -1
- package/dist/types/webhooks.d.ts +11 -0
- package/dist/types/webhooks.d.ts.map +1 -1
- package/dist/utils/error-utils.d.ts +139 -0
- package/dist/utils/error-utils.d.ts.map +1 -0
- package/dist/utils/permissions-utils.d.ts +30 -7
- package/dist/utils/permissions-utils.d.ts.map +1 -1
- package/node_modules/@mentra/types/dist/applet.d.ts +5 -1
- package/node_modules/@mentra/types/dist/applet.d.ts.map +1 -1
- package/node_modules/@mentra/types/dist/capabilities/even-realities-g2.d.ts +12 -0
- package/node_modules/@mentra/types/dist/capabilities/even-realities-g2.d.ts.map +1 -0
- package/node_modules/@mentra/types/dist/capabilities/even-realities-g2.js +61 -0
- package/node_modules/@mentra/types/dist/capabilities/mentra-display.d.ts +12 -0
- package/node_modules/@mentra/types/dist/capabilities/mentra-display.d.ts.map +1 -0
- package/node_modules/@mentra/types/dist/capabilities/mentra-display.js +54 -0
- package/node_modules/@mentra/types/dist/capabilities/none.d.ts +13 -0
- package/node_modules/@mentra/types/dist/capabilities/none.d.ts.map +1 -0
- package/node_modules/@mentra/types/dist/capabilities/none.js +67 -0
- package/node_modules/@mentra/types/dist/enums.d.ts +8 -2
- package/node_modules/@mentra/types/dist/enums.d.ts.map +1 -1
- package/node_modules/@mentra/types/dist/enums.js +9 -2
- package/node_modules/@mentra/types/dist/hardware.d.ts +3 -1
- package/node_modules/@mentra/types/dist/hardware.d.ts.map +1 -1
- package/node_modules/@mentra/types/dist/hardware.js +12 -2
- package/node_modules/@mentra/types/dist/index.d.ts +1 -1
- package/node_modules/@mentra/types/dist/index.d.ts.map +1 -1
- package/node_modules/@mentra/types/dist/index.js +2 -1
- package/node_modules/@mentra/types/package.json +2 -2
- package/package.json +24 -12
- package/dist/examples/managed-rtmp-streaming-example.d.ts +0 -2
- package/dist/examples/managed-rtmp-streaming-example.d.ts.map +0 -1
- package/dist/examples/managed-rtmp-streaming-with-restream-example.d.ts +0 -11
- package/dist/examples/managed-rtmp-streaming-with-restream-example.d.ts.map +0 -1
- package/dist/examples/rtmp-streaming-example.d.ts +0 -2
- package/dist/examples/rtmp-streaming-example.d.ts.map +0 -1
- package/node_modules/@mentra/types/src/applet.ts +0 -51
- package/node_modules/@mentra/types/src/capabilities/even-realities-g1.ts +0 -63
- package/node_modules/@mentra/types/src/capabilities/mentra-live.ts +0 -103
- package/node_modules/@mentra/types/src/capabilities/simulated-glasses.ts +0 -76
- package/node_modules/@mentra/types/src/capabilities/vuzix-z100.ts +0 -60
- package/node_modules/@mentra/types/src/cli.ts +0 -169
- package/node_modules/@mentra/types/src/device.ts +0 -43
- package/node_modules/@mentra/types/src/enums.ts +0 -36
- package/node_modules/@mentra/types/src/hardware.ts +0 -172
- package/node_modules/@mentra/types/src/index.ts +0 -64
- package/node_modules/@mentra/types/tsconfig.json +0 -22
- package/node_modules/@mentra/types/tsconfig.tsbuildinfo +0 -1
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* 📷 Camera Module
|
|
3
3
|
*
|
|
4
4
|
* Unified camera functionality for App Sessions.
|
|
5
|
-
* Handles
|
|
5
|
+
* Handles photo requests and livestreaming from connected glasses.
|
|
6
6
|
*/
|
|
7
|
-
import { PhotoData,
|
|
7
|
+
import { PhotoData, StreamStatus, ManagedStreamStatus, StreamStatusCheckResponse, CameraRoiPosition } from "../../../types";
|
|
8
8
|
import { VideoConfig, AudioConfig, StreamConfig, StreamStatusHandler } from "../../../types/rtmp-stream";
|
|
9
9
|
import { Logger } from "pino";
|
|
10
10
|
import { ManagedStreamOptions, ManagedStreamResult } from "./camera-managed-extension";
|
|
@@ -28,19 +28,36 @@ export interface PhotoRequestOptions {
|
|
|
28
28
|
size?: "small" | "medium" | "large" | "full";
|
|
29
29
|
/** Image compression level for upload optimization. Defaults to "none". */
|
|
30
30
|
compress?: "none" | "medium" | "heavy";
|
|
31
|
+
/** Controls shutter sound. Defaults to true if omitted. */
|
|
32
|
+
sound?: boolean;
|
|
31
33
|
}
|
|
32
34
|
/**
|
|
33
|
-
* Configuration options for
|
|
35
|
+
* Configuration options for a stream (RTMP, SRT, or WHIP)
|
|
34
36
|
*/
|
|
35
|
-
export interface
|
|
36
|
-
/** The
|
|
37
|
-
|
|
37
|
+
export interface StreamOptions {
|
|
38
|
+
/** The stream URL to stream to. Supports rtmp://, rtmps://, srt://, and https:// (WHIP) protocols.
|
|
39
|
+
* @example "rtmp://server.example.com/live/stream-key"
|
|
40
|
+
* @example "srt://server.example.com:4201?streamid=your-stream-id"
|
|
41
|
+
* @example "https://server.example.com/whip/endpoint"
|
|
42
|
+
*/
|
|
43
|
+
streamUrl: string;
|
|
38
44
|
/** Optional video configuration settings */
|
|
39
45
|
video?: VideoConfig;
|
|
40
46
|
/** Optional audio configuration settings */
|
|
41
47
|
audio?: AudioConfig;
|
|
42
48
|
/** Optional stream configuration settings */
|
|
43
49
|
stream?: StreamConfig;
|
|
50
|
+
/** Controls stream start/stop sounds. Defaults to true if omitted. */
|
|
51
|
+
sound?: boolean;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Options for setting the camera FOV and ROI position
|
|
55
|
+
*/
|
|
56
|
+
export interface CameraFovOptions {
|
|
57
|
+
/** Field of view in degrees (82-118). 118 means full sensor, no crop. */
|
|
58
|
+
fov: number;
|
|
59
|
+
/** ROI crop position. Ignored when fov is 118. Defaults to "center". */
|
|
60
|
+
roiPosition?: CameraRoiPosition;
|
|
44
61
|
}
|
|
45
62
|
/**
|
|
46
63
|
* 📷 Camera Module Implementation
|
|
@@ -48,7 +65,7 @@ export interface RtmpStreamOptions {
|
|
|
48
65
|
* Unified camera management for App Sessions.
|
|
49
66
|
* Provides methods for:
|
|
50
67
|
* - 📸 Requesting photos from glasses
|
|
51
|
-
* - 📹 Starting/stopping
|
|
68
|
+
* - 📹 Starting/stopping livestreams
|
|
52
69
|
* - 🔍 Monitoring photo and stream status
|
|
53
70
|
* - 🧹 Cleanup and cancellation
|
|
54
71
|
*
|
|
@@ -57,16 +74,16 @@ export interface RtmpStreamOptions {
|
|
|
57
74
|
* // Request a photo
|
|
58
75
|
* const photoData = await session.camera.requestPhoto({ saveToGallery: true });
|
|
59
76
|
*
|
|
60
|
-
* // Start
|
|
61
|
-
* await session.camera.
|
|
77
|
+
* // Start a livestream (managed, WebRTC by default)
|
|
78
|
+
* const urls = await session.camera.startLivestream();
|
|
79
|
+
*
|
|
80
|
+
* // Start a local livestream (unmanaged, to your own server)
|
|
81
|
+
* await session.camera.startLocalLivestream({ streamUrl: 'srt://192.168.1.100:4201' });
|
|
62
82
|
*
|
|
63
83
|
* // Monitor stream status
|
|
64
|
-
* session.camera.
|
|
84
|
+
* session.camera.onLocalLivestreamStatus((status) => {
|
|
65
85
|
* console.log('Stream status:', status.status);
|
|
66
86
|
* });
|
|
67
|
-
*
|
|
68
|
-
* // Stop streaming
|
|
69
|
-
* await session.camera.stopStream();
|
|
70
87
|
* ```
|
|
71
88
|
*/
|
|
72
89
|
export declare class CameraModule {
|
|
@@ -119,7 +136,7 @@ export declare class CameraModule {
|
|
|
119
136
|
* @deprecated Photo requests are now managed at AppServer level. This method delegates to AppServer.
|
|
120
137
|
*
|
|
121
138
|
* @param requestId - The request ID to cancel
|
|
122
|
-
* @returns true if the request was
|
|
139
|
+
* @returns true if the request was found and cancelled
|
|
123
140
|
*/
|
|
124
141
|
cancelPhotoRequest(requestId: string): boolean;
|
|
125
142
|
/**
|
|
@@ -130,32 +147,51 @@ export declare class CameraModule {
|
|
|
130
147
|
*/
|
|
131
148
|
cancelAllPhotoRequests(): number;
|
|
132
149
|
/**
|
|
133
|
-
*
|
|
150
|
+
* 🔭 Set the camera field-of-view and ROI crop position
|
|
151
|
+
*
|
|
152
|
+
* Fire-and-forget: the promise resolves once the message is sent.
|
|
153
|
+
* The phone applies the setting and pushes it to the glasses over BLE.
|
|
154
|
+
*
|
|
155
|
+
* @param options - FOV (82-118) and optional ROI position
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```typescript
|
|
159
|
+
* // Narrow crop, looking at the top of the frame
|
|
160
|
+
* await session.camera.setFov({ fov: 92, roiPosition: "top" });
|
|
161
|
+
*
|
|
162
|
+
* // Full sensor, no crop (roiPosition is ignored)
|
|
163
|
+
* await session.camera.setFov({ fov: 118 });
|
|
164
|
+
* ```
|
|
165
|
+
*/
|
|
166
|
+
setFov(options: CameraFovOptions): Promise<void>;
|
|
167
|
+
/**
|
|
168
|
+
* 📹 Start a local livestream to your own server (supports SRT, RTMP, WHIP)
|
|
134
169
|
*
|
|
135
|
-
*
|
|
170
|
+
* Use this when streaming to a server you control (local network or remote).
|
|
171
|
+
* For managed streaming with automatic WebRTC playback, use `startLivestream()` instead.
|
|
172
|
+
*
|
|
173
|
+
* @param options - Configuration options including the stream URL
|
|
136
174
|
* @returns Promise that resolves when the stream request is sent (not when streaming begins)
|
|
137
175
|
*
|
|
138
176
|
* @example
|
|
139
177
|
* ```typescript
|
|
140
|
-
* await session.camera.
|
|
141
|
-
*
|
|
142
|
-
* video: { resolution: '1920x1080', bitrate: 5000 },
|
|
143
|
-
* audio: { bitrate: 128 }
|
|
178
|
+
* await session.camera.startLocalLivestream({
|
|
179
|
+
* streamUrl: 'srt://192.168.1.100:4201?streamid=my-stream',
|
|
144
180
|
* });
|
|
145
181
|
* ```
|
|
146
182
|
*/
|
|
147
|
-
|
|
183
|
+
startLocalLivestream(options: StreamOptions): Promise<void>;
|
|
148
184
|
/**
|
|
149
|
-
* 🛑 Stop the current
|
|
185
|
+
* 🛑 Stop the current local livestream
|
|
150
186
|
*
|
|
151
187
|
* @returns Promise that resolves when the stop request is sent
|
|
152
188
|
*
|
|
153
189
|
* @example
|
|
154
190
|
* ```typescript
|
|
155
|
-
* await session.camera.
|
|
191
|
+
* await session.camera.stopLocalLivestream();
|
|
156
192
|
* ```
|
|
157
193
|
*/
|
|
158
|
-
|
|
194
|
+
stopLocalLivestream(): Promise<void>;
|
|
159
195
|
/**
|
|
160
196
|
* 🔍 Check if currently streaming
|
|
161
197
|
*
|
|
@@ -173,7 +209,7 @@ export declare class CameraModule {
|
|
|
173
209
|
*
|
|
174
210
|
* @returns The current stream status, or undefined if not available
|
|
175
211
|
*/
|
|
176
|
-
getStreamStatus():
|
|
212
|
+
getStreamStatus(): StreamStatus | undefined;
|
|
177
213
|
/**
|
|
178
214
|
* 📺 Subscribe to RTMP stream status updates
|
|
179
215
|
* This uses the standard stream subscription mechanism
|
|
@@ -184,13 +220,13 @@ export declare class CameraModule {
|
|
|
184
220
|
*/
|
|
185
221
|
unsubscribeFromStreamStatusUpdates(): void;
|
|
186
222
|
/**
|
|
187
|
-
* 👂 Listen for
|
|
223
|
+
* 👂 Listen for local livestream status updates
|
|
188
224
|
* @param handler - Function to call when stream status changes
|
|
189
225
|
* @returns Cleanup function to remove the handler
|
|
190
226
|
*
|
|
191
227
|
* @example
|
|
192
228
|
* ```typescript
|
|
193
|
-
* const cleanup = session.camera.
|
|
229
|
+
* const cleanup = session.camera.onLocalLivestreamStatus((status) => {
|
|
194
230
|
* console.log('Stream status:', status.status);
|
|
195
231
|
* if (status.status === 'error') {
|
|
196
232
|
* console.error('Stream error:', status.errorDetails);
|
|
@@ -201,7 +237,7 @@ export declare class CameraModule {
|
|
|
201
237
|
* cleanup();
|
|
202
238
|
* ```
|
|
203
239
|
*/
|
|
204
|
-
|
|
240
|
+
onLocalLivestreamStatus(handler: StreamStatusHandler): () => void;
|
|
205
241
|
/**
|
|
206
242
|
* 🔄 Update internal stream state based on a status message
|
|
207
243
|
* For internal use by AppSession
|
|
@@ -210,52 +246,74 @@ export declare class CameraModule {
|
|
|
210
246
|
*/
|
|
211
247
|
updateStreamState(message: any): void;
|
|
212
248
|
/**
|
|
213
|
-
* 📹 Start a
|
|
249
|
+
* 📹 Start a livestream
|
|
214
250
|
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
251
|
+
* Managed by Mentra cloud. Returns playback URLs automatically.
|
|
252
|
+
* By default uses WebRTC for sub-second latency. If restreamDestinations
|
|
253
|
+
* are provided, switches to SRT ingest with HLS/DASH playback.
|
|
254
|
+
* Multiple miniapps can consume the same livestream simultaneously.
|
|
217
255
|
*
|
|
218
|
-
* @param options - Configuration options for the
|
|
219
|
-
* @returns Promise that resolves with
|
|
256
|
+
* @param options - Configuration options for the livestream
|
|
257
|
+
* @returns Promise that resolves with playback URLs when the stream is ready
|
|
220
258
|
*
|
|
221
259
|
* @example
|
|
222
260
|
* ```typescript
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
*
|
|
261
|
+
* // Default: WebRTC (low latency)
|
|
262
|
+
* const urls = await session.camera.startLivestream();
|
|
263
|
+
* console.log('WebRTC URL:', urls.webrtcUrl);
|
|
264
|
+
*
|
|
265
|
+
* // With restream destinations: SRT + HLS/DASH
|
|
266
|
+
* const urls = await session.camera.startLivestream({
|
|
267
|
+
* restreamDestinations: [{ url: 'rtmp://...', name: 'YouTube' }]
|
|
226
268
|
* });
|
|
227
269
|
* console.log('HLS URL:', urls.hlsUrl);
|
|
228
270
|
* ```
|
|
229
271
|
*/
|
|
230
|
-
|
|
272
|
+
startLivestream(options?: ManagedStreamOptions): Promise<ManagedStreamResult>;
|
|
231
273
|
/**
|
|
232
|
-
* 🛑 Stop the current
|
|
274
|
+
* 🛑 Stop the current livestream
|
|
233
275
|
*
|
|
234
|
-
* This will stop streaming for this
|
|
235
|
-
* the same
|
|
276
|
+
* This will stop streaming for this miniapp only. If other miniapps are consuming
|
|
277
|
+
* the same livestream, it will continue for them.
|
|
236
278
|
*
|
|
237
279
|
* @returns Promise that resolves when the stop request is sent
|
|
238
280
|
*/
|
|
239
|
-
|
|
281
|
+
stopLivestream(): Promise<void>;
|
|
240
282
|
/**
|
|
241
|
-
* 🔔 Register a handler for
|
|
283
|
+
* 🔔 Register a handler for livestream status updates
|
|
242
284
|
*
|
|
243
285
|
* @param handler - Function to call when stream status changes
|
|
244
286
|
* @returns Cleanup function to unregister the handler
|
|
245
287
|
*/
|
|
246
|
-
|
|
288
|
+
onLivestreamStatus(handler: (status: ManagedStreamStatus) => void): () => void;
|
|
247
289
|
/**
|
|
248
|
-
* 📊 Check if
|
|
290
|
+
* 📊 Check if a livestream is active
|
|
249
291
|
*
|
|
250
|
-
* @returns true if a
|
|
292
|
+
* @returns true if a livestream is active
|
|
251
293
|
*/
|
|
252
|
-
|
|
294
|
+
isLivestreamActive(): boolean;
|
|
253
295
|
/**
|
|
254
|
-
* 🔗 Get current
|
|
296
|
+
* 🔗 Get current livestream URLs
|
|
255
297
|
*
|
|
256
298
|
* @returns Current stream URLs or undefined if not streaming
|
|
257
299
|
*/
|
|
300
|
+
getLivestreamUrls(): ManagedStreamResult | undefined;
|
|
301
|
+
/** @deprecated Use `startLivestream()` instead */
|
|
302
|
+
startManagedStream(options?: ManagedStreamOptions): Promise<ManagedStreamResult>;
|
|
303
|
+
/** @deprecated Use `stopLivestream()` instead */
|
|
304
|
+
stopManagedStream(): Promise<void>;
|
|
305
|
+
/** @deprecated Use `onLivestreamStatus()` instead */
|
|
306
|
+
onManagedStreamStatus(handler: (status: ManagedStreamStatus) => void): () => void;
|
|
307
|
+
/** @deprecated Use `isLivestreamActive()` instead */
|
|
308
|
+
isManagedStreamActive(): boolean;
|
|
309
|
+
/** @deprecated Use `getLivestreamUrls()` instead */
|
|
258
310
|
getManagedStreamUrls(): ManagedStreamResult | undefined;
|
|
311
|
+
/** @deprecated Use `startLocalLivestream()` instead */
|
|
312
|
+
startStream(options: StreamOptions): Promise<void>;
|
|
313
|
+
/** @deprecated Use `stopLocalLivestream()` instead */
|
|
314
|
+
stopStream(): Promise<void>;
|
|
315
|
+
/** @deprecated Use `onLocalLivestreamStatus()` instead */
|
|
316
|
+
onStreamStatus(handler: StreamStatusHandler): () => void;
|
|
259
317
|
/**
|
|
260
318
|
* 🔍 Check for any existing streams (managed or unmanaged) for the current user
|
|
261
319
|
*
|
|
@@ -272,7 +330,7 @@ export declare class CameraModule {
|
|
|
272
330
|
* if (streamInfo.streamInfo?.type === 'managed') {
|
|
273
331
|
* console.log('HLS URL:', streamInfo.streamInfo.hlsUrl);
|
|
274
332
|
* } else {
|
|
275
|
-
* console.log('
|
|
333
|
+
* console.log('Stream URL:', streamInfo.streamInfo.streamUrl);
|
|
276
334
|
* }
|
|
277
335
|
* }
|
|
278
336
|
* ```
|
|
@@ -290,7 +348,7 @@ export declare class CameraModule {
|
|
|
290
348
|
previewUrl?: string;
|
|
291
349
|
thumbnailUrl?: string;
|
|
292
350
|
activeViewers?: number;
|
|
293
|
-
|
|
351
|
+
streamUrl?: string;
|
|
294
352
|
requestingAppId?: string;
|
|
295
353
|
};
|
|
296
354
|
}>;
|
|
@@ -320,5 +378,5 @@ export declare class CameraModule {
|
|
|
320
378
|
photoRequests: number;
|
|
321
379
|
};
|
|
322
380
|
}
|
|
323
|
-
export { VideoConfig, AudioConfig, StreamConfig, StreamStatusHandler };
|
|
381
|
+
export type { VideoConfig, AudioConfig, StreamConfig, StreamStatusHandler };
|
|
324
382
|
//# sourceMappingURL=camera.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../../../../src/app/session/modules/camera.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAEL,SAAS,EAIT,
|
|
1
|
+
{"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../../../../src/app/session/modules/camera.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAEL,SAAS,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ACjB,MAAM,EAAE,MAAM,CAAC;YACf,SAAS,EAAE,IAAI,CAAC;YAEhB,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,OAAO,CAAC,EAAE,MAAM,CAAC;YACjB,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,UAAU,CAAC,EAAE,MAAM,CAAC;YACpB,YAAY,CAAC,EAAE,MAAM,CAAC;YACtB,aAAa,CAAC,EAAE,MAAM,CAAC;YAEvB,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,eAAe,CAAC,EAAE,MAAM,CAAC;SAC1B,CAAC;KACH,CAAC;IAIF;;;OAGG;IACH,yBAAyB,CAAC,QAAQ,EAAE,yBAAyB,GAAG,IAAI;IAIpE;;;OAGG;IACH,yBAAyB,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI;IAQ7D;;;;;OAKG;IACH,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAI3C;;;;OAIG;IACH,iBAAiB,IAAI;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE;CAe/C;AAGD,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
1
|
+
export * from "./audio";
|
|
2
|
+
export * from "./audio-output-stream";
|
|
3
|
+
export * from "./camera";
|
|
4
|
+
export * from "./camera-managed-extension";
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/app/session/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/app/session/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,uBAAuB,CAAA;AACrC,cAAc,UAAU,CAAA;AACxB,cAAc,4BAA4B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"led.d.ts","sourceRoot":"","sources":["../../../../src/app/session/modules/led.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"led.d.ts","sourceRoot":"","sources":["../../../../src/app/session/modules/led.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAA+C,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACvF,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE9B;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,gBAAgB;IAChB,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,OAAO,CAAM;IACrB,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,MAAM,CAAS;IAEvB;;;;;;;OAOG;gBACS,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;IAWjF;;;;;;;;;;;;;;OAcG;IACG,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAyCvD;;;;;;;;;OASG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IA4B9B;;;;;;;;;;OAUG;IACH,eAAe,IAAI,KAAK,CAAC;QACvB,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,OAAO,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IAUF;;;;;;;;;;;;;;OAcG;IACG,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAS3F;;;;;;;;;;;;;;;;;OAiBG;IACG,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAa7D;;;;OAIG;IACH,OAAO,IAAI,IAAI;CAGhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../../../src/app/session/modules/location.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../../../src/app/session/modules/location.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAyB,cAAc,EAAyB,MAAM,gBAAgB,CAAC;AAE9F,qBAAa,eAAe;IAC1B,OAAO,CAAC,OAAO,CAAa;IAC5B,OAAO,CAAC,0BAA0B,CAAwB;gBAE9C,OAAO,EAAE,UAAU;IAKxB,iBAAiB,CACtB,OAAO,EAAE;QACP,QAAQ,EACJ,UAAU,GACV,MAAM,GACN,UAAU,GACV,WAAW,GACX,eAAe,GACf,WAAW,GACX,iBAAiB,GACjB,SAAS,CAAC;KACf,EACD,OAAO,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,GACtC,MAAM,IAAI;IAmBN,qBAAqB,IAAI,IAAI;IAUvB,iBAAiB,CAAC,OAAO,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,cAAc,CAAC;CA4BvF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Logger } from "pino";
|
|
1
2
|
import { AppSetting, AppSettings } from "../../types";
|
|
2
3
|
/**
|
|
3
4
|
* Change information for a single setting
|
|
@@ -28,6 +29,7 @@ export declare class SettingsManager {
|
|
|
28
29
|
private settings;
|
|
29
30
|
private emitter;
|
|
30
31
|
private apiClient?;
|
|
32
|
+
private logger;
|
|
31
33
|
private mentraosSettings;
|
|
32
34
|
private mentraosEmitter;
|
|
33
35
|
private subscribeFn?;
|
|
@@ -39,8 +41,10 @@ export declare class SettingsManager {
|
|
|
39
41
|
* @param wsUrl WebSocket URL (for deriving HTTP API URL)
|
|
40
42
|
* @param userId User ID (for authenticated requests)
|
|
41
43
|
* @param subscribeFn Optional function to call to subscribe to streams
|
|
44
|
+
* @param logger Logger instance from the parent session
|
|
42
45
|
*/
|
|
43
|
-
constructor(initialSettings?: AppSettings, packageName?: string, wsUrl?: string, userId?: string, subscribeFn?: (streams: string[]) => Promise<void
|
|
46
|
+
constructor(initialSettings?: AppSettings, packageName?: string, wsUrl?: string, userId?: string, subscribeFn?: (streams: string[]) => Promise<void>, // Added parameter
|
|
47
|
+
logger?: Logger);
|
|
44
48
|
/**
|
|
45
49
|
* Configure the API client
|
|
46
50
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../src/app/session/settings.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../src/app/session/settings.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGtD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,GAAG,CAAC;IACd,QAAQ,EAAE,GAAG,CAAC;CACf;AAED;;GAEG;AACH,MAAM,MA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EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC;CAO9D"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Hono } from "hono";
|
|
2
|
+
import type { MiddlewareHandler } from "hono";
|
|
3
|
+
import { AuthVariables, MentraAuthContext, MentraAuthHonoContext } from "../../types";
|
|
3
4
|
import { AppSession } from "../session";
|
|
4
5
|
/**
|
|
5
6
|
* Extracts the temporary token from a URL string.
|
|
@@ -20,17 +21,16 @@ export declare function exchangeToken(cloudApiUrl: string, tempToken: string, ap
|
|
|
20
21
|
userId: string;
|
|
21
22
|
}>;
|
|
22
23
|
/**
|
|
23
|
-
*
|
|
24
|
+
* Hono middleware for automatically handling the token exchange.
|
|
24
25
|
* Assumes API key and Cloud URL are available (e.g., via environment variables).
|
|
25
|
-
*
|
|
26
|
+
* Sets context variables `authUserId` and `activeSession` if successful.
|
|
26
27
|
*
|
|
27
28
|
* @param options Configuration options.
|
|
28
|
-
* @param options.cloudApiUrl The base URL of the MentraOS Cloud API.
|
|
29
29
|
* @param options.apiKey Your App's secret API key.
|
|
30
|
-
* @param options.
|
|
30
|
+
* @param options.packageName Your App's package name.
|
|
31
31
|
* @param options.cookieName The name of the cookie to store the session token (default: 'aos_session').
|
|
32
32
|
* @param options.cookieSecret Secret key used to sign the session cookie. MUST be provided and kept secure.
|
|
33
|
-
* @param options.cookieOptions Options for the session cookie
|
|
33
|
+
* @param options.cookieOptions Options for the session cookie.
|
|
34
34
|
*/
|
|
35
35
|
export declare function createAuthMiddleware(options: {
|
|
36
36
|
apiKey: string;
|
|
@@ -42,8 +42,66 @@ export declare function createAuthMiddleware(options: {
|
|
|
42
42
|
httpOnly?: boolean;
|
|
43
43
|
secure?: boolean;
|
|
44
44
|
maxAge?: number;
|
|
45
|
-
sameSite?:
|
|
45
|
+
sameSite?: "Lax" | "Strict" | "None";
|
|
46
46
|
path?: string;
|
|
47
47
|
};
|
|
48
|
-
}):
|
|
48
|
+
}): MiddlewareHandler<{
|
|
49
|
+
Variables: AuthVariables;
|
|
50
|
+
}>;
|
|
51
|
+
/**
|
|
52
|
+
* Read the authenticated Mentra context from a Hono request context.
|
|
53
|
+
*
|
|
54
|
+
* This helper intentionally hides the underlying context variable names so
|
|
55
|
+
* app code does not depend on implementation details like `authUserId`.
|
|
56
|
+
*/
|
|
57
|
+
export declare function getMentraAuth(c: MentraAuthHonoContext): MentraAuthContext;
|
|
58
|
+
/**
|
|
59
|
+
* Read the authenticated Mentra context and throw if no authenticated user
|
|
60
|
+
* is present. Intended for SDK-owned middleware / helpers that want a strict
|
|
61
|
+
* contract after authentication has been enforced.
|
|
62
|
+
*/
|
|
63
|
+
export declare function requireMentraAuth(c: MentraAuthHonoContext): {
|
|
64
|
+
userId: string;
|
|
65
|
+
session: AppSession | null;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Generates a frontend token for client-side authentication.
|
|
69
|
+
* The token format is userId:hash where hash = sha256(userId + sha256(apiKey))
|
|
70
|
+
* @param userId The user ID to embed in the token
|
|
71
|
+
* @param apiKey The app's API key
|
|
72
|
+
* @returns A frontend token string
|
|
73
|
+
*/
|
|
74
|
+
export declare function generateFrontendToken(userId: string, apiKey: string): string;
|
|
75
|
+
/**
|
|
76
|
+
* Creates a Hono sub-app with authentication routes for frontend token exchange.
|
|
77
|
+
* Mount this at /api/mentra/auth to enable frontend-initiated authentication.
|
|
78
|
+
*
|
|
79
|
+
* This is required for apps using Bun's fullstack dev server where the HTML
|
|
80
|
+
* is served directly by Bun's routes (bypassing Hono middleware).
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```typescript
|
|
84
|
+
* import { createMentraAuthRoutes } from "@mentra/sdk";
|
|
85
|
+
*
|
|
86
|
+
* const app = new MyAppServer({...});
|
|
87
|
+
*
|
|
88
|
+
* app.route("/api/mentra/auth", createMentraAuthRoutes({
|
|
89
|
+
* apiKey: API_KEY,
|
|
90
|
+
* packageName: PACKAGE_NAME,
|
|
91
|
+
* cookieSecret: COOKIE_SECRET,
|
|
92
|
+
* }));
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
export declare function createMentraAuthRoutes(options: {
|
|
96
|
+
apiKey: string;
|
|
97
|
+
packageName: string;
|
|
98
|
+
cookieSecret: string;
|
|
99
|
+
cookieOptions?: {
|
|
100
|
+
httpOnly?: boolean;
|
|
101
|
+
secure?: boolean;
|
|
102
|
+
maxAge?: number;
|
|
103
|
+
sameSite?: "Lax" | "Strict" | "None";
|
|
104
|
+
path?: string;
|
|
105
|
+
};
|
|
106
|
+
}): Hono;
|
|
49
107
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/app/webview/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/app/webview/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,KAAK,EAAiB,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAK7D,OAAO,EAAE,aAAa,EAAwB,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAC5G,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAMxC;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQ3D;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CACjC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAmC7B;AA6HD;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE;IAC5C,MAAM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,EAAE,MAAM,CAAC;KACf,CAAC;CACH,GAAG,IAAI,CA+EP"}
|
|
@@ -1,18 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* updates.ts
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* in the terminal to notify developers about new SDK releases.
|
|
4
|
+
* SDK update notification messages and dist-tag utilities.
|
|
6
5
|
*
|
|
7
|
-
*
|
|
8
|
-
* that
|
|
9
|
-
* https://patorjk.com/software/taag/
|
|
6
|
+
* Previously used boxen-bordered ASCII art banners. Now returns plain
|
|
7
|
+
* single-line strings that the clean transport formats with color/prefix.
|
|
10
8
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
9
|
+
* The clean logger renders this as:
|
|
10
|
+
* MentraOS ⚠ SDK update available: 2.1.29 → 2.1.30 — bun install @mentra/sdk@latest
|
|
11
|
+
* MentraOS ⚠ SDK update available: 3.0.0-hono.4 → 3.0.0-hono.5 — bun install @mentra/sdk@hono
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Determine the npm dist-tag (release track) from a semver version string.
|
|
15
|
+
*
|
|
16
|
+
* Parses the prerelease identifier:
|
|
17
|
+
* "2.1.29" → "latest" (no prerelease)
|
|
18
|
+
* "2.1.31-beta.5" → "beta"
|
|
19
|
+
* "3.0.0-hono.4" → "hono"
|
|
20
|
+
* "2.1.2-alpha.0" → "alpha"
|
|
21
|
+
* "4.0.0-rc.1" → "rc"
|
|
22
|
+
* "1.0.0-unknown.1" → "latest" (unrecognized prerelease falls back to latest)
|
|
23
|
+
*
|
|
24
|
+
* @param version - The installed SDK version string
|
|
25
|
+
* @returns The dist-tag name (e.g., "latest", "beta", "hono")
|
|
26
|
+
*/
|
|
27
|
+
export declare function getDistTag(version: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* Generate a single-line SDK update notification message.
|
|
14
30
|
*
|
|
31
|
+
* The install command uses the correct dist-tag so developers on non-latest
|
|
32
|
+
* tracks (beta, hono, etc.) aren't told to install @latest which would
|
|
33
|
+
* downgrade/brick their app.
|
|
15
34
|
*
|
|
35
|
+
* @param currentVersion - The currently installed SDK version
|
|
36
|
+
* @param latestVersion - The latest available SDK version for this track
|
|
37
|
+
* @param tag - The npm dist-tag for the install command (default: "latest")
|
|
38
|
+
* @returns A plain string suitable for `logger.warn()`
|
|
16
39
|
*/
|
|
17
|
-
export declare const newSDKUpdate: (
|
|
40
|
+
export declare const newSDKUpdate: (currentVersion: string, latestVersion: string, tag?: string) => string;
|
|
18
41
|
//# sourceMappingURL=updates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updates.d.ts","sourceRoot":"","sources":["../../../src/constants/log-messages/updates.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"updates.d.ts","sourceRoot":"","sources":["../../../src/constants/log-messages/updates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AASH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAIlD;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,GAAI,gBAAgB,MAAM,EAAE,eAAe,MAAM,EAAE,MAAK,MAAiB,KAAG,MAEpG,CAAC"}
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* warning.ts
|
|
3
|
+
*
|
|
4
|
+
* Permission warning messages for the MentraOS SDK.
|
|
5
|
+
*
|
|
6
|
+
* Previously used boxen-bordered ASCII art banners with side-by-side layouts.
|
|
7
|
+
* Now returns plain single-line strings that the clean transport formats with
|
|
8
|
+
* color/prefix.
|
|
9
|
+
*
|
|
10
|
+
* The clean logger renders these as:
|
|
11
|
+
* MentraOS ⚠ camera permission required for requestPhoto — enable at https://console.mentra.glass/apps/org.example.myapp/edit
|
|
12
|
+
*/
|
|
1
13
|
export declare const noMicrophoneWarn: (funcName?: string, packageName?: string) => string;
|
|
2
14
|
export declare const locationWarn: (funcName?: string, packageName?: string) => string;
|
|
3
15
|
export declare const baackgroundLocationWarn: (funcName?: string, packageName?: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warning.d.ts","sourceRoot":"","sources":["../../../src/constants/log-messages/warning.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"warning.d.ts","sourceRoot":"","sources":["../../../src/constants/log-messages/warning.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAgBH,eAAO,MAAM,gBAAgB,GAAI,WAAW,MAAM,EAAE,cAAc,MAAM,KAAG,MACb,CAAC;AAE/D,eAAO,MAAM,YAAY,GAAI,WAAW,MAAM,EAAE,cAAc,MAAM,KAAG,MACX,CAAC;AAE7D,eAAO,MAAM,uBAAuB,GAAI,WAAW,MAAM,EAAE,cAAc,MAAM,KAAG,MACX,CAAC;AAExE,eAAO,MAAM,YAAY,GAAI,WAAW,MAAM,EAAE,cAAc,MAAM,KAAG,MACX,CAAC;AAE7D,eAAO,MAAM,mBAAmB,GAAI,WAAW,MAAM,EAAE,cAAc,MAAM,KAAG,MACT,CAAC;AAEtE,eAAO,MAAM,mBAAmB,GAAI,WAAW,MAAM,EAAE,cAAc,MAAM,KAAG,MACT,CAAC;AAEtE,eAAO,MAAM,UAAU,GAAI,WAAW,MAAM,EAAE,cAAc,MAAM,KAAG,MACX,CAAC"}
|
package/dist/display-utils.d.ts
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* Glasses-agnostic, pixel-accurate text measurement and wrapping library
|
|
5
5
|
* for smart glasses displays.
|
|
6
6
|
*
|
|
7
|
+
* This module re-exports from the shared @mentra/display-utils package.
|
|
8
|
+
*
|
|
7
9
|
* @example
|
|
8
10
|
* ```typescript
|
|
9
11
|
* import {
|
|
@@ -26,5 +28,5 @@
|
|
|
26
28
|
* const viewport = scrollView.getViewport()
|
|
27
29
|
* ```
|
|
28
30
|
*/
|
|
29
|
-
export
|
|
31
|
+
export * from "@mentra/display-utils";
|
|
30
32
|
//# sourceMappingURL=display-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display-utils.d.ts","sourceRoot":"","sources":["../src/display-utils.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"display-utils.d.ts","sourceRoot":"","sources":["../src/display-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAGH,cAAc,uBAAuB,CAAA"}
|