@mizchi/vlmkit-core 0.23.2 → 0.28.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.
Files changed (112) hide show
  1. package/dist/a11y-semantic.d.mts +6 -10
  2. package/dist/a11y-semantic.mjs +3 -4
  3. package/dist/animated-image.d.mts +27 -0
  4. package/dist/animated-image.mjs +112 -0
  5. package/dist/apng.d.mts +5 -9
  6. package/dist/apng.mjs +6 -7
  7. package/dist/arg-reader.d.mts +9 -12
  8. package/dist/arg-reader.mjs +1 -2
  9. package/dist/auth-state.d.mts +6 -9
  10. package/dist/auth-state.mjs +1 -2
  11. package/dist/authored-style-capture.d.mts +7 -10
  12. package/dist/authored-style-capture.mjs +1 -2
  13. package/dist/authored-style-diff.d.mts +8 -12
  14. package/dist/authored-style-diff.mjs +1 -2
  15. package/dist/bitmap-font.d.mts +7 -10
  16. package/dist/bitmap-font.mjs +1 -2
  17. package/dist/browser-launch.d.mts +7 -11
  18. package/dist/browser-launch.mjs +1 -2
  19. package/dist/cli-args.d.mts +8 -11
  20. package/dist/cli-args.mjs +1 -2
  21. package/dist/cli-error.d.mts +10 -13
  22. package/dist/cli-error.mjs +2 -3
  23. package/dist/computed-style-capture.d.mts +20 -23
  24. package/dist/computed-style-capture.mjs +4 -5
  25. package/dist/computed-style-diff.d.mts +8 -11
  26. package/dist/computed-style-diff.mjs +2 -3
  27. package/dist/diff-regions.d.mts +3 -7
  28. package/dist/diff-regions.mjs +1 -2
  29. package/dist/dom-equivalence.d.mts +5 -8
  30. package/dist/dom-equivalence.mjs +1 -2
  31. package/dist/dom-position-styles.d.mts +14 -15
  32. package/dist/dom-position-styles.mjs +4 -5
  33. package/dist/element-compare.d.mts +8 -9
  34. package/dist/element-compare.mjs +5 -5
  35. package/dist/filmstrip.d.mts +60 -9
  36. package/dist/filmstrip.mjs +83 -12
  37. package/dist/gate-config.d.mts +18 -22
  38. package/dist/gate-config.mjs +8 -4
  39. package/dist/gate-exit.d.mts +5 -8
  40. package/dist/gate-exit.mjs +1 -2
  41. package/dist/gif.d.mts +41 -0
  42. package/dist/gif.mjs +73 -0
  43. package/dist/heatmap-regions.d.mts +4 -7
  44. package/dist/heatmap-regions.mjs +1 -2
  45. package/dist/heatmap.d.mts +21 -17
  46. package/dist/heatmap.mjs +23 -11
  47. package/dist/image-resize.d.mts +9 -12
  48. package/dist/image-resize.mjs +1 -2
  49. package/dist/image-timing.d.mts +57 -0
  50. package/dist/image-timing.mjs +166 -0
  51. package/dist/index.d.mts +14 -14
  52. package/dist/index.mjs +11 -11
  53. package/dist/mask.d.mts +5 -9
  54. package/dist/mask.mjs +1 -2
  55. package/dist/motion-spec.d.mts +97 -0
  56. package/dist/motion-spec.mjs +145 -0
  57. package/dist/navigation-redirect.d.mts +1 -4
  58. package/dist/navigation-redirect.mjs +1 -2
  59. package/dist/page-load.d.mts +40 -16
  60. package/dist/page-load.mjs +34 -5
  61. package/dist/page-open.d.mts +15 -15
  62. package/dist/page-open.mjs +4 -3
  63. package/dist/plugin/args.d.mts +16 -12
  64. package/dist/plugin/args.mjs +15 -4
  65. package/dist/plugin/browser.d.mts +3 -3
  66. package/dist/plugin/browser.mjs +2 -2
  67. package/dist/plugin/cli-entry.d.mts +1 -4
  68. package/dist/plugin/cli-entry.mjs +1 -2
  69. package/dist/plugin/contract.d.mts +17 -21
  70. package/dist/plugin/contract.mjs +1 -2
  71. package/dist/plugin/index.d.mts +6 -9
  72. package/dist/plugin/index.mjs +7 -8
  73. package/dist/plugin/load.d.mts +7 -11
  74. package/dist/plugin/load.mjs +1 -2
  75. package/dist/plugin/registry.d.mts +8 -12
  76. package/dist/plugin/registry.mjs +1 -2
  77. package/dist/plugin/rule-prose.d.mts +4 -8
  78. package/dist/plugin/rule-prose.mjs +1 -2
  79. package/dist/plugin/rule-tier.d.mts +7 -11
  80. package/dist/plugin/rule-tier.mjs +1 -2
  81. package/dist/plugin/rules.d.mts +18 -22
  82. package/dist/plugin/rules.mjs +1 -2
  83. package/dist/plugin/runner.d.mts +18 -21
  84. package/dist/plugin/runner.mjs +55 -6
  85. package/dist/png-decode.d.mts +17 -0
  86. package/dist/png-decode.mjs +160 -0
  87. package/dist/png-utils.d.mts +7 -10
  88. package/dist/png-utils.mjs +3 -3
  89. package/dist/project-config.d.mts +7 -10
  90. package/dist/project-config.mjs +1 -2
  91. package/dist/rect-overlap.d.mts +3 -6
  92. package/dist/rect-overlap.mjs +1 -2
  93. package/dist/region-shift.d.mts +3 -6
  94. package/dist/region-shift.mjs +1 -2
  95. package/dist/run-ledger.d.mts +10 -13
  96. package/dist/run-ledger.mjs +4 -4
  97. package/dist/stable-selector.d.mts +1 -4
  98. package/dist/stable-selector.mjs +1 -2
  99. package/dist/terminal-colors.d.mts +8 -11
  100. package/dist/terminal-colors.mjs +1 -2
  101. package/dist/text-rows.d.mts +10 -13
  102. package/dist/text-rows.mjs +1 -2
  103. package/dist/types.d.mts +87 -64
  104. package/dist/version.d.mts +1 -4
  105. package/dist/version.mjs +2 -3
  106. package/dist/video-decode.d.mts +144 -0
  107. package/dist/video-decode.mjs +939 -0
  108. package/dist/video-frames.d.mts +310 -0
  109. package/dist/video-frames.mjs +576 -0
  110. package/dist/webp.d.mts +7 -11
  111. package/dist/webp.mjs +3 -3
  112. package/package.json +7 -7
