@proagentstore/cli 0.1.24 → 0.1.26
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
|
}
|
package/dist/index.js
CHANGED
|
@@ -1241,9 +1241,9 @@ async function waitForKey(keys) {
|
|
|
1241
1241
|
process.exit(0);
|
|
1242
1242
|
}
|
|
1243
1243
|
const val = (str || "").trim().toLowerCase();
|
|
1244
|
-
if (keys.includes(val)) {
|
|
1244
|
+
if (keys.length === 0 || keys.includes(val) || key?.name && keys.includes(key.name)) {
|
|
1245
1245
|
cleanup();
|
|
1246
|
-
resolve5(val);
|
|
1246
|
+
resolve5(val || key?.name || "");
|
|
1247
1247
|
}
|
|
1248
1248
|
};
|
|
1249
1249
|
const cleanup = () => {
|
|
@@ -1406,7 +1406,7 @@ var upCommand = new Command7("up").description("Start the browser runner for all
|
|
|
1406
1406
|
}
|
|
1407
1407
|
writeLine("");
|
|
1408
1408
|
writeLine(" Press any key to go back...");
|
|
1409
|
-
await waitForKey([
|
|
1409
|
+
await waitForKey([]);
|
|
1410
1410
|
printStatus(state);
|
|
1411
1411
|
}
|
|
1412
1412
|
if (key === "r") {
|