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(mcp): resilience tests, MCP icon, reputation/agenc/ens tool refinements
nirholas08f94391093f
diff --git a/api/_mcp3d/tools/studio.js b/api/_mcp3d/tools/studio.jsindex 348604e0d..ad226db7c 100644--- a/api/_mcp3d/tools/studio.js+++ b/api/_mcp3d/tools/studio.js@@ -140,7 +140,10 @@ async function fetchGlbBuffer(url) {}const buf = Buffer.from(await resp.arrayBuffer());if (buf.length > MAX_GLB_BYTES) {- throw rpcError(-32000, `GLB too large to save (${buf.length} bytes; max ${MAX_GLB_BYTES}).`);+ throw rpcError(+ -32000,+ `GLB too large to save (${buf.length} bytes; max ${MAX_GLB_BYTES}).`,+ );}return buf;}@@ -413,7 +416,6 @@ export const toolDefs = [tier: TIER_PROP,path: PATH_PROP,backend: BACKEND_PROP,- __ASPECT_CLOSE__: {},},required: ['prompt'],additionalProperties: false,@@ -1538,7 +1540,8 @@ export const toolDefs = [glb_url: {type: 'string',format: 'uri',- description: 'Public https URL of the GLB to save (e.g. from generation_status).',+ description:+ 'Public https URL of the GLB to save (e.g. from generation_status).',},name: {type: 'string',@@ -1556,7 +1559,8 @@ export const toolDefs = [source_prompt: {type: 'string',maxLength: 1000,- description: 'Optional: the prompt that generated this model, kept as provenance.',+ description:+ 'Optional: the prompt that generated this model, kept as provenance.',},tags: {type: 'array',@@ -1626,7 +1630,10 @@ export const toolDefs = [});const tags = Array.isArray(args.tags)- ? args.tags.map((t) => String(t).trim()).filter(Boolean).slice(0, 20)+ ? args.tags+ .map((t) => String(t).trim())+ .filter(Boolean)+ .slice(0, 20): [];const avatar = await createAvatar({diff --git a/mcp-server/src/tools/agenc-client.js b/mcp-server/src/tools/agenc-client.jsindex 9ca1fe572..b1b98df6f 100644--- a/mcp-server/src/tools/agenc-client.js+++ b/mcp-server/src/tools/agenc-client.js@@ -12,6 +12,8 @@ import { AnchorProvider, Program } from '@coral-xyz/anchor';import { AGENC_COORDINATION_IDL } from '@tetsuo-ai/protocol';import { DEVNET_RPC, MAINNET_RPC, PROGRAM_ID } from '@tetsuo-ai/sdk';+import { resilientFetch } from '../lib/resilient-fetch.js';+// Devnet program ID validated by the AgenC team on 2026-03-22.// Source: https://docs.agenc.tech/docs/runtime/api/.export const AGENC_DEVNET_PROGRAM_ID = new PublicKey(@@ -57,7 +59,19 @@ function buildReadOnlyWallet() {export function getAgenCClient(cluster = 'mainnet') {const c = cluster === 'devnet' ? 'devnet' : 'mainnet';const rpcUrl = pickRpc(c);- const connection = new Connection(rpcUrl, 'confirmed');+ const connection = new Connection(rpcUrl, {+ commitment: 'confirmed',+ // Bound every RPC call (web3.js otherwise inherits Node's unbounded+ // default — the source of indefinite hangs) and replay a single+ // transient blip. AgenC reads are idempotent queries, so retry is safe.+ fetch: (url, init) =>+ resilientFetch(url, init, {+ timeoutMs: 12_000,+ retries: 1,+ retryNonIdempotent: true,+ label: `agenc-rpc ${rpcUrl}`,+ }),+ });const provider = new AnchorProvider(connection, buildReadOnlyWallet(), {commitment: 'confirmed',preflightCommitment: 'confirmed',diff --git a/mcp-server/src/tools/agent-reputation.js b/mcp-server/src/tools/agent-reputation.jsindex 35593b21f..e6bbffe1e 100644--- a/mcp-server/src/tools/agent-reputation.js+++ b/mcp-server/src/tools/agent-reputation.js@@ -18,11 +18,12 @@// All numeric responses are returned both as decimal strings (for safe// integer transport) and as parsed Number where the value fits in float64.-import { JsonRpcProvider, Contract, isAddress, ZeroAddress } from 'ethers';+import { Contract, isAddress, ZeroAddress } from 'ethers';import { z } from 'zod';import { paid, toolError } from '../payments.js';import { jsonSchemaFromZod } from './_shared.js';+import { makeEvmProvider, getEvmRpcUrls } from '../lib/evm-rpc.js';const TOOL_NAME = 'agent_reputation';const TOOL_DESCRIPTION =@@ -75,11 +76,6 @@ function resolveChain(input) {throw new Error(`unsupported chain "${input}" — known: ${Object.keys(CHAINS).join(', ')}`);}-function rpcUrlFor(chain) {- const envKey = `MCP_AGENT_REP_RPC_${chain.id}`;- return process.env[envKey] || chain.rpc;-}-// Parse the agent identifier. Accepts: numeric ID, EVM wallet, or CAIP-10// "eip155:<chainId>:<address>" (which can also override the chain selection).function parseAgentInput(raw, defaultChain) {@@ -212,9 +208,12 @@ export async function buildAgentReputationTool() {async ({ address, chain }) => {const defaultChain = resolveChain(chain);const parsed = parseAgentInput(address, defaultChain);- const provider = new JsonRpcProvider(rpcUrlFor(parsed.chain), parsed.chain.id, {- staticNetwork: true,- });+ // Endpoint failover: an operator override (MCP_AGENT_REP_RPC_<id>) is+ // tried first, then the chain's built-in redundant public endpoints,+ // each with a bounded request timeout. A single RPC outage no longer+ // fails the lookup or hangs the paid call.+ const overrides = [process.env[`MCP_AGENT_REP_RPC_${parsed.chain.id}`]].filter(Boolean);+ const provider = makeEvmProvider(parsed.chain.id, { overrides, timeoutMs: 12_000 });let agentId = parsed.kind === 'agentId' ? parsed.agentId : null;let walletResolved = parsed.kind === 'wallet' ? parsed.wallet : null;@@ -252,7 +251,7 @@ export async function buildAgentReputationTool() {identity: isZero ? null : identity,reputation,events,- rpc: rpcUrlFor(parsed.chain),+ rpc: getEvmRpcUrls(parsed.chain.id, overrides),fetchedAt: new Date().toISOString(),};},diff --git a/mcp-server/src/tools/ens-sns-resolve.js b/mcp-server/src/tools/ens-sns-resolve.jsindex 6ca006260..5de425387 100644--- a/mcp-server/src/tools/ens-sns-resolve.js+++ b/mcp-server/src/tools/ens-sns-resolve.js@@ -40,10 +40,13 @@ async function withTimeout(promise, ms, label) {}async function resolveEns(name) {- const rpcUrl = env('MCP_ENS_RPC_URL') || env('MAINNET_RPC_URL');- const provider = rpcUrl- ? new ethers.JsonRpcProvider(rpcUrl)- : ethers.getDefaultProvider('mainnet');+ // Ethereum mainnet (chainId 1) with endpoint failover: any operator override+ // is tried first, then the built-in redundant public endpoints. Every RPC+ // call is timeout-bounded inside the provider, and the outer withTimeout+ // races the whole resolution as a final guard.+ const overrides = [env('MCP_ENS_RPC_URL'), env('MAINNET_RPC_URL')].filter(Boolean);+ const provider = makeEvmProvider(1, { overrides, timeoutMs: 8000 });+ const rpcUrl = overrides[0] || 'failover:ethereum';const address = await withTimeout(provider.resolveName(name), 4000, 'ens');if (!address) return null;let reverseName = null;@@ -58,7 +61,11 @@ async function resolveEns(name) {async function resolveSns(name) {const bare = name.toLowerCase().replace(/\.sol$/, '');if (!/^[a-z0-9-]{1,63}$/.test(bare)) return null;- const lookup = await fetch(`${SNS_API}/v2/domain/lookup/${bare}.sol`).catch(() => null);+ const lookup = await resilientFetch(+ `${SNS_API}/v2/domain/lookup/${bare}.sol`,+ {},+ { timeoutMs: 6000, retries: 2, label: 'sns-lookup' },+ ).catch(() => null);if (!lookup || !lookup.ok) return null;const data = await lookup.json().catch(() => null);const owner = data?.owner || data?.[bare + '.sol']?.owner || data?.data?.owner || null;@@ -67,7 +74,11 @@ async function resolveSns(name) {// Reverse fetch: other domains the owner holds.let allDomains = [];try {- const r = await fetch(`${SNS_API}/v2/user/domains/${owner}`);+ const r = await resilientFetch(+ `${SNS_API}/v2/user/domains/${owner}`,+ {},+ { timeoutMs: 6000, retries: 1, label: 'sns-domains' },+ );if (r.ok) {const body = await r.json();const list = body?.[owner] || body?.data?.[owner] || [];@@ -83,7 +94,11 @@ async function resolveSns(name) {let favoriteDomain = null;try {- const r = await fetch(`${SNS_API}/v2/user/fav-domains/${owner}`);+ const r = await resilientFetch(+ `${SNS_API}/v2/user/fav-domains/${owner}`,+ {},+ { timeoutMs: 6000, retries: 1, label: 'sns-fav' },+ );if (r.ok) {const body = await r.json();favoriteDomain = body?.[owner] || body?.data?.[owner] || null;diff --git a/package-lock.json b/package-lock.jsonindex e7f2ece6c..a86d372a1 100644--- a/package-lock.json+++ b/package-lock.json@@ -15453,8 +15453,72 @@}},"node_modules/@pump-fun/agent-payments-sdk": {- "resolved": "agent-payments-sdk",- "link": true+ "version": "3.0.3",+ "resolved": "https://registry.npmjs.org/@pump-fun/agent-payments-sdk/-/agent-payments-sdk-3.0.3.tgz",+ "integrity": "sha512-VUAGDs7EFJ+RI+nHxeBGjOAqbYQ1kWLJhyX2Wa+N7GCZM/ojL0ONGdc4HdvW+7j0m+vG8IfeeGWXCrK5ninA+A==",+ "license": "ISC",+ "dependencies": {+ "@coral-xyz/anchor": "^0.31.1",+ "@solana/spl-token": "^0.4.9",+ "@solana/web3.js": "^1.98.0"+ },+ "optionalDependencies": {+ "@rollup/rollup-linux-x64-gnu": "*"+ }+ },+ "node_modules/@pump-fun/agent-payments-sdk/node_modules/@coral-xyz/anchor": {+ "version": "0.31.1",+ "resolved": "https://registry.npmjs.org/@coral-xyz/anchor/-/anchor-0.31.1.tgz",+ "integrity": "sha512-QUqpoEK+gi2S6nlYc2atgT2r41TT3caWr/cPUEL8n8Md9437trZ68STknq897b82p5mW0XrTBNOzRbmIRJtfsA==",+ "license": "(MIT OR Apache-2.0)",+ "dependencies": {+ "@coral-xyz/anchor-errors": "^0.31.1",+ "@coral-xyz/borsh": "^0.31.1",+ "@noble/hashes": "^1.3.1",+ "@solana/web3.js": "^1.69.0",+ "bn.js": "^5.1.2",+ "bs58": "^4.0.1",+ "buffer-layout": "^1.2.2",+ "camelcase": "^6.3.0",+ "cross-fetch": "^3.1.5",+ "eventemitter3": "^4.0.7",+ "pako": "^2.0.3",+ "superstruct": "^0.15.4",+ "toml": "^3.0.0"+ },+ "engines": {+ "node": ">=17"+ }+ },+ "node_modules/@pump-fun/agent-payments-sdk/node_modules/base-x": {+ "version": "3.0.11",+ "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.11.tgz",+ "integrity": "sha512-xz7wQ8xDhdyP7tQxwdteLYeFfS68tSMNCZ/Y37WJ4bhGfKPpqEIlmIyueQHqOyoPhE6xNUqjzRr8ra0eF9VRvA==",+ "license": "MIT",+ "dependencies": {+ "safe-buffer": "^5.0.1"+ }+ },+ "node_modules/@pump-fun/agent-payments-sdk/node_modules/bs58": {+ "version": "4.0.1",+ "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz",+ "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==",+ "license": "MIT",+ "dependencies": {+ "base-x": "^3.0.2"+ }+ },+ "node_modules/@pump-fun/agent-payments-sdk/node_modules/eventemitter3": {+ "version": "4.0.7",+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",+ "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==",+ "license": "MIT"+ },+ "node_modules/@pump-fun/agent-payments-sdk/node_modules/superstruct": {+ "version": "0.15.5",+ "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-0.15.5.tgz",+ "integrity": "sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ==",+ "license": "MIT"},"node_modules/@pump-fun/pump-sdk": {"version": "1.36.0",diff --git a/pages/fact-checker.html b/pages/fact-checker.htmlindex be83ca4f7..da4e59877 100644--- a/pages/fact-checker.html+++ b/pages/fact-checker.html@@ -1,651 +1,1117 @@<!doctype html><html lang="en">-<head>- <meta charset="utf-8" />- <meta name="viewport" content="width=device-width,initial-scale=1" />- <title>Real-Time Fact Checker — three.ws</title>- <meta name="description" content="Pay per verification. Results cited. Attestation signed. Powered by live web search + LLM analysis on Base and Solana USDC." />- <meta property="og:title" content="Real-Time Fact Checker — three.ws" />- <meta property="og:description" content="Submit any claim. Get sourced verdict in seconds. $0.10–$1.00 per check. USDC. Base + Solana." />- <meta property="og:image" content="/og-image.png" />- <meta name="twitter:card" content="summary_large_image" />- <link rel="icon" href="/favicon.ico" />- <link rel="stylesheet" href="/fonts/fonts.css" />- <style>- :root {- color-scheme: dark;- --bg: #050505;- --surface-0: #0b0b0b;- --surface-1: #111111;- --surface-2: #181818;- --surface-3: #1e1e1e;- --hairline: #1c1c1c;- --hairline-strong: #2a2a2a;- --text: #f6f6f6;- --text-2: #a8a8a8;- --text-3: #6a6a6a;- --text-4: #4a4a4a;- --accent: #ffffff;- --accent-2: #ffffff;- --green: #e8e8e8;- --verdict-supported: #22c55e;- --verdict-contradicted:#ef4444;- --verdict-mixed: #f59e0b;- --verdict-insufficient:#6b7280;- --stance-supports: #22c55e;- --stance-contradicts:#ef4444;- --stance-neutral: #6b7280;- --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;- --font-body: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;- --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;- }- * { box-sizing: border-box; }- html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); }- body {- font-size: 15.5px; line-height: 1.55;- min-height: 100vh; overflow-x: hidden;- -webkit-font-smoothing: antialiased;- text-rendering: optimizeLegibility;- }- a { color: inherit; text-decoration: none; }- button { font-family: inherit; cursor: pointer; }- ::selection { background: var(--text); color: var(--bg); }- .wrap-1280 { max-width: 1280px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }- @media (max-width: 720px) { .wrap-1280 { padding-left: 20px; padding-right: 20px; } }+ <head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width,initial-scale=1" />+ <title>Real-Time Fact Checker — three.ws</title>+ <meta+ name="description"+ content="Pay per verification. Results cited. Attestation signed. Powered by live web search + LLM analysis on Base and Solana USDC."+ />+ <meta property="og:title" content="Real-Time Fact Checker — three.ws" />+ <meta+ property="og:description"+ content="Submit any claim. Get sourced verdict in seconds. $0.10–$1.00 per check. USDC. Base + Solana."+ />+ <meta property="og:image" content="/og-image.png" />+ <meta name="twitter:card" content="summary_large_image" />+ <link rel="icon" href="/favicon.ico" />+ <link rel="stylesheet" href="/fonts/fonts.css" />+ <style>+ :root {+ color-scheme: dark;+ --bg: #050505;+ --surface-0: #0b0b0b;+ --surface-1: #111111;+ --surface-2: #181818;+ --surface-3: #1e1e1e;+ --hairline: #1c1c1c;+ --hairline-strong: #2a2a2a;+ --text: #f6f6f6;+ --text-2: #a8a8a8;+ --text-3: #6a6a6a;+ --text-4: #4a4a4a;+ --accent: #ffffff;+ --accent-2: #ffffff;+ --green: #e8e8e8;+ --verdict-supported: #22c55e;+ --verdict-contradicted: #ef4444;+ --verdict-mixed: #f59e0b;+ --verdict-insufficient: #6b7280;+ --stance-supports: #22c55e;+ --stance-contradicts: #ef4444;+ --stance-neutral: #6b7280;+ --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;+ --font-body: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;+ --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;+ }+ * {+ box-sizing: border-box;+ }+ html,+ body {+ margin: 0;+ padding: 0;+ background: var(--bg);+ color: var(--text);+ font-family: var(--font-body);+ }+ body {+ font-size: 15.5px;+ line-height: 1.55;+ min-height: 100vh;+ overflow-x: hidden;+ -webkit-font-smoothing: antialiased;+ text-rendering: optimizeLegibility;+ }+ a {+ color: inherit;+ text-decoration: none;+ }+ button {+ font-family: inherit;+ cursor: pointer;+ }+ ::selection {+ background: var(--text);+ color: var(--bg);+ }+ .wrap-1280 {+ max-width: 1280px;+ margin: 0 auto;+ padding-left: 32px;+ padding-right: 32px;+ }+ @media (max-width: 720px) {+ .wrap-1280 {+ padding-left: 20px;+ padding-right: 20px;+ }+ }- /* ── NAV ──────────────────────────────────────────────────────────── */- .nav {- position: sticky; top: 0; z-index: 100;- border-bottom: 1px solid var(--hairline);- background: rgba(5,5,5,0.82);- backdrop-filter: blur(20px) saturate(140%);- }- .nav-inner {- display: flex; align-items: center; gap: 32px;- padding: 16px 32px; max-width: 1440px; margin: 0 auto;- }- .brand {- display: flex; align-items: center; gap: 10px;- font-family: var(--font-display);- font-weight: 600; letter-spacing: -0.025em; font-size: 16.5px;- flex-shrink: 0;- }- .brand-mark {- width: 18px; height: 18px;- border: 1px solid var(--text); border-radius: 3px;- position: relative;- }- .brand-mark::after {- content: ""; position: absolute; inset: 4px;- background: var(--text);- }- .nav-main { display: flex; gap: 2px; margin-left: 12px; flex: 1; }- .nav-main a {- padding: 7px 12px; font-size: 14px; font-weight: 450;- color: var(--text-2); transition: color 0.12s;- }- .nav-main a:hover { color: var(--text); }- .nav-main a.active { color: var(--text); font-weight: 500; }- .nav-end { display: flex; align-items: center; gap: 4px; }- .nav-end a { padding: 7px 12px; font-size: 14px; font-weight: 450; color: var(--text-2); }- .nav-end a:hover { color: var(--text); }- .nav-end .console {- color: var(--text); font-weight: 500;- border: 1px solid var(--hairline-strong);- padding: 7px 16px; border-radius: 7px; margin-left: 6px;- transition: border-color 0.15s, background 0.15s;- }- .nav-end .console:hover { border-color: var(--text); background: rgba(255,255,255,0.04); }- @media (max-width: 880px) {- .nav-main { display: none; }- .nav-inner { padding: 14px 20px; gap: 16px; }- }+ /* ── NAV ──────────────────────────────────────────────────────────── */+ .nav {+ position: sticky;+ top: 0;+ z-index: 100;+ border-bottom: 1px solid var(--hairline);+ background: rgba(5, 5, 5, 0.82);+ backdrop-filter: blur(20px) saturate(140%);+ }+ .nav-inner {+ display: flex;+ align-items: center;+ gap: 32px;+ padding: 16px 32px;+ max-width: 1440px;+ margin: 0 auto;+ }+ .brand {+ display: flex;+ align-items: center;+ gap: 10px;+ font-family: var(--font-display);+ font-weight: 600;+ letter-spacing: -0.025em;+ font-size: 16.5px;+ flex-shrink: 0;+ }+ .brand-mark {+ width: 18px;+ height: 18px;+ border: 1px solid var(--text);+ border-radius: 3px;+ position: relative;+ }+ .brand-mark::after {+ content: '';+ position: absolute;+ inset: 4px;+ background: var(--text);+ }+ .nav-main {+ display: flex;+ gap: 2px;+ margin-left: 12px;+ flex: 1;+ }+ .nav-main a {+ padding: 7px 12px;+ font-size: 14px;+ font-weight: 450;+ color: var(--text-2);+ transition: color 0.12s;+ }+ .nav-main a:hover {+ color: var(--text);+ }+ .nav-main a.active {+ color: var(--text);+ font-weight: 500;+ }+ .nav-end {+ display: flex;+ align-items: center;+ gap: 4px;+ }+ .nav-end a {+ padding: 7px 12px;+ font-size: 14px;+ font-weight: 450;+ color: var(--text-2);+ }+ .nav-end a:hover {+ color: var(--text);+ }+ .nav-end .console {+ color: var(--text);+ font-weight: 500;+ border: 1px solid var(--hairline-strong);+ padding: 7px 16px;+ border-radius: 7px;+ margin-left: 6px;+ transition:+ border-color 0.15s,+ background 0.15s;+ }+ .nav-end .console:hover {+ border-color: var(--text);+ background: rgba(255, 255, 255, 0.04);+ }+ @media (max-width: 880px) {+ .nav-main {+ display: none;+ }+ .nav-inner {+ padding: 14px 20px;+ gap: 16px;+ }+ }- /* ── BUTTONS ──────────────────────────────────────────────────────── */- .btn {- display: inline-flex; align-items: center; gap: 10px;- padding: 13px 22px; border-radius: 8px;- font-size: 14.5px; font-weight: 500;- border: 1px solid var(--hairline-strong);- background: transparent; color: var(--text);- transition: border-color 0.15s, background 0.15s;- cursor: pointer; text-decoration: none; font-family: inherit;- }- .btn:hover { border-color: var(--text); background: rgba(255,255,255,0.04); }- .btn.primary {- background: var(--text); color: var(--bg);- border-color: var(--text); font-weight: 550;- }- .btn.primary:hover { background: #fff; }- .btn:disabled {- opacity: 0.45; cursor: not-allowed;- pointer-events: none;- }- .btn.sm { padding: 9px 16px; font-size: 13.5px; }+ /* ── BUTTONS ──────────────────────────────────────────────────────── */+ .btn {+ display: inline-flex;+ align-items: center;+ gap: 10px;+ padding: 13px 22px;+ border-radius: 8px;+ font-size: 14.5px;+ font-weight: 500;+ border: 1px solid var(--hairline-strong);+ background: transparent;+ color: var(--text);+ transition:+ border-color 0.15s,+ background 0.15s;+ cursor: pointer;+ text-decoration: none;+ font-family: inherit;+ }+ .btn:hover {+ border-color: var(--text);+ background: rgba(255, 255, 255, 0.04);+ }+ .btn.primary {+ background: var(--text);+ color: var(--bg);+ border-color: var(--text);+ font-weight: 550;+ }+ .btn.primary:hover {+ background: #fff;+ }+ .btn:disabled {+ opacity: 0.45;+ cursor: not-allowed;+ pointer-events: none;+ }+ .btn.sm {+ padding: 9px 16px;+ font-size: 13.5px;+ }- /* ── HERO ─────────────────────────────────────────────────────────── */- .hero {- padding: 80px 0 56px;- border-bottom: 1px solid var(--hairline);- text-align: center;- }- .hero-eyebrow {- display: inline-flex; align-items: center; gap: 10px;- font-family: var(--font-mono); font-size: 11.5px;- text-transform: uppercase; letter-spacing: 0.18em;- color: var(--text-3); margin-bottom: 28px;- }- .hero-eyebrow::before {- content: ""; width: 6px; height: 6px; border-radius: 50%;- background: var(--green); box-shadow: 0 0 6px var(--green);- animation: pulse-green 2.4s ease-in-out infinite;- }- @keyframes pulse-green { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }- .hero h1 {- font-family: var(--font-display);- font-size: clamp(36px, 5vw, 64px);- line-height: 1.05; letter-spacing: -0.04em;- font-weight: 600; margin: 0 0 20px; color: var(--text);- }- .hero-sub {- font-size: 17px; color: var(--text-2);- max-width: 520px; margin: 0 auto 28px; line-height: 1.55; font-weight: 400;- }- .cost-badge {- display: inline-flex; align-items: center; gap: 8px;- border: 1px solid var(--hairline-strong);- background: var(--surface-1);- padding: 8px 18px; border-radius: 100px;- font-family: var(--font-mono); font-size: 12px;- color: var(--text-3); letter-spacing: 0.08em;- }- .cost-badge .dot {- width: 5px; height: 5px; border-radius: 50%;- background: var(--verdict-supported);- }+ /* ── HERO ─────────────────────────────────────────────────────────── */+ .hero {+ padding: 80px 0 56px;+ border-bottom: 1px solid var(--hairline);+ text-align: center;+ }+ .hero-eyebrow {+ display: inline-flex;+ align-items: center;+ gap: 10px;+ font-family: var(--font-mono);+ font-size: 11.5px;+ text-transform: uppercase;+ letter-spacing: 0.18em;+ color: var(--text-3);+ margin-bottom: 28px;+ }+ .hero-eyebrow::before {+ content: '';+ width: 6px;+ height: 6px;+ border-radius: 50%;+ background: var(--green);+ box-shadow: 0 0 6px var(--green);+ animation: pulse-green 2.4s ease-in-out infinite;+ }+ @keyframes pulse-green {+ 0%,+ 100% {+ opacity: 1;+ }+ 50% {+ opacity: 0.4;+ }+ }+ .hero h1 {+ font-family: var(--font-display);+ font-size: clamp(36px, 5vw, 64px);+ line-height: 1.05;+ letter-spacing: -0.04em;+ font-weight: 600;+ margin: 0 0 20px;+ color: var(--text);+ }+ .hero-sub {+ font-size: 17px;+ color: var(--text-2);+ max-width: 520px;+ margin: 0 auto 28px;+ line-height: 1.55;+ font-weight: 400;+ }+ .cost-badge {+ display: inline-flex;+ align-items: center;+ gap: 8px;+ border: 1px solid var(--hairline-strong);+ background: var(--surface-1);+ padding: 8px 18px;+ border-radius: 100px;+ font-family: var(--font-mono);+ font-size: 12px;+ color: var(--text-3);+ letter-spacing: 0.08em;+ }+ .cost-badge .dot {+ width: 5px;+ height: 5px;+ border-radius: 50%;+ background: var(--verdict-supported);+ }- /* ── MAIN LAYOUT ──────────────────────────────────────────────────── */- .main { padding: 52px 0 80px; }+ /* ── MAIN LAYOUT ──────────────────────────────────────────────────── */+ .main {+ padding: 52px 0 80px;+ }- /* ── FORM ─────────────────────────────────────────────────────────── */- .form-card {- background: var(--surface-1);- border: 1px solid var(--hairline);- border-radius: 12px; padding: 28px;- margin-bottom: 32px;- }- .form-label {- display: block; font-size: 13px; font-weight: 500;- color: var(--text-2); margin-bottom: 10px;- text-transform: uppercase; letter-spacing: 0.1em;- font-family: var(--font-mono);- }- .claim-textarea {- width: 100%; min-height: 100px;- background: var(--surface-0);- border: 1px solid var(--hairline-strong);- border-radius: 8px; padding: 16px;- color: var(--text); font-family: var(--font-body);- font-size: 15.5px; line-height: 1.55;- resize: vertical; outline: none;- transition: border-color 0.15s;- }- .claim-textarea:focus { border-color: var(--text-3); }- .claim-textarea::placeholder { color: var(--text-4); }- .strictness-row {- display: flex; gap: 12px; margin: 20px 0 24px; flex-wrap: wrap;- }- .strictness-option { display: flex; align-items: center; gap: 0; }- .strictness-option input[type="radio"] { display: none; }- .strictness-option label {- display: inline-flex; align-items: center; gap: 6px;- padding: 8px 18px; border-radius: 7px;- border: 1px solid var(--hairline-strong);- background: var(--surface-0);- color: var(--text-2); font-size: 14px; font-weight: 450;- cursor: pointer; transition: all 0.12s;- }- .strictness-option input[type="radio"]:checked + label {- border-color: var(--text);- background: rgba(255,255,255,0.06);- color: var(--text); font-weight: 500;- }- .strictness-option label:hover { border-color: var(--text-3); color: var(--text); }- .form-actions {- display: flex; align-items: center; gap: 16px; flex-wrap: wrap;- }- .char-counter {- margin-left: auto; font-family: var(--font-mono);- font-size: 12px; color: var(--text-4);- }- .char-counter.warn { color: var(--verdict-mixed); }- .char-counter.over { color: var(--verdict-contradicted); }+ /* ── FORM ─────────────────────────────────────────────────────────── */+ .form-card {+ background: var(--surface-1);+ border: 1px solid var(--hairline);+ border-radius: 12px;+ padding: 28px;+ margin-bottom: 32px;+ }+ .form-label {+ display: block;+ font-size: 13px;+ font-weight: 500;+ color: var(--text-2);+ margin-bottom: 10px;+ text-transform: uppercase;+ letter-spacing: 0.1em;+ font-family: var(--font-mono);+ }+ .claim-textarea {+ width: 100%;+ min-height: 100px;+ background: var(--surface-0);+ border: 1px solid var(--hairline-strong);+ border-radius: 8px;+ padding: 16px;+ color: var(--text);+ font-family: var(--font-body);+ font-size: 15.5px;+ line-height: 1.55;+ resize: vertical;+ outline: none;+ transition: border-color 0.15s;+ }+ .claim-textarea:focus {+ border-color: var(--text-3);+ }+ .claim-textarea::placeholder {+ color: var(--text-4);+ }+ .strictness-row {+ display: flex;+ gap: 12px;+ margin: 20px 0 24px;+ flex-wrap: wrap;+ }+ .strictness-option {+ display: flex;+ align-items: center;+ gap: 0;+ }+ .strictness-option input[type='radio'] {+ display: none;+ }+ .strictness-option label {+ display: inline-flex;+ align-items: center;+ gap: 6px;+ padding: 8px 18px;+ border-radius: 7px;+ border: 1px solid var(--hairline-strong);+ background: var(--surface-0);+ color: var(--text-2);+ font-size: 14px;+ font-weight: 450;+ cursor: pointer;+ transition: all 0.12s;+ }+ .strictness-option input[type='radio']:checked + label {+ border-color: var(--text);+ background: rgba(255, 255, 255, 0.06);+ color: var(--text);+ font-weight: 500;+ }+ .strictness-option label:hover {+ border-color: var(--text-3);+ color: var(--text);+ }+ .form-actions {+ display: flex;+ align-items: center;+ gap: 16px;+ flex-wrap: wrap;+ }+ .char-counter {+ margin-left: auto;+ font-family: var(--font-mono);+ font-size: 12px;+ color: var(--text-4);+ }+ .char-counter.warn {+ color: var(--verdict-mixed);+ }+ .char-counter.over {+ color: var(--verdict-contradicted);+ }- /* ── EXAMPLE CLAIMS ──────────────────────────────────────────────── */- .empty-state { margin-bottom: 32px; }- .empty-label {- font-family: var(--font-mono); font-size: 11px;- text-transform: uppercase; letter-spacing: 0.15em;- color: var(--text-4); margin-bottom: 14px;- }- .example-claims { display: flex; gap: 10px; flex-wrap: wrap; }- .example-chip {- display: inline-block;- border: 1px solid var(--hairline);- background: var(--surface-1);- padding: 8px 16px; border-radius: 100px;- font-size: 13.5px; color: var(--text-2);- cursor: pointer; transition: all 0.12s;- font-family: inherit;- }- .example-chip:hover {- border-color: var(--hairline-strong);- color: var(--text); background: var(--surface-2);- }+ /* ── EXAMPLE CLAIMS ──────────────────────────────────────────────── */+ .empty-state {+ margin-bottom: 32px;+ }+ .empty-label {+ font-family: var(--font-mono);+ font-size: 11px;+ text-transform: uppercase;+ letter-spacing: 0.15em;+ color: var(--text-4);+ margin-bottom: 14px;+ }+ .example-claims {+ display: flex;+ gap: 10px;+ flex-wrap: wrap;+ }+ .example-chip {+ display: inline-block;+ border: 1px solid var(--hairline);+ background: var(--surface-1);+ padding: 8px 16px;+ border-radius: 100px;+ font-size: 13.5px;+ color: var(--text-2);+ cursor: pointer;+ transition: all 0.12s;+ font-family: inherit;+ }+ .example-chip:hover {+ border-color: var(--hairline-strong);+ color: var(--text);+ background: var(--surface-2);+ }- /* ── SKELETON ─────────────────────────────────────────────────────── */- .skeleton { display: none; margin-bottom: 32px; }- .skeleton.active { display: block; }- @keyframes shimmer {- 0% { background-position: -400px 0; }- 100% { background-position: 400px 0; }- }- .skel-line {- background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);- background-size: 800px 100%;- animation: shimmer 1.4s infinite linear;- border-radius: 6px; height: 20px; margin-bottom: 12px;- }- .skel-verdict {- height: 56px; border-radius: 10px; margin-bottom: 24px;- background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);- background-size: 800px 100%;- animation: shimmer 1.4s infinite linear;- }- .skel-sources { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }- @media (max-width: 720px) { .skel-sources { grid-template-columns: 1fr; } }- .skel-card {- border: 1px solid var(--hairline);- border-radius: 10px; padding: 20px;- background: var(--surface-1);- }+ /* ── SKELETON ─────────────────────────────────────────────────────── */+ .skeleton {+ display: none;+ margin-bottom: 32px;+ }+ .skeleton.active {+ display: block;+ }+ @keyframes shimmer {+ 0% {+ background-position: -400px 0;+ }+ 100% {+ background-position: 400px 0;+ }+ }+ .skel-line {+ background: linear-gradient(+ 90deg,+ var(--surface-2) 25%,+ var(--surface-3) 50%,+ var(--surface-2) 75%+ );+ background-size: 800px 100%;+ animation: shimmer 1.4s infinite linear;+ border-radius: 6px;+ height: 20px;+ margin-bottom: 12px;+ }+ .skel-verdict {+ height: 56px;+ border-radius: 10px;+ margin-bottom: 24px;+ background: linear-gradient(+ 90deg,+ var(--surface-2) 25%,+ var(--surface-3) 50%,+ var(--surface-2) 75%+ );+ background-size: 800px 100%;+ animation: shimmer 1.4s infinite linear;+ }+ .skel-sources {+ display: grid;+ grid-template-columns: 1fr 1fr;+ gap: 14px;+ }+ @media (max-width: 720px) {+ .skel-sources {+ grid-template-columns: 1fr;+ }+ }+ .skel-card {+ border: 1px solid var(--hairline);+ border-radius: 10px;+ padding: 20px;+ background: var(--surface-1);+ }- /* ── RESULT ──────────────────────────────────────────────────────── */- .result-panel { display: none; }- .result-panel.active { display: block; }+ /* ── RESULT ──────────────────────────────────────────────────────── */+ .result-panel {+ display: none;+ }+ .result-panel.active {+ display: block;+ }- /* Verdict badge */- .verdict-banner {- display: flex; align-items: center; gap: 20px;- padding: 24px 28px; border-radius: 12px;- border: 1px solid; margin-bottom: 28px;- flex-wrap: wrap;- }- .verdict-banner.supported { border-color: var(--verdict-supported); background: rgba(34,197,94,0.07); }- .verdict-banner.contradicted { border-color: var(--verdict-contradicted); background: rgba(239,68,68,0.07); }- .verdict-banner.mixed { border-color: var(--verdict-mixed); background: rgba(245,158,11,0.07); }- .verdict-banner.insufficient { border-color: var(--verdict-insufficient); background: rgba(107,114,128,0.07); }- .verdict-label {- font-family: var(--font-display);- font-size: 26px; font-weight: 700; letter-spacing: -0.02em;- }- .verdict-banner.supported .verdict-label { color: var(--verdict-supported); }- .verdict-banner.contradicted .verdict-label { color: var(--verdict-contradicted); }- .verdict-banner.mixed .verdict-label { color: var(--verdict-mixed); }- .verdict-banner.insufficient .verdict-label { color: var(--verdict-insufficient); }- .verdict-confidence {- font-family: var(--font-mono); font-size: 13px;- color: var(--text-3);- }- .verdict-claim {- font-size: 14.5px; color: var(--text-2);- border-left: 2px solid var(--hairline-strong);- padding-left: 14px; font-style: italic;- flex: 1 1 100%;- }+ /* Verdict badge */+ .verdict-banner {+ display: flex;+ align-items: center;+ gap: 20px;+ padding: 24px 28px;+ border-radius: 12px;+ border: 1px solid;+ margin-bottom: 28px;+ flex-wrap: wrap;+ }+ .verdict-banner.supported {+ border-color: var(--verdict-supported);+ background: rgba(34, 197, 94, 0.07);+ }+ .verdict-banner.contradicted {+ border-color: var(--verdict-contradicted);+ background: rgba(239, 68, 68, 0.07);+ }+ .verdict-banner.mixed {+ border-color: var(--verdict-mixed);+ background: rgba(245, 158, 11, 0.07);+ }+ .verdict-banner.insufficient {+ border-color: var(--verdict-insufficient);+ background: rgba(107, 114, 128, 0.07);+ }+ .verdict-label {+ font-family: var(--font-display);+ font-size: 26px;+ font-weight: 700;+ letter-spacing: -0.02em;+ }+ .verdict-banner.supported .verdict-label {+ color: var(--verdict-supported);+ }+ .verdict-banner.contradicted .verdict-label {+ color: var(--verdict-contradicted);+ }+ .verdict-banner.mixed .verdict-label {+ color: var(--verdict-mixed);+ }+ .verdict-banner.insufficient .verdict-label {+ color: var(--verdict-insufficient);+ }+ .verdict-confidence {+ font-family: var(--font-mono);+ font-size: 13px;+ color: var(--text-3);+ }+ .verdict-claim {+ font-size: 14.5px;+ color: var(--text-2);+ border-left: 2px solid var(--hairline-strong);+ padding-left: 14px;+ font-style: italic;+ flex: 1 1 100%;+ }- /* Source cards */- .sources-section { margin-bottom: 28px; }- .section-title {- font-family: var(--font-mono); font-size: 11px;- text-transform: uppercase; letter-spacing: 0.15em;- color: var(--text-4); margin-bottom: 16px;- }- .sources-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }- @media (max-width: 720px) { .sources-grid { grid-template-columns: 1fr; } }- .source-card {- border: 1px solid var(--hairline);- border-radius: 10px; padding: 18px;- background: var(--surface-1);- transition: border-color 0.12s;- }- .source-card:hover { border-color: var(--hairline-strong); }- .source-header {- display: flex; align-items: flex-start; gap: 10px;- margin-bottom: 10px;- }- .source-favicon {- width: 16px; height: 16px; border-radius: 3px;- flex-shrink: 0; margin-top: 2px;- background: var(--surface-3);- }- .source-title {- font-size: 14px; font-weight: 500; color: var(--text);- flex: 1; line-height: 1.35;- }- .source-title a { color: inherit; text-decoration: none; }- .source-title a:hover { color: var(--text-2); }- .source-excerpt {- font-size: 13px; color: var(--text-3);- line-height: 1.5; margin-bottom: 12px;- }- .source-footer {- display: flex; align-items: center; gap: 10px;- flex-wrap: wrap;- }- .stance-pill {- display: inline-block;- padding: 3px 10px; border-radius: 100px;- font-family: var(--font-mono); font-size: 11px;- text-transform: uppercase; letter-spacing: 0.1em;- font-weight: 600;- }- .stance-pill.supports { background: rgba(34,197,94,0.12); color: var(--stance-supports); }- .stance-pill.contradicts { background: rgba(239,68,68,0.12); color: var(--stance-contradicts); }- .stance-pill.neutral { background: rgba(107,114,128,0.12); color: var(--stance-neutral); }- .source-authority {- font-family: var(--font-mono); font-size: 11px;- color: var(--text-4); margin-left: auto;- }+ /* Source cards */+ .sources-section {+ margin-bottom: 28px;+ }+ .section-title {+ font-family: var(--font-mono);+ font-size: 11px;+ text-transform: uppercase;+ letter-spacing: 0.15em;+ color: var(--text-4);+ margin-bottom: 16px;+ }+ .sources-grid {+ display: grid;+ grid-template-columns: 1fr 1fr;+ gap: 14px;+ }+ @media (max-width: 720px) {+ .sources-grid {+ grid-template-columns: 1fr;+ }+ }+ .source-card {+ border: 1px solid var(--hairline);+ border-radius: 10px;+ padding: 18px;+ background: var(--surface-1);+ transition: border-color 0.12s;+ }+ .source-card:hover {+ border-color: var(--hairline-strong);+ }+ .source-header {+ display: flex;+ align-items: flex-start;+ gap: 10px;+ margin-bottom: 10px;+ }+ .source-favicon {+ width: 16px;+ height: 16px;+ border-radius: 3px;+ flex-shrink: 0;+ margin-top: 2px;+ background: var(--surface-3);+ }+ .source-title {+ font-size: 14px;+ font-weight: 500;+ color: var(--text);+ flex: 1;+ line-height: 1.35;+ }+ .source-title a {+ color: inherit;+ text-decoration: none;+ }+ .source-title a:hover {+ color: var(--text-2);+ }+ .source-excerpt {+ font-size: 13px;+ color: var(--text-3);+ line-height: 1.5;+ margin-bottom: 12px;+ }+ .source-footer {+ display: flex;+ align-items: center;+ gap: 10px;+ flex-wrap: wrap;+ }+ .stance-pill {+ display: inline-block;+ padding: 3px 10px;+ border-radius: 100px;+ font-family: var(--font-mono);+ font-size: 11px;+ text-transform: uppercase;+ letter-spacing: 0.1em;+ font-weight: 600;+ }+ .stance-pill.supports {+ background: rgba(34, 197, 94, 0.12);+ color: var(--stance-supports);+ }+ .stance-pill.contradicts {+ background: rgba(239, 68, 68, 0.12);+ color: var(--stance-contradicts);+ }+ .stance-pill.neutral {+ background: rgba(107, 114, 128, 0.12);+ color: var(--stance-neutral);+ }+ .source-authority {+ font-family: var(--font-mono);+ font-size: 11px;+ color: var(--text-4);+ margin-left: auto;+ }- /* Cost breakdown */- .cost-section {- border: 1px solid var(--hairline);- border-radius: 10px; padding: 18px 20px;- background: var(--surface-1); margin-bottom: 16px;- }- .cost-grid {- display: flex; gap: 28px; flex-wrap: wrap;- }- .cost-item { display: flex; flex-direction: column; gap: 3px; }- .cost-key {- font-family: var(--font-mono); font-size: 10.5px;- text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-4);- }- .cost-val {- font-family: var(--font-mono); font-size: 15px;- color: var(--text); font-weight: 600;- }+ /* Cost breakdown */+ .cost-section {+ border: 1px solid var(--hairline);+ border-radius: 10px;+ padding: 18px 20px;+ background: var(--surface-1);+ margin-bottom: 16px;+ }+ .cost-grid {+ display: flex;+ gap: 28px;+ flex-wrap: wrap;+ }+ .cost-item {+ display: flex;+ flex-direction: column;+ gap: 3px;+ }+ .cost-key {+ font-family: var(--font-mono);+ font-size: 10.5px;+ text-transform: uppercase;+ letter-spacing: 0.12em;+ color: var(--text-4);+ }+ .cost-val {+ font-family: var(--font-mono);+ font-size: 15px;+ color: var(--text);+ font-weight: 600;+ }- /* Attestation */- .attestation-section { margin-bottom: 16px; }- .attestation-toggle {- display: flex; align-items: center; gap: 8px;- font-family: var(--font-mono); font-size: 11.5px;- color: var(--text-3); cursor: pointer;- user-select: none; background: none; border: none; padding: 0;- }- .attestation-toggle:hover { color: var(--text-2); }- .attestation-toggle .chevron { transition: transform 0.18s; }- .attestation-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }- .attestation-body {- display: none; margin-top: 10px;- background: var(--surface-0);- border: 1px solid var(--hairline);- border-radius: 8px; padding: 14px 16px;- }- .attestation-body.open { display: block; }- .attestation-hash {- font-family: var(--font-mono); font-size: 12px;- color: var(--text-3); word-break: break-all;- line-height: 1.5;- }- .attestation-desc {- font-size: 12px; color: var(--text-4); margin-top: 8px;- }+ /* Attestation */+ .attestation-section {+ margin-bottom: 16px;+ }+ .attestation-toggle {+ display: flex;+ align-items: center;+ gap: 8px;+ font-family: var(--font-mono);+ font-size: 11.5px;+ color: var(--text-3);+ cursor: pointer;+ user-select: none;+ background: none;+ border: none;+ padding: 0;+ }+ .attestation-toggle:hover {+ color: var(--text-2);+ }+ .attestation-toggle .chevron {+ transition: transform 0.18s;+ }+ .attestation-toggle[aria-expanded='true'] .chevron {+ transform: rotate(180deg);+ }+ .attestation-body {+ display: none;+ margin-top: 10px;+ background: var(--surface-0);+ border: 1px solid var(--hairline);+ border-radius: 8px;+ padding: 14px 16px;+ }+ .attestation-body.open {+ display: block;+ }+ .attestation-hash {+ font-family: var(--font-mono);+ font-size: 12px;+ color: var(--text-3);+ word-break: break-all;+ line-height: 1.5;+ }+ .attestation-desc {+ font-size: 12px;+ color: var(--text-4);+ margin-top: 8px;+ }- /* ── ERROR ───────────────────────────────────────────────────────── */- .error-panel { display: none; margin-bottom: 28px; }- .error-panel.active { display: block; }- .error-card {- border: 1px solid rgba(239,68,68,0.3);- border-radius: 10px; padding: 20px 22px;- background: rgba(239,68,68,0.06);- }- .error-title {- font-weight: 600; color: var(--verdict-contradicted);- margin-bottom: 6px; font-size: 15px;- }- .error-msg { color: var(--text-2); font-size: 14px; margin-bottom: 16px; }- .error-code {- font-family: var(--font-mono); font-size: 11.5px; color: var(--text-4);- }+ /* ── ERROR ───────────────────────────────────────────────────────── */+ .error-panel {+ display: none;+ margin-bottom: 28px;+ }+ .error-panel.active {+ display: block;+ }+ .error-card {+ border: 1px solid rgba(239, 68, 68, 0.3);+ border-radius: 10px;+ padding: 20px 22px;+ background: rgba(239, 68, 68, 0.06);+ }+ .error-title {+ font-weight: 600;+ color: var(--verdict-contradicted);+ margin-bottom: 6px;+ font-size: 15px;+ }+ .error-msg {+ color: var(--text-2);+ font-size: 14px;+ margin-bottom: 16px;+ }+ .error-code {+ font-family: var(--font-mono);+ font-size: 11.5px;+ color: var(--text-4);+ }- /* ── PAYMENT REQUIRED ────────────────────────────────────────────── */- .payment-panel { display: none; margin-bottom: 28px; }- .payment-panel.active { display: block; }- .payment-card {- border: 1px solid var(--hairline-strong);- border-radius: 12px; padding: 24px 28px;- background: var(--surface-1);- }- .payment-title {- font-family: var(--font-display);- font-size: 18px; font-weight: 600; letter-spacing: -0.02em;- margin-bottom: 8px; color: var(--text);- }- .payment-desc { font-size: 14px; color: var(--text-2); margin-bottom: 20px; }- .payment-networks {- display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap;- }- .network-badge {- display: inline-flex; align-items: center; gap: 6px;- border: 1px solid var(--hairline-strong);- background: var(--surface-2);- padding: 7px 14px; border-radius: 8px;- font-size: 13.5px; color: var(--text-2);- }- .network-badge strong { color: var(--text); font-weight: 600; }+ /* ── PAYMENT REQUIRED ────────────────────────────────────────────── */+ .payment-panel {+ display: none;+ margin-bottom: 28px;+ }+ .payment-panel.active {+ display: block;+ }+ .payment-card {+ border: 1px solid var(--hairline-strong);+ border-radius: 12px;+ padding: 24px 28px;+ background: var(--surface-1);+ }+ .payment-title {+ font-family: var(--font-display);+ font-size: 18px;+ font-weight: 600;+ letter-spacing: -0.02em;+ margin-bottom: 8px;+ color: var(--text);+ }+ .payment-desc {+ font-size: 14px;+ color: var(--text-2);+ margin-bottom: 20px;+ }+ .payment-networks {+ display: flex;+ gap: 10px;+ margin-bottom: 20px;+ flex-wrap: wrap;+ }+ .network-badge {+ display: inline-flex;+ align-items: center;+ gap: 6px;+ border: 1px solid var(--hairline-strong);+ background: var(--surface-2);+ padding: 7px 14px;+ border-radius: 8px;+ font-size: 13.5px;+ color: var(--text-2);+ }+ .network-badge strong {+ color: var(--text);+ font-weight: 600;+ }- /* ── LOADING STATE ──────────────────────────────────────────────── */- .loading-status {- font-family: var(--font-mono); font-size: 12.5px;- color: var(--text-3); margin-top: 12px;- display: none;- animation: pulse-text 1.5s ease-in-out infinite;- }- @keyframes pulse-text { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }- .loading-status.active { display: block; }- </style>+ /* ── LOADING STATE ──────────────────────────────────────────────── */+ .loading-status {+ font-family: var(--font-mono);+ font-size: 12.5px;+ color: var(--text-3);+ margin-top: 12px;+ display: none;+ animation: pulse-text 1.5s ease-in-out infinite;+ }+ @keyframes pulse-text {+ 0%,+ 100% {+ opacity: 1;+ }+ 50% {+ opacity: 0.45;+ }+ }+ .loading-status.active {+ display: block;+ }+ </style>- <link rel="canonical" href="https://three.ws/fact-checker">- <meta property="og:type" content="website">- <meta property="og:site_name" content="three.ws">- <meta property="og:url" content="https://three.ws/fact-checker">- <meta name="twitter:title" content="Fact Checker · three.ws">- <meta name="twitter:description" content="Pay $0.10 per claim. The agent searches across authoritative sources, pays per retrieval via x402, and returns a verdict with cited evidence and a signed attestation.">- <meta name="twitter:image" content="/og-image.png">- <script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","name":"Fact Checker","description":"Pay $0.10 per claim. The agent searches across authoritative sources, pays per retrieval via x402, and returns a verdict with cited evidence and a signed attestation.","url":"https://three.ws/fact-checker","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"}}</script>-</head>-<body>--<!-- ── NAV ─────────────────────────────────────────────────────────────── -->-<header class="nav">- <div class="nav-inner">- <a class="brand" href="/">- <span class="brand-mark"></span>- <span>three.ws</span>- </a>- <nav class="nav-main" aria-label="Primary">- <a href="/discover">Discover</a>- <a href="/marketplace">Marketplace</a>- <a href="/walk">Walk</a>- <a href="/pages/fact-checker.html" class="active">Fact Checker</a>- </nav>- <div class="nav-end">- <a href="/login">Sign in</a>- <a class="console" href="/dashboard">Dashboard →</a>- </div>- </div>-</header>--<!-- ── HERO ────────────────────────────────────────────────────────────── -->-<section class="hero">- <div class="wrap-1280">- <div class="hero-eyebrow">x402 paid endpoint · live</div>- <h1>Real-Time Fact Checker</h1>- <p class="hero-sub">Pay per verification. Results cited. Attestation signed.</p>- <div class="cost-badge">- <span class="dot"></span>- $0.10–$1.00 per check · USDC · Base + Solana- </div>- </div>-</section>--<!-- ── MAIN ─────────────────────────────────────────────────────────────── -->-<main class="main">- <div class="wrap-1280">-- <!-- Form -->- <div class="form-card">- <label class="form-label" for="claim-input">Claim to fact-check</label>- <textarea- id="claim-input"- class="claim-textarea"- placeholder="Enter a claim to fact-check..."- maxlength="1000"- ></textarea>-- <div>- <div class="form-label" style="margin-top:20px;">Strictness</div>- <div class="strictness-row">- <div class="strictness-option">- <input type="radio" id="s-low" name="strictness" value="low" />- <label for="s-low">Low</label>- </div>- <div class="strictness-option">- <input type="radio" id="s-medium" name="strictness" value="medium" checked />- <label for="s-medium">Medium</label>- </div>- <div class="strictness-option">- <input type="radio" id="s-high" name="strictness" value="high" />- <label for="s-high">High</label>- </div>+ <link rel="canonical" href="https://three.ws/fact-checker" />+ <meta property="og:type" content="website" />+ <meta property="og:site_name" content="three.ws" />+ <meta property="og:url" content="https://three.ws/fact-checker" />+ <meta name="twitter:title" content="Fact Checker · three.ws" />+ <meta+ name="twitter:description"+ content="Pay $0.10 per claim. The agent searches across authoritative sources, pays per retrieval via x402, and returns a verdict with cited evidence and a signed attestation."+ />+ <meta name="twitter:image" content="/og-image.png" />+ <script type="application/ld+json">+ {+ "@context": "https://schema.org",+ "@type": "WebPage",+ "name": "Fact Checker",+ "description": "Pay $0.10 per claim. The agent searches across authoritative sources, pays per retrieval via x402, and returns a verdict with cited evidence and a signed attestation.",+ "url": "https://three.ws/fact-checker",+ "isPartOf": { "@type": "WebSite", "name": "three.ws", "url": "https://three.ws" }+ }+ </script>+ </head>+ <body>+ <!-- ── NAV ─────────────────────────────────────────────────────────────── -->+ <header class="nav">+ <div class="nav-inner">+ <a class="brand" href="/">+ <span class="brand-mark"></span>+ <span>three.ws</span>+ </a>+ <nav class="nav-main" aria-label="Primary">+ <a href="/discover">Discover</a>+ <a href="/marketplace">Marketplace</a>+ <a href="/walk">Walk</a>+ <a href="/pages/fact-checker.html" class="active">Fact Checker</a>+ </nav>+ <div class="nav-end">+ <a href="/my-agents" data-auth="in" hidden>My Agents</a>+ <a href="/login" data-auth="out">Sign in</a>+ <a class="console" href="/dashboard" data-auth-name>Dashboard →</a></div></div>+ </header>- <div class="form-actions">- <button id="check-btn" class="btn primary">Check This Fact</button>- <div id="loading-status" class="loading-status">Searching sources...</div>- <span id="char-counter" class="char-counter">0 / 1000</span>+ <!-- ── HERO ────────────────────────────────────────────────────────────── -->+ <section class="hero">+ <div class="wrap-1280">+ <div class="hero-eyebrow">x402 paid endpoint · live</div>+ <h1>Real-Time Fact Checker</h1>+ <p class="hero-sub">Pay per verification. Results cited. Attestation signed.</p>+ <div class="cost-badge">+ <span class="dot"></span>+ $0.10–$1.00 per check · USDC · Base + Solana+ </div></div>- </div>+ </section>- <!-- Example claims (empty state) -->- <div id="empty-state" class="empty-state">- <div class="empty-label">Try an example</div>- <div class="example-claims">- <button class="example-chip" data-claim="The Eiffel Tower is 330 meters tall.">The Eiffel Tower is 330 meters tall.</button>- <button class="example-chip" data-claim="Bitcoin was invented in 2009.">Bitcoin was invented in 2009.</button>- <button class="example-chip" data-claim="The Great Wall of China is visible from space.">The Great Wall of China is visible from space.</button>- <button class="example-chip" data-claim="Humans use only 10% of their brain.">Humans use only 10% of their brain.</button>- </div>- </div>+ <!-- ── MAIN ─────────────────────────────────────────────────────────────── -->+ <main class="main">+ <div class="wrap-1280">+ <!-- Form -->+ <div class="form-card">+ <label class="form-label" for="claim-input">Claim to fact-check</label>+ <textarea+ id="claim-input"+ class="claim-textarea"+ placeholder="Enter a claim to fact-check..."+ maxlength="1000"+ ></textarea>- <!-- Skeleton loading -->- <div id="skeleton" class="skeleton">- <div class="skel-verdict"></div>- <div class="skel-sources">- <div class="skel-card">- <div class="skel-line" style="width:60%;height:14px;"></div>- <div class="skel-line" style="width:90%;height:13px;margin-top:10px;"></div>- <div class="skel-line" style="width:70%;height:13px;"></div>- </div>- <div class="skel-card">- <div class="skel-line" style="width:55%;height:14px;"></div>- <div class="skel-line" style="width:85%;height:13px;margin-top:10px;"></div>- <div class="skel-line" style="width:65%;height:13px;"></div>- </div>- <div class="skel-card">- <div class="skel-line" style="width:65%;height:14px;"></div>- <div class="skel-line" style="width:80%;height:13px;margin-top:10px;"></div>- <div class="skel-line" style="width:75%;height:13px;"></div>+ <div>+ <div class="form-label" style="margin-top: 20px">Strictness</div>+ <div class="strictness-row">+ <div class="strictness-option">+ <input type="radio" id="s-low" name="strictness" value="low" />+ <label for="s-low">Low</label>+ </div>+ <div class="strictness-option">+ <input+ type="radio"+ id="s-medium"+ name="strictness"+ value="medium"+ checked+ />+ <label for="s-medium">Medium</label>+ </div>+ <div class="strictness-option">+ <input type="radio" id="s-high" name="strictness" value="high" />+ <label for="s-high">High</label>+ </div>+ </div>+ </div>++ <div class="form-actions">+ <button id="check-btn" class="btn primary">Check This Fact</button>+ <div id="loading-status" class="loading-status">Searching sources...</div>+ <span id="char-counter" class="char-counter">0 / 1000</span>+ </div></div>- </div>- </div>- <!-- Payment required -->- <div id="payment-panel" class="payment-panel">- <div class="payment-card">- <div class="payment-title">Payment Required</div>- <div class="payment-desc" id="payment-desc">- This endpoint costs $0.10 per check. Connect your wallet to pay with USDC on Base or Solana.+ <!-- Example claims (empty state) -->+ <div id="empty-state" class="empty-state">+ <div class="empty-label">Try an example</div>+ <div class="example-claims">+ <button+ class="example-chip"+ data-claim="The Eiffel Tower is 330 meters tall."+ >+ The Eiffel Tower is 330 meters tall.+ </button>+ <button class="example-chip" data-claim="Bitcoin was invented in 2009.">+ Bitcoin was invented in 2009.+ </button>+ <button+ class="example-chip"+ data-claim="The Great Wall of China is visible from space."+ >+ The Great Wall of China is visible from space.+ </button>+ <button+ class="example-chip"+ data-claim="Humans use only 10% of their brain."+ >+ Humans use only 10% of their brain.+ </button>+ </div></div>- <div class="payment-networks" id="payment-networks">- <div class="network-badge">Base <strong>USDC</strong> — <strong id="payment-price-base">$0.10</strong></div>- <div class="network-badge">Solana <strong>USDC</strong> — <strong id="payment-price-sol">$0.10</strong></div>++ <!-- Skeleton loading -->+ <div id="skeleton" class="skeleton">+ <div class="skel-verdict"></div>+ <div class="skel-sources">+ <div class="skel-card">+ <div class="skel-line" style="width: 60%; height: 14px"></div>+ <div+ class="skel-line"+ style="width: 90%; height: 13px; margin-top: 10px"+ ></div>+ <div class="skel-line" style="width: 70%; height: 13px"></div>+ </div>+ <div class="skel-card">+ <div class="skel-line" style="width: 55%; height: 14px"></div>+ <div+ class="skel-line"+ style="width: 85%; height: 13px; margin-top: 10px"+ ></div>+ <div class="skel-line" style="width: 65%; height: 13px"></div>+ </div>+ <div class="skel-card">+ <div class="skel-line" style="width: 65%; height: 14px"></div>+ <div+ class="skel-line"+ style="width: 80%; height: 13px; margin-top: 10px"+ ></div>+ <div class="skel-line" style="width: 75%; height: 13px"></div>+ </div>+ </div></div>- <a href="/marketplace" class="btn sm">Connect wallet to pay →</a>- </div>- </div>- <!-- Error -->- <div id="error-panel" class="error-panel">- <div class="error-card">- <div class="error-title">Something went wrong</div>- <div class="error-msg" id="error-msg">An unexpected error occurred.</div>- <div class="error-code" id="error-code"></div>- <button class="btn sm" id="retry-btn" style="margin-top:16px;">Retry</button>- </div>- </div>+ <!-- Payment required -->+ <div id="payment-panel" class="payment-panel">+ <div class="payment-card">+ <div class="payment-title">Payment Required</div>+ <div class="payment-desc" id="payment-desc">+ This endpoint costs $0.10 per check. Connect your wallet to pay with+ USDC on Base or Solana.+ </div>+ <div class="payment-networks" id="payment-networks">+ <div class="network-badge">+ Base <strong>USDC</strong> —+ <strong id="payment-price-base">$0.10</strong>+ </div>+ <div class="network-badge">+ Solana <strong>USDC</strong> —+ <strong id="payment-price-sol">$0.10</strong>+ </div>+ </div>+ <a href="/marketplace" class="btn sm">Connect wallet to pay →</a>+ </div>+ </div>- <!-- Result panel -->- <div id="result-panel" class="result-panel">+ <!-- Error -->+ <div id="error-panel" class="error-panel">+ <div class="error-card">+ <div class="error-title">Something went wrong</div>+ <div class="error-msg" id="error-msg">An unexpected error occurred.</div>+ <div class="error-code" id="error-code"></div>+ <button class="btn sm" id="retry-btn" style="margin-top: 16px">+ Retry+ </button>+ </div>+ </div>- <!-- Verdict -->- <div id="verdict-banner" class="verdict-banner">- <span id="verdict-label" class="verdict-label"></span>- <span id="verdict-confidence" class="verdict-confidence"></span>- <p id="verdict-claim" class="verdict-claim"></p>- </div>+ <!-- Result panel -->+ <div id="result-panel" class="result-panel">+ <!-- Verdict -->+ <div id="verdict-banner" class="verdict-banner">+ <span id="verdict-label" class="verdict-label"></span>+ <span id="verdict-confidence" class="verdict-confidence"></span>+ <p id="verdict-claim" class="verdict-claim"></p>+ </div>- <!-- Sources -->- <div class="sources-section">- <div class="section-title">Sources</div>- <div id="sources-grid" class="sources-grid"></div>- </div>+ <!-- Sources -->+ <div class="sources-section">+ <div class="section-title">Sources</div>+ <div id="sources-grid" class="sources-grid"></div>+ </div>- <!-- Cost breakdown -->- <div class="cost-section">- <div class="section-title">Cost breakdown</div>- <div id="cost-grid" class="cost-grid"></div>- </div>+ <!-- Cost breakdown -->+ <div class="cost-section">+ <div class="section-title">Cost breakdown</div>+ <div id="cost-grid" class="cost-grid"></div>+ </div>- <!-- Attestation -->- <div class="attestation-section">- <button- id="attest-toggle"- class="attestation-toggle"- aria-expanded="false"- >- <svg class="chevron" width="14" height="14" viewBox="0 0 14 14" fill="none">- <path d="M3 5l4 4 4-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>- </svg>- Attestation- </button>- <div id="attest-body" class="attestation-body">- <div id="attest-hash" class="attestation-hash"></div>- <div class="attestation-desc">- SHA-256 hash of verdict + confidence + claim + source URLs. Verifiable offline.+ <!-- Attestation -->+ <div class="attestation-section">+ <button id="attest-toggle" class="attestation-toggle" aria-expanded="false">+ <svg+ class="chevron"+ width="14"+ height="14"+ viewBox="0 0 14 14"+ fill="none"+ >+ <path+ d="M3 5l4 4 4-4"+ stroke="currentColor"+ stroke-width="1.5"+ stroke-linecap="round"+ />+ </svg>+ Attestation+ </button>+ <div id="attest-body" class="attestation-body">+ <div id="attest-hash" class="attestation-hash"></div>+ <div class="attestation-desc">+ SHA-256 hash of verdict + confidence + claim + source URLs.+ Verifiable offline.+ </div>+ </div></div></div></div>- </div>-- </div>-</main>+ </main>-<script type="module" src="/src/fact-checker-app.js"></script>- <script src="/brand.js" defer></script>-</body>+ <script type="module" src="/src/fact-checker-app.js"></script>+ <script src="/brand.js" defer></script>+ <script>+ // Auth-aware nav, shared with the site header via /nav-auth.js so the two+ // never drift — see that module for the hint-then-reconcile strategy.+ (function () {+ if (typeof window.initNavAuth === 'function') {+ window.initNavAuth(document);+ return;+ }+ var s = document.createElement('script');+ s.src = '/nav-auth.js';+ s.addEventListener('load', function () {+ if (typeof window.initNavAuth === 'function') window.initNavAuth(document);+ });+ document.head.appendChild(s);+ })();+ </script>+ </body></html>diff --git a/public/features.json b/public/features.jsonindex feb20825d..74dfd816e 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-08T08:07:20.803Z",+ "generated_at": "2026-06-08T09:44:54.867Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/public/three-ws-mcp-icon.svg b/public/three-ws-mcp-icon.svgnew file mode 100644index 000000000..d45ae3327--- /dev/null+++ b/public/three-ws-mcp-icon.svg@@ -0,0 +1,27 @@+<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64" role="img" aria-label="three.ws 3D Studio">+ <defs>+ <linearGradient id="bg" x1="0" y1="0" x2="64" y2="64" gradientUnits="userSpaceOnUse">+ <stop offset="0" stop-color="#0E1116"/>+ <stop offset="1" stop-color="#1B2330"/>+ </linearGradient>+ <linearGradient id="top" x1="32" y1="10" x2="32" y2="32" gradientUnits="userSpaceOnUse">+ <stop offset="0" stop-color="#7DD3FC"/>+ <stop offset="1" stop-color="#38BDF8"/>+ </linearGradient>+ <linearGradient id="left" x1="14" y1="22" x2="32" y2="54" gradientUnits="userSpaceOnUse">+ <stop offset="0" stop-color="#2563EB"/>+ <stop offset="1" stop-color="#1E40AF"/>+ </linearGradient>+ <linearGradient id="right" x1="50" y1="22" x2="32" y2="54" gradientUnits="userSpaceOnUse">+ <stop offset="0" stop-color="#0EA5E9"/>+ <stop offset="1" stop-color="#0369A1"/>+ </linearGradient>+ </defs>+ <rect width="64" height="64" rx="14" fill="url(#bg)"/>+ <!-- isometric cube: text/image -> 3D -->+ <g stroke="#0B0E13" stroke-width="1.25" stroke-linejoin="round">+ <path d="M32 11 L51 21.5 L32 32 L13 21.5 Z" fill="url(#top)"/>+ <path d="M13 21.5 L32 32 L32 53 L13 42.5 Z" fill="url(#left)"/>+ <path d="M51 21.5 L32 32 L32 53 L51 42.5 Z" fill="url(#right)"/>+ </g>+</svg>diff --git a/tests/e2e/nav-auth.spec.js b/tests/e2e/nav-auth.spec.jsindex d630b908e..70c3ff77b 100644--- a/tests/e2e/nav-auth.spec.js+++ b/tests/e2e/nav-auth.spec.js@@ -1,11 +1,14 @@import { test, expect } from '@playwright/test';-// Drives a real Chromium against the homepage (pages/home.html, served at "/")-// to prove the auth-aware nav swap works end-to-end: the shared /nav-auth.js-// module reconciles the hand-rolled homepage nav against /api/auth/me. The auth-// endpoint is stubbed at the network layer so we exercise the real client wiring-// without standing up a session/DB — only the contract (`{ user }` vs-// `{ user: null }`) is faked, which is exactly the seam the client depends on.+// Drives a real Chromium against every page whose hand-rolled header relies on+// the shared /nav-auth.js module to become auth-aware, proving the "Sign in" CTA+// swaps end-to-end. The auth endpoint is stubbed at the network layer so we+// exercise the real client wiring without a session/DB — only the contract+// (`{ user }` vs `{ user: null }`) is faked, which is exactly the seam the+// client depends on. Adding a page here guards it against the drift that left+// the homepage showing "Sign in" to signed-in users.++const PAGES = ['/', '/fact-checker'];const SIGN_IN = '.nav-end a[data-auth="out"]';const MY_AGENTS = '.nav-end a[data-auth="in"]';@@ -21,51 +24,59 @@ function stubMe(page, body, status = 200) {);}-test('signed-out visitor sees "Sign in", not the account entry points', async ({ page }) => {- await stubMe(page, { user: null });- await page.goto('/', { waitUntil: 'domcontentloaded' });+function presetHint(page, hint) {+ return page.addInitScript((value) => {+ try {+ localStorage.setItem('3dagent:auth-hint', JSON.stringify(value));+ } catch (_) {}+ }, hint);+}- await expect(page.locator(SIGN_IN)).toBeVisible();- await expect(page.locator(MY_AGENTS)).toBeHidden();-});+for (const path of PAGES) {+ test.describe(`auth-aware nav · ${path}`, () => {+ test('signed-out visitor sees "Sign in", not the account entry points', async ({+ page,+ }) => {+ await stubMe(page, { user: null });+ await page.goto(path, { waitUntil: 'domcontentloaded' });-test('signed-in visitor sees account entry points and their name, not "Sign in"', async ({- page,-}) => {- await stubMe(page, { user: { display_name: 'Catherine Maerial', username: 'catherine' } });- await page.goto('/', { waitUntil: 'domcontentloaded' });+ await expect(page.locator(SIGN_IN)).toBeVisible();+ await expect(page.locator(MY_AGENTS)).toBeHidden();+ });- await expect(page.locator(SIGN_IN)).toBeHidden();- await expect(page.locator(MY_AGENTS)).toBeVisible();- await expect(page.locator(CONSOLE_PILL)).toHaveText('Catherine Maerial');-});+ test('signed-in visitor sees account entry points and their name', async ({ page }) => {+ await stubMe(page, {+ user: { display_name: 'Catherine Maerial', username: 'catherine' },+ });+ await page.goto(path, { waitUntil: 'domcontentloaded' });-test('falls back to the optimistic hint when the auth endpoint is down', async ({ page }) => {- // Returning user: a prior sign-in left the local hint. The endpoint failing- // must NOT flash them back to a signed-out nav.- await page.addInitScript(() => {- try {- localStorage.setItem('3dagent:auth-hint', JSON.stringify({ authed: true, name: 'Catherine' }));- } catch (_) {}- });- await page.route('**/api/auth/me', (route) => route.abort());- await page.goto('/', { waitUntil: 'domcontentloaded' });+ await expect(page.locator(SIGN_IN)).toBeHidden();+ await expect(page.locator(MY_AGENTS)).toBeVisible();+ await expect(page.locator(CONSOLE_PILL)).toHaveText('Catherine Maerial');+ });- await expect(page.locator(SIGN_IN)).toBeHidden();- await expect(page.locator(MY_AGENTS)).toBeVisible();-});+ test('falls back to the optimistic hint when the auth endpoint is down', async ({+ page,+ }) => {+ // Returning user: a prior sign-in left the local hint. The endpoint+ // failing must NOT flash them back to a signed-out nav.+ await presetHint(page, { authed: true, name: 'Catherine' });+ await page.route('**/api/auth/me', (route) => route.abort());+ await page.goto(path, { waitUntil: 'domcontentloaded' });-test('a stale hint is corrected when the server reports no session', async ({ page }) => {- // Hint says signed-in, but the real session is gone (e.g. expired/revoked).- // Server truth wins: the nav must reconcile back to "Sign in".- await page.addInitScript(() => {- try {- localStorage.setItem('3dagent:auth-hint', JSON.stringify({ authed: true, name: 'Ghost' }));- } catch (_) {}- });- await stubMe(page, { user: null });- await page.goto('/', { waitUntil: 'domcontentloaded' });+ await expect(page.locator(SIGN_IN)).toBeHidden();+ await expect(page.locator(MY_AGENTS)).toBeVisible();+ });- await expect(page.locator(SIGN_IN)).toBeVisible();- await expect(page.locator(MY_AGENTS)).toBeHidden();-});+ test('a stale hint is corrected when the server reports no session', async ({ page }) => {+ // Hint says signed-in, but the real session is gone (expired/revoked).+ // Server truth wins: the nav must reconcile back to "Sign in".+ await presetHint(page, { authed: true, name: 'Ghost' });+ await stubMe(page, { user: null });+ await page.goto(path, { waitUntil: 'domcontentloaded' });++ await expect(page.locator(SIGN_IN)).toBeVisible();+ await expect(page.locator(MY_AGENTS)).toBeHidden();+ });+ });+}diff --git a/tests/mcp-resilience.test.js b/tests/mcp-resilience.test.jsnew file mode 100644index 000000000..8a88a6951--- /dev/null+++ b/tests/mcp-resilience.test.js@@ -0,0 +1,214 @@+import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';++import {+ resilientFetch,+ fetchJson,+ parseRetryAfterMs,+ backoffMs,+} from '../mcp-server/src/lib/resilient-fetch.js';+import {+ getSolanaEndpoints,+ withSolanaConnection,+ _resetSolanaCache,+} from '../mcp-server/src/lib/solana-rpc.js';+import { getEvmRpcUrls } from '../mcp-server/src/lib/evm-rpc.js';++// A Response stub good enough for resilientFetch (status, ok, headers.get,+// arrayBuffer drain, json/text bodies).+function res(status, body = {}, headers = {}) {+ const h = new Map(Object.entries(headers).map(([k, v]) => [k.toLowerCase(), String(v)]));+ return {+ status,+ ok: status >= 200 && status < 300,+ headers: { get: (k) => h.get(k.toLowerCase()) ?? null },+ arrayBuffer: async () => new ArrayBuffer(0),+ json: async () => body,+ text: async () => JSON.stringify(body),+ };+}++describe('resilientFetch — timeout + safe retries', () => {+ let fetchMock;+ beforeEach(() => {+ fetchMock = vi.fn();+ vi.stubGlobal('fetch', fetchMock);+ });+ afterEach(() => {+ vi.unstubAllGlobals();+ vi.restoreAllMocks();+ });++ it('returns the first 2xx without retrying', async () => {+ fetchMock.mockResolvedValueOnce(res(200, { ok: true }));+ const r = await resilientFetch('https://x.test', {}, { retries: 3 });+ expect(r.status).toBe(200);+ expect(fetchMock).toHaveBeenCalledTimes(1);+ });++ it('retries a GET on a 503 then succeeds', async () => {+ fetchMock+ .mockResolvedValueOnce(res(503))+ .mockResolvedValueOnce(res(200, { ok: true }));+ const r = await resilientFetch('https://x.test', {}, { retries: 2, baseDelayMs: 1, maxDelayMs: 2 });+ expect(r.status).toBe(200);+ expect(fetchMock).toHaveBeenCalledTimes(2);+ });++ it('retries a GET on a network error then succeeds', async () => {+ fetchMock+ .mockRejectedValueOnce(new Error('ECONNRESET'))+ .mockResolvedValueOnce(res(200, { ok: true }));+ const r = await resilientFetch('https://x.test', {}, { retries: 2, baseDelayMs: 1, maxDelayMs: 2 });+ expect(r.status).toBe(200);+ expect(fetchMock).toHaveBeenCalledTimes(2);+ });++ it('does NOT retry a non-idempotent POST by default (no double-send)', async () => {+ fetchMock.mockResolvedValueOnce(res(503));+ const r = await resilientFetch('https://x.test', { method: 'POST' }, { retries: 3, baseDelayMs: 1 });+ expect(r.status).toBe(503);+ expect(fetchMock).toHaveBeenCalledTimes(1);+ });++ it('retries a POST when the caller opts in with retryNonIdempotent', async () => {+ fetchMock+ .mockResolvedValueOnce(res(500))+ .mockResolvedValueOnce(res(200, { ok: true }));+ const r = await resilientFetch(+ 'https://x.test',+ { method: 'POST' },+ { retries: 2, retryNonIdempotent: true, baseDelayMs: 1, maxDelayMs: 2 },+ );+ expect(r.status).toBe(200);+ expect(fetchMock).toHaveBeenCalledTimes(2);+ });++ it('returns the last response (not throw) when retries are exhausted on status', async () => {+ fetchMock.mockResolvedValue(res(429));+ const r = await resilientFetch('https://x.test', {}, { retries: 2, baseDelayMs: 1, maxDelayMs: 2 });+ expect(r.status).toBe(429);+ expect(fetchMock).toHaveBeenCalledTimes(3); // 1 + 2 retries+ });++ it('times out a hung request and surfaces a TimeoutError', async () => {+ // fetch never resolves until aborted; reject when the signal fires.+ fetchMock.mockImplementation(+ (_url, init) =>+ new Promise((_resolve, reject) => {+ init.signal.addEventListener('abort', () =>+ reject(Object.assign(new Error('aborted'), { name: 'AbortError' })),+ );+ }),+ );+ await expect(+ resilientFetch('https://x.test', {}, { timeoutMs: 10, retries: 0 }),+ ).rejects.toThrow(/timed out/i);+ });++ it('fetchJson throws on a non-2xx final response', async () => {+ fetchMock.mockResolvedValue(res(404, { error: 'nope' }));+ await expect(fetchJson('https://x.test', {}, { retries: 0 })).rejects.toThrow(/HTTP 404/);+ });++ it('fetchJson returns parsed JSON on success', async () => {+ fetchMock.mockResolvedValueOnce(res(200, { hello: 'world' }));+ await expect(fetchJson('https://x.test', {}, { retries: 0 })).resolves.toEqual({ hello: 'world' });+ });+});++describe('parseRetryAfterMs', () => {+ it('parses delta-seconds', () => {+ expect(parseRetryAfterMs(res(429, {}, { 'retry-after': '2' }))).toBe(2000);+ });+ it('returns null when absent', () => {+ expect(parseRetryAfterMs(res(429))).toBeNull();+ });+});++describe('backoffMs — full jitter within the doubling cap', () => {+ it('never exceeds the cap and grows the cap each attempt', () => {+ for (let attempt = 0; attempt < 6; attempt += 1) {+ const cap = Math.min(4000, 250 * 2 ** attempt);+ for (let i = 0; i < 50; i += 1) {+ const d = backoffMs(attempt, 250, 4000);+ expect(d).toBeGreaterThanOrEqual(0);+ expect(d).toBeLessThanOrEqual(cap);+ }+ }+ });+});++describe('getSolanaEndpoints — env-driven failover list', () => {+ const saved = { list: process.env.SOLANA_RPC_URLS, single: process.env.SOLANA_RPC_URL };+ afterEach(() => {+ process.env.SOLANA_RPC_URLS = saved.list;+ process.env.SOLANA_RPC_URL = saved.single;+ delete process.env.SOLANA_RPC_URLS;+ delete process.env.SOLANA_RPC_URL;+ });++ it('always returns at least the built-in defaults', () => {+ delete process.env.SOLANA_RPC_URLS;+ delete process.env.SOLANA_RPC_URL;+ const eps = getSolanaEndpoints();+ expect(eps.length).toBeGreaterThanOrEqual(1);+ expect(eps).toContain('https://api.mainnet-beta.solana.com');+ });++ it('puts the comma list first, then the single primary, deduped', () => {+ process.env.SOLANA_RPC_URLS = 'https://a.test, https://b.test';+ process.env.SOLANA_RPC_URL = 'https://b.test'; // duplicate of list entry+ const eps = getSolanaEndpoints();+ expect(eps[0]).toBe('https://a.test');+ expect(eps[1]).toBe('https://b.test');+ expect(eps.filter((e) => e === 'https://b.test')).toHaveLength(1);+ });+});++describe('withSolanaConnection — endpoint failover', () => {+ beforeEach(() => {+ process.env.SOLANA_RPC_URLS = 'https://a.test,https://b.test,https://c.test';+ _resetSolanaCache();+ });+ afterEach(() => {+ delete process.env.SOLANA_RPC_URLS;+ _resetSolanaCache();+ });++ it('falls over to the next endpoint when one fails and returns the success', async () => {+ let calls = 0;+ const out = await withSolanaConnection(async (conn) => {+ calls += 1;+ // First endpoint throws, second succeeds. Use the connection identity+ // to vary behavior across the failover loop.+ if (calls === 1) throw new Error('rpc down');+ return { endpoint: conn.rpcEndpoint, calls };+ });+ expect(out.calls).toBe(2);+ });++ it('throws the last error only when every endpoint fails', async () => {+ await expect(+ withSolanaConnection(async () => {+ throw new Error('all dead');+ }),+ ).rejects.toThrow(/all dead/);+ });+});++describe('getEvmRpcUrls — per-chain redundancy + overrides', () => {+ it('returns multiple built-in endpoints for a known chain', () => {+ const urls = getEvmRpcUrls(8453);+ expect(urls.length).toBeGreaterThanOrEqual(2);+ });++ it('puts caller overrides first and dedupes', () => {+ const urls = getEvmRpcUrls(1, ['https://my.rpc', 'https://eth.llamarpc.com']);+ expect(urls[0]).toBe('https://my.rpc');+ expect(urls.filter((u) => u === 'https://eth.llamarpc.com')).toHaveLength(1);+ });++ it('throws for an unknown chain with no endpoints', () => {+ expect(() => getEvmRpcUrls(999999)).toThrow(/no endpoints/);+ });+});