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
feat: add resources section to footer and update links for improved navigation
nirholas3b1359f6bc1f
diff --git a/avatar-page.html b/avatar-page.htmlindex 5503c6fe8..b43175e9e 100644--- a/avatar-page.html+++ b/avatar-page.html@@ -249,7 +249,18 @@<svg viewBox="0 0 16 16" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" d="M2 8h11m0 0L9 4m4 4l-4 4"/></svg></button></form>- <p class="h-footer-newsletter-msg" data-newsletter-msg aria-live="polite"></p>+ <p class="h-footer-newsletter-msg" data-newsletter-msg aria-live="polite"></p>+ </form>+ </div>+ <div class="h-footer-resources">+ <h3>Resources</h3>+ <p>Read the docs, join the community, and get help.</p>+ <a class="h-footer-community-btn" href="/docs" target="_blank" rel="noopener">+ <svg viewBox="0 0 24 24" aria-hidden="true"><path fill="currentColor" d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>+ Docs+ </a>+ </div>+ </div></div><div class="h-footer-community"><h3>Join the community</h3>diff --git a/package.json b/package.jsonindex 6b9efeb06..1d92a596e 100644--- a/package.json+++ b/package.json@@ -67,7 +67,8 @@"db:status": "node scripts/apply-migrations.mjs","pump:smoke": "node scripts/pumpfun-lifecycle-smoke.js","pump:refresh-idls": "node scripts/refresh-pump-idls.mjs",- "seed:skills": "node scripts/seed-skills.js"+ "seed:skills": "node scripts/seed-skills.js",+ "install:sdk": "npm install --prefix agent-payments-sdk && npm run build --prefix agent-payments-sdk && npm install ./agent-payments-sdk"},"dependencies": {"@avaturn/sdk": "^1.1.4",diff --git a/public/docs-widgets.html b/public/docs-widgets.htmlindex 3004c5ba1..7a3a88a2c 100644--- a/public/docs-widgets.html+++ b/public/docs-widgets.html@@ -551,6 +551,14 @@ img-src https://three.ws/ data:;</code></pre></div><p class="h-footer-tagline">Give your AI a body.</p></div>+ <nav class="h-footer-links" aria-label="Footer">+ <a href="https://github.com/nirholas/three.ws" target="_blank" rel="noopener">GitHub</a>+ <a href="/create">Create</a>+ <a href="/docs">Docs</a>+ </nav>+ </div>+ <p class="h-footer-tagline">Give your AI a body.</p>+ </div><nav class="h-footer-links" aria-label="Footer"><a href="https://github.com/nirholas/three.ws" target="_blank" rel="noopener">GitHub</a><a href="/create">Create</a>diff --git a/pumpfun-widget.html b/pumpfun-widget.htmlnew file mode 100644index 000000000..108285bfb--- /dev/null+++ b/pumpfun-widget.html@@ -0,0 +1,292 @@+<!doctype html>+<html lang="en">+ <head>+ <meta charset="utf-8" />+ <title>three.ws</title>+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />+ <meta name="description" content="Embedded three.ws avatar — on-chain." />+ <meta name="robots" content="noindex" />+ <style>+ html,+ body {+ margin: 0;+ padding: 0;+ height: 100%;+ width: 100%;+ background: transparent;+ overflow: hidden;+ font-family: system-ui, sans-serif;+ }+ #stage {+ position: absolute;+ inset: 0;+ }+ #stage canvas {+ display: block;+ width: 100% !important;+ height: 100% !important;+ }+ #stage .gui-wrap,+ #stage .gui-toggle,+ #stage .annotation-canvas {+ display: none !important;+ }+ #stage .model-info {+ display: none !important;+ }+ #name-plate {+ position: absolute;+ left: 12px;+ bottom: 10px;+ z-index: 2;+ pointer-events: none;+ font-size: 11px;+ color: rgba(255, 255, 255, 0.55);+ letter-spacing: 0.04em;+ text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);+ }+ #chain-plate {+ position: absolute;+ right: 12px;+ bottom: 10px;+ z-index: 2;+ pointer-events: none;+ font-size: 10px;+ color: rgba(255, 255, 255, 0.4);+ letter-spacing: 0.08em;+ text-transform: uppercase;+ text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);+ }+ #open-link {+ position: absolute;+ right: 12px;+ top: 10px;+ z-index: 3;+ font-size: 10px;+ color: rgba(255, 255, 255, 0.55);+ letter-spacing: 0.05em;+ text-decoration: none;+ padding: 4px 8px;+ border-radius: 4px;+ background: rgba(0, 0, 0, 0.35);+ backdrop-filter: blur(4px);+ }+ #open-link:hover {+ color: rgba(255, 255, 255, 0.9);+ background: rgba(0, 0, 0, 0.5);+ }+ #loading {+ position: absolute;+ inset: 0;+ display: flex;+ align-items: center;+ justify-content: center;+ color: rgba(255, 255, 255, 0.5);+ font-size: 12px;+ }+ #loading::after {+ content: '';+ width: 18px;+ height: 18px;+ margin-left: 8px;+ border: 2px solid rgba(255, 255, 255, 0.15);+ border-top-color: rgba(255, 255, 255, 0.5);+ border-radius: 50%;+ animation: spin 0.8s linear infinite;+ }+ @keyframes spin {+ to {+ transform: rotate(360deg);+ }+ }+ #error,+ #blocked {+ position: absolute;+ inset: 0;+ display: none;+ align-items: center;+ justify-content: center;+ color: rgba(255, 255, 255, 0.55);+ font-size: 12px;+ padding: 1rem;+ text-align: center;+ flex-direction: column;+ gap: 6px;+ }+ #blocked a {+ color: rgba(180, 200, 255, 0.9);+ text-decoration: none;+ }+ body.bg-dark {+ background: #0b0d10;+ }+ body.bg-light {+ background: #f5f5f5;+ }+ body.bg-light #name-plate {+ color: rgba(0, 0, 0, 0.65);+ text-shadow: none;+ }+ body.bg-light #chain-plate {+ color: rgba(0, 0, 0, 0.45);+ text-shadow: none;+ }+ body.bg-light #open-link {+ color: rgba(0, 0, 0, 0.65);+ background: rgba(255, 255, 255, 0.6);+ }+ </style>+ </head>+ <body>+ <div id="stage"></div>+ <div id="name-plate"></div>+ <div id="chain-plate"></div>+ <a id="open-link" target="_blank" rel="noopener" style="display: none">Open ↗</a>+ <div id="loading">Loading agent</div>+ <div id="error"></div>+ <div id="blocked"></div>++ <script type="module">+ import { Viewer } from './src/viewer.js';+ import {+ parseAgentRef,+ resolveOnchainAgent,+ toManifest,+ resolveUrlCandidates,+ isEmbedAllowed,+ toPublicUrl,+ } from './src/erc8004/resolver.js';++ const params = new URL(location.href).searchParams;+ const bg = params.get('bg') || 'transparent';+ if (bg === 'dark') document.body.classList.add('bg-dark');+ if (bg === 'light') document.body.classList.add('bg-light');++ const plateOn = params.get('name') !== '0';+ const chainOn = params.get('chain-plate') !== '0';+ const openLinkOn = params.get('open-link') !== '0';++ // URL: /a/:chainId/:agentId/embed+ const ref = parseAgentRef(location.pathname);++ // Best-effort parent origin from referrer; never use '*'.+ const parentOrigin = (() => {+ try {+ if (window.parent === window) return location.origin;+ if (document.referrer) return new URL(document.referrer).origin;+ } catch {}+ return null;+ })();++ function postToParent(msg) {+ if (!parent || parent === window) return;+ if (!parentOrigin) return;+ try { parent.postMessage(msg, parentOrigin); } catch {}+ }++ function showError(msg) {+ document.getElementById('loading').style.display = 'none';+ const el = document.getElementById('error');+ el.textContent = msg || 'Could not load agent';+ el.style.display = 'flex';+ postToParent({ __agent: true, type: 'error', message: msg });+ }++ function showBlocked(host) {+ document.getElementById('loading').style.display = 'none';+ const el = document.getElementById('blocked');+ const link = ref ? toPublicUrl(ref) : '/';+ el.innerHTML = `+ <div>This agent does not allow embedding on <b>${host || 'this site'}</b>.</div>+ <a href="${link}" target="_blank" rel="noopener">Open on three.ws ↗</a>+ `;+ el.style.display = 'flex';+ postToParent({ __agent: true, type: 'blocked', host });+ }++ // Best-effort parent hostname — referrer is the only cross-origin signal.+ function getParentHost() {+ try {+ if (window.parent === window) return location.hostname;+ if (document.referrer) return new URL(document.referrer).hostname;+ } catch {}+ return '';+ }++ // Try a list of candidate URLs; resolve with the first that succeeds.+ async function loadWithFallback(viewer, uris) {+ let lastErr;+ for (const u of uris) {+ try {+ await viewer.load(u, '', new Map());+ return u;+ } catch (err) {+ lastErr = err;+ console.warn('[a-embed] load failed, trying next:', u, err?.message);+ }+ }+ throw lastErr || new Error('All candidate URLs failed');+ }++ async function main() {+ if (!ref) return showError('Invalid agent URL');++ const resolved = await resolveOnchainAgent(ref);+ if (resolved.error && !resolved.glbUrl && !resolved.image) {+ return showError(`On-chain resolve failed: ${resolved.error}`);+ }++ // Embed-policy gate+ const parentHost = getParentHost();+ const policy = resolved.metadata?.embedPolicy;+ if (policy && !isEmbedAllowed(policy, parentHost)) {+ return showBlocked(parentHost);+ }++ if (plateOn) {+ document.getElementById('name-plate').textContent = resolved.name;+ }+ if (chainOn) {+ const chainName = resolved.chain?.name || `chain ${ref.chainId}`;+ document.getElementById('chain-plate').textContent =+ `${chainName} · #${ref.agentId}`;+ }+ if (openLinkOn) {+ const ol = document.getElementById('open-link');+ ol.href = toPublicUrl(ref);+ ol.style.display = 'inline-block';+ }++ const bodyURI = resolved.glbUrl || resolved.image;+ if (!bodyURI) return showError('Agent has no 3D body');++ const stage = document.getElementById('stage');+ const viewer = new Viewer(stage, { kiosk: true });+ if (bg === 'transparent') {+ viewer.renderer?.setClearAlpha(0);+ if (viewer.scene) viewer.scene.background = null;+ }++ const candidates = resolveUrlCandidates(bodyURI);+ await loadWithFallback(viewer, candidates);++ document.getElementById('loading').style.display = 'none';++ postToParent({+ __agent: true,+ type: 'ready',+ caip: resolved.caip,+ chainId: ref.chainId,+ agentId: ref.agentId,+ name: resolved.name,+ owner: resolved.onchain.owner,+ });+ }++ main().catch((err) => {+ console.error('[a-embed]', err);+ showError(err.message || 'Could not load agent');+ });+ </script>+ </body>+</html>