@proagentstore/cli 0.1.24 → 0.1.25
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.
|
@@ -177,7 +177,20 @@ export async function performBrowserAction(page, action, clickRobustly, resumeFi
|
|
|
177
177
|
case "wait":
|
|
178
178
|
await page.waitForTimeout(Math.min(5_000, action.ms ?? 1_000));
|
|
179
179
|
break;
|
|
180
|
-
default:
|
|
181
|
-
|
|
180
|
+
default: {
|
|
181
|
+
const name = String(action.action || "");
|
|
182
|
+
// The brain sometimes invents click variants (triple_click / double_click
|
|
183
|
+
// to select a field's text before retyping). Handle them generically
|
|
184
|
+
// rather than failing the whole task — clickCount selects the text.
|
|
185
|
+
if (/click/i.test(name)) {
|
|
186
|
+
const loc = locate();
|
|
187
|
+
const clickCount = /triple/i.test(name) ? 3 : /double|dbl/i.test(name) ? 2 : 1;
|
|
188
|
+
if (!(await loc.click({ clickCount, timeout: 6_000 }).then(() => true).catch(() => false))) {
|
|
189
|
+
await clickRobustly(page, loc);
|
|
190
|
+
}
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
throw new RunnerInputError(`Unsupported action "${name}". Use one of: click, type, select, check, upload, navigate, scroll, key, wait. To clear or replace a field, use "type" — it overwrites the existing value.`);
|
|
194
|
+
}
|
|
182
195
|
}
|
|
183
196
|
}
|