bruniai 0.1.7 → 0.1.8

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.
Files changed (119) hide show
  1. package/dist/compare-images.d.ts.map +1 -1
  2. package/dist/compare-images.js +7 -2
  3. package/dist/compare-images.js.map +1 -1
  4. package/dist/compare-urls.d.ts.map +1 -1
  5. package/dist/compare-urls.js +7 -2
  6. package/dist/compare-urls.js.map +1 -1
  7. package/dist/runtime/comparison/core.d.ts +59 -0
  8. package/dist/runtime/comparison/core.d.ts.map +1 -0
  9. package/dist/runtime/comparison/core.js +83 -0
  10. package/dist/runtime/comparison/core.js.map +1 -0
  11. package/dist/runtime/comparison/figma-core.d.ts +66 -0
  12. package/dist/runtime/comparison/figma-core.d.ts.map +1 -0
  13. package/dist/runtime/comparison/figma-core.js +116 -0
  14. package/dist/runtime/comparison/figma-core.js.map +1 -0
  15. package/dist/runtime/comparison/image-core.d.ts +33 -0
  16. package/dist/runtime/comparison/image-core.d.ts.map +1 -0
  17. package/dist/runtime/comparison/image-core.js +246 -0
  18. package/dist/runtime/comparison/image-core.js.map +1 -0
  19. package/dist/runtime/comparison/image-image-core.d.ts +30 -0
  20. package/dist/runtime/comparison/image-image-core.d.ts.map +1 -0
  21. package/dist/runtime/comparison/image-image-core.js +242 -0
  22. package/dist/runtime/comparison/image-image-core.js.map +1 -0
  23. package/dist/runtime/diff/diff.d.ts +18 -0
  24. package/dist/runtime/diff/diff.d.ts.map +1 -0
  25. package/dist/runtime/diff/diff.js +99 -0
  26. package/dist/runtime/diff/diff.js.map +1 -0
  27. package/dist/runtime/image/detector.d.ts +5 -0
  28. package/dist/runtime/image/detector.d.ts.map +1 -0
  29. package/dist/runtime/image/detector.js +33 -0
  30. package/dist/runtime/image/detector.js.map +1 -0
  31. package/dist/runtime/image/fetch.d.ts +8 -0
  32. package/dist/runtime/image/fetch.d.ts.map +1 -0
  33. package/dist/runtime/image/fetch.js +41 -0
  34. package/dist/runtime/image/fetch.js.map +1 -0
  35. package/dist/runtime/image/index.d.ts +6 -0
  36. package/dist/runtime/image/index.d.ts.map +1 -0
  37. package/dist/runtime/image/index.js +5 -0
  38. package/dist/runtime/image/index.js.map +1 -0
  39. package/dist/runtime/image/report.d.ts +11 -0
  40. package/dist/runtime/image/report.d.ts.map +1 -0
  41. package/dist/runtime/image/report.js +89 -0
  42. package/dist/runtime/image/report.js.map +1 -0
  43. package/dist/runtime/image/visual-sections.d.ts +105 -0
  44. package/dist/runtime/image/visual-sections.d.ts.map +1 -0
  45. package/dist/runtime/image/visual-sections.js +1012 -0
  46. package/dist/runtime/image/visual-sections.js.map +1 -0
  47. package/dist/runtime/reporter/image-compression.d.ts +15 -0
  48. package/dist/runtime/reporter/image-compression.d.ts.map +1 -0
  49. package/dist/runtime/reporter/image-compression.js +71 -0
  50. package/dist/runtime/reporter/image-compression.js.map +1 -0
  51. package/dist/runtime/reporter/index.d.ts +8 -0
  52. package/dist/runtime/reporter/index.d.ts.map +1 -0
  53. package/dist/runtime/reporter/index.js +7 -0
  54. package/dist/runtime/reporter/index.js.map +1 -0
  55. package/dist/runtime/reporter/report-generator.d.ts +33 -0
  56. package/dist/runtime/reporter/report-generator.d.ts.map +1 -0
  57. package/dist/runtime/reporter/report-generator.js +191 -0
  58. package/dist/runtime/reporter/report-generator.js.map +1 -0
  59. package/dist/runtime/reporter/reporter.d.ts +24 -0
  60. package/dist/runtime/reporter/reporter.d.ts.map +1 -0
  61. package/dist/runtime/reporter/reporter.js +99 -0
  62. package/dist/runtime/reporter/reporter.js.map +1 -0
  63. package/dist/runtime/reporter/types.d.ts +98 -0
  64. package/dist/runtime/reporter/types.d.ts.map +1 -0
  65. package/dist/runtime/reporter/types.js +5 -0
  66. package/dist/runtime/reporter/types.js.map +1 -0
  67. package/dist/runtime/sections/sectionDom.d.ts +19 -0
  68. package/dist/runtime/sections/sectionDom.d.ts.map +1 -0
  69. package/dist/runtime/sections/sectionDom.js +50 -0
  70. package/dist/runtime/sections/sectionDom.js.map +1 -0
  71. package/dist/runtime/sections/sectionExtraction.d.ts +50 -0
  72. package/dist/runtime/sections/sectionExtraction.d.ts.map +1 -0
  73. package/dist/runtime/sections/sectionExtraction.js +422 -0
  74. package/dist/runtime/sections/sectionExtraction.js.map +1 -0
  75. package/dist/runtime/sections/sections.d.ts +7 -0
  76. package/dist/runtime/sections/sections.d.ts.map +1 -0
  77. package/dist/runtime/sections/sections.js +128 -0
  78. package/dist/runtime/sections/sections.js.map +1 -0
  79. package/dist/runtime/utils/json.d.ts +2 -0
  80. package/dist/runtime/utils/json.d.ts.map +1 -0
  81. package/dist/runtime/utils/json.js +13 -0
  82. package/dist/runtime/utils/json.js.map +1 -0
  83. package/dist/runtime/utils/window.d.ts +35 -0
  84. package/dist/runtime/utils/window.d.ts.map +1 -0
  85. package/dist/runtime/utils/window.js +144 -0
  86. package/dist/runtime/utils/window.js.map +1 -0
  87. package/dist/runtime/vision/agents.d.ts +51 -0
  88. package/dist/runtime/vision/agents.d.ts.map +1 -0
  89. package/dist/runtime/vision/agents.js +409 -0
  90. package/dist/runtime/vision/agents.js.map +1 -0
  91. package/dist/runtime/vision/combiner.d.ts +18 -0
  92. package/dist/runtime/vision/combiner.d.ts.map +1 -0
  93. package/dist/runtime/vision/combiner.js +169 -0
  94. package/dist/runtime/vision/combiner.js.map +1 -0
  95. package/dist/runtime/vision/comparison-html.d.ts +16 -0
  96. package/dist/runtime/vision/comparison-html.d.ts.map +1 -0
  97. package/dist/runtime/vision/comparison-html.js +116 -0
  98. package/dist/runtime/vision/comparison-html.js.map +1 -0
  99. package/dist/runtime/vision/index.d.ts +5 -0
  100. package/dist/runtime/vision/index.d.ts.map +1 -0
  101. package/dist/runtime/vision/index.js +4 -0
  102. package/dist/runtime/vision/index.js.map +1 -0
  103. package/dist/runtime/vision/section-judge.d.ts +8 -0
  104. package/dist/runtime/vision/section-judge.d.ts.map +1 -0
  105. package/dist/runtime/vision/section-judge.js +87 -0
  106. package/dist/runtime/vision/section-judge.js.map +1 -0
  107. package/dist/runtime/vision/types.d.ts +592 -0
  108. package/dist/runtime/vision/types.d.ts.map +1 -0
  109. package/dist/runtime/vision/types.js +126 -0
  110. package/dist/runtime/vision/types.js.map +1 -0
  111. package/dist/runtime/vision/utils.d.ts +79 -0
  112. package/dist/runtime/vision/utils.d.ts.map +1 -0
  113. package/dist/runtime/vision/utils.js +415 -0
  114. package/dist/runtime/vision/utils.js.map +1 -0
  115. package/dist/runtime/vision/vision.d.ts +37 -0
  116. package/dist/runtime/vision/vision.d.ts.map +1 -0
  117. package/dist/runtime/vision/vision.js +173 -0
  118. package/dist/runtime/vision/vision.js.map +1 -0
  119. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"compare-images.d.ts","sourceRoot":"","sources":["../src/compare-images.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAmDpB;;;;;;;;;;;;GAYG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,mBAAmB,CAAC,CA4C9B"}
