1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-03 15:20:05 -04:00
Commit Graph

3 Commits

Author SHA1 Message Date
lucasmerlin
732e81017e egui_kittest_mcp: pass through PNG frames; inherit child stderr
- Screenshots now arrive pre-encoded as PNG; drop the local re-encode helper and the
  direct `image` dependency.
- Drop the now-removed egui_inspection `protocol` feature.
- Inherit the spawned child's stderr so its panics and logs surface.
2026-05-26 16:34:01 +02:00
lucasmerlin
2fced8012c egui_kittest_mcp: cross-platform local socket via interprocess
Port the bridge listener (was tokio::net::UnixListener) and the shim client
(was std::os::unix::net::UnixStream) to the interprocess crate, so the MCP
inspection transport builds and runs on Windows (named pipe) as well as
unix/macOS (unix domain socket).

- bridge: bind via interprocess local_socket::tokio Listener + ListenerOptions;
  accept() yields a single Stream, split into async halves. read/write_message
  are now generic over AsyncRead/AsyncWrite.
- shim: connect via interprocess sync Stream and split for the byte relay;
  closing the write direction is done by dropping the send half.
- Allocate/parse socket names through egui_inspection::transport, so both ends
  agree on the platform-specific mapping. Drop the now-unused tempfile dep.
- Add a transport round-trip test (tokio listener <-> sync client).
2026-05-26 16:34:01 +02:00
lucasmerlin
e15ba138d6 Add egui_kittest_mcp server
New binary crate that exposes an MCP (Model Context Protocol) server backed by
the `egui_inspection` protocol. The server bridges a running egui peer — a
spawned `egui_kittest` harness child process or an attached live `eframe` app —
to MCP tool handlers that drive it.

Components:
- `bridge.rs`: spawns / attaches a peer over a unix socket, runs reader+writer
  Tokio tasks that pump `HarnessMessage` ↔ `InspectorCommand` and track the
  peer's `Hello`, latest frame, accesskit tree, and blocked / finished state.
- `tools.rs`: `rmcp`-derived tool router with commands for stepping, event
  injection (click / type / scroll / hover / drag / keys), resizing, screenshot
  capture, accesskit tree queries, and lifecycle (launch / attach / kill).
- `tree.rs`: accesskit-tree projection helpers shared by the tools.
- `shim.rs` / `main.rs`: shim role that lets the same binary act as the child
  inspector for kittest harnesses, relaying bytes between the harness stdio
  and the MCP server's unix socket.
- `server.rs`: rmcp stdio entry point.

Live-app example added at `examples/egui_mcp/`.
2026-05-26 16:34:01 +02:00