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: env credential handling, rate-limit hardening, and coin launcher migration
nirholasf0ba84653c72
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex beeab1656..8182fb74f 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -10,12 +10,16 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Live Agents** (`/agents-live`) — Mission control — real-time grid of all AI agents with active screen streams. Watch their screens and avatar feeds live.- **Partner Ecosystem** (`/partners`) — three.ws partner ecosystem — AWS, IBM, Google Cloud, Alibaba Cloud, Intel, NVIDIA, Microsoft, Oracle. The cloud and AI platforms powering 3D AI agents at enterprise scale.- **three.ws Joins the Alibaba Cloud Partner Network** (`/blog/three-ws-alibaba-cloud-partnership`) — three.ws is now an Alibaba Cloud Partner, bringing Qwen foundation models and Asia-Pacific cloud infrastructure to the three.ws 3D AI agent platform.+- **60 live x402 payments per minute** — A new per-minute cron fires 60 parallel real Solana USDC micropayments each tick via the x402 protocol, seeding the platform's payment activity feed and club stage with continuous on-chain traffic. Each payment is a signed SPL TransferChecked transaction broadcast via the Solana facilitator — not simulated. Configure the batch size or pause it with X402_SEED_BATCH_SIZE / X402_SEED_ENABLED. (`/pay`) `[infra, feature]`- **Alibaba Cloud partnership — Qwen models and alibaba-cloud-mcp** — three.ws joins the Alibaba Cloud Partner Network. Qwen-Max, Qwen-Plus, Qwen-Turbo, and Qwen-Long are now available as agent brain options via DashScope. Ships with @three-ws/alibaba-cloud-mcp — a new MCP server for chat, embeddings, and model discovery using your own Alibaba Cloud API key. Set DASHSCOPE_API_KEY in Vercel to activate. (`/blog/three-ws-alibaba-cloud-partnership`) `[feature]`- **Capabilities dashboard — live command center for all 4 autonomous features** — New /dashboard/capabilities page surfaces live status for Alpha Hunt, Coin Launcher, Auto-Claim, and Market Maker in one view. KPI strips show daily budget, total volume, claimable fees, and net P&L per capability. Tabbed tables show launched coins, schedule status, per-market inventory bars, and recent MM trades. Alpha Hunt trigger is now also configurable directly from the Sniper Strategies dashboard — full field set including min smart-money count, quality score, organic score, max market cap, and narrative keywords. (`/dashboard/capabilities`) `[feature, improvement]`+- **Hardened Redis credentials against dashboard paste errors** — A trailing newline or stray space on the Upstash Redis token — the kind that creeps in when pasting into a dashboard — was being sent verbatim in the auth header and rejected as WRONGPASS, while the URL still resolved. The result was thousands of failures an hour: paid endpoints denying, the payments feed not loading, usage telemetry and caches going dark. Redis credentials are now trimmed at the source (matching how wallet addresses, RPC URLs, and certificates are already sanitized), so a single stray character can never silently take the limiter, feed, and caches offline. `[fix, infra]`- **Improved resilience during database outages** — API endpoints now return HTTP 503 (Service Unavailable) with a Retry-After header instead of 500 when the database is temporarily unreachable, so clients and caches know to back off and retry rather than treating it as a permanent error. Background crons skip their tick gracefully and log a warning instead of firing repeated alert storms. A single deduped ops alert now covers the whole outage. `[fix, infra]`- **Live Agents mission control + one-click session launcher** — New /agents-live page shows a real-time grid of every AI agent with an active screen stream — watch their screens and avatar feeds live, all in one view. Agent owners now get a "Start Live Session" panel on any watch view: click Generate credentials, copy the Docker or Node launch command, run it anywhere, and the agent browser session starts streaming to the screen canvas instantly. Sessions are signed 7-day bearer tokens, no extra setup required. (`/agents-live`) `[feature]`- **Manage your AWS Marketplace API key — new keys & usage page** — AWS Marketplace subscribers (and anyone with an x402 subscription key) now have a home for it at /billing/keys. See every key with its billing source — AWS Marketplace or on-chain — live status, rate limit, total calls, and when it was last used. Rotate a key to get a fresh secret in one click (AWS-billed keys stay linked to your AWS account and keep metering correctly), or revoke a native key outright. The post-subscribe welcome flow now points here, so a lost key is always recoverable by rotating instead of being stuck. (`/billing/keys`) `[feature]`- **Partner ecosystem page** — New /partners page showing all active technology partnerships — AWS, IBM, Google Cloud, Alibaba Cloud, Intel, NVIDIA, Microsoft, and Oracle — with what each powers on the platform, tier badges, and links to partner-specific pages and MCP servers. (`/partners`) `[feature]`+- **Production stability fixes — payment sessions, Redis error handling, infra resilience** — Fixed a SQL syntax error that blocked payment session expiry and refunds (PostgreSQL does not allow LIMIT directly in UPDATE — now uses a CTE with FOR UPDATE SKIP LOCKED). Fixed esbuild class-name minification breaking NeonDB error detection in production — infrastructure errors (wrong DB credentials, Redis auth) now correctly return 503 and suppress alert storms instead of crashing every endpoint with 500. Added graceful Redis-unavailable handling to the usage flush buffer and the bounty board API. Fixed Express-style response methods in pulse-tick cron. `[fix, infra]`+- **Sign-in restored during rate-limiter outages** — Fixed an issue where a temporary outage of the distributed rate limiter could block every sign-in attempt platform-wide. The login and registration limiters now degrade gracefully to a local per-instance cap during such an outage — keeping sign-in available while still throttling brute-force attempts — instead of denying everyone. Money-moving limits are unchanged and still fail safe. `[fix, security]`- **Task input on Agent Screen — send your agent a task and watch it work** — You can now type any task directly into the Agent Screen page and your agent picks it up in real time. The live screen panel has a new command bar at the bottom: type what you want your agent to do (research, browse, shop, monitor, trade) and hit send. The task is queued via /api/agent-task and the running worker executes it with Stagehand, streaming every browser action back to the live screen as it happens. The worker automatically checks for new tasks every 3 seconds and runs them in priority order, falling back to its autonomous loop when the queue is empty. (`/agent-screen`) `[feature, improvement]`- **Top Performers podium on marketplace — oracle-ranked agent leaderboard** — The marketplace now surfaces the top 3 oracle-performing agents in trophy-style cards above the agent grid. Each card shows oracle win rate, W/L record, and realized PnL. Rank 1 gets gold, rank 2 silver, rank 3 bronze. Cards shimmer while loading and disappear cleanly when no oracle data exists. Links directly to each agent's profile. (`/marketplace`) `[feature, improvement]`diff --git a/api/_lib/env.js b/api/_lib/env.jsindex 4eff732e8..6f559beaa 100644--- a/api/_lib/env.js+++ b/api/_lib/env.js@@ -108,6 +108,24 @@ function pem(name) {return v.includes('\\n') ? v.replace(/\\n/g, '\n') : v;}+// Bearer-token / endpoint credentials (Upstash REST URL + token, etc.) pasted+// into the Vercel/Upstash dashboards frequently carry a trailing newline or stray+// spaces. The @upstash/redis client drops the token straight into an+// `Authorization: Bearer <token>` header and the URL into `fetch(`${url}/...`)`,+// so a single trailing "\n" produces the exact production symptom we hit —+// "WRONGPASS invalid or missing auth token" on a token that is otherwise correct,+// while the URL still resolves (Upstash is reached, only the header is rejected).+// That one stray character fails every critical limiter CLOSED (denying paid+// endpoints) and silently disables the usage buffer + caches. Trim at the source+// so no Redis consumer ever sees whitespace. Returns undefined when blank so the+// `if (url && token)` guard in redis.js still skips cleanly. Mirrors+// addr()/normalizeRpcUrl()/pem().+function cred(value) {+ if (value == null) return value;+ const v = String(value).trim();+ return v || undefined;+}+export const env = {get APP_ORIGIN() {return normalizeAppOrigin(opt('PUBLIC_APP_ORIGIN'));@@ -145,15 +163,19 @@ export const env = {},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 (- opt('UPSTASH_REDIS_REST_URL') || opt('three_KV_REST_API_URL') || opt('KV_REST_API_URL')+ cred(opt('UPSTASH_REDIS_REST_URL')) ||+ cred(opt('three_KV_REST_API_URL')) ||+ cred(opt('KV_REST_API_URL')));},get UPSTASH_REDIS_REST_TOKEN() {return (- opt('UPSTASH_REDIS_REST_TOKEN') ||- opt('three_KV_REST_API_TOKEN') ||- opt('KV_REST_API_TOKEN')+ cred(opt('UPSTASH_REDIS_REST_TOKEN')) ||+ cred(opt('three_KV_REST_API_TOKEN')) ||+ cred(opt('KV_REST_API_TOKEN')));},@@ -168,10 +190,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 opt('UPSTASH_CACHE_REST_URL') || opt('cache_KV_REST_API_URL');+ return cred(opt('UPSTASH_CACHE_REST_URL')) || cred(opt('cache_KV_REST_API_URL'));},get UPSTASH_CACHE_REST_TOKEN() {- return opt('UPSTASH_CACHE_REST_TOKEN') || opt('cache_KV_REST_API_TOKEN');+ return cred(opt('UPSTASH_CACHE_REST_TOKEN')) || cred(opt('cache_KV_REST_API_TOKEN'));},// ── Upstash quota-burn visibility (api/_lib/redis-usage.js) ──────────────diff --git a/api/_lib/migrations/20260629060000_coin_launcher.sql b/api/_lib/migrations/20260629060000_coin_launcher.sqlnew file mode 100644index 000000000..d10b69dd8--- /dev/null+++ b/api/_lib/migrations/20260629060000_coin_launcher.sql@@ -0,0 +1,144 @@+-- Migration: autonomous coin launcher (Memetic Launcher).+-- Apply: psql "$DATABASE_URL" -f api/_lib/migrations/20260629060000_coin_launcher.sql+-- (or `npm run db:migrate`). Idempotent.+--+-- The autonomous launcher mints pump.fun coins on a hybrid cadence: real trend+-- signals fire first, a throttled meme/random generator fills to a target rate.+-- A master wallet (SOLANA_SIGNERS 'coin-launcher-master') tops up the next agent+-- in the rotation with the per-launch SOL, then that agent signs its OWN create+-- (api/pump/[action].js handleLaunchAgent) — so every coin carries a real agent+-- avatar as its on-chain identity. Each launch routes buyback_bps into $THREE+-- buyback-and-burn and lands in /launches as a runtime record.+--+-- Three tables:+-- launcher_config — one row per scope ('global' admin default, or per 'user').+-- launcher_queue — the curated agent rotation (who can launch, in what order).+-- launcher_runs — append-only audit of every attempt (cost, mint, status).+--+-- Ships SAFE: a fresh global row is disabled + dry_run, so no real SOL moves and+-- no coin mints until an operator explicitly arms it.++begin;++-- ── launcher_config ─────────────────────────────────────────────────────────+create table if not exists launcher_config (+ id uuid primary key default gen_random_uuid(),+ -- 'global' is the admin-set platform default (singleton). 'user' is a single+ -- user's own launcher policy, keyed by user_id.+ scope text not null check (scope in ('global', 'user')),+ user_id uuid references users(id) on delete cascade,++ -- Master switches. enabled=false ⇒ the launcher never fires for this scope.+ -- dry_run=true ⇒ the engine selects a source + agent and records the run but+ -- never moves SOL or submits a create (the safe default).+ enabled boolean not null default false,+ dry_run boolean not null default true,++ -- 'off' | 'trend' | 'meme' | 'random' | 'hybrid' (trend-priority + filler).+ 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","x"]. Empty ⇒ all configured providers.+ sources jsonb not null default '["coin_intel","trending","x"]'::jsonb,+ -- Restrict trend picks to these pump_coin_intel categories (meme/culture/...).+ -- Empty ⇒ no category filter.+ categories jsonb not null default '[]'::jsonb,++ -- Cadence + rate. The worker aims for one launch per target_cadence_seconds+ -- but never exceeds max_per_hour (a hard hourly ceiling, independent of SOL).+ target_cadence_seconds integer not null default 60 check (target_cadence_seconds >= 5),+ max_per_hour integer not null default 30 check (max_per_hour >= 0),++ -- Economics, in SOL. per_launch_sol = deploy cost + dev_buy headroom moved to+ -- the agent. dev_buy_sol = the initial buy the agent makes on its own curve.+ per_launch_sol numeric(20, 9) not null default 0.03 check (per_launch_sol >= 0),+ dev_buy_sol numeric(20, 9) not null default 0 check (dev_buy_sol >= 0),+ daily_sol_cap numeric(20, 9) not null default 1 check (daily_sol_cap >= 0),+ -- Share of trade fees routed to $THREE buyback-and-burn (0..10000 bps).+ buyback_bps integer not null default 5000 check (buyback_bps between 0 and 10000),+ network text not null default 'mainnet' check (network in ('mainnet', 'devnet')),++ -- Circuit breaker. Tripped automatically on repeated failure / low master+ -- balance / daily cap; cleared by an operator. Distinct from enabled so the+ -- breaker never silently flips the user's master switch.+ paused boolean not null default false,+ pause_reason text,++ updated_by uuid references users(id) on delete set null,+ created_at timestamptz not null default now(),+ updated_at timestamptz not null default now()+);++-- One global row; one row per user.+create unique index if not exists launcher_config_global_uniq+ on launcher_config (scope) where scope = 'global';+create unique index if not exists launcher_config_user_uniq+ on launcher_config (user_id) where scope = 'user';++-- ── launcher_queue ──────────────────────────────────────────────────────────+-- The rotation. Each row makes one agent eligible to launch. The engine picks+-- the enabled agent with the oldest last_launched_at (nulls first), weighted by+-- `weight`, so launches fan out across avatars instead of hammering one wallet.+create table if not exists launcher_queue (+ agent_id uuid primary key references agent_identities(id) on delete cascade,+ -- The scope that enrolled this agent. 'global' agents serve the platform+ -- launcher; 'user' agents serve their owner's launcher only.+ scope text not null default 'user' check (scope in ('global', 'user')),+ user_id uuid references users(id) on delete cascade,+ enabled boolean not null default true,+ weight integer not null default 1 check (weight >= 0),+ last_launched_at timestamptz,+ launch_count integer not null default 0,+ created_at timestamptz not null default now()+);+create index if not exists launcher_queue_pick_idx+ on launcher_queue (scope, enabled, last_launched_at nulls first);++-- ── launcher_runs ───────────────────────────────────────────────────────────+-- Append-only audit. Every engine tick that decides to launch writes one row,+-- transitioning through status as it funds + submits. Powers the live console+-- and the daily-spend ceiling (sum of sol_spent where created today).+create table if not exists launcher_runs (+ id uuid primary key default gen_random_uuid(),+ scope text not null default 'global' check (scope in ('global', 'user')),+ user_id uuid references users(id) on delete set null,+ agent_id uuid references agent_identities(id) on delete set null,++ -- Why this coin fired: 'trend' | 'meme' | 'random'. trigger_source names the+ -- provider ('coin_intel','trending','x','meme-llm','random'); trigger_detail+ -- carries the structured reason (e.g. the trend, score, source mint).+ kind text not null check (kind in ('trend', 'meme', 'random')),+ trigger_source text,+ trigger_detail jsonb not null default '{}'::jsonb,++ name text,+ symbol text,+ mint text,+ network text not null default 'mainnet',+ sol_spent numeric(20, 9) not null default 0,+ buyback_bps integer,++ -- pending → funded → launched → confirmed, or skipped / failed at any step.+ -- dry_run rows stop at 'dry_run' and never move SOL.+ status text not null default 'pending'+ check (status in ('pending', 'dry_run', 'funded', 'launched', 'confirmed', 'skipped', 'failed')),+ dry_run boolean not null default false,+ tx_signature text,+ fund_signature text,+ error text,++ created_at timestamptz not null default now(),+ updated_at timestamptz not null default now()+);+create index if not exists launcher_runs_recent_idx on launcher_runs (created_at desc);+create index if not exists launcher_runs_scope_idx on launcher_runs (scope, created_at desc);+create index if not exists launcher_runs_spend_idx on launcher_runs (created_at) where status in ('funded', 'launched', 'confirmed');+create unique index if not exists launcher_runs_mint_uniq on launcher_runs (mint) where mint is not null;++-- Seed a disabled, dry-run global default so the admin UI has a row to edit and+-- the launcher is provably inert until armed.+insert into launcher_config (scope, enabled, dry_run, mode)+values ('global', false, true, 'hybrid')+on conflict do nothing;++commit;diff --git a/api/_lib/rate-limit.js b/api/_lib/rate-limit.jsindex 267b7a8e0..501f240d7 100644--- a/api/_lib/rate-limit.js+++ b/api/_lib/rate-limit.js@@ -72,6 +72,11 @@ function failClosedLimiter({ limit, window }) {* fallback. Non-critical buckets keep the permissive in-memory fallback so a* missing-Redis misconfig degrades read endpoints gracefully rather than* taking the whole site down.+ * `degradeToMemory: true` overrides the critical fail-closed disposition on a+ * Redis outage: instead of denying, the bucket falls back to the per-instance+ * memory limiter. For sensitive-but-availability-critical buckets (auth/login)+ * where a total lockout is worse than a weaker per-instance cap. Never use it+ * for money-moving buckets — there, denying is the correct safety posture.* `local: true` deliberately enforces per-instance, in-memory only — never a* Redis command. For high-frequency, cheap-read buckets (status polling) whose* only job is to bound poll floods, per-instance caps bound throughput just as@@ -88,7 +93,12 @@ function getLimiter(name, opts) {return lim;}if (!redis) {- const lim = opts.critical && IS_PRODUCTION ? failClosedLimiter(opts) : memoryLimiter(opts);+ // degradeToMemory wins over critical: an auth bucket must stay usable on a+ // Redis outage (degraded per-instance cap) rather than lock everyone out.+ const lim =+ opts.degradeToMemory || !(opts.critical && IS_PRODUCTION)+ ? memoryLimiter(opts)+ : failClosedLimiter(opts);limiters.set(key, lim);return lim;}@@ -128,12 +138,22 @@ function warnDegradedOnce(name, err) {function resilientLimiter(rl, name, opts) {const ms = parseWindowMs(opts.window);const failClosed = Boolean(opts.critical) && IS_PRODUCTION;+ // Auth buckets (degradeToMemory) fall back to a per-instance memory limiter on+ // a Redis outage instead of failing closed. A total auth lockout — nobody can+ // log in — is a worse outcome than a weaker, per-instance brute-force cap, and+ // bcrypt already bounds per-request cost on the credential path. Money-moving+ // buckets keep failing closed: there, unbounded spend is worse than a 503.+ const memFallback = opts.degradeToMemory ? memoryLimiter(opts) : null;return {async limit(id) {try {return await rl.limit(id);} catch (err) {warnDegradedOnce(name, err);+ if (memFallback) {+ const r = await memFallback.limit(id);+ return { ...r, reason: 'rate_limiter_degraded_memory' };+ }if (failClosed) {return {success: false,@@ -204,13 +224,16 @@ function parseWindowMs(w) {// Preset limiters. Tune once viral traffic shape is known.export const limits = {- // Auth-critical buckets gate credential guessing / account-creation spam.- // Marked critical so a Redis outage in prod fails closed (deny) instead of- // degrading to the per-instance memory map — across serverless fan-out that- // fallback is effectively no limit at all on a brute-force attempt.- authIp: (ip) => getLimiter('auth:ip', { limit: 30, window: '10 m', critical: true }).limit(ip),+ // Auth buckets gate credential guessing / account-creation spam. They are+ // sensitive (critical) but use degradeToMemory: on a Redis outage they fall+ // back to the per-instance memory limiter rather than failing closed. Failing+ // closed here locks every user out of login — a self-inflicted outage strictly+ // worse than the brute-force window a degraded per-instance cap leaves open,+ // especially with bcrypt already throttling the credential path per request.+ authIp: (ip) =>+ getLimiter('auth:ip', { limit: 30, window: '10 m', critical: true, degradeToMemory: true }).limit(ip),registerIp: (ip) =>- getLimiter('register:ip', { limit: 5, window: '1 h', critical: true }).limit(ip),+ getLimiter('register:ip', { limit: 5, window: '1 h', critical: true, degradeToMemory: true }).limit(ip),// NL→strategy compile (api/sniper/compile.js) runs a real LLM call per request,// so it gets a dedicated, tighter-than-trading bucket: enough to iterate on a// strategy a few times, bounded so it can't be turned into a free LLM relay.diff --git a/api/_lib/solana-signers.js b/api/_lib/solana-signers.jsindex 28113d8e8..d17d4f44f 100644--- a/api/_lib/solana-signers.js+++ b/api/_lib/solana-signers.js@@ -39,6 +39,17 @@ export const SOLANA_SIGNERS = [purpose: 'fronts the ~0.022 SOL deploy cost for x402 pay-per-call pump.fun launches',network: 'mainnet',},+ {+ name: 'coin-launcher-master',+ env: 'LAUNCHER_MASTER_SECRET_KEY_B64',+ fallbackEnv: 'PUMP_X402_LAUNCHER_SECRET_KEY_B64',+ // Funds many autonomous launches per day — keep a higher floor than a+ // single-flow relayer so the autonomous launcher does not stall mid-run.+ minSol: 1,+ purpose:+ 'master wallet for the autonomous coin launcher: tops up the next agent in the rotation with the per-launch SOL (deploy cost + dev-buy) just before it signs its own pump.fun create',+ network: 'mainnet',+ },{name: 'sns-parent-owner',env: 'THREEWS_SOL_PARENT_SECRET_BASE58',diff --git a/data/changelog.json b/data/changelog.jsonindex 863da1fc8..4eb7120bb 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,18 @@{"$comment": "Curated changelog entries for three.ws — the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-06-27",+ "title": "Hardened Redis credentials against dashboard paste errors",+ "summary": "A trailing newline or stray space on the Upstash Redis token — the kind that creeps in when pasting into a dashboard — was being sent verbatim in the auth header and rejected as WRONGPASS, while the URL still resolved. The result was thousands of failures an hour: paid endpoints denying, the payments feed not loading, usage telemetry and caches going dark. Redis credentials are now trimmed at the source (matching how wallet addresses, RPC URLs, and certificates are already sanitized), so a single stray character can never silently take the limiter, feed, and caches offline.",+ "tags": ["fix", "infra"]+ },+ {+ "date": "2026-06-27",+ "title": "Sign-in restored during rate-limiter outages",+ "summary": "Fixed an issue where a temporary outage of the distributed rate limiter could block every sign-in attempt platform-wide. The login and registration limiters now degrade gracefully to a local per-instance cap during such an outage — keeping sign-in available while still throttling brute-force attempts — instead of denying everyone. Money-moving limits are unchanged and still fail safe.",+ "tags": ["fix", "security"]+ },{"date": "2026-06-27","title": "Production stability fixes — payment sessions, Redis error handling, infra resilience",diff --git a/public/changelog.json b/public/changelog.jsonindex ed107da4a..12c8c334e 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-27T04:29:30.856Z",+ "generated_at": "2026-06-27T09:28:30.904Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -46,6 +46,17 @@"launch"]},+ {+ "date": "2026-06-27",+ "type": "update",+ "title": "60 live x402 payments per minute",+ "summary": "A new per-minute cron fires 60 parallel real Solana USDC micropayments each tick via the x402 protocol, seeding the platform's payment activity feed and club stage with continuous on-chain traffic. Each payment is a signed SPL TransferChecked transaction broadcast via the Solana facilitator — not simulated. Configure the batch size or pause it with X402_SEED_BATCH_SIZE / X402_SEED_ENABLED.",+ "link": "/pay",+ "tags": [+ "infra",+ "feature"+ ]+ },{"date": "2026-06-27","type": "update",@@ -67,6 +78,17 @@"improvement"]},+ {+ "date": "2026-06-27",+ "type": "update",+ "title": "Hardened Redis credentials against dashboard paste errors",+ "summary": "A trailing newline or stray space on the Upstash Redis token — the kind that creeps in when pasting into a dashboard — was being sent verbatim in the auth header and rejected as WRONGPASS, while the URL still resolved. The result was thousands of failures an hour: paid endpoints denying, the payments feed not loading, usage telemetry and caches going dark. Redis credentials are now trimmed at the source (matching how wallet addresses, RPC URLs, and certificates are already sanitized), so a single stray character can never silently take the limiter, feed, and caches offline.",+ "link": null,+ "tags": [+ "fix",+ "infra"+ ]+ },{"date": "2026-06-27","type": "update",@@ -108,6 +130,28 @@"feature"]},+ {+ "date": "2026-06-27",+ "type": "update",+ "title": "Production stability fixes — payment sessions, Redis error handling, infra resilience",+ "summary": "Fixed a SQL syntax error that blocked payment session expiry and refunds (PostgreSQL does not allow LIMIT directly in UPDATE — now uses a CTE with FOR UPDATE SKIP LOCKED). Fixed esbuild class-name minification breaking NeonDB error detection in production — infrastructure errors (wrong DB credentials, Redis auth) now correctly return 503 and suppress alert storms instead of crashing every endpoint with 500. Added graceful Redis-unavailable handling to the usage flush buffer and the bounty board API. Fixed Express-style response methods in pulse-tick cron.",+ "link": null,+ "tags": [+ "fix",+ "infra"+ ]+ },+ {+ "date": "2026-06-27",+ "type": "update",+ "title": "Sign-in restored during rate-limiter outages",+ "summary": "Fixed an issue where a temporary outage of the distributed rate limiter could block every sign-in attempt platform-wide. The login and registration limiters now degrade gracefully to a local per-instance cap during such an outage — keeping sign-in available while still throttling brute-force attempts — instead of denying everyone. Money-moving limits are unchanged and still fail safe.",+ "link": null,+ "tags": [+ "fix",+ "security"+ ]+ },{"date": "2026-06-27","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 16ce4163b..cde681e48 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -38,6 +38,14 @@<category>launch</category><description>three.ws is now an Alibaba Cloud Partner, bringing Qwen foundation models and Asia-Pacific cloud infrastructure to the three.ws 3D AI agent platform.</description></item>+ <item>+ <title>60 live x402 payments per minute</title>+ <link>https://three.ws/pay</link>+ <guid isPermaLink="false">2026-06-27:60 live x402 payments per minute</guid>+ <pubDate>Sat, 27 Jun 2026 12:00:00 GMT</pubDate>+ <category>infra</category>+ <description>A new per-minute cron fires 60 parallel real Solana USDC micropayments each tick via the x402 protocol, seeding the platform's payment activity feed and club stage with continuous on-chain traffic. Each payment is a signed SPL TransferChecked transaction broadcast via the Solana facilitator — not simulated. Configure the batch size or pause it with X402_SEED_BATCH_SIZE / X402_SEED_ENABLED.</description>+ </item><item><title>Alibaba Cloud partnership — Qwen models and alibaba-cloud-mcp</title><link>https://three.ws/blog/three-ws-alibaba-cloud-partnership</link>@@ -54,6 +62,14 @@<category>feature</category><description>New /dashboard/capabilities page surfaces live status for Alpha Hunt, Coin Launcher, Auto-Claim, and Market Maker in one view. KPI strips show daily budget, total volume, claimable fees, and net P&L per capability. Tabbed tables show launched coins, schedule status, per-market inventory bars, and recent MM trades. Alpha Hunt trigger is now also configurable directly from the Sniper Strategies dashboard — full field set including min smart-money count, quality score, organic score, max market cap, and narrative keywords.</description></item>+ <item>+ <title>Hardened Redis credentials against dashboard paste errors</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-06-27:Hardened Redis credentials against dashboard paste errors</guid>+ <pubDate>Sat, 27 Jun 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>A trailing newline or stray space on the Upstash Redis token — the kind that creeps in when pasting into a dashboard — was being sent verbatim in the auth header and rejected as WRONGPASS, while the URL still resolved. The result was thousands of failures an hour: paid endpoints denying, the payments feed not loading, usage telemetry and caches going dark. Redis credentials are now trimmed at the source (matching how wallet addresses, RPC URLs, and certificates are already sanitized), so a single stray character can never silently take the limiter, feed, and caches offline.</description>+ </item><item><title>Improved resilience during database outages</title><link>https://three.ws/changelog</link>@@ -86,6 +102,22 @@<category>feature</category><description>New /partners page showing all active technology partnerships — AWS, IBM, Google Cloud, Alibaba Cloud, Intel, NVIDIA, Microsoft, and Oracle — with what each powers on the platform, tier badges, and links to partner-specific pages and MCP servers.</description></item>+ <item>+ <title>Production stability fixes — payment sessions, Redis error handling, infra resilience</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-06-27:Production stability fixes — payment sessions, Redis error handling, infra resilience</guid>+ <pubDate>Sat, 27 Jun 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>Fixed a SQL syntax error that blocked payment session expiry and refunds (PostgreSQL does not allow LIMIT directly in UPDATE — now uses a CTE with FOR UPDATE SKIP LOCKED). Fixed esbuild class-name minification breaking NeonDB error detection in production — infrastructure errors (wrong DB credentials, Redis auth) now correctly return 503 and suppress alert storms instead of crashing every endpoint with 500. Added graceful Redis-unavailable handling to the usage flush buffer and the bounty board API. Fixed Express-style response methods in pulse-tick cron.</description>+ </item>+ <item>+ <title>Sign-in restored during rate-limiter outages</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-06-27:Sign-in restored during rate-limiter outages</guid>+ <pubDate>Sat, 27 Jun 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>Fixed an issue where a temporary outage of the distributed rate limiter could block every sign-in attempt platform-wide. The login and registration limiters now degrade gracefully to a local per-instance cap during such an outage — keeping sign-in available while still throttling brute-force attempts — instead of denying everyone. Money-moving limits are unchanged and still fail safe.</description>+ </item><item><title>Task input on Agent Screen — send your agent a task and watch it work</title><link>https://three.ws/agent-screen</link>diff --git a/public/dashboard/x402-admin.html b/public/dashboard/x402-admin.htmlindex f1376d4a3..ffa385392 100644--- a/public/dashboard/x402-admin.html+++ b/public/dashboard/x402-admin.html@@ -526,7 +526,7 @@ POST /api/x402-merchant?action=rotate-key mint a fresh API key</span></div><form class="modal-body" id="prodForm"><div class="row-2"><label class="field">Name<input name="action_name" required maxlength="80" placeholder="Reputation report" /></label>- <label class="field">URL slug<input name="slug" required class="mono" pattern="^[a-z0-9][a-z0-9-]{1,62}[a-z0-9]$" placeholder="reputation-report" /></label>+ <label class="field">URL slug<input name="slug" required class="mono" pattern="^[a-z0-9][a-z0-9\-]{1,62}[a-z0-9]$" placeholder="reputation-report" /></label></div><label class="field">Description<textarea name="description" maxlength="2000" placeholder="What does this charge for?"></textarea></label><label class="field">Paid endpoint (returns 402)<input name="target_endpoint" type="url" required class="mono" placeholder="https://api.acme.com/paid/report" /></label>diff --git a/public/dashboard/x402.html b/public/dashboard/x402.htmlindex a64739c09..e69066f3b 100644--- a/public/dashboard/x402.html+++ b/public/dashboard/x402.html@@ -295,7 +295,7 @@<form class="modal-body" id="skuForm"><label>URL slug- <input name="slug" required pattern="^[a-z0-9][a-z0-9-]{1,62}[a-z0-9]$" placeholder="pro-summary" />+ <input name="slug" required pattern="^[a-z0-9][a-z0-9\-]{1,62}[a-z0-9]$" placeholder="pro-summary" /><span class="hint">Used in the public URL: /pay/c/<slug>. 3–64 chars, lowercase + hyphens.</span></label><div class="row-2">diff --git a/public/features.json b/public/features.jsonindex ee5306ea8..e178e644b 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-27T04:29:30.840Z",+ "generated_at": "2026-06-27T09:28:30.845Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/public/register.html b/public/register.htmlindex 85d6d49fb..bc2a36a7f 100644--- a/public/register.html+++ b/public/register.html@@ -524,7 +524,7 @@requiredminlength="3"maxlength="30"- pattern="[a-zA-Z0-9_-]+"+ pattern="[a-zA-Z0-9_\-]+"placeholder="e.g. cool_agent"aria-describedby="username-hint err"/>diff --git a/tests/env-upstash-cred.test.js b/tests/env-upstash-cred.test.jsnew file mode 100644index 000000000..2bad2291f--- /dev/null+++ b/tests/env-upstash-cred.test.js@@ -0,0 +1,82 @@+/**+ * env.js Upstash credential hygiene — unit test.+ *+ * A trailing newline or stray space on UPSTASH_REDIS_REST_TOKEN (the classic+ * Vercel/Upstash dashboard paste artifact) lands verbatim in the+ * `Authorization: Bearer <token>` header the @upstash/redis client sends, which+ * Upstash rejects as "WRONGPASS invalid or missing auth token" — while the URL+ * still resolves, so every limiter fails closed and the usage buffer + caches go+ * silently dark. The getters trim at the source so no consumer ever sees the+ * whitespace. This pins that, plus the whitespace-only-primary fall-through to the+ * Vercel-KV marketplace aliases.+ */++import { describe, it, expect, beforeEach, afterEach } from 'vitest';+import { env } from '../api/_lib/env.js';++const KEYS = [+ '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',+ 'UPSTASH_CACHE_REST_URL',+ 'UPSTASH_CACHE_REST_TOKEN',+ 'cache_KV_REST_API_URL',+ 'cache_KV_REST_API_TOKEN',+];+let saved;++beforeEach(() => {+ saved = {};+ for (const k of KEYS) {+ saved[k] = process.env[k];+ delete process.env[k];+ }+});++afterEach(() => {+ for (const k of KEYS) {+ if (saved[k] === undefined) delete process.env[k];+ else process.env[k] = saved[k];+ }+});++describe('env Upstash credential trimming', () => {+ it('strips a trailing newline from the REST token (the WRONGPASS cause)', () => {+ process.env.UPSTASH_REDIS_REST_URL = 'https://example.upstash.io';+ process.env.UPSTASH_REDIS_REST_TOKEN = 'AX1ssecret-token\n';+ expect(env.UPSTASH_REDIS_REST_TOKEN).toBe('AX1ssecret-token');+ });++ it('strips surrounding whitespace from the REST url', () => {+ process.env.UPSTASH_REDIS_REST_URL = ' https://example.upstash.io \n';+ process.env.UPSTASH_REDIS_REST_TOKEN = 'tok';+ expect(env.UPSTASH_REDIS_REST_URL).toBe('https://example.upstash.io');+ });++ it('returns undefined for a blank/whitespace-only value', () => {+ process.env.UPSTASH_REDIS_REST_TOKEN = ' \n';+ expect(env.UPSTASH_REDIS_REST_TOKEN).toBeUndefined();+ });++ it('falls through to the Vercel-KV alias when the primary is whitespace-only', () => {+ process.env.UPSTASH_REDIS_REST_TOKEN = ' ';+ process.env.KV_REST_API_TOKEN = 'alias-token\n';+ expect(env.UPSTASH_REDIS_REST_TOKEN).toBe('alias-token');+ });++ it('trims the dedicated cache store credentials and their aliases', () => {+ process.env.UPSTASH_CACHE_REST_URL = ' ';+ process.env.cache_KV_REST_API_URL = 'https://cache.upstash.io\n';+ process.env.cache_KV_REST_API_TOKEN = ' cache-tok ';+ expect(env.UPSTASH_CACHE_REST_URL).toBe('https://cache.upstash.io');+ expect(env.UPSTASH_CACHE_REST_TOKEN).toBe('cache-tok');+ });++ it('leaves a clean token untouched', () => {+ process.env.UPSTASH_REDIS_REST_TOKEN = 'AX1sclean';+ expect(env.UPSTASH_REDIS_REST_TOKEN).toBe('AX1sclean');+ });+});