Agent Harness
Публичная копия обвязки агентной разработки: гейты, journeys, скиллы и шаблоны. Без ключей и личных данных.
Публичная копия обвязки агентной разработки: гейты, journeys, скиллы и шаблоны. Без ключей и личных данных.
const { chromium } = require("playwright-core");
(async () => {
const b = await chromium.launch({ args: ["--force-device-scale-factor=1"] });
const p = await b.newPage({ viewport: { width: 1280, height: 720 }, deviceScaleFactor: 1 });
await p.addInitScript(() => {
window.__frames = []; let prev = 0, t0 = 0;
const tick = (t) => { if (!t0) t0 = t; if (prev) window.__frames.push([+(t - t0).toFixed(0), +(t - prev).toFixed(1)]); prev = t; requestAnimationFrame(tick); };
requestAnimationFrame(tick);
window.__casts = [];
});
await p.goto("http://localhost:5173/arena/", { waitUntil: "networkidle" });
await p.waitForTimeout(1500);
const r = await p.evaluate(async () => {
const a = window.__arena;
a.reset(); window.__frames.length = 0;
const t0 = performance.now();
const casts = [];
const names = ["SLASH","FIRE","FROST","BOLT","HEAL"];
let i = 0;
while (performance.now() - t0 < 20000) {
if (a.phase !== "fight") a.reset();
if (!a.locked) { const k = i++ % 5; if (a.cast(k)) casts.push([(performance.now() - t0).toFixed(0), names[k]]); }
await new Promise((res) => requestAnimationFrame(res));
}
const f = window.__frames.slice();
return { casts, spikes: f.filter((x) => x[1] > 20) };
});
console.log("casts:", JSON.stringify(r.casts));
console.log("spikes:", JSON.stringify(r.spikes));
await b.close();
})();