@riddledc/riddle-proof 0.7.172 → 0.7.174

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/dist/cli.cjs CHANGED
@@ -7001,6 +7001,7 @@ var RIDDLE_PROOF_PROFILE_CHECK_TYPES = [
7001
7001
  ];
7002
7002
  var RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES = [
7003
7003
  "click",
7004
+ "tap",
7004
7005
  "drag",
7005
7006
  "press",
7006
7007
  "fill",
@@ -7552,6 +7553,21 @@ function profileSetupDragReceipts(results) {
7552
7553
  reason: result.reason ?? result.error ?? null
7553
7554
  }));
7554
7555
  }
7556
+ function profileSetupTapReceipts(results) {
7557
+ return results.filter((result) => profileSetupResultAction(result) === "tap").map((result) => ({
7558
+ ordinal: result.ordinal ?? null,
7559
+ ok: result.ok !== false,
7560
+ selector: result.selector ?? null,
7561
+ frame_selector: result.frame_selector ?? null,
7562
+ pointer_type: result.pointer_type ?? null,
7563
+ input_dispatch: result.input_dispatch ?? null,
7564
+ coordinate_mode: result.coordinate_mode ?? null,
7565
+ x: result.x ?? null,
7566
+ y: result.y ?? null,
7567
+ duration_ms: result.duration_ms ?? null,
7568
+ reason: result.reason ?? result.error ?? null
7569
+ }));
7570
+ }
7555
7571
  function profileSetupCanvasSignatureReceipts(results) {
7556
7572
  return results.filter((result) => profileSetupResultAction(result) === "canvas_signature").map((result) => ({
7557
7573
  ordinal: result.ordinal ?? null,
@@ -7589,21 +7605,28 @@ function profileSetupCanvasSignatureStableHashGroups(results) {
7589
7605
  }
7590
7606
  const warnings = [];
7591
7607
  for (const group of groups.values()) {
7592
- const hashes = new Set(group.receipts.map((receipt) => receipt.hash));
7593
- const labels = [...new Set(group.receipts.map((receipt) => receipt.label))];
7594
- if (group.receipts.length < 2 || labels.length < 2 || hashes.size !== 1) continue;
7595
- const visibleLabels = labels.slice(0, 8);
7596
- warnings.push({
7597
- selector: group.selector,
7598
- frame_selector: group.frame_selector ?? null,
7599
- hash: group.receipts[0].hash,
7600
- count: group.receipts.length,
7601
- label_count: labels.length,
7602
- labels: visibleLabels,
7603
- omitted_label_count: Math.max(0, labels.length - visibleLabels.length),
7604
- ordinals: group.receipts.map((receipt) => receipt.ordinal).filter((value) => value !== void 0).slice(0, 12),
7605
- reason: "stable_canvas_signature_hash"
7606
- });
7608
+ const receiptsByHash = /* @__PURE__ */ new Map();
7609
+ for (const receipt of group.receipts) {
7610
+ const hashReceipts = receiptsByHash.get(receipt.hash) || [];
7611
+ hashReceipts.push(receipt);
7612
+ receiptsByHash.set(receipt.hash, hashReceipts);
7613
+ }
7614
+ for (const [hash, receipts] of receiptsByHash.entries()) {
7615
+ const labels = [...new Set(receipts.map((receipt) => receipt.label))];
7616
+ if (receipts.length < 2 || labels.length < 2) continue;
7617
+ const visibleLabels = labels.slice(0, 8);
7618
+ warnings.push({
7619
+ selector: group.selector,
7620
+ frame_selector: group.frame_selector ?? null,
7621
+ hash,
7622
+ count: receipts.length,
7623
+ label_count: labels.length,
7624
+ labels: visibleLabels,
7625
+ omitted_label_count: Math.max(0, labels.length - visibleLabels.length),
7626
+ ordinals: receipts.map((receipt) => receipt.ordinal).filter((value) => value !== void 0).slice(0, 12),
7627
+ reason: "stable_canvas_signature_hash"
7628
+ });
7629
+ }
7607
7630
  }
7608
7631
  return warnings;
7609
7632
  }
@@ -7706,6 +7729,8 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
7706
7729
  const sampledRangeValueReceipts = sampleProfileSetupSummaryItems(rangeValueReceipts, 8);
7707
7730
  const dragReceipts = profileSetupDragReceipts(results);
7708
7731
  const sampledDragReceipts = sampleProfileSetupSummaryItems(dragReceipts, 8);
7732
+ const tapReceipts = profileSetupTapReceipts(results);
7733
+ const sampledTapReceipts = sampleProfileSetupSummaryItems(tapReceipts, 8);
7709
7734
  const canvasSignatureReceipts = profileSetupCanvasSignatureReceipts(results);
7710
7735
  const sampledCanvasSignatureReceipts = sampleProfileSetupSummaryItems(canvasSignatureReceipts, 8);
7711
7736
  const clickedItems = results.filter((result) => profileSetupResultAction(result) === "click" && result.ok !== false).map((result) => {
@@ -7770,6 +7795,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
7770
7795
  drag_total: dragReceipts.length,
7771
7796
  drag_truncated: dragReceipts.length > sampledDragReceipts.length,
7772
7797
  drag: sampledDragReceipts,
7798
+ tap_total: tapReceipts.length,
7799
+ tap_truncated: tapReceipts.length > sampledTapReceipts.length,
7800
+ tap: sampledTapReceipts,
7773
7801
  canvas_signature_total: canvasSignatureReceipts.length,
7774
7802
  canvas_signature_truncated: canvasSignatureReceipts.length > sampledCanvasSignatureReceipts.length,
7775
7803
  canvas_signature: sampledCanvasSignatureReceipts,
@@ -7826,7 +7854,7 @@ function isSupportedCheckType(value) {
7826
7854
  }
7827
7855
  function normalizeSetupActionType(value, index) {
7828
7856
  const normalizedInput = String(value || "").trim().replace(/-/g, "_");
7829
- 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 === "deterministic_runtime" || normalizedInput === "mock_runtime" || normalizedInput === "mock_random" || normalizedInput === "mock_random_queue" || normalizedInput === "seed_random_queue" || normalizedInput === "set_random_queue" || normalizedInput === "mock_clock" || normalizedInput === "set_mock_clock" || normalizedInput === "set_runtime_determinism" || normalizedInput === "runtime_determinism" ? "deterministic_runtime" : normalizedInput === "canvas_hash" || normalizedInput === "capture_canvas_hash" || normalizedInput === "capture_canvas_signature" || normalizedInput === "canvas_state_signature" ? "canvas_signature" : 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;
7857
+ 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 === "pointer_tap" || normalizedInput === "touch_tap" || normalizedInput === "canvas_tap" ? "tap" : 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 === "deterministic_runtime" || normalizedInput === "mock_runtime" || normalizedInput === "mock_random" || normalizedInput === "mock_random_queue" || normalizedInput === "seed_random_queue" || normalizedInput === "set_random_queue" || normalizedInput === "mock_clock" || normalizedInput === "set_mock_clock" || normalizedInput === "set_runtime_determinism" || normalizedInput === "runtime_determinism" ? "deterministic_runtime" : normalizedInput === "canvas_hash" || normalizedInput === "capture_canvas_hash" || normalizedInput === "capture_canvas_signature" || normalizedInput === "canvas_state_signature" ? "canvas_signature" : 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;
7830
7858
  if (RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES.includes(normalized)) {
7831
7859
  return normalized;
7832
7860
  }
@@ -7908,8 +7936,8 @@ function normalizeSetupActionCoordinateMode(value, index) {
7908
7936
  }
7909
7937
  function normalizeSetupActionPointerType(value, type, index) {
7910
7938
  if (value === void 0 || value === null || value === "") return void 0;
7911
- if (type !== "drag") {
7912
- throw new Error(`target.setup_actions[${index}].pointer_type is only supported for drag actions.`);
7939
+ if (type !== "drag" && type !== "tap") {
7940
+ throw new Error(`target.setup_actions[${index}].pointer_type is only supported for drag/tap actions.`);
7913
7941
  }
7914
7942
  const normalized = String(value).trim().replace(/-/g, "_").toLowerCase();
7915
7943
  if (normalized === "mouse") return "mouse";
@@ -7988,11 +8016,11 @@ function normalizeSetupAction(input, index) {
7988
8016
  if (frameIndex !== void 0 && (!Number.isInteger(frameIndex) || frameIndex < 0)) {
7989
8017
  throw new Error(`target.setup_actions[${index}].frame_index must be a non-negative integer.`);
7990
8018
  }
7991
- if ((type === "click" || type === "drag" || type === "fill" || type === "set_input_value" || type === "set_range_value" || type === "canvas_signature" || type === "wait_for_selector" || type === "wait_for_text" || type === "assert_text_visible" || type === "assert_text_absent" || type === "assert_selector_count") && !selector) {
8019
+ if ((type === "click" || type === "tap" || type === "drag" || type === "fill" || type === "set_input_value" || type === "set_range_value" || type === "canvas_signature" || type === "wait_for_selector" || type === "wait_for_text" || type === "assert_text_visible" || type === "assert_text_absent" || type === "assert_selector_count") && !selector) {
7992
8020
  throw new Error(`target.setup_actions[${index}] ${type} requires selector.`);
7993
8021
  }
7994
- const fromX = type === "click" ? numberValue(valueFromOwn(input, "from_x", "fromX", "x", "click_x", "clickX", "start_x", "startX", "x1")) : numberValue(valueFromOwn(input, "from_x", "fromX", "start_x", "startX", "x1"));
7995
- const fromY = type === "click" ? numberValue(valueFromOwn(input, "from_y", "fromY", "y", "click_y", "clickY", "start_y", "startY", "y1")) : numberValue(valueFromOwn(input, "from_y", "fromY", "start_y", "startY", "y1"));
8022
+ const fromX = type === "click" || type === "tap" ? numberValue(valueFromOwn(input, "from_x", "fromX", "x", "click_x", "clickX", "start_x", "startX", "x1")) : numberValue(valueFromOwn(input, "from_x", "fromX", "start_x", "startX", "x1"));
8023
+ const fromY = type === "click" || type === "tap" ? numberValue(valueFromOwn(input, "from_y", "fromY", "y", "click_y", "clickY", "start_y", "startY", "y1")) : numberValue(valueFromOwn(input, "from_y", "fromY", "start_y", "startY", "y1"));
7996
8024
  const toX = numberValue(valueFromOwn(input, "to_x", "toX", "end_x", "endX", "x2"));
7997
8025
  const toY = numberValue(valueFromOwn(input, "to_y", "toY", "end_y", "endY", "y2"));
7998
8026
  const coordinateMode = normalizeSetupActionCoordinateMode(valueFromOwn(input, "coordinate_mode", "coordinateMode", "coords", "units"), index);
@@ -8012,6 +8040,21 @@ function normalizeSetupAction(input, index) {
8012
8040
  }
8013
8041
  }
8014
8042
  }
8043
+ if (type === "tap") {
8044
+ const hasTapCoordinate = fromX !== void 0 || fromY !== void 0;
8045
+ if (hasTapCoordinate && (fromX === void 0 || fromY === void 0)) {
8046
+ throw new Error(`target.setup_actions[${index}] tap coordinates require both x and y.`);
8047
+ }
8048
+ if (hasTapCoordinate && fromX !== void 0 && fromY !== void 0) {
8049
+ const tapCoordinates = [fromX, fromY];
8050
+ if (coordinateMode === "ratio" && tapCoordinates.some((value2) => value2 < 0 || value2 > 1)) {
8051
+ throw new Error(`target.setup_actions[${index}] tap ratio coordinates must be between 0 and 1.`);
8052
+ }
8053
+ if ((coordinateMode === void 0 || coordinateMode === "pixels") && tapCoordinates.some((value2) => value2 < 0)) {
8054
+ throw new Error(`target.setup_actions[${index}] tap pixel coordinates must be non-negative.`);
8055
+ }
8056
+ }
8057
+ }
8015
8058
  if (type === "drag") {
8016
8059
  if (fromX === void 0 || fromY === void 0 || toX === void 0 || toY === void 0) {
8017
8060
  throw new Error(`target.setup_actions[${index}] drag requires from_x, from_y, to_x, and to_y.`);
@@ -11350,24 +11393,31 @@ function profileSetupCanvasSignatureStableHashGroups(results) {
11350
11393
  }
11351
11394
  const warnings = [];
11352
11395
  for (const group of groups.values()) {
11353
- const hashes = new Set(group.receipts.map((receipt) => receipt.hash));
11354
- const labels = [...new Set(group.receipts.map((receipt) => receipt.label))];
11355
- if (group.receipts.length < 2 || labels.length < 2 || hashes.size !== 1) continue;
11356
- const visibleLabels = labels.slice(0, 8);
11357
- warnings.push({
11358
- selector: group.selector,
11359
- frame_selector: group.frame_selector || null,
11360
- hash: group.receipts[0].hash,
11361
- count: group.receipts.length,
11362
- label_count: labels.length,
11363
- labels: visibleLabels,
11364
- omitted_label_count: Math.max(0, labels.length - visibleLabels.length),
11365
- ordinals: group.receipts
11366
- .map((receipt) => receipt.ordinal)
11367
- .filter((value) => value !== undefined)
11368
- .slice(0, 12),
11369
- reason: "stable_canvas_signature_hash",
11370
- });
11396
+ const receiptsByHash = new Map();
11397
+ for (const receipt of group.receipts) {
11398
+ const hashReceipts = receiptsByHash.get(receipt.hash) || [];
11399
+ hashReceipts.push(receipt);
11400
+ receiptsByHash.set(receipt.hash, hashReceipts);
11401
+ }
11402
+ for (const [hash, receipts] of receiptsByHash.entries()) {
11403
+ const labels = [...new Set(receipts.map((receipt) => receipt.label))];
11404
+ if (receipts.length < 2 || labels.length < 2) continue;
11405
+ const visibleLabels = labels.slice(0, 8);
11406
+ warnings.push({
11407
+ selector: group.selector,
11408
+ frame_selector: group.frame_selector || null,
11409
+ hash,
11410
+ count: receipts.length,
11411
+ label_count: labels.length,
11412
+ labels: visibleLabels,
11413
+ omitted_label_count: Math.max(0, labels.length - visibleLabels.length),
11414
+ ordinals: receipts
11415
+ .map((receipt) => receipt.ordinal)
11416
+ .filter((value) => value !== undefined)
11417
+ .slice(0, 12),
11418
+ reason: "stable_canvas_signature_hash",
11419
+ });
11420
+ }
11371
11421
  }
11372
11422
  return warnings;
11373
11423
  }
@@ -12984,6 +13034,96 @@ async function executeSetupAction(action, ordinal, viewport) {
12984
13034
  await waitForAnyVisibleSelector(scope.context, action.selector, timeout);
12985
13035
  return { ...base, ...setupScopeEvidence(scope), ok: true, timeout_ms: timeout };
12986
13036
  }
13037
+ if (type === "tap") {
13038
+ const scope = await setupActionScope(action, timeout);
13039
+ if (!scope.ok) return setupScopeFailure(base, scope);
13040
+ const locator = scope.context.locator(action.selector);
13041
+ const count = await locator.count();
13042
+ if (!count) return { ...base, ...setupScopeEvidence(scope), reason: "selector_not_found", count };
13043
+ const targetIndex = Number.isInteger(action.index) ? action.index : 0;
13044
+ if (targetIndex < 0 || targetIndex >= count) return { ...base, ...setupScopeEvidence(scope), reason: "index_out_of_range", count, target_index: targetIndex };
13045
+ const target = locator.nth(targetIndex);
13046
+ await target.waitFor({ state: "visible", timeout });
13047
+ const box = await target.boundingBox();
13048
+ if (!box) return { ...base, ...setupScopeEvidence(scope), reason: "bounding_box_unavailable", count, target_index: targetIndex };
13049
+ const fromX = setupFiniteNumber(action.from_x ?? action.fromX ?? action.x ?? action.click_x ?? action.clickX);
13050
+ const fromY = setupFiniteNumber(action.from_y ?? action.fromY ?? action.y ?? action.click_y ?? action.clickY);
13051
+ const hasTapPosition = fromX !== undefined || fromY !== undefined;
13052
+ if (hasTapPosition && (fromX === undefined || fromY === undefined)) return { ...base, ...setupScopeEvidence(scope), reason: "missing_tap_coordinates", count, target_index: targetIndex };
13053
+ const mode = String(action.coordinate_mode || action.coordinateMode || (hasTapPosition ? "pixels" : "ratio")).trim();
13054
+ if (hasTapPosition && mode === "ratio" && [fromX, fromY].some((value) => value < 0 || value > 1)) return { ...base, ...setupScopeEvidence(scope), reason: "invalid_ratio_coordinates", count, target_index: targetIndex };
13055
+ if (hasTapPosition && mode !== "ratio" && [fromX, fromY].some((value) => value < 0)) return { ...base, ...setupScopeEvidence(scope), reason: "invalid_pixel_coordinates", count, target_index: targetIndex };
13056
+ const coordinate = (value, size) => mode === "ratio" ? value * size : value;
13057
+ const localX = hasTapPosition && fromX !== undefined ? fromX : 0.5;
13058
+ const localY = hasTapPosition && fromY !== undefined ? fromY : 0.5;
13059
+ const point = {
13060
+ x: box.x + coordinate(localX, box.width),
13061
+ y: box.y + coordinate(localY, box.height),
13062
+ };
13063
+ const durationMs = setupNumber(action.duration_ms ?? action.durationMs, 0);
13064
+ const pointerType = String(action.pointer_type || action.pointerType || "touch").trim().toLowerCase();
13065
+ if (pointerType === "touch" || pointerType === "pen") {
13066
+ const client = await page.context().newCDPSession(page);
13067
+ try {
13068
+ if (pointerType === "touch") {
13069
+ const touchPoint = {
13070
+ x: point.x,
13071
+ y: point.y,
13072
+ radiusX: 1,
13073
+ radiusY: 1,
13074
+ force: 1,
13075
+ id: 11,
13076
+ };
13077
+ await client.send("Input.dispatchTouchEvent", {
13078
+ type: "touchStart",
13079
+ touchPoints: [touchPoint],
13080
+ });
13081
+ if (durationMs) await page.waitForTimeout(durationMs);
13082
+ await client.send("Input.dispatchTouchEvent", {
13083
+ type: "touchEnd",
13084
+ touchPoints: [],
13085
+ });
13086
+ } else {
13087
+ await client.send("Input.dispatchMouseEvent", {
13088
+ type: "mousePressed",
13089
+ x: point.x,
13090
+ y: point.y,
13091
+ button: "left",
13092
+ buttons: 1,
13093
+ clickCount: 1,
13094
+ pointerType: "pen",
13095
+ });
13096
+ if (durationMs) await page.waitForTimeout(durationMs);
13097
+ await client.send("Input.dispatchMouseEvent", {
13098
+ type: "mouseReleased",
13099
+ x: point.x,
13100
+ y: point.y,
13101
+ button: "left",
13102
+ buttons: 0,
13103
+ clickCount: 1,
13104
+ pointerType: "pen",
13105
+ });
13106
+ }
13107
+ } finally {
13108
+ await client.detach().catch(() => {});
13109
+ }
13110
+ } else {
13111
+ await page.mouse.click(point.x, point.y);
13112
+ }
13113
+ return {
13114
+ ...base,
13115
+ ...setupScopeEvidence(scope),
13116
+ ok: true,
13117
+ count,
13118
+ target_index: targetIndex,
13119
+ coordinate_mode: hasTapPosition ? mode : undefined,
13120
+ x: hasTapPosition ? fromX : undefined,
13121
+ y: hasTapPosition ? fromY : undefined,
13122
+ pointer_type: pointerType,
13123
+ input_dispatch: pointerType === "touch" || pointerType === "pen" ? "cdp" : "playwright_mouse",
13124
+ duration_ms: durationMs || undefined,
13125
+ };
13126
+ }
12987
13127
  if (type === "drag") {
12988
13128
  const scope = await setupActionScope(action, timeout);
12989
13129
  if (!scope.ok) return setupScopeFailure(base, scope);
@@ -16265,6 +16405,7 @@ function profileSetupSummaryMarkdown(result) {
16265
16405
  const windowCallUntilCallTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.window_call_until_call_total) || 0), 0);
16266
16406
  const rangeValueTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.set_range_value_total) || 0), 0);
16267
16407
  const dragTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.drag_total) || 0), 0);
16408
+ const tapTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.tap_total) || 0), 0);
16268
16409
  const canvasSignatureTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.canvas_signature_total) || 0), 0);
