feat: Phase 2 act primitives
Add the Artemis Go CLI and its packages: - internal/adb: timeout-bounded adb wrapper, device list, wireless-debugging port scan and auto-connect (never hardcodes the moving port). - internal/ui: uiautomator dump parsing, find-by-text, tap the centre of a text match (FR-4), type, swipe, scroll, back, home, launch, wake. - cmd/artemis: CLI for the primitives plus 'demo', the Phase 2 DoD run. Failures are loud: a missing or disabled element errors instead of tapping a guessed coordinate. The screen is woken before acting, and every adb call has a deadline. Also record the section 13 Q4 decision (adb lives in the user profile on .13, wireless ADB needs no udev rules; service packaging still open until Phase 6), add unit tests, and document the phase evidence.
This commit is contained in:
68
README.md
Normal file
68
README.md
Normal file
@@ -0,0 +1,68 @@
|
||||
# Artemis Control
|
||||
|
||||
Artemis is the phone's **hands**. It drives the Pixel 8a screen from `.13` over
|
||||
Tailscale using **ADB wireless**, so the Hub can do things no deep link allows.
|
||||
|
||||
The build spec is [`AGENTS.md`](AGENTS.md). Follow the phases in section 11 in
|
||||
order.
|
||||
|
||||
## Status
|
||||
|
||||
| Phase | State |
|
||||
|---|---|
|
||||
| 1 — Prove the ADB link | ✅ proven — see [`docs/phase-1-adb-link.md`](docs/phase-1-adb-link.md) |
|
||||
| 2 — Act primitives | ✅ done — tap by text, type, scroll, back, home, launch |
|
||||
| 3 — Spotify recipe | not started |
|
||||
| 4 — Song radio | not started |
|
||||
| 5 — Maps recipe | not started |
|
||||
| 6 — Action API | not started |
|
||||
| 7 — Resilience | not started |
|
||||
| 8 — Documentation | not started |
|
||||
|
||||
## Layout
|
||||
|
||||
```
|
||||
cmd/artemis/ command line entry point
|
||||
internal/adb/ timeout-bounded wrapper around the adb binary
|
||||
internal/ui/ read the screen (uiautomator dump) and act on it (input)
|
||||
docs/ phase evidence and notes
|
||||
```
|
||||
|
||||
## Build and test
|
||||
|
||||
Go is not installed system-wide on `.13`; use a one-off nix shell. Nothing is
|
||||
added to `nixos-rebuild` and no system module changes.
|
||||
|
||||
```sh
|
||||
nix shell nixpkgs#go -c go build -o bin/artemis ./cmd/artemis
|
||||
nix shell nixpkgs#go -c go vet ./...
|
||||
nix shell nixpkgs#go -c go test ./...
|
||||
```
|
||||
|
||||
## Use
|
||||
|
||||
The phone address defaults to `100.101.49.17`. Override with `ARTEMIS_PHONE`,
|
||||
pin a serial with `ARTEMIS_ADB_SERIAL`, or point at a different adb with
|
||||
`ARTEMIS_ADB`.
|
||||
|
||||
```sh
|
||||
./bin/artemis connect # scan for the wireless-debugging port, then connect
|
||||
./bin/artemis devices
|
||||
./bin/artemis dump # text nodes and bounds
|
||||
./bin/artemis launch com.spotify.music
|
||||
./bin/artemis tap "Search" # find by text, tap its centre (FR-4)
|
||||
./bin/artemis type "Rolling Stones Honky Tonk"
|
||||
./bin/artemis scroll down
|
||||
./bin/artemis back
|
||||
./bin/artemis home
|
||||
./bin/artemis demo # Phase 2 DoD: launch an app, tap a named element
|
||||
```
|
||||
|
||||
## Rules that the code enforces
|
||||
|
||||
- **Find by text, never fixed coordinates.** `tap` resolves a text match to
|
||||
bounds and taps the centre.
|
||||
- **Never tap blindly.** A missing or disabled element is a loud failure, not a
|
||||
guessed coordinate.
|
||||
- **Wake first.** Every acting command wakes the screen (FR-7).
|
||||
- **Bound every command.** No adb call runs without a timeout (FR-11).
|
||||
Reference in New Issue
Block a user