Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
fix(guards): stop the motion ratchet counting the reduced-motion floor as drift
nirholasd474b274283c
diff --git a/scripts/audit-motion-drift.baseline.json b/scripts/audit-motion-drift.baseline.jsonindex e4491e8e4..be9b838b7 100644--- a/scripts/audit-motion-drift.baseline.json+++ b/scripts/audit-motion-drift.baseline.json@@ -1,5 +1,5 @@{- "total": 162,+ "total": 158,"perFile": {"pages/agent-screen.html": 4,"pages/club.html": 9,@@ -53,7 +53,7 @@"public/avatar-sdk.css": 2,"public/docs-freshness.css": 1,"public/docs-world.css": 1,- "public/feature-discovery.css": 2,+ "public/feature-discovery.css": 1,"public/features.css": 3,"public/gallery/gallery.css": 1,"public/genome.css": 1,@@ -64,12 +64,11 @@"public/ibm.css": 7,"public/marketplace-v2.css": 1,"public/marketplace.css": 1,- "public/nav.css": 1,"public/oracle-coin.css": 4,"public/pitch.css": 6,- "public/pricing.css": 4,+ "public/pricing.css": 3,"public/rig-doctor.css": 2,"public/studio-panels.css": 1,- "public/style.css": 2+ "public/style.css": 1}}diff --git a/scripts/audit-motion-drift.mjs b/scripts/audit-motion-drift.mjsindex c6b915d54..98fb23303 100644--- a/scripts/audit-motion-drift.mjs+++ b/scripts/audit-motion-drift.mjs@@ -22,8 +22,10 @@* drops the whole declaration, which is worse than the literal.** It does NOT touch @keyframes or `animation`, whose durations are usually- * intrinsic to the effect (a 2s shimmer loop is not a control response), and it- * ignores vendored third-party CSS.+ * intrinsic to the effect (a 2s shimmer loop is not a control response), it+ * ignores vendored third-party CSS, and it skips whatever sits inside a+ * `@media (prefers-reduced-motion: reduce)` block: that floor is the zeroing,+ * not an escape from it.** The count may only go DOWN. Migrate a value to the nearest rung of the* ladder rather than adding a token for it: the point of a ladder is that the@@ -70,9 +72,37 @@ const LITERAL_TIME = /(?<![\w-])\d*\.?\d+m?s(?![\w-])/g;const LITERAL_EASE =/(?<![\w-])(?:ease-in-out|ease-out|ease-in|linear|ease)(?![\w-])|cubic-bezier\([^)]*\)/g;+/** Strip every `@media (prefers-reduced-motion: reduce)` block.+ *+ * A literal inside that floor is not drift: it IS the zeroing the ladder exists+ * to preserve, and it cannot be a token without pointing a token at itself (the+ * floor is where `--duration-*` collapses in the first place). `1ms` rather+ * than `0s` there is deliberate too, so a `transitionend` listener still fires.+ * Counting it taught the opposite lesson: it read as a violation and pushed the+ * next author to delete the floor to get the gate green. */+function stripReducedMotionFloor(css) {+ let out = '';+ let i = 0;+ const re = /@media[^{]*prefers-reduced-motion[^{]*\{/g;+ let m;+ while ((m = re.exec(css))) {+ out += css.slice(i, m.index);+ let j = re.lastIndex;+ let depth = 1;+ while (j < css.length && depth > 0) {+ if (css[j] === '{') depth++;+ else if (css[j] === '}') depth--;+ j++;+ }+ i = j;+ re.lastIndex = j;+ }+ return out + css.slice(i);+}+/** Count the literals a sheet still spells out instead of naming. */function countDrift(css) {- const body = css.replace(/\/\*[\s\S]*?\*\//g, '');+ const body = stripReducedMotionFloor(css.replace(/\/\*[\s\S]*?\*\//g, ''));let n = 0;for (const m of body.matchAll(TRANSITION_DECL)) {const value = m[1];@@ -129,10 +159,6 @@ function audit() {...collectStylesheets(join(ROOT, 'src')),...collectStylesheets(join(ROOT, 'public')),]) {- // The token sheet is the source of truth. Its one literal is the 1ms- // collapse inside the prefers-reduced-motion floor, which cannot be a- // token without pointing a token at itself.- if (relative(ROOT, sheet) === 'public/tokens.css') continue;const n = countDrift(readFileSync(sheet, 'utf8'));if (n > 0) {perFile[relative(ROOT, sheet)] = n;