|
| 1 | +# Command Ownership Inventory |
| 2 | + |
| 3 | +This inventory keeps the public boundary stable while command semantics move into |
| 4 | +the runtime layer. New integrations should prefer the runtime, backend, and IO |
| 5 | +interfaces over helper subpaths. |
| 6 | + |
| 7 | +## Portable Command Runtime |
| 8 | + |
| 9 | +These commands describe device, app, capture, selector, or interaction behavior. |
| 10 | +Their semantics should live in `agent-device/commands` as they migrate. |
| 11 | + |
| 12 | +- `alert` |
| 13 | +- `app-switcher` |
| 14 | +- `apps` |
| 15 | +- `appstate` |
| 16 | +- `back` |
| 17 | +- `click` |
| 18 | +- `clipboard` |
| 19 | +- `close` |
| 20 | +- `diff` |
| 21 | +- `fill` |
| 22 | +- `find` |
| 23 | +- `focus` |
| 24 | +- `get` |
| 25 | +- `home` |
| 26 | +- `is` |
| 27 | +- `keyboard` |
| 28 | +- `longpress` |
| 29 | +- `open` |
| 30 | +- `pinch` |
| 31 | +- `press` |
| 32 | +- `push` |
| 33 | +- `rotate` |
| 34 | +- `screenshot` |
| 35 | +- `scroll` |
| 36 | +- `settings` |
| 37 | +- `snapshot` |
| 38 | +- `swipe` |
| 39 | +- `trigger-app-event` |
| 40 | +- `type` |
| 41 | +- `wait` |
| 42 | + |
| 43 | +## Runtime Migration Status |
| 44 | + |
| 45 | +- `screenshot`: runtime command implemented; daemon screenshot dispatch calls the runtime. |
| 46 | +- `diff screenshot`: runtime command implemented; CLI screenshot diff dispatch calls the runtime. |
| 47 | +- `snapshot`: runtime command implemented; daemon snapshot dispatch calls the runtime. |
| 48 | +- `diff snapshot`: runtime command implemented; daemon snapshot diff dispatch calls the runtime. |
| 49 | +- `find`: read-only runtime actions implemented for `exists`, `wait`, `get text`, |
| 50 | + and `get attrs`; mutating find actions remain on the existing interaction path. |
| 51 | +- `get`: runtime command implemented; daemon get dispatch calls the runtime. |
| 52 | +- `is`: runtime command implemented; daemon is dispatch calls the runtime. |
| 53 | +- `wait`: runtime command implemented for sleep, text, ref, and selector waits; |
| 54 | + daemon wait dispatch calls the runtime. |
| 55 | +- `click`: runtime command implemented for point, ref, and selector targets; the |
| 56 | + daemon click dispatch calls the runtime. |
| 57 | +- `press`: runtime command implemented for point, ref, and selector targets; the |
| 58 | + daemon press dispatch calls the runtime. |
| 59 | +- `fill`: runtime command implemented for point, ref, and selector targets; the |
| 60 | + daemon fill dispatch calls the runtime. |
| 61 | +- `type`: runtime command implemented; daemon type dispatch calls the runtime. |
| 62 | + |
| 63 | +## Boundary Requirements |
| 64 | + |
| 65 | +- Public command APIs expose only implemented commands. Planned commands belong |
| 66 | + in `commandCatalog`, not as methods that throw at runtime. |
| 67 | +- Runtime services default to `restrictedCommandPolicy()`. Local input and |
| 68 | + output paths require an explicit local policy or adapter decision. |
| 69 | +- File inputs and outputs cross the runtime boundary through `agent-device/io` |
| 70 | + refs and artifact descriptors; command implementations should not accept |
| 71 | + ad-hoc path strings for new file contracts. |
| 72 | +- Image-producing or image-reading commands must preserve `maxImagePixels` |
| 73 | + enforcement before decoding or comparing untrusted images. |
| 74 | +- Backend escape hatches must be named capabilities with a policy gate. Do not |
| 75 | + add a freeform backend command bag. |
| 76 | +- Command options should carry `session`, `requestId`, `signal`, and `metadata` |
| 77 | + through `CommandContext` so hosted adapters can enforce request scope, |
| 78 | + cancellation, and audit correlation consistently. |
| 79 | +- Runtime command modules should depend on shared `src/utils/*` helpers, not |
| 80 | + daemon-only modules. Keep daemon paths as compatibility shims when older |
| 81 | + handlers still import them. |
| 82 | +- New backend adapters should run `agent-device/testing/conformance` suites for |
| 83 | + the command families they claim to support. |
| 84 | + |
| 85 | +## Backend And Admin Capabilities |
| 86 | + |
| 87 | +These commands manage devices or app installation. Keep them explicit backend |
| 88 | +capabilities so hosted adapters can decide what is supported. |
| 89 | + |
| 90 | +- `boot` |
| 91 | +- `devices` |
| 92 | +- `ensure-simulator` |
| 93 | +- `install` |
| 94 | +- `install-from-source` |
| 95 | +- `reinstall` |
| 96 | + |
| 97 | +## Transport And Session Orchestration |
| 98 | + |
| 99 | +These are daemon, CLI, or transport concerns. They can construct or call the |
| 100 | +runtime, but they are not portable command semantics. |
| 101 | + |
| 102 | +- `session` |
| 103 | +- lease allocation, heartbeat, and release daemon commands |
| 104 | + |
| 105 | +## Environment Preparation |
| 106 | + |
| 107 | +These prepare local or remote development environment state. Keep them outside |
| 108 | +the portable command runtime. |
| 109 | + |
| 110 | +- `connect` |
| 111 | +- `connection` |
| 112 | +- `disconnect` |
| 113 | +- `metro` |
| 114 | + |
| 115 | +## Later Capability-Gated Runtime Commands |
| 116 | + |
| 117 | +These commands should migrate only after the runtime, backend capability, and IO |
| 118 | +contracts are established for their behavior. |
| 119 | + |
| 120 | +- `batch` |
| 121 | +- `logs` |
| 122 | +- `network` |
| 123 | +- `perf` |
| 124 | +- `record` |
| 125 | +- `replay` |
| 126 | +- `test` |
| 127 | +- `trace` |
| 128 | + |
| 129 | +## Compatibility Helper Subpaths |
| 130 | + |
| 131 | +These subpaths remain available during migration, but they should not be the |
| 132 | +primary boundary for new command behavior: |
| 133 | + |
| 134 | +- `agent-device/contracts` |
| 135 | +- `agent-device/selectors` |
| 136 | +- `agent-device/finders` |
| 137 | +- `agent-device/install-source` |
| 138 | +- `agent-device/android-apps` |
| 139 | +- `agent-device/artifacts` |
| 140 | +- `agent-device/metro` |
| 141 | +- `agent-device/remote-config` |
0 commit comments