1
+ {"version":3,"file":"compare-images.d.ts","sourceRoot":"","sources":["../src/compare-images.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAyDpB;;;;;;;;;;;;GAYG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,mBAAmB,CAAC,CA4C9B"}
@@ -8,10 +8,15 @@ async function importRuntimeModule(relativePath) {
8
8
  }
9
9
  async function loadImageToImageComparisonModule() {
10
10
  try {
11
- return await importRuntimeModule("../../../dist/comparison/image-image-core.js");
11
+ return await importRuntimeModule("./runtime/comparison/image-image-core.js");
12
12
  }
13
13
  catch {
14
- return await importRuntimeModule("../../../src/comparison/image-image-core.js");
14
+ try {
15
+ return await importRuntimeModule("../../../dist/comparison/image-image-core.js");
16
+ }
17
+ catch {
18
+ return await importRuntimeModule("../../../src/comparison/image-image-core.js");
19
+ }
15
20
  }
16
21
  }
17
22
  function isSupportedImageInput(input) {
@@ -1 +1 @@
1
- {"version":3,"file":"compare-images.js","sourceRoot":"","sources":["../src/compare-images.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAK5B,KAAK,UAAU,mBAAmB,CAAI,YAAoB;IACxD,MAAM,UAAU,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACzE,OAAO,CAAC,MAAM,MAAM,CAAC,UAAU,CAAC,CAAM,CAAC;AACzC,CAAC;AAED,KAAK,UAAU,gCAAgC;IAC7C,IAAI,CAAC;QACH,OAAO,MAAM,mBAAmB,CAC9B,8CAA8C,CAC/C,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,MAAM,mBAAmB,CAC9B,6CAA6C,CAC9C,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAS,qBAAqB,CAAC,KAAa;IAC1C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;QAC9B,OAAO,MAAM,CAAC,QAAQ,KAAK,OAAO,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC;IACrE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK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ts","sourceRoot":"","sources":["../src/compare-urls.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AA+BtE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,WAAW,CAC/B,KAAK,EAAE,gBAAgB,GACtB,OAAO,CAAC,iBAAiB,CAAC,CAiE5B"}
@@ -9,10 +9,15 @@ async function importRuntimeModule(relativePath) {
9
9
  }
10
10
  async function loadComparisonCoreModule() {
11
11
  try {
12
- return await importRuntimeModule("../../../dist/comparison/core.js");
12
+ return await importRuntimeModule("./runtime/comparison/core.js");
13
13
  }
14
14
  catch {
15
- return await importRuntimeModule("../../../src/comparison/core.js");
15
+ try {
16
+ return await importRuntimeModule("../../../dist/comparison/core.js");
17
+ }
18
+ catch {
19
+ return await importRuntimeModule("../../../src/comparison/core.js");
20
+ }
16
21
  }
17
22
  }
18
23
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"compare-urls.js","sourceRoot":"","sources":["../src/compare-urls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAI5B,KAAK,UAAU,mBAAmB,CAAI,YAAoB;IACxD,MAAM,UAAU,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACzE,OAAO,CAAC,MAAM,MAAM,CAAC,UAAU,CAAC,CAAM,CAAC;AACzC,CAAC;AAED,KAAK,UAAU,wBAAwB;IACrC,IAAI,CAAC;QACH,OAAO,MAAM,mBAAmB,CAC9B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;YACT,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,UAAU,EAAE,KAAK,CAAC,UAAU;SAC7B,CAAC,CAAC;QAEH,0BAA0B;QAC1B,kFAAkF;QAClF,MAAM,MAAM,GACV,MAAM,CAAC,eAAe,CAAC,MAAM,KAAK,MAAM;YACtC,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC;QAEpC,MAAM,MAAM,GAAsB;YAChC,MAAM;YACN,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;YAC3C,MAAM,EAAE;gBACN,eAAe,EAAE,MAAM,CAAC,eAAe;gBACvC,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;gBAC7C,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC7B,mBAAmB,EACjB,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,MAAM,GAAG,CAAC;oBAChD,CAAC,CAAC,MAAM,CAAC,WAAW,CAChB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAC5C,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;wBAChB,GAAG;wBACH,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE;qBAC7C,CACF,CACF;oBACH,CAAC,CAAC,SAAS;aAChB;SACF,CAAC;QAEF,OAAO,MAAM,CAAC;IAChB,CAAC;YAAS,CAAC;QACT,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC;AACH,CAAC"}
@@ -0,0 +1,59 @@
1
+ import type { Stagehand } from "@browserbasehq/stagehand";
2
+ import type { VisualAnalysisResult } from "../vision/types.js";
3
+ import type { SectionVisualResult } from "../reporter/types.js";
4
+ /**
5
+ * Options for performing a visual comparison.
6
+ */
7
+ export interface ComparisonOptions {
8
+ /** Stagehand instance to use for browser automation. */
9
+ stagehand: Stagehand;
10
+ /** Base/reference URL. */
11
+ baseUrl: string;
12
+ /** Preview/changed URL. */
13
+ previewUrl: string;
14
+ /** Page path to compare (e.g., "/" or "/about"). */
15
+ page: string;
16
+ /** Directory where images should be saved. */
17
+ imagesDir: string;
18
+ /** Optional PR number for metadata. */
19
+ prNumber?: string;
20
+ /** Optional repository name for metadata. */
21
+ repository?: string;
22
+ }
23
+ /**
24
+ * Result of a visual comparison.
25
+ */
26
+ export interface ComparisonResult {
27
+ /** Visual analysis result from AI. */
28
+ visual_analysis: VisualAnalysisResult;
29
+ /** Formatted sections analysis text. */
30
+ sections_analysis: string;
31
+ /** Path to base screenshot. */
32
+ base_screenshot: string;
33
+ /** Path to preview screenshot. */
34
+ preview_screenshot: string;
35
+ /** Path to diff image. */
36
+ diff_image: string;
37
+ /** Section screenshots keyed by section ID. */
38
+ section_screenshots: Record<string, {
39
+ base: string;
40
+ preview: string;
41
+ }>;
42
+ /** Optional deterministic section-level diff data. */
43
+ section_results?: SectionVisualResult[];
44
+ }
45
+ /**
46
+ * Perform visual comparison between two URLs.
47
+ *
48
+ * This function performs the core comparison workflow:
49
+ * 1. Takes screenshots of base and preview URLs
50
+ * 2. Generates diff image
51
+ * 3. Analyzes sections structure
52
+ * 4. Performs visual analysis with AI
53
+ * 5. Captures section screenshots
54
+ *
55
+ * @param options - Comparison options
56
+ * @returns Complete comparison results with image paths
57
+ */
58
+ export declare function performComparison(options: ComparisonOptions): Promise<ComparisonResult>;
59
+ //# sourceMappingURL=core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/comparison/core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAS1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAIhE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,SAAS,EAAE,SAAS,CAAC;IACrB,0BAA0B;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,sCAAsC;IACtC,eAAe,EAAE,oBAAoB,CAAC;IACtC,wCAAwC;IACxC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,+BAA+B;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,kCAAkC;IAClC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvE,sDAAsD;IACtD,eAAe,CAAC,EAAE,mBAAmB,EAAE,CAAC;CACzC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,gBAAgB,CAAC,CAqI3B"}
@@ -0,0 +1,83 @@
1
+ import { generateDiffImage } from "../diff/diff.js";
2
+ import { analyzeSectionsSideBySide } from "../sections/sections.js";
3
+ import { extractSectionBoundingBoxes, takeSectionScreenshot, } from "../sections/sectionExtraction.js";
4
+ import { analyzeImagesWithVision } from "../vision/index.js";
5
+ import { ensureViewportSize, ensurePageFullyRendered } from "../utils/window.js";
6
+ import { join } from "path";
7
+ import { writeFileSync } from "fs";
8
+ /**
9
+ * Perform visual comparison between two URLs.
10
+ *
11
+ * This function performs the core comparison workflow:
12
+ * 1. Takes screenshots of base and preview URLs
13
+ * 2. Generates diff image
14
+ * 3. Analyzes sections structure
15
+ * 4. Performs visual analysis with AI
16
+ * 5. Captures section screenshots
17
+ *
18
+ * @param options - Comparison options
19
+ * @returns Complete comparison results with image paths
20
+ */
21
+ export async function performComparison(options) {
22
+ const { stagehand, baseUrl, previewUrl, page, imagesDir, prNumber = "", repository = "", } = options;
23
+ // Construct full URLs for this page.
24
+ const fullBaseUrl = baseUrl.replace(/\/$/, "") + page;
25
+ const fullPreviewUrl = previewUrl.replace(/\/$/, "") + page;
26
+ // Generate page suffix for file naming.
27
+ let pageSuffix = page.replace(/\//g, "_");
28
+ pageSuffix = pageSuffix === "_" ? "home" : pageSuffix;
29
+ // Get the page and navigate to blank page first to ensure it's ready.
30
+ const initialPage = stagehand.context.pages()[0];
31
+ await ensureViewportSize(initialPage, "about:blank");
32
+ // Ensure viewport is set correctly before navigating and taking screenshot.
33
+ await ensureViewportSize(initialPage, fullBaseUrl);
34
+ // Scroll through the page to trigger lazy loading and wait for images.
35
+ await ensurePageFullyRendered(initialPage);
36
+ const baseScreenshot = await initialPage.screenshot({
37
+ fullPage: true,
38
+ });
39
+ const baseScreenshotPath = join(imagesDir, `base_screenshot_${pageSuffix}.png`);
40
+ writeFileSync(baseScreenshotPath, baseScreenshot);
41
+ // Ensure viewport is set correctly before navigating to preview URL and taking screenshot.
42
+ await ensureViewportSize(initialPage, fullPreviewUrl);
43
+ await ensurePageFullyRendered(initialPage);
44
+ const previewScreenshot = await initialPage.screenshot({
45
+ fullPage: true,
46
+ });
47
+ const previewScreenshotPath = join(imagesDir, `preview_screenshot_${pageSuffix}.png`);
48
+ writeFileSync(previewScreenshotPath, previewScreenshot);
49
+ const diffImagePath = join(imagesDir, `diff_${pageSuffix}.png`);
50
+ await generateDiffImage(baseScreenshotPath, previewScreenshotPath, diffImagePath);
51
+ // Analyze sections and get formatted analysis output.
52
+ const sectionsAnalysis = await analyzeSectionsSideBySide(stagehand, fullBaseUrl, fullPreviewUrl);
53
+ // Extract section bounding boxes with IDs from analysis.
54
+ const sectionsWithIds = await extractSectionBoundingBoxes(stagehand, fullBaseUrl, sectionsAnalysis);
55
+ // Capture section screenshots for both base and preview URLs.
56
+ const sectionScreenshots = {};
57
+ for (const section of sectionsWithIds) {
58
+ const sectionId = section.sectionId;
59
+ // Define section screenshot paths.
60
+ const baseSectionScreenshot = join(imagesDir, `base_screenshot_${pageSuffix}_section_${sectionId}.png`);
61
+ const previewSectionScreenshot = join(imagesDir, `preview_screenshot_${pageSuffix}_section_${sectionId}.png`);
62
+ // Take section screenshots using section IDs and analysis data.
63
+ const baseSectionSuccess = await takeSectionScreenshot(stagehand, fullBaseUrl, baseSectionScreenshot, sectionId, sectionsAnalysis);
64
+ const previewSectionSuccess = await takeSectionScreenshot(stagehand, fullPreviewUrl, previewSectionScreenshot, sectionId, sectionsAnalysis);
65
+ if (baseSectionSuccess && previewSectionSuccess) {
66
+ sectionScreenshots[sectionId] = {
67
+ base: baseSectionScreenshot,
68
+ preview: previewSectionScreenshot,
69
+ };
70
+ }
71
+ }
72
+ // Perform visual analysis with the sections information.
73
+ const visualAnalysis = await analyzeImagesWithVision(baseScreenshotPath, previewScreenshotPath, diffImagePath, fullBaseUrl, fullPreviewUrl, prNumber, repository, sectionsAnalysis);
74
+ return {
75
+ visual_analysis: visualAnalysis,
76
+ sections_analysis: sectionsAnalysis,
77
+ base_screenshot: baseScreenshotPath,
78
+ preview_screenshot: previewScreenshotPath,
79
+ diff_image: diffImagePath,
80
+ section_screenshots: sectionScreenshots,
81
+ };
82
+ }
83
+ //# sourceMappingURL=core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../../src/comparison/core.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAA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sB,UAAU,YAAY,SAAS,MAAM,CAC5D,CAAC;QAEF,gEAAgE;QAChE,MAAM,kBAAkB,GAAG,MAAM,qBAAqB,CACpD,SAAS,EACT,WAAW,EACX,qBAAqB,EACrB,SAAS,EACT,gBAAgB,CACjB,CAAC;QACF,MAAM,qBAAqB,GAAG,MAAM,qBAAqB,CACvD,SAAS,EACT,cAAc,EACd,wBAAwB,EACxB,SAAS,EACT,gBAAgB,CACjB,CAAC;QAEF,IAAI,kBAAkB,IAAI,qBAAqB,EAAE,CAAC;YAChD,kBAAkB,CAAC,SAAS,CAAC,GAAG;gBAC9B,IAAI,EAAE,qBAAqB;gBAC3B,OAAO,EAAE,wBAAwB;aAClC,CAAC;QACJ,CAAC;IACH,CAAC;IAED,yDAAyD;IACzD,MAAM,cAAc,GAAG,MAAM,uBAAuB,CAClD,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,WAAW,EACX,cAAc,EACd,QAAQ,EACR,UAAU,EACV,gBAAgB,CACjB,CAAC;IAEF,OAAO;QACL,eAAe,EAAE,cAAc;QAC/B,iBAAiB,EAAE,gBAAgB;QACnC,eAAe,EAAE,kBAAkB;QACnC,kBAAkB,EAAE,qBAAqB;QACzC,UAAU,EAAE,aAAa;QACzB,mBAAmB,EAAE,kBAAkB;KACxC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Figma-to-URL comparison core functionality.
3
+ *
4
+ * This module provides the workflow for comparing Figma prototype
5
+ * screenshots against live website URLs using visual AI-based section
6
+ * detection.
7
+ */
8
+ import type { Stagehand } from "@browserbasehq/stagehand";
9
+ import type { VisualAnalysisResult } from "../vision/types.js";
10
+ /**
11
+ * Options for performing a Figma-to-URL comparison.
12
+ */
13
+ export interface FigmaComparisonOptions {
14
+ /** Stagehand instance to use for browser automation. */
15
+ stagehand: Stagehand;
16
+ /** Figma prototype URL (base/reference). */
17
+ figmaUrl: string;
18
+ /** Preview/live URL to compare against. */
19
+ previewUrl: string;
20
+ /** Page path for the comparison (used for file naming). */
21
+ page: string;
22
+ /** Directory where images should be saved. */
23
+ imagesDir: string;
24
+ /** Optional PR number for metadata. */
25
+ prNumber?: string;
26
+ /** Optional repository name for metadata. */
27
+ repository?: string;
28
+ }
29
+ /**
30
+ * Result of a Figma-to-URL comparison.
31
+ */
32
+ export interface FigmaComparisonResult {
33
+ /** Visual analysis result from AI. */
34
+ visual_analysis: VisualAnalysisResult;
35
+ /** Formatted sections analysis text (AI-detected). */
36
+ sections_analysis: string;
37
+ /** Path to Figma screenshot (base). */
38
+ base_screenshot: string;
39
+ /** Path to preview URL screenshot. */
40
+ preview_screenshot: string;
41
+ /** Path to diff image. */
42
+ diff_image: string;
43
+ /** Section screenshots keyed by section ID. */
44
+ section_screenshots: Record<string, {
45
+ base: string;
46
+ preview: string;
47
+ }>;
48
+ /** Comparison mode indicator. */
49
+ mode: "figma-to-url";
50
+ }
51
+ /**
52
+ * Perform visual comparison between a Figma prototype and a live URL.
53
+ *
54
+ * This function performs the Figma-to-URL comparison workflow:
55
+ * 1. Takes screenshot of Figma prototype (canvas only)
56
+ * 2. Takes screenshot of preview URL
57
+ * 3. Generates diff image
58
+ * 4. Extracts visual sections using AI
59
+ * 5. Captures section screenshots
60
+ * 6. Performs visual analysis with AI
61
+ *
62
+ * @param options - Figma comparison options.
63
+ * @returns Complete comparison results with image paths.
64
+ */
65
+ export declare function performFigmaComparison(options: FigmaComparisonOptions): Promise<FigmaComparisonResult>;
66
+ //# sourceMappingURL=figma-core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"figma-core.d.ts","sourceRoot":"","sources":["../../src/comparison/figma-core.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAU1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAK/D;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,wDAAwD;IACxD,SAAS,EAAE,SAAS,CAAC;IACrB,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,sCAAsC;IACtC,eAAe,EAAE,oBAAoB,CAAC;IACtC,sDAAsD;IACtD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,uCAAuC;IACvC,eAAe,EAAE,MAAM,CAAC;IACxB,sCAAsC;IACtC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvE,iCAAiC;IACjC,IAAI,EAAE,cAAc,CAAC;CACtB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,qBAAqB,CAAC,CAiKhC"}
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Figma-to-URL comparison core functionality.
3
+ *
4
+ * This module provides the workflow for comparing Figma prototype
5
+ * screenshots against live website URLs using visual AI-based section
6
+ * detection.
7
+ */
8
+ import { generateDiffImage } from "../diff/diff.js";
9
+ import { screenshotFigmaPrototype, extractVisualSections, formatVisualSectionsAsAnalysis, takeSectionScreenshotsFromVisualBounds, } from "../figma/index.js";
10
+ import { analyzeImagesWithVisionFigmaMode } from "../vision/index.js";
11
+ import { ensureViewportSize } from "../utils/window.js";
12
+ import { join } from "path";
13
+ import { writeFileSync } from "fs";
14
+ import sharp from "sharp";
15
+ /**
16
+ * Perform visual comparison between a Figma prototype and a live URL.
17
+ *
18
+ * This function performs the Figma-to-URL comparison workflow:
19
+ * 1. Takes screenshot of Figma prototype (canvas only)
20
+ * 2. Takes screenshot of preview URL
21
+ * 3. Generates diff image
22
+ * 4. Extracts visual sections using AI
23
+ * 5. Captures section screenshots
24
+ * 6. Performs visual analysis with AI
25
+ *
26
+ * @param options - Figma comparison options.
27
+ * @returns Complete comparison results with image paths.
28
+ */
29
+ export async function performFigmaComparison(options) {
30
+ const { stagehand, figmaUrl, previewUrl, page, imagesDir, prNumber = "", repository = "", } = options;
31
+ console.log(`\n${"=".repeat(50)}\n🎨 Starting Figma-to-URL Comparison\n${"=".repeat(50)}`);
32
+ console.log(`Figma URL: ${figmaUrl}`);
33
+ console.log(`Preview URL: ${previewUrl}`);
34
+ // Generate page suffix for file naming.
35
+ let pageSuffix = page.replace(/\//g, "_");
36
+ pageSuffix = pageSuffix === "_" ? "home" : pageSuffix;
37
+ // Step 1: Take screenshot of Figma prototype.
38
+ console.log("\n📸 Step 1: Capturing Figma prototype screenshot...");
39
+ const baseScreenshotPath = join(imagesDir, `base_screenshot_${pageSuffix}.png`);
40
+ const figmaResult = await screenshotFigmaPrototype(stagehand, figmaUrl, baseScreenshotPath);
41
+ if (!figmaResult.success) {
42
+ throw new Error(`Failed to capture Figma screenshot: ${figmaResult.error || "Unknown error"}`);
43
+ }
44
+ console.log(`Figma screenshot saved: ${baseScreenshotPath}`);
45
+ console.log(`Canvas bounds: ${JSON.stringify(figmaResult.canvasBounds)}`);
46
+ // Step 2: Take screenshot of preview URL.
47
+ console.log("\n📸 Step 2: Capturing preview URL screenshot...");
48
+ const initialPage = stagehand.context.pages()[0];
49
+ await ensureViewportSize(initialPage, previewUrl);
50
+ const previewScreenshot = await initialPage.screenshot({
51
+ fullPage: true,
52
+ });
53
+ const previewScreenshotPath = join(imagesDir, `preview_screenshot_${pageSuffix}.png`);
54
+ writeFileSync(previewScreenshotPath, previewScreenshot);
55
+ console.log(`Preview screenshot saved: ${previewScreenshotPath}`);
56
+ // Step 3: Generate diff image.
57
+ console.log("\n🔍 Step 3: Generating diff image...");
58
+ const diffImagePath = join(imagesDir, `diff_${pageSuffix}.png`);
59
+ await generateDiffImage(baseScreenshotPath, previewScreenshotPath, diffImagePath);
60
+ console.log(`Diff image saved: ${diffImagePath}`);
61
+ // Step 4: Extract visual sections from Figma screenshot using AI.
62
+ console.log("\n🤖 Step 4: Extracting visual sections using AI...");
63
+ const visualSectionsResult = await extractVisualSections(stagehand, baseScreenshotPath);
64
+ // Format sections analysis for compatibility with existing workflow.
65
+ const sectionsAnalysis = formatVisualSectionsAsAnalysis(visualSectionsResult);
66
+ console.log(`\n${"=".repeat(50)}\n🗺️ Visual Sections Analysis:\n${sectionsAnalysis}\n${"=".repeat(50)}`);
67
+ // Step 5: Capture section screenshots.
68
+ console.log("\n📷 Step 5: Capturing section screenshots...");
69
+ const sectionScreenshots = {};
70
+ // Take section screenshots from preview URL using visual bounds.
71
+ const previewSectionScreenshots = await takeSectionScreenshotsFromVisualBounds(stagehand, previewUrl, visualSectionsResult.sections, imagesDir, pageSuffix);
72
+ // For Figma sections, we use the visual bounds to clip from the base screenshot.
73
+ for (const section of visualSectionsResult.sections) {
74
+ const sectionId = section.sectionId;
75
+ const baseSectionPath = join(imagesDir, `base_screenshot_${pageSuffix}_section_${sectionId}.png`);
76
+ try {
77
+ // Crop directly from the stitched base screenshot.
78
+ // This works even when the section is below the first viewport.
79
+ const baseSectionScreenshot = await sharp(baseScreenshotPath)
80
+ .extract({
81
+ left: Math.max(0, Math.round(section.boundingBox.x)),
82
+ top: Math.max(0, Math.round(section.boundingBox.y)),
83
+ width: Math.max(1, Math.round(section.boundingBox.width)),
84
+ height: Math.max(1, Math.round(section.boundingBox.height)),
85
+ })
86
+ .png()
87
+ .toBuffer();
88
+ writeFileSync(baseSectionPath, baseSectionScreenshot);
89
+ // Only add to result if both screenshots exist.
90
+ if (previewSectionScreenshots[sectionId]) {
91
+ sectionScreenshots[sectionId] = {
92
+ base: baseSectionPath,
93
+ preview: previewSectionScreenshots[sectionId],
94
+ };
95
+ }
96
+ }
97
+ catch (error) {
98
+ console.warn(`Failed to capture Figma section ${sectionId}: ${error}`);
99
+ }
100
+ }
101
+ console.log(`Captured ${Object.keys(sectionScreenshots).length} section screenshot pairs`);
102
+ // Step 6: Perform visual analysis with AI (Figma mode - skips URL navigation).
103
+ console.log("\n🧠 Step 6: Performing visual analysis (Figma mode)...");
104
+ const visualAnalysis = await analyzeImagesWithVisionFigmaMode(baseScreenshotPath, previewScreenshotPath, diffImagePath, figmaUrl, previewUrl, prNumber, repository, sectionsAnalysis);
105
+ console.log(`Visual analysis completed: ${visualAnalysis.status}`);
106
+ return {
107
+ visual_analysis: visualAnalysis,
108
+ sections_analysis: sectionsAnalysis,
109
+ base_screenshot: baseScreenshotPath,
110
+ preview_screenshot: previewScreenshotPath,
111
+ diff_image: diffImagePath,
112
+ section_screenshots: sectionScreenshots,
113
+ mode: "figma-to-url",
114
+ };
115
+ }
116
+ //# sourceMappingURL=figma-core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"figma-core.js","sourceRoot":"","sources":["../../src/comparison/figma-core.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,8BAA8B,EAC9B,sCAAsC,GACvC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACnC,OAAO,KAAK,MAAM,OAAO,CAAC;AA0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O,EAAE,yBAAyB,CAAC,SAAS,CAAC;iBAC9C,CAAC;YACJ,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,IAAI,CACV,mCAAmC,SAAS,KAAK,KAAK,EAAE,CACzD,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,CACT,YAAY,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,2BAA2B,CAC9E,CAAC;IAEF,+EAA+E;IAC/E,OAAO,CAAC,GAAG,CAAC,yDAAyD,CAAC,CAAC;IACvE,MAAM,cAAc,GAAG,MAAM,gCAAgC,CAC3D,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,UAAU,EACV,gBAAgB,CACjB,CAAC;IAEF,OAAO,CAAC,GAAG,CAAC,8BAA8B,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC;IAEnE,OAAO;QACL,eAAe,EAAE,cAAc;QAC/B,iBAAiB,EAAE,gBAAgB;QACnC,eAAe,EAAE,kBAAkB;QACnC,kBAAkB,EAAE,qBAAqB;QACzC,UAAU,EAAE,aAAa;QACzB,mBAAmB,EAAE,kBAAkB;QACvC,IAAI,EAAE,cAAc;KACrB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Deterministic image-to-URL comparison workflow.
3
+ *
4
+ * The design image is trimmed and segmented first. Each detected design
5
+ * section then searches the webpage screenshot for the best matching region.
6
+ */
7
+ import type { Stagehand } from "@browserbasehq/stagehand";
8
+ import type { VisualAnalysisResult } from "../vision/types.js";
9
+ import type { SectionVisualResult } from "../reporter/types.js";
10
+ export interface ImageComparisonOptions {
11
+ stagehand: Stagehand;
12
+ baseImageUrl: string;
13
+ previewUrl: string;
14
+ page: string;
15
+ imagesDir: string;
16
+ prNumber?: string;
17
+ repository?: string;
18
+ }
19
+ export interface ImageComparisonResult {
20
+ visual_analysis: VisualAnalysisResult;
21
+ sections_analysis: string;
22
+ base_screenshot: string;
23
+ preview_screenshot: string;
24
+ diff_image: string;
25
+ section_screenshots: Record<string, {
26
+ base: string;
27
+ preview: string;
28
+ }>;
29
+ section_results: SectionVisualResult[];
30
+ mode: "image-to-url";
31
+ }
32
+ export declare function performImageComparison(options: ImageComparisonOptions): Promise<ImageComparisonResult>;
33
+ //# sourceMappingURL=image-core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-core.d.ts","sourceRoot":"","sources":["../../src/comparison/image-core.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAe1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAKhE,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,SAAS,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,eAAe,EAAE,oBAAoB,CAAC;IACtC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvE,eAAe,EAAE,mBAAmB,EAAE,CAAC;IACvC,IAAI,EAAE,cAAc,CAAC;CACtB;AAiDD,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,qBAAqB,CAAC,CAuRhC"}