devlens-mcp 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -100,7 +100,7 @@ Without DevLens, AI agents resort to manual, error-prone workflows:
100
100
 
101
101
  ---
102
102
 
103
- ## Tools (36)
103
+ ## Tools (37)
104
104
 
105
105
  ### Device Management (3)
106
106
  | Tool | Description |
@@ -138,7 +138,7 @@ Without DevLens, AI agents resort to manual, error-prone workflows:
138
138
  | `devlens_fill_form` | Fill multiple fields at once |
139
139
  | `devlens_capture_flow` | Batch execute actions + capture labeled screenshots |
140
140
 
141
- ### Screenshots & Visual (5)
141
+ ### Screenshots & Visual (6)
142
142
  | Tool | Description |
143
143
  |------|-------------|
144
144
  | `devlens_screenshot` | Take screenshot (base64 + file) |
@@ -146,6 +146,7 @@ Without DevLens, AI agents resort to manual, error-prone workflows:
146
146
  | `devlens_element_screenshot` | Screenshot a specific element |
147
147
  | `devlens_compare_images` | A/B compare two saved screenshots |
148
148
  | `devlens_compare_with_figma` | Compare device screen against Figma design with per-element layout report |
149
+ | `devlens_compare_properties` | Compare ALL design properties (text sizes, colors, spacing, dimensions) per component against Figma |
149
150
 
150
151
  ### React Native / Metro (6)
151
152
  | Tool | Description |
@@ -204,9 +205,10 @@ DevLens integrates with Figma to create an automated design verification loop:
204
205
  6. **Wait for stability** — `devlens_wait_for_screen` waits until UI stops changing
205
206
  7. **Validate elements** — `devlens_snapshot(validate: true)` catches invisible/zero-size elements
206
207
  8. **Quick check** — `devlens_compare_with_figma(figmaUrl: "...", depth: "quick")` for fast iteration
207
- 9. **VQA validation** — `devlens_vqa_validate(figmaUrl: "...")` runs full VQA: spacing, colors, alignment, sizing, missing elements
208
- 10. **Fix issues** — AI reads VQA report with per-issue fix suggestions and applies fixes
209
- 11. **Repeat** — Run VQA again until status is `PASS` (zero VQA issues for designers)
208
+ 9. **Property comparison** — `devlens_compare_properties(figmaUrl: "...")` for per-component mismatches (font size, color, spacing, dimensions)
209
+ 10. **VQA validation** — `devlens_vqa_validate(figmaUrl: "...")` runs full VQA: spacing, colors, alignment, sizing, missing elements
210
+ 11. **Fix issues** — AI reads VQA/property reports with fix suggestions and applies fixes
211
+ 12. **Repeat** — Run VQA again until status is `PASS` (zero VQA issues for designers)
210
212
 
211
213
  ---
212
214
 
package/RELEASE_NOTES.md CHANGED
@@ -165,14 +165,15 @@ Four improvements that eliminate the 5% false-positive gap:
165
165
 
166
166
  ---
167
167
 
168
- ## New Tools (2)
168
+ ## New Tools (3)
169
169
 
170
170
  | Tool | Description |
171
171
  |------|-------------|
172
172
  | `devlens_analyze` | Smart analysis with configurable scope (minimal/targeted/full) |
173
173
  | `devlens_vqa_validate` | VQA validator — checks spacing, color, alignment, sizing, missing elements against Figma |
174
+ | `devlens_compare_properties` | Per-component property comparison — text sizes, colors, spacing, dimensions, layout direction with exact expected vs actual values and configurable tolerances |
174
175
 
175
- **Total tools: 36** (up from 34 in v0.3.3)
176
+ **Total tools: 37** (up from 34 in v0.3.3)
176
177
 
177
178
  ---
178
179
 
@@ -188,7 +189,7 @@ Four improvements that eliminate the 5% false-positive gap:
188
189
 
189
190
  ## Files Changed
190
191
 
191
- ### New (6 files)
192
+ ### New (9 files)
192
193
  | File | Purpose |
193
194
  |------|---------|
194
195
  | `src/setup/shell-detector.ts` | Shell type & node path detection |
@@ -197,6 +198,9 @@ Four improvements that eliminate the 5% false-positive gap:
197
198
  | `src/tools/vqa-tools.ts` | `devlens_vqa_validate` tool |
198
199
  | `src/visual/vqa-analyzer.ts` | VQA engine: spacing, sizing, alignment, color, missing checks |
199
200
  | `src/visual/color-extractor.ts` | Dominant color extraction & Delta-E comparison |
