Skip to content

Add Playwright stream capture on end#16

Merged
selfcontained merged 5 commits into
mainfrom
feature/playwright-streaming-impl
Mar 10, 2026
Merged

Add Playwright stream capture on end#16
selfcontained merged 5 commits into
mainfrom
feature/playwright-streaming-impl

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Summary

  • Adds onStreamEnd callback to StreamManager that fires with the last JPEG frame before cleanup
  • Server saves the frame to the agent's media dir, inserts a DB record with source: 'stream', and publishes media.changed SSE
  • Media sidebar renders stream captures with a "Stream recording" label via a local mediaSourceLabel helper
  • Includes the original MJPEG live streaming + pop-out viewer from the prior commit

Test plan

  • Start a Playwright stream, stop it, verify stream-capture-*.jpg saved to media dir
  • Verify DB record created with source: 'stream' via media API
  • Verify sidebar shows "Stream recording" label with correct thumbnail
  • npm run finalize:web passes (tsc + vite build)
  • Backend tsc --noEmit passes

🤖 Generated with Claude Code

selfcontained and others added 5 commits March 9, 2026 22:21
- StreamManager: CDP-to-MJPEG multiplexer with frame caching for idle pages
- MJPEG endpoint with Fastify reply.hijack(), flushHeaders, setNoDelay
- Sidebar live stream section with auto-open, red pulse indicator, pop-out button
- Pop-out viewer: standalone HTML page via window.open() for resizable viewing
- dispatch-stream CLI for agents to start/stop streams
- SSE events (stream.started/stopped) keep all clients in sync
- Plan docs for DB-backed media store and stream capture follow-ups

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Resolve conflicts to combine DB-backed media store and release manager
from main with the Playwright streaming feature. Drop the old fs.watch
media watchers in favor of DB-backed media.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
When a Playwright stream stops, StreamManager fires an onStreamEnd
callback with the last JPEG frame. The server saves it to the media
directory, inserts a DB record with source='stream', and publishes a
media.changed SSE event. The sidebar renders these as "Stream recording".

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Stream recording items now have a red left border, subtle red background
tint, and a MonitorPlay icon with "Stream recording" badge to visually
distinguish them from regular screenshots.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Add `description` TEXT column to media table
- Accept description in upload endpoint, stream stop API, and onStreamEnd callback
- dispatch-share and dispatch-stream stop both accept -d/--description flag
- Display descriptions in the media sidebar for both screenshots and stream captures

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@selfcontained
selfcontained merged commit e1bb41b into main Mar 10, 2026
1 check passed
@selfcontained
selfcontained deleted the feature/playwright-streaming-impl branch April 9, 2026 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant