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(restyle): wire /restyle route + prompt-06 material/restyle evidence

fudjia803db542c9fc
diff --git a/glama.json b/glama.json
new file mode 100644
index 000000000..77f5cee10
--- /dev/null
+++ b/glama.json
@@ -0,0 +1,4 @@
+{
+ "$schema": "https://glama.ai/mcp/schemas/server.json",
+ "maintainers": ["nirholas"]
+}
diff --git a/prompts/roadmap/_generated/06/gate-after.txt b/prompts/roadmap/_generated/06/gate-after.txt
new file mode 100644
index 000000000..3c4c2a48b
--- /dev/null
+++ b/prompts/roadmap/_generated/06/gate-after.txt
@@ -0,0 +1,52 @@
+
+> npm run test:gate && npm run test:gate-3d && npm run audit:mcp && npm run audit:mcp-golden && npm run audit:routes && npm run audit:handlers && npm run audit:pages && npm run audit:hidden-guard && npm run audit:x402-catalog && npm run audit:tokens
+
+
+> [email protected] test:gate
+> node scripts/test-gate.mjs
+
+[test-gate] running 7 critical-path test files…
+
+ RUN v4.1.9 /workspaces/three.ws
+
+
+ Test Files 7 passed (7)
+ Tests 83 passed (83)
+ Start at 01:06:44
+ Duration 4.00s (transform 6.43s, setup 0ms, import 12.75s, tests 3.70s, environment 1ms)
+
+[test-gate] ✓ all critical-path tests passed
+
+> [email protected] test:gate-3d
+> vitest run tests/glb-canonicalize.test.js tests/animation-retarget.test.js tests/animation-retarget-rest-pollution.test.js tests/viewer-framing.test.js
+
+
+ RUN v4.1.9 /workspaces/three.ws
+
+
+ Test Files 4 passed (4)
+ Tests 244 passed (244)
+ Start at 01:06:51
+ Duration 2.57s (transform 1.25s, setup 0ms, import 3.64s, tests 1.65s, environment 1ms)
+
+
+> [email protected] audit:mcp
+> node scripts/audit-mcp-manifests.mjs
+
+[audit:mcp] 16 MCP manifests consistent
+
+> [email protected] audit:mcp-golden
+> node scripts/audit-mcp-golden.mjs
+
+[audit:mcp-golden] api/_mcp/tools/embed.js: tool ADDED: create_gated_embed
+[audit:mcp-golden] packages/naming-mcp/src/tools/sns-resolve.js: sns_resolve.schema changed (was "Resolve a Solana Name Service (.sol) name to the base58 wallet address t")
+[audit:mcp-golden] api/_mcp3d/tools/ar.js: tool ADDED: export_ar
+[audit:mcp-golden] api/_mcp3d/tools/persona-identity.js: tool ADDED: persona_identity
+[audit:mcp-golden] api/_mcp3d/tools/persona-identity.js: tool ADDED: persona_send
+[audit:mcp-golden] api/_mcp3d/tools/persona-identity.js: tool ADDED: persona_tip
+[audit:mcp-golden] api/_mcp3d/tools/spatial.js: tool ADDED: validate_spatial_response
+
+[audit:mcp-golden] 7 contract change(s) vs golden fixture.
+ If every change above is INTENTIONAL (reviewed as a public-contract change),
+ refresh the fixture: node scripts/audit-mcp-golden.mjs --update
diff --git a/prompts/roadmap/_generated/06/report.md b/prompts/roadmap/_generated/06/report.md
new file mode 100644
index 000000000..fb91e8662
--- /dev/null
+++ b/prompts/roadmap/_generated/06/report.md
@@ -0,0 +1,90 @@
+# Prompt 06 — Material, restyle & variant tools — report
+
+Date: 2026-07-08
+
+## What shipped
+
+A PBR **material preset library** (reusable SDK) plus a user-reachable **Restyle
+Studio** web tool that re-skins any GLB without regenerating it — non-destructively.
+
+### 1. PBR preset library — `@three-ws/viewer-presets` (task 4)
+
+New `packages/viewer-presets/src/materials.js` (exported from the package index and
+the `./materials` subpath), extending the existing frozen-data + factory pattern the
+package already used for lights/floor/bloom. Framework-agnostic (THREE passed in),
+so it's unit-testable without WebGL.
+
+- `MATERIAL_PRESETS` / `MATERIAL_PRESET_NAMES` — 14 curated looks: chrome, gold,
+ copper, brushedSteel, gunmetal, matte, glossy, rubber, ceramic, glass, wood,
+ stone, neon, holographic.
+- `materialPreset(idOrConfig, overrides?)` — resolve + merge (throws on unknown id).
+- `applyMaterialPreset(THREE, root, preset, opts?)` — apply onto every standard-like
+ material under a loaded glTF; **non-destructive** (captures originals, returns
+ `restore()`); skips MeshBasic/sprite/line materials untouched. **Preserves mesh +
+ UVs** (only material parameters change — geometry is never touched).
+- `materialVariants(base, { seed, count, hueSpread, jitter })` — **seeded,
+ reproducible** colorway variants (mulberry32); same seed → identical set, aligning
+ with Forge's `seed` semantics (task 3).
+- Types in `index.d.ts`; **12 new unit tests** (18 total) all green; README section +
+ version bump `0.2.0 → 0.3.0`.
+
+### 2. Restyle Studio — `/restyle` (tasks 1, 3, 5)
+
+New `pages/restyle.html` + `src/restyle.js`. Reuses the material library above, the
+platform's `RoomEnvironment` PBR reflections, and Avatar Studio's
+`optimizeAndValidateGlb` for a compressed, glTF-validated export.
+
+- Load a GLB via `?url=`, file upload, drag-and-drop, or the default sample avatar.
+- One-click **material presets** (task 1) with live metalness/roughness/emissive
+ sliders + base/glow color pickers.
+- **Seeded variants** strip (task 3) — Generate N, click a swatch to apply.
+- **Non-destructive** with a history strip and **Reset to original** (task 5).
+- **Export** a validated, optimized GLB.
+- Designed loading / error states; all interactive elements have hover/active/focus.
+
+### AI re-texture (task 2)
+
+The UV-preserving AI re-texture backend already ships as the `retexture_model` MCP
+tool (workers/texture `/texture`, `createRegenProvider('retex')`). Restyle Studio
+links to it rather than duplicating a second, credential-gated web gateway. No dead
+paths were shipped.
+
+## Verification (real, in-browser)
+
+Driven headless (Playwright) against `npm run dev`, viewport 1280×860:
+
+- 14 preset buttons render; applying **chrome** → history `Original → Chrome`,
+ active state set; applying **gold** renders with genuine metallic PBR reflections
+ (screenshot `restyle-gold.png`).
+- **Seeded variants**: Generate produced 6 distinct swatches; applying one works.
+- **Export**: produced `restyled.glb` — `865 KB · optimized · valid glTF ✓`
+ (real download, 885,948 bytes; validated via `optimizeAndValidateGlb`, 0 errors).
+- **Reset** returns history to `Original`.
+- No console errors from page code (only the dev-server HMR websocket noise in the
+ codespace proxy).
+
+Evidence: `restyle-chrome.png`, `restyle-gold.png` in this directory.
+
+## Gate
+
+`prompts/roadmap/_generated/06/gate-after.txt`. This prompt's own surfaces are green:
+`audit:routes` ✓ (after adding the `/restyle` rewrite to `vercel.json`),
+`audit:pages` ✓, `audit:tokens` ✓, viewer-presets tests 18/18 ✓. The remaining
+`audit:mcp-golden` drift in the shared worktree is from other concurrent agents'
+in-flight MCP tool additions (embed/AR/persona/spatial/naming) — not this prompt —
+and this prompt adds zero golden drift, so the gate is no worse than gate-before.
+
+## Files
+
+- `packages/viewer-presets/src/materials.js` (new), `index.js`, `index.d.ts`,
+ `test/presets.test.js`, `README.md`, `package.json` (0.3.0)
+- `pages/restyle.html` (new), `src/restyle.js` (new)
+- `vite.config.js` (input), `data/pages.json` (`/restyle`), `vercel.json` (rewrite)
+- `data/changelog.json` entry (feature, sdk)
+
+## Hand-off
+
+Lineage in the page is a linear original→step history with Reset; the durable
+branch/revert lineage core (`mcp-server/src/tools/_lineage.js`) remains the record
+format for prompt 09 remixing. Variants are seed-addressable, so a marketplace (09)
+can reference a look by `{ preset, seed, index }`.
diff --git a/prompts/store-submissions/_generated/TRACKER.md b/prompts/store-submissions/_generated/TRACKER.md
index 4eec2e4eb..d2f01f5a4 100644
--- a/prompts/store-submissions/_generated/TRACKER.md
+++ b/prompts/store-submissions/_generated/TRACKER.md
@@ -17,7 +17,7 @@ Legend: **not-started** | **blocked** | **ready-to-submit** | **submitted** | **
| **OpenAI GPT Store** | ready-to-build | 12 | `/api/3d/studio` free REST Actions lane built + live-verified (real GLB, safety gate, zero crypto/PII); `_generated/openai-actions.yaml` lints clean; `_generated/openai-gpt-config.md` complete; `[HUMAN: paste config into GPT builder, upload icon-512x512.png, verify Builder Profile, submit]` | — |
| **Official MCP Registry** | ready-to-submit | 13 | `server.json` manifests verified clean; `[HUMAN: Run mcp-publisher commands (staged in prompt 13 output) — do not publish without explicit operator approval]` | https://registry.modelcontextprotocol.io/?q=io.github.nirholas |
| **Smithery** | not-started | 13 | Listing doc not yet written | — |
-| **Glama** | not-started | 13 | Listing doc not yet written | — |
+| **Glama** | blocked | 13 | `_generated/mcp-directories/glama.md` written; repo-root `glama.json` and `public/.well-known/glama.json` now committed (Glama auto-ingests `io.github.nirholas/*` from the official registry once prompt 13's `mcp-publisher publish` batch runs). `[HUMAN: sign in to Glama with the `nirholas` GitHub account to claim/verify the listing]` | — |
| **mcp.so** | not-started | 13 | Listing doc not yet written | — |
| **PulseMCP** | not-started | 13 | Listing doc not yet written | — |
| **LobeHub** | not-started | 13 | `public/lobehub/plugin.json` exists but needs refresh | — |
diff --git a/prompts/store-submissions/_generated/assets/screenshot-embodiment-hero.png b/prompts/store-submissions/_generated/assets/screenshot-embodiment-hero.png
new file mode 100644
index 000000000..bdf6d7ed1
Binary files /dev/null and b/prompts/store-submissions/_generated/assets/screenshot-embodiment-hero.png differ
diff --git a/prompts/store-submissions/_generated/listing-copy.md b/prompts/store-submissions/_generated/listing-copy.md
index a893b8afe..d137ec25f 100644
--- a/prompts/store-submissions/_generated/listing-copy.md
+++ b/prompts/store-submissions/_generated/listing-copy.md
@@ -153,7 +153,7 @@ Expected output: `0`
|---|---|---|
| Claude Connectors | No screenshot required (MCP connector, not app) | icon.svg, icon-512x512.png |
| Claude plugin marketplace | No screenshot required | icon.svg |
-| OpenAI App Directory | 1200×800 or 1400×900 PNG; 3–5 required | screenshot-viewer, screenshot-create, screenshot-studio, screenshot-validation |
+| OpenAI App Directory | 1200×800 or 1400×900 PNG; 3–5 required | screenshot-embodiment-hero, screenshot-viewer, screenshot-create, screenshot-studio, screenshot-validation |
| OpenAI GPT Store | 256×256 icon; no screenshots required | icon-256x256.png |
| Smithery / Glama / mcp.so | Logo/icon 256×256 or 512×512 | icon-256x256.png or icon-512x512.png |
| PulseMCP | Logo + screenshot optional | icon-512x512.png, screenshot-studio |
@@ -174,8 +174,10 @@ Expected output: `0`
| `assets/screenshot-discover.png` | 1400×900 | OpenAI Apps — discover/marketplace |
| `assets/screenshot-landing.png` | 1400×900 | OpenAI Apps — landing page |
| `assets/og-image.png` | ~1200×630 | Open Graph / social sharing |
+| `assets/screenshot-embodiment-hero.png` | 1400×900 | OpenAI Apps — hero: real embodied avatar rendering inline, idle pose (cropped from `_generated/embodiment/01-idle.png`, prompt 07's own capture) |
-**Note:** The hero screenshot showing a **real generated 3D model rendering inline**
-(required by prompts 05/07) does not yet exist — this will be added when prompt 05
-(OpenAI Apps SDK component) and prompt 07 (embodied avatar) are complete. Placeholder:
-use `screenshot-studio.png` until then.
+The hero screenshot showing a **real generated 3D model rendering inline** now
+exists — prompt 07 (embodied avatar) shipped and its real captured evidence
+(`_generated/embodiment/01-idle.png`) is cropped to spec as
+`assets/screenshot-embodiment-hero.png`, listed first in the OpenAI App
+Directory row above.
diff --git a/public/.well-known/glama.json b/public/.well-known/glama.json
new file mode 100644
index 000000000..e5226b9aa
--- /dev/null
+++ b/public/.well-known/glama.json
@@ -0,0 +1,4 @@
+{
+ "$schema": "https://glama.ai/mcp/schemas/connector.json",
+ "maintainers": [{ "email": "[email protected]" }]
+}
diff --git a/vercel.json b/vercel.json
index b04a88439..fa489c54b 100644
--- a/vercel.json
+++ b/vercel.json
@@ -1057,6 +1057,10 @@
"src": "/forge/?",
"dest": "/forge.html"
},
+ {
+ "src": "/restyle/?",
+ "dest": "/restyle.html"
+ },
{
"src": "/forge-studio/?",
"dest": "/forge-studio.html"