@riddledc/riddle-proof 0.7.57 → 0.7.58

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
@@ -240,7 +240,7 @@ where the second request must carry newer state.
240
240
  `target.setup_actions` is optional. Use it when the meaningful proof surface
241
241
  appears only after a picker, tab, login stub, storage seed, form fill,
242
242
  transport control, or other bounded interaction. Supported setup actions are
243
- `click`, `fill`, `set_input_value`, `assert_text_visible`,
243
+ `click`, `press`, `fill`, `set_input_value`, `assert_text_visible`,
244
244
  `assert_text_absent`, `assert_selector_count`, `assert_window_value`,
245
245
  `assert_window_number`, `local_storage`, `session_storage`, `clear_storage`, `wait`,
246
246
  `wait_for_selector`, `wait_for_text`, and `window_call`; a failed setup action
@@ -249,8 +249,11 @@ pass without reaching the intended state. Text-matched `click` actions prefer
249
249
  visible matching elements, which keeps responsive layouts from selecting hidden
250
250
  desktop or mobile-only links. Add `force: true` to a click action only when the
251
251
  matched visible element is intentionally animated or otherwise never becomes
252
- stable enough for Playwright's default click actionability checks. Use setup
253
- assertions when the pre-click or pre-navigation state is part of the contract,
252
+ stable enough for Playwright's default click actionability checks. Use `press`
253
+ with a Playwright key name, such as `Enter`, `Space`, or `ArrowLeft`,
254
+ when a route's intended browser control is keyboard-driven; omit `selector` for
255
+ a page-level key press, or provide `selector` to press against a focused element.
256
+ Use setup assertions when the pre-click or pre-navigation state is part of the contract,
254
257
  for example a fresh row must be present, stale copy must be absent, exactly one
255
258
  source link must exist before clicking into the final route, or a canvas app's
256
259
  proof state must expose a terminal flag. `assert_selector_count` accepts
@@ -32,6 +32,7 @@ var RIDDLE_PROOF_PROFILE_CHECK_TYPES = [
32
32
  ];
