@proagentstore/cli 0.4.5 → 0.4.6
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.
|
@@ -689,6 +689,17 @@ export class LocalRunner {
|
|
|
689
689
|
const head = (cut >= 0 ? text.slice(0, cut) : text).replace(/```[a-z]*\n?|```/g, " ").replace(/\s+/g, " ").trim();
|
|
690
690
|
return head.slice(0, 400);
|
|
691
691
|
}
|
|
692
|
+
/** A small JPEG screenshot (base64, no data: prefix) of the page — one per action,
|
|
693
|
+
* so the cloud can store it per step and the whole run can be replayed visually. */
|
|
694
|
+
async shot(page) {
|
|
695
|
+
try {
|
|
696
|
+
const buf = await page.screenshot({ type: "jpeg", quality: 45 });
|
|
697
|
+
return buf.toString("base64");
|
|
698
|
+
}
|
|
699
|
+
catch {
|
|
700
|
+
return undefined;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
692
703
|
/**
|
|
693
704
|
* After a WRITE action, read the field's REAL value back via the standard
|
|
694
705
|
* browser_evaluate tool (evaluates on the element by ref — no reinvented DOM
|
|
@@ -832,6 +843,7 @@ export class LocalRunner {
|
|
|
832
843
|
url: active.url(),
|
|
833
844
|
title: await active.title().catch(() => ""),
|
|
834
845
|
challenge: await detectHumanChallenge(active),
|
|
846
|
+
screenshot: await this.shot(active),
|
|
835
847
|
};
|
|
836
848
|
}
|
|
837
849
|
const mcp = await this.getMcp();
|
|
@@ -855,6 +867,7 @@ export class LocalRunner {
|
|
|
855
867
|
title: await settled.title().catch(() => ""),
|
|
856
868
|
challenge: await detectHumanChallenge(settled),
|
|
857
869
|
feedback: dialogMsg ? `a native dialog was accepted: "${dialogMsg}"` : "a native dialog was accepted",
|
|
870
|
+
screenshot: await this.shot(settled),
|
|
858
871
|
};
|
|
859
872
|
}
|
|
860
873
|
if (res.isError)
|
|
@@ -887,6 +900,7 @@ export class LocalRunner {
|
|
|
887
900
|
title: await active.title().catch(() => ""),
|
|
888
901
|
challenge: await detectHumanChallenge(active),
|
|
889
902
|
feedback: feedback || undefined,
|
|
903
|
+
screenshot: await this.shot(active),
|
|
890
904
|
};
|
|
891
905
|
}
|
|
892
906
|
// ── Agent-driven application lifecycle (called by the remote Workflow brain) ──
|