@glassly/miniapp 0.1.0-dev.26

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.
Files changed (312) hide show
  1. package/README.md +275 -0
  2. package/dist/background/index.d.ts +64 -0
  3. package/dist/background/index.d.ts.map +1 -0
  4. package/dist/background/index.js +26 -0
  5. package/dist/background/index.js.map +1 -0
  6. package/dist/background/register.d.ts +39 -0
  7. package/dist/background/register.d.ts.map +1 -0
  8. package/dist/background/register.js +72 -0
  9. package/dist/background/register.js.map +1 -0
  10. package/dist/dev-reload.d.ts +21 -0
  11. package/dist/dev-reload.d.ts.map +1 -0
  12. package/dist/dev-reload.js +60 -0
  13. package/dist/dev-reload.js.map +1 -0
  14. package/dist/envelope.d.ts +23 -0
  15. package/dist/envelope.d.ts.map +1 -0
  16. package/dist/envelope.js +47 -0
  17. package/dist/envelope.js.map +1 -0
  18. package/dist/globals.d.ts +54 -0
  19. package/dist/globals.d.ts.map +1 -0
  20. package/dist/globals.js +12 -0
  21. package/dist/globals.js.map +1 -0
  22. package/dist/hardware.d.ts +24 -0
  23. package/dist/hardware.d.ts.map +1 -0
  24. package/dist/hardware.js +20 -0
  25. package/dist/hardware.js.map +1 -0
  26. package/dist/index.d.ts +65 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +34 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/modules/actions.d.ts +81 -0
  31. package/dist/modules/actions.d.ts.map +1 -0
  32. package/dist/modules/actions.js +137 -0
  33. package/dist/modules/actions.js.map +1 -0
  34. package/dist/modules/ai.d.ts +211 -0
  35. package/dist/modules/ai.d.ts.map +1 -0
  36. package/dist/modules/ai.js +117 -0
  37. package/dist/modules/ai.js.map +1 -0
  38. package/dist/modules/auth.d.ts +25 -0
  39. package/dist/modules/auth.d.ts.map +1 -0
  40. package/dist/modules/auth.js +52 -0
  41. package/dist/modules/auth.js.map +1 -0
  42. package/dist/modules/base64.d.ts +16 -0
  43. package/dist/modules/base64.d.ts.map +1 -0
  44. package/dist/modules/base64.js +92 -0
  45. package/dist/modules/base64.js.map +1 -0
  46. package/dist/modules/blob.d.ts +161 -0
  47. package/dist/modules/blob.d.ts.map +1 -0
  48. package/dist/modules/blob.js +277 -0
  49. package/dist/modules/blob.js.map +1 -0
  50. package/dist/modules/camera.d.ts +183 -0
  51. package/dist/modules/camera.d.ts.map +1 -0
  52. package/dist/modules/camera.js +119 -0
  53. package/dist/modules/camera.js.map +1 -0
  54. package/dist/modules/cloud.d.ts +34 -0
  55. package/dist/modules/cloud.d.ts.map +1 -0
  56. package/dist/modules/cloud.js +70 -0
  57. package/dist/modules/cloud.js.map +1 -0
  58. package/dist/modules/dashboard.d.ts +24 -0
  59. package/dist/modules/dashboard.d.ts.map +1 -0
  60. package/dist/modules/dashboard.js +39 -0
  61. package/dist/modules/dashboard.js.map +1 -0
  62. package/dist/modules/display.d.ts +174 -0
  63. package/dist/modules/display.d.ts.map +1 -0
  64. package/dist/modules/display.js +83 -0
  65. package/dist/modules/display.js.map +1 -0
  66. package/dist/modules/events.d.ts +178 -0
  67. package/dist/modules/events.d.ts.map +1 -0
  68. package/dist/modules/events.js +168 -0
  69. package/dist/modules/events.js.map +1 -0
  70. package/dist/modules/glasses.d.ts +36 -0
  71. package/dist/modules/glasses.d.ts.map +1 -0
  72. package/dist/modules/glasses.js +52 -0
  73. package/dist/modules/glasses.js.map +1 -0
  74. package/dist/modules/heading.d.ts +16 -0
  75. package/dist/modules/heading.d.ts.map +1 -0
  76. package/dist/modules/heading.js +20 -0
  77. package/dist/modules/heading.js.map +1 -0
  78. package/dist/modules/imu.d.ts +31 -0
  79. package/dist/modules/imu.d.ts.map +1 -0
  80. package/dist/modules/imu.js +40 -0
  81. package/dist/modules/imu.js.map +1 -0
  82. package/dist/modules/input.d.ts +50 -0
  83. package/dist/modules/input.d.ts.map +1 -0
  84. package/dist/modules/input.js +70 -0
  85. package/dist/modules/input.js.map +1 -0
  86. package/dist/modules/keys.d.ts +30 -0
  87. package/dist/modules/keys.d.ts.map +1 -0
  88. package/dist/modules/keys.js +37 -0
  89. package/dist/modules/keys.js.map +1 -0
  90. package/dist/modules/languages.d.ts +42 -0
  91. package/dist/modules/languages.d.ts.map +1 -0
  92. package/dist/modules/languages.js +57 -0
  93. package/dist/modules/languages.js.map +1 -0
  94. package/dist/modules/led.d.ts +35 -0
  95. package/dist/modules/led.d.ts.map +1 -0
  96. package/dist/modules/led.js +39 -0
  97. package/dist/modules/led.js.map +1 -0
  98. package/dist/modules/location.d.ts +27 -0
  99. package/dist/modules/location.d.ts.map +1 -0
  100. package/dist/modules/location.js +35 -0
  101. package/dist/modules/location.js.map +1 -0
  102. package/dist/modules/memory.d.ts +126 -0
  103. package/dist/modules/memory.d.ts.map +1 -0
  104. package/dist/modules/memory.js +141 -0
  105. package/dist/modules/memory.js.map +1 -0
  106. package/dist/modules/mic.d.ts +61 -0
  107. package/dist/modules/mic.d.ts.map +1 -0
  108. package/dist/modules/mic.js +94 -0
  109. package/dist/modules/mic.js.map +1 -0
  110. package/dist/modules/miniapps.d.ts +82 -0
  111. package/dist/modules/miniapps.d.ts.map +1 -0
  112. package/dist/modules/miniapps.js +58 -0
  113. package/dist/modules/miniapps.js.map +1 -0
  114. package/dist/modules/navigation.d.ts +332 -0
  115. package/dist/modules/navigation.d.ts.map +1 -0
  116. package/dist/modules/navigation.js +387 -0
  117. package/dist/modules/navigation.js.map +1 -0
  118. package/dist/modules/permissions.d.ts +58 -0
  119. package/dist/modules/permissions.d.ts.map +1 -0
  120. package/dist/modules/permissions.js +66 -0
  121. package/dist/modules/permissions.js.map +1 -0
  122. package/dist/modules/phone.d.ts +95 -0
  123. package/dist/modules/phone.d.ts.map +1 -0
  124. package/dist/modules/phone.js +110 -0
  125. package/dist/modules/phone.js.map +1 -0
  126. package/dist/modules/pivots/engine.d.ts +169 -0
  127. package/dist/modules/pivots/engine.d.ts.map +1 -0
  128. package/dist/modules/pivots/engine.js +778 -0
  129. package/dist/modules/pivots/engine.js.map +1 -0
  130. package/dist/modules/pivots/geometry.d.ts +84 -0
  131. package/dist/modules/pivots/geometry.d.ts.map +1 -0
  132. package/dist/modules/pivots/geometry.js +371 -0
  133. package/dist/modules/pivots/geometry.js.map +1 -0
  134. package/dist/modules/pivots/instructions.d.ts +139 -0
  135. package/dist/modules/pivots/instructions.d.ts.map +1 -0
  136. package/dist/modules/pivots/instructions.js +281 -0
  137. package/dist/modules/pivots/instructions.js.map +1 -0
  138. package/dist/modules/speaker.d.ts +175 -0
  139. package/dist/modules/speaker.d.ts.map +1 -0
  140. package/dist/modules/speaker.js +249 -0
  141. package/dist/modules/speaker.js.map +1 -0
  142. package/dist/modules/speakers.d.ts +29 -0
  143. package/dist/modules/speakers.d.ts.map +1 -0
  144. package/dist/modules/speakers.js +38 -0
  145. package/dist/modules/speakers.js.map +1 -0
  146. package/dist/modules/storage.d.ts +50 -0
  147. package/dist/modules/storage.d.ts.map +1 -0
  148. package/dist/modules/storage.js +99 -0
  149. package/dist/modules/storage.js.map +1 -0
  150. package/dist/modules/stream.d.ts +133 -0
  151. package/dist/modules/stream.d.ts.map +1 -0
  152. package/dist/modules/stream.js +53 -0
  153. package/dist/modules/stream.js.map +1 -0
  154. package/dist/modules/system.d.ts +71 -0
  155. package/dist/modules/system.d.ts.map +1 -0
  156. package/dist/modules/system.js +65 -0
  157. package/dist/modules/system.js.map +1 -0
  158. package/dist/modules/transcription.d.ts +99 -0
  159. package/dist/modules/transcription.d.ts.map +1 -0
  160. package/dist/modules/transcription.js +126 -0
  161. package/dist/modules/transcription.js.map +1 -0
  162. package/dist/modules/translation.d.ts +65 -0
  163. package/dist/modules/translation.d.ts.map +1 -0
  164. package/dist/modules/translation.js +121 -0
  165. package/dist/modules/translation.js.map +1 -0
  166. package/dist/modules/ui.d.ts +186 -0
  167. package/dist/modules/ui.d.ts.map +1 -0
  168. package/dist/modules/ui.js +289 -0
  169. package/dist/modules/ui.js.map +1 -0
  170. package/dist/protocol.d.ts +390 -0
  171. package/dist/protocol.d.ts.map +1 -0
  172. package/dist/protocol.js +419 -0
  173. package/dist/protocol.js.map +1 -0
  174. package/dist/react/MiniappHeader.d.ts +44 -0
  175. package/dist/react/MiniappHeader.d.ts.map +1 -0
  176. package/dist/react/MiniappHeader.js +32 -0
  177. package/dist/react/MiniappHeader.js.map +1 -0
  178. package/dist/react/MiniappProvider.d.ts +33 -0
  179. package/dist/react/MiniappProvider.d.ts.map +1 -0
  180. package/dist/react/MiniappProvider.js +15 -0
  181. package/dist/react/MiniappProvider.js.map +1 -0
  182. package/dist/react/capsuleHeaderLayout.d.ts +3 -0
  183. package/dist/react/capsuleHeaderLayout.d.ts.map +1 -0
  184. package/dist/react/capsuleHeaderLayout.js +5 -0
  185. package/dist/react/capsuleHeaderLayout.js.map +1 -0
  186. package/dist/react/index.d.ts +13 -0
  187. package/dist/react/index.d.ts.map +1 -0
  188. package/dist/react/index.js +9 -0
  189. package/dist/react/index.js.map +1 -0
  190. package/dist/react/useCapabilities.d.ts +26 -0
  191. package/dist/react/useCapabilities.d.ts.map +1 -0
  192. package/dist/react/useCapabilities.js +27 -0
  193. package/dist/react/useCapabilities.js.map +1 -0
  194. package/dist/react/useCapsuleHeaderStyle.d.ts +27 -0
  195. package/dist/react/useCapsuleHeaderStyle.d.ts.map +1 -0
  196. package/dist/react/useCapsuleHeaderStyle.js +39 -0
  197. package/dist/react/useCapsuleHeaderStyle.js.map +1 -0
  198. package/dist/react/useColorScheme.d.ts +18 -0
  199. package/dist/react/useColorScheme.d.ts.map +1 -0
  200. package/dist/react/useColorScheme.js +24 -0
  201. package/dist/react/useColorScheme.js.map +1 -0
  202. package/dist/react/useConnected.d.ts +17 -0
  203. package/dist/react/useConnected.d.ts.map +1 -0
  204. package/dist/react/useConnected.js +39 -0
  205. package/dist/react/useConnected.js.map +1 -0
  206. package/dist/react/useRpc.d.ts +29 -0
  207. package/dist/react/useRpc.d.ts.map +1 -0
  208. package/dist/react/useRpc.js +82 -0
  209. package/dist/react/useRpc.js.map +1 -0
  210. package/dist/react/useSafeArea.d.ts +21 -0
  211. package/dist/react/useSafeArea.d.ts.map +1 -0
  212. package/dist/react/useSafeArea.js +22 -0
  213. package/dist/react/useSafeArea.js.map +1 -0
  214. package/dist/session.d.ts +355 -0
  215. package/dist/session.d.ts.map +1 -0
  216. package/dist/session.js +688 -0
  217. package/dist/session.js.map +1 -0
  218. package/dist/sub-path-types.test-d.d.ts +40 -0
  219. package/dist/sub-path-types.test-d.d.ts.map +1 -0
  220. package/dist/sub-path-types.test-d.js +37 -0
  221. package/dist/sub-path-types.test-d.js.map +1 -0
  222. package/dist/transport/auto.d.ts +35 -0
  223. package/dist/transport/auto.d.ts.map +1 -0
  224. package/dist/transport/auto.js +124 -0
  225. package/dist/transport/auto.js.map +1 -0
  226. package/dist/transport/dispatch.d.ts +43 -0
  227. package/dist/transport/dispatch.d.ts.map +1 -0
  228. package/dist/transport/dispatch.js +91 -0
  229. package/dist/transport/dispatch.js.map +1 -0
  230. package/dist/transport/local-socket.d.ts +28 -0
  231. package/dist/transport/local-socket.d.ts.map +1 -0
  232. package/dist/transport/local-socket.js +80 -0
  233. package/dist/transport/local-socket.js.map +1 -0
  234. package/dist/transport/mock.d.ts +54 -0
  235. package/dist/transport/mock.d.ts.map +1 -0
  236. package/dist/transport/mock.js +210 -0
  237. package/dist/transport/mock.js.map +1 -0
  238. package/dist/transport/postmessage.d.ts +36 -0
  239. package/dist/transport/postmessage.d.ts.map +1 -0
  240. package/dist/transport/postmessage.js +78 -0
  241. package/dist/transport/postmessage.js.map +1 -0
  242. package/dist/transport/types.d.ts +25 -0
  243. package/dist/transport/types.d.ts.map +1 -0
  244. package/dist/transport/types.js +11 -0
  245. package/dist/transport/types.js.map +1 -0
  246. package/dist/ui/index.d.ts +107 -0
  247. package/dist/ui/index.d.ts.map +1 -0
  248. package/dist/ui/index.js +32 -0
  249. package/dist/ui/index.js.map +1 -0
  250. package/package.json +88 -0
  251. package/src/background/index.ts +177 -0
  252. package/src/background/register.ts +89 -0
  253. package/src/dev-reload.ts +59 -0
  254. package/src/envelope.ts +54 -0
  255. package/src/globals.ts +62 -0
  256. package/src/hardware.ts +25 -0
  257. package/src/index.ts +216 -0
  258. package/src/modules/actions.ts +189 -0
  259. package/src/modules/ai.ts +281 -0
  260. package/src/modules/auth.ts +68 -0
  261. package/src/modules/base64.ts +87 -0
  262. package/src/modules/blob.ts +341 -0
  263. package/src/modules/camera.ts +258 -0
  264. package/src/modules/cloud.ts +94 -0
  265. package/src/modules/dashboard.ts +51 -0
  266. package/src/modules/display.ts +214 -0
  267. package/src/modules/events.ts +318 -0
  268. package/src/modules/glasses.ts +58 -0
  269. package/src/modules/heading.ts +23 -0
  270. package/src/modules/imu.ts +44 -0
  271. package/src/modules/input.ts +87 -0
  272. package/src/modules/keys.ts +46 -0
  273. package/src/modules/languages.ts +72 -0
  274. package/src/modules/led.ts +61 -0
  275. package/src/modules/location.ts +39 -0
  276. package/src/modules/memory.ts +224 -0
  277. package/src/modules/mic.ts +103 -0
  278. package/src/modules/miniapps.ts +103 -0
  279. package/src/modules/navigation.ts +674 -0
  280. package/src/modules/permissions.ts +83 -0
  281. package/src/modules/phone.ts +155 -0
  282. package/src/modules/pivots/engine.ts +863 -0
  283. package/src/modules/pivots/geometry.ts +409 -0
  284. package/src/modules/pivots/instructions.ts +341 -0
  285. package/src/modules/speaker.ts +347 -0
  286. package/src/modules/speakers.ts +40 -0
  287. package/src/modules/storage.ts +109 -0
  288. package/src/modules/stream.ts +168 -0
  289. package/src/modules/system.ts +113 -0
  290. package/src/modules/transcription.ts +180 -0
  291. package/src/modules/translation.ts +156 -0
  292. package/src/modules/ui.ts +481 -0
  293. package/src/protocol.ts +482 -0
  294. package/src/react/MiniappHeader.tsx +114 -0
  295. package/src/react/MiniappProvider.tsx +50 -0
  296. package/src/react/capsuleHeaderLayout.ts +11 -0
  297. package/src/react/index.ts +12 -0
  298. package/src/react/useCapabilities.ts +29 -0
  299. package/src/react/useCapsuleHeaderStyle.ts +55 -0
  300. package/src/react/useColorScheme.ts +26 -0
  301. package/src/react/useConnected.ts +47 -0
  302. package/src/react/useRpc.ts +103 -0
  303. package/src/react/useSafeArea.ts +36 -0
  304. package/src/session.ts +969 -0
  305. package/src/sub-path-types.test-d.ts +60 -0
  306. package/src/transport/auto.ts +143 -0
  307. package/src/transport/dispatch.ts +106 -0
  308. package/src/transport/local-socket.ts +91 -0
  309. package/src/transport/mock.ts +255 -0
  310. package/src/transport/postmessage.ts +95 -0
  311. package/src/transport/types.ts +26 -0
  312. package/src/ui/index.ts +129 -0
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @fileoverview Bridge envelope format.
3
+ *
4
+ * Every message between @glassly/miniapp and LocalMiniappRuntime is wrapped in
5
+ * this envelope for request/response correlation.
6
+ *
7
+ * { payload: {...}, requestId?: string }
8
+ */
9
+ export interface MiniappEnvelope<P = unknown> {
10
+ payload: P;
11
+ /** Correlates request/response pairs. Set by the sender when it wants a reply. */
12
+ requestId?: string;
13
+ }
14
+ /** Serialize an envelope for postMessage / WebSocket transport. */
15
+ export declare function serializeEnvelope(envelope: MiniappEnvelope): string;
16
+ /**
17
+ * Parse a serialized envelope. Returns null for any malformed input — never throws.
18
+ * Transports should pass raw strings in and silently drop nulls.
19
+ */
20
+ export declare function parseEnvelope(raw: unknown): MiniappEnvelope | null;
21
+ /** Generate a short random requestId. Browser-native (crypto.randomUUID). */
22
+ export declare function makeRequestId(): string;
23
+ //# sourceMappingURL=envelope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../src/envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,OAAO;IAC1C,OAAO,EAAE,CAAC,CAAA;IACV,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,mEAAmE;AACnE,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAEnE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,eAAe,GAAG,IAAI,CAoBlE;AAED,6EAA6E;AAC7E,wBAAgB,aAAa,IAAI,MAAM,CAMtC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @fileoverview Bridge envelope format.
3
+ *
4
+ * Every message between @glassly/miniapp and LocalMiniappRuntime is wrapped in
5
+ * this envelope for request/response correlation.
6
+ *
7
+ * { payload: {...}, requestId?: string }
8
+ */
9
+ /** Serialize an envelope for postMessage / WebSocket transport. */
10
+ export function serializeEnvelope(envelope) {
11
+ return JSON.stringify(envelope);
12
+ }
13
+ /**
14
+ * Parse a serialized envelope. Returns null for any malformed input — never throws.
15
+ * Transports should pass raw strings in and silently drop nulls.
16
+ */
17
+ export function parseEnvelope(raw) {
18
+ if (typeof raw !== "string")
19
+ return null;
20
+ let parsed;
21
+ try {
22
+ parsed = JSON.parse(raw);
23
+ }
24
+ catch {
25
+ return null;
26
+ }
27
+ if (typeof parsed !== "object" || parsed === null)
28
+ return null;
29
+ const obj = parsed;
30
+ if (typeof obj.payload !== "object" || obj.payload === null)
31
+ return null;
32
+ if (obj.requestId !== undefined && typeof obj.requestId !== "string")
33
+ return null;
34
+ return {
35
+ payload: obj.payload,
36
+ requestId: obj.requestId,
37
+ };
38
+ }
39
+ /** Generate a short random requestId. Browser-native (crypto.randomUUID). */
40
+ export function makeRequestId() {
41
+ if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
42
+ return crypto.randomUUID();
43
+ }
44
+ // Fallback for older engines: timestamp + random suffix. Not cryptographically secure.
45
+ return `req_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
46
+ }
47
+ //# sourceMappingURL=envelope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"envelope.js","sourceRoot":"","sources":["../src/envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH,mEAAmE;AACnE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"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * @fileoverview Shape of window.Glassly, injected by the host Glassly app
3
+ * before the miniapp's content loads. Miniapp authors generally won't read
4
+ * this directly — use the typed React hooks (useSafeArea, etc.) instead.
5
+ */
6
+ export interface MiniappSafeAreaInsets {
7
+ top: number;
8
+ bottom: number;
9
+ left: number;
10
+ right: number;
11
+ }
12
+ export interface MiniappCapsuleMenuRect {
13
+ top: number;
14
+ right: number;
15
+ bottom: number;
16
+ left: number;
17
+ width: number;
18
+ height: number;
19
+ }
20
+ export type MiniappColorScheme = "light" | "dark";
21
+ export interface GlasslyGlobals {
22
+ /** Package id the host assigned to this miniapp (e.g. "com.glassly.example"). */
23
+ packageName?: string;
24
+ /** "ios" | "android" | other. */
25
+ platform?: string;
26
+ /** Capabilities the host exposes to this miniapp (e.g. ["share", "open_url"]). */
27
+ capabilities?: string[];
28
+ /** True when this miniapp is running locally on-device (vs. hosted in the cloud). */
29
+ miniappLocal?: boolean;
30
+ /** True when the miniapp is running via the dev workflow (QR sideload). */
31
+ miniappDeveloperMode?: boolean;
32
+ /** Safe-area insets around the WebView content. Miniapps should pad accordingly. */
33
+ safeAreaInsets?: MiniappSafeAreaInsets;
34
+ /**
35
+ * Bounding rect (in CSS pixels) of the floating capsule menu the host draws
36
+ * over the WebView. The menu lives in the top-right and miniapps should
37
+ * avoid placing interactive elements beneath it.
38
+ */
39
+ capsuleMenu?: MiniappCapsuleMenuRect;
40
+ /**
41
+ * The host's current color scheme. Miniapps can follow this to match the
42
+ * phone's appearance. Updates at runtime arrive via the session's
43
+ * `colorScheme` event — see `useColorScheme()` in @glassly/miniapp/react.
44
+ */
45
+ colorScheme?: MiniappColorScheme;
46
+ }
47
+ declare global {
48
+ interface Window {
49
+ Glassly?: GlasslyGlobals;
50
+ }
51
+ }
52
+ /** Reads window.Glassly safely — returns an empty object if not set. */
53
+ export declare function getGlasslyGlobals(): GlasslyGlobals;
54
+ //# sourceMappingURL=globals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["../src/globals.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,MAAM,CAAA;AAEjD,MAAM,WAAW,cAAc;IAC7B,iFAAiF;IACjF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,qFAAqF;IACrF,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,2EAA2E;IAC3E,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,oFAAoF;IACpF,cAAc,CAAC,EAAE,qBAAqB,CAAA;IACtC;;;;OAIG;IACH,WAAW,CAAC,EAAE,sBAAsB,CAAA;IACpC;;;;OAIG;IACH,WAAW,CAAC,EAAE,kBAAkB,CAAA;CACjC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,OAAO,CAAC,EAAE,cAAc,CAAA;KACzB;CACF;AAED,wEAAwE;AACxE,wBAAgB,iBAAiB,IAAI,cAAc,CAGlD"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @fileoverview Shape of window.Glassly, injected by the host Glassly app
3
+ * before the miniapp's content loads. Miniapp authors generally won't read
4
+ * this directly — use the typed React hooks (useSafeArea, etc.) instead.
5
+ */
6
+ /** Reads window.Glassly safely — returns an empty object if not set. */
7
+ export function getGlasslyGlobals() {
8
+ if (typeof window === "undefined")
9
+ return {};
10
+ return window.Glassly ?? {};
11
+ }
12
+ //# sourceMappingURL=globals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globals.js","sourceRoot":"","sources":["../src/globals.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAqDH,wEAAwE;AACxE,MAAM,UAAU,iBAAiB;IAC/B,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO,EAAE,CAAA;IAC5C,OAAO,MAAM,CAAC,OAAO,IAAI,EAAE,CAAA;AAC7B,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"}
@@ -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"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * @glassly/miniapp — SDK for building Glassly local miniapps.
3
+ *
4
+ * Public entry point. Consumers do:
5
+ *
6
+ * import {MiniappSession} from "@glassly/miniapp" // background JSContext
7
+ * import {useColorScheme} from "@glassly/miniapp/react" // UI WebView hooks
8
+ * import {MiniappRequestType} from "@glassly/miniapp/protocol"
9
+ */
10
+ export { MiniappSession, NotConnectedError } from "./session";
11
+ export type { AuthUpdatePayload, ConnectAckPayload, DisplayCapabilities, GlassesCapabilities, MiniappAuthState, MiniappRequestError, MiniappSessionOptions, MiniappVisibility, } from "./session";
12
+ export type { AuthFetchOptions, AuthModule } from "./modules/auth";
13
+ export { makeRequestId, parseEnvelope, serializeEnvelope } from "./envelope";
14
+ export type { MiniappEnvelope } from "./envelope";
15
+ export { getGlasslyGlobals } from "./globals";
16
+ export type { GlasslyGlobals, MiniappCapsuleMenuRect, MiniappColorScheme, MiniappSafeAreaInsets } from "./globals";
17
+ export { MiniappErrorCode, MiniappRequestType, MiniappResponseType, MiniappStreamType } from "./protocol";
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";
21
+ export type { CloudClientAudioTransport, CloudClientConnectionStatus, CloudClientStatus } from "./modules/cloud";
22
+ export { HardwareType, HardwareRequirementLevel } from "./hardware";
23
+ export type { HardwareRequirement } from "./hardware";
24
+ export { createTransport } from "./transport/auto";
25
+ export type { CreateTransportOptions } from "./transport/auto";
26
+ export { PostMessageTransport } from "./transport/postmessage";
27
+ export { LocalSocketTransport } from "./transport/local-socket";
28
+ export type { LocalSocketTransportOptions } from "./transport/local-socket";
29
+ export { MockTransport, isMockExplicitlyRequested } from "./transport/mock";
30
+ export type { MockTransportOptions } from "./transport/mock";
31
+ export type { Transport, TransportDisconnectHandler, TransportMessageHandler } from "./transport/types";
32
+ export type { DisplayBreakMode, NativeNavInfo, NativeNavResult, RenderBox, RenderElement, RenderOptions, RenderRectStyle, RenderResult, RenderTextStyle, ViewType, } from "./modules/display";
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";
35
+ export type { PlayAudioOptions, SpeakOptions, SpeakResult, SpeakerState, SpeakerStateEvent, SpeakerStreamOptions, SpeakerStreamSampleRate, SpeakerStreamWriteResult, } from "./modules/speaker";
36
+ export { SpeakerStreamWriter, SPEAKER_STREAM_MAX_BUFFERED_MS, SPEAKER_WRITE_CHUNK_BYTES } from "./modules/speaker";
37
+ export type { CameraFovPreset, CameraFovRequest, CameraFovResult, CameraRoiPosition, PhotoTaken, SetCameraFovOptions, StartVideoRecordingOptions, StopVideoRecordingOptions, TakePhotoOptions, VideoRecordingStarted, } from "./modules/camera";
38
+ export type { DashboardMode, ShowNativeDashboardResult } from "./modules/dashboard";
39
+ export type { CloudModule } from "./modules/cloud";
40
+ export type { LedColor, LedControlOptions } from "./modules/led";
41
+ export type { RestreamDestination, StartStreamOptions, StreamAudioConfig, StreamResolvedConfig, StreamResult, StreamStatus, StreamVideoConfig, } from "./modules/stream";
42
+ export type { ShareOptions, ShareResult, DownloadOptions, DownloadResult, ScanQrOptions, ScanQrResult, } from "./modules/system";
43
+ export type { MiniappInfo, MiniappActionInfo, MiniappCompatibility, ListMiniappsOptions } from "./modules/miniapps";
44
+ export type { ActionContext, ActionDescriptor, ActionHandler, InvokeOptions } from "./modules/actions";
45
+ export type { DisplayManager } from "./modules/display";
46
+ export type { MiniappsModule } from "./modules/miniapps";
47
+ export type { ActionsModule } from "./modules/actions";
48
+ export type { GlassesModule } from "./modules/glasses";
49
+ export type { HeadingModule } from "./modules/heading";
50
+ export type { AiModule, AiProvider, AiTier, AiTool, AiToolCall, AiToolResult, AiMessage, AiCompleteRequest, AiCompleteResult, AiStopReason, AiUsage, } from "./modules/ai";
51
+ export type { ImuModule } from "./modules/imu";
52
+ export type { InputModule } from "./modules/input";
53
+ export type { KeysModule, ApiKeyProvider } from "./modules/keys";
54
+ export type { LocationModule } from "./modules/location";
55
+ export type { MemoryModule, MemoryEntry, MemoryEntryKind, MemoryNoteSource, MemoryQuery, MemorySearchResult, MemorySession, MemorySummary, } from "./modules/memory";
56
+ export type { SpeakersModule } from "./modules/speakers";
57
+ export type { MicModule } from "./modules/mic";
58
+ export type { ComputedRoute, ComputedRouteStep, ComputeRouteOptions, ComputeRouteResult, LatLng, NavArrived, NavCancelled, NavError, NavigationModule, NavManeuver, NavOffRoute, NavPermissionResult, NavPlaceDetails, NavPlaceSuggestion, NavRerouting, NavRoute, NavState, NavStep, NavUpdate, Pivot, PivotEvent, PivotOptions, RouteAvoidances, StartNavigationOptions, TravelMode, } from "./modules/navigation";
59
+ export type { PermissionsModule, PermissionErrorEvent } from "./modules/permissions";
60
+ export type { PhoneModule, PhoneNotificationsModule, PhoneCalendarModule } from "./modules/phone";
61
+ export type { TranscriptionModule, TranscriptionConfig, TranscriptionOptions } from "./modules/transcription";
62
+ export type { TranslationModule } from "./modules/translation";
63
+ export type { SpeakerModule } from "./modules/speaker";
64
+ export type { PermissionType, PermissionRecord } from "./session";
65
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AASH,OAAO,EAAC,cAAc,E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,GACd,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAA;AACtD,YAAY,EAAC,SAAS,EAAC,MAAM,eAAe,CAAA;AAC5C,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,MAAM,EACN,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,SAAS,EACT,KAAK,EACL,UAAU,EACV,YAAY,EACZ,eAAe,EACf,sBAAsB,EACtB,UAAU,GACX,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EAAC,iBAAiB,EAAE,oBAAoB,EAAC,MAAM,uBAAuB,CAAA;AAClF,YAAY,EAAC,WAAW,EAAE,wBAAwB,EAAE,mBAAmB,EAAC,MAAM,iBAAiB,CAAA;AAC/F,YAAY,EAAC,mBAAmB,EAAE,mBAAmB,EAAE,oBAAoB,EAAC,MAAM,yBAAyB,CAAA;AAC3G,YAAY,EAAC,iBAAiB,EAAC,MAAM,uBAAuB,CAAA;AAC5D,YAAY,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAA;AAGpD,YAAY,EAAC,cAAc,EAAE,gBAAgB,EAAC,MAAM,WAAW,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @glassly/miniapp — SDK for building Glassly local miniapps.
3
+ *
4
+ * Public entry point. Consumers do:
5
+ *
6
+ * import {MiniappSession} from "@glassly/miniapp" // background JSContext
7
+ * import {useColorScheme} from "@glassly/miniapp/react" // UI WebView hooks
8
+ * import {MiniappRequestType} from "@glassly/miniapp/protocol"
9
+ */
10
+ import { installDevReloadListenerIfDevMode } from "./dev-reload";
11
+ // Auto-install the dev-reload listener on module import so authors get live
12
+ // reload for free in dev builds. No-op in production (gated on
13
+ // window.Glassly.miniappDeveloperMode).
14
+ installDevReloadListenerIfDevMode();
15
+ export { MiniappSession, NotConnectedError } from "./session";
16
+ export { makeRequestId, parseEnvelope, serializeEnvelope } from "./envelope";
17
+ export { getGlasslyGlobals } from "./globals";
18
+ export { MiniappErrorCode, MiniappRequestType, MiniappResponseType, MiniappStreamType } from "./protocol";
19
+ export { CLOUD_STATUS_STREAM } from "./modules/cloud";
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
+ // Hardware requirement types — canonical defs live in ./hardware; miniapp
24
+ // authors type their miniapp.json manifest with these, and @glassly/engine
25
+ // re-exports them. Keep explicit exports (enums as value, interfaces as
26
+ // type) for Bun compat.
27
+ export { HardwareType, HardwareRequirementLevel } from "./hardware";
28
+ // Transports — exported for advanced uses (forced transport injection, tests)
29
+ export { createTransport } from "./transport/auto";
30
+ export { PostMessageTransport } from "./transport/postmessage";
31
+ export { LocalSocketTransport } from "./transport/local-socket";
32
+ export { MockTransport, isMockExplicitlyRequested } from "./transport/mock";
33
+ export { SpeakerStreamWriter, SPEAKER_STREAM_MAX_BUFFERED_MS, SPEAKER_WRITE_CHUNK_BYTES } from "./modules/speaker";
34
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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,wCAAwC;AACxC,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,iBAAiB,EAAC,MAAM,WAAW,CAAA;AAG3C,OAAO,EAAC,gBAAgB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,iBAAiB,EAAC,MAAM,YAAY,CAAA;AACvG,OAAO,EAAC,mBAAmB,EAAC,MAAM,iBAAiB,CAAA;AAEnD,2EAA2E;AAC3E,4DAA4D;AAC5D,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,iCAAiC,EACjC,uBAAuB,GACxB,MAAM,qBAAqB,CAAA;AAI5B,0EAA0E;AAC1E,2EAA2E;AAC3E,wEAAwE;AACxE,wBAAwB;AACxB,OAAO,EAAC,YAAY,EAAE,wBAAwB,EAAC,MAAM,YAAY,CAAA;AAGjE,8EAA8E;AAC9E,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAA;AAEhD,OAAO,EAAC,oBAAoB,EAAC,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAC,oBAAoB,EAAC,MAAM,0BAA0B,CAAA;AAE7D,OAAO,EAAC,aAAa,EAAE,yBAAyB,EAAC,MAAM,kBAAkB,CAAA;AA8CzE,OAAO,EAAC,mBAAmB,EAAE,8BAA8B,EAAE,yBAAyB,EAAC,MAAM,mBAAmB,CAAA"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * @fileoverview ActionsModule — `session.actions`.
3
+ *
4
+ * The MCP-shaped capability layer (miniapp tools), all three directions:
5
+ * - `list()` — discover every action the caller may invoke across installed
6
+ * miniapps (the MCP tools/list analog).
7
+ * - `invoke(pkg, actionId, params)` — call another miniapp's declared action.
8
+ * Open to all miniapps; headless-wakes the target if it's stopped. Actions
9
+ * declared with `visibility: "system"` stay restricted to system apps.
10
+ * - `handle(actionId, fn)` — expose one of your own actions. Mirrors
11
+ * `session.ui.handle` (one handler per id, throws on double-register,
12
+ * errors propagate to the caller).
13
+ *
14
+ * `invoke` ↔ `handle` are the two ends of one wire (keyed by `actionId`), which
15
+ * is why they share this namespace rather than being split across
16
+ * `session.miniapps` (whose lifecycle surface stays SYSTEM-only).
17
+ */
18
+ import { MiniappSession } from "../session";
19
+ /** Context handed to an action handler. `callerPackageName` is host-stamped. */
20
+ export interface ActionContext {
21
+ /** The package that invoked this action (trustworthy — set by the host). */
22
+ callerPackageName: string;
23
+ }
24
+ export type ActionHandler = (params: Record<string, unknown>, ctx: ActionContext) => unknown | Promise<unknown>;
25
+ export interface InvokeOptions {
26
+ /** Overall timeout in ms (default 30s, max 120s — host-enforced). */
27
+ timeoutMs?: number;
28
+ }
29
+ /**
30
+ * One invokable action surfaced by {@link ActionsModule.list}. Maps 1:1 onto
31
+ * an MCP tool: `id`→name, `description`, `parameters`→inputSchema.
32
+ */
33
+ export interface ActionDescriptor {
34
+ /** The miniapp that declares (and handles) the action. */
35
+ packageName: string;
36
+ /** Human-readable name of that miniapp. */
37
+ appName: string;
38
+ id: string;
39
+ description: string;
40
+ /** JSON-Schema input descriptor (the MCP-compatible subset). */
41
+ parameters?: Record<string, unknown>;
42
+ /** JSON-Schema descriptor for the structured result. */
43
+ outputSchema?: Record<string, unknown>;
44
+ }
45
+ export declare class ActionsModule {
46
+ private readonly session;
47
+ private readonly handlers;
48
+ /** Inbound calls buffered until their handler registers, keyed by actionId. */
49
+ private readonly buffered;
50
+ constructor(session: MiniappSession);
51
+ /**
52
+ * List every action this miniapp may invoke across installed miniapps.
53
+ * Incompatible apps and the caller's own actions are excluded; actions
54
+ * declared `visibility: "system"` only appear for system callers.
55
+ */
56
+ list(): Promise<ActionDescriptor[]>;
57
+ /**
58
+ * Invoke a declared action on another miniapp. Resolves with the handler's
59
+ * return value, rejects with a MiniappRequestError (NOT_PERMITTED,
60
+ * APP_NOT_FOUND, ACTION_NOT_FOUND, WAKE_FAILED, NO_ACTION_HANDLER,
61
+ * ACTION_TIMEOUT, PAYLOAD_TOO_LARGE, or the handler's own error). Open to
62
+ * all miniapps; the target keeps running after the call — a target that
63
+ * wants to shut down when done can call `session.system.exit()` itself.
64
+ */
65
+ invoke<TResult = unknown>(packageName: string, actionId: string, params?: Record<string, unknown>, opts?: InvokeOptions): Promise<TResult>;
66
+ /**
67
+ * Register a handler for one of this miniapp's declared actions. One handler
68
+ * per actionId — throws synchronously on double-register. The returned
69
+ * function unregisters. Declare the action in `miniapp.json` for it to be
70
+ * invokable; an undeclared id still registers but the host never routes to it.
71
+ */
72
+ handle(actionId: string, handler: ActionHandler): () => void;
73
+ /**
74
+ * @internal — called by MiniappSession.handleIncoming on an ACTION_CALL.
75
+ * Routes to the registered handler, or buffers briefly for one to appear.
76
+ */
77
+ _deliver(callId: string, actionId: string, params: Record<string, unknown>, ctx: ActionContext): void;
78
+ private dispatch;
79
+ private sendResult;
80
+ }
81
+ //# sourceMappingURL=actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/modules/actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAA;AAEzC,gFAAgF;AAChF,MAAM,WAAW,aAAa;IAC5B,4EAA4E;IAC5E,iBAAiB,EAAE,MAAM,CAAA;CAC1B;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,aAAa,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;AAE/G,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,0DAA0D;IAC1D,WAAW,EAAE,MAAM,CAAA;IACnB,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAA;IACf,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;IACnB,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACpC,wDAAwD;IACxD,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACvC;AAiBD,qBAAa,aAAa;IAKZ,OAAO,CAAC,QAAQ,CAAC,OAAO;IAJpC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmC;IAC5D,+EAA+E;IAC/E,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoC;gBAEhC,OAAO,EAAE,cAAc;IAEpD;;;;OAIG;IACH,IAAI,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAMnC;;;;;;;OAOG;IACH,MAAM,CAAC,OAAO,GAAG,OAAO,EACtB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,IAAI,CAAC,EAAE,aAAa,GACnB,OAAO,CAAC,OAAO,CAAC;IAUnB;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,MAAM,IAAI;IAqB5D;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,aAAa,GAAG,IAAI;YAuBvF,QAAQ;IAmBtB,OAAO,CAAC,UAAU;CAQnB"}
@@ -0,0 +1,137 @@
1
+ /**
2
+ * @fileoverview ActionsModule — `session.actions`.
3
+ *
4
+ * The MCP-shaped capability layer (miniapp tools), all three directions:
5
+ * - `list()` — discover every action the caller may invoke across installed
6
+ * miniapps (the MCP tools/list analog).
7
+ * - `invoke(pkg, actionId, params)` — call another miniapp's declared action.
8
+ * Open to all miniapps; headless-wakes the target if it's stopped. Actions
9
+ * declared with `visibility: "system"` stay restricted to system apps.
10
+ * - `handle(actionId, fn)` — expose one of your own actions. Mirrors
11
+ * `session.ui.handle` (one handler per id, throws on double-register,
12
+ * errors propagate to the caller).
13
+ *
14
+ * `invoke` ↔ `handle` are the two ends of one wire (keyed by `actionId`), which
15
+ * is why they share this namespace rather than being split across
16
+ * `session.miniapps` (whose lifecycle surface stays SYSTEM-only).
17
+ */
18
+ import { MiniappErrorCode, MiniappRequestType } from "../protocol";
19
+ /**
20
+ * How long the SDK holds an inbound ACTION_CALL waiting for its handler to
21
+ * register (a just-woken miniapp registers handlers a beat after CONNECT).
22
+ * If no handler appears in this window the call is failed with
23
+ * NO_ACTION_HANDLER. Mirrors the UI bus's pre-handler buffering.
24
+ */
25
+ const HANDLER_WAIT_MS = 5000;
26
+ export class ActionsModule {
27
+ constructor(session) {
28
+ this.session = session;
29
+ this.handlers = new Map();
30
+ /** Inbound calls buffered until their handler registers, keyed by actionId. */
31
+ this.buffered = new Map();
32
+ }
33
+ /**
34
+ * List every action this miniapp may invoke across installed miniapps.
35
+ * Incompatible apps and the caller's own actions are excluded; actions
36
+ * declared `visibility: "system"` only appear for system callers.
37
+ */
38
+ list() {
39
+ return this.session.sendRequest({
40
+ type: MiniappRequestType.ACTIONS_LIST,
41
+ });
42
+ }
43
+ /**
44
+ * Invoke a declared action on another miniapp. Resolves with the handler's
45
+ * return value, rejects with a MiniappRequestError (NOT_PERMITTED,
46
+ * APP_NOT_FOUND, ACTION_NOT_FOUND, WAKE_FAILED, NO_ACTION_HANDLER,
47
+ * ACTION_TIMEOUT, PAYLOAD_TOO_LARGE, or the handler's own error). Open to
48
+ * all miniapps; the target keeps running after the call — a target that
49
+ * wants to shut down when done can call `session.system.exit()` itself.
50
+ */
51
+ invoke(packageName, actionId, params, opts) {
52
+ return this.session.sendRequest({
53
+ type: MiniappRequestType.ACTION_INVOKE,
54
+ targetPackageName: packageName,
55
+ actionId,
56
+ params: params ?? {},
57
+ ...(opts?.timeoutMs != null ? { timeoutMs: opts.timeoutMs } : {}),
58
+ });
59
+ }
60
+ /**
61
+ * Register a handler for one of this miniapp's declared actions. One handler
62
+ * per actionId — throws synchronously on double-register. The returned
63
+ * function unregisters. Declare the action in `miniapp.json` for it to be
64
+ * invokable; an undeclared id still registers but the host never routes to it.
65
+ */
66
+ handle(actionId, handler) {
67
+ if (this.handlers.has(actionId)) {
68
+ throw new Error(`session.actions.handle: a handler is already registered for "${actionId}"`);
69
+ }
70
+ this.handlers.set(actionId, handler);
71
+ // Flush any calls that arrived before this handler registered.
72
+ const waiting = this.buffered.get(actionId);
73
+ if (waiting) {
74
+ this.buffered.delete(actionId);
75
+ for (const call of waiting) {
76
+ clearTimeout(call.timer);
77
+ void this.dispatch(call.callId, actionId, call.params, call.ctx);
78
+ }
79
+ }
80
+ return () => {
81
+ if (this.handlers.get(actionId) === handler)
82
+ this.handlers.delete(actionId);
83
+ };
84
+ }
85
+ /**
86
+ * @internal — called by MiniappSession.handleIncoming on an ACTION_CALL.
87
+ * Routes to the registered handler, or buffers briefly for one to appear.
88
+ */
89
+ _deliver(callId, actionId, params, ctx) {
90
+ if (this.handlers.has(actionId)) {
91
+ void this.dispatch(callId, actionId, params, ctx);
92
+ return;
93
+ }
94
+ // No handler yet — buffer, and fail with NO_ACTION_HANDLER if none registers.
95
+ const timer = setTimeout(() => {
96
+ const arr = this.buffered.get(actionId);
97
+ if (arr) {
98
+ const idx = arr.findIndex((c) => c.callId === callId);
99
+ if (idx >= 0)
100
+ arr.splice(idx, 1);
101
+ if (arr.length === 0)
102
+ this.buffered.delete(actionId);
103
+ }
104
+ this.sendResult(callId, false, undefined, {
105
+ code: MiniappErrorCode.NO_ACTION_HANDLER,
106
+ message: `No handler registered for action "${actionId}"`,
107
+ });
108
+ }, HANDLER_WAIT_MS);
109
+ const arr = this.buffered.get(actionId) ?? [];
110
+ arr.push({ callId, params, ctx, timer });
111
+ this.buffered.set(actionId, arr);
112
+ }
113
+ async dispatch(callId, actionId, params, ctx) {
114
+ const handler = this.handlers.get(actionId);
115
+ if (!handler)
116
+ return;
117
+ try {
118
+ const result = await handler(params, ctx);
119
+ this.sendResult(callId, true, result ?? null);
120
+ }
121
+ catch (e) {
122
+ this.sendResult(callId, false, undefined, {
123
+ code: MiniappErrorCode.INTERNAL,
124
+ message: e?.message ?? "action handler threw",
125
+ });
126
+ }
127
+ }
128
+ sendResult(callId, ok, result, error) {
129
+ this.session.sendOneShot({
130
+ type: MiniappRequestType.ACTION_RESULT,
131
+ callId,
132
+ ok,
133
+ ...(ok ? { result } : { error }),
134
+ });
135
+ }
136
+ }
137
+ //# sourceMappingURL=actions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/modules/actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAE,kBAAkB,EAAC,MAAM,aAAa,CAAA;AAwChE;;;;;GAKG;AACH,MAAM,eAAe,GAAG,IAAK,CAAA;AAE7B,MAAM,OAAO,aAAa;IAKxB,YAA6B,OAAuB;QAAvB,YAAO,GAAP,OAAO,CAAgB;QAJnC,aAAQ,GAAG,IAAI,GAAG,EAAyB,CAAA;QAC5D,+EAA+E;QAC9D,aAAQ,GAAG,IAAI,GAAG,EAA0B,CAAA;IAEN,CAAC;IAExD;;;;OAIG;IACH,IAAI;QACF,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAqB;YAClD,IAAI,EAAE,kBAAkB,CAAC,YAAY;SACtC,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CACJ,WAAmB,EACnB,QAAgB,EAChB,MAAgC,EAChC,IAAoB;QAEpB,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAU;YACvC,IAAI,EAAE,kBAAkB,CAAC,aAAa;YACtC,iBAAiB,EAAE,WAAW;YAC9B,QAAQ;YACR,MAAM,EAAE,MAAM,IAAI,EAAE;YACpB,GAAG,CAAC,IAAI,EAAE,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,EAAC,SAAS,EAAE,IAAI,CAAC,SAAS,E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