runcloud 0.1.108 → 0.1.110

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/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const CLI_VERSION = '0.1.108';
1
+ export const CLI_VERSION = '0.1.110';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runcloud",
3
- "version": "0.1.108",
3
+ "version": "0.1.110",
4
4
  "description": "Create and control run.cloud remote mobile simulators and cloud sandboxes",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
Binary file
@@ -1,44 +1,32 @@
1
1
  ---
2
2
  name: run-cloud-ios-simulator
3
- description: Operate run.cloud iOS simulator and Android emulator sessions with the CLI or TypeScript SDK. Use for creating, installing, inspecting, reading device logs, embedding, smoke-testing, connecting local Metro, capturing iOS screenshots, injecting iOS media, or releasing remote mobile sessions.
3
+ description: Operate run.cloud iOS simulator and Android emulator sessions with the CLI or TypeScript SDK. Use for creating, installing, inspecting, reading logs, controlling, embedding, smoke-testing, connecting local Metro, taking screenshots or screen recordings, injecting iOS media, or releasing remote mobile sessions.
4
4
  ---
5
5
 
6
6
  # Operate run.cloud Mobile Sessions
7
7
 
8
- Use run.cloud through the `runcloud` CLI for terminal workflows and
9
- `@run-cloud/sdk` for application, CI, or agent code.
8
+ Use the `runcloud` CLI for terminal workflows, `@run-cloud/sdk` for TypeScript,
9
+ and `@run-cloud/ui` for React embeds.
10
10
 
11
11
  ## Authenticate
12
12
 
13
13
  - Install the CLI with `npm install -g runcloud`.
14
- - Use `runcloud login` for an interactive browser handoff. Use
15
- `runcloud login --manual` when a local callback cannot open.
14
+ - Use `runcloud login`; add `--manual` when a local callback cannot open.
16
15
  - In CI, set `RUN_CLOUD_API_KEY`. `RUN_CLOUD_API_TOKEN` is an equivalent alias.
17
- - Set `RUN_CLOUD_API_URL` only to override the production default
18
- `https://api.run.cloud`.
19
- - Never print, commit, or place credentials in a skill file.
20
- - Treat signed simulator URLs and tunnel URLs as bearer secrets.
21
- - Require Node.js 20 or newer for the CLI and TypeScript SDK.
16
+ - Set `RUN_CLOUD_API_URL` only to override `https://api.run.cloud`.
17
+ - Require Node.js 20 or newer.
18
+ - Never print, commit, or place credentials in a skill file. Treat signed session
19
+ and tunnel URLs as bearer secrets.
22
20
 
23
- Inspect account and organization credit before starting metered work:
21
+ Check access and credit before starting metered work:
24
22
 
25
23
  ```bash
26
24
  runcloud account --json
27
25
  ```
28
26
 
29
- Sessions require product access, organization credit below its ceiling, and
30
- available fleet capacity. A create request may queue while capacity is full.
27
+ The SDK equivalents are `cloud.account()` and `cloud.usage({ orgId? })`.
31
28
 
32
- ## Choose the Interface
33
-
34
- - Prefer CLI commands with `--json` for shell automation.
35
- - Prefer `@run-cloud/sdk` for TypeScript applications and CI.
36
- - Inspect `runcloud <command> --help` or installed SDK types before using a
37
- method not documented here.
38
-
39
- ## Use the CLI
40
-
41
- Create an iOS session, capture its ID, open a deep link, and release it:
29
+ ## Create and Release Sessions
42
30
 
43
31
  ```bash
44
32
  SESSION_ID=$(runcloud ios create \
@@ -48,79 +36,67 @@ SESSION_ID=$(runcloud ios create \
48
36
  --json | jq -r '.id')
49
37
 
50
38
  trap 'runcloud ios delete "$SESSION_ID" >/dev/null 2>&1 || true' EXIT
51
-
52
39
  runcloud ios get "$SESSION_ID" --json
53
- runcloud ios open-url myapp://settings --id "$SESSION_ID" --json
54
40
  ```
55
41
 
56
- Use the corresponding `runcloud android` commands for Android artifacts.
57
-
58
- The shared mobile lifecycle is:
42
+ Replace `ios` with `android` for an Android artifact. The shared lifecycle is
43
+ `create`, `list`, `get`, `open-url`, `logs`, and `delete`. Use `--json` whenever
44
+ another program consumes output, and inspect `runcloud ios|android --help` for
45
+ create and log options.
59
46
 
