runcloud 0.1.15 → 0.1.17
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/api.js +16 -1
- package/dist/commands/boxAccess.js +61 -2
- package/dist/commands/image.js +66 -21
- package/dist/commands/run-cloud.js +36 -146
- package/dist/commands/sandbox.js +329 -26
- package/dist/commands/sandboxOutput.js +70 -0
- package/dist/commands/secrets.js +203 -0
- package/dist/prompt.js +44 -0
- package/dist/run-cloud.js +2 -0
- package/dist/sandboxExec.js +91 -0
- package/dist/shellSession.js +4 -2
- package/dist/terminal.js +158 -0
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/skills/run-cloud-ios-simulator/SKILL.md +196 -0
- package/skills/run-cloud-ios-simulator/agents/openai.yaml +4 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
---
|
|
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, embedding, smoke-testing, connecting local Metro, capturing iOS screenshots, injecting iOS media, or releasing remote mobile sessions.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Operate run.cloud Mobile Sessions
|
|
7
|
+
|
|
8
|
+
Use run.cloud through the `runcloud` CLI for terminal workflows and
|
|
9
|
+
`@run-cloud/sdk` for application, CI, or agent code.
|
|
10
|
+
|
|
11
|
+
## Authenticate
|
|
12
|
+
|
|
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.
|
|
16
|
+
- 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.
|
|
22
|
+
|
|
23
|
+
Inspect account and organization credit before starting metered work:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
runcloud account --json
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Sessions require product access, organization credit below its ceiling, and
|
|
30
|
+
available fleet capacity. A create request may queue while capacity is full.
|
|
31
|
+
|
|
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:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
SESSION_ID=$(runcloud ios create \
|
|
45
|
+
--install ./build/MyApp.tar.gz \
|
|
46
|
+
--inactivity-timeout 60s \
|
|
47
|
+
--hard-timeout 10m \
|
|
48
|
+
--json | jq -r '.id')
|
|
49
|
+
|
|
50
|
+
trap 'runcloud ios delete "$SESSION_ID" >/dev/null 2>&1 || true' EXIT
|
|
51
|
+
|
|
52
|
+
runcloud ios get "$SESSION_ID" --json
|
|
53
|
+
runcloud ios open-url myapp://settings --id "$SESSION_ID" --json
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Use the corresponding `runcloud android` commands for Android artifacts.
|
|
57
|
+
|
|
58
|
+
The shared mobile lifecycle is:
|
|
59
|
+
|
|
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 delete <id>`
|
|
65
|
+
|
|
66
|
+
Create accepts `--model`, `--region`, `--display-name`, repeatable `--label`,
|
|
67
|
+
repeatable `--install`, repeatable `--install-asset`,
|
|
68
|
+
`--inactivity-timeout`, `--hard-timeout`, `--codec`, `--rm`, and `--json`.
|
|
69
|
+
|
|
70
|
+
Use assets and samples when no local artifact is ready:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
runcloud sample download ios
|
|
74
|
+
runcloud ios create --install ./run-cloud-sample-ios.app.tar.gz --json
|
|
75
|
+
|
|
76
|
+
runcloud asset push ./build/MyApp.tar.gz --name my-app --json
|
|
77
|
+
runcloud ios create --install-asset my-app --json
|
|
78
|
+
runcloud asset list --json
|
|
79
|
+
runcloud asset pull <asset-id> --output ./MyApp.tar.gz
|
|
80
|
+
runcloud asset delete <asset-id> --json
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
iOS needs an Apple Silicon simulator-compatible `.app`, `.zip`, `.tar.gz`, or
|
|
84
|
+
`.ipa` artifact. A device-signed App Store IPA is not a substitute. Android
|
|
85
|
+
needs an emulator-compatible artifact such as an APK.
|
|
86
|
+
|
|
87
|
+
## Connect Local Development
|
|
88
|
+
|
|
89
|
+
Connect a local Metro or mock server to an active iOS session:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
runcloud ios tunnel "$SESSION_ID" \
|
|
93
|
+
--local-port 8081 \
|
|
94
|
+
--service metro \
|
|
95
|
+
--json
|
|
96
|
+
|
|
97
|
+
runcloud ios tunnel-status --json
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Use the run.cloud sidecar flow. Do not install or expose an unauthenticated
|
|
101
|
+
third-party tunnel. If the sidecar is unavailable, report that requirement
|
|
102
|
+
instead of guessing a public URL.
|
|
103
|
+
|
|
104
|
+
## Use the TypeScript SDK
|
|
105
|
+
|
|
106
|
+
Install the SDK:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
npm install @run-cloud/sdk
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Always release metered sessions in `finally`:
|
|
113
|
+
|
|
114
|
+
```ts
|
|
115
|
+
import { writeFile } from "node:fs/promises";
|
|
116
|
+
import { Client } from "@run-cloud/sdk";
|
|
117
|
+
|
|
118
|
+
const cloud = new Client();
|
|
119
|
+
const session = await cloud.ios.create({
|
|
120
|
+
displayName: "Agent smoke",
|
|
121
|
+
labels: { owner: "agent" },
|
|
122
|
+
inactivityTimeout: "60s",
|
|
123
|
+
hardTimeout: "10m",
|
|
124
|
+
codec: "auto",
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
try {
|
|
128
|
+
await cloud.ios.openUrl(session.id, "https://run.cloud");
|
|
129
|
+
const screenshot = await cloud.ios.screenshot(session.id);
|
|
130
|
+
await writeFile("run-cloud.png", screenshot);
|
|
131
|
+
} finally {
|
|
132
|
+
await cloud.ios.delete(session.id);
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
The mobile SDK surface is:
|
|
137
|
+
|
|
138
|
+
- `cloud.account()` and `cloud.usage({ orgId? })`
|
|
139
|
+
- `cloud.ios`: `create`, `list`, `get`, `openUrl`, `screenshot`,
|
|
140
|
+
`uploadVideo`, `uploadMicrophoneAudio`, `delete`
|
|
141
|
+
- `cloud.android`: `create`, `list`, `get`, `openUrl`, `delete`
|
|
142
|
+
- `cloud.simulators`: runtime-platform `create`, `list`, `get`, `openUrl`,
|
|
143
|
+
`delete`
|
|
144
|
+
- `cloud.assets`: `upload`, `list`, `delete`
|
|
145
|
+
|
|
146
|
+
Create options include `model`, `region`, `displayName`, `labels`,
|
|
147
|
+
`installAssets`, `inactivityTimeout`, `hardTimeout`, and `codec`.
|
|
148
|
+
|
|
149
|
+
Do not invent SDK methods for scripted taps, typing, recording, app lifecycle,
|
|
150
|
+
or Android screenshots. Browser-stream interaction and iframe commands are
|
|
151
|
+
separate from the public SDK.
|
|
152
|
+
|
|
153
|
+
## Inject iOS Media
|
|
154
|
+
|
|
155
|
+
Use `cloud.ios.uploadVideo(id, video, options)` for MP4 or QuickTime video. It
|
|
156
|
+
stores a user-owned asset and imports it into Photos.
|
|
157
|
+
|
|
158
|
+
Use `cloud.ios.uploadMicrophoneAudio(id, audio, options)` for AAC, M4A, MP3,
|
|
159
|
+
MP4-audio, or WAV. Pass an optional `bundleId`; otherwise it targets the
|
|
160
|
+
foreground app. The operation relaunches the target app with microphone
|
|
161
|
+
permission and loops the decoded audio through `AVAudioEngine`.
|
|
162
|
+
|
|
163
|
+
Delete uploaded assets when they are no longer needed.
|
|
164
|
+
|
|
165
|
+
## Embed a Session
|
|
166
|
+
|
|
167
|
+
- Add `embed=1` to the signed session URL for the clean iframe UI.
|
|
168
|
+
- Add `loadingGuard=1` when the iframe should block interaction until streaming
|
|
169
|
+
and app launch are ready.
|
|
170
|
+
- Verify `event.source` is the expected iframe before processing messages.
|
|
171
|
+
- Handle `ios-simulator:status`, `ios-simulator:auth-error`,
|
|
172
|
+
`ios-simulator:session-ended`, and
|
|
173
|
+
`ios-simulator:session-restart-requested`.
|
|
174
|
+
- Create a new session after a restart request; never reuse an ended URL.
|
|
175
|
+
- Use `ios-simulator:command` for `reload`, `home`, `rotate`, `screenshot`, and
|
|
176
|
+
`toggleAccessibility`.
|
|
177
|
+
|
|
178
|
+
## Run Maintained Demos
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
runcloud demo run eight-device-mosaic --open
|
|
182
|
+
runcloud demo run live-camera-relay --open
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
The bundled demos release their sessions automatically.
|
|
186
|
+
|
|
187
|
+
## Guardrails
|
|
188
|
+
|
|
189
|
+
- Release every session created during a task unless the user explicitly asks
|
|
190
|
+
to keep it open.
|
|
191
|
+
- Use inactivity and hard timeouts for unattended work.
|
|
192
|
+
- Verify platform compatibility before changing application code after an
|
|
193
|
+
install failure.
|
|
194
|
+
- Do not expose credentials, signed viewer URLs, tunnel URLs, or simulator
|
|
195
|
+
tokens in logs, screenshots, PR comments, or chat output.
|
|
196
|
+
- Do not claim that browser iframe controls are public SDK methods.
|