Skip to content

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.

fix(audit-links): stop reporting build-copied trees and the generated manifest as dead links

nirholas220ed5689c7e
diff --git a/scripts/audit-links.mjs b/scripts/audit-links.mjs
index c6baba128..f310eb44b 100644
--- a/scripts/audit-links.mjs
+++ b/scripts/audit-links.mjs
@@ -106,6 +106,18 @@ function matchRoute(path) {
return null;
}
+// Content trees that live at the repo root and are copied into dist/ verbatim by
+// the closeBundle plugins in vite.config.js (copy-docs, copy-blog, copy-src-to-
+// dist, the avatar-sdk mirror). `/blog/a-post.html` has no vercel route because
+// the slug route only matches extensionless paths, so without these the whole
+// blog reads as broken while production serves every one of them.
+const BUILD_COPIED_ROOTS = ['blog', 'docs', 'pump-fun-skills', 'avatar-sdk'];
+
+// Emitted at build time, so there is no source file to point at. vite-plugin-pwa
+// writes the web manifest from the `manifest` block in vite.config.js, which is
+// what the 250 pages linking `/manifest.webmanifest` actually get.
+const GENERATED_TARGETS = new Set(['/manifest.webmanifest']);
+
// Does a clean path resolve to a real source file (what the catch-all serves)?
function fileForCleanPath(path) {
const p = path.replace(/^\/+/, '').replace(/\/+$/, '');
@@ -115,6 +127,12 @@ function fileForCleanPath(path) {
if (p.startsWith('src/') || p.startsWith('node_modules/')) {
return fileExists(join(ROOT, p)) ? p : null;
}
+ if (BUILD_COPIED_ROOTS.includes(p.split('/')[0])) {
+ for (const c of [p, p + '.html', join(p, 'index.html')]) {
+ if (fileExists(join(ROOT, c))) return c;
+ }
+ return null;
+ }
const candidates = [
join('public', p),
join('public', p + '.html'),
@@ -153,6 +171,7 @@ function apiResolves(path) {
function resolveInternal(rawTarget, baseDir) {
const target = rawTarget.split('#')[0].split('?')[0];
if (target === '') return { ok: true }; // pure #anchor / query on current page
+ if (GENERATED_TARGETS.has(target)) return { ok: true, via: 'build output' };
// Relative path (not root-absolute) → resolve against the file's own directory.
if (!target.startsWith('/')) {
return fileForRelative(target, baseDir) ? { ok: true } : { ok: false, kind: 'relative' };