@riddledc/riddle-proof 0.7.195 → 0.7.197

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.
@@ -801,6 +801,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
801
801
  selector: result.selector ?? null,
802
802
  frame_selector: result.frame_selector ?? null,
803
803
  text: compactProfileSetupSummaryText(result.text),
804
+ ...result.fallback_to_tap === true ? { fallback_to_tap: true } : {},
805
+ ...result.input_dispatch ? { input_dispatch: result.input_dispatch } : {},
806
+ ...result.click_error ? { click_error: compactProfileSetupSummaryText(result.click_error) } : {},
804
807
  ...clickCount ? { click_count: clickCount } : {}
805
808
  };
806
809
  });
@@ -1255,6 +1258,7 @@ function normalizeSetupAction(input, index) {
1255
1258
  frame_index: frameIndex,
1256
1259
  full_page: normalizeSetupActionScreenshotFullPage(input, type, index),
1257
1260
  force: type === "click" && (input.force === true || input.force_click === true || input.forceClick === true),
1261
+ fallback_to_tap: type === "click" && (input.fallback_to_tap === true || input.fallbackToTap === true || input.fallback_to_pointer_tap === true || input.fallbackToPointerTap === true || input.pointer_fallback === true || input.pointerFallback === true) || void 0,
1258
1262
  click_count: normalizeSetupActionClickCount(input, type, index),
1259
1263
  coordinate_mode: coordinateMode,
1260
1264
  pointer_type: pointerType,
@@ -4721,6 +4725,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
4721
4725
  selector: result.selector ?? null,
4722
4726
  frame_selector: result.frame_selector ?? null,
4723
4727
  text: compactProfileSetupSummaryText(result.text),
4728
+ ...(result.fallback_to_tap === true ? { fallback_to_tap: true } : {}),
4729
+ ...(result.input_dispatch ? { input_dispatch: result.input_dispatch } : {}),
4730
+ ...(result.click_error ? { click_error: compactProfileSetupSummaryText(result.click_error) } : {}),
4724
4731
  ...(clickCount ? { click_count: clickCount } : {}),
4725
4732
  };
4726
4733
  });
