Some checks failed
Release / semantic-release (push) Successful in 22s
tests / Unit tests (Linux, Python 3.11) (push) Failing after 5m16s
Release / build-linux (push) Failing after 7m10s
Release / build-windows (push) Has been cancelled
Release / build-macos (arm64, macos-latest) (push) Has been cancelled
Release / build-macos (x64, macos-15-intel) (push) Has been cancelled
Release / release-main (push) Has been cancelled
Release / release-develop (push) Has been cancelled
agents/llm.md promises "play the Nth video from the top", but browseAndPlay only ever clicked the first result. Add an optional 1-based index argument (default 1, backward-compatible) threaded to the Node helper, which now clicks the Nth a#video-title and clamps to the number of results returned so asking beyond the list plays the last available video instead of failing. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1.7 KiB
1.7 KiB
browseAndPlay Tool Spec
Plays a YouTube video on the shared screen so it appears on the Go-Live broadcast. Used when the user asks the assistant to play / watch a song, music video, or clip.
Behaviour
- Public schema is a required
querystring (what to play) plus an optionalindexinteger (1-based position in the search results, counted from the top of the list).indexdefaults to1(first result), so existing callers and "play X" requests are unchanged; "play the 3rd video" / "play the second one" map toindex=3/index=2. - Mode-gated: only acts when
STREAM_BROWSERis true (cfg.stream_browser). In voice-only mode (false) there is no screen to show, so it returns a short message and does nothing. - Drives the on-screen Chrome by subprocessing the Node CDP helper
bot/scripts/stream-test/browse-search.mjs <query> youtube <index>, which searches YouTube and plays the chosen result on display:1. The broadcast captures that display, so the playback is what viewers see.- The helper clicks the
index-tha#video-titlein the results list. The index is clamped to the number of results actually returned, so asking for a position beyond the list plays the last available result rather than failing.
- The helper clicks the
- Returns
successwith the played video's title (and the resolvedindex), or a failure message if the helper/Chrome is unavailable. It does NOT make an LLM call.
Principles
- The Node layer owns Chrome/CDP; the Python tool only shells out to it, so the brain stays free of a browser dependency.
- Fail-open and explicit: any error returns a plain failure message rather than raising into the reply loop.