@limrun/ui 0.14.0-rc.2 → 0.14.0-rc.3

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 (38) hide show
  1. package/dist/app-store-relay/index.js +3 -3
  2. package/dist/app-store-relay/react.d.ts +1 -1
  3. package/dist/app-store-relay/react.js +6 -2
  4. package/dist/{client-CBX-hLnL.mjs → client-C8ZDEjtD.mjs} +1 -6
  5. package/dist/components/remote-control.d.ts +0 -156
  6. package/dist/core/device-install/operations/operations.d.ts +1 -1
  7. package/dist/core/play-publish/google.d.ts +13 -0
  8. package/dist/core/play-publish/publish.d.ts +34 -0
  9. package/dist/device-build/index.js +5 -5
  10. package/dist/device-install/index.js +7 -1
  11. package/dist/device-install/react.js +24 -21
  12. package/dist/index.cjs +1 -1
  13. package/dist/index.css +1 -1
  14. package/dist/index.js +1125 -1405
  15. package/dist/play-publish/index.cjs +1 -0
  16. package/dist/play-publish/index.d.ts +2 -0
  17. package/dist/play-publish/index.js +106 -0
  18. package/dist/play-publish/react.cjs +1 -0
  19. package/dist/play-publish/react.d.ts +21 -0
  20. package/dist/play-publish/react.js +81 -0
  21. package/dist/{provisioning-DKbkBO-p.mjs → provisioning-BmsEnF6X.mjs} +8 -8
  22. package/package.json +13 -2
  23. package/src/app-store-relay/index.test.ts +6 -6
  24. package/src/app-store-relay/react.ts +5 -1
  25. package/src/components/remote-control.css +0 -32
  26. package/src/components/remote-control.tsx +5 -865
  27. package/src/core/device-install/apple/client.ts +1 -6
  28. package/src/core/device-install/apple/relay.ts +1 -4
  29. package/src/core/device-install/operations/operations.ts +7 -1
  30. package/src/core/play-publish/google.ts +104 -0
  31. package/src/core/play-publish/publish.test.ts +68 -0
  32. package/src/core/play-publish/publish.ts +89 -0
  33. package/src/device-install/demo/demo.tsx +1 -4
  34. package/src/device-install/react.ts +30 -27
  35. package/src/play-publish/README.md +65 -0
  36. package/src/play-publish/index.ts +12 -0
  37. package/src/play-publish/react.ts +168 -0
  38. package/vite.config.ts +2 -0
@@ -1,8 +1,8 @@
1
- import { p as D } from "../client-CBX-hLnL.mjs";
2
- import { A as Pe, f as he, o as qe, a as Be, b as Se, c as Ce, d as Re, s as Te, t as Ee, e as Ke } from "../client-CBX-hLnL.mjs";
1
+ import { p as D } from "../client-C8ZDEjtD.mjs";
2
+ import { A as Pe, f as he, o as qe, a as Be, b as Se, c as Ce, d as Re, s as Te, t as Ee, e as Ke } from "../client-C8ZDEjtD.mjs";
3
3
  import { f as p } from "../index-DFdCvi2_.mjs";
4
4
  import { A as ke } from "../index-DFdCvi2_.mjs";