@@ -1,6 +1,6 @@
1
1
  import { appendFileSync, existsSync, mkdirSync, readFileSync } from "node:fs";
2
2
  import { dirname, join, relative, resolve } from "node:path";
3
- //#region src/run-ledger.ts
3
+ // src/run-ledger.ts
4
4
  /**
5
5
  * Append-only run ledger for agent-loop tools.
6
6
  *
@@ -75,10 +75,11 @@ function appendRunLedger(entry, options = {}) {
75
75
  try {
76
76
  const created = !existsSync(target);
77
77
  mkdirSync(dirname(target), { recursive: true });
78
- appendFileSync(target, JSON.stringify({
78
+ const line = JSON.stringify({
79
79
  ts: (/* @__PURE__ */ new Date()).toISOString(),
80
80
  ...entry
81
- }) + "\n");
81
+ });
82
+ appendFileSync(target, line + "\n");
82
83
  const write = {
83
84
  path: target,
84
85
  created
@@ -118,5 +119,4 @@ function isGitIgnored(cwd, target) {
118
119
  function isGitRepo(cwd) {
119
120
  return existsSync(join(cwd, ".git"));
120
121
  }
121
- //#endregion
122
122
  export { LEDGER_RELATIVE_PATH, VLMKIT_IGNORE_ENTRIES, appendRunLedger, configureRunLedger, firstLedgerWrite, isGitIgnored, isGitRepo };
@@ -1,4 +1,3 @@
1
- //#region src/stable-selector.d.ts
2
1
  /**
3
2
  * The one in-page selector generator, as a script fragment.
4
3
  *
@@ -45,6 +44,4 @@
45
44
  * `page.evaluate`, so it carries its own copy on purpose and the uniqueness test is
46
45
  * what holds the two in agreement.
47
46
  */
48
- declare const STABLE_SELECTOR_JS = "\n function stableSelector(el) {\n if (!el || !el.tagName) return \"(no target)\";\n const id = el.getAttribute && el.getAttribute(\"id\");\n if (id) return \"#\" + CSS.escape(id);\n const classes = el.classList ? Array.from(el.classList).slice(0, 3) : [];\n if (classes.length > 0) {\n const selector = el.tagName.toLowerCase() + classes.map((c) => \".\" + CSS.escape(c)).join(\"\");\n if (document.querySelectorAll(selector).length === 1) return selector;\n }\n const parent = el.parentElement;\n if (!parent) return el.tagName.toLowerCase();\n const siblings = Array.from(parent.children).filter((item) => item.tagName === el.tagName);\n return stableSelector(parent) + \" > \" + el.tagName.toLowerCase() + \":nth-of-type(\" + (siblings.indexOf(el) + 1) + \")\";\n }\n";
49
- //#endregion
50
- export { STABLE_SELECTOR_JS };
47
+ export declare const STABLE_SELECTOR_JS = "\n function stableSelector(el) {\n if (!el || !el.tagName) return \"(no target)\";\n const id = el.getAttribute && el.getAttribute(\"id\");\n if (id) return \"#\" + CSS.escape(id);\n const classes = el.classList ? Array.from(el.classList).slice(0, 3) : [];\n if (classes.length > 0) {\n const selector = el.tagName.toLowerCase() + classes.map((c) => \".\" + CSS.escape(c)).join(\"\");\n if (document.querySelectorAll(selector).length === 1) return selector;\n }\n const parent = el.parentElement;\n if (!parent) return el.tagName.toLowerCase();\n const siblings = Array.from(parent.children).filter((item) => item.tagName === el.tagName);\n return stableSelector(parent) + \" > \" + el.tagName.toLowerCase() + \":nth-of-type(\" + (siblings.indexOf(el) + 1) + \")\";\n }\n";
@@ -1,4 +1,4 @@
1
- //#region src/stable-selector.ts
1
+ // src/stable-selector.ts
2
2
  /**
3
3
  * The one in-page selector generator, as a script fragment.
4
4
  *
@@ -61,5 +61,4 @@ const STABLE_SELECTOR_JS = `
61
61
  return stableSelector(parent) + " > " + el.tagName.toLowerCase() + ":nth-of-type(" + (siblings.indexOf(el) + 1) + ")";
62
62
  }
63
63
  `;
64
- //#endregion
65
64
  export { STABLE_SELECTOR_JS };
@@ -1,12 +1,9 @@
1
- //#region src/terminal-colors.d.ts
2
1
  /** Shared ANSI terminal color codes and helpers */
3
- declare const DIM = "\u001B[2m";
4
- declare const RESET = "\u001B[0m";
5
- declare const GREEN = "\u001B[32m";
6
- declare const RED = "\u001B[31m";
7
- declare const YELLOW = "\u001B[33m";
8
- declare const CYAN = "\u001B[36m";
9
- declare const BOLD = "\u001B[1m";
10
- declare function hr(width?: number): void;
11
- //#endregion
12
- export { BOLD, CYAN, DIM, GREEN, RED, RESET, YELLOW, hr };
2
+ export declare const DIM = "";
3
+ export declare const RESET = "";
4
+ export declare const GREEN = "";
5
+ export declare const RED = "";
6
+ export declare const YELLOW = "";
7
+ export declare const CYAN = "";
8
+ export declare const BOLD = "";
9
+ export declare function hr(width?: number): void;
@@ -1,4 +1,4 @@
1
- //#region src/terminal-colors.ts
1
+ // src/terminal-colors.ts
2
2
  /** Shared ANSI terminal color codes and helpers */
3
3
  const DIM = "\x1B[2m";
4
4
  const RESET = "\x1B[0m";
@@ -10,5 +10,4 @@ const BOLD = "\x1B[1m";
10
10
  function hr(width = 72) {
11
11
  console.log(`${DIM}${"─".repeat(width)}${RESET}`);
12
12
  }
13
- //#endregion
14
13
  export { BOLD, CYAN, DIM, GREEN, RED, RESET, YELLOW, hr };
@@ -1,5 +1,4 @@
1
- //#region src/text-rows.d.ts
2
- interface TextRow {
1
+ export interface TextRow {
3
2
  /** Optional OCR/debug text when a caller can supply it. Pixel extraction does not infer this. */
4
3
  text?: string;
5
4
  /** Y-coordinate of the row's vertical center. */
@@ -36,7 +35,7 @@ interface TextRow {
36
35
  inkLeft?: number;
37
36
  inkRight?: number;
38
37
  }
39
- interface MatchedTextRow {
38
+ export interface MatchedTextRow {
40
39
  /** Position in the ordered list of detected rows (0 = topmost). */
41
40
  rank: number;
42
41
  baseline: TextRow;
@@ -44,7 +43,7 @@ interface MatchedTextRow {
44
43
  /** variant.yCenter − baseline.yCenter (px). */
45
44
  deltaY: number;
46
45
  }
47
- interface RowGapDelta {
46
+ export interface RowGapDelta {
48
47
  /** Rank of the row above the gap. */
49
48
  aboveRank: number;
50
49
  /** Rank of the row below the gap. */
@@ -56,7 +55,7 @@ interface RowGapDelta {
56
55
  /** variantGap − baselineGap; positive means the gap grew. */
57
56
  delta: number;
58
57
  }
59
- interface ExtractTextRowsOptions {
58
+ export interface ExtractTextRowsOptions {
60
59
  /**
61
60
  * Minimum dip in mean luminance (vs. the median row luminance) for a
62
61
  * row to be considered "text". Default 12 — picks up body text but
@@ -68,8 +67,8 @@ interface ExtractTextRowsOptions {
68
67
  /** Maximum bands to return (top-N by yCenter, i.e. all of them). */
69
68
  maxBands?: number;
70
69
  }
71
- declare function extractTextRowsFromRgba(data: Uint8Array, width: number, height: number, options?: ExtractTextRowsOptions): TextRow[];
72
- declare function extractTextRowsFromFile(path: string, options?: ExtractTextRowsOptions): Promise<TextRow[]>;
70
+ export declare function extractTextRowsFromRgba(data: Uint8Array, width: number, height: number, options?: ExtractTextRowsOptions): TextRow[];
71
+ export declare function extractTextRowsFromFile(path: string, options?: ExtractTextRowsOptions): Promise<TextRow[]>;
73
72
  /**
74
73
  * Pair text rows by ordered index. When baseline has 6 rows and variant
75
74
  * has 6 rows, this maps row #0 → row #0, #1 → #1, etc. When the counts
@@ -78,7 +77,7 @@ declare function extractTextRowsFromFile(path: string, options?: ExtractTextRows
78
77
  * Reports rows with |Δy| above `minDeltaY` to keep the table focused on
79
78
  * actionable shifts (small subpixel deltas are excluded by default).
80
79
  */
81
- declare function matchTextRows(baseline: TextRow[], variant: TextRow[], minDeltaY?: number): MatchedTextRow[];
80
+ export declare function matchTextRows(baseline: TextRow[], variant: TextRow[], minDeltaY?: number): MatchedTextRow[];
82
81
  /**
83
82
  * Compute per-pair gap deltas from baseline ↔ variant row matches.
84
83
  * The gap above row N+1 = `row[N+1].yCenter − row[N].yCenter` — the
@@ -92,7 +91,7 @@ declare function matchTextRows(baseline: TextRow[], variant: TextRow[], minDelta
92
91
  * doesn't yet suggest which CSS knob to turn." Gap deltas tell
93
92
  * the agent exactly which margin to adjust.
94
93
  */
95
- interface TypographyMismatch {
94
+ export interface TypographyMismatch {
96
95
  rank: number;
97
96
  baselineFontSize?: number;
98
97
  variantFontSize?: number;
@@ -115,7 +114,5 @@ interface TypographyMismatch {
115
114
  * and the comparison is noisier — only large bucket jumps are
116
115
  * surfaced.
117
116
  */
118
- declare function compareRowTypography(baseline: TextRow[], variant: TextRow[], minDensityDelta?: number): TypographyMismatch[];
119
- declare function computeRowGapDeltas(baseline: TextRow[], variant: TextRow[], minAbsoluteDelta?: number): RowGapDelta[];
120
- //#endregion
121
- export { ExtractTextRowsOptions, MatchedTextRow, RowGapDelta, TextRow, TypographyMismatch, compareRowTypography, computeRowGapDeltas, extractTextRowsFromFile, extractTextRowsFromRgba, matchTextRows };
117
+ export declare function compareRowTypography(baseline: TextRow[], variant: TextRow[], minDensityDelta?: number): TypographyMismatch[];
118
+ export declare function computeRowGapDeltas(baseline: TextRow[], variant: TextRow[], minAbsoluteDelta?: number): RowGapDelta[];
@@ -1,6 +1,6 @@
1
1
  import { readFile } from "node:fs/promises";
2
2
  import { PNG } from "pngjs";
3
- //#region src/text-rows.ts
3
+ // src/text-rows.ts
4
4
  /**
5
5
  * Text-row y-position extraction.
6
6
  *
@@ -242,5 +242,4 @@ function computeRowGapDeltas(baseline, variant, minAbsoluteDelta = 2) {
242
242
  }
243
243
  return out;
244
244
  }
245
- //#endregion
246
245
  export { compareRowTypography, computeRowGapDeltas, extractTextRowsFromFile, extractTextRowsFromRgba, matchTextRows };
package/dist/types.d.mts CHANGED
@@ -1,49 +1,48 @@
1
- //#region src/types.d.ts
2
- interface PlaywrightReport {
1
+ export interface PlaywrightReport {
3
2
  config: {
4
3
  rootDir: string;
5
4
  projects: ProjectConfig[];
6
5
  };
7
6
  suites: TestSuite[];
8
7
  }
9
- interface ProjectConfig {
8
+ export interface ProjectConfig {
10
9
  name: string;
11
10
  use: Record<string, unknown>;
12
11
  }
13
- interface TestSuite {
12
+ export interface TestSuite {
14
13
  title: string;
15
14
  file: string;
16
15
  suites?: TestSuite[];
17
16
  specs: TestSpec[];
18
17
  }
19
- interface TestSpec {
18
+ export interface TestSpec {
20
19
  title: string;
21
20
  ok: boolean;
22
21
  tests: TestResult[];
23
22
  }
24
- interface TestResult {
23
+ export interface TestResult {
25
24
  projectName: string;
26
25
  status: "expected" | "unexpected" | "flaky" | "skipped";
27
26
  duration: number;
28
27
  results: TestAttempt[];
29
28
  }
30
- interface TestAttempt {
29
+ export interface TestAttempt {
31
30
  status: "passed" | "failed" | "timedOut" | "skipped";
32
31
  duration: number;
33
32
  attachments: Attachment[];
34
33
  errors: TestError[];
35
34
  }
36
- interface Attachment {
35
+ export interface Attachment {
37
36
  name: string;
38
37
  contentType: string;
39
38
  path?: string;
40
39
  body?: string;
41
40
  }
42
- interface TestError {
41
+ export interface TestError {
43
42
  message: string;
44
43
  stack?: string;
45
44
  }
46
- interface VrtSnapshot {
45
+ export interface VrtSnapshot {
47
46
  testId: string;
48
47
  testTitle: string;
49
48
  projectName: string;
@@ -51,7 +50,7 @@ interface VrtSnapshot {
51
50
  baselinePath?: string;
52
51
  status: "new" | "unchanged" | "changed" | "missing";
53
52
  }
54
- interface VrtDiff {
53
+ export interface VrtDiff {
55
54
  snapshot: VrtSnapshot;
56
55
  diffPixels: number;
57
56
  /**
@@ -67,13 +66,13 @@ interface VrtDiff {
67
66
  mask?: DiffMaskSummary;
68
67
  }
69
68
  /** A rectangle the caller declared permanently non-deterministic. */
70
- interface DiffIgnoreRegion {
69
+ export interface DiffIgnoreRegion {
71
70
  x: number;
72
71
  y: number;
73
72
  width: number;
74
73
  height: number;
75
74
  }
76
- interface DiffIgnoredRegionReport extends DiffIgnoreRegion {
75
+ export interface DiffIgnoredRegionReport extends DiffIgnoreRegion {
77
76
  /**
78
77
  * Pixels this rect actually covered inside the compared area — less than
79
78
  * `width * height` when the rect hangs off the edge, and 0 when it misses the
@@ -97,7 +96,7 @@ interface DiffIgnoredRegionReport extends DiffIgnoreRegion {
97
96
  * 0.1%. `imagePixels - ignoredPixels === totalPixels` is the arithmetic a
98
97
  * reader can check.
99
98
  */
100
- interface DiffMaskSummary {
99
+ export interface DiffMaskSummary {
101
100
  regions: DiffIgnoredRegionReport[];
102
101
  /** De-duplicated count of pixels inside at least one ignore region. */
103
102
  ignoredPixels: number;
@@ -106,8 +105,8 @@ interface DiffMaskSummary {
106
105
  /** The compared area before masking (excludes size-mismatch overflow). */
107
106
  imagePixels: number;
108
107
  }
109
- type DiffRegionType = "shift" | "content" | "edge";
110
- interface DiffRegion {
108
+ export type DiffRegionType = "shift" | "content" | "edge";
109
+ export interface DiffRegion {
111
110
  x: number;
112
111
  y: number;
113
112
  width: number;
@@ -119,15 +118,41 @@ interface DiffRegion {
119
118
  shift?: DiffRegionShift;
120
119
  /** Deterministic DOM hit-test result for this region's bbox (diff png --elements-*). */
121
120
  selectorCandidate?: DiffRegionSelectorCandidate;
121
+ /**
122
+ * What changed, named by a model on this region's magnified crop (diff png --kind). The
123
+ * region, shift and colours stay the pixels'; this is the one field that is not measured.
124
+ */
125
+ kind?: DiffRegionKind;
126
+ /** Why --kind left this region unlabelled (over --kind-limit, a size Jev rejects, an API error). */
127
+ kindSkipped?: string;
128
+ /**
129
+ * The largest per-channel difference of any pixel in the region (0-255). A few levels is
130
+ * antialiasing or compositing, not a change of content.
131
+ */
132
+ maxChannelDelta?: number;
133
+ /**
134
+ * Only glyph and edge rendering differs: a 5x5 average removes most of the difference and it
135
+ * lightens as much as it darkens (antialiasing, a layer composited differently), with no
136
+ * measured shift. Not a change of content.
137
+ */
138
+ edgeOnly?: boolean;
139
+ }
140
+ export interface DiffRegionKind {
141
+ label: "text" | "color" | "position" | "presence";
142
+ confidence: number;
143
+ /** Below the measured threshold (0.6): every wrong label in the 2026-10-16 round was below it. */
144
+ uncertain: boolean;
145
+ /** The model that answered, as served (e.g. `jev-1.14.0`). */
146
+ model: string;
122
147
  }
123
- interface DiffRegionShift {
148
+ export interface DiffRegionShift {
124
149
  /** Content moved by +dx px horizontally in current (vs baseline). */
125
150
  dx: number;
126
151
  /** Content moved by +dy px vertically in current (vs baseline). */
127
152
  dy: number;
128
153
  confidence: number;
129
154
  }
130
- interface DiffRegionSelectorCandidate {
155
+ export interface DiffRegionSelectorCandidate {
131
156
  selector: string;
132
157
  confidence: "high" | "medium" | "low";
133
158
  path: string;
@@ -144,19 +169,19 @@ interface DiffRegionSelectorCandidate {
144
169
  */
145
170
  alternates?: Omit<DiffRegionSelectorCandidate, "alternates">[];
146
171
  }
147
- interface DiffRegionColor {
172
+ export interface DiffRegionColor {
148
173
  r: number;
149
174
  g: number;
150
175
  b: number;
151
176
  hex: string;
152
177
  }
153
- interface DiffRegionColorPair {
178
+ export interface DiffRegionColorPair {
154
179
  baseline: DiffRegionColor;
155
180
  current: DiffRegionColor;
156
181
  /** Euclidean RGB distance between baseline and current. */
157
182
  distance: number;
158
183
  }
159
- interface DiffRegionColorSample extends DiffRegionColorPair {
184
+ export interface DiffRegionColorSample extends DiffRegionColorPair {
160
185
  /**
161
186
  * The single differing pixel with the largest baseline↔current channel
162
187
  * delta, attached when the differing pixels are sparse (thin glyphs, a
@@ -166,14 +191,14 @@ interface DiffRegionColorSample extends DiffRegionColorPair {
166
191
  */
167
192
  peak?: DiffRegionColorPair;
168
193
  }
169
- interface ShiftRegion {
194
+ export interface ShiftRegion {
170
195
  yStart: number;
171
196
  yEnd: number;
172
197
  shift: number;
173
198
  /** Correlation strength of the chosen offset (0..1). Higher = more confident. */
174
199
  confidence?: number;
175
200
  }
176
- interface DiffReport {
201
+ export interface DiffReport {
177
202
  diffPixels: number;
178
203
  /** Measured pixels — see `VrtDiff.totalPixels`. */
179
204
  totalPixels: number;
@@ -188,45 +213,45 @@ interface DiffReport {
188
213
  compensatedDiffCount: number;
189
214
  compact: string;
190
215
  }
191
- type Language = "typescript" | "moonbit" | "rust";
192
- interface DepNode {
216
+ export type Language = "typescript" | "moonbit" | "rust";
217
+ export interface DepNode {
193
218
  id: string;
194
219
  filePath: string;
195
220
  language: Language;
196
221
  exports: string[];
197
222
  isComponent: boolean;
198
223
  }
199
- interface DepEdge {
224
+ export interface DepEdge {
200
225
  from: string;
201
226
  to: string;
202
227
  specifiers: string[];
203
228
  }
204
- interface DepGraph {
229
+ export interface DepGraph {
205
230
  nodes: Map<string, DepNode>;
206
231
  edges: DepEdge[];
207
232
  }
208
- interface AffectedComponent {
233
+ export interface AffectedComponent {
209
234
  node: DepNode;
210
235
  depth: number;
211
236
  changedDependencies: string[];
212
237
  }
213
- interface ChangeIntent {
238
+ export interface ChangeIntent {
214
239
  summary: string;
215
240
  expectedVisualChanges: VisualExpectation[];
216
241
  expectedA11yChanges: A11yExpectation[];
217
242
  affectedComponents: string[];
218
243
  changeType: "feature" | "bugfix" | "refactor" | "style" | "deps" | "a11y" | "unknown";
219
244
  }
220
- interface VisualExpectation {
245
+ export interface VisualExpectation {
221
246
  component: string;
222
247
  description: string;
223
248
  confidence: number;
224
249
  }
225
- interface A11yExpectation {
250
+ export interface A11yExpectation {
226
251
  testId: string;
227
252
  expectedChanges: ExpectedA11yChange[];
228
253
  }
229
- interface ExpectedA11yChange {
254
+ export interface ExpectedA11yChange {
230
255
  /** NL description (primary). Works standalone */
231
256
  description: string;
232
257
  /** Structured hint (optional). Used for heuristic matching */
@@ -235,14 +260,14 @@ interface ExpectedA11yChange {
235
260
  role?: string;
236
261
  name?: string;
237
262
  }
238
- interface VrtExpectation {
263
+ export interface VrtExpectation {
239
264
  /** NL description of the change intent (primary) */
240
265
  description: string;
241
266
  /** Structured intent (optional). Inferred from description if omitted */
242
267
  intent?: Partial<ChangeIntent>;
243
268
  pages: PageExpectation[];
244
269
  }
245
- interface PageExpectation {
270
+ export interface PageExpectation {
246
271
  testId: string;
247
272
  /** Expected state in NL (alternative to structured fields) */
248
273
  expect?: string;
@@ -252,7 +277,7 @@ interface PageExpectation {
252
277
  expectedA11yChanges?: ExpectedA11yChange[];
253
278
  expectedVisualChanges?: VisualExpectation[];
254
279
  }
255
- interface UiSpec {
280
+ export interface UiSpec {
256
281
  /** Description of this spec */
257
282
  description: string;
258
283
  /** Per-page invariants */
@@ -260,14 +285,14 @@ interface UiSpec {
260
285
  /** Global invariants (applied to all pages) */
261
286
  global?: SpecInvariant[];
262
287
  }
263
- interface PageSpec {
288
+ export interface PageSpec {
264
289
  testId: string;
265
290
  /** Purpose of this page */
266
291
  purpose?: string;
267
292
  /** Invariant list */
268
293
  invariants: SpecInvariant[];
269
294
  }
270
- interface SpecInvariant {
295
+ export interface SpecInvariant {
271
296
  /** NL description of the invariant (primary) */
272
297
  description: string;
273
298
  /** Structured hint (optional) */
@@ -279,12 +304,12 @@ interface SpecInvariant {
279
304
  /** Verification cost. "low" = heuristics, "high" = LLM/Vision */
280
305
  cost?: "low" | "high";
281
306
  }
282
- type SpecCheckType = "landmark-exists" | "label-present" | "no-whiteout" | "no-error-state" | "text-visible" | "element-count" | "heading-hierarchy" | "aria-relationships" | "color-contrast" | "responsive-layout" | "nl-assertion";
283
- interface IntrospectResult {
307
+ export type SpecCheckType = "landmark-exists" | "label-present" | "no-whiteout" | "no-error-state" | "text-visible" | "element-count" | "heading-hierarchy" | "aria-relationships" | "color-contrast" | "responsive-layout" | "nl-assertion";
308
+ export interface IntrospectResult {
284
309
  generatedAt: string;
285
310
  pages: PageIntrospection[];
286
311
  }
287
- interface PageIntrospection {
312
+ export interface PageIntrospection {
288
313
  testId: string;
289
314
  /** Auto-generated page description */
290
315
  description: string;
@@ -314,7 +339,7 @@ interface PageIntrospection {
314
339
  /** Auto-inferred invariants */
315
340
  suggestedInvariants: SpecInvariant[];
316
341
  }
317
- interface NlAssertion {
342
+ export interface NlAssertion {
318
343
  /** Assertion text */
319
344
  assert: string;
320
345
  /** Target page */
@@ -328,7 +353,7 @@ interface NlAssertion {
328
353
  checkedAt: string;
329
354
  };
330
355
  }
331
- interface LoopScore {
356
+ export interface LoopScore {
332
357
  usability: number;
333
358
  practicality: number;
334
359
  fixSteps: number;
@@ -337,43 +362,43 @@ interface LoopScore {
337
362
  summary: string;
338
363
  details: ScoreDetail[];
339
364
  }
340
- interface ScoreDetail {
365
+ export interface ScoreDetail {
341
366
  category: string;
342
367
  score: number;
343
368
  maxScore: number;
344
369
  reasoning: string;
345
370
  }
346
- interface DiffSemantics {
371
+ export interface DiffSemantics {
347
372
  filesChanged: FileChange[];
348
373
  commitMessage: string;
349
374
  intent: ChangeIntent;
350
375
  }
351
- interface FileChange {
376
+ export interface FileChange {
352
377
  path: string;
353
378
  additions: number;
354
379
  deletions: number;
355
380
  hunks: DiffHunk[];
356
381
  }
357
- interface DiffHunk {
382
+ export interface DiffHunk {
358
383
  header: string;
359
384
  content: string;
360
385
  startLine: number;
361
386
  endLine: number;
362
387
  }
363
- interface VrtVerdict {
388
+ export interface VrtVerdict {
364
389
  snapshotId: string;
365
390
  decision: "approve" | "reject" | "escalate";
366
391
  reasoning: string;
367
392
  matchedIntent?: VisualExpectation;
368
393
  confidence: number;
369
394
  }
370
- interface AgentContext {
395
+ export interface AgentContext {
371
396
  intent: ChangeIntent;
372
397
  diffs: VrtDiff[];
373
398
  verdicts: VrtVerdict[];
374
399
  qualityChecks: QualityCheckResult[];
375
400
  }
376
- interface A11yNode {
401
+ export interface A11yNode {
377
402
  role: string;
378
403
  name: string;
379
404
  id?: string;
@@ -395,13 +420,13 @@ interface A11yNode {
395
420
  ariaActiveDescendant?: string | string[];
396
421
  children?: A11yNode[];
397
422
  }
398
- interface A11ySnapshot {
423
+ export interface A11ySnapshot {
399
424
  testId: string;
400
425
  testTitle: string;
401
426
  tree: A11yNode;
402
427
  }
403
- type A11yChangeType = "node-added" | "node-removed" | "role-changed" | "name-changed" | "state-changed" | "structure-changed" | "landmark-changed";
404
- interface A11yChange {
428
+ export type A11yChangeType = "node-added" | "node-removed" | "role-changed" | "name-changed" | "state-changed" | "structure-changed" | "landmark-changed";
429
+ export interface A11yChange {
405
430
  type: A11yChangeType;
406
431
  path: string;
407
432
  before?: Partial<A11yNode>;
@@ -409,7 +434,7 @@ interface A11yChange {
409
434
  severity: "error" | "warning" | "info";
410
435
  description: string;
411
436
  }
412
- interface A11yDiff {
437
+ export interface A11yDiff {
413
438
  testId: string;
414
439
  changes: A11yChange[];
415
440
  hasRegression: boolean;
@@ -420,19 +445,19 @@ interface A11yDiff {
420
445
  modified: number;
421
446
  };
422
447
  }
423
- type VisualChangeType = "text-change" | "color-change" | "layout-shift" | "reflow" | "element-added" | "element-removed" | "icon-change";
424
- interface VisualSemanticChange {
448
+ export type VisualChangeType = "text-change" | "color-change" | "layout-shift" | "reflow" | "element-added" | "element-removed" | "icon-change" | "render-noise";
449
+ export interface VisualSemanticChange {
425
450
  type: VisualChangeType;
426
451
  region: DiffRegion;
427
452
  confidence: number;
428
453
  description: string;
429
454
  }
430
- interface VisualSemanticDiff {
455
+ export interface VisualSemanticDiff {
431
456
  testId: string;
432
457
  changes: VisualSemanticChange[];
433
458
  summary: string;
434
459
  }
435
- interface CrossValidationResult {
460
+ export interface CrossValidationResult {
436
461
  testId: string;
437
462
  visualDiff?: VisualSemanticDiff;
438
463
  a11yDiff?: A11yDiff;
@@ -441,7 +466,7 @@ interface CrossValidationResult {
441
466
  recommendation: "approve" | "reject" | "escalate";
442
467
  reasoning: string;
443
468
  }
444
- interface UnifiedAgentContext {
469
+ export interface UnifiedAgentContext {
445
470
  intent: ChangeIntent;
446
471
  vrtDiffs: VrtDiff[];
447
472
  a11yDiffs: A11yDiff[];
@@ -450,25 +475,23 @@ interface UnifiedAgentContext {
450
475
  verdicts: VrtVerdict[];
451
476
  qualityChecks: QualityCheckResult[];
452
477
  }
453
- interface QualityCheckResult {
478
+ export interface QualityCheckResult {
454
479
  check: QualityCheckType;
455
480
  passed: boolean;
456
481
  details: string;
457
482
  severity: "error" | "warning" | "info";
458
483
  }
459
- type QualityCheckType = "whiteout" | "error-state" | "coverage" | "layout-shift" | "empty-content" | "a11y-regression" | "a11y-coverage" | "landmark-missing" | "label-missing";
484
+ export type QualityCheckType = "whiteout" | "error-state" | "coverage" | "layout-shift" | "empty-content" | "a11y-regression" | "a11y-coverage" | "landmark-missing" | "label-missing";
460
485
  /**
461
486
  * A targetable HTML source: either an inline HTML string or a URL the
462
487
  * server fetches on the client's behalf. Shared by both the HTTP API
463
488
  * (`api-types`) and the smoke runner (`vrt-markup/inspect`).
464
489
  */
465
- interface HtmlSource {
490
+ export interface HtmlSource {
466
491
  /** Inline HTML */
467
492
  html?: string;
468
493
  /** URL (fetched server-side) */
469
494
  url?: string;
470
495
  /** Label (for reports) */
471
496
  label?: string;
472
- }
473
- //#endregion
474
- export { A11yChange, A11yChangeType, A11yDiff, A11yExpectation, A11yNode, A11ySnapshot, AffectedComponent, AgentContext, Attachment, ChangeIntent, CrossValidationResult, DepEdge, DepGraph, DepNode, DiffHunk, DiffIgnoreRegion, DiffIgnoredRegionReport, DiffMaskSummary, DiffRegion, DiffRegionColor, DiffRegionColorPair, DiffRegionColorSample, DiffRegionSelectorCandidate, DiffRegionShift, DiffRegionType, DiffReport, DiffSemantics, ExpectedA11yChange, FileChange, HtmlSource, IntrospectResult, Language, LoopScore, NlAssertion, PageExpectation, PageIntrospection, PageSpec, PlaywrightReport, ProjectConfig, QualityCheckResult, QualityCheckType, ScoreDetail, ShiftRegion, SpecCheckType, SpecInvariant, TestAttempt, TestError, TestResult, TestSpec, TestSuite, UiSpec, UnifiedAgentContext, VisualChangeType, VisualExpectation, VisualSemanticChange, VisualSemanticDiff, VrtDiff, VrtExpectation, VrtSnapshot, VrtVerdict };
497
+ }
@@ -1,4 +1,3 @@
1
- //#region src/version.d.ts
2
1
  /**
3
2
  * The one place the shipped version number is written.
4
3
  *
@@ -15,6 +14,4 @@
15
14
  * every `package.json` and that the CHANGELOG has a section for it, so the literal cannot drift
16
15
  * from the release either.
17
16
  */
18
- declare const VLMKIT_VERSION = "0.23.2";
19
- //#endregion
20
- export { VLMKIT_VERSION };
17
+ export declare const VLMKIT_VERSION = "0.28.0";
package/dist/version.mjs CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/version.ts
1
+ // src/version.ts
2
2
  /**
3
3
  * The one place the shipped version number is written.
4
4
  *
@@ -15,6 +15,5 @@
15
15
  * every `package.json` and that the CHANGELOG has a section for it, so the literal cannot drift
16
16
  * from the release either.
17
17
  */
18
- const VLMKIT_VERSION = "0.23.2";
19
- //#endregion
18
+ const VLMKIT_VERSION = "0.28.0";
20
19
  export { VLMKIT_VERSION };