@proagentstore/cli 0.4.1 → 0.4.2
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.
|
@@ -712,8 +712,7 @@ export class LocalRunner {
|
|
|
712
712
|
return mcp.callTool("browser_select_option", { element: label, target: this.refOf(a), values: [a.text ?? ""] });
|
|
713
713
|
case "key":
|
|
714
714
|
return mcp.callTool("browser_press_key", { key: a.key || "Enter" });
|
|
715
|
-
|
|
716
|
-
return mcp.callTool("browser_evaluate", { function: `() => window.scrollBy(0, ${Math.round(a.dy ?? 600)})` });
|
|
715
|
+
// scroll is handled before this mapper (mouse-wheel on the live page).
|
|
717
716
|
case "wait":
|
|
718
717
|
return mcp.callTool("browser_wait_for", { time: Math.min(5, Math.max(0.1, (a.ms ?? 1000) / 1000)) });
|
|
719
718
|
default:
|
|
@@ -764,6 +763,22 @@ export class LocalRunner {
|
|
|
764
763
|
}
|
|
765
764
|
if (this.applyResumePath)
|
|
766
765
|
this.armFileAutoAttach(page, this.applyResumePath);
|
|
766
|
+
// Scroll is a VIEWPORT primitive, not an element action — no ref, no standard
|
|
767
|
+
// tool in @playwright/mcp 0.0.77. Use the mouse wheel on the live page (as the
|
|
768
|
+
// prior runtime did): it scrolls the actual hovered/inner scroll container,
|
|
769
|
+
// whereas window.scrollBy is a no-op on sites that scroll an inner panel (e.g.
|
|
770
|
+
// PageUp/Coles), which made the brain scroll-loop forever.
|
|
771
|
+
if (action.action === "scroll") {
|
|
772
|
+
await page.mouse.wheel(0, Math.round(action.dy ?? 600)).catch(() => undefined);
|
|
773
|
+
await page.waitForTimeout(300).catch(() => undefined);
|
|
774
|
+
const active = await this.getActivePage();
|
|
775
|
+
return {
|
|
776
|
+
ok: true,
|
|
777
|
+
url: active.url(),
|
|
778
|
+
title: await active.title().catch(() => ""),
|
|
779
|
+
challenge: await detectHumanChallenge(active),
|
|
780
|
+
};
|
|
781
|
+
}
|
|
767
782
|
const mcp = await this.getMcp();
|
|
768
783
|
const res = await this.callBrowserTool(mcp, action);
|
|
769
784
|
const text = mcp.textOf(res).trim();
|