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: chat UI overhaul, play-pass refresh, marketplace + NPC updates
nirholasab8e361ea302
diff --git a/api/_lib/audit.js b/api/_lib/audit.jsindex 2bad40fa9..d07442426 100644--- a/api/_lib/audit.js+++ b/api/_lib/audit.js@@ -9,7 +9,7 @@// api/_lib/migrations/2026-05-25-audit-log-context.sql — ip + user_agent// Audit data starts 2026-05-01 — earlier deletions/revocations have no row.-import { sql } from './db.js';+import { sql, withDbRetry } from './db.js';import { clientIp } from './rate-limit.js';const UA_MAX = 512;@@ -31,10 +31,10 @@ export function logAudit({ userId, action, resourceId = null, meta = null, req =const resolvedUa = rawUa ? String(rawUa).slice(0, UA_MAX) : null;queueMicrotask(async () => {try {- await sql`+ await withDbRetry(() => sql`insert into audit_log (user_id, action, resource_id, meta, ip, user_agent)values (${userId}, ${action}, ${resourceId}, ${meta}, ${resolvedIp}, ${resolvedUa})- `;+ `);} catch (err) {console.error('[audit] insert failed', { action, resourceId, error: err?.message });}diff --git a/api/_lib/db.js b/api/_lib/db.jsindex e92be2597..a0b753652 100644--- a/api/_lib/db.js+++ b/api/_lib/db.js@@ -44,3 +44,40 @@ export const sql = new Proxy(function () {}, {return getSql()[prop];},});++// Neon's HTTP driver does a `fetch` per query. On Vercel, cold connections and+// momentary network blips surface as `NeonDbError: Error connecting to database:+// fetch failed` — a connection-level failure where the request never reached+// Postgres, so no statement ran. These are transient and safe to retry (the+// query is never half-applied: a failed connect can't have committed a write).+// SQL errors (constraint violations, syntax, 22021 NUL, etc.) are deterministic+// and surface unchanged.+//+// This is a per-call opt-in (not baked into `sql`) on purpose: the bare `sql`+// tagged template must keep returning Neon's lazy query object so callers can+// still batch them with `sql.transaction([...])`. Use it around standalone,+// idempotent statements where a transient blip otherwise drops data — e.g. the+// fire-and-forget audit/usage writes.+const MAX_DB_ATTEMPTS = 3;+const RETRY_BACKOFF_MS = [150, 400];++function isTransientConnError(err) {+ const msg = `${err?.message || ''} ${err?.sourceError?.message || ''} ${err?.cause?.message || ''}`;+ return /fetch failed|connecting to database|ECONNRESET|ECONNREFUSED|ETIMEDOUT|EAI_AGAIN|socket hang up|network|terminat/i.test(+ msg,+ );+}++export async function withDbRetry(run) {+ let lastErr;+ for (let attempt = 0; attempt < MAX_DB_ATTEMPTS; attempt++) {+ try {+ return await run();+ } catch (err) {+ lastErr = err;+ if (attempt === MAX_DB_ATTEMPTS - 1 || !isTransientConnError(err)) throw err;+ await new Promise((r) => setTimeout(r, RETRY_BACKOFF_MS[attempt] ?? 400));+ }+ }+ throw lastErr;+}diff --git a/api/_lib/play-pass.js b/api/_lib/play-pass.jsindex 080b39d0f..76810ee5b 100644--- a/api/_lib/play-pass.js+++ b/api/_lib/play-pass.js@@ -150,3 +150,21 @@ export function signPlayPass({ wallet, mint, balance }) {exp: now + PASS_TTL_S,});}++/**+ * Verify an existing play pass and return its payload, or null when missing,+ * malformed, tampered with, or expired. Mirrors the game server's verifyPlayPass+ * (multiplayer/src/play-pass.js) so a still-valid pass can be used to silently+ * re-issue a fresh one — possession of an unexpired, HMAC-signed pass already+ * proves the wallet was verified minutes ago, so no new signature is needed.+ * @param {unknown} token+ * @returns {{ wallet: string, mint: string, balance: number, tier: string, iat: number, exp: number } | null}+ */+export function verifyPlayPass(token) {+ const payload = open(token, 'play-pass');+ if (!payload || payload.tier !== 'play') return null;+ if (typeof payload.wallet !== 'string' || !payload.wallet) return null;+ if (typeof payload.mint !== 'string' || !payload.mint) return null;+ if (typeof payload.balance !== 'number' || !Number.isFinite(payload.balance) || payload.balance < 0) return null;+ return payload;+}diff --git a/api/_lib/rate-limit.js b/api/_lib/rate-limit.jsindex c664e18ee..291b3b55c 100644--- a/api/_lib/rate-limit.js+++ b/api/_lib/rate-limit.js@@ -321,6 +321,12 @@ export const limits = {// per user is generous for browse but discourages scraping the full year.auditLogRead: (userId) =>getLimiter('audit-log:read', { limit: 120, window: '1 m' }).limit(userId),+ // Notifications inbox poll — the nav badge polls every 30s and re-polls on+ // each navigation + tab focus. Keyed by userId with its own generous bucket so+ // it never competes with the strict per-IP `authIp` budget (which a shared+ // office/NAT IP would otherwise exhaust, 429-ing the badge for everyone).+ notificationsRead: (userId) =>+ getLimiter('notifications:read', { limit: 120, window: '1 m' }).limit(userId),// $THREE token payment layer (api/token/*).// quote: 30 per user per minute — prevents price-polling abuse; each quote// hits a live price feed and signs a HMAC. Generous enough for interactivediff --git a/api/_lib/usage.js b/api/_lib/usage.jsindex 69da8deb6..b132311a3 100644--- a/api/_lib/usage.js+++ b/api/_lib/usage.js@@ -1,12 +1,12 @@// Fire-and-forget usage event logging. Failures must never impact the request.-import { sql } from './db.js';+import { sql, withDbRetry } from './db.js';export function recordEvent(evt) {// Intentionally not awaited in callers; we swallow errors here.queueMicrotask(async () => {try {- await sql`+ await withDbRetry(() => sql`insert into usage_events (user_id, api_key_id, client_id, avatar_id, agent_id, kind, tool, status, bytes, latency_ms, meta)values (${evt.userId ?? null},@@ -21,7 +21,7 @@ export function recordEvent(evt) {${evt.latencyMs ?? null},${JSON.stringify(evt.meta ?? {})}::jsonb)- `;+ `);} catch (err) {console.warn('[usage] write failed', err?.message);}diff --git a/api/avatar-og.js b/api/avatar-og.jsindex 368819fa6..38696de57 100644--- a/api/avatar-og.js+++ b/api/avatar-og.js@@ -113,7 +113,15 @@ export default wrap(async (req, res) => {return;} catch (err) {console.warn('[avatar-og] render fallback', { avatarId, err: err?.message });- return sendFallbackLogo(req, res);+ // Render failed (oversized GLB, timeout, unreachable model). We still hold+ // the avatar's real metadata, so serve the branded, *named* card — strictly+ // better for a Twitter/Slack/Discord crawler than the anonymous site logo,+ // and the crawler caches a card that actually identifies the avatar.+ return sendCardSvg(res, 200, CACHE_FALLBACK, {+ name: avatar.name || 'Avatar',+ description: avatar.description || 'A 3D avatar on three.ws',+ tags: avatar.tags || [],+ });}});diff --git a/api/marketplace/[action].js b/api/marketplace/[action].jsindex 9eacddcfd..26eec358d 100644--- a/api/marketplace/[action].js+++ b/api/marketplace/[action].js@@ -179,42 +179,77 @@ async function handleTheme(req, res) {const weekNum = Math.floor(Date.now() / (7 * 24 * 3600 * 1000));const cat = THEME_CATEGORIES[weekNum % THEME_CATEGORIES.length];- let rows;- try {- rows = await sql`- SELECT a.id, a.name, a.description, a.category, a.tags, a.skills,- a.views_count, a.forks_count,- COALESCE((SELECT AVG(rating)::numeric(3,2) FROM agent_reviews r WHERE r.agent_id = a.id), 0) AS rating_avg,- COALESCE((SELECT COUNT(*) FROM agent_reviews r WHERE r.agent_id = a.id), 0) AS rating_count,- a.published_at, a.created_at,- v.storage_key AS avatar_storage_key,- (v.visibility IS NULL OR v.visibility IN ('public', 'unlisted')) AS avatar_public,- v.thumbnail_key- FROM agent_identities a- LEFT JOIN avatars v ON v.id = a.avatar_id AND v.deleted_at IS NULL- WHERE a.is_published = true AND a.deleted_at IS NULL- AND (${cat.slug === 'general'} OR a.category = ${cat.slug})- ORDER BY a.views_count DESC, rating_avg DESC- LIMIT 8+ // Top Picks pulls a randomized lineup of the community's most-viewed agents+ // that actually carry a public 3D avatar — every pick renders a real GLB,+ // and the order reshuffles per request so the strip always feels alive.+ // We INNER JOIN avatars (not LEFT) so agents without a 3D asset never appear.+ // Strategy: take the top-by-views pool, then `random()` within it. Themed+ // weeks scope to their category but fall back to the global pool when that+ // category has too few 3D-backed agents to fill the strip.+ const PICKS_LIMIT = 12;+ const POOL_SIZE = 60;++ // Two literal variants instead of composed `sql` fragments: the Neon HTTP+ // driver binds interpolations as parameters and doesn't support nested+ // tagged-template fragments. The no-ratings variant is the fallback for+ // databases without the agent_reviews table/columns yet.+ function queryWithRatings(scopeToCategory) {+ return sql`+ WITH pool AS (+ SELECT a.id, a.name, a.description, a.category, a.tags, a.skills,+ a.views_count, a.forks_count,+ COALESCE((SELECT AVG(rating)::numeric(3,2) FROM agent_reviews r WHERE r.agent_id = a.id), 0) AS rating_avg,+ COALESCE((SELECT COUNT(*) FROM agent_reviews r WHERE r.agent_id = a.id), 0) AS rating_count,+ a.published_at, a.created_at,+ v.storage_key AS avatar_storage_key,+ v.thumbnail_key+ FROM agent_identities a+ JOIN avatars v ON v.id = a.avatar_id AND v.deleted_at IS NULL+ WHERE a.is_published = true AND a.deleted_at IS NULL+ AND v.storage_key IS NOT NULL+ AND (v.visibility IS NULL OR v.visibility IN ('public', 'unlisted'))+ AND (${!scopeToCategory} OR a.category = ${cat.slug})+ ORDER BY a.views_count DESC NULLS LAST+ LIMIT ${POOL_SIZE}+ )+ SELECT * FROM pool ORDER BY random() LIMIT ${PICKS_LIMIT}`;- } catch (err) {- // 42P01 = table does not exist, 42703 = column does not exist- if (err.code === '42P01' || err.code === '42703') {- rows = await sql`+ }+ function queryNoRatings(scopeToCategory) {+ return sql`+ WITH pool AS (SELECT a.id, a.name, a.description, a.category, a.tags, a.skills,a.views_count, a.forks_count,0::numeric AS rating_avg, 0::int AS rating_count,a.published_at, a.created_at,v.storage_key AS avatar_storage_key,- (v.visibility IS NULL OR v.visibility IN ('public', 'unlisted')) AS avatar_public,v.thumbnail_keyFROM agent_identities a- LEFT JOIN avatars v ON v.id = a.avatar_id AND v.deleted_at IS NULL+ JOIN avatars v ON v.id = a.avatar_id AND v.deleted_at IS NULLWHERE a.is_published = true AND a.deleted_at IS NULL- AND (${cat.slug === 'general'} OR a.category = ${cat.slug})- ORDER BY a.views_count DESC- LIMIT 8- `;+ AND v.storage_key IS NOT NULL+ AND (v.visibility IS NULL OR v.visibility IN ('public', 'unlisted'))+ AND (${!scopeToCategory} OR a.category = ${cat.slug})+ ORDER BY a.views_count DESC NULLS LAST+ LIMIT ${POOL_SIZE}+ )+ SELECT * FROM pool ORDER BY random() LIMIT ${PICKS_LIMIT}+ `;+ }++ const scopeToCategory = cat.slug !== 'general';+ let rows;+ try {+ rows = await queryWithRatings(scopeToCategory);+ // A themed category with a thin 3D lineup falls back to the global pool+ // so the strip is never half-empty.+ if (scopeToCategory && rows.length < 4) rows = await queryWithRatings(false);+ } catch (err) {+ // 42P01 = table does not exist, 42703 = column does not exist (e.g. no+ // reviews table yet). Retry without the rating subqueries.+ if (err.code === '42P01' || err.code === '42703') {+ rows = await queryNoRatings(scopeToCategory);+ if (scopeToCategory && rows.length < 4) rows = await queryNoRatings(false);} else {throw err;}@@ -232,7 +267,7 @@ async function handleTheme(req, res) {rating_avg: Number(row.rating_avg || 0),rating_count: row.rating_count || 0,thumbnail_url: row.thumbnail_key ? publicUrl(row.thumbnail_key) : null,- avatar_glb_url: row.avatar_public && row.avatar_storage_key ? publicUrl(row.avatar_storage_key) : null,+ avatar_glb_url: row.avatar_storage_key ? publicUrl(row.avatar_storage_key) : null,published_at: row.published_at,}));@@ -240,7 +275,9 @@ async function handleTheme(req, res) {res,200,{ data: { theme: { title: cat.title, blurb: cat.blurb, category: cat.slug, agents } } },- { 'cache-control': 'public, max-age=3600, stale-while-revalidate=7200' },+ // Short cache: the lineup is randomized per request, so a long freeze would+ // defeat the shuffle. The client reshuffles on top of this for per-load variety.+ { 'cache-control': 'public, max-age=120, stale-while-revalidate=600' },);}diff --git a/api/notifications/index.js b/api/notifications/index.jsindex 6b9b4f05b..c260908a4 100644--- a/api/notifications/index.js+++ b/api/notifications/index.js@@ -3,7 +3,7 @@import { sql } from '../_lib/db.js';import { getSessionUser } from '../_lib/auth.js';import { cors, json, method, wrap, error } from '../_lib/http.js';-import { limits, clientIp } from '../_lib/rate-limit.js';+import { limits } from '../_lib/rate-limit.js';export default wrap(async (req, res) => {if (cors(req, res, { methods: 'GET,OPTIONS', credentials: true })) return;@@ -12,7 +12,7 @@ export default wrap(async (req, res) => {const user = await getSessionUser(req);if (!user) return error(res, 401, 'unauthorized', 'sign in required');- const rl = await limits.authIp(clientIp(req));+ const rl = await limits.notificationsRead(user.id);if (!rl.success) return error(res, 429, 'rate_limited', 'too many requests');const params = new URL(req.url, 'http://x').searchParams;diff --git a/api/play/refresh.js b/api/play/refresh.jsnew file mode 100644index 000000000..189a8a045--- /dev/null+++ b/api/play/refresh.js@@ -0,0 +1,90 @@+// POST /api/play/refresh { playPass }+//+// Silent mid-session renewal of a wallet's /play credential. The wallet proved+// ownership once at POST /api/play/verify (ed25519 signature over a server+// nonce); possession of the resulting unexpired, HMAC-signed pass is itself proof+// that the same wallet was verified minutes ago, so renewing it needs no new+// signature — only a fresh on-chain balance read to confirm the wallet still+// clears the floor. This is what keeps a player in a long building session from+// being re-prompted to sign in every ~8 minutes.+//+// Responses (200 unless the request itself is malformed):+// { ok: true, wallet, balance, mint, symbol, decimals, playPass, expiresAt }+// { ok: false, reason: 'balance_too_low', wallet, balance, mint, symbol,+// minBalance, acquireUrl }+// Hard errors the client routes on:+// 400 gate_disabled — no game token pinned (client shouldn't have called us)+// 401 pass_invalid — missing/expired/forged pass → fall back to a full sign-in+// 502 balance_unavailable — RPC/price feed down+import { z } from 'zod';+import { cors, error, json, method, readJson, wrap } from '../_lib/http.js';+import { clientIp, limits } from '../_lib/rate-limit.js';+import { getBalances } from '../_lib/balances.js';+import { verifyPlayPass, signPlayPass, PLAY_GATE_MINT, PLAY_GATE_MIN } from '../_lib/play-pass.js';++const SOL_MINT = 'So11111111111111111111111111111111111111112';++const schema = z.object({+ playPass: z.string().trim().min(16).max(4096),+});++export default wrap(async (req, res) => {+ if (cors(req, res, { methods: 'POST,OPTIONS', credentials: true })) return;+ if (!method(req, res, ['POST'])) return;+ res.setHeader('cache-control', 'no-store');++ const rl = await limits.authIp(clientIp(req));+ if (!rl.success) return error(res, 429, 'rate_limited', 'too many requests');++ if (!PLAY_GATE_MINT) {+ return error(res, 400, 'gate_disabled', 'the token gate is not active');+ }++ const parsed = schema.safeParse(await readJson(req).catch(() => null));+ if (!parsed.success) return error(res, 400, 'validation_error', 'playPass is required');++ // 1) The pass must still be a valid, unexpired credential we issued for this+ // gate's token. An expired or forged pass can't be renewed silently — the+ // client falls back to a fresh signed sign-in.+ const pass = verifyPlayPass(parsed.data.playPass);+ if (!pass || pass.mint !== PLAY_GATE_MINT) {+ return error(res, 401, 'pass_invalid', 'sign-in expired — please sign in again');+ }+ const address = pass.wallet;++ // 2) Re-read the proven wallet's on-chain balance so a wallet that offloaded+ // its tokens is refused here rather than riding a renewed pass.+ let balances;+ try {+ balances = await getBalances({ chain: 'solana', address });+ } catch (err) {+ const status = err?.status === 503 ? 503 : 502;+ return error(res, status, 'balance_unavailable', err?.message || 'could not read on-chain balance');+ }++ const holding =+ PLAY_GATE_MINT === SOL_MINT+ ? balances?.native+ : (balances?.tokens ?? []).find((t) => t.mint === PLAY_GATE_MINT);+ const balance = Math.round((holding?.amount || 0) * 1e6) / 1e6;+ const symbol = holding?.symbol || (PLAY_GATE_MINT === SOL_MINT ? 'SOL' : '$THREE');+ const decimals = holding?.decimals ?? null;+ const minBalance = PLAY_GATE_MIN;++ // 3) Gate on the floor, exactly as /verify does — a wallet still over it gets a+ // fresh pass; one that dropped below gets an honest, actionable refusal.+ if (balance >= minBalance) {+ const playPass = signPlayPass({ wallet: address, mint: PLAY_GATE_MINT, balance });+ return json(res, 200, {+ data: { ok: true, wallet: address, balance, mint: PLAY_GATE_MINT, symbol, decimals, playPass, expiresAt: new Date(Date.now() + 10 * 60 * 1000).toISOString() },+ });+ }++ const acquireUrl = PLAY_GATE_MINT === SOL_MINT+ ? 'https://jup.ag/onramp'+ : `https://jup.ag/swap/SOL-${PLAY_GATE_MINT}`;++ return json(res, 200, {+ data: { ok: false, reason: 'balance_too_low', wallet: address, balance, mint: PLAY_GATE_MINT, symbol, minBalance, acquireUrl },+ });+});diff --git a/api/three-token/[action].js b/api/three-token/[action].jsindex de156ef75..ab25482cb 100644--- a/api/three-token/[action].js+++ b/api/three-token/[action].js@@ -33,16 +33,18 @@ const _cache = new Map();// price panel is not.const STALE_MAX_MS = 5 * 60_000;-// One warn per URL per cooldown so a sustained Birdeye 429 can't itself flood the+// One warn per key per cooldown so a sustained Birdeye 429 can't itself flood the// logs (the very failure mode brief 09 is about).-const _staleWarnedAt = new Map();+const _warnedAt = new Map();const STALE_WARN_COOLDOWN_MS = 60_000;-function warnStaleOnce(url, status) {- const last = _staleWarnedAt.get(url) || 0;+function warnThrottled(key, msg) {const now = Date.now();- if (now - last < STALE_WARN_COOLDOWN_MS) return;- _staleWarnedAt.set(url, now);- console.warn(`[three-token] birdeye ${status} — serving last good value (stale) for ${url.split('?')[0]}`);+ if (now - (_warnedAt.get(key) || 0) < STALE_WARN_COOLDOWN_MS) return;+ _warnedAt.set(key, now);+ console.warn(msg);+}+function warnStaleOnce(url, status) {+ warnThrottled(url, `[three-token] birdeye ${status} — serving last good value (stale) for ${url.split('?')[0]}`);}async function cachedFetch(url, headers, ttlMs = 30_000) {@@ -85,17 +87,32 @@ async function cachedFetch(url, headers, ttlMs = 30_000) {async function fetchTokenOverview(apiKey) {const headers = { 'X-API-KEY': apiKey, accept: 'application/json' };- const [priceResp, securityResp] = await Promise.all([- cachedFetch(`${BIRDEYE_BASE}/defi/price?address=${THREE_MINT}`, headers),- cachedFetch(`${BIRDEYE_BASE}/defi/token_overview?address=${THREE_MINT}`, headers, 60_000),- ]);+ // token_overview already carries price + 24h change alongside market cap,+ // volume, holders, liquidity and supply — so one call covers everything the+ // stats panel needs. We deliberately do NOT also hit /defi/price: a second+ // request per stats load only doubles pressure on the shared, rate-limited+ // Birdeye key (the source of the 429s).+ const resp = await cachedFetch(`${BIRDEYE_BASE}/defi/token_overview?address=${THREE_MINT}`, headers, 60_000);+ const ov = resp?.data ?? null;return {- price: priceResp?.data?.value ?? null,- priceChange24h: priceResp?.data?.priceChange24h ?? null,- overview: securityResp?.data ?? null,+ price: ov?.price ?? null,+ priceChange24h: ov?.priceChange24hPercent ?? null,+ overview: ov,};}+// Birdeye 429/5xx on a cold cache (no last-good value to fall back to) is an+// upstream throttle, not a bug on our side — warn (throttled) instead of+// error-spamming. A genuine client/auth error (4xx other than 429) still logs.+function logBirdeyeFailure(err) {+ const status = Number(/Birdeye (\d+)/.exec(err?.message || '')?.[1] || 0);+ if (status === 429 || status >= 500) {+ warnThrottled('birdeye-cold', `[three-token] birdeye ${status} (cold cache) — price temporarily unavailable`);+ return;+ }+ console.error('[three-token] birdeye error:', err?.message);+}+async function fetchPlatformMetrics() {const [agentCount, revenueData, paymentCount] = await Promise.all([sql`SELECT count(*)::int AS total FROM agent_identities WHERE deleted_at IS NULL`.catch(@@ -166,7 +183,7 @@ export default wrap(async (req, res) => {const [tokenData, platform] = await Promise.all([apiKey? fetchTokenOverview(apiKey).catch((err) => {- console.error('[three-token] birdeye error:', err.message);+ logBirdeyeFailure(err);return { price: null, priceChange24h: null, overview: null };}): { price: null, priceChange24h: null, overview: null },@@ -175,27 +192,35 @@ export default wrap(async (req, res) => {const ov = tokenData.overview || {};- return json(res, 200, {- token: {- mint: THREE_MINT,- symbol: '$THREE',- price_usd: tokenData.price,- price_change_24h: tokenData.priceChange24h,- market_cap: ov.mc ?? ov.marketCap ?? null,- volume_24h: ov.v24hUSD ?? ov.volume24h ?? null,- holders: ov.holder ?? ov.uniqueWallet30m ?? null,- liquidity: ov.liquidity ?? null,- supply: ov.supply ?? null,- decimals: ov.decimals ?? 6,+ return json(+ res,+ 200,+ {+ token: {+ mint: THREE_MINT,+ symbol: '$THREE',+ price_usd: tokenData.price,+ price_change_24h: tokenData.priceChange24h,+ market_cap: ov.mc ?? ov.marketCap ?? null,+ volume_24h: ov.v24hUSD ?? ov.volume24h ?? null,+ holders: ov.holder ?? ov.uniqueWallet30m ?? null,+ liquidity: ov.liquidity ?? null,+ supply: ov.supply ?? null,+ decimals: ov.decimals ?? 6,+ },+ protocol: {+ total_agents: platform.total_agents,+ total_revenue_usd: platform.total_revenue_gross / 1_000_000,+ total_payments: platform.total_payments,+ revenue_share_pool_pct: REVENUE_SHARE_POOL_PCT,+ agent_deploy_burn: AGENT_DEPLOY_BURN,+ },},- protocol: {- total_agents: platform.total_agents,- total_revenue_usd: platform.total_revenue_gross / 1_000_000,- total_payments: platform.total_payments,- revenue_share_pool_pct: REVENUE_SHARE_POOL_PCT,- agent_deploy_burn: AGENT_DEPLOY_BURN,- },- });+ // Edge-cache the public stats at the CDN so most page loads never reach+ // the lambda (or Birdeye). 20s freshness is invisible for a token price;+ // stale-while-revalidate keeps the panel populated during a refresh.+ { 'cache-control': 'public, s-maxage=20, stale-while-revalidate=120' },+ );}if (action === 'revenue-share') {diff --git a/chat/index.html b/chat/index.htmlindex e4608053c..6766e9fbe 100644--- a/chat/index.html+++ b/chat/index.html@@ -6,7 +6,11 @@<link rel="icon" type="image/png" href="/chat/ios/180.png" /><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"><link rel="manifest" href="/chat/manifest.json">- <meta name="theme-color" content="#FFFFFF"/>+ <meta name="theme-color" content="#0A0A0A"/>+ <style>+ /* Dark canvas before the app stylesheet loads — avoids a white flash. */+ html, body { background: #0A0A0A; color: #ECEAE3; }+ </style><meta name="description" content="Chat with any AI model — Claude, GPT, Gemini, Ollama and more. Powered by three.ws." />diff --git a/chat/public/manifest.json b/chat/public/manifest.jsonindex a1e8a21cf..8612e1143 100644--- a/chat/public/manifest.json+++ b/chat/public/manifest.json@@ -3,8 +3,8 @@"short_name": "three.ws chat","start_url": "/chat/","display": "standalone",- "background_color": "#ffffff",- "theme_color": "#ffffff",+ "background_color": "#0A0A0A",+ "theme_color": "#0A0A0A","description": "A simple, lightweight, and open LLM playground.","icons": [{diff --git a/chat/src/App.svelte b/chat/src/App.svelteindex ef2b09ccf..9610ec69c 100644--- a/chat/src/App.svelte+++ b/chat/src/App.svelte@@ -2199,7 +2199,7 @@<ResourcePage slug={$route.slice('resources/'.length)} /></div>{:else if $route === 'dashboard/revenue'}- <div class="min-h-dvh bg-[#F5F4EF]">+ <div class="min-h-dvh bg-paper"><div class="sticky top-0 z-[110]"><TopNav /></div><RevenueDashboard /></div>@@ -2269,13 +2269,13 @@tabindex="-1"on:click={() => (exportOpen = false)}/>- <div class="absolute right-0 top-full mt-1 z-30 w-48 rounded-xl border border-[#E5E3DC] bg-white p-1 shadow-pop">+ <div class="absolute right-0 top-full mt-1 z-30 w-48 rounded-xl border border-rule bg-white p-1 shadow-pop"><button- class="flex h-9 w-full items-center rounded-lg px-3 text-sm font-medium text-[#1A1A1A] hover:bg-[#F5F4EF]"+ class="flex h-9 w-full items-center rounded-lg px-3 text-sm font-medium text-ink hover:bg-paper"on:click={exportConvoAsMarkdown}>Export as Markdown</button><button- class="flex h-9 w-full items-center rounded-lg px-3 text-sm font-medium text-[#1A1A1A] hover:bg-[#F5F4EF]"+ class="flex h-9 w-full items-center rounded-lg px-3 text-sm font-medium text-ink hover:bg-paper"on:click={exportConvoAsJSON}>Export as JSON</button></div>@@ -2526,13 +2526,13 @@tabindex="-1"on:click={() => (exportOpen = false)}/>- <div class="absolute right-0 top-full mt-1 z-30 w-48 rounded-xl border border-[#E5E3DC] bg-white p-1 shadow-pop">+ <div class="absolute right-0 top-full mt-1 z-30 w-48 rounded-xl border border-rule bg-white p-1 shadow-pop"><button- class="flex h-9 w-full items-center rounded-lg px-3 text-sm font-medium text-[#1A1A1A] hover:bg-[#F5F4EF]"+ class="flex h-9 w-full items-center rounded-lg px-3 text-sm font-medium text-ink hover:bg-paper"on:click={exportConvoAsMarkdown}>Export as Markdown</button><button- class="flex h-9 w-full items-center rounded-lg px-3 text-sm font-medium text-[#1A1A1A] hover:bg-[#F5F4EF]"+ class="flex h-9 w-full items-center rounded-lg px-3 text-sm font-medium text-ink hover:bg-paper"on:click={exportConvoAsJSON}>Export as JSON</button></div>@@ -2862,12 +2862,12 @@}:global(.markdown.prose :where(a):not(:where([class~='not-prose'], [class~='not-prose'] *))) {- color: #1A1A1A;+ color: #ECEAE3;}:global(.markdown.prose :where(pre):not(:where([class~='not-prose'], [class~='not-prose'] *))) {- background-color: #EBE8E0;- border-color: #E5E3DC;+ background-color: #1C1C1C;+ border-color: #2A2A2A;}.avatar-floater {@@ -2909,8 +2909,8 @@margin-bottom: 14px;padding: 10px 14px 12px;border-radius: 18px;- background: #ffffff;- border: 1px solid #E5E3DC;+ background: #141414;+ border: 1px solid #2A2A2A;box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);font-family: 'Inter', system-ui, sans-serif;animation: thought-bubble-pop 220ms ease-out;@@ -2929,7 +2929,7 @@margin-bottom: 6px;font-size: 11px;font-weight: 600;- color: #9C9A93;+ color: #6B6B6B;text-transform: uppercase;letter-spacing: 0.04em;}@@ -2945,11 +2945,11 @@width: 6px;height: 6px;border-radius: 50%;- background: #6366F1;+ background: #818CF8;animation: thought-bubble-pulse 1.2s ease-in-out infinite;}.thought-bubble-dot.idle {- background: #C7C4BB;+ background: #3A3A3A;animation: none;}@@ -2963,20 +2963,20 @@overflow-y: auto;font-size: 12px;line-height: 1.5;- color: #4B4A45;+ color: #C9C7C0;white-space: pre-wrap;word-break: break-word;scrollbar-width: thin;- scrollbar-color: #D4D2CA transparent;+ scrollbar-color: #3A3A3A transparent;mask-image: linear-gradient(to bottom, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);-webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);}.thought-bubble-body::-webkit-scrollbar { width: 4px; }- .thought-bubble-body::-webkit-scrollbar-thumb { background: #D4D2CA; border-radius: 2px; }+ .thought-bubble-body::-webkit-scrollbar-thumb { background: #3A3A3A; border-radius: 2px; }.thought-bubble-placeholder {- color: #9C9A93;+ color: #6B6B6B;font-style: italic;}@@ -2984,8 +2984,8 @@position: absolute;right: 28px;border-radius: 50%;- background: #ffffff;- border: 1px solid #E5E3DC;+ background: #141414;+ border: 1px solid #2A2A2A;box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);}.thought-bubble-tail-1 {@@ -3003,53 +3003,8 @@visibility: visible;opacity: 1;}- :global(.h-footer-horizon) {- background: #F5F4EF !important;- color: #1A1A1A !important;- border-top: 1px solid #E5E3DC !important;- }- :global(.h-footer-horizon .h-footer-glow-line, .h-footer-horizon .h-footer-floor, .h-footer-horizon .h-footer-haze, .h-footer-horizon .h-footer-watermark) {- display: none;- }- :global(.h-footer-links a) {- color: rgba(0,0,0,0.65) !important;- }- :global(.h-footer-links a:hover) {- color: #000 !important;- text-shadow: none !important;- }- :global(.h-footer-link-heading) {- color: rgba(0,0,0,0.45) !important;- }- :global(.h-footer-brand) {- color: #000 !important;- }- :global(.h-footer-brand .wordmark-dot) {- background: #000 !important;- box-shadow: none !important;- }- :global(.h-footer-tagline) {- color: rgba(0,0,0,0.55) !important;- }- :global(.h-footer-legal) {- color: rgba(0,0,0,0.52) !important;- }- :global(.h-footer-legal-links a) {- color: rgba(0,0,0,0.65) !important;- }- :global(.h-footer-social) {- color: rgba(0,0,0,0.65) !important;- background: rgba(0,0,0,0.03) !important;- border-color: rgba(0,0,0,0.06) !important;- }- :global(.h-footer-social:hover) {- color: #000 !important;- background: rgba(0,0,0,0.08) !important;- border-color: rgba(0,0,0,0.18) !important;- }- :global(.h-footer-bottom) {- border-top: 1px solid rgba(0,0,0,0.06) !important;- }+ /* The chat canvas is dark, so let the shared (dark) footer.css show through+ unchanged — only keep the layout spacing tweak. */:global(.h-footer-inner) {margin-bottom: 2rem;}diff --git a/chat/src/Input.svelte b/chat/src/Input.svelteindex ff573df3a..9bc6c385b 100644--- a/chat/src/Input.svelte+++ b/chat/src/Input.svelte@@ -544,9 +544,9 @@ ${file.contents}<Icon icon={feChevronDown} class="w-3 h-3" /></button>{#if platformsOpen}- <div class="absolute left-0 bottom-full mb-2 bg-white border border-[#E5E3DC] rounded-xl shadow-pop z-10 min-w-[160px] py-1">+ <div class="absolute left-0 bottom-full mb-2 bg-white border border-rule rounded-xl shadow-pop z-10 min-w-[160px] py-1">{#each desktopPlatformOptions as p}- <label class="flex items-center gap-2 w-full px-3 py-1.5 text-sm text-[#1A1A1A] hover:bg-[#F5F4EF] cursor-pointer">+ <label class="flex items-center gap-2 w-full px-3 py-1.5 text-sm text-ink hover:bg-paper cursor-pointer"><inputtype="checkbox"class="accent-blue-500"@@ -588,10 +588,10 @@ ${file.contents}<Icon icon={feChevronDown} class="w-3 h-3" /></button>{#if toneOpen}- <div class="absolute left-0 bottom-full mb-2 bg-white border border-[#E5E3DC] rounded-xl shadow-pop z-10 min-w-[140px]">+ <div class="absolute left-0 bottom-full mb-2 bg-white border border-rule rounded-xl shadow-pop z-10 min-w-[140px]">{#each tones as tone}<button- class="block w-full px-4 py-2 text-sm text-left text-[#1A1A1A] hover:bg-[#F5F4EF] first:rounded-t-xl last:rounded-b-xl"+ class="block w-full px-4 py-2 text-sm text-left text-ink hover:bg-paper first:rounded-t-xl last:rounded-b-xl"on:click={() => { selectedTone = tone; toneOpen = false; }}>{tone}@@ -602,20 +602,20 @@ ${file.contents}</div><div class="relative"><button- class="rounded-full bg-white border border-[#E5E3DC] h-7 px-2 inline-flex items-center gap-1 hover:bg-[#F5F4EF] transition-colors"+ class="rounded-full bg-white border border-rule h-7 px-2 inline-flex items-center gap-1 hover:bg-paper transition-colors"on:click={() => { imgModelOpen = !imgModelOpen; toneOpen = false; }}><span class="w-[18px] h-[18px] rounded-full bg-black shrink-0 inline-block"></span><span class="text-base leading-none">🍌</span>- <Icon icon={feChevronDown} class="w-3 h-3 text-[#6B6B6B]" />+ <Icon icon={feChevronDown} class="w-3 h-3 text-ink-soft" /></button>{#if imgModelOpen}- <div class="absolute left-0 bottom-full mb-2 bg-white border border-[#E5E3DC] rounded-xl shadow-pop z-10 min-w-[140px]">- <button class="flex items-center gap-2 w-full px-3 py-2 text-sm text-left text-[#1A1A1A] hover:bg-[#F5F4EF] rounded-t-xl">+ <div class="absolute left-0 bottom-full mb-2 bg-white border border-rule rounded-xl shadow-pop z-10 min-w-[140px]">+ <button class="flex items-center gap-2 w-full px-3 py-2 text-sm text-left text-ink hover:bg-paper rounded-t-xl"><span class="w-[18px] h-[18px] rounded-full bg-black shrink-0 inline-block"></span>OpenAI</button>- <button class="flex items-center gap-2 w-full px-3 py-2 text-sm text-left text-[#1A1A1A] hover:bg-[#F5F4EF] rounded-b-xl">+ <button class="flex items-center gap-2 w-full px-3 py-2 text-sm text-left text-ink hover:bg-paper rounded-b-xl"><span class="text-base leading-none shrink-0">🍌</span>Banana</button>@@ -633,12 +633,12 @@ ${file.contents}</button><div class="relative"><button- class="inline-flex items-center gap-2 h-8 px-2 pr-1 rounded-full border border-[#E5E3DC] bg-white text-sm hover:bg-[#F5F4EF] transition-colors"+ class="inline-flex items-center gap-2 h-8 px-2 pr-1 rounded-full border border-rule bg-white text-sm hover:bg-paper transition-colors"on:click={() => (designModelPickerOpen = !designModelPickerOpen)}><span class="w-4 h-4 rounded-full bg-gray-900 shrink-0 inline-block"></span><span>{DESIGN_MODEL_LABELS[$designModel] ?? $designModel}</span>- <Icon icon={feChevronDown} class="w-3.5 h-3.5 text-[#6B6B6B]" />+ <Icon icon={feChevronDown} class="w-3.5 h-3.5 text-ink-soft" /></button>{#if designModelPickerOpen}<DesignModelPicker on:close={() => (designModelPickerOpen = false)} />@@ -671,10 +671,10 @@ ${file.contents}tabindex="-1"on:click={() => (secondaryOpen = null)}/>- <div class="absolute left-0 bottom-full mb-2 bg-white border border-[#E5E3DC] rounded-xl shadow-pop z-30 min-w-[160px] py-1">+ <div class="absolute left-0 bottom-full mb-2 bg-white border border-rule rounded-xl shadow-pop z-30 min-w-[160px] py-1">{#each sec.options as opt}<button- class="block w-full px-4 py-2 text-sm text-left text-[#1A1A1A] hover:bg-[#F5F4EF] {currentVal === opt ? 'font-medium' : ''} first:rounded-t-xl last:rounded-b-xl"+ class="block w-full px-4 py-2 text-sm text-left text-ink hover:bg-paper {currentVal === opt ? 'font-medium' : ''} first:rounded-t-xl last:rounded-b-xl"on:click={() => { $flowSecondary = { ...$flowSecondary, [$mode]: opt }; secondaryOpen = null; }}>{opt}diff --git a/chat/src/Message.svelte b/chat/src/Message.svelteindex 9c83b6453..3c2094e4e 100644--- a/chat/src/Message.svelte+++ b/chat/src/Message.svelte@@ -106,7 +106,7 @@return name?.split(' ').slice(0, 2).map(w => w[0]).join('').toUpperCase() || '?';}- const COLORS = ['#6366f1','#ec4899','#f59e0b','#10b981','#3b82f6','#8b5cf6','#ef4444'];+ const COLORS = ['#818CF8','#ec4899','#f59e0b','#10b981','#3b82f6','#8b5cf6','#ef4444'];function color(id) {let h = 0;for (let i = 0; i < (id?.length ?? 0); i++) h = (h * 31 + id.charCodeAt(i)) >>> 0;@@ -220,7 +220,7 @@{/if}<divclass="{message.role === 'user'- ? 'bg-[#EBE8E0] text-[#1A1A1A] rounded-2xl px-4 py-3 max-w-[78%] relative'+ ? 'bg-paper-deep text-ink rounded-2xl px-4 py-3 max-w-[78%] relative': 'relative flex w-full gap-x-3.5 items-end'}">{#if message.role !== 'user'}@@ -374,7 +374,7 @@<divclass="{generating? 'animate-pulse'- : ''} flex items-center gap-x-1.5 self-start rounded-full bg-paper-deep px-3.5 py-2 text-left text-xs text-[#9C9A93] transition-colors hover:bg-[#E0DDD5]"+ : ''} flex items-center gap-x-1.5 self-start rounded-full bg-paper-deep px-3.5 py-2 text-left text-xs text-ink-faint transition-colors hover:bg-paper-deep">{generating ? 'Searching' : 'Searched'} the web</div>@@ -383,7 +383,7 @@<buttonclass="{message.thinking? 'animate-pulse'- : ''} flex items-center gap-x-1.5 self-start rounded-full bg-paper-deep px-3.5 py-2 text-left text-xs text-[#9C9A93] transition-colors hover:bg-[#E0DDD5]"+ : ''} flex items-center gap-x-1.5 self-start rounded-full bg-paper-deep px-3.5 py-2 text-left text-xs text-ink-faint transition-colors hover:bg-paper-deep"on:click={() => {message.thoughtsExpanded = !message.thoughtsExpanded;saveMessage(message);@@ -399,7 +399,7 @@icon={feChevronDown}class="{message.thoughtsExpanded? 'rotate-180'- : ''} h-4 w-4 text-[#9C9A93] transition-transform"+ : ''} h-4 w-4 text-ink-faint transition-transform"/>{/if}</button>@@ -415,7 +415,7 @@/>{#if contentHeight > 400}<button- class="sticky z-10 bottom-2 left-1/2 flex translate-x-[calc(-50%+40px)] items-center gap-x-1.5 self-start rounded-full bg-paper-deep px-3.5 py-2 text-left text-xs text-[#9C9A93] transition-colors hover:bg-[#E0DDD5]"+ class="sticky z-10 bottom-2 left-1/2 flex translate-x-[calc(-50%+40px)] items-center gap-x-1.5 self-start rounded-full bg-paper-deep px-3.5 py-2 text-left text-xs text-ink-faint transition-colors hover:bg-paper-deep"on:click={() => {message.thoughtsExpanded = !message.thoughtsExpanded;saveMessage(message);@@ -741,17 +741,17 @@width: 180px;padding: 8px 12px 10px;border-radius: 14px;- background: #ffffff;- border: 1px solid #E5E3DC;+ background: #141414;+ border: 1px solid #2A2A2A;box-shadow: 0 4px 16px rgba(0,0,0,0.07);font-size: 12px;line-height: 1.45;- color: #1A1A1A;+ color: #ECEAE3;animation: bubble-pop 200ms ease-out;}.avatar-bubble--thinking {- background: #F8F7F4;- color: #6B7280;+ background: #1C1C1C;+ color: #9A988F;}.avatar-bubble-tail {position: absolute;@@ -760,12 +760,12 @@transform: translateX(-50%) rotate(45deg);width: 10px;height: 10px;- background: #ffffff;- border-right: 1px solid #E5E3DC;- border-bottom: 1px solid #E5E3DC;+ background: #141414;+ border-right: 1px solid #2A2A2A;+ border-bottom: 1px solid #2A2A2A;}.avatar-bubble--thinking .avatar-bubble-tail {- background: #F8F7F4;+ background: #1C1C1C;}@keyframes bubble-pop {from { opacity: 0; transform: translateY(4px) scale(0.97); }diff --git a/chat/src/MessageContent.svelte b/chat/src/MessageContent.svelteindex 4250baa9b..0ee4deaa2 100644--- a/chat/src/MessageContent.svelte+++ b/chat/src/MessageContent.svelte@@ -13,7 +13,7 @@{:else if message.content}<divbind:clientHeight={contentHeight}- class="markdown prose prose-slate flex w-full max-w-none flex-col break-words prose-h1:font-semibold prose-h2:font-semibold prose-h3:font-semibold prose-h4:font-semibold prose-h1:!my-2 prose-h1:text-[22px] prose-h2:!my-1.5 prose-h2:text-xl prose-h3:!my-1.5 prose-h3:text-lg prose-p:whitespace-pre-wrap prose-p:text-slate-800 prose-a:[overflow-wrap:anywhere] prose-code:[overflow-wrap:anywhere] prose-pre:mb-4 prose-pre:mt-0 prose-pre:whitespace-pre-wrap prose-pre:rounded-lg prose-pre:rounded-t-none prose-pre:border-t-0 prose-pre:border prose-pre:border-slate-200 prose-pre:bg-white prose-pre:text-slate-800 prose-pre:[overflow-wrap:anywhere] prose-ul:my-0 prose-img:mb-2"+ class="markdown prose prose-slate prose-invert flex w-full max-w-none flex-col break-words prose-h1:font-semibold prose-h2:font-semibold prose-h3:font-semibold prose-h4:font-semibold prose-h1:!my-2 prose-h1:text-[22px] prose-h2:!my-1.5 prose-h2:text-xl prose-h3:!my-1.5 prose-h3:text-lg prose-p:whitespace-pre-wrap prose-p:text-slate-800 prose-a:[overflow-wrap:anywhere] prose-code:[overflow-wrap:anywhere] prose-pre:mb-4 prose-pre:mt-0 prose-pre:whitespace-pre-wrap prose-pre:rounded-lg prose-pre:rounded-t-none prose-pre:border-t-0 prose-pre:border prose-pre:border-slate-200 prose-pre:bg-white prose-pre:text-slate-800 prose-pre:[overflow-wrap:anywhere] prose-ul:my-0 prose-img:mb-2">{#if message.contentParts}{#each message.contentParts as part}diff --git a/chat/src/SkillsMarketplaceModal.svelte b/chat/src/SkillsMarketplaceModal.svelteindex 76c08ee0b..ae8d8ff13 100644--- a/chat/src/SkillsMarketplaceModal.svelte+++ b/chat/src/SkillsMarketplaceModal.svelte@@ -1018,7 +1018,7 @@<!-- Markdown content (knowledge skills) -->{#if isContentSkill(detail) && typeof detail.content === 'string' && detail.content.length > 0}<div class="mt-4 max-h-[420px] overflow-y-auto rounded border border-slate-100 bg-slate-50/50 p-3">- <div class="markdown prose prose-sm prose-slate max-w-none break-words prose-pre:whitespace-pre-wrap prose-pre:rounded-md prose-pre:border prose-pre:border-slate-200 prose-pre:bg-white">+ <div class="markdown prose prose-sm prose-slate prose-invert max-w-none break-words prose-pre:whitespace-pre-wrap prose-pre:rounded-md prose-pre:border prose-pre:border-slate-200 prose-pre:bg-white"><Markdown source={detail.content} /></div></div>diff --git a/chat/src/svelte-json-view/JsonView.svelte b/chat/src/svelte-json-view/JsonView.svelteindex 9356f06ed..9b7b98ca9 100644--- a/chat/src/svelte-json-view/JsonView.svelte+++ b/chat/src/svelte-json-view/JsonView.svelte@@ -122,7 +122,7 @@}:where(._jsonBkt):not(.empty):hover {cursor: pointer;- background: var(--jsonBracketHoverBackground, #e5e7eb);+ background: var(--jsonBracketHoverBackground, rgba(255,255,255,0.08));}:where(._jsonSep) {color: var(--jsonSeparatorColor, currentcolor);@@ -134,12 +134,12 @@color: var(--jsonValColor, #9ca3af);}:where(._jsonVal).string {- color: var(--jsonValStringColor, #059669);+ color: var(--jsonValStringColor, #34d399);}:where(._jsonVal).number {- color: var(--jsonValNumberColor, #d97706);+ color: var(--jsonValNumberColor, #fbbf24);}:where(._jsonVal).boolean {- color: var(--jsonValBooleanColor, #2563eb);+ color: var(--jsonValBooleanColor, #60a5fa);}</style>diff --git a/chat/src/three-ui/AnnouncementBanner.svelte b/chat/src/three-ui/AnnouncementBanner.svelteindex 870cbf8fc..01938d58e 100644--- a/chat/src/three-ui/AnnouncementBanner.svelte+++ b/chat/src/three-ui/AnnouncementBanner.svelte@@ -9,13 +9,13 @@</script>{#if !$dismissed}- <div class="relative w-full bg-[#EBE8E0] text-[#1A1A1A]">+ <div class="relative w-full bg-paper-deep text-ink"><a {href} class="flex items-center justify-center gap-2 h-10 text-sm font-medium hover:opacity-80"><span>{message}</span><Icon icon={feArrowRight} class="h-4 w-4 shrink-0" /></a><button- class="absolute right-3 top-1/2 -translate-y-1/2 p-1 text-[#6B6B6B] hover:text-[#1A1A1A]"+ class="absolute right-3 top-1/2 -translate-y-1/2 p-1 text-ink-soft hover:text-ink"on:click={() => ($dismissed = true)}aria-label="Dismiss announcement"><Icon icon={feX} class="h-4 w-4" />diff --git a/chat/src/three-ui/Composer.svelte b/chat/src/three-ui/Composer.svelteindex 7c19ecbf8..488467ea6 100644--- a/chat/src/three-ui/Composer.svelte+++ b/chat/src/three-ui/Composer.svelte@@ -310,7 +310,7 @@<div class="mx-auto flex w-full max-w-[760px] flex-col"><!-- Composer card --><div- class="bg-white border border-[#E5E3DC] rounded-[20px] shadow-composer pt-5 px-5 pb-3"+ class="bg-white border border-rule rounded-[20px] shadow-composer pt-5 px-5 pb-3"style="min-height:140px"><!-- Textarea -->@@ -319,7 +319,7 @@bind:value={content}{placeholder}rows={1}- class="w-full resize-none bg-transparent border-0 p-0 outline-none ring-0 focus:outline-none focus:ring-0 text-base text-[#1A1A1A] placeholder-[#9C9A93] font-sans overflow-y-auto scrollbar-ultraslim"+ class="w-full resize-none bg-transparent border-0 p-0 outline-none ring-0 focus:outline-none focus:ring-0 text-base text-ink placeholder-ink-faint font-sans overflow-y-auto scrollbar-ultraslim"style="max-height:320px;"on:paste={handlePaste}on:keydown={(event) => {@@ -366,7 +366,7 @@<imgsrc={image.url}alt=""- class="h-16 w-16 rounded-lg border border-[#E5E3DC] object-cover"+ class="h-16 w-16 rounded-lg border border-rule object-cover"/><buttonon:click={() => {@@ -403,7 +403,7 @@<div class="flex items-center gap-2 min-w-0"><!-- "+" attach button --><button- class="flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-[#E5E3DC] bg-white text-[#1A1A1A] hover:bg-[#F0EEE6] transition-colors text-xl leading-none"+ class="flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-rule bg-white text-ink hover:bg-paper-deep transition-colors text-xl leading-none"on:click={() => fileInputEl.click()}title="Attach files">@@ -420,14 +420,14 @@<!-- Selected mode pill -->{#if mode}<div- class="flex shrink-0 items-center gap-1 rounded-full border border-[#E5E3DC] bg-[#F5F4EF] px-3 py-1 text-xs text-[#1A1A1A]"+ class="flex shrink-0 items-center gap-1 rounded-full border border-rule bg-paper px-3 py-1 text-xs text-ink">{#if modes.find((m) => m.id === mode)?.icon}<Icon icon={modes.find((m) => m.id === mode).icon} class="h-3 w-3" />{/if}<span>{modes.find((m) => m.id === mode)?.label ?? mode}</span><button- class="ml-0.5 flex h-3.5 w-3.5 items-center justify-center rounded-full hover:bg-[#E5E3DC] transition-colors"+ class="ml-0.5 flex h-3.5 w-3.5 items-center justify-center rounded-full hover:bg-rule transition-colors"on:click={onModeClear}><Icon icon={feX} class="h-2.5 w-2.5" />@@ -573,13 +573,13 @@title={recording ? 'Stop recording' : 'Speak a message'}on:click={toggleVoiceInput}class="flex h-9 w-9 items-center justify-center rounded-full transition-colors- {recording ? 'bg-red-500 text-white animate-pulse' : 'text-[#9C9A93] hover:text-[#1A1A1A]'}"+ {recording ? 'bg-red-500 text-white animate-pulse' : 'text-ink-faint hover:text-ink'}"><Icon icon={recording ? feMicOff : feMic} class="h-4 w-4" /></button>{#if isGenerating}<button- class="flex h-9 w-9 items-center justify-center rounded-full bg-[#1A1A1A] transition-colors hover:bg-[#333]"+ class="flex h-9 w-9 items-center justify-center rounded-full bg-ink transition-colors hover:bg-[#333]"on:click={handleAbort}title="Stop generating">@@ -590,7 +590,7 @@disabled={!canSend}class="flex h-9 w-9 items-center justify-center rounded-full transition-colors {canSend? 'bg-black text-white hover:bg-[#333] cursor-pointer'- : 'bg-[#E7E5DD] text-[#9C9A93] cursor-default'}"+ : 'bg-paper-deep text-ink-faint cursor-default'}"on:click={sendMessage}title="Send message">diff --git a/chat/src/three-ui/DesignModelPicker.svelte b/chat/src/three-ui/DesignModelPicker.svelteindex 54fd535c5..cec1c9b79 100644--- a/chat/src/three-ui/DesignModelPicker.svelte+++ b/chat/src/three-ui/DesignModelPicker.svelte@@ -32,10 +32,10 @@on:click={() => dispatch('close')}/>-<div class="absolute bottom-full mb-2 left-0 z-30 bg-white border border-[#E5E3DC] rounded-2xl shadow-pop p-2 w-[220px]">+<div class="absolute bottom-full mb-2 left-0 z-30 bg-white border border-rule rounded-2xl shadow-pop p-2 w-[220px]">{#each models as model}<button- class="flex items-center gap-3 w-full px-3 h-10 rounded-lg text-sm font-medium text-[#1A1A1A] hover:bg-[#F5F4EF]"+ class="flex items-center gap-3 w-full px-3 h-10 rounded-lg text-sm font-medium text-ink hover:bg-paper"on:click={() => pick(model)}><span class="w-5 h-5 shrink-0 flex items-center justify-center text-base leading-none">diff --git a/chat/src/three-ui/MoreDropdown.svelte b/chat/src/three-ui/MoreDropdown.svelteindex 159563de7..76b7def0e 100644--- a/chat/src/three-ui/MoreDropdown.svelte+++ b/chat/src/three-ui/MoreDropdown.svelte@@ -45,10 +45,10 @@/><!-- Dropdown card -->-<div class="absolute bottom-full mb-2 right-0 z-30 bg-white border border-[#E5E3DC] rounded-2xl shadow-pop p-2 w-[260px]">+<div class="absolute bottom-full mb-2 right-0 z-30 bg-white border border-rule rounded-2xl shadow-pop p-2 w-[260px]">{#each items as item}<button- class="flex items-center gap-3 w-full px-3 h-10 rounded-lg text-sm font-medium text-[#1A1A1A] hover:bg-[#F5F4EF]"+ class="flex items-center gap-3 w-full px-3 h-10 rounded-lg text-sm font-medium text-ink hover:bg-paper"on:click={() => pick(item)}><Icon icon={item.icon} class="h-4 w-4 shrink-0" />diff --git a/chat/src/three-ui/TopNav.svelte b/chat/src/three-ui/TopNav.svelteindex ef7ec0ac2..b903c39b0 100644--- a/chat/src/three-ui/TopNav.svelte+++ b/chat/src/three-ui/TopNav.svelte@@ -117,8 +117,8 @@<style>:global(.three-ui-card) {- background: #f5f4ef;- border: 1px solid #e5e3dc;+ background: #0A0A0A;+ border: 1px solid #2A2A2A;border-radius: 12px;}</style>diff --git a/chat/src/three-ui/dropdowns/BusinessDropdown.svelte b/chat/src/three-ui/dropdowns/BusinessDropdown.svelteindex 59f116b9a..6d61ec3a5 100644--- a/chat/src/three-ui/dropdowns/BusinessDropdown.svelte+++ b/chat/src/three-ui/dropdowns/BusinessDropdown.svelte@@ -12,17 +12,17 @@];</script>-<div class="bg-white border border-[#E5E3DC] rounded-2xl shadow-pop p-3 w-[420px]">+<div class="bg-white border border-rule rounded-2xl shadow-pop p-3 w-[420px]">{#each items as item}<button- class="flex items-start gap-3 w-full px-3 py-3 rounded-xl text-left hover:bg-[#F5F4EF]"+ class="flex items-start gap-3 w-full px-3 py-3 rounded-xl text-left hover:bg-paper"on:click={() => route.set(item.route)}>- <span class="w-9 h-9 rounded-lg bg-[#F5F4EF] flex items-center justify-center shrink-0">- <Icon icon={item.icon} class="w-[18px] h-[18px] text-[#1A1A1A]" />+ <span class="w-9 h-9 rounded-lg bg-paper flex items-center justify-center shrink-0">+ <Icon icon={item.icon} class="w-[18px] h-[18px] text-ink" /></span><span class="flex-1 min-w-0">- <span class="block text-sm font-semibold text-[#1A1A1A]">{item.title}</span>- <span class="block text-xs text-[#6B6B6B] mt-0.5">{item.subtitle}</span>+ <span class="block text-sm font-semibold text-ink">{item.title}</span>+ <span class="block text-xs text-ink-soft mt-0.5">{item.subtitle}</span></span></button>{/each}diff --git a/chat/src/three-ui/dropdowns/EventsDropdown.svelte b/chat/src/three-ui/dropdowns/EventsDropdown.svelteindex 8d055a33f..cdca57fe2 100644--- a/chat/src/three-ui/dropdowns/EventsDropdown.svelte+++ b/chat/src/three-ui/dropdowns/EventsDropdown.svelte@@ -12,17 +12,17 @@];</script>-<div class="bg-white border border-[#E5E3DC] rounded-2xl shadow-pop p-3 w-[420px]">+<div class="bg-white border border-rule rounded-2xl shadow-pop p-3 w-[420px]">{#each items as item}<button- class="flex items-start gap-3 w-full px-3 py-3 rounded-xl text-left hover:bg-[#F5F4EF]"+ class="flex items-start gap-3 w-full px-3 py-3 rounded-xl text-left hover:bg-paper"on:click={() => route.set(item.route)}>- <span class="w-9 h-9 rounded-lg bg-[#F5F4EF] flex items-center justify-center shrink-0">- <Icon icon={item.icon} class="w-[18px] h-[18px] text-[#1A1A1A]" />+ <span class="w-9 h-9 rounded-lg bg-paper flex items-center justify-center shrink-0">+ <Icon icon={item.icon} class="w-[18px] h-[18px] text-ink" /></span><span class="flex-1 min-w-0">- <span class="block text-sm font-semibold text-[#1A1A1A]">{item.title}</span>- <span class="block text-xs text-[#6B6B6B] mt-0.5">{item.subtitle}</span>+ <span class="block text-sm font-semibold text-ink">{item.title}</span>+ <span class="block text-xs text-ink-soft mt-0.5">{item.subtitle}</span></span></button>{/each}diff --git a/chat/src/three-ui/dropdowns/FeaturesDropdown.svelte b/chat/src/three-ui/dropdowns/FeaturesDropdown.svelteindex cbea1ac27..88188c0ab 100644--- a/chat/src/three-ui/dropdowns/FeaturesDropdown.svelte+++ b/chat/src/three-ui/dropdowns/FeaturesDropdown.svelte@@ -18,17 +18,17 @@];</script>-<div class="bg-white border border-[#E5E3DC] rounded-2xl shadow-pop p-3 w-[420px]">+<div class="bg-white border border-rule rounded-2xl shadow-pop p-3 w-[420px]">{#each items as item}<button- class="flex items-start gap-3 w-full px-3 py-3 rounded-xl text-left hover:bg-[#F5F4EF]"+ class="flex items-start gap-3 w-full px-3 py-3 rounded-xl text-left hover:bg-paper"on:click={() => route.set(item.route)}>- <span class="w-9 h-9 rounded-lg bg-[#F5F4EF] flex items-center justify-center shrink-0">- <Icon icon={item.icon} class="w-[18px] h-[18px] text-[#1A1A1A]" />+ <span class="w-9 h-9 rounded-lg bg-paper flex items-center justify-center shrink-0">+ <Icon icon={item.icon} class="w-[18px] h-[18px] text-ink" /></span><span class="flex-1 min-w-0">- <span class="block text-sm font-semibold text-[#1A1A1A]">{item.title}</span>- <span class="block text-xs text-[#6B6B6B] mt-0.5">{item.subtitle}</span>+ <span class="block text-sm font-semibold text-ink">{item.title}</span>+ <span class="block text-xs text-ink-soft mt-0.5">{item.subtitle}</span></span></button>{/each}diff --git a/chat/src/three-ui/dropdowns/ResourcesDropdown.svelte b/chat/src/three-ui/dropdowns/ResourcesDropdown.svelteindex 5cfb88baf..2915ea364 100644--- a/chat/src/three-ui/dropdowns/ResourcesDropdown.svelte+++ b/chat/src/three-ui/dropdowns/ResourcesDropdown.svelte@@ -14,17 +14,17 @@];</script>-<div class="bg-white border border-[#E5E3DC] rounded-2xl shadow-pop p-3 w-[420px]">+<div class="bg-white border border-rule rounded-2xl shadow-pop p-3 w-[420px]">{#each items as item}<button- class="flex items-start gap-3 w-full px-3 py-3 rounded-xl text-left hover:bg-[#F5F4EF]"+ class="flex items-start gap-3 w-full px-3 py-3 rounded-xl text-left hover:bg-paper"on:click={() => route.set(item.route)}>- <span class="w-9 h-9 rounded-lg bg-[#F5F4EF] flex items-center justify-center shrink-0">- <Icon icon={item.icon} class="w-[18px] h-[18px] text-[#1A1A1A]" />+ <span class="w-9 h-9 rounded-lg bg-paper flex items-center justify-center shrink-0">+ <Icon icon={item.icon} class="w-[18px] h-[18px] text-ink" /></span><span class="flex-1 min-w-0">- <span class="block text-sm font-semibold text-[#1A1A1A]">{item.title}</span>- <span class="block text-xs text-[#6B6B6B] mt-0.5">{item.subtitle}</span>+ <span class="block text-sm font-semibold text-ink">{item.title}</span>+ <span class="block text-xs text-ink-soft mt-0.5">{item.subtitle}</span></span></button>{/each}diff --git a/chat/src/three-ui/dropdowns/SolutionsDropdown.svelte b/chat/src/three-ui/dropdowns/SolutionsDropdown.svelteindex 1b05c9fc4..2ee5e1c3c 100644--- a/chat/src/three-ui/dropdowns/SolutionsDropdown.svelte+++ b/chat/src/three-ui/dropdowns/SolutionsDropdown.svelte@@ -18,18 +18,18 @@];</script>-<div class="bg-white border border-[#E5E3DC] rounded-2xl shadow-pop p-3 w-[420px]">+<div class="bg-white border border-rule rounded-2xl shadow-pop p-3 w-[420px]">{#each items as item}<button- class="flex items-start gap-3 w-full px-3 py-3 rounded-xl text-left hover:bg-[#F5F4EF]"+ class="flex items-start gap-3 w-full px-3 py-3 rounded-xl text-left hover:bg-paper"on:click={() => route.set(item.slug)}>- <span class="w-9 h-9 rounded-lg bg-[#F5F4EF] flex items-center justify-center shrink-0">- <Icon icon={item.icon} class="w-[18px] h-[18px] text-[#1A1A1A]" />+ <span class="w-9 h-9 rounded-lg bg-paper flex items-center justify-center shrink-0">+ <Icon icon={item.icon} class="w-[18px] h-[18px] text-ink" /></span><span class="flex-1 min-w-0">- <span class="block text-sm font-semibold text-[#1A1A1A]">{item.title}</span>- <span class="block text-xs text-[#6B6B6B] mt-0.5">{item.subtitle}</span>+ <span class="block text-sm font-semibold text-ink">{item.title}</span>+ <span class="block text-xs text-ink-soft mt-0.5">{item.subtitle}</span></span></button>{/each}diff --git a/chat/src/three-ui/flows/DesignFlow.svelte b/chat/src/three-ui/flows/DesignFlow.svelteindex 90f248b9d..c9335f8bf 100644--- a/chat/src/three-ui/flows/DesignFlow.svelte+++ b/chat/src/three-ui/flows/DesignFlow.svelte@@ -44,22 +44,22 @@</script><div class="w-full pb-12">- <p class="text-[#1A1A1A] font-medium mb-4 mt-10 max-w-[1100px] mx-auto px-6">Get started with</p>+ <p class="text-ink font-medium mb-4 mt-10 max-w-[1100px] mx-auto px-6">Get started with</p><div class="grid md:grid-cols-2 xl:grid-cols-3 gap-4 max-w-[1100px] mx-auto px-6">{#each cards as card}<button- class="bg-white border border-[#E5E3DC] rounded-2xl p-5 flex gap-4 hover:bg-[#F5F4EF] transition-colors text-left w-full"+ class="bg-white border border-rule rounded-2xl p-5 flex gap-4 hover:bg-paper transition-colors text-left w-full"on:click={() => selectCard(card.description)}><div class="flex-1 min-w-0">- <div class="flex items-center justify-between text-[#1A1A1A] font-semibold text-sm">+ <div class="flex items-center justify-between text-ink font-semibold text-sm"><span class="text-ellipsis overflow-hidden whitespace-nowrap mr-2">{card.title}</span>- <Icon icon={feChevronRight} class="h-4 w-4 shrink-0 text-[#9C9A93]" />+ <Icon icon={feChevronRight} class="h-4 w-4 shrink-0 text-ink-faint" /></div>- <p class="text-xs text-[#6B6B6B] mt-1.5 line-clamp-2">{card.description}</p>+ <p class="text-xs text-ink-soft mt-1.5 line-clamp-2">{card.description}</p></div>- <div class="w-24 h-24 shrink-0 rounded-lg bg-[#EFECE3] flex items-center justify-center">- <Icon icon={card.icon} class="h-8 w-8 text-[#9C9A93]" />+ <div class="w-24 h-24 shrink-0 rounded-lg bg-paper-deep flex items-center justify-center">+ <Icon icon={card.icon} class="h-8 w-8 text-ink-faint" /></div></button>{/each}diff --git a/chat/src/three-ui/flows/DesktopFlow.svelte b/chat/src/three-ui/flows/DesktopFlow.svelteindex ecc5a1d2c..62b1be821 100644--- a/chat/src/three-ui/flows/DesktopFlow.svelte+++ b/chat/src/three-ui/flows/DesktopFlow.svelte@@ -68,11 +68,11 @@<div class="grid md:grid-cols-2 lg:grid-cols-4 gap-3">{#each samplePrompts as prompt}<button- class="bg-white border border-[#E5E3DC] rounded-xl p-4 h-[112px] flex flex-col justify-between text-left hover:bg-[#F5F4EF] transition-colors"+ class="bg-white border border-rule rounded-xl p-4 h-[112px] flex flex-col justify-between text-left hover:bg-paper transition-colors"on:click={() => selectPrompt(prompt)}>- <span class="text-sm text-[#1A1A1A] leading-snug">{prompt}</span>- <Icon icon={feArrowUpLeft} size={14} class="text-[#9C9A93] self-end" />+ <span class="text-sm text-ink leading-snug">{prompt}</span>+ <Icon icon={feArrowUpLeft} size={14} class="text-ink-faint self-end" /></button>{/each}</div>@@ -97,7 +97,7 @@{#each ideas as idea}<button class="three-ui-chip" on:click={() => selectIdea(idea)}>{idea}- <Icon icon={feArrowUpLeft} size={14} class="text-[#9C9A93]" />+ <Icon icon={feArrowUpLeft} size={14} class="text-ink-faint" /></button>{/each}</div>diff --git a/chat/src/three-ui/flows/SamplePromptGrid.svelte b/chat/src/three-ui/flows/SamplePromptGrid.svelteindex 37c77eaa1..8fa630c11 100644--- a/chat/src/three-ui/flows/SamplePromptGrid.svelte+++ b/chat/src/three-ui/flows/SamplePromptGrid.svelte@@ -12,13 +12,13 @@<div class="grid md:grid-cols-2 lg:grid-cols-4 gap-3">{#each prompts as prompt}<button- class="relative bg-white border border-[#E5E3DC] rounded-xl p-4 h-[96px] text-left text-sm hover:bg-[#F5F4EF] transition-colors overflow-hidden"+ class="relative bg-white border border-rule rounded-xl p-4 h-[96px] text-left text-sm hover:bg-paper transition-colors overflow-hidden"on:click={() => composerFill.set({ text: prompt, submit: true })}><span class="line-clamp-3 block pr-5">{prompt}</span><Iconicon={feArrowUpLeft}- class="absolute bottom-3 right-3 h-3.5 w-3.5 text-[#9C9A93]"+ class="absolute bottom-3 right-3 h-3.5 w-3.5 text-ink-faint"/></button>{/each}diff --git a/chat/src/three-ui/flows/SlidesFlow.svelte b/chat/src/three-ui/flows/SlidesFlow.svelteindex 8c4791a53..47d8e2858 100644--- a/chat/src/three-ui/flows/SlidesFlow.svelte+++ b/chat/src/three-ui/flows/SlidesFlow.svelte@@ -22,35 +22,35 @@</script><div class="w-full max-w-[760px] mx-auto">- <h2 class="text-sm font-semibold text-[#1A1A1A] mb-3 mt-10">Sample prompts</h2>+ <h2 class="text-sm font-semibold text-ink mb-3 mt-10">Sample prompts</h2><div class="grid grid-cols-2 gap-3 md:grid-cols-4">{#each samplePrompts as prompt}<button- class="bg-white border border-[#E5E3DC] rounded-xl p-4 text-left h-[112px] flex flex-col justify-between hover:bg-[#F5F4EF] transition-colors"+ class="bg-white border border-rule rounded-xl p-4 text-left h-[112px] flex flex-col justify-between hover:bg-paper transition-colors"on:click={() => selectPrompt(prompt)}>- <span class="text-sm text-[#1A1A1A] line-clamp-2">{prompt}</span>- <Icon icon={feArrowUpLeft} class="w-[14px] h-[14px] text-[#9C9A93] self-end shrink-0" />+ <span class="text-sm text-ink line-clamp-2">{prompt}</span>+ <Icon icon={feArrowUpLeft} class="w-[14px] h-[14px] text-ink-faint self-end shrink-0" /></button>{/each}</div><div class="flex items-center justify-between mb-3 mt-10">- <h2 class="text-sm font-semibold text-[#1A1A1A]">Choose a template</h2>+ <h2 class="text-sm font-semibold text-ink">Choose a template</h2><div class="relative"><button- class="bg-white border border-[#E5E3DC] rounded-full h-9 px-3 text-sm flex items-center gap-2 hover:bg-[#F5F4EF] transition-colors"+ class="bg-white border border-rule rounded-full h-9 px-3 text-sm flex items-center gap-2 hover:bg-paper transition-colors"on:click={() => (slideCountOpen = !slideCountOpen)}>- <Icon icon={feLayout} class="w-4 h-4 text-[#6B6B6B]" />+ <Icon icon={feLayout} class="w-4 h-4 text-ink-soft" />{selectedSlideCount}- <Icon icon={feChevronDown} class="w-3 h-3 text-[#6B6B6B]" />+ <Icon icon={feChevronDown} class="w-3 h-3 text-ink-soft" /></button>{#if slideCountOpen}- <div class="absolute right-0 top-full mt-1 bg-white border border-[#E5E3DC] rounded-xl shadow-pop z-10 min-w-[120px]">+ <div class="absolute right-0 top-full mt-1 bg-white border border-rule rounded-xl shadow-pop z-10 min-w-[120px]">{#each slideCountOptions as option}<button- class="block w-full px-4 py-2 text-sm text-left text-[#1A1A1A] hover:bg-[#F5F4EF] first:rounded-t-xl last:rounded-b-xl"+ class="block w-full px-4 py-2 text-sm text-left text-ink hover:bg-paper first:rounded-t-xl last:rounded-b-xl"on:click={() => { selectedSlideCount = option; slideCountOpen = false; }}>{option}@@ -62,13 +62,13 @@</div><div class="grid grid-cols-4 gap-4 pb-8">- <button class="aspect-[4/3] bg-white border border-[#E5E3DC] rounded-xl flex flex-col items-center justify-center gap-2 hover:bg-[#F5F4EF] transition-colors">- <Icon icon={feUpload} class="w-5 h-5 text-[#6B6B6B]" />- <span class="text-xs text-[#6B6B6B]">Import template</span>+ <button class="aspect-[4/3] bg-white border border-rule rounded-xl flex flex-col items-center justify-center gap-2 hover:bg-paper transition-colors">+ <Icon icon={feUpload} class="w-5 h-5 text-ink-soft" />+ <span class="text-xs text-ink-soft">Import template</span></button>{#each Array(templateCount) as _, i}- <button class="aspect-[4/3] bg-[#EFECE3] rounded-xl flex items-center justify-center hover:opacity-80 transition-opacity">- <span class="text-xs text-[#6B6B6B] font-serif text-center px-2">Sample template {i + 1}</span>+ <button class="aspect-[4/3] bg-paper-deep rounded-xl flex items-center justify-center hover:opacity-80 transition-opacity">+ <span class="text-xs text-ink-soft font-serif text-center px-2">Sample template {i + 1}</span></button>{/each}</div>diff --git a/chat/src/three-ui/flows/UtilityFlows.svelte b/chat/src/three-ui/flows/UtilityFlows.svelteindex 4596b435d..458e11361 100644--- a/chat/src/three-ui/flows/UtilityFlows.svelte+++ b/chat/src/three-ui/flows/UtilityFlows.svelte@@ -36,7 +36,7 @@{:else if $mode === 'audio'}<SamplePromptGrid title="Audio examples" prompts={audioPrompts} />{:else if $mode === 'chat'}- <p class="text-xs text-[#6B6B6B] mt-4 text-center">+ <p class="text-xs text-ink-soft mt-4 text-center">Tools and agents are off. Plain chat with the model.</p>{:else if $mode === 'playbook'}diff --git a/chat/src/three-ui/flows/WebsiteFlow.svelte b/chat/src/three-ui/flows/WebsiteFlow.svelteindex d5fa0b0d9..a161027b7 100644--- a/chat/src/three-ui/flows/WebsiteFlow.svelte+++ b/chat/src/three-ui/flows/WebsiteFlow.svelte@@ -56,13 +56,13 @@<div class="mt-8 max-w-[760px] mx-auto px-1"><div class="flex items-center justify-between">- <h3 class="text-sm font-semibold text-[#1A1A1A]">What would you like to build?</h3>+ <h3 class="text-sm font-semibold text-ink">What would you like to build?</h3>{#if !compact}- <div class="flex items-center gap-3 text-sm text-[#1A1A1A]">+ <div class="flex items-center gap-3 text-sm text-ink"><button class="inline-flex items-center gap-1.5 hover:underline"><Icon icon={feLink} size={14} /> Add website reference</button>- <span class="text-[#9C9A93]">|</span>+ <span class="text-ink-faint">|</span><button class="inline-flex items-center gap-1.5 hover:underline"><Icon icon={feFigma} size={14} /> Import from Figma</button>@@ -89,7 +89,7 @@{#each ideasByCategory[$websiteCategory] as idea}<button class="three-ui-chip" on:click={() => selectIdea(idea)}><span>{idea}</span>- <Icon icon={feArrowUpLeft} size={14} class="text-[#9C9A93]" />+ <Icon icon={feArrowUpLeft} size={14} class="text-ink-faint" /></button>{/each}</div>diff --git a/chat/src/three-ui/pages/AuthPage.svelte b/chat/src/three-ui/pages/AuthPage.svelteindex 8ecbbbecf..ac37e5911 100644--- a/chat/src/three-ui/pages/AuthPage.svelte+++ b/chat/src/three-ui/pages/AuthPage.svelte@@ -45,11 +45,11 @@</script><section class="pt-24 pb-16 px-6">- <div class="bg-white border border-[#E5E3DC] rounded-2xl p-8 w-full max-w-[420px] mx-auto">+ <div class="bg-white border border-rule rounded-2xl p-8 w-full max-w-[420px] mx-auto"><h1 class="font-serif text-3xl font-semibold text-center">{kind === 'signin' ? 'Welcome back' : 'Create your account'}</h1>- <p class="text-[#6B6B6B] text-sm text-center mt-2">+ <p class="text-ink-soft text-sm text-center mt-2">{kind === 'signin'? 'Sign in to continue to three.ws': 'Free to start. No credit card required.'}@@ -66,7 +66,7 @@<buttondisabled={loading !== null}on:click={connectSolana}- class="bg-white border border-[#E5E3DC] text-[#1A1A1A] rounded-xl h-11 w-full flex items-center justify-center gap-2 hover:bg-[#F5F4EF] text-sm font-medium disabled:opacity-50 transition-colors"+ class="bg-white border border-rule text-ink rounded-xl h-11 w-full flex items-center justify-center gap-2 hover:bg-paper text-sm font-medium disabled:opacity-50 transition-colors">{loading === 'sol' ? 'Connecting…' : 'Connect Solana Wallet'}</button>@@ -75,42 +75,42 @@{/if}</div>- <div class="flex items-center gap-3 text-xs text-[#9C9A93] my-4">- <span class="flex-1 h-px bg-[#E5E3DC]" />or<span class="flex-1 h-px bg-[#E5E3DC]" />+ <div class="flex items-center gap-3 text-xs text-ink-faint my-4">+ <span class="flex-1 h-px bg-rule" />or<span class="flex-1 h-px bg-rule" /></div><form class="space-y-3" on:submit|preventDefault={submit}>{#if kind === 'signup'}<label class="block">- <span class="text-xs font-medium text-[#6B6B6B] mb-1.5 block">Name</span>- <input class="w-full h-11 px-4 rounded-xl border border-[#E5E3DC] bg-white focus:outline-none focus:border-[#1A1A1A]"+ <span class="text-xs font-medium text-ink-soft mb-1.5 block">Name</span>+ <input class="w-full h-11 px-4 rounded-xl border border-rule bg-white focus:outline-none focus:border-ink"type="text" bind:value={name} required></label>{/if}<label class="block">- <span class="text-xs font-medium text-[#6B6B6B] mb-1.5 block">Email</span>- <input class="w-full h-11 px-4 rounded-xl border border-[#E5E3DC] bg-white focus:outline-none focus:border-[#1A1A1A]"+ <span class="text-xs font-medium text-ink-soft mb-1.5 block">Email</span>+ <input class="w-full h-11 px-4 rounded-xl border border-rule bg-white focus:outline-none focus:border-ink"type="email" bind:value={email} required></label><label class="block">- <span class="text-xs font-medium text-[#6B6B6B] mb-1.5 block">Password</span>- <input class="w-full h-11 px-4 rounded-xl border border-[#E5E3DC] bg-white focus:outline-none focus:border-[#1A1A1A]"+ <span class="text-xs font-medium text-ink-soft mb-1.5 block">Password</span>+ <input class="w-full h-11 px-4 rounded-xl border border-rule bg-white focus:outline-none focus:border-ink"type="password" bind:value={password} required minlength="8"></label><button type="submit"- class="w-full h-11 rounded-full bg-black text-white text-sm font-medium hover:bg-[#1A1A1A]">+ class="w-full h-11 rounded-full bg-black text-white text-sm font-medium hover:bg-ink">{kind === 'signin' ? 'Sign in' : 'Create account'}</button></form></div>- <p class="text-center text-sm text-[#6B6B6B] mt-6">+ <p class="text-center text-sm text-ink-soft mt-6">{#if kind === 'signin'}Don't have an account?- <button class="text-[#1A1A1A] underline" on:click={() => route.set('signup')}>Sign up</button>+ <button class="text-ink underline" on:click={() => route.set('signup')}>Sign up</button>{:else}Already have an account?- <button class="text-[#1A1A1A] underline" on:click={() => route.set('signin')}>Sign in</button>+ <button class="text-ink underline" on:click={() => route.set('signin')}>Sign in</button>{/if}</p></section>diff --git a/chat/src/three-ui/pages/EventsPage.svelte b/chat/src/three-ui/pages/EventsPage.svelteindex 77b8e7119..70123db6f 100644--- a/chat/src/three-ui/pages/EventsPage.svelte+++ b/chat/src/three-ui/pages/EventsPage.svelte@@ -93,8 +93,8 @@<!-- Hero --><div class="text-center mb-16">- <h1 class="font-serif text-5xl font-semibold text-[#1A1A1A]">{page.title}</h1>- <p class="text-[#6B6B6B] text-lg max-w-[560px] mx-auto mt-4">{page.sub}</p>+ <h1 class="font-serif text-5xl font-semibold text-ink">{page.title}</h1>+ <p class="text-ink-soft text-lg max-w-[560px] mx-auto mt-4">{page.sub}</p>{#if page.cta}<button class="mt-8 bg-black text-white rounded-full h-10 px-6 text-sm font-medium hover:bg-[#333] transition-colors">{page.cta}@@ -104,22 +104,22 @@<!-- Upcoming -->{#if page.upcoming.length > 0}- <h2 class="font-serif text-2xl font-semibold text-[#1A1A1A] mb-6">Upcoming</h2>+ <h2 class="font-serif text-2xl font-semibold text-ink mb-6">Upcoming</h2><div class="space-y-3 mb-16">{#each page.upcoming as e}- <div class="bg-white border border-[#E5E3DC] rounded-2xl px-6 py-5 flex items-center gap-6">- <div class="flex items-center justify-center w-10 h-10 rounded-xl bg-[#F5F4EF] shrink-0">- <Icon icon={feCalendar} class="w-5 h-5 text-[#1A1A1A]" strokeWidth={1.5} />+ <div class="bg-white border border-rule rounded-2xl px-6 py-5 flex items-center gap-6">+ <div class="flex items-center justify-center w-10 h-10 rounded-xl bg-paper shrink-0">+ <Icon icon={feCalendar} class="w-5 h-5 text-ink" strokeWidth={1.5} /></div><div class="flex-1 min-w-0">- <p class="text-sm font-semibold text-[#1A1A1A]">{e.title}</p>- <p class="text-xs text-[#6B6B6B] mt-1">{e.host} · {e.duration}</p>+ <p class="text-sm font-semibold text-ink">{e.title}</p>+ <p class="text-xs text-ink-soft mt-1">{e.host} · {e.duration}</p></div><div class="text-right shrink-0">- <p class="text-xs font-medium text-[#1A1A1A]">{e.date}</p>- <p class="text-xs text-[#6B6B6B] mt-1">{e.spots}</p>+ <p class="text-xs font-medium text-ink">{e.date}</p>+ <p class="text-xs text-ink-soft mt-1">{e.spots}</p></div>- <button class="shrink-0 h-8 px-4 rounded-full border border-[#E5E3DC] text-xs font-medium text-[#1A1A1A] hover:bg-[#F5F4EF] transition-colors">+ <button class="shrink-0 h-8 px-4 rounded-full border border-rule text-xs font-medium text-ink hover:bg-paper transition-colors">Register</button></div>@@ -128,20 +128,20 @@{/if}<!-- Past / All Recordings -->- <h2 class="font-serif text-2xl font-semibold text-[#1A1A1A] mb-6">+ <h2 class="font-serif text-2xl font-semibold text-ink mb-6">{page.upcoming.length > 0 ? 'Past sessions' : 'All recordings'}</h2><div class="grid md:grid-cols-2 gap-4">{#each page.past as e}- <div class="bg-white border border-[#E5E3DC] rounded-2xl px-6 py-5 flex items-center gap-4 hover:bg-[#FAF9F4] transition-colors cursor-pointer">- <div class="flex items-center justify-center w-10 h-10 rounded-xl bg-[#F5F4EF] shrink-0">- <Icon icon={fePlay} class="w-4 h-4 text-[#1A1A1A]" strokeWidth={1.5} />+ <div class="bg-white border border-rule rounded-2xl px-6 py-5 flex items-center gap-4 hover:bg-paper-deep transition-colors cursor-pointer">+ <div class="flex items-center justify-center w-10 h-10 rounded-xl bg-paper shrink-0">+ <Icon icon={fePlay} class="w-4 h-4 text-ink" strokeWidth={1.5} /></div><div class="flex-1 min-w-0">- <p class="text-sm font-semibold text-[#1A1A1A] line-clamp-1">{e.title}</p>- <p class="text-xs text-[#6B6B6B] mt-1">{e.date} · {e.views}</p>+ <p class="text-sm font-semibold text-ink line-clamp-1">{e.title}</p>+ <p class="text-xs text-ink-soft mt-1">{e.date} · {e.views}</p></div>- <Icon icon={feExternalLink} class="w-4 h-4 text-[#9C9A93] shrink-0" strokeWidth={1.5} />+ <Icon icon={feExternalLink} class="w-4 h-4 text-ink-faint shrink-0" strokeWidth={1.5} /></div>{/each}</div>diff --git a/chat/src/three-ui/pages/FeaturePage.svelte b/chat/src/three-ui/pages/FeaturePage.svelteindex 27cbf7fb5..e20cd54f4 100644--- a/chat/src/three-ui/pages/FeaturePage.svelte+++ b/chat/src/three-ui/pages/FeaturePage.svelte@@ -12,12 +12,12 @@<!-- Hero --><div class="text-center">- <p class="text-xs font-medium tracking-[0.16em] uppercase text-[#6B6B6B] mb-4">{page.eyebrow}</p>+ <p class="text-xs font-medium tracking-[0.16em] uppercase text-ink-soft mb-4">{page.eyebrow}</p><h1 class="three.ws-display">{page.title}</h1>- <p class="text-[#6B6B6B] text-lg max-w-[640px] mx-auto mt-6">{page.sub}</p>+ <p class="text-ink-soft text-lg max-w-[640px] mx-auto mt-6">{page.sub}</p><div class="flex items-center justify-center gap-3 mt-8"><button class="three.ws-btn-primary">{page.primaryCta}</button>- <button class="three.ws-btn-ghost border border-[#E5E3DC]">{page.secondaryCta}</button>+ <button class="three.ws-btn-ghost border border-rule">{page.secondaryCta}</button></div></div>@@ -25,12 +25,12 @@<h2 class="font-serif text-3xl font-semibold mt-24 mb-8 text-center">What you get</h2><div class="grid md:grid-cols-3 gap-4">{#each page.features as feat}- <div class="bg-white border border-[#E5E3DC] rounded-2xl p-6">- <div class="w-9 h-9 flex items-center justify-center rounded-xl bg-paper border border-[#E5E3DC]">+ <div class="bg-white border border-rule rounded-2xl p-6">+ <div class="w-9 h-9 flex items-center justify-center rounded-xl bg-paper border border-rule"><Icon icon={feat.icon} class="h-[22px] w-[22px] text-ink" strokeWidth={1.5} /></div><p class="text-base font-semibold mt-4">{feat.title}</p>- <p class="text-sm text-[#6B6B6B] mt-2">{feat.body}</p>+ <p class="text-sm text-ink-soft mt-2">{feat.body}</p></div>{/each}</div>diff --git a/chat/src/three-ui/pages/MarketingPage.svelte b/chat/src/three-ui/pages/MarketingPage.svelteindex e47c029fc..76b8c1ae4 100644--- a/chat/src/three-ui/pages/MarketingPage.svelte+++ b/chat/src/three-ui/pages/MarketingPage.svelte@@ -38,7 +38,7 @@<!-- Eyebrow -->{#if content.eyebrow}- <p class="text-center text-xs font-semibold uppercase tracking-[0.14em] text-[#9C9A93] mb-4">+ <p class="text-center text-xs font-semibold uppercase tracking-[0.14em] text-ink-faint mb-4">{content.eyebrow}</p>{/if}@@ -51,14 +51,14 @@</h1><!-- Sub -->- <p class="text-[#6B6B6B] text-lg max-w-[640px] mx-auto text-center mt-6">+ <p class="text-ink-soft text-lg max-w-[640px] mx-auto text-center mt-6">{content.sub}</p><!-- Composer --><div class="mt-12 max-w-[680px] mx-auto"><div- class="bg-white border border-[#E5E3DC] rounded-[20px] shadow-composer pt-5 px-5 pb-3"+ class="bg-white border border-rule rounded-[20px] shadow-composer pt-5 px-5 pb-3"style="min-height:140px"><textarea@@ -66,7 +66,7 @@bind:value={text}placeholder={content.placeholder}rows={1}- class="w-full resize-none bg-transparent border-0 p-0 outline-none ring-0 focus:outline-none focus:ring-0 text-base text-[#1A1A1A] placeholder-[#9C9A93] font-sans overflow-y-auto scrollbar-ultraslim"+ class="w-full resize-none bg-transparent border-0 p-0 outline-none ring-0 focus:outline-none focus:ring-0 text-base text-ink placeholder-ink-faint font-sans overflow-y-auto scrollbar-ultraslim"style="max-height:320px;"on:input={autoresize}on:keydown={(e) => {@@ -82,7 +82,7 @@on:click={submit}class="flex h-9 w-9 items-center justify-center rounded-full transition-colors {text.trim()? 'bg-black text-white hover:bg-[#333] cursor-pointer'- : 'bg-[#E7E5DD] text-[#9C9A93] cursor-default'}"+ : 'bg-paper-deep text-ink-faint cursor-default'}"title="Send"><Icon icon={feArrowUp} class="h-4 w-4" />@@ -97,7 +97,7 @@<!-- Logos strip --><div class="mt-20 grid grid-cols-3 md:grid-cols-6 gap-6 items-center opacity-70">{#each logos as logo}- <div class="text-[#6B6B6B] text-sm uppercase tracking-[0.16em] text-center">+ <div class="text-ink-soft text-sm uppercase tracking-[0.16em] text-center">{logo}</div>{/each}diff --git a/chat/src/three-ui/pages/Pricing.svelte b/chat/src/three-ui/pages/Pricing.svelteindex c0e425baf..0d6ccd84b 100644--- a/chat/src/three-ui/pages/Pricing.svelte+++ b/chat/src/three-ui/pages/Pricing.svelte@@ -22,7 +22,7 @@<section class="pt-20 pb-24"><h1 class="three.ws-display text-center">Simple pricing.<br/>Built for momentum.</h1>- <p class="text-[#6B6B6B] text-lg max-w-[640px] text-center mx-auto mt-6">+ <p class="text-ink-soft text-lg max-w-[640px] text-center mx-auto mt-6">Start free. Upgrade when your team is ready to ship more.</p>@@ -30,13 +30,13 @@{#each plans as p}<div class={'rounded-2xl p-8 flex flex-col border ' + (p.highlight? 'bg-black text-white border-black'- : 'bg-white text-[#1A1A1A] border-[#E5E3DC]')}>+ : 'bg-white text-ink border-rule')}><div class="text-sm font-medium opacity-80">{p.name}</div><div class="mt-2 flex items-baseline gap-1"><span class="font-serif text-5xl font-semibold">{p.price}</span>- <span class={p.highlight ? 'text-white/60 text-base' : 'text-[#6B6B6B] text-base'}>{p.suffix}</span>+ <span class={p.highlight ? 'text-white/60 text-base' : 'text-ink-soft text-base'}>{p.suffix}</span></div>- <div class={'mt-2 text-sm ' + (p.highlight ? 'text-white/70' : 'text-[#6B6B6B]')}>{p.tag}</div>+ <div class={'mt-2 text-sm ' + (p.highlight ? 'text-white/70' : 'text-ink-soft')}>{p.tag}</div><ul class="mt-6 space-y-2 text-sm">{#each p.features as f}<li class="flex items-center gap-2">@@ -47,18 +47,18 @@</ul><button class={'mt-8 h-10 rounded-full text-sm font-medium ' + (p.highlight? 'bg-white text-black hover:bg-white/90'- : 'bg-black text-white hover:bg-[#1A1A1A]')}>{p.cta}</button>+ : 'bg-black text-white hover:bg-ink')}>{p.cta}</button></div>{/each}</div><div class="max-w-[760px] mx-auto px-6 mt-24"><h2 class="font-serif text-3xl font-semibold mb-6">Questions</h2>- <div class="divide-y divide-[#E5E3DC] border-t border-[#E5E3DC]">+ <div class="divide-y divide-rule border-t border-rule">{#each faqs as f}<details class="py-4">- <summary class="cursor-pointer font-medium text-[#1A1A1A]">{f.q}</summary>- <p class="mt-2 text-[#6B6B6B] text-sm">{f.a}</p>+ <summary class="cursor-pointer font-medium text-ink">{f.q}</summary>+ <p class="mt-2 text-ink-soft text-sm">{f.a}</p></details>{/each}</div>diff --git a/chat/src/three-ui/pages/ResourcePage.svelte b/chat/src/three-ui/pages/ResourcePage.svelteindex cfd0a1dc9..4bbd1bb41 100644--- a/chat/src/three-ui/pages/ResourcePage.svelte+++ b/chat/src/three-ui/pages/ResourcePage.svelte@@ -20,6 +20,6 @@<TrustCenter />{:else}<div class="max-w-[1100px] mx-auto px-6 pt-16 pb-24">- <p class="text-[#6B6B6B]">Page not found: resources/{slug}</p>+ <p class="text-ink-soft">Page not found: resources/{slug}</p></div>{/if}diff --git a/chat/src/three-ui/pages/RevenueDashboard.svelte b/chat/src/three-ui/pages/RevenueDashboard.svelteindex 890347fa4..bbba42d82 100644--- a/chat/src/three-ui/pages/RevenueDashboard.svelte+++ b/chat/src/three-ui/pages/RevenueDashboard.svelte@@ -190,14 +190,14 @@<section class="pt-10 pb-20 px-4 max-w-2xl mx-auto"><div class="flex items-center gap-3 mb-8"><button- class="text-[#6B6B6B] hover:text-[#1A1A1A] text-sm"+ class="text-ink-soft hover:text-ink text-sm"on:click={() => route.set('chat')}>← Back</button>- <h1 class="font-serif text-2xl font-semibold text-[#1A1A1A]">Revenue & Withdrawals</h1>+ <h1 class="font-serif text-2xl font-semibold text-ink">Revenue & Withdrawals</h1></div>{#if loading}- <p class="text-[#6B6B6B] text-sm">Loading…</p>+ <p class="text-ink-soft text-sm">Loading…</p>{:else if loadError}<div class="rounded-xl border border-red-200 bg-red-50 p-4 text-sm text-red-700">{loadError}</div>{:else}@@ -211,12 +211,12 @@{ label: 'Net Earnings', value: revenueData.summary.net_total },{ label: 'Payments', count: revenueData.summary.payment_count },] as card}- <div class="rounded-xl border border-[#E5E3DC] bg-white p-4">- <p class="text-xs text-[#6B6B6B] mb-1">{card.label}</p>+ <div class="rounded-xl border border-rule bg-white p-4">+ <p class="text-xs text-ink-soft mb-1">{card.label}</p>{#if card.count !== undefined}- <p class="text-lg font-semibold text-[#1A1A1A]">{card.count}</p>+ <p class="text-lg font-semibold text-ink">{card.count}</p>{:else}- <p class="text-lg font-semibold {card.neg ? 'text-red-600' : 'text-[#1A1A1A]'}">+ <p class="text-lg font-semibold {card.neg ? 'text-red-600' : 'text-ink'}">{card.neg ? '−' : ''}{formatUSDC(card.value)}</p>{/if}@@ -226,19 +226,19 @@{/if}<!-- Withdraw Earnings -->- <div class="rounded-2xl border border-[#E5E3DC] bg-white p-6 mb-6">- <h2 class="font-semibold text-[#1A1A1A] mb-4">Withdraw Earnings</h2>+ <div class="rounded-2xl border border-rule bg-white p-6 mb-6">+ <h2 class="font-semibold text-ink mb-4">Withdraw Earnings</h2><!-- Available balance --><div class="flex items-baseline gap-2 mb-5">- <span class="text-sm text-[#6B6B6B]">Available balance</span>- <span class="text-xl font-semibold text-[#1A1A1A]">{formatUSDC(availableBalance)}</span>+ <span class="text-sm text-ink-soft">Available balance</span>+ <span class="text-xl font-semibold text-ink">{formatUSDC(availableBalance)}</span></div>{#if noWallets}- <div class="rounded-xl bg-[#F5F4EF] border border-[#E5E3DC] p-4 text-sm text-[#6B6B6B] mb-4">+ <div class="rounded-xl bg-paper border border-rule p-4 text-sm text-ink-soft mb-4">No payout wallet configured.- <button class="text-[#1A1A1A] underline ml-1" on:click={() => route.set('settings/payout-wallets')}>+ <button class="text-ink underline ml-1" on:click={() => route.set('settings/payout-wallets')}>Add a wallet</button>to enable withdrawals.@@ -247,7 +247,7 @@<!-- Amount --><label class="block mb-4">- <span class="text-xs font-medium text-[#6B6B6B] mb-1.5 block">Amount (USDC)</span>+ <span class="text-xs font-medium text-ink-soft mb-1.5 block">Amount (USDC)</span><div class="flex gap-2"><inputtype="number"@@ -256,13 +256,13 @@bind:value={amountDisplay}disabled={noWallets}placeholder="0.00"- class="flex-1 h-11 px-4 rounded-xl border border-[#E5E3DC] bg-white focus:outline-none focus:border-[#1A1A1A] disabled:bg-[#F5F4EF] disabled:text-[#9C9A93] text-sm"+ class="flex-1 h-11 px-4 rounded-xl border border-rule bg-white focus:outline-none focus:border-ink disabled:bg-paper disabled:text-ink-faint text-sm"/><buttontype="button"disabled={noWallets || availableBalance === 0}on:click={setMax}- class="h-11 px-4 rounded-xl border border-[#E5E3DC] bg-white text-sm font-medium text-[#1A1A1A] hover:bg-[#F5F4EF] disabled:opacity-40 disabled:cursor-not-allowed transition-colors"+ class="h-11 px-4 rounded-xl border border-rule bg-white text-sm font-medium text-ink hover:bg-paper disabled:opacity-40 disabled:cursor-not-allowed transition-colors">Max</button></div>{#if amountErr}@@ -272,12 +272,12 @@<!-- Wallet selector --><label class="block mb-5">- <span class="text-xs font-medium text-[#6B6B6B] mb-1.5 block">To wallet</span>+ <span class="text-xs font-medium text-ink-soft mb-1.5 block">To wallet</span><div class="flex gap-2 items-center">{#if wallets.length > 0}<selectbind:value={selectedWalletId}- class="flex-1 h-11 px-4 rounded-xl border border-[#E5E3DC] bg-white focus:outline-none focus:border-[#1A1A1A] text-sm"+ class="flex-1 h-11 px-4 rounded-xl border border-rule bg-white focus:outline-none focus:border-ink text-sm">{#each wallets as w}<option value={w.id}>@@ -286,12 +286,12 @@{/each}</select>{:else}- <div class="flex-1 h-11 px-4 rounded-xl border border-[#E5E3DC] bg-[#F5F4EF] flex items-center text-sm text-[#9C9A93]">+ <div class="flex-1 h-11 px-4 rounded-xl border border-rule bg-paper flex items-center text-sm text-ink-faint">No wallets</div>{/if}<button- class="text-sm text-[#1A1A1A] underline whitespace-nowrap"+ class="text-sm text-ink underline whitespace-nowrap"on:click={() => route.set('settings/payout-wallets')}>+ Add wallet</button></div>@@ -315,7 +315,7 @@type="button"disabled={noWallets || submitting || availableBalance === 0}on:click={submit}- class="w-full h-11 rounded-full bg-black text-white text-sm font-medium hover:bg-[#1A1A1A] disabled:opacity-40 disabled:cursor-not-allowed transition-colors"+ class="w-full h-11 rounded-full bg-black text-white text-sm font-medium hover:bg-ink disabled:opacity-40 disabled:cursor-not-allowed transition-colors">{submitting ? 'Requesting…' : 'Request Withdrawal'}</button>@@ -323,34 +323,34 @@</div><!-- Withdrawal History -->- <div class="rounded-2xl border border-[#E5E3DC] bg-white p-6">- <h2 class="font-semibold text-[#1A1A1A] mb-4">Withdrawal History</h2>+ <div class="rounded-2xl border border-rule bg-white p-6">+ <h2 class="font-semibold text-ink mb-4">Withdrawal History</h2>{#if withdrawals.length === 0}- <p class="text-sm text-[#9C9A93]">No withdrawals yet.</p>+ <p class="text-sm text-ink-faint">No withdrawals yet.</p>{:else}<div class="overflow-x-auto"><table class="w-full text-sm"><thead>- <tr class="border-b border-[#E5E3DC]">- <th class="py-2 pr-4 text-left text-xs font-medium text-[#6B6B6B]">Date</th>- <th class="py-2 pr-4 text-left text-xs font-medium text-[#6B6B6B]">Amount</th>- <th class="py-2 pr-4 text-left text-xs font-medium text-[#6B6B6B]">Wallet</th>- <th class="py-2 pr-4 text-left text-xs font-medium text-[#6B6B6B]">Status</th>- <th class="py-2 text-left text-xs font-medium text-[#6B6B6B]">Tx</th>+ <tr class="border-b border-rule">+ <th class="py-2 pr-4 text-left text-xs font-medium text-ink-soft">Date</th>+ <th class="py-2 pr-4 text-left text-xs font-medium text-ink-soft">Amount</th>+ <th class="py-2 pr-4 text-left text-xs font-medium text-ink-soft">Wallet</th>+ <th class="py-2 pr-4 text-left text-xs font-medium text-ink-soft">Status</th>+ <th class="py-2 text-left text-xs font-medium text-ink-soft">Tx</th></tr></thead><tbody>{#each withdrawals as w}{@const txUrl = explorerUrl(w)}- <tr class="border-b border-[#E5E3DC] last:border-0">- <td class="py-3 pr-4 text-[#6B6B6B] whitespace-nowrap">+ <tr class="border-b border-rule last:border-0">+ <td class="py-3 pr-4 text-ink-soft whitespace-nowrap">{new Date(w.created_at).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' })}</td>- <td class="py-3 pr-4 font-mono text-[#1A1A1A] whitespace-nowrap">+ <td class="py-3 pr-4 font-mono text-ink whitespace-nowrap">{formatUSDC(w.amount)}</td>- <td class="py-3 pr-4 font-mono text-[#6B6B6B] whitespace-nowrap">+ <td class="py-3 pr-4 font-mono text-ink-soft whitespace-nowrap">{truncateAddr(w.to_address)}</td><td class="py-3 pr-4">@@ -365,7 +365,7 @@{w.tx_signature.slice(0, 8)}…</a>{:else}- <span class="text-xs text-[#9C9A93]">—</span>+ <span class="text-xs text-ink-faint">—</span>{/if}</td></tr>@@ -376,18 +376,18 @@<!-- Pagination -->{#if withdrawalsTotal > HIST_LIMIT}- <div class="flex items-center justify-between mt-4 text-sm text-[#6B6B6B]">+ <div class="flex items-center justify-between mt-4 text-sm text-ink-soft"><span>{histOffset + 1}–{Math.min(histOffset + HIST_LIMIT, withdrawalsTotal)} of {withdrawalsTotal}</span><div class="flex gap-2"><buttondisabled={histOffset === 0}on:click={prevPage}- class="px-3 py-1 rounded-lg border border-[#E5E3DC] hover:bg-[#F5F4EF] disabled:opacity-40 disabled:cursor-not-allowed"+ class="px-3 py-1 rounded-lg border border-rule hover:bg-paper disabled:opacity-40 disabled:cursor-not-allowed">← Prev</button><buttondisabled={histOffset + HIST_LIMIT >= withdrawalsTotal}on:click={nextPage}- class="px-3 py-1 rounded-lg border border-[#E5E3DC] hover:bg-[#F5F4EF] disabled:opacity-40 disabled:cursor-not-allowed"+ class="px-3 py-1 rounded-lg border border-rule hover:bg-paper disabled:opacity-40 disabled:cursor-not-allowed">Next →</button></div></div>diff --git a/chat/src/three-ui/pages/resources/BlogIndex.svelte b/chat/src/three-ui/pages/resources/BlogIndex.svelteindex 2de2e294d..3ebfa207e 100644--- a/chat/src/three-ui/pages/resources/BlogIndex.svelte+++ b/chat/src/three-ui/pages/resources/BlogIndex.svelte@@ -14,15 +14,15 @@<div class="max-w-[1100px] mx-auto px-6 pt-16 pb-24"><h1 class="font-serif text-4xl font-semibold mb-2">Blog</h1>- <p class="text-[#6B6B6B] text-base mb-12">Ideas, guides, and stories from the three.ws team</p>+ <p class="text-ink-soft text-base mb-12">Ideas, guides, and stories from the three.ws team</p><div class="grid md:grid-cols-3 gap-6">{#each articles as a}- <article class="bg-white border border-[#E5E3DC] rounded-2xl p-6 hover:bg-[#FAF9F4] transition-colors cursor-pointer">- <span class="inline-block text-xs uppercase tracking-wide text-[#6B6B6B]">{a.tag}</span>- <h2 class="font-serif text-xl mt-2 text-[#1A1A1A]">{a.title}</h2>- <p class="text-sm text-[#6B6B6B] mt-2 line-clamp-2">{a.excerpt}</p>- <div class="text-xs text-[#9C9A93] mt-4">{a.date} · {a.read}</div>+ <article class="bg-white border border-rule rounded-2xl p-6 hover:bg-paper-deep transition-colors cursor-pointer">+ <span class="inline-block text-xs uppercase tracking-wide text-ink-soft">{a.tag}</span>+ <h2 class="font-serif text-xl mt-2 text-ink">{a.title}</h2>+ <p class="text-sm text-ink-soft mt-2 line-clamp-2">{a.excerpt}</p>+ <div class="text-xs text-ink-faint mt-4">{a.date} · {a.read}</div></article>{/each}</div>diff --git a/chat/src/three-ui/pages/resources/DocsIndex.svelte b/chat/src/three-ui/pages/resources/DocsIndex.svelteindex c91fcc541..57b477ef0 100644--- a/chat/src/three-ui/pages/resources/DocsIndex.svelte+++ b/chat/src/three-ui/pages/resources/DocsIndex.svelte@@ -101,34 +101,34 @@type="search"placeholder="Search docs"bind:value={search}- class="bg-white border border-[#E5E3DC] rounded-full h-9 px-3 text-sm w-full mb-6 focus:outline-none focus:border-[#1A1A1A]"+ class="bg-white border border-rule rounded-full h-9 px-3 text-sm w-full mb-6 focus:outline-none focus:border-ink"/>{#if filtered}<div class="mb-4">- <div class="text-xs font-semibold uppercase tracking-wide text-[#9C9A93] mb-1">Results</div>+ <div class="text-xs font-semibold uppercase tracking-wide text-ink-faint mb-1">Results</div><ul class="space-y-0.5">{#each filtered as slug}<li><button- class="w-full text-left text-sm px-2 py-1 rounded-lg transition-colors {active === slug ? 'bg-[#F5F4EF] text-[#1A1A1A] font-medium' : 'text-[#6B6B6B] hover:text-[#1A1A1A] hover:bg-[#F5F4EF]'}"+ class="w-full text-left text-sm px-2 py-1 rounded-lg transition-colors {active === slug ? 'bg-paper text-ink font-medium' : 'text-ink-soft hover:text-ink hover:bg-paper'}"on:click={() => navigate(slug)}>{getTitle(slug)}</button></li>{/each}{#if filtered.length === 0}- <li class="text-sm text-[#9C9A93] px-2 py-1">No results</li>+ <li class="text-sm text-ink-faint px-2 py-1">No results</li>{/if}</ul></div>{:else}{#each sections as s}<div class="mb-4">- <div class="text-xs font-semibold uppercase tracking-wide text-[#9C9A93] mb-1">{s.label}</div>+ <div class="text-xs font-semibold uppercase tracking-wide text-ink-faint mb-1">{s.label}</div><ul class="space-y-0.5">{#each s.items as slug}<li><button- class="w-full text-left text-sm px-2 py-1 rounded-lg transition-colors {active === slug ? 'bg-[#F5F4EF] text-[#1A1A1A] font-medium' : 'text-[#6B6B6B] hover:text-[#1A1A1A] hover:bg-[#F5F4EF]'}"+ class="w-full text-left text-sm px-2 py-1 rounded-lg transition-colors {active === slug ? 'bg-paper text-ink font-medium' : 'text-ink-soft hover:text-ink hover:bg-paper'}"on:click={() => navigate(slug)}>{getTitle(slug)}</button></li>@@ -141,7 +141,7 @@</aside><!-- Content -->- <main class="flex-1 min-w-0 prose prose-neutral max-w-none">+ <main class="flex-1 min-w-0 prose prose-neutral prose-invert max-w-none">{@html htmlContent}</main></div>diff --git a/chat/src/three-ui/pages/resources/TrustCenter.svelte b/chat/src/three-ui/pages/resources/TrustCenter.svelteindex 6b1368534..3c3b3a6b2 100644--- a/chat/src/three-ui/pages/resources/TrustCenter.svelte+++ b/chat/src/three-ui/pages/resources/TrustCenter.svelte@@ -29,14 +29,14 @@<div class="max-w-[1100px] mx-auto px-6 pt-16 pb-24"><h1 class="font-serif text-4xl font-semibold mb-2">Trust Center</h1>- <p class="text-[#6B6B6B] text-base mb-12">Security, privacy, and compliance at three.ws</p>+ <p class="text-ink-soft text-base mb-12">Security, privacy, and compliance at three.ws</p><!-- Stats row --><div class="grid md:grid-cols-3 gap-4 mb-10">{#each stats as s}- <div class="bg-white border border-[#E5E3DC] rounded-2xl p-6">- <div class="font-serif text-2xl font-semibold text-[#1A1A1A] mb-1">{s.label}</div>- <p class="text-sm text-[#6B6B6B]">{s.detail}</p>+ <div class="bg-white border border-rule rounded-2xl p-6">+ <div class="font-serif text-2xl font-semibold text-ink mb-1">{s.label}</div>+ <p class="text-sm text-ink-soft">{s.detail}</p></div>{/each}</div>@@ -44,19 +44,19 @@<!-- Content sections --><div class="grid md:grid-cols-2 gap-4 mb-14">{#each sections as s}- <div class="bg-white border border-[#E5E3DC] rounded-2xl p-6">- <h2 class="font-serif text-xl font-semibold mb-3 text-[#1A1A1A]">{s.title}</h2>- <p class="text-sm text-[#6B6B6B] leading-relaxed">{s.body}</p>+ <div class="bg-white border border-rule rounded-2xl p-6">+ <h2 class="font-serif text-xl font-semibold mb-3 text-ink">{s.title}</h2>+ <p class="text-sm text-ink-soft leading-relaxed">{s.body}</p></div>{/each}</div><!-- Compliance badge grid -->- <h2 class="font-serif text-2xl font-semibold mb-6 text-[#1A1A1A]">Certifications & frameworks</h2>+ <h2 class="font-serif text-2xl font-semibold mb-6 text-ink">Certifications & frameworks</h2><div class="grid grid-cols-3 md:grid-cols-6 gap-4">{#each badges as b}- <div class="bg-[#F5F4EF] border border-[#E5E3DC] rounded-xl aspect-square flex items-center justify-center">- <span class="text-xs font-semibold text-[#6B6B6B] text-center px-2">{b}</span>+ <div class="bg-paper border border-rule rounded-xl aspect-square flex items-center justify-center">+ <span class="text-xs font-semibold text-ink-soft text-center px-2">{b}</span></div>{/each}</div>diff --git a/chat/src/three-ui/pages/resources/UpdatesTimeline.svelte b/chat/src/three-ui/pages/resources/UpdatesTimeline.svelteindex e87ba0d18..30b9811fa 100644--- a/chat/src/three-ui/pages/resources/UpdatesTimeline.svelte+++ b/chat/src/three-ui/pages/resources/UpdatesTimeline.svelte@@ -35,20 +35,20 @@<div class="max-w-[1100px] mx-auto px-6 pt-16 pb-24"><h1 class="font-serif text-4xl font-semibold mb-2">Updates</h1>- <p class="text-[#6B6B6B] text-base mb-12">What's new in three.ws</p>+ <p class="text-ink-soft text-base mb-12">What's new in three.ws</p><div class="relative"><!-- vertical line -->- <div class="absolute left-[120px] top-0 bottom-0 w-px bg-[#E5E3DC]"></div>+ <div class="absolute left-[120px] top-0 bottom-0 w-px bg-rule"></div><div class="space-y-10">{#each entries as e}<div class="flex gap-10">- <time class="w-[100px] shrink-0 text-xs text-[#9C9A93] uppercase tracking-wide pt-5 text-right">{e.date}</time>+ <time class="w-[100px] shrink-0 text-xs text-ink-faint uppercase tracking-wide pt-5 text-right">{e.date}</time><div class="flex-1 pl-8">- <div class="bg-white border border-[#E5E3DC] rounded-2xl p-6 hover:bg-[#FAF9F4] transition-colors">- <h2 class="font-serif text-xl font-semibold text-[#1A1A1A]">{e.title}</h2>- <p class="text-sm text-[#6B6B6B] mt-2 leading-relaxed">{e.body}</p>+ <div class="bg-white border border-rule rounded-2xl p-6 hover:bg-paper-deep transition-colors">+ <h2 class="font-serif text-xl font-semibold text-ink">{e.title}</h2>+ <p class="text-sm text-ink-soft mt-2 leading-relaxed">{e.body}</p></div></div></div>diff --git a/chat/src/three-ui/pages/resources/UseCasesIndex.svelte b/chat/src/three-ui/pages/resources/UseCasesIndex.svelteindex 26ba22004..867bfe838 100644--- a/chat/src/three-ui/pages/resources/UseCasesIndex.svelte+++ b/chat/src/three-ui/pages/resources/UseCasesIndex.svelte@@ -13,16 +13,16 @@<div class="max-w-[1100px] mx-auto px-6 pt-16 pb-24"><h1 class="font-serif text-4xl font-semibold mb-2">Use Cases</h1>- <p class="text-[#6B6B6B] text-base mb-12">How teams are putting three.ws to work</p>+ <p class="text-ink-soft text-base mb-12">How teams are putting three.ws to work</p><div class="grid md:grid-cols-2 gap-6">{#each cases as c}- <article class="bg-white border border-[#E5E3DC] rounded-2xl p-6 hover:bg-[#FAF9F4] transition-colors cursor-pointer flex flex-col">- <span class="inline-block text-xs uppercase tracking-wide text-[#6B6B6B]">{c.industry}</span>- <h2 class="font-serif text-xl mt-2 text-[#1A1A1A] leading-snug">{c.headline}</h2>- <p class="text-sm text-[#6B6B6B] mt-2 line-clamp-2 flex-1">{c.summary}</p>- <div class="mt-5 h-8 bg-[#F5F4EF] rounded-lg flex items-center px-3">- <span class="text-xs text-[#9C9A93] font-medium">{c.logo}</span>+ <article class="bg-white border border-rule rounded-2xl p-6 hover:bg-paper-deep transition-colors cursor-pointer flex flex-col">+ <span class="inline-block text-xs uppercase tracking-wide text-ink-soft">{c.industry}</span>+ <h2 class="font-serif text-xl mt-2 text-ink leading-snug">{c.headline}</h2>+ <p class="text-sm text-ink-soft mt-2 line-clamp-2 flex-1">{c.summary}</p>+ <div class="mt-5 h-8 bg-paper rounded-lg flex items-center px-3">+ <span class="text-xs text-ink-faint font-medium">{c.logo}</span></div></article>{/each}diff --git a/chat/tailwind.config.cjs b/chat/tailwind.config.cjsindex ed58a41ff..b1bd856cb 100644--- a/chat/tailwind.config.cjs+++ b/chat/tailwind.config.cjs@@ -1,55 +1,96 @@const typography = require('@tailwindcss/typography');+const palette = require('tailwindcss/colors');++// ---------------------------------------------------------------------------+// Dark theme by default.+//+// The chat UI was authored against a light "paper/ink" palette, using the full+// Tailwind neutral + accent scales (slate-800 text on white, slate-200 rules,+// etc.). Rather than annotate every one of the ~700 utility classes with a+// `dark:` variant, we flip the palette itself: each numeric scale is mirrored+// (50 <-> 950, 100 <-> 900, ... 500 stays) so that every light-mode colour+// relationship inverts into its dark-mode counterpart. A dark `slate-800`+// heading becomes a light one; a `bg-white` surface becomes near-black; a+// `bg-indigo-50` tint becomes a deep indigo. The design intent is preserved;+// only the luminance axis is reflected.+//+// `white` and `black` are remapped to act as surface/accent anchors so the+// canvas reads as true black with subtly-raised panels.+// ---------------------------------------------------------------------------++const SHADES = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];++function invertScale(scale) {+ if (!scale || typeof scale !== 'object') return scale;+ const out = {};+ for (const shade of SHADES) {+ if (scale[shade] === undefined) continue;+ const mirror = 1000 - shade; // 50<->950, 100<->900, ... 500<->500+ out[shade] = scale[mirror] !== undefined ? scale[mirror] : scale[shade];+ }+ // preserve any non-numeric keys (e.g. DEFAULT) untouched+ for (const key of Object.keys(scale)) {+ if (!SHADES.includes(Number(key))) out[key] = scale[key];+ }+ return out;+}++const NEUTRAL_HUES = ['slate', 'gray', 'zinc', 'neutral', 'stone'];+const ACCENT_HUES = [+ 'red', 'orange', 'amber', 'yellow', 'lime', 'green', 'emerald', 'teal',+ 'cyan', 'sky', 'blue', 'indigo', 'violet', 'purple', 'fuchsia', 'pink', 'rose',+];++const invertedScales = {};+for (const hue of [...NEUTRAL_HUES, ...ACCENT_HUES]) {+ if (palette[hue]) invertedScales[hue] = invertScale(palette[hue]);+}++// Dark surface/text anchors. `white` is used throughout for raised surfaces+// (cards, panels, the composer) so it maps to a slightly-lifted near-black;+// `black` is used for the primary accent (solid buttons) so it maps to a warm+// near-white that reads as an inverted accent on the dark canvas.+const SURFACE_RAISED = '#141414';+const ACCENT_INVERTED = '#F0EEE7';function scrollbarsPlugin({ addUtilities }) {+ const track = '#0A0A0A';+ const thumb = 'rgba(255,255,255,0.18)';addUtilities({'.scrollbar-invisible': {- 'scrollbar-color': 'white white',- '&::-webkit-scrollbar-track': {- background: 'white',- },- '&::-webkit-scrollbar-thumb': {- background: 'white',- },+ 'scrollbar-color': `${track} ${track}`,+ '&::-webkit-scrollbar-track': { background: track },+ '&::-webkit-scrollbar-thumb': { background: track },},'.scrollbar-white': {- 'scrollbar-color': 'theme(\'colors.gray.400 / 50%\') white',- '&::-webkit-scrollbar-track': {- background: 'white',- },- '&::-webkit-scrollbar-thumb': {- background: 'white',- },+ 'scrollbar-color': `${thumb} ${track}`,+ '&::-webkit-scrollbar-track': { background: track },+ '&::-webkit-scrollbar-thumb': { background: thumb },},'.scrollbar-slim': {'scrollbar-width': 'thin',- '&::-webkit-scrollbar': {- width: '6px',- height: '6px',- },+ '&::-webkit-scrollbar': { width: '6px', height: '6px' },'&::-webkit-scrollbar-track': {- background: "theme('colors.gray.200 / 70%')",+ background: track,'-webkit-border-radius': '10px','border-radius': '10px',},'&::-webkit-scrollbar-thumb': {- background: "theme('colors.gray.400 / 50%')",+ background: thumb,'-webkit-border-radius': '10px','border-radius': '10px',},},'.scrollbar-ultraslim': {'scrollbar-width': 'thin',- '&::-webkit-scrollbar': {- width: '3px',- height: '3px',- },+ '&::-webkit-scrollbar': { width: '3px', height: '3px' },'&::-webkit-scrollbar-track': {- background: "theme('colors.gray.200 / 70%')",+ background: track,'-webkit-border-radius': '10px','border-radius': '10px',},'&::-webkit-scrollbar-thumb': {- background: "theme('colors.gray.400 / 50%')",+ background: thumb,'-webkit-border-radius': '10px','border-radius': '10px',},@@ -57,16 +98,12 @@ function scrollbarsPlugin({ addUtilities }) {'.scrollbar-none': {'-ms-overflow-style': 'none','scrollbar-width': 'none',- '&::-webkit-scrollbar': {- display: 'none',- },+ '&::-webkit-scrollbar': { display: 'none' },},'.scrollbar-default': {'-ms-overflow-style': 'auto','scrollbar-width': 'auto',- '&::-webkit-scrollbar': {- display: 'block',- },+ '&::-webkit-scrollbar': { display: 'block' },},});}@@ -91,20 +128,25 @@ const config = {serif: ['Lora', 'ui-serif', 'Georgia', 'serif'],},colors: {- paper: '#F5F4EF',- 'paper-deep': '#EBE8E0',- ink: '#1A1A1A',- 'ink-soft': '#6B6B6B',- rule: '#E5E3DC',+ ...invertedScales,+ white: SURFACE_RAISED,+ black: ACCENT_INVERTED,+ // Semantic design tokens, flipped to a true-black dark theme.+ paper: '#0A0A0A', // app canvas+ 'paper-deep': '#1C1C1C', // raised / hover surface+ ink: '#ECEAE3', // primary text+ 'ink-soft': '#9A988F', // secondary text+ 'ink-faint': '#6B6B6B', // tertiary text / timestamps+ rule: '#2A2A2A', // hairline borders'three-ui': {- blue: '#3B82F6',- 'blue-soft': '#EFF6FF',- 'blue-border': '#BFDBFE',+ blue: '#60A5FA',+ 'blue-soft': '#172554',+ 'blue-border': '#1E40AF',},},boxShadow: {- pop: '0 8px 24px -8px rgba(20,20,20,0.12), 0 2px 6px -2px rgba(20,20,20,0.06)',- composer: '0 1px 2px rgba(20,20,20,0.04), 0 8px 32px -16px rgba(20,20,20,0.10)',+ pop: '0 8px 24px -8px rgba(0,0,0,0.55), 0 2px 6px -2px rgba(0,0,0,0.40)',+ composer: '0 1px 2px rgba(0,0,0,0.40), 0 8px 32px -16px rgba(0,0,0,0.55)',},borderRadius: {composer: '20px',diff --git a/pages/agent-detail.html b/pages/agent-detail.htmlindex b684c2efd..b425b8b7d 100644--- a/pages/agent-detail.html+++ b/pages/agent-detail.html@@ -109,10 +109,6 @@</aside><main class="ad-main loading">- <header class="ad-banner">- <span>S1 Powered by Torque · $250K rewards</span>- </header>-<div class="ad-topbar"><input class="ad-search" placeholder="Search agents…" /><div class="ad-actions">@@ -227,7 +223,7 @@<button class="ad-copy" data-copy-target="ad-holdings-addr" aria-label="Copy">⧉</button></div><div class="ad-balance"><span id="ad-holdings-sol">0</span> SOL</div>- <div class="flex space-x-2 mt-4 justify-start">+ <div class="flex space-x-2 mt-4 justify-start" id="ad-holdings-actions"><button id="receive-btn" class="ad-btn">Receive</button>diff --git a/pages/marketplace.html b/pages/marketplace.htmlindex cebe3213c..f48c14905 100644--- a/pages/marketplace.html+++ b/pages/marketplace.html@@ -575,15 +575,21 @@/* ── Weekly theme strip ───────────────────────────────────────── */.market-theme-strip {display: flex;- align-items: center;+ flex-direction: column;+ align-items: stretch;gap: 12px;margin: 14px 24px 0;- padding: 10px 16px;+ padding: 12px 16px;background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.06) 60%, transparent);border: 1px solid rgba(255, 255, 255, 0.12);border-radius: 12px;font-size: 13px;color: #d4d4d8;+ }+ .market-theme-head {+ display: flex;+ align-items: center;+ gap: 12px;flex-wrap: wrap;}.market-theme-strip .market-theme-eyebrow {@@ -619,6 +625,150 @@background: rgba(255, 255, 255, 0.14);}+ /* Top-picks row: horizontally scrollable 3D mini-cards. */+ .market-theme-picks {+ display: flex;+ gap: 10px;+ overflow-x: auto;+ overflow-y: hidden;+ padding: 2px 2px 6px;+ margin: -2px -2px -4px;+ scroll-snap-type: x proximity;+ scrollbar-width: thin;+ scrollbar-color: rgba(255, 255, 255, 0.18) transparent;+ }+ .market-theme-picks::-webkit-scrollbar { height: 6px; }+ .market-theme-picks::-webkit-scrollbar-thumb {+ background: rgba(255, 255, 255, 0.18);+ border-radius: 99px;+ }+ .market-theme-pick {+ position: relative;+ flex: 0 0 132px;+ width: 132px;+ border: 1px solid rgba(255, 255, 255, 0.1);+ border-radius: 10px;+ background: linear-gradient(180deg, #0e0e12, #0a0a0d);+ overflow: hidden;+ cursor: pointer;+ scroll-snap-align: start;+ transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;+ text-align: left;+ appearance: none;+ color: inherit;+ font: inherit;+ padding: 0;+ }+ .market-theme-pick:hover,+ .market-theme-pick:focus-visible {+ border-color: rgba(255, 255, 255, 0.28);+ transform: translateY(-2px);+ box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);+ outline: none;+ }+ .market-theme-pick:focus-visible {+ box-shadow: 0 0 0 2px var(--accent, #8b5cf6), 0 8px 22px rgba(0, 0, 0, 0.45);+ }+ .market-theme-pick-stage {+ position: relative;+ width: 100%;+ height: 108px;+ background:+ radial-gradient(120% 90% at 50% 18%, rgba(139, 92, 246, 0.16), transparent 60%),+ #0b0b0f;+ }+ .market-theme-pick-stage model-viewer {+ width: 100%;+ height: 100%;+ --poster-color: transparent;+ background: transparent;+ }+ .market-theme-pick-rank {+ position: absolute;+ top: 6px;+ left: 6px;+ z-index: 2;+ font-family: var(--font-display);+ font-size: 10px;+ font-weight: 700;+ letter-spacing: 0.04em;+ padding: 2px 6px;+ border-radius: 6px;+ background: rgba(0, 0, 0, 0.55);+ color: #fafafa;+ backdrop-filter: blur(4px);+ }+ .market-theme-pick-views {+ position: absolute;+ top: 6px;+ right: 6px;+ z-index: 2;+ font-size: 10px;+ font-weight: 600;+ padding: 2px 6px;+ border-radius: 6px;+ background: rgba(0, 0, 0, 0.55);+ color: #d4d4d8;+ backdrop-filter: blur(4px);+ }+ .market-theme-pick-meta {+ padding: 7px 9px 9px;+ }+ .market-theme-pick-name {+ display: block;+ font-size: 12px;+ font-weight: 600;+ color: #fafafa;+ white-space: nowrap;+ overflow: hidden;+ text-overflow: ellipsis;+ }+ .market-theme-pick-cat {+ display: block;+ margin-top: 2px;+ font-size: 10px;+ color: #8b8b94;+ white-space: nowrap;+ overflow: hidden;+ text-overflow: ellipsis;+ }+ .market-theme-pick-placeholder {+ position: absolute;+ inset: 0;+ display: flex;+ align-items: center;+ justify-content: center;+ font-family: var(--font-display);+ font-size: 30px;+ font-weight: 700;+ color: rgba(255, 255, 255, 0.16);+ transition: opacity 0.4s ease;+ pointer-events: none;+ }+ .market-theme-pick.mv-loaded .market-theme-pick-placeholder { opacity: 0; }+ /* Skeleton shimmer while the lineup loads. */+ .market-theme-pick.is-skeleton {+ cursor: default;+ pointer-events: none;+ }+ .market-theme-pick.is-skeleton .market-theme-pick-stage,+ .market-theme-pick.is-skeleton .market-theme-pick-meta {+ background: linear-gradient(100deg, #131318 30%, #1b1b22 50%, #131318 70%);+ background-size: 200% 100%;+ animation: market-pick-shimmer 1.2s ease-in-out infinite;+ }+ @keyframes market-pick-shimmer {+ 0% { background-position: 200% 0; }+ 100% { background-position: -200% 0; }+ }+ @media (prefers-reduced-motion: reduce) {+ .market-theme-pick { transition: border-color 0.18s ease; }+ .market-theme-pick:hover,+ .market-theme-pick:focus-visible { transform: none; }+ .market-theme-pick.is-skeleton .market-theme-pick-stage,+ .market-theme-pick.is-skeleton .market-theme-pick-meta { animation: none; }+ }+/* ── Onchain card variants ────────────────────────────────────── */.market-card-avatar.onchain {background: linear-gradient(180deg, #0d0d0d, #0a0a0a);@@ -2188,10 +2338,13 @@<h1 class="market-visually-hidden">Agent Marketplace</h1><!-- Weekly curated theme strip (loads from /api/marketplace/theme) --><aside class="market-theme-strip" id="market-theme-strip" hidden>- <span class="market-theme-eyebrow">This week</span>- <strong class="market-theme-title" id="market-theme-title">—</strong>- <span class="market-theme-blurb" id="market-theme-blurb">—</span>- <button class="market-theme-cta" id="market-theme-cta" hidden>Browse →</button>+ <div class="market-theme-head">+ <span class="market-theme-eyebrow">This week</span>+ <strong class="market-theme-title" id="market-theme-title">—</strong>+ <span class="market-theme-blurb" id="market-theme-blurb">—</span>+ <button class="market-theme-cta" id="market-theme-cta" hidden>Browse →</button>+ </div>+ <div class="market-theme-picks" id="market-theme-picks" role="list" aria-label="Top picks this week" hidden></div></aside><!-- Live 3D hero carousel --><section class="market-hero" id="market-hero" hidden aria-label="Featured 3D avatars">diff --git a/public/chat/manifest.json b/public/chat/manifest.jsonindex a1e8a21cf..8612e1143 100644--- a/public/chat/manifest.json+++ b/public/chat/manifest.json@@ -3,8 +3,8 @@"short_name": "three.ws chat","start_url": "/chat/","display": "standalone",- "background_color": "#ffffff",- "theme_color": "#ffffff",+ "background_color": "#0A0A0A",+ "theme_color": "#0A0A0A","description": "A simple, lightweight, and open LLM playground.","icons": [{diff --git a/public/features.json b/public/features.jsonindex f45a78e30..3a451b84c 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-05T11:18:33.111Z",+ "generated_at": "2026-06-05T13:37:42.793Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/src/agent-detail.js b/src/agent-detail.jsindex cae7d4d5f..991e4a135 100644--- a/src/agent-detail.js+++ b/src/agent-detail.js@@ -311,10 +311,10 @@ function render(agent) {}document.querySelector('.ad-main').classList.remove('loading');- bindWalletActions();+ bindWalletActions(agent.isOwner);wireShareButton(agent);- loadExtraSections(agent.id, agent.rawMetadata);+ loadExtraSections(agent.id, agent.rawMetadata, agent.isOwner);// Layer the marketplace discovery + commerce features (3D avatar, live chat// preview, creator profile, skill pricing, sale panel, embed, similar,@@ -323,7 +323,7 @@ function render(agent) {enrichAgentDetail(agent).catch((e) => log.warn('[agent-detail] enrich failed:', e?.message));}-async function loadExtraSections(agentId, rec) {+async function loadExtraSections(agentId, rec, isOwner) {const url = (p) => `/api/agents/${encodeURIComponent(agentId)}${p}`;const safe = async (fn) => {@@ -334,14 +334,19 @@ async function loadExtraSections(agentId, rec) {}};+ // Actions, memory and strategy are owner-only on the server (401/403 for+ // anyone else). Only request them when the viewer owns the agent, so public+ // visitors don't generate failed requests that pollute the console.+ const ownerOnly = (fn) => (isOwner ? safe(fn) : Promise.resolve(null));+const [actions, memory, strategy, reputation, embedPolicy] = await Promise.all([- safe(() => fetchJson(url('/actions?limit=8'))),- safe(() =>+ ownerOnly(() => fetchJson(url('/actions?limit=8'))),+ ownerOnly(() =>fetch(`/api/agent-memory?agentId=${encodeURIComponent(agentId)}&limit=6`, {credentials: 'include',}).then((r) => (r.ok ? r.json() : null)),),- safe(() =>+ ownerOnly(() =>fetch(`/api/agent-strategy?id=${encodeURIComponent(agentId)}`, {credentials: 'include',}).then((r) => (r.ok ? r.json() : null)),@@ -1010,7 +1015,20 @@ function wireShareButton(agent) {});}-function bindWalletActions() {+function bindWalletActions(isOwner) {+ // Receive / Withdraw / Swap act on funds the viewer controls, not the agent's+ // on-chain wallet — there is no client-side key for the agent address. Showing+ // them under AGENT HOLDINGS on agents the viewer doesn't own misrepresents what+ // they do (it reads as "move the agent's SOL"). Server-side ownership is the+ // authoritative signal: /api/agents/:id only returns user_id to the owner, which+ // is what `isOwner` reflects. Hide the actions for everyone else; the balance and+ // address above stay visible as read-only info.+ const actions = document.getElementById('ad-holdings-actions');+ if (!isOwner) {+ if (actions) actions.style.display = 'none';+ return;+ }+const receiveBtn = document.getElementById('receive-btn');const withdrawBtn = document.getElementById('withdraw-btn');const swapBtn = document.getElementById('swap-btn');@@ -1146,7 +1164,6 @@ function renderNotFound(id, reason) {document.title = 'Agent not found — three.ws';const main = document.querySelector('.ad-main');main.innerHTML = `- <div class="ad-banner"><span>S1 Powered by Torque · $250K rewards</span></div><div style="padding:60px 24px;text-align:center;"><h1 style="margin:0 0 8px;font-size:22px;font-weight:600;">Agent not found</h1><p style="color:rgba(231,233,238,0.55);font-size:14px;margin:0 0 22px;">diff --git a/src/game/ambient-crowd.js b/src/game/ambient-crowd.jsindex 55ff1f8f9..3dc4e02a0 100644--- a/src/game/ambient-crowd.js+++ b/src/game/ambient-crowd.js@@ -18,7 +18,7 @@ import { AnimationManager } from '../animation-manager.js';const AVATAR_DEFAULT = '/avatars/default.glb';const MANIFEST_URL = '/animations/manifest.json';-const GALLERY_URL = '/api/avatars/public?limit=24'; // public avatar gallery — one distinct model per wanderer+const GALLERY_URL = '/api/avatars/public?limit=96'; // public avatar gallery — a broad pool so each wanderer is a distinct community modelconst CLIP_IDLE = 'idle';const CLIP_WALK = 'av-walk-feminine';const WORLD_RADIUS = 54; // a touch inside the plaza edgediff --git a/src/game/coincommunities-ui.js b/src/game/coincommunities-ui.jsindex a8c3ab842..177a545b9 100644--- a/src/game/coincommunities-ui.js+++ b/src/game/coincommunities-ui.js@@ -14,7 +14,7 @@ import { resolveAvatarUrl } from './avatar-rig.js';import { validateGlb, uploadGlb } from './avatar-upload.js';import { GUEST_SENTINEL, playAs } from './play-handoff.js';import { COMPOSITE_PIECES } from './build-voxels.js';-import { PROP_CATALOG } from './world-objects.js';+import { PROP_CATALOG, GALLERY_PROP_PREFIX, registerGalleryProp } from './world-objects.js';import { log } from '../shared/log.js';// Degrees shown on the rotate button for each quarter-turn step (0–3).@@ -1261,22 +1261,33 @@ export class CommunityUI {_buildPropPalette() {this._activeProp = null;this._propBtns = new Map();-- const items = PROP_CATALOG.map((p) => {- const btn = el('button', {- class: 'cc-prop', type: 'button',- role: 'radio', 'aria-checked': 'false',- title: `${p.name} — place a prop (R rotates, break mode removes yours)`,- 'aria-label': p.name,- onclick: () => this.h.onPickProp?.(this._activeProp === p.id ? null : p.id),- }, [- el('span', { class: 'cc-prop-ico', 'aria-hidden': 'true', text: p.icon || '◆' }),- el('span', { class: 'cc-prop-name', text: p.name }),- ]);- this._propBtns.set(p.id, btn);- return btn;+ // Gallery streaming state: every public community model is placeable, paged in+ // after the built-in props as the user scrolls / searches / hits "More".+ this._gallery = { cursor: null, loading: false, done: false, started: false, q: '' };++ const items = PROP_CATALOG.map((p) => this._propButton(p));++ // A thin rule separates the hand-authored props from the community gallery that+ // streams in after them; hidden until the first gallery model lands.+ this._galleryDivider = el('div', { class: 'cc-prop-divider', hidden: true, 'aria-hidden': 'true' });+ this._galleryMore = el('button', {+ class: 'cc-prop cc-prop-more', type: 'button', hidden: true,+ title: 'Load more community models', 'aria-label': 'Load more community models',+ onclick: () => this._loadGalleryPage(),+ }, [+ el('span', { class: 'cc-prop-ico', 'aria-hidden': 'true', text: '+' }),+ el('span', { class: 'cc-prop-name', text: 'More' }),+ ]);+ this.propRow = el('div', { class: 'cc-prop-row', role: 'radiogroup', 'aria-label': 'Place a prop' },+ [...items, this._galleryDivider, this._galleryMore]);++ this.propSearch = el('input', {+ type: 'search', class: 'cc-prop-search', placeholder: 'Search models…',+ 'aria-label': 'Search community models', maxlength: '60', autocomplete: 'off',+ oninput: (e) => this._onGallerySearch(e.target.value),+ // Swallow keys so typing in the search box never steers the avatar/build hotkeys.+ onkeydown: (e) => e.stopPropagation(),});- const row = el('div', { class: 'cc-prop-row', role: 'radiogroup', 'aria-label': 'Place a prop' }, items);this.propRotateBtn = el('button', {class: 'cc-prop-rotate', type: 'button', disabled: true,@@ -1286,27 +1297,153 @@ export class CommunityUI {const head = el('div', { class: 'cc-prop-head' }, [el('span', { class: 'cc-prop-title', text: 'Props' }),+ this.propSearch,this.propRotateBtn,]);- this.propPalette = el('div', { id: 'cc-props', hidden: true, 'aria-label': 'Build props' }, [head, row]);+ this._galleryStatus = el('div', { class: 'cc-prop-gstatus', role: 'status', 'aria-live': 'polite', hidden: true });++ this.propPalette = el('div', { id: 'cc-props', hidden: true, 'aria-label': 'Build props' }, [head, this.propRow, this._galleryStatus]);document.body.appendChild(this.propPalette);}- /** Show/hide the props palette with build mode. */- setPropPaletteVisible(on) { if (this.propPalette) this.propPalette.hidden = !on; }+ // One placeable-prop button. Built-in props show their emoji glyph; gallery models+ // show a real thumbnail (falling back to the glyph when a model has no render yet).+ _propButton(p) {+ const ico = p.thumbnail+ ? el('img', { class: 'cc-prop-thumb', src: p.thumbnail, alt: '', loading: 'lazy', decoding: 'async' })+ : el('span', { class: 'cc-prop-ico', 'aria-hidden': 'true', text: p.icon || '◆' });+ const btn = el('button', {+ class: 'cc-prop', type: 'button',+ role: 'radio', 'aria-checked': 'false',+ title: `${p.name} — place a prop (R rotates, break mode removes yours)`,+ 'aria-label': p.name,+ onclick: () => this.h.onPickProp?.(this._activeProp === p.id ? null : p.id),+ }, [ico, el('span', { class: 'cc-prop-name', text: p.name })]);+ this._propBtns.set(p.id, btn);+ return btn;+ }++ /** Show/hide the props palette with build mode; first open kicks off the gallery. */+ setPropPaletteVisible(on) {+ if (!this.propPalette) return;+ this.propPalette.hidden = !on;+ if (on) this._startGallery();+ }/** Reflect the armed prop (null = voxel layer); toggles the rotate button. */setPropSelected(id) {this._activeProp = id ?? null;+ let foundActive = false;for (const [pid, btn] of this._propBtns) {const on = pid === this._activeProp;+ if (on) foundActive = true;btn.classList.toggle('cc-on', on);btn.setAttribute('aria-checked', on ? 'true' : 'false');}+ // A gallery prop can be armed before its button has paged in (e.g. armed by a+ // deep link); scroll the active button into view when it exists.+ if (foundActive) this._propBtns.get(this._activeProp)?.scrollIntoView?.({ block: 'nearest', inline: 'nearest' });if (this.propRotateBtn) this.propRotateBtn.disabled = this._activeProp == null;}+ // ---- community gallery as placeable props -------------------------------------+ // Kick the first gallery page when the palette first opens; cheap no-op after.+ _startGallery() {+ if (this._gallery.started) return;+ this._gallery.started = true;+ this._loadGalleryPage();+ }++ // Debounced search: re-query the gallery for models matching the typed text.+ _onGallerySearch(value) {+ const q = (value || '').trim();+ if (q === this._gallery.q) return;+ this._gallery.q = q;+ clearTimeout(this._gallerySearchT);+ this._gallerySearchT = setTimeout(() => this._resetGallery(), 260);+ }++ // Drop every streamed gallery button (keeping built-in props) and re-page from the+ // top — used when the search query changes.+ _resetGallery() {+ for (const [id, btn] of this._propBtns) {+ if (id.startsWith(GALLERY_PROP_PREFIX)) { btn.remove(); this._propBtns.delete(id); }+ }+ this._galleryDivider.hidden = true;+ this._gallery.cursor = null;+ this._gallery.done = false;+ this._loadGalleryPage();+ }++ // Fetch one page of public gallery models and stream them in as placeable props.+ async _loadGalleryPage() {+ const g = this._gallery;+ if (g.loading || g.done) return;+ g.loading = true;+ this._galleryMore.hidden = true;+ const first = !g.cursor;+ if (first) this._setGalleryStatus('Loading community models…', false);+ try {+ const params = new URLSearchParams({ limit: '48' });+ if (g.cursor) params.set('cursor', g.cursor);+ if (g.q) params.set('q', g.q);+ const r = await fetch(`/api/avatars/public?${params}`, { headers: { accept: 'application/json' } });+ if (!r.ok) throw new Error(`gallery ${r.status}`);+ const { avatars, next_cursor: next } = await r.json();+ const list = (avatars || []).filter((a) => a.id && (a.model_url || a.base_model_url));+ for (const a of list) this._appendGalleryItem(a);+ g.cursor = next || null;+ g.done = !g.cursor || list.length === 0;+ const count = this._galleryCount();+ this._galleryMore.hidden = g.done || !count;+ this._setGalleryStatus(count ? '' : (g.q ? `No models match “${g.q}”.` : 'No community models yet.'), false);+ } catch (e) {+ log.warn('[cc-ui] gallery load failed', e?.message || e);+ this._setGalleryStatus('Couldn’t load models — tap to retry.', true);+ this._galleryMore.hidden = true;+ } finally {+ g.loading = false;+ }+ }++ _galleryCount() {+ let n = 0;+ for (const id of this._propBtns.keys()) if (id.startsWith(GALLERY_PROP_PREFIX)) n++;+ return n;+ }++ // Register a gallery model with the world-object catalog (so it can be placed ++ // rendered) and add its button to the palette, just before the trailing "More".+ _appendGalleryItem(a) {+ const id = GALLERY_PROP_PREFIX + a.id;+ if (this._propBtns.has(id)) return;+ registerGalleryProp(a.id, { url: a.model_url || a.base_model_url, name: a.name, thumbnail: a.thumbnail_url });+ const btn = this._propButton({ id, name: a.name || 'Model', icon: '🧍', thumbnail: a.thumbnail_url });+ btn.classList.add('cc-prop-gallery');+ this.propRow.insertBefore(btn, this._galleryMore);+ this._galleryDivider.hidden = false;+ }++ // Render a one-line gallery status (loading / empty / error). The error variant is+ // tappable to retry the failed page.+ _setGalleryStatus(msg, isError) {+ const s = this._galleryStatus;+ if (!s) return;+ s.textContent = msg || '';+ s.hidden = !msg;+ s.classList.toggle('cc-err', !!isError);+ if (isError) {+ s.setAttribute('role', 'button');+ s.tabIndex = 0;+ s.onclick = () => { this._gallery.done = false; this._loadGalleryPage(); };+ } else {+ s.setAttribute('role', 'status');+ s.removeAttribute('tabindex');+ s.onclick = null;+ }+ }+// ---------------------------------------------------------------- share sheet (R20)// A modal that shows the captured screenshot and offers three ways to share the// build: copy a deep link back into this world, download the image, or publishdiff --git a/src/game/coincommunities.css b/src/game/coincommunities.cssindex 59e182f94..a8198343d 100644--- a/src/game/coincommunities.css+++ b/src/game/coincommunities.css@@ -1603,12 +1603,45 @@ html, body {.cc-prop:focus-visible { outline: 2px solid #66ff8c; outline-offset: 2px; }.cc-prop.cc-on { background: #f4f5f7; color: var(--cc-ink); border-color: #f4f5f7; }.cc-prop-ico { font-size: 19px; line-height: 1; }-.cc-prop-name { font-size: 10px; letter-spacing: 0.02em; white-space: nowrap; }+.cc-prop-name { font-size: 10px; letter-spacing: 0.02em; white-space: nowrap; max-width: 64px; overflow: hidden; text-overflow: ellipsis; }++/* community gallery models streamed into the props row */+.cc-prop-thumb {+ width: 30px; height: 30px; border-radius: 7px; object-fit: cover; display: block;+ background: rgba(255, 255, 255, 0.06);+}+.cc-prop.cc-on .cc-prop-thumb { box-shadow: 0 0 0 1px var(--cc-ink); }+.cc-prop-divider {+ flex: 0 0 auto; align-self: stretch; width: 1px; margin: 2px 1px;+ background: var(--cc-edge); border-radius: 1px;+}+.cc-prop-divider[hidden] { display: none; }+.cc-prop-more { border-style: dashed; border-color: var(--cc-edge); color: var(--cc-dim); }+.cc-prop-more:hover { border-color: var(--cc-edge-hi); color: var(--cc-text); }+.cc-prop-more[hidden] { display: none; }+.cc-prop-search {+ flex: 1 1 auto; min-width: 0; max-width: 220px; height: 27px; margin: 0 8px;+ padding: 0 10px; border-radius: var(--cc-radius-sm);+ border: 1px solid var(--cc-edge); background: rgba(255, 255, 255, 0.04);+ color: var(--cc-text); font: inherit; font-size: 12px;+ -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);+ transition: background 0.12s, border-color 0.12s;+}+.cc-prop-search::placeholder { color: var(--cc-dim); }+.cc-prop-search:focus { outline: none; border-color: var(--cc-edge-hi); background: rgba(255, 255, 255, 0.08); }+.cc-prop-gstatus {+ align-self: center; padding: 2px 6px; color: var(--cc-dim);+ font-size: 11px; letter-spacing: 0.02em; pointer-events: auto;+}+.cc-prop-gstatus[hidden] { display: none; }+.cc-prop-gstatus.cc-err { color: #ff8a8a; cursor: pointer; }+.cc-prop-gstatus.cc-err:focus-visible { outline: 2px solid #66ff8c; outline-offset: 2px; }@media (pointer: coarse) { #cc-props { bottom: 150px; } }@media (max-width: 560px) {#cc-props { bottom: 156px; width: 96vw; }.cc-prop { min-width: 48px; }+ .cc-prop-search { max-width: none; }}/* ---------------- share-a-build sheet (R20) ---------------- */diff --git a/src/game/npc/ambient-life.js b/src/game/npc/ambient-life.jsindex e3199e87e..231305bf2 100644--- a/src/game/npc/ambient-life.js+++ b/src/game/npc/ambient-life.js@@ -23,7 +23,7 @@ import { AnimationManager } from '../../animation-manager.js';import { buildAvatar, CLIP_WALK } from '../avatar-rig.js';import { mulberry32 } from './nav-graph.js';-const GALLERY_URL = '/api/avatars/public?limit=24';+const GALLERY_URL = '/api/avatars/public?limit=96';const DEFAULT_AVATAR = '/avatars/default.glb';const PED_WALK_SPEED = 1.35; // m/s along the loop — an unhurried strolldiff --git a/src/game/npc/npc-chat.js b/src/game/npc/npc-chat.jsindex 3931d1e41..c7fa0d97f 100644--- a/src/game/npc/npc-chat.js+++ b/src/game/npc/npc-chat.js@@ -255,7 +255,10 @@ export function openChat(npc, { ui, serviceId, persona, greeting, world } = {})input.style.height = 'auto';addBubble('me', text);history.push({ role: 'user', content: text });- if (history.length > HISTORY_CAP) history.splice(0, history.length - HISTORY_CAP);+ // Keep the context bounded, and always opening on a user turn (Anthropic+ // rejects histories that start with an assistant message).+ while (history.length > HISTORY_CAP) history.shift();+ if (history[0]?.role === 'assistant') history.shift();setBusy(true);const target = addBubble('npc', '');diff --git a/src/game/play-auth.js b/src/game/play-auth.jsindex a26966fff..1852e6355 100644--- a/src/game/play-auth.js+++ b/src/game/play-auth.js@@ -22,6 +22,7 @@ import '../../solana-mobile/src/index.js';const NONCE_URL = '/api/play/nonce';const VERIFY_URL = '/api/play/verify';+const REFRESH_URL = '/api/play/refresh';const STORE_KEY = 'cc-play-pass';// Refresh a little before the server's 10-min pass TTL so a reconnect never// races expiry; the game server sweeps expired passes every minute.@@ -163,6 +164,43 @@ export async function signInToPlay({ nonce, forceReconnect = false, onStage = ()return data;}+/**+ * Silently renew an unexpired play pass — no wallet prompt. Possession of a+ * still-valid pass proves the wallet was verified minutes ago, so the server+ * re-issues a fresh pass after re-reading the on-chain balance, without a new+ * signature. Used by the mid-session refresh so a long building session never+ * re-pops the wallet's sign-in dialog.+ *+ * @param {string} playPass the current, still-valid pass+ * @returns {Promise<object>} the /refresh result — { ok: true, wallet, balance,+ * playPass, expiresAt, … } when the wallet still clears the floor, or+ * { ok: false, reason: 'balance_too_low', … }.+ * @throws {PlayAuthError} pass_invalid (expired/forged → re-sign) | verify_failed+ */+export async function refreshPlayPass(playPass) {+ let res, body;+ try {+ res = await fetch(REFRESH_URL, {+ method: 'POST',+ credentials: 'include',+ headers: { 'content-type': 'application/json' },+ body: JSON.stringify({ playPass }),+ });+ body = await res.json().catch(() => null);+ } catch {+ throw new PlayAuthError('verify_failed', 'Network error during refresh. Check your connection and retry.');+ }+ if (!res.ok) {+ const code = body?.error || 'verify_failed';+ throw new PlayAuthError(code, body?.error_description || 'Could not renew your session.');+ }+ const data = body?.data;+ if (!data) throw new PlayAuthError('verify_failed', 'Refresh returned an unexpected response.');++ if (data.ok && data.playPass) storePass(data);+ return data;+}+// ── Session cache ────────────────────────────────────────────────────────────/** Persist a granted pass for this tab so a reload inside its TTL doesn'tdiff --git a/src/game/world-objects.js b/src/game/world-objects.jsindex bdc0f9e59..cc1ff0ee0 100644--- a/src/game/world-objects.js+++ b/src/game/world-objects.js@@ -67,9 +67,58 @@ export const PROP_CATALOG = [{ id: 'pole', name: 'Pole', icon: '🎚️', foot: 0.35, glb: '/club/props/pole.glb', fitH: 3.0 },];const PROP_BY_ID = new Map(PROP_CATALOG.map((p) => [p.id, p]));-export function propDef(type) { return PROP_BY_ID.get(type) || null; }+export function propDef(type) { return PROP_BY_ID.get(type) || GALLERY_PROPS.get(type) || null; }export const DEFAULT_PROP = PROP_CATALOG[0].id;+// ── gallery props ────────────────────────────────────────────────────────────+// Any public gallery model can be placed into a world as a prop. It rides the+// EXACT same networking as a built-in prop: a placed object's `type` is the+// gallery avatar id prefixed with `g:` (a UUID → 38 chars, comfortably inside the+// server's 48-char `type` budget), so no schema or server change is needed. The+// model's GLB url is resolved client-side — registered up-front when the user+// picks it from the palette, and lazily fetched from /api/avatars/<id> when a+// peer's placement (or a build restored from disk) references a model this client+// hasn't loaded yet. Gallery defs share the same shape as GLB catalog props+// (`glb` + `fitH` + `foot`), so the ghost, instancing and disposal paths all work+// unchanged — gallery models are just props the catalog learns about at runtime.+export const GALLERY_PROP_PREFIX = 'g:';+const DEFAULT_GALLERY_FIT = 1.8; // a human-height avatar standing on the floor+const DEFAULT_GALLERY_FOOT = 0.5; // snap-grid + ghost footprint half-extent+const GALLERY_PROPS = new Map(); // 'g:<id>' → def++export function isGalleryType(type) {+ return typeof type === 'string' && type.startsWith(GALLERY_PROP_PREFIX);+}++// Register (or refresh the url of) a gallery model so it can be placed + rendered+// as a prop. Idempotent — returns the shared def either way so callers can rely on+// `propDef('g:'+id)` immediately after.+export function registerGalleryProp(id, { url, name, thumbnail, fitH, foot } = {}) {+ const type = isGalleryType(id) ? id : GALLERY_PROP_PREFIX + id;+ let def = GALLERY_PROPS.get(type);+ if (def) { if (url) def.glb = url; return def; }+ def = {+ id: type, name: name || 'Model', icon: '🧍', gallery: true,+ glb: url || null, fitH: fitH || DEFAULT_GALLERY_FIT, foot: foot || DEFAULT_GALLERY_FOOT,+ thumbnail: thumbnail || null,+ };+ GALLERY_PROPS.set(type, def);+ return def;+}++// Resolve a gallery model we don't have registered yet (a peer placed it, or it was+// restored from a saved build) by fetching its public avatar record for the GLB url.+async function resolveGalleryDef(type) {+ const id = type.slice(GALLERY_PROP_PREFIX.length);+ const r = await fetch(`/api/avatars/${encodeURIComponent(id)}`, { headers: { accept: 'application/json' } });+ if (!r.ok) throw new Error(`avatar ${id} → ${r.status}`);+ const data = await r.json();+ const a = data?.avatar || data || {};+ const url = a.model_url || a.base_model_url || a.url;+ if (!url) throw new Error(`avatar ${id} has no model url`);+ return registerGalleryProp(id, { url, name: a.name, thumbnail: a.thumbnail_url });+}+// ── procedural prop builders (base at y=0) ───────────────────────────────────function std(color, opts = {}) {const m = new MeshStandardMaterial({ color, roughness: opts.roughness ?? 0.85, metalness: opts.metalness ?? 0 });@@ -209,11 +258,23 @@ function instanceGLB(def, holder) {// synchronous; GLB props attach a placeholder-free holder that populates on load.function buildProp(type) {const def = propDef(type);- if (!def) return neutralBox();- if (def.build) return def.build();- const holder = new Group();- instanceGLB(def, holder);- return holder;+ if (def && (def.build || def.glb)) {+ if (def.build) return def.build();+ const holder = new Group();+ instanceGLB(def, holder);+ return holder;+ }+ // A gallery model we haven't loaded yet (a peer's placement or a restored build):+ // hold the slot now and resolve the GLB url from the API, then instance it in place+ // so the object renders for real rather than vanishing.+ if (isGalleryType(type)) {+ const holder = new Group();+ resolveGalleryDef(type)+ .then((d) => instanceGLB(d, holder))+ .catch((e) => { log.warn('[world-objects] gallery resolve failed', type, e?.message || e); holder.add(neutralBox()); });+ return holder;+ }+ return neutralBox();}// Register the build-prop factory for the durable kinds R18 places. Both 'block'diff --git a/src/marketplace.js b/src/marketplace.jsindex c783f4d06..89c8d77e1 100644--- a/src/marketplace.js+++ b/src/marketplace.js@@ -595,6 +595,7 @@ function closeLobby() {// ── Weekly theme strip ───────────────────────────────────────────────────async function loadTheme() {+ renderThemeSkeleton();try {const r = await fetch(`${API}/marketplace/theme`);if (!r.ok) return;@@ -608,6 +609,22 @@ async function loadTheme() {}}+// Show the strip with a shimmer immediately so the top of the page never pops+// in late. Replaced by the real lineup once /theme resolves.+function renderThemeSkeleton() {+ const strip = $('market-theme-strip');+ const picks = $('market-theme-picks');+ if (!strip || !picks) return;+ picks.hidden = false;+ picks.innerHTML = Array.from({ length: 6 })+ .map(+ () =>+ `<div class="market-theme-pick is-skeleton" aria-hidden="true"><div class="market-theme-pick-stage"></div><div class="market-theme-pick-meta"><span class="market-theme-pick-name"> </span><span class="market-theme-pick-cat"> </span></div></div>`,+ )+ .join('');+ strip.hidden = false;+}+function renderTheme() {const strip = $('market-theme-strip');if (!strip || !state.theme) return;@@ -616,21 +633,105 @@ function renderTheme() {if (titleEl) titleEl.textContent = state.theme.title;if (blurbEl) blurbEl.textContent = state.theme.blurb || '';const cta = $('market-theme-cta');- if (cta && state.theme.tag) {+ // The theme endpoint scopes by category (general = all). Wire the CTA to+ // browse that category; hide it for the catch-all "general" weeks.+ const cat = state.theme.category;+ if (cta && cat && cat !== 'general') {cta.hidden = false;- cta.textContent = `Browse #${state.theme.tag} →`;+ cta.textContent = `Browse ${CATEGORY_LABELS[cat] || cat} →`;cta.onclick = () => {- els.search.value = state.theme.tag;- state.q = state.theme.tag;+ state.category = cat;+ state.cursor = null;loadList(true);+ if (typeof highlightCategoryChips === 'function') highlightCategoryChips();window.scrollTo({ top: 0, behavior: 'smooth' });};} else if (cta) {cta.hidden = true;}+ renderThemePicks();strip.hidden = false;}+// Render the randomized 3D lineup. Every agent here is guaranteed (by the API)+// to carry a public avatar GLB, so each card shows a live rotating model. We+// reshuffle client-side too, so revisiting the page varies the order even when+// the API response is served from cache.+function renderThemePicks() {+ const row = $('market-theme-picks');+ if (!row) return;+ const all = (state.theme?.agents || []).filter((a) => a.avatar_glb_url);+ if (!all.length) {+ row.hidden = true;+ row.innerHTML = '';+ return;+ }+ const picks = shuffle(all.slice()).slice(0, 6);+ row.hidden = false;+ row.innerHTML = picks+ .map((a, i) => {+ const views = a.views_count || 0;+ const catLabel = CATEGORY_LABELS[a.category] || a.category || 'Agent';+ return `<button type="button" class="market-theme-pick" role="listitem" data-id="${escapeHtml(a.id)}" title="${escapeHtml(a.name || 'Agent')}" aria-label="${escapeHtml(a.name || 'Agent')} — ${fmtNumber(views)} views">+ <div class="market-theme-pick-stage">+ <span class="market-theme-pick-rank">#${i + 1}</span>+ ${views > 0 ? `<span class="market-theme-pick-views">⊙ ${fmtNumber(views)}</span>` : ''}+ <span class="market-theme-pick-placeholder" aria-hidden="true">${escapeHtml(initial(a.name || 'A'))}</span>+ <model-viewer+ src="${escapeHtml(a.avatar_glb_url)}"+ alt="${escapeHtml(a.name || 'Agent')}"+ ${a.thumbnail_url ? `poster="${escapeHtml(a.thumbnail_url)}"` : ''}+ auto-rotate+ autoplay+ rotation-per-second="22deg"+ interaction-prompt="none"+ disable-zoom+ disable-pan+ disable-tap+ camera-controls+ exposure="1.05"+ shadow-intensity="0.5"+ tone-mapping="aces"+ loading="lazy"+ reveal="auto"+ ></model-viewer>+ </div>+ <div class="market-theme-pick-meta">+ <span class="market-theme-pick-name">${escapeHtml(a.name || 'Untitled')}</span>+ <span class="market-theme-pick-cat">${escapeHtml(catLabel)}</span>+ </div>+ </button>`;+ })+ .join('');+ row.querySelectorAll('.market-theme-pick').forEach((card) => {+ card.addEventListener('click', () => navTo(`/marketplace/agents/${card.dataset.id}`));+ const mv = card.querySelector('model-viewer');+ if (mv) {+ mv.addEventListener('load', () => card.classList.add('mv-loaded'), { once: true });+ mv.addEventListener('poster-dismissed', () => card.classList.add('mv-loaded'), { once: true });+ // If a GLB 404s or is CORS-blocked, drop the card so the strip never+ // shows an empty stage.+ mv.addEventListener(+ 'error',+ () => {+ card.remove();+ if (!row.querySelector('.market-theme-pick')) row.hidden = true;+ },+ { once: true },+ );+ }+ });+}++// Fisher–Yates shuffle. Browser-only path, so Math.random is fine here.+function shuffle(arr) {+ for (let i = arr.length - 1; i > 0; i--) {+ const j = Math.floor(Math.random() * (i + 1));+ [arr[i], arr[j]] = [arr[j], arr[i]];+ }+ return arr;+}+// ── Featured hero (rotating 3D showcase) ─────────────────────────────────async function loadFeatured() {