@mentra/cloud-client 3.2.0-dev.235 → 3.2.0-dev.245
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mentra/cloud-client",
|
|
3
|
-
"version": "3.2.0-dev.
|
|
3
|
+
"version": "3.2.0-dev.245",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"exports": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"test": "bun test"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@mentra/cloud-protocol": "3.2.0-dev.
|
|
15
|
+
"@mentra/cloud-protocol": "3.2.0-dev.245",
|
|
16
16
|
"tweetnacl": "^1.0.3"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
@@ -20,7 +20,6 @@ import type { HttpClient } from "../../http";
|
|
|
20
20
|
import { systemTimers, type CloudClientTimers } from "../../timers";
|
|
21
21
|
import type {
|
|
22
22
|
CloudToClientMessage,
|
|
23
|
-
PhotoOptions,
|
|
24
23
|
StreamOptions,
|
|
25
24
|
ManagedStream,
|
|
26
25
|
StreamStatusResult,
|
|
@@ -29,7 +28,6 @@ import type {
|
|
|
29
28
|
// The camera wire types are canonical in the protocol package (the cloud server
|
|
30
29
|
// uses the same ones); re-export them so a host gets them from this module.
|
|
31
30
|
export type {
|
|
32
|
-
PhotoOptions,
|
|
33
31
|
StreamOptions,
|
|
34
32
|
ManagedStream,
|
|
35
33
|
StreamStatusResult,
|
|
@@ -88,8 +86,8 @@ export class Camera {
|
|
|
88
86
|
* the POST has already resolved by the time we await it, so the key exists
|
|
89
87
|
* before any push can be processed for it.
|
|
90
88
|
*/
|
|
91
|
-
async requestPhoto(
|
|
92
|
-
const { requestId } = await this.startPhoto(
|
|
89
|
+
async requestPhoto(): Promise<PhotoResult> {
|
|
90
|
+
const { requestId } = await this.startPhoto();
|
|
93
91
|
return this.awaitPhotoReady(requestId);
|
|
94
92
|
}
|
|
95
93
|
|
|
@@ -100,7 +98,7 @@ export class Camera {
|
|
|
100
98
|
* `photo.ready` push can fire; plain consumers can keep using
|
|
101
99
|
* {@link requestPhoto}, which composes both steps.
|
|
102
100
|
*/
|
|
103
|
-
async startPhoto(
|
|
101
|
+
async startPhoto(): Promise<{
|
|
104
102
|
requestId: string;
|
|
105
103
|
uploadUrl: string;
|
|
106
104
|
readUrl: string;
|
|
@@ -109,7 +107,7 @@ export class Camera {
|
|
|
109
107
|
requestId: string;
|
|
110
108
|
uploadUrl: string;
|
|
111
109
|
readUrl: string;
|
|
112
|
-
}>(PHOTO_PATH
|
|
110
|
+
}>(PHOTO_PATH);
|
|
113
111
|
}
|
|
114
112
|
|
|
115
113
|
/** Step 2: resolve when the cloud pushes `photo.ready` for the request. */
|
|
@@ -29,7 +29,7 @@ import type { Connection } from "./connection";
|
|
|
29
29
|
import { HandshakeRejectedError } from "./connection";
|
|
30
30
|
import type { RuntimeEmitter, RuntimeEvents } from "./emitter";
|
|
31
31
|
import type { Subscriptions } from "./subscriptions";
|
|
32
|
-
import type { Camera,
|
|
32
|
+
import type { Camera, StreamOptions, ManagedStream, StreamStatusResult } from "./camera";
|
|
33
33
|
import type { Maps, DirectionsRequest, DirectionsResult, LatLng, ReverseGeocodeResult } from "./maps";
|
|
34
34
|
import type { Tts, RuntimeTtsSpeakOptions, RuntimeTtsSpeechSource } from "./tts";
|
|
35
35
|
import type { UdpAudio } from "./audio-udp";
|
|
@@ -41,7 +41,7 @@ const UDP_LIVENESS_TIMEOUT_MS = 3_000;
|
|
|
41
41
|
|
|
42
42
|
// Re-export the camera option/result types so a host importing the runtime gets
|
|
43
43
|
// them from one place alongside the module that produces them.
|
|
44
|
-
export type {
|
|
44
|
+
export type { StreamOptions, ManagedStream, StreamStatusResult } from "./camera";
|
|
45
45
|
export type {
|
|
46
46
|
DirectionsRequest,
|
|
47
47
|
DirectionsResult,
|
|
@@ -86,8 +86,8 @@ export interface RuntimeModule {
|
|
|
86
86
|
onTranscript(handler: (data: TranscriptionData) => void): () => void;
|
|
87
87
|
onTranslation(handler: (data: TranslationData) => void): () => void;
|
|
88
88
|
|
|
89
|
-
requestManagedPhoto(
|
|
90
|
-
startManagedPhoto(
|
|
89
|
+
requestManagedPhoto(): Promise<{ requestId: string; readUrl: string }>;
|
|
90
|
+
startManagedPhoto(): Promise<{ requestId: string; uploadUrl: string; readUrl: string }>;
|
|
91
91
|
awaitManagedPhotoReady(requestId: string): Promise<{ requestId: string; readUrl: string }>;
|
|
92
92
|
startManagedStream(opts: StreamOptions): Promise<ManagedStream>;
|
|
93
93
|
getManagedStreamStatus(streamId: string): Promise<StreamStatusResult>;
|
|
@@ -444,13 +444,13 @@ export class Runtime implements RuntimeModule {
|
|
|
444
444
|
|
|
445
445
|
// --- Camera: managed photo/stream (delegated) -----------------------------
|
|
446
446
|
|
|
447
|
-
requestManagedPhoto(
|
|
448
|
-
return this.camera.requestPhoto(
|
|
447
|
+
requestManagedPhoto(): Promise<{ requestId: string; readUrl: string }> {
|
|
448
|
+
return this.camera.requestPhoto();
|
|
449
449
|
}
|
|
450
450
|
|
|
451
451
|
/** Device-side managed photo: presign now, deliver bytes yourself, then await ready. */
|
|
452
|
-
startManagedPhoto(
|
|
453
|
-
return this.camera.startPhoto(
|
|
452
|
+
startManagedPhoto(): Promise<{ requestId: string; uploadUrl: string; readUrl: string }> {
|
|
453
|
+
return this.camera.startPhoto();
|
|
454
454
|
}
|
|
455
455
|
|
|
456
456
|
awaitManagedPhotoReady(requestId: string): Promise<{ requestId: string; readUrl: string }> {
|