@@ -7127,6 +7134,7 @@ async function executeSetupAction(action, ordinal, viewport) {
7127
7134
  : { timeout, noWaitAfter: true };
7128
7135
  const clickCount = setupNumber(action.click_count, 1);
7129
7136
  if (Number.isInteger(clickCount) && clickCount > 1) clickOptions.clickCount = clickCount;
7137
+ const target = locator.nth(targetIndex);
7130
7138
  const fromX = setupFiniteNumber(action.from_x ?? action.fromX ?? action.x ?? action.click_x ?? action.clickX);
7131
7139
  const fromY = setupFiniteNumber(action.from_y ?? action.fromY ?? action.y ?? action.click_y ?? action.clickY);
7132
7140
  const hasClickPosition = fromX !== undefined || fromY !== undefined;
@@ -7134,7 +7142,6 @@ async function executeSetupAction(action, ordinal, viewport) {
7134
7142
  let mode;
7135
7143
  if (hasClickPosition) {
7136
7144
  if (fromX === undefined || fromY === undefined) return { ...base, ...setupScopeEvidence(scope), reason: "missing_click_coordinates", count, target_index: targetIndex };
7137
- const target = locator.nth(targetIndex);
7138
7145
  const box = await target.boundingBox();
7139
7146
  if (!box) return { ...base, ...setupScopeEvidence(scope), reason: "bounding_box_unavailable", count, target_index: targetIndex };
7140
7147
  mode = String(action.coordinate_mode || action.coordinateMode || "pixels").trim();
@@ -7142,7 +7149,43 @@ async function executeSetupAction(action, ordinal, viewport) {
7142
7149
  position = { x: coordinate(fromX, box.width), y: coordinate(fromY, box.height) };
7143
7150
  clickOptions.position = position;
7144
7151
  }
7145
- await locator.nth(targetIndex).click(clickOptions);
7152
+ try {
7153
+ await target.click(clickOptions);
7154
+ } catch (error) {
7155
+ if (action.fallback_to_tap !== true) throw error;
7156
+ const box = await target.boundingBox();
7157
+ if (!box) {
7158
+ return {
7159
+ ...base,
7160
+ ...setupScopeEvidence(scope),
7161
+ reason: "fallback_bounding_box_unavailable",
7162
+ count,
7163
+ target_index: targetIndex,
7164
+ click_error: String(error && error.message ? error.message : error).slice(0, 1000),
7165
+ };
7166
+ }
7167
+ const fallbackPoint = position
7168
+ ? { x: box.x + position.x, y: box.y + position.y }
7169
+ : { x: box.x + box.width / 2, y: box.y + box.height / 2 };
7170
+ if (clickCount > 1) await page.mouse.click(fallbackPoint.x, fallbackPoint.y, { clickCount });
7171
+ else await page.mouse.click(fallbackPoint.x, fallbackPoint.y);
7172
+ return {
7173
+ ...base,
7174
+ ...setupScopeEvidence(scope),
7175
+ ok: true,
7176
+ count,
7177
+ target_index: targetIndex,
7178
+ text: matchedText,
7179
+ force: action.force === true || undefined,
7180
+ fallback_to_tap: true,
7181
+ input_dispatch: "playwright_mouse",
7182
+ click_error: String(error && error.message ? error.message : error).slice(0, 1000),
7183
+ click_count: clickCount > 1 ? clickCount : undefined,
7184
+ coordinate_mode: mode,
7185
+ x: position ? fromX : undefined,
7186
+ y: position ? fromY : undefined,
7187
+ };
7188
+ }
7146
7189
  return {
7147
7190
  ...base,
7148
7191
  ...setupScopeEvidence(scope),
package/dist/cli.cjs CHANGED
@@ -7758,6 +7758,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
7758
7758
  selector: result.selector ?? null,
7759
7759
  frame_selector: result.frame_selector ?? null,
7760
7760
  text: compactProfileSetupSummaryText(result.text),
7761
+ ...result.fallback_to_tap === true ? { fallback_to_tap: true } : {},
7762
+ ...result.input_dispatch ? { input_dispatch: result.input_dispatch } : {},
7763
+ ...result.click_error ? { click_error: compactProfileSetupSummaryText(result.click_error) } : {},
7761
7764
  ...clickCount ? { click_count: clickCount } : {}
7762
7765
  };
7763
7766
  });
@@ -8212,6 +8215,7 @@ function normalizeSetupAction(input, index) {
8212
8215
  frame_index: frameIndex,
8213
8216
  full_page: normalizeSetupActionScreenshotFullPage(input, type, index),
8214
8217
  force: type === "click" && (input.force === true || input.force_click === true || input.forceClick === true),
8218
+ fallback_to_tap: type === "click" && (input.fallback_to_tap === true || input.fallbackToTap === true || input.fallback_to_pointer_tap === true || input.fallbackToPointerTap === true || input.pointer_fallback === true || input.pointerFallback === true) || void 0,
8215
8219
  click_count: normalizeSetupActionClickCount(input, type, index),
8216
8220
  coordinate_mode: coordinateMode,
8217
8221
  pointer_type: pointerType,
@@ -11662,6 +11666,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
11662
11666
  selector: result.selector ?? null,
11663
11667
  frame_selector: result.frame_selector ?? null,
11664
11668
  text: compactProfileSetupSummaryText(result.text),
11669
+ ...(result.fallback_to_tap === true ? { fallback_to_tap: true } : {}),
11670
+ ...(result.input_dispatch ? { input_dispatch: result.input_dispatch } : {}),
11671
+ ...(result.click_error ? { click_error: compactProfileSetupSummaryText(result.click_error) } : {}),
11665
11672
  ...(clickCount ? { click_count: clickCount } : {}),
11666
11673
  };
11667
11674
  });
