Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

feat: implement image upload handling for Tripo provider and enhance error messaging

qrqke3e651c735f9
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ebc3136a4..201796cdc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,13 +6,16 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
## 2026-06-28
-- **$THREE payments ride out brief price-feed blips instead of failing** — Paid actions priced in $THREE (Forge high tier, spins, marketplace) no longer fail when every live price feed happens to miss on the same request. The price layer now keeps a recent last-known-good price and serves it through a momentary simultaneous outage of Jupiter and the backup feeds, so a quote is never rejected over a transient blip. Prices older than five minutes are still refused — a payment is never priced off a stale number. (`/three-token`) `[fix]`
+- **$THREE payments ride out brief price-feed blips instead of failing** — Paid actions priced in $THREE (Forge high tier, spins, marketplace) no longer fail when every live price feed happens to miss on the same request. The price layer now keeps a recent last-known-good price and serves it through a momentary simultaneous outage of Jupiter and the backup feeds, so a quote is never rejected over a transient blip. Prices older than five minutes are still refused — a payment is never priced off a stale number. And on the rare moment the payment rail genuinely is catching its breath, you now see a clear "briefly unavailable — try again" message instead of a raw "internal error" support code. (`/three-token`) `[fix]`
- **Agent Reputation Leaderboard — top agents promoted in marketplace by on-chain trust score** — The platform now autonomously ranks the top 10 three.ws agents by behavioral trust score every 30 minutes via a real x402 payment to the agent-reputation endpoint. Scores are synthesized from real on-chain pump.fun agent-payments activity, distribution/buyback success, and signed Solana attestations — not a subjective rating. The top 10 are promoted to the front of the marketplace recommended feed and marked with a ◈ Top Trust badge. The ranking is also stored as an oracle signal (topic: agent_reputation_leaderboard) for downstream systems to query. Full snapshot history is written to agent_reputation_leaderboard_snapshots so trust trends are auditable over time. (`/marketplace`) `[feature, improvement]`
+- **Agent Studio's Brain editor is now a clean form, not a node graph** — Designing your agent's mind no longer means dragging wires around a flow-chart. The Brain tab is now an ordered stack of cards — Persona, Memory, Skills, Market signals, Model, and Avatar output — that you simply fill in. The wiring happens automatically: a card that's present is part of your agent's reasoning; remove it and it's gone. Templates, the live test chat, the behavior preview, and the 'watch it think' highlight all carry over unchanged, and everything you already built loads straight into the new editor. (`/agent-studio`) `[improvement]`
- **API Key Validity Health — the platform verifies its own access keys every hour** — A lapsed or missing access key for the autonomous loop means every self-call in the pipeline hits the paywall cold — legitimate tool calls start failing, recovery is manual, and the outage is invisible until someone investigates why the spend log went quiet. The platform now detects this automatically. Every hour an autonomous agent makes a real on-chain payment to a new /api/x402/api-key-health endpoint with body { scope: "autonomous_loop" }. The endpoint checks whether any active subscription key covers the requested scope, falling back to the INTERNAL_API_KEY env var, and returns { valid, scopes, expires_at }. The extracted signal surfaces hours_until_expiry in x402_autonomous_log.signal_data. When expiry is within 24 hours the storeValue hook writes a Redis alert (x402:api-key-health:expiry-alert) so the ops surface can surface the warning before the key lapses. `[infra, feature]`
- **Auth Session Lifecycle Health — the platform canaries its own JWT auth pipeline every 30 minutes** — A broken auth subsystem — a JWT signer that stops working, a verifier that accepts expired tokens, or a misconfigured issuer — can lock users out silently or, worse, leave a security hole open. The platform now detects both within 30 minutes. Every half-hour an autonomous agent makes a real on-chain payment to a new /api/x402/auth-health endpoint and runs a four-step session lifecycle canary: mint a canary access token, verify it with the full JWT verifier, issue a replacement token and re-verify it (the rotation path), and confirm that an already-expired token is rejected. Each step is timed independently; a failure names exactly which step broke and why. The result — all_pass, failed_step, and per-step latency — is recorded as an actionable signal so ops can read auth health off a single log row without a separate query. `[infra, security]`
- **Avatar generation rides out engine outages by failing over between backends** — Describe-it-to-3D and Instant Agent Genesis no longer dead-end with "the avatar engine rejected this job" when one 3D backend has a hiccup. A request now tries every configured engine in turn — and your own Meshy or Tripo key as a backstop — before giving up, so a single provider's cold start, throttle, or outage is invisible to you. On the rare moment every engine is down at once, the error now points you straight to the selfie scanner and offers a one-tap retry instead of stranding the build. (`/create/prompt`) `[fix]`
- **Changelog Telegram bot health check** — The autonomous x402 loop now pings the changelog Telegram bot every 5 minutes by paying $0.001 USDC to the new /api/x402/telegram-health endpoint. It verifies the bot can reach the Telegram API, measures round-trip latency, and raises a Redis alert when it can't — so ops knows immediately when $THREE holders would miss a changelog entry. `[infra, feature]`
- **Club Social Activity — the platform tracks its own nightlife economy on-chain** — The autonomous loop now pays /api/x402/analytics every 30 minutes with { report: "clubs", period: "24h" } for a live snapshot of the Pole Club's social economy. The report reads straight from the real ledgers — settled tips (club_tips), the stage roster (club_dancer_wallets) and settled door cover charges (x402_audit_log) — and returns how many stages are active, how many distinct patrons showed up, the tip count and USDC volume, the cover charges collected at the door, and a fastest-growing-stage leaderboard. Every snapshot is appended to a club_social_analytics time series so a dashboard can chart whether the nightlife is heating up or cooling down and spot which stages are on the rise. `[feature, infra]`
+- **Create an agent by describing it — the wizard now builds itself** — Spinning up an agent no longer means filling out five steps of fields. At the top of the Create flow there's now a single box: describe your agent in a sentence — "a witty crypto market analyst that explains charts in plain English" — and we generate the whole thing for you: name, description, tags, the right skills, a fitting 3D body, a marketplace category, a greeting, and its personality. No idea where to start? Tap an example or hit "Surprise me" and get a complete agent with zero typing. Everything lands on the Review step pre-filled, so you read it over, tweak anything you like, and ship. The by-hand form is still right there for anyone who wants it. (`/create-agent`) `[feature]`
+- **Five pages that were returning 404 are reachable again** — The Gaussian-splat viewer (/splat), the capture tool (/capture), the integrations directory (/integrations), partners (/partners), and the live-agents board (/agents-live) were all returning a 404 in production even though the pages existed and were linked from the nav. Our routing pins every clean URL explicitly, and these five were missing their entry, so the request fell through to the not-found page. We added the missing routes and tightened the route audit so a new page can no longer ship without one. (`/splat`) `[fix]`
- **Forge Content Health — the platform canaries its own generation engine every 10 minutes** — Every 3D generation the Forge produces begins by running a prompt through the platform's generative AI lane, so if that lane slows down or goes dark, creations stall before a mesh is ever built. The platform now watches for this automatically. Every ten minutes an autonomous agent makes a real on-chain payment to a new lightweight health_check mode on /api/x402/forge, which runs one fast text completion over the same free-first model chain Forge depends on — no expensive 3D reconstruction — and reports back whether content was generated, how long it took, and the token count. A completion slower than five seconds, or an outright generator outage, raises a Forge performance alert that an on-call dashboard reads in a single lookup and that clears itself once generation is healthy again. The new health_check mode is also available to any x402 agent on the bazaar for a fraction of a cent, far cheaper than a full generation, for callers that just want to confirm the engine is live. `[infra, feature]`
- **Forge Image Generation Canary — the platform validates its own image pipeline every 5 minutes** — Every Forge job that reconstructs a 3D mesh starts with a text-to-image call. If the image provider chain is down or hung, every paid Forge generation silently fails — before users even hit the paywall. The platform now detects this automatically. Every five minutes an autonomous agent makes a real on-chain $0.001 USDC payment to /api/x402/forge with body { mode: "health_check", type: "image", prompt: "A simple blue circle." }. The endpoint runs one real text-to-image call through the free-first provider chain (NIM FLUX → Vertex Imagen → Replicate backstop) and uploads the result to R2 CDN — proving the full image generation and CDN upload path end-to-end. The extracted signal { generated, url, latency_ms } lands in x402_autonomous_log.signal_data. When generation fails or latency exceeds 30 seconds, a Redis alert (x402:forge-image-health:alert) is raised so ops can investigate before users see broken generations. The image alert key is separate from the existing text LLM canary alert so both lanes can degrade independently. `[infra, feature]`
- **Forge no longer dead-ends on "Generator not configured" when a free lane is live** — When the free NVIDIA text→3D lane was briefly down, Forge could return "Generator not configured" even on deployments where the free Hugging Face lane was fully set up — because the degrade step looked for a paid Replicate key that wasn't required. Forge now falls through to whichever free engine is configured (Hugging Face Spaces) instead of stopping, so a single free key keeps text and photo generation working through upstream blips. (`/forge`) `[fix]`
@@ -23,7 +26,9 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Pay-By-Name Resolution Health — the platform watches its own name registry every 10 minutes** — Every 'send USDC to a name' flow on three.ws — the SDK's payByName(), the /pay studio, the profile pay button, and any agent routing a payment to @username or a .sol domain — resolves the recipient through the same name registry before a single lamport moves. If that registry breaks (a Bonfida SNS regression, the parent domain de-registering, or the platform domain repointing to a different wallet), the failure is silent and every downstream send either pays the wrong place or throws an error. The platform now watches for this automatically. Every 10 minutes an autonomous agent makes a free call to the resolve endpoint with the platform's own known SNS name and checks that it comes back with a valid, on-curve Solana wallet address. If an expected wallet is configured, it additionally asserts the resolution still matches that specific wallet — an anti-poisoning check that catches a domain repoint between deploys before any user is affected. Results are recorded to a time-series log and cached in Redis so a health dashboard can read the latest verdict without a database round-trip. A failed or mismatched resolution raises an alert flag that lingers until the next clean run. The monitor is a read-only, free call — it moves no funds — and it replaces a prior registry entry that was calling the wrong endpoint method and would have silently recorded every 404 as healthy. `[feature, infra]`
- **Pump Launch Monitor: live snipe-candidate screening** — The autonomous x402 agent now pays to audit the 10 most recently launched pump.fun tokens every 5 minutes, extracting each cohort's average and peak initial bonding-curve liquidity. New launches with initial liquidity well above the rolling cohort average are surfaced as high-conviction snipe candidates; the signal is upserted into the oracle feed so the sniper gate can act on it immediately. `[feature, infra]`
- **RSS Feed Health — the platform validates its own changelog XML feed every 5 minutes** — A broken RSS feed is invisible — the feed URL returns 200, but the XML inside is malformed, the item count drifted after a skipped build step, or the latest entry title diverged from the canonical record. The platform now catches all three failure modes automatically. Every five minutes an autonomous agent makes a real on-chain payment to a new /api/x402/feed-health endpoint with body { feed: "changelog_rss" }. The endpoint fetches three.ws/changelog.xml, parses it as RSS 2.0 with fast-xml-parser, counts the <item> elements, and cross-checks the latest item title against the canonical public/changelog.json compiled output. If any of those checks fail — invalid XML, unreachable URL, title mismatch — the { valid: false } verdict is recorded as an actionable signal in x402_autonomous_log.signal_data so the status surface can read feed health in a single lookup. The same endpoint is available on the x402 bazaar for $0.001 per check. `[infra, feature]`
+- **Selfie → avatar now works on the Tripo engine** — Building an avatar from a selfie could fail with "Avatar engine is having trouble" when the Tripo 3D engine was in use. Your photo is sent to the engine as inline image data, but Tripo only accepts an uploaded image — so every selfie was being rejected. We now upload your photo to the engine first and reference it correctly, so selfie-to-avatar succeeds on Tripo just like it already did on the other engine. (`/create/selfie`) `[fix]`
- **Skill Marketplace: most-purchased skills signal** — The autonomous x402 loop now pays every 30 minutes to retrieve the 5 most-purchased agent skills over the past 7 days from the real hire ledger. The top skill and full ranked list land in the autonomous log as actionable signal for featured-listing curation — a shift in the top skill across runs surfaces emerging high-demand capabilities automatically. `[feature, infra]`
+- **The Avatar Engines Atlas page is now reachable** — The link to the Avatar Engines Atlas — the curated rundown of the open-source and commercial engines behind high-quality, photoreal 3D human avatars — was returning a 404 because the page was never wired into routing. The route is now in place, so the page opens from navigation as intended. (`/avatar-engines`) `[fix]`
- **User Activity Analytics — DAU, WAU, and top features now tracked every 6 hours via x402** — The platform now monitors its own engagement metrics automatically. Every six hours an autonomous agent pays the /api/x402/analytics endpoint for a live user_activity report — computing DAU, WAU, stickiness (DAU/WAU ratio), the top ten features by event volume, the platform error rate, and session-length distribution (average, median, and p90). All figures are read live from the real metered tables; an empty window returns zeros, never fabricated numbers. The extracted signal — dau, wau, top_feature — is recorded to x402_autonomous_log for the status surface to read, and every snapshot is persisted to a user_activity_snapshots time series for trend alerting and the engagement dashboard. The same report is available to any x402 agent on the bazaar for $0.005 per call. `[feature, infra]`
- **x402 Volume Analytics — the platform measures its own payment economy every 30 minutes** — The autonomous loop now pays /api/x402/analytics every 30 minutes with { report: "x402_volume", period: "24h" } for a live read of x402 transaction volume across every paid endpoint. The report comes straight from the settled-payment ledger and returns the totals that prove ecosystem growth — total settled calls, total USDC paid, and unique paying wallets — alongside a per-endpoint breakdown and the least-active ("underused") endpoints, so the platform can see at a glance which services are thriving and which need a push or a rethink. The headline totals and the underused-endpoint list are recorded as an actionable signal, and the same report is available to any x402 agent on the bazaar for $0.005 per call. `[feature, infra]`
diff --git a/CLAUDE.md b/CLAUDE.md
index b316e3b98..4a4270504 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -12,6 +12,8 @@ You are building **three.ws** — a platform that competes with the best in the
**Execute. Do not interview the user.** Pick the most reasonable interpretation and ship a complete, polished feature. Questions waste the user's time.
+**If you propose a solution, try it before asking anything.** Diagnosing a bug and describing the fix is not the job — implementing it and verifying it is. Never end a turn with "here's what I'd do, want me to do it?" or "should I proceed?". The default is always: do it, then report what you did and what you observed. Only stop to ask when you are genuinely blocked on a decision that is the user's to make and that you cannot resolve from the code, the request, or a sensible default — and even then, ask in one line and keep going on everything else. Surfacing a real risk or a follow-up the user should know about is fine; turning it into a gate that stalls the work is not.
+
**Do what's proper and professional, always. Never take shortcuts. Always wire completely. Never use mocks or fake data. Always build real implementations and integrations and use real APIs.**
---
diff --git a/api/_providers/tripo.js b/api/_providers/tripo.js
index 2a2e07532..5ff346c8c 100644
--- a/api/_providers/tripo.js
+++ b/api/_providers/tripo.js
@@ -60,6 +60,24 @@ function imageTypeFor(url) {
return ext === 'jpeg' ? 'jpg' : ext;
}
+// Parse a data:image/...;base64,... URI into its raw bytes, mime, and the file
+// extension Tripo expects. Returns null for anything that isn't a base64 image
+// data URI (e.g. a plain http(s) URL), so callers can branch on it.
+function parseImageDataUri(s) {
+ const m = /^data:(image\/(?:png|jpe?g|webp));base64,(.+)$/is.exec(String(s || ''));
+ if (!m) return null;
+ const mime = m[1].toLowerCase();
+ const ext = mime === 'image/png' ? 'png' : mime === 'image/webp' ? 'webp' : 'jpg';
+ let bytes;
+ try {
+ bytes = Buffer.from(m[2], 'base64');
+ } catch {
+ return null;
+ }
+ if (!bytes.length) return null;
+ return { bytes, mime, ext };
+}
+
export function createTripoProvider(apiKey) {
if (!apiKey) {
throw Object.assign(new Error('Tripo API key is required'), { code: 'missing_key' });
@@ -121,6 +139,67 @@ export function createTripoProvider(apiKey) {
return String(taskId);
}
+ // Tripo's image_to_model `file` accepts a public http(s) `url` or an uploaded
+ // `file_token` — never an inline data: URI. Selfies arrive as base64 data
+ // URIs, so push the raw bytes through Tripo's multipart /upload endpoint and
+ // hand the task the returned token. Mirrors createTask's error classification
+ // so a bad key / no credits / throttle surfaces the same actionable code.
+ async function uploadImage({ bytes, mime, ext }) {
+ const form = new FormData();
+ form.append('file', new Blob([bytes], { type: mime }), `selfie.${ext}`);
+ let res;
+ try {
+ // Let fetch set the multipart content-type (with boundary) itself — only
+ // forward the bearer, never the JSON content-type from `headers`.
+ res = await fetch(`${TRIPO_BASE}/upload`, {
+ method: 'POST',
+ headers: { authorization: headers.authorization },
+ body: form,
+ });
+ } catch (err) {
+ throw Object.assign(new Error(`tripo upload unreachable: ${err?.message}`), {
+ code: 'provider_unreachable',
+ status: 502,
+ });
+ }
+ const data = await res.json().catch(() => ({}));
+ if (res.status === 401 || res.status === 403) {
+ throw Object.assign(new Error('Tripo rejected the API key.'), {
+ code: 'invalid_key',
+ status: 401,
+ providerStatus: res.status,
+ });
+ }
+ if (res.status === 402 || data?.code === 2000) {
+ throw Object.assign(new Error('Tripo account is out of credits.'), {
+ code: 'insufficient_credits',
+ status: 402,
+ });
+ }
+ if (res.status === 429) {
+ throw Object.assign(new Error('Tripo is rate limiting this key.'), {
+ code: 'rate_limited',
+ status: 429,
+ providerStatus: 429,
+ });
+ }
+ if (!res.ok || data?.code !== 0) {
+ throw Object.assign(
+ new Error(data?.message || `tripo upload returned ${res.status} (code ${data?.code})`),
+ { code: 'provider_error', status: 502, providerStatus: res.status },
+ );
+ }
+ // Upload returns the handle as image_token; older responses use file_token.
+ const token = data?.data?.image_token || data?.data?.file_token;
+ if (!token) {
+ throw Object.assign(new Error('tripo upload returned no image token'), {
+ code: 'provider_error',
+ status: 502,
+ });
+ }
+ return String(token);
+ }
+
return {
async textToGeometry({ prompt, tier }) {
const taskId = await createTask({
@@ -135,9 +214,15 @@ export function createTripoProvider(apiKey) {
},
async imageTo3d({ imageUrl, tier }) {
+ // Data URI (selfie) → upload first and reference the token; a real
+ // http(s) URL passes straight through as `file.url`.
+ const parsed = parseImageDataUri(imageUrl);
+ const file = parsed
+ ? { type: parsed.ext, file_token: await uploadImage(parsed) }
+ : { type: imageTypeFor(imageUrl), url: imageUrl };
const taskId = await createTask({
type: 'image_to_model',
- file: { type: imageTypeFor(imageUrl), url: imageUrl },
+ file,
model_version: modelVersion(),
face_limit: clampFaces(tier.polycount),
texture: true,
diff --git a/api/token/[action].js b/api/token/[action].js
index f0f0a1285..36dddb207 100644
--- a/api/token/[action].js
+++ b/api/token/[action].js
@@ -47,6 +47,17 @@ const PURPOSES = {
const SOLANA_ADDRESS = z.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/, 'invalid Solana address');
+// Typed failures from the pricing / fund-routing layer that mean "briefly
+// unavailable", not "internal fault". Their messages carry no secrets, so we
+// answer them with an honest 503 + retry hint here — before they reach wrap()'s
+// generic sanitizer, which would otherwise flatten them into the scary
+// "internal error — quote ref …" support dump and strip the actionable code.
+const QUOTE_UNAVAILABLE_DETAIL = {
+ price_unavailable: 'Live $THREE price is briefly unavailable. Try again in a moment.',
+ treasury_unavailable: 'The $THREE payment rail is briefly unavailable. Try again shortly.',
+ rewards_unavailable: 'The $THREE payment rail is briefly unavailable. Try again shortly.',
+};
+
function isAdmin(user) {
if (!user) return false;
if (user.is_admin) return true;
@@ -119,15 +130,28 @@ async function handleQuote(req, res) {
return error(res, 400, 'seller_required', 'seller_wallet is required for this purpose');
}
- const { token, quote, expiresAt } = await issueQuote({
- purpose: body.purpose,
- usd: body.usd,
- splitPolicy: purpose.policy,
- sellerWallet: body.seller_wallet ?? null,
- network: body.network,
- refType: body.ref_type ?? null,
- refId: body.ref_id ?? null,
- });
+ let issued;
+ try {
+ issued = await issueQuote({
+ purpose: body.purpose,
+ usd: body.usd,
+ splitPolicy: purpose.policy,
+ sellerWallet: body.seller_wallet ?? null,
+ network: body.network,
+ refType: body.ref_type ?? null,
+ refId: body.ref_id ?? null,
+ });
+ } catch (err) {
+ const detail = QUOTE_UNAVAILABLE_DETAIL[err?.code];
+ if (detail) {
+ // Honest, safe-to-show 503 with the actionable code preserved + a back-off
+ // hint, so the client renders a clean "try again shortly" retry state.
+ res.setHeader('retry-after', '15');
+ return error(res, 503, err.code, detail, { retry_after: 15 });
+ }
+ throw err; // genuine fault → wrap() logs, alerts, and sanitizes it.
+ }
+ const { token, quote, expiresAt } = issued;
return json(res, 201, {
quote_token: token,
diff --git a/data/changelog.json b/data/changelog.json
index 2f4afc7f6..bf2029fa6 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,51 @@
{
"$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-28",
+ "title": "Five pages that were returning 404 are reachable again",
+ "summary": "The Gaussian-splat viewer (/splat), the capture tool (/capture), the integrations directory (/integrations), partners (/partners), and the live-agents board (/agents-live) were all returning a 404 in production even though the pages existed and were linked from the nav. Our routing pins every clean URL explicitly, and these five were missing their entry, so the request fell through to the not-found page. We added the missing routes and tightened the route audit so a new page can no longer ship without one.",
+ "tags": [
+ "fix"
+ ],
+ "link": "/splat"
+ },
+ {
+ "date": "2026-06-28",
+ "title": "Selfie → avatar now works on the Tripo engine",
+ "summary": "Building an avatar from a selfie could fail with \"Avatar engine is having trouble\" when the Tripo 3D engine was in use. Your photo is sent to the engine as inline image data, but Tripo only accepts an uploaded image — so every selfie was being rejected. We now upload your photo to the engine first and reference it correctly, so selfie-to-avatar succeeds on Tripo just like it already did on the other engine.",
+ "tags": [
+ "fix"
+ ],
+ "link": "/create/selfie"
+ },
+ {
+ "date": "2026-06-28",
+ "title": "Create an agent by describing it — the wizard now builds itself",
+ "summary": "Spinning up an agent no longer means filling out five steps of fields. At the top of the Create flow there's now a single box: describe your agent in a sentence — \"a witty crypto market analyst that explains charts in plain English\" — and we generate the whole thing for you: name, description, tags, the right skills, a fitting 3D body, a marketplace category, a greeting, and its personality. No idea where to start? Tap an example or hit \"Surprise me\" and get a complete agent with zero typing. Everything lands on the Review step pre-filled, so you read it over, tweak anything you like, and ship. The by-hand form is still right there for anyone who wants it.",
+ "tags": [
+ "feature"
+ ],
+ "link": "/create-agent"
+ },
+ {
+ "date": "2026-06-28",
+ "title": "Agent Studio's Brain editor is now a clean form, not a node graph",
+ "summary": "Designing your agent's mind no longer means dragging wires around a flow-chart. The Brain tab is now an ordered stack of cards — Persona, Memory, Skills, Market signals, Model, and Avatar output — that you simply fill in. The wiring happens automatically: a card that's present is part of your agent's reasoning; remove it and it's gone. Templates, the live test chat, the behavior preview, and the 'watch it think' highlight all carry over unchanged, and everything you already built loads straight into the new editor.",
+ "tags": [
+ "improvement"
+ ],
+ "link": "/agent-studio"
+ },
+ {
+ "date": "2026-06-28",
+ "title": "The Avatar Engines Atlas page is now reachable",
+ "summary": "The link to the Avatar Engines Atlas — the curated rundown of the open-source and commercial engines behind high-quality, photoreal 3D human avatars — was returning a 404 because the page was never wired into routing. The route is now in place, so the page opens from navigation as intended.",
+ "tags": [
+ "fix"
+ ],
+ "link": "/avatar-engines"
+ },
{
"date": "2026-06-28",
"title": "Avatar generation rides out engine outages by failing over between backends",
@@ -13,7 +58,7 @@
{
"date": "2026-06-28",
"title": "$THREE payments ride out brief price-feed blips instead of failing",
- "summary": "Paid actions priced in $THREE (Forge high tier, spins, marketplace) no longer fail when every live price feed happens to miss on the same request. The price layer now keeps a recent last-known-good price and serves it through a momentary simultaneous outage of Jupiter and the backup feeds, so a quote is never rejected over a transient blip. Prices older than five minutes are still refused — a payment is never priced off a stale number.",
+ "summary": "Paid actions priced in $THREE (Forge high tier, spins, marketplace) no longer fail when every live price feed happens to miss on the same request. The price layer now keeps a recent last-known-good price and serves it through a momentary simultaneous outage of Jupiter and the backup feeds, so a quote is never rejected over a transient blip. Prices older than five minutes are still refused — a payment is never priced off a stale number. And on the rare moment the payment rail genuinely is catching its breath, you now see a clear \"briefly unavailable — try again\" message instead of a raw \"internal error\" support code.",
"tags": [
"fix"
],
diff --git a/pages/create-agent.html b/pages/create-agent.html
index 912505b39..06504482e 100644
--- a/pages/create-agent.html
+++ b/pages/create-agent.html
@@ -1359,7 +1359,6 @@
<div class="magic-divider">or build it by hand</div>
-
<div class="field">
<label class="field-label" for="f-name">
<span
diff --git a/public/changelog.json b/public/changelog.json
index 0f86da7e7..aa0ccad80 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-28T05:57:27.534Z",
+ "generated_at": "2026-06-28T06:12:23.647Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -10,7 +10,7 @@
"date": "2026-06-28",
"type": "update",
"title": "$THREE payments ride out brief price-feed blips instead of failing",
- "summary": "Paid actions priced in $THREE (Forge high tier, spins, marketplace) no longer fail when every live price feed happens to miss on the same request. The price layer now keeps a recent last-known-good price and serves it through a momentary simultaneous outage of Jupiter and the backup feeds, so a quote is never rejected over a transient blip. Prices older than five minutes are still refused — a payment is never priced off a stale number.",
+ "summary": "Paid actions priced in $THREE (Forge high tier, spins, marketplace) no longer fail when every live price feed happens to miss on the same request. The price layer now keeps a recent last-known-good price and serves it through a momentary simultaneous outage of Jupiter and the backup feeds, so a quote is never rejected over a transient blip. Prices older than five minutes are still refused — a payment is never priced off a stale number. And on the rare moment the payment rail genuinely is catching its breath, you now see a clear \"briefly unavailable — try again\" message instead of a raw \"internal error\" support code.",
"link": "/three-token",
"tags": [
"fix"
@@ -27,6 +27,16 @@
"improvement"
]
},
+ {
+ "date": "2026-06-28",
+ "type": "update",
+ "title": "Agent Studio's Brain editor is now a clean form, not a node graph",
+ "summary": "Designing your agent's mind no longer means dragging wires around a flow-chart. The Brain tab is now an ordered stack of cards — Persona, Memory, Skills, Market signals, Model, and Avatar output — that you simply fill in. The wiring happens automatically: a card that's present is part of your agent's reasoning; remove it and it's gone. Templates, the live test chat, the behavior preview, and the 'watch it think' highlight all carry over unchanged, and everything you already built loads straight into the new editor.",
+ "link": "/agent-studio",
+ "tags": [
+ "improvement"
+ ]
+ },
{
"date": "2026-06-28",
"type": "update",
@@ -81,6 +91,26 @@
"infra"
]
},
+ {
+ "date": "2026-06-28",
+ "type": "update",
+ "title": "Create an agent by describing it — the wizard now builds itself",
+ "summary": "Spinning up an agent no longer means filling out five steps of fields. At the top of the Create flow there's now a single box: describe your agent in a sentence — \"a witty crypto market analyst that explains charts in plain English\" — and we generate the whole thing for you: name, description, tags, the right skills, a fitting 3D body, a marketplace category, a greeting, and its personality. No idea where to start? Tap an example or hit \"Surprise me\" and get a complete agent with zero typing. Everything lands on the Review step pre-filled, so you read it over, tweak anything you like, and ship. The by-hand form is still right there for anyone who wants it.",
+ "link": "/create-agent",
+ "tags": [
+ "feature"
+ ]
+ },
+ {
+ "date": "2026-06-28",
+ "type": "update",
+ "title": "Five pages that were returning 404 are reachable again",
+ "summary": "The Gaussian-splat viewer (/splat), the capture tool (/capture), the integrations directory (/integrations), partners (/partners), and the live-agents board (/agents-live) were all returning a 404 in production even though the pages existed and were linked from the nav. Our routing pins every clean URL explicitly, and these five were missing their entry, so the request fell through to the not-found page. We added the missing routes and tightened the route audit so a new page can no longer ship without one.",
+ "link": "/splat",
+ "tags": [
+ "fix"
+ ]
+ },
{
"date": "2026-06-28",
"type": "update",
@@ -190,6 +220,16 @@
"feature"
]
},
+ {
+ "date": "2026-06-28",
+ "type": "update",
+ "title": "Selfie → avatar now works on the Tripo engine",
+ "summary": "Building an avatar from a selfie could fail with \"Avatar engine is having trouble\" when the Tripo 3D engine was in use. Your photo is sent to the engine as inline image data, but Tripo only accepts an uploaded image — so every selfie was being rejected. We now upload your photo to the engine first and reference it correctly, so selfie-to-avatar succeeds on Tripo just like it already did on the other engine.",
+ "link": "/create/selfie",
+ "tags": [
+ "fix"
+ ]
+ },
{
"date": "2026-06-28",
"type": "update",
@@ -201,6 +241,16 @@
"infra"
]
},
+ {
+ "date": "2026-06-28",
+ "type": "update",
+ "title": "The Avatar Engines Atlas page is now reachable",
+ "summary": "The link to the Avatar Engines Atlas — the curated rundown of the open-source and commercial engines behind high-quality, photoreal 3D human avatars — was returning a 404 because the page was never wired into routing. The route is now in place, so the page opens from navigation as intended.",
+ "link": "/avatar-engines",
+ "tags": [
+ "fix"
+ ]
+ },
{
"date": "2026-06-28",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index ad727c92c..6f5366638 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -12,7 +12,7 @@
<guid isPermaLink="false">2026-06-28:$THREE payments ride out brief price-feed blips instead of failing</guid>
<pubDate>Sun, 28 Jun 2026 12:00:00 GMT</pubDate>
<category>fix</category>
- <description>Paid actions priced in $THREE (Forge high tier, spins, marketplace) no longer fail when every live price feed happens to miss on the same request. The price layer now keeps a recent last-known-good price and serves it through a momentary simultaneous outage of Jupiter and the backup feeds, so a quote is never rejected over a transient blip. Prices older than five minutes are still refused — a payment is never priced off a stale number.</description>
+ <description>Paid actions priced in $THREE (Forge high tier, spins, marketplace) no longer fail when every live price feed happens to miss on the same request. The price layer now keeps a recent last-known-good price and serves it through a momentary simultaneous outage of Jupiter and the backup feeds, so a quote is never rejected over a transient blip. Prices older than five minutes are still refused — a payment is never priced off a stale number. And on the rare moment the payment rail genuinely is catching its breath, you now see a clear &quot;briefly unavailable — try again&quot; message instead of a raw &quot;internal error&quot; support code.</description>
</item>
<item>
<title>Agent Reputation Leaderboard — top agents promoted in marketplace by on-chain trust score</title>
@@ -22,6 +22,14 @@
<category>feature</category>
<description>The platform now autonomously ranks the top 10 three.ws agents by behavioral trust score every 30 minutes via a real x402 payment to the agent-reputation endpoint. Scores are synthesized from real on-chain pump.fun agent-payments activity, distribution/buyback success, and signed Solana attestations — not a subjective rating. The top 10 are promoted to the front of the marketplace recommended feed and marked with a ◈ Top Trust badge. The ranking is also stored as an oracle signal (topic: agent_reputation_leaderboard) for downstream systems to query. Full snapshot history is written to agent_reputation_leaderboard_snapshots so trust trends are auditable over time.</description>
</item>
+ <item>
+ <title>Agent Studio's Brain editor is now a clean form, not a node graph</title>
+ <link>https://three.ws/agent-studio</link>
+ <guid isPermaLink="false">2026-06-28:Agent Studio's Brain editor is now a clean form, not a node graph</guid>
+ <pubDate>Sun, 28 Jun 2026 12:00:00 GMT</pubDate>
+ <category>improvement</category>
+ <description>Designing your agent's mind no longer means dragging wires around a flow-chart. The Brain tab is now an ordered stack of cards — Persona, Memory, Skills, Market signals, Model, and Avatar output — that you simply fill in. The wiring happens automatically: a card that's present is part of your agent's reasoning; remove it and it's gone. Templates, the live test chat, the behavior preview, and the 'watch it think' highlight all carry over unchanged, and everything you already built loads straight into the new editor.</description>
+ </item>
<item>
<title>API Key Validity Health — the platform verifies its own access keys every hour</title>
<link>https://three.ws/changelog</link>
@@ -62,6 +70,22 @@
<category>feature</category>
<description>The autonomous loop now pays /api/x402/analytics every 30 minutes with { report: &quot;clubs&quot;, period: &quot;24h&quot; } for a live snapshot of the Pole Club's social economy. The report reads straight from the real ledgers — settled tips (club_tips), the stage roster (club_dancer_wallets) and settled door cover charges (x402_audit_log) — and returns how many stages are active, how many distinct patrons showed up, the tip count and USDC volume, the cover charges collected at the door, and a fastest-growing-stage leaderboard. Every snapshot is appended to a club_social_analytics time series so a dashboard can chart whether the nightlife is heating up or cooling down and spot which stages are on the rise.</description>
</item>
+ <item>
+ <title>Create an agent by describing it — the wizard now builds itself</title>
+ <link>https://three.ws/create-agent</link>
+ <guid isPermaLink="false">2026-06-28:Create an agent by describing it — the wizard now builds itself</guid>
+ <pubDate>Sun, 28 Jun 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>Spinning up an agent no longer means filling out five steps of fields. At the top of the Create flow there's now a single box: describe your agent in a sentence — &quot;a witty crypto market analyst that explains charts in plain English&quot; — and we generate the whole thing for you: name, description, tags, the right skills, a fitting 3D body, a marketplace category, a greeting, and its personality. No idea where to start? Tap an example or hit &quot;Surprise me&quot; and get a complete agent with zero typing. Everything lands on the Review step pre-filled, so you read it over, tweak anything you like, and ship. The by-hand form is still right there for anyone who wants it.</description>
+ </item>
+ <item>
+ <title>Five pages that were returning 404 are reachable again</title>
+ <link>https://three.ws/splat</link>
+ <guid isPermaLink="false">2026-06-28:Five pages that were returning 404 are reachable again</guid>
+ <pubDate>Sun, 28 Jun 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>The Gaussian-splat viewer (/splat), the capture tool (/capture), the integrations directory (/integrations), partners (/partners), and the live-agents board (/agents-live) were all returning a 404 in production even though the pages existed and were linked from the nav. Our routing pins every clean URL explicitly, and these five were missing their entry, so the request fell through to the not-found page. We added the missing routes and tightened the route audit so a new page can no longer ship without one.</description>
+ </item>
<item>
<title>Forge Content Health — the platform canaries its own generation engine every 10 minutes</title>
<link>https://three.ws/changelog</link>
@@ -142,6 +166,14 @@
<category>infra</category>
<description>A broken RSS feed is invisible — the feed URL returns 200, but the XML inside is malformed, the item count drifted after a skipped build step, or the latest entry title diverged from the canonical record. The platform now catches all three failure modes automatically. Every five minutes an autonomous agent makes a real on-chain payment to a new /api/x402/feed-health endpoint with body { feed: &quot;changelog_rss&quot; }. The endpoint fetches three.ws/changelog.xml, parses it as RSS 2.0 with fast-xml-parser, counts the &lt;item&gt; elements, and cross-checks the latest item title against the canonical public/changelog.json compiled output. If any of those checks fail — invalid XML, unreachable URL, title mismatch — the { valid: false } verdict is recorded as an actionable signal in x402_autonomous_log.signal_data so the status surface can read feed health in a single lookup. The same endpoint is available on the x402 bazaar for $0.001 per check.</description>
</item>
+ <item>
+ <title>Selfie → avatar now works on the Tripo engine</title>
+ <link>https://three.ws/create/selfie</link>
+ <guid isPermaLink="false">2026-06-28:Selfie → avatar now works on the Tripo engine</guid>
+ <pubDate>Sun, 28 Jun 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>Building an avatar from a selfie could fail with &quot;Avatar engine is having trouble&quot; when the Tripo 3D engine was in use. Your photo is sent to the engine as inline image data, but Tripo only accepts an uploaded image — so every selfie was being rejected. We now upload your photo to the engine first and reference it correctly, so selfie-to-avatar succeeds on Tripo just like it already did on the other engine.</description>
+ </item>
<item>
<title>Skill Marketplace: most-purchased skills signal</title>
<link>https://three.ws/changelog</link>
@@ -150,6 +182,14 @@
<category>feature</category>
<description>The autonomous x402 loop now pays every 30 minutes to retrieve the 5 most-purchased agent skills over the past 7 days from the real hire ledger. The top skill and full ranked list land in the autonomous log as actionable signal for featured-listing curation — a shift in the top skill across runs surfaces emerging high-demand capabilities automatically.</description>
</item>
+ <item>
+ <title>The Avatar Engines Atlas page is now reachable</title>
+ <link>https://three.ws/avatar-engines</link>
+ <guid isPermaLink="false">2026-06-28:The Avatar Engines Atlas page is now reachable</guid>
+ <pubDate>Sun, 28 Jun 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>The link to the Avatar Engines Atlas — the curated rundown of the open-source and commercial engines behind high-quality, photoreal 3D human avatars — was returning a 404 because the page was never wired into routing. The route is now in place, so the page opens from navigation as intended.</description>
+ </item>
<item>
<title>User Activity Analytics — DAU, WAU, and top features now tracked every 6 hours via x402</title>
<link>https://three.ws/changelog</link>
diff --git a/public/features.json b/public/features.json
index 45540b783..aca23a4a5 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-28T05:57:27.436Z",
+ "generated_at": "2026-06-28T06:12:23.631Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/scripts/verify-routes.mjs b/scripts/verify-routes.mjs
index 9727adeb1..dd62d2f1a 100644
--- a/scripts/verify-routes.mjs
+++ b/scripts/verify-routes.mjs
@@ -108,7 +108,14 @@ function fileServes(path) {
const clean = path.replace(/^\//, '').split('?')[0];
if (clean === '') return served.has('home.html') || served.has('index.html');
if (served.has(clean)) return true;
- if (served.has(clean + '.html')) return true;
+ // NOTE: no bare-`.html` extension resolution here. This project pins routing
+ // with a legacy `routes` array in vercel.json, which opts out of Vercel's
+ // `cleanUrls` — the filesystem handler does NOT serve `splat.html` for a
+ // request to `/splat`. Each flat page needs an explicit `/x → /x.html`
+ // route. Modeling the extension fallback here would mask pages that are
+ // missing that route (they 404 in production while the audit stays green —
+ // exactly how /splat, /capture, /integrations, /partners, /agents-live
+ // slipped through). Directory indexes are still served by the filesystem.
if (served.has(clean + '/index.html')) return true;
if (clean.endsWith('/') && served.has(clean + 'index.html')) return true;
return false;
diff --git a/src/create-agent.js b/src/create-agent.js
index 855efde97..325115a5c 100644
--- a/src/create-agent.js
+++ b/src/create-agent.js
@@ -16,7 +16,7 @@ import { apiFetch } from './api.js';
import { getMe, saveRemoteGlbToAccount } from './account.js';
import { log } from './shared/log.js';
import { isValidGlbMagic } from './shared/glb-magic.js';
-import { trackFunnelStep, trackError, ANALYTICS_EVENTS } from './analytics.js';
+import { track, trackFunnelStep, trackError, ANALYTICS_EVENTS } from './analytics.js';
const TOTAL_STEPS = 5;
const STEP_LABELS = ['Basics', 'Model', 'Skills', 'Personality', 'Review'];
@@ -134,6 +134,7 @@ async function boot() {
wireBasics();
wireModel();
wirePersonality();
+ wireMagic();
wireNav();
// Resolve auth. The whole flow requires an account (the agent gets a wallet),
@@ -166,6 +167,9 @@ function cacheEls() {
el.authGate = $('auth-gate');
el.preview = $('model-preview');
el.previewEmpty = $('model-preview-empty');
+ el.magicInput = $('magic-input');
+ el.magicGo = $('magic-go');
+ el.magicMsg = $('magic-msg');
}
function showAuthGate() {
@@ -392,7 +396,164 @@ function wireTagInput() {
});
box.insertBefore(frag, input);
}
- // expose for the personality step's reuse — not needed elsewhere now.
+ // Expose so the magic generator can repaint after replacing state.tags.
+ tagRenderer = renderTags;
+}
+
+// ── Magic generator: describe it, we build it ───────────────────────────────
+
+let generating = false;
+
+function wireMagic() {
+ const input = el.magicInput;
+ const go = el.magicGo;
+ if (!input || !go) return;
+
+ // Auto-grow the brief box so longer ideas stay fully visible.
+ const grow = () => {
+ input.style.height = 'auto';
+ input.style.height = Math.min(input.scrollHeight, 160) + 'px';
+ };
+ input.addEventListener('input', grow);
+ // Enter generates; Shift+Enter inserts a newline.
+ input.addEventListener('keydown', (e) => {
+ if (e.key === 'Enter' && !e.shiftKey) {
+ e.preventDefault();
+ generateSpec(input.value);
+ }
+ });
+
+ go.addEventListener('click', () => generateSpec(input.value));
+
+ // Example chips fill the brief (one-click, zero typing) and generate at once.
+ document.querySelectorAll('#magic-chips .magic-chip[data-example]').forEach((chip) => {
+ chip.addEventListener('click', () => {
+ input.value = chip.dataset.example || '';
+ grow();
+ generateSpec(input.value);
+ });
+ });
+ // "Surprise me" — generate with no brief at all.
+ $('magic-surprise')?.addEventListener('click', () => generateSpec(''));
+}
+
+function setMagicMsg(text, kind) {
+ if (!el.magicMsg) return;
+ el.magicMsg.textContent = text || '';
+ el.magicMsg.className = 'magic-msg' + (kind ? ' ' + kind : '');
+}
+
+function setMagicBusy(busy) {
+ generating = busy;
+ if (el.magicGo) {
+ el.magicGo.setAttribute('aria-busy', busy ? 'true' : 'false');
+ el.magicGo.disabled = busy;
+ const label = el.magicGo.querySelector('.magic-go-label');
+ if (label) label.textContent = busy ? 'Building…' : 'Generate';
+ }
+ if (el.magicInput) el.magicInput.disabled = busy;
+ document
+ .querySelectorAll('#magic-chips .magic-chip')
+ .forEach((c) => (c.disabled = busy));
+}
+
+async function generateSpec(rawPrompt) {
+ if (generating) return;
+ const prompt = (rawPrompt || '').trim();
+ setMagicBusy(true);
+ setMagicMsg('Designing your agent…', '');
+ try {
+ const res = await apiFetch('/api/agents/suggest-spec', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({ prompt }),
+ });
+ const data = await res.json().catch(() => ({}));
+ if (!res.ok || !data.spec) {
+ const msg =
+ data.error_description ||
+ (res.status === 401
+ ? 'Please sign in first, then generate.'
+ : res.status === 429
+ ? 'You’re generating quickly — give it a few seconds and try again.'
+ : 'Couldn’t generate that one. Try a different description or fill the form by hand.');
+ setMagicMsg(msg, 'err');
+ setMagicBusy(false);
+ return;
+ }
+ applySpec(data.spec);
+ track(ANALYTICS_EVENTS.CTA_CLICKED, {
+ cta: 'ai_generate_spec',
+ location: 'create-agent',
+ had_prompt: prompt.length > 0,
+ });
+ setMagicBusy(false);
+ setMagicMsg('', '');
+ // Drop the user on Review with everything filled — read it over and ship,
+ // or jump back to any step via the pips to tweak.
+ showStep(TOTAL_STEPS - 1);
+ setMsg(`“${state.name}” is ready to review. Tweak anything, then create.`, 'ok');
+ } catch (err) {
+ log.warn('[create-agent] generate failed', err?.message);
+ trackError('create_agent.generate', err);
+ setMagicMsg('Network hiccup — try again in a moment.', 'err');
+ setMagicBusy(false);
+ }
+}
+
+// Pour a generated spec into the wizard's real state + DOM, reusing the same
+// fields and selection paths a manual fill would touch — nothing bypasses the
+// existing validation or submit flow.
+function applySpec(spec) {
+ // Step 1 — name, description, tags.
+ state.name = spec.name || '';
+ $('f-name').value = state.name;
+ $('name-count').textContent = `${state.name.length} / 60`;
+ $('f-name').classList.remove('is-invalid');
+ $('name-error').classList.remove('show');
+
+ state.description = spec.description || '';
+ $('f-description').value = state.description;
+ $('desc-count').textContent = `${state.description.length} / 280`;
+
+ state.tags = Array.isArray(spec.tags) ? spec.tags.slice(0, MAX_TAGS) : [];
+ tagRenderer();
+
+ // Step 2 — pick the suggested starter body.
+ const starter = STARTERS.find((s) => s.id === spec.avatar_starter) || DEFAULT_AVATAR;
+ const starterTab = document.querySelector('.model-tab[data-pane="starter"]');
+ if (starterTab && !starterTab.classList.contains('is-active')) starterTab.click();
+ selectStarter(starter.id);
+
+ // Step 3 — optional skills (core stay locked on).
+ state.skills = new Set(CORE_SKILLS.map((s) => s.id));
+ (Array.isArray(spec.skills) ? spec.skills : []).forEach((id) => {
+ if (OPTIONAL_SKILLS.some((s) => s.id === id)) state.skills.add(id);
+ });
+ renderSkills();
+
+ // Step 4 — category, greeting, persona, voice.
+ state.category = CATEGORIES.includes(spec.category) ? spec.category : '';
+ $('f-category').value = state.category;
+
+ state.greeting = spec.greeting || '';
+ $('f-greeting').value = state.greeting;
+ $('greet-count').textContent = `${state.greeting.length} / 200`;
+
+ state.persona = spec.persona || '';
+ $('f-persona').value = state.persona;
+ $('persona-count').textContent = `${state.persona.length} / 2000`;
+
+ state.voice = spec.voice === 'custom' ? 'custom' : 'browser';
+ document.querySelectorAll('[data-voice]').forEach((b) => {
+ const on = b.dataset.voice === state.voice;
+ b.classList.toggle('is-selected', on);
+ b.setAttribute('aria-pressed', on ? 'true' : 'false');
+ });
+
+ // Publishing needs a category + persona; the generator supplies both, so
+ // default the marketplace listing on — the review step lets them opt out.
+ state.publish = Boolean(state.category && state.persona.trim());
}
// ── Step 2: Model ───────────────────────────────────────────────────────────
diff --git a/src/forge-pay.js b/src/forge-pay.js
index 5a97ba815..30dd78633 100644
--- a/src/forge-pay.js
+++ b/src/forge-pay.js
@@ -105,6 +105,31 @@ function classifyError(err) {
cta: { label: 'Try again', retry: true },
};
}
+ if (code === 'quote_expired') {
+ return {
+ title: 'Quote expired',
+ detail: 'That price quote timed out before the payment confirmed. Try again — no $THREE was spent.',
+ cta: { label: 'Try again', retry: true },
+ };
+ }
+ // The server fails closed on a transient back-end gap (treasury/rewards routing
+ // not ready, generation lane down) with a typed, safe-to-show code. Recognize
+ // that family so the user sees an honest, reassuring retry state. A genuinely
+ // unexpected fault (code 'internal_error') falls through to the generic branch
+ // below, which keeps the support ref the user can quote.
+ if (
+ code === 'service_unavailable' ||
+ code === 'treasury_unavailable' ||
+ code === 'rewards_unavailable' ||
+ code === 'allowance_unavailable' ||
+ code === 'generation_unavailable'
+ ) {
+ return {
+ title: 'Payments briefly unavailable',
+ detail: 'The $THREE payment rail is catching its breath. Try again in a moment — no $THREE was spent.',
+ cta: { label: 'Try again', retry: true },
+ };
+ }
// Settlement / verification or any other transient failure.
return {
title: 'Payment didn’t go through',
diff --git a/src/forge-studio/forge-pay.js b/src/forge-studio/forge-pay.js
index f17a6dbe9..cd686bf9a 100644
--- a/src/forge-studio/forge-pay.js
+++ b/src/forge-studio/forge-pay.js
@@ -105,6 +105,31 @@ function classifyError(err) {
cta: { label: 'Try again', retry: true },
};
}
+ if (code === 'quote_expired') {
+ return {
+ title: 'Quote expired',
+ detail: 'That price quote timed out before the payment confirmed. Try again — no $THREE was spent.',
+ cta: { label: 'Try again', retry: true },
+ };
+ }
+ // The server fails closed on a transient back-end gap (treasury/rewards routing
+ // not ready, generation lane down) with a typed, safe-to-show code. Recognize
+ // that family so the user sees an honest, reassuring retry state. A genuinely
+ // unexpected fault (code 'internal_error') falls through to the generic branch
+ // below, which keeps the support ref the user can quote.
+ if (
+ code === 'service_unavailable' ||
+ code === 'treasury_unavailable' ||
+ code === 'rewards_unavailable' ||
+ code === 'allowance_unavailable' ||
+ code === 'generation_unavailable'
+ ) {
+ return {
+ title: 'Payments briefly unavailable',
+ detail: 'The $THREE payment rail is catching its breath. Try again in a moment — no $THREE was spent.',
+ cta: { label: 'Try again', retry: true },
+ };
+ }
// Settlement / verification or any other transient failure.
return {
title: 'Payment didn’t go through',
diff --git a/src/game/spin-wheel-ui.js b/src/game/spin-wheel-ui.js
index d26e3a451..26ad67eed 100644
--- a/src/game/spin-wheel-ui.js
+++ b/src/game/spin-wheel-ui.js
@@ -192,6 +192,9 @@ class SpinWheel {
case 'token_unavailable': return 'Paid spins are unavailable right now.';
case 'no_wallet': return 'Connect a Solana wallet to buy a spin.';
case 'price_unavailable': return 'Live token price unavailable — try again in a moment.';
+ case 'service_unavailable':
+ case 'treasury_unavailable':
+ case 'rewards_unavailable': return 'Paid spins are briefly unavailable — try again in a moment.';
case 'build_failed': return 'Could not prepare the payment. Try again.';
case 'no_signature': return 'No transaction signature received.';
case 'already_settled': return 'That payment was already used for a spin.';
diff --git a/src/studio/brain/brain-studio.js b/src/studio/brain/brain-studio.js
index 74a0091bb..2846a13d9 100644
--- a/src/studio/brain/brain-studio.js
+++ b/src/studio/brain/brain-studio.js
@@ -388,8 +388,8 @@ class BrainStudio {
// The brain canvas mounts lazily (see _showEditor), so #bsDiff can be
// clicked before this.graph exists — e.g. during the async provider fetch
// in _init, or a stray click while onboarding is still showing. Lazily
- // mount the editor first so there's always a graph to compile; an empty
- // graph renders the "(empty — wire a Persona node)" diff rather than
+ // mount the editor first so there's always a brain to compile; an empty
+ // brain renders the "(empty — fill in the Persona card)" diff rather than
// throwing "undefined is not an object (evaluating 'this.graph.toGraph')".
if (!this.graph) this._showEditor();
const current = compileBrain(this.graph.toGraph(), { agentName: this.studio.agent?.name });
@@ -419,7 +419,7 @@ class BrainStudio {
const out = [];
for (const line of a) if (!bSet.has(line) && line.trim()) out.push(`<span class="diff-del">- ${esc(line)}</span>`);
for (const line of b) out.push(bSet.has(line) && !aSet.has(line) ? `<span class="diff-add">+ ${esc(line)}</span>` : esc(line));
- return out.join('\n') || '<span class="diff-muted">(empty — wire a Persona node)</span>';
+ return out.join('\n') || '<span class="diff-muted">(empty — fill in the Persona card)</span>';
}
_closeModal() {
diff --git a/tests/token-layer.test.js b/tests/token-layer.test.js
index a9bb4f1c9..3f80c3709 100644
--- a/tests/token-layer.test.js
+++ b/tests/token-layer.test.js
@@ -136,12 +136,16 @@ describe('token config', () => {
if (prior !== undefined) process.env.THREE_TREASURY_WALLET = prior;
});
- it('treasuryWallet throws in production when unset', () => {
+ it('treasuryWallet throws a typed 503 in production when unset', () => {
const priorNode = process.env.NODE_ENV;
const priorWallet = process.env.THREE_TREASURY_WALLET;
process.env.NODE_ENV = 'production';
delete process.env.THREE_TREASURY_WALLET;
+ // The quote endpoint translates this exact code into an honest 503; lock it.
expect(() => treasuryWallet()).toThrow(/THREE_TREASURY_WALLET/);
+ expect(() => treasuryWallet()).toThrowError(
+ expect.objectContaining({ status: 503, code: 'treasury_unavailable' }),
+ );
process.env.NODE_ENV = priorNode;
if (priorWallet !== undefined) process.env.THREE_TREASURY_WALLET = priorWallet;
});
diff --git a/tests/tripo-provider.test.js b/tests/tripo-provider.test.js
new file mode 100644
index 000000000..f764661ad
--- /dev/null
+++ b/tests/tripo-provider.test.js
@@ -0,0 +1,110 @@
+// Tripo image_to_model input handling. Tripo's `file` object accepts a public
+// http(s) `url` or an uploaded `file_token` — never an inline data: URI. The
+// selfie → avatar pipeline hands the adapter base64 data URIs, so the provider
+// must upload them via /upload and reference the returned token; passing the
+// data URI straight into `file.url` is what produced the 502 "Avatar engine is
+// having trouble" error. These tests pin that behaviour.
+
+import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
+import { createTripoProvider } from '../api/_providers/tripo.js';
+
+const KEY = 'tsk_test_key';
+const TINY_JPEG_B64 = Buffer.from([0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10]).toString('base64');
+const DATA_URI = `data:image/jpeg;base64,${TINY_JPEG_B64}`;
+
+function jsonResponse(status, body) {
+ return { ok: status >= 200 && status < 300, status, json: async () => body };
+}
+
+let fetchMock;
+beforeEach(() => {
+ fetchMock = vi.fn();
+ vi.stubGlobal('fetch', fetchMock);
+});
+afterEach(() => {
+ vi.unstubAllGlobals();
+ vi.clearAllMocks();
+});
+
+describe('createTripoProvider.imageTo3d — input routing', () => {
+ it('uploads a data URI then submits the task with the returned file_token', async () => {
+ fetchMock
+ .mockResolvedValueOnce(jsonResponse(200, { code: 0, data: { image_token: 'img-123' } })) // /upload
+ .mockResolvedValueOnce(jsonResponse(200, { code: 0, data: { task_id: 'task-789' } })); // /task
+
+ const provider = createTripoProvider(KEY);
+ const out = await provider.imageTo3d({ imageUrl: DATA_URI, tier: { polycount: 30000, pbr: true } });
+
+ expect(out).toEqual({ kind: 'task', taskId: 'task-789' });
+ expect(fetchMock).toHaveBeenCalledTimes(2);
+
+ // First call: multipart upload, bearer only (no JSON content-type so fetch
+ // can set the multipart boundary), FormData body.
+ const [uploadUrl, uploadOpts] = fetchMock.mock.calls[0];
+ expect(uploadUrl).toBe('https://api.tripo3d.ai/v2/openapi/upload');
+ expect(uploadOpts.method).toBe('POST');
+ expect(uploadOpts.headers).toEqual({ authorization: `Bearer ${KEY}` });
+ expect(uploadOpts.body).toBeInstanceOf(FormData);
+
+ // Second call: the task references the uploaded token, never a data: URI.
+ const taskBody = JSON.parse(fetchMock.mock.calls[1][1].body);
+ expect(taskBody.type).toBe('image_to_model');
+ expect(taskBody.file).toEqual({ type: 'jpg', file_token: 'img-123' });
+ expect(JSON.stringify(taskBody)).not.toContain('data:image');
+ });
+
+ it('accepts an older upload response that returns file_token', async () => {
+ fetchMock
+ .mockResolvedValueOnce(jsonResponse(200, { code: 0, data: { file_token: 'tok-legacy' } }))
+ .mockResolvedValueOnce(jsonResponse(200, { code: 0, data: { task_id: 't2' } }));
+
+ const provider = createTripoProvider(KEY);
+ await provider.imageTo3d({ imageUrl: DATA_URI, tier: { polycount: 30000, pbr: false } });
+
+ const taskBody = JSON.parse(fetchMock.mock.calls[1][1].body);
+ expect(taskBody.file.file_token).toBe('tok-legacy');
+ });
+
+ it('passes a real http(s) URL straight through without an upload call', async () => {
+ fetchMock.mockResolvedValueOnce(jsonResponse(200, { code: 0, data: { task_id: 'task-url' } }));
+
+ const provider = createTripoProvider(KEY);
+ const out = await provider.imageTo3d({
+ imageUrl: 'https://cdn.example.com/selfie.png',
+ tier: { polycount: 30000, pbr: true },
+ });
+
+ expect(out.taskId).toBe('task-url');
+ expect(fetchMock).toHaveBeenCalledTimes(1);
+ const taskBody = JSON.parse(fetchMock.mock.calls[0][1].body);
+ expect(taskBody.file).toEqual({ type: 'png', url: 'https://cdn.example.com/selfie.png' });
+ });
+
+ it('maps an upload auth failure to invalid_key (401) and never submits a task', async () => {
+ fetchMock.mockResolvedValueOnce(jsonResponse(401, { code: 1001, message: 'bad key' }));
+
+ const provider = createTripoProvider(KEY);
+ await expect(
+ provider.imageTo3d({ imageUrl: DATA_URI, tier: { polycount: 30000, pbr: true } }),
+ ).rejects.toMatchObject({ code: 'invalid_key', status: 401 });
+ expect(fetchMock).toHaveBeenCalledTimes(1);
+ });
+
+ it('maps an out-of-credits upload to insufficient_credits (402)', async () => {
+ fetchMock.mockResolvedValueOnce(jsonResponse(402, { code: 2000, message: 'no credits' }));
+
+ const provider = createTripoProvider(KEY);
+ await expect(
+ provider.imageTo3d({ imageUrl: DATA_URI, tier: { polycount: 30000, pbr: true } }),
+ ).rejects.toMatchObject({ code: 'insufficient_credits', status: 402 });
+ });
+
+ it('treats an upload with no token as a provider_error (502)', async () => {
+ fetchMock.mockResolvedValueOnce(jsonResponse(200, { code: 0, data: {} }));
+
+ const provider = createTripoProvider(KEY);
+ await expect(
+ provider.imageTo3d({ imageUrl: DATA_URI, tier: { polycount: 30000, pbr: true } }),
+ ).rejects.toMatchObject({ code: 'provider_error', status: 502 });
+ });
+});
diff --git a/vercel.json b/vercel.json
index 9605a1e6a..87813dd9f 100644
--- a/vercel.json
+++ b/vercel.json
@@ -1763,6 +1763,46 @@
"src": "/avatar-engines/",
"dest": "/avatar-engines.html"
},
+ {
+ "src": "/splat",
+ "dest": "/splat.html"
+ },
+ {
+ "src": "/splat/",
+ "dest": "/splat.html"
+ },
+ {
+ "src": "/capture",
+ "dest": "/capture.html"
+ },
+ {
+ "src": "/capture/",
+ "dest": "/capture.html"
+ },
+ {
+ "src": "/integrations",
+ "dest": "/integrations.html"
+ },
+ {
+ "src": "/integrations/",
+ "dest": "/integrations.html"
+ },
+ {
+ "src": "/partners",
+ "dest": "/partners.html"
+ },
+ {
+ "src": "/partners/",
+ "dest": "/partners.html"
+ },
+ {
+ "src": "/agents-live",
+ "dest": "/agents-live.html"
+ },
+ {
+ "src": "/agents-live/",
+ "dest": "/agents-live.html"
+ },
{
"src": "/cosmos",
"dest": "/cosmos.html"