1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-02 23:00:04 -04:00

Add egui_inspection crate and eframe inspection hooks

New `egui_inspection` crate ships:
- `protocol` (default): wire types + length-prefixed msgpack framing for the
  inspector ↔ egui-peer connection. Transport-neutral (stdio / unix socket / TCP).
- `plugin`: `InspectionPlugin`, an `egui::Plugin` that dials a unix socket from
  `EGUI_INSPECTION_SOCKET`, streams frames + accesskit tree updates, and applies
  inbound `InspectorCommand`s back into the running `egui::Context`.

eframe gains an `inspection` feature that auto-attaches the plugin during native
startup (glow + wgpu integrations) when the env var is set. Connection failures
log via `log::warn!` and do not abort startup.

Lives in its own crate (rather than `egui_kittest`) so eframe can pull the
protocol in without picking up the test harness, and so external tools can
depend on it directly.
This commit is contained in:
lucasmerlin
2026-05-21 10:57:42 +02:00
parent a41bba33a0
commit 622218e94f
11 changed files with 809 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
# egui_inspection
Wire protocol and `egui::Plugin` for live inspection of running egui apps and
kittest harnesses.
Two layers:
- **`protocol`** (default feature): length-prefixed MessagePack messages used by
`egui_kittest`'s inspector, the external `kittest_inspector` UI, and the
`egui_kittest_mcp` server.
- **`plugin`** (opt-in): an `egui::Plugin` implementation that streams frames +
AccessKit tree updates to an inspector over a unix domain socket and applies
received `InspectorCommand`s back into the running app. Auto-attaches when
`EGUI_INSPECTION_SOCKET` is set.