@@ -14068,6 +14075,7 @@ async function executeSetupAction(action, ordinal, viewport) {
14068
14075
  : { timeout, noWaitAfter: true };
14069
14076
  const clickCount = setupNumber(action.click_count, 1);
14070
14077
  if (Number.isInteger(clickCount) && clickCount > 1) clickOptions.clickCount = clickCount;
14078
+ const target = locator.nth(targetIndex);
14071
14079
  const fromX = setupFiniteNumber(action.from_x ?? action.fromX ?? action.x ?? action.click_x ?? action.clickX);
14072
14080
  const fromY = setupFiniteNumber(action.from_y ?? action.fromY ?? action.y ?? action.click_y ?? action.clickY);
14073
14081
  const hasClickPosition = fromX !== undefined || fromY !== undefined;
@@ -14075,7 +14083,6 @@ async function executeSetupAction(action, ordinal, viewport) {
14075
14083
  let mode;
14076
14084
  if (hasClickPosition) {
14077
14085
  if (fromX === undefined || fromY === undefined) return { ...base, ...setupScopeEvidence(scope), reason: "missing_click_coordinates", count, target_index: targetIndex };
14078
- const target = locator.nth(targetIndex);
14079
14086
  const box = await target.boundingBox();
14080
14087
  if (!box) return { ...base, ...setupScopeEvidence(scope), reason: "bounding_box_unavailable", count, target_index: targetIndex };
14081
14088
  mode = String(action.coordinate_mode || action.coordinateMode || "pixels").trim();
@@ -14083,7 +14090,43 @@ async function executeSetupAction(action, ordinal, viewport) {
14083
14090
  position = { x: coordinate(fromX, box.width), y: coordinate(fromY, box.height) };
14084
14091
  clickOptions.position = position;
14085
14092
  }
14086
- await locator.nth(targetIndex).click(clickOptions);
14093
+ try {
14094
+ await target.click(clickOptions);
14095
+ } catch (error) {
14096
+ if (action.fallback_to_tap !== true) throw error;
14097
+ const box = await target.boundingBox();
14098
+ if (!box) {
14099
+ return {
14100
+ ...base,
14101
+ ...setupScopeEvidence(scope),
14102
+ reason: "fallback_bounding_box_unavailable",
14103
+ count,
14104
+ target_index: targetIndex,
14105
+ click_error: String(error && error.message ? error.message : error).slice(0, 1000),
14106
+ };
14107
+ }
14108
+ const fallbackPoint = position
14109
+ ? { x: box.x + position.x, y: box.y + position.y }
14110
+ : { x: box.x + box.width / 2, y: box.y + box.height / 2 };
14111
+ if (clickCount > 1) await page.mouse.click(fallbackPoint.x, fallbackPoint.y, { clickCount });
14112
+ else await page.mouse.click(fallbackPoint.x, fallbackPoint.y);
14113
+ return {
14114
+ ...base,
14115
+ ...setupScopeEvidence(scope),
14116
+ ok: true,
14117
+ count,
14118
+ target_index: targetIndex,
14119
+ text: matchedText,
14120
+ force: action.force === true || undefined,
14121
+ fallback_to_tap: true,
14122
+ input_dispatch: "playwright_mouse",
14123
+ click_error: String(error && error.message ? error.message : error).slice(0, 1000),
14124
+ click_count: clickCount > 1 ? clickCount : undefined,
14125
+ coordinate_mode: mode,
14126
+ x: position ? fromX : undefined,
14127
+ y: position ? fromY : undefined,
14128
+ };
14129
+ }
14087
14130
  return {
14088
14131
  ...base,
14089
14132
  ...setupScopeEvidence(scope),
@@ -16742,6 +16785,20 @@ function profilePackReceiptStatus(result, metadata, receipt) {
16742
16785
  ...setupViewports.flatMap((viewport) => setupReceiptArray(viewport, "window_call"))
16743
16786
  ].filter((item) => item.ok !== false);
16744
16787
  const clickCount = setupViewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.clicked_total) || 0), 0) + profileSetupReceiptTotal(setupViewports, "click") + profileSetupReceiptTotal(setupViewports, "click_count");
16788
+ const clickFallbackTapKeys = /* @__PURE__ */ new Set();
16789
+ [
16790
+ ...setupViewports.flatMap((viewport) => setupReceiptArray(viewport, "clicked")),
16791
+ ...evidenceViewports.flatMap((viewport) => setupReceiptArray(cliRecord(viewport) || {}, "setup_action_results"))
16792
+ ].forEach((receipt2, index) => {
16793
+ if (receipt2.ok === false || receipt2.fallback_to_tap !== true) return;
16794
+ const action = cliString(receipt2.action);
16795
+ if (action && action !== "click") return;
16796
+ const ordinal = cliFiniteNumber(receipt2.ordinal);
16797
+ const selector = cliString(receipt2.selector) || "";
16798
+ const frameSelector = cliString(receipt2.frame_selector) || "";
16799
+ clickFallbackTapKeys.add(`${ordinal === void 0 ? `idx:${index}` : `ord:${ordinal}`}:${frameSelector}:${selector}`);
16800
+ });
16801
+ const clickFallbackTapCount = clickFallbackTapKeys.size;
16745
16802
  const visibleUiActionCount = clickCount + profileSetupReceiptTotal(setupViewports, "tap");
16746
16803
  const setupFailureCount = profileSetupFailureCount(setupViewports);
16747
16804
  const setupObstructionCount = profileSetupObstructionCount(setupViewports);
@@ -16805,6 +16862,13 @@ function profilePackReceiptStatus(result, metadata, receipt) {
16805
16862
  if (text.includes("setup action")) {
16806
16863
  return profileReceiptSignalStatus(hasSetupReceipts, "setup receipts present", "setup receipts missing");
16807
16864
  }
16865
+ if (text.includes("click") && text.includes("fallback") && text.includes("tap")) {
16866
+ return profileReceiptSignalStatus(
16867
+ clickFallbackTapCount > 0,
16868
+ `click fallback tap evidence present (${clickFallbackTapCount})`,
16869
+ "click fallback tap evidence missing"
16870
+ );
16871
+ }
16808
16872
  if (text.includes("active") && (text.includes("route-local") || text.includes("route local")) && (text.includes("proof helper") || text.includes("proof api") || text.includes("proof state"))) {
16809
16873
  return profileReceiptSignalStatus(
16810
16874
  hasActiveRouteLocalProofReceipt,
package/dist/cli.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  profileStatusExitCode,
14
14
  resolveRiddleProofProfileTargetUrl,
15
15
  resolveRiddleProofProfileTimeoutSec
16
- } from "./chunk-UKMTTGQ4.js";
16
+ } from "./chunk-EYLIXKE2.js";
17
17
  import {
18
18
  createRiddleApiClient,
19
19
  isTerminalRiddleJobStatus,
@@ -834,6 +834,20 @@ function profilePackReceiptStatus(result, metadata, receipt) {
834
834
  ...setupViewports.flatMap((viewport) => setupReceiptArray(viewport, "window_call"))
835
835
  ].filter((item) => item.ok !== false);
836
836
  const clickCount = setupViewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.clicked_total) || 0), 0) + profileSetupReceiptTotal(setupViewports, "click") + profileSetupReceiptTotal(setupViewports, "click_count");
