@mentra/miniapp 0.3.0-dev.0
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 +259 -0
- package/dist/background/index.d.ts +59 -0
- package/dist/background/index.d.ts.map +1 -0
- package/dist/background/index.js +25 -0
- package/dist/background/index.js.map +1 -0
- package/dist/background/register.d.ts +38 -0
- package/dist/background/register.d.ts.map +1 -0
- package/dist/background/register.js +75 -0
- package/dist/background/register.js.map +1 -0
- package/dist/dev-reload.d.ts +21 -0
- package/dist/dev-reload.d.ts.map +1 -0
- package/dist/dev-reload.js +62 -0
- package/dist/dev-reload.js.map +1 -0
- package/dist/envelope.d.ts +23 -0
- package/dist/envelope.d.ts.map +1 -0
- package/dist/envelope.js +47 -0
- package/dist/envelope.js.map +1 -0
- package/dist/globals.d.ts +54 -0
- package/dist/globals.d.ts.map +1 -0
- package/dist/globals.js +12 -0
- package/dist/globals.js.map +1 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/actions.d.ts +54 -0
- package/dist/modules/actions.d.ts.map +1 -0
- package/dist/modules/actions.js +122 -0
- package/dist/modules/actions.js.map +1 -0
- package/dist/modules/auth.d.ts +25 -0
- package/dist/modules/auth.d.ts.map +1 -0
- package/dist/modules/auth.js +52 -0
- package/dist/modules/auth.js.map +1 -0
- package/dist/modules/base64.d.ts +16 -0
- package/dist/modules/base64.d.ts.map +1 -0
- package/dist/modules/base64.js +92 -0
- package/dist/modules/base64.js.map +1 -0
- package/dist/modules/blob.d.ts +161 -0
- package/dist/modules/blob.d.ts.map +1 -0
- package/dist/modules/blob.js +277 -0
- package/dist/modules/blob.js.map +1 -0
- package/dist/modules/camera.d.ts +137 -0
- package/dist/modules/camera.d.ts.map +1 -0
- package/dist/modules/camera.js +104 -0
- package/dist/modules/camera.js.map +1 -0
- package/dist/modules/cloud.d.ts +34 -0
- package/dist/modules/cloud.d.ts.map +1 -0
- package/dist/modules/cloud.js +70 -0
- package/dist/modules/cloud.js.map +1 -0
- package/dist/modules/dashboard.d.ts +16 -0
- package/dist/modules/dashboard.d.ts.map +1 -0
- package/dist/modules/dashboard.js +27 -0
- package/dist/modules/dashboard.js.map +1 -0
- package/dist/modules/display.d.ts +106 -0
- package/dist/modules/display.d.ts.map +1 -0
- package/dist/modules/display.js +57 -0
- package/dist/modules/display.js.map +1 -0
- package/dist/modules/events.d.ts +167 -0
- package/dist/modules/events.d.ts.map +1 -0
- package/dist/modules/events.js +123 -0
- package/dist/modules/events.js.map +1 -0
- package/dist/modules/glasses.d.ts +28 -0
- package/dist/modules/glasses.d.ts.map +1 -0
- package/dist/modules/glasses.js +39 -0
- package/dist/modules/glasses.js.map +1 -0
- package/dist/modules/heading.d.ts +16 -0
- package/dist/modules/heading.d.ts.map +1 -0
- package/dist/modules/heading.js +20 -0
- package/dist/modules/heading.js.map +1 -0
- package/dist/modules/imu.d.ts +31 -0
- package/dist/modules/imu.d.ts.map +1 -0
- package/dist/modules/imu.js +40 -0
- package/dist/modules/imu.js.map +1 -0
- package/dist/modules/input.d.ts +34 -0
- package/dist/modules/input.d.ts.map +1 -0
- package/dist/modules/input.js +50 -0
- package/dist/modules/input.js.map +1 -0
- package/dist/modules/led.d.ts +35 -0
- package/dist/modules/led.d.ts.map +1 -0
- package/dist/modules/led.js +39 -0
- package/dist/modules/led.js.map +1 -0
- package/dist/modules/location.d.ts +27 -0
- package/dist/modules/location.d.ts.map +1 -0
- package/dist/modules/location.js +35 -0
- package/dist/modules/location.js.map +1 -0
- package/dist/modules/mic.d.ts +44 -0
- package/dist/modules/mic.d.ts.map +1 -0
- package/dist/modules/mic.js +67 -0
- package/dist/modules/mic.js.map +1 -0
- package/dist/modules/miniapps.d.ts +72 -0
- package/dist/modules/miniapps.d.ts.map +1 -0
- package/dist/modules/miniapps.js +48 -0
- package/dist/modules/miniapps.js.map +1 -0
- package/dist/modules/navigation.d.ts +326 -0
- package/dist/modules/navigation.d.ts.map +1 -0
- package/dist/modules/navigation.js +386 -0
- package/dist/modules/navigation.js.map +1 -0
- package/dist/modules/permissions.d.ts +58 -0
- package/dist/modules/permissions.d.ts.map +1 -0
- package/dist/modules/permissions.js +66 -0
- package/dist/modules/permissions.js.map +1 -0
- package/dist/modules/phone.d.ts +61 -0
- package/dist/modules/phone.d.ts.map +1 -0
- package/dist/modules/phone.js +94 -0
- package/dist/modules/phone.js.map +1 -0
- package/dist/modules/pivots/engine.d.ts +169 -0
- package/dist/modules/pivots/engine.d.ts.map +1 -0
- package/dist/modules/pivots/engine.js +779 -0
- package/dist/modules/pivots/engine.js.map +1 -0
- package/dist/modules/pivots/geometry.d.ts +84 -0
- package/dist/modules/pivots/geometry.d.ts.map +1 -0
- package/dist/modules/pivots/geometry.js +371 -0
- package/dist/modules/pivots/geometry.js.map +1 -0
- package/dist/modules/pivots/instructions.d.ts +139 -0
- package/dist/modules/pivots/instructions.d.ts.map +1 -0
- package/dist/modules/pivots/instructions.js +280 -0
- package/dist/modules/pivots/instructions.js.map +1 -0
- package/dist/modules/speaker.d.ts +163 -0
- package/dist/modules/speaker.d.ts.map +1 -0
- package/dist/modules/speaker.js +250 -0
- package/dist/modules/speaker.js.map +1 -0
- package/dist/modules/storage.d.ts +50 -0
- package/dist/modules/storage.d.ts.map +1 -0
- package/dist/modules/storage.js +99 -0
- package/dist/modules/storage.js.map +1 -0
- package/dist/modules/stream.d.ts +129 -0
- package/dist/modules/stream.d.ts.map +1 -0
- package/dist/modules/stream.js +52 -0
- package/dist/modules/stream.js.map +1 -0
- package/dist/modules/system.d.ts +45 -0
- package/dist/modules/system.d.ts.map +1 -0
- package/dist/modules/system.js +42 -0
- package/dist/modules/system.js.map +1 -0
- package/dist/modules/transcription.d.ts +67 -0
- package/dist/modules/transcription.d.ts.map +1 -0
- package/dist/modules/transcription.js +106 -0
- package/dist/modules/transcription.js.map +1 -0
- package/dist/modules/translation.d.ts +59 -0
- package/dist/modules/translation.d.ts.map +1 -0
- package/dist/modules/translation.js +119 -0
- package/dist/modules/translation.js.map +1 -0
- package/dist/modules/ui.d.ts +186 -0
- package/dist/modules/ui.d.ts.map +1 -0
- package/dist/modules/ui.js +293 -0
- package/dist/modules/ui.js.map +1 -0
- package/dist/protocol.d.ts +294 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +320 -0
- package/dist/protocol.js.map +1 -0
- package/dist/react/MentraProvider.d.ts +33 -0
- package/dist/react/MentraProvider.d.ts.map +1 -0
- package/dist/react/MentraProvider.js +15 -0
- package/dist/react/MentraProvider.js.map +1 -0
- package/dist/react/MiniappHeader.d.ts +44 -0
- package/dist/react/MiniappHeader.d.ts.map +1 -0
- package/dist/react/MiniappHeader.js +32 -0
- package/dist/react/MiniappHeader.js.map +1 -0
- package/dist/react/index.d.ts +13 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +9 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/useCapabilities.d.ts +26 -0
- package/dist/react/useCapabilities.d.ts.map +1 -0
- package/dist/react/useCapabilities.js +27 -0
- package/dist/react/useCapabilities.js.map +1 -0
- package/dist/react/useCapsuleHeaderStyle.d.ts +27 -0
- package/dist/react/useCapsuleHeaderStyle.d.ts.map +1 -0
- package/dist/react/useCapsuleHeaderStyle.js +36 -0
- package/dist/react/useCapsuleHeaderStyle.js.map +1 -0
- package/dist/react/useColorScheme.d.ts +18 -0
- package/dist/react/useColorScheme.d.ts.map +1 -0
- package/dist/react/useColorScheme.js +24 -0
- package/dist/react/useColorScheme.js.map +1 -0
- package/dist/react/useConnected.d.ts +17 -0
- package/dist/react/useConnected.d.ts.map +1 -0
- package/dist/react/useConnected.js +39 -0
- package/dist/react/useConnected.js.map +1 -0
- package/dist/react/useRpc.d.ts +29 -0
- package/dist/react/useRpc.d.ts.map +1 -0
- package/dist/react/useRpc.js +82 -0
- package/dist/react/useRpc.js.map +1 -0
- package/dist/react/useSafeArea.d.ts +21 -0
- package/dist/react/useSafeArea.d.ts.map +1 -0
- package/dist/react/useSafeArea.js +22 -0
- package/dist/react/useSafeArea.js.map +1 -0
- package/dist/session.d.ts +310 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +653 -0
- package/dist/session.js.map +1 -0
- package/dist/sub-path-types.test-d.d.ts +28 -0
- package/dist/sub-path-types.test-d.d.ts.map +1 -0
- package/dist/sub-path-types.test-d.js +37 -0
- package/dist/sub-path-types.test-d.js.map +1 -0
- package/dist/transport/auto.d.ts +35 -0
- package/dist/transport/auto.d.ts.map +1 -0
- package/dist/transport/auto.js +125 -0
- package/dist/transport/auto.js.map +1 -0
- package/dist/transport/dispatch.d.ts +43 -0
- package/dist/transport/dispatch.d.ts.map +1 -0
- package/dist/transport/dispatch.js +91 -0
- package/dist/transport/dispatch.js.map +1 -0
- package/dist/transport/local-socket.d.ts +28 -0
- package/dist/transport/local-socket.d.ts.map +1 -0
- package/dist/transport/local-socket.js +80 -0
- package/dist/transport/local-socket.js.map +1 -0
- package/dist/transport/mock.d.ts +54 -0
- package/dist/transport/mock.d.ts.map +1 -0
- package/dist/transport/mock.js +205 -0
- package/dist/transport/mock.js.map +1 -0
- package/dist/transport/postmessage.d.ts +36 -0
- package/dist/transport/postmessage.d.ts.map +1 -0
- package/dist/transport/postmessage.js +78 -0
- package/dist/transport/postmessage.js.map +1 -0
- package/dist/transport/types.d.ts +25 -0
- package/dist/transport/types.d.ts.map +1 -0
- package/dist/transport/types.js +11 -0
- package/dist/transport/types.js.map +1 -0
- package/dist/ui/index.d.ts +98 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +32 -0
- package/dist/ui/index.js.map +1 -0
- package/package.json +75 -0
- package/src/background/index.ts +152 -0
- package/src/background/register.ts +85 -0
- package/src/dev-reload.ts +60 -0
- package/src/envelope.ts +54 -0
- package/src/globals.ts +62 -0
- package/src/index.ts +171 -0
- package/src/modules/actions.ts +156 -0
- package/src/modules/auth.ts +68 -0
- package/src/modules/base64.ts +87 -0
- package/src/modules/blob.ts +341 -0
- package/src/modules/camera.ts +196 -0
- package/src/modules/cloud.ts +94 -0
- package/src/modules/dashboard.ts +31 -0
- package/src/modules/display.ts +122 -0
- package/src/modules/events.ts +264 -0
- package/src/modules/glasses.ts +44 -0
- package/src/modules/heading.ts +23 -0
- package/src/modules/imu.ts +44 -0
- package/src/modules/input.ts +71 -0
- package/src/modules/led.ts +61 -0
- package/src/modules/location.ts +39 -0
- package/src/modules/mic.ts +74 -0
- package/src/modules/miniapps.ts +90 -0
- package/src/modules/navigation.ts +670 -0
- package/src/modules/permissions.ts +84 -0
- package/src/modules/phone.ts +120 -0
- package/src/modules/pivots/engine.ts +863 -0
- package/src/modules/pivots/geometry.ts +409 -0
- package/src/modules/pivots/instructions.ts +343 -0
- package/src/modules/speaker.ts +328 -0
- package/src/modules/storage.ts +109 -0
- package/src/modules/stream.ts +163 -0
- package/src/modules/system.ts +76 -0
- package/src/modules/transcription.ts +128 -0
- package/src/modules/translation.ts +149 -0
- package/src/modules/ui.ts +498 -0
- package/src/protocol.ts +371 -0
- package/src/react/MentraProvider.tsx +50 -0
- package/src/react/MiniappHeader.tsx +122 -0
- package/src/react/index.ts +12 -0
- package/src/react/useCapabilities.ts +29 -0
- package/src/react/useCapsuleHeaderStyle.ts +54 -0
- package/src/react/useColorScheme.ts +26 -0
- package/src/react/useConnected.ts +47 -0
- package/src/react/useRpc.ts +106 -0
- package/src/react/useSafeArea.ts +40 -0
- package/src/session.ts +878 -0
- package/src/sub-path-types.test-d.ts +49 -0
- package/src/transport/auto.ts +143 -0
- package/src/transport/dispatch.ts +106 -0
- package/src/transport/local-socket.ts +93 -0
- package/src/transport/mock.ts +248 -0
- package/src/transport/postmessage.ts +95 -0
- package/src/transport/types.ts +26 -0
- package/src/ui/index.ts +122 -0
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error thrown by `mentra.request` when the handler threw or returned an
|
|
3
|
+
* error envelope. Plain `Error` subclass — distinguished by `err.name`.
|
|
4
|
+
* `err.cause` is `{code?: string}` if the handler attached one.
|
|
5
|
+
*/
|
|
6
|
+
export class MentraRpcError extends Error {
|
|
7
|
+
constructor(message, options) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.name = "MentraRpcError";
|
|
10
|
+
// Assign `cause` directly: the package's tsconfig targets ES2020 lib
|
|
11
|
+
// where `Error`'s ctor is typed as 1-arity (no `ErrorOptions`).
|
|
12
|
+
// Modern JS engines still allow setting `cause` as a plain property.
|
|
13
|
+
if (options?.cause !== undefined) {
|
|
14
|
+
;
|
|
15
|
+
this.cause = options.cause;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/** Thrown by `mentra.request` when its `{timeout}` elapses. */
|
|
20
|
+
export class MentraRpcTimeoutError extends Error {
|
|
21
|
+
constructor(message = "RPC timed out") {
|
|
22
|
+
super(message);
|
|
23
|
+
this.name = "MentraRpcTimeoutError";
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function rpcErrorFromUnknown(e) {
|
|
27
|
+
if (e instanceof Error) {
|
|
28
|
+
// `cause` is ES2022; this package's lib targets ES2020 where Error
|
|
29
|
+
// has no `cause` field. Read it via a structural cast. Diagnostic fields
|
|
30
|
+
// (code/stage/transport) may live as own props (PhotoError-style) or on
|
|
31
|
+
// the cause — own props win.
|
|
32
|
+
const own = e;
|
|
33
|
+
const cause = own.cause;
|
|
34
|
+
return compactEnvelope({
|
|
35
|
+
message: e.message,
|
|
36
|
+
code: own.code ?? cause?.code,
|
|
37
|
+
stage: own.stage,
|
|
38
|
+
transport: own.transport,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (e && typeof e === "object") {
|
|
42
|
+
// Hosts reject RPCs with plain structured objects ({code, message, stage,
|
|
43
|
+
// transport}); stringifying them produced the infamous "[object Object]".
|
|
44
|
+
const o = e;
|
|
45
|
+
return compactEnvelope({
|
|
46
|
+
message: typeof o.message === "string" ? o.message : JSON.stringify(e),
|
|
47
|
+
code: typeof o.code === "string" ? o.code : undefined,
|
|
48
|
+
stage: typeof o.stage === "string" ? o.stage : undefined,
|
|
49
|
+
transport: typeof o.transport === "string" ? o.transport : undefined,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return { message: String(e) };
|
|
53
|
+
}
|
|
54
|
+
function compactEnvelope(env) {
|
|
55
|
+
const out = { message: env.message };
|
|
56
|
+
if (env.code)
|
|
57
|
+
out.code = env.code;
|
|
58
|
+
if (env.stage)
|
|
59
|
+
out.stage = env.stage;
|
|
60
|
+
if (env.transport)
|
|
61
|
+
out.transport = env.transport;
|
|
62
|
+
return out;
|
|
63
|
+
}
|
|
64
|
+
export class UIModuleImpl {
|
|
65
|
+
constructor(session) {
|
|
66
|
+
this.session = session;
|
|
67
|
+
/** True between UI_OPEN and the matching UI_CLOSE. */
|
|
68
|
+
this.bound = false;
|
|
69
|
+
/** Monotonic outbound seq number. Reset on bind. */
|
|
70
|
+
this.nextSeq = 1;
|
|
71
|
+
/** Open-lifecycle handlers — fire on every UI_OPEN. */
|
|
72
|
+
this.openHandlers = new Set();
|
|
73
|
+
this.closeHandlers = new Set();
|
|
74
|
+
/** channel → set of subscribers. */
|
|
75
|
+
this.channelHandlers = new Map();
|
|
76
|
+
/** channel → single registered RPC handler. */
|
|
77
|
+
this.rpcHandlers = new Map();
|
|
78
|
+
/** requestId → AbortController for in-flight RPC handler invocations. */
|
|
79
|
+
this.inflightRpc = new Map();
|
|
80
|
+
// Arrow-property bindings make every public method safe to destructure
|
|
81
|
+
// (`const {send} = session.ui`) or pass as a bare callback — a plain
|
|
82
|
+
// method loses `this` and crashes on `this.bound`.
|
|
83
|
+
this.isOpen = () => {
|
|
84
|
+
return this.bound;
|
|
85
|
+
};
|
|
86
|
+
this.onOpen = (cb) => {
|
|
87
|
+
this.openHandlers.add(cb);
|
|
88
|
+
if (this.bound) {
|
|
89
|
+
// Late subscriber — fire once for the current binding so callers
|
|
90
|
+
// that wire onOpen *after* the WebView mounted don't miss it.
|
|
91
|
+
// Gate on session readiness for the same reason handleInbound does:
|
|
92
|
+
// a late onOpen must still observe populated capabilities, not the
|
|
93
|
+
// pre-CONNECT_ACK null snapshot. If not yet ready, the "ready"
|
|
94
|
+
// listener registered in handleInbound's UI_OPEN branch will fan
|
|
95
|
+
// out to every openHandler (this one included), so we don't wire a
|
|
96
|
+
// second listener here.
|
|
97
|
+
if (this.session.ready) {
|
|
98
|
+
try {
|
|
99
|
+
cb();
|
|
100
|
+
}
|
|
101
|
+
catch (e) {
|
|
102
|
+
// eslint-disable-next-line no-console
|
|
103
|
+
console.warn("session.ui.onOpen late-fire threw:", e);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return () => {
|
|
108
|
+
this.openHandlers.delete(cb);
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
this.onClose = (cb) => {
|
|
112
|
+
this.closeHandlers.add(cb);
|
|
113
|
+
return () => {
|
|
114
|
+
this.closeHandlers.delete(cb);
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
this.send = (channel, payload) => {
|
|
118
|
+
if (!this.bound) {
|
|
119
|
+
// Per spec: drop silently when no WebView is bound. Background
|
|
120
|
+
// is the source of truth — the WebView re-fetches state on next
|
|
121
|
+
// open via session.ui.onOpen.
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const seq = this.nextSeq++;
|
|
125
|
+
const envelope = { type: "UI_SEND", channel, payload, seq };
|
|
126
|
+
this.session.sendOneShot(envelope);
|
|
127
|
+
};
|
|
128
|
+
this.on = (channel, cb) => {
|
|
129
|
+
let set = this.channelHandlers.get(channel);
|
|
130
|
+
if (!set) {
|
|
131
|
+
set = new Set();
|
|
132
|
+
this.channelHandlers.set(channel, set);
|
|
133
|
+
}
|
|
134
|
+
set.add(cb);
|
|
135
|
+
return () => {
|
|
136
|
+
set.delete(cb);
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
this.handle = (channel, handler) => {
|
|
140
|
+
const key = channel;
|
|
141
|
+
if (this.rpcHandlers.has(key)) {
|
|
142
|
+
throw new Error(`session.ui.handle: a handler is already registered for "${key}"`);
|
|
143
|
+
}
|
|
144
|
+
this.rpcHandlers.set(key, handler);
|
|
145
|
+
return () => {
|
|
146
|
+
this.rpcHandlers.delete(key);
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
// The session forwards UI_OPEN / UI_CLOSE / UI_MESSAGE envelopes via
|
|
150
|
+
// its internal stream subscriber surface. The UIModule registers
|
|
151
|
+
// once via session._subscribe to receive them. The "_ui" stream
|
|
152
|
+
// name is internal — not exposed in the public stream list — so
|
|
153
|
+
// the host router knows to route lifecycle frames here without
|
|
154
|
+
// bumping any existing stream type.
|
|
155
|
+
this.session._subscribe("_ui", (env) => this.handleInbound(env));
|
|
156
|
+
}
|
|
157
|
+
/** Fire every registered open handler once. Guarded per-handler. */
|
|
158
|
+
fireOpenHandlers() {
|
|
159
|
+
for (const h of this.openHandlers) {
|
|
160
|
+
try {
|
|
161
|
+
h();
|
|
162
|
+
}
|
|
163
|
+
catch (e) {
|
|
164
|
+
// eslint-disable-next-line no-console
|
|
165
|
+
console.warn("session.ui.onOpen handler threw", e);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/** @internal — handle UI_OPEN / UI_CLOSE / UI_MESSAGE envelopes from the host. */
|
|
170
|
+
handleInbound(env) {
|
|
171
|
+
if (env.type === "UI_OPEN") {
|
|
172
|
+
this.bound = true;
|
|
173
|
+
this.nextSeq = 1;
|
|
174
|
+
// onOpen handlers almost always read session.capabilities /
|
|
175
|
+
// session.ready to hydrate the fresh WebView. The WebView's
|
|
176
|
+
// `mentra.ready()` (which produces this UI_OPEN) races the
|
|
177
|
+
// background session's CONNECT_ACK — on a fast bridge UI_OPEN can
|
|
178
|
+
// arrive first, leaving capabilities null and the UI rendering a
|
|
179
|
+
// "no glasses" snapshot that never self-corrects. Gate the open
|
|
180
|
+
// fan-out on session readiness so handlers always observe a
|
|
181
|
+
// populated session. The WebView is marked bound immediately
|
|
182
|
+
// (send/isOpen work, inbound stays buffered) — only the open
|
|
183
|
+
// callbacks wait.
|
|
184
|
+
if (this.session.ready) {
|
|
185
|
+
this.fireOpenHandlers();
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
const off = this.session.on("ready", () => {
|
|
189
|
+
off();
|
|
190
|
+
// If the WebView closed during the connect window, don't fire
|
|
191
|
+
// stale open handlers — a later UI_OPEN will re-trigger them.
|
|
192
|
+
if (this.bound)
|
|
193
|
+
this.fireOpenHandlers();
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
if (env.type === "UI_CLOSE") {
|
|
199
|
+
this.bound = false;
|
|
200
|
+
for (const h of this.closeHandlers) {
|
|
201
|
+
try {
|
|
202
|
+
h();
|
|
203
|
+
}
|
|
204
|
+
catch (e) {
|
|
205
|
+
// eslint-disable-next-line no-console
|
|
206
|
+
console.warn("session.ui.onClose handler threw", e);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
if (env.type === "UI_MESSAGE") {
|
|
212
|
+
// RPC call: requestId set → dispatch to handle() handler.
|
|
213
|
+
if (typeof env.requestId === "string") {
|
|
214
|
+
this.dispatchRpcCall(env.channel, env.payload, env.requestId);
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
// Broadcast: fan out to on() subscribers.
|
|
218
|
+
const set = this.channelHandlers.get(env.channel);
|
|
219
|
+
if (!set || set.size === 0)
|
|
220
|
+
return;
|
|
221
|
+
for (const h of set) {
|
|
222
|
+
try {
|
|
223
|
+
h(env.payload);
|
|
224
|
+
}
|
|
225
|
+
catch (e) {
|
|
226
|
+
// eslint-disable-next-line no-console
|
|
227
|
+
console.warn(`session.ui.on(${env.channel}) threw`, e);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
if (env.type === "UI_CANCEL") {
|
|
233
|
+
const ctrl = this.inflightRpc.get(env.requestId);
|
|
234
|
+
if (ctrl) {
|
|
235
|
+
try {
|
|
236
|
+
ctrl.abort();
|
|
237
|
+
}
|
|
238
|
+
catch {
|
|
239
|
+
/* ignore */
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
/** @internal — invoke a registered RPC handler and send back the reply. */
|
|
246
|
+
dispatchRpcCall(channel, payload, requestId) {
|
|
247
|
+
const handler = this.rpcHandlers.get(channel);
|
|
248
|
+
if (!handler) {
|
|
249
|
+
// No handler registered. Reply with a structured error so the
|
|
250
|
+
// UI's request promise rejects with a useful message.
|
|
251
|
+
this.sendRpcReply(channel, requestId, {
|
|
252
|
+
ok: false,
|
|
253
|
+
error: { message: `no handler registered for "${channel}"` },
|
|
254
|
+
});
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
const ctrl = new AbortController();
|
|
258
|
+
this.inflightRpc.set(requestId, ctrl);
|
|
259
|
+
const ctx = { signal: ctrl.signal };
|
|
260
|
+
const finish = (envelope) => {
|
|
261
|
+
this.inflightRpc.delete(requestId);
|
|
262
|
+
// If the controller already aborted (UI cancelled), drop the
|
|
263
|
+
// reply — the UI side has already removed its listener.
|
|
264
|
+
if (ctrl.signal.aborted)
|
|
265
|
+
return;
|
|
266
|
+
this.sendRpcReply(channel, requestId, envelope);
|
|
267
|
+
};
|
|
268
|
+
let result;
|
|
269
|
+
try {
|
|
270
|
+
result = handler(payload, ctx);
|
|
271
|
+
}
|
|
272
|
+
catch (e) {
|
|
273
|
+
finish({ ok: false, error: rpcErrorFromUnknown(e) });
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
if (result && typeof result.then === "function") {
|
|
277
|
+
;
|
|
278
|
+
result.then((v) => finish({ ok: true, result: v }), (e) => finish({ ok: false, error: rpcErrorFromUnknown(e) }));
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
finish({ ok: true, result });
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
/** @internal — send a UI_SEND envelope tagged with a requestId. */
|
|
285
|
+
sendRpcReply(channel, requestId, payload) {
|
|
286
|
+
if (!this.bound)
|
|
287
|
+
return;
|
|
288
|
+
const seq = this.nextSeq++;
|
|
289
|
+
const envelope = { type: "UI_SEND", channel, payload, seq, requestId };
|
|
290
|
+
this.session.sendOneShot(envelope);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
//# sourceMappingURL=ui.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/modules/ui.ts"],"names":[],"mappings":"AAiFA;;;;GAIG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;IACvC,YAAY,OAAe,EAAE,OAAmC;QAC9D,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAA;QAC5B,qEAAqE;QACrE,gEAAgE;QAChE,qEAAqE;QACrE,IAAI,OAAO,EAAE,KAAK,KAAK,SAAS,EAAE,CAAC;YACjC,CAAC;YAAC,IAAkC,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAA;QAC5D,CAAC;IACH,CAAC;CACF;AAED,+DAA+D;AAC/D,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC9C,YAAY,OAAO,GAAG,eAAe;QACnC,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAA;IACrC,CAAC;CACF;AAyFD,SAAS,mBAAmB,CAAC,CAAU;IACrC,IAAI,CAAC,YAAY,KAAK,EAAE,CAAC;QACvB,mEAAmE;QACnE,yEAAyE;QACzE,wEAAwE;QACxE,6BAA6B;QAC7B,MAAM,GAAG,GAAG,CAAiF,CAAA;QAC7F,MAAM,KAA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,CAAA;QAC1B,MAAM,QAAQ,GAAmB,EAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAC,CAAA;QACpF,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;IACpC,CAAC;CACF"}
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Wire protocol for @mentra/miniapp.
|
|
3
|
+
*
|
|
4
|
+
* Fresh miniapp-naming enum values. No legacy tpa_/app_/applet_ prefixes.
|
|
5
|
+
* These values are the contract between @mentra/miniapp (running in a WebView)
|
|
6
|
+
* and LocalMiniappRuntime (running on the phone).
|
|
7
|
+
*
|
|
8
|
+
* IMPORTANT: This file has NO runtime dependency on @mentra/sdk. The cloud SDK's
|
|
9
|
+
* wire protocol enums live in @mentra/sdk/types/message-types.ts and are used
|
|
10
|
+
* for cloud↔app communication, not phone↔miniapp.
|
|
11
|
+
*/
|
|
12
|
+
export declare enum MiniappRequestType {
|
|
13
|
+
/** Handshake: miniapp announces itself and asks phone to bind the session. */
|
|
14
|
+
CONNECT = "miniapp_connect",
|
|
15
|
+
/** Request a fresh miniapp-scoped backend auth token. */
|
|
16
|
+
AUTH_REFRESH = "miniapp_auth_refresh",
|
|
17
|
+
/** Update the set of streams the miniapp is subscribed to. */
|
|
18
|
+
SUBSCRIBE = "miniapp_subscribe",
|
|
19
|
+
/**
|
|
20
|
+
* Push a legacy display layout to the glasses. The SDK no longer emits this
|
|
21
|
+
* (render()/RENDER replaced it); hosts keep accepting it from bundles packed
|
|
22
|
+
* with older SDKs and from cloud-shaped layouts.
|
|
23
|
+
*/
|
|
24
|
+
DISPLAY = "miniapp_display",
|
|
25
|
+
/** Render a whole scene of positioned elements (replace-the-frame). */
|
|
26
|
+
RENDER = "miniapp_render",
|
|
27
|
+
/** Play an arbitrary audio URL through the phone's audio playback service. */
|
|
28
|
+
PLAY_AUDIO = "miniapp_play_audio",
|
|
29
|
+
/** Stop any audio playback this miniapp initiated. */
|
|
30
|
+
STOP_AUDIO = "miniapp_stop_audio",
|
|
31
|
+
/** Speak text via cloud TTS — phone constructs the URL. */
|
|
32
|
+
SPEAK = "miniapp_speak",
|
|
33
|
+
/**
|
|
34
|
+
* Live PCM output stream to the phone's audio playback service
|
|
35
|
+
* (speaker.createStream). OPEN provisions a native chunk player; WRITE
|
|
36
|
+
* appends base64 PCM (replies with {bufferedMs} for backpressure); CLOSE
|
|
37
|
+
* drains and finishes; ABORT drops immediately.
|
|
38
|
+
*/
|
|
39
|
+
SPEAKER_STREAM_OPEN = "miniapp_speaker_stream_open",
|
|
40
|
+
SPEAKER_STREAM_WRITE = "miniapp_speaker_stream_write",
|
|
41
|
+
SPEAKER_STREAM_CLOSE = "miniapp_speaker_stream_close",
|
|
42
|
+
SPEAKER_STREAM_ABORT = "miniapp_speaker_stream_abort",
|
|
43
|
+
/** Control the glasses RGB LED. */
|
|
44
|
+
RGB_LED = "miniapp_rgb_led",
|
|
45
|
+
/** One-shot location poll. */
|
|
46
|
+
LOCATION_POLL = "miniapp_location_poll",
|
|
47
|
+
/** Start a turn-by-turn navigation trip. Android only. */
|
|
48
|
+
NAVIGATION_START = "miniapp_navigation_start",
|
|
49
|
+
/** Stop the active navigation trip (if any). */
|
|
50
|
+
NAVIGATION_STOP = "miniapp_navigation_stop",
|
|
51
|
+
/** Dev-only: nudge the simulator off-route to test rerouting. Android sim only. */
|
|
52
|
+
NAVIGATION_DEVIATE = "miniapp_navigation_deviate",
|
|
53
|
+
/** Dev-only: lock simulated locations to the wrong sidewalk for pivot-trigger testing. */
|
|
54
|
+
NAVIGATION_SET_WRONG_SIDEWALK = "miniapp_navigation_set_wrong_sidewalk",
|
|
55
|
+
/** Dev-only: take over the simulator and walk a polyline with crossings stripped. */
|
|
56
|
+
NAVIGATION_SET_SKIP_CROSSINGS = "miniapp_navigation_set_skip_crossings",
|
|
57
|
+
/** Snapshot of the active trip (or null). Lets a miniapp opening mid-trip hydrate. */
|
|
58
|
+
NAVIGATION_GET_STATE = "miniapp_navigation_get_state",
|
|
59
|
+
/** Compute a route without starting a trip. Replaces hand-rolled Directions calls. */
|
|
60
|
+
NAVIGATION_COMPUTE_ROUTE = "miniapp_navigation_compute_route",
|
|
61
|
+
/** Reverse-geocode a coordinate to a short road name + full formatted
|
|
62
|
+
* address. `road` backs the engine's fallback for pivots whose Routes-API
|
|
63
|
+
* instruction didn't include a parseable road; `address` backs UI labels for
|
|
64
|
+
* dropped pins / POI taps. Resolved in the v2 cloud maps service (Mapbox
|
|
65
|
+
* today) via the host bridge — the miniapp never holds a maps token. */
|
|
66
|
+
NAVIGATION_REVERSE_GEOCODE = "miniapp_navigation_reverse_geocode",
|
|
67
|
+
/** Type-ahead place search (autocomplete). Resolved in the v2 cloud maps
|
|
68
|
+
* service (Mapbox Search Box today) via the host bridge — the miniapp never
|
|
69
|
+
* holds a maps token. Pairs with NAVIGATION_PLACE_DETAILS via a sessionToken. */
|
|
70
|
+
NAVIGATION_PLACE_AUTOCOMPLETE = "miniapp_navigation_place_autocomplete",
|
|
71
|
+
/** Resolve an autocomplete suggestion (placeId + sessionToken) to coordinates,
|
|
72
|
+
* in the v2 cloud maps service via the host bridge. */
|
|
73
|
+
NAVIGATION_PLACE_DETAILS = "miniapp_navigation_place_details",
|
|
74
|
+
/** Trigger the Google Nav SDK T&C dialog up-front so start() doesn't have to. */
|
|
75
|
+
NAVIGATION_REQUEST_PERMISSION = "miniapp_navigation_request_permission",
|
|
76
|
+
/** Phone-local simple storage. */
|
|
77
|
+
STORAGE_GET = "miniapp_storage_get",
|
|
78
|
+
STORAGE_SET = "miniapp_storage_set",
|
|
79
|
+
STORAGE_DELETE = "miniapp_storage_delete",
|
|
80
|
+
STORAGE_LIST = "miniapp_storage_list",
|
|
81
|
+
STORAGE_CLEAR = "miniapp_storage_clear",
|
|
82
|
+
STORAGE_HAS = "miniapp_storage_has",
|
|
83
|
+
STORAGE_GET_ALL = "miniapp_storage_get_all",
|
|
84
|
+
STORAGE_SET_MULTIPLE = "miniapp_storage_set_multiple",
|
|
85
|
+
STORAGE_FLUSH = "miniapp_storage_flush",
|
|
86
|
+
/** Write camera FOV settings. */
|
|
87
|
+
CAMERA_FOV = "miniapp_camera_fov",
|
|
88
|
+
/** Pre-warm the glasses camera so the next takePhoto() is near-instant. */
|
|
89
|
+
CAMERA_WARM_UP = "miniapp_camera_warm_up",
|
|
90
|
+
/**
|
|
91
|
+
* Enable/disable raw accelerometer (IMU) streaming on the glasses. The
|
|
92
|
+
* accel stream also auto-enables on subscribe; this is an explicit override
|
|
93
|
+
* for callers who want to control the sensor directly. G2 only today.
|
|
94
|
+
*/
|
|
95
|
+
IMU_SET_ENABLED = "miniapp_imu_set_enabled",
|
|
96
|
+
/** Share content via the OS share sheet. */
|
|
97
|
+
SHARE = "miniapp_share",
|
|
98
|
+
/** Open a URL in the system browser. */
|
|
99
|
+
OPEN_URL = "miniapp_open_url",
|
|
100
|
+
/** Copy text to the system clipboard. */
|
|
101
|
+
COPY_CLIPBOARD = "miniapp_copy_clipboard",
|
|
102
|
+
/** Download a file (triggers OS share sheet for save location). */
|
|
103
|
+
DOWNLOAD = "miniapp_download",
|
|
104
|
+
/**
|
|
105
|
+
* Phone-local persistent binary blob storage, scoped to (userId, packageName).
|
|
106
|
+
* Unlike STORAGE_* (small string KV in MMKV), blobs are arbitrary bytes written
|
|
107
|
+
* to the phone filesystem. Large payloads are moved in chunks (BLOB_WRITE /
|
|
108
|
+
* BLOB_READ) so a single bridge message never carries a multi-MB string.
|
|
109
|
+
*/
|
|
110
|
+
BLOB_CREATE = "miniapp_blob_create",
|
|
111
|
+
BLOB_WRITE = "miniapp_blob_write",
|
|
112
|
+
BLOB_COMMIT = "miniapp_blob_commit",
|
|
113
|
+
BLOB_ABORT = "miniapp_blob_abort",
|
|
114
|
+
BLOB_GET = "miniapp_blob_get",
|
|
115
|
+
BLOB_LIST = "miniapp_blob_list",
|
|
116
|
+
BLOB_DELETE = "miniapp_blob_delete",
|
|
117
|
+
BLOB_CLEAR = "miniapp_blob_clear",
|
|
118
|
+
BLOB_USAGE = "miniapp_blob_usage",
|
|
119
|
+
BLOB_OPEN_READ = "miniapp_blob_open_read",
|
|
120
|
+
BLOB_READ = "miniapp_blob_read",
|
|
121
|
+
BLOB_CLOSE_READ = "miniapp_blob_close_read",
|
|
122
|
+
/** Download a URL straight into a blob, host-side (no bytes cross the bridge). */
|
|
123
|
+
BLOB_SET_FROM_URL = "miniapp_blob_set_from_url",
|
|
124
|
+
/** Open the OS file picker and import the chosen file into a blob, host-side. */
|
|
125
|
+
BLOB_IMPORT = "miniapp_blob_import",
|
|
126
|
+
/** Share a stored blob from disk via the OS share sheet (no bytes cross the bridge). */
|
|
127
|
+
BLOB_SHARE = "miniapp_blob_share",
|
|
128
|
+
/** Phone → miniapp liveness probe. Miniapp SDK auto-replies with PONG. */
|
|
129
|
+
PING = "miniapp_ping",
|
|
130
|
+
/**
|
|
131
|
+
* Apply transcription configuration (language hints, vocabulary, diarization).
|
|
132
|
+
* Phone forwards to the cloud STT layer. Fire-and-forget; cached client-side
|
|
133
|
+
* so future reconnect logic can re-send.
|
|
134
|
+
*/
|
|
135
|
+
TRANSCRIPTION_CONFIG = "miniapp_transcription_config",
|
|
136
|
+
/** Dashboard content update. Noop in v1. */
|
|
137
|
+
DASHBOARD_CONTENT_UPDATE = "miniapp_dashboard_content_update",
|
|
138
|
+
PHOTO = "miniapp_photo",
|
|
139
|
+
VIDEO_RECORDING_START = "miniapp_video_recording_start",
|
|
140
|
+
VIDEO_RECORDING_STOP = "miniapp_video_recording_stop",
|
|
141
|
+
STREAM_START = "miniapp_stream_start",
|
|
142
|
+
STREAM_STOP = "miniapp_stream_stop",
|
|
143
|
+
MANAGED_STREAM_START = "miniapp_managed_stream_start",
|
|
144
|
+
MANAGED_STREAM_STOP = "miniapp_managed_stream_stop",
|
|
145
|
+
/** Ask the host to open the glasses Wi-Fi setup flow (mirrors the cloud SDK's requestWifiSetup). */
|
|
146
|
+
REQUEST_WIFI_SETUP = "miniapp_request_wifi_setup",
|
|
147
|
+
/** List installed miniapps (compatibility-filtered, with declared actions). */
|
|
148
|
+
MINIAPPS_LIST = "miniapp_apps_list",
|
|
149
|
+
/** Start another miniapp (user-tap semantics). */
|
|
150
|
+
MINIAPPS_START = "miniapp_apps_start",
|
|
151
|
+
/** Stop another miniapp. */
|
|
152
|
+
MINIAPPS_STOP = "miniapp_apps_stop",
|
|
153
|
+
/** Invoke a declared action on another miniapp; headless-wakes it if stopped. */
|
|
154
|
+
ACTION_INVOKE = "miniapp_action_invoke",
|
|
155
|
+
/** Target → host: the result of a delivered ACTION_CALL, correlated by callId. */
|
|
156
|
+
ACTION_RESULT = "miniapp_action_result"
|
|
157
|
+
}
|
|
158
|
+
export declare enum MiniappResponseType {
|
|
159
|
+
/** Response to CONNECT carrying userId, packageName, capabilities. */
|
|
160
|
+
CONNECT_ACK = "miniapp_connect_ack",
|
|
161
|
+
/** Push: a streamed event for a subscribed stream. */
|
|
162
|
+
EVENT = "miniapp_event",
|
|
163
|
+
/** Response to any request that needs a result (matched by requestId). */
|
|
164
|
+
REQUEST_RESULT = "miniapp_request_result",
|
|
165
|
+
/** Push: glasses capabilities changed. */
|
|
166
|
+
CAPABILITIES_UPDATE = "miniapp_capabilities_update",
|
|
167
|
+
/** Push: miniapp's foreground/background state changed. */
|
|
168
|
+
VISIBILITY_CHANGE = "miniapp_visibility_change",
|
|
169
|
+
/** Push: host color scheme (light/dark) changed. */
|
|
170
|
+
COLOR_SCHEME_CHANGE = "miniapp_color_scheme_change",
|
|
171
|
+
/**
|
|
172
|
+
* Push: speaker playback state transitioned. Per-miniapp; the runtime sends
|
|
173
|
+
* to the owning miniapp only. Carries {state, errorCode?, errorMessage?,
|
|
174
|
+
* durationMs?}. See SpeakerModule.onStateChange().
|
|
175
|
+
*/
|
|
176
|
+
SPEAKER_STATE = "miniapp_speaker_state",
|
|
177
|
+
/**
|
|
178
|
+
* Push: manifest-declared permissions changed (e.g. dev miniapp re-scanned
|
|
179
|
+
* with updated manifest). Carries a full PermissionRecord. SDK caches it
|
|
180
|
+
* and fires session.permissions.onUpdate handlers.
|
|
181
|
+
*/
|
|
182
|
+
PERMISSIONS_UPDATE = "miniapp_permissions_update",
|
|
183
|
+
/**
|
|
184
|
+
* Push: miniapp-scoped backend auth token changed. Carries a token minted for
|
|
185
|
+
* this packageName only; it is never a Core or runtime access token.
|
|
186
|
+
*/
|
|
187
|
+
AUTH_UPDATE = "miniapp_auth_update",
|
|
188
|
+
/** Reply to PING. SDK auto-handles this; developers never see it. */
|
|
189
|
+
PONG = "miniapp_pong",
|
|
190
|
+
/**
|
|
191
|
+
* Host → target: deliver an action call (from another miniapp's
|
|
192
|
+
* session.actions.invoke) to this miniapp's session.actions.handle handler.
|
|
193
|
+
* Carries {callId, actionId, params, callerPackageName}. The SDK runs the
|
|
194
|
+
* handler and replies with an ACTION_RESULT request keyed by callId.
|
|
195
|
+
*/
|
|
196
|
+
ACTION_CALL = "miniapp_action_call",
|
|
197
|
+
/**
|
|
198
|
+
* Push: phone is about to tear down the miniapp's session. Gives the SDK
|
|
199
|
+
* a brief window (~50ms grace on the phone side) to fire one last
|
|
200
|
+
* `sendOneShot` before the transport closes — used to flush final
|
|
201
|
+
* cleanup like `display.render([])`. Synchronous handlers only.
|
|
202
|
+
*/
|
|
203
|
+
WILL_DISCONNECT = "miniapp_will_disconnect",
|
|
204
|
+
/** Async error not tied to a specific request. */
|
|
205
|
+
ERROR = "miniapp_error"
|
|
206
|
+
}
|
|
207
|
+
export declare enum MiniappStreamType {
|
|
208
|
+
BUTTON_PRESS = "button_press",
|
|
209
|
+
TOUCH_EVENT = "touch_event",
|
|
210
|
+
HEAD_POSITION = "head_position",
|
|
211
|
+
/**
|
|
212
|
+
* Raw accelerometer reading from the glasses IMU — `{x, y, z}` in g, plus a
|
|
213
|
+
* timestamp. G2 only today. A richer combined IMU stream (accel + gyro +
|
|
214
|
+
* magnetometer) is future work; this is the single-sensor precursor.
|
|
215
|
+
*/
|
|
216
|
+
ACCEL_DATA = "accel_data",
|
|
217
|
+
GLASSES_BATTERY = "glasses_battery",
|
|
218
|
+
PHONE_BATTERY = "phone_battery",
|
|
219
|
+
GLASSES_CONNECTION = "glasses_connection",
|
|
220
|
+
/** Glasses Wi-Fi state (connected/ssid). Glasses with Wi-Fi only; needed for streaming. */
|
|
221
|
+
GLASSES_WIFI = "glasses_wifi",
|
|
222
|
+
TRANSCRIPTION = "transcription",// language variant: "transcription:en-US"
|
|
223
|
+
TRANSLATION = "translation",// language variant: "translation:en-US"
|
|
224
|
+
AUDIO_CHUNK = "audio_chunk",
|
|
225
|
+
VAD = "vad",
|
|
226
|
+
LOCATION_UPDATE = "location_update",
|
|
227
|
+
/** Compass heading in degrees (0=N, 90=E). Android only. */
|
|
228
|
+
HEADING_UPDATE = "heading_update",
|
|
229
|
+
/** Turn-by-turn navigation event (maneuver / rerouting / arrived / error). */
|
|
230
|
+
NAVIGATION_UPDATE = "navigation_update",
|
|
231
|
+
/** Active navigation route polyline — full path, fired once per route build. */
|
|
232
|
+
NAVIGATION_ROUTE = "navigation_route",
|
|
233
|
+
PHONE_NOTIFICATION = "phone_notification",
|
|
234
|
+
/**
|
|
235
|
+
* A previously-posted notification was dismissed by the user.
|
|
236
|
+
*
|
|
237
|
+
* Android-only today. iOS does not expose dismiss callbacks to apps
|
|
238
|
+
* (Apple privacy restriction); subscribing on iOS succeeds but no events
|
|
239
|
+
* fire. See agents/miniapp-speaker-state-and-notif-dismissed-plan.md.
|
|
240
|
+
*/
|
|
241
|
+
PHONE_NOTIFICATION_DISMISSED = "phone_notification_dismissed",
|
|
242
|
+
CALENDAR_EVENT = "calendar_event",
|
|
243
|
+
PHOTO_TAKEN = "photo_taken",
|
|
244
|
+
STREAM_STATUS = "stream_status"
|
|
245
|
+
}
|
|
246
|
+
export declare enum MiniappErrorCode {
|
|
247
|
+
/** Request arguments failed host-side validation. */
|
|
248
|
+
INVALID_ARGUMENT = "INVALID_ARGUMENT",
|
|
249
|
+
/** The miniapp subscribed to a stream whose required permission wasn't in its manifest. */
|
|
250
|
+
PERMISSION_NOT_DECLARED = "PERMISSION_NOT_DECLARED",
|
|
251
|
+
/** Request routed to a method that isn't supported yet. */
|
|
252
|
+
NOT_IMPLEMENTED = "NOT_IMPLEMENTED",
|
|
253
|
+
/** Request timed out or the session was torn down before it could complete. */
|
|
254
|
+
REQUEST_ABORTED = "REQUEST_ABORTED",
|
|
255
|
+
/** Phone-side code path threw. Check `message`. */
|
|
256
|
+
INTERNAL = "INTERNAL",
|
|
257
|
+
/** Cloud TTS returned a non-2xx for a SPEAK request. */
|
|
258
|
+
TTS_TEXT_TOO_LONG = "TTS_TEXT_TOO_LONG",
|
|
259
|
+
TTS_INVALID_VOICE = "TTS_INVALID_VOICE",
|
|
260
|
+
TTS_UPSTREAM_ERROR = "TTS_UPSTREAM_ERROR",
|
|
261
|
+
/** Not connected / pre-ACK and transport closed. */
|
|
262
|
+
NOT_CONNECTED = "NOT_CONNECTED",
|
|
263
|
+
/** Caller is not a system app — interop APIs (list/start/stop/invoke) are SYSTEM-only. */
|
|
264
|
+
NOT_PERMITTED = "NOT_PERMITTED",
|
|
265
|
+
/** Target miniapp is not installed. */
|
|
266
|
+
APP_NOT_FOUND = "APP_NOT_FOUND",
|
|
267
|
+
/** Target miniapp is incompatible with the connected glasses. */
|
|
268
|
+
APP_NOT_COMPATIBLE = "APP_NOT_COMPATIBLE",
|
|
269
|
+
/** Target miniapp does not declare the requested action. */
|
|
270
|
+
ACTION_NOT_FOUND = "ACTION_NOT_FOUND",
|
|
271
|
+
/** Target connected but never registered a handler for the action (within the buffer window). */
|
|
272
|
+
NO_ACTION_HANDLER = "NO_ACTION_HANDLER",
|
|
273
|
+
/** Target failed to wake / complete its CONNECT handshake for an invoke. */
|
|
274
|
+
WAKE_FAILED = "WAKE_FAILED",
|
|
275
|
+
/** Action handler did not return within the caller's timeout. */
|
|
276
|
+
ACTION_TIMEOUT = "ACTION_TIMEOUT",
|
|
277
|
+
/** Action params or result exceeded the 256 KB size cap. */
|
|
278
|
+
PAYLOAD_TOO_LARGE = "PAYLOAD_TOO_LARGE",
|
|
279
|
+
/** No blob with the given id in this miniapp's namespace. */
|
|
280
|
+
BLOB_NOT_FOUND = "BLOB_NOT_FOUND",
|
|
281
|
+
/** Writing this blob would exceed the per-app blob quota. */
|
|
282
|
+
BLOB_QUOTA_EXCEEDED = "BLOB_QUOTA_EXCEEDED",
|
|
283
|
+
/** Blob is larger than the requested in-memory read can hold. */
|
|
284
|
+
BLOB_TOO_LARGE = "BLOB_TOO_LARGE",
|
|
285
|
+
/** Write/read handle is unknown, already settled, or belongs to another app. */
|
|
286
|
+
BLOB_HANDLE_INVALID = "BLOB_HANDLE_INVALID",
|
|
287
|
+
/** Filesystem write failed (out of disk, permissions, etc.). */
|
|
288
|
+
BLOB_WRITE_FAILED = "BLOB_WRITE_FAILED",
|
|
289
|
+
/** `blob.setFromUrl` could not download the URL (network / non-2xx). */
|
|
290
|
+
BLOB_DOWNLOAD_FAILED = "BLOB_DOWNLOAD_FAILED",
|
|
291
|
+
/** `blob.importFile` failed (not the user cancelling — that resolves to null). */
|
|
292
|
+
BLOB_IMPORT_FAILED = "BLOB_IMPORT_FAILED"
|
|
293
|
+
}
|
|
294
|
+
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -0,0 +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,8EAA8E;IAC9E,UAAU,uBAAuB;IAEjC,sDAAsD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