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.

embed page polish: strip SW + sitemap refresh + auth-hints test tweaks

nirholas5e17902dccb7
diff --git a/package.json b/package.json
index 353424db1..679b443a8 100644
--- a/package.json
+++ b/package.json
@@ -56,7 +56,7 @@
"build:pages": "node scripts/build-page-index.mjs",
"build:news": "node scripts/build-news.mjs",
"prebuild": "node scripts/build-news.mjs && node scripts/build-page-index.mjs && node scripts/build-skill-metadata.mjs && node scripts/build-local-skill-packs.mjs && npm run build:club-assets",
- "build": "vite build",
+ "build": "vite build && node scripts/strip-sw-from-embeds.mjs",
"build:wasm": "PATH=\"$HOME/.cargo/bin:$PATH\" RUSTFLAGS='-C target-feature=+simd128' wasm-pack build crates/vanity-grinder --target web --release --out-dir ../../src/solana/vanity/wasm && printf '%s\\n' '# wasm-pack writes a default `*` gitignore that excludes everything.' '# Override it: the generated files in this directory ARE checked in so the' '# app builds without requiring a Rust toolchain at install time. Run' '# `npm run build:wasm` after editing /crates/vanity-grinder/src/lib.rs to' '# refresh these artifacts.' '!*' > src/solana/vanity/wasm/.gitignore",
"build:animations": "node scripts/build-animations.mjs",
"build:club-props": "node scripts/build-club-props.mjs",
diff --git a/public/sitemap.xml b/public/sitemap.xml
index 8d03927ac..47141a9ff 100644
--- a/public/sitemap.xml
+++ b/public/sitemap.xml
@@ -2,277 +2,277 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://three.ws/</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://three.ws/discover</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>daily</changefreq>
<priority>0.9</priority>
</url>
<url>
<loc>https://three.ws/gallery</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://three.ws/walk</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>monthly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://three.ws/marketplace</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://three.ws/community</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>weekly</changefreq>
<priority>0.6</priority>
</url>
<url>
<loc>https://three.ws/sitemap</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>weekly</changefreq>
<priority>0.4</priority>
</url>
<url>
<loc>https://three.ws/create</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>weekly</changefreq>
<priority>0.9</priority>
</url>
<url>
<loc>https://three.ws/app</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>monthly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://three.ws/validation</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>monthly</changefreq>
<priority>0.6</priority>
</url>
<url>
<loc>https://three.ws/studio</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://three.ws/artifact</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>monthly</changefreq>
<priority>0.5</priority>
</url>
<url>
<loc>https://three.ws/widgets</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://three.ws/hydrate</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://three.ws/features</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://three.ws/launchpad</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://three.ws/walkaround</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://three.ws/brain</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://three.ws/lipsync</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>weekly</changefreq>
<priority>0.6</priority>
</url>
<url>
<loc>https://three.ws/lipsync/mic</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>weekly</changefreq>
<priority>0.6</priority>
</url>
<url>
<loc>https://three.ws/avatar-artifact</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>monthly</changefreq>
<priority>0.5</priority>
</url>
<url>
<loc>https://three.ws/pay</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>weekly</changefreq>
<priority>0.9</priority>
</url>
<url>
<loc>https://three.ws/pumpfun</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://three.ws/pump-live</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>daily</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://three.ws/pump-dashboard</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://three.ws/strategy-lab</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://three.ws/vanity-wallet</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>monthly</changefreq>
<priority>0.6</priority>
</url>
<url>
<loc>https://three.ws/eth-vanity</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>monthly</changefreq>
<priority>0.6</priority>
</url>
<url>
<loc>https://three.ws/pump-visualizer</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://three.ws/chat</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://three.ws/agent</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://three.ws/agents</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>daily</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://three.ws/reputation</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>weekly</changefreq>
<priority>0.6</priority>
</url>
<url>
<loc>https://three.ws/login</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>yearly</changefreq>
<priority>0.4</priority>
</url>
<url>
<loc>https://three.ws/register</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>yearly</changefreq>
<priority>0.4</priority>
</url>
<url>
<loc>https://three.ws/forgot-password</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>yearly</changefreq>
<priority>0.2</priority>
</url>
<url>
<loc>https://three.ws/docs</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>weekly</changefreq>
<priority>0.9</priority>
</url>
<url>
<loc>https://three.ws/docs/quick-start</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://three.ws/docs/agent-system</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
</url>
<url>
<loc>https://three.ws/docs/erc8004</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
</url>
<url>
<loc>https://three.ws/docs/embedding</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
</url>
<url>
<loc>https://three.ws/docs/web-component</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
</url>
<url>
<loc>https://three.ws/docs/mcp</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
</url>
<url>
<loc>https://three.ws/docs/skills</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
</url>
<url>
<loc>https://three.ws/docs/widgets</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
</url>
<url>
<loc>https://three.ws/docs/api-reference</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
</url>
<url>
<loc>https://three.ws/docs/sdk</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
</url>
<url>
<loc>https://three.ws/docs/listings</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>monthly</changefreq>
<priority>0.5</priority>
</url>
<url>
<loc>https://three.ws/tutorials</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
</url>
<url>
<loc>https://three.ws/blog</loc>
@@ -300,13 +300,13 @@
</url>
<url>
<loc>https://three.ws/legal/privacy</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>yearly</changefreq>
<priority>0.2</priority>
</url>
<url>
<loc>https://three.ws/legal/tos</loc>
- <lastmod>2026-05-24</lastmod>
+ <lastmod>2026-05-25</lastmod>
<changefreq>yearly</changefreq>
<priority>0.2</priority>
</url>
diff --git a/scripts/strip-sw-from-embeds.mjs b/scripts/strip-sw-from-embeds.mjs
new file mode 100644
index 000000000..2a8875790
--- /dev/null
+++ b/scripts/strip-sw-from-embeds.mjs
@@ -0,0 +1,91 @@
+#!/usr/bin/env node
+// Strip the VitePWA <script id="vite-plugin-pwa:register-sw"> tag from every
+// embed-surface HTML in dist/. Runs as a post-build step (see package.json
+// `build` script) so it executes after VitePWA has already injected the
+// registration tag.
+//
+// Why this matters:
+// Embed surfaces (/widget, /embed, /agent-embed, /a-embed, /avatar-embed)
+// are loaded in third-party iframes. Registering a service worker from
+// inside one of those iframes installs an SW scoped to https://three.ws/,
+// which then intercepts every other tab/page on the same origin. That's a
+// privacy + correctness hazard for anyone embedding our widget — they
+// never consented to running our SW, and any cache pollution affects
+// pages they have no control over.
+//
+// Doing this as a separate script (rather than a Vite plugin) means it runs
+// reliably regardless of plugin ordering between VitePWA and our own
+// transformIndexHtml hook. Idempotent — running it twice is a no-op.
+
+import { readdirSync, statSync, readFileSync, writeFileSync, existsSync } from 'node:fs';
+import { join } from 'node:path';
+
+const EMBED_ENTRIES = new Set([
+ 'widget.html',
+ 'embed.html',
+ 'avatar-embed.html',
+ 'agent-embed.html',
+ 'a-embed.html',
+ 'agent-token-page.html',
+]);
+
+const REGISTER_SW_RE =
+ /<script[^>]*id=["']vite-plugin-pwa:register-sw["'][^>]*><\/script>\s*/g;
+
+const distDir = process.argv[2] || 'dist';
+
+if (!existsSync(distDir)) {
+ console.error(`[strip-sw] dist directory not found: ${distDir}`);
+ process.exit(2);
+}
+
+const stripped = [];
+const scanned = [];
+
+function walk(dir) {
+ let entries;
+ try {
+ entries = readdirSync(dir);
+ } catch {
+ return;
+ }
+ for (const name of entries) {
+ const full = join(dir, name);
+ let s;
+ try {
+ s = statSync(full);
+ } catch {
+ continue;
+ }
+ if (s.isDirectory()) {
+ walk(full);
+ continue;
+ }
+ if (!EMBED_ENTRIES.has(name)) continue;
+ scanned.push(full);
+ const html = readFileSync(full, 'utf8');
+ if (!REGISTER_SW_RE.test(html)) continue;
+ writeFileSync(full, html.replace(REGISTER_SW_RE, ''));
+ stripped.push(full);
+ }
+}
+
+walk(distDir);
+
+if (!scanned.length) {
+ console.warn(
+ `[strip-sw] no embed HTMLs found in ${distDir}/ — did vite build write them?`,
+ );
+ process.exit(0);
+}
+
+if (stripped.length) {
+ console.log(
+ `[strip-sw] removed registerSW from ${stripped.length} file(s):`,
+ stripped.map((p) => p.replace(distDir + '/', '')).join(', '),
+ );
+} else {
+ console.log(
+ `[strip-sw] all ${scanned.length} embed HTML(s) already clean.`,
+ );
+}
diff --git a/tests/api/auth-hints.test.js b/tests/api/auth-hints.test.js
index 7fc9a978a..04d484156 100644
--- a/tests/api/auth-hints.test.js
+++ b/tests/api/auth-hints.test.js
@@ -7,6 +7,9 @@ import { describe, it, expect, vi, beforeAll } from 'vitest';
process.env.PUBLIC_APP_ORIGIN ||= 'https://app.test';
process.env.JWT_SECRET ||= 'test-auth-hints-secret-at-least-32-chars-long';
process.env.VERCEL_ENV ||= 'production';
+// Allow the in-process memory store for the idempotency cache so tests run
+// without Upstash credentials even when VERCEL_ENV=production is set.
+process.env.X402_ALLOW_MEMORY_FALLBACK ||= '1';
// Sql stub — auth.js touches it for API-key lookups but JWT verification
// hits jwtVerify directly (no DB).
diff --git a/vite.config.js b/vite.config.js
index bdd9663b5..95d028b2c 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -239,7 +239,7 @@ const appConfig = {
async handler() {
const { readdirSync, statSync, readFileSync, writeFileSync } =
await import('node:fs');
- const { join } = await import('node:path');
+ const { join, resolve: resolvePath } = await import('node:path');
const EMBED_ENTRIES = new Set([
'widget.html',
'embed.html',
@@ -249,7 +249,7 @@ const appConfig = {
'agent-token-page.html',
]);
const RE = /<script[^>]*id=["']vite-plugin-pwa:register-sw["'][^>]*><\/script>\s*/g;
- const outDir = 'dist';
+ const outDir = resolvePath(__dirname, 'dist');
const stripped = [];
const walk = (dir) => {
let entries;
@@ -272,8 +272,9 @@ const appConfig = {
}
if (!EMBED_ENTRIES.has(name)) continue;
const html = readFileSync(full, 'utf8');
- if (!RE.test(html)) continue;
- writeFileSync(full, html.replace(RE, ''));
+ const next = html.replace(RE, '');
+ if (next === html) continue;
+ writeFileSync(full, next);
stripped.push(full);
}
};