837
+ const clickFallbackTapKeys = /* @__PURE__ */ new Set();
838
+ [
839
+ ...setupViewports.flatMap((viewport) => setupReceiptArray(viewport, "clicked")),
840
+ ...evidenceViewports.flatMap((viewport) => setupReceiptArray(cliRecord(viewport) || {}, "setup_action_results"))
841
+ ].forEach((receipt2, index) => {
842
+ if (receipt2.ok === false || receipt2.fallback_to_tap !== true) return;
843
+ const action = cliString(receipt2.action);
844
+ if (action && action !== "click") return;
845
+ const ordinal = cliFiniteNumber(receipt2.ordinal);
846
+ const selector = cliString(receipt2.selector) || "";
847
+ const frameSelector = cliString(receipt2.frame_selector) || "";
848
+ clickFallbackTapKeys.add(`${ordinal === void 0 ? `idx:${index}` : `ord:${ordinal}`}:${frameSelector}:${selector}`);
849
+ });
850
+ const clickFallbackTapCount = clickFallbackTapKeys.size;
837
851
  const visibleUiActionCount = clickCount + profileSetupReceiptTotal(setupViewports, "tap");
838
852
  const setupFailureCount = profileSetupFailureCount(setupViewports);
839
853
  const setupObstructionCount = profileSetupObstructionCount(setupViewports);
@@ -897,6 +911,13 @@ function profilePackReceiptStatus(result, metadata, receipt) {
897
911
  if (text.includes("setup action")) {
898
912
  return profileReceiptSignalStatus(hasSetupReceipts, "setup receipts present", "setup receipts missing");
899
913
  }
914
+ if (text.includes("click") && text.includes("fallback") && text.includes("tap")) {
915
+ return profileReceiptSignalStatus(
916
+ clickFallbackTapCount > 0,
917
+ `click fallback tap evidence present (${clickFallbackTapCount})`,
918
+ "click fallback tap evidence missing"
919
+ );
920
+ }
900
921
  if (text.includes("active") && (text.includes("route-local") || text.includes("route local")) && (text.includes("proof helper") || text.includes("proof api") || text.includes("proof state"))) {
901
922
  return profileReceiptSignalStatus(
902
923
  hasActiveRouteLocalProofReceipt,
package/dist/index.cjs CHANGED
@@ -9534,6 +9534,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
9534
9534
  selector: result.selector ?? null,
9535
9535
  frame_selector: result.frame_selector ?? null,
9536
9536
  text: compactProfileSetupSummaryText(result.text),
9537
+ ...result.fallback_to_tap === true ? { fallback_to_tap: true } : {},
9538
+ ...result.input_dispatch ? { input_dispatch: result.input_dispatch } : {},
9539
+ ...result.click_error ? { click_error: compactProfileSetupSummaryText(result.click_error) } : {},
9537
9540
  ...clickCount ? { click_count: clickCount } : {}
9538
9541
  };
9539
9542
  });
