@riddledc/riddle-proof 0.7.137 → 0.7.138
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 +4 -1
- package/dist/{chunk-2WWSWSYA.js → chunk-N75EAJNG.js} +33 -2
- package/dist/cli.cjs +33 -2
- package/dist/cli.js +1 -1
- package/dist/index.cjs +33 -2
- package/dist/index.js +1 -1
- package/dist/profile.cjs +33 -2
- package/dist/profile.d.cts +1 -0
- package/dist/profile.d.ts +1 -0
- package/dist/profile.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -455,7 +455,10 @@ met and records `call_count`, final `returned`, and final `until_value`.
|
|
|
455
455
|
Use `screenshot` with an optional `label` to capture durable Riddle screenshots
|
|
456
456
|
at important setup milestones, such as after a route switch, terminal state, or
|
|
457
457
|
reset. These labels are recorded in setup evidence and included in profile
|
|
458
|
-
artifact summaries alongside final viewport screenshots.
|
|
458
|
+
artifact summaries alongside final viewport screenshots. Setup screenshots are
|
|
459
|
+
full-page by default; set `full_page: false`, `fullPage: false`, or
|
|
460
|
+
`mode: "viewport"` when fixed or sticky page chrome would make full-page
|
|
461
|
+
captures harder to review.
|
|
459
462
|
Add `frame_selector` / `frameSelector` to a setup action when the interaction
|
|
460
463
|
target lives inside an embedded iframe, such as a community game player or
|
|
461
464
|
hosted preview surface. Selector-based actions, storage actions, window calls,
|
|
@@ -665,6 +665,34 @@ function normalizeSetupActionPointerType(value, type, index) {
|
|
|
665
665
|
if (normalized === "pen" || normalized === "stylus") return "pen";
|
|
666
666
|
throw new Error(`target.setup_actions[${index}].pointer_type ${String(value)} is not supported. Supported pointer types: mouse, touch, pen.`);
|
|
667
667
|
}
|
|
668
|
+
function normalizeSetupActionScreenshotFullPage(input, type, index) {
|
|
669
|
+
const directFullPage = booleanValue(valueFromOwn(input, "full_page", "fullPage"));
|
|
670
|
+
const viewportOnly = booleanValue(valueFromOwn(input, "viewport_only", "viewportOnly", "viewport_screenshot", "viewportScreenshot"));
|
|
671
|
+
if (type !== "screenshot") {
|
|
672
|
+
if (directFullPage !== void 0 || viewportOnly !== void 0 || valueFromOwn(input, "screenshot_mode", "screenshotMode", "capture_mode", "captureMode") !== void 0) {
|
|
673
|
+
throw new Error(`target.setup_actions[${index}].full_page is only supported for screenshot actions.`);
|
|
674
|
+
}
|
|
675
|
+
return void 0;
|
|
676
|
+
}
|
|
677
|
+
const modeInput = stringFromOwn(input, "mode", "screenshot_mode", "screenshotMode", "capture_mode", "captureMode");
|
|
678
|
+
let modeFullPage;
|
|
679
|
+
if (modeInput) {
|
|
680
|
+
const mode = modeInput.trim().toLowerCase().replace(/[-\s]+/g, "_");
|
|
681
|
+
if (mode === "full_page" || mode === "fullpage" || mode === "page" || mode === "document") {
|
|
682
|
+
modeFullPage = true;
|
|
683
|
+
} else if (mode === "viewport" || mode === "view") {
|
|
684
|
+
modeFullPage = false;
|
|
685
|
+
} else {
|
|
686
|
+
throw new Error(`target.setup_actions[${index}].mode ${modeInput} is not supported for screenshot actions. Supported modes: full_page, viewport.`);
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
const values = [directFullPage, viewportOnly === void 0 ? void 0 : !viewportOnly, modeFullPage].filter((value) => value !== void 0);
|
|
690
|
+
if (!values.length) return void 0;
|
|
691
|
+
if (values.some((value) => value !== values[0])) {
|
|
692
|
+
throw new Error(`target.setup_actions[${index}] has conflicting screenshot full_page / viewport mode options.`);
|
|
693
|
+
}
|
|
694
|
+
return values[0];
|
|
695
|
+
}
|
|
668
696
|
function normalizeSetupAction(input, index) {
|
|
669
697
|
if (!isRecord(input)) throw new Error(`target.setup_actions[${index}] must be an object.`);
|
|
670
698
|
const type = normalizeSetupActionType(stringValue(input.type), index);
|
|
@@ -795,6 +823,7 @@ function normalizeSetupAction(input, index) {
|
|
|
795
823
|
selector,
|
|
796
824
|
frame_selector: frameSelector,
|
|
797
825
|
frame_index: frameIndex,
|
|
826
|
+
full_page: normalizeSetupActionScreenshotFullPage(input, type, index),
|
|
798
827
|
force: type === "click" && (input.force === true || input.force_click === true || input.forceClick === true),
|
|
799
828
|
click_count: normalizeSetupActionClickCount(input, type, index),
|
|
800
829
|
coordinate_mode: coordinateMode,
|
|
@@ -5104,8 +5133,10 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
5104
5133
|
const viewportName = viewport && viewport.name ? viewport.name : "viewport";
|
|
5105
5134
|
const label = profileSlug + "-" + viewportName + "-" + labelPart;
|
|
5106
5135
|
if (typeof saveScreenshot !== "function") return { ...base, reason: "save_screenshot_unavailable", label: rawLabel };
|
|
5107
|
-
|
|
5108
|
-
|
|
5136
|
+
const screenshotOptions = {};
|
|
5137
|
+
if (action.full_page !== undefined) screenshotOptions.fullPage = action.full_page !== false;
|
|
5138
|
+
await saveScreenshot(label, screenshotOptions);
|
|
5139
|
+
return { ...base, ok: true, label: rawLabel, screenshot_label: label, full_page: action.full_page === undefined ? null : action.full_page !== false };
|
|
5109
5140
|
}
|
|
5110
5141
|
if (type === "clear_console") {
|
|
5111
5142
|
const cleared_console_event_count = consoleEvents.length;
|
package/dist/cli.cjs
CHANGED
|
@@ -7602,6 +7602,34 @@ function normalizeSetupActionPointerType(value, type, index) {
|
|
|
7602
7602
|
if (normalized === "pen" || normalized === "stylus") return "pen";
|
|
7603
7603
|
throw new Error(`target.setup_actions[${index}].pointer_type ${String(value)} is not supported. Supported pointer types: mouse, touch, pen.`);
|
|
7604
7604
|
}
|
|
7605
|
+
function normalizeSetupActionScreenshotFullPage(input, type, index) {
|
|
7606
|
+
const directFullPage = booleanValue(valueFromOwn(input, "full_page", "fullPage"));
|
|
7607
|
+
const viewportOnly = booleanValue(valueFromOwn(input, "viewport_only", "viewportOnly", "viewport_screenshot", "viewportScreenshot"));
|
|
7608
|
+
if (type !== "screenshot") {
|
|
7609
|
+
if (directFullPage !== void 0 || viewportOnly !== void 0 || valueFromOwn(input, "screenshot_mode", "screenshotMode", "capture_mode", "captureMode") !== void 0) {
|
|
7610
|
+
throw new Error(`target.setup_actions[${index}].full_page is only supported for screenshot actions.`);
|
|
7611
|
+
}
|
|
7612
|
+
return void 0;
|
|
7613
|
+
}
|
|
7614
|
+
const modeInput = stringFromOwn(input, "mode", "screenshot_mode", "screenshotMode", "capture_mode", "captureMode");
|
|
7615
|
+
let modeFullPage;
|
|
7616
|
+
if (modeInput) {
|
|
7617
|
+
const mode = modeInput.trim().toLowerCase().replace(/[-\s]+/g, "_");
|
|
7618
|
+
if (mode === "full_page" || mode === "fullpage" || mode === "page" || mode === "document") {
|
|
7619
|
+
modeFullPage = true;
|
|
7620
|
+
} else if (mode === "viewport" || mode === "view") {
|
|
7621
|
+
modeFullPage = false;
|
|
7622
|
+
} else {
|
|
7623
|
+
throw new Error(`target.setup_actions[${index}].mode ${modeInput} is not supported for screenshot actions. Supported modes: full_page, viewport.`);
|
|
7624
|
+
}
|
|
7625
|
+
}
|
|
7626
|
+
const values = [directFullPage, viewportOnly === void 0 ? void 0 : !viewportOnly, modeFullPage].filter((value) => value !== void 0);
|
|
7627
|
+
if (!values.length) return void 0;
|
|
7628
|
+
if (values.some((value) => value !== values[0])) {
|
|
7629
|
+
throw new Error(`target.setup_actions[${index}] has conflicting screenshot full_page / viewport mode options.`);
|
|
7630
|
+
}
|
|
7631
|
+
return values[0];
|
|
7632
|
+
}
|
|
7605
7633
|
function normalizeSetupAction(input, index) {
|
|
7606
7634
|
if (!isRecord(input)) throw new Error(`target.setup_actions[${index}] must be an object.`);
|
|
7607
7635
|
const type = normalizeSetupActionType(stringValue2(input.type), index);
|
|
@@ -7732,6 +7760,7 @@ function normalizeSetupAction(input, index) {
|
|
|
7732
7760
|
selector,
|
|
7733
7761
|
frame_selector: frameSelector,
|
|
7734
7762
|
frame_index: frameIndex,
|
|
7763
|
+
full_page: normalizeSetupActionScreenshotFullPage(input, type, index),
|
|
7735
7764
|
force: type === "click" && (input.force === true || input.force_click === true || input.forceClick === true),
|
|
7736
7765
|
click_count: normalizeSetupActionClickCount(input, type, index),
|
|
7737
7766
|
coordinate_mode: coordinateMode,
|
|
@@ -12025,8 +12054,10 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
12025
12054
|
const viewportName = viewport && viewport.name ? viewport.name : "viewport";
|
|
12026
12055
|
const label = profileSlug + "-" + viewportName + "-" + labelPart;
|
|
12027
12056
|
if (typeof saveScreenshot !== "function") return { ...base, reason: "save_screenshot_unavailable", label: rawLabel };
|
|
12028
|
-
|
|
12029
|
-
|
|
12057
|
+
const screenshotOptions = {};
|
|
12058
|
+
if (action.full_page !== undefined) screenshotOptions.fullPage = action.full_page !== false;
|
|
12059
|
+
await saveScreenshot(label, screenshotOptions);
|
|
12060
|
+
return { ...base, ok: true, label: rawLabel, screenshot_label: label, full_page: action.full_page === undefined ? null : action.full_page !== false };
|
|
12030
12061
|
}
|
|
12031
12062
|
if (type === "clear_console") {
|
|
12032
12063
|
const cleared_console_event_count = consoleEvents.length;
|
package/dist/cli.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -9398,6 +9398,34 @@ function normalizeSetupActionPointerType(value, type, index) {
|
|
|
9398
9398
|
if (normalized === "pen" || normalized === "stylus") return "pen";
|
|
9399
9399
|
throw new Error(`target.setup_actions[${index}].pointer_type ${String(value)} is not supported. Supported pointer types: mouse, touch, pen.`);
|
|
9400
9400
|
}
|
|
9401
|
+
function normalizeSetupActionScreenshotFullPage(input, type, index) {
|
|
9402
|
+
const directFullPage = booleanValue(valueFromOwn(input, "full_page", "fullPage"));
|
|
9403
|
+
const viewportOnly = booleanValue(valueFromOwn(input, "viewport_only", "viewportOnly", "viewport_screenshot", "viewportScreenshot"));
|
|
9404
|
+
if (type !== "screenshot") {
|
|
9405
|
+
if (directFullPage !== void 0 || viewportOnly !== void 0 || valueFromOwn(input, "screenshot_mode", "screenshotMode", "capture_mode", "captureMode") !== void 0) {
|
|
9406
|
+
throw new Error(`target.setup_actions[${index}].full_page is only supported for screenshot actions.`);
|
|
9407
|
+
}
|
|
9408
|
+
return void 0;
|
|
9409
|
+
}
|
|
9410
|
+
const modeInput = stringFromOwn(input, "mode", "screenshot_mode", "screenshotMode", "capture_mode", "captureMode");
|
|
9411
|
+
let modeFullPage;
|
|
9412
|
+
if (modeInput) {
|
|
9413
|
+
const mode = modeInput.trim().toLowerCase().replace(/[-\s]+/g, "_");
|
|
9414
|
+
if (mode === "full_page" || mode === "fullpage" || mode === "page" || mode === "document") {
|
|
9415
|
+
modeFullPage = true;
|
|
9416
|
+
} else if (mode === "viewport" || mode === "view") {
|
|
9417
|
+
modeFullPage = false;
|
|
9418
|
+
} else {
|
|
9419
|
+
throw new Error(`target.setup_actions[${index}].mode ${modeInput} is not supported for screenshot actions. Supported modes: full_page, viewport.`);
|
|
9420
|
+
}
|
|
9421
|
+
}
|
|
9422
|
+
const values = [directFullPage, viewportOnly === void 0 ? void 0 : !viewportOnly, modeFullPage].filter((value) => value !== void 0);
|
|
9423
|
+
if (!values.length) return void 0;
|
|
9424
|
+
if (values.some((value) => value !== values[0])) {
|
|
9425
|
+
throw new Error(`target.setup_actions[${index}] has conflicting screenshot full_page / viewport mode options.`);
|
|
9426
|
+
}
|
|
9427
|
+
return values[0];
|
|
9428
|
+
}
|
|
9401
9429
|
function normalizeSetupAction(input, index) {
|
|
9402
9430
|
if (!isRecord2(input)) throw new Error(`target.setup_actions[${index}] must be an object.`);
|
|
9403
9431
|
const type = normalizeSetupActionType(stringValue5(input.type), index);
|
|
@@ -9528,6 +9556,7 @@ function normalizeSetupAction(input, index) {
|
|
|
9528
9556
|
selector,
|
|
9529
9557
|
frame_selector: frameSelector,
|
|
9530
9558
|
frame_index: frameIndex,
|
|
9559
|
+
full_page: normalizeSetupActionScreenshotFullPage(input, type, index),
|
|
9531
9560
|
force: type === "click" && (input.force === true || input.force_click === true || input.forceClick === true),
|
|
9532
9561
|
click_count: normalizeSetupActionClickCount(input, type, index),
|
|
9533
9562
|
coordinate_mode: coordinateMode,
|
|
@@ -13837,8 +13866,10 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
13837
13866
|
const viewportName = viewport && viewport.name ? viewport.name : "viewport";
|
|
13838
13867
|
const label = profileSlug + "-" + viewportName + "-" + labelPart;
|
|
13839
13868
|
if (typeof saveScreenshot !== "function") return { ...base, reason: "save_screenshot_unavailable", label: rawLabel };
|
|
13840
|
-
|
|
13841
|
-
|
|
13869
|
+
const screenshotOptions = {};
|
|
13870
|
+
if (action.full_page !== undefined) screenshotOptions.fullPage = action.full_page !== false;
|
|
13871
|
+
await saveScreenshot(label, screenshotOptions);
|
|
13872
|
+
return { ...base, ok: true, label: rawLabel, screenshot_label: label, full_page: action.full_page === undefined ? null : action.full_page !== false };
|
|
13842
13873
|
}
|
|
13843
13874
|
if (type === "clear_console") {
|
|
13844
13875
|
const cleared_console_event_count = consoleEvents.length;
|
package/dist/index.js
CHANGED
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
resolveRiddleProofProfileTimeoutSec,
|
|
63
63
|
slugifyRiddleProofProfileName,
|
|
64
64
|
summarizeRiddleProofProfileResult
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-N75EAJNG.js";
|
|
66
66
|
import {
|
|
67
67
|
DEFAULT_RIDDLE_API_BASE_URL,
|
|
68
68
|
DEFAULT_RIDDLE_API_KEY_FILE,
|
package/dist/profile.cjs
CHANGED
|
@@ -712,6 +712,34 @@ function normalizeSetupActionPointerType(value, type, index) {
|
|
|
712
712
|
if (normalized === "pen" || normalized === "stylus") return "pen";
|
|
713
713
|
throw new Error(`target.setup_actions[${index}].pointer_type ${String(value)} is not supported. Supported pointer types: mouse, touch, pen.`);
|
|
714
714
|
}
|
|
715
|
+
function normalizeSetupActionScreenshotFullPage(input, type, index) {
|
|
716
|
+
const directFullPage = booleanValue(valueFromOwn(input, "full_page", "fullPage"));
|
|
717
|
+
const viewportOnly = booleanValue(valueFromOwn(input, "viewport_only", "viewportOnly", "viewport_screenshot", "viewportScreenshot"));
|
|
718
|
+
if (type !== "screenshot") {
|
|
719
|
+
if (directFullPage !== void 0 || viewportOnly !== void 0 || valueFromOwn(input, "screenshot_mode", "screenshotMode", "capture_mode", "captureMode") !== void 0) {
|
|
720
|
+
throw new Error(`target.setup_actions[${index}].full_page is only supported for screenshot actions.`);
|
|
721
|
+
}
|
|
722
|
+
return void 0;
|
|
723
|
+
}
|
|
724
|
+
const modeInput = stringFromOwn(input, "mode", "screenshot_mode", "screenshotMode", "capture_mode", "captureMode");
|
|
725
|
+
let modeFullPage;
|
|
726
|
+
if (modeInput) {
|
|
727
|
+
const mode = modeInput.trim().toLowerCase().replace(/[-\s]+/g, "_");
|
|
728
|
+
if (mode === "full_page" || mode === "fullpage" || mode === "page" || mode === "document") {
|
|
729
|
+
modeFullPage = true;
|
|
730
|
+
} else if (mode === "viewport" || mode === "view") {
|
|
731
|
+
modeFullPage = false;
|
|
732
|
+
} else {
|
|
733
|
+
throw new Error(`target.setup_actions[${index}].mode ${modeInput} is not supported for screenshot actions. Supported modes: full_page, viewport.`);
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
const values = [directFullPage, viewportOnly === void 0 ? void 0 : !viewportOnly, modeFullPage].filter((value) => value !== void 0);
|
|
737
|
+
if (!values.length) return void 0;
|
|
738
|
+
if (values.some((value) => value !== values[0])) {
|
|
739
|
+
throw new Error(`target.setup_actions[${index}] has conflicting screenshot full_page / viewport mode options.`);
|
|
740
|
+
}
|
|
741
|
+
return values[0];
|
|
742
|
+
}
|
|
715
743
|
function normalizeSetupAction(input, index) {
|
|
716
744
|
if (!isRecord(input)) throw new Error(`target.setup_actions[${index}] must be an object.`);
|
|
717
745
|
const type = normalizeSetupActionType(stringValue(input.type), index);
|
|
@@ -842,6 +870,7 @@ function normalizeSetupAction(input, index) {
|
|
|
842
870
|
selector,
|
|
843
871
|
frame_selector: frameSelector,
|
|
844
872
|
frame_index: frameIndex,
|
|
873
|
+
full_page: normalizeSetupActionScreenshotFullPage(input, type, index),
|
|
845
874
|
force: type === "click" && (input.force === true || input.force_click === true || input.forceClick === true),
|
|
846
875
|
click_count: normalizeSetupActionClickCount(input, type, index),
|
|
847
876
|
coordinate_mode: coordinateMode,
|
|
@@ -5151,8 +5180,10 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
5151
5180
|
const viewportName = viewport && viewport.name ? viewport.name : "viewport";
|
|
5152
5181
|
const label = profileSlug + "-" + viewportName + "-" + labelPart;
|
|
5153
5182
|
if (typeof saveScreenshot !== "function") return { ...base, reason: "save_screenshot_unavailable", label: rawLabel };
|
|
5154
|
-
|
|
5155
|
-
|
|
5183
|
+
const screenshotOptions = {};
|
|
5184
|
+
if (action.full_page !== undefined) screenshotOptions.fullPage = action.full_page !== false;
|
|
5185
|
+
await saveScreenshot(label, screenshotOptions);
|
|
5186
|
+
return { ...base, ok: true, label: rawLabel, screenshot_label: label, full_page: action.full_page === undefined ? null : action.full_page !== false };
|
|
5156
5187
|
}
|
|
5157
5188
|
if (type === "clear_console") {
|
|
5158
5189
|
const cleared_console_event_count = consoleEvents.length;
|
package/dist/profile.d.cts
CHANGED
package/dist/profile.d.ts
CHANGED
package/dist/profile.js
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
resolveRiddleProofProfileTimeoutSec,
|
|
24
24
|
slugifyRiddleProofProfileName,
|
|
25
25
|
summarizeRiddleProofProfileResult
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-N75EAJNG.js";
|
|
27
27
|
export {
|
|
28
28
|
RIDDLE_PROOF_PROFILE_CHECK_TYPES,
|
|
29
29
|
RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
|