60
- - `runcloud ios|android create`
61
- - `runcloud ios|android list [--all]`
62
- - `runcloud ios|android get <id>`
63
- - `runcloud ios|android open-url <url> --id <id>`
64
- - `runcloud ios|android logs <id> [--tail N|--follow]`
65
- - `runcloud ios|android delete <id>`
47
+ iOS needs an Apple Silicon simulator-compatible `.app`, `.zip`, `.tar.gz`, or
48
+ `.ipa`; a device-signed App Store IPA is not a substitute. Android needs an
49
+ emulator-compatible APK.
66
50
 
67
- Create accepts `--model`, `--region`, `--display-name`, repeatable `--label`,
68
- repeatable `--install`, repeatable `--install-asset`,
69
- `--inactivity-timeout`, `--hard-timeout`, `--codec`, `--rm`, and `--json`.
51
+ ## Control a Session
70
52
 
71
- Use assets and samples when no local artifact is ready:
53
+ Both platform groups expose acknowledged controls:
72
54
 
73
55
  ```bash
74
- runcloud sample download ios
75
- runcloud ios create --install ./run-cloud-sample-ios.app.tar.gz --json
76
-
77
- runcloud asset push ./build/MyApp.tar.gz --name my-app --json
78
- runcloud ios create --install-asset my-app --json
79
- runcloud asset list --json
80
- runcloud asset pull <asset-id> --output ./MyApp.tar.gz
81
- runcloud asset delete <asset-id> --json
56
+ runcloud ios tap "$SESSION_ID" 0.5 0.3 --json
57
+ runcloud ios swipe "$SESSION_ID" 0.5 0.8 0.5 0.2 --duration 300 --json
58
+ runcloud ios type-text "$SESSION_ID" 'hello' --json
59
+ runcloud ios press-key "$SESSION_ID" enter --json
60
+ runcloud ios press-button "$SESSION_ID" home --json
61
+ runcloud ios screenshot "$SESSION_ID" --output ios.png --json
82
62
  ```
83
63
 
84
- iOS needs an Apple Silicon simulator-compatible `.app`, `.zip`, `.tar.gz`, or
85
- `.ipa` artifact. A device-signed App Store IPA is not a substitute. Android
86
- needs an emulator-compatible artifact such as an APK.
64
+ The full control set is `tap`, `swipe`, `gesture`, `type-text`, `press-key`,
65
+ `press-button`, `rotate`, `reload`, `scroll`, `toggle-software-keyboard`,
66
+ `simulate-memory-warning`, `rotate-digital-crown`, `set-render-debug`, and
67
+ `screenshot`. Every interaction accepts `--request-id`, `--timeout`, and
68
+ `--json`; use `runcloud <platform> <control> --help` for its typed arguments.
87
69
 
88
- ## Diagnose App Failures
70
+ Coordinates use the current display orientation: `(0, 0)` is top-left and
71
+ `(1, 1)` is bottom-right. Gesture steps use one or two points with `begin`,
72
+ `move`, and `end` phases. Each `delayMs` is the pause before the next step, so
73
+ the final `end` step must use `0`. Key names are semantic US-keyboard names;
74
+ modifiers are `shift`, `control`, `alt`, and `meta`. Current mobile sessions do
75
+ not support Digital Crown input, and Android does not support iOS render-debug
76
+ controls or the `capsLock`, `numLock`, and `scrollLock` keys. Handle structured
77
+ `unsupported_action` errors instead of retrying them.
89
78
 
90
- Read up to 1,000 retained entries from the current lease:
79
+ An acknowledgement means input dispatch completed. Confirm visible app effects
80
+ with a screenshot or the signed viewer when the outcome matters.
91
81
 
92
- ```bash
93
- runcloud ios logs "$SESSION_ID" --tail 1000
94
- runcloud android logs "$SESSION_ID" --tail 1000
95
- ```
96
-
97
- Use `--follow` while reproducing an issue, and add `--json` when another tool
98
- will consume the entries. `--tail` and `--follow` are mutually exclusive.
99
- Before releasing a failed session, always capture a bounded snapshot and keep
100
- the relevant entries with the test evidence. A follow stream contains only new
101
- entries and is not a substitute for the retained snapshot.
102
-
103
- ## Connect Local Development
82
+ ## Record the Screen
104
83
 
105
- Connect a local Metro or mock server to an active iOS session:
84
+ Both platforms expose the same session-scoped recording lifecycle:
106
85
 
