@blazediff/agent 0.9.1 → 0.10.0

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/dist/cli.js CHANGED
@@ -15,7 +15,7 @@ var langgraph = require('@langchain/langgraph');
15
15
  var sharp = require('sharp');
16
16
  var pc = require('picocolors');
17
17
  var langgraphCheckpoint = require('@langchain/langgraph-checkpoint');
18
- var coreNative = require('@blazediff/core-native');
18
+ var interpretNative = require('@blazediff/interpret-native');
19
19
  var net = require('net');
20
20
  var util = require('util');
21
21
  var treeKill = require('tree-kill');
@@ -51,7 +51,7 @@ var treeKill__default = /*#__PURE__*/_interopDefault(treeKill);
51
51
 
52
52
  // package.json
53
53
  var package_default = {
54
- version: "0.9.1"};
54
+ version: "0.10.0"};
55
55
  var FROZEN_NOW = Date.UTC(2025, 0, 1, 0, 0, 0);
56
56
  var STABILITY_CSS = `
57
57
  *,*::before,*::after{
@@ -2835,37 +2835,29 @@ async function diffEntry(id, baselinePath, actualPath, opts = {}, cwd = process.
2835
2835
  }
2836
2836
  const threshold = opts.threshold ?? DEFAULT_THRESHOLD;
2837
2837
  const antialiasing = opts.antialiasing ?? true;
2838
- const result = await coreNative.compare(baselinePath, actualPath, void 0, {
2839
- threshold,
2840
- antialiasing,
2841
- interpret: true
2842
- });
2843
- if (result.match) return { id, baselinePath, actualPath, match: true };
2844
- if (result.reason === "file-not-exists") {
2845
- return {
2846
- id,
2847
- baselinePath,
2848
- actualPath,
2849
- match: false,
2850
- reason: "file-not-exists"
2851
- };
2852
- }
2853
- if (result.reason === "layout-diff") {
2854
- return {
2855
- id,
2856
- baselinePath,
2857
- actualPath,
2858
- diffPath,
2859
- match: false,
2860
- reason: "layout-diff"
2861
- };
2862
- }
2863
- if (diffPath) {
2864
- await coreNative.compare(baselinePath, actualPath, diffPath, {
2838
+ let result;
2839
+ try {
2840
+ result = await interpretNative.interpret(baselinePath, actualPath, diffPath, {
2865
2841
  threshold,
2866
2842
  antialiasing,
2867
2843
  compression: 9
2868
2844
  });
2845
+ } catch (error) {
2846
+ const message = error instanceof Error ? error.message : String(error);
2847
+ if (/Image sizes do not match/.test(message)) {
2848
+ return {
2849
+ id,
2850
+ baselinePath,
2851
+ actualPath,
2852
+ diffPath,
2853
+ match: false,
2854
+ reason: "layout-diff"
2855
+ };
2856
+ }
2857
+ throw error;
2858
+ }
2859
+ if (result.diffCount === 0) {
2860
+ return { id, baselinePath, actualPath, match: true };
2869
2861
  }
2870
2862
  return {
2871
2863
  id,
@@ -2876,7 +2868,7 @@ async function diffEntry(id, baselinePath, actualPath, opts = {}, cwd = process.
2876
2868
  reason: "pixel-diff",
2877
2869
  diffCount: result.diffCount,
2878
2870
  diffPercentage: result.diffPercentage,
2879
- interpretation: result.interpretation
2871
+ interpretation: result
2880
2872
  };
2881
2873
  }
2882
2874
 
@@ -4979,7 +4971,7 @@ async function installStack(stack, cwd, opts = {}) {
4979
4971
  if (info.kind === "local-judge") {
4980
4972
  return { stack, status: "configured" };
4981
4973
  }
4982
- const target = info.target?.(cwd);
4974
+ const target = info.target(cwd);
4983
4975
  const files = loadSkillFiles();
4984
4976
  if (info.format === "cursor-rule") {
4985
4977
  const content = renderCursorRule(files);
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { BoundingBox, InterpretResult } from '@blazediff/core-native';
1
+ import { BoundingBox, InterpretResult } from '@blazediff/interpret-native';
2
2
  import { Page, Browser, BrowserContext } from 'playwright';
3
3
 
4
4
  type VerdictLabel = "regression-likely" | "intentional-likely" | "noise-likely" | "ambiguous";
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { BoundingBox, InterpretResult } from '@blazediff/core-native';
1
+ import { BoundingBox, InterpretResult } from '@blazediff/interpret-native';
2
2
  import { Page, Browser, BrowserContext } from 'playwright';
3
3
 
4
4
  type VerdictLabel = "regression-likely" | "intentional-likely" | "noise-likely" | "ambiguous";
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ var playwright = require('playwright');
9
9
  var child_process = require('child_process');
10
10
  var module$1 = require('module');
11
11
  var crypto$1 = require('crypto');
12
- var coreNative = require('@blazediff/core-native');
12
+ var interpretNative = require('@blazediff/interpret-native');
13
13
  var util = require('util');
14
14
  var langgraph = require('@langchain/langgraph');
15
15
  var sharp = require('sharp');
@@ -857,37 +857,29 @@ async function diffEntry(id, baselinePath, actualPath, opts = {}, cwd = process.
857
857
  }
858
858
  const threshold = opts.threshold ?? DEFAULT_THRESHOLD;
859
859
  const antialiasing = opts.antialiasing ?? true;
860
- const result = await coreNative.compare(baselinePath, actualPath, void 0, {
861
- threshold,
862
- antialiasing,
863
- interpret: true
864
- });
865
- if (result.match) return { id, baselinePath, actualPath, match: true };
866
- if (result.reason === "file-not-exists") {
867
- return {
868
- id,
869
- baselinePath,
870
- actualPath,
871
- match: false,
872
- reason: "file-not-exists"
873
- };
874
- }
875
- if (result.reason === "layout-diff") {
876
- return {
877
- id,
878
- baselinePath,
879
- actualPath,
880
- diffPath,
881
- match: false,
882
- reason: "layout-diff"
883
- };
884
- }
885
- if (diffPath) {
886
- await coreNative.compare(baselinePath, actualPath, diffPath, {
860
+ let result;
861
+ try {
862
+ result = await interpretNative.interpret(baselinePath, actualPath, diffPath, {
887
863
  threshold,
888
864
  antialiasing,
889
865
  compression: 9
890
866
  });
867
+ } catch (error) {
868
+ const message = error instanceof Error ? error.message : String(error);
869
+ if (/Image sizes do not match/.test(message)) {
870
+ return {
871
+ id,
872
+ baselinePath,
873
+ actualPath,
874
+ diffPath,
875
+ match: false,
876
+ reason: "layout-diff"
877
+ };
878
+ }
879
+ throw error;
880
+ }
881
+ if (result.diffCount === 0) {
882
+ return { id, baselinePath, actualPath, match: true };
891
883
  }
892
884
  return {
893
885
  id,
@@ -898,7 +890,7 @@ async function diffEntry(id, baselinePath, actualPath, opts = {}, cwd = process.
898
890
  reason: "pixel-diff",
899
891
  diffCount: result.diffCount,
900
892
  diffPercentage: result.diffPercentage,
901
- interpretation: result.interpretation
893
+ interpretation: result
902
894
  };
903
895
  }
904
896
 
package/dist/index.mjs CHANGED
@@ -7,7 +7,7 @@ import { chromium } from 'playwright';
7
7
  import { spawn } from 'child_process';
8
8
  import { createRequire } from 'module';
9
9
  import { createHash } from 'crypto';
10
- import { compare } from '@blazediff/core-native';
10
+ import { interpret } from '@blazediff/interpret-native';
11
11
  import * as util from 'util';
12
12
  import { Annotation, Command, StateGraph, START, Send, END, interrupt } from '@langchain/langgraph';
13
13
  import sharp from 'sharp';
@@ -829,37 +829,29 @@ async function diffEntry(id, baselinePath, actualPath, opts = {}, cwd = process.
829
829
  }
830
830
  const threshold = opts.threshold ?? DEFAULT_THRESHOLD;
831
831
  const antialiasing = opts.antialiasing ?? true;
832
- const result = await compare(baselinePath, actualPath, void 0, {
833
- threshold,
834
- antialiasing,
835
- interpret: true
836
- });
837
- if (result.match) return { id, baselinePath, actualPath, match: true };
838
- if (result.reason === "file-not-exists") {
839
- return {
840
- id,
841
- baselinePath,
842
- actualPath,
843
- match: false,
844
- reason: "file-not-exists"
845
- };
846
- }
847
- if (result.reason === "layout-diff") {
848
- return {
849
- id,
850
- baselinePath,
851
- actualPath,
852
- diffPath,
853
- match: false,
854
- reason: "layout-diff"
855
- };
856
- }
857
- if (diffPath) {
858
- await compare(baselinePath, actualPath, diffPath, {
832
+ let result;
833
+ try {
834
+ result = await interpret(baselinePath, actualPath, diffPath, {
859
835
  threshold,
860
836
  antialiasing,
861
837
  compression: 9
862
838
  });
839
+ } catch (error) {
840
+ const message = error instanceof Error ? error.message : String(error);
841
+ if (/Image sizes do not match/.test(message)) {
842
+ return {
843
+ id,
844
+ baselinePath,
845
+ actualPath,
846
+ diffPath,
847
+ match: false,
848
+ reason: "layout-diff"
849
+ };
850
+ }
851
+ throw error;
852
+ }
853
+ if (result.diffCount === 0) {
854
+ return { id, baselinePath, actualPath, match: true };
863
855
  }
864
856
  return {
865
857
  id,
@@ -870,7 +862,7 @@ async function diffEntry(id, baselinePath, actualPath, opts = {}, cwd = process.
870
862
  reason: "pixel-diff",
871
863
  diffCount: result.diffCount,
872
864
  diffPercentage: result.diffPercentage,
873
- interpretation: result.interpretation
865
+ interpretation: result
874
866
  };
875
867
  }
876
868
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blazediff/agent",
3
- "version": "0.9.1",
3
+ "version": "0.10.0",
4
4
  "description": "Agentic visual regression for BlazeDiff. Auto-discovers routes, captures deterministic screenshots, runs CI checks.",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -48,7 +48,8 @@
48
48
  "sharp": "^0.34.0",
49
49
  "tree-kill": "^1.2.2",
50
50
  "zod": "^3.25.32",
51
- "@blazediff/core-native": "5.4.0"
51
+ "@blazediff/core-native": "6.0.0",
52
+ "@blazediff/interpret-native": "6.0.0"
52
53
  },
53
54
  "peerDependencies": {
54
55
  "@huggingface/transformers": "^4.2.0"