## Decision

Build a **full JS debugger**, not just live highlighting: breakpoints, step, call stack and variable inspection. It runs **on the physical device** over the protocol. Console log origins remain part of this issue.

## Source

- "JS debugger for inspecting the runtime: highlight lines as the program runs, hover variables to inspect them"
- "Animation code while it runs so the end-user can see what is happening and how the code is broken (add a debugger-type thing too)."
- "Click/hover on log in console to see where it came from"

## Current state

The console shows log text and a structured runtime error with a line/column. There is no execution trace, variable inspection, breakpoint or stepping support, and a normal `console.log` entry has no source location.

## Acceptance

- [ ] Define the debug protocol between firmware/runtime and the editor: breakpoints, pause/resume, step over/into/out, call stack and variable inspection.
- [ ] The editor highlights the current execution line while running and while paused.
- [ ] Variables can be inspected while paused, by hover and in a debugger panel, including values inside timers and async callbacks.
- [ ] A call stack is shown and selecting a frame focuses its source location.
- [ ] Every console log carries its source location; clicking or hovering a log reveals and focuses that line, with a keyboard path.
- [ ] A device disconnect ends the session cleanly and reports it on the console.
- [ ] Runtime/protocol tests cover the debug events; an e2e or emulator journey covers break, step and inspect.
- [ ] Measure overhead during a normal run; the debugger is off by default.


<sub>Generated on _MrBeast_ using _opencode/deepseek-v4.1-flash_ in _ses_e8326e581ffeJviTmSkomwnKES_</sub>

