Skip to main content

Crate blitz_control_protocol

Crate blitz_control_protocol 

Source
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§

AgentSnapshot
CaptureRequest
What to draw, and how large.
CapturedImage
An RGBA8 image, as the renderer actually drew it.
ConsoleEntry
DebugDescriptor
DebugError
DebugSnapshot
FrameMetrics
Timings of one real presented frame, in milliseconds.
FrameWindowMetrics
Aggregate statistics over the recently presented frames.
LayoutBounds
A node’s live border box, encoded on the wire as [x, y, width, height].
LayoutDiagnosticRow
One node’s renderer-computed geometry.
LayoutEdges
Computed CSS edges, encoded in shorthand order [top, right, bottom, left].
LayoutOffset
A live scroll offset, encoded as [x, y].
LayoutSize
A two-dimensional layout size, encoded as [width, height].
Modifiers
RendererMetrics
RevisionSet
RuntimeErrorEntry
ScriptMetrics
Script execution cost, in milliseconds, over the retained poll window.
ScriptSource
One attributed source of script time.
SemanticNode
SnapshotCost
What it cost to answer this diagnostics request.
SnapshotRequest
TimingStats
Mean, 95th percentile and worst case for one timing series, in milliseconds.

Enums§

AgentAction
AgentControlEvent
AgentControlRequest
DebugEvent
DebugProtocolError
DebugResponse
DebugStream
DiagnosticsRequest
IncomingRequest
InputCommand
KeyPhase
LifecycleEvent
PointerPhase
WheelPhase

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.