Expand description
Typed local debugging protocol carried by endpoint-libs framing.
This is deliberately not WebDriver. It models the native renderer and app
lifecycle directly, supports observation by more than one client, and has
no authentication handshake. Agent control binds only to a local transport;
expensive diagnostics collection remains an explicit compile-time feature
of the server, tauri-runtime-blitz/diagnostics.
§Why this is its own crate
These are the server’s own definitions, and a client that hand-rolls the
JSON gets them wrong in ways that do not look like encoding mistakes.
AgentAction is adjacently tagged, so {"action":"click","node_id":9} is
malformed where {"action":"click","params":{"node_id":9}} is correct, and
the difference used to present as a hung application. Sharing the types
makes that a compile error.
Speaking the protocol must not cost a renderer. tauri-runtime-blitz pulls
in tauri, winit, wgpu and blitz, so a measurement tool that depended on it
for these types would build a browser engine to send a wheel event. Nothing
here needs any of that: it is serde plus endpoint-libs’ framing.
§No diagnostics feature, on purpose
The types are inert data definitions and cost nothing to compile, whereas
gating them creates feature skew: cargo unifies features across a build, so
one workspace member asking for diagnostics types while the server crate is
built without them turned DebugResponse into a non-exhaustive match in
code nobody had touched. What stays gated in the server is collection,
which is where the expense actually is. A build that cannot serve
diagnostics says so by omitting the tool from tools/list; see
encode_tools_list_response.
Structs§
- Agent
Snapshot - Capture
Request - What to draw, and how large.
- Captured
Image - An RGBA8 image, as the renderer actually drew it.
- Console
Entry - Debug
Descriptor - Debug
Error - Debug
Snapshot - Frame
Metrics - Timings of one real presented frame, in milliseconds.
- Frame
Window Metrics - Aggregate statistics over the recently presented frames.
- Layout
Bounds - A node’s live border box, encoded on the wire as
[x, y, width, height]. - Layout
Diagnostic Row - One node’s renderer-computed geometry.
- Layout
Edges - Computed CSS edges, encoded in shorthand order
[top, right, bottom, left]. - Layout
Offset - A live scroll offset, encoded as
[x, y]. - Layout
Size - A two-dimensional layout size, encoded as
[width, height]. - Modifiers
- Renderer
Metrics - Revision
Set - Runtime
Error Entry - Script
Metrics - Script execution cost, in milliseconds, over the retained poll window.
- Script
Source - One attributed source of script time.
- Semantic
Node - Snapshot
Cost - What it cost to answer this diagnostics request.
- Snapshot
Request - Timing
Stats - Mean, 95th percentile and worst case for one timing series, in milliseconds.
Enums§
- Agent
Action - Agent
Control Event - Agent
Control Request - Debug
Event - Debug
Protocol Error - Debug
Response - Debug
Stream - Diagnostics
Request - Incoming
Request - Input
Command - KeyPhase
- Lifecycle
Event - Pointer
Phase - Wheel
Phase
Constants§
- AGENT_
CONTROL_ TOOL - AGENT_
EVENT_ NOTIFICATION - DEBUG_
PROTOCOL_ VERSION - DIAGNOSTICS_
EVENT_ NOTIFICATION - DIAGNOSTICS_
TOOL - MCP_
INITIALIZE - MCP_
INITIALIZED_ NOTIFICATION - MCP_
TOOLS_ CALL - MCP_
TOOLS_ LIST
Functions§
- decode_
agent_ event - decode_
agent_ request - decode_
diagnostics_ event - decode_
diagnostics_ request - decode_
incoming - decode_
response - decode_
rpc - encode_
agent_ event - encode_
agent_ request - encode_
diagnostics_ event - encode_
diagnostics_ request - encode_
initialize_ response - encode_
response - encode_
rpc - encode_
rpc_ error - encode_
tools_ list_ response - The tool list, which is the one place a build’s capability shows.
- peek_
request_ id - The request id of an incoming frame, recovered without consuming it.