feat: drive the studio from MCP agents (Trace Recorder hook and options, camera choice)

Aperta
#17 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
playwright, typescript

Direzione di ricerca

Start with the debug.trace and source.camera nodes and RuntimeContext.studio, then locate their unit and end-to-end coverage plus the tracking-debugger skill. Implement the studio-only trace hook, recorder options, and camera selection behind the API proposed in the issue. Done means an agent can record and read JSONL through window.webarkitStudio.trace, a camera can be chosen by label or deviceId, new logic is unit-tested, and the README node table and CHANGELOG are updated.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

AI - agents editor enhancement runtime

Follow-up of #9 (tracking traces and the MCP servers in .mcp.json).

Context

Testing #9 showed two frictions.

  • Getting a browser trace: the Trace Recorder (debug.trace) delivers its trace as a file download. An agent driving the studio through Playwright MCP or Chrome DevTools MCP has to catch that download, when it could simply read the trace from the page.
  • Choosing a camera: the Camera node (source.camera) picks a device only by facing mode. On a machine with several cameras (a webcam and virtual cameras), the browser opens the default one. Today the only way to choose is a Chrome flag or a permission prompt.

MCP servers cannot run from a graph node: they drive the browser from outside, and the graph also runs in exported apps. The other direction works: make the page easy to drive.

Proposal

  1. Agent hook in the studio, not in the player. A small page API, for example window.webarkitStudio.trace, that can start and stop a Trace Recorder and return its JSONL as text. Playwright and DevTools can then read the trace with an evaluate call. It does nothing in exported apps, like the Trace Recorder itself (RuntimeContext.studio).
  2. Trace Recorder options.
    • A duration in seconds, next to Max frames.
    • A label, written to the trace header, for example "One Euro, beta 0.02", to tell traces apart in trace:diff. This adds an optional header field: decide whether it bumps TRACE_VERSION.
  3. Camera node: device choice. A param that selects a camera by label or deviceId, falling back to the facing mode. The camera param is not live today: say whether this one should be.

To decide

  • Whether the hook belongs on window or behind a query flag (?debug).
  • Whether the camera param is a format change. Adding a param is not; renaming facingMode would be.
  • Updating the tracking-debugger skill to use the hook instead of downloads.

Acceptance

  • Through Playwright MCP, an agent records a trace from the studio and reads it without a download.
  • The Camera node opens a chosen camera on a machine with several.
  • Unit tests for the new logic; the e2e tests still pass; the README node table and CHANGELOG are updated.

Generated by Claude Code

Lingua principale
TypeScript
Stelle
1
Fork
0
Merge medio
2h 36m
PR unite (30g)
92

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di webarkit/webarkit-studio

Tutte le issue di webarkit/webarkit-studio

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.