Agent Harness
Публичная копия обвязки агентной разработки: гейты, journeys, скиллы и шаблоны. Без ключей и личных данных.
Публичная копия обвязки агентной разработки: гейты, journeys, скиллы и шаблоны. Без ключей и личных данных.
const { chromium } = require("playwright-core");
const OUT = "<HOME>/Projects/pixelfx/arena/shots";
(async () => {
const b = await chromium.launch({ channel: "chrome" });
const p = await b.newPage({ viewport: { width: 1280, height: 720 }, deviceScaleFactor: 1 });
p.on("pageerror", (e) => console.log("ERR", e.message));
await p.goto("http://localhost:5173/arena/library.html", { waitUntil: "networkidle" });
await p.waitForTimeout(1200);
await p.evaluate(async () => {
const h = document.body.scrollHeight;
for (let y = 0; y < h; y += 150) { window.scrollTo(0, y); await new Promise((r) => setTimeout(r, 120)); }
});
await p.waitForTimeout(500);
await p.evaluate(() => document.getElementById("transitions").scrollIntoView());
await p.waitForTimeout(3000);
// any tile in view still empty?
const empty = await p.evaluate(() => {
const out = [];
for (const fig of document.querySelectorAll(".tile")) {
const r = fig.getBoundingClientRect();
if (r.bottom < 0 || r.top > innerHeight) continue;
const cv = fig.querySelector("canvas");
const d = cv.getContext("2d").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] > 90) lit++;
if (!cv.width || lit < 20) out.push([fig.querySelector("b").textContent, cv.width, lit]);
}
return out;
});
console.log("empty in view:", JSON.stringify(empty));
await p.screenshot({ path: OUT + "/library-transitions.png" });
await b.close();
})();