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(forge/marketplace): model categories, explore improvements, marketplace UI
nirholas64120a6a2943
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 15dd84537..81a0ceeb6 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -7,6 +7,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr## 2026-06-13- **All 14 three.ws MCP servers are now live on npm and the official MCP registry** — Every three.ws MCP server is now publicly installable and discoverable. The eight install-and-run servers ship on npm under the @three-ws scope — pull any of them with one command, e.g. npx -y @three-ws/mcp-server (3D + agent tools), @three-ws/three-token-mcp ($THREE price, hold, and burn), @three-ws/pumpfun-mcp, @three-ws/ibm-x402-mcp, @three-ws/avatar-agent, and more. Together with the six hosted remote servers, all 14 are registered in the official Model Context Protocol registry, so any MCP-compatible client — Claude, Cursor, and others — can find them by name. No more dead install links: the documented commands now work. (`/docs/mcp`) `[sdk, feature]`+- **AR is live on the homepage — place any 3D model in your real space from the front page** — The three.ws homepage now has a live AR section: real models from the Forge gallery load in an interactive 3D viewer, and on mobile you can tap 'Place in your space' to anchor the model in your real environment through the camera. On desktop a QR code appears so you can scan and place from your phone in one step. WebXR on Android, Quick Look on iOS — no app, no download. A full blog post explains how the AR pipeline works across both platforms. (`/blog/see-your-3d-in-ar`) `[feature, improvement]`- **Describe it to 3D joins the rest of the site — and the two generators now point at each other** — The avatar generator at /create/prompt was a cul-de-sac: no site navigation, no footer, no way onward except a back button. It now carries the full three.ws header and footer like every other page, and finishing an avatar pops the same 'what now?' card the Forge shows — open it in Studio, make it an agent, walk it, or embed it, with your new avatar carried along. The two text-to-3D tools also cross-link: Forge points character-makers to Describe it to 3D (rigged avatars), and Describe it to 3D points prop-makers to Forge (textured objects), so you always land in the right tool. (`/create/prompt`) `[improvement]`- **Embed any Forge model on your own site with one line** — Every model you forge now has an Embed button next to Download. It hands you a ready-to-paste snippet — an iframe by default, or a <model-viewer> web component for builders — that drops a live, orbitable, AR-ready 3D model onto any website, with a live preview and size presets (16:9, square, 4:5) right in the panel. The iframe points at a new lightweight three.ws viewer (/forge/embed) that needs no scripts on the host page, and clicking its corner badge brings visitors back to Forge with your prompt pre-loaded to remix. Same idea as the <agent-3d> embed, now for any generated object. (`/forge`) `[feature]`- **Embed straight from the homepage demo — no trip to the full Forge** — The text-to-3D demo on the homepage now has an Embed button right in its result toolbar, so a model you forge there can go on your own site without opening the full Forge first. It pops a panel with a live preview, an iframe or <model-viewer> snippet, and the same 16:9 / square / 4:5 size presets, ready to copy in one tap. It's the same one-line embed the full Forge gives you, now one step shorter from the front page. (`/`) `[feature]`diff --git a/api/_lib/avatars.js b/api/_lib/avatars.jsindex 013133a59..9dbc14874 100644--- a/api/_lib/avatars.js+++ b/api/_lib/avatars.js@@ -125,6 +125,7 @@ export async function updateAvatar({ id, userId, patch }) {patch.thumbnail_key === undefined &&patch.usdz_key === undefined &&patch.halfbody_key === undefined &&+ patch.model_category === undefined &&!hasAppearance &&!hasBaked) {@@ -170,15 +171,16 @@ export async function updateAvatar({ id, userId, patch }) {// "column does not exist".const [row] = await sql`update avatars set- name = coalesce(${patch.name ?? null}, name),- description = coalesce(${patch.description ?? null}, description),- visibility = coalesce(${patch.visibility ?? null}, visibility),- tags = coalesce(${patch.tags ?? null}::text[], tags),- thumbnail_key = coalesce(${patch.thumbnail_key ?? null}, thumbnail_key),- appearance = case when ${hasAppearance}::bool- then ${patch.appearance ? JSON.stringify(patch.appearance) : null}::jsonb- else appearance end,- updated_at = now()+ name = coalesce(${patch.name ?? null}, name),+ description = coalesce(${patch.description ?? null}, description),+ visibility = coalesce(${patch.visibility ?? null}, visibility),+ tags = coalesce(${patch.tags ?? null}::text[], tags),+ thumbnail_key = coalesce(${patch.thumbnail_key ?? null}, thumbnail_key),+ model_category = coalesce(${patch.model_category ?? null}, model_category),+ appearance = case when ${hasAppearance}::bool+ then ${patch.appearance ? JSON.stringify(patch.appearance) : null}::jsonb+ else appearance end,+ updated_at = now()where id = ${id} and owner_id = ${userId} and deleted_at is nullreturning *`;diff --git a/api/_lib/demo-avatars.js b/api/_lib/demo-avatars.jsindex 5eb6d9075..0fe43e2c4 100644--- a/api/_lib/demo-avatars.js+++ b/api/_lib/demo-avatars.js@@ -16,7 +16,7 @@import { env } from './env.js';-function demoItem({ id, slug, name, description, tags, glbUrl, image, sortDate, attribution, author }) {+function demoItem({ id, slug, name, description, tags, glbUrl, image, sortDate, attribution, author, modelCategory }) {const explicitGlb = glbUrl;const finalGlb = explicitGlb.startsWith('http')? explicitGlb@@ -32,6 +32,7 @@ function demoItem({ id, slug, name, description, tags, glbUrl, image, sortDate,glbUrl: finalGlb,has3d: true,tags,+ modelCategory: modelCategory || 'avatar',createdAt: sortDate,viewerUrl: `/avatars/${id}`,attribution,@@ -54,5 +55,5 @@ export const DEMO_AVATARS = [demoItem({ id: "avatar_demo_disk_spartian", slug: "demo-spartian", name: "Spartian", description: "Spartian — disciplined, armored, never folds.", tags: ["humanoid","rigged","animated","community"], glbUrl: "https://three.ws/animations/soldier.glb", image: null, sortDate: "2025-03-31T13:00:00.000Z", attribution: {"handle":"threejs","displayName":"three.js examples","url":"https://github.com/mrdoob/three.js","license":"MIT"}, author: {"handle":"threejs","displayName":"three.js examples","profileUrl":"https://github.com/mrdoob/three.js"} }),demoItem({ id: "avatar_demo_disk_test", slug: "demo-test", name: "Tester", description: "Tester — kicks the tires on every release before anyone else.", tags: ["humanoid","community"], glbUrl: "https://three.ws/avatars/default.glb", image: null, sortDate: "2025-03-31T12:00:00.000Z", attribution: {"handle":"three.ws","displayName":"three.ws starter","url":"https://three.ws","license":"CC-BY 4.0"}, author: {"handle":"three.ws","displayName":"three.ws starter","profileUrl":"https://three.ws"} }),demoItem({ id: "avatar_demo_disk_nova", slug: "demo-nova", name: "Nova", description: "Nova — high-detail portrait avatar with an expressive face, built for streams and overlays.", tags: ["humanoid","character","community"], glbUrl: "https://three.ws/avatars/selfie-girl.glb", image: null, sortDate: "2025-03-31T11:00:00.000Z", attribution: {"handle":"three.ws","displayName":"three.ws starter","url":"https://three.ws","license":"CC-BY 4.0"}, author: {"handle":"three.ws","displayName":"three.ws starter","profileUrl":"https://three.ws"} }),- demoItem({ id: "avatar_demo_disk_foxy", slug: "demo-foxy", name: "Foxy", description: "Foxy — stylized fox mascot with survey, walk, and run animations.", tags: ["animal","mascot","rigged","animated","community"], glbUrl: "https://three.ws/avatars/fox.glb", image: null, sortDate: "2025-03-31T10:00:00.000Z", attribution: {"handle":"khronos","displayName":"Khronos Group","url":"https://github.com/KhronosGroup/glTF-Sample-Assets","license":"CC-BY 4.0"}, author: {"handle":"khronos","displayName":"Khronos Group","profileUrl":"https://github.com/KhronosGroup/glTF-Sample-Assets"} }),+ demoItem({ id: "avatar_demo_disk_foxy", slug: "demo-foxy", name: "Foxy", description: "Foxy — stylized fox mascot with survey, walk, and run animations.", tags: ["animal","mascot","rigged","animated","community"], glbUrl: "https://three.ws/avatars/fox.glb", image: null, sortDate: "2025-03-31T10:00:00.000Z", attribution: {"handle":"khronos","displayName":"Khronos Group","url":"https://github.com/KhronosGroup/glTF-Sample-Assets","license":"CC-BY 4.0"}, author: {"handle":"khronos","displayName":"Khronos Group","profileUrl":"https://github.com/KhronosGroup/glTF-Sample-Assets"}, modelCategory: "creature" }),];diff --git a/api/_lib/forge-store.js b/api/_lib/forge-store.jsindex 3afaf034d..d74e844b0 100644--- a/api/_lib/forge-store.js+++ b/api/_lib/forge-store.js@@ -59,6 +59,12 @@ export function hashIp(ip) {// retained even if the mesh step later fails. Returns the new creation id (used// as the durable object key and the client-facing handle) or null when the// store is unavailable.+export const MODEL_CATEGORIES = ['avatar', 'accessory', 'item', 'scene', 'creature', 'vehicle', 'other'];++export function validModelCategory(v) {+ return typeof v === 'string' && MODEL_CATEGORIES.includes(v) ? v : null;+}+export async function createCreation({clientKey,ipHash,@@ -73,21 +79,23 @@ export async function createCreation({backend,tier,path,+ modelCategory,}) {if (!forgeStoreEnabled()) return null;const id = randomUUID();+ const category = validModelCategory(modelCategory) ?? 'other';try {await sql`insert into forge_creations(id, client_key, ip_hash, prompt, aspect, preview_image_url,replicate_job_id, text_to_image_model, views_requested, views_used,- multiview, backend, tier, path, status, outcome)+ multiview, backend, tier, path, status, outcome, model_category)values(${id}, ${clientKey}, ${ipHash ?? null}, ${prompt}, ${aspect ?? null},${previewImageUrl ?? null}, ${replicateJobId ?? null},${textToImageModel ?? null}, ${viewsRequested ?? null}, ${viewsUsed ?? null},${typeof multiview === 'boolean' ? multiview : null}, ${backend ?? null},- ${tier ?? null}, ${path ?? null}, 'generating', 'generated')+ ${tier ?? null}, ${path ?? null}, 'generating', 'generated', ${category})`;return id;} catch (err) {@@ -103,7 +111,7 @@ export async function findByJob({ replicateJobId, clientKey }) {try {const rows = await sql`select id, status, glb_url, glb_key, prompt, preview_image_url,- views_requested, views_used, multiview, backend, tier, path+ views_requested, views_used, multiview, backend, tier, path, model_categoryfrom forge_creationswhere replicate_job_id = ${replicateJobId} and client_key = ${clientKey}limit 1@@ -270,6 +278,25 @@ export async function recordFeedback({ id, clientKey, outcome, downloaded, ratin}}+// Update the model_category on a forge creation. Scoped to the owning client.+export async function setForgeCategory({ id, clientKey, modelCategory }) {+ if (!forgeStoreEnabled() || !id) return false;+ const category = validModelCategory(modelCategory);+ if (!category) return false;+ try {+ const rows = await sql`+ update forge_creations+ set model_category = ${category}, updated_at = now()+ where id = ${id} and client_key = ${clientKey}+ returning id+ `;+ return rows.length > 0;+ } catch (err) {+ console.error('[forge-store] setForgeCategory failed:', err?.message);+ return false;+ }+}+// Fetch a single durable creation by id, NOT scoped to any client. Powers the// share flow: a recipient who didn't forge the model still gets to view it.// Only returns finished, durably-stored rows — an in-flight or failed creation@@ -279,7 +306,7 @@ export async function getPublicCreation({ id }) {try {const rows = await sql`select id, prompt, aspect, glb_url, preview_image_url, outcome,- views_used, multiview, backend, tier, path, created_at+ views_used, multiview, backend, tier, path, model_category, created_atfrom forge_creationswhere id = ${id} and status = 'done' and glb_url is not nulllimit 1@@ -298,6 +325,7 @@ export async function getPublicCreation({ id }) {backend: r.backend ?? null,tier: r.tier ?? null,path: r.path ?? null,+ model_category: r.model_category ?? 'other',created_at: r.created_at,};} catch (err) {@@ -313,7 +341,7 @@ export async function listCreations({ clientKey, limit = 24 }) {try {const rows = await sql`select id, prompt, aspect, glb_url, preview_image_url, outcome, downloaded,- views_used, multiview, backend, tier, path, created_at+ views_used, multiview, backend, tier, path, model_category, created_atfrom forge_creationswhere client_key = ${clientKey} and status = 'done' and glb_url is not nullorder by created_at desc@@ -332,6 +360,7 @@ export async function listCreations({ clientKey, limit = 24 }) {backend: r.backend ?? null,tier: r.tier ?? null,path: r.path ?? null,+ model_category: r.model_category ?? 'other',created_at: r.created_at,}));} catch (err) {@@ -356,7 +385,7 @@ export async function listShowcase({ limit = 12 } = {}) {// but they shouldn't bury the visual rows.const rows = await sql`select id, prompt, glb_url, preview_image_url,- views_used, multiview, backend, tier, path, created_at+ views_used, multiview, backend, tier, path, model_category, created_atfrom forge_creationswhere status = 'done' and glb_url is not nulland (outcome is null or outcome != 'rejected')@@ -373,6 +402,7 @@ export async function listShowcase({ limit = 12 } = {}) {backend: r.backend ?? null,tier: r.tier ?? null,path: r.path ?? null,+ model_category: r.model_category ?? 'other',created_at: r.created_at,}));} catch (err) {diff --git a/api/_lib/migrations/20260613000000_model_categories.sql b/api/_lib/migrations/20260613000000_model_categories.sqlnew file mode 100644index 000000000..d4757ce53--- /dev/null+++ b/api/_lib/migrations/20260613000000_model_categories.sql@@ -0,0 +1,28 @@+-- Model categories: classify what a 3D model IS, not just how it was created.+-- This powers category browsing everywhere models are displayed and lays the+-- groundwork for an agent equipment / accessory system.+--+-- Categories:+-- avatar — full character/agent body (default for existing records)+-- accessory — wearable/equippable item for an agent+-- item — prop or object an agent can hold or interact with+-- scene — environment, world, or background scene+-- creature — animal, pet, or non-humanoid companion+-- vehicle — vehicle or mount+-- other — uncategorised++ALTER TABLE avatars+ ADD COLUMN IF NOT EXISTS model_category text NOT NULL DEFAULT 'avatar'+ CHECK (model_category IN ('avatar','accessory','item','scene','creature','vehicle','other'));++ALTER TABLE forge_creations+ ADD COLUMN IF NOT EXISTS model_category text NOT NULL DEFAULT 'other'+ CHECK (model_category IN ('avatar','accessory','item','scene','creature','vehicle','other'));++-- Index for category-filtered listing queries on both tables.+CREATE INDEX IF NOT EXISTS idx_avatars_model_category+ ON avatars (model_category)+ WHERE deleted_at IS NULL;++CREATE INDEX IF NOT EXISTS idx_forge_creations_model_category+ ON forge_creations (model_category);diff --git a/api/_lib/rate-limit.js b/api/_lib/rate-limit.jsindex 633f3f524..eeca8ac43 100644--- a/api/_lib/rate-limit.js+++ b/api/_lib/rate-limit.js@@ -217,8 +217,10 @@ export const limits = {// aixbt intelligence bridge (api/aixbt/*). Each call may fall through to the// upstream aixbt REST API, which is rate-limited per key — cap per IP so one// caller can't drain the shared key's budget. Reads are cached, so this is- // generous enough for an interactive feed.+ // generous enough for an interactive feed. The global ceiling prevents many+ // distributed IPs from collectively exhausting the shared upstream key.aixbtIp: (ip) => getLimiter('aixbt:ip', { limit: 90, window: '1 m' }).limit(ip),+ aixbtGlobal: () => getLimiter('aixbt:global', { limit: 1800, window: '1 h' }).limit('global'),// Solana Developer Platform proxy (api/sdp/*). Each call fronts the SDP API// under our server-side key, and writes (wallet create / issuance / payment)// move real value, so cap per IP to keep that egress bounded and prevent thediff --git a/api/aixbt/intel.js b/api/aixbt/intel.jsindex 603821205..677a4cf72 100644--- a/api/aixbt/intel.js+++ b/api/aixbt/intel.js@@ -16,11 +16,12 @@ export default wrap(async (req, res) => {if (cors(req, res, { methods: 'GET,OPTIONS', origins: '*' })) return;if (!method(req, res, ['GET'])) return;- const rl = await limits.aixbtIp(clientIp(req));+ const [rl, rlg] = await Promise.all([limits.aixbtIp(clientIp(req)), limits.aixbtGlobal()]);if (!rl.success) return rateLimited(res, rl);+ if (!rlg.success) return rateLimited(res, rlg);const url = new URL(req.url, 'http://x');- const limit = Number(url.searchParams.get('limit')) || 20;+ const limit = Math.min(Math.max(Number(url.searchParams.get('limit')) || 20, 1), 100);const category = url.searchParams.get('category') || undefined;const chain = url.searchParams.get('chain') || undefined;diff --git a/api/aixbt/projects.js b/api/aixbt/projects.jsindex 1359fe90f..801a6a934 100644--- a/api/aixbt/projects.js+++ b/api/aixbt/projects.js@@ -14,12 +14,13 @@ export default wrap(async (req, res) => {if (cors(req, res, { methods: 'GET,OPTIONS', origins: '*' })) return;if (!method(req, res, ['GET'])) return;- const rl = await limits.aixbtIp(clientIp(req));+ const [rl, rlg] = await Promise.all([limits.aixbtIp(clientIp(req)), limits.aixbtGlobal()]);if (!rl.success) return rateLimited(res, rl);+ if (!rlg.success) return rateLimited(res, rlg);const url = new URL(req.url, 'http://x');- const limit = Number(url.searchParams.get('limit')) || 20;- const page = Number(url.searchParams.get('page')) || 1;+ const limit = Math.min(Math.max(Number(url.searchParams.get('limit')) || 20, 1), 100);+ const page = Math.min(Math.max(Number(url.searchParams.get('page')) || 1, 1), 100);const names = url.searchParams.get('names') || undefined;const chain = url.searchParams.get('chain') || undefined;diff --git a/api/avatars/[id].js b/api/avatars/[id].jsindex 454edce2b..6bbd66496 100644--- a/api/avatars/[id].js+++ b/api/avatars/[id].js@@ -24,6 +24,8 @@ import { dispatchWebhooks } from '../_lib/webhook-dispatch.js';const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;+const MODEL_CATEGORY_VALUES = ['avatar', 'accessory', 'item', 'scene', 'creature', 'vehicle', 'other'];+const patchSchema = z.object({name: z.string().trim().min(1).max(120).optional(),description: z.string().trim().max(2000).optional(),@@ -32,6 +34,7 @@ const patchSchema = z.object({thumbnail_key: z.string().min(1).max(512).optional(),usdz_key: z.string().min(1).max(512).optional(),halfbody_key: z.string().min(1).max(512).optional(),+ model_category: z.enum(MODEL_CATEGORY_VALUES).optional(),// `null` clears the dress-up state. Omit the field entirely to leave it untouched.appearance: avatarAppearance.nullable().optional(),});diff --git a/api/avatars/_actions.js b/api/avatars/_actions.jsindex 7d30f4e0b..deaa5eb51 100644--- a/api/avatars/_actions.js+++ b/api/avatars/_actions.js@@ -300,7 +300,7 @@ const handlePublic = wrap(async (req, res) => {if (!method(req, res, ['GET'])) return;const url = new URL(req.url, 'http://x');const parsedLimit = Number(url.searchParams.get('limit'));- const limit = Number.isFinite(parsedLimit) && parsedLimit > 0 ? parsedLimit : 24;+ const limit = Math.min(Number.isFinite(parsedLimit) && parsedLimit > 0 ? parsedLimit : 24, 100);let result;try {result = await searchPublicAvatars({diff --git a/api/avatars/index.js b/api/avatars/index.jsindex de04f5b21..43daaad01 100644--- a/api/avatars/index.js+++ b/api/avatars/index.js@@ -33,7 +33,7 @@ async function handleList(req, res) {const url = new URL(req.url, 'http://x');const result = await listAvatars({userId: auth.userId,- limit: Number(url.searchParams.get('limit')) || 50,+ limit: Math.min(Math.max(Number(url.searchParams.get('limit')) || 50, 1), 200),cursor: url.searchParams.get('cursor'),visibility: url.searchParams.get('visibility'),includePublic: url.searchParams.get('include_public') === 'true',diff --git a/api/explore.js b/api/explore.jsindex 7df5b7a1d..317f86a9e 100644--- a/api/explore.js+++ b/api/explore.js@@ -68,6 +68,13 @@ export default wrap(async (req, res) => {const sourceFilter = url.searchParams.get('source') || 'all';const quality = url.searchParams.get('quality') === 'all' ? 'all' : 'high';+ // model_category filter — null means 'all categories'+ const categoryFilter = url.searchParams.get('category') || null;+ const VALID_CATEGORIES = new Set(['avatar', 'accessory', 'item', 'scene', 'creature', 'vehicle', 'other']);+ if (categoryFilter && !VALID_CATEGORIES.has(categoryFilter)) {+ return error(res, 400, 'validation_error', 'unknown category');+ }+const cursorDate = cursor ? new Date(cursor) : null;if (cursor && isNaN(cursorDate?.getTime())) {return error(res, 400, 'validation_error', 'cursor must be an ISO date');@@ -103,7 +110,7 @@ export default wrap(async (req, res) => {const avatarRows = includeAvatars? await sql`SELECT a.id, a.slug, a.name, a.description, a.storage_key, a.thumbnail_key,- a.tags, a.created_at, a.source,+ a.tags, a.created_at, a.source, a.model_category,coalesce(a.featured, false) AS featured,coalesce(a.view_count, 0) AS view_count,u.username AS owner_username,@@ -123,6 +130,7 @@ export default wrap(async (req, res) => {coalesce(a.name,'') ILIKE ${'%' + q + '%'}OR coalesce(a.description,'') ILIKE ${'%' + q + '%'}))+ AND (${categoryFilter}::text IS NULL OR a.model_category = ${categoryFilter})AND (${cursorDate ? cursorDate.toISOString() : null}::timestamptz IS NULL OR a.created_at < ${cursorDate ? cursorDate.toISOString() : null}::timestamptz)ORDER BY coalesce(a.featured, false) DESC, a.created_at DESCLIMIT ${(limit + 1) * 3}@@ -226,6 +234,7 @@ export default wrap(async (req, res) => {has3d: true,tags: r.tags || [],source: r.source || null,+ modelCategory: r.model_category || 'avatar',featured: r.featured === true || r.featured === 't',viewCount: Number(r.view_count) || 0,createdAt: r.created_at,@@ -252,16 +261,20 @@ export default wrap(async (req, res) => {if (avatarItems.length > limit + 1) avatarItems = avatarItems.slice(0, limit + 1);// Inject demo avatars on the first page when the source allows avatars.- // Filter by query if one is set so search still feels correct.+ // Filter by query and/or category if set so search/filter still feel correct.if (includeAvatars && !cursorDate) {const qLower = q.toLowerCase();- const matching = q- ? DEMO_AVATARS.filter(- (a) =>- a.name.toLowerCase().includes(qLower) ||- a.description.toLowerCase().includes(qLower),- )- : DEMO_AVATARS;+ let matching = DEMO_AVATARS;+ if (q) {+ matching = matching.filter(+ (a) =>+ a.name.toLowerCase().includes(qLower) ||+ a.description.toLowerCase().includes(qLower),+ );+ }+ if (categoryFilter) {+ matching = matching.filter((a) => (a.modelCategory || 'avatar') === categoryFilter);+ }avatarItems.push(...matching);}diff --git a/api/forge-categorize.js b/api/forge-categorize.jsnew file mode 100644index 000000000..0b94a2161--- /dev/null+++ b/api/forge-categorize.js@@ -0,0 +1,50 @@+/**+ * Forge categorize — set the model_category on a forge creation.+ *+ * POST /api/forge-categorize { creation_id, model_category }+ *+ * Auth-free like the rest of /forge: scoped to the anonymous client key+ * (x-forge-client header) so a creator can only categorize their own models.+ *+ * Valid categories: avatar | accessory | item | scene | creature | vehicle | other+ */++import { cors, json, method, readJson, wrap, rateLimited } from './_lib/http.js';+import { limits, clientIp } from './_lib/rate-limit.js';+import { hashClient, setForgeCategory, MODEL_CATEGORIES, forgeStoreEnabled } from './_lib/forge-store.js';++const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;+const VALID_CATEGORIES = new Set(MODEL_CATEGORIES);++export default wrap(async (req, res) => {+ if (cors(req, res, { methods: 'POST,OPTIONS' })) return;+ if (!method(req, res, ['POST'])) return;++ const rl = await limits.mcp3dStatus(clientIp(req));+ if (!rl.success) return rateLimited(res, rl);++ if (!forgeStoreEnabled()) {+ return json(res, 200, { ok: false, stored: false, reason: 'persistence_unconfigured' });+ }++ const body = await readJson(req, 4_000).catch(() => null);+ const creationId = typeof body?.creation_id === 'string' ? body.creation_id.trim() : '';+ if (!UUID_RE.test(creationId)) {+ return json(res, 400, { error: 'invalid_creation', message: 'creation_id must be a uuid.' });+ }++ const modelCategory = typeof body?.model_category === 'string' ? body.model_category.trim() : '';+ if (!VALID_CATEGORIES.has(modelCategory)) {+ return json(res, 400, {+ error: 'invalid_category',+ message: `model_category must be one of: ${MODEL_CATEGORIES.join(', ')}`,+ });+ }++ const rawClient = req.headers['x-forge-client'];+ const clientKey = hashClient(Array.isArray(rawClient) ? rawClient[0] : rawClient);++ const stored = await setForgeCategory({ id: creationId, clientKey, modelCategory });++ return json(res, 200, { ok: true, stored });+});diff --git a/api/forge-gallery.js b/api/forge-gallery.jsindex 1e76cdab6..f7af6ba41 100644--- a/api/forge-gallery.js+++ b/api/forge-gallery.js@@ -26,7 +26,7 @@ export default wrap(async (req, res) => {if (cors(req, res, { methods: 'GET,OPTIONS' })) return;if (!method(req, res, ['GET'])) return;- const rl = await limits.mcp3dStatus(clientIp(req));+ const rl = await limits.publicIp(clientIp(req));if (!rl.success) {return rateLimited(res, rl);}@@ -36,7 +36,7 @@ export default wrap(async (req, res) => {}const url = new URL(req.url, 'http://localhost');- const limit = Number(url.searchParams.get('limit')) || 24;+ const limit = Math.min(Math.max(Number(url.searchParams.get('limit')) || 24, 1), 50);if ((url.searchParams.get('scope') || '').trim() === 'community') {const creations = await listShowcase({ limit });diff --git a/api/kol/[action].js b/api/kol/[action].jsindex 98e8ac41c..cd494e8db 100644--- a/api/kol/[action].js+++ b/api/kol/[action].js@@ -187,7 +187,7 @@ async function handleLeaderboard(req, res) {const url = new URL(req.url, `http://${req.headers.host}`);const window = url.searchParams.get('window') || '7d';const limitRaw = url.searchParams.get('limit');- const limit = limitRaw != null ? Number(limitRaw) : 25;+ const limit = Math.min(Math.max(Number(limitRaw) || 25, 1), 100);const { getLeaderboard } = await import('../../src/kol/leaderboard.js');let items;try {diff --git a/api/pump/channel-feed.js b/api/pump/channel-feed.jsindex 687d7dd45..16f7248c6 100644--- a/api/pump/channel-feed.js+++ b/api/pump/channel-feed.js@@ -13,7 +13,8 @@ export default wrap(async (req, res) => {const kindsParam = url.searchParams.get('kinds');const allowed = kindsParam ? new Set(kindsParam.split(',').map(s => s.trim())) : null;const limitParam = url.searchParams.get('limit');- const limit = limitParam ? parseInt(limitParam, 10) : Infinity;+ const limitRaw = limitParam ? parseInt(limitParam, 10) : 100;+ const limit = Math.min(Math.max(Number.isFinite(limitRaw) ? limitRaw : 100, 1), 200);const [mints, whales, claims] = await Promise.all([(!allowed || allowed.has('mint')) ? getMints().catch(() => []) : [],@@ -34,7 +35,7 @@ export default wrap(async (req, res) => {return true;}).sort((a, b) => (b.timestamp || 0) - (a.timestamp || 0))- .slice(0, isFinite(limit) ? limit : undefined);+ .slice(0, limit);return json(res, 200, { items: all });});diff --git a/api/token/[action].js b/api/token/[action].jsindex 5e203c4ba..733fee17f 100644--- a/api/token/[action].js+++ b/api/token/[action].js@@ -186,7 +186,7 @@ async function handlePayments(req, res) {purpose: url.searchParams.get('purpose') || null,refType: url.searchParams.get('ref_type') || null,refId: url.searchParams.get('ref_id') || null,- limit: Number(url.searchParams.get('limit')) || 50,+ limit: Math.min(Math.max(Number(url.searchParams.get('limit')) || 50, 1), 200),before: url.searchParams.get('before') || null,});return json(res, 200, page);diff --git a/api/widgets/[id]/[action].js b/api/widgets/[id]/[action].jsindex aca64651f..89ddfd2c1 100644--- a/api/widgets/[id]/[action].js+++ b/api/widgets/[id]/[action].js@@ -1421,7 +1421,7 @@ async function handleKnowledge(req, res) {const probe = url.searchParams.get('test');if (probe !== null) {try {- const topK = parseInt(url.searchParams.get('top_k') || '5', 10) || 5;+ const topK = Math.min(parseInt(url.searchParams.get('top_k') || '5', 10) || 5, 20);const data = await testRetrieval({ widgetId: id, query: probe, topK });return json(res, 200, data);} catch (err) {diff --git a/data/changelog.json b/data/changelog.jsonindex b18c33e9d..1c2428f6e 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,16 @@{"$comment": "Curated changelog entries for three.ws — the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-06-13",+ "title": "AR is live on the homepage — place any 3D model in your real space from the front page",+ "summary": "The three.ws homepage now has a live AR section: real models from the Forge gallery load in an interactive 3D viewer, and on mobile you can tap 'Place in your space' to anchor the model in your real environment through the camera. On desktop a QR code appears so you can scan and place from your phone in one step. WebXR on Android, Quick Look on iOS — no app, no download. A full blog post explains how the AR pipeline works across both platforms.",+ "tags": [+ "feature",+ "improvement"+ ],+ "link": "/blog/see-your-3d-in-ar"+ },{"date": "2026-06-13","title": "All 14 three.ws MCP servers are now live on npm and the official MCP registry",diff --git a/pages/home.html b/pages/home.htmlindex cb2349021..28f0ef566 100644--- a/pages/home.html+++ b/pages/home.html@@ -2372,6 +2372,68 @@transform: none;}}++ /* ── HOME AR SECTION ─────────────────────────────────────────── */+ #home-ar { background: var(--bg); }+ .har-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }+ @media (max-width: 860px) { .har-inner { grid-template-columns: 1fr; gap: 40px; } }+ .har-viewer-wrap {+ position: relative;+ border-radius: 20px;+ overflow: hidden;+ background: #0a0a14;+ border: 1px solid var(--hairline);+ aspect-ratio: 1 / 1;+ display: flex; align-items: center; justify-content: center;+ }+ .har-viewer-wrap model-viewer { width: 100%; height: 100%; --poster-color: transparent; background: transparent; }+ .har-viewer-nav {+ position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);+ display: flex; align-items: center; gap: 8px;+ background: rgba(0,0,0,.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);+ border: 1px solid rgba(255,255,255,.08); border-radius: 999px; padding: 6px 10px;+ }+ .har-nav-btn {+ background: none; border: none; color: rgba(255,255,255,.6); cursor: pointer;+ padding: 4px 8px; border-radius: 6px; font-size: 14px; line-height: 1;+ transition: color .15s, background .15s;+ }+ .har-nav-btn:hover { color: #fff; background: rgba(255,255,255,.08); }+ .har-prompt { font-size: 11px; color: rgba(255,255,255,.5); font-family: var(--font-mono); max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }+ .har-skeleton { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 13px; }+ .har-right { display: flex; flex-direction: column; gap: 28px; }+ .har-mobile-btn {+ display: inline-flex; align-items: center; gap: 10px;+ padding: 16px 24px; border-radius: 14px; background: #fff; color: #000;+ font-size: 16px; font-weight: 600; border: none; cursor: pointer;+ transition: transform .15s, box-shadow .15s, opacity .15s; align-self: flex-start;+ }+ .har-mobile-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(255,255,255,.15); }+ .har-mobile-btn:active { transform: none; }+ .har-mobile-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }+ .har-mobile-btn svg { width: 20px; height: 20px; flex-shrink: 0; }+ .har-qr-wrap {+ width: 120px; height: 120px; border-radius: 12px; background: #fff;+ display: flex; align-items: center; justify-content: center;+ padding: 8px; box-sizing: border-box;+ }+ .har-qr-wrap canvas { border-radius: 4px; display: block; }+ .har-qr-label { font-size: 13px; color: var(--text-3); line-height: 1.5; }+ .har-compat { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }+ .har-compat-pill {+ padding: 4px 12px; border-radius: 999px;+ background: rgba(255,255,255,.05); border: 1px solid var(--hairline);+ font-size: 12px; color: var(--text-3);+ }+ .har-cta-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 14px; text-decoration: none; transition: color .15s; }+ .har-cta-link:hover { color: var(--text); }+ /* Show/hide platform-specific UI: default desktop */+ .har-desktop-only { display: flex; flex-direction: column; gap: 12px; }+ .har-mobile-only { display: none; }+ @media (hover: none) and (pointer: coarse) {+ .har-desktop-only { display: none; }+ .har-mobile-only { display: flex; flex-direction: column; gap: 16px; }+ }</style><noscript><style>.reveal{opacity:1!important;transform:none!important}.hero-text>*{opacity:1!important;transform:none!important}</style></noscript><script type="module" src="https://three.ws/agent-3d/latest/agent-3d.js"></script>@@ -3687,6 +3749,185 @@</div></section>+<!-- ── AR — PLACE IT IN YOUR WORLD ───────────────────────────────── -->+<section class="block" id="home-ar">+ <div class="wrap-1280">+ <div class="block-head reveal">+ <p class="block-eyebrow"><span class="num">•</span>Augmented Reality</p>+ <h2 class="block-h">Your 3D agent. <em>In your room.</em></h2>+ <p class="block-lede">+ Every model you generate or import gets a View in AR button. On mobile, tap once to anchor it in your real space through the camera. On desktop, scan the QR and place it from your phone. WebXR on Android, Quick Look on iOS. No app. No download.+ </p>+ </div>+ <div class="har-inner reveal reveal-d1">+ <div class="har-viewer-wrap" id="har-viewer-wrap">+ <div class="har-skeleton" id="har-skeleton">Loading model…</div>+ <!-- model-viewer injected by JS once the CDN script is ready -->+ <div class="har-viewer-nav" id="har-viewer-nav" style="display:none">+ <button class="har-nav-btn" id="har-prev" aria-label="Previous model">←</button>+ <span class="har-prompt" id="har-prompt-label"></span>+ <button class="har-nav-btn" id="har-next" aria-label="Next model">→</button>+ </div>+ </div>+ <div class="har-right">+ <div>+ <p style="color:var(--text-2);line-height:1.7;margin:0 0 8px;font-size:15px;">+ These are real models from the <a href="/forge" style="color:var(--text);text-decoration:underline;text-underline-offset:3px">Forge gallery</a> — generated by users with a text prompt. On a phone, tap the button below to see the current model anchored to a flat surface around you at real-world scale.+ </p>+ <div class="har-compat">+ <span class="har-compat-pill">WebXR · Android</span>+ <span class="har-compat-pill">Quick Look · iOS</span>+ <span class="har-compat-pill">No app needed</span>+ </div>+ </div>++ <!-- Mobile: direct AR launch -->+ <div class="har-mobile-only">+ <button class="har-mobile-btn" id="har-ar-btn" disabled>+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 2 3 7v10l9 5 9-5V7z"/><path d="M3 7l9 5 9-5"/><path d="M12 12v10"/></svg>+ Place in your space+ </button>+ <p style="color:var(--text-3);font-size:13px;margin:0">Point your camera at a flat surface to anchor the model.</p>+ </div>++ <!-- Desktop: QR code -->+ <div class="har-desktop-only">+ <div class="har-qr-wrap" id="har-qr-wrap">+ <canvas id="har-qr-canvas" width="104" height="104" style="border-radius:4px;display:block"></canvas>+ </div>+ <p class="har-qr-label">Scan with your phone to place<br>this model in your real space.</p>+ </div>++ <div style="display:flex;flex-direction:column;gap:10px">+ <a class="har-cta-link" href="/forge">Generate your own model →</a>+ <a class="har-cta-link" href="/gallery">Browse the avatar gallery →</a>+ <a class="har-cta-link" href="/blog/see-your-3d-in-ar">How AR works on three.ws →</a>+ </div>+ </div>+ </div>+ </div>+</section>+<script type="module">+(async () => {+ const { renderQRToCanvas } = await import('/src/erc8004/qr.js');++ // Lazy-load model-viewer (reuse the CDN script if already present)+ async function ensureModelViewer() {+ if (customElements.get('model-viewer')) return;+ await new Promise((resolve, reject) => {+ const s = document.createElement('script');+ s.type = 'module';+ s.src = 'https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js';+ s.integrity = 'sha384-sr9b4Ux0WhAUGclJ0ym0FSY2zSOMmNSn0bP/SA0e6bNCrpn/5W3QL8mm+LdlQMKw';+ s.crossOrigin = 'anonymous';+ s.onload = resolve;+ s.onerror = reject;+ document.head.appendChild(s);+ });+ }++ let models = [];+ let idx = 0;+ let mv = null;++ const wrap = document.getElementById('har-viewer-wrap');+ const skeleton = document.getElementById('har-skeleton');+ const nav = document.getElementById('har-viewer-nav');+ const promptLabel = document.getElementById('har-prompt-label');+ const arBtn = document.getElementById('har-ar-btn');+ const qrCanvas = document.getElementById('har-qr-canvas');+ const qrWrap = document.getElementById('har-qr-wrap');++ // Render QR pointing to three.ws/forge for this model+ function updateQR(glbUrl) {+ // Link directly to the gallery so mobile users can pick the same model+ // Encode as a forge viewer link if possible; fall back to /forge+ const arUrl = `https://three.ws/forge`;+ try {+ const ctx = qrCanvas.getContext('2d');+ const tmp = renderQRToCanvas(arUrl, { scale: 8, margin: 2 });+ qrCanvas.width = tmp.width;+ qrCanvas.height = tmp.height;+ ctx.drawImage(tmp, 0, 0);+ qrWrap.style.width = qrCanvas.width + 'px';+ qrWrap.style.height = qrCanvas.height + 'px';+ } catch {}+ }++ function loadModel(m) {+ if (!mv) return;+ mv.setAttribute('src', m.glb_url);+ mv.setAttribute('alt', m.prompt || '3D model');+ promptLabel.textContent = m.prompt || 'model';+ arBtn.disabled = false;+ updateQR(m.glb_url);+ }++ async function init() {+ try {+ const r = await fetch('/api/forge-gallery?limit=12');+ if (!r.ok) throw new Error(r.status);+ const d = await r.json();+ models = (d.creations || []).filter(c => c.glb_url);+ } catch { models = []; }++ if (!models.length) {+ skeleton.textContent = 'No models available';+ return;+ }++ await ensureModelViewer();++ mv = document.createElement('model-viewer');+ mv.setAttribute('camera-controls', '');+ mv.setAttribute('auto-rotate', '');+ mv.setAttribute('ar', '');+ mv.setAttribute('ar-modes', 'webxr scene-viewer quick-look');+ mv.setAttribute('shadow-intensity', '1');+ mv.setAttribute('environment-image', 'neutral');+ mv.style.cssText = 'width:100%;height:100%;--poster-color:transparent;background:transparent;';++ skeleton.style.display = 'none';+ wrap.insertBefore(mv, nav);++ loadModel(models[0]);+ nav.style.display = 'flex';++ // Wire AR button to model-viewer+ arBtn.addEventListener('click', () => {+ if (mv && mv.activateAR) mv.activateAR();+ });++ // Cycle models+ document.getElementById('har-prev').addEventListener('click', () => {+ idx = (idx - 1 + models.length) % models.length;+ loadModel(models[idx]);+ });+ document.getElementById('har-next').addEventListener('click', () => {+ idx = (idx + 1) % models.length;+ loadModel(models[idx]);+ });+ }++ // Render initial QR immediately (desktop only, no model needed)+ try {+ const tmp = renderQRToCanvas('https://three.ws/forge', { scale: 8, margin: 2 });+ qrCanvas.width = tmp.width;+ qrCanvas.height = tmp.height;+ qrCanvas.getContext('2d').drawImage(tmp, 0, 0);+ qrWrap.style.width = qrCanvas.width + 'px';+ qrWrap.style.height = qrCanvas.height + 'px';+ } catch {}++ // Use IntersectionObserver to lazy-init when section is visible+ const section = document.getElementById('home-ar');+ const io = new IntersectionObserver((entries) => {+ if (entries[0].isIntersecting) { io.disconnect(); init(); }+ }, { rootMargin: '200px' });+ io.observe(section);+})();+</script>+<!-- ── FEATURE BENTO ─────────────────────────────────────────────── --><section class="block"><div class="wrap-1280">diff --git a/pages/marketplace.html b/pages/marketplace.htmlindex de02e4528..58b8d25a3 100644--- a/pages/marketplace.html+++ b/pages/marketplace.html@@ -2706,6 +2706,21 @@Paid</button></div>+ <div+ class="market-filter-chips market-model-category-chips"+ id="market-model-category-chips"+ role="group"+ aria-label="Filter 3D models by type"+ hidden+ >+ <button class="market-chip active" data-model-cat="" title="All 3D models">All 3D</button>+ <button class="market-chip" data-model-cat="avatar" title="Full character / agent body models">Avatar</button>+ <button class="market-chip" data-model-cat="accessory" title="Wearable items for agents">Accessory</button>+ <button class="market-chip" data-model-cat="item" title="Props and objects">Item</button>+ <button class="market-chip" data-model-cat="scene" title="Environments and worlds">Scene</button>+ <button class="market-chip" data-model-cat="creature" title="Animals and companions">Creature</button>+ <button class="market-chip" data-model-cat="vehicle" title="Vehicles and mounts">Vehicle</button>+ </div><label class="market-visually-hidden" for="market-sort">Sort marketplace results</label>diff --git a/public/changelog.json b/public/changelog.jsonindex ac69f7f26..a529c8e45 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-13T08:37:02.543Z",+ "generated_at": "2026-06-13T09:11:49.815Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -17,6 +17,17 @@"feature"]},+ {+ "date": "2026-06-13",+ "type": "update",+ "title": "AR is live on the homepage — place any 3D model in your real space from the front page",+ "summary": "The three.ws homepage now has a live AR section: real models from the Forge gallery load in an interactive 3D viewer, and on mobile you can tap 'Place in your space' to anchor the model in your real environment through the camera. On desktop a QR code appears so you can scan and place from your phone in one step. WebXR on Android, Quick Look on iOS — no app, no download. A full blog post explains how the AR pipeline works across both platforms.",+ "link": "/blog/see-your-3d-in-ar",+ "tags": [+ "feature",+ "improvement"+ ]+ },{"date": "2026-06-13","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 46b0ca947..7615db7a2 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -14,6 +14,14 @@<category>sdk</category><description>Every three.ws MCP server is now publicly installable and discoverable. The eight install-and-run servers ship on npm under the @three-ws scope — pull any of them with one command, e.g. npx -y @three-ws/mcp-server (3D + agent tools), @three-ws/three-token-mcp ($THREE price, hold, and burn), @three-ws/pumpfun-mcp, @three-ws/ibm-x402-mcp, @three-ws/avatar-agent, and more. Together with the six hosted remote servers, all 14 are registered in the official Model Context Protocol registry, so any MCP-compatible client — Claude, Cursor, and others — can find them by name. No more dead install links: the documented commands now work.</description></item>+ <item>+ <title>AR is live on the homepage — place any 3D model in your real space from the front page</title>+ <link>https://three.ws/blog/see-your-3d-in-ar</link>+ <guid isPermaLink="false">2026-06-13:AR is live on the homepage — place any 3D model in your real space from the front page</guid>+ <pubDate>Sat, 13 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>The three.ws homepage now has a live AR section: real models from the Forge gallery load in an interactive 3D viewer, and on mobile you can tap 'Place in your space' to anchor the model in your real environment through the camera. On desktop a QR code appears so you can scan and place from your phone in one step. WebXR on Android, Quick Look on iOS — no app, no download. A full blog post explains how the AR pipeline works across both platforms.</description>+ </item><item><title>Describe it to 3D joins the rest of the site — and the two generators now point at each other</title><link>https://three.ws/create/prompt</link>diff --git a/public/features.json b/public/features.jsonindex 6626c611e..72b83979f 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-13T08:37:02.527Z",+ "generated_at": "2026-06-13T09:11:49.802Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/public/marketplace.css b/public/marketplace.cssindex bb58b7728..a85648bc8 100644--- a/public/marketplace.css+++ b/public/marketplace.css@@ -3382,6 +3382,21 @@ body.market-page > header {font-weight: 600;letter-spacing: 0.02em;}+/* Per-category color accents on the model type pill */+.model-cat-pill.model-cat-avatar { background: rgba(99, 102, 241, 0.18); color: #a5b4fc; }+.model-cat-pill.model-cat-accessory { background: rgba(236, 72, 153, 0.18); color: #f9a8d4; }+.model-cat-pill.model-cat-item { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }+.model-cat-pill.model-cat-scene { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; }+.model-cat-pill.model-cat-creature { background: rgba(251, 146, 60, 0.18); color: #fdba74; }+.model-cat-pill.model-cat-vehicle { background: rgba(56, 189, 248, 0.18); color: #7dd3fc; }+.model-cat-pill.model-cat-other { background: rgba(255, 255, 255, 0.08); color: #a1a1aa; }++/* Model-category sub-filter chips row — visible when avatars are shown */+.market-model-category-chips {+ border-top: 1px solid var(--stroke);+ padding-top: 8px;+ margin-top: 2px;+}.market-card-avatar .footer .open-cta {font-size: 11px;color: var(--ink-dim);diff --git a/src/marketplace.js b/src/marketplace.jsindex cdef935b3..20c42c5a8 100644--- a/src/marketplace.js+++ b/src/marketplace.js@@ -113,8 +113,31 @@ const CATEGORY_LABELS = {blockchain: 'Blockchain',};+// Labels for 3D model_category values — what a model IS, not how it was created.+const MODEL_CATEGORY_LABELS = {+ avatar: 'Avatar',+ accessory: 'Accessory',+ item: 'Item',+ scene: 'Scene',+ creature: 'Creature',+ vehicle: 'Vehicle',+ other: 'Other',+};++// Icon glyphs shown on model category badges inside cards.+const MODEL_CATEGORY_ICONS = {+ avatar: '◉',+ accessory: '◈',+ item: '◇',+ scene: '▦',+ creature: '◆',+ vehicle: '▷',+ other: '○',+};+const state = {- category: null, // null = Discover (all)+ category: null, // null = Discover (all) — agent category+ modelCategory: null, // null = all 3D types — avatar/accessory/item/scene/creature/vehicleq: '',tag: null, // ?tag=humanoid → filter all cards to entries containing this tagsort: 'recommended',@@ -143,6 +166,7 @@ const els = {tools: $('market-tools'),cats: $('market-cats'),catChips: $('market-cat-chips'),+ modelCatChips: $('market-model-category-chips'),grid: $('market-grid'),search: $('market-search'),sortSel: $('market-sort'),@@ -497,6 +521,7 @@ async function loadPublicAvatars() {url.searchParams.set('limit', '200');url.searchParams.set('quality', 'high');if (state.q) url.searchParams.set('q', state.q);+ if (state.modelCategory) url.searchParams.set('category', state.modelCategory);const r = await fetch(url);if (!r.ok) return;const j = await r.json();@@ -991,6 +1016,31 @@ function bindFilterChips() {renderGrid();});});++ // Model-category chips — filter 3D models by what they ARE (avatar, accessory, etc.).+ // Visible only when avatars are in the current view. Selecting a category+ // re-fetches the explore API with category= so the filter is server-side.+ const modelCatChips = document.querySelectorAll('#market-model-category-chips .market-chip');+ modelCatChips.forEach((chip) => {+ chip.addEventListener('click', () => {+ modelCatChips.forEach((c) => c.classList.toggle('active', c === chip));+ state.modelCategory = chip.dataset.modelCat || null;+ state.publicAvatars = [];+ state.publicAvatarsLoaded = false;+ loadPublicAvatars();+ renderGrid();+ });+ });+}++function syncModelCatChips() {+ if (!els.modelCatChips) return;+ const showAvatars = state.filter === 'all' || state.filter === 'avatars';+ els.modelCatChips.hidden = !showAvatars;+ els.modelCatChips.querySelectorAll('.market-chip').forEach((c) => {+ const val = c.dataset.modelCat || null;+ c.classList.toggle('active', val === state.modelCategory || (val === '' && !state.modelCategory));+ });}function renderTagBanner() {@@ -1014,6 +1064,7 @@ function renderTagBanner() {}function renderGrid() {+ syncModelCatChips();const showAgents = state.filter === 'all' || state.filter === 'agents';const showAvatars = (state.filter === 'all' || state.filter === 'avatars') && !state.category;const showOnchain = state.filter === 'all' || state.filter === 'onchain';@@ -3847,7 +3898,7 @@ function renderAvatarCard(a, spotlight = false) {${desc ? `<div class="desc">${desc}</div>` : ''}${tagPills}<div class="footer">- <span class="avatar-pill">3D Avatar</span>+ ${modelCategoryBadge(a.modelCategory)}<span class="open-cta">Open →</span></div></div>@@ -5460,6 +5511,13 @@ function formatAssetPrice(price) {// Reusable badge HTML for a Free/Paid listing. Returns empty string when there// is nothing to show.+function modelCategoryBadge(category) {+ const cat = category || 'avatar';+ const label = MODEL_CATEGORY_LABELS[cat] || cat;+ const icon = MODEL_CATEGORY_ICONS[cat] || '○';+ return `<span class="avatar-pill model-cat-pill model-cat-${escapeHtml(cat)}">${icon} ${escapeHtml(label)}</span>`;+}+function priceBadgeHtml(price) {const label = formatAssetPrice(price);if (label) {