# JARVIS-TV — Android TV control agent

A personal agent app for **my own Android TV**. Runs a persistent background service that takes
commands over the local network and drives any app on the TV (launch, search, play, show, stream)
using an Accessibility engine — no root required.

> Scope: this is for a device I own and control. It is not covert monitoring of any person.

## Architecture
```
Telegram (Ahmed) ──▶ Ultron VPS ──ssh──▶ Pi (on home LAN) ──http──▶ TV :8080  (ControlService)
                                                                        │
                                                                        ├─ Actions (intents: launch/url/youtube/image/stream)
                                                                        └─ JarvisAccessibilityService (tap/scroll/type in ANY app)
```
The VPS can't reach the TV directly (TV is behind home NAT), so the **Pi on the home LAN** is the
relay that actually talks to the TV's command server.

## Command API (POST JSON to `http://<tv-ip>:8080/cmd`)
| action | params | does |
|---|---|---|
| `launch` | `package` | open any app |
| `youtube` | `query` | search YouTube, play first result |
| `yt_id` | `id` | play a specific video id |
| `google` | `query` | Google search |
| `url` | `url` | open a URL |
| `image` | `url` | show an image full-screen |
| `stream` | `url` | play a direct video URL |
| `click`/`type`/`scroll`/`back`/`home`/`ping` | (text) | raw navigation |

Example: `curl -X POST 10.0.0.42:8080/cmd -d '{"action":"youtube","query":"lofi beats"}'`

## v1 status
- [x] App scaffold: manifest, service, accessibility engine, command router, TV UI
- [ ] Compile APK (needs Android SDK on VPS — do it when the Maps scraper is idle to protect the pipeline)
- [ ] Install to TV over ADB, enable Accessibility, verify commands
- [ ] Wire Telegram → Pi relay so "play X on the TV" works hands-free

## Roadmap
- Animated "arc-reactor" Jarvis UI + on-screen response captions
- Voice (mic on TV or push-to-talk from phone)
- Natural-language command parsing (map free text → the action table above)
- Secure the command port (shared token / bind to LAN only)

## Build (when SDK is present)
```
./gradlew assembleRelease
adb connect <tv-ip>:5555
adb install -r app/build/outputs/apk/release/app-release.apk
```
