Agent Harness
Публичная копия обвязки агентной разработки: гейты, journeys, скиллы и шаблоны. Без ключей и личных данных.
Публичная копия обвязки агентной разработки: гейты, journeys, скиллы и шаблоны. Без ключей и личных данных.
const { chromium } = require("playwright-core");
(async () => {
const b = await chromium.launch({ channel: "chrome" });
const p = await b.newPage({ viewport: { width: 1280, height: 720 }, deviceScaleFactor: 1 });
await p.goto("http://localhost:5173/arena/library.html", { waitUntil: "networkidle" });
// scroll the whole page slowly so every tile gets a poster
await p.evaluate(async () => {
const h = document.body.scrollHeight;
for (let y = 0; y < h; y += 200) { window.scrollTo(0, y); await new Promise((r) => setTimeout(r, 250)); }
});
await p.waitForTimeout(6000);
const r = await p.evaluate(() => {
const out = [];
for (const fig of document.querySelectorAll(".tile")) {
const cv = fig.querySelector("canvas");
if (!cv.width) { out.push([fig.querySelector("b").textContent, "no-canvas"]); continue; }
const ctx = cv.getContext("2d");
const d = ctx.getImageData(0, 0, cv.width, cv.height).data;
let lit = 0;
for (let i = 0; i < d.length; i += 4) if (d[i] + d[i + 1] + d[i + 2] > 150) lit++;
const frac = lit / (d.length / 4);
if (frac < 0.004) out.push([fig.querySelector("b").textContent, +(frac * 100).toFixed(2)]);
}
return out;
});
console.log(JSON.stringify(r));
await b.close();
})();