5
- import { l as w, f as g, a as I, s as P, b as h, d as q, c as B, e as S, g as C, h as R, r as T, i as E, j as K, k as U, m as k, n as x } from "../provisioning-DKbkBO-p.mjs";
5
+ import { l as w, f as g, a as I, s as P, b as h, d as q, c as B, e as S, h as C, i as R, r as T, j as E, k as K, m as U, n as k, o as x } from "../provisioning-BmsEnF6X.mjs";
6
6
  const F = {
7
7
  name: "RSASSA-PKCS1-v1_5",
8
8
  modulusLength: 2048,
@@ -12,4 +12,4 @@ export type UseAppleIDLoginResult = {
12
12
  finalize: () => Promise<AppleRelayResponse | undefined>;
13
13
  close: () => Promise<void>;
14
14
  };
15
- export declare function useAppleIDLogin({ registryApiUrl, token, organizationId }: UseAppleIDLoginOptions): UseAppleIDLoginResult;
15
+ export declare function useAppleIDLogin({ registryApiUrl, token, organizationId, }: UseAppleIDLoginOptions): UseAppleIDLoginResult;
@@ -1,7 +1,11 @@
1
1
  import { useState as c, useRef as y, useCallback as a, useEffect as E } from "react";
2
- import { s as A } from "../client-CBX-hLnL.mjs";
2
+ import { s as A } from "../client-C8ZDEjtD.mjs";
3
3
  import "../index-DFdCvi2_.mjs";
4
- function L({ registryApiUrl: r, token: l, organizationId: d }) {
4
+ function L({
5
+ registryApiUrl: r,
6
+ token: l,
7
+ organizationId: d
8
+ }) {
5
9
  const [h, o] = c("idle"), [v, u] = c(), [g, p] = c(), [m, f] = c(), [R, s] = c(), t = y(void 0), C = a(async () => {
6
10
  await t.current?.close().catch(() => {
7
11
  }), t.current = void 0, u(void 0), p(void 0), f(void 0), s(void 0), o("idle");
@@ -140,12 +140,7 @@ async function M({
140
140
  twoFactorChallengeResponse: s,
141
141
  requiresTwoFactor: y,
142
142
  finishTwoFactor: async (a) => {
143
- const d = l.type === "phone" ? await v(
144
- n,
145
- l.phoneNumberId,
146
- a,
147
- l.mode
148
- ) : await T(n, a);
143
+ const d = l.type === "phone" ? await v(n, l.phoneNumberId, a, l.mode) : await T(n, a);
149
144
  if (d.status < 200 || d.status >= 300)
150
145
  throw new Error(
151
146
  `Apple two-factor code failed: HTTP ${d.status} ${d.rawBody ?? ""}`.trim()
@@ -14,18 +14,6 @@ interface RemoteControlProps {
14
14
  openUrl?: string;
15
15
  showFrame?: boolean;
16
16
  autoReconnect?: boolean;
17
- /**
18
- * Fires once when the component concludes the instance is permanently
19
- * gone rather than suffering a recoverable connection blip.
20
- *
21
- * After a drop, the component probes the instance endpoint over HTTP;
22
- * a 404 means the instance no longer exists (terminated/deleted). When
23
- * that happens the component stops reconnecting and renders a built-in
24
- * "terminated" message in place of the "Retry" button, and invokes this
25
- * callback so the host can react (navigate away, surface its own UI,
26
- * etc.). It is not called for ordinary network drops.
27
- */
28
- onTerminated?: () => void;
29
17
  /**
30
18
  * Enable the inspect overlay. When set, the component starts polling the
31
19
  * accessibility tree and draws boxes over each element on top of the
@@ -105,150 +93,6 @@ interface RemoteControlProps {
105
93
  * @default 2000
106
94
  */
107
95
  axMaxBackoffMs?: number;
108
- /**
109
- * Fires whenever the iOS simulator's camera demand state changes —
110
- * i.e. an app inside the sim called
111
- * `[AVCaptureSession startRunning]` or `[stopRunning]`. The
112
- * component handles the `navigator.mediaDevices.getUserMedia` prompt
113
- * and SDP plumbing internally; this callback is purely so the host
114
- * UI can render a status indicator ("simulator is using your
115
- * camera", etc.).
116
- *
117
- * `active` reflects whether the sim is currently asking for
118
- * frames. `granted` is set only on the call that follows a
119
- * `getUserMedia` attempt: `true` when the user accepted the
120
- * browser prompt, `false` when they denied or the call failed
121
- * (in which case the limulator side switches to a black-frame
122
- * fallback so the app keeps ticking).
123
- *
124
- * `camera` (optional, only meaningful when `granted === true`)
125
- * carries what `MediaStreamTrack.getSettings()` reported for the
126
- * active capture: resolution, framerate, device label, facing
127
- * mode. Use it to render a richer status indicator (e.g.
128
- * "Camera · 1920×1080 · 30 fps · FaceTime HD").
129
- *
130
- * Only iOS instances ever fire this callback; Android instances
131
- * have no camera-injector path and stay silent.
132
- */
133
- onCameraDemandChange?: (active: boolean, granted?: boolean, camera?: CameraCaptureInfo) => void;
134
- /**
135
- * Periodically (~1Hz) fires with a snapshot of the outbound
136
- * camera stream's live WebRTC stats — codec, encoder
137
- * implementation, hardware acceleration, encoded fps, bitrate,
138
- * round-trip-time, and the encoder's
139
- * `qualityLimitationReason` (which is what Meet/Zoom use to
140
- * decide whether to show "Bandwidth limited" or "CPU limited"
141
- * banners).
142
- *
143
- * Only fires while the simulator is actively pulling the
144
- * camera AND `getUserMedia` was granted. `null` is emitted
145
- * once when the stream goes back to idle so consumers can
146
- * clear their UI without having to maintain their own
147
- * timeout. The host app does not need to poll `getStats()`
148
- * itself — this is the canonical place.
149
- */
150
- onCameraStats?: (stats: CameraStreamStats | null) => void;
151
- /**
152
- * Optional resolution cap for outbound camera capture.
153
- *
154
- * - `'auto'` (default): no extra constraint. The browser captures
155
- * at its webcam's native max; WebRTC's quality scaler may step
156
- * down resolution on the encoder side under bandwidth pressure
157
- * while still feeding the simulator at the pool's native size.
158
- * - `'1080p'` / `'720p'` / `'480p'`: hard cap applied via
159
- * `getUserMedia` constraints (for new captures) and
160
- * `track.applyConstraints` (for the currently-active track),
161
- * matching the way Meet/Zoom expose a "Send resolution" picker.
162
- *
163
- * Bumping or lowering the cap mid-stream is supported; the
164
- * change takes effect within a frame or two as the webcam
165
- * re-negotiates.
166
- */
167
- cameraResolutionCap?: CameraResolutionCap;
168
- /**
169
- * Aspect ratio the simulator's virtual camera should report to apps.
170
- * Picking a value here triggers a `cameraAspect` WS message to the
171
- * host, which rebuilds its IOSurface ring at the matching dimensions
172
- * (16:9 → 1920×1080, 4:3 → 1440×1080, 1:1 → 1080×1080, 9:16 →
173
- * 1080×1920) and signals the in-sim dylib to re-handshake. iOS apps
174
- * see CMSampleBuffers at the new dimensions within a frame or two.
175
- *
176
- * The browser still captures whatever the webcam offers; the host
177
- * aspect-fills (cover, center-crop) into the new pool. Switching
178
- * aspect at runtime is intentionally cheap so users can A/B preview
179
- * styles without restarting the simulator.
180
- *
181
- * `undefined` leaves the pool untouched (the host's boot default —
182
- * 16:9 / 1920×1080 — applies).
183
- */
184
- cameraAspect?: CameraAspect;
185
- }
186
- /**
187
- * Resolution caps a host app can request on the outbound camera.
188
- * `'auto'` is "let the browser decide" (no constraints beyond the
189
- * 30 fps ceiling); the other options clamp width/height to the
190
- * named target. Aspect ratio is preserved.
191
- */
192
- export type CameraResolutionCap = 'auto' | '1080p' | '720p' | '480p';
193
- /**
194
- * Aspect ratios exposed to the operator for the simulated camera.
195
- * The host maps each label to concrete IOSurface dimensions; values
196
- * the host doesn't recognise are silently ignored.
197
- */
198
- export type CameraAspect = '16:9' | '4:3' | '1:1' | '9:16';
199
- /**
200
- * Snapshot of the browser's webcam capture, mirrored from
201
- * `MediaStreamTrack.getSettings()`. Forwarded to the host alongside
202
- * `cameraResult` and exposed to the host app via
203
- * `onCameraDemandChange` so it can render a status indicator without
204
- * having to call `getStats()` itself.
205
- */
206
- export interface CameraCaptureInfo {
207
- width?: number;
208
- height?: number;
209
- frameRate?: number;
210
- deviceId?: string;
211
- label?: string;
212
- facingMode?: string;
213
- }
214
- /**
215
- * Live outbound-camera quality snapshot. Derived from
216
- * `RTCPeerConnection.getStats()` and rate-derived deltas, sampled
217
- * once per second while the camera is sending. All fields optional:
218
- * some browsers omit fields (Safari rarely reports
219
- * `encoderImplementation`), and the first sample after camera start
220
- * has no delta-derived numbers yet.
221
- */
222
- export interface CameraStreamStats {
223
- /** "H264", "HEVC"/"H265", "VP9", "VP8", "AV1", etc. (uppercased). */
224
- codec?: string;
225
- /** e.g. "VideoToolbox" (hw), "OpenH264" (sw), "ExternalEncoder". */
226
- encoderImplementation?: string;
227
- /**
228
- * Browser-reported hardware-acceleration hint. Some Chromium
229
- * versions expose this via `powerEfficientEncoder`; we mirror it
230
- * here so consumers don't have to know the spec quirk.
231
- */
232
- hardwareAccelerated?: boolean;
233
- /** Outbound encoded fps over the last sample window. */
234
- framesPerSecond?: number;
235
- /** Cumulative encoded frame count. */
236
- framesEncoded?: number;
237
- /** Outbound encoded bitrate (bits/s) over the last window. */
238
- bitrateBps?: number;
239
- /** Width/height the encoder is currently producing. */
240
- width?: number;
241
- height?: number;
242
- /**
243
- * One of `'none' | 'cpu' | 'bandwidth' | 'other'`. Mirrors
244
- * Meet/Zoom's "limited by …" banners. Anything other than
245
- * `'none'` means the encoder dropped resolution to keep up.
246
- */
247
- qualityLimitationReason?: string;
248
- /** Round-trip time in milliseconds, from the matching RTCP. */
249
- rttMs?: number;
250
- /** Packet-loss percentage over the last sample window (0..100). */
251
- packetsLostPct?: number;
252
96
  }
253
97
  interface ScreenshotData {
254
98
  dataUri: string;
@@ -37,7 +37,7 @@ export type StartInstallRelayOptions = StartPairingRelayOptions & {
37
37
  installSource: InstallSource;
38
38
  };
39
39
  export declare function requestUSBAccess({ log }: RequestUSBAccessOptions): Promise<DeviceRelayTarget>;
40
- export declare function startPairingRelay({ registryApiUrl, token, organizationId, log, target }: StartPairingRelayOptions): Promise<{
40
+ export declare function startPairingRelay({ registryApiUrl, token, organizationId, log, target, }: StartPairingRelayOptions): Promise<{
41
41
  relay: RelayClient;
42
42
  pairRecord: PairRecordPayload;
43
43
  target: DeviceRelayTarget;
@@ -0,0 +1,13 @@
1
+ export declare const ANDROID_PUBLISHER_SCOPE = "https://www.googleapis.com/auth/androidpublisher";
2
+ export declare function loadGoogleIdentityServices(): Promise<void>;
3
+ export type RequestGoogleAccessTokenInput = {
4
+ clientId: string;
5
+ scope?: string;
6
+ };
7
+ /**
8
+ * Opens the Google consent popup and resolves with a short-lived OAuth
9
+ * access token. Call from a user gesture so popup blockers allow it, and
10
+ * call loadGoogleIdentityServices beforehand (e.g. when the surrounding
11
+ * dialog opens) to keep this call synchronous with the click.
12
+ */
13
+ export declare function requestGoogleAccessToken({ clientId, scope, }: RequestGoogleAccessTokenInput): Promise<string>;
@@ -0,0 +1,34 @@
1
+ export type PlaystorePublishInput = {
2
+ registryApiUrl: string;
3
+ /** Limrun API token authenticating the registry call. */
4
+ token?: string;
5
+ /** Organization tid; required when it differs from the token's default organization. */
6
+ organizationId?: string;
7
+ /** Google OAuth access token with the androidpublisher scope. Sent per request, never stored. */
8
+ accessToken: string;
9
+ packageName: string;
10
+ assetId?: string;
11
+ assetName?: string;
12
+ /** Play track ID, defaults to internal on the server. */
13
+ track?: string;
14
+ /** Required by the server when track is production. */
15
+ releaseStatus?: 'draft' | 'completed';
16
+ };
17
+ export type PlaystorePublishResult = {
18
+ versionCode: number;
19
+ };
20
+ /**
21
+ * Registry publish failure. `code` carries the registry's machine-readable
22
+ * error code when available: invalidRequest, assetNotFound, internal, busy,
23
+ * listingNotFound, permissionDenied, versionCodeExists, uploadKeyMismatch
24
+ * or unknown; the set grows additively.
25
+ */
26
+ export declare class PlaystorePublishError extends Error {
27
+ readonly code?: string;
28
+ readonly status?: number;
29
+ constructor(message: string, options?: {
30
+ code?: string;
31
+ status?: number;
32
+ });
33
+ }
34
+ export declare function publishToPlaystore(input: PlaystorePublishInput): Promise<PlaystorePublishResult>;
@@ -1,6 +1,6 @@
1
1
  import { f as b, g as B, s as D, w as y } from "../limbuild-client-BagK_FWE.mjs";
2
2
  import "../index-DFdCvi2_.mjs";
3
- import { o as C, p as E } from "../provisioning-DKbkBO-p.mjs";
3
+ import { g as C, p as E } from "../provisioning-BmsEnF6X.mjs";
4
4
  import { p as d, a as m, b as u, c as A } from "../browser-storage-Cx9eW-bm.mjs";
5
5
  import { g as M, d as T, e as F, f as H, h as N } from "../browser-storage-Cx9eW-bm.mjs";
6
6
  async function w({
@@ -9,9 +9,9 @@ async function w({
9
9
  certificatePassword: t,
10
10
  bundleId: n,
11
11
  deviceUDID: o,
12
- teamId: l,
12
+ teamId: g,
13
13
  signingMode: r = "development",
14
- certificateId: g
14
+ certificateId: l
15
15
  }) {
16
16
  const [c, p, s] = await Promise.all([
17
17
  a(i),
@@ -21,9 +21,9 @@ async function w({
21
21
  return f({ profile: s, bundleId: n, deviceUDID: o, signingMode: r }), m({
22
22
  bundleID: n ?? s.bundleID ?? s.applicationIdentifier ?? e.name,
23
23
  deviceUDID: o,
24
- teamID: l ?? s.teamID,
24
+ teamID: g ?? s.teamID,
25
25
  signingMode: r,
26
- certificateID: g,
26
+ certificateID: l,
27
27
  certificateP12Base64: c,
28
28
  certificateFileName: i.name,
29
29
  certificatePassword: t || void 0,
@@ -431,7 +431,13 @@ async function ae({ log: e }) {
431
431
  `${t.manufacturerName ?? ""} ${t.productName ?? ""} ${t.serialNumber ?? ""}`.trim()
432
432
  ), n;
433
433
  }
434
- async function ie({ registryApiUrl: e, token: t, organizationId: n, log: r, target: a }) {
434
+ async function ie({
435
+ registryApiUrl: e,
436
+ token: t,
437
+ organizationId: n,
438
+ log: r,
439
+ target: a
440
+ }) {
435
441
  const i = N(e, t, n);
436
442
  let o;
437
443
  try {
@@ -55,27 +55,30 @@ function H({
55
55
  } finally {
56
56
  s(void 0);
57
57
  }
58
- }, [c, a, e, f, v]), N = l(async (t) => {
59
- if (!c || !e || !n)
60
- throw new Error("Select and pair a USB device before starting installation.");
61
- s("install"), i(void 0);
62
- try {
63
- return await a(), y.current = await T({
64
- registryApiUrl: c,
65
- token: v,
66
- organizationId: f,
67
- log: r.current,
68
- target: e,
69
- pairRecord: n,
70
- installSource: t
71
- }), r.current("Device install started", "Installation will continue through the connected iPhone."), y.current;
72
- } catch (o) {
73
- await d(e, r.current), i(R(o));
74
- return;
75
- } finally {
76
- s(void 0);
77
- }
78
- }, [c, a, e, f, n, v]), q = l(() => {
58
+ }, [c, a, e, f, v]), N = l(
59
+ async (t) => {
60
+ if (!c || !e || !n)
61
+ throw new Error("Select and pair a USB device before starting installation.");
62
+ s("install"), i(void 0);
63
+ try {
64
+ return await a(), y.current = await T({
65
+ registryApiUrl: c,
66
+ token: v,
67
+ organizationId: f,
68
+ log: r.current,
69
+ target: e,
70
+ pairRecord: n,
71
+ installSource: t
72
+ }), r.current("Device install started", "Installation will continue through the connected iPhone."), y.current;
73
+ } catch (o) {
74
+ await d(e, r.current), i(R(o));
75
+ return;
76
+ } finally {
77
+ s(void 0);
78
+ }
79
+ },
80
+ [c, a, e, f, n, v]
81
+ ), q = l(() => {
79
82
  a(), r.current("Device relay stopped");
80
83
  }, [a]);
81
84
  return {