@riddledc/riddle-proof 0.7.68 → 0.7.69

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
@@ -272,6 +272,10 @@ stable enough for Playwright's default click actionability checks. Use `press`
272
272
  with a Playwright key name, such as `Enter`, `Space`, or `ArrowLeft`,
273
273
  when a route's intended browser control is keyboard-driven; omit `selector` for
274
274
  a page-level key press, or provide `selector` to press against a focused element.
275
+ Use `click_count` / `clickCount` / `clicks` from 1 to 10 on a single `click`
276
+ action for atomic double-click or double-submit contracts where modeling the
277
+ interaction as repeated setup actions would incorrectly require the target to
278
+ remain in the DOM after the first click.
275
279
  Use `drag` for pointer-driven controls such as canvas launch areas, sliders, or
276
280
  drag-to-aim games. Provide `selector`, `from_x`, `from_y`, `to_x`, and `to_y`;
277
281
  coordinates are element-relative pixels by default. Set `coordinate_mode:
@@ -329,6 +329,18 @@ function normalizeSetupActionRepeat(input, index) {
329
329
  }
330
330
  return repeat;
331
331
  }
332
+ function normalizeSetupActionClickCount(input, type, index) {
333
+ const clickCountInput = valueFromOwn(input, "click_count", "clickCount", "clicks");
334
+ if (clickCountInput === void 0) return void 0;
335
+ if (type !== "click") {
336
+ throw new Error(`target.setup_actions[${index}].click_count is only supported for click actions.`);
337
+ }
338
+ const clickCount = numberValue(clickCountInput);
339
+ if (clickCount === void 0 || !Number.isInteger(clickCount) || clickCount < 1 || clickCount > 10) {
340
+ throw new Error(`target.setup_actions[${index}].click_count must be an integer from 1 to 10.`);
341
+ }
342
+ return clickCount;
343
+ }
332
344
  function normalizeSetupActionCoordinateMode(value, index) {
333
345
  if (value === void 0 || value === null || value === "") return void 0;
334
346
  const normalized = String(value).trim().replace(/-/g, "_").toLowerCase();
@@ -420,6 +432,7 @@ function normalizeSetupAction(input, index) {
420
432
  frame_selector: frameSelector,
421
433
  frame_index: frameIndex,
422
434
  force: type === "click" && (input.force === true || input.force_click === true || input.forceClick === true),
435
+ click_count: normalizeSetupActionClickCount(input, type, index),
423
436
  coordinate_mode: coordinateMode,
424
437
  from_x: fromX,
425
438
  from_y: fromY,
@@ -3118,8 +3131,10 @@ async function executeSetupAction(action, ordinal, viewport) {
3118
3131
  const clickOptions = action.force === true
3119
3132
  ? { timeout, noWaitAfter: true, force: true }
3120
3133
  : { timeout, noWaitAfter: true };
3134
+ const clickCount = setupNumber(action.click_count, 1);
3135
+ if (Number.isInteger(clickCount) && clickCount > 1) clickOptions.clickCount = clickCount;
3121
3136
  await locator.nth(targetIndex).click(clickOptions);
3122
- return { ...base, ...setupScopeEvidence(scope), ok: true, count, target_index: targetIndex, text: matchedText, force: action.force === true || undefined };
3137
+ return { ...base, ...setupScopeEvidence(scope), ok: true, count, target_index: targetIndex, text: matchedText, force: action.force === true || undefined, click_count: clickCount > 1 ? clickCount : undefined };
3123
3138
  }
3124
3139
  if (type === "fill" || type === "set_input_value") {
3125
3140
  const scope = await setupActionScope(action, timeout);
package/dist/cli.cjs CHANGED
@@ -7202,6 +7202,18 @@ function normalizeSetupActionRepeat(input, index) {
7202
7202
  }
7203
7203
  return repeat;
7204
7204
  }
7205
+ function normalizeSetupActionClickCount(input, type, index) {
7206
+ const clickCountInput = valueFromOwn(input, "click_count", "clickCount", "clicks");
7207
+ if (clickCountInput === void 0) return void 0;
7208
+ if (type !== "click") {
7209
+ throw new Error(`target.setup_actions[${index}].click_count is only supported for click actions.`);
7210
+ }
7211
+ const clickCount = numberValue(clickCountInput);
7212
+ if (clickCount === void 0 || !Number.isInteger(clickCount) || clickCount < 1 || clickCount > 10) {
7213
+ throw new Error(`target.setup_actions[${index}].click_count must be an integer from 1 to 10.`);
7214
+ }
7215
+ return clickCount;
7216
+ }
7205
7217
  function normalizeSetupActionCoordinateMode(value, index) {
7206
7218
  if (value === void 0 || value === null || value === "") return void 0;
7207
7219
  const normalized = String(value).trim().replace(/-/g, "_").toLowerCase();
@@ -7293,6 +7305,7 @@ function normalizeSetupAction(input, index) {
7293
7305
  frame_selector: frameSelector,
7294
7306
  frame_index: frameIndex,
7295
7307
  force: type === "click" && (input.force === true || input.force_click === true || input.forceClick === true),
7308
+ click_count: normalizeSetupActionClickCount(input, type, index),
7296
7309
  coordinate_mode: coordinateMode,
7297
7310
  from_x: fromX,
7298
7311
  from_y: fromY,
@@ -9975,8 +9988,10 @@ async function executeSetupAction(action, ordinal, viewport) {
9975
9988
  const clickOptions = action.force === true
9976
9989
  ? { timeout, noWaitAfter: true, force: true }
9977
9990
  : { timeout, noWaitAfter: true };
9991
+ const clickCount = setupNumber(action.click_count, 1);
9992
+ if (Number.isInteger(clickCount) && clickCount > 1) clickOptions.clickCount = clickCount;
9978
9993
  await locator.nth(targetIndex).click(clickOptions);
9979
- return { ...base, ...setupScopeEvidence(scope), ok: true, count, target_index: targetIndex, text: matchedText, force: action.force === true || undefined };
9994
+ return { ...base, ...setupScopeEvidence(scope), ok: true, count, target_index: targetIndex, text: matchedText, force: action.force === true || undefined, click_count: clickCount > 1 ? clickCount : undefined };
9980
9995
  }
9981
9996
  if (type === "fill" || type === "set_input_value") {
9982
9997
  const scope = await setupActionScope(action, timeout);
package/dist/cli.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  profileStatusExitCode,
11
11
  resolveRiddleProofProfileTargetUrl,
12
12
  resolveRiddleProofProfileTimeoutSec
13
- } from "./chunk-376FPGFA.js";
13
+ } from "./chunk-ZQPC7PYM.js";
14
14
  import {
15
15
  createRiddleApiClient,
16
16
  parseRiddleViewport
package/dist/index.cjs CHANGED
@@ -9043,6 +9043,18 @@ function normalizeSetupActionRepeat(input, index) {
9043
9043
  }
9044
9044
  return repeat;
9045
9045
  }
9046
+ function normalizeSetupActionClickCount(input, type, index) {
9047
+ const clickCountInput = valueFromOwn(input, "click_count", "clickCount", "clicks");
9048
+ if (clickCountInput === void 0) return void 0;
9049
+ if (type !== "click") {
9050
+ throw new Error(`target.setup_actions[${index}].click_count is only supported for click actions.`);
9051
+ }
9052
+ const clickCount = numberValue3(clickCountInput);
9053
+ if (clickCount === void 0 || !Number.isInteger(clickCount) || clickCount < 1 || clickCount > 10) {
9054
+ throw new Error(`target.setup_actions[${index}].click_count must be an integer from 1 to 10.`);
9055
+ }
9056
+ return clickCount;
9057
+ }
9046
9058
  function normalizeSetupActionCoordinateMode(value, index) {
9047
9059
  if (value === void 0 || value === null || value === "") return void 0;
9048
9060
  const normalized = String(value).trim().replace(/-/g, "_").toLowerCase();
@@ -9134,6 +9146,7 @@ function normalizeSetupAction(input, index) {
9134
9146
  frame_selector: frameSelector,
9135
9147
  frame_index: frameIndex,
9136
9148
  force: type === "click" && (input.force === true || input.force_click === true || input.forceClick === true),
9149
+ click_count: normalizeSetupActionClickCount(input, type, index),
9137
9150
  coordinate_mode: coordinateMode,
9138
9151
  from_x: fromX,
9139
9152
  from_y: fromY,
@@ -11832,8 +11845,10 @@ async function executeSetupAction(action, ordinal, viewport) {
11832
11845
  const clickOptions = action.force === true
11833
11846
  ? { timeout, noWaitAfter: true, force: true }
11834
11847
  : { timeout, noWaitAfter: true };
11848
+ const clickCount = setupNumber(action.click_count, 1);
11849
+ if (Number.isInteger(clickCount) && clickCount > 1) clickOptions.clickCount = clickCount;
11835
11850
  await locator.nth(targetIndex).click(clickOptions);
11836
- return { ...base, ...setupScopeEvidence(scope), ok: true, count, target_index: targetIndex, text: matchedText, force: action.force === true || undefined };
11851
+ return { ...base, ...setupScopeEvidence(scope), ok: true, count, target_index: targetIndex, text: matchedText, force: action.force === true || undefined, click_count: clickCount > 1 ? clickCount : undefined };
11837
11852
  }
11838
11853
  if (type === "fill" || type === "set_input_value") {
11839
11854
  const scope = await setupActionScope(action, timeout);
package/dist/index.js CHANGED
@@ -58,7 +58,7 @@ import {
58
58
  resolveRiddleProofProfileTimeoutSec,
59
59
  slugifyRiddleProofProfileName,
60
60
  summarizeRiddleProofProfileResult
61
- } from "./chunk-376FPGFA.js";
61
+ } from "./chunk-ZQPC7PYM.js";
62
62
  import {
63
63
  DEFAULT_RIDDLE_API_BASE_URL,
64
64
  DEFAULT_RIDDLE_API_KEY_FILE,
package/dist/profile.cjs CHANGED
@@ -372,6 +372,18 @@ function normalizeSetupActionRepeat(input, index) {
372
372
  }
373
373
  return repeat;
374
374
  }
375
+ function normalizeSetupActionClickCount(input, type, index) {
376
+ const clickCountInput = valueFromOwn(input, "click_count", "clickCount", "clicks");
377
+ if (clickCountInput === void 0) return void 0;
378
+ if (type !== "click") {
379
+ throw new Error(`target.setup_actions[${index}].click_count is only supported for click actions.`);
380
+ }
381
+ const clickCount = numberValue(clickCountInput);
382
+ if (clickCount === void 0 || !Number.isInteger(clickCount) || clickCount < 1 || clickCount > 10) {
383
+ throw new Error(`target.setup_actions[${index}].click_count must be an integer from 1 to 10.`);
384
+ }
385
+ return clickCount;
386
+ }
375
387
  function normalizeSetupActionCoordinateMode(value, index) {
376
388
  if (value === void 0 || value === null || value === "") return void 0;
377
389
  const normalized = String(value).trim().replace(/-/g, "_").toLowerCase();
@@ -463,6 +475,7 @@ function normalizeSetupAction(input, index) {
463
475
  frame_selector: frameSelector,
464
476
  frame_index: frameIndex,
465
477
  force: type === "click" && (input.force === true || input.force_click === true || input.forceClick === true),
478
+ click_count: normalizeSetupActionClickCount(input, type, index),
466
479
  coordinate_mode: coordinateMode,
467
480
  from_x: fromX,
468
481
  from_y: fromY,
@@ -3161,8 +3174,10 @@ async function executeSetupAction(action, ordinal, viewport) {
3161
3174
  const clickOptions = action.force === true
3162
3175
  ? { timeout, noWaitAfter: true, force: true }
3163
3176
  : { timeout, noWaitAfter: true };
3177
+ const clickCount = setupNumber(action.click_count, 1);
3178
+ if (Number.isInteger(clickCount) && clickCount > 1) clickOptions.clickCount = clickCount;
3164
3179
  await locator.nth(targetIndex).click(clickOptions);
3165
- return { ...base, ...setupScopeEvidence(scope), ok: true, count, target_index: targetIndex, text: matchedText, force: action.force === true || undefined };
3180
+ return { ...base, ...setupScopeEvidence(scope), ok: true, count, target_index: targetIndex, text: matchedText, force: action.force === true || undefined, click_count: clickCount > 1 ? clickCount : undefined };
3166
3181
  }
3167
3182
  if (type === "fill" || type === "set_input_value") {
3168
3183
  const scope = await setupActionScope(action, timeout);
@@ -23,6 +23,7 @@ interface RiddleProofProfileSetupAction {
23
23
  frame_selector?: string;
24
24
  frame_index?: number;
25
25
  force?: boolean;
26
+ click_count?: number;
26
27
  coordinate_mode?: "pixels" | "ratio";
27
28
  from_x?: number;
28
29
  from_y?: number;
package/dist/profile.d.ts CHANGED
@@ -23,6 +23,7 @@ interface RiddleProofProfileSetupAction {
23
23
  frame_selector?: string;
24
24
  frame_index?: number;
25
25
  force?: boolean;
26
+ click_count?: number;
26
27
  coordinate_mode?: "pixels" | "ratio";
27
28
  from_x?: number;
28
29
  from_y?: number;
package/dist/profile.js CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  resolveRiddleProofProfileTimeoutSec,
20
20
  slugifyRiddleProofProfileName,
21
21
  summarizeRiddleProofProfileResult
22
- } from "./chunk-376FPGFA.js";
22
+ } from "./chunk-ZQPC7PYM.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.68",
3
+ "version": "0.7.69",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",