@@ -9988,6 +9991,7 @@ function normalizeSetupAction(input, index) {
9988
9991
  frame_index: frameIndex,
9989
9992
  full_page: normalizeSetupActionScreenshotFullPage(input, type, index),
9990
9993
  force: type === "click" && (input.force === true || input.force_click === true || input.forceClick === true),
9994
+ fallback_to_tap: type === "click" && (input.fallback_to_tap === true || input.fallbackToTap === true || input.fallback_to_pointer_tap === true || input.fallbackToPointerTap === true || input.pointer_fallback === true || input.pointerFallback === true) || void 0,
9991
9995
  click_count: normalizeSetupActionClickCount(input, type, index),
9992
9996
  coordinate_mode: coordinateMode,
9993
9997
  pointer_type: pointerType,
@@ -13454,6 +13458,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
13454
13458
  selector: result.selector ?? null,
13455
13459
  frame_selector: result.frame_selector ?? null,
13456
13460
  text: compactProfileSetupSummaryText(result.text),
13461
+ ...(result.fallback_to_tap === true ? { fallback_to_tap: true } : {}),
13462
+ ...(result.input_dispatch ? { input_dispatch: result.input_dispatch } : {}),
13463
+ ...(result.click_error ? { click_error: compactProfileSetupSummaryText(result.click_error) } : {}),
13457
13464
  ...(clickCount ? { click_count: clickCount } : {}),
13458
13465
  };
13459
13466
  });
