@riddledc/riddle-proof 0.7.147 → 0.7.148

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 CHANGED
@@ -397,8 +397,8 @@ when body matching overrides sequence order.
397
397
  `target.setup_actions` is optional. Use it when the meaningful proof surface
398
398
  appears only after a picker, tab, login stub, storage seed, form fill,
399
399
  transport control, or other bounded interaction. Supported setup actions are
400
- `click`, `drag`, `press`, `fill`, `set_input_value`, `assert_text_visible`,
401
- `assert_text_absent`, `assert_selector_count`, `assert_window_value`,
400
+ `click`, `drag`, `press`, `fill`, `set_input_value`, `set_range_value`,
401
+ `assert_text_visible`, `assert_text_absent`, `assert_selector_count`, `assert_window_value`,
402
402
  `assert_window_number`, `local_storage`, `session_storage`, `clear_storage`,
403
403
  `clear_console`, `screenshot`, `wait`, `wait_for_selector`, `wait_for_text`,
404
404
  `window_eval`, `window_call`, and `window_call_until`;
@@ -415,6 +415,13 @@ Use `click_count` / `clickCount` / `clicks` from 1 to 10 on a single `click`
415
415
  action for atomic double-click or double-submit contracts where modeling the
416
416
  interaction as repeated setup actions would incorrectly require the target to
417
417
  remain in the DOM after the first click.
418
+ Use `set_range_value` for HTML range inputs and React-controlled sliders. It
419
+ accepts aliases such as `set-slider-value`, requires `selector` plus `value`,
420
+ uses the native input value setter, dispatches bubbling `input` and `change`
421
+ events, and records the requested value plus the browser's actual normalized
422
+ value, numeric value, `min`, `max`, and `step`. The action is intentionally
423
+ strict: if the target is not an `input[type="range"]`, setup fails with
424
+ `not_range_input` instead of silently treating the control like a text field.
418
425
  Use `drag` for pointer-driven controls such as canvas launch areas, sliders, or
419
426
  drag-to-aim games. Provide `selector`, `from_x`, `from_y`, `to_x`, and `to_y`;
