@glassly/miniapp 0.3.0-dev.2 → 0.3.0-dev.460
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 +219 -74
- package/dist/background/index.d.ts +14 -8
- package/dist/background/index.d.ts.map +1 -1
- package/dist/background/index.js +4 -0
- package/dist/background/index.js.map +1 -1
- package/dist/background/register.d.ts +1 -1
- package/dist/background/register.js +1 -1
- package/dist/display/index.d.ts +23 -0
- package/dist/display/index.d.ts.map +1 -0
- package/dist/display/index.js +17 -0
- package/dist/display/index.js.map +1 -0
- package/dist/display/measurer/TextMeasurer.d.ts +160 -0
- package/dist/display/measurer/TextMeasurer.d.ts.map +1 -0
- package/dist/display/measurer/TextMeasurer.js +272 -0
- package/dist/display/measurer/TextMeasurer.js.map +1 -0
- package/dist/display/measurer/index.d.ts +10 -0
- package/dist/display/measurer/index.d.ts.map +1 -0
- package/dist/display/measurer/index.js +11 -0
- package/dist/display/measurer/index.js.map +1 -0
- package/dist/display/measurer/script-detection.d.ts +53 -0
- package/dist/display/measurer/script-detection.d.ts.map +1 -0
- package/dist/display/measurer/script-detection.js +184 -0
- package/dist/display/measurer/script-detection.js.map +1 -0
- package/dist/display/pixelArt.d.ts +22 -0
- package/dist/display/pixelArt.d.ts.map +1 -0
- package/dist/display/pixelArt.js +126 -0
- package/dist/display/pixelArt.js.map +1 -0
- package/dist/display/profiles/g1.d.ts +33 -0
- package/dist/display/profiles/g1.d.ts.map +1 -0
- package/dist/display/profiles/g1.js +214 -0
- package/dist/display/profiles/g1.js.map +1 -0
- package/dist/display/profiles/g2.d.ts +13 -0
- package/dist/display/profiles/g2.d.ts.map +1 -0
- package/dist/display/profiles/g2.js +34 -0
- package/dist/display/profiles/g2.js.map +1 -0
- package/dist/display/profiles/index.d.ts +12 -0
- package/dist/display/profiles/index.d.ts.map +1 -0
- package/dist/display/profiles/index.js +15 -0
- package/dist/display/profiles/index.js.map +1 -0
- package/dist/display/profiles/nex.d.ts +10 -0
- package/dist/display/profiles/nex.d.ts.map +1 -0
- package/dist/display/profiles/nex.js +150 -0
- package/dist/display/profiles/nex.js.map +1 -0
- package/dist/display/profiles/types.d.ts +103 -0
- package/dist/display/profiles/types.d.ts.map +1 -0
- package/dist/display/profiles/types.js +2 -0
- package/dist/display/profiles/types.js.map +1 -0
- package/dist/display/profiles/z100.d.ts +33 -0
- package/dist/display/profiles/z100.d.ts.map +1 -0
- package/dist/display/profiles/z100.js +182 -0
- package/dist/display/profiles/z100.js.map +1 -0
- package/dist/display/scene/types.d.ts +292 -0
- package/dist/display/scene/types.d.ts.map +1 -0
- package/dist/display/scene/types.js +0 -0
- package/dist/display/scene/types.js.map +1 -0
- package/dist/display/wrapper/TextWrapper.d.ts +102 -0
- package/dist/display/wrapper/TextWrapper.d.ts.map +1 -0
- package/dist/display/wrapper/TextWrapper.js +469 -0
- package/dist/display/wrapper/TextWrapper.js.map +1 -0
- package/dist/display/wrapper/index.d.ts +12 -0
- package/dist/display/wrapper/index.d.ts.map +1 -0
- package/dist/display/wrapper/index.js +12 -0
- package/dist/display/wrapper/index.js.map +1 -0
- package/dist/display/wrapper/types.d.ts +75 -0
- package/dist/display/wrapper/types.d.ts.map +1 -0
- package/dist/display/wrapper/types.js +11 -0
- package/dist/display/wrapper/types.js.map +1 -0
- package/dist/globals.d.ts +5 -5
- package/dist/globals.d.ts.map +1 -1
- package/dist/globals.js +1 -1
- package/dist/globals.js.map +1 -1
- package/dist/hardware.d.ts +4 -18
- package/dist/hardware.d.ts.map +1 -1
- package/dist/hardware.js +2 -13
- package/dist/hardware.js.map +1 -1
- package/dist/index.d.ts +16 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/knownApps.d.ts +26 -0
- package/dist/knownApps.d.ts.map +1 -0
- package/dist/knownApps.js +140 -0
- package/dist/knownApps.js.map +1 -0
- package/dist/mirror/canvas.d.ts +22 -0
- package/dist/mirror/canvas.d.ts.map +1 -0
- package/dist/mirror/canvas.js +311 -0
- package/dist/mirror/canvas.js.map +1 -0
- package/dist/mirror/geometry.d.ts +69 -0
- package/dist/mirror/geometry.d.ts.map +1 -0
- package/dist/mirror/geometry.js +75 -0
- package/dist/mirror/geometry.js.map +1 -0
- package/dist/mirror/index.d.ts +3 -0
- package/dist/mirror/index.d.ts.map +1 -0
- package/dist/mirror/index.js +2 -0
- package/dist/mirror/index.js.map +1 -0
- package/dist/mirror/types.d.ts +40 -0
- package/dist/mirror/types.d.ts.map +1 -0
- package/dist/mirror/types.js +2 -0
- package/dist/mirror/types.js.map +1 -0
- package/dist/modules/auth.d.ts +1 -1
- package/dist/modules/auth.d.ts.map +1 -1
- package/dist/modules/auth.js +2 -2
- package/dist/modules/auth.js.map +1 -1
- package/dist/modules/compass.d.ts +47 -0
- package/dist/modules/compass.d.ts.map +1 -0
- package/dist/modules/compass.js +39 -0
- package/dist/modules/compass.js.map +1 -0
- package/dist/modules/display.d.ts +192 -8
- package/dist/modules/display.d.ts.map +1 -1
- package/dist/modules/display.js +40 -3
- package/dist/modules/display.js.map +1 -1
- package/dist/modules/events.d.ts +30 -2
- package/dist/modules/events.d.ts.map +1 -1
- package/dist/modules/events.js.map +1 -1
- package/dist/modules/input.d.ts +40 -1
- package/dist/modules/input.d.ts.map +1 -1
- package/dist/modules/input.js +45 -1
- package/dist/modules/input.js.map +1 -1
- package/dist/modules/latest-render-scheduler.d.ts +19 -0
- package/dist/modules/latest-render-scheduler.d.ts.map +1 -0
- package/dist/modules/latest-render-scheduler.js +54 -0
- package/dist/modules/latest-render-scheduler.js.map +1 -0
- package/dist/modules/lightSensor.d.ts +44 -0
- package/dist/modules/lightSensor.d.ts.map +1 -0
- package/dist/modules/lightSensor.js +33 -0
- package/dist/modules/lightSensor.js.map +1 -0
- package/dist/modules/mic.d.ts +3 -2
- package/dist/modules/mic.d.ts.map +1 -1
- package/dist/modules/mic.js +3 -2
- 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/mirror.d.ts +16 -0
- package/dist/modules/mirror.d.ts.map +1 -0
- package/dist/modules/mirror.js +40 -0
- package/dist/modules/mirror.js.map +1 -0
- package/dist/modules/mono-text-rows.d.ts +20 -0
- package/dist/modules/mono-text-rows.d.ts.map +1 -0
- package/dist/modules/mono-text-rows.js +26 -0
- package/dist/modules/mono-text-rows.js.map +1 -0
- package/dist/modules/navigation.d.ts.map +1 -1
- package/dist/modules/navigation.js +21 -14
- package/dist/modules/navigation.js.map +1 -1
- package/dist/modules/phone.d.ts +26 -1
- package/dist/modules/phone.d.ts.map +1 -1
- package/dist/modules/phone.js +28 -0
- package/dist/modules/phone.js.map +1 -1
- package/dist/modules/settings.d.ts +45 -0
- package/dist/modules/settings.d.ts.map +1 -0
- package/dist/modules/settings.js +54 -0
- package/dist/modules/settings.js.map +1 -0
- package/dist/modules/system.d.ts +21 -0
- package/dist/modules/system.d.ts.map +1 -1
- package/dist/modules/system.js +12 -0
- package/dist/modules/system.js.map +1 -1
- package/dist/modules/transcription.d.ts +3 -2
- package/dist/modules/transcription.d.ts.map +1 -1
- package/dist/modules/transcription.js +3 -2
- package/dist/modules/transcription.js.map +1 -1
- package/dist/protocol.d.ts +65 -5
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +66 -5
- package/dist/protocol.js.map +1 -1
- package/dist/react/MirrorCanvas.d.ts +10 -0
- package/dist/react/MirrorCanvas.d.ts.map +1 -0
- package/dist/react/MirrorCanvas.js +23 -0
- package/dist/react/MirrorCanvas.js.map +1 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +1 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/useColorScheme.d.ts +2 -3
- package/dist/react/useColorScheme.d.ts.map +1 -1
- package/dist/react/useColorScheme.js +15 -8
- package/dist/react/useColorScheme.js.map +1 -1
- package/dist/react/useRpc.js +2 -2
- package/dist/react/useRpc.js.map +1 -1
- package/dist/react/useSafeArea.d.ts.map +1 -1
- package/dist/react/useSafeArea.js +2 -2
- package/dist/react/useSafeArea.js.map +1 -1
- package/dist/session.d.ts +50 -4
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +35 -6
- package/dist/session.js.map +1 -1
- package/dist/transport/auto.d.ts +2 -2
- package/dist/transport/auto.js +2 -2
- package/dist/transport/dispatch.d.ts +1 -1
- package/dist/transport/dispatch.js +1 -1
- package/dist/transport/mock.d.ts +4 -4
- package/dist/transport/mock.d.ts.map +1 -1
- package/dist/transport/mock.js +31 -7
- package/dist/transport/mock.js.map +1 -1
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +1 -0
- package/dist/ui/index.js.map +1 -1
- package/package.json +19 -3
- package/src/background/index.ts +26 -4
- package/src/background/register.ts +1 -1
- package/src/display/index.ts +83 -0
- package/src/display/measurer/TextMeasurer.ts +346 -0
- package/src/display/measurer/index.ts +21 -0
- package/src/display/measurer/script-detection.ts +218 -0
- package/src/display/pixelArt.ts +141 -0
- package/src/display/profiles/g1.ts +237 -0
- package/src/display/profiles/g2.ts +39 -0
- package/src/display/profiles/index.ts +28 -0
- package/src/display/profiles/nex.ts +166 -0
- package/src/display/profiles/types.ts +132 -0
- package/src/display/profiles/z100.ts +198 -0
- package/src/display/scene/types.ts +335 -0
- package/src/display/wrapper/TextWrapper.ts +546 -0
- package/src/display/wrapper/index.ts +15 -0
- package/src/display/wrapper/types.ts +102 -0
- package/src/globals.ts +5 -5
- package/src/hardware.ts +6 -21
- package/src/index.ts +34 -6
- package/src/knownApps.ts +170 -0
- package/src/mirror/canvas.ts +322 -0
- package/src/mirror/geometry.ts +128 -0
- package/src/mirror/index.ts +2 -0
- package/src/mirror/types.ts +38 -0
- package/src/modules/auth.ts +2 -2
- package/src/modules/compass.ts +69 -0
- package/src/modules/display.ts +222 -12
- package/src/modules/events.ts +27 -1
- package/src/modules/input.ts +55 -2
- package/src/modules/latest-render-scheduler.ts +55 -0
- package/src/modules/lightSensor.ts +61 -0
- package/src/modules/mic.ts +3 -2
- package/src/modules/miniapps.ts +2 -0
- package/src/modules/mirror.ts +42 -0
- package/src/modules/mono-text-rows.ts +30 -0
- package/src/modules/navigation.ts +20 -14
- package/src/modules/phone.ts +40 -1
- package/src/modules/settings.ts +64 -0
- package/src/modules/system.ts +30 -1
- package/src/modules/transcription.ts +3 -2
- package/src/protocol.ts +72 -5
- package/src/react/MirrorCanvas.tsx +35 -0
- package/src/react/index.ts +3 -0
- package/src/react/useColorScheme.ts +17 -8
- package/src/react/useRpc.ts +2 -2
- package/src/react/useSafeArea.ts +2 -2
- package/src/session.ts +78 -8
- package/src/transport/auto.ts +2 -2
- package/src/transport/dispatch.ts +1 -1
- package/src/transport/mock.ts +42 -11
- package/src/ui/index.ts +3 -0
- package/dist/modules/heading.d.ts +0 -16
- package/dist/modules/heading.d.ts.map +0 -1
- package/dist/modules/heading.js +0 -20
- package/dist/modules/heading.js.map +0 -1
- package/src/modules/heading.ts +0 -23
package/dist/modules/phone.d.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* session.phone.notifications.{on, hasPermission, stop}
|
|
7
7
|
* session.phone.calendar.{listEvents, hasPermission}
|
|
8
|
+
* session.phone.heading.{onUpdate, hasPermission}
|
|
8
9
|
* session.phone.onBattery(...) // stays flat
|
|
9
10
|
*
|
|
10
11
|
* Imperative phone-OS calls (share, openUrl, copyToClipboard, download) live
|
|
@@ -16,7 +17,7 @@
|
|
|
16
17
|
* subscribing on iOS is a no-op even though the API is present.
|
|
17
18
|
*/
|
|
18
19
|
import { MiniappSession } from "../session";
|
|
19
|
-
import type { BatteryData, NotificationDismissedData, PhoneNotificationData, UnsubscribeFn } from "./events";
|
|
20
|
+
import type { BatteryData, HeadingData, NotificationDismissedData, PhoneNotificationData, UnsubscribeFn } from "./events";
|
|
20
21
|
declare class TrackedSubs {
|
|
21
22
|
private readonly unsubs;
|
|
22
23
|
protected track(unsub: UnsubscribeFn): UnsubscribeFn;
|
|
@@ -38,6 +39,20 @@ export declare class PhoneNotificationsModule extends TrackedSubs {
|
|
|
38
39
|
onDismissed(handler: (data: NotificationDismissedData) => void): UnsubscribeFn;
|
|
39
40
|
/** True iff `READ_NOTIFICATIONS` is declared in the miniapp's manifest. */
|
|
40
41
|
get hasPermission(): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Apps that post phone notifications, for a per-app filter UI. Android
|
|
44
|
+
* lists installed apps with their icons (base64 PNG); iOS has no cross-app
|
|
45
|
+
* lookup, so it lists a seeded catalog plus the apps the glasses reported
|
|
46
|
+
* posting, without icons. SYSTEM-only.
|
|
47
|
+
*/
|
|
48
|
+
installedApps(): Promise<NotificationAppInfo[]>;
|
|
49
|
+
}
|
|
50
|
+
export interface NotificationAppInfo {
|
|
51
|
+
/** Bundle id (iOS) or package name (Android). */
|
|
52
|
+
packageName: string;
|
|
53
|
+
appName: string;
|
|
54
|
+
/** Base64 PNG, Android only. */
|
|
55
|
+
icon: string | null;
|
|
41
56
|
}
|
|
42
57
|
export interface CalendarListOptions {
|
|
43
58
|
/** Inclusive start of the query window. */
|
|
@@ -80,10 +95,20 @@ export declare class PhoneCalendarModule {
|
|
|
80
95
|
/** True iff `CALENDAR` is declared in the miniapp's manifest. */
|
|
81
96
|
get hasPermission(): boolean;
|
|
82
97
|
}
|
|
98
|
+
/** Phone compass (magnetometer / sensor fusion). For the glasses' own heading use `session.compass`. */
|
|
99
|
+
export declare class PhoneHeadingModule {
|
|
100
|
+
private readonly session;
|
|
101
|
+
constructor(session: MiniappSession);
|
|
102
|
+
/** True iff `LOCATION` is declared in the miniapp's manifest. */
|
|
103
|
+
get hasPermission(): boolean;
|
|
104
|
+
/** Continuous phone heading updates; the phone compass starts on the first subscriber. */
|
|
105
|
+
onUpdate(handler: (data: HeadingData) => void): UnsubscribeFn;
|
|
106
|
+
}
|
|
83
107
|
export declare class PhoneModule {
|
|
84
108
|
private readonly session;
|
|
85
109
|
readonly notifications: PhoneNotificationsModule;
|
|
86
110
|
readonly calendar: PhoneCalendarModule;
|
|
111
|
+
readonly heading: PhoneHeadingModule;
|
|
87
112
|
constructor(session: MiniappSession);
|
|
88
113
|
/**
|
|
89
114
|
* Phone battery events. Stays flat (not sub-namespaced) — single event,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone.d.ts","sourceRoot":"","sources":["../../src/modules/phone.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"phone.d.ts","sourceRoot":"","sources":["../../src/modules/phone.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAA;AACzC,OAAO,KAAK,EAAC,WAAW,EAAE,WAAW,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,aAAa,EAAC,MAAM,UAAU,CAAA;AAEvH,cAAM,WAAW;IACf,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2B;IAElD,SAAS,CAAC,KAAK,CAAC,KAAK,EAAE,aAAa,GAAG,aAAa;IAQpD,IAAI,IAAI,IAAI;CAUb;AAED,qBAAa,wBAAyB,SAAQ,WAAW;IAC3C,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,cAAc;IAIpD,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,GAAG,aAAa;IAIjE;;;;;;;;OAQG;IACH,WAAW,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,yBAAyB,KAAK,IAAI,GAAG,aAAa;IAM9E,2EAA2E;IAC3E,IAAI,aAAa,IAAI,OAAO,CAE3B;IAED;;;;;OAKG;IACG,aAAa,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;CAMtD;AAED,MAAM,WAAW,mBAAmB;IAClC,iDAA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I,aAAa,IAAI,OAAO,CAE3B;IAED,0FAA0F;IAC1F,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,GAAG,aAAa;CAG9D;AAED,qBAAa,WAAW;IAKV,OAAO,CAAC,QAAQ,CAAC,OAAO;IAJpC,SAAgB,aAAa,EAAE,wBAAwB,CAAA;IACvD,SAAgB,QAAQ,EAAE,mBAAmB,CAAA;IAC7C,SAAgB,OAAO,EAAE,kBAAkB,CAAA;gBAEd,OAAO,EAAE,cAAc;IAMpD;;;OAGG;IACH,SAAS,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,GAAG,aAAa;CAG/D"}
|
package/dist/modules/phone.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* session.phone.notifications.{on, hasPermission, stop}
|
|
7
7
|
* session.phone.calendar.{listEvents, hasPermission}
|
|
8
|
+
* session.phone.heading.{onUpdate, hasPermission}
|
|
8
9
|
* session.phone.onBattery(...) // stays flat
|
|
9
10
|
*
|
|
10
11
|
* Imperative phone-OS calls (share, openUrl, copyToClipboard, download) live
|
|
@@ -63,6 +64,18 @@ export class PhoneNotificationsModule extends TrackedSubs {
|
|
|
63
64
|
get hasPermission() {
|
|
64
65
|
return this.session._hasManifestPermission("READ_NOTIFICATIONS");
|
|
65
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Apps that post phone notifications, for a per-app filter UI. Android
|
|
69
|
+
* lists installed apps with their icons (base64 PNG); iOS has no cross-app
|
|
70
|
+
* lookup, so it lists a seeded catalog plus the apps the glasses reported
|
|
71
|
+
* posting, without icons. SYSTEM-only.
|
|
72
|
+
*/
|
|
73
|
+
async installedApps() {
|
|
74
|
+
const result = await this.session.sendRequest({
|
|
75
|
+
type: MiniappRequestType.NOTIFICATION_APPS_LIST,
|
|
76
|
+
});
|
|
77
|
+
return result ?? [];
|
|
78
|
+
}
|
|
66
79
|
}
|
|
67
80
|
export class PhoneCalendarModule {
|
|
68
81
|
constructor(session) {
|
|
@@ -93,11 +106,26 @@ function normalizeCalendarDate(value, field) {
|
|
|
93
106
|
throw new TypeError(`${field} must be a valid Date or ISO 8601 string`);
|
|
94
107
|
return date.toISOString();
|
|
95
108
|
}
|
|
109
|
+
/** Phone compass (magnetometer / sensor fusion). For the glasses' own heading use `session.compass`. */
|
|
110
|
+
export class PhoneHeadingModule {
|
|
111
|
+
constructor(session) {
|
|
112
|
+
this.session = session;
|
|
113
|
+
}
|
|
114
|
+
/** True iff `LOCATION` is declared in the miniapp's manifest. */
|
|
115
|
+
get hasPermission() {
|
|
116
|
+
return this.session._hasManifestPermission("LOCATION");
|
|
117
|
+
}
|
|
118
|
+
/** Continuous phone heading updates; the phone compass starts on the first subscriber. */
|
|
119
|
+
onUpdate(handler) {
|
|
120
|
+
return this.session._subscribe(MiniappStreamType.HEADING_UPDATE, handler);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
96
123
|
export class PhoneModule {
|
|
97
124
|
constructor(session) {
|
|
98
125
|
this.session = session;
|
|
99
126
|
this.notifications = new PhoneNotificationsModule(session);
|
|
100
127
|
this.calendar = new PhoneCalendarModule(session);
|
|
128
|
+
this.heading = new PhoneHeadingModule(session);
|
|
101
129
|
}
|
|
102
130
|
/**
|
|
103
131
|
* Phone battery events. Stays flat (not sub-namespaced) — single event,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone.js","sourceRoot":"","sources":["../../src/modules/phone.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"phone.js","sourceRoot":"","sources":["../../src/modules/phone.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAC,kBAAkB,EAAE,iBAAiB,EAAC,MAAM,aAAa,CAAA;AAIjE,MAAM,WAAW;IAAjB;QACmB,WAAM,GAAG,IAAI,GAAG,EAAiB,CAAA;IAoBpD,CAAC;IAlBW,KAAK,CAAC,KAA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AAO,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAA;IACxD,CAAC;IAED,0FAA0F;IAC1F,QAAQ,CAAC,OAAoC;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,cAAc,EAAE,OAAkC,CAAC,CAAA;IACtG,CAAC;CACF;AAED,MAAM,OAAO,WAAW;IAKtB,YAA6B,OAAuB;QAAvB,YAAO,GAAP,OAAO,CAAgB;QAClD,IAAI,CAAC,aAAa,GAAG,IAAI,wBAAwB,CAAC,OAAO,CAAC,CAAA;QAC1D,IAAI,CAAC,QAAQ,GAAG,IAAI,mBAAmB,CAAC,OAAO,CAAC,CAAA;QAChD,IAAI,CAAC,OAAO,GAAG,IAAI,kBAAkB,CAAC,OAAO,CAAC,CAAA;IAChD,CAAC;IAED;;;OAGG;IACH,SAAS,CAAC,OAAoC;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,aAAa,EAAE,OAAkC,CAAC,CAAA;IACrG,CAAC;CACF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview SettingsModule — `session.settings`, the engine's settings
|
|
3
|
+
* store behind an allowlist. SYSTEM-only: every call rejects with
|
|
4
|
+
* NOT_PERMITTED unless the caller is a system app. The dashboard miniapp is
|
|
5
|
+
* the first consumer: it reads and edits the same dashboard, notification
|
|
6
|
+
* and glasses-menu keys the phone's settings screens used to, so firmware
|
|
7
|
+
* sync and the host's notification policy keep one source of truth.
|
|
8
|
+
*
|
|
9
|
+
* Keys are the engine's setting keys (e.g. `custom_dashboard_layout`,
|
|
10
|
+
* `notifications_popups`, `menu_apps`); values are their JSON values. The
|
|
11
|
+
* host also serves a few derived read-only keys (`phone_active`,
|
|
12
|
+
* `foreground_app_on_screen`, `ring_battery`) that the engine computes
|
|
13
|
+
* rather than stores. `set` on a read-only or unknown key rejects.
|
|
14
|
+
*/
|
|
15
|
+
import { MiniappSession } from "../session";
|
|
16
|
+
import type { UnsubscribeFn } from "./events";
|
|
17
|
+
export interface SettingsChange {
|
|
18
|
+
key: string;
|
|
19
|
+
value: unknown;
|
|
20
|
+
}
|
|
21
|
+
export declare class SettingsModule {
|
|
22
|
+
private readonly session;
|
|
23
|
+
constructor(session: MiniappSession);
|
|
24
|
+
/** One allowlisted key's value; undefined when the key is unknown. SYSTEM-only. */
|
|
25
|
+
get<T = unknown>(key: string): Promise<T | undefined>;
|
|
26
|
+
/**
|
|
27
|
+
* Every allowlisted key's value, or just `keys`. Unknown keys are left out
|
|
28
|
+
* rather than rejected, so a newer miniapp on an older host still reads
|
|
29
|
+
* the keys the host knows. SYSTEM-only.
|
|
30
|
+
*/
|
|
31
|
+
getAll(keys?: string[]): Promise<Record<string, unknown>>;
|
|
32
|
+
/**
|
|
33
|
+
* Write a writable key through the engine's settings store: persistence,
|
|
34
|
+
* server sync and the Bluetooth sync of glasses settings behave as if a
|
|
35
|
+
* phone screen wrote it. SYSTEM-only.
|
|
36
|
+
*/
|
|
37
|
+
set(key: string, value: unknown): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* An allowlisted key changed (including the derived read-only keys). On
|
|
40
|
+
* subscribe the host replays every key's current value, so a mirror can
|
|
41
|
+
* be built from this stream alone. SYSTEM-only; other apps never hear it.
|
|
42
|
+
*/
|
|
43
|
+
onChange(handler: (change: SettingsChange) => void): UnsubscribeFn;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/modules/settings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAA;AACzC,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,UAAU,CAAA;AAE3C,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,OAAO,CAAA;CACf;AAED,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,cAAc;IAEpD,mFAAmF;IAC7E,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAK3D;;;;OAIG;IACG,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAQ/D;;;;OAIG;IACG,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrD;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,GAAG,aAAa;CAGnE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview SettingsModule — `session.settings`, the engine's settings
|
|
3
|
+
* store behind an allowlist. SYSTEM-only: every call rejects with
|
|
4
|
+
* NOT_PERMITTED unless the caller is a system app. The dashboard miniapp is
|
|
5
|
+
* the first consumer: it reads and edits the same dashboard, notification
|
|
6
|
+
* and glasses-menu keys the phone's settings screens used to, so firmware
|
|
7
|
+
* sync and the host's notification policy keep one source of truth.
|
|
8
|
+
*
|
|
9
|
+
* Keys are the engine's setting keys (e.g. `custom_dashboard_layout`,
|
|
10
|
+
* `notifications_popups`, `menu_apps`); values are their JSON values. The
|
|
11
|
+
* host also serves a few derived read-only keys (`phone_active`,
|
|
12
|
+
* `foreground_app_on_screen`, `ring_battery`) that the engine computes
|
|
13
|
+
* rather than stores. `set` on a read-only or unknown key rejects.
|
|
14
|
+
*/
|
|
15
|
+
import { MiniappRequestType, MiniappStreamType } from "../protocol";
|
|
16
|
+
export class SettingsModule {
|
|
17
|
+
constructor(session) {
|
|
18
|
+
this.session = session;
|
|
19
|
+
}
|
|
20
|
+
/** One allowlisted key's value; undefined when the key is unknown. SYSTEM-only. */
|
|
21
|
+
async get(key) {
|
|
22
|
+
const values = await this.getAll([key]);
|
|
23
|
+
return values[key];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Every allowlisted key's value, or just `keys`. Unknown keys are left out
|
|
27
|
+
* rather than rejected, so a newer miniapp on an older host still reads
|
|
28
|
+
* the keys the host knows. SYSTEM-only.
|
|
29
|
+
*/
|
|
30
|
+
async getAll(keys) {
|
|
31
|
+
const result = await this.session.sendRequest({
|
|
32
|
+
type: MiniappRequestType.SETTINGS_GET,
|
|
33
|
+
...(keys ? { keys } : {}),
|
|
34
|
+
});
|
|
35
|
+
return result?.values ?? {};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Write a writable key through the engine's settings store: persistence,
|
|
39
|
+
* server sync and the Bluetooth sync of glasses settings behave as if a
|
|
40
|
+
* phone screen wrote it. SYSTEM-only.
|
|
41
|
+
*/
|
|
42
|
+
async set(key, value) {
|
|
43
|
+
await this.session.sendRequest({ type: MiniappRequestType.SETTINGS_SET, key, value });
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* An allowlisted key changed (including the derived read-only keys). On
|
|
47
|
+
* subscribe the host replays every key's current value, so a mirror can
|
|
48
|
+
* be built from this stream alone. SYSTEM-only; other apps never hear it.
|
|
49
|
+
*/
|
|
50
|
+
onChange(handler) {
|
|
51
|
+
return this.session._subscribe(MiniappStreamType.SETTINGS_CHANGED, handler);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/modules/settings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAC,kBAAkB,EAAE,iBAAiB,EAAC,MAAM,aAAa,CAAA;AASjE,MAAM,OAAO,cAAc;IACzB,YAA6B,OAAuB;QAAvB,YAAO,GAAP,OAAO,CAAgB;IAAG,CAAC;IAExD,mFAAmF;IACnF,KAAK,CAAC,GAAG,CAAc,GAAW;QAChC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;QACvC,OAAO,MAAM,CAAC,GAAG,CAAkB,CAAA;IACrC,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,CAAC,IAAe;QAC1B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAqC;YAChF,IAAI,EAAE,kBAAkB,CAAC,YAAY;YACrC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAC,IAAI,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SACxB,CAAC,CAAA;QACF,OAAO,MAAM,EAAE,MAAM,IAAI,EAAE,CAAA;IAC7B,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,GAAG,CAAC,GAAW,EAAE,KAAc;QACnC,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAO,EAAC,IAAI,EAAE,kBAAkB,CAAC,YAAY,EAAE,GAAG,EAAE,KAAK,EAAC,CAAC,CAAA;IAC3F,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,OAAyC;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,OAAkC,CAAC,CAAA;IACxG,CAAC;CACF"}
|
package/dist/modules/system.d.ts
CHANGED
|
@@ -43,6 +43,20 @@ export type ScanQrResult = {
|
|
|
43
43
|
cancelled: true;
|
|
44
44
|
data?: undefined;
|
|
45
45
|
};
|
|
46
|
+
/** Native G2 performance counters only; never display text or packet contents. */
|
|
47
|
+
export interface DisplayDiagnostic {
|
|
48
|
+
v: 1;
|
|
49
|
+
run: string;
|
|
50
|
+
id: number;
|
|
51
|
+
t: number;
|
|
52
|
+
type: "sample" | "stall" | "session";
|
|
53
|
+
[key: string]: string | number | boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface DisplayDiagnosticsResult {
|
|
56
|
+
enabled: boolean;
|
|
57
|
+
generatedAt: number;
|
|
58
|
+
records: DisplayDiagnostic[];
|
|
59
|
+
}
|
|
46
60
|
export declare class SystemModule {
|
|
47
61
|
private readonly session;
|
|
48
62
|
constructor(session: MiniappSession);
|
|
@@ -50,6 +64,13 @@ export declare class SystemModule {
|
|
|
50
64
|
share(options: ShareOptions): Promise<ShareResult>;
|
|
51
65
|
/** Open a URL in the system browser. Blocks dangerous schemes (javascript:, file:). */
|
|
52
66
|
openUrl(url: string): void;
|
|
67
|
+
/**
|
|
68
|
+
* Read recent native G2 diagnostics (bounded to 180 records / 3 minutes).
|
|
69
|
+
* Requires the phone's Debug Console setting. Empty on unsupported devices;
|
|
70
|
+
* submitted bytes are not over-the-air throughput or measured display FPS.
|
|
71
|
+
* Poll no faster than once per second. Older hosts reject this request.
|
|
72
|
+
*/
|
|
73
|
+
getDisplayDiagnostics(): Promise<DisplayDiagnosticsResult>;
|
|
53
74
|
/** Copy text to the system clipboard. */
|
|
54
75
|
copyToClipboard(text: string): Promise<void>;
|
|
55
76
|
/** Download a file. Opens the OS share sheet so user can choose save location. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../src/modules/system.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAA;AAEzC,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAA;C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ACX,EAAE,EAAE,MAAM,CAAA;IACV,CAAC,EAAE,MAAM,CAAA;IACT,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAA;IACpC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;CACzC;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,OAAO,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,iBAAiB,EAAE,CAAA;CAC7B;AAED,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,cAAc;IAEpD,sDAAsD;IAChD,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;IAQxD,uFAAuF;IACvF,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAO1B;;;;;OAKG;IACG,qBAAqB,IAAI,OAAO,CAAC,wBAAwB,CAAC;IAOhE,yCAAyC;IACnC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOlD,kFAAkF;IAC5E,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC;IAQjE;;;;;OAKG;IACH,IAAI,IAAI,IAAI;IAMZ;;;;OAIG;IACG,MAAM,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;CAUjE"}
|
package/dist/modules/system.js
CHANGED
|
@@ -23,6 +23,18 @@ export class SystemModule {
|
|
|
23
23
|
url,
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Read recent native G2 diagnostics (bounded to 180 records / 3 minutes).
|
|
28
|
+
* Requires the phone's Debug Console setting. Empty on unsupported devices;
|
|
29
|
+
* submitted bytes are not over-the-air throughput or measured display FPS.
|
|
30
|
+
* Poll no faster than once per second. Older hosts reject this request.
|
|
31
|
+
*/
|
|
32
|
+
async getDisplayDiagnostics() {
|
|
33
|
+
const result = await this.session.sendRequest({
|
|
34
|
+
type: MiniappRequestType.DISPLAY_DIAGNOSTICS,
|
|
35
|
+
});
|
|
36
|
+
return result ?? { enabled: false, generatedAt: Date.now(), records: [] };
|
|
37
|
+
}
|
|
26
38
|
/** Copy text to the system clipboard. */
|
|
27
39
|
async copyToClipboard(text) {
|
|
28
40
|
await this.session.sendRequest({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.js","sourceRoot":"","sources":["../../src/modules/system.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,kBAAkB,EAAC,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"system.js","sourceRoot":"","sources":["../../src/modules/system.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,kBAAkB,EAAC,MAAM,aAAa,CAAA;AA0D9C,MAAM,OAAO,YAAY;IACvB,YAA6B,OAAuB;QAAvB,YAAO,GAAP,OAAO,CAAgB;IAAG,CAAC;IAExD,sDAAsD;IACtD,KAAK,CAAC,KAAK,CAAC,OAAqB;QAC/B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAc;YACzD,IAAI,EAAE,kBAAkB,CAAC,KAAK;YAC9B,GAAG,OAAO;SACX,CAAC,CAAA;QACF,OAAO,MAAM,IAAI,EAAC,OAAO,EAAE,KAAK,EAAC,CAAA;IACnC,CAAC;IAED,uFAAuF;IACvF,OAAO,CAAC,GAAW;QACjB,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;YACvB,IAAI,EAAE,kBAAkB,CAAC,QAAQ;YACjC,GAAG;SACJ,CAAC,CAAA;IACJ,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,qBAAqB;QACzB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAA2B;YACtE,IAAI,EAAE,kBAAkB,CAAC,mBAAmB;SAC7C,CAAC,CAAA;QACF,OAAO,MAAM,IAAI,EAAC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE,EAAC,CAAA;IACzE,CAAC;IAED,yCAAyC;IACzC,KAAK,CAAC,eAAe,CAAC,IAAY;QAChC,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAO;YACnC,IAAI,EAAE,kBAAkB,CAAC,cAAc;YACvC,IAAI;SACL,CAAC,CAAA;IACJ,CAAC;IAED,kFAAkF;IAClF,KAAK,CAAC,QAAQ,CAAC,OAAwB;QACrC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAiB;YAC5D,IAAI,EAAE,kBAAkB,CAAC,QAAQ;YACjC,GAAG,OAAO;SACX,CAAC,CAAA;QACF,OAAO,MAAM,IAAI,EAAC,OAAO,EAAE,KAAK,EAAC,CAAA;IACnC,CAAC;IAED;;;;;OAKG;IACH,IAAI;QACF,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;YACvB,IAAI,EAAE,kBAAkB,CAAC,WAAW;SACrC,CAAC,CAAA;IACJ,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,CAAC,UAAyB,EAAE;QACtC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAC3C;YACE,IAAI,EAAE,kBAAkB,CAAC,OAAO;YAChC,GAAG,OAAO;SACX,EACD,EAAC,SAAS,EAAE,CAAC,EAAC,CACf,CAAA;QACD,OAAO,MAAM,IAAI,EAAC,SAAS,EAAE,IAAI,EAAC,CAAA;IACpC,CAAC;CACF"}
|
|
@@ -14,8 +14,9 @@
|
|
|
14
14
|
* module still exposes lower-level audio chunks + VAD; this module is for
|
|
15
15
|
* "give me text from speech."
|
|
16
16
|
*
|
|
17
|
-
* MICROPHONE permission must be declared in miniapp.json.
|
|
18
|
-
*
|
|
17
|
+
* MICROPHONE permission must be declared in miniapp.json. Otherwise the phone
|
|
18
|
+
* runtime drops the subscription silently: SUBSCRIBE carries no requestId, so
|
|
19
|
+
* the PERMISSION_NOT_DECLARED result is discarded and handlers just never fire.
|
|
19
20
|
*/
|
|
20
21
|
import { MiniappSession } from "../session";
|
|
21
22
|
import type { TranscriptionData, UnsubscribeFn } from "./events";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transcription.d.ts","sourceRoot":"","sources":["../../src/modules/transcription.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"transcription.d.ts","sourceRoot":"","sources":["../../src/modules/transcription.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAA;AACzC,OAAO,KAAK,EAAC,iBAAiB,EAAE,aAAa,EAAC,MAAM,UAAU,CAAA;AAE9D,OAAO,KAAK,EAAC,YAAY,EAAE,qBAAqB,EAAC,MAAM,aAAa,CAAA;AAEpE,2DAA2D;AAC3D,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,YAAY,EAAE,CAAA;IAC9B,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,qBAAa,mBAAmB;IAIlB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAHpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2B;IAClD,OAAO,CAAC,aAAa,CAAmC;gBAE3B,OAAO,EAAE,cAAc;IAEpD;;;;;;;OAOG;IACH,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,EAAE,OAAO,GAAE,oBAAyB,GAAG,aAAa;IAMjG;;;;;;;;;;;;;OAaG;IACH,WAAW,CACT,QAAQ,EAAE,qBAAqB,GAAG,qBAAqB,EAAE,EACzD,OAAO,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,EAC1C,OAAO,GAAE,oBAAyB,GACjC,aAAa;IA4BhB;;;;;;;;;;OAUG;IACH,SAAS,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBrD,mEAAmE;IACnE,IAAI,IAAI,IAAI;IAWZ,mEAAmE;IACnE,IAAI,aAAa,IAAI,OAAO,CAE3B;IAED,0EAA0E;IAC1E,UAAU,IAAI,mBAAmB,GAAG,IAAI;IAMxC,OAAO,CAAC,KAAK;CAOd"}
|
|
@@ -14,8 +14,9 @@
|
|
|
14
14
|
* module still exposes lower-level audio chunks + VAD; this module is for
|
|
15
15
|
* "give me text from speech."
|
|
16
16
|
*
|
|
17
|
-
* MICROPHONE permission must be declared in miniapp.json.
|
|
18
|
-
*
|
|
17
|
+
* MICROPHONE permission must be declared in miniapp.json. Otherwise the phone
|
|
18
|
+
* runtime drops the subscription silently: SUBSCRIBE carries no requestId, so
|
|
19
|
+
* the PERMISSION_NOT_DECLARED result is discarded and handlers just never fire.
|
|
19
20
|
*/
|
|
20
21
|
import { MiniappRequestType, MiniappStreamType } from "../protocol";
|
|
21
22
|
import { requireLanguageHint, requireTranscriptionLanguage } from "./languages";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transcription.js","sourceRoot":"","sources":["../../src/modules/transcription.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"transcription.js","sourceRoot":"","sources":["../../src/modules/transcription.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAC,kBAAkB,EAAE,iBAAiB,EAAC,MAAM,aAAa,CAAA;AAGjE,OAAO,EAAC,mBAAmB,EAAE,4BAA4B,EAAC,MAAM,aAAa,CAAA;AAgC7E,MAAM,OAAO,mBAAm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,MAAM,CAAC,KAAK,CAAC,CAAA;YACzB,KAAK,EAAE,CAAA;QACT,CAAC,CAAA;IACH,CAAC;CACF"}
|
package/dist/protocol.d.ts
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* These values are the contract between @glassly/miniapp (running in a WebView)
|
|
6
6
|
* and LocalMiniappRuntime (running on the phone).
|
|
7
7
|
*
|
|
8
|
-
* IMPORTANT: This file has
|
|
9
|
-
* wire
|
|
10
|
-
*
|
|
8
|
+
* IMPORTANT: This file has no runtime dependency on the retired cloud SDK.
|
|
9
|
+
* Its published wire-protocol enums are used only for compatibility with
|
|
10
|
+
* existing cloud-hosted miniapps, not for phone↔miniapp communication.
|
|
11
11
|
*/
|
|
12
12
|
export declare enum MiniappRequestType {
|
|
13
13
|
/** Handshake: miniapp announces itself and asks phone to bind the session. */
|
|
@@ -16,6 +16,12 @@ export declare enum MiniappRequestType {
|
|
|
16
16
|
AUTH_REFRESH = "miniapp_auth_refresh",
|
|
17
17
|
/** Update the set of streams the miniapp is subscribed to. */
|
|
18
18
|
SUBSCRIBE = "miniapp_subscribe",
|
|
19
|
+
/**
|
|
20
|
+
* Declare the touch gestures this miniapp is handling itself. The most
|
|
21
|
+
* recent claimer of a gesture gets it alone and the host's default for it
|
|
22
|
+
* is skipped; releasing hands it back to the previous claimer.
|
|
23
|
+
*/
|
|
24
|
+
CLAIM_GESTURES = "miniapp_claim_gestures",
|
|
19
25
|
/**
|
|
20
26
|
* Push a legacy display layout to the glasses. The SDK no longer emits this
|
|
21
27
|
* (render()/RENDER replaced it); hosts keep accepting it from bundles packed
|
|
@@ -24,6 +30,15 @@ export declare enum MiniappRequestType {
|
|
|
24
30
|
DISPLAY = "miniapp_display",
|
|
25
31
|
/** Render a whole scene of positioned elements (replace-the-frame). */
|
|
26
32
|
RENDER = "miniapp_render",
|
|
33
|
+
/** Read the globally visible intended glasses canvas. DISPLAY_MIRROR permission. */
|
|
34
|
+
MIRROR_GET = "miniapp_mirror_get",
|
|
35
|
+
/**
|
|
36
|
+
* Ask the host for a display view (display.showView). "main" is every
|
|
37
|
+
* app's; "dashboard" is the overlay slot above the main content, granted
|
|
38
|
+
* only to the running miniapp whose manifest type is "system_dashboard"
|
|
39
|
+
* while the glasses can show it.
|
|
40
|
+
*/
|
|
41
|
+
SHOW_VIEW = "miniapp_show_view",
|
|
27
42
|
/**
|
|
28
43
|
* Feed the device's firmware-rendered navigation UI (capability
|
|
29
44
|
* `hasNativeNavigation`): structured turn-by-turn card fields and
|
|
@@ -52,6 +67,19 @@ export declare enum MiniappRequestType {
|
|
|
52
67
|
LOCATION_POLL = "miniapp_location_poll",
|
|
53
68
|
/** Read a bounded snapshot of phone calendar events. */
|
|
54
69
|
CALENDAR_LIST_EVENTS = "miniapp_calendar_list_events",
|
|
70
|
+
/**
|
|
71
|
+
* Apps that post phone notifications, for a notification filter UI.
|
|
72
|
+
* SYSTEM-only. Android: installed apps with icons; iOS: the seeded
|
|
73
|
+
* catalog plus apps the glasses reported.
|
|
74
|
+
*/
|
|
75
|
+
NOTIFICATION_APPS_LIST = "miniapp_notification_apps_list",
|
|
76
|
+
/**
|
|
77
|
+
* The engine's settings store behind an allowlist (session.settings).
|
|
78
|
+
* SYSTEM-only. GET takes optional `keys` and answers `{values}`; SET
|
|
79
|
+
* takes `key` and `value` and writes through the store.
|
|
80
|
+
*/
|
|
81
|
+
SETTINGS_GET = "miniapp_settings_get",
|
|
82
|
+
SETTINGS_SET = "miniapp_settings_set",
|
|
55
83
|
/** Start a turn-by-turn navigation trip. Android only. */
|
|
56
84
|
NAVIGATION_START = "miniapp_navigation_start",
|
|
57
85
|
/** Stop the active navigation trip (if any). */
|
|
@@ -149,6 +177,7 @@ export declare enum MiniappRequestType {
|
|
|
149
177
|
* for callers who want to control the sensor directly. G2 only today.
|
|
150
178
|
*/
|
|
151
179
|
IMU_SET_ENABLED = "miniapp_imu_set_enabled",
|
|
180
|
+
GLASSES_SENSOR_CONTROL = "miniapp_glasses_sensor_control",
|
|
152
181
|
/** Explicitly enable/disable glasses-side VAD (GX8002). Mirrors the app's mic settings toggle. */
|
|
153
182
|
MIC_SET_VAD_ENABLED = "miniapp_mic_set_vad_enabled",
|
|
154
183
|
/** Explicitly enable/disable the center-mic loudness gate ("Barrier"). */
|
|
@@ -163,6 +192,7 @@ export declare enum MiniappRequestType {
|
|
|
163
192
|
/** Open a URL in the system browser. */
|
|
164
193
|
OPEN_URL = "miniapp_open_url",
|
|
165
194
|
/** Copy text to the system clipboard. */
|
|
195
|
+
DISPLAY_DIAGNOSTICS = "miniapp_display_diagnostics",
|
|
166
196
|
COPY_CLIPBOARD = "miniapp_copy_clipboard",
|
|
167
197
|
/** Download a file (triggers OS share sheet for save location). */
|
|
168
198
|
DOWNLOAD = "miniapp_download",
|
|
@@ -242,6 +272,8 @@ export declare enum MiniappResponseType {
|
|
|
242
272
|
REQUEST_RESULT = "miniapp_request_result",
|
|
243
273
|
/** Push: glasses capabilities changed. */
|
|
244
274
|
CAPABILITIES_UPDATE = "miniapp_capabilities_update",
|
|
275
|
+
/** Push: host user preferences (units, clock format) changed. */
|
|
276
|
+
PREFERENCES_UPDATE = "miniapp_preferences_update",
|
|
245
277
|
/** Push: miniapp's foreground/background state changed. */
|
|
246
278
|
VISIBILITY_CHANGE = "miniapp_visibility_change",
|
|
247
279
|
/** Push: host color scheme (light/dark) changed. */
|
|
@@ -285,7 +317,25 @@ export declare enum MiniappResponseType {
|
|
|
285
317
|
export declare enum MiniappStreamType {
|
|
286
318
|
BUTTON_PRESS = "button_press",
|
|
287
319
|
TOUCH_EVENT = "touch_event",
|
|
320
|
+
/**
|
|
321
|
+
* Physical keyboard paired to the glasses (input.onKey): DOM-style
|
|
322
|
+
* `{phase, key, code, modifiers, text?, repeat, timestamp}`. G2 Glassly CFW
|
|
323
|
+
* revision 39+ only; broadcast to every subscriber like button_press.
|
|
324
|
+
*/
|
|
325
|
+
KEYBOARD_EVENT = "keyboard_event",
|
|
288
326
|
HEAD_POSITION = "head_position",
|
|
327
|
+
/**
|
|
328
|
+
* The dashboard view's state (display.onViewChange): `{kind: "change",
|
|
329
|
+
* view, reason}` when the host grants or takes the overlay slot.
|
|
330
|
+
*/
|
|
331
|
+
DISPLAY_VIEW = "display_view",
|
|
332
|
+
/** Initial mirror snapshot and subsequent visible display changes. */
|
|
333
|
+
MIRROR_UPDATE = "mirror_update",
|
|
334
|
+
/**
|
|
335
|
+
* A gesture claim changed hands (input.onClaimChange): `{gesture, held}`,
|
|
336
|
+
* sent to the app that gained or lost the gesture.
|
|
337
|
+
*/
|
|
338
|
+
GESTURE_CLAIM = "gesture_claim",
|
|
289
339
|
/**
|
|
290
340
|
* Raw accelerometer reading from the glasses IMU — `{x, y, z}` in g, plus a
|
|
291
341
|
* timestamp. G2 only today. A richer combined IMU stream (accel + gyro +
|
|
@@ -302,19 +352,29 @@ export declare enum MiniappStreamType {
|
|
|
302
352
|
AUDIO_CHUNK = "audio_chunk",
|
|
303
353
|
VAD = "vad",
|
|
304
354
|
LOCATION_UPDATE = "location_update",
|
|
305
|
-
/**
|
|
355
|
+
/** Phone compass heading in degrees (0=N, 90=E). */
|
|
306
356
|
HEADING_UPDATE = "heading_update",
|
|
357
|
+
LIGHT_SENSOR = "light_sensor",
|
|
358
|
+
/** Glasses compass heading; auto-starts on custom firmware, nav mode only on stock. */
|
|
359
|
+
GLASSES_COMPASS = "glasses_compass",
|
|
360
|
+
COMPASS_CALIBRATION = "compass_calibration",
|
|
307
361
|
/** Turn-by-turn navigation event (maneuver / rerouting / arrived / error). */
|
|
308
362
|
NAVIGATION_UPDATE = "navigation_update",
|
|
309
363
|
/** Active navigation route polyline — full path, fired once per route build. */
|
|
310
364
|
NAVIGATION_ROUTE = "navigation_route",
|
|
311
365
|
PHONE_NOTIFICATION = "phone_notification",
|
|
366
|
+
/**
|
|
367
|
+
* An allowlisted engine setting changed (session.settings.onChange), as
|
|
368
|
+
* `{key, value}`. SYSTEM-only; every key's current value is replayed on
|
|
369
|
+
* subscribe.
|
|
370
|
+
*/
|
|
371
|
+
SETTINGS_CHANGED = "settings_changed",
|
|
312
372
|
/**
|
|
313
373
|
* A previously-posted notification was dismissed by the user.
|
|
314
374
|
*
|
|
315
375
|
* Android-only today. iOS does not expose dismiss callbacks to apps
|
|
316
376
|
* (Apple privacy restriction); subscribing on iOS succeeds but no events
|
|
317
|
-
* fire. See agents/miniapp-speaker-state-and-notif-dismissed-plan.md.
|
|
377
|
+
* fire. See notes/archive/agents/miniapp-speaker-state-and-notif-dismissed-plan.md.
|
|
318
378
|
*/
|
|
319
379
|
PHONE_NOTIFICATION_DISMISSED = "phone_notification_dismissed",
|
|
320
380
|
PHOTO_TAKEN = "photo_taken",
|
package/dist/protocol.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,oBAAY,kBAAkB;IAC5B,8EAA8E;IAC9E,OAAO,oBAAoB;IAE3B,yDAAyD;IACzD,YAAY,yBAAyB;IAErC,8DAA8D;IAC9D,SAAS,sBAAsB;IAE/B;;;;OAIG;IACH,OAAO,oBAAoB;IAE3B,uEAAuE;IACvE,MAAM,mBAAmB;IAEzB;;;;OAIG;IACH,UAAU,uBAAuB;IAEjC,8EAA8E;IAC9E,UAAU,uBAAuB;IAEjC,sDAAsD;IACtD,UAAU,uBAAuB;IAEjC,2DAA2D;IAC3D,KAAK,kBAAkB;IAEvB;;;;;OAKG;IACH,mBAAmB,gCAAgC;IACnD,oBAAoB,iCAAiC;IACrD,oBAAoB,iCAAiC;IACrD,oBAAoB,iCAAiC;IAErD,mCAAmC;IACnC,OAAO,oBAAoB;IAE3B,8BAA8B;IAC9B,aAAa,0BAA0B;IAEvC,wDAAwD;IACxD,oBAAoB,iCAAiC;IAErD,0DAA0D;IAC1D,gBAAgB,6BAA6B;IAC7C,gDAAgD;IAChD,eAAe,4BAA4B;IAC3C,mFAAm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