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: accessory thumbnails, marketplace/my-agents/dashboard-agents updates

nirholas838c3d5222d9
diff --git a/public/accessories/thumbs/earrings-hoops.png b/public/accessories/thumbs/earrings-hoops.png
new file mode 100644
index 000000000..bb18983c0
Binary files /dev/null and b/public/accessories/thumbs/earrings-hoops.png differ
diff --git a/public/accessories/thumbs/earrings-studs.png b/public/accessories/thumbs/earrings-studs.png
new file mode 100644
index 000000000..653879a10
Binary files /dev/null and b/public/accessories/thumbs/earrings-studs.png differ
diff --git a/public/accessories/thumbs/glasses-round.png b/public/accessories/thumbs/glasses-round.png
new file mode 100644
index 000000000..b382bd481
Binary files /dev/null and b/public/accessories/thumbs/glasses-round.png differ
diff --git a/public/accessories/thumbs/glasses-shades.png b/public/accessories/thumbs/glasses-shades.png
new file mode 100644
index 000000000..adf50dc89
Binary files /dev/null and b/public/accessories/thumbs/glasses-shades.png differ
diff --git a/public/accessories/thumbs/hat-baseball.png b/public/accessories/thumbs/hat-baseball.png
new file mode 100644
index 000000000..b51b301f0
Binary files /dev/null and b/public/accessories/thumbs/hat-baseball.png differ
diff --git a/public/accessories/thumbs/hat-beanie.png b/public/accessories/thumbs/hat-beanie.png
new file mode 100644
index 000000000..d6c8cd596
Binary files /dev/null and b/public/accessories/thumbs/hat-beanie.png differ
diff --git a/public/accessories/thumbs/hat-cowboy.png b/public/accessories/thumbs/hat-cowboy.png
new file mode 100644
index 000000000..40e0d4518
Binary files /dev/null and b/public/accessories/thumbs/hat-cowboy.png differ
diff --git a/public/features.json b/public/features.json
index ae246d4cc..3b73ae16e 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-05-31T04:49:17.186Z",
+ "generated_at": "2026-05-31T05:13:03.171Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/public/marketplace.css b/public/marketplace.css
index 15ed41536..2711b0a53 100644
--- a/public/marketplace.css
+++ b/public/marketplace.css
@@ -2110,6 +2110,556 @@ body.market-page {
font-size: 14px;
}
+/* ── Earn dashboard ──────────────────────────────────────────────────── */
+
+.earn-body {
+ padding: 24px;
+}
+
+.earn-dashboard {
+ display: flex;
+ flex-direction: column;
+ gap: 28px;
+ animation: earn-fade-in 0.3s ease;
+}
+
+@keyframes earn-fade-in {
+ from { opacity: 0; transform: translateY(6px); }
+ to { opacity: 1; transform: translateY(0); }
+}
+
+/* Stat cards */
+.earn-stats {
+ display: grid;
+ grid-template-columns: repeat(4, 1fr);
+ gap: 14px;
+}
+
+.earn-card {
+ position: relative;
+ background: var(--mk-panel);
+ border: 1px solid var(--mk-border);
+ border-radius: var(--mk-radius);
+ padding: 18px 20px;
+ transition: border-color 0.2s ease, transform 0.2s ease;
+}
+
+.earn-card:hover {
+ border-color: var(--mk-border-2);
+}
+
+.earn-card-total {
+ background: linear-gradient(160deg, var(--mk-panel-2), var(--mk-panel));
+ border-color: var(--mk-border-2);
+}
+
+.earn-card-label {
+ font-size: 11px;
+ font-weight: 600;
+ text-transform: uppercase;
+ letter-spacing: 0.06em;
+ color: var(--mk-text-3);
+}
+
+.earn-card-value {
+ margin-top: 10px;
+ font-size: 26px;
+ font-weight: 700;
+ color: var(--mk-text);
+ line-height: 1.1;
+ font-variant-numeric: tabular-nums;
+}
+
+.earn-card-meta {
+ margin-top: 6px;
+ font-size: 12px;
+ color: var(--mk-text-2);
+}
+
+.earn-val-pending {
+ color: #fbbf24;
+}
+
+.earn-val-settled {
+ color: #34d399;
+}
+
+/* Wallet card */
+.earn-card-wallet {
+ display: flex;
+ flex-direction: column;
+}
+
+.earn-wallet-addr {
+ font-family: ui-monospace, "SF Mono", Menlo, monospace;
+ font-size: 16px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.earn-wallet-btn {
+ position: absolute;
+ top: 16px;
+ right: 16px;
+ background: var(--mk-panel-2);
+ border: 1px solid var(--mk-border-2);
+ color: var(--mk-text-2);
+ border-radius: 7px;
+ padding: 5px 12px;
+ font-size: 12px;
+ font-weight: 500;
+ cursor: pointer;
+ transition: color 0.2s ease, border-color 0.2s ease;
+}
+
+.earn-wallet-btn:hover {
+ color: var(--mk-text);
+ border-color: var(--mk-text-3);
+}
+
+.earn-wallet-btn:focus-visible {
+ outline: 2px solid var(--mk-accent);
+ outline-offset: 2px;
+}
+
+/* Section headers */
+.earn-section-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-bottom: 16px;
+}
+
+.earn-section-title {
+ font-size: 15px;
+ font-weight: 600;
+ color: var(--mk-text);
+ margin: 0;
+}
+
+/* Period chips */
+.earn-period-chips {
+ display: inline-flex;
+ gap: 4px;
+ background: var(--mk-panel);
+ border: 1px solid var(--mk-border);
+ border-radius: 9px;
+ padding: 3px;
+}
+
+.earn-chip {
+ background: transparent;
+ border: 0;
+ color: var(--mk-text-2);
+ border-radius: 7px;
+ padding: 5px 12px;
+ font-size: 12px;
+ font-weight: 500;
+ cursor: pointer;
+ transition: background 0.2s ease, color 0.2s ease;
+}
+
+.earn-chip:hover {
+ color: var(--mk-text);
+}
+
+.earn-chip.active {
+ background: var(--mk-panel-2);
+ color: var(--mk-text);
+}
+
+.earn-chip:focus-visible {
+ outline: 2px solid var(--mk-accent);
+ outline-offset: 1px;
+}
+
+/* Chart */
+.earn-chart {
+ background: var(--mk-panel);
+ border: 1px solid var(--mk-border);
+ border-radius: var(--mk-radius);
+ padding: 20px;
+ min-height: 220px;
+}
+
+.earn-chart-loading,
+.earn-chart-empty {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ min-height: 180px;
+ color: var(--mk-text-3);
+ font-size: 13px;
+}
+
+.earn-chart-loading {
+ animation: earn-pulse 1.4s ease-in-out infinite;
+}
+
+@keyframes earn-pulse {
+ 0%, 100% { opacity: 0.5; }
+ 50% { opacity: 1; }
+}
+
+.earn-chart-meta {
+ display: flex;
+ align-items: baseline;
+ gap: 10px;
+ margin-bottom: 18px;
+}
+
+.earn-chart-total {
+ font-size: 22px;
+ font-weight: 700;
+ color: var(--mk-text);
+ font-variant-numeric: tabular-nums;
+}
+
+.earn-chart-count {
+ font-size: 12px;
+ color: var(--mk-text-2);
+}
+
+.earn-chart-bars {
+ display: flex;
+ align-items: flex-end;
+ gap: 3px;
+ height: 140px;
+}
+
+.earn-bar {
+ flex: 1 1 0;
+ display: flex;
+ flex-direction: column;
+ justify-content: flex-end;
+ align-items: center;
+ height: 100%;
+ min-width: 0;
+}
+
+.earn-bar-col {
+ width: 100%;
+ max-width: 28px;
+ height: var(--h, 0%);
+ min-height: 2px;
+ background: linear-gradient(180deg, #60a5fa, #3b82f6);
+ border-radius: 4px 4px 0 0;
+ transition: height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.15s ease;
+}
+
+.earn-bar:hover .earn-bar-col {
+ filter: brightness(1.25);
+}
+
+.earn-bar-date {
+ margin-top: 8px;
+ font-size: 10px;
+ color: var(--mk-text-3);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ max-width: 100%;
+ min-height: 12px;
+}
+
+/* Breakdown */
+.earn-breakdown {
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+}
+
+.earn-bk-row {
+ display: grid;
+ grid-template-columns: 140px 1fr auto auto;
+ align-items: center;
+ gap: 12px;
+}
+
+.earn-bk-name {
+ font-size: 13px;
+ color: var(--mk-text);
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.earn-bk-track {
+ height: 8px;
+ background: var(--mk-panel-2);
+ border-radius: 4px;
+ overflow: hidden;
+}
+
+.earn-bk-fill {
+ height: 100%;
+ background: linear-gradient(90deg, #a78bfa, #8b5cf6);
+ border-radius: 4px;
+ transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
+}
+
+.earn-bk-amount {
+ font-size: 13px;
+ font-weight: 600;
+ color: var(--mk-text);
+ font-variant-numeric: tabular-nums;
+}
+
+.earn-bk-count {
+ font-size: 12px;
+ color: var(--mk-text-3);
+ min-width: 32px;
+ text-align: right;
+}
+
+/* Transactions */
+.earn-txn-count {
+ font-size: 12px;
+ color: var(--mk-text-3);
+}
+
+.earn-txns {
+ display: flex;
+ flex-direction: column;
+ border: 1px solid var(--mk-border);
+ border-radius: var(--mk-radius);
+ overflow: hidden;
+}
+
+.earn-txn {
+ display: flex;
+ align-items: center;
+ gap: 14px;
+ padding: 14px 18px;
+ border-bottom: 1px solid var(--mk-border);
+ transition: background 0.15s ease;
+}
+
+.earn-txn:last-child {
+ border-bottom: 0;
+}
+
+.earn-txn:hover {
+ background: var(--mk-panel);
+}
+
+.earn-txn-icon {
+ flex: 0 0 auto;
+ width: 34px;
+ height: 34px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: var(--mk-panel-2);
+ border-radius: 9px;
+ font-size: 15px;
+}
+
+.earn-txn-info {
+ flex: 1 1 auto;
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+ min-width: 0;
+}
+
+.earn-txn-name {
+ font-size: 14px;
+ color: var(--mk-text);
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.earn-txn-agent {
+ font-size: 12px;
+ color: var(--mk-text-3);
+}
+
+.earn-txn-right {
+ display: flex;
+ align-items: center;
+ gap: 14px;
+ flex: 0 0 auto;
+}
+
+.earn-txn-amount {
+ font-size: 14px;
+ font-weight: 600;
+ color: var(--mk-text);
+ font-variant-numeric: tabular-nums;
+}
+
+.earn-txn-status {
+ font-size: 11px;
+ font-weight: 500;
+ text-transform: capitalize;
+ padding: 3px 9px;
+ border-radius: 20px;
+}
+
+.earn-status-settled {
+ color: #34d399;
+ background: rgba(52, 211, 153, 0.12);
+}
+
+.earn-status-pending {
+ color: #fbbf24;
+ background: rgba(251, 191, 36, 0.12);
+}
+
+.earn-txn-date {
+ font-size: 12px;
+ color: var(--mk-text-3);
+ min-width: 56px;
+ text-align: right;
+}
+
+.earn-txns-more {
+ margin-top: 14px;
+ text-align: center;
+}
+
+.earn-show-more {
+ background: var(--mk-panel);
+ border: 1px solid var(--mk-border);
+ color: var(--mk-text-2);
+ border-radius: 8px;
+ padding: 8px 20px;
+ font-size: 13px;
+ cursor: pointer;
+ transition: color 0.2s ease, border-color 0.2s ease;
+}
+
+.earn-show-more:hover {
+ color: var(--mk-text);
+ border-color: var(--mk-border-2);
+}
+
+/* State messages (auth / error / empty) */
+.earn-state-msg {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ text-align: center;
+ padding: 72px 24px;
+ max-width: 440px;
+ margin: 0 auto;
+}
+
+.earn-state-icon {
+ width: 52px;
+ height: 52px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: var(--mk-panel-2);
+ border: 1px solid var(--mk-border-2);
+ border-radius: 14px;
+ font-size: 22px;
+ font-weight: 700;
+ color: var(--mk-text-2);
+ margin-bottom: 18px;
+}
+
+.earn-icon-error {
+ color: #f87171;
+ border-color: rgba(248, 113, 113, 0.3);
+ background: rgba(248, 113, 113, 0.08);
+}
+
+.earn-state-msg h3 {
+ font-size: 18px;
+ font-weight: 600;
+ color: var(--mk-text);
+ margin: 0 0 8px;
+}
+
+.earn-state-msg p {
+ font-size: 14px;
+ color: var(--mk-text-2);
+ line-height: 1.5;
+ margin: 0 0 6px;
+}
+
+.earn-empty-actions {
+ display: flex;
+ gap: 10px;
+ margin-top: 12px;
+}
+
+/* Skeleton */
+.earn-skeleton {
+ display: flex;
+ flex-direction: column;
+ gap: 28px;
+}
+
+.earn-card-sk {
+ min-height: 92px;
+}
+
+.earn-sk-line,
+.earn-sk-block {
+ background: linear-gradient(90deg, var(--mk-panel) 25%, var(--mk-panel-2) 50%, var(--mk-panel) 75%);
+ background-size: 200% 100%;
+ animation: earn-shimmer 1.4s ease-in-out infinite;
+ border-radius: 6px;
+}
+
+.earn-sk-line {
+ height: 12px;
+}
+
+.earn-chart-sk {
+ background: var(--mk-panel);
+ border: 1px solid var(--mk-border);
+ border-radius: var(--mk-radius);
+ padding: 20px;
+}
+
+.earn-sk-block {
+ height: 180px;
+ border-radius: 10px;
+}
+
+.earn-txn-sk {
+ border: 1px solid var(--mk-border);
+ border-radius: var(--mk-radius);
+ overflow: hidden;
+}
+
+.earn-txn-sk-row {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 14px;
+ padding: 16px 18px;
+ border-bottom: 1px solid var(--mk-border);
+}
+
+.earn-txn-sk-row:last-child {
+ border-bottom: 0;
+}
+
+@keyframes earn-shimmer {
+ 0% { background-position: 200% 0; }
+ 100% { background-position: -200% 0; }
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .earn-dashboard,
+ .earn-bar-col,
+ .earn-bk-fill,
+ .earn-sk-line,
+ .earn-sk-block,
+ .earn-chart-loading {
+ animation: none;
+ transition: none;
+ }
+}
+
/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 980px) {
@@ -2141,6 +2691,34 @@ body.market-page {
.market-detail-side {
position: static;
}
+
+ .earn-stats {
+ grid-template-columns: repeat(2, 1fr);
+ }
+}
+
+@media (max-width: 560px) {
+ .earn-body {
+ padding: 16px;
+ }
+
+ .earn-stats {
+ grid-template-columns: 1fr;
+ }
+
+ .earn-bk-row {
+ grid-template-columns: 1fr auto;
+ row-gap: 4px;
+ }
+
+ .earn-bk-track {
+ grid-column: 1 / -1;
+ order: 3;
+ }
+
+ .earn-txn-agent {
+ display: none;
+ }
}
/* ── WIP banner dismiss ──────────────────────────────────────────── */
diff --git a/public/my-agents/index.html b/public/my-agents/index.html
index 3fbf1af3d..cfd0d6380 100644
--- a/public/my-agents/index.html
+++ b/public/my-agents/index.html
@@ -32,11 +32,43 @@
</header>
<main class="my-agents-main" id="my-agents-main">
- <h1 class="my-agents-title">My Agents</h1>
- <p class="my-agents-subtitle">
- All your agents — three.ws agents and on-chain (ERC-8004) agents from your linked wallets.
- New users get a starter agent with a default avatar automatically.
- </p>
+ <div class="my-agents-head">
+ <div class="my-agents-head__text">
+ <h1 class="my-agents-title">My Agents</h1>
+ <p class="my-agents-subtitle">
+ Every agent you own — three.ws agents and on-chain (ERC-8004) agents from
+ your linked wallets. New users get a starter agent automatically.
+ </p>
+ </div>
+ <a class="my-agents-new" href="/create" id="my-agents-new-top" hidden>
+ <svg width="15" height="15" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M12 5v14M5 12h14" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>
+ New agent
+ </a>
+ </div>
+
+ <div id="my-agents-stats" class="my-agents-stats" hidden aria-label="Agent summary"></div>
+
+ <div id="my-agents-toolbar" class="my-agents-toolbar" hidden>
+ <div class="my-agents-search">
+ <svg width="15" height="15" viewBox="0 0 24 24" fill="none" aria-hidden="true"><circle cx="11" cy="11" r="7" stroke="currentColor" stroke-width="2"/><path d="m20 20-3-3" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>
+ <input
+ id="my-agents-search-input"
+ type="search"
+ placeholder="Search agents…"
+ aria-label="Search your agents by name"
+ autocomplete="off"
+ />
+ </div>
+ <label class="my-agents-sort">
+ <span class="my-agents-sort__label">Sort</span>
+ <select id="my-agents-sort-select" aria-label="Sort agents">
+ <option value="recent">Newest first</option>
+ <option value="oldest">Oldest first</option>
+ <option value="name">Name (A–Z)</option>
+ <option value="chats">Most chats</option>
+ </select>
+ </label>
+ </div>
<div
id="my-agents-error"
diff --git a/scripts/_shot5.mjs b/scripts/_shot5.mjs
deleted file mode 100644
index f975facab..000000000
--- a/scripts/_shot5.mjs
+++ /dev/null
@@ -1,19 +0,0 @@
-import { chromium } from 'playwright';
-import { writeFileSync } from 'node:fs';
-const base='http://127.0.0.1:3002';
-const b=await chromium.launch({args:['--use-gl=angle','--use-angle=swiftshader','--enable-unsafe-swiftshader','--ignore-gpu-blocklist']});
-const p=await b.newPage({viewport:{width:1440,height:900}});
-const grab=async(n)=>{const d=await p.evaluate(()=>{const c=document.querySelector('#as-stage canvas');return c?c.toDataURL('image/png'):null;});if(d)writeFileSync(n,Buffer.from(d.split(',')[1],'base64'));return !!d;};
-await p.goto(base+'/create/studio',{waitUntil:'networkidle'}).catch(()=>{});
-await p.waitForTimeout(7000);
-await p.click('#as-tab-face').catch(()=>{});
-await p.waitForTimeout(400);
-// zoom in toward head target a few notches to frame the face
-const c=await p.$('#as-stage canvas'); const box=await c.boundingBox();
-await p.mouse.move(box.x+box.width/2, box.y+box.height*0.35);
-for(let i=0;i<6;i++){await p.mouse.wheel(0,-120);await p.waitForTimeout(120);}
-await p.waitForTimeout(1200);
-console.log('neutral:',await grab('/tmp/f3-neutral.png'));
-await p.click('button[data-expr="cheerful"]').catch(()=>{}); await p.waitForTimeout(1800);
-console.log('cheerful:',await grab('/tmp/f3-cheerful.png'));
-await b.close();
diff --git a/scripts/render-accessory-thumbs.mjs b/scripts/render-accessory-thumbs.mjs
new file mode 100644
index 000000000..f5b46e44c
--- /dev/null
+++ b/scripts/render-accessory-thumbs.mjs
@@ -0,0 +1,153 @@
+#!/usr/bin/env node
+/**
+ * Render PNG preview thumbnails for the Avatar Studio accessory catalog
+ * (hats, glasses, earrings). Each preset in public/accessories/presets.json
+ * with a `glbUrl` is rendered once in a headless Chromium via model-viewer,
+ * captured as a 512×512 transparent PNG, and written to
+ * public/accessories/thumbs/<preset-id>.png — the path presets.json already
+ * points each `thumbnail` at.
+ *
+ * These are static assets committed to the repo so the studio's tile grid shows
+ * real model previews instead of a generic per-kind emoji, and so the page
+ * stops requesting (and 404-ing) thumbnails that don't exist.
+ *
+ * Usage: node scripts/render-accessory-thumbs.mjs
+ */
+
+import { chromium } from 'playwright';
+import { createServer } from 'node:http';
+import { readFile } from 'node:fs/promises';
+import { fileURLToPath } from 'node:url';
+import { dirname, join, extname, resolve, basename } from 'node:path';
+import { mkdirSync, writeFileSync, readFileSync } from 'node:fs';
+
+const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..');
+const PUBLIC = join(ROOT, 'public');
+const OUT_DIR = join(PUBLIC, 'accessories', 'thumbs');
+const SIZE = 512;
+
+// Derive targets from presets.json so the catalog stays the single source of
+// truth — any accessory with a model GLB gets a thumbnail at its `thumbnail` path.
+const presets = JSON.parse(readFileSync(join(PUBLIC, 'accessories', 'presets.json'), 'utf-8'));
+const TARGETS = presets
+ .filter((p) => p.glbUrl && p.thumbnail)
+ .map((p) => ({ glb: p.glbUrl, out: basename(p.thumbnail) }));
+
+const MIME = {
+ '.glb': 'model/gltf-binary',
+ '.html': 'text/html; charset=utf-8',
+ '.js': 'text/javascript',
+ '.png': 'image/png',
+};
+
+function startServer() {
+ const server = createServer(async (req, res) => {
+ try {
+ const path = decodeURIComponent(req.url.split('?')[0]);
+ const file = join(PUBLIC, path);
+ if (!file.startsWith(PUBLIC)) {
+ res.writeHead(403).end();
+ return;
+ }
+ const body = await readFile(file);
+ res.writeHead(200, {
+ 'content-type': MIME[extname(file)] || 'application/octet-stream',
+ 'access-control-allow-origin': '*',
+ });
+ res.end(body);
+ } catch {
+ res.writeHead(404).end();
+ }
+ });
+ return new Promise((res) => {
+ server.listen(0, '127.0.0.1', () => res({ server, port: server.address().port }));
+ });
+}
+
+const viewerHtml = (origin) => `<!doctype html>
+<html><head><meta charset="utf-8">
+<style>
+ html,body { margin:0; padding:0; background: transparent; width:${SIZE}px; height:${SIZE}px; }
+ model-viewer { width:100%; height:100%; --poster-color: transparent; background: transparent; }
+</style>
+<script type="module" src="${origin}/vendor/model-viewer.min.js" onerror="window.__mvFallback=1"></script>
+<script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>
+</head>
+<body>
+ <model-viewer id="mv" interaction-prompt="none" exposure="1.1" shadow-intensity="0.6" tone-mapping="aces" camera-orbit="0deg 80deg auto"></model-viewer>
+</body></html>`;
+
+async function capture(page, src) {
+ await page.evaluate(async (s) => {
+ const mv = document.getElementById('mv');
+ mv.setAttribute('src', s);
+ await new Promise((res, rej) => {
+ const t = setTimeout(() => rej(new Error('load timeout')), 25000);
+ mv.addEventListener('load', () => { clearTimeout(t); res(); }, { once: true });
+ mv.addEventListener('error', () => { clearTimeout(t); rej(new Error('load error')); }, { once: true });
+ });
+ // Frame deterministically from the model's real bounding box so every
+ // accessory — earrings to cowboy hat — fills the swatch the same way.
+ const FOV = 26; // degrees
+ const dims = mv.getDimensions(); // metres, post-load bounding box
+ const maxDim = Math.max(dims.x, dims.y, dims.z);
+ const radius = (maxDim / 2) / Math.tan((FOV / 2) * Math.PI / 180) * 1.15;
+ mv.fieldOfView = `${FOV}deg`;
+ mv.cameraTarget = 'auto auto auto';
+ mv.cameraOrbit = `0deg 80deg ${radius}m`;
+ await new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r)));
+ await new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r)));
+ }, src);
+
+ const dataUrl = await page.evaluate(async () => {
+ const mv = document.getElementById('mv');
+ const blob = await mv.toBlob({ idealAspect: true, mimeType: 'image/png' });
+ return await new Promise((res) => {
+ const fr = new FileReader();
+ fr.onloadend = () => res(fr.result);
+ fr.readAsDataURL(blob);
+ });
+ });
+ return Buffer.from(dataUrl.split(',')[1], 'base64');
+}
+
+async function main() {
+ if (TARGETS.length === 0) {
+ console.error('[acc-thumbs] no accessory presets with glbUrl + thumbnail found');
+ process.exit(1);
+ }
+ mkdirSync(OUT_DIR, { recursive: true });
+ const { server, port } = await startServer();
+ const origin = `http://127.0.0.1:${port}`;
+ console.log(`[acc-thumbs] static server on ${origin}, ${TARGETS.length} targets`);
+
+ const browser = await chromium.launch({ args: ['--no-sandbox', '--disable-dev-shm-usage'] });
+ const ctx = await browser.newContext({ viewport: { width: SIZE, height: SIZE }, deviceScaleFactor: 2 });
+ const page = await ctx.newPage();
+ await page.setContent(viewerHtml(origin), { waitUntil: 'load' });
+ await page.waitForFunction(() => !!customElements.get('model-viewer'), null, { timeout: 30000 });
+
+ let ok = 0, fail = 0;
+ for (const t of TARGETS) {
+ try {
+ console.log(`[acc-thumbs] rendering ${t.glb}…`);
+ const png = await capture(page, origin + t.glb);
+ writeFileSync(join(OUT_DIR, t.out), png);
+ console.log(`[acc-thumbs] ✓ ${t.out} (${png.length} bytes)`);
+ ok++;
+ } catch (err) {
+ console.error(`[acc-thumbs] ✗ ${t.glb}: ${err.message}`);
+ fail++;
+ }
+ }
+
+ await browser.close();
+ server.close();
+ console.log(`[acc-thumbs] done — ${ok} ok, ${fail} failed`);
+ if (fail) process.exit(1);
+}
+
+main().catch((err) => {
+ console.error('[acc-thumbs] fatal:', err);
+ process.exit(1);
+});
diff --git a/src/dashboard-next/pages/agents.js b/src/dashboard-next/pages/agents.js
index 0428cc386..8e5dedb21 100644
--- a/src/dashboard-next/pages/agents.js
+++ b/src/dashboard-next/pages/agents.js
@@ -694,22 +694,18 @@ function openPersonaModal(host, agent, allAgents, avatars) {
<div style="border-top:1px solid var(--nxt-stroke);padding-top:18px;margin-top:4px">
<div style="font-size:13px;font-weight:600;color:var(--nxt-ink);margin-bottom:4px">Memory seeding</div>
<div style="font-size:12.5px;color:var(--nxt-ink-dim);margin-bottom:14px">
- Seed this agent's long-term memory from public profiles. Each source is fetched and summarised into the agent's memory store.
+ Seed this agent's long-term memory from your activity. Each source is fetched, distilled into facts, and written to the agent's memory store.
</div>
- <div style="display:grid;grid-template-columns:1fr auto;gap:8px;margin-bottom:10px">
- <input data-slot="seed-twitter" type="text" maxlength="50" placeholder="Twitter / X handle (without @)"
- style="padding:8px 11px;border-radius:8px;border:1px solid var(--nxt-stroke);
- background:rgba(255,255,255,0.04);color:var(--nxt-ink);font:inherit;font-size:13px" />
+ <div style="display:flex;align-items:center;gap:10px;margin-bottom:10px">
+ <div style="flex:1;min-width:0;font-size:12.5px;color:var(--nxt-ink-dim)">Distil your recent posts. Uses your connected <strong style="color:var(--nxt-ink)">X</strong> account.</div>
<button class="dn-btn" data-action="seed-twitter" type="button" style="flex-shrink:0">Seed from X</button>
</div>
- <div style="display:grid;grid-template-columns:1fr auto;gap:8px;margin-bottom:10px">
- <input data-slot="seed-github" type="text" maxlength="60" placeholder="GitHub username"
- style="padding:8px 11px;border-radius:8px;border:1px solid var(--nxt-stroke);
- background:rgba(255,255,255,0.04);color:var(--nxt-ink);font:inherit;font-size:13px" />
+ <div style="display:flex;align-items:center;gap:10px;margin-bottom:10px">
+ <div style="flex:1;min-width:0;font-size:12.5px;color:var(--nxt-ink-dim)">Distil your repos and commits. Uses your connected <strong style="color:var(--nxt-ink)">GitHub</strong> account.</div>
<button class="dn-btn" data-action="seed-github" type="button" style="flex-shrink:0">Seed from GitHub</button>
</div>
<div style="display:grid;grid-template-columns:1fr auto;gap:8px;margin-bottom:0">
- <input data-slot="seed-farcaster" type="text" maxlength="50" placeholder="Farcaster username (FID or handle)"
+ <input data-slot="seed-farcaster" type="text" maxlength="50" placeholder="Farcaster username or FID"
style="padding:8px 11px;border-radius:8px;border:1px solid var(--nxt-stroke);
background:rgba(255,255,255,0.04);color:var(--nxt-ink);font:inherit;font-size:13px" />
<button class="dn-btn" data-action="seed-farcaster" type="button" style="flex-shrink:0">Seed from Farcaster</button>
@@ -763,40 +759,59 @@ function openPersonaModal(host, agent, allAgents, avatars) {
}
});
+ const aid = encodeURIComponent(agent.id);
+ const SEED_LABELS = { 'seed-twitter': 'Seed from X', 'seed-github': 'Seed from GitHub', 'seed-farcaster': 'Seed from Farcaster' };
+ const SOURCE_NAMES = { 'seed-twitter': 'X', 'seed-github': 'GitHub', 'seed-farcaster': 'Farcaster' };
+
const seedAction = async (action) => {
- const SEED_ENDPOINTS = {
- 'seed-twitter': `/api/agents/${encodeURIComponent(agent.id)}/memory-seed-x`,
- 'seed-github': `/api/seed/github`,
- 'seed-farcaster': `/api/seed/farcaster`,
- };
- const SEED_SLOTS = {
- 'seed-twitter': 'seed-twitter',
- 'seed-github': 'seed-github',
- 'seed-farcaster': 'seed-farcaster',
- };
- const endpoint = SEED_ENDPOINTS[action];
- const handle = overlay.querySelector(`[data-slot="${SEED_SLOTS[action]}"]`).value.trim();
- if (!handle) { seedStatus.textContent = 'Enter a handle first.'; return; }
+ seedStatus.innerHTML = '';
+
+ // X and GitHub seed from the user's connected OAuth account (no handle).
+ // Farcaster is public, so it takes a username or FID.
+ let endpoint;
+ let body;
+ if (action === 'seed-twitter') {
+ endpoint = `/api/agents/${aid}/memory-seed-x`;
+ } else if (action === 'seed-github') {
+ endpoint = `/api/agents/${aid}/memory-seed`;
+ } else {
+ const handle = overlay.querySelector('[data-slot="seed-farcaster"]').value.trim().replace(/^@/, '');
+ if (!handle) { seedStatus.style.color = 'var(--nxt-danger)'; seedStatus.textContent = 'Enter a Farcaster username or FID first.'; return; }
+ endpoint = `/api/agents/${aid}/memory/seed/farcaster`;
+ body = /^\d+$/.test(handle) ? { fid: Number(handle) } : { fname: handle };
+ }
const btn = overlay.querySelector(`[data-action="${action}"]`);
btn.disabled = true;
btn.textContent = 'Seeding…';
- seedStatus.textContent = 'Fetching and seeding memory…';
+ seedStatus.style.color = 'var(--nxt-ink-dim)';
+ seedStatus.textContent = 'Fetching and distilling memory…';
try {
- const body = action === 'seed-twitter'
- ? { handle }
- : { agent_id: agent.id, username: handle };
- await post(endpoint, body);
+ const r = await post(endpoint, body);
+ const count = r?.seeded ?? 0;
seedStatus.style.color = 'var(--nxt-ink)';
- seedStatus.textContent = `Memory seeded from ${action.replace('seed-', '')}.`;
+ seedStatus.textContent = count > 0
+ ? `Seeded ${count} ${count === 1 ? 'fact' : 'facts'} from ${SOURCE_NAMES[action]}.`
+ : `No new facts found from ${SOURCE_NAMES[action]}.`;
} catch (err) {
seedStatus.style.color = 'var(--nxt-danger)';
- seedStatus.textContent = err?.body?.error || err?.message || 'Seeding failed.';
+ // The X/GitHub endpoints require a connected account; guide the user there.
+ if (err?.code === 'not_connected' || err?.status === 412) {
+ seedStatus.innerHTML = `Connect ${esc(SOURCE_NAMES[action])} to seed from it. `;
+ const link = document.createElement('a');
+ link.href = '/settings#connected-accounts';
+ link.textContent = 'Connect now';
+ link.style.color = 'var(--nxt-accent, #6ea8fe)';
+ seedStatus.appendChild(link);
+ } else if (err?.status === 429) {
+ seedStatus.textContent = err?.message || 'Seeding is rate-limited. Try again later.';
+ } else {
+ seedStatus.textContent = err?.message || err?.body?.error || 'Seeding failed.';
+ }
} finally {
btn.disabled = false;
- const labels = { 'seed-twitter': 'Seed from X', 'seed-github': 'Seed from GitHub', 'seed-farcaster': 'Seed from Farcaster' };
- btn.textContent = labels[action];
+ btn.textContent = SEED_LABELS[action];
}
};
diff --git a/src/marketplace.js b/src/marketplace.js
index 10252e30e..396c67f85 100644
--- a/src/marketplace.js
+++ b/src/marketplace.js
@@ -4407,6 +4407,9 @@ function bindEvents() {
// Avatar detail back button.
const avatarDetailBack = $('avatar-detail-back');
if (avatarDetailBack) avatarDetailBack.addEventListener('click', () => { _avatarDetailId = null; navTo('/marketplace'); });
+ // Plugin detail back button → return to the tools tab.
+ const toolDetailBack = $('tool-detail-back');
+ if (toolDetailBack) toolDetailBack.addEventListener('click', () => { _toolDetailId = null; navTo('/marketplace?tab=tools'); });
$('d-fork').addEventListener('click', fork);
$('d-bookmark').addEventListener('click', toggleBookmark);
$('d-export-json')?.addEventListener('click', exportAgentJson);
@@ -5974,7 +5977,12 @@ function renderPluginCard(p, installed) {
const toolCount = Array.isArray(manifest?.api) ? manifest.api.length : 0;
const isInstalled = installed.has(p.identifier);
const cat = escapeHtml(p.category || manifest?.meta?.category || 'general');
- const icon = (p.name || p.identifier || '?')[0].toUpperCase();
+ // Prefer a manifest emoji/glyph avatar; image URLs and missing avatars fall
+ // back to the name's first letter so the grid stays visually uniform.
+ const av = manifest?.meta?.avatar;
+ const icon = av && !/^(https?:\/\/|\/)/.test(av)
+ ? escapeHtml(av)
+ : (p.name || p.identifier || '?')[0].toUpperCase();
const priceBadge = priceBadgeHtml(p.price);
// Whole card deep-links to the plugin detail page when it has a DB id.
const linkAttrs = p.id
@@ -6005,6 +6013,281 @@ function renderPluginCard(p, installed) {
</div>`;
}
+// ── Plugin detail page ──────────────────────────────────────────────────────
+// Rich, deep-linkable page for a single plugin at /marketplace/tools/:id.
+// Lists every tool the plugin exposes with its parameters, plus the system
+// role, author, pricing and an install / buy action.
+
+let _toolDetailId = null;
+
+function _setToolDetailState({ skeleton = false, empty = false, body = false }) {
+ const skel = $('tool-detail-skeleton');
+ const emptyEl = $('tool-detail-empty');
+ const bodyEl = $('tool-detail-body');
+ if (skel) skel.hidden = !skeleton;
+ if (emptyEl) emptyEl.hidden = !empty;
+ if (bodyEl) bodyEl.hidden = !body;
+}
+
+function _renderToolDetailEmpty() {
+ _setToolDetailState({ empty: true });
+ setSocialMeta({
+ title: 'Plugin not found · three.ws',
+ description: 'This plugin may have been removed or the link is wrong.',
+ url: location.origin + location.pathname,
+ image: _socialMetaDefaults.image,
+ });
+}
+
+async function loadToolDetail(id) {
+ if (_toolDetailId === id) return; // already rendered for this id
+
+ _setToolDetailState({ skeleton: true });
+
+ // Try the in-memory list first (instant if the user browsed there), then
+ // fetch the canonical record. Don't cache the id until a successful render
+ // so a transient failure leaves the page retryable.
+ let plugin = pluginState.items.find((p) => p.id === id || p.identifier === id);
+ if (!plugin) {
+ try {
+ const r = await fetch(`${PLUGIN_API}/${encodeURIComponent(id)}`);
+ if (r.ok) {
+ const j = await r.json();
+ plugin = j?.data?.plugin || null;
+ }
+ } catch (err) {
+ console.error('[marketplace] tool detail fetch', err);
+ }
+ }
+
+ // Re-check the route — the user may have navigated away during the fetch.
+ if (readRoute().view !== 'tool-detail') return;
+
+ if (!plugin) {
+ _renderToolDetailEmpty();
+ return;
+ }
+
+ renderToolDetail(plugin);
+ _toolDetailId = id;
+}
+
+function renderToolDetail(p) {
+ const manifest = p.manifest_json ?? p;
+ const title = p.name || manifest?.meta?.title || p.identifier || 'Untitled plugin';
+ const desc = p.description || manifest?.meta?.description || '';
+ const category = p.category || manifest?.meta?.category || 'general';
+ const tags = p.tags || manifest?.meta?.tags || [];
+ const tools = Array.isArray(manifest?.api) ? manifest.api : [];
+ const version = manifest?.version || null;
+ const homepage = manifest?.homepage || null;
+ const manifestUrl = p.manifest_url || manifest?._manifest_url || null;
+ const systemRole = manifest?.systemRole || '';
+ const avatarUrl = manifest?.meta?.avatar || null;
+ const rating = Number(p.avg_rating) || 0;
+
+ // Icon — manifest avatar may be an image URL or an emoji/glyph. Anything
+ // that looks like a URL renders as an <img>; everything else (emoji, short
+ // glyph) renders as text, falling back to the title's first letter.
+ const iconEl = $('tool-detail-icon');
+ if (iconEl) {
+ const isUrl = avatarUrl && /^(https?:\/\/|\/)/.test(avatarUrl);
+ if (isUrl) {
+ iconEl.innerHTML = `<img src="${escapeHtml(avatarUrl)}" alt="" loading="lazy" />`;
+ } else {
+ iconEl.textContent = avatarUrl || (title || '?')[0].toUpperCase();
+ }
+ }
+
+ $('tool-detail-name').textContent = title;
+ $('tool-detail-id').textContent = p.identifier || '';
+
+ const authorEl = $('tool-detail-author');
+ const authorName = p.author?.display_name || (typeof manifest?.author === 'string' ? manifest.author : null);
+ if (authorEl) {
+ if (authorName) {
+ authorEl.hidden = false;
+ authorEl.textContent = `by ${authorName}`;
+ } else {
+ authorEl.hidden = true;
+ authorEl.textContent = '';
+ }
+ }
+
+ // Price badge (reuses the listing pill).
+ const priceEl = $('tool-detail-price');
+ if (priceEl) priceEl.innerHTML = priceBadgeHtml(p.price);
+
+ // Pills — category, tool count, installs, rating, version, then tags.
+ const pillsEl = $('tool-detail-pills');
+ if (pillsEl) {
+ const pills = [];
+ pills.push(`<span class="stat-pill">${escapeHtml(category)}</span>`);
+ pills.push(`<span class="stat-pill">${tools.length} tool${tools.length !== 1 ? 's' : ''}</span>`);
+ pills.push(`<span class="stat-pill">↓ ${fmtNumber(p.install_count || 0)} installs</span>`);
+ if (rating > 0) pills.push(`<span class="stat-pill">★ ${rating.toFixed(1)}</span>`);
+ if (version) pills.push(`<span class="stat-pill">v${escapeHtml(String(version))}</span>`);
+ tags.forEach((t) => {
+ pills.push(`<button type="button" class="tag-pill" data-tag="${escapeHtml(t)}">#${escapeHtml(t)}</button>`);
+ });
+ pillsEl.innerHTML = pills.join('');
+ pillsEl.querySelectorAll('[data-tag]').forEach((btn) => {
+ btn.addEventListener('click', () => navTo(`/marketplace?tab=tools&tag=${encodeURIComponent(btn.dataset.tag)}`));
+ });
+ }
+
+ const descEl = $('tool-detail-desc');
+ if (descEl) {
+ descEl.textContent = desc;
+ descEl.hidden = !desc;
+ }
+
+ // Install / buy CTA.
+ const installBtn = $('tool-detail-install');
+ if (installBtn) {
+ const refreshCta = () => {
+ const installed = getInstalledIds().has(p.identifier);
+ const paid = hasActivePrice(p.price);
+ installBtn.classList.toggle('installed', installed);
+ installBtn.textContent = installed
+ ? 'Installed ✓ — Remove'
+ : paid
+ ? `Buy ${formatAssetPrice(p.price)}`
+ : 'Add to Agent';
+ };
+ refreshCta();
+ installBtn.onclick = () => {
+ const installed = getInstalledIds().has(p.identifier);
+ const paid = hasActivePrice(p.price);
+ if (paid && p.id && !installed) {
+ openAssetPurchaseFlow({
+ item_type: 'plugin',
+ item_id: p.id,
+ label: title,
+ price: p.price,
+ });
+ return;
+ }
+ togglePluginInstall(manifest);
+ refreshCta();
+ };
+ }
+
+ // Share.
+ const shareBtn = $('tool-detail-share');
+ if (shareBtn) {
+ shareBtn.onclick = async () => {
+ const shareUrl = location.href;
+ const shareTitle = `${title} — three.ws plugin`;
+ const shareText = desc || 'Check out this agent plugin on three.ws';
+ if (navigator.share) {
+ try { await navigator.share({ title: shareTitle, text: shareText, url: shareUrl }); return; }
+ catch { /* cancelled — fall through to copy */ }
+ }
+ try {
+ await navigator.clipboard.writeText(shareUrl);
+ const original = shareBtn.textContent;
+ shareBtn.textContent = 'Link copied ✓';
+ shareBtn.classList.add('copied');
+ setTimeout(() => { shareBtn.textContent = original; shareBtn.classList.remove('copied'); }, 1800);
+ } catch (err) {
+ console.error('[marketplace] tool share copy', err);
+ }
+ };
+ }
+
+ // External links.
+ const homeBtn = $('tool-detail-homepage');
+ if (homeBtn) {
+ if (homepage) { homeBtn.hidden = false; homeBtn.href = homepage; }
+ else homeBtn.hidden = true;
+ }
+ const manifestBtn = $('tool-detail-manifest');
+ if (manifestBtn) {
+ if (manifestUrl) { manifestBtn.hidden = false; manifestBtn.href = manifestUrl; }
+ else manifestBtn.hidden = true;
+ }
+
+ // System role.
+ const sysWrap = $('tool-detail-systemrole-wrap');
+ const sysEl = $('tool-detail-systemrole');
+ if (sysWrap && sysEl) {
+ if (systemRole) { sysWrap.hidden = false; sysEl.textContent = systemRole; }
+ else sysWrap.hidden = true;
+ }
+
+ // Tools list — the heart of the detail page.
+ const toolsWrap = $('tool-detail-tools-wrap');
+ const toolsEl = $('tool-detail-tools');
+ const toolsCount = $('tool-detail-tools-count');
+ if (toolsCount) toolsCount.textContent = tools.length ? `${tools.length}` : '';
+ if (toolsWrap && toolsEl) {
+ if (!tools.length) {
+ toolsWrap.hidden = true;
+ } else {
+ toolsWrap.hidden = false;
+ toolsEl.innerHTML = tools.map(renderToolCard).join('');
+ }
+ }
+
+ // Social meta for link unfurls.
+ setSocialMeta({
+ title: `${title} — three.ws plugin`,
+ description: desc || `An agent plugin exposing ${tools.length} tool${tools.length !== 1 ? 's' : ''} on three.ws.`,
+ url: location.origin + location.pathname,
+ image: avatarUrl || _socialMetaDefaults.image,
+ });
+ document.title = `${title} · three.ws`;
+
+ _setToolDetailState({ body: true });
+}
+
+function renderToolCard(tool) {
+ const name = escapeHtml(tool?.name || 'tool');
+ const description = escapeHtml(tool?.description || '');
+ const endpoint = tool?.url ? `<span class="tool-card-endpoint">${escapeHtml(tool.url)}</span>` : '';
+ const params = tool?.parameters;
+ const props = params && typeof params.properties === 'object' ? params.properties : null;
+ const required = new Set(Array.isArray(params?.required) ? params.required : []);
+
+ let paramsHtml = '';
+ if (props && Object.keys(props).length) {
+ const rows = Object.entries(props).map(([key, schema]) => {
+ const type = schema?.type ? escapeHtml(String(schema.type)) : 'any';
+ const pdesc = schema?.description ? `<div class="tool-param-desc">${escapeHtml(schema.description)}</div>` : '';
+ const isReq = required.has(key);
+ const enumVals = Array.isArray(schema?.enum) ? schema.enum : null;
+ const enumHtml = enumVals
+ ? `<div class="tool-param-enum">${enumVals.map((v) => `<code>${escapeHtml(String(v))}</code>`).join('')}</div>`
+ : '';
+ return `<div class="tool-param">
+ <div class="tool-param-row">
+ <span class="tool-param-name">${escapeHtml(key)}</span>
+ <span class="tool-param-type">${type}</span>
+ ${isReq ? '<span class="tool-param-req">required</span>' : ''}
+ </div>
+ ${pdesc}
+ ${enumHtml}
+ </div>`;
+ }).join('');
+ paramsHtml = `<div class="tool-card-params">
+ <div class="tool-card-params-label">Parameters</div>
+ ${rows}
+ </div>`;
+ } else {
+ paramsHtml = '<p class="tool-card-noparams">No parameters.</p>';
+ }
+
+ return `<div class="tool-card">
+ <div class="tool-card-head">
+ <span class="tool-card-name">${name}</span>
+ ${endpoint}
+ </div>
+ ${description ? `<p class="tool-card-desc">${description}</p>` : ''}
+ ${paramsHtml}
+ </div>`;
+}
+
// ── Add by URL modal ──────────────────────────────────────────────────────────
function openPluginUrlModal() {