420
427
  coordinates are element-relative pixels by default. Set `coordinate_mode:
@@ -47,6 +47,7 @@ var RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES = [
47
47
  "press",
48
48
  "fill",
49
49
  "set_input_value",
50
+ "set_range_value",
50
51
  "assert_text_visible",
51
52
  "assert_text_absent",
52
53
  "assert_selector_count",
@@ -638,7 +639,7 @@ function isSupportedCheckType(value) {
638
639
  }
639
640
  function normalizeSetupActionType(value, index) {
640
641
  const normalizedInput = String(value || "").trim().replace(/-/g, "_");
641
- const normalized = normalizedInput === "clear_browser_storage" ? "clear_storage" : normalizedInput === "reset_console" || normalizedInput === "clear_browser_console" || normalizedInput === "reset_browser_console" ? "clear_console" : normalizedInput === "pointer_drag" || normalizedInput === "mouse_drag" || normalizedInput === "drag_to" ? "drag" : normalizedInput === "keyboard_press" || normalizedInput === "key_press" ? "press" : normalizedInput === "capture_screenshot" || normalizedInput === "save_screenshot" || normalizedInput === "setup_screenshot" ? "screenshot" : normalizedInput === "accept_dialog" || normalizedInput === "accept_dialogs" || normalizedInput === "confirm_dialog" || normalizedInput === "set_dialog_response" ? "dialog_response" : normalizedInput === "dismiss_dialog" || normalizedInput === "dismiss_dialogs" || normalizedInput === "cancel_dialog" ? "dialog_response" : normalizedInput === "window_call_until" || normalizedInput === "call_until" || normalizedInput === "window_call_repeat_until" || normalizedInput === "repeat_window_call_until" ? "window_call_until" : normalizedInput === "window_evaluate" || normalizedInput === "browser_eval" || normalizedInput === "browser_evaluate" || normalizedInput === "evaluate_script" || normalizedInput === "profile_script" ? "window_eval" : normalizedInput;
642
+ const normalized = normalizedInput === "clear_browser_storage" ? "clear_storage" : normalizedInput === "reset_console" || normalizedInput === "clear_browser_console" || normalizedInput === "reset_browser_console" ? "clear_console" : normalizedInput === "pointer_drag" || normalizedInput === "mouse_drag" || normalizedInput === "drag_to" ? "drag" : normalizedInput === "keyboard_press" || normalizedInput === "key_press" ? "press" : normalizedInput === "set_slider_value" || normalizedInput === "slider_value" || normalizedInput === "set_slider" || normalizedInput === "set_range" || normalizedInput === "range_value" || normalizedInput === "range_input" || normalizedInput === "set_range_input" ? "set_range_value" : normalizedInput === "capture_screenshot" || normalizedInput === "save_screenshot" || normalizedInput === "setup_screenshot" ? "screenshot" : normalizedInput === "accept_dialog" || normalizedInput === "accept_dialogs" || normalizedInput === "confirm_dialog" || normalizedInput === "set_dialog_response" ? "dialog_response" : normalizedInput === "dismiss_dialog" || normalizedInput === "dismiss_dialogs" || normalizedInput === "cancel_dialog" ? "dialog_response" : normalizedInput === "window_call_until" || normalizedInput === "call_until" || normalizedInput === "window_call_repeat_until" || normalizedInput === "repeat_window_call_until" ? "window_call_until" : normalizedInput === "window_evaluate" || normalizedInput === "browser_eval" || normalizedInput === "browser_evaluate" || normalizedInput === "evaluate_script" || normalizedInput === "profile_script" ? "window_eval" : normalizedInput;
642
643
  if (RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES.includes(normalized)) {
643
644
  return normalized;
644
645
  }
@@ -736,7 +737,7 @@ function normalizeSetupAction(input, index) {
736
737
  if (frameIndex !== void 0 && (!Number.isInteger(frameIndex) || frameIndex < 0)) {
737
738
  throw new Error(`target.setup_actions[${index}].frame_index must be a non-negative integer.`);
738
739
  }
739
- if ((type === "click" || type === "drag" || type === "fill" || type === "set_input_value" || type === "wait_for_selector" || type === "wait_for_text" || type === "assert_text_visible" || type === "assert_text_absent" || type === "assert_selector_count") && !selector) {
740
+ if ((type === "click" || type === "drag" || type === "fill" || type === "set_input_value" || type === "set_range_value" || type === "wait_for_selector" || type === "wait_for_text" || type === "assert_text_visible" || type === "assert_text_absent" || type === "assert_selector_count") && !selector) {
740
741
  throw new Error(`target.setup_actions[${index}] ${type} requires selector.`);
741
742
  }
742
743
  const fromX = numberValue(valueFromOwn(input, "from_x", "fromX", "start_x", "startX", "x1"));
@@ -768,7 +769,7 @@ function normalizeSetupAction(input, index) {
768
769
  }
769
770
  const value = stringFromOwn(input, "value", "input_value", "inputValue");
770
771
  const hasJsonValue = hasOwn(input, "value_json") || hasOwn(input, "valueJson") || hasOwn(input, "json");
771
- if ((type === "fill" || type === "set_input_value") && value === void 0 && !hasJsonValue) {
772
+ if ((type === "fill" || type === "set_input_value" || type === "set_range_value") && value === void 0 && !hasJsonValue) {
772
773
  throw new Error(`target.setup_actions[${index}] ${type} requires value.`);
773
774
  }
774
775
  const key = stringValue(input.key);
@@ -5925,6 +5926,58 @@ async function executeSetupAction(action, ordinal, viewport) {
5925
5926
  await locator.nth(targetIndex).fill(value, { timeout });
5926
5927
  return { ...base, ...setupScopeEvidence(scope), ok: true, count, target_index: targetIndex, value_length: value.length };
5927
5928
  }
5929
+ if (type === "set_range_value") {
5930
+ const scope = await setupActionScope(action, timeout);
5931
+ if (!scope.ok) return setupScopeFailure(base, scope);
5932
+ const locator = scope.context.locator(action.selector);
5933
+ const count = await locator.count();
5934
+ if (!count) return { ...base, reason: "selector_not_found", count };
5935
+ const targetIndex = Number.isInteger(action.index) ? action.index : 0;
5936
+ if (targetIndex < 0 || targetIndex >= count) return { ...base, reason: "index_out_of_range", count, target_index: targetIndex };
5937
+ const target = locator.nth(targetIndex);
5938
+ await target.waitFor({ state: "visible", timeout });
5939
+ const requestedValue = setupActionValue(action);
5940
+ const rangeResult = await target.evaluate((element, value) => {
5941
+ const tag = String(element && element.tagName ? element.tagName : "").toLowerCase();
5942
+ const inputType = tag === "input" ? String(element.type || "").toLowerCase() : "";
5943
+ if (tag !== "input" || inputType !== "range") {
5944
+ return { ok: false, reason: "not_range_input", tag, input_type: inputType };
5945
+ }
5946
+ const beforeValue = String(element.value);
5947
+ const valueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set;
5948
+ if (typeof valueSetter === "function") valueSetter.call(element, String(value));
5949
+ else element.value = String(value);
5950
+ element.dispatchEvent(new Event("input", { bubbles: true, composed: true }));
5951
+ element.dispatchEvent(new Event("change", { bubbles: true, composed: true }));
5952
+ const valueAsNumber = Number(element.valueAsNumber);
5953
+ return {
5954
+ ok: true,
5955
+ before_value: beforeValue,
5956
+ actual_value: String(element.value),
5957
+ value_as_number: Number.isFinite(valueAsNumber) ? valueAsNumber : null,
5958
+ min: element.min || null,
5959
+ max: element.max || null,
5960
+ step: element.step || null,
5961
+ };
5962
+ }, requestedValue);
5963
+ return {
5964
+ ...base,
5965
+ ...setupScopeEvidence(scope),
5966
+ ok: rangeResult && rangeResult.ok === true,
5967
+ count,
5968
+ target_index: targetIndex,
5969
+ requested_value: requestedValue,
5970
+ actual_value: rangeResult?.actual_value,
5971
+ before_value: rangeResult?.before_value,
5972
+ value_as_number: rangeResult?.value_as_number,
5973
+ min: rangeResult?.min,
5974
+ max: rangeResult?.max,
5975
+ step: rangeResult?.step,
5976
+ tag: rangeResult?.tag,
5977
+ input_type: rangeResult?.input_type,
5978
+ reason: rangeResult && rangeResult.ok === true ? undefined : rangeResult?.reason || "range_value_not_set",
5979
+ };
5980
+ }
5928
5981
  if (type === "assert_selector_count") {
5929
5982
  const scope = await setupActionScope(action, timeout);
5930
5983
  if (!scope.ok) return setupScopeFailure(base, scope);
package/dist/cli.cjs CHANGED
@@ -6996,6 +6996,7 @@ var RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES = [
6996
6996
  "press",
6997
6997
  "fill",
6998
6998
  "set_input_value",
6999
+ "set_range_value",
6999
7000
  "assert_text_visible",
7000
7001
  "assert_text_absent",
7001
7002
  "assert_selector_count",
@@ -7587,7 +7588,7 @@ function isSupportedCheckType(value) {
7587
7588
  }
7588
7589
  function normalizeSetupActionType(value, index) {
7589
7590
  const normalizedInput = String(value || "").trim().replace(/-/g, "_");
7590
- const normalized = normalizedInput === "clear_browser_storage" ? "clear_storage" : normalizedInput === "reset_console" || normalizedInput === "clear_browser_console" || normalizedInput === "reset_browser_console" ? "clear_console" : normalizedInput === "pointer_drag" || normalizedInput === "mouse_drag" || normalizedInput === "drag_to" ? "drag" : normalizedInput === "keyboard_press" || normalizedInput === "key_press" ? "press" : normalizedInput === "capture_screenshot" || normalizedInput === "save_screenshot" || normalizedInput === "setup_screenshot" ? "screenshot" : normalizedInput === "accept_dialog" || normalizedInput === "accept_dialogs" || normalizedInput === "confirm_dialog" || normalizedInput === "set_dialog_response" ? "dialog_response" : normalizedInput === "dismiss_dialog" || normalizedInput === "dismiss_dialogs" || normalizedInput === "cancel_dialog" ? "dialog_response" : normalizedInput === "window_call_until" || normalizedInput === "call_until" || normalizedInput === "window_call_repeat_until" || normalizedInput === "repeat_window_call_until" ? "window_call_until" : normalizedInput === "window_evaluate" || normalizedInput === "browser_eval" || normalizedInput === "browser_evaluate" || normalizedInput === "evaluate_script" || normalizedInput === "profile_script" ? "window_eval" : normalizedInput;
7591
+ const normalized = normalizedInput === "clear_browser_storage" ? "clear_storage" : normalizedInput === "reset_console" || normalizedInput === "clear_browser_console" || normalizedInput === "reset_browser_console" ? "clear_console" : normalizedInput === "pointer_drag" || normalizedInput === "mouse_drag" || normalizedInput === "drag_to" ? "drag" : normalizedInput === "keyboard_press" || normalizedInput === "key_press" ? "press" : normalizedInput === "set_slider_value" || normalizedInput === "slider_value" || normalizedInput === "set_slider" || normalizedInput === "set_range" || normalizedInput === "range_value" || normalizedInput === "range_input" || normalizedInput === "set_range_input" ? "set_range_value" : normalizedInput === "capture_screenshot" || normalizedInput === "save_screenshot" || normalizedInput === "setup_screenshot" ? "screenshot" : normalizedInput === "accept_dialog" || normalizedInput === "accept_dialogs" || normalizedInput === "confirm_dialog" || normalizedInput === "set_dialog_response" ? "dialog_response" : normalizedInput === "dismiss_dialog" || normalizedInput === "dismiss_dialogs" || normalizedInput === "cancel_dialog" ? "dialog_response" : normalizedInput === "window_call_until" || normalizedInput === "call_until" || normalizedInput === "window_call_repeat_until" || normalizedInput === "repeat_window_call_until" ? "window_call_until" : normalizedInput === "window_evaluate" || normalizedInput === "browser_eval" || normalizedInput === "browser_evaluate" || normalizedInput === "evaluate_script" || normalizedInput === "profile_script" ? "window_eval" : normalizedInput;
7591
7592
  if (RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES.includes(normalized)) {
7592
7593
  return normalized;
7593
7594
  }
@@ -7685,7 +7686,7 @@ function normalizeSetupAction(input, index) {
7685
7686
  if (frameIndex !== void 0 && (!Number.isInteger(frameIndex) || frameIndex < 0)) {
7686
7687
  throw new Error(`target.setup_actions[${index}].frame_index must be a non-negative integer.`);
7687
7688
  }
7688
- if ((type === "click" || type === "drag" || type === "fill" || type === "set_input_value" || type === "wait_for_selector" || type === "wait_for_text" || type === "assert_text_visible" || type === "assert_text_absent" || type === "assert_selector_count") && !selector) {
7689
+ if ((type === "click" || type === "drag" || type === "fill" || type === "set_input_value" || type === "set_range_value" || type === "wait_for_selector" || type === "wait_for_text" || type === "assert_text_visible" || type === "assert_text_absent" || type === "assert_selector_count") && !selector) {
7689
7690
  throw new Error(`target.setup_actions[${index}] ${type} requires selector.`);
7690
7691
  }
7691
7692
  const fromX = numberValue(valueFromOwn(input, "from_x", "fromX", "start_x", "startX", "x1"));
@@ -7717,7 +7718,7 @@ function normalizeSetupAction(input, index) {
7717
7718
  }
7718
7719
  const value = stringFromOwn(input, "value", "input_value", "inputValue");
7719
7720
  const hasJsonValue = hasOwn(input, "value_json") || hasOwn(input, "valueJson") || hasOwn(input, "json");
7720
- if ((type === "fill" || type === "set_input_value") && value === void 0 && !hasJsonValue) {
7721
+ if ((type === "fill" || type === "set_input_value" || type === "set_range_value") && value === void 0 && !hasJsonValue) {
7721
7722
  throw new Error(`target.setup_actions[${index}] ${type} requires value.`);
7722
7723
  }
7723
7724
  const key = stringValue2(input.key);
@@ -12858,6 +12859,58 @@ async function executeSetupAction(action, ordinal, viewport) {
12858
12859
  await locator.nth(targetIndex).fill(value, { timeout });
12859
12860
  return { ...base, ...setupScopeEvidence(scope), ok: true, count, target_index: targetIndex, value_length: value.length };
12860
12861
  }
12862
+ if (type === "set_range_value") {
12863
+ const scope = await setupActionScope(action, timeout);
12864
+ if (!scope.ok) return setupScopeFailure(base, scope);
12865
+ const locator = scope.context.locator(action.selector);
12866
+ const count = await locator.count();
12867
+ if (!count) return { ...base, reason: "selector_not_found", count };
12868
+ const targetIndex = Number.isInteger(action.index) ? action.index : 0;
12869
+ if (targetIndex < 0 || targetIndex >= count) return { ...base, reason: "index_out_of_range", count, target_index: targetIndex };
12870
+ const target = locator.nth(targetIndex);
12871
+ await target.waitFor({ state: "visible", timeout });
12872
+ const requestedValue = setupActionValue(action);
12873
+ const rangeResult = await target.evaluate((element, value) => {
12874
+ const tag = String(element && element.tagName ? element.tagName : "").toLowerCase();
12875
+ const inputType = tag === "input" ? String(element.type || "").toLowerCase() : "";
12876
+ if (tag !== "input" || inputType !== "range") {
12877
+ return { ok: false, reason: "not_range_input", tag, input_type: inputType };
12878
+ }
12879
+ const beforeValue = String(element.value);
12880
+ const valueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set;
12881
+ if (typeof valueSetter === "function") valueSetter.call(element, String(value));
12882
+ else element.value = String(value);
12883
+ element.dispatchEvent(new Event("input", { bubbles: true, composed: true }));
12884
+ element.dispatchEvent(new Event("change", { bubbles: true, composed: true }));
12885
+ const valueAsNumber = Number(element.valueAsNumber);
12886
+ return {
12887
+ ok: true,
12888
+ before_value: beforeValue,
12889
+ actual_value: String(element.value),
12890
+ value_as_number: Number.isFinite(valueAsNumber) ? valueAsNumber : null,
12891
+ min: element.min || null,
12892
+ max: element.max || null,
12893
+ step: element.step || null,
12894
+ };
12895
+ }, requestedValue);
12896
+ return {
12897
+ ...base,
12898
+ ...setupScopeEvidence(scope),
12899
+ ok: rangeResult && rangeResult.ok === true,
12900
+ count,
12901
+ target_index: targetIndex,
12902
+ requested_value: requestedValue,
12903
+ actual_value: rangeResult?.actual_value,
12904
+ before_value: rangeResult?.before_value,
12905
+ value_as_number: rangeResult?.value_as_number,
12906
+ min: rangeResult?.min,
12907
+ max: rangeResult?.max,
12908
+ step: rangeResult?.step,
12909
+ tag: rangeResult?.tag,
12910
+ input_type: rangeResult?.input_type,
12911
+ reason: rangeResult && rangeResult.ok === true ? undefined : rangeResult?.reason || "range_value_not_set",
12912
+ };
12913
+ }
12861
12914
  if (type === "assert_selector_count") {
12862
12915
  const scope = await setupActionScope(action, timeout);
12863
12916
  if (!scope.ok) return setupScopeFailure(base, scope);
package/dist/cli.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  profileStatusExitCode,
14
14
  resolveRiddleProofProfileTargetUrl,
15
15
  resolveRiddleProofProfileTimeoutSec
16
- } from "./chunk-ZC6AK3D3.js";
16
+ } from "./chunk-WAJA6TJV.js";
17
17
  import {
18
18
  createRiddleApiClient,
19
19
  parseRiddleViewport
package/dist/index.cjs CHANGED
@@ -8780,6 +8780,7 @@ var RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES = [
8780
8780
  "press",
8781
8781
  "fill",
8782
8782
  "set_input_value",
8783
+ "set_range_value",
8783
8784
  "assert_text_visible",
8784
8785
  "assert_text_absent",
8785
8786
  "assert_selector_count",
@@ -9371,7 +9372,7 @@ function isSupportedCheckType(value) {
9371
9372
  }
9372
9373
  function normalizeSetupActionType(value, index) {
9373
9374
  const normalizedInput = String(value || "").trim().replace(/-/g, "_");
9374
- const normalized = normalizedInput === "clear_browser_storage" ? "clear_storage" : normalizedInput === "reset_console" || normalizedInput === "clear_browser_console" || normalizedInput === "reset_browser_console" ? "clear_console" : normalizedInput === "pointer_drag" || normalizedInput === "mouse_drag" || normalizedInput === "drag_to" ? "drag" : normalizedInput === "keyboard_press" || normalizedInput === "key_press" ? "press" : normalizedInput === "capture_screenshot" || normalizedInput === "save_screenshot" || normalizedInput === "setup_screenshot" ? "screenshot" : normalizedInput === "accept_dialog" || normalizedInput === "accept_dialogs" || normalizedInput === "confirm_dialog" || normalizedInput === "set_dialog_response" ? "dialog_response" : normalizedInput === "dismiss_dialog" || normalizedInput === "dismiss_dialogs" || normalizedInput === "cancel_dialog" ? "dialog_response" : normalizedInput === "window_call_until" || normalizedInput === "call_until" || normalizedInput === "window_call_repeat_until" || normalizedInput === "repeat_window_call_until" ? "window_call_until" : normalizedInput === "window_evaluate" || normalizedInput === "browser_eval" || normalizedInput === "browser_evaluate" || normalizedInput === "evaluate_script" || normalizedInput === "profile_script" ? "window_eval" : normalizedInput;
9375
+ const normalized = normalizedInput === "clear_browser_storage" ? "clear_storage" : normalizedInput === "reset_console" || normalizedInput === "clear_browser_console" || normalizedInput === "reset_browser_console" ? "clear_console" : normalizedInput === "pointer_drag" || normalizedInput === "mouse_drag" || normalizedInput === "drag_to" ? "drag" : normalizedInput === "keyboard_press" || normalizedInput === "key_press" ? "press" : normalizedInput === "set_slider_value" || normalizedInput === "slider_value" || normalizedInput === "set_slider" || normalizedInput === "set_range" || normalizedInput === "range_value" || normalizedInput === "range_input" || normalizedInput === "set_range_input" ? "set_range_value" : normalizedInput === "capture_screenshot" || normalizedInput === "save_screenshot" || normalizedInput === "setup_screenshot" ? "screenshot" : normalizedInput === "accept_dialog" || normalizedInput === "accept_dialogs" || normalizedInput === "confirm_dialog" || normalizedInput === "set_dialog_response" ? "dialog_response" : normalizedInput === "dismiss_dialog" || normalizedInput === "dismiss_dialogs" || normalizedInput === "cancel_dialog" ? "dialog_response" : normalizedInput === "window_call_until" || normalizedInput === "call_until" || normalizedInput === "window_call_repeat_until" || normalizedInput === "repeat_window_call_until" ? "window_call_until" : normalizedInput === "window_evaluate" || normalizedInput === "browser_eval" || normalizedInput === "browser_evaluate" || normalizedInput === "evaluate_script" || normalizedInput === "profile_script" ? "window_eval" : normalizedInput;
9375
9376
  if (RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES.includes(normalized)) {
9376
9377
  return normalized;
9377
9378
  }
@@ -9469,7 +9470,7 @@ function normalizeSetupAction(input, index) {
9469
9470
  if (frameIndex !== void 0 && (!Number.isInteger(frameIndex) || frameIndex < 0)) {
9470
9471
  throw new Error(`target.setup_actions[${index}].frame_index must be a non-negative integer.`);
9471
9472
  }
9472
- if ((type === "click" || type === "drag" || type === "fill" || type === "set_input_value" || type === "wait_for_selector" || type === "wait_for_text" || type === "assert_text_visible" || type === "assert_text_absent" || type === "assert_selector_count") && !selector) {
9473
+ if ((type === "click" || type === "drag" || type === "fill" || type === "set_input_value" || type === "set_range_value" || type === "wait_for_selector" || type === "wait_for_text" || type === "assert_text_visible" || type === "assert_text_absent" || type === "assert_selector_count") && !selector) {
9473
9474
  throw new Error(`target.setup_actions[${index}] ${type} requires selector.`);
9474
9475
  }
9475
9476
  const fromX = numberValue3(valueFromOwn(input, "from_x", "fromX", "start_x", "startX", "x1"));
@@ -9501,7 +9502,7 @@ function normalizeSetupAction(input, index) {
9501
9502
  }
9502
9503
  const value = stringFromOwn(input, "value", "input_value", "inputValue");
9503
9504
  const hasJsonValue = hasOwn(input, "value_json") || hasOwn(input, "valueJson") || hasOwn(input, "json");
9504
- if ((type === "fill" || type === "set_input_value") && value === void 0 && !hasJsonValue) {
9505
+ if ((type === "fill" || type === "set_input_value" || type === "set_range_value") && value === void 0 && !hasJsonValue) {
9505
9506
  throw new Error(`target.setup_actions[${index}] ${type} requires value.`);
9506
9507
  }
9507
9508
  const key = stringValue5(input.key);
@@ -14658,6 +14659,58 @@ async function executeSetupAction(action, ordinal, viewport) {
14658
14659
  await locator.nth(targetIndex).fill(value, { timeout });
14659
14660
  return { ...base, ...setupScopeEvidence(scope), ok: true, count, target_index: targetIndex, value_length: value.length };
14660
14661
  }
14662
+ if (type === "set_range_value") {
14663
+ const scope = await setupActionScope(action, timeout);
14664
+ if (!scope.ok) return setupScopeFailure(base, scope);
14665
+ const locator = scope.context.locator(action.selector);
14666
+ const count = await locator.count();
14667
+ if (!count) return { ...base, reason: "selector_not_found", count };
14668
+ const targetIndex = Number.isInteger(action.index) ? action.index : 0;
14669
+ if (targetIndex < 0 || targetIndex >= count) return { ...base, reason: "index_out_of_range", count, target_index: targetIndex };
14670
+ const target = locator.nth(targetIndex);
14671
+ await target.waitFor({ state: "visible", timeout });
14672
+ const requestedValue = setupActionValue(action);
14673
+ const rangeResult = await target.evaluate((element, value) => {
14674
+ const tag = String(element && element.tagName ? element.tagName : "").toLowerCase();
14675
+ const inputType = tag === "input" ? String(element.type || "").toLowerCase() : "";
14676
+ if (tag !== "input" || inputType !== "range") {
14677
+ return { ok: false, reason: "not_range_input", tag, input_type: inputType };
14678
+ }
14679
+ const beforeValue = String(element.value);
14680
+ const valueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set;
14681
+ if (typeof valueSetter === "function") valueSetter.call(element, String(value));
14682
+ else element.value = String(value);
14683
+ element.dispatchEvent(new Event("input", { bubbles: true, composed: true }));
14684
+ element.dispatchEvent(new Event("change", { bubbles: true, composed: true }));
14685
+ const valueAsNumber = Number(element.valueAsNumber);
14686
+ return {
14687
+ ok: true,
14688
+ before_value: beforeValue,
14689
+ actual_value: String(element.value),
14690
+ value_as_number: Number.isFinite(valueAsNumber) ? valueAsNumber : null,
14691
+ min: element.min || null,
14692
+ max: element.max || null,
14693
+ step: element.step || null,
14694
+ };
14695
+ }, requestedValue);
14696
+ return {
14697
+ ...base,
14698
+ ...setupScopeEvidence(scope),
14699
+ ok: rangeResult && rangeResult.ok === true,
14700
+ count,
14701
+ target_index: targetIndex,
14702
+ requested_value: requestedValue,
14703
+ actual_value: rangeResult?.actual_value,
14704
+ before_value: rangeResult?.before_value,
14705
+ value_as_number: rangeResult?.value_as_number,
14706
+ min: rangeResult?.min,
14707
+ max: rangeResult?.max,
14708
+ step: rangeResult?.step,
14709
+ tag: rangeResult?.tag,
14710
+ input_type: rangeResult?.input_type,
14711
+ reason: rangeResult && rangeResult.ok === true ? undefined : rangeResult?.reason || "range_value_not_set",
14712
+ };
14713
+ }
14661
14714
  if (type === "assert_selector_count") {
14662
14715
  const scope = await setupActionScope(action, timeout);
14663
14716
  if (!scope.ok) return setupScopeFailure(base, scope);
package/dist/index.js CHANGED
@@ -62,7 +62,7 @@ import {
62
62
  resolveRiddleProofProfileTimeoutSec,
63
63
  slugifyRiddleProofProfileName,
64
64
  summarizeRiddleProofProfileResult
65
- } from "./chunk-ZC6AK3D3.js";
65
+ } from "./chunk-WAJA6TJV.js";
66
66
  import {
67
67
  DEFAULT_RIDDLE_API_BASE_URL,
68
68
  DEFAULT_RIDDLE_API_KEY_FILE,
package/dist/profile.cjs CHANGED
@@ -94,6 +94,7 @@ var RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES = [
94
94
  "press",
95
95
  "fill",
96
96
  "set_input_value",
97
+ "set_range_value",
97
98
  "assert_text_visible",
98
99
  "assert_text_absent",
99
100
  "assert_selector_count",
@@ -685,7 +686,7 @@ function isSupportedCheckType(value) {
685
686
  }
686
687
  function normalizeSetupActionType(value, index) {
687
688
  const normalizedInput = String(value || "").trim().replace(/-/g, "_");
688
- const normalized = normalizedInput === "clear_browser_storage" ? "clear_storage" : normalizedInput === "reset_console" || normalizedInput === "clear_browser_console" || normalizedInput === "reset_browser_console" ? "clear_console" : normalizedInput === "pointer_drag" || normalizedInput === "mouse_drag" || normalizedInput === "drag_to" ? "drag" : normalizedInput === "keyboard_press" || normalizedInput === "key_press" ? "press" : normalizedInput === "capture_screenshot" || normalizedInput === "save_screenshot" || normalizedInput === "setup_screenshot" ? "screenshot" : normalizedInput === "accept_dialog" || normalizedInput === "accept_dialogs" || normalizedInput === "confirm_dialog" || normalizedInput === "set_dialog_response" ? "dialog_response" : normalizedInput === "dismiss_dialog" || normalizedInput === "dismiss_dialogs" || normalizedInput === "cancel_dialog" ? "dialog_response" : normalizedInput === "window_call_until" || normalizedInput === "call_until" || normalizedInput === "window_call_repeat_until" || normalizedInput === "repeat_window_call_until" ? "window_call_until" : normalizedInput === "window_evaluate" || normalizedInput === "browser_eval" || normalizedInput === "browser_evaluate" || normalizedInput === "evaluate_script" || normalizedInput === "profile_script" ? "window_eval" : normalizedInput;
689
+ const normalized = normalizedInput === "clear_browser_storage" ? "clear_storage" : normalizedInput === "reset_console" || normalizedInput === "clear_browser_console" || normalizedInput === "reset_browser_console" ? "clear_console" : normalizedInput === "pointer_drag" || normalizedInput === "mouse_drag" || normalizedInput === "drag_to" ? "drag" : normalizedInput === "keyboard_press" || normalizedInput === "key_press" ? "press" : normalizedInput === "set_slider_value" || normalizedInput === "slider_value" || normalizedInput === "set_slider" || normalizedInput === "set_range" || normalizedInput === "range_value" || normalizedInput === "range_input" || normalizedInput === "set_range_input" ? "set_range_value" : normalizedInput === "capture_screenshot" || normalizedInput === "save_screenshot" || normalizedInput === "setup_screenshot" ? "screenshot" : normalizedInput === "accept_dialog" || normalizedInput === "accept_dialogs" || normalizedInput === "confirm_dialog" || normalizedInput === "set_dialog_response" ? "dialog_response" : normalizedInput === "dismiss_dialog" || normalizedInput === "dismiss_dialogs" || normalizedInput === "cancel_dialog" ? "dialog_response" : normalizedInput === "window_call_until" || normalizedInput === "call_until" || normalizedInput === "window_call_repeat_until" || normalizedInput === "repeat_window_call_until" ? "window_call_until" : normalizedInput === "window_evaluate" || normalizedInput === "browser_eval" || normalizedInput === "browser_evaluate" || normalizedInput === "evaluate_script" || normalizedInput === "profile_script" ? "window_eval" : normalizedInput;
689
690
  if (RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES.includes(normalized)) {
690
691
  return normalized;
691
692
  }
@@ -783,7 +784,7 @@ function normalizeSetupAction(input, index) {
783
784
  if (frameIndex !== void 0 && (!Number.isInteger(frameIndex) || frameIndex < 0)) {
784
785
  throw new Error(`target.setup_actions[${index}].frame_index must be a non-negative integer.`);
785
786
  }
786
- if ((type === "click" || type === "drag" || type === "fill" || type === "set_input_value" || type === "wait_for_selector" || type === "wait_for_text" || type === "assert_text_visible" || type === "assert_text_absent" || type === "assert_selector_count") && !selector) {
787
+ if ((type === "click" || type === "drag" || type === "fill" || type === "set_input_value" || type === "set_range_value" || type === "wait_for_selector" || type === "wait_for_text" || type === "assert_text_visible" || type === "assert_text_absent" || type === "assert_selector_count") && !selector) {
787
788
  throw new Error(`target.setup_actions[${index}] ${type} requires selector.`);
788
789
  }
789
790
  const fromX = numberValue(valueFromOwn(input, "from_x", "fromX", "start_x", "startX", "x1"));
@@ -815,7 +816,7 @@ function normalizeSetupAction(input, index) {
815
816
  }
816
817
  const value = stringFromOwn(input, "value", "input_value", "inputValue");
817
818
  const hasJsonValue = hasOwn(input, "value_json") || hasOwn(input, "valueJson") || hasOwn(input, "json");
818
- if ((type === "fill" || type === "set_input_value") && value === void 0 && !hasJsonValue) {
819
+ if ((type === "fill" || type === "set_input_value" || type === "set_range_value") && value === void 0 && !hasJsonValue) {
819
820
  throw new Error(`target.setup_actions[${index}] ${type} requires value.`);
820
821
  }
821
822
  const key = stringValue(input.key);
@@ -5972,6 +5973,58 @@ async function executeSetupAction(action, ordinal, viewport) {
5972
5973
  await locator.nth(targetIndex).fill(value, { timeout });
5973
5974
  return { ...base, ...setupScopeEvidence(scope), ok: true, count, target_index: targetIndex, value_length: value.length };
5974
5975
  }
5976
+ if (type === "set_range_value") {
5977
+ const scope = await setupActionScope(action, timeout);
5978
+ if (!scope.ok) return setupScopeFailure(base, scope);
5979
+ const locator = scope.context.locator(action.selector);
5980
+ const count = await locator.count();
5981
+ if (!count) return { ...base, reason: "selector_not_found", count };
5982
+ const targetIndex = Number.isInteger(action.index) ? action.index : 0;
5983
+ if (targetIndex < 0 || targetIndex >= count) return { ...base, reason: "index_out_of_range", count, target_index: targetIndex };
5984
+ const target = locator.nth(targetIndex);
5985
+ await target.waitFor({ state: "visible", timeout });
5986
+ const requestedValue = setupActionValue(action);
5987
+ const rangeResult = await target.evaluate((element, value) => {
5988
+ const tag = String(element && element.tagName ? element.tagName : "").toLowerCase();
5989
+ const inputType = tag === "input" ? String(element.type || "").toLowerCase() : "";
5990
+ if (tag !== "input" || inputType !== "range") {
5991
+ return { ok: false, reason: "not_range_input", tag, input_type: inputType };
5992
+ }
5993
+ const beforeValue = String(element.value);
5994
+ const valueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set;
5995
+ if (typeof valueSetter === "function") valueSetter.call(element, String(value));
5996
+ else element.value = String(value);
5997
+ element.dispatchEvent(new Event("input", { bubbles: true, composed: true }));
5998
+ element.dispatchEvent(new Event("change", { bubbles: true, composed: true }));
5999
+ const valueAsNumber = Number(element.valueAsNumber);
6000
+ return {
6001
+ ok: true,
6002
+ before_value: beforeValue,
6003
+ actual_value: String(element.value),
6004
+ value_as_number: Number.isFinite(valueAsNumber) ? valueAsNumber : null,
6005
+ min: element.min || null,
6006
+ max: element.max || null,
6007
+ step: element.step || null,
6008
+ };
6009
+ }, requestedValue);
6010
+ return {
6011
+ ...base,
6012
+ ...setupScopeEvidence(scope),
6013
+ ok: rangeResult && rangeResult.ok === true,
6014
+ count,
6015
+ target_index: targetIndex,
6016
+ requested_value: requestedValue,
6017
+ actual_value: rangeResult?.actual_value,
6018
+ before_value: rangeResult?.before_value,
6019
+ value_as_number: rangeResult?.value_as_number,
6020
+ min: rangeResult?.min,
6021
+ max: rangeResult?.max,
6022
+ step: rangeResult?.step,
6023
+ tag: rangeResult?.tag,
6024
+ input_type: rangeResult?.input_type,
6025
+ reason: rangeResult && rangeResult.ok === true ? undefined : rangeResult?.reason || "range_value_not_set",
6026
+ };
6027
+ }
5975
6028
  if (type === "assert_selector_count") {
5976
6029
  const scope = await setupActionScope(action, timeout);
5977
6030
  if (!scope.ok) return setupScopeFailure(base, scope);
@@ -5,7 +5,7 @@ declare const RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION: "riddle-proof.profile-evide
5
5
  declare const RIDDLE_PROOF_PROFILE_RESULT_VERSION: "riddle-proof.profile-result.v1";
6
6
  declare const RIDDLE_PROOF_PROFILE_STATUSES: readonly ["passed", "product_regression", "proof_insufficient", "environment_blocked", "configuration_error", "needs_human_review"];
7
7
  declare const RIDDLE_PROOF_PROFILE_CHECK_TYPES: readonly ["route_loaded", "url_search_param_equals", "url_search_param_absent", "selector_visible", "selector_absent", "selector_count_at_least", "selector_count_equals", "selector_count_equal", "selector_count_eq", "dialog_count_equals", "dialog_accept_count_equals", "dialog_dismiss_count_equals", "selector_text_visible", "selector_text_absent", "selector_text_order", "frame_text_visible", "frame_url_equals", "frame_url_matches", "frame_no_horizontal_overflow", "text_visible", "text_absent", "http_status", "link_status", "artifact_link_status", "route_inventory", "no_horizontal_overflow", "no_mobile_horizontal_overflow", "no_fatal_console_errors", "no_console_warnings"];
8
- declare const RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES: readonly ["click", "drag", "press", "fill", "set_input_value", "assert_text_visible", "assert_text_absent", "assert_selector_count", "assert_window_value", "assert_window_number", "local_storage", "session_storage", "clear_storage", "clear_console", "dialog_response", "screenshot", "wait", "wait_for_selector", "wait_for_text", "window_eval", "window_call", "window_call_until"];
8
+ declare const RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES: readonly ["click", "drag", "press", "fill", "set_input_value", "set_range_value", "assert_text_visible", "assert_text_absent", "assert_selector_count", "assert_window_value", "assert_window_number", "local_storage", "session_storage", "clear_storage", "clear_console", "dialog_response", "screenshot", "wait", "wait_for_selector", "wait_for_text", "window_eval", "window_call", "window_call_until"];
9
9
  type RiddleProofProfileStatus = typeof RIDDLE_PROOF_PROFILE_STATUSES[number];
10
10
  type RiddleProofProfileCheckType = typeof RIDDLE_PROOF_PROFILE_CHECK_TYPES[number];
11
11
  type RiddleProofProfileSetupActionType = typeof RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES[number];
package/dist/profile.d.ts CHANGED
@@ -5,7 +5,7 @@ declare const RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION: "riddle-proof.profile-evide
5
5
  declare const RIDDLE_PROOF_PROFILE_RESULT_VERSION: "riddle-proof.profile-result.v1";
6
6
  declare const RIDDLE_PROOF_PROFILE_STATUSES: readonly ["passed", "product_regression", "proof_insufficient", "environment_blocked", "configuration_error", "needs_human_review"];
7
7
  declare const RIDDLE_PROOF_PROFILE_CHECK_TYPES: readonly ["route_loaded", "url_search_param_equals", "url_search_param_absent", "selector_visible", "selector_absent", "selector_count_at_least", "selector_count_equals", "selector_count_equal", "selector_count_eq", "dialog_count_equals", "dialog_accept_count_equals", "dialog_dismiss_count_equals", "selector_text_visible", "selector_text_absent", "selector_text_order", "frame_text_visible", "frame_url_equals", "frame_url_matches", "frame_no_horizontal_overflow", "text_visible", "text_absent", "http_status", "link_status", "artifact_link_status", "route_inventory", "no_horizontal_overflow", "no_mobile_horizontal_overflow", "no_fatal_console_errors", "no_console_warnings"];
8
- declare const RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES: readonly ["click", "drag", "press", "fill", "set_input_value", "assert_text_visible", "assert_text_absent", "assert_selector_count", "assert_window_value", "assert_window_number", "local_storage", "session_storage", "clear_storage", "clear_console", "dialog_response", "screenshot", "wait", "wait_for_selector", "wait_for_text", "window_eval", "window_call", "window_call_until"];
8
+ declare const RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES: readonly ["click", "drag", "press", "fill", "set_input_value", "set_range_value", "assert_text_visible", "assert_text_absent", "assert_selector_count", "assert_window_value", "assert_window_number", "local_storage", "session_storage", "clear_storage", "clear_console", "dialog_response", "screenshot", "wait", "wait_for_selector", "wait_for_text", "window_eval", "window_call", "window_call_until"];
9
9
  type RiddleProofProfileStatus = typeof RIDDLE_PROOF_PROFILE_STATUSES[number];
10
10
  type RiddleProofProfileCheckType = typeof RIDDLE_PROOF_PROFILE_CHECK_TYPES[number];
11
11
  type RiddleProofProfileSetupActionType = typeof RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES[number];
package/dist/profile.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  resolveRiddleProofProfileTimeoutSec,
24
24
  slugifyRiddleProofProfileName,
25
25
  summarizeRiddleProofProfileResult
26
- } from "./chunk-ZC6AK3D3.js";
26
+ } from "./chunk-WAJA6TJV.js";
27
27
  export {
28
28
  RIDDLE_PROOF_PROFILE_CHECK_TYPES,
29
29
  RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/riddle-proof",
3
- "version": "0.7.147",
3
+ "version": "0.7.148",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",