201
+ | `src/figma/figma-properties.ts` | Extract all comparable design properties from Figma REST API |
202
+ | `src/snapshot/device-properties.ts` | Extract comparable properties from device snapshot + screenshot |
203
+ | `src/visual/property-comparator.ts` | Per-property comparison engine with tolerances and severity |
200
204
 
201
205
  ### Modified (11 files)
202
206
  | File | What changed |
package/dist/bin/cli.js CHANGED
@@ -1,8 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ const fs_1 = require("fs");
5
+ const path_1 = require("path");
4
6
  const index_js_1 = require("../src/index.js");
5
7
  const config_patcher_js_1 = require("../src/setup/config-patcher.js");
8
+ if (process.argv.includes("--version") || process.argv.includes("-v")) {
9
+ const pkg = JSON.parse((0, fs_1.readFileSync)((0, path_1.resolve)(__dirname, "..", "..", "package.json"), "utf-8"));
10
+ console.log(`devlens-mcp v${pkg.version}`);
11
+ process.exit(0);
12
+ }
6
13
  async function main() {
7
14
  await (0, config_patcher_js_1.detectAndPatchConfig)();
8
15
  const server = await (0, index_js_1.createServer)();
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../bin/cli.ts"],"names":[],"mappings":";;;AAEA,8CAA+C;AAC/C,sEAAsE;AAEtE,KAAK,UAAU,IAAI;IACjB,MAAM,IAAA,wCAAoB,GAAE,CAAC;IAE7B,MAAM,MAAM,GAAG,MAAM,IAAA,uBAAY,GAAE,CAAC;IAEpC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;QAC9B,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;QAC/B,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;IACjD,OAAO,CAAC,IAAI,C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AAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -237,12 +237,15 @@ When you use any of the prompts above, the AI agent automatically runs this sequ
237
237
  3. devlens_hot_reload ← Push changes to device
238
238
  4. devlens_wait_for_screen(stableMs: 1500) ← Wait for render
239
239
  5. devlens_snapshot(validate: true) ← Get element tree + catch invisible bugs
240
- 6. devlens_vqa_validate( Run VQA
240
+ 6. devlens_compare_properties( Per-component property check
241
+ figmaUrl: "https://figma.com/design/..."
242
+ )
243
+ 7. devlens_vqa_validate( ← Run VQA
241
244
  figmaUrl: "https://figma.com/design/...",
242
245
  checkCategories: ["spacing", "color", "alignment", "sizing", "missing"]
243
246
  )
244
- 7. (AI reads VQA report, applies fix suggestions to code)
245
- 8. Repeat steps 3-7 until VQA status = PASS
247
+ 8. (AI reads property + VQA reports, applies fix suggestions to code)
248
+ 9. Repeat steps 3-8 until VQA status = PASS
246
249
  ```
247
250
 
248
251
  ---
@@ -174,7 +174,7 @@ For the full VQA workflow guide with report format details, see [Figma Workflow]
174
174
 
175
175
  ## Figma Token Setup
176
176
 
177
- Required only for `devlens_compare_with_figma`.
177
+ Required for `devlens_compare_with_figma`, `devlens_compare_properties`, and `devlens_vqa_validate`.
178
178
 
179
179
  1. Go to [figma.com/settings](https://www.figma.com/settings)
180
180
  2. Scroll to **Personal access tokens** → **Generate new token**
@@ -343,7 +343,7 @@ Then restart Cursor. npx will re-download the latest version.
343
343
 
344
344
  ## What's Available
345
345
 
346
- DevLens provides **36 tools** across 9 categories:
346
+ DevLens provides **37 tools** across 9 categories:
347
347
 
348
348
  | Category | Tools | Count |
349
349
  |----------|-------|-------|
@@ -351,7 +351,7 @@ DevLens provides **36 tools** across 9 categories:
351
351
  | App Management | launch_app, terminate_app, install_app, list_apps | 4 |
352
352
  | Snapshot & Elements | snapshot, find_element, wait_for_element, wait_for_screen, element_info | 5 |
353
353
  | Interaction | tap, type, swipe, scroll, long_press, press_button, fill_form, capture_flow | 8 |
354
- | Screenshots & Visual | screenshot, compare_screenshot, element_screenshot, compare_images, compare_with_figma | 5 |
354
+ | Screenshots & Visual | screenshot, compare_screenshot, element_screenshot, compare_images, compare_with_figma, compare_properties | 6 |
355
355
  | React Native / Metro | metro_status, metro_logs, component_tree, hot_reload, network_requests, dismiss_overlays | 6 |
356
356
  | Navigation | open_url, go_back | 2 |
357
357
  | Design System | ds_context | 1 |
@@ -1,6 +1,6 @@
1
1
  # DevLens Tool Reference
2
2
 
3
- Complete reference for all **33** DevLens MCP tools, organized by category.
3
+ Complete reference for all **37** DevLens MCP tools, organized by category.
4
4
 
5
5
  > **Tip:** Use `devlens_metro_status` at the start of every session to verify Metro is healthy before invoking Metro-dependent tools.
6
6
 
@@ -100,6 +100,8 @@ List all installed third-party apps.
100
100
  |-------|------|----------|-------------|
101
101
  | `mode` | "full" \| "incremental" | No | "full" (default) returns entire tree. "incremental" returns only changes since last snapshot. |
102
102
  | `validate` | boolean | No | When `true`, appends a **Validation Report** that flags zero-size elements, invisible nodes, and empty containers. Default: `false`. |
103
+ | `scope` | "screen" \| "component" | No | "screen" (default) captures full tree. "component" captures only the subtree of `componentRef`. |
104
+ | `componentRef` | string | No | Element ref to scope to (e.g., `"e5"`). Only used when `scope: "component"`. Reduces token usage for targeted checks. |
103
105
 
104
106
  **Example response:**
105
107
  ```
@@ -434,6 +436,10 @@ Returns similarity score, diff pixel count, and diff image (same format as `devl
434
436
  | `resizeStrategy` | "fit" \| "scale" \| "crop" | No | Dimension mismatch handling (default: "fit") |
435
437
  | `cropRef` | string | No | Crop device screenshot to element bounds |
436
438
  | `region` | {x, y, width, height} | No | Crop device screenshot to pixel region |
439
+ | `layoutReport` | boolean | No | Run per-element layout analysis (default: `true`). Requires `devlens_snapshot` first. |
440
+ | `depth` | "quick" \| "standard" \| "thorough" | No | `"quick"`: skip layout report, loose threshold. `"standard"` (default): normal behavior. `"thorough"`: per-element analysis + property summary. |
441
+ | `excludeSystemBars` | "auto" \| "ios" \| "android" \| "none" | No | Exclude status/nav bar from comparison (default: `"auto"`). |
442
+ | `preprocessReference` | boolean | No | Remove Figma artifacts — rounded corners, backgrounds (default: `true`). |
437
443
 
438
444
  > Provide either `figmaUrl`, or both `fileKey` and `nodeId`.
439
445
 
@@ -448,6 +454,54 @@ devlens_compare_with_figma(
448
454
 
449
455
  ---
450
456
 
457
+ ### devlens_compare_properties
458
+ **Per-component property comparison.** Compares ALL measurable design properties (text sizes, colors, spacing, dimensions, layout direction, padding) between a Figma design and the live device. Returns per-component mismatches with exact expected vs actual values.
459
+
460
+ More detailed than pixel comparison — use after `devlens_compare_with_figma` to catch every property difference. Requires `devlens_snapshot` to have been called first.
461
+
462
+ | Param | Type | Required | Description |
463
+ |-------|------|----------|-------------|
464
+ | `figmaUrl` | string | No | Full Figma URL |
465
+ | `fileKey` | string | No | Figma file key (alternative to figmaUrl) |
466
+ | `nodeId` | string | No | Figma node ID (use with fileKey) |
467
+ | `includeColors` | boolean | No | Extract and compare colors from screenshot (default: `true`) |
468
+ | `tolerances` | object | No | Override defaults: `{ dimensions: 2, fontSize: 0.2, color: 15, spacing: 2 }` |
469
+
470
+ **Properties compared per component:**
471
+
472
+ | Property | Source (Figma) | Source (Device) | Tolerance |
473
+ |----------|----------------|-----------------|-----------|
474
+ | Text content | `characters` | accessibility `text` | Exact |
475
+ | Width / Height | `absoluteBoundingBox` | accessibility `bounds` | ±2px |
476
+ | Font size | `style.fontSize` | height × 0.75 estimate | ±20% |
477
+ | Fill color | `fills[0].color` | screenshot sampling | ΔE ≤ 15 |
478
+ | Layout direction | `layoutMode` | inferred from children | Exact |
479
+ | Item spacing | `itemSpacing` | measured child gaps | ±2px |
480
+ | Padding | `padding*` | inferred from bounds | ±2px |
481
+ | Corner radius | `cornerRadius` | — | Info only |
482
+ | Opacity | `opacity` | — | Info only |
483
+
484
+ **Example output:**
485
+ ```
486
+ === COMPONENT PROPERTY COMPARISON ===
487
+ Compared: 47 properties | Match rate: 78% (37/47)
488
+
489
+ CRITICAL (2):
490
+ [e5] Screen > Header > Title
491
+ fontSize: expected 24px, actual ~33px
492
+ → Adjust font size from ~33px to 24px
493
+
494
+ WARNING (3):
495
+ [e8] Screen > Body > Card
496
+ width: expected 358px, actual 390px
497
+ → Adjust width from 390px to 358px
498
+ [e12] Screen > Footer > TabBar
499
+ itemSpacing: expected 0px, actual 12px
500
+ → Adjust item spacing from 12px to 0px
501
+ ```
502
+
503
+ ---
504
+
451
505
  ## React Native / Metro (6)
452
506
 
453
507
  ### devlens_metro_status
@@ -662,7 +716,7 @@ Issues: 3 (0 critical, 2 major, 1 minor)
662
716
  | 5 | `devlens_terminate_app` | App | appId |
663
717
  | 6 | `devlens_install_app` | App | path |
664
718
  | 7 | `devlens_list_apps` | App | — |
665
- | 8 | `devlens_snapshot` | Snapshot | mode?, validate? |
719
+ | 8 | `devlens_snapshot` | Snapshot | mode?, validate?, scope?, componentRef? |
666
720
  | 9 | `devlens_find_element` | Snapshot | text?, label?, type? |
667
721
  | 10 | `devlens_wait_for_element` | Snapshot | text?, label?, timeout? |
668
722
  | 11 | `devlens_wait_for_screen` | Snapshot | text?, label?, stableMs?, timeoutMs? |
@@ -679,15 +733,16 @@ Issues: 3 (0 critical, 2 major, 1 minor)
679
733
  | 22 | `devlens_compare_screenshot` | Visual | referenceImagePath?, referenceImageBase64?, cropRef?, region? |
680
734
  | 23 | `devlens_element_screenshot` | Visual | ref, filename? |
681
735
  | 24 | `devlens_compare_images` | Visual | imageA, imageB, threshold?, resizeStrategy? |
682
- | 25 | `devlens_compare_with_figma` | Visual | figmaUrl?, fileKey?, nodeId?, cropRef?, region? |
683
- | 26 | `devlens_metro_status` | Metro | |
684
- | 27 | `devlens_metro_logs` | Metro | level?, since? |
685
- | 28 | `devlens_component_tree` | Metro | depth? |
686
- | 29 | `devlens_hot_reload` | Metro | |
687
- | 30 | `devlens_network_requests` | Metro | urlPattern? |
688
- | 31 | `devlens_dismiss_overlays` | Metro | suppressLogBox?, pressBack? |
689
- | 32 | `devlens_open_url` | Navigation | url |
690
- | 33 | `devlens_go_back` | Navigation | |
691
- | 34 | `devlens_ds_context` | Design System | — |
692
- | 35 | `devlens_analyze` | Analysis | scope, targetRefs?, referenceImagePath?, referenceImageBase64?, figmaUrl?, threshold? |
693
- | 36 | `devlens_vqa_validate` | VQA | figmaUrl?, fileKey?, nodeId?, scale?, checkCategories?, enableAutoFix?, preprocessReference? |
736
+ | 25 | `devlens_compare_with_figma` | Visual | figmaUrl?, fileKey?, nodeId?, cropRef?, region?, depth?, excludeSystemBars? |
737
+ | 26 | `devlens_compare_properties` | Visual | figmaUrl?, fileKey?, nodeId?, includeColors?, tolerances? |
738
+ | 27 | `devlens_metro_status` | Metro | |
739
+ | 28 | `devlens_metro_logs` | Metro | level?, since? |
740
+ | 29 | `devlens_component_tree` | Metro | depth? |
741
+ | 30 | `devlens_hot_reload` | Metro | |
742
+ | 31 | `devlens_network_requests` | Metro | urlPattern? |
743
+ | 32 | `devlens_dismiss_overlays` | Metro | suppressLogBox?, pressBack? |
744
+ | 33 | `devlens_open_url` | Navigation | url |
745
+ | 34 | `devlens_go_back` | Navigation | — |
746
+ | 35 | `devlens_ds_context` | Design System | |
747
+ | 36 | `devlens_analyze` | Analysis | scope, targetRefs?, referenceImagePath?, referenceImageBase64?, figmaUrl?, threshold? |
748
+ | 37 | `devlens_vqa_validate` | VQA | figmaUrl?, fileKey?, nodeId?, scale?, checkCategories?, enableAutoFix?, preprocessReference? |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devlens-mcp",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "DevLens — Playwright-style MCP server for mobile development. Take screenshots, compare with Figma designs, interact with iOS Simulators & Android Emulators, and access Metro bundler logs.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",