lilith/redroid-client
Natalie 9c631af242
Some checks are pending
Build and Publish (lilith packages) / build-and-publish (lix-build) (push) Waiting to run
Build and Publish (lilith packages) / build-and-publish (lix-configs) (push) Waiting to run
Build and Publish (lilith packages) / build-and-publish (mcp-common) (push) Waiting to run
Build and Publish (lilith packages) / build-and-publish (redroid-client) (push) Waiting to run
Build and Publish (lilith packages) / build-and-publish (redroid-mcp) (push) Waiting to run
Build and Publish (lilith packages) / build-and-publish (ui-fab) (push) Waiting to run
Build and Publish (lilith packages) / build-and-publish (ui-icons) (push) Waiting to run
Build and Publish (lilith packages) / build-and-publish (ui-zname) (push) Waiting to run
feat(redroid-client): add OCR + OpenAI-compatible backends for the box path, bump 0.3.0
The redroid box has no Claude API, so add two HTTP backends used there: ocr_extract()
(the on-box mrnumber-ocr tesseract service → {text,lines}) and openai_chat() (an
OpenAI-compatible /v1/chat/completions LLM on a DO GPU droplet). Plus selectors
extract_backend() (ocr|vision, default vision) + rating_llm_url()/model() so plum-dev
keeps the Claude path unchanged. Additive; @whatsapp unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 00:38:31 -04:00
..
src/redroid_client feat(redroid-client): add OCR + OpenAI-compatible backends for the box path, bump 0.3.0 2026-06-30 00:38:31 -04:00
tests feat(redroid): add shared redroid-client (py) + redroid-mcp (ts) packages 2026-06-28 15:04:24 -04:00
.gitignore feat(redroid): add shared redroid-client (py) + redroid-mcp (ts) packages 2026-06-28 15:04:24 -04:00
pyproject.toml feat(redroid-client): add OCR + OpenAI-compatible backends for the box path, bump 0.3.0 2026-06-30 00:38:31 -04:00
README.md feat(redroid): add shared redroid-client (py) + redroid-mcp (ts) packages 2026-06-28 15:04:24 -04:00

@lilith/redroid-client (lilith-redroid-client)

Shared client base for the lilith Android screening tools (@mr-number, @whatsapp). One implementation of the device automation, vision extraction, and screening-record plumbing; each app subclasses it and adds only its app-specific navigation + vision prompts.

What it provides

Symbol Purpose
RedroidDevice adb base: adb/adb_tap/adb_text/adb_keyevent/adb_swipe/screen_size, get_ui_dump, parse_bounds, find_and_tap_text, find_edit_text_and_input, launch_app, take_screenshot. Subclass it; override package, ui_dump_*, screenshot_*.
extract_screenshot(...) Batch-SDK vision: app supplies system + prompt, gets back a parsed JSON dict (never raises).
load_sdk() Boots claude-code-batch-sdk from disk (CLAUDE_CODE_BATCH_SDK_PATH).
post_screening(...) POST /api/clients/{id}/screening with the canonical wire body; service discriminates the tool.
clean_phone / digits_only The two phone forms (keep-+ vs digits-only).
log / set_json_mode Progress to stdout, or stderr in --json mode.

Usage

from redroid_client import RedroidDevice, extract_screenshot, post_screening, clean_phone

class WhatsAppDevice(RedroidDevice):
    ui_dump_remote = "/sdcard/wa_ui.xml"
    screenshot_prefix = "whatsapp"
    def open_chat(self, digits): ...   # app-specific nav

Install

pip install -i http://134.199.243.61:3000/api/packages/platform/pypi/simple lilith-redroid-client

Test

PYTHONPATH=src python3 -m unittest discover -s tests -v

Published to the cocotte-forge (Forgejo) PyPI registry, platform org.