@riddledc/riddle-proof 0.8.34 → 0.8.36

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/index.cjs CHANGED
@@ -10862,6 +10862,8 @@ function normalizeSetupAction(input, index) {
10862
10862
  expect_changed: booleanValue(valueFromOwn(input, "expect_changed", "expectChanged", "should_change", "shouldChange", "changed")),
10863
10863
  until_path: untilPath,
10864
10864
  until_expected_value: hasUntilExpectedValue ? toJsonValue(valueFromOwn(input, "until_expected_value", "untilExpectedValue", "until_expected", "untilExpected", "until_value", "untilValue", "expected_value", "expectedValue", "expected")) : void 0,
10865
+ expected_path: stringFromOwn(input, "expected_path", "expectedPath", "expected_terminal_path", "expectedTerminalPath"),
10866
+ expected_url: stringFromOwn(input, "expected_url", "expectedUrl", "expected_terminal_url", "expectedTerminalUrl"),
10865
10867
  max_calls: maxCalls,
10866
10868
  tap_burst_size: tapBurstSize,
10867
10869
  settle_ms: settleMs,
@@ -13219,6 +13221,80 @@ function routePathMatches(observed, expected, targetUrl) {
13219
13221
  if (normalizedObserved === normalizedExpected) return true;
13220
13222
  return normalizedObserved === normalizeRoutePath(mountedExpectedRoutePath(targetUrl, expected));
13221
13223
  }
13224
+ function setupActionExpectedRoute(action) {
13225
+ const expectedUrl = typeof action.expected_url === "string" && action.expected_url.trim()
13226
+ ? action.expected_url.trim()
13227
+ : typeof action.expectedUrl === "string" && action.expectedUrl.trim()
13228
+ ? action.expectedUrl.trim()
13229
+ : "";
13230
+ const expectedPath = typeof action.expected_path === "string" && action.expected_path.trim()
13231
+ ? action.expected_path.trim()
13232
+ : typeof action.expectedPath === "string" && action.expectedPath.trim()
13233
+ ? action.expectedPath.trim()
13234
+ : "";
13235
+ if (!expectedUrl && !expectedPath) return null;
13236
+ return { expected_url: expectedUrl || undefined, expected_path: expectedPath || undefined };
13237
+ }
13238
+ function setupUrlMatchesExpectedRoute(href, expected) {
13239
+ if (!expected) return true;
13240
+ let observedUrl;
13241
+ try {
13242
+ observedUrl = new URL(href, targetUrl);
13243
+ } catch {
13244
+ return false;
13245
+ }
13246
+ if (expected.expected_url) {
13247
+ let expectedUrl;
13248
+ try {
13249
+ expectedUrl = new URL(expected.expected_url, targetUrl);
13250
+ } catch {
13251
+ return false;
13252
+ }
13253
+ return observedUrl.href === expectedUrl.href;
13254
+ }
13255
+ const expectedPath = expected.expected_path || "/";
13256
+ if (/[?#]/.test(expectedPath)) {
13257
+ const observedRoute = observedUrl.pathname + observedUrl.search + observedUrl.hash;
13258
+ const normalizedObservedRoute = observedRoute === "/" ? "/" : observedRoute.replace(/\/+(?=[?#]|$)/, "");
13259
+ const normalizedExpectedRoute = expectedPath === "/" ? "/" : expectedPath.replace(/\/+(?=[?#]|$)/, "");
13260
+ return normalizedObservedRoute === normalizedExpectedRoute;
13261
+ }
13262
+ return routePathMatches(observedUrl.pathname, expectedPath, targetUrl);
13263
+ }
13264
+ function setupObservedRouteEvidence(expected, waitError) {
13265
+ let observedUrl = page.url();
13266
+ let observedPath = "";
13267
+ let observedRoute = "";
13268
+ try {
13269
+ const url = new URL(observedUrl, targetUrl);
13270
+ observedUrl = url.href;
13271
+ observedPath = url.pathname;
13272
+ observedRoute = url.pathname + url.search + url.hash;
13273
+ } catch {
13274
+ observedPath = "";
13275
+ observedRoute = "";
13276
+ }
13277
+ return {
13278
+ expected_url: expected && expected.expected_url || undefined,
13279
+ expected_path: expected && expected.expected_path || undefined,
13280
+ observed_url: observedUrl,
13281
+ observed_path: observedPath,
13282
+ observed_route: observedRoute,
13283
+ route_matched: setupUrlMatchesExpectedRoute(observedUrl, expected),
13284
+ route_wait_error: waitError ? String(waitError && waitError.message ? waitError.message : waitError).slice(0, 1000) : undefined,
13285
+ };
13286
+ }
13287
+ async function waitForSetupActionRoute(action, timeout) {
13288
+ const expected = setupActionExpectedRoute(action);
13289
+ if (!expected) return null;
13290
+ let waitError;
13291
+ try {
13292
+ await page.waitForURL((url) => setupUrlMatchesExpectedRoute(url.href, expected), { timeout: Math.min(timeout, 20000) });
13293
+ } catch (error) {
13294
+ waitError = error;
13295
+ }
13296
+ return setupObservedRouteEvidence(expected, waitError);
13297
+ }
13222
13298
  function routeOk(route, targetUrl) {
13223
13299
  return Boolean(route && (route.matched || routePathMatches(route.observed, route.expected_path, targetUrl)) && !route.error && (route.http_status == null || route.http_status < 400));
13224
13300
  }
@@ -16112,11 +16188,22 @@ async function executeSetupAction(action, ordinal, viewport) {
16112
16188
  const prepared = await resolveSetupTapTarget(action, base, scope, timeout);
16113
16189
  if (prepared.result) return prepared.result;
16114
16190
  await dispatchSetupTapPoint(prepared.target.point, prepared.target.pointerType, prepared.target.durationMs);
16191
+ const routeEvidence = await waitForSetupActionRoute(action, timeout);
16192
+ if (routeEvidence && !routeEvidence.route_matched) {
16193
+ return {
16194
+ ...base,
16195
+ ...setupScopeEvidence(scope),
16196
+ ...setupTapTargetEvidence(prepared.target),
16197
+ ...routeEvidence,
16198
+ reason: "expected_route_not_reached",
16199
+ };
16200
+ }
16115
16201
  return {
16116
16202
  ...base,
16117
16203
  ...setupScopeEvidence(scope),
16118
16204
  ok: true,
16119
16205
  ...setupTapTargetEvidence(prepared.target),
16206
+ ...routeEvidence,
16120
16207
  };
16121
16208
  }
16122
16209
  if (type === "tap_until") {
@@ -16977,6 +17064,26 @@ async function executeSetupAction(action, ordinal, viewport) {
16977
17064
  : { x: box.x + box.width / 2, y: box.y + box.height / 2 };
16978
17065
  if (clickCount > 1) await page.mouse.click(fallbackPoint.x, fallbackPoint.y, { clickCount });
16979
17066
  else await page.mouse.click(fallbackPoint.x, fallbackPoint.y);
17067
+ const routeEvidence = await waitForSetupActionRoute(action, timeout);
17068
+ if (routeEvidence && !routeEvidence.route_matched) {
17069
+ return {
17070
+ ...base,
17071
+ ...setupScopeEvidence(scope),
17072
+ count,
17073
+ target_index: targetIndex,
17074
+ text: matchedText,
17075
+ force: action.force === true || undefined,
17076
+ fallback_to_tap: true,
17077
+ input_dispatch: "playwright_mouse",
17078
+ click_error: String(error && error.message ? error.message : error).slice(0, 1000),
17079
+ click_count: clickCount > 1 ? clickCount : undefined,
17080
+ coordinate_mode: mode,
17081
+ x: position ? fromX : undefined,
17082
+ y: position ? fromY : undefined,
17083
+ ...routeEvidence,
17084
+ reason: "expected_route_not_reached",
17085
+ };
17086
+ }
16980
17087
  return {
16981
17088
  ...base,
16982
17089
  ...setupScopeEvidence(scope),
@@ -16992,6 +17099,24 @@ async function executeSetupAction(action, ordinal, viewport) {
16992
17099
  coordinate_mode: mode,
16993
17100
  x: position ? fromX : undefined,
16994
17101
  y: position ? fromY : undefined,
17102
+ ...routeEvidence,
17103
+ };
17104
+ }
17105
+ const routeEvidence = await waitForSetupActionRoute(action, timeout);
17106
+ if (routeEvidence && !routeEvidence.route_matched) {
17107
+ return {
17108
+ ...base,
17109
+ ...setupScopeEvidence(scope),
17110
+ count,
17111
+ target_index: targetIndex,
17112
+ text: matchedText,
17113
+ force: action.force === true || undefined,
17114
+ click_count: clickCount > 1 ? clickCount : undefined,
17115
+ coordinate_mode: mode,
17116
+ x: position ? fromX : undefined,
17117
+ y: position ? fromY : undefined,
17118
+ ...routeEvidence,
17119
+ reason: "expected_route_not_reached",
16995
17120
  };
16996
17121
  }
16997
17122
  return {
@@ -17006,6 +17131,7 @@ async function executeSetupAction(action, ordinal, viewport) {
17006
17131
  coordinate_mode: mode,
17007
17132
  x: position ? fromX : undefined,
17008
17133
  y: position ? fromY : undefined,
17134
+ ...routeEvidence,
17009
17135
  };
17010
17136
  }
17011
17137
  if (type === "fill" || type === "set_input_value") {
package/dist/index.js CHANGED
@@ -62,7 +62,7 @@ import {
62
62
  resolveRiddleProofProfileTimeoutSec,
63
63
  slugifyRiddleProofProfileName,
64
64
  summarizeRiddleProofProfileResult
65
- } from "./chunk-PEWAIEER.js";
65
+ } from "./chunk-Z2LCVROU.js";
66
66
  import {
67
67
  DEFAULT_RIDDLE_API_BASE_URL,
68
68
  DEFAULT_RIDDLE_API_KEY_FILE,
@@ -1380,6 +1380,8 @@ function normalizeSetupAction(input, index) {
1380
1380
  expect_changed: booleanValue(valueFromOwn(input, "expect_changed", "expectChanged", "should_change", "shouldChange", "changed")),
1381
1381
  until_path: untilPath,
1382
1382
  until_expected_value: hasUntilExpectedValue ? toJsonValue(valueFromOwn(input, "until_expected_value", "untilExpectedValue", "until_expected", "untilExpected", "until_value", "untilValue", "expected_value", "expectedValue", "expected")) : void 0,
1383
+ expected_path: stringFromOwn(input, "expected_path", "expectedPath", "expected_terminal_path", "expectedTerminalPath"),
1384
+ expected_url: stringFromOwn(input, "expected_url", "expectedUrl", "expected_terminal_url", "expectedTerminalUrl"),
1383
1385
  max_calls: maxCalls,
1384
1386
  tap_burst_size: tapBurstSize,
1385
1387
  settle_ms: settleMs,
@@ -3737,6 +3739,80 @@ function routePathMatches(observed, expected, targetUrl) {
3737
3739
  if (normalizedObserved === normalizedExpected) return true;
3738
3740
  return normalizedObserved === normalizeRoutePath(mountedExpectedRoutePath(targetUrl, expected));
3739
3741
  }
3742
+ function setupActionExpectedRoute(action) {
3743
+ const expectedUrl = typeof action.expected_url === "string" && action.expected_url.trim()
3744
+ ? action.expected_url.trim()
3745
+ : typeof action.expectedUrl === "string" && action.expectedUrl.trim()
3746
+ ? action.expectedUrl.trim()
3747
+ : "";
3748
+ const expectedPath = typeof action.expected_path === "string" && action.expected_path.trim()
3749
+ ? action.expected_path.trim()
3750
+ : typeof action.expectedPath === "string" && action.expectedPath.trim()
3751
+ ? action.expectedPath.trim()
3752
+ : "";
3753
+ if (!expectedUrl && !expectedPath) return null;
3754
+ return { expected_url: expectedUrl || undefined, expected_path: expectedPath || undefined };
3755
+ }
3756
+ function setupUrlMatchesExpectedRoute(href, expected) {
3757
+ if (!expected) return true;
3758
+ let observedUrl;
3759
+ try {
3760
+ observedUrl = new URL(href, targetUrl);
3761
+ } catch {
3762
+ return false;
3763
+ }
3764
+ if (expected.expected_url) {
3765
+ let expectedUrl;
3766
+ try {
3767
+ expectedUrl = new URL(expected.expected_url, targetUrl);
3768
+ } catch {
3769
+ return false;
3770
+ }
3771
+ return observedUrl.href === expectedUrl.href;
3772
+ }
3773
+ const expectedPath = expected.expected_path || "/";
3774
+ if (/[?#]/.test(expectedPath)) {
3775
+ const observedRoute = observedUrl.pathname + observedUrl.search + observedUrl.hash;
3776
+ const normalizedObservedRoute = observedRoute === "/" ? "/" : observedRoute.replace(/\/+(?=[?#]|$)/, "");
3777
+ const normalizedExpectedRoute = expectedPath === "/" ? "/" : expectedPath.replace(/\/+(?=[?#]|$)/, "");
3778
+ return normalizedObservedRoute === normalizedExpectedRoute;
3779
+ }
3780
+ return routePathMatches(observedUrl.pathname, expectedPath, targetUrl);
3781
+ }
3782
+ function setupObservedRouteEvidence(expected, waitError) {
3783
+ let observedUrl = page.url();
3784
+ let observedPath = "";
3785
+ let observedRoute = "";
3786
+ try {
3787
+ const url = new URL(observedUrl, targetUrl);
3788
+ observedUrl = url.href;
3789
+ observedPath = url.pathname;
3790
+ observedRoute = url.pathname + url.search + url.hash;
3791
+ } catch {
3792
+ observedPath = "";
3793
+ observedRoute = "";
3794
+ }
3795
+ return {
3796
+ expected_url: expected && expected.expected_url || undefined,
3797
+ expected_path: expected && expected.expected_path || undefined,
3798
+ observed_url: observedUrl,
3799
+ observed_path: observedPath,
3800
+ observed_route: observedRoute,
3801
+ route_matched: setupUrlMatchesExpectedRoute(observedUrl, expected),
3802
+ route_wait_error: waitError ? String(waitError && waitError.message ? waitError.message : waitError).slice(0, 1000) : undefined,
3803
+ };
3804
+ }
3805
+ async function waitForSetupActionRoute(action, timeout) {
3806
+ const expected = setupActionExpectedRoute(action);
3807
+ if (!expected) return null;
3808
+ let waitError;
3809
+ try {
3810
+ await page.waitForURL((url) => setupUrlMatchesExpectedRoute(url.href, expected), { timeout: Math.min(timeout, 20000) });
3811
+ } catch (error) {
3812
+ waitError = error;
3813
+ }
3814
+ return setupObservedRouteEvidence(expected, waitError);
3815
+ }
3740
3816
  function routeOk(route, targetUrl) {
3741
3817
  return Boolean(route && (route.matched || routePathMatches(route.observed, route.expected_path, targetUrl)) && !route.error && (route.http_status == null || route.http_status < 400));
3742
3818
  }
@@ -6630,11 +6706,22 @@ async function executeSetupAction(action, ordinal, viewport) {
6630
6706
  const prepared = await resolveSetupTapTarget(action, base, scope, timeout);
6631
6707
  if (prepared.result) return prepared.result;
6632
6708
  await dispatchSetupTapPoint(prepared.target.point, prepared.target.pointerType, prepared.target.durationMs);
6709
+ const routeEvidence = await waitForSetupActionRoute(action, timeout);
6710
+ if (routeEvidence && !routeEvidence.route_matched) {
6711
+ return {
6712
+ ...base,
6713
+ ...setupScopeEvidence(scope),
6714
+ ...setupTapTargetEvidence(prepared.target),
6715
+ ...routeEvidence,
6716
+ reason: "expected_route_not_reached",
6717
+ };
6718
+ }
6633
6719
  return {
6634
6720
  ...base,
6635
6721
  ...setupScopeEvidence(scope),
6636
6722
  ok: true,
6637
6723
  ...setupTapTargetEvidence(prepared.target),
6724
+ ...routeEvidence,
6638
6725
  };
6639
6726
  }
6640
6727
  if (type === "tap_until") {
@@ -7495,6 +7582,26 @@ async function executeSetupAction(action, ordinal, viewport) {
7495
7582
  : { x: box.x + box.width / 2, y: box.y + box.height / 2 };
7496
7583
  if (clickCount > 1) await page.mouse.click(fallbackPoint.x, fallbackPoint.y, { clickCount });
7497
7584
  else await page.mouse.click(fallbackPoint.x, fallbackPoint.y);
7585
+ const routeEvidence = await waitForSetupActionRoute(action, timeout);
7586
+ if (routeEvidence && !routeEvidence.route_matched) {
7587
+ return {
7588
+ ...base,
7589
+ ...setupScopeEvidence(scope),
7590
+ count,
7591
+ target_index: targetIndex,
7592
+ text: matchedText,
7593
+ force: action.force === true || undefined,
7594
+ fallback_to_tap: true,
7595
+ input_dispatch: "playwright_mouse",
7596
+ click_error: String(error && error.message ? error.message : error).slice(0, 1000),
7597
+ click_count: clickCount > 1 ? clickCount : undefined,
7598
+ coordinate_mode: mode,
7599
+ x: position ? fromX : undefined,
7600
+ y: position ? fromY : undefined,
7601
+ ...routeEvidence,
7602
+ reason: "expected_route_not_reached",
7603
+ };
7604
+ }
7498
7605
  return {
7499
7606
  ...base,
7500
7607
  ...setupScopeEvidence(scope),
@@ -7510,6 +7617,24 @@ async function executeSetupAction(action, ordinal, viewport) {
7510
7617
  coordinate_mode: mode,
7511
7618
  x: position ? fromX : undefined,
7512
7619
  y: position ? fromY : undefined,
7620
+ ...routeEvidence,
7621
+ };
7622
+ }
7623
+ const routeEvidence = await waitForSetupActionRoute(action, timeout);
7624
+ if (routeEvidence && !routeEvidence.route_matched) {
7625
+ return {
7626
+ ...base,
7627
+ ...setupScopeEvidence(scope),
7628
+ count,
7629
+ target_index: targetIndex,
7630
+ text: matchedText,
7631
+ force: action.force === true || undefined,
7632
+ click_count: clickCount > 1 ? clickCount : undefined,
7633
+ coordinate_mode: mode,
7634
+ x: position ? fromX : undefined,
7635
+ y: position ? fromY : undefined,
7636
+ ...routeEvidence,
7637
+ reason: "expected_route_not_reached",
7513
7638
  };
7514
7639
  }
7515
7640
  return {
@@ -7524,6 +7649,7 @@ async function executeSetupAction(action, ordinal, viewport) {
7524
7649
  coordinate_mode: mode,
7525
7650
  x: position ? fromX : undefined,
7526
7651
  y: position ? fromY : undefined,
7652
+ ...routeEvidence,
7527
7653
  };
7528
7654
  }
7529
7655
  if (type === "fill" || type === "set_input_value") {
@@ -23,7 +23,7 @@ import {
23
23
  resolveRiddleProofProfileTimeoutSec,
24
24
  slugifyRiddleProofProfileName,
25
25
  summarizeRiddleProofProfileResult
26
- } from "../chunk-PEWAIEER.js";
26
+ } from "../chunk-Z2LCVROU.js";
27
27
  import "../chunk-MLKGABMK.js";
28
28
  export {
29
29
  RIDDLE_PROOF_PROFILE_CHECK_TYPES,
package/dist/profile.cjs CHANGED
@@ -1378,6 +1378,8 @@ function normalizeSetupAction(input, index) {
1378
1378
  expect_changed: booleanValue(valueFromOwn(input, "expect_changed", "expectChanged", "should_change", "shouldChange", "changed")),
1379
1379
  until_path: untilPath,
1380
1380
  until_expected_value: hasUntilExpectedValue ? toJsonValue(valueFromOwn(input, "until_expected_value", "untilExpectedValue", "until_expected", "untilExpected", "until_value", "untilValue", "expected_value", "expectedValue", "expected")) : void 0,
1381
+ expected_path: stringFromOwn(input, "expected_path", "expectedPath", "expected_terminal_path", "expectedTerminalPath"),
1382
+ expected_url: stringFromOwn(input, "expected_url", "expectedUrl", "expected_terminal_url", "expectedTerminalUrl"),
1381
1383
  max_calls: maxCalls,
1382
1384
  tap_burst_size: tapBurstSize,
1383
1385
  settle_ms: settleMs,
@@ -3735,6 +3737,80 @@ function routePathMatches(observed, expected, targetUrl) {
3735
3737
  if (normalizedObserved === normalizedExpected) return true;
3736
3738
  return normalizedObserved === normalizeRoutePath(mountedExpectedRoutePath(targetUrl, expected));
3737
3739
  }
3740
+ function setupActionExpectedRoute(action) {
3741
+ const expectedUrl = typeof action.expected_url === "string" && action.expected_url.trim()
3742
+ ? action.expected_url.trim()
3743
+ : typeof action.expectedUrl === "string" && action.expectedUrl.trim()
3744
+ ? action.expectedUrl.trim()
3745
+ : "";
3746
+ const expectedPath = typeof action.expected_path === "string" && action.expected_path.trim()
3747
+ ? action.expected_path.trim()
3748
+ : typeof action.expectedPath === "string" && action.expectedPath.trim()
3749
+ ? action.expectedPath.trim()
3750
+ : "";
3751
+ if (!expectedUrl && !expectedPath) return null;
3752
+ return { expected_url: expectedUrl || undefined, expected_path: expectedPath || undefined };
3753
+ }
3754
+ function setupUrlMatchesExpectedRoute(href, expected) {
3755
+ if (!expected) return true;
3756
+ let observedUrl;
3757
+ try {
3758
+ observedUrl = new URL(href, targetUrl);
3759
+ } catch {
3760
+ return false;
3761
+ }
3762
+ if (expected.expected_url) {
3763
+ let expectedUrl;
3764
+ try {
3765
+ expectedUrl = new URL(expected.expected_url, targetUrl);
3766
+ } catch {
3767
+ return false;
3768
+ }
3769
+ return observedUrl.href === expectedUrl.href;
3770
+ }
3771
+ const expectedPath = expected.expected_path || "/";
3772
+ if (/[?#]/.test(expectedPath)) {
3773
+ const observedRoute = observedUrl.pathname + observedUrl.search + observedUrl.hash;
3774
+ const normalizedObservedRoute = observedRoute === "/" ? "/" : observedRoute.replace(/\/+(?=[?#]|$)/, "");
3775
+ const normalizedExpectedRoute = expectedPath === "/" ? "/" : expectedPath.replace(/\/+(?=[?#]|$)/, "");
3776
+ return normalizedObservedRoute === normalizedExpectedRoute;
3777
+ }
3778
+ return routePathMatches(observedUrl.pathname, expectedPath, targetUrl);
3779
+ }
3780
+ function setupObservedRouteEvidence(expected, waitError) {
3781
+ let observedUrl = page.url();
3782
+ let observedPath = "";
3783
+ let observedRoute = "";
3784
+ try {
3785
+ const url = new URL(observedUrl, targetUrl);
3786
+ observedUrl = url.href;
3787
+ observedPath = url.pathname;
3788
+ observedRoute = url.pathname + url.search + url.hash;
3789
+ } catch {
3790
+ observedPath = "";
3791
+ observedRoute = "";
3792
+ }
3793
+ return {
3794
+ expected_url: expected && expected.expected_url || undefined,
3795
+ expected_path: expected && expected.expected_path || undefined,
3796
+ observed_url: observedUrl,
3797
+ observed_path: observedPath,
3798
+ observed_route: observedRoute,
3799
+ route_matched: setupUrlMatchesExpectedRoute(observedUrl, expected),
3800
+ route_wait_error: waitError ? String(waitError && waitError.message ? waitError.message : waitError).slice(0, 1000) : undefined,
3801
+ };
3802
+ }
3803
+ async function waitForSetupActionRoute(action, timeout) {
3804
+ const expected = setupActionExpectedRoute(action);
3805
+ if (!expected) return null;
3806
+ let waitError;
3807
+ try {
3808
+ await page.waitForURL((url) => setupUrlMatchesExpectedRoute(url.href, expected), { timeout: Math.min(timeout, 20000) });
3809
+ } catch (error) {
3810
+ waitError = error;
3811
+ }
3812
+ return setupObservedRouteEvidence(expected, waitError);
3813
+ }
3738
3814
  function routeOk(route, targetUrl) {
3739
3815
  return Boolean(route && (route.matched || routePathMatches(route.observed, route.expected_path, targetUrl)) && !route.error && (route.http_status == null || route.http_status < 400));
3740
3816
  }
@@ -6628,11 +6704,22 @@ async function executeSetupAction(action, ordinal, viewport) {
6628
6704
  const prepared = await resolveSetupTapTarget(action, base, scope, timeout);
6629
6705
  if (prepared.result) return prepared.result;
6630
6706
  await dispatchSetupTapPoint(prepared.target.point, prepared.target.pointerType, prepared.target.durationMs);
6707
+ const routeEvidence = await waitForSetupActionRoute(action, timeout);
6708
+ if (routeEvidence && !routeEvidence.route_matched) {
6709
+ return {
6710
+ ...base,
6711
+ ...setupScopeEvidence(scope),
6712
+ ...setupTapTargetEvidence(prepared.target),
6713
+ ...routeEvidence,
6714
+ reason: "expected_route_not_reached",
6715
+ };
6716
+ }
6631
6717
  return {
6632
6718
  ...base,
6633
6719
  ...setupScopeEvidence(scope),
6634
6720
  ok: true,
6635
6721
  ...setupTapTargetEvidence(prepared.target),
6722
+ ...routeEvidence,
6636
6723
  };
6637
6724
  }
6638
6725
  if (type === "tap_until") {
@@ -7493,6 +7580,26 @@ async function executeSetupAction(action, ordinal, viewport) {
7493
7580
  : { x: box.x + box.width / 2, y: box.y + box.height / 2 };
7494
7581
  if (clickCount > 1) await page.mouse.click(fallbackPoint.x, fallbackPoint.y, { clickCount });
7495
7582
  else await page.mouse.click(fallbackPoint.x, fallbackPoint.y);
7583
+ const routeEvidence = await waitForSetupActionRoute(action, timeout);
7584
+ if (routeEvidence && !routeEvidence.route_matched) {
7585
+ return {
7586
+ ...base,
7587
+ ...setupScopeEvidence(scope),
7588
+ count,
7589
+ target_index: targetIndex,
7590
+ text: matchedText,
7591
+ force: action.force === true || undefined,
7592
+ fallback_to_tap: true,
7593
+ input_dispatch: "playwright_mouse",
7594
+ click_error: String(error && error.message ? error.message : error).slice(0, 1000),
7595
+ click_count: clickCount > 1 ? clickCount : undefined,
7596
+ coordinate_mode: mode,
7597
+ x: position ? fromX : undefined,
7598
+ y: position ? fromY : undefined,
7599
+ ...routeEvidence,
7600
+ reason: "expected_route_not_reached",
7601
+ };
7602
+ }
7496
7603
  return {
7497
7604
  ...base,
7498
7605
  ...setupScopeEvidence(scope),
@@ -7508,6 +7615,24 @@ async function executeSetupAction(action, ordinal, viewport) {
7508
7615
  coordinate_mode: mode,
7509
7616
  x: position ? fromX : undefined,
7510
7617
  y: position ? fromY : undefined,
7618
+ ...routeEvidence,
7619
+ };
7620
+ }
7621
+ const routeEvidence = await waitForSetupActionRoute(action, timeout);
7622
+ if (routeEvidence && !routeEvidence.route_matched) {
7623
+ return {
7624
+ ...base,
7625
+ ...setupScopeEvidence(scope),
7626
+ count,
7627
+ target_index: targetIndex,
7628
+ text: matchedText,
7629
+ force: action.force === true || undefined,
7630
+ click_count: clickCount > 1 ? clickCount : undefined,
7631
+ coordinate_mode: mode,
7632
+ x: position ? fromX : undefined,
7633
+ y: position ? fromY : undefined,
7634
+ ...routeEvidence,
7635
+ reason: "expected_route_not_reached",
7511
7636
  };
7512
7637
  }
7513
7638
  return {
@@ -7522,6 +7647,7 @@ async function executeSetupAction(action, ordinal, viewport) {
7522
7647
  coordinate_mode: mode,
7523
7648
  x: position ? fromX : undefined,
7524
7649
  y: position ? fromY : undefined,
7650
+ ...routeEvidence,
7525
7651
  };
7526
7652
  }
7527
7653
  if (type === "fill" || type === "set_input_value") {
@@ -145,6 +145,8 @@ interface RiddleProofProfileSetupAction {
145
145
  expect_changed?: boolean;
146
146
  until_path?: string;
147
147
  until_expected_value?: JsonValue;
148
+ expected_path?: string;
149
+ expected_url?: string;
148
150
  max_calls?: number;
149
151
  tap_burst_size?: number;
150
152
  settle_ms?: number;
package/dist/profile.d.ts CHANGED
@@ -145,6 +145,8 @@ interface RiddleProofProfileSetupAction {
145
145
  expect_changed?: boolean;
146
146
  until_path?: string;
147
147
  until_expected_value?: JsonValue;
148
+ expected_path?: string;
149
+ expected_url?: string;
148
150
  max_calls?: number;
149
151
  tap_burst_size?: number;
150
152
  settle_ms?: number;
package/dist/profile.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  resolveRiddleProofProfileTimeoutSec,
24
24
  slugifyRiddleProofProfileName,
25
25
  summarizeRiddleProofProfileResult
26
- } from "./chunk-PEWAIEER.js";
26
+ } from "./chunk-Z2LCVROU.js";
27
27
  import "./chunk-MLKGABMK.js";
28
28
  export {
29
29
  RIDDLE_PROOF_PROFILE_CHECK_TYPES,
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
292
292
  blocking?: boolean;
293
293
  details?: Record<string, unknown>;
294
294
  ok: boolean;
295
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
295
+ action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
296
296
  state_path: string;
297
297
  stage: any;
298
298
  summary: string;
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
382
382
  continueWithStage?: WorkflowStage | null;
383
383
  blocking?: boolean;
384
384
  details?: Record<string, unknown>;
385
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
385
+ action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
386
386
  state_path: string;
387
387
  stage: any;
388
388
  checkpoint: string;
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
659
659
  error?: undefined;
660
660
  } | {
661
661
  ok: boolean;
662
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup";
662
+ action: "setup" | "recon" | "author" | "implement" | "verify" | "ship";
663
663
  state_path: string;
664
664
  stage: any;
665
665
  summary: string;
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
292
292
  blocking?: boolean;
293
293
  details?: Record<string, unknown>;
294
294
  ok: boolean;
295
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
295
+ action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
296
296
  state_path: string;
297
297
  stage: any;
298
298
  summary: string;
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
382
382
  continueWithStage?: WorkflowStage | null;
383
383
  blocking?: boolean;
384
384
  details?: Record<string, unknown>;
385
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
385
+ action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
386
386
  state_path: string;
387
387
  stage: any;
388
388
  checkpoint: string;
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
659
659
  error?: undefined;
660
660
  } | {
661
661
  ok: boolean;
662
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup";
662
+ action: "setup" | "recon" | "author" | "implement" | "verify" | "ship";
663
663
  state_path: string;
664
664
  stage: any;
665
665
  summary: string;
@@ -1,2 +1,2 @@
1
1
  import './proof-run-core-B1GeqkR8.cjs';
2
- export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from './proof-run-engine-4dM37pEx.cjs';
2
+ export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from './proof-run-engine-DYUu2mqY.cjs';
@@ -1,2 +1,2 @@
1
1
  import './proof-run-core-B1GeqkR8.js';
2
- export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from './proof-run-engine-BqaeqAze.js';
2
+ export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from './proof-run-engine-BmNYuOJ7.js';