An agent skill for creating detailed, interactive isometric illustrations of real-world machines and complex systems. Generates polished SVGs with optional WebGL shaders and 3D effects.
Start headless Chrome on Linux; let publish --submit replace a leftover local folder
Charlie Joseph8afa22ec7daf
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex ffd6fc7..a2d9f20 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -14,6 +14,8 @@ All notable changes to Anatomy are recorded here. The format follows [Keep a Cha### Fixed+- Start headless Chrome on Linux: `capture.mjs`, `drive.mjs` and `turn-check.mjs` pass `--no-sandbox` there and find Playwright's Linux Chromium under `~/.cache/ms-playwright`, so the browser checks and the gallery's validator run on Linux hosts.+- `publish.mjs --submit` no longer stops with "already exists" when an earlier run without `--submit` left the figure's folder in the clone; it only asks for `--force` when the folder is already on the gallery's main.- Preserve configured pipe clearances in broad-phase solid and pipe sampling.- Observe replacement and late-mounted DOM targets through useInView.- Check texture line attachments against rounded rectangle corners, including separate radii, SVG clamping and transformed outlines.diff --git a/scripts/capture.mjs b/scripts/capture.mjsindex 1622fdc..419a3f6 100644--- a/scripts/capture.mjs+++ b/scripts/capture.mjs@@ -82,6 +82,8 @@ function chromePath() {}}}+ const linux = join(homedir(), ".cache/ms-playwright");+ if (existsSync(linux)) for (const dir of readdirSync(linux).sort().reverse()) for (const sub of ["chrome-linux64/chrome", "chrome-linux/chrome"]) candidates.push(join(linux, dir, sub));return candidates.find((path) => existsSync(path));}@@ -100,7 +102,7 @@ async function main() {}const profile = mkdtempSync(join(tmpdir(), "iso-capture-"));const chrome = spawn(binary, [- "--headless=new",+ "--headless=new", ...(process.platform === "linux" ? ["--no-sandbox"] : []),"--remote-debugging-port=0",`--user-data-dir=${profile}`,"--no-first-run",diff --git a/scripts/drive.mjs b/scripts/drive.mjsindex e8d60af..f4eb138 100644--- a/scripts/drive.mjs+++ b/scripts/drive.mjs@@ -78,6 +78,8 @@ function chromePath() {}}}+ const linux = join(homedir(), ".cache/ms-playwright");+ if (existsSync(linux)) for (const dir of readdirSync(linux).sort().reverse()) for (const sub of ["chrome-linux64/chrome", "chrome-linux/chrome"]) candidates.push(join(linux, dir, sub));return candidates.find((path) => existsSync(path));}@@ -115,7 +117,7 @@ async function main() {process.exit(1);}const profile = mkdtempSync(join(tmpdir(), "iso-drive-"));- const chrome = spawn(binary, ["--headless=new", "--remote-debugging-port=0", `--user-data-dir=${profile}`, "--no-first-run", "--no-default-browser-check", "--hide-scrollbars", "--allow-file-access-from-files", "--enable-unsafe-swiftshader", "--ignore-gpu-blocklist", "about:blank"]);+ const chrome = spawn(binary, ["--headless=new", ...(process.platform === "linux" ? ["--no-sandbox"] : []), "--remote-debugging-port=0", `--user-data-dir=${profile}`, "--no-first-run", "--no-default-browser-check", "--hide-scrollbars", "--allow-file-access-from-files", "--enable-unsafe-swiftshader", "--ignore-gpu-blocklist", "about:blank"]);const port = await chromePort(chrome, profile);const finish = (code) => {chrome.kill("SIGKILL");diff --git a/scripts/publish.mjs b/scripts/publish.mjsindex 039eb01..86e12a9 100644--- a/scripts/publish.mjs+++ b/scripts/publish.mjs@@ -264,7 +264,10 @@ async function submit(options) {for (const step of plan.steps) {if (step.gh) run("gh", step.gh);if (step.git) run("git", step.git);- if (step.publish) published = publish({ ...options, log: (line) => console.log(` ${line}`) });+ if (step.publish) {+ const onMain = run("git", ["ls-tree", "--name-only", "HEAD", "--", plan.folder]) !== "";+ published = publish({ ...options, force: options.force || !onMain, log: (line) => console.log(` ${line}`) });+ }if (step.pr) {const open = gh(["pr", "list", "--repo", step.pr.repo, "--head", plan.branch, "--state", "open", "--json", "url", "--jq", ".[0].url"]).stdout.trim();const url = open || run("gh", ["pr", "create", "--repo", step.pr.repo, "--base", "main", "--head", step.pr.head, "--title", step.pr.title, "--body", `${published.figure.prompt}\n\nPublished with Anatomy's publish.mjs.`]);diff --git a/scripts/turn-check.mjs b/scripts/turn-check.mjsindex ed3c1ce..ec609a3 100644--- a/scripts/turn-check.mjs+++ b/scripts/turn-check.mjs@@ -31,12 +31,14 @@ function chromePath() {const candidates = [process.env.CHROME_PATH, "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome", "/Applications/Chromium.app/Contents/MacOS/Chromium", "/usr/bin/google-chrome", "/usr/bin/google-chrome-stable", "/usr/bin/chromium", "/usr/bin/chromium-browser"].filter(Boolean);const playwright = join(homedir(), "Library/Caches/ms-playwright");if (existsSync(playwright)) for (const dir of readdirSync(playwright).sort().reverse()) for (const sub of ["chrome-mac-arm64/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing", "chrome-mac/Chromium.app/Contents/MacOS/Chromium", "chrome-linux/chrome"]) candidates.push(join(playwright, dir, sub));+ const linux = join(homedir(), ".cache/ms-playwright");+ if (existsSync(linux)) for (const dir of readdirSync(linux).sort().reverse()) for (const sub of ["chrome-linux64/chrome", "chrome-linux/chrome"]) candidates.push(join(linux, dir, sub));return candidates.find((path) => existsSync(path));}async function browser(target, { width, height, scale, throttle, noWebgl }) {const profile = mkdtempSync(join(tmpdir(), "turn-check-"));- const chrome = spawn(chromePath(), ["--headless=new", "--remote-debugging-port=0", `--user-data-dir=${profile}`, "--no-first-run", "--no-default-browser-check", "--hide-scrollbars", "--allow-file-access-from-files", "--enable-unsafe-swiftshader", "--ignore-gpu-blocklist", "about:blank"]);+ const chrome = spawn(chromePath(), ["--headless=new", ...(process.platform === "linux" ? ["--no-sandbox"] : []), "--remote-debugging-port=0", `--user-data-dir=${profile}`, "--no-first-run", "--no-default-browser-check", "--hide-scrollbars", "--allow-file-access-from-files", "--enable-unsafe-swiftshader", "--ignore-gpu-blocklist", "about:blank"]);const port = await chromePort(chrome, profile);const page = await (await fetch(`http://127.0.0.1:${port}/json/new?about:blank`, { method: "PUT" })).json();const socket = new WebSocket(page.webSocketDebuggerUrl);