@riddledc/riddle-proof 0.7.23 → 0.7.24

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.
@@ -1121,6 +1121,20 @@ async function captureViewport(viewport) {
1121
1121
  const scrollWidth = documentElement ? documentElement.scrollWidth : 0;
1122
1122
  const viewportWidth = clientWidth || window.innerWidth;
1123
1123
  const overflowOffenders = [];
1124
+ function isContainedByHorizontalScroller(element) {
1125
+ let current = element.parentElement;
1126
+ while (current && current !== body && current !== documentElement) {
1127
+ const style = window.getComputedStyle(current);
1128
+ const overflowX = style.overflowX || style.overflow || "";
1129
+ if ((overflowX === "auto" || overflowX === "scroll") && current.scrollWidth > current.clientWidth + 1) {
1130
+ const currentRect = current.getBoundingClientRect();
1131
+ const contained = currentRect.left >= -0.5 && currentRect.right <= viewportWidth + 0.5;
1132
+ if (contained) return true;
1133
+ }
1134
+ current = current.parentElement;
1135
+ }
1136
+ return false;
1137
+ }
1124
1138
  for (const element of Array.from(body ? body.querySelectorAll("*") : [])) {
1125
1139
  const rect = element.getBoundingClientRect();
1126
1140
  if (!rect || rect.width < 1 || rect.height < 1) continue;
@@ -1130,6 +1144,7 @@ async function captureViewport(viewport) {
1130
1144
  const rightOverflow = Math.max(0, rect.right - viewportWidth);
1131
1145
  const overflow = Math.max(leftOverflow, rightOverflow);
1132
1146
  if (overflow <= 0.5) continue;
1147
+ if (isContainedByHorizontalScroller(element)) continue;
1133
1148
  const tag = element.tagName ? element.tagName.toLowerCase() : "element";
1134
1149
  const id = element.id ? "#" + element.id : "";
1135
1150
  const className = typeof element.className === "string"
@@ -1161,6 +1176,7 @@ async function captureViewport(viewport) {
1161
1176
  pathname: location.pathname,
1162
1177
  title: document.title,
1163
1178
  body_text_length: text.length,
1179
+ body_text: text,
1164
1180
  body_text_sample: text.slice(0, 8000),
1165
1181
  scroll_width: scrollWidth,
1166
1182
  client_width: clientWidth,
@@ -1186,7 +1202,7 @@ async function captureViewport(viewport) {
1186
1202
  selectors[check.selector] = await selectorStats(check.selector);
1187
1203
  }
1188
1204
  if ((check.type === "text_visible" || check.type === "text_absent") && (check.text || check.pattern)) {
1189
- text_matches[textKey(check)] = textMatches(dom.body_text_sample || "", check);
1205
+ text_matches[textKey(check)] = textMatches(dom.body_text || dom.body_text_sample || "", check);
1190
1206
  }
1191
1207
  }
1192
1208
  const screenshotLabel = profileSlug + "-" + viewport.name;
package/dist/cli.cjs CHANGED
@@ -7885,6 +7885,20 @@ async function captureViewport(viewport) {
7885
7885
  const scrollWidth = documentElement ? documentElement.scrollWidth : 0;
7886
7886
  const viewportWidth = clientWidth || window.innerWidth;
7887
7887
  const overflowOffenders = [];
7888
+ function isContainedByHorizontalScroller(element) {
7889
+ let current = element.parentElement;
7890
+ while (current && current !== body && current !== documentElement) {
7891
+ const style = window.getComputedStyle(current);
7892
+ const overflowX = style.overflowX || style.overflow || "";
7893
+ if ((overflowX === "auto" || overflowX === "scroll") && current.scrollWidth > current.clientWidth + 1) {
7894
+ const currentRect = current.getBoundingClientRect();
7895
+ const contained = currentRect.left >= -0.5 && currentRect.right <= viewportWidth + 0.5;
7896
+ if (contained) return true;
7897
+ }
7898
+ current = current.parentElement;
7899
+ }
7900
+ return false;
7901
+ }
7888
7902
  for (const element of Array.from(body ? body.querySelectorAll("*") : [])) {
7889
7903
  const rect = element.getBoundingClientRect();
7890
7904
  if (!rect || rect.width < 1 || rect.height < 1) continue;
@@ -7894,6 +7908,7 @@ async function captureViewport(viewport) {
7894
7908
  const rightOverflow = Math.max(0, rect.right - viewportWidth);
7895
7909
  const overflow = Math.max(leftOverflow, rightOverflow);
7896
7910
  if (overflow <= 0.5) continue;
7911
+ if (isContainedByHorizontalScroller(element)) continue;
7897
7912
  const tag = element.tagName ? element.tagName.toLowerCase() : "element";
7898
7913
  const id = element.id ? "#" + element.id : "";
7899
7914
  const className = typeof element.className === "string"
@@ -7925,6 +7940,7 @@ async function captureViewport(viewport) {
7925
7940
  pathname: location.pathname,
7926
7941
  title: document.title,
7927
7942
  body_text_length: text.length,
7943
+ body_text: text,
7928
7944
  body_text_sample: text.slice(0, 8000),
7929
7945
  scroll_width: scrollWidth,
7930
7946
  client_width: clientWidth,
@@ -7950,7 +7966,7 @@ async function captureViewport(viewport) {
7950
7966
  selectors[check.selector] = await selectorStats(check.selector);
7951
7967
  }
7952
7968
  if ((check.type === "text_visible" || check.type === "text_absent") && (check.text || check.pattern)) {
7953
- text_matches[textKey(check)] = textMatches(dom.body_text_sample || "", check);
7969
+ text_matches[textKey(check)] = textMatches(dom.body_text || dom.body_text_sample || "", check);
7954
7970
  }
7955
7971
  }
7956
7972
  const screenshotLabel = profileSlug + "-" + viewport.name;
package/dist/cli.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  profileStatusExitCode,
11
11
  resolveRiddleProofProfileTargetUrl,
12
12
  resolveRiddleProofProfileTimeoutSec
13
- } from "./chunk-XOM2OYAB.js";
13
+ } from "./chunk-SDSBS64X.js";
14
14
  import {
15
15
  createRiddleApiClient,
16
16
  parseRiddleViewport
package/dist/index.cjs CHANGED
@@ -9835,6 +9835,20 @@ async function captureViewport(viewport) {
9835
9835
  const scrollWidth = documentElement ? documentElement.scrollWidth : 0;
9836
9836
  const viewportWidth = clientWidth || window.innerWidth;
9837
9837
  const overflowOffenders = [];
9838
+ function isContainedByHorizontalScroller(element) {
9839
+ let current = element.parentElement;
9840
+ while (current && current !== body && current !== documentElement) {
9841
+ const style = window.getComputedStyle(current);
9842
+ const overflowX = style.overflowX || style.overflow || "";
9843
+ if ((overflowX === "auto" || overflowX === "scroll") && current.scrollWidth > current.clientWidth + 1) {
9844
+ const currentRect = current.getBoundingClientRect();
9845
+ const contained = currentRect.left >= -0.5 && currentRect.right <= viewportWidth + 0.5;
9846
+ if (contained) return true;
9847
+ }
9848
+ current = current.parentElement;
9849
+ }
9850
+ return false;
9851
+ }
9838
9852
  for (const element of Array.from(body ? body.querySelectorAll("*") : [])) {
9839
9853
  const rect = element.getBoundingClientRect();
9840
9854
  if (!rect || rect.width < 1 || rect.height < 1) continue;
@@ -9844,6 +9858,7 @@ async function captureViewport(viewport) {
9844
9858
  const rightOverflow = Math.max(0, rect.right - viewportWidth);
9845
9859
  const overflow = Math.max(leftOverflow, rightOverflow);
9846
9860
  if (overflow <= 0.5) continue;
9861
+ if (isContainedByHorizontalScroller(element)) continue;
9847
9862
  const tag = element.tagName ? element.tagName.toLowerCase() : "element";
9848
9863
  const id = element.id ? "#" + element.id : "";
9849
9864
  const className = typeof element.className === "string"
@@ -9875,6 +9890,7 @@ async function captureViewport(viewport) {
9875
9890
  pathname: location.pathname,
9876
9891
  title: document.title,
9877
9892
  body_text_length: text.length,
9893
+ body_text: text,
9878
9894
  body_text_sample: text.slice(0, 8000),
9879
9895
  scroll_width: scrollWidth,
9880
9896
  client_width: clientWidth,
@@ -9900,7 +9916,7 @@ async function captureViewport(viewport) {
9900
9916
  selectors[check.selector] = await selectorStats(check.selector);
9901
9917
  }
9902
9918
  if ((check.type === "text_visible" || check.type === "text_absent") && (check.text || check.pattern)) {
9903
- text_matches[textKey(check)] = textMatches(dom.body_text_sample || "", check);
9919
+ text_matches[textKey(check)] = textMatches(dom.body_text || dom.body_text_sample || "", check);
9904
9920
  }
9905
9921
  }
9906
9922
  const screenshotLabel = profileSlug + "-" + viewport.name;
package/dist/index.js CHANGED
@@ -58,7 +58,7 @@ import {
58
58
  resolveRiddleProofProfileTimeoutSec,
59
59
  slugifyRiddleProofProfileName,
60
60
  summarizeRiddleProofProfileResult
61
- } from "./chunk-XOM2OYAB.js";
61
+ } from "./chunk-SDSBS64X.js";
62
62
  import {
63
63
  DEFAULT_RIDDLE_API_BASE_URL,
64
64
  DEFAULT_RIDDLE_API_KEY_FILE,
package/dist/profile.cjs CHANGED
@@ -1164,6 +1164,20 @@ async function captureViewport(viewport) {
1164
1164
  const scrollWidth = documentElement ? documentElement.scrollWidth : 0;
1165
1165
  const viewportWidth = clientWidth || window.innerWidth;
1166
1166
  const overflowOffenders = [];
1167
+ function isContainedByHorizontalScroller(element) {
1168
+ let current = element.parentElement;
1169
+ while (current && current !== body && current !== documentElement) {
1170
+ const style = window.getComputedStyle(current);
1171
+ const overflowX = style.overflowX || style.overflow || "";
1172
+ if ((overflowX === "auto" || overflowX === "scroll") && current.scrollWidth > current.clientWidth + 1) {
1173
+ const currentRect = current.getBoundingClientRect();
1174
+ const contained = currentRect.left >= -0.5 && currentRect.right <= viewportWidth + 0.5;
1175
+ if (contained) return true;
1176
+ }
1177
+ current = current.parentElement;
1178
+ }
1179
+ return false;
1180
+ }
1167
1181
  for (const element of Array.from(body ? body.querySelectorAll("*") : [])) {
1168
1182
  const rect = element.getBoundingClientRect();
1169
1183
  if (!rect || rect.width < 1 || rect.height < 1) continue;
@@ -1173,6 +1187,7 @@ async function captureViewport(viewport) {
1173
1187
  const rightOverflow = Math.max(0, rect.right - viewportWidth);
1174
1188
  const overflow = Math.max(leftOverflow, rightOverflow);
1175
1189
  if (overflow <= 0.5) continue;
1190
+ if (isContainedByHorizontalScroller(element)) continue;
1176
1191
  const tag = element.tagName ? element.tagName.toLowerCase() : "element";
1177
1192
  const id = element.id ? "#" + element.id : "";
1178
1193
  const className = typeof element.className === "string"
@@ -1204,6 +1219,7 @@ async function captureViewport(viewport) {
1204
1219
  pathname: location.pathname,
1205
1220
  title: document.title,
1206
1221
  body_text_length: text.length,
1222
+ body_text: text,
1207
1223
  body_text_sample: text.slice(0, 8000),
1208
1224
  scroll_width: scrollWidth,
1209
1225
  client_width: clientWidth,
@@ -1229,7 +1245,7 @@ async function captureViewport(viewport) {
1229
1245
  selectors[check.selector] = await selectorStats(check.selector);
1230
1246
  }
1231
1247
  if ((check.type === "text_visible" || check.type === "text_absent") && (check.text || check.pattern)) {
1232
- text_matches[textKey(check)] = textMatches(dom.body_text_sample || "", check);
1248
+ text_matches[textKey(check)] = textMatches(dom.body_text || dom.body_text_sample || "", check);
1233
1249
  }
1234
1250
  }
1235
1251
  const screenshotLabel = profileSlug + "-" + viewport.name;
package/dist/profile.js CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  resolveRiddleProofProfileTimeoutSec,
20
20
  slugifyRiddleProofProfileName,
21
21
  summarizeRiddleProofProfileResult
22
- } from "./chunk-XOM2OYAB.js";
22
+ } from "./chunk-SDSBS64X.js";
23
23
  export {
24
24
  RIDDLE_PROOF_PROFILE_CHECK_TYPES,
25
25
  RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
292
292
  blocking?: boolean;
293
293
  details?: Record<string, unknown>;
294
294
  ok: boolean;
295
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
295
+ action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
296
296
  state_path: string;
297
297
  stage: any;
298
298
  summary: string;
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
382
382
  continueWithStage?: WorkflowStage | null;
383
383
  blocking?: boolean;
384
384
  details?: Record<string, unknown>;
385
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
385
+ action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
386
386
  state_path: string;
387
387
  stage: any;
388
388
  checkpoint: string;
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
659
659
  error?: undefined;
660
660
  } | {
661
661
  ok: boolean;
662
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
662
+ action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
663
663
  state_path: string;
664
664
  stage: any;
665
665
  summary: string;
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
292
292
  blocking?: boolean;
293
293
  details?: Record<string, unknown>;
294
294
  ok: boolean;
295
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
295
+ action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
296
296
  state_path: string;
297
297
  stage: any;
298
298
  summary: string;
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
382
382
  continueWithStage?: WorkflowStage | null;
383
383
  blocking?: boolean;
384
384
  details?: Record<string, unknown>;
385
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
385
+ action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
386
386
  state_path: string;
387
387
  stage: any;
388
388
  checkpoint: string;
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
659
659
  error?: undefined;
660
660
  } | {
661
661
  ok: boolean;
662
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
662
+ action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
663
663
  state_path: string;
664
664
  stage: any;
665
665
  summary: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/riddle-proof",
3
- "version": "0.7.23",
3
+ "version": "0.7.24",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",