feat(provider-webos): add LG webOS TV provider plugin

Merged
AL
6h ago
+3067-42

Summary

Adds @agent-device/webos, an optional provider plugin that drives web apps on LG webOS TVs, and the private @agent-device/tv-cdp package it bundles, which the Tizen plugin in #4168 shares. The TV enters as a plugin-owned Android TV device (webos:<ares device>): lifecycle through ares-launch, the page over CDP through the ares-inspect tunnel.

Scope is the smaller v1 from review: open/close/apps, snapshot (-s, -d, -i), remote keys (directions, select, back), pointer, text, scroll, screenshot, logs, appstate. SSAP system buttons, perf memory, network dump, install/uninstall and the capability-matrix column follow in separate PRs.

agent-device plugins add @agent-device/webos
agent-device connect webos --device living-room
agent-device open com.example.app
agent-device snapshot -i

52 files. Also: kernel cdp-dom producer, an interactive-test option in capture-kit's desktop shaper, smoke fixtures, docs, a one-line provider-plugin catalog in help so help remote keeps its first-screen rules as plugins are added, and the TV flows of help remote in their own module (cli-help-tv.ts), which keeps cli-help.ts within its line limit. No linked issue.

Validation

Tested SHA 70420cb73, rebased on main bb960da51.

  • pnpm check:affected --run: every stage passed except unit, whose failures are unrelated. fill-verification and committed-source-tree also fail intermittently on main. Two script tests failed under machine load and pass when run alone.
  • pnpm check:coverage-changed at a9301f326, before the rebase: changed-line coverage is 370/408 (90.69%) against the 70% threshold. pnpm check:coverage-crap reports no touched function at or above 30.
  • Unit tests cover the device route against fakes: the ares-inspect tunnel, connectTv, cancellable open, a lease that ends while open waits for the page, exit-only aresError rewrites, empty fill, pointer, scroll, screenshot, covered controls, Map/Set log previews, and the inspector error in the open timeout.
  • Live at b942ccd96: fill "" clears a filled input, and open --relaunch keeps one tunnel. pgrep -fl ares-inspect prints nothing after disconnect and after Ctrl-C during open.
  • Live at a9301f326: snapshots hit-test interactive nodes. A control under another element is marked [covered], press refuses it with the cover named, and snapshot -i still lists it. The output is in the PR conversation.
  • An independent review found four issues, all fixed.
  • Live on an LG 32LQ63006LA (webOS TV 22, SDK 7.6.0, firmware 04.60.91): connect, open, snapshot (41 nodes) / -i (18) / -s <label> (that subtree only), keys, screenshot, logs, appstate, apps, close. After disconnect, pgrep -fl ares-inspect prints nothing. An app closed outside agent-device gives the typed "No webOS app is attached" error in 0.15 s; with the TV unreachable, open returns COMMAND_FAILED in 2.9 s; without the CLI, TOOL_MISSING.

Risks: experimental; no CI device lane.

šŸ¤– Generated with Claude Code