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 });
p.on("pageerror", (e) => console.log("ERR", e.message));
await p.goto("http://localhost:5173/arena/library.html", { waitUntil: "networkidle" });
await p.waitForTimeout(1200);
// a person's pass down the page, then back up to transitions
await p.evaluate(async () => {
const h = document.body.scrollHeight;
for (let y = 0; y < h; y += 120) { window.scrollTo(0, y); await new Promise((r) => setTimeout(r, 100)); }
});
await p.waitForTimeout(1200);
await p.evaluate(() => document.getElementById("transitions").scrollIntoView());
await p.waitForTimeout(2500);
const r = await p.evaluate(() => {
const out = [];
for (const fig of document.querySelectorAll(".tile")) {
const rect = fig.getBoundingClientRect();
if (rect.bottom < 0 || rect.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] > 60) lit++;
out.push([fig.querySelector("b").textContent, cv.width, lit]);
}
return out;
});
console.log(JSON.stringify(r));
await p.screenshot({ path: "<HOME>/Projects/pixelfx/arena/shots/library-transitions.png" });
await b.close();
})();