107
86
  ```bash
108
- runcloud ios tunnel "$SESSION_ID" \
109
- --local-port 8081 \
110
- --service metro \
111
- --json
112
-
113
- runcloud ios tunnel-status --json
87
+ RECORDING_ID=$(runcloud ios recording start "$SESSION_ID" \
88
+ --idempotency-key "task-${TASK_ID:-manual}" --json | jq -r '.id')
89
+ runcloud ios recording stop "$SESSION_ID" "$RECORDING_ID" --json
90
+ runcloud ios recording download "$SESSION_ID" "$RECORDING_ID" \
91
+ --output ./recording.mp4 --json
114
92
  ```
115
93
 
116
- Use the run.cloud sidecar flow. Do not install or expose an unauthenticated
117
- third-party tunnel. If the sidecar is unavailable, report that requirement
118
- instead of guessing a public URL.
94
+ Use `recording list` and `recording status` to inspect retained state,
95
+ lifecycle events, and actionable failures. Replace `ios` with `android` for an
96
+ Android session. Reuse the idempotency key when retrying `start`.
119
97
 
120
98
  ## Use the TypeScript SDK
121
99
 
122
- Install the SDK:
123
-
124
100
  ```bash
125
101
  npm install @run-cloud/sdk
126
102
  ```
@@ -132,84 +108,99 @@ import { writeFile } from "node:fs/promises";
132
108
  import { Client } from "@run-cloud/sdk";
133
109
 
134
110
  const cloud = new Client();