16269
16410
  const failedTotal = viewports.reduce((sum, viewport) => sum + (Array.isArray(viewport.failed) ? viewport.failed.length : 0), 0);
16270
16411
  const lines = [
@@ -16297,6 +16438,9 @@ function profileSetupSummaryMarkdown(result) {
16297
16438
  if (dragTotal) {
16298
16439
  lines.push(`- drag: ${dragTotal} action(s)`);
16299
16440
  }
16441
+ if (tapTotal) {
16442
+ lines.push(`- tap: ${tapTotal} action(s)`);
16443
+ }
16300
16444
  if (canvasSignatureTotal) {
16301
16445
  lines.push(`- canvas_signature: ${canvasSignatureTotal} action(s)`);
16302
16446
  }
@@ -16319,9 +16463,10 @@ function profileSetupSummaryMarkdown(result) {
16319
16463
  const windowCallUntilCalls = cliFiniteNumber(viewport.window_call_until_call_total) || 0;
16320
16464
  const rangeValueActions = cliFiniteNumber(viewport.set_range_value_total) || 0;
16321
16465
  const dragActions = cliFiniteNumber(viewport.drag_total) || 0;
16466
+ const tapActions = cliFiniteNumber(viewport.tap_total) || 0;
16322
16467
  const canvasSignatureActions = cliFiniteNumber(viewport.canvas_signature_total) || 0;
16323
16468
  const observedPath = cliString(viewport.observed_path);
16324
- lines.push(`- ${name}: ${ok}, ${resultCount} result(s), ${screenshotCount} setup screenshot(s), ${clicked} click(s)${clickSequenceCount ? `, ${clickSequenceCount} click sequence(s)` : ""}${clickCountActions ? `, ${clickCountActions} click_count action(s)` : ""}${rangeValueActions ? `, ${rangeValueActions} set_range_value action(s)` : ""}${dragActions ? `, ${dragActions} drag action(s)` : ""}${canvasSignatureActions ? `, ${canvasSignatureActions} canvas_signature action(s)` : ""}${deterministicRuntimeActions ? `, ${deterministicRuntimeActions} deterministic_runtime action(s)` : ""}${windowCallActions ? `, ${windowCallActions} window_call action(s), ${windowCallStored} stored return(s), ${windowCallCaptured} captured return(s)` : ""}${windowEvalActions ? `, ${windowEvalActions} window_eval action(s), ${windowEvalStored} stored return(s), ${windowEvalCaptured} captured return(s)` : ""}${windowCallUntilActions ? `, ${windowCallUntilActions} window_call_until action(s), ${windowCallUntilCalls} call(s)` : ""}${observedPath ? `, path ${observedPath}` : ""}`);
16469
+ lines.push(`- ${name}: ${ok}, ${resultCount} result(s), ${screenshotCount} setup screenshot(s), ${clicked} click(s)${clickSequenceCount ? `, ${clickSequenceCount} click sequence(s)` : ""}${clickCountActions ? `, ${clickCountActions} click_count action(s)` : ""}${rangeValueActions ? `, ${rangeValueActions} set_range_value action(s)` : ""}${dragActions ? `, ${dragActions} drag action(s)` : ""}${tapActions ? `, ${tapActions} tap action(s)` : ""}${canvasSignatureActions ? `, ${canvasSignatureActions} canvas_signature action(s)` : ""}${deterministicRuntimeActions ? `, ${deterministicRuntimeActions} deterministic_runtime action(s)` : ""}${windowCallActions ? `, ${windowCallActions} window_call action(s), ${windowCallStored} stored return(s), ${windowCallCaptured} captured return(s)` : ""}${windowEvalActions ? `, ${windowEvalActions} window_eval action(s), ${windowEvalStored} stored return(s), ${windowEvalCaptured} captured return(s)` : ""}${windowCallUntilActions ? `, ${windowCallUntilActions} window_call_until action(s), ${windowCallUntilCalls} call(s)` : ""}${observedPath ? `, path ${observedPath}` : ""}`);
16325
16470
  }
16326
16471
  const clickSequenceGroups = viewports.map((viewport) => {
16327
16472
  const name = cliString(viewport.name) || "viewport";
@@ -16367,6 +16512,27 @@ function profileSetupSummaryMarkdown(result) {
16367
16512
  lines.push(`- ${name} drag: ${ok}, ${markdownInlineCode(selector)}${pointerType ? ` ${markdownInlineCode(pointerType)}` : ""}${inputDispatch ? ` via ${markdownInlineCode(inputDispatch)}` : ""}${coordinateText}${steps === void 0 ? "" : `, steps ${steps}`}${durationMs === void 0 ? "" : `, duration ${durationMs}ms`}${reason ? `, reason ${markdownInlineCode(reason, 100)}` : ""}`);
16368
16513
  }
16369
16514
  if (dragDetails.length > sampledDragDetails.length) lines.push(`- ${dragDetails.length - sampledDragDetails.length} additional drag receipt(s) omitted.`);
16515
+ const tapGroups = viewports.map((viewport) => {
16516
+ const name = cliString(viewport.name) || "viewport";
16517
+ const receipts = Array.isArray(viewport.tap) ? viewport.tap.map(cliRecord).filter((item) => Boolean(item)) : [];
16518
+ return receipts.map((receipt) => ({ name, receipt }));
16519
+ });
16520
+ const tapDetails = tapGroups.flat();
16521
+ const sampledTapDetails = balancedSetupReceiptDetails(tapGroups, 12);
16522
+ for (const { name, receipt } of sampledTapDetails) {
16523
+ const selector = cliString(receipt.selector) || "target";
16524
+ const pointerType = cliString(receipt.pointer_type);
16525
+ const inputDispatch = cliString(receipt.input_dispatch);
16526
+ const coordinateMode = cliString(receipt.coordinate_mode);
16527
+ const x = cliValueLabel(receipt.x);
16528
+ const y = cliValueLabel(receipt.y);
16529
+ const durationMs = cliFiniteNumber(receipt.duration_ms);
16530
+ const ok = receipt.ok === false ? "failed" : "ok";
16531
+ const reason = cliString(receipt.reason);
16532
+ const coordinateText = x && y ? `, ${coordinateMode ? `${coordinateMode} ` : ""}${markdownInlineCode(`${x},${y}`)}` : "";
16533
+ lines.push(`- ${name} tap: ${ok}, ${markdownInlineCode(selector)}${pointerType ? ` ${markdownInlineCode(pointerType)}` : ""}${inputDispatch ? ` via ${markdownInlineCode(inputDispatch)}` : ""}${coordinateText}${durationMs === void 0 ? "" : `, duration ${durationMs}ms`}${reason ? `, reason ${markdownInlineCode(reason, 100)}` : ""}`);
16534
+ }
16535
+ if (tapDetails.length > sampledTapDetails.length) lines.push(`- ${tapDetails.length - sampledTapDetails.length} additional tap receipt(s) omitted.`);
16370
16536
  const canvasSignatureGroups = viewports.map((viewport) => {
16371
16537
  const name = cliString(viewport.name) || "viewport";
16372
16538
  const receipts = Array.isArray(viewport.canvas_signature) ? viewport.canvas_signature.map(cliRecord).filter((item) => Boolean(item)) : [];
package/dist/cli.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  profileStatusExitCode,
14
14
  resolveRiddleProofProfileTargetUrl,
15
15
  resolveRiddleProofProfileTimeoutSec
16
- } from "./chunk-5ELOMJ7U.js";
16
+ } from "./chunk-BD4RHTGW.js";
17
17
  import {
18
18
  createRiddleApiClient,
19
19
  isTerminalRiddleJobStatus,
@@ -790,6 +790,7 @@ function profileSetupSummaryMarkdown(result) {
790
790
  const windowCallUntilCallTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.window_call_until_call_total) || 0), 0);
791
791
  const rangeValueTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.set_range_value_total) || 0), 0);