@@ -15860,6 +15867,7 @@ async function executeSetupAction(action, ordinal, viewport) {
15860
15867
  : { timeout, noWaitAfter: true };
15861
15868
  const clickCount = setupNumber(action.click_count, 1);
15862
15869
  if (Number.isInteger(clickCount) && clickCount > 1) clickOptions.clickCount = clickCount;
15870
+ const target = locator.nth(targetIndex);
15863
15871
  const fromX = setupFiniteNumber(action.from_x ?? action.fromX ?? action.x ?? action.click_x ?? action.clickX);
15864
15872
  const fromY = setupFiniteNumber(action.from_y ?? action.fromY ?? action.y ?? action.click_y ?? action.clickY);
15865
15873
  const hasClickPosition = fromX !== undefined || fromY !== undefined;
@@ -15867,7 +15875,6 @@ async function executeSetupAction(action, ordinal, viewport) {
15867
15875
  let mode;
15868
15876
  if (hasClickPosition) {
15869
15877
  if (fromX === undefined || fromY === undefined) return { ...base, ...setupScopeEvidence(scope), reason: "missing_click_coordinates", count, target_index: targetIndex };
15870
- const target = locator.nth(targetIndex);
15871
15878
  const box = await target.boundingBox();
15872
15879
  if (!box) return { ...base, ...setupScopeEvidence(scope), reason: "bounding_box_unavailable", count, target_index: targetIndex };
15873
15880
  mode = String(action.coordinate_mode || action.coordinateMode || "pixels").trim();
@@ -15875,7 +15882,43 @@ async function executeSetupAction(action, ordinal, viewport) {
15875
15882
  position = { x: coordinate(fromX, box.width), y: coordinate(fromY, box.height) };
15876
15883
  clickOptions.position = position;
15877
15884
  }
15878
- await locator.nth(targetIndex).click(clickOptions);
15885
+ try {
15886
+ await target.click(clickOptions);
15887
+ } catch (error) {
15888
+ if (action.fallback_to_tap !== true) throw error;
15889
+ const box = await target.boundingBox();
15890
+ if (!box) {
15891
+ return {
15892
+ ...base,
15893
+ ...setupScopeEvidence(scope),
15894
+ reason: "fallback_bounding_box_unavailable",
15895
+ count,
15896
+ target_index: targetIndex,
15897
+ click_error: String(error && error.message ? error.message : error).slice(0, 1000),
15898
+ };
15899
+ }
15900
+ const fallbackPoint = position
15901
+ ? { x: box.x + position.x, y: box.y + position.y }
15902
+ : { x: box.x + box.width / 2, y: box.y + box.height / 2 };
15903
+ if (clickCount > 1) await page.mouse.click(fallbackPoint.x, fallbackPoint.y, { clickCount });
15904
+ else await page.mouse.click(fallbackPoint.x, fallbackPoint.y);
15905
+ return {
15906
+ ...base,
15907
+ ...setupScopeEvidence(scope),
15908
+ ok: true,
15909
+ count,
15910
+ target_index: targetIndex,
15911
+ text: matchedText,
15912
+ force: action.force === true || undefined,
15913
+ fallback_to_tap: true,
15914
+ input_dispatch: "playwright_mouse",
15915
+ click_error: String(error && error.message ? error.message : error).slice(0, 1000),
15916
+ click_count: clickCount > 1 ? clickCount : undefined,
15917
+ coordinate_mode: mode,
15918
+ x: position ? fromX : undefined,
15919
+ y: position ? fromY : undefined,
15920
+ };
15921
+ }
15879
15922
  return {
15880
15923
  ...base,
15881
15924
  ...setupScopeEvidence(scope),
package/dist/index.js CHANGED
@@ -62,7 +62,7 @@ import {
62
62
  resolveRiddleProofProfileTimeoutSec,
63
63
  slugifyRiddleProofProfileName,
64
64
  summarizeRiddleProofProfileResult
65
- } from "./chunk-UKMTTGQ4.js";
65
+ } from "./chunk-EYLIXKE2.js";
66
66
  import {
67
67
  DEFAULT_RIDDLE_API_BASE_URL,
68
68
  DEFAULT_RIDDLE_API_KEY_FILE,
package/dist/profile.cjs CHANGED
@@ -848,6 +848,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
848
848
  selector: result.selector ?? null,
849
849
  frame_selector: result.frame_selector ?? null,
850
850
  text: compactProfileSetupSummaryText(result.text),
851
+ ...result.fallback_to_tap === true ? { fallback_to_tap: true } : {},
852
+ ...result.input_dispatch ? { input_dispatch: result.input_dispatch } : {},
853
+ ...result.click_error ? { click_error: compactProfileSetupSummaryText(result.click_error) } : {},
851
854
  ...clickCount ? { click_count: clickCount } : {}
852
855
  };
853
856
  });
@@ -1302,6 +1305,7 @@ function normalizeSetupAction(input, index) {
1302
1305
  frame_index: frameIndex,
1303
1306
  full_page: normalizeSetupActionScreenshotFullPage(input, type, index),
1304
1307
  force: type === "click" && (input.force === true || input.force_click === true || input.forceClick === true),
1308
+ fallback_to_tap: type === "click" && (input.fallback_to_tap === true || input.fallbackToTap === true || input.fallback_to_pointer_tap === true || input.fallbackToPointerTap === true || input.pointer_fallback === true || input.pointerFallback === true) || void 0,
1305
1309
  click_count: normalizeSetupActionClickCount(input, type, index),
1306
1310
  coordinate_mode: coordinateMode,
1307
1311
  pointer_type: pointerType,
@@ -4768,6 +4772,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
4768
4772
  selector: result.selector ?? null,
4769
4773
  frame_selector: result.frame_selector ?? null,
4770
4774
  text: compactProfileSetupSummaryText(result.text),
4775
+ ...(result.fallback_to_tap === true ? { fallback_to_tap: true } : {}),
4776
+ ...(result.input_dispatch ? { input_dispatch: result.input_dispatch } : {}),
4777
+ ...(result.click_error ? { click_error: compactProfileSetupSummaryText(result.click_error) } : {}),
4771
4778
  ...(clickCount ? { click_count: clickCount } : {}),
4772
4779
  };
4773
4780
  });