33
33
  var RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES = [
34
34
  "click",
35
+ "press",
35
36
  "fill",
36
37
  "set_input_value",
37
38
  "assert_text_visible",
@@ -201,7 +202,7 @@ function isSupportedCheckType(value) {
201
202
  }
202
203
  function normalizeSetupActionType(value, index) {
203
204
  const normalizedInput = String(value || "").trim().replace(/-/g, "_");
204
- const normalized = normalizedInput === "clear_browser_storage" ? "clear_storage" : normalizedInput;
205
+ const normalized = normalizedInput === "clear_browser_storage" ? "clear_storage" : normalizedInput === "keyboard_press" || normalizedInput === "key_press" ? "press" : normalizedInput;
205
206
  if (RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES.includes(normalized)) {
206
207
  return normalized;
207
208
  }
@@ -254,6 +255,9 @@ function normalizeSetupAction(input, index) {
254
255
  throw new Error(`target.setup_actions[${index}] ${type} requires value.`);
255
256
  }
256
257
  const key = stringValue(input.key);
258
+ if (type === "press" && !key) {
259
+ throw new Error(`target.setup_actions[${index}] ${type} requires key.`);
260
+ }
257
261
  if ((type === "local_storage" || type === "session_storage") && !key) {
258
262
  throw new Error(`target.setup_actions[${index}] ${type} requires key.`);
259
263
  }
@@ -2344,6 +2348,21 @@ async function executeSetupAction(action, ordinal) {
2344
2348
  await page.waitForSelector(action.selector, { state: "visible", timeout });
2345
2349
  return { ...base, ok: true, timeout_ms: timeout };
2346
2350
  }
2351
+ if (type === "press") {
2352
+ const key = String(action.key || "").trim();
2353
+ if (!key) return { ...base, reason: "missing_key" };
2354
+ if (!action.selector) {
2355
+ await page.keyboard.press(key);
2356
+ return { ...base, ok: true, key };
2357
+ }
2358
+ const locator = page.locator(action.selector);
2359
+ const count = await locator.count();
2360
+ if (!count) return { ...base, reason: "selector_not_found", count, key };
2361
+ const targetIndex = Number.isInteger(action.index) ? action.index : 0;
2362
+ if (targetIndex < 0 || targetIndex >= count) return { ...base, reason: "index_out_of_range", count, target_index: targetIndex, key };
2363
+ await locator.nth(targetIndex).press(key, { timeout });
2364
+ return { ...base, ok: true, count, target_index: targetIndex, key };
2365
+ }
2347
2366
  if (type === "local_storage" || type === "session_storage") {
2348
2367
  const value = setupActionValue(action);
2349
2368
  await page.evaluate(({ type, key, value }) => {
package/dist/cli.cjs CHANGED
@@ -6905,6 +6905,7 @@ var RIDDLE_PROOF_PROFILE_CHECK_TYPES = [
6905
6905
  ];
6906
6906
  var RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES = [
6907
6907
  "click",
6908
+ "press",
6908
6909
  "fill",
6909
6910
  "set_input_value",
6910
6911
  "assert_text_visible",
@@ -7074,7 +7075,7 @@ function isSupportedCheckType(value) {
7074
7075
  }
7075
7076
  function normalizeSetupActionType(value, index) {
7076
7077
  const normalizedInput = String(value || "").trim().replace(/-/g, "_");
7077
- const normalized = normalizedInput === "clear_browser_storage" ? "clear_storage" : normalizedInput;
7078
+ const normalized = normalizedInput === "clear_browser_storage" ? "clear_storage" : normalizedInput === "keyboard_press" || normalizedInput === "key_press" ? "press" : normalizedInput;
7078
7079
  if (RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES.includes(normalized)) {
7079
7080
  return normalized;
7080
7081
  }
@@ -7127,6 +7128,9 @@ function normalizeSetupAction(input, index) {
7127
7128
  throw new Error(`target.setup_actions[${index}] ${type} requires value.`);
7128
7129
  }
7129
7130
  const key = stringValue2(input.key);
7131
+ if (type === "press" && !key) {
7132
+ throw new Error(`target.setup_actions[${index}] ${type} requires key.`);
7133
+ }
7130
7134
  if ((type === "local_storage" || type === "session_storage") && !key) {
7131
7135
  throw new Error(`target.setup_actions[${index}] ${type} requires key.`);
7132
7136
  }
@@ -9201,6 +9205,21 @@ async function executeSetupAction(action, ordinal) {
9201
9205
  await page.waitForSelector(action.selector, { state: "visible", timeout });
9202
9206
  return { ...base, ok: true, timeout_ms: timeout };
9203
9207
  }
9208
+ if (type === "press") {
9209
+ const key = String(action.key || "").trim();
9210
+ if (!key) return { ...base, reason: "missing_key" };
9211
+ if (!action.selector) {
9212
+ await page.keyboard.press(key);
9213
+ return { ...base, ok: true, key };
9214
+ }
9215
+ const locator = page.locator(action.selector);
9216
+ const count = await locator.count();
9217
+ if (!count) return { ...base, reason: "selector_not_found", count, key };
9218
+ const targetIndex = Number.isInteger(action.index) ? action.index : 0;
9219
+ if (targetIndex < 0 || targetIndex >= count) return { ...base, reason: "index_out_of_range", count, target_index: targetIndex, key };
9220
+ await locator.nth(targetIndex).press(key, { timeout });
9221
+ return { ...base, ok: true, count, target_index: targetIndex, key };
9222
+ }
9204
9223
  if (type === "local_storage" || type === "session_storage") {
9205
9224
  const value = setupActionValue(action);
9206
9225
  await page.evaluate(({ type, key, value }) => {
package/dist/cli.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  profileStatusExitCode,
11
11
  resolveRiddleProofProfileTargetUrl,
12
12
  resolveRiddleProofProfileTimeoutSec
13
- } from "./chunk-H5LDZKGN.js";
13
+ } from "./chunk-7ZBK2GQX.js";
14
14
  import {
15
15
  createRiddleApiClient,
16
16
  parseRiddleViewport
package/dist/index.cjs CHANGED
@@ -8746,6 +8746,7 @@ var RIDDLE_PROOF_PROFILE_CHECK_TYPES = [
8746
8746
  ];
8747
8747
  var RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES = [
8748
8748
  "click",
8749
+ "press",
8749
8750
  "fill",
8750
8751
  "set_input_value",
8751
8752
  "assert_text_visible",
@@ -8915,7 +8916,7 @@ function isSupportedCheckType(value) {
8915
8916
  }
8916
8917
  function normalizeSetupActionType(value, index) {
8917
8918
  const normalizedInput = String(value || "").trim().replace(/-/g, "_");
8918
- const normalized = normalizedInput === "clear_browser_storage" ? "clear_storage" : normalizedInput;
8919
+ const normalized = normalizedInput === "clear_browser_storage" ? "clear_storage" : normalizedInput === "keyboard_press" || normalizedInput === "key_press" ? "press" : normalizedInput;
8919
8920
  if (RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES.includes(normalized)) {
8920
8921
  return normalized;
8921
8922
  }
@@ -8968,6 +8969,9 @@ function normalizeSetupAction(input, index) {
8968
8969
  throw new Error(`target.setup_actions[${index}] ${type} requires value.`);
8969
8970
  }
8970
8971
  const key = stringValue5(input.key);
8972
+ if (type === "press" && !key) {
8973
+ throw new Error(`target.setup_actions[${index}] ${type} requires key.`);
8974
+ }
8971
8975
  if ((type === "local_storage" || type === "session_storage") && !key) {
8972
8976
  throw new Error(`target.setup_actions[${index}] ${type} requires key.`);
8973
8977
  }
@@ -11058,6 +11062,21 @@ async function executeSetupAction(action, ordinal) {
11058
11062
  await page.waitForSelector(action.selector, { state: "visible", timeout });
11059
11063
  return { ...base, ok: true, timeout_ms: timeout };
11060
11064
  }
11065
+ if (type === "press") {
11066
+ const key = String(action.key || "").trim();
11067
+ if (!key) return { ...base, reason: "missing_key" };
11068
+ if (!action.selector) {
11069
+ await page.keyboard.press(key);
11070
+ return { ...base, ok: true, key };
11071
+ }
11072
+ const locator = page.locator(action.selector);
11073
+ const count = await locator.count();
11074
+ if (!count) return { ...base, reason: "selector_not_found", count, key };
11075
+ const targetIndex = Number.isInteger(action.index) ? action.index : 0;
11076
+ if (targetIndex < 0 || targetIndex >= count) return { ...base, reason: "index_out_of_range", count, target_index: targetIndex, key };
11077
+ await locator.nth(targetIndex).press(key, { timeout });
11078
+ return { ...base, ok: true, count, target_index: targetIndex, key };
11079
+ }
11061
11080
  if (type === "local_storage" || type === "session_storage") {
11062
11081
  const value = setupActionValue(action);
11063
11082
  await page.evaluate(({ type, key, value }) => {
package/dist/index.js CHANGED
@@ -58,7 +58,7 @@ import {
58
58
  resolveRiddleProofProfileTimeoutSec,
59
59
  slugifyRiddleProofProfileName,
60
60
  summarizeRiddleProofProfileResult
61
- } from "./chunk-H5LDZKGN.js";
61
+ } from "./chunk-7ZBK2GQX.js";
62
62
  import {
63
63
  DEFAULT_RIDDLE_API_BASE_URL,
64
64
  DEFAULT_RIDDLE_API_KEY_FILE,
package/dist/profile.cjs CHANGED
@@ -75,6 +75,7 @@ var RIDDLE_PROOF_PROFILE_CHECK_TYPES = [
75
75
  ];
76
76
  var RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES = [
77
77
  "click",
78
+ "press",
78
79
  "fill",
79
80
  "set_input_value",
80
81
  "assert_text_visible",
@@ -244,7 +245,7 @@ function isSupportedCheckType(value) {
244
245
  }
245
246
  function normalizeSetupActionType(value, index) {
246
247
  const normalizedInput = String(value || "").trim().replace(/-/g, "_");
247
- const normalized = normalizedInput === "clear_browser_storage" ? "clear_storage" : normalizedInput;
248
+ const normalized = normalizedInput === "clear_browser_storage" ? "clear_storage" : normalizedInput === "keyboard_press" || normalizedInput === "key_press" ? "press" : normalizedInput;
248
249
  if (RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES.includes(normalized)) {
249
250
  return normalized;
250
251
  }
@@ -297,6 +298,9 @@ function normalizeSetupAction(input, index) {
297
298
  throw new Error(`target.setup_actions[${index}] ${type} requires value.`);
298
299
  }
299
300
  const key = stringValue(input.key);
301
+ if (type === "press" && !key) {
302
+ throw new Error(`target.setup_actions[${index}] ${type} requires key.`);
303
+ }
300
304
  if ((type === "local_storage" || type === "session_storage") && !key) {
301
305
  throw new Error(`target.setup_actions[${index}] ${type} requires key.`);
302
306
  }
@@ -2387,6 +2391,21 @@ async function executeSetupAction(action, ordinal) {
2387
2391
  await page.waitForSelector(action.selector, { state: "visible", timeout });
2388
2392
  return { ...base, ok: true, timeout_ms: timeout };
2389
2393
  }
2394
+ if (type === "press") {
2395
+ const key = String(action.key || "").trim();
2396
+ if (!key) return { ...base, reason: "missing_key" };
2397
+ if (!action.selector) {
2398
+ await page.keyboard.press(key);
2399
+ return { ...base, ok: true, key };
2400
+ }
2401
+ const locator = page.locator(action.selector);
2402
+ const count = await locator.count();
2403
+ if (!count) return { ...base, reason: "selector_not_found", count, key };
2404
+ const targetIndex = Number.isInteger(action.index) ? action.index : 0;
2405
+ if (targetIndex < 0 || targetIndex >= count) return { ...base, reason: "index_out_of_range", count, target_index: targetIndex, key };
2406
+ await locator.nth(targetIndex).press(key, { timeout });
2407
+ return { ...base, ok: true, count, target_index: targetIndex, key };
2408
+ }
2390
2409
  if (type === "local_storage" || type === "session_storage") {
2391
2410
  const value = setupActionValue(action);
2392
2411
  await page.evaluate(({ type, key, value }) => {
@@ -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", "selector_text_order", "frame_text_visible", "frame_no_horizontal_overflow", "text_visible", "text_absent", "route_inventory", "no_horizontal_overflow", "no_mobile_horizontal_overflow", "no_fatal_console_errors"];
8
- declare const RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES: readonly ["click", "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", "wait", "wait_for_selector", "wait_for_text", "window_call"];
8
+ declare const RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES: readonly ["click", "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", "wait", "wait_for_selector", "wait_for_text", "window_call"];
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", "selector_text_order", "frame_text_visible", "frame_no_horizontal_overflow", "text_visible", "text_absent", "route_inventory", "no_horizontal_overflow", "no_mobile_horizontal_overflow", "no_fatal_console_errors"];
8
- declare const RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES: readonly ["click", "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", "wait", "wait_for_selector", "wait_for_text", "window_call"];
8
+ declare const RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES: readonly ["click", "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", "wait", "wait_for_selector", "wait_for_text", "window_call"];
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
@@ -19,7 +19,7 @@ import {
19
19
  resolveRiddleProofProfileTimeoutSec,
20
20
  slugifyRiddleProofProfileName,
21
21
  summarizeRiddleProofProfileResult
22
- } from "./chunk-H5LDZKGN.js";
22
+ } from "./chunk-7ZBK2GQX.js";
23
23
  export {
24
24
  RIDDLE_PROOF_PROFILE_CHECK_TYPES,
25
25
  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.57",
3
+ "version": "0.7.58",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",