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.

feat: implement optimistic authentication hint and update sign-in link handling

swarmsyy8826b7fd28db
diff --git a/package-lock.json b/package-lock.json
index 44cada3a4..0946925bc 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -29,6 +29,7 @@
"three": "^0.176.0",
"tweakpane": "^4.0.5",
"vhtml": "^2.2.0",
+ "viem": "^2.18.0",
"zod": "^3.23.8"
},
"devDependencies": {
@@ -3132,6 +3133,18 @@
"@types/pg": "8.11.6"
}
},
+ "node_modules/@noble/ciphers": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.3.0.tgz",
+ "integrity": "sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==",
+ "license": "MIT",
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
"node_modules/@noble/curves": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz",
@@ -3581,6 +3594,81 @@
}
}
},
+ "node_modules/@scure/base": {
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.6.tgz",
+ "integrity": "sha512-g/nm5FgUa//MCj1gV09zTJTaM6KBAHqLN907YVQqf7zC49+DcO4B1so4ZX07Ef10Twr6nuqYEH9GEggFXA4Fmg==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@scure/bip32": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.7.0.tgz",
+ "integrity": "sha512-E4FFX/N3f4B80AKWp5dP6ow+flD1LQZo/w8UnLGYZO674jS6YnYeepycOOksv+vLPSpgN35wgKgy+ybfTb2SMw==",
+ "license": "MIT",
+ "dependencies": {
+ "@noble/curves": "~1.9.0",
+ "@noble/hashes": "~1.8.0",
+ "@scure/base": "~1.2.5"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@scure/bip32/node_modules/@noble/curves": {
+ "version": "1.9.7",
+ "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.7.tgz",
+ "integrity": "sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw==",
+ "license": "MIT",
+ "dependencies": {
+ "@noble/hashes": "1.8.0"
+ },
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@scure/bip32/node_modules/@noble/hashes": {
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz",
+ "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==",
+ "license": "MIT",
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@scure/bip39": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.6.0.tgz",
+ "integrity": "sha512-+lF0BbLiJNwVlev4eKelw1WWLaiKXw7sSl8T6FvBlWkdX+94aGJ4o8XjUdlyhTCjd8c+B3KT3JfS8P0bLRNU6A==",
+ "license": "MIT",
+ "dependencies": {
+ "@noble/hashes": "~1.8.0",
+ "@scure/base": "~1.2.5"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@scure/bip39/node_modules/@noble/hashes": {
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz",
+ "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==",
+ "license": "MIT",
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
"node_modules/@smithy/chunked-blob-reader": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader/-/chunked-blob-reader-5.2.2.tgz",
@@ -4398,6 +4486,27 @@
"uncrypto": "^0.1.3"
}
},
+ "node_modules/abitype": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.2.3.tgz",
+ "integrity": "sha512-Ofer5QUnuUdTFsBRwARMoWKOH1ND5ehwYhJ3OJ/BQO+StkwQjHw0XyVh4vDttzHB7QOFhPHa/o413PJ82gU/Tg==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/wevm"
+ },
+ "peerDependencies": {
+ "typescript": ">=5.0.4",
+ "zod": "^3.22.0 || ^4.0.0"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ },
+ "zod": {
+ "optional": true
+ }
+ }
+ },
"node_modules/acorn": {
"version": "8.16.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz",
@@ -6106,6 +6215,21 @@
"dev": true,
"license": "ISC"
},
+ "node_modules/isows": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/isows/-/isows-1.0.7.tgz",
+ "integrity": "sha512-I1fSfDCZL5P0v33sVqeTDSpcstAg/N+wF5HS033mogOVIp4B+oHC7oOCsA3axAbBSGTJ8QubbNmnIRN/h8U7hg==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/wevm"
+ }
+ ],
+ "license": "MIT",
+ "peerDependencies": {
+ "ws": "*"
+ }
+ },
"node_modules/jackspeak": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.2.3.tgz",
@@ -6682,6 +6806,75 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/ox": {
+ "version": "0.14.17",
+ "resolved": "https://registry.npmjs.org/ox/-/ox-0.14.17.tgz",
+ "integrity": "sha512-jOzNb2Wlfzsr8z/GoCtd1bf6OSRuWuysvbhnHGD+7fV1WRbcBR6B0RYoe3xWnUedF7zp4l5APmS7CzAhUok/lA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/wevm"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "@adraffy/ens-normalize": "^1.11.0",
+ "@noble/ciphers": "^1.3.0",
+ "@noble/curves": "1.9.1",
+ "@noble/hashes": "^1.8.0",
+ "@scure/bip32": "^1.7.0",
+ "@scure/bip39": "^1.6.0",
+ "abitype": "^1.2.3",
+ "eventemitter3": "5.0.1"
+ },
+ "peerDependencies": {
+ "typescript": ">=5.4.0"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/ox/node_modules/@adraffy/ens-normalize": {
+ "version": "1.11.1",
+ "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.11.1.tgz",
+ "integrity": "sha512-nhCBV3quEgesuf7c7KYfperqSS14T8bYuvJ8PcLJp6znkZpFc0AuW4qBtr8eKVyPPe/8RSr7sglCWPU5eaxwKQ==",
+ "license": "MIT"
+ },
+ "node_modules/ox/node_modules/@noble/curves": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.1.tgz",
+ "integrity": "sha512-k11yZxZg+t+gWvBbIswW0yoJlu8cHOC7dhunwOzoWH/mXGBiYyR4YY6hAEK/3EUs4UpB8la1RfdRpeGsFHkWsA==",
+ "license": "MIT",
+ "dependencies": {
+ "@noble/hashes": "1.8.0"
+ },
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/ox/node_modules/@noble/hashes": {
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz",
+ "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==",
+ "license": "MIT",
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/ox/node_modules/eventemitter3": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz",
+ "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==",
+ "license": "MIT"
+ },
"node_modules/package-json-from-dist": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz",
@@ -8003,6 +8196,84 @@
"integrity": "sha512-TPXrXrxBOslRUVnlVkiAqhoXneiertIg86bdvzionrUYhEuiROvyPZNiiP6GIIJ2Q7oPNVyEtIx8gMAZZE9lCQ==",
"license": "MIT"
},
+ "node_modules/viem": {
+ "version": "2.48.0",
+ "resolved": "https://registry.npmjs.org/viem/-/viem-2.48.0.tgz",
+ "integrity": "sha512-0uLzTAUNKPpY9Cf3OBCPdwClXx9CEHAkoVYnxMPdHt7cRI1DobMso+pHZvU7itD+hFwE4htmp9QfP+5lb+kn0g==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/wevm"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "@noble/curves": "1.9.1",
+ "@noble/hashes": "1.8.0",
+ "@scure/bip32": "1.7.0",
+ "@scure/bip39": "1.6.0",
+ "abitype": "1.2.3",
+ "isows": "1.0.7",
+ "ox": "0.14.17",
+ "ws": "8.18.3"
+ },
+ "peerDependencies": {
+ "typescript": ">=5.0.4"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/viem/node_modules/@noble/curves": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.1.tgz",
+ "integrity": "sha512-k11yZxZg+t+gWvBbIswW0yoJlu8cHOC7dhunwOzoWH/mXGBiYyR4YY6hAEK/3EUs4UpB8la1RfdRpeGsFHkWsA==",
+ "license": "MIT",
+ "dependencies": {
+ "@noble/hashes": "1.8.0"
+ },
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/viem/node_modules/@noble/hashes": {
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz",
+ "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==",
+ "license": "MIT",
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/viem/node_modules/ws": {
+ "version": "8.18.3",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz",
+ "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ },
"node_modules/vite": {
"version": "8.0.8",
"resolved": "https://registry.npmjs.org/vite/-/vite-8.0.8.tgz",
diff --git a/package.json b/package.json
index 8e2127a96..3dd07f53a 100644
--- a/package.json
+++ b/package.json
@@ -66,6 +66,7 @@
"three": "^0.176.0",
"tweakpane": "^4.0.5",
"vhtml": "^2.2.0",
+ "viem": "^2.18.0",
"zod": "^3.23.8"
},
"devDependencies": {
diff --git a/public/dashboard/dashboard.js b/public/dashboard/dashboard.js
index cbfbad9d5..f06f7755c 100644
--- a/public/dashboard/dashboard.js
+++ b/public/dashboard/dashboard.js
@@ -37,6 +37,7 @@ async function j(method, path, body) {
export function signOut() {
fetch('/api/auth/logout', { method: 'POST', credentials: 'include' }).finally(() => {
+ try { localStorage.removeItem('3dagent:auth-hint'); } catch { /* ignore */ }
location.href = '/';
});
}
diff --git a/public/login.html b/public/login.html
index fd146a92d..6e5c3f747 100644
--- a/public/login.html
+++ b/public/login.html
@@ -49,7 +49,7 @@
Sign in with MetaMask
</button>
<div class="err" id="err"></div>
- <p class="foot">No account? <a href="/register.html">Create one</a></p>
+ <p class="foot">No account? <a href="/register">Create one</a></p>
</form>
<script type="module" src="/wallet-login.js"></script>
<script>
@@ -74,6 +74,7 @@ form.addEventListener('submit', async (e) => {
});
const data = await res.json();
if (!res.ok) throw new Error(data.error_description || 'Sign-in failed');
+ try { localStorage.setItem('3dagent:auth-hint', JSON.stringify({ authed: true, ts: Date.now() })); } catch { /* ignore */ }
location.href = next;
} catch (e) {
err.textContent = e.message;
diff --git a/public/register.html b/public/register.html
index aa4ac5c98..6aa2c0284 100644
--- a/public/register.html
+++ b/public/register.html
@@ -53,7 +53,7 @@
Continue with MetaMask
</button>
<div class="err" id="err"></div>
- <p class="foot">Already have one? <a href="/login.html">Sign in</a></p>
+ <p class="foot">Already have one? <a href="/login">Sign in</a></p>
</form>
<script type="module" src="/wallet-login.js"></script>
<script>
@@ -79,6 +79,7 @@ form.addEventListener('submit', async (e) => {
});
const data = await res.json();
if (!res.ok) throw new Error(data.error_description || 'Sign-up failed');
+ try { localStorage.setItem('3dagent:auth-hint', JSON.stringify({ authed: true, ts: Date.now() })); } catch { /* ignore */ }
location.href = next;
} catch (e) {
err.textContent = e.message;
diff --git a/public/studio/studio.js b/public/studio/studio.js
index 05c4e98b6..ce0038258 100644
--- a/public/studio/studio.js
+++ b/public/studio/studio.js
@@ -281,6 +281,7 @@ function hydrateForm() {
function wireButtons() {
$('#signout-btn').addEventListener('click', async () => {
await fetch('/api/auth/logout', { method: 'POST', credentials: 'include' }).catch(() => {});
+ try { localStorage.removeItem('3dagent:auth-hint'); } catch { /* ignore */ }
location.href = '/';
});
diff --git a/public/wallet-login.js b/public/wallet-login.js
index ffca05d1c..b61828fd3 100644
--- a/public/wallet-login.js
+++ b/public/wallet-login.js
@@ -136,6 +136,7 @@ async function completeSignIn(provider, btn) {
const data = await verifyRes.json();
if (!verifyRes.ok) throw new Error(data.error_description || 'Verification failed');
+ try { localStorage.setItem('3dagent:auth-hint', JSON.stringify({ authed: true, ts: Date.now() })); } catch { /* ignore */ }
location.href = next;
}
diff --git a/src/account.js b/src/account.js
index 5c864aba3..3882ca933 100644
--- a/src/account.js
+++ b/src/account.js
@@ -32,12 +32,44 @@ function redirectToLogin() {
location.href = '/login?next=' + encodeURIComponent(next);
}
+// Optimistic auth hint — non-authoritative, used only for first-paint gating
+// on the viewer. The real session cookie is HttpOnly so we can't read it
+// synchronously; this hint lets us avoid a visible flash between "pending"
+// and the resolved state for returning users. Always revalidated by getMe().
+const AUTH_HINT_KEY = '3dagent:auth-hint';
+const AUTH_HINT_TTL_MS = 1000 * 60 * 60 * 24 * 7; // 7d
+
+export function readAuthHint() {
+ try {
+ const raw = localStorage.getItem(AUTH_HINT_KEY);
+ if (!raw) return null;
+ const { authed, ts } = JSON.parse(raw);
+ if (!ts || Date.now() - ts > AUTH_HINT_TTL_MS) return null;
+ return authed ? 'true' : 'false';
+ } catch { return null; }
+}
+
+function writeAuthHint(authed) {
+ try {
+ localStorage.setItem(AUTH_HINT_KEY, JSON.stringify({ authed: !!authed, ts: Date.now() }));
+ } catch { /* quota or disabled storage */ }
+}
+
+export function clearAuthHint() {
+ try { localStorage.removeItem(AUTH_HINT_KEY); } catch { /* ignore */ }
+}
+
export async function getMe() {
// /api/auth/me 401s for anonymous visitors by design — handle in place.
const res = await apiFetch(`${API}/api/auth/me`, { allowAnonymous: true });
- if (res.status === 401) return null;
+ if (res.status === 401) {
+ writeAuthHint(false);
+ return null;
+ }
if (!res.ok) throw new Error(`auth/me failed: ${res.status}`);
- return (await res.json()).user;
+ const user = (await res.json()).user;
+ writeAuthHint(!!user);
+ return user;
}
// Fetches a GLB from a URL (e.g. the one the avatar creator returns on export),
diff --git a/src/app.js b/src/app.js
index 5f0ffcea4..0f2340241 100644
--- a/src/app.js
+++ b/src/app.js
@@ -8,7 +8,7 @@ import { Footer } from './components/footer';
import { NichAgent } from './nich-agent.js';
import { AvatarCreator } from './avatar-creator.js';
import { resolveURI, isDecentralizedURI } from './ipfs.js';
-import { saveRemoteGlbToAccount, getMe } from './account.js';
+import { saveRemoteGlbToAccount, getMe, readAuthHint } from './account.js';
import { getWidget } from './widgets.js';
import queryString from 'query-string';
@@ -220,7 +220,11 @@ class App {
if (kiosk || widget || agent) mode = 'embed';
else if (register) mode = 'register';
document.body.dataset.viewerMode = mode;
- if (mode === 'main') document.body.dataset.authed = 'pending';
+ if (mode === 'main') {
+ // Optimistic paint from the last-known auth hint; corrected by
+ // _updateSignInLink once /api/auth/me resolves.
+ document.body.dataset.authed = readAuthHint() ?? 'pending';
+ }
}
async _updateSignInLink() {
diff --git a/style.css b/style.css
index f4743d59e..b55d4f85e 100644
--- a/style.css
+++ b/style.css
@@ -1259,6 +1259,507 @@ footer .separator {
}
}
+/* ── Tabbed Agent Studio (extends the basic register styles above) ──── */
+
+.erc8004-card--wide {
+ max-width: 880px;
+}
+
+.erc8004-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: var(--space-md);
+ margin-bottom: var(--space-md);
+ flex-wrap: wrap;
+}
+
+.erc8004-brand {
+ display: inline-flex;
+ align-items: center;
+ gap: var(--space-xs);
+ font-size: var(--text-sm);
+ color: rgba(255, 255, 255, 0.85);
+}
+
+.erc8004-brand-badge {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ padding: 2px 8px;
+ border-radius: var(--radius-sm);
+ background: linear-gradient(135deg, rgba(99, 102, 241, 0.6), rgba(236, 72, 153, 0.55));
+ color: #fff;
+ font-size: var(--text-xs);
+ font-weight: 600;
+ letter-spacing: 0.04em;
+}
+
+.erc8004-brand-title b {
+ font-weight: 600;
+ color: #fff;
+}
+
+.erc8004-controls {
+ display: inline-flex;
+ align-items: center;
+ gap: var(--space-xs);
+ flex-wrap: wrap;
+}
+
+.erc8004-chain-select {
+ padding: 6px 10px;
+ background: rgba(255, 255, 255, 0.06);
+ border: 1px solid rgba(255, 255, 255, 0.12);
+ border-radius: var(--radius-sm);
+ color: #fff;
+ font-family: inherit;
+ font-size: var(--text-xs);
+ cursor: pointer;
+}
+
+.erc8004-btn--wallet.erc8004-btn--connected {
+ background: rgba(34, 197, 94, 0.18);
+ border-color: rgba(34, 197, 94, 0.4);
+}
+
+.erc8004-btn--primary {
+ background: rgba(99, 102, 241, 0.3);
+ border-color: rgba(99, 102, 241, 0.5);
+}
+
+.erc8004-btn--primary:hover:not(:disabled) {
+ background: rgba(99, 102, 241, 0.45);
+}
+
+.erc8004-btn--ghost {
+ background: transparent;
+}
+
+.erc8004-btn--x {
+ padding: 4px 8px;
+}
+
+.erc8004-btn--close {
+ padding: 4px 10px;
+ font-size: var(--text-base);
+ line-height: 1;
+}
+
+.erc8004-stats {
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
+ gap: var(--space-sm);
+ margin-bottom: var(--space-md);
+}
+
+.erc8004-stat {
+ padding: var(--space-sm);
+ background: rgba(255, 255, 255, 0.03);
+ border: 1px solid rgba(255, 255, 255, 0.06);
+ border-radius: var(--radius-md);
+ text-align: center;
+}
+
+.erc8004-stat-val {
+ font-size: var(--text-lg);
+ font-weight: 600;
+ color: #fff;
+ font-variant-numeric: tabular-nums;
+}
+
+.erc8004-stat-lbl {
+ font-size: var(--text-xs);
+ color: rgba(255, 255, 255, 0.45);
+ margin-top: 2px;
+}
+
+.erc8004-tabs {
+ display: flex;
+ gap: 2px;
+ padding: 4px;
+ margin-bottom: var(--space-md);
+ background: rgba(255, 255, 255, 0.03);
+ border: 1px solid rgba(255, 255, 255, 0.06);
+ border-radius: var(--radius-md);
+ overflow-x: auto;
+}
+
+.erc8004-tab {
+ flex: 1;
+ min-width: max-content;
+ padding: 8px 14px;
+ border: 0;
+ background: transparent;
+ color: rgba(255, 255, 255, 0.6);
+ font-family: inherit;
+ font-size: var(--text-sm);
+ font-weight: 500;
+ cursor: pointer;
+ border-radius: var(--radius-sm);
+ transition: background 0.2s, color 0.2s;
+}
+
+.erc8004-tab:hover {
+ color: #fff;
+}
+
+.erc8004-tab--active {
+ background: rgba(255, 255, 255, 0.1);
+ color: #fff;
+}
+
+.erc8004-tab-body {
+ min-height: 280px;
+}
+
+.erc8004-wizard {
+ display: flex;
+ flex-direction: column;
+ gap: var(--space-md);
+}
+
+.erc8004-steps {
+ display: flex;
+ gap: var(--space-xs);
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+
+.erc8004-step {
+ flex: 1;
+ display: flex;
+ align-items: center;
+ gap: var(--space-xs);
+ padding: var(--space-xs) var(--space-sm);
+ background: rgba(255, 255, 255, 0.03);
+ border: 1px solid rgba(255, 255, 255, 0.06);
+ border-radius: var(--radius-sm);
+ color: rgba(255, 255, 255, 0.4);
+ font-size: var(--text-xs);
+}
+
+.erc8004-step--active {
+ background: rgba(99, 102, 241, 0.18);
+ border-color: rgba(99, 102, 241, 0.45);
+ color: #fff;
+}
+
+.erc8004-step--done {
+ color: rgba(34, 197, 94, 0.9);
+ border-color: rgba(34, 197, 94, 0.3);
+}
+
+.erc8004-step-num {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ width: 20px;
+ height: 20px;
+ border-radius: 50%;
+ background: rgba(255, 255, 255, 0.1);
+ font-weight: 600;
+}
+
+.erc8004-step--active .erc8004-step-num {
+ background: rgba(99, 102, 241, 0.7);
+}
+
+.erc8004-wizard-body {
+ padding: var(--space-md);
+ background: rgba(255, 255, 255, 0.02);
+ border: 1px solid rgba(255, 255, 255, 0.06);
+ border-radius: var(--radius-md);
+}
+
+.erc8004-wizard-nav {
+ display: flex;
+ justify-content: space-between;
+ gap: var(--space-xs);
+ margin-top: var(--space-md);
+}
+
+.erc8004-wizard-nav > :only-child {
+ margin-left: auto;
+}
+
+.erc8004-h3 {
+ margin: 0 0 var(--space-3xs);
+ font-size: var(--text-lg);
+ font-weight: 500;
+ color: #fff;
+}
+
+.erc8004-h4 {
+ margin: 0 0 var(--space-xs);
+ font-size: var(--text-base);
+ font-weight: 500;
+ color: #fff;
+}
+
+.erc8004-p {
+ margin: 0 0 var(--space-sm);
+ font-size: var(--text-sm);
+ color: rgba(255, 255, 255, 0.6);
+ line-height: 1.5;
+}
+
+.erc8004-req {
+ color: #f87171;
+}
+
+.erc8004-hint {
+ margin: -2px 0 var(--space-sm);
+ font-size: var(--text-xs);
+ color: rgba(255, 255, 255, 0.35);
+}
+
+.erc8004-muted {
+ color: rgba(255, 255, 255, 0.4);
+ font-size: var(--text-sm);
+}
+
+.erc8004-small {
+ font-size: var(--text-xs);
+}
+
+.erc8004-row {
+ display: flex;
+ gap: var(--space-xs);
+ align-items: center;
+ flex-wrap: wrap;
+ margin-bottom: var(--space-sm);
+}
+
+.erc8004-link {
+ color: #a5b4fc;
+ text-decoration: none;
+ cursor: pointer;
+ background: none;
+ border: 0;
+ padding: 0;
+ font: inherit;
+}
+
+.erc8004-link:hover {
+ text-decoration: underline;
+ color: #c7d2fe;
+}
+
+.erc8004-alert {
+ padding: var(--space-xs) var(--space-sm);
+ margin-bottom: var(--space-sm);
+ background: rgba(245, 158, 11, 0.1);
+ border: 1px solid rgba(245, 158, 11, 0.3);
+ border-radius: var(--radius-sm);
+ color: rgba(253, 224, 71, 0.9);
+ font-size: var(--text-sm);
+}
+
+.erc8004-tag {
+ display: inline-block;
+ padding: 2px 8px;
+ background: rgba(255, 255, 255, 0.08);
+ border-radius: 999px;
+ font-size: var(--text-xs);
+ color: rgba(255, 255, 255, 0.7);
+ font-variant-numeric: tabular-nums;
+}
+
+.erc8004-clip {
+ display: -webkit-box;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+}
+
+.erc8004-services {
+ display: flex;
+ flex-direction: column;
+ gap: var(--space-xs);
+ margin-bottom: var(--space-sm);
+}
+
+.erc8004-svc-row {
+ display: grid;
+ grid-template-columns: 140px 160px 1fr auto;
+ gap: var(--space-xs);
+ align-items: center;
+}
+
+.erc8004-input--tight {
+ width: auto;
+}
+
+.erc8004-summary {
+ display: grid;
+ grid-template-columns: auto 1fr;
+ gap: var(--space-3xs) var(--space-md);
+ margin: 0 0 var(--space-sm);
+ padding: var(--space-sm);
+ background: rgba(255, 255, 255, 0.03);
+ border-radius: var(--radius-sm);
+ font-size: var(--text-sm);
+}
+
+.erc8004-summary dt {
+ color: rgba(255, 255, 255, 0.45);
+}
+
+.erc8004-summary dd {
+ margin: 0;
+ color: #fff;
+ word-break: break-word;
+}
+
+.erc8004-agent-card {
+ padding: var(--space-sm);
+ background: rgba(255, 255, 255, 0.03);
+ border: 1px solid rgba(255, 255, 255, 0.06);
+ border-radius: var(--radius-md);
+ margin-bottom: var(--space-xs);
+}
+
+.erc8004-agent-card-inner {
+ display: grid;
+ grid-template-columns: 72px 1fr;
+ gap: var(--space-sm);
+ align-items: start;
+}
+
+.erc8004-agent-card-img {
+ width: 72px;
+ height: 72px;
+ border-radius: var(--radius-sm);
+ overflow: hidden;
+ background: rgba(255, 255, 255, 0.05);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.erc8004-agent-card-img img {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+}
+
+.erc8004-agent-card-ph {
+ font-size: 2rem;
+ opacity: 0.5;
+}
+
+.erc8004-agent-card-head {
+ display: flex;
+ align-items: center;
+ gap: var(--space-xs);
+ margin-bottom: var(--space-3xs);
+ color: #fff;
+ font-weight: 500;
+}
+
+.erc8004-agent-card-actions {
+ display: inline-flex;
+ gap: var(--space-sm);
+ margin-top: var(--space-xs);
+ font-size: var(--text-xs);
+}
+
+.erc8004-template-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
+ gap: var(--space-sm);
+}
+
+.erc8004-template {
+ display: flex;
+ flex-direction: column;
+ gap: var(--space-3xs);
+ padding: var(--space-md);
+ background: rgba(255, 255, 255, 0.03);
+ border: 1px solid rgba(255, 255, 255, 0.08);
+ border-radius: var(--radius-md);
+ color: #fff;
+ font-family: inherit;
+ text-align: left;
+ cursor: pointer;
+ transition: background 0.2s, border-color 0.2s, transform 0.15s;
+}
+
+.erc8004-template:hover {
+ background: rgba(255, 255, 255, 0.06);
+ border-color: rgba(99, 102, 241, 0.45);
+ transform: translateY(-1px);
+}
+
+.erc8004-template-emoji {
+ font-size: 1.75rem;
+ line-height: 1;
+}
+
+.erc8004-template-name {
+ font-weight: 500;
+ font-size: var(--text-sm);
+}
+
+.erc8004-template-desc {
+ font-size: var(--text-xs);
+ color: rgba(255, 255, 255, 0.5);
+ line-height: 1.4;
+}
+
+.erc8004-history-row {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: var(--space-sm);
+ padding: var(--space-xs) var(--space-sm);
+ background: rgba(255, 255, 255, 0.03);
+ border: 1px solid rgba(255, 255, 255, 0.06);
+ border-radius: var(--radius-sm);
+ margin-bottom: var(--space-3xs);
+ font-size: var(--text-sm);
+}
+
+.erc8004-history-main {
+ min-width: 0;
+ flex: 1;
+}
+
+.erc8004-history-main code {
+ font-size: var(--text-xs);
+ color: rgba(255, 255, 255, 0.5);
+}
+
+.erc8004-toast {
+ position: fixed;
+ bottom: var(--space-lg);
+ left: 50%;
+ transform: translateX(-50%);
+ padding: var(--space-sm) var(--space-md);
+ background: rgba(20, 20, 25, 0.95);
+ border: 1px solid rgba(255, 255, 255, 0.12);
+ border-radius: var(--radius-md);
+ color: #fff;
+ font-size: var(--text-sm);
+ z-index: 100;
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
+}
+
+.erc8004-toast--error {
+ background: rgba(127, 29, 29, 0.95);
+ border-color: rgba(248, 113, 113, 0.4);
+}
+
+@media screen and (max-width: 700px) {
+ .erc8004-stats { grid-template-columns: 1fr; }
+ .erc8004-svc-row { grid-template-columns: 1fr; }
+ .erc8004-agent-card-inner { grid-template-columns: 56px 1fr; }
+ .erc8004-agent-card-img { width: 56px; height: 56px; }
+ .erc8004-step-lbl { display: none; }
+}
+
/******************************************************************************
* Create Avatar Button
*/
diff --git a/yarn.lock b/yarn.lock
index 952d849b4..b774efef1 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2,6 +2,11 @@
# yarn lockfile v1
+"@adraffy/ens-normalize@^1.11.0":
+ version "1.11.1"
+ resolved "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.11.1.tgz"
+ integrity sha512-nhCBV3quEgesuf7c7KYfperqSS14T8bYuvJ8PcLJp6znkZpFc0AuW4qBtr8eKVyPPe/8RSr7sglCWPU5eaxwKQ==
+
"@adraffy/[email protected]":
version "1.10.1"
resolved "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz"
@@ -1482,6 +1487,18 @@
dependencies:
"@types/pg" "8.11.6"
+"@noble/ciphers@^1.3.0":
+ version "1.3.0"
+ resolved "https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.3.0.tgz"
+ integrity sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==
+
+"@noble/curves@~1.9.0":
+ version "1.9.7"
+ resolved "https://registry.npmjs.org/@noble/curves/-/curves-1.9.7.tgz"
+ integrity sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw==
+ dependencies:
+ "@noble/hashes" "1.8.0"
+
version "1.2.0"
resolved "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz"
@@ -1489,6 +1506,18 @@
dependencies:
"@noble/hashes" "1.3.2"
+ version "1.9.1"
+ resolved "https://registry.npmjs.org/@noble/curves/-/curves-1.9.1.tgz"
+ integrity sha512-k11yZxZg+t+gWvBbIswW0yoJlu8cHOC7dhunwOzoWH/mXGBiYyR4YY6hAEK/3EUs4UpB8la1RfdRpeGsFHkWsA==
+ dependencies:
+ "@noble/hashes" "1.8.0"
+
+"@noble/hashes@^1.8.0", "@noble/hashes@~1.8.0", "@noble/[email protected]":
+ version "1.8.0"
+ resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz"
+ integrity sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==
+
version "1.3.2"
resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz"
@@ -1616,6 +1645,28 @@
estree-walker "^2.0.2"
picomatch "^4.0.2"
+"@scure/base@~1.2.5":
+ version "1.2.6"
+ resolved "https://registry.npmjs.org/@scure/base/-/base-1.2.6.tgz"
+ integrity sha512-g/nm5FgUa//MCj1gV09zTJTaM6KBAHqLN907YVQqf7zC49+DcO4B1so4ZX07Ef10Twr6nuqYEH9GEggFXA4Fmg==
+
+"@scure/bip32@^1.7.0", "@scure/[email protected]":
+ version "1.7.0"
+ resolved "https://registry.npmjs.org/@scure/bip32/-/bip32-1.7.0.tgz"
+ integrity sha512-E4FFX/N3f4B80AKWp5dP6ow+flD1LQZo/w8UnLGYZO674jS6YnYeepycOOksv+vLPSpgN35wgKgy+ybfTb2SMw==
+ dependencies:
+ "@noble/curves" "~1.9.0"
+ "@noble/hashes" "~1.8.0"
+ "@scure/base" "~1.2.5"
+
+"@scure/bip39@^1.6.0", "@scure/[email protected]":
+ version "1.6.0"
+ resolved "https://registry.npmjs.org/@scure/bip39/-/bip39-1.6.0.tgz"
+ integrity sha512-+lF0BbLiJNwVlev4eKelw1WWLaiKXw7sSl8T6FvBlWkdX+94aGJ4o8XjUdlyhTCjd8c+B3KT3JfS8P0bLRNU6A==
+ dependencies:
+ "@noble/hashes" "~1.8.0"
+ "@scure/base" "~1.2.5"
+
"@smithy/chunked-blob-reader-native@^4.2.3":
version "4.2.3"
resolved "https://registry.npmjs.org/@smithy/chunked-blob-reader-native/-/chunked-blob-reader-native-4.2.3.tgz"
@@ -2182,6 +2233,11 @@
dependencies:
uncrypto "^0.1.3"
+abitype@^1.2.3, [email protected]:
+ version "1.2.3"
+ resolved "https://registry.npmjs.org/abitype/-/abitype-1.2.3.tgz"
+ integrity sha512-Ofer5QUnuUdTFsBRwARMoWKOH1ND5ehwYhJ3OJ/BQO+StkwQjHw0XyVh4vDttzHB7QOFhPHa/o413PJ82gU/Tg==
+
acorn@^8.15.0:
version "8.16.0"
resolved "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz"
@@ -2623,6 +2679,11 @@ eventemitter3@^5.0.1:
resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz"
integrity sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==
+ version "5.0.1"
+ resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz"
+ integrity sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==
+
fast-deep-equal@^3.1.3:
version "3.1.3"
resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz"
@@ -3054,6 +3115,11 @@ isexe@^2.0.0:
resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz"
integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==
+ version "1.0.7"
+ resolved "https://registry.npmjs.org/isows/-/isows-1.0.7.tgz"
+ integrity sha512-I1fSfDCZL5P0v33sVqeTDSpcstAg/N+wF5HS033mogOVIp4B+oHC7oOCsA3axAbBSGTJ8QubbNmnIRN/h8U7hg==
+
jackspeak@^4.1.1:
version "4.2.3"
resolved "https://registry.npmjs.org/jackspeak/-/jackspeak-4.2.3.tgz"
@@ -3272,6 +3338,20 @@ own-keys@^1.0.1:
object-keys "^1.1.1"
safe-push-apply "^1.0.0"
+ version "0.14.17"
+ resolved "https://registry.npmjs.org/ox/-/ox-0.14.17.tgz"
+ integrity sha512-jOzNb2Wlfzsr8z/GoCtd1bf6OSRuWuysvbhnHGD+7fV1WRbcBR6B0RYoe3xWnUedF7zp4l5APmS7CzAhUok/lA==
+ dependencies:
+ "@adraffy/ens-normalize" "^1.11.0"
+ "@noble/ciphers" "^1.3.0"
+ "@noble/curves" "1.9.1"
+ "@noble/hashes" "^1.8.0"
+ "@scure/bip32" "^1.7.0"
+ "@scure/bip39" "^1.6.0"
+ abitype "^1.2.3"
+ eventemitter3 "5.0.1"
+
package-json-from-dist@^1.0.0:
version "1.0.1"
resolved "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz"
@@ -4019,6 +4099,20 @@ vhtml@^2.2.0:
resolved "https://registry.npmjs.org/vhtml/-/vhtml-2.2.0.tgz"
integrity sha512-TPXrXrxBOslRUVnlVkiAqhoXneiertIg86bdvzionrUYhEuiROvyPZNiiP6GIIJ2Q7oPNVyEtIx8gMAZZE9lCQ==
+viem@^2.18.0:
+ version "2.48.0"
+ resolved "https://registry.npmjs.org/viem/-/viem-2.48.0.tgz"
+ integrity sha512-0uLzTAUNKPpY9Cf3OBCPdwClXx9CEHAkoVYnxMPdHt7cRI1DobMso+pHZvU7itD+hFwE4htmp9QfP+5lb+kn0g==
+ dependencies:
+ "@noble/curves" "1.9.1"
+ "@noble/hashes" "1.8.0"
+ "@scure/bip32" "1.7.0"
+ "@scure/bip39" "1.6.0"
+ abitype "1.2.3"
+ isows "1.0.7"
+ ox "0.14.17"
+ ws "8.18.3"
+
vite-plugin-pwa@^1.2.0:
version "1.2.0"
resolved "https://registry.npmjs.org/vite-plugin-pwa/-/vite-plugin-pwa-1.2.0.tgz"
@@ -4280,6 +4374,11 @@ [email protected]:
resolved "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz"
integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==
+ version "8.18.3"
+ resolved "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz"
+ integrity sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==
+
yallist@^3.0.2:
version "3.1.1"
resolved "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz"