@proagentstore/cli 0.4.7 → 0.4.8
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.
|
@@ -761,13 +761,24 @@ export class LocalRunner {
|
|
|
761
761
|
case "check":
|
|
762
762
|
return mcp.callTool("browser_click", { element: label, target: this.refOf(a) });
|
|
763
763
|
case "upload": {
|
|
764
|
-
// Standard two-step: clicking the upload control opens the file chooser,
|
|
765
|
-
// which puts the @playwright/mcp server into its file-chooser modal state;
|
|
766
|
-
// browser_file_upload then resolves that state with the résumé path.
|
|
767
|
-
await mcp.callTool("browser_click", { element: label, target: this.refOf(a) });
|
|
768
764
|
if (!this.applyResumePath)
|
|
769
765
|
throw new RunnerInputError("no résumé file available to upload");
|
|
770
|
-
|
|
766
|
+
// Standard two-step FIRST (respects the brain's target): clicking the upload
|
|
767
|
+
// control opens the file chooser → browser_file_upload attaches the résumé.
|
|
768
|
+
const ref = (a.ref || "").trim();
|
|
769
|
+
if (ref)
|
|
770
|
+
await mcp.callTool("browser_click", { element: label, target: ref }).catch(() => undefined);
|
|
771
|
+
const res = await mcp.callTool("browser_file_upload", { paths: [this.applyResumePath] });
|
|
772
|
+
if (!res.isError || !/modal state|file chooser/i.test(mcp.textOf(res)))
|
|
773
|
+
return res;
|
|
774
|
+
// The target was a LABEL / DROP-ZONE, not the chooser trigger, so no file
|
|
775
|
+
// chooser opened. Fall back to setting the résumé directly on the page's
|
|
776
|
+
// file input — robust across hidden inputs, drop-zones and custom upload
|
|
777
|
+
// widgets (the semantically-correct upload field the brain clicks is often
|
|
778
|
+
// a container, not the button that fires the chooser).
|
|
779
|
+
const page = await this.getActivePage();
|
|
780
|
+
await page.locator('input[type="file"]').first().setInputFiles(this.applyResumePath, { timeout: 8_000 });
|
|
781
|
+
return { content: [{ type: "text", text: "résumé attached directly to the file input" }] };
|
|
771
782
|
}
|
|
772
783
|
case "select":
|
|
773
784
|
return mcp.callTool("browser_select_option", { element: label, target: this.refOf(a), values: [a.text ?? ""] });
|