mirror of
https://github.com/storytold/figcraft.git
synced 2026-11-30 10:16:46 +01:00
An agent building a page can't see whether it matches the design. `inspect.compare` and the MCP tool `compare_design` take a capture the agent's own browser tools made and compare it with a frame, on this computer. A browser's text and antialiasing never match pixel for pixel, so the answer isn't one score: it is the layers that differ, each on the deepest layer it belongs to and largest first, as a position difference (with its offset), a colour difference (expected and actual) or a content difference. Text is held to twice the tolerance. A capture at 2x is the same design: the frame's width sets the density. Explicit targets are validated, and one frame is compared at a time. Parameters of the wrong type are refused, and so are a path and data together. The capture is size-checked before it is decoded, the comparison scale is bounded by the larger of the frame and the capture, the layer walk is iterative and capped (`truncated` says so), and only the 100 differences listed are searched for a move.
14 lines
285 B
Rust
14 lines
285 B
Rust
pub mod annotations;
|
|
pub mod asset_handoff;
|
|
pub mod code_connect;
|
|
pub mod codegen;
|
|
pub mod component_codegen;
|
|
pub mod design_context;
|
|
pub mod dev_measurements;
|
|
pub mod dev_resources;
|
|
pub mod devcompare;
|
|
pub mod devinspect;
|
|
pub mod responsive;
|
|
pub mod tailwind;
|
|
pub mod visual_compare;
|