@riddledc/riddle-proof 0.7.195 → 0.7.196

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.
@@ -1255,6 +1255,7 @@ function normalizeSetupAction(input, index) {
1255
1255
  frame_index: frameIndex,
1256
1256
  full_page: normalizeSetupActionScreenshotFullPage(input, type, index),
1257
1257
  force: type === "click" && (input.force === true || input.force_click === true || input.forceClick === true),
1258
+ 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
1259
  click_count: normalizeSetupActionClickCount(input, type, index),
1259
1260
  coordinate_mode: coordinateMode,
1260
1261
  pointer_type: pointerType,
@@ -7127,6 +7128,7 @@ async function executeSetupAction(action, ordinal, viewport) {
7127
7128
  : { timeout, noWaitAfter: true };
7128
7129
  const clickCount = setupNumber(action.click_count, 1);
7129
7130
  if (Number.isInteger(clickCount) && clickCount > 1) clickOptions.clickCount = clickCount;
7131
+ const target = locator.nth(targetIndex);
7130
7132
  const fromX = setupFiniteNumber(action.from_x ?? action.fromX ?? action.x ?? action.click_x ?? action.clickX);
7131
7133
  const fromY = setupFiniteNumber(action.from_y ?? action.fromY ?? action.y ?? action.click_y ?? action.clickY);
7132
7134
  const hasClickPosition = fromX !== undefined || fromY !== undefined;
@@ -7134,7 +7136,6 @@ async function executeSetupAction(action, ordinal, viewport) {
7134
7136
  let mode;
7135
7137
  if (hasClickPosition) {
7136
7138
  if (fromX === undefined || fromY === undefined) return { ...base, ...setupScopeEvidence(scope), reason: "missing_click_coordinates", count, target_index: targetIndex };
7137
- const target = locator.nth(targetIndex);
7138
7139
  const box = await target.boundingBox();
7139
7140
  if (!box) return { ...base, ...setupScopeEvidence(scope), reason: "bounding_box_unavailable", count, target_index: targetIndex };
7140
7141
  mode = String(action.coordinate_mode || action.coordinateMode || "pixels").trim();
@@ -7142,7 +7143,43 @@ async function executeSetupAction(action, ordinal, viewport) {
7142
7143
  position = { x: coordinate(fromX, box.width), y: coordinate(fromY, box.height) };
7143
7144
  clickOptions.position = position;
7144
7145
  }
7145
- await locator.nth(targetIndex).click(clickOptions);
7146
+ try {
7147
+ await target.click(clickOptions);
7148
+ } catch (error) {
7149
+ if (action.fallback_to_tap !== true) throw error;
7150
+ const box = await target.boundingBox();
7151
+ if (!box) {
7152
+ return {
7153
+ ...base,
7154
+ ...setupScopeEvidence(scope),
7155
+ reason: "fallback_bounding_box_unavailable",
7156
+ count,
7157
+ target_index: targetIndex,
7158
+ click_error: String(error && error.message ? error.message : error).slice(0, 1000),
7159
+ };
7160
+ }
7161
+ const fallbackPoint = position
7162
+ ? { x: box.x + position.x, y: box.y + position.y }
7163
+ : { x: box.x + box.width / 2, y: box.y + box.height / 2 };
7164
+ if (clickCount > 1) await page.mouse.click(fallbackPoint.x, fallbackPoint.y, { clickCount });
7165
+ else await page.mouse.click(fallbackPoint.x, fallbackPoint.y);
7166
+ return {
7167
+ ...base,
7168
+ ...setupScopeEvidence(scope),
7169
+ ok: true,
7170
+ count,
7171
+ target_index: targetIndex,
7172
+ text: matchedText,
7173
+ force: action.force === true || undefined,
7174
+ fallback_to_tap: true,
7175
+ input_dispatch: "playwright_mouse",
7176
+ click_error: String(error && error.message ? error.message : error).slice(0, 1000),
7177
+ click_count: clickCount > 1 ? clickCount : undefined,
7178
+ coordinate_mode: mode,
7179
+ x: position ? fromX : undefined,
7180
+ y: position ? fromY : undefined,
7181
+ };
7182
+ }
7146
7183
  return {
7147
7184
  ...base,
7148
7185
  ...setupScopeEvidence(scope),
package/dist/cli.cjs CHANGED
@@ -8212,6 +8212,7 @@ function normalizeSetupAction(input, index) {
8212
8212
  frame_index: frameIndex,
8213
8213
  full_page: normalizeSetupActionScreenshotFullPage(input, type, index),
8214
8214
  force: type === "click" && (input.force === true || input.force_click === true || input.forceClick === true),
8215
+ 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
8216
  click_count: normalizeSetupActionClickCount(input, type, index),
8216
8217
  coordinate_mode: coordinateMode,
8217
8218
  pointer_type: pointerType,
@@ -14068,6 +14069,7 @@ async function executeSetupAction(action, ordinal, viewport) {
14068
14069
  : { timeout, noWaitAfter: true };
14069
14070
  const clickCount = setupNumber(action.click_count, 1);
14070
14071
  if (Number.isInteger(clickCount) && clickCount > 1) clickOptions.clickCount = clickCount;
14072
+ const target = locator.nth(targetIndex);
14071
14073
  const fromX = setupFiniteNumber(action.from_x ?? action.fromX ?? action.x ?? action.click_x ?? action.clickX);
14072
14074
  const fromY = setupFiniteNumber(action.from_y ?? action.fromY ?? action.y ?? action.click_y ?? action.clickY);
14073
14075
  const hasClickPosition = fromX !== undefined || fromY !== undefined;
@@ -14075,7 +14077,6 @@ async function executeSetupAction(action, ordinal, viewport) {
14075
14077
  let mode;
14076
14078
  if (hasClickPosition) {
14077
14079
  if (fromX === undefined || fromY === undefined) return { ...base, ...setupScopeEvidence(scope), reason: "missing_click_coordinates", count, target_index: targetIndex };
14078
- const target = locator.nth(targetIndex);
14079
14080
  const box = await target.boundingBox();
14080
14081
  if (!box) return { ...base, ...setupScopeEvidence(scope), reason: "bounding_box_unavailable", count, target_index: targetIndex };
14081
14082
  mode = String(action.coordinate_mode || action.coordinateMode || "pixels").trim();
@@ -14083,7 +14084,43 @@ async function executeSetupAction(action, ordinal, viewport) {
14083
14084
  position = { x: coordinate(fromX, box.width), y: coordinate(fromY, box.height) };
14084
14085
  clickOptions.position = position;
14085
14086
  }
14086
- await locator.nth(targetIndex).click(clickOptions);
14087
+ try {
14088
+ await target.click(clickOptions);
14089
+ } catch (error) {
14090
+ if (action.fallback_to_tap !== true) throw error;
14091
+ const box = await target.boundingBox();
14092
+ if (!box) {
14093
+ return {
14094
+ ...base,
14095
+ ...setupScopeEvidence(scope),
14096
+ reason: "fallback_bounding_box_unavailable",
14097
+ count,
14098
+ target_index: targetIndex,
14099
+ click_error: String(error && error.message ? error.message : error).slice(0, 1000),
14100
+ };
14101
+ }
14102
+ const fallbackPoint = position
14103
+ ? { x: box.x + position.x, y: box.y + position.y }
14104
+ : { x: box.x + box.width / 2, y: box.y + box.height / 2 };
14105
+ if (clickCount > 1) await page.mouse.click(fallbackPoint.x, fallbackPoint.y, { clickCount });
14106
+ else await page.mouse.click(fallbackPoint.x, fallbackPoint.y);
14107
+ return {
14108
+ ...base,
14109
+ ...setupScopeEvidence(scope),
14110
+ ok: true,
14111
+ count,
14112
+ target_index: targetIndex,
14113
+ text: matchedText,
14114
+ force: action.force === true || undefined,
14115
+ fallback_to_tap: true,
14116
+ input_dispatch: "playwright_mouse",
14117
+ click_error: String(error && error.message ? error.message : error).slice(0, 1000),
14118
+ click_count: clickCount > 1 ? clickCount : undefined,
14119
+ coordinate_mode: mode,
14120
+ x: position ? fromX : undefined,
14121
+ y: position ? fromY : undefined,
14122
+ };
14123
+ }
14087
14124
  return {
14088
14125
  ...base,
14089
14126
  ...setupScopeEvidence(scope),
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-WUOU5RB4.js";
17
17
  import {
18
18
  createRiddleApiClient,
19
19
  isTerminalRiddleJobStatus,
package/dist/index.cjs CHANGED
@@ -9988,6 +9988,7 @@ function normalizeSetupAction(input, index) {
9988
9988
  frame_index: frameIndex,
9989
9989
  full_page: normalizeSetupActionScreenshotFullPage(input, type, index),
9990
9990
  force: type === "click" && (input.force === true || input.force_click === true || input.forceClick === true),
9991
+ 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
9992
  click_count: normalizeSetupActionClickCount(input, type, index),
9992
9993
  coordinate_mode: coordinateMode,
9993
9994
  pointer_type: pointerType,
@@ -15860,6 +15861,7 @@ async function executeSetupAction(action, ordinal, viewport) {
15860
15861
  : { timeout, noWaitAfter: true };
15861
15862
  const clickCount = setupNumber(action.click_count, 1);
15862
15863
  if (Number.isInteger(clickCount) && clickCount > 1) clickOptions.clickCount = clickCount;
15864
+ const target = locator.nth(targetIndex);
15863
15865
  const fromX = setupFiniteNumber(action.from_x ?? action.fromX ?? action.x ?? action.click_x ?? action.clickX);
15864
15866
  const fromY = setupFiniteNumber(action.from_y ?? action.fromY ?? action.y ?? action.click_y ?? action.clickY);
15865
15867
  const hasClickPosition = fromX !== undefined || fromY !== undefined;
@@ -15867,7 +15869,6 @@ async function executeSetupAction(action, ordinal, viewport) {
15867
15869
  let mode;
15868
15870
  if (hasClickPosition) {
15869
15871
  if (fromX === undefined || fromY === undefined) return { ...base, ...setupScopeEvidence(scope), reason: "missing_click_coordinates", count, target_index: targetIndex };
15870
- const target = locator.nth(targetIndex);
15871
15872
  const box = await target.boundingBox();
15872
15873
  if (!box) return { ...base, ...setupScopeEvidence(scope), reason: "bounding_box_unavailable", count, target_index: targetIndex };
15873
15874
  mode = String(action.coordinate_mode || action.coordinateMode || "pixels").trim();
@@ -15875,7 +15876,43 @@ async function executeSetupAction(action, ordinal, viewport) {
15875
15876
  position = { x: coordinate(fromX, box.width), y: coordinate(fromY, box.height) };
15876
15877
  clickOptions.position = position;
15877
15878
  }
15878
- await locator.nth(targetIndex).click(clickOptions);
15879
+ try {
15880
+ await target.click(clickOptions);
15881
+ } catch (error) {
15882
+ if (action.fallback_to_tap !== true) throw error;
15883
+ const box = await target.boundingBox();
15884
+ if (!box) {
15885
+ return {
15886
+ ...base,
15887
+ ...setupScopeEvidence(scope),
15888
+ reason: "fallback_bounding_box_unavailable",
15889
+ count,
15890
+ target_index: targetIndex,
15891
+ click_error: String(error && error.message ? error.message : error).slice(0, 1000),
15892
+ };
15893
+ }
15894
+ const fallbackPoint = position
15895
+ ? { x: box.x + position.x, y: box.y + position.y }
15896
+ : { x: box.x + box.width / 2, y: box.y + box.height / 2 };
15897
+ if (clickCount > 1) await page.mouse.click(fallbackPoint.x, fallbackPoint.y, { clickCount });
15898
+ else await page.mouse.click(fallbackPoint.x, fallbackPoint.y);
15899
+ return {
15900
+ ...base,
15901
+ ...setupScopeEvidence(scope),
15902
+ ok: true,
15903
+ count,
15904
+ target_index: targetIndex,
15905
+ text: matchedText,
15906
+ force: action.force === true || undefined,
15907
+ fallback_to_tap: true,
15908
+ input_dispatch: "playwright_mouse",
15909
+ click_error: String(error && error.message ? error.message : error).slice(0, 1000),
15910
+ click_count: clickCount > 1 ? clickCount : undefined,
15911
+ coordinate_mode: mode,
15912
+ x: position ? fromX : undefined,
15913
+ y: position ? fromY : undefined,
15914
+ };
15915
+ }
15879
15916
  return {
15880
15917
  ...base,
15881
15918
  ...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-WUOU5RB4.js";
66
66
  import {
67
67
  DEFAULT_RIDDLE_API_BASE_URL,
68
68
  DEFAULT_RIDDLE_API_KEY_FILE,
package/dist/profile.cjs CHANGED
@@ -1302,6 +1302,7 @@ function normalizeSetupAction(input, index) {
1302
1302
  frame_index: frameIndex,
1303
1303
  full_page: normalizeSetupActionScreenshotFullPage(input, type, index),
1304
1304
  force: type === "click" && (input.force === true || input.force_click === true || input.forceClick === true),
1305
+ 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
1306
  click_count: normalizeSetupActionClickCount(input, type, index),
1306
1307
  coordinate_mode: coordinateMode,
1307
1308
  pointer_type: pointerType,
@@ -7174,6 +7175,7 @@ async function executeSetupAction(action, ordinal, viewport) {
7174
7175
  : { timeout, noWaitAfter: true };
7175
7176
  const clickCount = setupNumber(action.click_count, 1);
7176
7177
  if (Number.isInteger(clickCount) && clickCount > 1) clickOptions.clickCount = clickCount;
7178
+ const target = locator.nth(targetIndex);
7177
7179
  const fromX = setupFiniteNumber(action.from_x ?? action.fromX ?? action.x ?? action.click_x ?? action.clickX);
7178
7180
  const fromY = setupFiniteNumber(action.from_y ?? action.fromY ?? action.y ?? action.click_y ?? action.clickY);
7179
7181
  const hasClickPosition = fromX !== undefined || fromY !== undefined;
@@ -7181,7 +7183,6 @@ async function executeSetupAction(action, ordinal, viewport) {
7181
7183
  let mode;
7182
7184
  if (hasClickPosition) {
7183
7185
  if (fromX === undefined || fromY === undefined) return { ...base, ...setupScopeEvidence(scope), reason: "missing_click_coordinates", count, target_index: targetIndex };
7184
- const target = locator.nth(targetIndex);
7185
7186
  const box = await target.boundingBox();
7186
7187
  if (!box) return { ...base, ...setupScopeEvidence(scope), reason: "bounding_box_unavailable", count, target_index: targetIndex };
7187
7188
  mode = String(action.coordinate_mode || action.coordinateMode || "pixels").trim();
@@ -7189,7 +7190,43 @@ async function executeSetupAction(action, ordinal, viewport) {
7189
7190
  position = { x: coordinate(fromX, box.width), y: coordinate(fromY, box.height) };
7190
7191
  clickOptions.position = position;
7191
7192
  }
7192
- await locator.nth(targetIndex).click(clickOptions);
7193
+ try {
7194
+ await target.click(clickOptions);
7195
+ } catch (error) {
7196
+ if (action.fallback_to_tap !== true) throw error;
7197
+ const box = await target.boundingBox();
7198
+ if (!box) {
7199
+ return {
7200
+ ...base,
7201
+ ...setupScopeEvidence(scope),
7202
+ reason: "fallback_bounding_box_unavailable",
7203
+ count,
7204
+ target_index: targetIndex,
7205
+ click_error: String(error && error.message ? error.message : error).slice(0, 1000),
7206
+ };
7207
+ }
7208
+ const fallbackPoint = position
7209
+ ? { x: box.x + position.x, y: box.y + position.y }
7210
+ : { x: box.x + box.width / 2, y: box.y + box.height / 2 };
7211
+ if (clickCount > 1) await page.mouse.click(fallbackPoint.x, fallbackPoint.y, { clickCount });
7212
+ else await page.mouse.click(fallbackPoint.x, fallbackPoint.y);
7213
+ return {
7214
+ ...base,
7215
+ ...setupScopeEvidence(scope),
7216
+ ok: true,
7217
+ count,
7218
+ target_index: targetIndex,
7219
+ text: matchedText,
7220
+ force: action.force === true || undefined,
7221
+ fallback_to_tap: true,
7222
+ input_dispatch: "playwright_mouse",
7223
+ click_error: String(error && error.message ? error.message : error).slice(0, 1000),
7224
+ click_count: clickCount > 1 ? clickCount : undefined,
7225
+ coordinate_mode: mode,
7226
+ x: position ? fromX : undefined,
7227
+ y: position ? fromY : undefined,
7228
+ };
7229
+ }
7193
7230
  return {
7194
7231
  ...base,
7195
7232
  ...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-WUOU5RB4.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.196",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",