@riddledc/riddle-proof 0.8.35 → 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/advanced/index.d.cts +1 -1
- package/dist/advanced/index.d.ts +1 -1
- package/dist/advanced/proof-run-engine.d.cts +1 -1
- package/dist/advanced/proof-run-engine.d.ts +1 -1
- package/dist/{chunk-UGHN77PS.js → chunk-E25K5PDM.js} +1 -1
- package/dist/{chunk-PEWAIEER.js → chunk-Z2LCVROU.js} +126 -0
- package/dist/cli/index.js +2 -2
- package/dist/cli.cjs +126 -0
- package/dist/cli.js +2 -2
- package/dist/index.cjs +126 -0
- package/dist/index.js +1 -1
- package/dist/profile/index.cjs +126 -0
- package/dist/profile/index.js +1 -1
- package/dist/profile.cjs +126 -0
- package/dist/profile.d.cts +2 -0
- package/dist/profile.d.ts +2 -0
- package/dist/profile.js +1 -1
- package/dist/{proof-run-engine-BqaeqAze.d.ts → proof-run-engine-BmNYuOJ7.d.ts} +3 -3
- package/dist/{proof-run-engine-4dM37pEx.d.cts → proof-run-engine-DYUu2mqY.d.cts} +3 -3
- package/dist/proof-run-engine.d.cts +1 -1
- package/dist/proof-run-engine.d.ts +1 -1
- package/examples/regression-packs/oc-flow-regression.json +16 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { b as runner } from '../runner-4LJ5z0D-.cjs';
|
|
2
2
|
export { l as engineHarness } from '../engine-harness-LBfqbFSe.cjs';
|
|
3
3
|
export { p as proofRunCore } from '../proof-run-core-B1GeqkR8.cjs';
|
|
4
|
-
export { p as proofRunEngine } from '../proof-run-engine-
|
|
4
|
+
export { p as proofRunEngine } from '../proof-run-engine-DYUu2mqY.cjs';
|
|
5
5
|
import '../types.cjs';
|
package/dist/advanced/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { b as runner } from '../runner-BdQpOkZD.js';
|
|
2
2
|
export { l as engineHarness } from '../engine-harness-CMACHP6A.js';
|
|
3
3
|
export { p as proofRunCore } from '../proof-run-core-B1GeqkR8.js';
|
|
4
|
-
export { p as proofRunEngine } from '../proof-run-engine-
|
|
4
|
+
export { p as proofRunEngine } from '../proof-run-engine-BmNYuOJ7.js';
|
|
5
5
|
import '../types.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-
|
|
1
|
+
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-DYUu2mqY.cjs';
|
|
2
2
|
import '../proof-run-core-B1GeqkR8.cjs';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-
|
|
1
|
+
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-BmNYuOJ7.js';
|
|
2
2
|
import '../proof-run-core-B1GeqkR8.js';
|
|
@@ -1331,6 +1331,8 @@ function normalizeSetupAction(input, index) {
|
|
|
1331
1331
|
expect_changed: booleanValue(valueFromOwn(input, "expect_changed", "expectChanged", "should_change", "shouldChange", "changed")),
|
|
1332
1332
|
until_path: untilPath,
|
|
1333
1333
|
until_expected_value: hasUntilExpectedValue ? toJsonValue(valueFromOwn(input, "until_expected_value", "untilExpectedValue", "until_expected", "untilExpected", "until_value", "untilValue", "expected_value", "expectedValue", "expected")) : void 0,
|
|
1334
|
+
expected_path: stringFromOwn(input, "expected_path", "expectedPath", "expected_terminal_path", "expectedTerminalPath"),
|
|
1335
|
+
expected_url: stringFromOwn(input, "expected_url", "expectedUrl", "expected_terminal_url", "expectedTerminalUrl"),
|
|
1334
1336
|
max_calls: maxCalls,
|
|
1335
1337
|
tap_burst_size: tapBurstSize,
|
|
1336
1338
|
settle_ms: settleMs,
|
|
@@ -3688,6 +3690,80 @@ function routePathMatches(observed, expected, targetUrl) {
|
|
|
3688
3690
|
if (normalizedObserved === normalizedExpected) return true;
|
|
3689
3691
|
return normalizedObserved === normalizeRoutePath(mountedExpectedRoutePath(targetUrl, expected));
|
|
3690
3692
|
}
|
|
3693
|
+
function setupActionExpectedRoute(action) {
|
|
3694
|
+
const expectedUrl = typeof action.expected_url === "string" && action.expected_url.trim()
|
|
3695
|
+
? action.expected_url.trim()
|
|
3696
|
+
: typeof action.expectedUrl === "string" && action.expectedUrl.trim()
|
|
3697
|
+
? action.expectedUrl.trim()
|
|
3698
|
+
: "";
|
|
3699
|
+
const expectedPath = typeof action.expected_path === "string" && action.expected_path.trim()
|
|
3700
|
+
? action.expected_path.trim()
|
|
3701
|
+
: typeof action.expectedPath === "string" && action.expectedPath.trim()
|
|
3702
|
+
? action.expectedPath.trim()
|
|
3703
|
+
: "";
|
|
3704
|
+
if (!expectedUrl && !expectedPath) return null;
|
|
3705
|
+
return { expected_url: expectedUrl || undefined, expected_path: expectedPath || undefined };
|
|
3706
|
+
}
|
|
3707
|
+
function setupUrlMatchesExpectedRoute(href, expected) {
|
|
3708
|
+
if (!expected) return true;
|
|
3709
|
+
let observedUrl;
|
|
3710
|
+
try {
|
|
3711
|
+
observedUrl = new URL(href, targetUrl);
|
|
3712
|
+
} catch {
|
|
3713
|
+
return false;
|
|
3714
|
+
}
|
|
3715
|
+
if (expected.expected_url) {
|
|
3716
|
+
let expectedUrl;
|
|
3717
|
+
try {
|
|
3718
|
+
expectedUrl = new URL(expected.expected_url, targetUrl);
|
|
3719
|
+
} catch {
|
|
3720
|
+
return false;
|
|
3721
|
+
}
|
|
3722
|
+
return observedUrl.href === expectedUrl.href;
|
|
3723
|
+
}
|
|
3724
|
+
const expectedPath = expected.expected_path || "/";
|
|
3725
|
+
if (/[?#]/.test(expectedPath)) {
|
|
3726
|
+
const observedRoute = observedUrl.pathname + observedUrl.search + observedUrl.hash;
|
|
3727
|
+
const normalizedObservedRoute = observedRoute === "/" ? "/" : observedRoute.replace(/\/+(?=[?#]|$)/, "");
|
|
3728
|
+
const normalizedExpectedRoute = expectedPath === "/" ? "/" : expectedPath.replace(/\/+(?=[?#]|$)/, "");
|
|
3729
|
+
return normalizedObservedRoute === normalizedExpectedRoute;
|
|
3730
|
+
}
|
|
3731
|
+
return routePathMatches(observedUrl.pathname, expectedPath, targetUrl);
|
|
3732
|
+
}
|
|
3733
|
+
function setupObservedRouteEvidence(expected, waitError) {
|
|
3734
|
+
let observedUrl = page.url();
|
|
3735
|
+
let observedPath = "";
|
|
3736
|
+
let observedRoute = "";
|
|
3737
|
+
try {
|
|
3738
|
+
const url = new URL(observedUrl, targetUrl);
|
|
3739
|
+
observedUrl = url.href;
|
|
3740
|
+
observedPath = url.pathname;
|
|
3741
|
+
observedRoute = url.pathname + url.search + url.hash;
|
|
3742
|
+
} catch {
|
|
3743
|
+
observedPath = "";
|
|
3744
|
+
observedRoute = "";
|
|
3745
|
+
}
|
|
3746
|
+
return {
|
|
3747
|
+
expected_url: expected && expected.expected_url || undefined,
|
|
3748
|
+
expected_path: expected && expected.expected_path || undefined,
|
|
3749
|
+
observed_url: observedUrl,
|
|
3750
|
+
observed_path: observedPath,
|
|
3751
|
+
observed_route: observedRoute,
|
|
3752
|
+
route_matched: setupUrlMatchesExpectedRoute(observedUrl, expected),
|
|
3753
|
+
route_wait_error: waitError ? String(waitError && waitError.message ? waitError.message : waitError).slice(0, 1000) : undefined,
|
|
3754
|
+
};
|
|
3755
|
+
}
|
|
3756
|
+
async function waitForSetupActionRoute(action, timeout) {
|
|
3757
|
+
const expected = setupActionExpectedRoute(action);
|
|
3758
|
+
if (!expected) return null;
|
|
3759
|
+
let waitError;
|
|
3760
|
+
try {
|
|
3761
|
+
await page.waitForURL((url) => setupUrlMatchesExpectedRoute(url.href, expected), { timeout: Math.min(timeout, 20000) });
|
|
3762
|
+
} catch (error) {
|
|
3763
|
+
waitError = error;
|
|
3764
|
+
}
|
|
3765
|
+
return setupObservedRouteEvidence(expected, waitError);
|
|
3766
|
+
}
|
|
3691
3767
|
function routeOk(route, targetUrl) {
|
|
3692
3768
|
return Boolean(route && (route.matched || routePathMatches(route.observed, route.expected_path, targetUrl)) && !route.error && (route.http_status == null || route.http_status < 400));
|
|
3693
3769
|
}
|
|
@@ -6581,11 +6657,22 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
6581
6657
|
const prepared = await resolveSetupTapTarget(action, base, scope, timeout);
|
|
6582
6658
|
if (prepared.result) return prepared.result;
|
|
6583
6659
|
await dispatchSetupTapPoint(prepared.target.point, prepared.target.pointerType, prepared.target.durationMs);
|
|
6660
|
+
const routeEvidence = await waitForSetupActionRoute(action, timeout);
|
|
6661
|
+
if (routeEvidence && !routeEvidence.route_matched) {
|
|
6662
|
+
return {
|
|
6663
|
+
...base,
|
|
6664
|
+
...setupScopeEvidence(scope),
|
|
6665
|
+
...setupTapTargetEvidence(prepared.target),
|
|
6666
|
+
...routeEvidence,
|
|
6667
|
+
reason: "expected_route_not_reached",
|
|
6668
|
+
};
|
|
6669
|
+
}
|
|
6584
6670
|
return {
|
|
6585
6671
|
...base,
|
|
6586
6672
|
...setupScopeEvidence(scope),
|
|
6587
6673
|
ok: true,
|
|
6588
6674
|
...setupTapTargetEvidence(prepared.target),
|
|
6675
|
+
...routeEvidence,
|
|
6589
6676
|
};
|
|
6590
6677
|
}
|
|
6591
6678
|
if (type === "tap_until") {
|
|
@@ -7446,6 +7533,26 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
7446
7533
|
: { x: box.x + box.width / 2, y: box.y + box.height / 2 };
|
|
7447
7534
|
if (clickCount > 1) await page.mouse.click(fallbackPoint.x, fallbackPoint.y, { clickCount });
|
|
7448
7535
|
else await page.mouse.click(fallbackPoint.x, fallbackPoint.y);
|
|
7536
|
+
const routeEvidence = await waitForSetupActionRoute(action, timeout);
|
|
7537
|
+
if (routeEvidence && !routeEvidence.route_matched) {
|
|
7538
|
+
return {
|
|
7539
|
+
...base,
|
|
7540
|
+
...setupScopeEvidence(scope),
|
|
7541
|
+
count,
|
|
7542
|
+
target_index: targetIndex,
|
|
7543
|
+
text: matchedText,
|
|
7544
|
+
force: action.force === true || undefined,
|
|
7545
|
+
fallback_to_tap: true,
|
|
7546
|
+
input_dispatch: "playwright_mouse",
|
|
7547
|
+
click_error: String(error && error.message ? error.message : error).slice(0, 1000),
|
|
7548
|
+
click_count: clickCount > 1 ? clickCount : undefined,
|
|
7549
|
+
coordinate_mode: mode,
|
|
7550
|
+
x: position ? fromX : undefined,
|
|
7551
|
+
y: position ? fromY : undefined,
|
|
7552
|
+
...routeEvidence,
|
|
7553
|
+
reason: "expected_route_not_reached",
|
|
7554
|
+
};
|
|
7555
|
+
}
|
|
7449
7556
|
return {
|
|
7450
7557
|
...base,
|
|
7451
7558
|
...setupScopeEvidence(scope),
|
|
@@ -7461,6 +7568,24 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
7461
7568
|
coordinate_mode: mode,
|
|
7462
7569
|
x: position ? fromX : undefined,
|
|
7463
7570
|
y: position ? fromY : undefined,
|
|
7571
|
+
...routeEvidence,
|
|
7572
|
+
};
|
|
7573
|
+
}
|
|
7574
|
+
const routeEvidence = await waitForSetupActionRoute(action, timeout);
|
|
7575
|
+
if (routeEvidence && !routeEvidence.route_matched) {
|
|
7576
|
+
return {
|
|
7577
|
+
...base,
|
|
7578
|
+
...setupScopeEvidence(scope),
|
|
7579
|
+
count,
|
|
7580
|
+
target_index: targetIndex,
|
|
7581
|
+
text: matchedText,
|
|
7582
|
+
force: action.force === true || undefined,
|
|
7583
|
+
click_count: clickCount > 1 ? clickCount : undefined,
|
|
7584
|
+
coordinate_mode: mode,
|
|
7585
|
+
x: position ? fromX : undefined,
|
|
7586
|
+
y: position ? fromY : undefined,
|
|
7587
|
+
...routeEvidence,
|
|
7588
|
+
reason: "expected_route_not_reached",
|
|
7464
7589
|
};
|
|
7465
7590
|
}
|
|
7466
7591
|
return {
|
|
@@ -7475,6 +7600,7 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
7475
7600
|
coordinate_mode: mode,
|
|
7476
7601
|
x: position ? fromX : undefined,
|
|
7477
7602
|
y: position ? fromY : undefined,
|
|
7603
|
+
...routeEvidence,
|
|
7478
7604
|
};
|
|
7479
7605
|
}
|
|
7480
7606
|
if (type === "fill" || type === "set_input_value") {
|
package/dist/cli/index.js
CHANGED
package/dist/cli.cjs
CHANGED
|
@@ -9147,6 +9147,8 @@ function normalizeSetupAction(input, index) {
|
|
|
9147
9147
|
expect_changed: booleanValue(valueFromOwn(input, "expect_changed", "expectChanged", "should_change", "shouldChange", "changed")),
|
|
9148
9148
|
until_path: untilPath,
|
|
9149
9149
|
until_expected_value: hasUntilExpectedValue ? toJsonValue(valueFromOwn(input, "until_expected_value", "untilExpectedValue", "until_expected", "untilExpected", "until_value", "untilValue", "expected_value", "expectedValue", "expected")) : void 0,
|
|
9150
|
+
expected_path: stringFromOwn(input, "expected_path", "expectedPath", "expected_terminal_path", "expectedTerminalPath"),
|
|
9151
|
+
expected_url: stringFromOwn(input, "expected_url", "expectedUrl", "expected_terminal_url", "expectedTerminalUrl"),
|
|
9150
9152
|
max_calls: maxCalls,
|
|
9151
9153
|
tap_burst_size: tapBurstSize,
|
|
9152
9154
|
settle_ms: settleMs,
|
|
@@ -11488,6 +11490,80 @@ function routePathMatches(observed, expected, targetUrl) {
|
|
|
11488
11490
|
if (normalizedObserved === normalizedExpected) return true;
|
|
11489
11491
|
return normalizedObserved === normalizeRoutePath(mountedExpectedRoutePath(targetUrl, expected));
|
|
11490
11492
|
}
|
|
11493
|
+
function setupActionExpectedRoute(action) {
|
|
11494
|
+
const expectedUrl = typeof action.expected_url === "string" && action.expected_url.trim()
|
|
11495
|
+
? action.expected_url.trim()
|
|
11496
|
+
: typeof action.expectedUrl === "string" && action.expectedUrl.trim()
|
|
11497
|
+
? action.expectedUrl.trim()
|
|
11498
|
+
: "";
|
|
11499
|
+
const expectedPath = typeof action.expected_path === "string" && action.expected_path.trim()
|
|
11500
|
+
? action.expected_path.trim()
|
|
11501
|
+
: typeof action.expectedPath === "string" && action.expectedPath.trim()
|
|
11502
|
+
? action.expectedPath.trim()
|
|
11503
|
+
: "";
|
|
11504
|
+
if (!expectedUrl && !expectedPath) return null;
|
|
11505
|
+
return { expected_url: expectedUrl || undefined, expected_path: expectedPath || undefined };
|
|
11506
|
+
}
|
|
11507
|
+
function setupUrlMatchesExpectedRoute(href, expected) {
|
|
11508
|
+
if (!expected) return true;
|
|
11509
|
+
let observedUrl;
|
|
11510
|
+
try {
|
|
11511
|
+
observedUrl = new URL(href, targetUrl);
|
|
11512
|
+
} catch {
|
|
11513
|
+
return false;
|
|
11514
|
+
}
|
|
11515
|
+
if (expected.expected_url) {
|
|
11516
|
+
let expectedUrl;
|
|
11517
|
+
try {
|
|
11518
|
+
expectedUrl = new URL(expected.expected_url, targetUrl);
|
|
11519
|
+
} catch {
|
|
11520
|
+
return false;
|
|
11521
|
+
}
|
|
11522
|
+
return observedUrl.href === expectedUrl.href;
|
|
11523
|
+
}
|
|
11524
|
+
const expectedPath = expected.expected_path || "/";
|
|
11525
|
+
if (/[?#]/.test(expectedPath)) {
|
|
11526
|
+
const observedRoute = observedUrl.pathname + observedUrl.search + observedUrl.hash;
|
|
11527
|
+
const normalizedObservedRoute = observedRoute === "/" ? "/" : observedRoute.replace(/\/+(?=[?#]|$)/, "");
|
|
11528
|
+
const normalizedExpectedRoute = expectedPath === "/" ? "/" : expectedPath.replace(/\/+(?=[?#]|$)/, "");
|
|
11529
|
+
return normalizedObservedRoute === normalizedExpectedRoute;
|
|
11530
|
+
}
|
|
11531
|
+
return routePathMatches(observedUrl.pathname, expectedPath, targetUrl);
|
|
11532
|
+
}
|
|
11533
|
+
function setupObservedRouteEvidence(expected, waitError) {
|
|
11534
|
+
let observedUrl = page.url();
|
|
11535
|
+
let observedPath = "";
|
|
11536
|
+
let observedRoute = "";
|
|
11537
|
+
try {
|
|
11538
|
+
const url = new URL(observedUrl, targetUrl);
|
|
11539
|
+
observedUrl = url.href;
|
|
11540
|
+
observedPath = url.pathname;
|
|
11541
|
+
observedRoute = url.pathname + url.search + url.hash;
|
|
11542
|
+
} catch {
|
|
11543
|
+
observedPath = "";
|
|
11544
|
+
observedRoute = "";
|
|
11545
|
+
}
|
|
11546
|
+
return {
|
|
11547
|
+
expected_url: expected && expected.expected_url || undefined,
|
|
11548
|
+
expected_path: expected && expected.expected_path || undefined,
|
|
11549
|
+
observed_url: observedUrl,
|
|
11550
|
+
observed_path: observedPath,
|
|
11551
|
+
observed_route: observedRoute,
|
|
11552
|
+
route_matched: setupUrlMatchesExpectedRoute(observedUrl, expected),
|
|
11553
|
+
route_wait_error: waitError ? String(waitError && waitError.message ? waitError.message : waitError).slice(0, 1000) : undefined,
|
|
11554
|
+
};
|
|
11555
|
+
}
|
|
11556
|
+
async function waitForSetupActionRoute(action, timeout) {
|
|
11557
|
+
const expected = setupActionExpectedRoute(action);
|
|
11558
|
+
if (!expected) return null;
|
|
11559
|
+
let waitError;
|
|
11560
|
+
try {
|
|
11561
|
+
await page.waitForURL((url) => setupUrlMatchesExpectedRoute(url.href, expected), { timeout: Math.min(timeout, 20000) });
|
|
11562
|
+
} catch (error) {
|
|
11563
|
+
waitError = error;
|
|
11564
|
+
}
|
|
11565
|
+
return setupObservedRouteEvidence(expected, waitError);
|
|
11566
|
+
}
|
|
11491
11567
|
function routeOk(route, targetUrl) {
|
|
11492
11568
|
return Boolean(route && (route.matched || routePathMatches(route.observed, route.expected_path, targetUrl)) && !route.error && (route.http_status == null || route.http_status < 400));
|
|
11493
11569
|
}
|
|
@@ -14381,11 +14457,22 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
14381
14457
|
const prepared = await resolveSetupTapTarget(action, base, scope, timeout);
|
|
14382
14458
|
if (prepared.result) return prepared.result;
|
|
14383
14459
|
await dispatchSetupTapPoint(prepared.target.point, prepared.target.pointerType, prepared.target.durationMs);
|
|
14460
|
+
const routeEvidence = await waitForSetupActionRoute(action, timeout);
|
|
14461
|
+
if (routeEvidence && !routeEvidence.route_matched) {
|
|
14462
|
+
return {
|
|
14463
|
+
...base,
|
|
14464
|
+
...setupScopeEvidence(scope),
|
|
14465
|
+
...setupTapTargetEvidence(prepared.target),
|
|
14466
|
+
...routeEvidence,
|
|
14467
|
+
reason: "expected_route_not_reached",
|
|
14468
|
+
};
|
|
14469
|
+
}
|
|
14384
14470
|
return {
|
|
14385
14471
|
...base,
|
|
14386
14472
|
...setupScopeEvidence(scope),
|
|
14387
14473
|
ok: true,
|
|
14388
14474
|
...setupTapTargetEvidence(prepared.target),
|
|
14475
|
+
...routeEvidence,
|
|
14389
14476
|
};
|
|
14390
14477
|
}
|
|
14391
14478
|
if (type === "tap_until") {
|
|
@@ -15246,6 +15333,26 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
15246
15333
|
: { x: box.x + box.width / 2, y: box.y + box.height / 2 };
|
|
15247
15334
|
if (clickCount > 1) await page.mouse.click(fallbackPoint.x, fallbackPoint.y, { clickCount });
|
|
15248
15335
|
else await page.mouse.click(fallbackPoint.x, fallbackPoint.y);
|
|
15336
|
+
const routeEvidence = await waitForSetupActionRoute(action, timeout);
|
|
15337
|
+
if (routeEvidence && !routeEvidence.route_matched) {
|
|
15338
|
+
return {
|
|
15339
|
+
...base,
|
|
15340
|
+
...setupScopeEvidence(scope),
|
|
15341
|
+
count,
|
|
15342
|
+
target_index: targetIndex,
|
|
15343
|
+
text: matchedText,
|
|
15344
|
+
force: action.force === true || undefined,
|
|
15345
|
+
fallback_to_tap: true,
|
|
15346
|
+
input_dispatch: "playwright_mouse",
|
|
15347
|
+
click_error: String(error && error.message ? error.message : error).slice(0, 1000),
|
|
15348
|
+
click_count: clickCount > 1 ? clickCount : undefined,
|
|
15349
|
+
coordinate_mode: mode,
|
|
15350
|
+
x: position ? fromX : undefined,
|
|
15351
|
+
y: position ? fromY : undefined,
|
|
15352
|
+
...routeEvidence,
|
|
15353
|
+
reason: "expected_route_not_reached",
|
|
15354
|
+
};
|
|
15355
|
+
}
|
|
15249
15356
|
return {
|
|
15250
15357
|
...base,
|
|
15251
15358
|
...setupScopeEvidence(scope),
|
|
@@ -15261,6 +15368,24 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
15261
15368
|
coordinate_mode: mode,
|
|
15262
15369
|
x: position ? fromX : undefined,
|
|
15263
15370
|
y: position ? fromY : undefined,
|
|
15371
|
+
...routeEvidence,
|
|
15372
|
+
};
|
|
15373
|
+
}
|
|
15374
|
+
const routeEvidence = await waitForSetupActionRoute(action, timeout);
|
|
15375
|
+
if (routeEvidence && !routeEvidence.route_matched) {
|
|
15376
|
+
return {
|
|
15377
|
+
...base,
|
|
15378
|
+
...setupScopeEvidence(scope),
|
|
15379
|
+
count,
|
|
15380
|
+
target_index: targetIndex,
|
|
15381
|
+
text: matchedText,
|
|
15382
|
+
force: action.force === true || undefined,
|
|
15383
|
+
click_count: clickCount > 1 ? clickCount : undefined,
|
|
15384
|
+
coordinate_mode: mode,
|
|
15385
|
+
x: position ? fromX : undefined,
|
|
15386
|
+
y: position ? fromY : undefined,
|
|
15387
|
+
...routeEvidence,
|
|
15388
|
+
reason: "expected_route_not_reached",
|
|
15264
15389
|
};
|
|
15265
15390
|
}
|
|
15266
15391
|
return {
|
|
@@ -15275,6 +15400,7 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
15275
15400
|
coordinate_mode: mode,
|
|
15276
15401
|
x: position ? fromX : undefined,
|
|
15277
15402
|
y: position ? fromY : undefined,
|
|
15403
|
+
...routeEvidence,
|
|
15278
15404
|
};
|
|
15279
15405
|
}
|
|
15280
15406
|
if (type === "fill" || type === "set_input_value") {
|
package/dist/cli.js
CHANGED
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-
|
|
65
|
+
} from "./chunk-Z2LCVROU.js";
|
|
66
66
|
import {
|
|
67
67
|
DEFAULT_RIDDLE_API_BASE_URL,
|
|
68
68
|
DEFAULT_RIDDLE_API_KEY_FILE,
|
package/dist/profile/index.cjs
CHANGED
|
@@ -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") {
|
package/dist/profile/index.js
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
resolveRiddleProofProfileTimeoutSec,
|
|
24
24
|
slugifyRiddleProofProfileName,
|
|
25
25
|
summarizeRiddleProofProfileResult
|
|
26
|
-
} from "../chunk-
|
|
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") {
|
package/dist/profile.d.cts
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.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-
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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-
|
|
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-
|
|
2
|
+
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from './proof-run-engine-BmNYuOJ7.js';
|
|
@@ -67,7 +67,14 @@
|
|
|
67
67
|
"wait_for_selector": "main#main-content",
|
|
68
68
|
"viewports": [{ "name": "desktop", "width": 1280, "height": 900 }],
|
|
69
69
|
"setup_actions": [
|
|
70
|
-
{
|
|
70
|
+
{
|
|
71
|
+
"type": "click",
|
|
72
|
+
"selector": "a[href*='/proof']",
|
|
73
|
+
"text": "Proof",
|
|
74
|
+
"expected_path": "/proof/",
|
|
75
|
+
"timeout_ms": 10000,
|
|
76
|
+
"after_ms": 750
|
|
77
|
+
}
|
|
71
78
|
]
|
|
72
79
|
},
|
|
73
80
|
"checks": [
|
|
@@ -93,7 +100,14 @@
|
|
|
93
100
|
"wait_for_selector": "main#main-content",
|
|
94
101
|
"viewports": [{ "name": "desktop", "width": 1280, "height": 900 }],
|
|
95
102
|
"setup_actions": [
|
|
96
|
-
{
|
|
103
|
+
{
|
|
104
|
+
"type": "click",
|
|
105
|
+
"selector": "a[href='/'], a[href='https://riddledc.com/']",
|
|
106
|
+
"text": "Riddle",
|
|
107
|
+
"expected_path": "/",
|
|
108
|
+
"timeout_ms": 10000,
|
|
109
|
+
"after_ms": 750
|
|
110
|
+
}
|
|
97
111
|
]
|
|
98
112
|
},
|
|
99
113
|
"checks": [
|