@farmslot/adapter-rn 0.15.0
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/CHANGELOG.md +117 -0
- package/LICENSE +21 -0
- package/README.md +143 -0
- package/bin/farmslot-adapter-rn.mjs +10 -0
- package/dist/agent-device-ui-transport.d.ts +88 -0
- package/dist/agent-device-ui-transport.d.ts.map +1 -0
- package/dist/agent-device-ui-transport.js +1148 -0
- package/dist/agent-device-ui-transport.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +169 -0
- package/dist/cli.js.map +1 -0
- package/dist/constants.d.ts +6 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +6 -0
- package/dist/constants.js.map +1 -0
- package/dist/doctor.d.ts +17 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js +125 -0
- package/dist/doctor.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/json.d.ts +2 -0
- package/dist/json.d.ts.map +1 -0
- package/dist/json.js +5 -0
- package/dist/json.js.map +1 -0
- package/dist/metro-recipe-bridge-transport.d.ts +12 -0
- package/dist/metro-recipe-bridge-transport.d.ts.map +1 -0
- package/dist/metro-recipe-bridge-transport.js +63 -0
- package/dist/metro-recipe-bridge-transport.js.map +1 -0
- package/dist/redaction.d.ts +3 -0
- package/dist/redaction.d.ts.map +1 -0
- package/dist/redaction.js +57 -0
- package/dist/redaction.js.map +1 -0
- package/dist/runner.d.ts +20 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +270 -0
- package/dist/runner.js.map +1 -0
- package/dist/scaffold.d.ts +14 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +82 -0
- package/dist/scaffold.js.map +1 -0
- package/dist/simctl-video-recorder.d.ts +6 -0
- package/dist/simctl-video-recorder.d.ts.map +1 -0
- package/dist/simctl-video-recorder.js +160 -0
- package/dist/simctl-video-recorder.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +11 -0
- package/dist/version.js.map +1 -0
- package/package.json +81 -0
- package/templates/scripts/agentic/recipe/README.md +15 -0
- package/templates/scripts/agentic/recipe/action-manifest.json +547 -0
- package/templates/scripts/agentic/recipe/action-manifest.with-bridge.json +599 -0
- package/templates/scripts/agentic/recipe/recipes/expo.config.recipe.json +37 -0
- package/templates/scripts/agentic/validate-recipe.sh +64 -0
- package/templates/src/farmslot/RecipeBridgeProvider.tsx +127 -0
- package/templates/src/farmslot/RecipeHud.tsx +138 -0
- package/templates/src/farmslot/index.ts +11 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@farmslot/adapter-rn` (published as `@farmslot/expo-recipe` up to 0.14.0) are tracked here.
|
|
4
|
+
|
|
5
|
+
## Unreleased
|
|
6
|
+
|
|
7
|
+
- Active-development baseline; add user-facing changes here before release or package publication.
|
|
8
|
+
|
|
9
|
+
## 0.15.0 - 2026-10-05
|
|
10
|
+
|
|
11
|
+
- **Breaking:** renamed from `@farmslot/expo-recipe`, with no alias package. The bin is now `farmslot-adapter-rn` (was `farmslot-expo-recipe`), and `init` writes `recipe:*` scripts that call it. Run provenance and the bundled recipe source report `@farmslot/adapter-rn`. `runExpoRecipeCli` and `EXPO_RECIPE_PACKAGE_VERSIONS` are now `runAdapterRnCli` and `ADAPTER_RN_PACKAGE_VERSIONS`. Expo-specific APIs (`installExpoRecipeScaffold`, `runExpoRecipeDoctor`, `runExpoRecipeDocument`, …) keep their names.
|
|
12
|
+
- Publish with protocol 0.34.0 and recipe-runner 0.23.0.
|
|
13
|
+
|
|
14
|
+
## 0.14.0 - 2026-10-04
|
|
15
|
+
|
|
16
|
+
- Depend on `@farmslot/recipe-runner` (renamed from `@farmslot/recipe-harness`).
|
|
17
|
+
- Publish with protocol 0.34.0 and recipe-runner 0.23.0.
|
|
18
|
+
|
|
19
|
+
## 0.13.1 - 2026-10-03
|
|
20
|
+
|
|
21
|
+
- Publish with recipe-harness 0.22.1 so consumers share one recipe-harness copy.
|
|
22
|
+
|
|
23
|
+
## 0.13.0 - 2026-10-02
|
|
24
|
+
|
|
25
|
+
- Provide `@farmslot/expo-recipe` to recipe libraries that declare it in `requires`.
|
|
26
|
+
- Publish with protocol 0.34.0 and recipe-harness 0.22.0 so consumers share one protocol and runtime.
|
|
27
|
+
|
|
28
|
+
## 0.12.2 - 2026-09-29
|
|
29
|
+
|
|
30
|
+
- Publish with protocol 0.33.0 and recipe-harness 0.21.1 so consumers share one protocol and runtime.
|
|
31
|
+
|
|
32
|
+
## 0.12.1 - 2026-09-28
|
|
33
|
+
|
|
34
|
+
- Publish against protocol 0.32.0 and recipe-harness 0.20.0 so downstream installs share one protocol and recording runtime.
|
|
35
|
+
|
|
36
|
+
## 0.12.0 - 2026-09-27
|
|
37
|
+
|
|
38
|
+
- Agent Device `ui.scroll` maps one-axis `delta_x`/`delta_y` to a relative direction and pixel scroll, and rejects absolute `offset_x`/`offset_y` instead of ignoring them.
|
|
39
|
+
|
|
40
|
+
## 0.11.0 - 2026-09-20
|
|
41
|
+
|
|
42
|
+
- Published against `@farmslot/protocol` 0.30.0 so one protocol copy serves every dependent (child checklist units and the acceptance ledger arrive through that pin).
|
|
43
|
+
|
|
44
|
+
## 0.10.0 - 2026-09-18
|
|
45
|
+
|
|
46
|
+
- Publish against `@farmslot/protocol` 0.29.0 so downstream installs resolve one protocol version.
|
|
47
|
+
|
|
48
|
+
## 0.9.2 - 2026-09-17
|
|
49
|
+
|
|
50
|
+
- Publish against `@farmslot/protocol` 0.28.0 so a consumer that also installs `@farmslot/agent-runtime` 0.10.0 resolves one protocol copy.
|
|
51
|
+
|
|
52
|
+
## 0.9.1 - 2026-09-13
|
|
53
|
+
|
|
54
|
+
- Publish against `@farmslot/protocol` 0.26.0 so a consumer that also installs `@farmslot/agent-runtime` 0.9.0 resolves one protocol copy.
|
|
55
|
+
|
|
56
|
+
## 0.9.0 - 2026-09-07
|
|
57
|
+
|
|
58
|
+
- Expose transport-owned `open()` so native consumers can inspect before interacting without reopening the same session; pair it with `close()`.
|
|
59
|
+
|
|
60
|
+
## 0.8.2 - 2026-08-14
|
|
61
|
+
|
|
62
|
+
- fix: require `test_id` for verifiable Android input replacement, retry empty placeholders with bounded chunked clearing, and fail closed when the field cannot be observed.
|
|
63
|
+
- fix: send `Back` through native navigation, require observable keyboard effects for `Escape`, `Enter`, and `Return` on Android and iOS, and honor the recipe node timeout while waiting for the resulting UI to settle.
|
|
64
|
+
|
|
65
|
+
## 0.8.1 - 2026-08-14
|
|
66
|
+
|
|
67
|
+
- Publish against `@farmslot/recipe-harness` 0.15.0 so consumers use one Recipe Protocol 0.21.0 runtime.
|
|
68
|
+
|
|
69
|
+
## 0.8.0 - 2026-08-14
|
|
70
|
+
|
|
71
|
+
- fix: route standard Back, Escape, Enter, and Return key presses through the native device keyboard on opaque Android and iOS runtimes, then wait for the resulting UI transition.
|
|
72
|
+
- fix: verify Android `ui.set_input` replacement, preserve exact whitespace, distinguish labels from values, and prove masked-field clearing before retrying.
|
|
73
|
+
- Publish against `@farmslot/protocol` 0.21.
|
|
74
|
+
|
|
75
|
+
## 0.7.1 - 2026-08-03
|
|
76
|
+
|
|
77
|
+
- fix: expose the canonical native UI action set from the package root so consumers can verify provider capability wiring without duplicating it.
|
|
78
|
+
|
|
79
|
+
## 0.7.0 - 2026-08-03
|
|
80
|
+
|
|
81
|
+
- fix: make native full-surface capture reliably target explicit scroll views, tolerate dropped iOS swipes, and stop at the requested end marker.
|
|
82
|
+
- feat: add opt-in `ui.capture_surface` support for native Expo recipes, including targetable scroll surfaces, bounded full-height stitching, virtualized-list end detection, and position restoration. Publish against `@farmslot/protocol` 0.18.0 and `@farmslot/recipe-harness` 0.14.0.
|
|
83
|
+
|
|
84
|
+
## 0.6.0 - 2026-08-02
|
|
85
|
+
|
|
86
|
+
- feat: drive swipe, pan, drag, and `hold_ms` long-press recipe actions through the assigned native device, select Android devices by ADB serial, retry failed tool/device discovery, reject unsupported native paths before execution, and retain resolved coordinate phases. Publish against `@farmslot/protocol` 0.16.0 and `@farmslot/recipe-harness` 0.12.0.
|
|
87
|
+
|
|
88
|
+
## 0.5.0 - 2026-08-01
|
|
89
|
+
|
|
90
|
+
- **BREAKING:** Remove the `WATCHER_PORT` fallback and implicit port `7677`; Metro-backed actions now require `FARMSLOT_RECIPE_METRO_PORT` or `METRO_PORT` set to an integer from 1 through 65535. Port resolution remains lazy, so headless and native-only runs do not require either variable.
|
|
91
|
+
- Publish against `@farmslot/protocol` 0.15.0 and `@farmslot/recipe-harness` 0.11.1 so Expo consumers receive structured suite evidence and idempotent iOS lifecycle restarts.
|
|
92
|
+
|
|
93
|
+
## 0.4.0 - 2026-07-24
|
|
94
|
+
|
|
95
|
+
- Accept root recipe parameters and task-local composed recipes.
|
|
96
|
+
- Enforce assigned-device context for native actions anywhere in the resolved recipe graph.
|
|
97
|
+
- Generate strict keyed Action Manifest v1 templates.
|
|
98
|
+
|
|
99
|
+
## 0.3.0 - 2026-07-19
|
|
100
|
+
|
|
101
|
+
- Security: recipe runs honor inherited source provenance before device actions
|
|
102
|
+
|
|
103
|
+
## 0.2.0 - 2026-07-12
|
|
104
|
+
|
|
105
|
+
- Drive Expo and React Native recipe UI actions through Agent Device on the simulator or device assigned by Farmslot, including passive native UI observations and screenshot artifacts.
|
|
106
|
+
|
|
107
|
+
## 0.1.2 - 2026-07-09
|
|
108
|
+
|
|
109
|
+
- chore: stamp the generated Expo config recipe with the canonical Recipe Protocol v1 `$schema` URL.
|
|
110
|
+
|
|
111
|
+
## 0.1.1
|
|
112
|
+
|
|
113
|
+
- Make the generated HUD compact, wrapping, and configurable for client apps.
|
|
114
|
+
|
|
115
|
+
## 0.1.0
|
|
116
|
+
|
|
117
|
+
- Initial public release of the Expo recipe adapter, CLI, and template assets.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Arthur Breton
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# @farmslot/adapter-rn
|
|
2
|
+
|
|
3
|
+
Convenience Expo/React Native integration package built on top of `@farmslot/recipe-runner`. It does not define a second protocol or runner; it scaffolds an Expo project so it can use the same Recipe Protocol v1 and official harness actions as other Farmslot projects.
|
|
4
|
+
|
|
5
|
+
Public docs: <https://farmslot.io/docs/guides/adapter-rn>
|
|
6
|
+
|
|
7
|
+
## Source layout
|
|
8
|
+
|
|
9
|
+
| Path | Owns |
|
|
10
|
+
| ------------------ | ------------------------------------------------------------- |
|
|
11
|
+
| `bin/` | Published `farmslot-adapter-rn` executable shim. |
|
|
12
|
+
| `src/cli.ts` | Init command parsing and CLI entrypoint. |
|
|
13
|
+
| `src/scaffold.ts` | File-copy and package-script scaffolding. |
|
|
14
|
+
| `src/doctor.ts` | Project integration checks. |
|
|
15
|
+
| `src/runner.ts` | Expo smoke runner wiring built on `@farmslot/recipe-runner`. |
|
|
16
|
+
| `src/redaction.ts` | Output redaction helpers for generated artifacts. |
|
|
17
|
+
| `templates/` | Versionless project scaffold copied into consuming Expo apps. |
|
|
18
|
+
|
|
19
|
+
## Relationship to the harness
|
|
20
|
+
|
|
21
|
+
`@farmslot/adapter-rn` is a thin integration layer:
|
|
22
|
+
|
|
23
|
+
- `@farmslot/protocol` owns Recipe Protocol v1 schemas, action names, and validation.
|
|
24
|
+
- `@farmslot/recipe-runner` owns the generic runner, official core actions, UI actions, and CDP/React Native transports.
|
|
25
|
+
- `@farmslot/adapter-rn` only adds Expo-friendly scaffolding: package scripts, a default recipe, optional dev-only React Native bridge/HUD files, and integration checks.
|
|
26
|
+
|
|
27
|
+
Do not add project-specific actions such as wallet, perps, or meetings to this package. Those belong in the app or a project-specific runner/manifest that extends the official harness actions. Generic whole-run video proof stays in the shared harness capability surface.
|
|
28
|
+
|
|
29
|
+
## What it installs
|
|
30
|
+
|
|
31
|
+
- a versionless `scripts/agentic/recipe/` scaffold;
|
|
32
|
+
- a small headless action manifest using official harness actions;
|
|
33
|
+
- an Expo config smoke recipe that emits the standard Farmslot artifact package;
|
|
34
|
+
- `recipe:*` package scripts;
|
|
35
|
+
- optional dev-only bridge/HUD files when `--with-bridge` is requested.
|
|
36
|
+
|
|
37
|
+
Protocol versioning remains inside recipe metadata. User-facing paths and scripts stay versionless.
|
|
38
|
+
|
|
39
|
+
### Native session ownership
|
|
40
|
+
|
|
41
|
+
Consumers of `createAgentDeviceUiTransport` can call `await transport.open()`
|
|
42
|
+
before using their shared SDK client for a snapshot. Later `execute` and
|
|
43
|
+
`observe` calls reuse that open session. Pair it with `await transport.close()`;
|
|
44
|
+
do not open or close the same client independently behind the transport.
|
|
45
|
+
This does not prepare a cold XCTest runner or bound snapshot latency.
|
|
46
|
+
|
|
47
|
+
## Usage
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Published package path, once @farmslot packages are public.
|
|
51
|
+
yarn add -D @farmslot/adapter-rn @farmslot/recipe-runner @farmslot/protocol
|
|
52
|
+
farmslot-adapter-rn init
|
|
53
|
+
yarn recipe:doctor
|
|
54
|
+
yarn recipe:validate
|
|
55
|
+
yarn recipe:dry-run
|
|
56
|
+
yarn recipe:run
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Pass typed values with `--param key=value`. A task recipe at `artifacts/recipe.json` can keep task-only dependencies in `artifacts/recipe-library/`; the runner discovers them automatically.
|
|
60
|
+
|
|
61
|
+
`recipe:dry-run` still runs core/headless commands; it only stubs live UI, CDP,
|
|
62
|
+
and app bridge actions. Command output is sanitized before recipe artifacts are
|
|
63
|
+
written so public Expo config secrets do not leak into `trace.json`.
|
|
64
|
+
|
|
65
|
+
### Metro bridge port
|
|
66
|
+
|
|
67
|
+
Recipes that execute Metro-backed actions such as `app.status`, `app.hud`, or
|
|
68
|
+
`app.trace` must set `FARMSLOT_RECIPE_METRO_PORT` or `METRO_PORT` to the
|
|
69
|
+
assigned port (1–65535). `FARMSLOT_RECIPE_METRO_PORT` takes precedence. There
|
|
70
|
+
is no default port or `WATCHER_PORT` fallback. The port is resolved only when a
|
|
71
|
+
Metro-backed action runs, so headless and native-only recipes do not need it.
|
|
72
|
+
|
|
73
|
+
When asserting command output that may be redacted, prefer stable substrings or structured fields over exact pretty-printed JSON whitespace.
|
|
74
|
+
|
|
75
|
+
For motion-sensitive visual proof, `farmslot-adapter-rn run --record-video`
|
|
76
|
+
records one whole-recipe MP4 through `capture-helper`. By default it targets the
|
|
77
|
+
macOS Simulator window; override with `--record-pid`, `--record-window-id`, or
|
|
78
|
+
`--record-app-name` plus `--record-window-name`.
|
|
79
|
+
|
|
80
|
+
For a UI/HUD-capable app scaffold:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
farmslot-adapter-rn init --with-bridge
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Then wrap the app root with `RecipeBridgeProvider` and enable it only in development:
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
import { RecipeBridgeProvider } from './src/farmslot';
|
|
90
|
+
|
|
91
|
+
export default function App() {
|
|
92
|
+
return <RecipeBridgeProvider>{/* app */}</RecipeBridgeProvider>;
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
The generated bridge no-ops unless both conditions are true:
|
|
97
|
+
|
|
98
|
+
- `__DEV__`
|
|
99
|
+
- `EXPO_PUBLIC_FARMSLOT_RECIPE_BRIDGE=1`
|
|
100
|
+
|
|
101
|
+
The bridge and HUD are copied into local source files by design, so each app can customize `bridgeName`, bridge enablement, HUD text, HUD styles, or full HUD rendering without forking the harness.
|
|
102
|
+
|
|
103
|
+
Default HUD text is compact and wraps instead of ellipsizing. To tune the generated HUD without replacing it:
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
<RecipeBridgeProvider
|
|
107
|
+
hud={{
|
|
108
|
+
text: {
|
|
109
|
+
badge: (state) => `${state.status} ${state.currentStep ?? ''}/${state.totalSteps ?? ''}`,
|
|
110
|
+
intent: (state) => state.intent,
|
|
111
|
+
error: (state) => state.error,
|
|
112
|
+
},
|
|
113
|
+
styles: {
|
|
114
|
+
container: { bottom: 24, backgroundColor: 'rgba(0, 0, 0, 0.7)' },
|
|
115
|
+
line: { fontSize: 10, lineHeight: 13 },
|
|
116
|
+
intent: { color: '#fff' },
|
|
117
|
+
},
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
{/* app */}
|
|
121
|
+
</RecipeBridgeProvider>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
For a completely custom overlay, pass `renderHud`.
|
|
125
|
+
|
|
126
|
+
## Maintenance rules
|
|
127
|
+
|
|
128
|
+
1. **Stay thin.** Keep this package to Expo scaffolding and checks; generic execution belongs in `@farmslot/recipe-runner`.
|
|
129
|
+
2. **Keep manifests small and project-supported.** Do not add task-specific or ticket-specific actions.
|
|
130
|
+
3. **Parameterize before multiplying.** Prefer one parameterized domain action over duplicate narrow actions.
|
|
131
|
+
4. **Use UI/HUD actions only for visible proof.** Preparation and fixture convergence should stay separate from the measured proof nodes.
|
|
132
|
+
5. **Keep templates versionless.** Protocol versioning belongs in recipe metadata, not in generated path names.
|
|
133
|
+
6. **Run `yarn recipe:doctor` before handing a scaffolded project to Farmslot.**
|
|
134
|
+
|
|
135
|
+
## Local quality
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
yarn workspace @farmslot/adapter-rn quality
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## License
|
|
142
|
+
|
|
143
|
+
MIT. See [LICENSE](LICENSE).
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { runAdapterRnCli } from '../dist/cli.js';
|
|
3
|
+
|
|
4
|
+
try {
|
|
5
|
+
await runAdapterRnCli(process.argv.slice(2));
|
|
6
|
+
} catch (error) {
|
|
7
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
8
|
+
console.error(message);
|
|
9
|
+
process.exit(1);
|
|
10
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { type UiActionTransport } from '@farmslot/recipe-runner';
|
|
2
|
+
export interface AgentDeviceSnapshotNode {
|
|
3
|
+
identifier?: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
value?: unknown;
|
|
6
|
+
type?: string;
|
|
7
|
+
hittable?: boolean;
|
|
8
|
+
visibleToUser?: boolean;
|
|
9
|
+
interactionBlocked?: 'covered';
|
|
10
|
+
hiddenContentAbove?: boolean;
|
|
11
|
+
hiddenContentBelow?: boolean;
|
|
12
|
+
rect?: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export interface AgentDeviceSnapshot {
|
|
20
|
+
nodes: AgentDeviceSnapshotNode[];
|
|
21
|
+
truncated: boolean;
|
|
22
|
+
appName?: string;
|
|
23
|
+
appBundleId?: string;
|
|
24
|
+
}
|
|
25
|
+
interface AgentDeviceInteractionResult {
|
|
26
|
+
evidence?: {
|
|
27
|
+
changedFromBefore?: boolean;
|
|
28
|
+
};
|
|
29
|
+
[key: string]: unknown;
|
|
30
|
+
}
|
|
31
|
+
export interface AgentDeviceClientLike {
|
|
32
|
+
apps: {
|
|
33
|
+
open(options: Record<string, unknown>): Promise<unknown>;
|
|
34
|
+
};
|
|
35
|
+
interactions: {
|
|
36
|
+
press(options: Record<string, unknown>): Promise<unknown>;
|
|
37
|
+
fill(options: Record<string, unknown>): Promise<AgentDeviceInteractionResult>;
|
|
38
|
+
scroll(options: Record<string, unknown>): Promise<unknown>;
|
|
39
|
+
swipe(options: Record<string, unknown>): Promise<unknown>;
|
|
40
|
+
};
|
|
41
|
+
command: {
|
|
42
|
+
back?(options: Record<string, unknown>): Promise<unknown>;
|
|
43
|
+
wait(options: Record<string, unknown>): Promise<unknown>;
|
|
44
|
+
keyboard(options: Record<string, unknown>): Promise<unknown>;
|
|
45
|
+
};
|
|
46
|
+
capture: {
|
|
47
|
+
snapshot(options: Record<string, unknown>): Promise<AgentDeviceSnapshot>;
|
|
48
|
+
screenshot(options: Record<string, unknown>): Promise<{
|
|
49
|
+
width?: number;
|
|
50
|
+
height?: number;
|
|
51
|
+
logicalWidth?: number;
|
|
52
|
+
logicalHeight?: number;
|
|
53
|
+
pixelDensity?: number;
|
|
54
|
+
}>;
|
|
55
|
+
};
|
|
56
|
+
sessions: {
|
|
57
|
+
close(options: Record<string, unknown>): Promise<unknown>;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
type AgentDeviceClient = AgentDeviceClientLike;
|
|
61
|
+
export declare const NATIVE_UI_ACTIONS: readonly ["ui.press", "ui.key_press", "ui.set_input", "ui.scroll", "ui.swipe", "ui.pan", "ui.drag", "ui.long_press", "ui.wait_for", "ui.screenshot", "ui.capture_surface"];
|
|
62
|
+
export interface AgentDeviceUiTransportOptions {
|
|
63
|
+
platform: 'ios' | 'android';
|
|
64
|
+
device: string;
|
|
65
|
+
app: string;
|
|
66
|
+
session: string;
|
|
67
|
+
stateDir?: string;
|
|
68
|
+
client?: AgentDeviceClient;
|
|
69
|
+
gestureCommandRunner?: NativeGestureCommandRunner;
|
|
70
|
+
idbPath?: string;
|
|
71
|
+
adbPath?: string;
|
|
72
|
+
}
|
|
73
|
+
export interface NativeGestureCommandRunner {
|
|
74
|
+
execFile(file: string, args: string[], options?: {
|
|
75
|
+
timeoutMs?: number;
|
|
76
|
+
}): Promise<{
|
|
77
|
+
stdout?: string;
|
|
78
|
+
stderr?: string;
|
|
79
|
+
}>;
|
|
80
|
+
}
|
|
81
|
+
export interface AgentDeviceUiTransport extends UiActionTransport {
|
|
82
|
+
open(): Promise<void>;
|
|
83
|
+
close(): Promise<void>;
|
|
84
|
+
}
|
|
85
|
+
export declare function createAgentDeviceUiTransport(options: AgentDeviceUiTransportOptions): AgentDeviceUiTransport;
|
|
86
|
+
export declare function assertAgentDeviceNodeVersion(version: string): void;
|
|
87
|
+
export {};
|
|
88
|
+
//# sourceMappingURL=agent-device-ui-transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-device-ui-transport.d.ts","sourceRoot":"","sources":["../src/agent-device-ui-transport.ts"],"names":[],"mappings":"AAQA,OAAO,EAUL,KAAK,iBAAiB,EAGvB,MAAM,yBAAyB,CAAC;AAOjC,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC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