@@ -7174,6 +7181,7 @@ async function executeSetupAction(action, ordinal, viewport) {
7174
7181
  : { timeout, noWaitAfter: true };
7175
7182
  const clickCount = setupNumber(action.click_count, 1);
7176
7183
  if (Number.isInteger(clickCount) && clickCount > 1) clickOptions.clickCount = clickCount;
7184
+ const target = locator.nth(targetIndex);
7177
7185
  const fromX = setupFiniteNumber(action.from_x ?? action.fromX ?? action.x ?? action.click_x ?? action.clickX);
7178
7186
  const fromY = setupFiniteNumber(action.from_y ?? action.fromY ?? action.y ?? action.click_y ?? action.clickY);
7179
7187
  const hasClickPosition = fromX !== undefined || fromY !== undefined;
@@ -7181,7 +7189,6 @@ async function executeSetupAction(action, ordinal, viewport) {
7181
7189
  let mode;
7182
7190
  if (hasClickPosition) {
7183
7191
  if (fromX === undefined || fromY === undefined) return { ...base, ...setupScopeEvidence(scope), reason: "missing_click_coordinates", count, target_index: targetIndex };
7184
- const target = locator.nth(targetIndex);
7185
7192
  const box = await target.boundingBox();
7186
7193
  if (!box) return { ...base, ...setupScopeEvidence(scope), reason: "bounding_box_unavailable", count, target_index: targetIndex };
7187
7194
  mode = String(action.coordinate_mode || action.coordinateMode || "pixels").trim();
@@ -7189,7 +7196,43 @@ async function executeSetupAction(action, ordinal, viewport) {
7189
7196
  position = { x: coordinate(fromX, box.width), y: coordinate(fromY, box.height) };
7190
7197
  clickOptions.position = position;
7191
7198
  }
7192
- await locator.nth(targetIndex).click(clickOptions);
7199
+ try {
7200
+ await target.click(clickOptions);
7201
+ } catch (error) {
7202
+ if (action.fallback_to_tap !== true) throw error;
7203
+ const box = await target.boundingBox();
7204
+ if (!box) {
7205
+ return {
7206
+ ...base,
7207
+ ...setupScopeEvidence(scope),
7208
+ reason: "fallback_bounding_box_unavailable",
7209
+ count,
7210
+ target_index: targetIndex,
7211
+ click_error: String(error && error.message ? error.message : error).slice(0, 1000),
7212
+ };
7213
+ }
7214
+ const fallbackPoint = position
7215
+ ? { x: box.x + position.x, y: box.y + position.y }
7216
+ : { x: box.x + box.width / 2, y: box.y + box.height / 2 };
7217
+ if (clickCount > 1) await page.mouse.click(fallbackPoint.x, fallbackPoint.y, { clickCount });
7218
+ else await page.mouse.click(fallbackPoint.x, fallbackPoint.y);
7219
+ return {
7220
+ ...base,
7221
+ ...setupScopeEvidence(scope),
7222
+ ok: true,
7223
+ count,
7224
+ target_index: targetIndex,
7225
+ text: matchedText,
7226
+ force: action.force === true || undefined,
7227
+ fallback_to_tap: true,
7228
+ input_dispatch: "playwright_mouse",
7229
+ click_error: String(error && error.message ? error.message : error).slice(0, 1000),
7230
+ click_count: clickCount > 1 ? clickCount : undefined,
7231
+ coordinate_mode: mode,
7232
+ x: position ? fromX : undefined,
7233
+ y: position ? fromY : undefined,
7234
+ };
7235
+ }
7193
7236
  return {
7194
7237
  ...base,
7195
7238
  ...setupScopeEvidence(scope),
@@ -114,6 +114,7 @@ interface RiddleProofProfileSetupAction {
114
114
  frame_index?: number;
115
115
  full_page?: boolean;
116
116
  force?: boolean;
117
+ fallback_to_tap?: boolean;
117
118
  click_count?: number;
118
119
  coordinate_mode?: "pixels" | "ratio";
119
120
  pointer_type?: "mouse" | "touch" | "pen";
package/dist/profile.d.ts CHANGED
@@ -114,6 +114,7 @@ interface RiddleProofProfileSetupAction {
114
114
  frame_index?: number;
115
115
  full_page?: boolean;
116
116
  force?: boolean;
117
+ fallback_to_tap?: boolean;
117
118
  click_count?: number;
118
119
  coordinate_mode?: "pixels" | "ratio";
119
120
  pointer_type?: "mouse" | "touch" | "pen";
package/dist/profile.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  resolveRiddleProofProfileTimeoutSec,
24
24
  slugifyRiddleProofProfileName,
25
25
  summarizeRiddleProofProfileResult
26
- } from "./chunk-UKMTTGQ4.js";
26
+ } from "./chunk-EYLIXKE2.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.195",
3
+ "version": "0.7.197",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",