Three new capabilities ported from askjo.ai's production deployment, battle-tested over ~2 weeks on Fly.io handling real AI agent traffic.
YouTube Transcript Extraction
POST /youtube/transcript fetches captions from any YouTube video. Uses yt-dlp under the hood — no YouTube API key, no browser playback, no ads. ~5 seconds per video.
curl -X POST http://localhost:9377/youtube/transcript \
-H 'Content-Type: application/json' \
-d '{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}'Falls back to a browser-based intercept method if yt-dlp isn't installed — this works but is slower (must wait through ads).
Dockerfile now includes python3-minimal + yt-dlp. For local dev, pip install yt-dlp or brew install yt-dlp.
Snapshot Screenshots
GET /tabs/:id/snapshot?includeScreenshot=true returns a base64-encoded PNG alongside the ARIA accessibility tree in a single call. LLM agents get both the structured text and the visual layout without a separate round-trip.
9 new e2e tests including pixel-level PNG validation.
Large Page Pagination
Snapshots of large pages (product listings, search results) were returning 200KB+ ARIA trees that blew out LLM context windows. Now automatically truncated to 50,000 chars with offset-based pagination:
- Truncated responses include
hasMore: trueandnextOffset - Agents paginate with
?offset=50000 - Cached full snapshot avoids re-rendering on subsequent chunks
- Cache invalidates on navigation or click
6 e2e + 15 unit tests.
Reliability Fixes
- Click timeout — Playwright throws
"Timeout"(capital T) but the catch checked for lowercase. Clicks on slow elements silently failed instead of retrying with CSS fallback. - buildRefs timeout — 12 second cap (was unbounded, hung forever on pages with infinite iframes)
- Tab recycling — when global tab limit is hit, closes the oldest idle tab instead of returning 429
- Health probe — periodic lightweight navigation to detect zombie browser processes
- refsAvailable flag — navigate response tells agents whether element refs were successfully built
Tests
17 suites, 151 tests passing (+30 new since v1.2.0).