@proagentstore/cli 0.3.6 → 0.3.7
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.
|
@@ -302,7 +302,8 @@ export async function inspectField(page, action) {
|
|
|
302
302
|
if (t && rx.test(t) && t.length < 180)
|
|
303
303
|
err = t;
|
|
304
304
|
}
|
|
305
|
-
|
|
305
|
+
const disabled = e.hasAttribute("disabled") || e.getAttribute("aria-disabled") === "true" || e.hasAttribute("readonly");
|
|
306
|
+
return { value, invalid, err: err.replace(/\s+/g, " ").slice(0, 180), tag: e.tagName.toLowerCase(), html: (e.outerHTML || "").replace(/\s+/g, " ").slice(0, 500), disabled };
|
|
306
307
|
})
|
|
307
308
|
.catch(() => null);
|
|
308
309
|
if (!info)
|
|
@@ -321,15 +322,22 @@ export async function inspectField(page, action) {
|
|
|
321
322
|
// or belongs to another field — reporting it as REJECTED sent the brain into a
|
|
322
323
|
// false-retry loop on a value that was actually accepted.
|
|
323
324
|
if (info.invalid || (typed && !stuck)) {
|
|
324
|
-
if (info.
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
parts.unshift(
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
325
|
+
if (info.disabled) {
|
|
326
|
+
// A disabled/read-only control can't be changed — it's almost always already
|
|
327
|
+
// set correctly. Tell the brain to move on instead of fixating on it.
|
|
328
|
+
parts.unshift(`ℹ "${action.name}" is DISABLED / read-only — it is likely already set correctly; do NOT keep trying, move on to other fields.`);
|
|
329
|
+
}
|
|
330
|
+
else {
|
|
331
|
+
if (info.err)
|
|
332
|
+
parts.unshift(`⚠ "${action.name}" REJECTED: "${info.err}"`);
|
|
333
|
+
else if (info.invalid)
|
|
334
|
+
parts.unshift(`⚠ "${action.name}" is marked invalid`);
|
|
335
|
+
// Value didn't take / field invalid → show the widget's real DOM so the brain
|
|
336
|
+
// can pick the right interaction (custom dropdown → click to open + click the
|
|
337
|
+
// option by text; masked input → a different shape) instead of blindly retrying.
|
|
338
|
+
if (info.html)
|
|
339
|
+
parts.push(`DOM: <${info.tag}> ${info.html}`);
|
|
340
|
+
}
|
|
333
341
|
}
|
|
334
342
|
return parts.join("; ");
|
|
335
343
|
}
|