diff
Compares two saved .fig revisions and reports exact layer ids, types and changed fields per frame, so you can see precisely what changed between design versions.
Instructions
What changed between two saved revisions of a design (old, file): exact layer ids and types only: a frame renamed in place (same id and type) is a structure change, while a recreated frame (a new id) is reported as removed plus added, with a labelled possibleMatch (same name, else same rounded size and position) that never claims identity; lineage between the two files is not verified. Each changed top-level frame (layers directly on a page group under the page) has one summary line with counts per facet: text (text, fonts and laid-out glyphs), layout (size, transform, constraints, auto layout), appearance (fills, strokes, effects, opacity, radius, visibility), properties (component property definitions and assignments, variable values, scopes and code syntax, descriptions, style type, Dev Mode annotations and categories, a page's Ready for dev map and prototype interactions), structure (name, type, parent, order, hidden) and bindings (variable, style, image, main component and prototype edges, old and new compared so removed ones are listed). Nodes carry changed fields with old/new values (each within 512 bytes and 4 KiB per node, 256 KiB per page; larger values say truncated, never unchanged) and edge additions/removals, with swap naming both mains. A side that stopped short reports its missing layers as unknown, never removed; a layer with a field it could not read and no proven difference is unknown with unread, never changed. Pages of changes in stable frame order; nextCursor binds both snapshots, the node, the built corpora and the retained result, so a rebuild that stopped elsewhere is cursor_stale. Nothing is written.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"old": "<old>",
"file": "<file>"
},
"name": "diff"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| old | Yes | the earlier saved .fig: a local path | |
| file | Yes | the later saved .fig: a local path | |
| node | No | stored scope root on both sides; default the document | 0:0 |
| limit | No | 1-500 changed layers per page, default 100 | |
| cursor | No | nextCursor from the previous page of the same pair and node |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| node | No | ||
| frames | Yes | id, name, page, change when the frame itself changed, summary (N listed, then counts per facet and unread), possibleMatch {id, basis, identity possible_match}, and this page's nodes: id, kind, name, change, facets, fields {key: {facet, old, new}}, edges {added, removed, truncated count, swap {old, new} or {truncated}}, descendants, identity_uncertain with oldKind; unread with fields when a field could not be read (change unknown when nothing else proves a difference) | |
| source | Yes | old and new sourceId and snapshotId, and freshness.reusedPair | |
| coverage | Yes | complete; old and new stop and scannedRecords; changes (layers listed across pages, added/removed subtrees counted at their top), possibleMatches and reasons (a side's stop, diff_work_limit, unread_fields, relation_unverified, hidden_content_not_expanded, selection_context_unknown, definition_not_compared for styles, variables, main components and component sets outside the compared records, including variables a compared variable aliases, its collection, explicit variable modes inherited from above the selected node, and Dev Mode state stored above it: a page's Ready for dev status of a compared layer and the document's annotation categories a compared annotation names) | |
| matching | No | basis node_id+kind; lineage unverified | |
| nextCursor | Yes |