feat: rebuild the orbital vault as an operational map

This commit is contained in:
2026-11-09 22:01:14 +07:00
parent 2129e80c38
commit fba4a1e628
25 changed files with 1342 additions and 1333 deletions

View File

@@ -1,21 +1,27 @@
import { tmpdir } from "node:os";
import { join } from "node:path";
import { chromium } from "playwright";
const base = process.env.TESSERA_URL ?? "http://127.0.0.1:8787/";
const outFlow =
process.env.FLOW_SHOT ?? "/cursor/stores/self/media/tessera-galaxy-flow-polish.png";
const outLock =
process.env.LOCK_SHOT ?? "/cursor/stores/self/media/tessera-galaxy-locked-polish.png";
const outFlow = process.env.FLOW_SHOT ?? join(tmpdir(), "tessera-galaxy-flowing.png");
const outLock = process.env.LOCK_SHOT ?? join(tmpdir(), "tessera-galaxy-locked.png");
const browser = await chromium.launch({ headless: true });
const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
await page.goto(base, { waitUntil: "networkidle", timeout: 30_000 });
await page.waitForTimeout(2500);
await page.screenshot({ path: outFlow, fullPage: false });
const svg = page.locator('[aria-label="Galaxy vault viewport"]');
const box = await svg.boundingBox();
if (!box) throw new Error("galaxy svg not found");
await page.mouse.click(box.x + box.width / 2, box.y + box.height / 2);
await page.waitForTimeout(1400);
await page.screenshot({ path: outLock, fullPage: false });
await browser.close();
console.log("saved", outFlow, outLock);
try {
const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
const [orbitResponse] = await Promise.all([
page.waitForResponse((response) => new URL(response.url()).pathname === "/api/v1/orbits" && response.ok()),
page.goto(base),
]);
await page.getByText("Hub online", { exact: true }).waitFor();
await page.screenshot({ path: outFlow });
const firstOrbit = page.locator(".register-row").first();
if ((await orbitResponse.json()).length) await firstOrbit.click();
else await page.getByRole("button", { name: "Pause motion" }).click();
await page.getByRole("button", { name: "Resume motion" }).waitFor();
await page.screenshot({ path: outLock });
console.log("saved", outFlow, outLock);
} finally {
await browser.close();
}