Problem
src/adb/exec.ts:41 hardcodes execFile("adb", …) — every tool, plugin, and flow assumes the adb binary lives on the same host as pi-droid. This blocks three topologies:
- Remote: agent on laptop, phone USB-connected to a different host (e.g., today's Brain setup) — currently requires running pi-droid on the remote host
- On-device (Termux): pi-droid as a worker inside the phone — no adb needed, shell is direct
- WiFi ADB from anywhere: works today but still needs
adb local to pi-droid
Proposal
Introduce a Transport interface that every I/O routes through. adb() / adbShell() become thin wrappers over Transport.shell() / Transport.adb(), defaulting to a back-compat LocalAdbTransport.
interface Transport {
readonly capabilities: { adb: boolean; portForward: boolean; hostFs: "local"|"remote"|"android"; screenMirror: "scrcpy"|"ws-scrcpy"|"native"|"none" };
shell(cmd, opts): Promise<string>;
adb(args, opts): Promise<string>; // throws UnsupportedByTransport on on-device
forward(localPort, remote): Promise<void>;
push/pull(...)
screenshot(): Promise<Buffer>;
}
Implementations:
LocalAdbTransport — today's behavior (Phase 1)
RemoteAdbTransport — wraps SSH: ssh <host> adb -s <serial> … (Phase 3)
OnDeviceTransport — Termux; adb() throws, shell() goes direct (Phase 4)
Plugin impact
Direct execAsync("adb", …) calls (e.g. private/flows/ollama-setup.ts:167 for the CDP port forward) migrate to transport.forward(9222, "localabstract:chrome_devtools_remote") — then works unchanged on remote transport and no-ops cleanly on on-device.
Non-goals
- Cross-topology failover mid-session
- Emulator support (tracked separately)
Design doc
Full design: docs/CONNECTIVITY.md — covers the three topologies, migration phases, and back-compat story.
Depends on / blocks
Problem
src/adb/exec.ts:41hardcodesexecFile("adb", …)— every tool, plugin, and flow assumes theadbbinary lives on the same host as pi-droid. This blocks three topologies:adblocal to pi-droidProposal
Introduce a
Transportinterface that every I/O routes through.adb()/adbShell()become thin wrappers overTransport.shell()/Transport.adb(), defaulting to a back-compatLocalAdbTransport.Implementations:
LocalAdbTransport— today's behavior (Phase 1)RemoteAdbTransport— wraps SSH:ssh <host> adb -s <serial> …(Phase 3)OnDeviceTransport— Termux;adb()throws,shell()goes direct (Phase 4)Plugin impact
Direct
execAsync("adb", …)calls (e.g.private/flows/ollama-setup.ts:167for the CDP port forward) migrate totransport.forward(9222, "localabstract:chrome_devtools_remote")— then works unchanged on remote transport and no-ops cleanly on on-device.Non-goals
Design doc
Full design:
docs/CONNECTIVITY.md— covers the three topologies, migration phases, and back-compat story.Depends on / blocks
pidroidCLI, fromISSUES-TO-FILE.md)