peachsim 0.1.2399 → 0.1.2401
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/cli/bin.ts +1 -1
- package/cli/catalog/content.ts +520 -0
- package/cli/catalog/index.ts +4 -0
- package/cli/catalog/meta.ts +3881 -0
- package/cli/catalog/renderers.ts +659 -0
- package/cli/catalog/routes.ts +237 -0
- package/cli/catalog/types.ts +96 -0
- package/cli/commands/inspect.ts +3 -3
- package/cli/commands/record.ts +1 -1
- package/cli/dev-build-freshness.ts +1 -0
- package/cli/help-core.ts +6 -6
- package/cli/hidden-runtime-alias.ts +1 -1
- package/cli/outbound-endpoints.ts +5 -0
- package/cli/parse-args.ts +1 -1
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +53 -46
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +2 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +51 -44
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +53 -46
- package/dist-lib/host/fetch-proxy-handler.cjs +44 -41
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +48 -45
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +53 -50
- package/dist-lib/native-app-identity-project.cjs +22 -19
- package/dist-lib/native-app-identity-project.mjs +4 -3
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +24 -24
- package/dist-lib/public-origins-lib.json +59 -59
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +68 -61
- package/dist-lib/swift-compile.cjs +28 -30
- package/dist-lib/swift-compile.mjs +24 -26
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +29 -31
- package/dist-lib/vite.cjs +39 -36
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/capture/browserAccessibilityContract.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/webViewBridgeContract.d.ts +2 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/kotlin/toolchain.json +2 -2
- package/package.json +1 -3
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/GameplayKit.framework/Headers/GKState.h +78 -0
- package/sdk/ios/System/Library/Frameworks/GameplayKit.framework/Headers/GKStateMachine.h +69 -0
- package/sdk/ios/System/Library/Frameworks/GameplayKit.framework/Headers/GameplayKit.apinotes +269 -0
- package/sdk/ios/System/Library/Frameworks/GameplayKit.framework/Headers/GameplayKit.h +15 -0
- package/sdk/ios/System/Library/Frameworks/GameplayKit.framework/Headers/GameplayKitBase.h +38 -0
- package/sdk/ios/System/Library/Frameworks/GameplayKit.framework/Modules/module.modulemap +6 -0
- package/src/expo-swift-host.ts +30 -22
- package/src/wasm-optimize.ts +23 -24
- package/src/worklets-babel.ts +2 -6
- package/cli/registry.ts +0 -2
package/README.md
CHANGED
|
@@ -842,12 +842,12 @@ only writes build artifacts; run `peach skill install` explicitly to install
|
|
|
842
842
|
or refresh agent skills. The bundled
|
|
843
843
|
skills cover setup, debugging/perf/accessibility, testing, visual review, and
|
|
844
844
|
the generated `contrast` command index. The published CLI registry and generated
|
|
845
|
-
website docs both come from `packages/
|
|
845
|
+
website docs both come from `packages/peachsim/cli/catalog/`:
|
|
846
846
|
|
|
847
847
|
- `packages/peachsim/skills/contrast/SKILL.md` is generated from that registry
|
|
848
848
|
- `src/features/site/docs/peach/cli/*` is generated output, not hand-edited
|
|
849
849
|
|
|
850
|
-
When command docs or examples drift, update `packages/
|
|
850
|
+
When command docs or examples drift, update `packages/peachsim/cli/catalog/` and run:
|
|
851
851
|
|
|
852
852
|
```sh
|
|
853
853
|
bun run generate:peach-docs
|
package/cli/bin.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// peach CLI entry point. the full command and verb surface lives in the
|
|
4
|
-
// registry at `packages/
|
|
4
|
+
// registry at `packages/peachsim/cli/catalog/meta.ts` — help output,
|
|
5
5
|
// website docs, and agent skills all read from there. do not duplicate
|
|
6
6
|
// command listings in this file; run `peach --help` for the canonical
|
|
7
7
|
// surface.
|
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
import type { CliDocSection, CliOverviewSection } from './types'
|
|
2
|
+
|
|
3
|
+
export const cliOverviewSections: CliOverviewSection[] = [
|
|
4
|
+
{
|
|
5
|
+
title: 'What The CLI Covers',
|
|
6
|
+
body: `
|
|
7
|
+
The CLI is split across four jobs:
|
|
8
|
+
|
|
9
|
+
- booting a simulator shell around a local React Native bundler
|
|
10
|
+
- opening, listing, and targeting live sims over the shared bridge host
|
|
11
|
+
- running React Native apps, and Swift and Android apps in beta
|
|
12
|
+
- automating those sims for Maestro/Detox tests, screenshots, and recordings
|
|
13
|
+
- exposing the same bridge-backed runtime to CLI automation and generated docs
|
|
14
|
+
|
|
15
|
+
If you only remember one rule, use the highest-level command that matches the task. Reach for \`peach open\` before pasting shell URLs, and \`peach describe\` before debugging with screenshots.
|
|
16
|
+
`,
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
title: 'Command Groups',
|
|
20
|
+
body: `
|
|
21
|
+
The command set is intentionally shaped around workflow instead of implementation detail.
|
|
22
|
+
|
|
23
|
+
- setup and development: \`setup\`, \`open\`, \`desktop\`
|
|
24
|
+
- remote and preview sharing: \`remote\`, \`preview\`, \`ios\`, \`android\`
|
|
25
|
+
- agent onboarding: \`skill install\` installs the bundled peach workflow skills
|
|
26
|
+
- storage and device: \`storage\`, \`permissions\`, \`location\`, \`device\`
|
|
27
|
+
- automation: \`test\`, \`record\`, \`screenshot\`, \`assert\`
|
|
28
|
+
- live control: \`open\`, \`list\`, \`use\`, \`claim\`, \`close\`
|
|
29
|
+
- runtime reads: \`describe\`, \`find\`, and the \`get <noun>\` family (\`get tree\`, \`get a11y\`, \`get layout --styling\`, \`get url\`, \`get count\`, \`get errors\`, \`get requests\`, …)
|
|
30
|
+
- runtime actions: the \`do <action>\` family (\`do tap\`, \`do type\`, \`do scroll\`, \`do swipe\`, \`do key\`, …), plus \`shell <action>\` for simulator chrome
|
|
31
|
+
- instrumentation: \`perf\` for profiling and \`debug\` for raw runtime dumps, channels, snapshots, diffs, and events
|
|
32
|
+
- project metadata: \`project-report\`
|
|
33
|
+
- compatibility: \`compat\`; install health: \`doctor\`; help and problem reports: \`support\`
|
|
34
|
+
|
|
35
|
+
That grouping is what the website docs and terminal help now share from the same package source.
|
|
36
|
+
`,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
title: 'Bridge Model',
|
|
40
|
+
body: `
|
|
41
|
+
The bridge host is the control plane behind top-level verbs like \`describe\` and \`do tap\`, plus \`debug\`, \`open\`, \`list\`, \`use\`, \`claim\`, and \`close\`.
|
|
42
|
+
|
|
43
|
+
- default bridge port: \`{{bridgePort}}\`
|
|
44
|
+
- default shell URL: \`{{defaultShellUrl}}\`
|
|
45
|
+
- every connected sim gets a stable hex id like \`a1\`, \`a2\`, …, \`af\`, \`b0\`
|
|
46
|
+
- browser sims use isolated Playwright Chrome for Testing profiles; the desktop app uses the native host on Mac and Linux, and Electron on Windows
|
|
47
|
+
- \`peach open\` reuses the saved sim by default. \`--new\`, \`--profile\`, and \`--ephemeral\` explicitly request a separate sim
|
|
48
|
+
- the first CLI to send a state-changing command to a sim holds a 10-minute lease on it. read-only inspection and close bypass the lease. other agents cannot change state until the lease expires or, last-resort, is taken with \`peach claim --force\` (which interrupts whoever's mid-flow; prefer \`peach open --new\` to get a fresh sim instead). the lease refreshes on state-changing commands from the owner
|
|
49
|
+
|
|
50
|
+
This means you can open a sim one way and still inspect or debug it later from the CLI.
|
|
51
|
+
The CLI also remembers the last sim you opened or selected, so one common
|
|
52
|
+
pattern is:
|
|
53
|
+
|
|
54
|
+
\`\`\`bash
|
|
55
|
+
peach open 8081
|
|
56
|
+
peach describe
|
|
57
|
+
peach do tap-text "Sign in"
|
|
58
|
+
\`\`\`
|
|
59
|
+
`,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
title: 'Local Setup And CI',
|
|
63
|
+
body: `
|
|
64
|
+
Start the app's Metro, Expo, React Native, or One development server with its existing command. peach does not start or replace that server. Run \`peach open <port>\` from the app project root when possible. That directory is the fallback for custom-font, splash-screen, and project-configuration discovery when the development server does not advertise its root.
|
|
65
|
+
|
|
66
|
+
The local bridge is a lightweight HTTP and WebSocket server at \`{{defaultShellUrl}}\` by default. The background service keeps that bridge and the runtime ready between commands. It is strongly recommended for local agent work because inspect, interaction, and test commands start much faster. It remains optional: enable it any time with \`peach daemon install\`. CI can install the standalone CLI with \`curl -fsSL https://peachsim.com/install.sh | PEACH_NO_MODIFY_PATH=1 sh\` and run \`peach open <port> --driver playwright --headless\`; the command starts the bridge for the job without registering an operating-system service. The peach installer itself does not require Node.js, npm, or Bun.
|
|
67
|
+
|
|
68
|
+
Coding agents should run \`peach skill install\` once, then restart their session so they load the bundled setup, debugging, testing, visual, and performance workflows.
|
|
69
|
+
`,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
title: 'Common Flows',
|
|
73
|
+
body: `
|
|
74
|
+
\`\`\`bash
|
|
75
|
+
# load a local port into the current sim
|
|
76
|
+
peach open 8081
|
|
77
|
+
|
|
78
|
+
# open a second sim only when it must run concurrently
|
|
79
|
+
peach open --new 8085
|
|
80
|
+
|
|
81
|
+
# see what is connected and target one sim explicitly
|
|
82
|
+
peach list
|
|
83
|
+
peach describe --sim a3
|
|
84
|
+
|
|
85
|
+
# capture state around a bug
|
|
86
|
+
peach debug snapshot before
|
|
87
|
+
peach debug snapshot after
|
|
88
|
+
peach debug diff before after
|
|
89
|
+
|
|
90
|
+
# isolate app storage in the native desktop app, Windows Electron, or Playwright
|
|
91
|
+
peach storage profile create qa
|
|
92
|
+
peach open 8081 --profile qa
|
|
93
|
+
|
|
94
|
+
# run a single Maestro flow
|
|
95
|
+
peach test .maestro/login.yaml --record
|
|
96
|
+
\`\`\`
|
|
97
|
+
`,
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
title: 'Multiple Sims',
|
|
101
|
+
body: `
|
|
102
|
+
When more than one sim is connected, run \`peach list\` first and pass \`--sim\` to the command you care about. The CLI remembers the last sim you opened or used, so explicit \`--sim\` matters most when you are juggling more than one target and want deterministic automation.
|
|
103
|
+
|
|
104
|
+
Passing \`--sim <sim>\` also skips the CLI's identity lookup entirely. If you need a stable identity without pinning a sim on every call, export \`PEACH_CLI_IDENTITY=<any-stable-string>\` once for your shell or agent run.
|
|
105
|
+
|
|
106
|
+
Name yourself when you open: \`peach open <target> --id <name>\` makes the sim's agent indicator show \`<name>\` while you drive it, and every later \`peach\` command from the same session keeps using it. Pick a short name that says what you are doing, such as \`checkout-flow\`; without \`--id\` it uses the \`PEACH_AGENT_ID\` environment variable when set, else a shortened session id.
|
|
107
|
+
`,
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
title: 'Auto-Settle After Writes',
|
|
111
|
+
body: `
|
|
112
|
+
Every \`peach do <write>\` command (\`tap\`, \`tap-id\`, \`type\`, \`scroll\`, \`drag\`, \`swipe\`, etc.) briefly waits for the app's motion to end before returning: capped at 200ms (800ms when an agent environment is detected), returning once the app's render activity has stayed idle for two frames and any screen transition it started has finished. The wait listens for the app's own idle signal instead of polling it, so it adds no work to the animation it waits on. This keeps the next CLI call from capturing mid-animation state, which is the single most common source of agent confusion (\`do tap\` then \`describe\` showing a half-slid screen). When the auto-wait hits its cap without stabilizing, it warns that the next command may see mid-animation state and points at \`peach do settle\` for a longer wait, so agents know what happened.
|
|
113
|
+
|
|
114
|
+
Opt out with \`--no-wait\` on the command, or \`PEACH_NO_AUTO_WAIT=1\` for the sim. For longer waits (e.g. screens that animate slowly), chain an explicit \`peach do settle <seconds>\` or \`peach wait idle\` after the write.
|
|
115
|
+
|
|
116
|
+
Agent detection is automatic: \`CLAUDECODE\`, \`CLAUDE_CODE_ENTRYPOINT\`, \`CODEX_THREAD_ID\`, \`CURSOR_TRACE_ID\`, \`AIDER_MODEL\`, or explicit \`PEACH_AGENT=1\` enables agent-friendly defaults. Set \`PEACH_AGENT=0\` to force interactive defaults.
|
|
117
|
+
`,
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
title: 'Explicit Waits',
|
|
121
|
+
body: `
|
|
122
|
+
\`peach wait <kind>\` gives you bounded, loud synchronization primitives instead of \`sleep\` guessing:
|
|
123
|
+
|
|
124
|
+
- \`peach wait ready\` blocks until the guest app bundle is loaded and painted. A persistent runtime readiness flag is cleared on bundle reload and reset by full page reload, avoiding node-count heuristics that can mistake the connection screen for a loaded app. It is idempotent and returns immediately when the app is already ready. The default wait keeps going while Metro or the guest reports progress (bundle percent, startup phase, tree growth) and fails when progress stalls for 60 seconds or the 10-minute cap passes, naming the stalled phase (bundle, evaluation, first paint). Pass \`--max-ms\` or \`--timeout\` for a hard deadline. Run it after opening a new sim or after \`debug js "window.location.reload()"\`; no \`sleep\` is needed.
|
|
125
|
+
- \`peach wait idle\` blocks until animations, rAF queue, and layout all stop moving. Same signal as \`do settle\` but discoverable under the \`wait\` grouping.
|
|
126
|
+
- \`peach wait selector <testid-or-text>\` blocks until a node with that testID or that visible text is present and laid out; \`--text <text>\` waits on visible text instead. Playwright-style. When \`peach find --testid foo\` returns no result, the CLI prints this as a hint.
|
|
127
|
+
|
|
128
|
+
All \`wait\` subverbs accept \`--max-ms <ms>\` and exit non-zero on timeout, so scripts fail loudly.
|
|
129
|
+
|
|
130
|
+
\`peach do <tap|double-tap|long-press>\` also accept \`--testid <id>\` or \`--text <text>\` to resolve a node center at call time, consistent with \`find --testid\`. \`do tap <testid>\` is the default way to tap by id; \`--testid\` and \`do tap-id\` are aliases. A missing node prints the \`wait selector\` hint.
|
|
131
|
+
`,
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
title: 'Flow Drafting',
|
|
135
|
+
body: `
|
|
136
|
+
When \`peach test start\` is active, successful write commands like \`tap\`, \`tap-id\`, \`type\`, \`scroll\`, and \`swipe\` update the pending flow candidate. They do not automatically become part of the draft. Use \`peach test keep\` only after the last action proved itself.
|
|
137
|
+
`,
|
|
138
|
+
},
|
|
139
|
+
]
|
|
140
|
+
|
|
141
|
+
const remoteBundleSections: CliDocSection[] = [
|
|
142
|
+
{
|
|
143
|
+
title: 'Run Your App',
|
|
144
|
+
body: `
|
|
145
|
+
From your Expo or React Native app's folder:
|
|
146
|
+
|
|
147
|
+
\`\`\`sh
|
|
148
|
+
peach ios --remote .
|
|
149
|
+
\`\`\`
|
|
150
|
+
|
|
151
|
+
Peach builds the app with the app's own bundler, compiles its Expo modules, Nitro modules and C++ TurboModules on your Mac, and ships them with the bundle. Your Metro config needs no changes. Remote Android simulators do not load compiled Kotlin modules yet.
|
|
152
|
+
|
|
153
|
+
A prebuilt bundle also works. Build it with \`expo export:embed\` or \`react-native bundle\` through \`withPeach(config)\` from \`peachsim/metro\`, which records your installed package versions, then pass the file. Peach compiles the native modules of the app folder above the bundle, or of \`--native-project <app-dir>\`:
|
|
154
|
+
|
|
155
|
+
\`\`\`sh
|
|
156
|
+
npx expo export:embed --platform ios --dev false --bundle-output dist/main.js --assets-dest dist
|
|
157
|
+
peach ios --remote ./dist/main.js
|
|
158
|
+
\`\`\`
|
|
159
|
+
`,
|
|
160
|
+
},
|
|
161
|
+
]
|
|
162
|
+
|
|
163
|
+
export const cliCommandSections: Record<string, CliDocSection[]> = {
|
|
164
|
+
ios: remoteBundleSections,
|
|
165
|
+
android: remoteBundleSections,
|
|
166
|
+
remote: remoteBundleSections,
|
|
167
|
+
do: [
|
|
168
|
+
{
|
|
169
|
+
title: 'Inline Action Chains',
|
|
170
|
+
body: `
|
|
171
|
+
Repeat \`--then\` before each additional \`do\` action to run one ordered engine
|
|
172
|
+
batch:
|
|
173
|
+
|
|
174
|
+
\`\`\`sh
|
|
175
|
+
peach do tap email --then type user@example.com --then tap submit
|
|
176
|
+
\`\`\`
|
|
177
|
+
|
|
178
|
+
Each phrase uses the same positional grammar as its standalone command. The
|
|
179
|
+
shell passes \`--then\` through as a normal argument, so punctuation in action
|
|
180
|
+
data remains data:
|
|
181
|
+
|
|
182
|
+
\`\`\`sh
|
|
183
|
+
peach do tap email --then type "Hello, world" --then key return
|
|
184
|
+
\`\`\`
|
|
185
|
+
|
|
186
|
+
The exact \`--then\` token is reserved by \`peach do\` as the action boundary.
|
|
187
|
+
|
|
188
|
+
Batchable phrases are \`tap\`, \`tap-id\`, \`tap-text\`, \`double-tap\`,
|
|
189
|
+
\`long-press\`, \`type\`, \`type-into\`, \`key\`, \`key-sequence\`, \`dismiss\`,
|
|
190
|
+
\`scroll\`, \`drag\`, \`swipe\`, \`pinch\`, \`touch\`, and \`sleep\`.
|
|
191
|
+
Conveniences such as \`type-into\` and \`key-sequence\` expand into their normal
|
|
192
|
+
input steps inside the same batch. Run lifecycle and state commands such as
|
|
193
|
+
\`reload\`, \`settle\`, and \`peach wait\` separately.
|
|
194
|
+
|
|
195
|
+
The batch stops on the first failed action, then applies the usual post-write
|
|
196
|
+
auto-settle. Add \`--json\` for every engine-step result or \`--no-wait\` to
|
|
197
|
+
skip the final auto-settle.
|
|
198
|
+
`,
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
title: 'Inline Versus Durable Flows',
|
|
202
|
+
body: `
|
|
203
|
+
An inline chain is the shell-native form for a one-off batch. Put reusable,
|
|
204
|
+
reviewed, or CI-owned flows in Maestro YAML and run them with
|
|
205
|
+
\`peach test\`. A chain does not create or update a Maestro draft.
|
|
206
|
+
`,
|
|
207
|
+
},
|
|
208
|
+
],
|
|
209
|
+
test: [
|
|
210
|
+
{
|
|
211
|
+
title: 'One Test Command',
|
|
212
|
+
body: `
|
|
213
|
+
\`peach test\` owns every test: Maestro YAML flows, existing Detox suites, generated flows and live-authored drafts. It picks the runner from what you give it. Check \`--list-compat\` for the supported Maestro verbs before running an existing Maestro project:
|
|
214
|
+
|
|
215
|
+
\`\`\`sh
|
|
216
|
+
peach test # run .maestro/ or maestro/, else your Detox suite
|
|
217
|
+
peach test .maestro/login.yaml --app 8081 # one flow
|
|
218
|
+
peach test generate "log in and verify the welcome screen"
|
|
219
|
+
peach test start # begin a live-authored draft
|
|
220
|
+
peach do tap loginButton
|
|
221
|
+
peach test keep
|
|
222
|
+
peach test end --output .maestro/login.yaml --validate
|
|
223
|
+
peach test init # scaffold .maestro/login.yaml
|
|
224
|
+
peach test --list-compat # verb support matrix
|
|
225
|
+
\`\`\`
|
|
226
|
+
|
|
227
|
+
Supports: tapOn, longPressOn, assertVisible, inputText, scrollUntilVisible, launchApp with JSON arguments, stopApp, killApp, setLocation, travel, inputRandom*, clearState, copyTextFrom, evalScript, openLink, when:/optional:, onFlowStart/onFlowComplete, repeat, runFlow, env var interpolation. Launch arguments are installed before guest app entry and replace or clear on each later launch. setAirplaneMode logs that iOS simulators have no airplane mode and continues, as Maestro does.
|
|
228
|
+
|
|
229
|
+
Directory discovery selects root YAML flows by default, as Maestro does.
|
|
230
|
+
For nested suites, pass their folder, such as \`.maestro/flows\`, or add
|
|
231
|
+
\`config.yaml\` with \`flows: ["flows/**"]\`. Keep shared subflows outside those
|
|
232
|
+
globs; \`runFlow\` can still load them.
|
|
233
|
+
The CLI prints the result directory after writing preview or run receipts.
|
|
234
|
+
|
|
235
|
+
For live authoring, only the last successful write action becomes the pending
|
|
236
|
+
candidate; \`test keep\` commits it to the draft. \`test end --validate\`
|
|
237
|
+
re-runs from a clean run before clearing the draft, and preserves the draft if
|
|
238
|
+
validation fails.
|
|
239
|
+
|
|
240
|
+
Existing flow files still support frontmatter like:
|
|
241
|
+
|
|
242
|
+
\`\`\`yaml
|
|
243
|
+
---
|
|
244
|
+
app: 8081
|
|
245
|
+
electron: true
|
|
246
|
+
---
|
|
247
|
+
\`\`\`
|
|
248
|
+
|
|
249
|
+
That lets a flow file encode which target it opens and whether the desktop companion is the preferred runtime for that flow.
|
|
250
|
+
When you want frame timing for a full scripted path, run the same file with
|
|
251
|
+
\`--profile\`. Playback, recording, and profiling stay on the same bridge-backed sim/action surface as the rest of the CLI.
|
|
252
|
+
`,
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
title: 'Drop-in Detox',
|
|
256
|
+
body: `
|
|
257
|
+
A Jest config, a test file or a directory of them runs your existing Detox suite against peach with no code changes. With a peach shell running (\`peach open <app-port>\`), it sets up the Jest module mapping (\`^detox$\` → \`peachsim/detox\`), and runs your tests. Jest runs from your project, so add its dev dependencies once:
|
|
258
|
+
|
|
259
|
+
\`\`\`sh
|
|
260
|
+
npm i -D peachsim jest
|
|
261
|
+
\`\`\`
|
|
262
|
+
|
|
263
|
+
\`\`\`sh
|
|
264
|
+
peach test e2e/ --app 8081 # run the suite in e2e/ against the app on :8081
|
|
265
|
+
peach test init --detox # scaffold config + sample test
|
|
266
|
+
peach test e2e/ --watch # jest watch mode
|
|
267
|
+
peach test e2e/ -t "login" # filter by name
|
|
268
|
+
\`\`\`
|
|
269
|
+
|
|
270
|
+
Users can also add \`preset: 'peachsim/detox'\` to their own Jest config to run tests via plain \`npx jest\`.
|
|
271
|
+
`,
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
title: 'Accounts',
|
|
275
|
+
body: `
|
|
276
|
+
Running tests needs a signed-in Peach account on every machine: \`peach login\` on a desktop, or \`PEACH_API_KEY\` in CI and other shells. Every account, the free Seed plan included, can create a key with \`peach auth key create\` or in Billing → API Keys. The CLI verifies the key online and keeps the answer, so runs keep working offline for a while between checks. A GitHub App repository authenticates with its installation token and needs no key.
|
|
277
|
+
`,
|
|
278
|
+
},
|
|
279
|
+
],
|
|
280
|
+
record: [
|
|
281
|
+
{
|
|
282
|
+
title: 'Recording Notes',
|
|
283
|
+
body: `
|
|
284
|
+
\`record\` drives the engine's built-in canvas recorder over the WS bridge: no second browser, no ffmpeg. Encoding happens in the running page:
|
|
285
|
+
|
|
286
|
+
- \`webm\` via MediaRecorder (default, fastest)
|
|
287
|
+
- \`mp4\` via WebCodecs + mp4-muxer (chrome/edge, real h264)
|
|
288
|
+
- \`gif\` via gifenc on sampled frames
|
|
289
|
+
- \`--frames N\` dumps N evenly spaced png frames to a directory, handy when you only need a few snapshots from a sim (e.g. for handoff, regression reports, or diffing)
|
|
290
|
+
|
|
291
|
+
Format is inferred from \`--output\`'s extension, or pass \`--format\`. For step-by-step evidence around a bug, pair it with \`debug snapshot\` rather than trying to infer state from the video alone.
|
|
292
|
+
`,
|
|
293
|
+
},
|
|
294
|
+
],
|
|
295
|
+
screenshot: [
|
|
296
|
+
{
|
|
297
|
+
title: 'Screenshot Modes',
|
|
298
|
+
body: `
|
|
299
|
+
\`screenshot\` owns one-off PNG capture and App Store screenshot workflows:
|
|
300
|
+
|
|
301
|
+
- \`screenshot capture\` captures the current canvas as a PNG. Bare \`screenshot\` is the same path.
|
|
302
|
+
- \`screenshot layers\` exports one screen as engine-isolated layers: a normal frame, the frame re-rendered with the listed subtrees hidden, each subtree alone on a transparent frame, and a manifest of logical rects. The isolation is a real engine re-render, so content and glass blur behind a hidden subtree are genuine.
|
|
303
|
+
- \`screenshot slides\` drives the live slide composer through the shell bridge.
|
|
304
|
+
- \`screenshot appstore\` runs a plan that captures raw screenshots, frames them, and composes export canvases.
|
|
305
|
+
- \`screenshot appstore capture\` headlessly recaptures editable org-deck slides.
|
|
306
|
+
|
|
307
|
+
Use \`mode screenshot on\` when you need the browser chrome hidden around the canvas before capturing.
|
|
308
|
+
`,
|
|
309
|
+
},
|
|
310
|
+
],
|
|
311
|
+
storage: [
|
|
312
|
+
{
|
|
313
|
+
title: 'Two Kinds Of Storage',
|
|
314
|
+
body: `
|
|
315
|
+
\`storage clear\` targets the guest app in the current sim: localStorage, sessionStorage, secure-store, and IndexedDB are cleared through the live reload bridge.
|
|
316
|
+
|
|
317
|
+
\`storage profile\` manages persistent launch profiles used by the native app, Windows Electron and Playwright. Profiles isolate browser storage at window/context creation time, so opening with \`--profile <id>\` always creates a fresh isolated sim.
|
|
318
|
+
`,
|
|
319
|
+
},
|
|
320
|
+
],
|
|
321
|
+
perf: [
|
|
322
|
+
{
|
|
323
|
+
title: 'Profiling Surfaces',
|
|
324
|
+
body: `
|
|
325
|
+
\`perf cpu\` captures sampled JavaScript CPU profiles through CDP. Open the sim with a CDP port first:
|
|
326
|
+
|
|
327
|
+
\`\`\`bash
|
|
328
|
+
peach open 8081 --new --driver playwright --cdp-port 9222
|
|
329
|
+
peach perf cpu --cdp-port 9222 --duration 5
|
|
330
|
+
\`\`\`
|
|
331
|
+
|
|
332
|
+
\`perf react\` reads React render cost from the tenant worker. \`perf shell\` records shell and compositor frame timing. \`perf scroll\` records timestamp-aligned per-frame offsets from the tenant, shell, and compositor workers while it is armed; use \`--json\` on stop for the complete series.
|
|
333
|
+
`,
|
|
334
|
+
},
|
|
335
|
+
],
|
|
336
|
+
debug: [
|
|
337
|
+
{
|
|
338
|
+
title: 'What Debug Owns',
|
|
339
|
+
body: `
|
|
340
|
+
\`debug\` is for engine state, not user-facing UI summaries. It owns:
|
|
341
|
+
|
|
342
|
+
- channel toggles like \`sheets\`, \`portals\`, \`touch\`, and \`render\`
|
|
343
|
+
- snapshots and diffs
|
|
344
|
+
- recent event history
|
|
345
|
+
- on-demand inspectors for complex runtime structures
|
|
346
|
+
|
|
347
|
+
If you want to know what is on screen, use \`describe\` or \`get\`. If you want to know what the engine thinks just happened, use \`debug\`.
|
|
348
|
+
`,
|
|
349
|
+
},
|
|
350
|
+
],
|
|
351
|
+
open: [
|
|
352
|
+
{
|
|
353
|
+
title: 'Run It From The App Root',
|
|
354
|
+
body: `
|
|
355
|
+
Start Metro, Expo, React Native, or One with the app's normal development command. peach does not own that process. Then run \`peach open\` from the app project root, where its Metro or Expo configuration lives. The command can run elsewhere, but this directory is the fallback for discovering custom native-linked fonts, the configured splash screen, and other file-based app configuration when the development server does not report its project root.
|
|
356
|
+
`,
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
title: 'Resolution Rules',
|
|
360
|
+
body: `
|
|
361
|
+
\`open\` accepts five inputs:
|
|
362
|
+
|
|
363
|
+
- a raw dev-server port like \`8081\`
|
|
364
|
+
- a dev-server base URL like \`http://localhost:8081\`
|
|
365
|
+
- a full bundle URL
|
|
366
|
+
- a built bundle file like \`./dist/ios.js\` (\`.js\`, \`.bundle\` or \`.jsbundle\`)
|
|
367
|
+
- a full peach shell URL
|
|
368
|
+
|
|
369
|
+
For raw targets, \`open\` now hands the input to the shell instead of guessing a fallback bundle URL. Numeric targets open as \`/rn/<port>\`, while non-port inputs fall back to \`/rn?open=...\` so ConnectRN can resolve them inside the shell.
|
|
370
|
+
`,
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
title: 'Production Bundles',
|
|
374
|
+
body: `
|
|
375
|
+
A built bundle runs with no dev server, on production React and React Native. Build it with the app's own tool, then open the file:
|
|
376
|
+
|
|
377
|
+
\`\`\`sh
|
|
378
|
+
npx one build --platform ios # One: writes dist/ios.js
|
|
379
|
+
npx expo export:embed --platform ios --dev false --bundle-output dist/ios.js
|
|
380
|
+
npx react-native bundle --platform ios --dev false --entry-file index.js --bundle-output dist/ios.js
|
|
381
|
+
peach open ./dist/ios.js
|
|
382
|
+
\`\`\`
|
|
383
|
+
|
|
384
|
+
The bridge serves a copy of the file, so the sim keeps working after the command returns. The bundle's own \`__DEV__\` prelude decides production or development, so the sim boots the matching runtime first. Fonts, splash and identity come from the nearest app above the file, or from \`--project-root\`. Peach serves the bundle file only: images an app loads from a Metro assets folder beside it do not load this way yet.
|
|
385
|
+
`,
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
title: 'Managed Surfaces',
|
|
389
|
+
body: `
|
|
390
|
+
\`open\` uses an isolated Playwright browser by default. Pass \`--driver desktop\` for the native app on Mac and Linux, or \`--driver electron\` for Windows. Both register with the same bridge and reuse the current managed sim unless you explicitly request a new profile or sim.
|
|
391
|
+
|
|
392
|
+
Sim pages never fall through to the operating-system browser handler. Preview pages and external links still open in the user's browser because they are viewing pages, not driveable sims.
|
|
393
|
+
`,
|
|
394
|
+
},
|
|
395
|
+
],
|
|
396
|
+
list: [
|
|
397
|
+
{
|
|
398
|
+
title: 'Output Shape',
|
|
399
|
+
body: `
|
|
400
|
+
The sim list is meant to answer two questions quickly:
|
|
401
|
+
|
|
402
|
+
- what shells are connected right now?
|
|
403
|
+
- which one actually loaded the app I care about?
|
|
404
|
+
|
|
405
|
+
Each sim prints its id, loaded target summary, full URL when available, readiness state, and whether it is the current primary sim.
|
|
406
|
+
`,
|
|
407
|
+
},
|
|
408
|
+
],
|
|
409
|
+
use: [
|
|
410
|
+
{
|
|
411
|
+
title: 'Primary Sim Behavior',
|
|
412
|
+
body: `
|
|
413
|
+
If you omit a sim id, \`use\` targets the primary open sim. That makes it convenient after \`open\` or when you only have one sim connected.
|
|
414
|
+
`,
|
|
415
|
+
},
|
|
416
|
+
],
|
|
417
|
+
close: [
|
|
418
|
+
{
|
|
419
|
+
title: 'Close Semantics',
|
|
420
|
+
body: `
|
|
421
|
+
\`close\` sends a bridge request to the target sim and then waits for it to disappear from the host's connection list. If a sim ignores the request or is in the middle of disconnecting already, the command reports that state instead of pretending the close succeeded instantly.
|
|
422
|
+
|
|
423
|
+
\`--all\` closes every connected sim; \`--others\` closes everything except the current/targeted sim. Both are the cleanup path when leaked sims (e.g. from repeated \`open --new\`) accumulate on the bridge; use \`--others\` to clear the backlog without losing the sim you are working in.
|
|
424
|
+
`,
|
|
425
|
+
},
|
|
426
|
+
],
|
|
427
|
+
setup: [
|
|
428
|
+
{
|
|
429
|
+
title: 'No Project Setup Required',
|
|
430
|
+
body: `
|
|
431
|
+
Bare \`peach\` works without changing the current project. On the first human run,
|
|
432
|
+
the guided flow:
|
|
433
|
+
|
|
434
|
+
- explains and offers the strongly recommended background service
|
|
435
|
+
- keeps the current window preference, or uses the native desktop app on Apple silicon macOS and Linux x64 and installs it; Windows offers Browser or its Desktop app
|
|
436
|
+
- opens ConnectRN before asking about diagnostics or repository changes
|
|
437
|
+
- offers to enable bounded diagnostics and crash reports, which are off by default
|
|
438
|
+
- only inside a Git repository with package.json, offers an exact dependency and script for teammates; this final choice defaults to no
|
|
439
|
+
|
|
440
|
+
Declining the service does not disable peach. It uses an on-demand bridge instead.
|
|
441
|
+
Enable the faster service later with \`peach daemon install\`. Re-run the optional
|
|
442
|
+
choices with \`peach setup\`.
|
|
443
|
+
|
|
444
|
+
On Apple silicon macOS and Linux x64, setup installs the native desktop app and
|
|
445
|
+
\`peach open\` uses it, since it is faster than the browser. Linux installs a
|
|
446
|
+
native \`.deb\` with \`sudo apt-get install\` and needs a desktop session. Select
|
|
447
|
+
a browser window with \`peach open <port> --driver playwright --headed\`. The
|
|
448
|
+
background service keeps the bridge ready for either window and is a separate
|
|
449
|
+
choice.
|
|
450
|
+
`,
|
|
451
|
+
},
|
|
452
|
+
],
|
|
453
|
+
'project-report': [
|
|
454
|
+
{
|
|
455
|
+
title: 'Project discovery',
|
|
456
|
+
body: `
|
|
457
|
+
The default scan starts at the detected workspace or Git repository root. Use \`--app <dir>\` to limit it to one directory. React Native and Expo entries reuse the compatibility scanner for native libraries; native entries read Xcode build settings, SwiftPM pins, CocoaPods locks and Gradle version metadata. Each dependency version says whether it is installed, locked or declared.
|
|
458
|
+
|
|
459
|
+
The command never executes app config, Swift or Gradle builds. Dynamic or unspecified settings remain unknown. It skips dependency, build, cache and hidden directories and directory symlinks. Discovery is capped at 12 levels, 10,000 directories and 200,000 entries, with at most 4 MiB read per metadata file; the report says when discovery is incomplete. Paths are relative and dependency URLs are redacted. Source and environment values are excluded.
|
|
460
|
+
|
|
461
|
+
To send the report, run \`peach support report "<description>"\`, inspect the preview and explicitly confirm. Agents need your approval before using \`--yes\`.
|
|
462
|
+
`,
|
|
463
|
+
},
|
|
464
|
+
],
|
|
465
|
+
support: [
|
|
466
|
+
{
|
|
467
|
+
title: 'Ask, Try, Report, Check',
|
|
468
|
+
body: `
|
|
469
|
+
Ask when the docs do not cover something: \`peach support ask "<question>"\` waits up to 15 minutes and prints the answer, which comes from an assistant that reads the simulator's docs and code with the earlier asks and reports of your account. \`--no-wait\` returns the id at once.
|
|
470
|
+
|
|
471
|
+
An account's first 5 asks are answered right away. Later asks are kept and queued until we approve the account, then answered in order; \`peach support status\` shows them as \`waitlisted\` meanwhile. Reports and status are never held.
|
|
472
|
+
|
|
473
|
+
Want onboarding support? Add funds: \`peach support fund\` opens the payment page in your default browser, waits for the payment, and binds the funded account to this login.
|
|
474
|
+
|
|
475
|
+
Report when something is broken on our side: \`peach support report "<what happened, the exact steps, expected and actual>"\`. The command shows the description and attachment summary before it sends anything. An interactive terminal asks for confirmation. A non-interactive agent must first show the finding to the user and ask whether to report it. Only after the user explicitly agrees may the agent rerun with \`--yes\`. A report attaches the local compatibility scan and the same report printed by \`peach project-report\`: discovered project paths, dependency versions, native build settings, and machine toolchain versions. Use \`--dry-run\` to inspect that attachment summary without sending.
|
|
476
|
+
|
|
477
|
+
Check with \`peach support status\`. It lists your account's asks and reports, newest first, with our replies, the commit that fixed a report, and the runtime release that shipped it. \`--new\` lists only what changed since the last check, so an agent can run it every hour. Nothing needs an id kept by hand: the account your \`peach login\` names owns every item.
|
|
478
|
+
`,
|
|
479
|
+
},
|
|
480
|
+
],
|
|
481
|
+
desktop: [
|
|
482
|
+
{
|
|
483
|
+
title: 'Desktop Companion Role',
|
|
484
|
+
body: `
|
|
485
|
+
On Apple silicon macOS and Linux x64, the native desktop app is the simulator
|
|
486
|
+
window because it is faster than the browser. Setup installs it, and on a Mac
|
|
487
|
+
the first \`peach open\` installs it if it is missing. Windows uses Electron;
|
|
488
|
+
Intel Mac and Linux arm64 use the browser.
|
|
489
|
+
|
|
490
|
+
\`peach desktop install\` installs or updates the app by hand. Use
|
|
491
|
+
\`peach desktop\` to open ConnectRN in it. On Linux, the desktop installer uses
|
|
492
|
+
a \`.deb\` and \`sudo apt-get install\` and needs a desktop session.
|
|
493
|
+
\`peach desktop install --native\` on Linux installs the standalone headless
|
|
494
|
+
host instead of the desktop app.
|
|
495
|
+
|
|
496
|
+
Use \`peach open <port> --driver playwright --headed\` for a browser window. The
|
|
497
|
+
background daemon keeps the bridge ready for either window and is a separate
|
|
498
|
+
optional choice. Both windows use the same CLI inspection and interaction commands.
|
|
499
|
+
`,
|
|
500
|
+
},
|
|
501
|
+
],
|
|
502
|
+
auth: [
|
|
503
|
+
{
|
|
504
|
+
title: 'Auth Sources',
|
|
505
|
+
body: `
|
|
506
|
+
\`auth\` prints the credential the CLI will use. An API key comes from \`PEACH_API_KEY\`, or else the key \`peach setup\` saved from \`PEACH_API_KEY\`, \`~/Downloads/peach-api-key.txt\` or a paste. \`auth key create\` creates one for the signed-in account and prints it once; Billing → API Keys on peachsim.com lists and revokes them. Every account, the free Seed plan included, can create keys. \`login\` stores a desktop session token for interactive local uploads, and \`logout\` clears it and the saved key.
|
|
507
|
+
`,
|
|
508
|
+
},
|
|
509
|
+
],
|
|
510
|
+
config: [
|
|
511
|
+
{
|
|
512
|
+
title: 'Local Preferences',
|
|
513
|
+
body: `
|
|
514
|
+
\`config telemetry\` persists your diagnostics choice in ~/.peach/config.json. Bounded diagnostics and automatic crash reports are off until you enable them with \`peach config telemetry on\`, \`peach setup --analytics on\`, or guided setup. CI, headless sessions, pipes and agent runs keep existing choices. \`DO_NOT_TRACK=1\` or \`DO_NOT_TRACK=true\` disables both for the current run.
|
|
515
|
+
|
|
516
|
+
Each report includes CLI and runtime versions, OS and architecture, the command name without arguments, and a random anonymous per-install ID stored with your privacy preferences. Package incompatibilities include package name (160 characters), version (80) and unsupported API (160). CLI failures include the error class (160) and first line of its message (300). Runtime errors, red-screen titles and warnings such as font registration failures include only the first line of the message (300), plus those environment fields. Home paths, other local paths, source filenames and URL paths/queries are redacted; dependency paths retain only package names. Messages can contain text your app puts in an error or warning. Reports exclude stacks, arguments, app source, structured app data, account identity, recordings and screenshots. Set \`PEACH_HINTS=off\` to suppress hints. Set \`PEACH_UPDATE_CHECK=off\` to disable automatic CLI checks, runtime updates, and their notices. Start the bridge with this environment; persist it for the background service with \`PEACH_UPDATE_CHECK=off peach daemon install --force\`.
|
|
517
|
+
`,
|
|
518
|
+
},
|
|
519
|
+
],
|
|
520
|
+
}
|