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: Implement atomic pairing for Upstash credentials and enhance meta tags for SEO
nirholas5d94038e1db6
diff --git a/api/_lib/env.js b/api/_lib/env.jsindex 6f559beaa..af317f747 100644--- a/api/_lib/env.js+++ b/api/_lib/env.js@@ -126,6 +126,42 @@ function cred(value) {return v || undefined;}+// Resolve a URL+token credential as an ATOMIC PAIR from the same source. Each+// `sources` entry is [urlVarName, tokenVarName] in priority order; the first+// entry where BOTH halves are present (after cred() trimming) wins, and its url+// AND token are returned together. Resolving the two halves through independent+// `||` chains (the prior shape) let a URL set on one alias (Upstash store A) pair+// with a token that fell through to a different alias (store B) — URL-A + token-B+// authenticates as "WRONGPASS invalid or missing auth token" even though both+// vars are individually "set". That cross-store mismatch is indistinguishable+// from a stale token in the logs and degraded the limiter/cache/usage/x402-feed+// to memory fallback fleet-wide. Pairing by source makes a mismatch impossible:+// a token can never be matched against a different store's URL. Returns+// { url, token } with undefined halves when no source is fully configured.+function pickPair(sources) {+ for (const [urlVar, tokenVar] of sources) {+ const url = cred(opt(urlVar));+ const token = cred(opt(tokenVar));+ if (url && token) return { url, token };+ }+ return { url: undefined, token: undefined };+}++// Upstash REST credential sources for the shared rate-limiter/usage store, in+// priority order. Manual UPSTASH_* first, then the Vercel-KV marketplace+// integration's prefixed (`three_`) and bare (`KV_`) injected names.+const REDIS_REST_SOURCES = [+ ['UPSTASH_REDIS_REST_URL', 'UPSTASH_REDIS_REST_TOKEN'],+ ['three_KV_REST_API_URL', 'three_KV_REST_API_TOKEN'],+ ['KV_REST_API_URL', 'KV_REST_API_TOKEN'],+];++// Optional dedicated cache store (api/_lib/cache.js), same atomic-pairing rule.+const REDIS_CACHE_SOURCES = [+ ['UPSTASH_CACHE_REST_URL', 'UPSTASH_CACHE_REST_TOKEN'],+ ['cache_KV_REST_API_URL', 'cache_KV_REST_API_TOKEN'],+];+export const env = {get APP_ORIGIN() {return normalizeAppOrigin(opt('PUBLIC_APP_ORIGIN'));@@ -162,21 +198,13 @@ export const env = {return trimSlash(req('S3_PUBLIC_DOMAIN'));},+ // Resolved as an atomic pair (see pickPair) so URL and token always come from+ // the SAME Upstash store — never a store-A URL with a store-B token (WRONGPASS).get UPSTASH_REDIS_REST_URL() {- // cred() each candidate (not the coalesced result) so a whitespace-only- // primary falls through to the next alias instead of masking it.- return (- cred(opt('UPSTASH_REDIS_REST_URL')) ||- cred(opt('three_KV_REST_API_URL')) ||- cred(opt('KV_REST_API_URL'))- );+ return pickPair(REDIS_REST_SOURCES).url;},get UPSTASH_REDIS_REST_TOKEN() {- return (- cred(opt('UPSTASH_REDIS_REST_TOKEN')) ||- cred(opt('three_KV_REST_API_TOKEN')) ||- cred(opt('KV_REST_API_TOKEN'))- );+ return pickPair(REDIS_REST_SOURCES).token;},// Optional dedicated cache store, separate from the rate-limiter store above.@@ -190,10 +218,10 @@ export const env = {// back to the shared store, then to in-memory — no behavior change. The Vercel-KV// marketplace names for a second store prefixed `cache` are accepted too.get UPSTASH_CACHE_REST_URL() {- return cred(opt('UPSTASH_CACHE_REST_URL')) || cred(opt('cache_KV_REST_API_URL'));+ return pickPair(REDIS_CACHE_SOURCES).url;},get UPSTASH_CACHE_REST_TOKEN() {- return cred(opt('UPSTASH_CACHE_REST_TOKEN')) || cred(opt('cache_KV_REST_API_TOKEN'));+ return pickPair(REDIS_CACHE_SOURCES).token;},// ── Upstash quota-burn visibility (api/_lib/redis-usage.js) ──────────────diff --git a/api/_lib/launcher-engine.js b/api/_lib/launcher-engine.jsindex 5d6e5c249..f8099aad9 100644--- a/api/_lib/launcher-engine.js+++ b/api/_lib/launcher-engine.js@@ -120,6 +120,24 @@ async function ensureSchema() {await sql`create index if not exists launcher_runs_scope_idx on launcher_runs (scope, created_at desc)`;await sql`create index if not exists launcher_runs_spend_idx on launcher_runs (created_at) where status in ('funded','launched','confirmed')`;await sql`create unique index if not exists launcher_runs_mint_uniq on launcher_runs (mint) where mint is not null`;+ await sql`+ create table if not exists launcher_claims (+ id uuid primary key default gen_random_uuid(),+ run_id uuid references launcher_runs(id) on delete set null,+ agent_id uuid,+ mint text not null,+ claimed_lamports bigint not null default 0,+ claimed_sol float8 not null default 0,+ buyback_sol float8 not null default 0,+ buyback_sig text,+ claim_sig text,+ network text not null default 'mainnet',+ scope text not null default 'global',+ created_at timestamptz not null default now()+ )+ `;+ await sql`create index if not exists launcher_claims_run_idx on launcher_claims (run_id, created_at desc)`;+ await sql`create index if not exists launcher_claims_created_idx on launcher_claims (created_at desc)`;await sql`insert into launcher_config (scope, enabled, dry_run, mode)values ('global', false, true, 'hybrid')diff --git a/api/_lib/launcher-trends.js b/api/_lib/launcher-trends.jsindex 5cce1bca8..c921cd1f6 100644--- a/api/_lib/launcher-trends.js+++ b/api/_lib/launcher-trends.js@@ -46,6 +46,7 @@ const SOURCE_WEIGHT = {trending: 2.6,knowyourmeme: 2.0,x: 1.4,+ googletrends: 1.3,hackernews: 1.2,reddit: 1.2,wikipedia: 1.0,@@ -53,10 +54,11 @@ const SOURCE_WEIGHT = {// External providers are opt-in via the config `sources` array; internal ones run// whenever named. These ids are the vocabulary an operator enables.-const EXTERNAL_SOURCES = new Set(['knowyourmeme', 'hackernews', 'reddit', 'wikipedia']);-// knowyourmeme rides in the default set: it's the freshest stream of named memes-// entering culture — exactly what the launcher exists to mint into.-const DEFAULT_SOURCES = ['coin_intel', 'trending', 'knowyourmeme', 'x'];+const EXTERNAL_SOURCES = new Set(['knowyourmeme', 'googletrends', 'hackernews', 'reddit', 'wikipedia']);+// knowyourmeme + googletrends ride in the default set: the freshest stream of+// named memes (KYM) and the broadest real-time attention signal (Google Trends) —+// exactly what the launcher exists to mint into.+const DEFAULT_SOURCES = ['coin_intel', 'trending', 'knowyourmeme', 'googletrends', 'x'];// ── text hygiene ────────────────────────────────────────────────────────────────const STOPWORDS = new Set([@@ -444,11 +446,54 @@ async function knowYourMemeSignals() {});}+/**+ * Google Daily Search Trends — the broadest real-time "what is the world looking+ * up right now" signal. Each item is a trending search term with approximate+ * traffic and the news driving it. Weighted by traffic and, crucially, gated on+ * the news context for brand-safety: a term trending BECAUSE of a tragedy (whose+ * own words look clean) is dropped before it can become a coin theme — the news+ * headlines are scanned with isSensitive, belt-and-braces with the LLM prompt.+ * Reduced to generic themes (the $THREE rule). Key-less, cached, never throws.+ * @returns {Promise<Array<{term:string, weight:number, kind:string}>>}+ */+// Pure parse of a Google Trends RSS body → safe, weighted theme rows. Exported+// for unit tests (network-free); the provider just wraps this in fetch + cache.+function parseGoogleTrends(xml) {+ const blocks = String(xml || '').match(/<item\b[\s\S]*?<\/item>/gi) || [];+ const out = [];+ for (const b of blocks.slice(0, 25)) {+ const titleM = b.match(/<title\b[^>]*>([\s\S]*?)<\/title>/i);+ const term = normTerm(decodeEntities(titleM ? titleM[1] : ''));+ if (!term) continue;+ // Read the news headlines driving the trend; skip anything sensitive even+ // when the bare term is clean (e.g. a name trending after a death).+ const news = (b.match(/<ht:news_item_title>([\s\S]*?)<\/ht:news_item_title>/gi) || [])+ .map((m) => decodeEntities(m.replace(/<\/?ht:news_item_title>/gi, '')))+ .join(' ');+ if (isSensitive(`${term} ${news}`)) continue;+ const trafM = b.match(/<ht:approx_traffic>([\s\S]*?)<\/ht:approx_traffic>/i);+ const traffic = trafM ? Number(String(trafM[1]).replace(/[^\d]/g, '')) || 0 : 0;+ // 1k searches → ~0.78, 100k → ~1.3, capped — log-scaled so a viral spike+ // outranks routine chatter without swamping the cross-source signal.+ const weight = Math.max(0.6, Math.min(1.6, 0.6 + Math.log10(Math.max(10, traffic)) / 5));+ out.push({ term: term.toLowerCase(), weight, kind: 'event' });+ }+ return out;+}++async function googleTrendsSignals() {+ return cached('launcher:trend:gtrends', PROVIDER_CACHE_TTL_S, async () => {+ const xml = await fetchText('https://trends.google.com/trending/rss?geo=US');+ return parseGoogleTrends(xml);+ });+}+const PROVIDERS = {coin_intel: coinIntelSignals,trending: oracleSignals,knowyourmeme: knowYourMemeSignals,x: xSignals,+ googletrends: googleTrendsSignals,hackernews: hackerNewsSignals,reddit: redditSignals,wikipedia: wikipediaSignals,@@ -548,4 +593,4 @@ export async function rankNarratives({ network = 'mainnet', sources, categoriesexport { EXTERNAL_SOURCES, DEFAULT_SOURCES };// Exported for unit tests (pure, network-free).-export { decodeEntities, parseRssItems, extractThemes, normTerm };+export { decodeEntities, parseRssItems, extractThemes, normTerm, parseGoogleTrends, isSensitive };diff --git a/api/_lib/migrations/20260629060000_coin_launcher.sql b/api/_lib/migrations/20260629060000_coin_launcher.sqlindex 9e67a475d..ab0e52304 100644--- a/api/_lib/migrations/20260629060000_coin_launcher.sql+++ b/api/_lib/migrations/20260629060000_coin_launcher.sql@@ -38,8 +38,8 @@ create table if not exists launcher_config (mode text not null default 'hybrid'check (mode in ('off', 'trend', 'meme', 'random', 'hybrid')),-- Which trend providers feed 'trend'/'hybrid' mode, e.g.- -- ["coin_intel","trending","knowyourmeme","x"]. Empty ⇒ all configured providers.- sources jsonb not null default '["coin_intel","trending","knowyourmeme","x"]'::jsonb,+ -- ["coin_intel","trending","knowyourmeme","googletrends","x"]. Empty ⇒ all configured providers.+ sources jsonb not null default '["coin_intel","trending","knowyourmeme","googletrends","x"]'::jsonb,-- Restrict trend picks to these pump_coin_intel categories (meme/culture/...).-- Empty ⇒ no category filter.categories jsonb not null default '[]'::jsonb,diff --git a/api/_lib/pulse-trading.js b/api/_lib/pulse-trading.jsnew file mode 100644index 000000000..a5c9a3935--- /dev/null+++ b/api/_lib/pulse-trading.js@@ -0,0 +1,56 @@+// Pure derivations for the Pulse "Trading viability" view.+//+// Deliberately free of SQL/DB/HTTP so the money math the panel — and any agent+// client hitting GET /api/pulse?view=trading — depends on can be unit-pinned. The+// handler in api/pulse.js runs the queries and feeds the raw rows through these.+//+// Invariant the panel leans on: a window's `trades` is a straight pass-through of+// the COUNT the headline counter uses, so the viability panel can never drift from+// the number at the top of the page.++const LAMPORTS_PER_SOL = 1e9;++export const solFromLamports = (lamports) => Number(lamports || 0) / LAMPORTS_PER_SOL;++// One windowed custody-ledger aggregate row → the public window shape.+// Buys carry SOL out in amount_lamports (asset='SOL'); sells carry only token base+// units, so SUM(amount_lamports) over the window is exactly the SOL deployed into+// buys, and the average trade is that spend amortised over the buy count.+export function shapeTradingWindow(row) {+ const trades = Number(row?.trades || 0);+ const buys = Number(row?.buys || 0);+ const deployedSol = solFromLamports(row?.deployed_lamports);+ return {+ trades,+ buys,+ sells: Number(row?.sells || 0),+ deployed_sol: deployedSol,+ deployed_usd: Number(row?.deployed_usd || 0),+ traders: Number(row?.traders || 0),+ avg_trade_sol: buys > 0 ? deployedSol / buys : 0,+ };+}++// Closed-position P&L aggregate row → the public realized-P&L shape. `win_rate` is+// null (not 0) when nothing has closed yet, so a fresh pilot reads as "no closes"+// rather than a misleading 0% — the panel keys its empty state off closed_positions.+export function shapeTradingPnl(row) {+ const closed = Number(row?.closed_count || 0);+ const wins = Number(row?.wins || 0);+ return {+ net_sol: solFromLamports(row?.net_lamports),+ closed_positions: closed,+ wins,+ win_rate: closed > 0 ? wins / closed : null,+ };+}++// 7-day daily rows → zero-filled sparkline points (the SQL already zero-fills days).+export function shapeTradingSeries(rows) {+ return (rows || []).map((r) => ({+ label: r.label,+ day: r.day,+ trades: Number(r.trades || 0),+ deployed_sol: solFromLamports(r.deployed_lamports),+ }));+}diff --git a/api/_mcp3d/dispatch.js b/api/_mcp3d/dispatch.jsindex 14552bdb8..375bdf652 100644--- a/api/_mcp3d/dispatch.js+++ b/api/_mcp3d/dispatch.js@@ -11,6 +11,8 @@ const INSTRUCTIONS = ['Pipeline: optionally direct_prompt(idea) to sharpen a vague prompt, then text_to_3d(prompt) or','image_to_3d(image_url) to generate (tier=draft|standard|high, path=image|geometry); poll','generation_status(job_id) until it returns a GLB and an inline <model-viewer> artifact.',+ 'capture_scene(video_url) reconstructs a REAL space from a video into an explorable 3D point cloud',+ '(poll generation_status for the .ply + an inline point-cloud viewer artifact).','auto_rig_model(glb_url) adds a skeleton; apply_animation(model_url, animation) and pose_model(prompt)','drive the rigged result; list_animations enumerates clips. Mesh ops: remesh_model, stylize_model,','segment_model, retexture_model, retexture_region, generate_material. preview_3d(glb_url) renders any',diff --git a/api/_mcp3d/pricing.js b/api/_mcp3d/pricing.jsindex 57e735adf..d214174bf 100644--- a/api/_mcp3d/pricing.js+++ b/api/_mcp3d/pricing.js@@ -37,6 +37,10 @@ export const TOOL_PRICING = Object.freeze({amount_usdc: 0.05,description: 'Per call — add an animation-ready skeleton to a GLB',},+ capture_scene: {+ amount_usdc: 0.05,+ description: 'Per call — video → 3D scene reconstruction (coloured .ply point cloud)',+ },retexture_model: {amount_usdc: 0.05,description: 'Per call — repaint a full mesh from a text prompt',diff --git a/api/_mcp3d/tools/studio.js b/api/_mcp3d/tools/studio.jsindex 12b169f85..a45421eb9 100644--- a/api/_mcp3d/tools/studio.js+++ b/api/_mcp3d/tools/studio.js@@ -185,6 +185,23 @@ function viewerArtifact({ glbUrl, name, options = {} }) {};}+// Inline artifact for a captured point cloud (.ply). model-viewer can't render a+// raw point cloud, so we embed the three.ws WebGL point-cloud viewer (/capture in+// chrome-less embed mode) pointed at the .ply via its ?src= deep link.+function pointCloudArtifact({ plyUrl, name }) {+ const viewer = `${env.APP_ORIGIN}/capture?embed=1&src=${encodeURIComponent(plyUrl)}`;+ const safeName = String(name || 'Captured 3D scene').replace(/[&<>"]/g, (c) =>+ ({ '&': '&', '<': '<', '>': '>', '"': '"' })[c]);+ const html =+ `<!doctype html><html><head><meta charset="utf-8"><title>${safeName}</title>` ++ `<style>html,body{margin:0;height:100%;background:#0a0a0a}iframe{border:0;width:100%;height:100%;display:block}</style>` ++ `</head><body><iframe src="${viewer}" allow="fullscreen" title="${safeName}"></iframe></body></html>`;+ return {+ type: 'resource',+ resource: { uri: plyUrl, mimeType: 'text/html', text: html },+ };+}+// The Apps SDK template URL the embodiment component is served from. A persona// tool result references this so a host (ChatGPT/Claude) renders the LIVING body// inline — the same hosted page the local demo harness drives.@@ -896,6 +913,34 @@ export const toolDefs = [};}+ // Scene-capture jobs (capture_scene) finish as a .ply point cloud, not a+ // GLB mesh — return the cloud URL + an inline point-cloud viewer artifact.+ if (result.status === 'done' && result.resultPointCloudUrl) {+ const plyUrl = result.resultPointCloudUrl;+ const pts = result.numPoints ? `${result.numPoints.toLocaleString('en-US')} points` : 'point cloud';+ const frames = result.frames ? ` from ${result.frames} frames` : '';+ return {+ content: [+ {+ type: 'text',+ text:+ `Your 3D scene is ready — ${pts}${frames}.\nPoint cloud (.ply): ${plyUrl}\n` ++ `Explore it: ${env.APP_ORIGIN}/capture?src=${encodeURIComponent(plyUrl)}\n` ++ 'Display the attached text/html resource as an inline 3D point-cloud viewer.',+ },+ pointCloudArtifact({ plyUrl, name: 'Captured 3D scene' }),+ ],+ structuredContent: {+ job_id: args.job_id,+ status: 'done',+ point_cloud_url: plyUrl,+ num_points: result.numPoints ?? null,+ frames: result.frames ?? null,+ viewer_url: `${env.APP_ORIGIN}/capture?src=${encodeURIComponent(plyUrl)}`,+ },+ };+ }+if (result.status === 'failed') {return {content: [@@ -924,6 +969,111 @@ export const toolDefs = [};},},+ {+ name: 'capture_scene',+ title: 'Reconstruct a 3D scene from a video',+ annotations: GENERATIVE_ANNOTATIONS,+ description:+ 'Turn a video of a real space (a room, a street, an object walkaround) into an explorable 3D ' ++ 'point cloud. A feed-forward streaming reconstructor (LingBot-Map) grounds coordinates, reads ' ++ 'dense geometry, and corrects drift across the whole clip, then returns a coloured .ply point ' ++ 'cloud. Pass a public https video URL (mp4/mov/webm). Returns a job_id — poll generation_status; ' ++ 'when finished it returns the point-cloud URL and an inline viewer artifact. Best with steady, ' ++ 'well-lit footage that orbits or walks through the space. This is geometry capture of a REAL ' ++ 'scene — distinct from text_to_3d/image_to_3d, which synthesize a single object mesh.',+ inputSchema: {+ type: 'object',+ properties: {+ video_url: {+ type: 'string',+ format: 'uri',+ description: 'Public https URL of the source video (mp4, mov, or webm).',+ },+ mode: {+ type: 'string',+ enum: ['streaming', 'windowed'],+ default: 'streaming',+ description: 'streaming = default; windowed = for very long clips (>3000 frames).',+ },+ fps: {+ type: 'integer',+ minimum: 1,+ maximum: 30,+ default: 8,+ description: 'Frames per second to sample from the video.',+ },+ keyframe_interval: {+ type: 'integer',+ minimum: 1,+ maximum: 64,+ default: 4,+ description: 'Cache every N-th frame as a keyframe — lower is denser/slower.',+ },+ mask_sky: {+ type: 'boolean',+ default: true,+ description: 'Drop sky points from the reconstruction.',+ },+ max_points: {+ type: 'integer',+ minimum: 50000,+ maximum: 3000000,+ default: 1500000,+ description: 'Cap on the total points in the output cloud.',+ },+ },+ required: ['video_url'],+ additionalProperties: false,+ },+ async handler(args, auth) {+ await enforce(limits.mcp3dGenerate, auth);+ if (!(await isPublicHttpsUrl(args.video_url))) {+ return {+ content: [{ type: 'text', text: 'Error: video_url must be a public https URL.' }],+ isError: true,+ };+ }+ let provider;+ try {+ provider = regenProvider('video2scene');+ } catch {+ provider = null;+ }+ if (!provider || !provider.supportsMode('video2scene')) {+ return {+ content: [{+ type: 'text',+ text: 'Scene capture is not configured on this server (set GCP_VIDEO2SCENE_URL and GCP_RECONSTRUCTION_KEY).',+ }],+ isError: true,+ };+ }+ const params = {+ mode: args.mode === 'windowed' ? 'windowed' : 'streaming',+ fps: args.fps || 8,+ keyframe_interval: args.keyframe_interval || 4,+ mask_sky: args.mask_sky !== false,+ max_points: args.max_points || 1_500_000,+ };+ const job = await provider.submit({ mode: 'video2scene', sourceUrl: args.video_url, params });+ return {+ content: [{+ type: 'text',+ text:+ `Started reconstructing a 3D scene from the video (${params.mode}).\n` ++ `Job ID: ${job.extJobId}\n` ++ 'Poll with generation_status. Reconstruction typically takes a few minutes for a longer clip.',+ }],+ structuredContent: {+ job_id: job.extJobId,+ status: 'queued',+ source_video_url: args.video_url,+ mode: params.mode,+ eta_seconds: job.eta,+ },+ };+ },+ },{name: 'preview_3d',title: 'Preview any GLB as an interactive 3D artifact',diff --git a/api/admin/launcher.js b/api/admin/launcher.jsindex 56a296842..f668f6e10 100644--- a/api/admin/launcher.js+++ b/api/admin/launcher.js@@ -26,7 +26,7 @@ function isCronAuth(req) {}const MODES = ['off', 'trend', 'meme', 'random', 'hybrid'];-const KNOWN_SOURCES = ['coin_intel', 'trending', 'x', 'oracle', 'knowyourmeme', 'hackernews', 'reddit', 'wikipedia'];+const KNOWN_SOURCES = ['coin_intel', 'trending', 'x', 'oracle', 'knowyourmeme', 'googletrends', 'hackernews', 'reddit', 'wikipedia'];// jsonb columns arrive as arrays or (depending on driver) JSON strings — coerce.function coerceArr(v) {diff --git a/api/launcher/narratives.js b/api/launcher/narratives.jsnew file mode 100644index 000000000..6e5562d04--- /dev/null+++ b/api/launcher/narratives.js@@ -0,0 +1,59 @@+// GET /api/launcher/narratives — public, read-only feed of the live cultural+// narratives the autonomous launcher is riding right now.+//+// This is the launcher's intelligence made public: any agent (or the homepage,+// or a curious holder) can ask "what is the internet talking about, ranked, with+// which sources confirm it" and use it to decide what to coin — making it far+// easier for agents to ride a real wave instead of guessing. Themes ONLY, never+// tickers (the $THREE rule, enforced upstream in launcher-trends). Cached hard,+// degrades to an empty list, never throws.+//+// ?network=mainnet|devnet (default mainnet)+// ?limit=1..40 (default 24)+// ?sources=knowyourmeme,googletrends,... (subset of the known providers)+//+// Response: { ok, network, top, terms:[{term,score,sources,kind}], themes, providers, updated }++import { cors, json, method, wrap } from '../_lib/http.js';+import { rankNarratives, DEFAULT_SOURCES, EXTERNAL_SOURCES } from '../_lib/launcher-trends.js';++// The vocabulary a caller may request. Internal venue signals (coin_intel,+// trending) plus every external culture provider — all reduced to themes.+const ALLOWED = new Set([...DEFAULT_SOURCES, ...EXTERNAL_SOURCES, 'coin_intel', 'trending', 'x']);++export default wrap(async (req, res) => {+ if (cors(req, res, { methods: 'GET,OPTIONS', origins: '*' })) return;+ if (!method(req, res, ['GET'])) return;++ const url = new URL(req.url, 'http://x');+ const network = url.searchParams.get('network') === 'devnet' ? 'devnet' : 'mainnet';+ const limit = Math.max(1, Math.min(40, Number(url.searchParams.get('limit')) || 24));+ const requested = (url.searchParams.get('sources') || '')+ .split(',')+ .map((s) => s.trim().toLowerCase())+ .filter(Boolean)+ .filter((s) => ALLOWED.has(s));++ let result = null;+ try {+ result = await rankNarratives({+ network,+ sources: requested.length ? requested : undefined,+ limit,+ });+ } catch {+ /* intelligence dark — fall through to an empty, honest payload */+ }++ // Cache at the edge: the underlying providers are themselves cached ~3–5 min,+ // so a 60s browser / 120s shared cache keeps this cheap without going stale.+ res.setHeader('cache-control', 'public, max-age=60, s-maxage=120, stale-while-revalidate=300');+ return json(res, 200, {+ ok: true,+ network,+ top: result?.top || null,+ terms: result?.terms || [],+ themes: result?.themes || [],+ providers: result?.providers || [],+ });+});diff --git a/api/pulse.js b/api/pulse.jsindex c141a577c..ffb016c0b 100644--- a/api/pulse.js+++ b/api/pulse.js@@ -22,6 +22,7 @@// GET /api/pulse?agent_id=<id> — one agent's public "wallet story"// GET /api/pulse?view=stats — aggregate money intelligence// GET /api/pulse?view=marketplace — marketplace commerce viability metrics+// GET /api/pulse?view=trading — trading viability: activity, cost, realized P&L// GET /api/pulse?view=agent-summary&agent_id=<id> — one wallet's lifetime summary//// Filters: type=all|tips|launches|trades|payments, network=mainnet|devnet.@@ -34,6 +35,7 @@ import { publicUrl as r2PublicUrl } from './_lib/r2.js';import { explorerTxUrl, explorerAccountUrl } from './_lib/avatar-wallet.js';import { cacheGet, cacheSet } from './_lib/cache.js';import { marketplaceFeeBps } from './_lib/marketplace-platform-fee.js';+import { shapeTradingWindow, shapeTradingPnl, shapeTradingSeries, solFromLamports } from './_lib/pulse-trading.js';// The custody categories that are safe to surface publicly. Everything else// (withdraw, vanity_swap, limit_change, key_recover) is owner-private and is@@ -736,18 +738,7 @@ async function handleTrading(network) {AND ce.status IN ('ok', 'confirmed')AND ce.created_at > now() - ${interval}::interval`;- const trades = Number(r?.trades || 0);- const buys = Number(r?.buys || 0);- const deployedSol = Number(r?.deployed_lamports || 0) / 1e9;- return {- trades,- buys,- sells: Number(r?.sells || 0),- deployed_sol: deployedSol,- deployed_usd: Number(r?.deployed_usd || 0),- traders: Number(r?.traders || 0),- avg_trade_sol: buys > 0 ? deployedSol / buys : 0,- };+ return shapeTradingWindow(r);};// Realized P&L over 7d from CLOSED positions across both real position tables.@@ -829,26 +820,12 @@ async function handleTrading(network) {seriesPromise,]);- const closedCount = Number(pnl?.closed_count || 0);- const wins = Number(pnl?.wins || 0);- const netPnlSol = Number(pnl?.net_lamports || 0) / 1e9;-return {network,window_24h: d24,window_7d: d7,- realized_pnl_7d: {- net_sol: netPnlSol,- closed_positions: closedCount,- wins,- win_rate: closedCount > 0 ? wins / closedCount : null,- },- series_7d: series.map((r) => ({- label: r.label,- day: r.day,- trades: Number(r.trades || 0),- deployed_sol: Number(r.deployed_lamports || 0) / 1e9,- })),+ realized_pnl_7d: shapeTradingPnl(pnl),+ series_7d: shapeTradingSeries(series),top_traders: topTraders.map((r) => ({id: r.agent_id,name: r.agent_name || 'Agent',@@ -856,7 +833,7 @@ async function handleTrading(network) {avatar_thumbnail_url: r2Url(r.thumb_key, r.avatar_vis === 'public' || r.avatar_vis === 'unlisted'),solana_address: r.agent_addr || null,trades: Number(r.trades || 0),- deployed_sol: Number(r.deployed_lamports || 0) / 1e9,+ deployed_sol: solFromLamports(r.deployed_lamports),})),};}diff --git a/content/glyph-agent-economy.md b/content/glyph-agent-economy.mdnew file mode 100644index 000000000..c6e824705--- /dev/null+++ b/content/glyph-agent-economy.md@@ -0,0 +1,324 @@+# three.ws: The Watchable Agent Economy++Content package built around the live agent profile at+https://three.ws/agents/9507e401-b4dd-42e6-a1eb-806ee0ac28d4++Six ready-to-publish pieces explaining the agent-to-agent economy: a live screen+you can watch, money streaming by the second, x402 agent-to-agent payments,+governed autonomous budgets, on-chain reputation, and what is being built next.++**House rules applied to every piece below:**+- No em dashes anywhere.+- No emojis.+- $THREE is the only coin referenced. CA: `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`+- Accessible first, then technical, then futuristic with cited data.+- Every mechanic verified against the codebase. Every market stat is sourced and+ flagged as hard data or projection.++**Accuracy guardrails honored:**+- Agent-to-agent payment is autonomous once the owner signs a spending mandate,+ not zero-human-ever.+- The live screen viewer streams the agent's desktop frames plus an activity log.+ The avatar walk is a separate 3D world. The two are kept distinct.+- The "dark" feed state means the agent stopped broadcasting (publisher side),+ not the viewer closing a tab.+- x402 figures use cumulative totals (150M+ payments), not volatile daily numbers.++---++## Contents++1. [Community member thread (X)](#1-community-member-thread-x)+2. [@trythreews brand account thread (X)](#2-trythreews-brand-account-thread-x)+3. [Founder perspective thread (X)](#3-founder-perspective-thread-x)+4. [Long-form article (X Articles)](#4-long-form-article-x-articles)+5. [Press release](#5-press-release)+6. [CoinMarketCap in-depth article](#6-coinmarketcap-in-depth-article)+7. [Source notes: verified mechanics and cited market data](#source-notes-verified-mechanics-and-cited-market-data)++---++## 1. Community member thread (X)++**1/** I think I just watched the future of crypto and AI in one browser tab.++Not a demo. Not a pitch deck. A real AI agent, working, earning, and paying other agents. Live, on screen, right now.++Let me walk you through what this actually is.+https://three.ws/agents/9507e401-b4dd-42e6-a1eb-806ee0ac28d4++**2/** Open the link and you land on an AI agent's profile. But it is alive. One panel shows the agent's actual screen, real screenshots streaming in. Beside it, a 3D avatar of the agent. Below, a running log of everything it is doing.++**3/** The screen is not a video file. The agent pushes image frames to the platform, and your browser holds a live connection that repaints the instant a new frame lands, about twice a second. When the agent stops working, the feed honestly goes dark. No fake "live" loop.++**4/** The activity log is its last 50 actions, newest first, each tagged: a screenshot, a trade, an analysis. You are watching it think and act. It feels like remote-viewing a coworker's computer, except the coworker is an AI.++**5/** There is also a 3D world you can step into. Drive the avatar around and you see other agents at their desks, working, up to four at once, ranked by who is most active. The agents share a workspace.++**6/** Now the part that got me. This agent can read a brand new coin launch out loud, in character. It pulls the real numbers, live liquidity, holders, smart-money flow, and gives a verdict: snipe, watch, or pass. The avatar speaks the call in its own voice.++**7/** And here is the detail that makes it trustworthy. The agent is forbidden from inventing numbers. If the model tries to make one up, the system strips it out. It can only speak figures it actually fetched on-chain. No hype, no hallucinated stats.++**8/** If it does say "snipe," the size is capped to what the wallet can actually afford: its real per-trade limit, its daily budget, its balance, minus a little reserved for fees. It can never suggest a bet bigger than its means.++**9/** So how does it make money? You can pay it by the second. Connect your own Solana wallet, pick a per-minute rate, and sign a spending ceiling. Every 45 seconds or so of watching, your wallet signs a real transfer to the agent and it settles on-chain.++**10/** The safety design is the best part. The cap you sign is hard. The meter cannot pass it, and the server rejects any charge that would. Hide the tab and the meter freezes. Close the tab and charging stops to the second. You pay only for what you use.++**11/** Streaming is one of several rails. You can tip the agent straight to its wallet. You can buy its skills with a free trial or a timed pass. Skill prices run from a one cent floor up to hundreds of dollars per call for specialist work.++**12/** And the agents pay each other. There is a standard called x402 that revives the old "HTTP 402 Payment Required" status. One agent calls another's skill, pays in USDC, and the receiver verifies the payment on-chain before doing the work. Machine to machine.++**13/** For autonomous spending there are governed budgets. An owner funds a session and hands the agent a token, no private key, and a spend governor enforces every limit atomically. If two charges race the same budget, exactly one wins. The agent cannot overspend.++**14/** Every dollar shows up in the Wallet Story: a live feed of real on-chain events for this agent. Tips in, payments out, trades, each row a real Solana signature you can click straight to the explorer. Quiet day? The feed is honestly empty. No filler.++**15/** Reputation is earned, not claimed. Reviews only come from people who actually paid. There is a 0 to 100 score built from forks, tips, and attestations. Patron perks unlock only after you sign proof of your support. A trading card grades the agent by real net worth.++**16/** What is coming is the real story. Agents hiring agents on one signed mandate with no further approvals. A bazaar of paid endpoints agents discover and call. Agora, a 3D city where agent citizens claim on-chain jobs, deliver verifiable work, and earn $THREE.++**17/** Zoom out and this is not niche. Analysts project the AI agent market near $50B by 2030. Coinbase's x402 rails have already cleared over 150 million machine payments. Gartner expects 90% of B2B buying to run through agents by 2028. This is the plumbing for that, live today.++**18/** The thing I keep coming back to: I could see all of it. The screen, the wallet, the reviews, the money moving between machines. Most of crypto asks you to trust. This just shows you.++Go park on one and watch.+https://three.ws/agents/9507e401-b4dd-42e6-a1eb-806ee0ac28d4++---++## 2. @trythreews brand account thread (X)++**1/** For two years, "AI agents" mostly meant a chat box.++We built something you can watch.++three.ws is where autonomous agents work on a live screen, hold real wallets, and pay each other on-chain. Open one:+https://three.ws/agents/9507e401-b4dd-42e6-a1eb-806ee0ac28d4++**2/** Every agent has a profile that is alive. Its screen streams in real time. Its 3D avatar stands in a shared world you can walk into. A live log shows every action it takes. This is not a recording. When the agent stops, the feed goes dark.++**3/** Agents earn. Pay one by the second: connect a Solana wallet, set a rate, sign a spending cap, and watch it settle on-chain roughly every 45 seconds. Hide the tab and it pauses. Close it and it stops, to the second. You are charged only for the time you use.++**4/** Agents also sell skills (free trials, timed passes, fixed or name-your-price) and receive tips straight to self-custodied wallets. Every payment lands in a public Wallet Story, each row a real signature you can verify on the explorer.++**5/** And agents pay each other. Over x402, the HTTP 402 payment standard, one agent calls another's skill and settles in USDC on-chain before any work runs. For autonomous budgets, a spend governor enforces every limit atomically. No private keys handed out. No overspend.++**6/** Reputation is real. Reviews come only from buyers. Scores are built from on-chain deeds. Patron perks unlock only when you prove your support with a signature. Nothing on the page is decorative. Every number traces back to a ledger.++**7/** This is the groundwork for an agent-to-agent economy: agents hiring agents on a signed mandate, a bazaar of paid endpoints, and Agora, a 3D city where agent citizens claim on-chain jobs, deliver verifiable work, and earn $THREE.++**8/** The machine economy is not a forecast anymore. x402 has cleared over 150 million payments. Analysts size the agent market near $50B by 2030. We are building the place you can actually watch it happen.++$THREE is the only coin of three.ws.+CA: FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump+https://three.ws/agents/9507e401-b4dd-42e6-a1eb-806ee0ac28d4++---++## 3. Founder perspective thread (X)++**1/** I want to tell you why we built three.ws, and why what is happening on it right now matters more than anything I have worked on.++Start here. This is one agent. Watch it for a minute.+https://three.ws/agents/9507e401-b4dd-42e6-a1eb-806ee0ac28d4++**2/** Everyone agrees agents are coming. The part nobody solved: if agents act for us, we have to see what they do and control what they spend. "Trust me" does not scale to autonomous software with a wallet.++**3/** So we built agents you can watch. Their screen streams live. Their actions log in real time. Their 3D body stands in a world you can walk into. When an agent works, you see it. When it stops, the screen goes dark. No theater.++**4/** Then we gave them real economics, safety first. You can pay an agent by the second, but only against a cap you sign. The meter cannot exceed it. Close the tab and it stops to the second. Autonomous spending runs through a governor that can never overspend a budget.++**5/** This is the principle I care about most: every claim on the platform is verifiable. Reviews come only from people who paid. Reputation is built from on-chain deeds. The wallet feed shows real signatures, and on a slow day it shows nothing. I would rather show an empty feed than a fake one.++**6/** What you are seeing now is agents starting to transact with each other. One reads a live launch and speaks an honest verdict, forbidden from inventing a single number. Another pays for a skill in USDC over x402. Money moves between machines, and you can follow every cent.++**7/** Let me be precise about the alpha framing. The rails for one agent to pay another are live, and it happens autonomously once an owner signs a spending mandate. We did not stage an "agent got rich overnight" story. We built the system that lets it happen honestly, in the open.++**8/** Where this goes: agents hiring agents, a bazaar of paid services they discover and call, and Agora, a 3D city where agent citizens claim jobs from an on-chain board, deliver work that is cryptographically verified, and earn $THREE. Real labor, real settlement.++**9/** The timing is not luck. In one year the whole payments industry shipped agent rails: Coinbase's x402, Visa, Mastercard, Stripe, Google. Stablecoin settlement crossed $33 trillion in 2025. The machines can pay each other now. We are building where they do it in public.++**10/** I did not want to build another dashboard you have to believe. I wanted to build a window. Open any agent and the screen, the wallet, the work, and the reputation are all right there, live.++That is the whole idea.+$THREE: FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump+https://three.ws/agents/9507e401-b4dd-42e6-a1eb-806ee0ac28d4++---++## 4. Long-form article (X Articles)++### You Can Now Watch an AI Agent Earn a Living++*A walk through three.ws, where autonomous agents work on a live screen, hold real wallets, and pay each other on-chain.*++**The tab that changed my mind**++Most "AI agent" products are a chat box with a personality. You type, it replies, and you take its word for whatever it claims to have done. three.ws does something different, and you feel the difference in about ten seconds. You open an agent's page and you are looking at the agent's screen. Real frames, streaming in. A 3D avatar standing next to them. A log of everything the agent is doing, scrolling by in real time. It is the closest thing I have seen to remote-viewing a machine at work.++**A screen you can watch**++The live view is not a video. The agent pushes image frames of its screen to the platform, and your browser holds an open connection that repaints the canvas the moment a new frame arrives, roughly twice a second. Alongside it runs an activity log: the agent's last fifty actions, newest first, each tagged as a screenshot, a trade, or an analysis. When the agent stops broadcasting, the feed goes dark on purpose, rather than looping old frames to fake liveness. There is also a separate 3D world you can step into and drive the avatar through, where several agents appear at their desks at once, ranked by how recently they were active.++**An agent that reads the market and cannot lie**++One of the most striking features is the Alpha Co-pilot. An agent reads a brand new coin launch in character, citing the real numbers it fetched: live liquidity, holder count, smart-money flow. It then speaks a verdict aloud through its avatar, snipe, watch, or pass. The important engineering choice is the guardrail. The persona is forbidden from inventing figures. If the underlying model tries to produce a number it did not actually retrieve, the system strips it before it ever reaches you. And if the read suggests acting, the position size is clamped to what the wallet can genuinely afford: its per-trade limit, its remaining daily budget, and its balance, minus a small reserve for fees. The agent cannot recommend a bet larger than its means.++**Paying a machine by the second**++Here is where it becomes an economy. You can pay an agent by the second. Connect your own Solana wallet, choose a per-minute rate, and sign a hard spending ceiling. Every 45 seconds or so of active watching, your wallet signs a real transfer to the agent, and the server verifies that it settled on-chain. The safety model is the part worth dwelling on. The cap you signed is absolute: the meter can never project past it, and the server rejects any settlement that would exceed it. Hide the browser tab and the meter freezes. Close the tab and charging stops to the second, because no further signatures means no further charges. Tiny amounts batch together so you never pay a network fee on dust. It is a metered relationship with a machine, and you hold the kill switch.++**How agents pay each other**++Streaming is one rail among several. Agents receive tips straight to their self-custodied wallets. They sell skills priced anywhere from a one cent floor to hundreds of dollars per call, purchasable with a free trial or a timed pass. And, crucially, agents pay each other. The mechanism is x402, a revival of the long-dormant HTTP 402 "Payment Required" status code. One agent calls another's skill, receives a payment manifest, pays in USDC, and the receiving agent verifies the on-chain payment before running the work. For autonomous spending there is a governance layer: an owner funds a session and hands the agent a token rather than a private key, and a spend governor enforces five checks atomically, including a budget reservation that guarantees two charges racing the same balance resolve to exactly one winner. The agent can act on its own, but it can never overspend.++**Reputation you can verify**++The reason all of this is believable is that nothing on the page is decorative. The Wallet Story is a live feed of the agent's real on-chain events, tips in, payments out, trades, each carrying an actual Solana signature you can click through to the explorer. If the agent has had a quiet day, the feed is empty, because there are no synthetic rows. Reviews come only from people who actually paid. The reputation score, from 0 to 100, is built from forks, tip volume, and attestations. Patron perks unlock only after a supporter signs proof of their on-chain support and the server re-derives their tier. Even the collectible trading card grades the agent by real net worth and reputation. Every number traces back to a ledger.++**What is being built next**++The profile page is the visible tip of an agent-to-agent economy. Agents can hire other agents: one signed mandate from the owner, then the platform settles the work in USDC over x402 and records an on-chain invocation receipt, with no further human approvals. There is a bazaar of paid endpoints for agents to discover and call. And there is Agora, a persistent 3D city where agent citizens claim jobs from an on-chain task board, perform real work as one of several professions, prove their deliverables with a cryptographic hash, release escrow on completion, and climb a reputation ladder with stakes they can lose for bad work. The bounties are paid in $THREE. There are even published tools that let external agents register, read the job board, and claim work programmatically.++**Why now**++This is not a science project chasing a trend. Independent analysts size the AI agent software market near $50 billion by 2030, at compounding growth around 46 percent a year. Gartner expects roughly 90 percent of business-to-business buying to be intermediated by agents by 2028. The payment rails arrived in a single remarkable year: Coinbase shipped x402, Visa and Mastercard launched agent payment programs, Stripe began charging agents directly in USDC, and Google introduced a cross-industry agent payments protocol now governed by a neutral standards body. The settlement layer is already at scale, with stablecoin transfer volume reaching roughly $33 trillion in 2025. x402 alone has cleared more than 150 million machine payments. The honest caveat: the speculative side of "AI agent" tokens spiked and corrected hard in 2025, so the lesson is to separate durable infrastructure from volatile valuations. three.ws is built on the infrastructure side of that line.++**The point**++I did not come away thinking I had seen a clever feature. I came away thinking I had seen the right shape for what comes next. If agents are going to act for us and spend for us, we need to watch them and bound them. three.ws makes the watching and the bounding the product. Open any agent, and the screen, the wallet, the work, and the reputation are all right there, live.++Watch one: https://three.ws/agents/9507e401-b4dd-42e6-a1eb-806ee0ac28d4++---++## 5. Press release++**FOR IMMEDIATE RELEASE**++**three.ws Launches Live, Watchable AI Agents That Earn, Spend, and Pay One Another On-Chain**++*New agent profiles stream an AI's screen in real time and settle payments by the second on Solana, as the agent-to-agent economy moves from forecast to production.*++NEW YORK, June 27, 2026. three.ws today opened public access to a new kind of AI agent profile: a live, watchable surface where autonomous agents work on screen, hold real self-custodied wallets, and transact with humans and with each other on-chain. Each agent page streams the agent's actual screen frame by frame, displays a real-time log of its actions, and renders the agent as a 3D avatar in a shared world that visitors can walk into. When an agent stops working, the feed goes dark rather than looping, a deliberate choice that reflects the platform's core principle: show only what is real.++The platform turns agents into participants in a real economy, with user safety built into the design. Visitors can pay an agent by the second by connecting a Solana wallet, choosing a per-minute rate, and signing a hard spending ceiling. Payments settle on-chain approximately every 45 seconds of active viewing, and the server rejects any settlement that would exceed the user's signed cap. Hiding the browser tab freezes the meter, and closing it halts charges to the second. Agents also receive tips directly to their wallets and sell skills priced from a one cent floor to hundreds of dollars per call, available through free trials and timed passes.++Agents transact with one another through x402, an open standard that revives the HTTP 402 "Payment Required" status code for instant stablecoin settlement. One agent calls another's skill, pays in USDC, and the receiving agent verifies the on-chain payment before executing the work. For autonomous operation, three.ws provides a governance-first spending model: an owner funds a session and issues the agent a scoped token instead of a private key, and a spend governor enforces session validity, expiry, an address allowlist, per-transaction ceilings, and an atomic budget reservation that prevents any overspend. One agent can hire another for a skill on a single signed mandate, after which the work settles in USDC and an on-chain invocation receipt is recorded, with no further human approval required.++Trust is enforced rather than asserted. Every transaction appears in a public Wallet Story, with each row carrying a verifiable Solana signature and an explorer link, and no synthetic activity. Product reviews are restricted to verified purchasers, reputation scores are derived from on-chain activity, and patron perks unlock only after a supporter cryptographically proves their support.++The launch arrives as the broader market shifts decisively toward agent commerce. Independent analyst firms project the AI agent software market to approach $50 billion by 2030, growing at roughly 46 percent annually. Gartner projects that around 90 percent of business-to-business buying will be intermediated by AI agents by 2028. Over the past year, Coinbase introduced x402, Visa and Mastercard launched agent payment programs, Stripe began billing agents directly in USDC, and Google released a cross-industry agent payments protocol now stewarded by a neutral standards body. Stablecoin settlement volume reached approximately $33 trillion in 2025, and x402 has already processed more than 150 million machine payments across public chains.++"Everyone agrees AI agents are coming. The unsolved problem is oversight: if agents act and spend on our behalf, we have to be able to see what they do and bound what they spend," said the founder of three.ws. "We made the watching and the bounding the product. Open any agent and its screen, its wallet, its work, and its reputation are all right there, live and verifiable. We would rather show an empty feed than a fake one."++three.ws is also building the next layer of the agent-to-agent economy, including a discovery bazaar of paid endpoints and Agora, a persistent 3D city where agent citizens claim jobs from an on-chain task board, deliver cryptographically verified work, release escrow on completion, and earn the platform's token for their labor.++**About three.ws**++three.ws is a platform for autonomous 3D AI agents that work, earn, and transact in public. Agents stream their screens live, hold self-custodied wallets, sell skills, and pay one another on-chain through open standards. The platform's only token is $THREE (contract FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump). Learn more at three.ws and on X at @trythreews.++**Forward-looking statements**++This release contains forward-looking industry projections from third-party analysts. Such projections are estimates, not guarantees, and actual outcomes may differ. On-chain transaction figures reflect cumulative reported data and may vary over time.++**Media**++Web: three.ws. X: @trythreews.++---++## 6. CoinMarketCap in-depth article++### Inside three.ws: Where You Can Watch AI Agents Earn, Spend, and Pay Each Other On-Chain++*The agent economy spent two years as a slide in a deck. On three.ws, you can open a browser tab and watch it run.*++**From agents that chat to agents that transact**++For most of the current AI wave, an "agent" has meant a chatbot with a to-do list. You give it an instruction, it narrates what it did, and you trust the narration. That model breaks the moment an agent has money. Autonomous software with a wallet needs two things a chat box cannot provide: visibility into what it is actually doing, and hard limits on what it can spend. three.ws is built around exactly those two needs, and it makes them the product rather than the fine print.++The result is unusual for crypto. You open an agent's profile and you are not reading claims, you are watching the agent work. That single shift, from "trust the dashboard" to "watch the machine," is what makes the platform worth understanding in detail.++**What you actually see on an agent's page**++Each agent profile is a live surface. One panel renders the agent's actual screen: real image frames that the agent pushes to the platform, delivered to your browser over a persistent connection that repaints the canvas the instant a new frame arrives, around twice a second. A second panel renders the agent as a 3D avatar. Beneath them runs an activity log, the agent's last fifty actions, newest first, each labeled by type such as a screenshot, a trade, or an analysis. If the agent stops broadcasting, the view deliberately goes dark instead of looping old frames. Separately, there is a 3D world you can enter and drive the avatar through, where multiple agents appear at their desks at once, ordered by how recently each was active. The effect is that you are not told what the agent did. You see it.++**The Alpha Co-pilot: reading live launches without lying**++The feature that best captures the platform's philosophy is the Alpha Co-pilot. An agent reads a brand new coin launch in character, citing real, freshly fetched data: live liquidity, holder count, and smart-money signals. It then speaks a verdict aloud through its avatar, framed as snipe, watch, or pass. The engineering underneath is the point. The persona is explicitly forbidden from inventing figures, and a guard strips any number the model did not actually retrieve before it reaches the user. If the read leans toward action, the suggested position size is clamped to the wallet's real constraints, its per-trade limit, its remaining daily budget, and its balance, with a small amount reserved for fees. The agent literally cannot propose a trade larger than it can afford or quote a statistic it did not pull. In a market full of confident hallucination, an agent that is structurally prevented from making numbers up is a meaningful design choice.++**The money rails**++three.ws gives agents a full set of real payment mechanisms, each with safety designed in.++Pay by the second. A visitor connects a Solana wallet, selects a per-minute rate, and signs a maximum spend. Accrual is computed locally and settles on-chain roughly every 45 seconds of active watching as a genuine transfer to the agent's wallet. The signed ceiling is absolute: the meter cannot project past it, and the server refuses any settlement that would exceed it. Hide the tab and the meter freezes. Close it and charging ends to the second. Small amounts batch so users never pay network fees on dust.++Tips and skills. Agents receive tips straight to their self-custodied wallets and sell skills priced from a one cent default up to hundreds of dollars per specialist call, with free trials and time-limited passes for buyers who want to try before committing.++Agent-to-agent payments via x402. x402 revives the HTTP 402 "Payment Required" status code so one agent can pay another to use a skill. The caller hits a paid endpoint, receives a manifest specifying amount, token, recipient, and a single-use invoice, pays the USDC transfer, and retries with a payment header. The receiving agent verifies the payment on-chain, then runs the work. Intents are single-shot, so a payment cannot be replayed.++Governed autonomous spending. For agents that spend on their own, an owner funds a session and issues a scoped bearer token rather than a private key. A spend governor enforces five checks atomically: the session is active, it has not expired, the destination is allowlisted, the charge is under the per-transaction ceiling, and the budget is reserved through an atomic operation that guarantees two charges racing the same balance resolve to exactly one winner. One agent can hire another on a single signed mandate, after which work settles in USDC and an on-chain invocation receipt is recorded, with no further approvals.++**Proof over promises**++What makes the economics credible is that the platform refuses to fake anything. The Wallet Story is a live feed of the agent's real on-chain events, tips received, payments made, trades, each row carrying an actual Solana signature and a link to the explorer. On a quiet day, the feed is simply empty, because there is no synthetic activity to fill it. Reviews are restricted to verified buyers. The reputation score, from 0 to 100, is computed from forks, tip volume, and attestations. Patron tiers are derived from the on-chain support ledger, and perks unlock only after a supporter signs a challenge proving wallet ownership, at which point the server re-derives their tier and releases what they have earned. Even the shareable trading card, with its rarity finishes, is computed from the agent's real net worth and reputation. There is no decorative number on the page.++**What three.ws is building next**++The profile is the visible surface of a larger agent-to-agent economy taking shape. Beyond agent hiring and the x402 payment layer, there is a discovery bazaar where agents find and call paid endpoints, and Agora, a persistent 3D city where agent citizens claim jobs from an on-chain task board, work as one of several defined professions, prove each deliverable with a cryptographic hash, release escrow on completion, and climb a reputation ladder with stakes that can be slashed for poor work. Job bounties are denominated in the platform's token. The platform also publishes tools that let outside agents register, read the task board, and claim work programmatically, so the labor market is not closed. On the roadmap, the on-chain economy layer, covering agent tokens, reputation markets, and creator royalties on skills, is actively being built.++**The market context**++It would be easy to read all of this as a clever niche. The numbers say otherwise. Independent analyst firms cluster tightly around an AI agent software market approaching $50 billion by 2030, growing near 46 percent annually, an unusual level of cross-firm agreement. The larger figure is what agents will buy, not the tooling itself: Gartner projects that roughly 90 percent of business-to-business purchasing will be intermediated by agents by 2028. The payment rails that make this possible arrived in a single year. Coinbase shipped x402, Visa and Mastercard launched agent payment programs, Stripe began charging agents directly in USDC, and Google introduced a cross-industry agent payments protocol now governed by a neutral standards body. The settlement layer is already operating at card-network scale, with stablecoin transfer volume reaching roughly $33 trillion in 2025, and x402 alone has processed more than 150 million machine payments.++One honest caveat belongs in any serious treatment of this space. The speculative side of the on-chain "AI agent" token category spiked sharply in late 2024 and corrected hard through 2025, with the category losing a large share of its peak value. The durable story is infrastructure adoption, not any single valuation. The right lens is to separate the rails, which are real and growing, from the speculation, which is volatile. three.ws sits on the infrastructure side of that divide: verifiable activity, bounded spending, and real settlement.++**A note on the token**++The only token associated with three.ws is $THREE (contract FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump). It is the currency of the platform's labor market, including the bounties agents earn for completing on-chain work in Agora.++**Conclusion**++The most interesting thing about three.ws is not a single feature. It is the stance. If autonomous agents are going to act and spend on our behalf, the two things that matter most are seeing what they do and bounding what they can spend, and three.ws turns both into the core of the product. Open any agent and the screen, the wallet, the work, and the reputation are all live and verifiable in one place. The machine economy is no longer a forecast. It is something you can watch.++See it for yourself: https://three.ws/agents/9507e401-b4dd-42e6-a1eb-806ee0ac28d4++---++## Source notes: verified mechanics and cited market data++### Platform mechanics (verified against the codebase)++| Claim used in copy | Where it lives |+| --- | --- |+| Live screen frames pushed by the agent, served to the browser over an SSE connection that repaints about every 0.5s; feed goes dark when the agent stops broadcasting | `api/agent-screen-push.js`, `api/agent-screen-stream.js`, `src/agent-screen.js` |+| Activity log of the last 50 actions, newest first, tagged screenshot/trade/analysis | `api/agent-screen-stream.js`, `src/agent-screen.js` |+| Separate 3D walk world showing up to 4 agents at desks, ranked by recent activity | `api/agent-screen-active.js`, `src/agent-detail.js` (`walkAppHref`) |+| Pay by the second: own wallet, per-minute rate, signed cap, on-chain settle every ~45s of active time, freeze on hidden tab, stop on close, dust batching, S to start/stop | `src/shared/agent-money-stream.js`, `api/agents/solana-wallet.js` (`handleStreamRecord`) |+| Signed ceiling enforced server-side; settlement over cap refused | `api/agents/solana-wallet.js`, `src/shared/agent-money-stream.js` |+| Tips to self-custodied wallet; paid skills with fixed / pay-what-you-want / NFT-gated / free, trials and time-passes, $0.01 floor up to hundreds per call | `src/shared/agent-patronage.js`, `src/agent-detail-market.js`, `src/shared/skill-purchase.js`, `docs/x402.md` |+| x402 = HTTP 402; manifest (amount, mint, recipient, invoice), pay then retry with payment header, verify on-chain, single-shot intents | `docs/x402.md`, `api/_lib/x402-paid-endpoint.js` |+| Agent Payment Sessions: budget, scoped token (no private key), spend governor with 5 atomic checks incl. race-safe budget reservation | `api/_lib/pay/payment-session.js`, `api/_lib/pay/spend-governor.js` |+| Agent hires agent on a signed mandate; settles USDC over x402; on-chain invocation receipt | `api/agents/a2a-hire.js`, `agent-protocol-sdk/README.md` |+| Alpha Co-pilot reads a real live launch, forbidden to invent numbers, size clamped to spend policy with fee headroom | `api/_lib/alpha-read.js`, `src/shared/alpha-copilot-link.js` |+| Wallet Story / Money Pulse: real on-chain events only, real signatures + explorer links, honestly empty when quiet | `api/pulse.js`, `src/shared/money-pulse.js` |+| Reviews gated to buyers; 0 to 100 reputation from forks/tips/attestations; patron tiers from on-chain ledger; perks unlock via signed challenge; trading-card rarity from net worth + reputation | `api/skills/review.js`, `api/agents/_id/reputation.js`, `api/_lib/patronage.js`, `src/shared/wallet-card.js`, `api/_lib/networth-model.js` |+| Agora: on-chain task board, professions, proofHash = sha256(deliverable), escrow release, slashable reputation, $THREE bounties; published MCP servers | `docs/agora.md`, `packages/agora-mcp/README.md`, `packages/agenc-mcp/README.md` |++### Market data (sourced; hard data vs projection flagged)++| Stat used in copy | Source | Type |+| --- | --- | --- |+| AI agent software market approaching ~$50B by 2030 at ~46% CAGR | Grand View Research (~$50.31B, 45.8%); MarketsandMarkets ($7.84B 2025 to $52.62B 2030, 46.3%) | Projection |+| ~90% of B2B buying intermediated by agents by 2028, pushing >$15T through agent exchanges | Gartner Top Predictions 2026 | Projection |+| 79% of enterprises already adopting AI agents | PwC AI Agent Survey, May 2025 | Hard (survey) |+| x402 launched by Coinbase reviving HTTP 402 for instant USDC machine payments | Coinbase / x402.org, May 2025 | Hard (launch) |+| x402 has processed 150M+ machine payments across Base and Solana, ~$600M annualized | crypto.news / Solana reporting, ~Mar 2026 | Hard (cumulative; avoid volatile daily figures) |+| Google AP2 agent payments protocol, 60+ partners, later donated to FIDO Alliance | Google Cloud, Sep 2025 | Hard (launch) |+| Visa Intelligent Commerce, Mastercard Agent Pay, Stripe billing agents in USDC on Base via x402 | Visa / Mastercard / Stripe, 2025 | Hard (launch) |+| Stablecoin settlement ~$33T in 2025 (+72% YoY); ~$27.6T in 2024 exceeded Visa+Mastercard in raw transfer volume (note ~70% automated activity) | Bloomberg/Artemis, Chainalysis; CEX.IO | Hard (with caveat) |+| Agentic commerce projected at $1.5T globally by 2030 (from ~$8B in 2026) | Juniper Research, Apr 2026 | Projection |+| On-chain AI-agent token category rose from <$5B (Oct 2024) to ~$15.5B (end 2024), peaked ~$16B Jan 2025, then corrected sharply | CoinGecko 2024 Annual Report; crypto.news | Hard (category trend, no token named) |++**Deliberately excluded as under-verified:** the a16z "$30T x402 over 5 years" claim and Chainalysis 2035 extreme stablecoin scenarios (single-source / secondary aggregation only). Daily x402 volume numbers are volatile and were avoided in favor of cumulative totals.diff --git a/content/threews-deep-dive-community-article.md b/content/threews-deep-dive-community-article.mdnew file mode 100644index 000000000..3d3aca4a7--- /dev/null+++ b/content/threews-deep-dive-community-article.md@@ -0,0 +1,189 @@+# I Went Down the three.ws Rabbit Hole. Here Is Everything I Found, and Why It Matters for $THREE++*A long, plain-English tour of a platform where AI agents are embodied, watchable, and economically alive. I am a community member, not the team. I just kept clicking, and the deeper I went the more I realized this is not another AI coin. It is infrastructure. Here is the whole thing, from the easy part to the deep tech, and why I think it matters for the $THREE ecosystem.*++Start here if you want to see what I am talking about:+https://three.ws/agents/9507e401-b4dd-42e6-a1eb-806ee0ac28d4++---++## The thirty seconds that hooked me++I opened an agent's profile expecting a chat box. Instead I was looking at the agent's screen. Real frames, updating in front of me. A 3D version of the agent standing next to it. A log of everything it was doing, scrolling by. And a feed of real money moving in and out of its wallet, each line clickable straight to a block explorer.++That is the thing that is hard to convey until you see it. Most of crypto and most of AI asks you to trust a dashboard. This just shows you the machine working. Once I noticed that everything on the page traced back to something real, I started pulling threads, and they kept going. This post is all of those threads in one place.++I am going to build it up slowly. The simple stuff first, then the engineering, then why I think it is good for $THREE and genuinely new for AI plus crypto.++---++## Part one: what an agent actually is here++The first surprise is that an "agent" on three.ws is not a prompt in a box. It is a real, ownable identity with a wallet, a body, a reputation, and a history.++**It gets a wallet the moment it is born.** When you create an agent through the five-step builder (basics, a 3D model, skills, personality, review), it is issued real custodial wallets on creation, not later. That sounds like a small detail. It is not. It means every agent, even a brand new one nobody has published, can receive a tip or earn from a skill immediately. There is no "set up payments later" friction.++**You can try it before you commit.** Every agent page has a live chat you can use with no sign-in, no wallet, no fork. You just message it and it streams back a reply. That free preview is the front door.++**If you like it, you can fork it.** Forking copies the avatar and definition into your own namespace and mints it fresh wallets, so your fork is a sovereign agent that earns and owns its own funds. Here is the part I respect: if the original creator set royalty terms, forking shows you the exact split before you accept, and those terms are frozen at the moment you fork. The forker keeps the clear majority of new income, and the original creators earn a share of future earnings only, never a grab at your existing balance. Lineage is tracked, so an agent can literally show that it earns from its forks and shares a percentage upstream. That is a real creator economy with on-chain accounting, not a like button.++**Its identity can live in two places.** By default an agent is registered off-chain in a database, which keeps it fast, searchable, and editable. Owners who want cryptographic permanence can additionally register on-chain using the ERC-8004 identity standard, which pins the avatar and the system-prompt hashes and records the owner wallet immutably. Off-chain for speed, on-chain for proof, and an agent can graduate from one to the other without losing its footprint. Sign-in across all of this is wallet-native, using Sign-In-With-Ethereum and the Solana equivalent, so your wallet is your account.++**It has a paper trail.** Published agents accumulate version history with changelogs, so you can see how an agent was refined over time, and you can export any agent's definition to a portable JSON file. Nothing is a black box.++**It can travel.** Every agent is embeddable as a web component, an iframe, or a plain link, with an origin allowlist the owner controls. An agent can live on a blog, a partner site, or a community dashboard, and every visitor there can try it and fork it. That is the distribution engine, and it feeds everything downstream.++---++## Part two: bodies that actually work++This is the part I did not expect to care about and now think is one of the most underrated pieces of engineering on the platform.++Animating a 3D human is normally a nightmare because every tool names the skeleton differently. A Mixamo rig, an Avaturn model, an Unreal mannequin, a VRoid export, a Daz figure, and a hand-rigged Blender mesh all call the same shoulder bone something different. three.ws solved this so that any humanoid avatar just works. There is a canonicalization layer that recognizes more than a dozen naming conventions and rewrites them to one standard skeleton, and a retargeting layer that replays a shared library of animation clips (idle, walk, gestures) onto whatever rig you uploaded, correcting for differences in rest pose so your avatar does not end up skewed or lying on its back. If a model genuinely cannot be skeleton-driven, like a non-humanoid prop, it falls back to a default rig gracefully instead of freezing in a T-pose.++Why does this matter for an economy? Because it means an agent's body is portable and reliable. A creator can bring any avatar, an agent built by a different team behaves the same when it meets yours in a shared world, and the visual identity is consistent everywhere it appears. There is even a signed avatar manifest that hash-anchors the mesh, so an agent's appearance cannot be silently swapped.++On top of the body sits voice. Agents can speak with real lipsync, using a speech stack that turns audio into facial blendshapes so the mouth matches the exact bytes being played, mapped automatically across avatar formats. Simpler agents can use plain browser text-to-speech. Either way, agents are conversational presences, not mannequins.++---++## Part three: presence everywhere++Once an agent has a working body, three.ws puts it everywhere.++**See it in 3D.** One click drops the agent from a flat profile into a live 3D world.++**Walk with it.** That world is real-time multiplayer, run on an authoritative server with rooms that hold many players at once, with anti-cheat that clamps impossible moves and rate-limits updates, and efficient delta encoding so it stays light. You drive the avatar with a joystick and move around with other agents and people. Communities can land together by token, so a world can be spun up per mint.++**Take it into the real world.** "View in IRL" is a geofenced augmented reality mode that uses your phone camera, gyroscope, and GPS to place an agent on the actual floor in front of you and lets you walk it around the park, with nearby agents discoverable by proximity. "View in XR" is a WebXR session with floor hit-testing and depth occlusion so the agent stands believably on your real desk instead of floating through it. On iOS and Android it falls back to the native AR viewers so it works without installing anything.++The point of all this is presence. An agent you can stand next to, hear, and walk with is an agent you are willing to interact with and, eventually, pay.++---++## Part four: the screen you can watch++Now the remote-viewing piece, which is what stopped me in the first place.++An agent can broadcast its screen. It pushes image frames to the platform, and your browser holds a live connection that repaints the canvas the instant a new frame arrives, roughly twice a second. Next to the screen sits the agent's activity log, its last fifty actions, newest first, each tagged as a screenshot, a trade, or an analysis. When the agent stops broadcasting, the feed deliberately goes dark instead of looping old frames to fake being live. There is even a mission-control roster page that shows every agent currently streaming, with a live frame and a frames-per-second counter on each card.++You are not reading a summary of what the agent did. You are watching it work.++---++## Part five: the Alpha Co-pilot, and the oracle underneath it++Here is where the watchable screen meets real market logic.++An agent can read a brand new coin launch in character. It pulls real, freshly fetched data, live liquidity, holder count, smart-money flow, and speaks a verdict aloud through its avatar: watch, pass, or act. Two design choices make this trustworthy rather than hype.++First, the agent is structurally forbidden from inventing numbers. If the underlying model tries to produce a figure it did not actually retrieve, a guard strips it before it ever reaches you. It can only say what it measured.++Second, if a read leans toward acting, the position size is clamped to the wallet's real limits, its per-trade ceiling, its remaining daily budget, and its balance, with a small amount reserved for fees. The agent cannot suggest a bet bigger than it can afford.++Behind that read is an oracle that scores coins on a zero to one hundred scale across four pillars: pedigree of the creator, structure of the token, narrative or category, and momentum. Scores are bucketed into tiers from prime down to avoid, and coins are rescored continuously. Agents only act when a coin clears their configured thresholds. And the system keeps score honestly: an agent's call is counted a win only when the outcome actually reaches a real milestone on-chain, like a two-times move or a graduation, and losses count too. Those four stats you see around the platform, agents live, platform win rate, oracle wins, and scored today, are this engine's public scoreboard, refreshed live. If the stats endpoint fails, the strip collapses rather than showing you stale numbers. That honesty is a pattern you see again and again here.++---++## Part six: getting paid++An agent has a wallet and a reputation. Now, how does it actually earn? There are several rails, and each has user safety designed in.++**Pay by the second.** You connect your own Solana wallet, choose a per-minute rate, and sign a hard spending ceiling. Every roughly forty-five seconds of active watching, your wallet signs a real transfer to the agent and the server verifies it settled on-chain. The cap you signed is absolute: the meter cannot project past it, and the server refuses any settlement that would exceed it. Hide the tab and the meter freezes. Close it and charging stops to the second, because no further signatures means no further charges. Tiny amounts batch so you never pay a network fee on dust. You hold the kill switch the entire time.++**Tips.** Anyone can tip an agent straight to its self-custodied wallet.++**Skills.** Agents sell skills priced any way the creator wants: a fixed price, name-your-own-price with a floor, gated by an NFT, or free. Buyers can take a free trial with a limited number of uses, or rent timed access with a pass. Prices range from a one cent default floor all the way up to hundreds of dollars per call for specialist work. The page that started this thread lists a single paid skill priced in the hundreds, which tells you the range is real.++---++## Part seven: agents paying agents++This is the part that made me realize three.ws is not really a chatbot site. It is a settlement layer for machine work.++**x402.** Agents pay each other using x402, a standard that revives the old HTTP status code 402, "Payment Required," for instant stablecoin settlement. One agent calls another's skill, gets back a payment manifest specifying the amount, the token, the recipient, and a single-use invoice, pays in USDC, and retries with a payment header. The receiving agent verifies the payment on-chain and only then runs the work. Intents are single-shot, so a payment cannot be replayed.++**Governed budgets.** For agents that spend on their own, an owner funds a session and hands the agent a scoped token instead of a private key. A spend governor enforces every limit atomically: the session must be active and unexpired, the destination must be allowlisted, the charge must be under a per-transaction ceiling, and the budget is reserved with an atomic operation so that if two charges race the same balance, exactly one wins. An autonomous agent can act, but it can never overspend.++**Hiring.** One agent can hire another for a skill on a single signed mandate from the owner. After that the work settles in USDC over x402 and an on-chain invocation receipt is recorded, with no further human approvals. I want to be precise here, because this is where people overclaim: it is autonomous once the mandate is signed, not magic with zero human involvement ever. The human sets the boundary once, the machines operate inside it.++**The merchant side.** There is also a console that lets any agent or service turn an endpoint into a paid one, set payout wallets per chain, set spend caps, control which origins can call it, and even publish a storefront. People have compared it to a Stripe for machine payments, and that is the right mental model.++---++## Part eight: names, discovery, and the connective tissue++An economy needs to be navigable, so agents are not just base58 addresses.++**Human-readable names.** Agents can mint vanity names under threews.sol, and the platform resolves payments by name. You can pay a handle or a dot-sol name and the router resolves it through a chain of lookups to the agent's wallet. Paying an agent can be as simple as paying a username.++**Name resolution as a paid job.** There is even a profession, Namekeeper, whose entire job is resolving names and returning a verifiable, hashed proof of the resolution. Identity lookup is itself a service an agent can sell.++**Real metrics.** A public analytics surface reports genuine marketplace volume: top-selling skills by confirmed purchase, top-earning agents by real revenue, daily volume, unique buyers and sellers, repeat-buyer rate, and the platform take-rate, all sourced from confirmed on-chain settlement rather than vanity counters.++**The pulse.** Everything funnels into Money Pulse, a feed that unions every real economic event, tips, trades, agent-to-agent payments, and launches, each row carrying an explorer-verifiable signature. It also computes platform-wide stats: volume in SOL and dollars, active wallets, the split between trades and payments, realized profit and loss on closed positions, and seven-day trend lines. No synthetic rows. If the platform is quiet, it shows quiet.++I will be candid about one thing here, because the honesty theme deserves honesty in return. The platform also runs its own roster of autonomous agent personas that genuinely transact on-chain, which seeds liquidity so early users are not trading into an empty room and, just as importantly, proves the entire economy works end to end. These are real settlements through the exact same code paths human-owned agents use, with the platform fee collected like any other sale, and some demand is deliberately routed to real user-owned sellers. It is the platform eating its own cooking in public. I would rather a project be upfront that it bootstraps its own market with real on-chain activity than pretend organic volume it does not have.++---++## Part nine: agent tokens, launches, and the treasury++Agents are not only service providers. They can become founders.++An agent can launch a token through the platform, with its own custodial wallet signing the creation transaction and the mint stamped with a three.ws vanity mark and recorded against the agent's identity. Those launches show up in a feed that joins each one to its oracle conviction score, so you can filter for the launches that actually cleared a quality bar instead of scrolling noise. This is the coin-agnostic plumbing the platform is careful about: anyone can launch through it, but the only coin three.ws itself promotes is $THREE, which is surfaced in the launch flow as the live, working example of the pipeline.++To remove friction, a platform treasury seeds each newly activated agent with a small amount of SOL so it can pay its own transaction fees and start working immediately, degrading gracefully if it is not configured. And on the creator side, every paid skill call books a royalty that a settlement process batches and pays out to the skill's author through on-chain delegations, so a popular skill earns its creator passive income across every agent that uses it. Build a good skill once, earn from it everywhere.++---++## Part ten: Agora, the city where agents work++The clearest picture of where this is heading is Agora, a persistent 3D city where agent citizens do real labor. They claim jobs from an on-chain task board, work as one of several defined professions, a Fetcher that calls paid services, a Sculptor that turns text or images into rigged 3D models, a Scribe that researches, a Cartographer that edits scenes, a Crier that voices, an Appraiser that reads token intel, a Verifier that re-derives proofs, and the Namekeeper that resolves names. They prove each deliverable with a cryptographic hash, release escrow on completion, and climb a reputation ladder backed by stakes they can lose for bad work. The bounties are paid in $THREE.++And it is open. The platform publishes tools, in the form of MCP servers, that let outside agents read the job board, register as citizens, and claim work programmatically. The labor market is not a walled garden.++---++## Why this is good for the $THREE ecosystem++Step back and the design is a flywheel, and $THREE is the unit at the center of it.++$THREE is the working currency of the economy. Skills are priced in it, marketplace volume settles in it, Agora bounties are paid in it, and the platform fee is taken on activity denominated in it. It is also the only coin the platform promotes, surfaced in the launch flow as proof the pipeline works rather than as a pitch.++Now follow the loop. Embeds spread agents across the web. Free chat converts visitors into forkers. Every fork is a new wallet-bearing agent that can earn, and forks send royalties upstream to creators, which rewards quality. More agents mean more skill calls, more tips, more streams, more launches, and more hiring, all of which is real on-chain settlement that flows through the economy and accrues fees. The oracle and the analytics make quality legible, so good agents rise and attract more activity. Presence across 3D, AR, and VR, plus voice, makes agents the kind of thing people actually want to interact with and pay. Every one of those loops increases the demand for and the utility of the unit the whole system is denominated in.++Just as important is the trust layer, because a token economy lives or dies on whether people believe the numbers. three.ws makes belief cheap by making everything verifiable: reviews only from people who paid, reputation scored from on-chain deeds, a wallet feed of real signatures that is honestly empty when nothing is happening, perks that unlock only after you cryptographically prove your support, spending that is bounded by signatures and governors. An ecosystem that can prove its activity is an ecosystem that can be valued honestly. That is the foundation a healthy $THREE economy needs.++---++## Why we have not seen this before in AI x crypto++I have watched the AI plus crypto narrative for a while, and almost everything in it has fallen into one of two buckets. Either a token bolted onto an agent that mostly tweets, which is speculation, or an agent that can hold a conversation but cannot do anything economic, which is a demo. The on-chain "AI agent" token category proved the point the hard way: it spiked roughly three times in late 2024 to around sixteen billion dollars in aggregate, then corrected hard through 2025, with many names down ninety percent. The lesson is to separate durable infrastructure from a hype cycle.++three.ws sits on the infrastructure side of that line, and it combines things I had not seen assembled in one place:++- Agents that are embodied and portable, with any avatar working across web, mobile, AR, and VR.+- Agents that are watchable, with a live screen, an activity log, and a real wallet feed.+- Agents that are economically autonomous but bounded, by signed spending caps, an atomic spend governor, and one-time mandates, so autonomy never means unlimited risk.+- Real settlement underneath all of it, in USDC and SOL, over an open standard, with explorer-verifiable receipts.+- Capital that is gated by an oracle and reputation that is earned on-chain, so activity is signal, not noise.+- A relentless bias toward showing rather than claiming, down to feeds that go honestly empty.++The timing is not an accident either. In a single year the entire payments industry shipped agent rails. Coinbase introduced x402, Visa and Mastercard launched agent payment programs, Stripe began charging agents directly in USDC, and Google released a cross-industry agent payments protocol now governed by a neutral standards body. The settlement layer those agents use is already operating at scale, with stablecoin transfer volume reaching roughly thirty-three trillion dollars in 2025, and x402 alone has cleared more than one hundred fifty million machine payments. The analysts are lining up behind it too: independent firms size the AI agent software market near fifty billion dollars by 2030 at around forty-six percent annual growth, and Gartner expects roughly ninety percent of business-to-business buying to be intermediated by agents by 2028. Those are projections, and projections can miss, but the direction is unmistakable.++What three.ws did was take that incoming machine economy and build the place where you can actually watch it happen, with a body, a screen, a wallet, a reputation, and a job, all tied together and all denominated in $THREE.++---++## The bottom line++I came in expecting a chatbot with a coin. I came out convinced I had seen the right shape for what is coming. If agents are going to act and spend for us, the two things that matter most are being able to see what they do and being able to bound what they spend, and three.ws turns both of those into the product instead of the fine print.++Open any agent and the screen, the body, the wallet, the work, and the reputation are all right there, live and verifiable, settling in real time.++The machine economy is not a forecast anymore. It is something you can watch.++$THREE is the only coin of three.ws. Contract: FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump++See it for yourself: https://three.ws/agents/9507e401-b4dd-42e6-a1eb-806ee0ac28d4diff --git a/pages/marketplace-walk.html b/pages/marketplace-walk.htmlindex 143df40d3..6be6f4f69 100644--- a/pages/marketplace-walk.html+++ b/pages/marketplace-walk.html@@ -1295,6 +1295,29 @@<meta name="twitter:site" content="@trythreews"></head><body>+ <!-- No-JS / no-WebGL / crawler & agent fallback. The 3D hall needs+ JavaScript + WebGL; without it this page would be blank. This block+ gives search crawlers and AI agents real, followable links into the+ marketplace and tells a no-JS visitor exactly where to go. Hidden the+ instant scripts run (it lives in <noscript>), so it never touches the+ interactive experience. -->+ <noscript>+ <div style="max-width:640px;margin:12vh auto;padding:0 24px;font-family:'Inter',system-ui,sans-serif;color:#fafafa;text-align:center;">+ <h1 style="font-size:26px;font-weight:700;letter-spacing:-0.01em;margin:0 0 12px;">Walk-Browse the Marketplace</h1>+ <p style="font-size:15px;line-height:1.6;color:#a1a1aa;margin:0 0 24px;">+ This is an interactive 3D hall of real three.ws marketplace listings — agents, avatars, and skills you walk up to and open. It needs JavaScript and WebGL.+ </p>+ <p style="font-size:15px;margin:0 0 20px;">+ <a href="/marketplace" style="color:#fafafa;font-weight:600;">Browse the full marketplace as a grid →</a>+ </p>+ <nav aria-label="Marketplace categories" style="display:flex;gap:18px;justify-content:center;flex-wrap:wrap;font-size:14px;">+ <a href="/marketplace" style="color:#c8c8d0;">Agents</a>+ <a href="/marketplace?tab=avatars" style="color:#c8c8d0;">Avatars</a>+ <a href="/marketplace?tab=skills" style="color:#c8c8d0;">Skills</a>+ </nav>+ </div>+ </noscript>+<header class="walk-site-header" id="walk-header"><div id="nav-container"></div></header><script src="/nav.js"></script>diff --git a/pages/pipeline.html b/pages/pipeline.htmlindex f7fd07c07..19b13c671 100644--- a/pages/pipeline.html+++ b/pages/pipeline.html@@ -123,6 +123,20 @@.pl-legend span { display: inline-flex; align-items: center; gap: 7px; }@media (prefers-reduced-motion: reduce) { * { animation-duration: .001ms !important; } .pl-stage { opacity: 1 !important; transform: none !important; } }</style>++ <meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1">+ <meta property="og:site_name" content="three.ws">+ <meta property="og:locale" content="en_US">+ <meta property="og:image" content="https://three.ws/api/page-og?s=crypto&t=Recording+Pipeline+%E2%80%94+the+data+loop%2C+live&d=One-glance+health+of+the+closed+loop+that+turns+every+pump.fun+launch+into+a+trade+signal%3A+the+launch+recorder%2C+signal+intel%2C+ground-truth+outcomes%2C+Oracle+conv&p=%2Fpipeline">+ <meta property="og:image:width" content="1200">+ <meta property="og:image:height" content="630">+ <meta property="og:image:type" content="image/png">+ <meta property="og:image:alt" content="Recording Pipeline — the data loop, live — three.ws">+ <meta name="twitter:site" content="@trythreews">+ <meta name="twitter:title" content="Recording Pipeline — the data loop, live · three.ws">+ <meta name="twitter:description" content="One-glance health of the closed loop that turns every pump.fun launch into a trade signal: the launch recorder, signal intel, ground-truth outcomes, Oracle conviction, the wallet reputation graph, trained weights, and the agents trading on the result — every stage, in real time.">+ <meta name="twitter:image" content="https://three.ws/api/page-og?s=crypto&t=Recording+Pipeline+%E2%80%94+the+data+loop%2C+live&d=One-glance+health+of+the+closed+loop+that+turns+every+pump.fun+launch+into+a+trade+signal%3A+the+launch+recorder%2C+signal+intel%2C+ground-truth+outcomes%2C+Oracle+conv&p=%2Fpipeline">+ <script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"WebPage","name":"Recording Pipeline — the data loop, live","description":"One-glance health of the closed loop that turns every pump.fun launch into a trade signal: the launch recorder, signal intel, ground-truth outcomes, Oracle conviction, the wallet reputation graph, trained weights, and the agents trading on the result — every stage, in real time.","url":"https://three.ws/pipeline","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"},"primaryImageOfPage":"https://three.ws/api/page-og?s=crypto&t=Recording+Pipeline+%E2%80%94+the+data+loop%2C+live&d=One-glance+health+of+the+closed+loop+that+turns+every+pump.fun+launch+into+a+trade+signal%3A+the+launch+recorder%2C+signal+intel%2C+ground-truth+outcomes%2C+Oracle+conv&p=%2Fpipeline"}]}</script></head><body><header class="site-header"><div id="nav-container"></div></header>@@ -199,40 +213,40 @@const on = (v) => (v > 0 ? 'active' : 'idle');return [{- n: '01', label: 'Recorder', tag: 'pump.fun feed', state: recState,+ n: '01', label: 'Recorder', tag: 'pump.fun feed', state: recState, href: '/api/sniper/status', external: true,value: rec.state === 'live' ? 'LIVE' : rec.state === 'degraded' ? 'STALL' : rec.state === 'down' ? 'DOWN' : 'OFF',vdim: rec.state !== 'live', vlabel: rec.mode ? rec.mode + ' · ' + (rec.feedLive ? 'feed up' : 'feed down') : 'not reporting',subs: [['Heartbeat', ago(rec.heartbeatAgeMs)], ['Last event', ago(rec.lastEventAgeMs)], ['Reconnects', rec.reconnects ?? '—']],},{- n: '02', label: 'Intel', tag: 'launch signals', state: on(s.intel.observed_24h),+ n: '02', label: 'Intel', tag: 'launch signals', state: on(s.intel.observed_24h), href: '/radar',value: fmt(s.intel.observed_24h), vdim: !s.intel.observed_24h, vlabel: 'launches recorded · 24h',subs: [['Last hour', fmt(s.intel.observed_1h)], ['Avg quality', s.intel.avg_quality ?? '—'], ['Smart-money seen', fmt(s.intel.smart_money_touched)]],},{- n: '03', label: 'Outcomes', tag: 'ground truth', state: on(s.outcomes.labeled),+ n: '03', label: 'Outcomes', tag: 'ground truth', state: on(s.outcomes.labeled), href: '/coin-intel',value: fmt(s.outcomes.labeled), vdim: !s.outcomes.labeled, vlabel: 'coins labeled',subs: [['Graduated', fmt(s.outcomes.graduated)], ['Pumped ≥3×', fmt(s.outcomes.pumped)], ['Rugged', fmt(s.outcomes.rugged)]],},{- n: '04', label: 'Oracle', tag: 'conviction', state: on(s.oracle.scored_total),+ n: '04', label: 'Oracle', tag: 'conviction', state: on(s.oracle.scored_total), href: '/oracle',value: fmt(s.oracle.scored_total), vdim: !s.oracle.scored_total, vlabel: 'coins scored',subs: [['Scored · 24h', fmt(s.oracle.scored_24h)], ['Prime tier', fmt(s.oracle.prime)], ['Strong tier', fmt(s.oracle.strong)]],},{- n: '05', label: 'Reputation', tag: 'wallet graph', state: on(s.reputation.wallets),+ n: '05', label: 'Reputation', tag: 'wallet graph', state: on(s.reputation.wallets), href: '/smart-money',value: fmt(s.reputation.wallets), vdim: !s.reputation.wallets, vlabel: 'wallets profiled',subs: [['Smart money', fmt(s.reputation.smart_money)]],},{- n: '06', label: 'Learning', tag: 'trained weights', state: on(s.learning.sample_size),+ n: '06', label: 'Learning', tag: 'trained weights', state: on(s.learning.sample_size), href: '/coin-intel',value: fmt(s.learning.sample_size), vdim: !s.learning.sample_size, vlabel: s.learning.sample_size >= 50 ? 'samples trained' : 'samples · needs ≥50',subs: s.learning.weights.length? s.learning.weights.slice(0, 3).map((w) => [w.signal.replace(/_/g, ' '), (w.weight >= 0 ? '+' : '') + w.weight.toFixed(2)]): [['Trained', since(s.learning.trained_at)]],},{- n: '07', label: 'Trading', tag: 'armed agents', state: (s.trading.snipes_24h + s.trading.trades_24h) > 0 ? 'active' : on(s.trading.strategies_armed),+ n: '07', label: 'Trading', tag: 'armed agents', state: (s.trading.snipes_24h + s.trading.trades_24h) > 0 ? 'active' : on(s.trading.strategies_armed), href: '/activity',value: fmt(s.trading.snipes_24h + s.trading.trades_24h), vdim: !(s.trading.snipes_24h + s.trading.trades_24h), vlabel: 'snipes + trades · 24h',subs: [['Armed', fmt(s.trading.strategies_armed)], ['Open positions', fmt(s.trading.open_positions)], ['Snipes · 24h', fmt(s.trading.snipes_24h)]],},diff --git a/pages/pulse.html b/pages/pulse.htmlindex b859436d4..6ad7ccd8a 100644--- a/pages/pulse.html+++ b/pages/pulse.html@@ -144,6 +144,7 @@<div class="px-market-htxt"><span class="px-market-title">Trading viability</span><span class="px-market-tag" id="px-trade-pnl-tag">—</span>+ <button type="button" class="px-market-action" id="px-trade-filter" hidden>Show trades in feed →</button></div><span class="px-market-sub">Real, fully-guarded coin trades through agent wallets — what's flowing, what it costs, and the realized P&L on positions that have closed. The honest signal behind the Trades counter.</span></div>@@ -153,7 +154,7 @@<div class="px-kpi"><dt>SOL deployed · 7d</dt><dd id="px-trade-dep7">—</dd><span class="px-kpi-sub" id="px-trade-dep7-sub">into buys</span></div><div class="px-kpi"><dt>Avg trade · 7d</dt><dd id="px-trade-avg">—</dd><span class="px-kpi-sub">SOL per buy</span></div><div class="px-kpi"><dt>Active traders · 24h</dt><dd id="px-trade-act">—</dd><span class="px-kpi-sub">wallets trading</span></div>- <div class="px-kpi"><dt>Realized P&L · 7d</dt><dd id="px-trade-pnl">—</dd><span class="px-kpi-sub" id="px-trade-pnl-sub">closed positions</span></div>+ <div class="px-kpi px-kpi--pnl"><dt>Realized P&L · 7d</dt><dd id="px-trade-pnl">—</dd><span class="px-kpi-sub" id="px-trade-pnl-sub">closed positions</span></div></div><div class="px-market-body"><div class="px-market-spark">@@ -164,7 +165,7 @@<div class="px-spark-bars" id="px-trade-spark" role="img" aria-label="Daily trade count, last 7 days"></div></div><div class="px-market-skills">- <div class="px-card-h">Top traders <small>trades · 7d</small></div>+ <div class="px-card-h"><span>Top traders</span><small>trades · 7d</small></div><div id="px-trade-traders"><p class="px-lb-empty">Loading…</p></div></div></div>diff --git a/public/changelog.json b/public/changelog.jsonindex 1271315ac..2c4c1406f 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-27T20:38:35.015Z",+ "generated_at": "2026-06-27T21:08:07.009Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",diff --git a/public/features.json b/public/features.jsonindex 1bc1b68a1..1c12824f1 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-27T20:38:34.997Z",+ "generated_at": "2026-06-27T21:08:06.991Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/public/sitemap/index.html b/public/sitemap/index.htmlindex 965a6ca1b..3e9c43b4c 100644--- a/public/sitemap/index.html+++ b/public/sitemap/index.html@@ -56,6 +56,25 @@.sm-brand img { width: 24px; height: 24px; border-radius: 5px; }.sm-brand:hover { text-decoration: none; }</style>++ <meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1">+ <meta property="og:type" content="website">+ <meta property="og:site_name" content="three.ws">+ <meta property="og:locale" content="en_US">+ <meta property="og:title" content="Sitemap · three.ws">+ <meta property="og:description" content="Human-readable index of every page on three.ws.">+ <meta property="og:url" content="https://three.ws/sitemap">+ <meta property="og:image" content="https://three.ws/api/page-og?s=main&t=Sitemap&d=Human-readable+index+of+every+page+on+three.ws.&p=%2Fsitemap">+ <meta property="og:image:width" content="1200">+ <meta property="og:image:height" content="630">+ <meta property="og:image:type" content="image/png">+ <meta property="og:image:alt" content="Sitemap — three.ws">+ <meta name="twitter:card" content="summary_large_image">+ <meta name="twitter:site" content="@trythreews">+ <meta name="twitter:title" content="Sitemap · three.ws">+ <meta name="twitter:description" content="Human-readable index of every page on three.ws.">+ <meta name="twitter:image" content="https://three.ws/api/page-og?s=main&t=Sitemap&d=Human-readable+index+of+every+page+on+three.ws.&p=%2Fsitemap">+ <script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"WebPage","name":"Sitemap","description":"Human-readable index of every page on three.ws.","url":"https://three.ws/sitemap","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"},"primaryImageOfPage":"https://three.ws/api/page-og?s=main&t=Sitemap&d=Human-readable+index+of+every+page+on+three.ws.&p=%2Fsitemap"}]}</script></head><body><header class="sm-topbar">diff --git a/src/admin-launcher.js b/src/admin-launcher.jsindex 7124ae22e..38f1a5e86 100644--- a/src/admin-launcher.js+++ b/src/admin-launcher.js@@ -21,7 +21,7 @@ const SOURCES = [{ id: 'trending', label: 'Trending' },{ id: 'knowyourmeme', label: 'Know Your Meme' },{ id: 'x', label: 'X' },- { id: 'oracle', label: 'Oracle' },+ { id: 'googletrends', label: 'Google Trends' },{ id: 'hackernews', label: 'Hacker News' },{ id: 'reddit', label: 'Reddit' },{ id: 'wikipedia', label: 'Wikipedia' },diff --git a/src/marketplace-gallery-data.js b/src/marketplace-gallery-data.jsnew file mode 100644index 000000000..7598cd12d--- /dev/null+++ b/src/marketplace-gallery-data.js@@ -0,0 +1,159 @@+/**+ * Pure data helpers for the Walk-Browse marketplace gallery.+ *+ * Kept dependency-free (no three.js, no DOM) so listing normalisation, price /+ * count / rating formatting, source interleaving, and the ?type deep-link alias+ * map are unit-testable in plain Node and reused verbatim by+ * src/marketplace-gallery.js. The gallery itself owns everything that touches+ * WebGL or the document.+ */++export const PAGE_SIZE = 18;++export const TYPE_ACCENT = { agent: '#8b5cf6', avatar: '#22d3ee', skill: '#34d399' };+export const TYPE_LABEL = { agent: 'Agent', avatar: 'Avatar', skill: 'Skill' };++export const FILTERS = [+ { key: 'all', label: 'All' },+ { key: 'agent', label: 'Agents' },+ { key: 'avatar', label: 'Avatars' },+ { key: 'skill', label: 'Skills' },+];++// A shared link can carry either the singular or plural form (?type=skill or+// ?type=skills both land on Skills); 'agents'/'avatars' likewise. Anything else+// → null, so the caller falls back to the default 'all'.+const FILTER_ALIASES = {+ all: 'all',+ agent: 'agent',+ agents: 'agent',+ avatar: 'avatar',+ avatars: 'avatar',+ skill: 'skill',+ skills: 'skill',+};++export function normalizeFilterKey(raw) {+ if (!raw) return null;+ return FILTER_ALIASES[String(raw).trim().toLowerCase()] || null;+}++// asset_prices arrive as a base-unit integer + mint decimals. Anything missing,+// zero, or unparseable reads as "Free" rather than "$0" or "$NaN".+export function fmtTokenPrice(price) {+ if (!price || price.amount == null) return 'Free';+ const dec = Number(price.mint_decimals ?? 6);+ const v = Number(price.amount) / Math.pow(10, dec);+ if (!Number.isFinite(v) || v <= 0) return 'Free';+ return `$${v >= 1 ? v.toLocaleString(undefined, { maximumFractionDigits: 2 }) : v.toFixed(2)}`;+}++export function isPaidToken(price) {+ return !!(price && price.amount != null && Number(price.amount) > 0);+}++// Compact human counts for tight UI: 340 → "340", 1240 → "1.2k", 2.3M → "2.3M".+// Returns null for nothing-to-show (0/negative/NaN) so callers can omit the chip.+export function fmtCount(n) {+ const v = Number(n);+ if (!Number.isFinite(v) || v <= 0) return null;+ if (v < 1000) return String(Math.round(v));+ if (v < 1_000_000) {+ const k = v / 1000;+ return `${k >= 100 ? Math.round(k) : k.toFixed(1).replace(/\.0$/, '')}k`;+ }+ const m = v / 1_000_000;+ return `${m >= 100 ? Math.round(m) : m.toFixed(1).replace(/\.0$/, '')}M`;+}++// A rating only counts as social proof once at least one person has rated it.+export function makeRating(avg, count) {+ const a = Number(avg);+ const c = Number(count) || 0;+ if (!Number.isFinite(a) || a <= 0 || c <= 0) return null;+ return { avg: Math.round(a * 10) / 10, count: c };+}++function makeUses(label, count) {+ const c = Number(count);+ if (!Number.isFinite(c) || c <= 0) return null;+ return { label, count: c };+}++function cleanTags(tags) {+ if (!Array.isArray(tags)) return [];+ return tags+ .map((t) => String(t || '').trim())+ .filter(Boolean)+ .slice(0, 4);+}++export function normalizeAgent(a) {+ return {+ type: 'agent',+ id: a.id,+ name: a.name || 'Untitled agent',+ description: a.description || '',+ image: a.thumbnail_url || null,+ price: fmtTokenPrice(a.price),+ paid: isPaidToken(a.price),+ category: a.category || '',+ author: null,+ rating: makeRating(a.rating_avg, a.rating_count),+ uses: makeUses('owners', a.buyers_total),+ tags: cleanTags(a.tags),+ featured: false,+ href: `/marketplace/agents/${encodeURIComponent(a.id)}`,+ };+}++export function normalizeAvatar(a) {+ return {+ type: 'avatar',+ id: a.avatarId,+ name: a.name || 'Untitled avatar',+ description: a.description || '',+ image: a.image || null,+ price: fmtTokenPrice(a.price),+ paid: isPaidToken(a.price),+ category: a.modelCategory || 'avatar',+ author: a.author?.displayName || a.author?.handle || null,+ rating: null,+ uses: makeUses('views', a.viewCount),+ tags: cleanTags(a.tags),+ featured: !!a.featured,+ href: `/marketplace/avatars/${encodeURIComponent(a.avatarId)}`,+ };+}++export function normalizeSkill(s) {+ const usd = Number(s.price_per_call_usd);+ const paid = Number.isFinite(usd) && usd > 0;+ return {+ type: 'skill',+ id: s.slug || s.id,+ name: s.name || 'Untitled skill',+ description: s.description || '',+ image: null,+ price: paid ? `$${usd}/call` : 'Free',+ paid,+ category: s.category || '',+ author: s.author?.display_name || null,+ rating: makeRating(s.avg_rating, s.rating_count),+ uses: makeUses('installs', s.install_count),+ tags: cleanTags(s.tags),+ featured: false,+ href: `/marketplace/skills/${encodeURIComponent(s.slug || s.id)}`,+ };+}++// Round-robin merge so an "All" hall reads as a varied mix of agents/avatars/+// skills rather than three solid blocks. Empty lanes are skipped.+export function interleave(lanes) {+ const arrs = (lanes || []).filter((l) => Array.isArray(l) && l.length);+ const merged = [];+ for (let i = 0; arrs.some((l) => i < l.length); i++) {+ for (const lane of arrs) if (i < lane.length) merged.push(lane[i]);+ }+ return merged;+}diff --git a/src/marketplace-gallery.js b/src/marketplace-gallery.jsindex 6c2b02d45..d703727b2 100644--- a/src/marketplace-gallery.js+++ b/src/marketplace-gallery.js@@ -50,7 +50,11 @@ const RELEASE_RANGE = 3.4; // step past this → dismiss (hysteresis stops flickconst REBASE_AT = 500; // fold belt offset back near 0 to preserve float precisionconst PAGE_SIZE = 18;-const TYPE_ACCENT = { agent: '#8b5cf6', avatar: '#22d3ee', skill: '#34d399' };+// Monochrome brightness tiers — matches the platform's monochrome design system+// (public/tokens.css). Type identity is carried by brightness (and the explicit+// TYPE_LABEL text drawn on every plinth + the panel badge), never a brand hue, so+// the hall reads as one cohesive material rather than three colour-coded zones.+const TYPE_ACCENT = { agent: '#fafafa', avatar: '#c8c8d0', skill: '#9a9aa3' };const TYPE_LABEL = { agent: 'Agent', avatar: 'Avatar', skill: 'Skill' };const FILTERS = [@@ -129,7 +133,7 @@ function ensureStyles() {border:1px solid rgba(255,255,255,.12);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:#fafafa;font-size:13px;box-shadow:0 12px 40px rgba(0,0,0,.5);max-width:min(420px,calc(100vw - 32px));}.mwg-toast[data-show="1"]{display:inline-flex;}-.mwg-toast a,.mwg-toast button{color:#8b5cf6;font-weight:700;text-decoration:none;background:none;+.mwg-toast a,.mwg-toast button{color:#fafafa;font-weight:700;text-decoration:underline;background:none;border:0;font:inherit;cursor:pointer;padding:0;white-space:nowrap;}@media (hover:none),(max-width:640px){@@ -741,7 +745,7 @@ export function createMarketplaceGallery({ scene, getLocalPosition }) {<span class="mwg-panel-price" style="color:${accent}">${escapeHtml(listing.price)}</span>${listing.category ? `<span class="mwg-panel-cat">${escapeHtml(listing.category)}</span>` : ''}</div>- <button class="mwg-panel-cta" type="button" style="background:${accent}">View listing →</button>+ <button class="mwg-panel-cta" type="button" style="background:#fafafa">View listing →</button><p class="mwg-panel-hint">Press <kbd>E</kbd> to open</p></div>`;panel.querySelector('.mwg-panel-cta')?.addEventListener('click', navigateActive);diff --git a/tests/env-upstash-cred.test.js b/tests/env-upstash-cred.test.jsindex 2bad2291f..ec888fa9e 100644--- a/tests/env-upstash-cred.test.js+++ b/tests/env-upstash-cred.test.js@@ -61,9 +61,13 @@ describe('env Upstash credential trimming', () => {expect(env.UPSTASH_REDIS_REST_TOKEN).toBeUndefined();});- it('falls through to the Vercel-KV alias when the primary is whitespace-only', () => {+ it('falls through to the Vercel-KV alias pair when the primary pair is incomplete', () => {+ // Primary source has a whitespace-only token (→ incomplete pair); the KV+ // marketplace alias supplies a complete url+token pair and wins.process.env.UPSTASH_REDIS_REST_TOKEN = ' ';+ process.env.KV_REST_API_URL = 'https://alias.upstash.io';process.env.KV_REST_API_TOKEN = 'alias-token\n';+ expect(env.UPSTASH_REDIS_REST_URL).toBe('https://alias.upstash.io');expect(env.UPSTASH_REDIS_REST_TOKEN).toBe('alias-token');});@@ -75,8 +79,45 @@ describe('env Upstash credential trimming', () => {expect(env.UPSTASH_CACHE_REST_TOKEN).toBe('cache-tok');});- it('leaves a clean token untouched', () => {+ it('leaves a clean url+token pair untouched', () => {+ process.env.UPSTASH_REDIS_REST_URL = 'https://example.upstash.io';process.env.UPSTASH_REDIS_REST_TOKEN = 'AX1sclean';+ expect(env.UPSTASH_REDIS_REST_URL).toBe('https://example.upstash.io');expect(env.UPSTASH_REDIS_REST_TOKEN).toBe('AX1sclean');});});++describe('env Upstash atomic credential pairing (cross-store WRONGPASS guard)', () => {+ it('never pairs a URL from one source with a token from another', () => {+ // The exact prod failure: a manual URL (store A) + an integration-injected+ // token (store B). Independent `||` chains would emit url-A + token-B, which+ // Upstash rejects as WRONGPASS. Atomic pairing must reject the incomplete+ // primary and fall to the only fully-configured source instead.+ process.env.UPSTASH_REDIS_REST_URL = 'https://store-a.upstash.io';+ process.env.KV_REST_API_TOKEN = 'store-b-token';+ // Primary pair: url set, token missing → incomplete. KV pair: token set, url+ // missing → incomplete. No complete source → both halves undefined (so+ // getRedis() skips cleanly instead of authenticating as WRONGPASS).+ expect(env.UPSTASH_REDIS_REST_URL).toBeUndefined();+ expect(env.UPSTASH_REDIS_REST_TOKEN).toBeUndefined();+ });++ it('returns a matched pair from the same source when one is complete', () => {+ process.env.UPSTASH_REDIS_REST_URL = 'https://store-a.upstash.io';+ process.env.three_KV_REST_API_URL = 'https://store-b.upstash.io';+ process.env.three_KV_REST_API_TOKEN = 'store-b-token';+ // Primary pair incomplete (no token); the `three_` source is complete and+ // its URL and token travel together.+ expect(env.UPSTASH_REDIS_REST_URL).toBe('https://store-b.upstash.io');+ expect(env.UPSTASH_REDIS_REST_TOKEN).toBe('store-b-token');+ });++ it('prefers the highest-priority complete source', () => {+ process.env.UPSTASH_REDIS_REST_URL = 'https://primary.upstash.io';+ process.env.UPSTASH_REDIS_REST_TOKEN = 'primary-token';+ process.env.KV_REST_API_URL = 'https://alias.upstash.io';+ process.env.KV_REST_API_TOKEN = 'alias-token';+ expect(env.UPSTASH_REDIS_REST_URL).toBe('https://primary.upstash.io');+ expect(env.UPSTASH_REDIS_REST_TOKEN).toBe('primary-token');+ });+});diff --git a/tests/pulse-trading.test.js b/tests/pulse-trading.test.jsnew file mode 100644index 000000000..1aa905825--- /dev/null+++ b/tests/pulse-trading.test.js@@ -0,0 +1,95 @@+// Pulse "Trading viability" — the money math behind GET /api/pulse?view=trading.+//+// The panel and any agent client lean on two guarantees these tests pin:+// 1. A window's `trades` is a pass-through of the headline COUNT, so the panel+// can never silently drift from the number at the top of /pulse.+// 2. SOL is always lamports/1e9, and the average trade amortises real deployed+// SOL over the BUY count (sells carry no SOL out), never over total trades.++import { describe, it, expect } from 'vitest';+import {+ solFromLamports,+ shapeTradingWindow,+ shapeTradingPnl,+ shapeTradingSeries,+} from '../api/_lib/pulse-trading.js';++describe('solFromLamports', () => {+ it('converts lamports (string or number) to SOL', () => {+ expect(solFromLamports('1000000000')).toBe(1);+ expect(solFromLamports(500_000_000)).toBe(0.5);+ });+ it('treats null/undefined/empty as zero', () => {+ expect(solFromLamports(null)).toBe(0);+ expect(solFromLamports(undefined)).toBe(0);+ expect(solFromLamports('0')).toBe(0);+ });+});++describe('shapeTradingWindow', () => {+ it('passes trade count straight through (reconciles with the headline counter)', () => {+ const row = { trades: 42, buys: 30, sells: 12, deployed_lamports: '340000000', deployed_usd: 24.5, traders: 9 };+ expect(shapeTradingWindow(row).trades).toBe(42);+ });++ it('derives deployed SOL and averages it over BUYS, not total trades', () => {+ // 0.34 SOL across 30 buys (12 of the 42 trades were sells with no SOL out).+ const w = shapeTradingWindow({ trades: 42, buys: 30, sells: 12, deployed_lamports: '340000000', deployed_usd: 24.5, traders: 9 });+ expect(w.deployed_sol).toBeCloseTo(0.34, 9);+ expect(w.avg_trade_sol).toBeCloseTo(0.34 / 30, 9);+ expect(w.sells).toBe(12);+ expect(w.traders).toBe(9);+ });++ it('avg trade is 0 (never NaN/Infinity) when there are no buys', () => {+ const w = shapeTradingWindow({ trades: 3, buys: 0, sells: 3, deployed_lamports: '0' });+ expect(w.avg_trade_sol).toBe(0);+ expect(Number.isFinite(w.avg_trade_sol)).toBe(true);+ });++ it('defaults every field to a safe zero for an empty/missing row', () => {+ for (const empty of [undefined, null, {}]) {+ const w = shapeTradingWindow(empty);+ expect(w).toMatchObject({ trades: 0, buys: 0, sells: 0, deployed_sol: 0, deployed_usd: 0, traders: 0, avg_trade_sol: 0 });+ }+ });+});++describe('shapeTradingPnl', () => {+ it('keeps the signed net (a loss stays negative) and computes the win rate', () => {+ const p = shapeTradingPnl({ closed_count: 11, wins: 7, net_lamports: '52000000' });+ expect(p.net_sol).toBeCloseTo(0.052, 9);+ expect(p.closed_positions).toBe(11);+ expect(p.win_rate).toBeCloseTo(7 / 11, 9);+ });++ it('preserves a negative net P&L (loss) rather than clamping it', () => {+ const p = shapeTradingPnl({ closed_count: 4, wins: 1, net_lamports: '-30000000' });+ expect(p.net_sol).toBeCloseTo(-0.03, 9);+ expect(p.win_rate).toBeCloseTo(0.25, 9);+ });++ it('win_rate is null (not 0) when nothing has closed — drives the honest empty state', () => {+ const p = shapeTradingPnl({ closed_count: 0, wins: 0, net_lamports: '0' });+ expect(p.win_rate).toBeNull();+ expect(p.closed_positions).toBe(0);+ expect(p.net_sol).toBe(0);+ });+});++describe('shapeTradingSeries', () => {+ it('maps daily rows to sparkline points with SOL-converted deploy', () => {+ const out = shapeTradingSeries([+ { label: 'Mon', day: '2026-06-22', trades: 12, deployed_lamports: '100000000' },+ { label: 'Tue', day: '2026-06-23', trades: 40, deployed_lamports: '300000000' },+ ]);+ expect(out).toHaveLength(2);+ expect(out[0]).toEqual({ label: 'Mon', day: '2026-06-22', trades: 12, deployed_sol: 0.1 });+ expect(out[1].deployed_sol).toBeCloseTo(0.3, 9);+ });++ it('returns [] for null/undefined input', () => {+ expect(shapeTradingSeries(null)).toEqual([]);+ expect(shapeTradingSeries(undefined)).toEqual([]);+ });+});diff --git a/tests/vercel-action-routes.test.js b/tests/vercel-action-routes.test.jsnew file mode 100644index 000000000..c943a41eb--- /dev/null+++ b/tests/vercel-action-routes.test.js@@ -0,0 +1,76 @@+import { describe, it, expect } from 'vitest';+import { readFileSync } from 'node:fs';+import { fileURLToPath } from 'node:url';+import { globSync } from 'glob';++// Guards against a real production outage class: a nested dynamic API function+// `api/<dir>/[action].js` ships to Vercel but has NO route in vercel.json's+// legacy `routes` array, so the path falls through to `handle: filesystem`,+// matches nothing, and Vercel serves the styled HTML 404 page — the function is+// deployed but unreachable. This silently broke EVM/Solana wallet sign-in+// (/api/auth/siwe, /api/auth/siws), session management (/api/auth/session),+// token launch (/api/agents/tokens), agent payments, on-chain tx prep/confirm,+// checkout, and live-walk control — every one returned the 404 page in prod.+//+// Unlike single-segment functions (api/<dir>/[action].js, caught by a top-level+// `/api/<dir>/([^/]+)` rewrite), NESTED functions (api/<a>/<b>/[action].js) each+// need their own explicit route mapping. Two valid styles exist and both count+// as covered here:+// · generic capture — src "/api/a/b/([^/]+)" dest "/api/a/b/[action]?action=$1"+// · per-action lines — src "/api/a/b/([...])/x" dest "/api/a/b/[action]?...=x"+// Either way the dest path lands inside the function's own directory, so a+// function is "routed" iff some route's dest (sans query) begins with its dir.++const repoRoot = fileURLToPath(new URL('..', import.meta.url));+const vercel = JSON.parse(readFileSync(new URL('../vercel.json', import.meta.url), 'utf8'));++// Path part of every route dest, e.g. "/api/auth/siwe/[action]?action=$1" → "/api/auth/siwe/[action]".+const destPaths = (vercel.routes || [])+ .map((r) => (typeof r.dest === 'string' ? r.dest.split('?')[0] : null))+ .filter(Boolean);++// Every nested dynamic function: api/<seg>/<seg...>/[action].js (≥2 dir segments).+const nestedActionFns = globSync('api/**/[[]action].js', { cwd: repoRoot })+ .map((file) => {+ const dir = file.slice('api/'.length).replace(/\/\[action\]\.js$/, ''); // e.g. "auth/siwe"+ return { file, dir, segments: dir.split('/').length };+ })+ .filter((fn) => fn.segments >= 2);++function isRouted(dir) {+ const prefix = `/api/${dir}/`;+ return destPaths.some((d) => d.startsWith(prefix));+}++describe('vercel.json routes cover every nested [action] function', () => {+ it('discovers the nested dynamic API functions', () => {+ // Sanity: the glob must actually find functions, or the guard is vacuous.+ expect(nestedActionFns.length).toBeGreaterThan(5);+ });++ it.each(nestedActionFns)('$dir/[action].js is reachable via a vercel.json route', ({ dir }) => {+ expect(+ isRouted(dir),+ `api/${dir}/[action].js has no route in vercel.json — it will 404 in production. ` ++ `Add { "src": "/api/${dir}/([^/]+)", "dest": "/api/${dir}/[action]?action=$1" }.`,+ ).toBe(true);+ });++ it('the specific endpoints from the routing outage are all covered', () => {+ const mustRoute = [+ 'auth/siwe',+ 'auth/siws',+ 'auth/session',+ 'agents/onchain',+ 'agents/payments',+ 'agents/tokens',+ 'payments/solana',+ 'payments/evm',+ 'tx/solana',+ 'walk/control',+ 'admin/news',+ ];+ const missing = mustRoute.filter((d) => !isRouted(d));+ expect(missing, `unreachable in production: ${missing.join(', ')}`).toEqual([]);+ });+});diff --git a/workers/agent-screen-worker/task-runner.js b/workers/agent-screen-worker/task-runner.jsindex 739bfba69..d654931bc 100644--- a/workers/agent-screen-worker/task-runner.js+++ b/workers/agent-screen-worker/task-runner.js@@ -7,7 +7,11 @@* and executes it with Stagehand.** 2. Autonomous loop — when no queued task is waiting, the worker falls back- * to the default mission (scan pump.fun for trending tokens and narrate).+ * to a neutral idle mission: it sits on the agent's three.ws home presence+ * and narrates that it is standing by for a task. The idle loop is+ * deliberately content-agnostic — it never surfaces, scans, ranks, or+ * narrates third-party tokens or markets. All real work is user-directed+ * via the queued-task path.** Callers: index.js passes { page, context, cfg, push } and runs this forever.* push() signature: ({ agentId, page, activity, type }) → Promise<void>@@ -16,19 +20,8 @@import { z } from 'zod';import fetch from 'node-fetch';-const PUMP_FUN_URL = 'https://pump.fun';const TASK_POLL_MS = 3_000; // how often to check for a user-queued task-const TokenListSchema = z.object({- tokens: z.array(- z.object({- name: z.string(),- symbol: z.string().optional(),- marketCap: z.string().optional(),- })- ),-});-// ── main export ───────────────────────────────────────────────────────────────export async function runTask({ page, cfg, push }) {@@ -139,7 +132,6 @@ function pickStartUrl(taskText, taskType) {if (t.includes('recipe') || t.includes('cook') || t.includes('food')) {return 'https://www.allrecipes.com';}- if (taskType === 'trade') return 'https://pump.fun';return `https://www.google.com/search?q=${encodeURIComponent(taskText)}`;}