135
- const session = await cloud.ios.create({
136
- displayName: "Agent smoke",
137
- tags: { owner: "agent" },
111
+ const session = await cloud.android.create({
138
112
  inactivityTimeout: "60s",
139
113
  hardTimeout: "10m",
140
- codec: "auto",
114
+ tags: { owner: "agent" },
141
115
  });
142
116
 
143
117
  try {
144
- await cloud.ios.openUrl(session.id, "https://run.cloud");
145
- const screenshot = await cloud.ios.screenshot(session.id);
146
- await writeFile("run-cloud.png", screenshot);
118
+ await cloud.android.tap(session.id, { x: 0.5, y: 0.3 });
119
+ await cloud.android.typeText(session.id, "hello");
120
+ await cloud.android.pressKey(session.id, "enter");
121
+ const screenshot = await cloud.android.screenshot(session.id);
122
+ await writeFile("android.png", screenshot);
147
123
  } finally {
148
- await cloud.ios.delete(session.id);
124
+ await cloud.android.delete(session.id);
149
125
  }
150
126
  ```
151
127
 
152
- The mobile SDK surface is:
128
+ `cloud.ios`, `cloud.android`, and the platform-selectable `cloud.simulators`
129
+ expose `interact` plus convenience methods matching every CLI control above.
130
+ Interaction options accept `requestId`, `timeoutMs`, and `signal`; results are
131
+ typed acknowledgements. Use `RunCloudError` fields such as `code`, `retryable`,
132
+ `requestId`, and `action` when reporting API failures.
153
133
 
154
- - `cloud.account()` and `cloud.usage({ orgId? })`
155
- - `cloud.ios`: `create`, `list`, `get`, `openUrl`, `logs`, `followLogs`, `screenshot`,
156
- `uploadVideo`, `uploadMicrophoneAudio`, `delete`
157
- - `cloud.android`: `create`, `list`, `get`, `openUrl`, `logs`, `followLogs`, `delete`
158
- - `cloud.simulators`: runtime-platform `create`, `list`, `get`, `openUrl`,
159
- `delete`
160
- - `cloud.assets`: `upload`, `list`, `delete`
134
+ The lifecycle surface also includes `create`, `list`, `get`, `openUrl`, `logs`,
135
+ `followLogs`, and `delete`. Both platforms expose `screenshot`,
136
+ `startRecording`, `listRecordings`, `getRecording`, `stopRecording`, and
137
+ `downloadRecording`; iOS additionally supports `uploadVideo` and
138
+ `uploadMicrophoneAudio`. Inspect the installed types for complete create,
139
+ asset, log, recording, and media options.
161
140
 
162
- Create options include `model`, `region`, `displayName`, `tags`,
163
- `installAssets`, `inactivityTimeout`, `hardTimeout`, and `codec`.
141
+ In compact form, `cloud.ios`: `create`, `list`, `get`, `openUrl`, `logs`,
142
+ `followLogs`, `screenshot`, and the five recording methods above.
143
+ `cloud.android` provides the same shared lifecycle and control operations.
164
144
 
165
- Do not invent SDK methods for scripted taps, typing, recording, app lifecycle,
166
- or Android screenshots. Browser-stream interaction and iframe commands are
167
- separate from the public SDK.
145
+ ## Diagnose App Failures
168
146
 
169
- ## Inject iOS Media
147
+ ```bash
148
+ runcloud ios logs "$SESSION_ID" --tail 1000
149
+ runcloud android logs "$SESSION_ID" --tail 1000
150
+ ```
170
151
 
171
- Use `cloud.ios.uploadVideo(id, video, options)` for MP4 or QuickTime video. It
172
- stores a user-owned asset and imports it into Photos.
152
+ Use `--follow` while reproducing an issue. Before releasing a failed session,
153
+ capture a bounded retained snapshot; a follow stream contains only new entries.
173
154
 
174
- Use `cloud.ios.uploadMicrophoneAudio(id, audio, options)` for AAC, M4A, MP3,
175
- MP4-audio, or WAV. Pass an optional `bundleId`; otherwise it targets the
176
- foreground app. The operation relaunches the target app with microphone
177
- permission and loops the decoded audio through `AVAudioEngine`.
155
+ ## Connect Local Development
156
+
157
+ Connect a local Metro or mock server through the supported sidecar flow:
178
158
 
179
- Delete uploaded assets when they are no longer needed.
159
+ ```bash
160
+ runcloud ios tunnel "$SESSION_ID" --local-port 8081 --service metro --json
161
+ runcloud ios tunnel-status --json
162
+ ```
163
+
164
+ Do not expose an unauthenticated third-party tunnel. If the sidecar is
165
+ unavailable, report that requirement instead of guessing a public URL.
180
166
 
181
167
  ## Embed a Session
182
168
 
183
- - In React, use `RemoteControl` from `@runcloud/ui` with the signed session URL.
184
- - Add `embed=1` to the signed session URL for the clean iframe UI.
185
- - Add `loadingGuard=1` when the iframe should block interaction until streaming
186
- and app launch are ready.
187
- - For raw iframes, verify both `event.source` and the exact signed-URL origin
188
- before processing messages, and use that exact origin as the command
189
- `postMessage` target.
190
- - Handle `ios-simulator:status`, `ios-simulator:auth-error`,
191
- `ios-simulator:session-ended`, and
192
- `ios-simulator:session-restart-requested`.
193
- - Create a new session after a restart request; never reuse an ended URL.
194
- - Use `ios-simulator:command` for `reload`, `home`, `rotate`, `screenshot`, and
195
- `toggleAccessibility`.
196
-
197
- ## Run Maintained Demos
169
+ - Use `RemoteControl` from `@run-cloud/ui` with the signed session URL.
170
+ - Its ref exposes promise-based `interact` and convenience methods matching the
171
+ SDK controls. Handle `onInteractionResult` for inspectable acknowledgements.
172
+ - Add `embed=1` to raw iframe URLs. Add `loadingGuard=1` when interaction should
173
+ wait for streaming and app readiness.
174
+ - Raw iframe requests use `run-cloud:interaction`; acknowledgements use
175
+ `run-cloud:interaction-result`. Correlate them by `requestId`. To stop a
176
+ pending request, post `run-cloud:interaction-cancel` with the same
177
+ `requestId` and `action`.
178
+ - Verify `event.source` and the exact signed-URL origin, and use that origin as
179
+ the `postMessage` target.
180
+ - Legacy `ios-simulator:command` messages remain compatibility-only. Prefer the
181
+ generic acknowledged interaction channel for new code.
182
+ - Create a new session after an `ios-simulator:session-restart-requested`
183
+ message; never reuse an ended URL.
184
+
185
+ ## Assets, Samples, and Demos
198
186
 
199
187
  ```bash
188
+ runcloud sample download ios
189
+ runcloud asset push ./build/MyApp.tar.gz --name my-app --json
190
+ runcloud asset pull <asset-id>
191
+ runcloud ios create --install-asset my-app --json
200
192
  runcloud demo run eight-device-mosaic --open
201
193
  runcloud demo run live-camera-relay --open
202
194
  ```
203
195
 
204
- The bundled demos release their sessions automatically.
196
+ Delete uploaded assets when no longer needed. Bundled demos release their
197
+ sessions automatically.
205
198
 
206
199
  ## Guardrails
207
200
 
208
- - Release every session created during a task unless the user explicitly asks
209
- to keep it open.
201
+ - Release every session created during a task unless asked to keep it open.
210
202
  - Use inactivity and hard timeouts for unattended work.
211
- - Verify platform compatibility before changing application code after an
203
+ - Verify artifact/platform compatibility before changing app code after an
212
204
  install failure.
213
205
  - Do not expose credentials, signed viewer URLs, tunnel URLs, or simulator
214
206
  tokens in logs, screenshots, PR comments, or chat output.
215
- - Do not claim that browser iframe controls are public SDK methods.