@mentra/miniapp 0.3.0-dev.0 → 3.1.0-dev.10
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 +8 -6
- package/dist/background/index.d.ts +7 -4
- package/dist/background/index.d.ts.map +1 -1
- package/dist/background/index.js +1 -0
- package/dist/background/index.js.map +1 -1
- package/dist/background/register.d.ts +3 -2
- package/dist/background/register.d.ts.map +1 -1
- package/dist/background/register.js.map +1 -1
- package/dist/hardware.d.ts +24 -0
- package/dist/hardware.d.ts.map +1 -0
- package/dist/hardware.js +20 -0
- package/dist/hardware.js.map +1 -0
- package/dist/index.d.ts +8 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/modules/camera.d.ts +50 -4
- package/dist/modules/camera.d.ts.map +1 -1
- package/dist/modules/camera.js +20 -5
- package/dist/modules/camera.js.map +1 -1
- package/dist/modules/events.d.ts +10 -17
- package/dist/modules/events.d.ts.map +1 -1
- package/dist/modules/events.js +56 -11
- package/dist/modules/events.js.map +1 -1
- package/dist/modules/glasses.d.ts +8 -0
- package/dist/modules/glasses.d.ts.map +1 -1
- package/dist/modules/glasses.js +13 -0
- package/dist/modules/glasses.js.map +1 -1
- package/dist/modules/languages.d.ts +42 -0
- package/dist/modules/languages.d.ts.map +1 -0
- package/dist/modules/languages.js +57 -0
- package/dist/modules/languages.js.map +1 -0
- package/dist/modules/mic.d.ts +17 -0
- package/dist/modules/mic.d.ts.map +1 -1
- package/dist/modules/mic.js +28 -1
- package/dist/modules/mic.js.map +1 -1
- package/dist/modules/miniapps.d.ts +2 -0
- package/dist/modules/miniapps.d.ts.map +1 -1
- package/dist/modules/miniapps.js.map +1 -1
- package/dist/modules/phone.d.ts +38 -4
- package/dist/modules/phone.d.ts.map +1 -1
- package/dist/modules/phone.js +22 -6
- package/dist/modules/phone.js.map +1 -1
- package/dist/modules/speaker.d.ts +12 -0
- package/dist/modules/speaker.d.ts.map +1 -1
- package/dist/modules/speaker.js +7 -8
- package/dist/modules/speaker.js.map +1 -1
- package/dist/modules/stream.d.ts +6 -2
- package/dist/modules/stream.d.ts.map +1 -1
- package/dist/modules/stream.js +1 -0
- package/dist/modules/stream.js.map +1 -1
- package/dist/modules/system.d.ts +20 -1
- package/dist/modules/system.d.ts.map +1 -1
- package/dist/modules/system.js +13 -1
- package/dist/modules/system.js.map +1 -1
- package/dist/modules/transcription.d.ts +35 -8
- package/dist/modules/transcription.d.ts.map +1 -1
- package/dist/modules/transcription.js +32 -12
- package/dist/modules/transcription.js.map +1 -1
- package/dist/modules/translation.d.ts +9 -3
- package/dist/modules/translation.d.ts.map +1 -1
- package/dist/modules/translation.js +5 -3
- package/dist/modules/translation.js.map +1 -1
- package/dist/protocol.d.ts +24 -2
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +24 -2
- package/dist/protocol.js.map +1 -1
- package/dist/react/capsuleHeaderLayout.d.ts +3 -0
- package/dist/react/capsuleHeaderLayout.d.ts.map +1 -0
- package/dist/react/capsuleHeaderLayout.js +5 -0
- package/dist/react/capsuleHeaderLayout.js.map +1 -0
- package/dist/react/useCapsuleHeaderStyle.d.ts.map +1 -1
- package/dist/react/useCapsuleHeaderStyle.js +6 -1
- package/dist/react/useCapsuleHeaderStyle.js.map +1 -1
- package/dist/session.d.ts +5 -3
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +7 -3
- package/dist/session.js.map +1 -1
- package/dist/sub-path-types.test-d.d.ts +12 -0
- package/dist/sub-path-types.test-d.d.ts.map +1 -1
- package/dist/sub-path-types.test-d.js.map +1 -1
- package/dist/transport/mock.js +5 -0
- package/dist/transport/mock.js.map +1 -1
- package/package.json +16 -3
- package/src/background/index.ts +18 -4
- package/src/background/register.ts +10 -3
- package/src/hardware.ts +25 -0
- package/src/index.ts +23 -9
- package/src/modules/camera.ts +75 -13
- package/src/modules/events.ts +54 -27
- package/src/modules/glasses.ts +14 -0
- package/src/modules/languages.ts +72 -0
- package/src/modules/mic.ts +30 -1
- package/src/modules/miniapps.ts +2 -0
- package/src/modules/phone.ts +59 -24
- package/src/modules/speaker.ts +21 -2
- package/src/modules/stream.ts +7 -2
- package/src/modules/system.ts +26 -1
- package/src/modules/transcription.ts +63 -16
- package/src/modules/translation.ts +22 -8
- package/src/protocol.ts +29 -3
- package/src/react/capsuleHeaderLayout.ts +11 -0
- package/src/react/useCapsuleHeaderStyle.ts +6 -1
- package/src/session.ts +19 -7
- package/src/sub-path-types.test-d.ts +12 -1
- package/src/transport/mock.ts +7 -0
package/README.md
CHANGED
|
@@ -104,24 +104,24 @@ Convenience wrappers: `onVisibilityChange`, `onCapabilitiesChange`, `onColorSche
|
|
|
104
104
|
|
|
105
105
|
## Modules
|
|
106
106
|
|
|
107
|
-
All event subscribers return an `UnsubscribeFn`. Subscriptions are ref-counted: the SDK
|
|
107
|
+
All event subscribers return an `UnsubscribeFn`. Subscriptions are ref-counted: the SDK sends `SUBSCRIBE` when a stream's active state or routing metadata changes.
|
|
108
108
|
|
|
109
109
|
| Module | Methods |
|
|
110
110
|
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
111
111
|
| `session.display` | `render(elements, opts?)` — scene API: diffed frames, stable-id in-place updates, `render([])` clears |
|
|
112
112
|
| `session.speaker` | `play({audioUrl})`, `speak(text, options?)`, `createStream({sampleRate?, volume?})` for bounded 16-bit PCM output, `stop()`, `onStateChange(handler)` |
|
|
113
113
|
| `session.mic` | `onAudioChunk(handler)`, `onVoiceActivity(handler)`, `stop()`, `hasPermission` |
|
|
114
|
-
| `session.transcription` | `on(handler)`, `forLanguage(lang \| [langs], handler)`, `configure({languageHints, vocabulary, diarization})`, `stop()`, `hasPermission`
|
|
114
|
+
| `session.transcription` | `on(handler, {forceLocal?})`, `forLanguage(lang \| [langs], handler, {forceLocal?})`, `configure({languageHints, vocabulary, diarization})`, `stop()`, `hasPermission` |
|
|
115
115
|
| `session.translation` | `forLanguagePair(from, to, handler)`, `stop()`, `hasPermission` |
|
|
116
116
|
| `session.input` | `onButtonPress(handler)`, `onTouch(handler \| gesture, handler \| gestures, handler)` |
|
|
117
117
|
| `session.location` | `onUpdate(handler)`, `hasPermission` |
|
|
118
118
|
| `session.imu` | `onHeadPosition(handler)` |
|
|
119
119
|
| `session.glasses` | `onBattery(handler)`, `onConnection(handler)` |
|
|
120
120
|
| `session.phone.notifications` | `on(handler)`, `onDismissed(handler)`, `stop()`, `hasPermission` |
|
|
121
|
-
| `session.phone.calendar` | `
|
|
121
|
+
| `session.phone.calendar` | `listEvents({startsAt, endsAt, limit?})`, `hasPermission` |
|
|
122
122
|
| `session.phone` | `onBattery(handler)` |
|
|
123
123
|
| `session.system` | `share(opts)`, `openUrl(url)`, `copyToClipboard(text)`, `download(opts)` |
|
|
124
|
-
| `session.camera` | `takePhoto({size?, compress?, sound?, saveToGallery
|
|
124
|
+
| `session.camera` | `takePhoto({size?, mode?, transferMethod?, compress?, sound?, saveToGallery?, zsl?, mfnr?, timeoutMs?, ...})`, `setFov({fov, roiPosition?} \| {preset})`, `hasPermission` |
|
|
125
125
|
| `session.led` | `turnOn({color?, ontime?, offtime?, count?})`, `turnOff()`, `blink(color, ontime, offtime, count)`, `solid(color, duration)` — resolve after the glasses acknowledge the RGB command |
|
|
126
126
|
| `session.permissions` | `has(type)`, `getAll()`, `onUpdate(handler)`, `onPermissionError(handler)` |
|
|
127
127
|
| `session.storage` | `get(key)`, `set(key, value)`, `delete(key)`, `list()` — strings only, scoped to `(userId, packageName)` |
|
|
@@ -132,15 +132,17 @@ All event subscribers return an `UnsubscribeFn`. Subscriptions are ref-counted:
|
|
|
132
132
|
|
|
133
133
|
### Camera FOV
|
|
134
134
|
|
|
135
|
-
`await session.camera.setFov({fov, roiPosition})` applies
|
|
135
|
+
`await session.camera.setFov({fov, roiPosition})` applies a temporary, miniapp-owned FOV/ROI override and resolves with `CameraFovResult` after the ASG client reports the setting was applied following the camera restart cooldown. The host restores the previous live miniapp override—or the persistent 118-degree full-sensor base—when this miniapp closes. `roiPosition` accepts `"center"`, `"bottom"`, or `"top"` and defaults to `"center"`. You can also call `setFov({preset: "narrow" | "standard" | "wide"})`; presets map to 82, 102, and 118 degrees with center ROI. The call requires `CAMERA` in `miniapp.json` and rejects with `MiniappRequestError` if the host or glasses cannot apply it.
|
|
136
136
|
|
|
137
137
|
### Camera Photos
|
|
138
138
|
|
|
139
139
|
`await session.camera.takePhoto(...)` resolves only after the photo is delivered through the phone/cloud upload path. The result includes `{requestId, photoUrl, mimeType, size}`. Glasses-side or phone-relay failures such as `CAMERA_BUSY`, `BATTERY_LOW`, storage errors, or fallback upload failures reject before upload polling completes; intermediate `photo_status` progress and request acceptance alone do not resolve the miniapp photo promise.
|
|
140
140
|
|
|
141
|
+
Pass `transferMethod: "ble"` to skip direct Wi-Fi upload and always relay the image through the phone over Bluetooth. The default `"auto"` mode tries direct upload first and falls back to BLE.
|
|
142
|
+
|
|
141
143
|
### Transcription language convention
|
|
142
144
|
|
|
143
|
-
Transcription/translation streams use a colon-suffixed wire format: `transcription:en-US`, `translation:en-US:fr-FR`. `session.transcription.on(handler)` subscribes to `transcription:auto` (cloud auto-detects). The detected language is in the payload. A handler on `transcription:auto` receives any `transcription:<lang>` event — wildcard fan-out — so "give me transcripts in whatever language" works without manual wiring. Use `session.transcription.forLanguage(lang | [langs], handler)` to pin specific languages.
|
|
145
|
+
Transcription/translation streams use a colon-suffixed wire format: `transcription:en-US`, `translation:en-US:fr-FR`. `session.transcription.on(handler)` subscribes to `transcription:auto` (cloud auto-detects). The detected language is in the payload. A handler on `transcription:auto` receives any `transcription:<lang>` event — wildcard fan-out — so "give me transcripts in whatever language" works without manual wiring. Use `session.transcription.forLanguage(lang | [langs], handler)` to pin specific languages. Pass `{forceLocal: true}` as the final argument to either method to require on-device transcription and suppress cloud results for that subscription. Routing is per listener, so a default listener on the same stream can continue receiving cloud transcription.
|
|
144
146
|
|
|
145
147
|
### Permissions semantics
|
|
146
148
|
|
|
@@ -15,9 +15,12 @@
|
|
|
15
15
|
* separate type-roots on each `exports` entry.
|
|
16
16
|
*/
|
|
17
17
|
export { MiniappSession, type MiniappSessionOptions } from "../session";
|
|
18
|
-
export { registerMiniapp, type MiniappInitHandler } from "./register";
|
|
19
|
-
export type { TranscriptionData, TranslationData, ButtonPressData, AudioChunkData, VadData, BatteryData, ConnectionData, WifiData, HeadPositionData, AccelData, LocationData, PhoneNotificationData, NotificationDismissedData,
|
|
18
|
+
export { registerMiniapp, type MiniappInitHandler, type TypedMiniappSession } from "./register";
|
|
19
|
+
export type { TranscriptionData, TranslationData, ButtonPressData, AudioChunkData, VadData, BatteryData, ConnectionData, WifiData, HeadPositionData, AccelData, LocationData, PhoneNotificationData, NotificationDismissedData, HeadingData, TouchData, UnsubscribeFn, } from "../modules/events";
|
|
20
|
+
export type { CalendarEvent, CalendarListOptions, CalendarListResult } from "../modules/phone";
|
|
20
21
|
export { MiniappRequestType, MiniappResponseType, MiniappStreamType, MiniappErrorCode } from "../protocol";
|
|
22
|
+
export { MiniappValidationError, SUPPORTED_LANGUAGE_HINTS, SUPPORTED_TRANSCRIPTION_LANGUAGES, isTranscriptionLanguage, } from "../modules/languages";
|
|
23
|
+
export type { LanguageHint, TranscriptionLanguage } from "../modules/languages";
|
|
21
24
|
export type { ActionContext, ActionHandler, InvokeOptions } from "../modules/actions";
|
|
22
25
|
export type { DisplayManager } from "../modules/display";
|
|
23
26
|
export type { CameraFovPreset, CameraFovRequest, CameraFovResult, CameraModule, CameraRoiPosition, SetCameraFovOptions, } from "../modules/camera";
|
|
@@ -49,8 +52,8 @@ export type { LedColor, LedControlOptions } from "../modules/led";
|
|
|
49
52
|
export type { ViewType, DisplayBreakMode, RenderBox, RenderElement, RenderOptions, RenderRectStyle, RenderResult, RenderTextStyle, } from "../modules/display";
|
|
50
53
|
export type { DashboardMode } from "../modules/dashboard";
|
|
51
54
|
export type { PlayAudioOptions, SpeakOptions, SpeakResult, SpeakerState, SpeakerStateEvent } from "../modules/speaker";
|
|
52
|
-
export type { ShareOptions, ShareResult, DownloadOptions, DownloadResult } from "../modules/system";
|
|
53
|
-
export type { TranscriptionConfig } from "../modules/transcription";
|
|
55
|
+
export type { ShareOptions, ShareResult, DownloadOptions, DownloadResult, ScanQrOptions, ScanQrResult, } from "../modules/system";
|
|
56
|
+
export type { TranscriptionConfig, TranscriptionOptions } from "../modules/transcription";
|
|
54
57
|
export type { PermissionErrorEvent } from "../modules/permissions";
|
|
55
58
|
export type { AuthUpdatePayload, MiniappVisibility, PermissionType, PermissionRecord, GlassesCapabilities, ConnectAckPayload, MiniappAuthState, MiniappRequestError, } from "../session";
|
|
56
59
|
export type { AuthFetchOptions, AuthModule } from "../modules/auth";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/background/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAC,cAAc,EAAE,KAAK,qBAAqB,EAAC,MAAM,YAAY,CAAA;AACrE,OAAO,EAAC,eAAe,EAAE,KAAK,kBAAkB,EAAC,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/background/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAC,cAAc,EAAE,KAAK,qBAAqB,EAAC,MAAM,YAAY,CAAA;AACrE,OAAO,EAAC,eAAe,EAAE,KAAK,kBAAkB,EAAE,KAAK,mBAAmB,EAAC,MAAM,YAAY,CAAA;AAI7F,YAAY,EACV,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,cAAc,EACd,OAAO,EACP,WAAW,EACX,cAAc,EACd,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,qBAAqB,EACrB,yB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M,oBAAoB,CAAA;AACpH,YAAY,EACV,YAAY,EACZ,WAAW,EACX,eAAe,EACf,cAAc,EACd,aAAa,EACb,YAAY,GACb,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EAAC,mBAAmB,EAAE,oBAAoB,EAAC,MAAM,0BAA0B,CAAA;AACvF,YAAY,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAA;AAChE,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,YAAY,CAAA;AACnB,YAAY,EAAC,gBAAgB,EAAE,UAAU,EAAC,MAAM,iBAAiB,CAAA;AACjE,YAAY,EAAC,kBAAkB,EAAC,MAAM,YAAY,CAAA;AAElD,YAAY,EACV,MAAM,EACN,UAAU,EACV,YAAY,EACZ,eAAe,EACf,WAAW,EACX,WAAW,EACX,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,UAAU,EACV,OAAO,EACP,aAAa,EACb,sBAAsB,EACtB,QAAQ,EACR,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,kBAAkB,GACnB,MAAM,uBAAuB,CAAA"}
|
package/dist/background/index.js
CHANGED
|
@@ -19,6 +19,7 @@ export { registerMiniapp } from "./register";
|
|
|
19
19
|
// Public envelope + protocol types so authors can write strongly-typed
|
|
20
20
|
// glue when they need to fall back to session.sendOneShot / sendRequest.
|
|
21
21
|
export { MiniappRequestType, MiniappResponseType, MiniappStreamType, MiniappErrorCode } from "../protocol";
|
|
22
|
+
export { MiniappValidationError, SUPPORTED_LANGUAGE_HINTS, SUPPORTED_TRANSCRIPTION_LANGUAGES, isTranscriptionLanguage, } from "../modules/languages";
|
|
22
23
|
export { BlobModule, BlobWriter, BlobReader, BLOB_WRITE_CHUNK_BYTES, BLOB_READ_ALL_MAX_BYTES } from "../modules/blob";
|
|
23
24
|
export { bytesToBase64, base64ToBytes } from "../modules/base64";
|
|
24
25
|
export { MentraRpcError, MentraRpcTimeoutError } from "../modules/ui";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/background/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAC,cAAc,EAA6B,MAAM,YAAY,CAAA;AACrE,OAAO,EAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/background/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAC,cAAc,EAA6B,MAAM,YAAY,CAAA;AACrE,OAAO,EAAC,eAAe,EAAoD,MAAM,YAAY,CAAA;AAwB7F,uEAAuE;AACvE,yEAAyE;AACzE,OAAO,EAAC,kBAAkB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,gBAAgB,EAAC,MAAM,aAAa,CAAA;AACxG,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,iCAAiC,EACjC,uBAAuB,GACxB,MAAM,sBAAsB,CAAA;AAqC7B,OAAO,EAAC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,sBAAsB,EAAE,uBAAuB,EAAC,MAAM,iBAAiB,CAAA;AAEnH,OAAO,EAAC,aAAa,EAAE,aAAa,EAAC,MAAM,mBAAmB,CAAA;AAQ9D,OAAO,EAAC,cAAc,EAAE,qBAAqB,EAAC,MAAM,eAAe,CAAA"}
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
* re-evaluated and the handler fires again with a fresh session.
|
|
21
21
|
*/
|
|
22
22
|
import { MiniappSession, type MiniappSessionOptions } from "../session";
|
|
23
|
-
export type
|
|
23
|
+
export type TypedMiniappSession<TChannels extends object> = MiniappSession<TChannels>;
|
|
24
|
+
export type MiniappInitHandler<TChannels extends object = Record<string, unknown>> = (session: TypedMiniappSession<TChannels>) => void | Promise<void>;
|
|
24
25
|
/**
|
|
25
26
|
* Register the miniapp's startup handler. Call once at the top level of
|
|
26
27
|
* `src/background/index.ts`. Top-level side effects are fine, but the
|
|
@@ -34,5 +35,5 @@ export type MiniappInitHandler = (session: MiniappSession) => void | Promise<voi
|
|
|
34
35
|
* })
|
|
35
36
|
* })
|
|
36
37
|
*/
|
|
37
|
-
export declare function registerMiniapp(handler: MiniappInitHandler
|
|
38
|
+
export declare function registerMiniapp<TChannels extends object = Record<string, unknown>>(handler: MiniappInitHandler<TChannels>, options?: MiniappSessionOptions): void;
|
|
38
39
|
//# sourceMappingURL=register.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/background/register.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAC,cAAc,EAAE,KAAK,qBAAqB,EAAC,MAAM,YAAY,CAAA;AAErE,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/background/register.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAC,cAAc,EAAE,KAAK,qBAAqB,EAAC,MAAM,YAAY,CAAA;AAErE,MAAM,MAAM,mBAAmB,CAAC,SAAS,SAAS,MAAM,IAAI,cAAc,CAAC,SAAS,CAAC,CAAA;AAErF,MAAM,MAAM,kBAAkB,CAAC,SAAS,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CACnF,OAAO,EAAE,mBAAmB,CAAC,SAAS,CAAC,KACpC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AAYzB;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,SAAS,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChF,OAAO,EAAE,kBAAkB,CAAC,SAAS,CAAC,EACtC,OAAO,GAAE,qBAA0B,GAClC,IAAI,CAmCN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../src/background/register.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAC,cAAc,EAA6B,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../src/background/register.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAC,cAAc,EAA6B,MAAM,YAAY,CAAA;AAkBrE;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,eAAe,CAC7B,OAAsC,EACtC,UAAiC,EAAE;IAEnC,MAAM,CAAC,GAAG,UAAoC,CAAA;IAC9C,CAAC,CAAC,oBAAoB,GAAG,CAAC,UAAkB,EAAE,EAAE;QAC9C,MAAM,OAAO,GAAG,IAAI,cAAc,CAAY,OAAO,CAAC,CAAA;QACtD,iEAAiE;QACjE,mDAAmD;QACnD,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;YAC/B,IAAI,MAAM,IAAI,OAAQ,MAAwB,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;gBACnE,CAAC;gBAAC,MAAwB,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;oBAChD,sCAAsC;oBACtC,OAAO,CAAC,KAAK,CAAC,oDAAoD,EAAE,GAAG,CAAC,CAAA;gBAC1E,CAAC,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,sCAAsC;YACtC,OAAO,CAAC,KAAK,CAAC,iDAAiD,EAAE,GAAG,CAAC,CAAA;QACvE,CAAC;QACD,OAAO,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;YACvC,sCAAsC;YACtC,OAAO,CAAC,KAAK,CAAC,8CAA8C,EAAE,GAAG,CAAC,CAAA;YAClE,kEAAkE;YAClE,kEAAkE;YAClE,2DAA2D;YAC3D,8DAA8D;YAC9D,qCAAqC;YACrC,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;gBAChE,MAAM,KAAK,GAAG,GAAG,YAAY,KAAK,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;gBAChE,CAAC,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,6BAA6B,OAAO,EAAE,EAAE,KAAK,EAAC,CAAC,CAAC,CAAA;YAC3F,CAAC;YAAC,MAAM,CAAC;gBACP,2CAA2C;YAC7C,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Hardware components that a miniapp can declare in its manifest. */
|
|
2
|
+
export declare enum HardwareType {
|
|
3
|
+
CAMERA = "CAMERA",
|
|
4
|
+
DISPLAY = "DISPLAY",
|
|
5
|
+
MICROPHONE = "MICROPHONE",
|
|
6
|
+
SPEAKER = "SPEAKER",
|
|
7
|
+
IMU = "IMU",
|
|
8
|
+
BUTTON = "BUTTON",
|
|
9
|
+
LIGHT = "LIGHT",
|
|
10
|
+
WIFI = "WIFI",
|
|
11
|
+
EXIST = "EXIST"
|
|
12
|
+
}
|
|
13
|
+
/** Whether a missing component prevents the miniapp from running. */
|
|
14
|
+
export declare enum HardwareRequirementLevel {
|
|
15
|
+
REQUIRED = "REQUIRED",
|
|
16
|
+
OPTIONAL = "OPTIONAL"
|
|
17
|
+
}
|
|
18
|
+
/** One hardware requirement from a miniapp manifest. */
|
|
19
|
+
export interface HardwareRequirement {
|
|
20
|
+
type: HardwareType;
|
|
21
|
+
level: HardwareRequirementLevel;
|
|
22
|
+
description?: string;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=hardware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hardware.d.ts","sourceRoot":"","sources":["../src/hardware.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,oBAAY,YAAY;IACtB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,OAAO,YAAY;IACnB,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAED,qEAAqE;AACrE,oBAAY,wBAAwB;IAClC,QAAQ,aAAa;IACrB,QAAQ,aAAa;CACtB;AAED,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,YAAY,CAAA;IAClB,KAAK,EAAE,wBAAwB,CAAA;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB"}
|
package/dist/hardware.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Hardware components that a miniapp can declare in its manifest. */
|
|
2
|
+
export var HardwareType;
|
|
3
|
+
(function (HardwareType) {
|
|
4
|
+
HardwareType["CAMERA"] = "CAMERA";
|
|
5
|
+
HardwareType["DISPLAY"] = "DISPLAY";
|
|
6
|
+
HardwareType["MICROPHONE"] = "MICROPHONE";
|
|
7
|
+
HardwareType["SPEAKER"] = "SPEAKER";
|
|
8
|
+
HardwareType["IMU"] = "IMU";
|
|
9
|
+
HardwareType["BUTTON"] = "BUTTON";
|
|
10
|
+
HardwareType["LIGHT"] = "LIGHT";
|
|
11
|
+
HardwareType["WIFI"] = "WIFI";
|
|
12
|
+
HardwareType["EXIST"] = "EXIST";
|
|
13
|
+
})(HardwareType || (HardwareType = {}));
|
|
14
|
+
/** Whether a missing component prevents the miniapp from running. */
|
|
15
|
+
export var HardwareRequirementLevel;
|
|
16
|
+
(function (HardwareRequirementLevel) {
|
|
17
|
+
HardwareRequirementLevel["REQUIRED"] = "REQUIRED";
|
|
18
|
+
HardwareRequirementLevel["OPTIONAL"] = "OPTIONAL";
|
|
19
|
+
})(HardwareRequirementLevel || (HardwareRequirementLevel = {}));
|
|
20
|
+
//# sourceMappingURL=hardware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hardware.js","sourceRoot":"","sources":["../src/hardware.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,MAAM,CAAN,IAAY,YAUX;AAVD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,mCAAmB,CAAA;IACnB,yCAAyB,CAAA;IACzB,mCAAmB,CAAA;IACnB,2BAAW,CAAA;IACX,iCAAiB,CAAA;IACjB,+BAAe,CAAA;IACf,6BAAa,CAAA;IACb,+BAAe,CAAA;AACjB,CAAC,EAVW,YAAY,KAAZ,YAAY,QAUvB;AAED,qEAAqE;AACrE,MAAM,CAAN,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAClC,iDAAqB,CAAA;IACrB,iDAAqB,CAAA;AACvB,CAAC,EAHW,wBAAwB,KAAxB,wBAAwB,QAGnC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -16,9 +16,11 @@ export { getMentraOSGlobals } from "./globals";
|
|
|
16
16
|
export type { MentraOSGlobals, MiniappCapsuleMenuRect, MiniappColorScheme, MiniappSafeAreaInsets } from "./globals";
|
|
17
17
|
export { MiniappErrorCode, MiniappRequestType, MiniappResponseType, MiniappStreamType } from "./protocol";
|
|
18
18
|
export { CLOUD_STATUS_STREAM } from "./modules/cloud";
|
|
19
|
+
export { MiniappValidationError, SUPPORTED_LANGUAGE_HINTS, SUPPORTED_TRANSCRIPTION_LANGUAGES, isTranscriptionLanguage, } from "./modules/languages";
|
|
20
|
+
export type { LanguageHint, TranscriptionLanguage } from "./modules/languages";
|
|
19
21
|
export type { CloudClientAudioTransport, CloudClientConnectionStatus, CloudClientStatus } from "./modules/cloud";
|
|
20
|
-
export { HardwareType, HardwareRequirementLevel } from "
|
|
21
|
-
export type { HardwareRequirement } from "
|
|
22
|
+
export { HardwareType, HardwareRequirementLevel } from "./hardware";
|
|
23
|
+
export type { HardwareRequirement } from "./hardware";
|
|
22
24
|
export { createTransport } from "./transport/auto";
|
|
23
25
|
export type { CreateTransportOptions } from "./transport/auto";
|
|
24
26
|
export { PostMessageTransport } from "./transport/postmessage";
|
|
@@ -28,7 +30,8 @@ export { MockTransport, isMockExplicitlyRequested } from "./transport/mock";
|
|
|
28
30
|
export type { MockTransportOptions } from "./transport/mock";
|
|
29
31
|
export type { Transport, TransportDisconnectHandler, TransportMessageHandler } from "./transport/types";
|
|
30
32
|
export type { DisplayBreakMode, RenderBox, RenderElement, RenderOptions, RenderRectStyle, RenderResult, RenderTextStyle, ViewType, } from "./modules/display";
|
|
31
|
-
export type { AccelData, AudioChunkData, BatteryData, ButtonPressData,
|
|
33
|
+
export type { AccelData, AudioChunkData, BatteryData, ButtonPressData, ConnectionData, HeadingData, HeadPositionData, LocationData, NotificationDismissedData, PhoneNotificationData, TouchData, TranscriptionData, TranslationData, UnsubscribeFn, VadData, WifiData, } from "./modules/events";
|
|
34
|
+
export type { CalendarEvent, CalendarListOptions, CalendarListResult } from "./modules/phone";
|
|
32
35
|
export type { PlayAudioOptions, SpeakOptions, SpeakResult, SpeakerState, SpeakerStateEvent, SpeakerStreamOptions, SpeakerStreamSampleRate, SpeakerStreamWriteResult, } from "./modules/speaker";
|
|
33
36
|
export { SpeakerStreamWriter, SPEAKER_STREAM_MAX_BUFFERED_MS, SPEAKER_WRITE_CHUNK_BYTES } from "./modules/speaker";
|
|
34
37
|
export type { CameraFovPreset, CameraFovRequest, CameraFovResult, CameraRoiPosition, PhotoTaken, SetCameraFovOptions, StartVideoRecordingOptions, StopVideoRecordingOptions, TakePhotoOptions, VideoRecordingStarted, } from "./modules/camera";
|
|
@@ -36,7 +39,7 @@ export type { DashboardMode } from "./modules/dashboard";
|
|
|
36
39
|
export type { CloudModule } from "./modules/cloud";
|
|
37
40
|
export type { LedColor, LedControlOptions } from "./modules/led";
|
|
38
41
|
export type { RestreamDestination, StartStreamOptions, StreamAudioConfig, StreamResolvedConfig, StreamResult, StreamStatus, StreamVideoConfig, } from "./modules/stream";
|
|
39
|
-
export type { ShareOptions, ShareResult, DownloadOptions, DownloadResult } from "./modules/system";
|
|
42
|
+
export type { ShareOptions, ShareResult, DownloadOptions, DownloadResult, ScanQrOptions, ScanQrResult, } from "./modules/system";
|
|
40
43
|
export type { MiniappInfo, MiniappActionInfo, MiniappCompatibility, ListMiniappsOptions } from "./modules/miniapps";
|
|
41
44
|
export type { ActionContext, ActionHandler, InvokeOptions } from "./modules/actions";
|
|
42
45
|
export type { DisplayManager } from "./modules/display";
|
|
@@ -51,7 +54,7 @@ export type { MicModule } from "./modules/mic";
|
|
|
51
54
|
export type { ComputedRoute, ComputedRouteStep, ComputeRouteOptions, ComputeRouteResult, LatLng, NavArrived, NavError, NavigationModule, NavManeuver, NavOffRoute, NavPermissionResult, NavPlaceDetails, NavPlaceSuggestion, NavRerouting, NavRoute, NavState, NavStep, NavUpdate, Pivot, PivotEvent, PivotOptions, RouteAvoidances, StartNavigationOptions, TravelMode, } from "./modules/navigation";
|
|
52
55
|
export type { PermissionsModule, PermissionErrorEvent } from "./modules/permissions";
|
|
53
56
|
export type { PhoneModule, PhoneNotificationsModule, PhoneCalendarModule } from "./modules/phone";
|
|
54
|
-
export type { TranscriptionModule, TranscriptionConfig } from "./modules/transcription";
|
|
57
|
+
export type { TranscriptionModule, TranscriptionConfig, TranscriptionOptions } from "./modules/transcription";
|
|
55
58
|
export type { TranslationModule } from "./modules/translation";
|
|
56
59
|
export type { SpeakerModule } from "./modules/speaker";
|
|
57
60
|
export type { PermissionType, PermissionRecord } from "./session";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AASH,OAAO,EAAC,cAAc,EAAE,iBAAiB,EAAC,MAAM,WAAW,CAAA;AAC3D,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,WAAW,CAAA;AAClB,YAAY,EAAC,gBAAgB,EAAE,UAAU,EAAC,MAAM,gBAAgB,CAAA;AAEhE,OAAO,EAAC,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAC,MAAM,YAAY,CAAA;AAC1E,YAAY,EAAC,eAAe,EAAC,MAAM,YAAY,CAAA;AAE/C,OAAO,EAAC,kBAAkB,EAAC,MAAM,WAAW,CAAA;AAC5C,YAAY,EAAC,eAAe,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,qBAAqB,EAAC,MAAM,WAAW,CAAA;AAEjH,OAAO,EAAC,gBAAgB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,iBAAiB,EAAC,MAAM,YAAY,CAAA;AACvG,OAAO,EAAC,mBAAmB,EAAC,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AASH,OAAO,EAAC,cAAc,EAAE,iBAAiB,EAAC,MAAM,WAAW,CAAA;AAC3D,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,WAAW,CAAA;AAClB,YAAY,EAAC,gBAAgB,EAAE,UAAU,EAAC,MAAM,gBAAgB,CAAA;AAEhE,OAAO,EAAC,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAC,MAAM,YAAY,CAAA;AAC1E,YA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AY,EAAC,cAAc,EAAE,gBAAgB,EAAC,MAAM,WAAW,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -17,11 +17,11 @@ export { makeRequestId, parseEnvelope, serializeEnvelope } from "./envelope";
|
|
|
17
17
|
export { getMentraOSGlobals } from "./globals";
|
|
18
18
|
export { MiniappErrorCode, MiniappRequestType, MiniappResponseType, MiniappStreamType } from "./protocol";
|
|
19
19
|
export { CLOUD_STATUS_STREAM } from "./modules/cloud";
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
|
|
23
|
-
//
|
|
24
|
-
export { HardwareType, HardwareRequirementLevel } from "
|
|
20
|
+
// Language registry (issue 021): canonical language types + the validation
|
|
21
|
+
// error the typed transcription/translation surfaces throw.
|
|
22
|
+
export { MiniappValidationError, SUPPORTED_LANGUAGE_HINTS, SUPPORTED_TRANSCRIPTION_LANGUAGES, isTranscriptionLanguage, } from "./modules/languages";
|
|
23
|
+
// Canonical miniapp manifest hardware contract.
|
|
24
|
+
export { HardwareType, HardwareRequirementLevel } from "./hardware";
|
|
25
25
|
// Transports — exported for advanced uses (forced transport injection, tests)
|
|
26
26
|
export { createTransport } from "./transport/auto";
|
|
27
27
|
export { PostMessageTransport } from "./transport/postmessage";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,iCAAiC,EAAC,MAAM,cAAc,CAAA;AAE9D,4EAA4E;AAC5E,+DAA+D;AAC/D,yCAAyC;AACzC,iCAAiC,EAAE,CAAA;AAEnC,OAAO,EAAC,cAAc,EAAE,iBAAiB,EAAC,MAAM,WAAW,CAAA;AAa3D,OAAO,EAAC,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAC,MAAM,YAAY,CAAA;AAG1E,OAAO,EAAC,kBAAkB,EAAC,MAAM,WAAW,CAAA;AAG5C,OAAO,EAAC,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d.ts
CHANGED
|
@@ -24,6 +24,11 @@ export interface TakePhotoOptions {
|
|
|
24
24
|
size?: "low" | "medium" | "high" | "max";
|
|
25
25
|
/** Capture at maximum source quality and optimize BLE delivery for readable text. */
|
|
26
26
|
mode?: "photo" | "text";
|
|
27
|
+
/**
|
|
28
|
+
* Image delivery path. `auto` tries direct Wi-Fi upload and falls back to
|
|
29
|
+
* BLE; `direct` disables BLE fallback; `ble` always relays through the phone.
|
|
30
|
+
*/
|
|
31
|
+
transferMethod?: "auto" | "direct" | "ble";
|
|
27
32
|
compress?: "none" | "low" | "medium" | "high";
|
|
28
33
|
sound?: boolean;
|
|
29
34
|
saveToGallery?: boolean;
|
|
@@ -33,6 +38,38 @@ export interface TakePhotoOptions {
|
|
|
33
38
|
* manual exposure; ignored otherwise.
|
|
34
39
|
*/
|
|
35
40
|
exposureTimeNs?: number;
|
|
41
|
+
/** Sensor ISO for this capture only. Only used when `exposureTimeNs` enables manual exposure. */
|
|
42
|
+
iso?: number | null;
|
|
43
|
+
/** After AE convergence, divide the metered exposure by this factor (scan mode). */
|
|
44
|
+
aeExposureDivisor?: number;
|
|
45
|
+
/** Cap ISO after AE metering (scan mode). */
|
|
46
|
+
isoCap?: number;
|
|
47
|
+
/** Request per-capture noise reduction. Sent on the wire; glasses may log `not_implemented`. */
|
|
48
|
+
noiseReduction?: boolean;
|
|
49
|
+
/** Request per-capture edge enhancement. Sent on the wire; glasses may log `not_implemented`. */
|
|
50
|
+
edgeEnhancement?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* ZSL buffering. Manual and scan stills force it off because fixed sensor controls take priority.
|
|
53
|
+
*/
|
|
54
|
+
zsl?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* MFNR still capture. Manual and scan stills force it off because fixed sensor controls take priority.
|
|
57
|
+
*/
|
|
58
|
+
mfnr?: boolean;
|
|
59
|
+
/** ISP digital gain hint. */
|
|
60
|
+
ispDigitalGain?: number;
|
|
61
|
+
/** ISP analog gain hint. */
|
|
62
|
+
ispAnalogGain?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Override the SDK's default 60s request timeout for this capture only.
|
|
65
|
+
* Leave unset for a normal user-triggered capture (the full 60s ceiling is
|
|
66
|
+
* appropriate there). Callers that speculatively fire a capture and may
|
|
67
|
+
* abandon it if the result isn't needed (e.g. a short-lived non-visual
|
|
68
|
+
* assistant turn racing a capture against a ~1s latency cap) should pass a
|
|
69
|
+
* short value here so the abandoned `takePhoto()` promise settles quickly
|
|
70
|
+
* instead of sitting on the default 60s ceiling.
|
|
71
|
+
*/
|
|
72
|
+
timeoutMs?: number;
|
|
36
73
|
}
|
|
37
74
|
export interface PhotoTaken {
|
|
38
75
|
/** Request id that correlates ASG status, upload, and phone/cloud logs. */
|
|
@@ -43,8 +80,15 @@ export interface PhotoTaken {
|
|
|
43
80
|
}
|
|
44
81
|
export interface WarmUpCameraOptions {
|
|
45
82
|
size?: "low" | "medium" | "high" | "max";
|
|
83
|
+
/** Match the upcoming capture mode so warm-up and capture share one ASG camera session. */
|
|
84
|
+
mode?: "photo" | "text";
|
|
46
85
|
exposureTimeNs?: number;
|
|
86
|
+
/** Ready-state hold in milliseconds. Defaults to 15 seconds and is capped at 60 seconds. */
|
|
47
87
|
durationMs?: number;
|
|
88
|
+
/** ZSL preview buffering for the warm-up session. */
|
|
89
|
+
zsl?: boolean;
|
|
90
|
+
/** MFNR still capture for the warm-up session. */
|
|
91
|
+
mfnr?: boolean;
|
|
48
92
|
}
|
|
49
93
|
export interface StartVideoRecordingOptions {
|
|
50
94
|
/** Video width in pixels. Omit to use the device's saved button-video default. */
|
|
@@ -82,10 +126,11 @@ export declare class CameraModule {
|
|
|
82
126
|
/** True iff `CAMERA` is declared in the miniapp's manifest. */
|
|
83
127
|
get hasPermission(): boolean;
|
|
84
128
|
/**
|
|
85
|
-
* Apply camera FOV/ROI
|
|
129
|
+
* Apply a session-owned camera FOV/ROI override on the glasses.
|
|
86
130
|
*
|
|
87
131
|
* Resolves after the ASG client reports that the setting was applied to camera
|
|
88
|
-
* hardware after the restart cooldown.
|
|
132
|
+
* hardware after the restart cooldown. The host restores the prior override or persistent base
|
|
133
|
+
* when this miniapp closes. Requires CAMERA permission declared in miniapp.json.
|
|
89
134
|
*/
|
|
90
135
|
setFov(request: CameraFovRequest): Promise<CameraFovResult>;
|
|
91
136
|
/**
|
|
@@ -100,10 +145,11 @@ export declare class CameraModule {
|
|
|
100
145
|
takePhoto(options?: TakePhotoOptions): Promise<PhotoTaken>;
|
|
101
146
|
/**
|
|
102
147
|
* Pre-warm the glasses camera so the next takePhoto() is near-instant.
|
|
103
|
-
* The camera stays warm for ~durationMs (default 15s); call warmUp() again to
|
|
148
|
+
* The camera stays warm for ~durationMs (default 15s, maximum 60s); call warmUp() again to
|
|
104
149
|
* extend it. Warm with the same `size` you'll capture with — a mismatched size
|
|
105
150
|
* forces the camera to reconfigure and loses the speedup. Requires CAMERA
|
|
106
|
-
* permission in miniapp.json. Resolves once the camera reports ready.
|
|
151
|
+
* permission in miniapp.json. Resolves once the camera reports ready. The host automatically
|
|
152
|
+
* releases this miniapp's request-owned lease when the miniapp closes.
|
|
107
153
|
*
|
|
108
154
|
* Warm-ups are serialized: only one runs at a time and none may start while a
|
|
109
155
|
* photo is being captured. If the camera is busy (a capture is in flight, or
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../../src/modules/camera.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAA;AAEzC,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAA;AAC3D,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAA;AAE5D,MAAM,MAAM,gBAAgB,GACxB;IACE,+BAA+B;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,wEAAwE;IACxE,WAAW,CAAC,EAAE,iBAAiB,CA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;;;;;OASG;IACG,mBAAmB,CAAC,OAAO,GAAE,0BAA+B,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAWnG;;;;;;;;OAQG;IACG,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,GAAE,yBAA8B,GAAG,OAAO,CAAC,IAAI,CAAC;CAQtG"}
|
package/dist/modules/camera.js
CHANGED
|
@@ -11,10 +11,11 @@ export class CameraModule {
|
|
|
11
11
|
return this.session._hasManifestPermission("CAMERA");
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* Apply camera FOV/ROI
|
|
14
|
+
* Apply a session-owned camera FOV/ROI override on the glasses.
|
|
15
15
|
*
|
|
16
16
|
* Resolves after the ASG client reports that the setting was applied to camera
|
|
17
|
-
* hardware after the restart cooldown.
|
|
17
|
+
* hardware after the restart cooldown. The host restores the prior override or persistent base
|
|
18
|
+
* when this miniapp closes. Requires CAMERA permission declared in miniapp.json.
|
|
18
19
|
*/
|
|
19
20
|
async setFov(request) {
|
|
20
21
|
return this.session.sendRequest({
|
|
@@ -36,18 +37,29 @@ export class CameraModule {
|
|
|
36
37
|
type: MiniappRequestType.PHOTO,
|
|
37
38
|
size: options.size ?? "medium",
|
|
38
39
|
mode: options.mode ?? "photo",
|
|
40
|
+
...(options.transferMethod !== undefined ? { transferMethod: options.transferMethod } : {}),
|
|
39
41
|
compress: options.compress ?? "none",
|
|
40
42
|
sound: options.sound ?? true,
|
|
41
43
|
saveToGallery: options.saveToGallery ?? false,
|
|
42
44
|
exposureTimeNs: options.exposureTimeNs,
|
|
43
|
-
|
|
45
|
+
iso: options.iso,
|
|
46
|
+
aeExposureDivisor: options.aeExposureDivisor,
|
|
47
|
+
isoCap: options.isoCap,
|
|
48
|
+
noiseReduction: options.noiseReduction,
|
|
49
|
+
edgeEnhancement: options.edgeEnhancement,
|
|
50
|
+
zsl: options.zsl,
|
|
51
|
+
mfnr: options.mfnr,
|
|
52
|
+
ispDigitalGain: options.ispDigitalGain,
|
|
53
|
+
ispAnalogGain: options.ispAnalogGain,
|
|
54
|
+
}, options.timeoutMs != null ? { timeoutMs: options.timeoutMs } : undefined);
|
|
44
55
|
}
|
|
45
56
|
/**
|
|
46
57
|
* Pre-warm the glasses camera so the next takePhoto() is near-instant.
|
|
47
|
-
* The camera stays warm for ~durationMs (default 15s); call warmUp() again to
|
|
58
|
+
* The camera stays warm for ~durationMs (default 15s, maximum 60s); call warmUp() again to
|
|
48
59
|
* extend it. Warm with the same `size` you'll capture with — a mismatched size
|
|
49
60
|
* forces the camera to reconfigure and loses the speedup. Requires CAMERA
|
|
50
|
-
* permission in miniapp.json. Resolves once the camera reports ready.
|
|
61
|
+
* permission in miniapp.json. Resolves once the camera reports ready. The host automatically
|
|
62
|
+
* releases this miniapp's request-owned lease when the miniapp closes.
|
|
51
63
|
*
|
|
52
64
|
* Warm-ups are serialized: only one runs at a time and none may start while a
|
|
53
65
|
* photo is being captured. If the camera is busy (a capture is in flight, or
|
|
@@ -59,8 +71,11 @@ export class CameraModule {
|
|
|
59
71
|
await this.session.sendRequest({
|
|
60
72
|
type: MiniappRequestType.CAMERA_WARM_UP,
|
|
61
73
|
size: options.size ?? "medium",
|
|
74
|
+
mode: options.mode ?? "photo",
|
|
62
75
|
exposureTimeNs: options.exposureTimeNs,
|
|
63
76
|
durationMs: options.durationMs ?? 15000,
|
|
77
|
+
zsl: options.zsl,
|
|
78
|
+
mfnr: options.mfnr,
|
|
64
79
|
});
|
|
65
80
|
}
|
|
66
81
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"camera.js","sourceRoot":"","sources":["../../src/modules/camera.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAC,kBAAkB,EAAC,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"camera.js","sourceRoot":"","sources":["../../src/modules/camera.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAC,kBAAkB,EAAC,MAAM,aAAa,CAAA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X,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,eAAe,EAAE,OAAO,CAAC,eAAe;SACzC,CAAC,CAAA;IACJ,CAAC;CACF"}
|
package/dist/modules/events.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* - session.imu.onHeadPosition(...)
|
|
10
10
|
* - session.location.onUpdate(...)
|
|
11
11
|
* - session.glasses.onBattery(...) / onConnection(...)
|
|
12
|
-
* - session.phone.
|
|
12
|
+
* - session.phone.notifications.on(...) / session.phone.onBattery(...)
|
|
13
13
|
*
|
|
14
14
|
* This module's only public method is `subscribe(rawStreamType, handler)` —
|
|
15
15
|
* a forward-compat escape hatch for new event types not yet wrapped on a
|
|
@@ -29,6 +29,8 @@
|
|
|
29
29
|
*/
|
|
30
30
|
import { MiniappSession } from "../session";
|
|
31
31
|
export type UnsubscribeFn = () => void;
|
|
32
|
+
/** @internal Host-selected delivery target for a transcription event. */
|
|
33
|
+
export type TranscriptionEventRoute = "default" | "forceLocal" | "all";
|
|
32
34
|
export interface TranscriptionData {
|
|
33
35
|
text: string;
|
|
34
36
|
isFinal: boolean;
|
|
@@ -112,19 +114,6 @@ export interface NotificationDismissedData {
|
|
|
112
114
|
/** Unix ms timestamp of the dismissal. */
|
|
113
115
|
timestamp: number;
|
|
114
116
|
}
|
|
115
|
-
export interface CalendarEventData {
|
|
116
|
-
eventId: string;
|
|
117
|
-
title: string;
|
|
118
|
-
/** ISO 8601 start time. */
|
|
119
|
-
dtStart: string;
|
|
120
|
-
/** ISO 8601 end time. */
|
|
121
|
-
dtEnd: string;
|
|
122
|
-
timezone: string;
|
|
123
|
-
allDay: boolean;
|
|
124
|
-
location: string;
|
|
125
|
-
notes: string;
|
|
126
|
-
calendarId: string;
|
|
127
|
-
}
|
|
128
117
|
export interface VadData {
|
|
129
118
|
/** True while the user is speaking (voice detected), false when silent. */
|
|
130
119
|
status: boolean;
|
|
@@ -142,8 +131,10 @@ export interface AudioChunkData {
|
|
|
142
131
|
export declare class EventManager {
|
|
143
132
|
private readonly session;
|
|
144
133
|
private readonly emitter;
|
|
145
|
-
/** Stream -> ref count. Outbound SUBSCRIBE
|
|
134
|
+
/** Stream -> ref count. Outbound SUBSCRIBE tracks active streams and routing changes. */
|
|
146
135
|
private readonly refCounts;
|
|
136
|
+
/** Transcription stream -> refs that require on-device-only processing. */
|
|
137
|
+
private readonly forceLocalRefCounts;
|
|
147
138
|
constructor(session: MiniappSession);
|
|
148
139
|
/**
|
|
149
140
|
* Generic subscribe. `stream` is the raw wire value, including any language
|
|
@@ -157,11 +148,13 @@ export declare class EventManager {
|
|
|
157
148
|
* via a separate envelope `type`; the EventManager only routes them
|
|
158
149
|
* locally.
|
|
159
150
|
*/
|
|
160
|
-
subscribe(stream: string, handler: (data: unknown) => void
|
|
151
|
+
subscribe(stream: string, handler: (data: unknown) => void, options?: {
|
|
152
|
+
forceLocal?: boolean;
|
|
153
|
+
}): UnsubscribeFn;
|
|
161
154
|
/** Unsubscribe every handler on every stream this EventManager owns. */
|
|
162
155
|
unsubscribeAll(): void;
|
|
163
156
|
/** @internal */
|
|
164
|
-
_forwardEvent(stream: string, data: unknown): void;
|
|
157
|
+
_forwardEvent(stream: string, data: unknown, transcriptionRoute?: TranscriptionEventRoute): void;
|
|
165
158
|
private sendSubscriptionUpdate;
|
|
166
159
|
}
|
|
167
160
|
//# sourceMappingURL=events.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/modules/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAKH,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAA;AAEzC,MAAM,MAAM,aAAa,GAAG,MAAM,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/modules/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAKH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