792
792
  const dragTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.drag_total) || 0), 0);
793
+ const tapTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.tap_total) || 0), 0);
793
794
  const canvasSignatureTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.canvas_signature_total) || 0), 0);
794
795
  const failedTotal = viewports.reduce((sum, viewport) => sum + (Array.isArray(viewport.failed) ? viewport.failed.length : 0), 0);
795
796
  const lines = [
@@ -822,6 +823,9 @@ function profileSetupSummaryMarkdown(result) {
822
823
  if (dragTotal) {
823
824
  lines.push(`- drag: ${dragTotal} action(s)`);
824
825
  }
826
+ if (tapTotal) {
827
+ lines.push(`- tap: ${tapTotal} action(s)`);
828
+ }
825
829
  if (canvasSignatureTotal) {
826
830
  lines.push(`- canvas_signature: ${canvasSignatureTotal} action(s)`);
827
831
  }
@@ -844,9 +848,10 @@ function profileSetupSummaryMarkdown(result) {
844
848
  const windowCallUntilCalls = cliFiniteNumber(viewport.window_call_until_call_total) || 0;
845
849
  const rangeValueActions = cliFiniteNumber(viewport.set_range_value_total) || 0;
846
850
  const dragActions = cliFiniteNumber(viewport.drag_total) || 0;
851
+ const tapActions = cliFiniteNumber(viewport.tap_total) || 0;
847
852
  const canvasSignatureActions = cliFiniteNumber(viewport.canvas_signature_total) || 0;
848
853
  const observedPath = cliString(viewport.observed_path);
849
- lines.push(`- ${name}: ${ok}, ${resultCount} result(s), ${screenshotCount} setup screenshot(s), ${clicked} click(s)${clickSequenceCount ? `, ${clickSequenceCount} click sequence(s)` : ""}${clickCountActions ? `, ${clickCountActions} click_count action(s)` : ""}${rangeValueActions ? `, ${rangeValueActions} set_range_value action(s)` : ""}${dragActions ? `, ${dragActions} drag action(s)` : ""}${canvasSignatureActions ? `, ${canvasSignatureActions} canvas_signature action(s)` : ""}${deterministicRuntimeActions ? `, ${deterministicRuntimeActions} deterministic_runtime action(s)` : ""}${windowCallActions ? `, ${windowCallActions} window_call action(s), ${windowCallStored} stored return(s), ${windowCallCaptured} captured return(s)` : ""}${windowEvalActions ? `, ${windowEvalActions} window_eval action(s), ${windowEvalStored} stored return(s), ${windowEvalCaptured} captured return(s)` : ""}${windowCallUntilActions ? `, ${windowCallUntilActions} window_call_until action(s), ${windowCallUntilCalls} call(s)` : ""}${observedPath ? `, path ${observedPath}` : ""}`);
854
+ lines.push(`- ${name}: ${ok}, ${resultCount} result(s), ${screenshotCount} setup screenshot(s), ${clicked} click(s)${clickSequenceCount ? `, ${clickSequenceCount} click sequence(s)` : ""}${clickCountActions ? `, ${clickCountActions} click_count action(s)` : ""}${rangeValueActions ? `, ${rangeValueActions} set_range_value action(s)` : ""}${dragActions ? `, ${dragActions} drag action(s)` : ""}${tapActions ? `, ${tapActions} tap action(s)` : ""}${canvasSignatureActions ? `, ${canvasSignatureActions} canvas_signature action(s)` : ""}${deterministicRuntimeActions ? `, ${deterministicRuntimeActions} deterministic_runtime action(s)` : ""}${windowCallActions ? `, ${windowCallActions} window_call action(s), ${windowCallStored} stored return(s), ${windowCallCaptured} captured return(s)` : ""}${windowEvalActions ? `, ${windowEvalActions} window_eval action(s), ${windowEvalStored} stored return(s), ${windowEvalCaptured} captured return(s)` : ""}${windowCallUntilActions ? `, ${windowCallUntilActions} window_call_until action(s), ${windowCallUntilCalls} call(s)` : ""}${observedPath ? `, path ${observedPath}` : ""}`);
850
855
  }
851
856
  const clickSequenceGroups = viewports.map((viewport) => {
852
857
  const name = cliString(viewport.name) || "viewport";
@@ -892,6 +897,27 @@ function profileSetupSummaryMarkdown(result) {
892
897
  lines.push(`- ${name} drag: ${ok}, ${markdownInlineCode(selector)}${pointerType ? ` ${markdownInlineCode(pointerType)}` : ""}${inputDispatch ? ` via ${markdownInlineCode(inputDispatch)}` : ""}${coordinateText}${steps === void 0 ? "" : `, steps ${steps}`}${durationMs === void 0 ? "" : `, duration ${durationMs}ms`}${reason ? `, reason ${markdownInlineCode(reason, 100)}` : ""}`);
893
898
  }
894
899
  if (dragDetails.length > sampledDragDetails.length) lines.push(`- ${dragDetails.length - sampledDragDetails.length} additional drag receipt(s) omitted.`);
900
+ const tapGroups = viewports.map((viewport) => {
901
+ const name = cliString(viewport.name) || "viewport";
902
+ const receipts = Array.isArray(viewport.tap) ? viewport.tap.map(cliRecord).filter((item) => Boolean(item)) : [];
903
+ return receipts.map((receipt) => ({ name, receipt }));
904
+ });
905
+ const tapDetails = tapGroups.flat();
906
+ const sampledTapDetails = balancedSetupReceiptDetails(tapGroups, 12);
907
+ for (const { name, receipt } of sampledTapDetails) {
908
+ const selector = cliString(receipt.selector) || "target";
909
+ const pointerType = cliString(receipt.pointer_type);
910
+ const inputDispatch = cliString(receipt.input_dispatch);
911
+ const coordinateMode = cliString(receipt.coordinate_mode);
912
+ const x = cliValueLabel(receipt.x);
913
+ const y = cliValueLabel(receipt.y);
914
+ const durationMs = cliFiniteNumber(receipt.duration_ms);
915
+ const ok = receipt.ok === false ? "failed" : "ok";
916
+ const reason = cliString(receipt.reason);
917
+ const coordinateText = x && y ? `, ${coordinateMode ? `${coordinateMode} ` : ""}${markdownInlineCode(`${x},${y}`)}` : "";
918
+ lines.push(`- ${name} tap: ${ok}, ${markdownInlineCode(selector)}${pointerType ? ` ${markdownInlineCode(pointerType)}` : ""}${inputDispatch ? ` via ${markdownInlineCode(inputDispatch)}` : ""}${coordinateText}${durationMs === void 0 ? "" : `, duration ${durationMs}ms`}${reason ? `, reason ${markdownInlineCode(reason, 100)}` : ""}`);
919
+ }
920
+ if (tapDetails.length > sampledTapDetails.length) lines.push(`- ${tapDetails.length - sampledTapDetails.length} additional tap receipt(s) omitted.`);
895
921
  const canvasSignatureGroups = viewports.map((viewport) => {
896
922
  const name = cliString(viewport.name) || "viewport";
897
923
  const receipts = Array.isArray(viewport.canvas_signature) ? viewport.canvas_signature.map(cliRecord).filter((item) => Boolean(item)) : [];