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: auth, skills, mirror, and strategies updates
nirholas779407473578
diff --git a/api/auth/persona/[action].js b/api/auth/persona/[action].jsindex 21d5533b8..26559cd7f 100644--- a/api/auth/persona/[action].js+++ b/api/auth/persona/[action].js@@ -283,7 +283,7 @@ async function handleMe(req, res) {}export default wrap(async (req, res) => {- const action = req.query?.action;+ const action = req.query?.action ?? new URL(req.url, 'http://x').pathname.split('/').filter(Boolean).pop();if (action === 'issue') return handleIssue(req, res);if (action === 'verify') return handleVerify(req, res);if (action === 'me') return handleMe(req, res);diff --git a/api/auth/session/[action].js b/api/auth/session/[action].jsindex 5e6e0271f..196094164 100644--- a/api/auth/session/[action].js+++ b/api/auth/session/[action].js@@ -14,7 +14,7 @@ function readCookieToken(req) {}export default wrap(async (req, res) => {- const action = req.query?.action;+ const action = req.query?.action ?? new URL(req.url, 'http://x').pathname.split('/').filter(Boolean).pop();if (action === 'list') {if (cors(req, res, { methods: 'GET,OPTIONS', credentials: true })) return;diff --git a/api/auth/sessions/[action].js b/api/auth/sessions/[action].jsindex f0cd45a10..efe333616 100644--- a/api/auth/sessions/[action].js+++ b/api/auth/sessions/[action].js@@ -16,7 +16,7 @@ import { limits, clientIp } from '../../_lib/rate-limit.js';const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;export default wrap(async (req, res) => {- const action = req.query?.action;+ const action = req.query?.action ?? new URL(req.url, 'http://x').pathname.split('/').filter(Boolean).pop();if (action === undefined || action === '' || action === null) {return handleIndex(req, res);diff --git a/api/auth/siwe/[action].js b/api/auth/siwe/[action].jsindex 57a11a595..d11c61975 100644--- a/api/auth/siwe/[action].js+++ b/api/auth/siwe/[action].js@@ -22,7 +22,7 @@ const verifyBody = z.object({});export default wrap(async (req, res) => {- const action = req.query?.action;+ const action = req.query?.action ?? new URL(req.url, 'http://x').pathname.split('/').filter(Boolean).pop();if (action === 'nonce') return handleNonce(req, res);if (action === 'verify') return handleVerify(req, res);return error(res, 404, 'not_found', 'unknown siwe action');diff --git a/api/auth/siws/[action].js b/api/auth/siws/[action].jsindex 4ec410d2c..11c9bf8ea 100644--- a/api/auth/siws/[action].js+++ b/api/auth/siws/[action].js@@ -24,7 +24,7 @@ const verifyBody = z.object({});export default wrap(async (req, res) => {- const action = req.query?.action;+ const action = req.query?.action ?? new URL(req.url, 'http://x').pathname.split('/').filter(Boolean).pop();if (action === 'nonce') return handleNonce(req, res);if (action === 'verify') return handleVerify(req, res);return error(res, 404, 'not_found', 'unknown siws action');diff --git a/api/auth/wallets/[action].js b/api/auth/wallets/[action].jsindex 2c5a2d76f..63f5b76fd 100644--- a/api/auth/wallets/[action].js+++ b/api/auth/wallets/[action].js@@ -40,7 +40,7 @@ const nonceBody = z.object({});export default wrap(async (req, res) => {- const action = req.query?.action;+ const action = req.query?.action ?? new URL(req.url, 'http://x').pathname.split('/').filter(Boolean).pop();// /api/auth/wallets — list (GET) or link (POST)if (action === undefined || action === '' || action === null) {diff --git a/api/auth/x/[action].js b/api/auth/x/[action].jsindex f0852b7e8..6d32754fc 100644--- a/api/auth/x/[action].js+++ b/api/auth/x/[action].js@@ -248,7 +248,7 @@ async function handleCallback(req, res) {// ── dispatch ──────────────────────────────────────────────────────────────────export default wrap(async (req, res) => {- const action = req.query?.action;+ const action = req.query?.action ?? new URL(req.url, 'http://x').pathname.split('/').filter(Boolean).pop();if (action === 'connect') return handleConnect(req, res);if (action === 'callback') return handleCallback(req, res);return error(res, 404, 'not_found', 'unknown action');diff --git a/api/skills/[id].js b/api/skills/[id].jsindex ab0ccb356..9ddb011ee 100644--- a/api/skills/[id].js+++ b/api/skills/[id].js@@ -6,6 +6,8 @@ import { limits, clientIp } from '../_lib/rate-limit.js';import { parse, isUuid } from '../_lib/validate.js';import skillReviewHandler from './review.js';+const SLUG_RE = /^[a-z0-9][a-z0-9_-]{0,59}$/;+const updateSchema = z.object({name: z.string().trim().min(2).max(80).optional(),description: z.string().trim().max(500).optional(),@@ -35,9 +37,16 @@ export default wrap(async (req, res) => {if (!method(req, res, ['GET', 'PUT', 'DELETE'])) return;const id = req.query?.id;- if (!id || !isUuid(id)) return error(res, 404, 'not_found', 'skill not found');-- if (req.method === 'GET') return handleGet(req, res, id);+ if (!id) return error(res, 404, 'not_found', 'skill not found');++ const isId = isUuid(id);+ const isSlug = SLUG_RE.test(id);+ // GET supports both UUID and slug for deep-linking; mutations require UUID+ if (req.method === 'GET') {+ if (!isId && !isSlug) return error(res, 404, 'not_found', 'skill not found');+ return handleGet(req, res, id, isId);+ }+ if (!isId) return error(res, 404, 'not_found', 'skill not found');if (req.method === 'PUT') return handleUpdate(req, res, id);return handleDelete(req, res, id);});@@ -72,31 +81,50 @@ function toSkill(row, { includeInstalled = false } = {}) {return skill;}-async function handleGet(req, res, id) {+async function handleGet(req, res, id, isId = true) {const rl = await limits.publicIp(clientIp(req));if (!rl.success) return rateLimited(res, rl);const auth = await resolveOptionalAuth(req);const userId = auth?.userId ?? null;- const [row] = await sql`- SELECT- ms.*,- u.display_name AS author_display_name,- ROUND(COALESCE(AVG(sr.rating), 0)::numeric, 1)::float AS avg_rating,- COUNT(sr.rating)::int AS rating_count,- CASE WHEN ${userId}::uuid IS NOT NULL- THEN EXISTS(- SELECT 1 FROM skill_installs si- WHERE si.skill_id = ms.id AND si.user_id = ${userId}::uuid- )- ELSE NULL END AS installed- FROM marketplace_skills ms- LEFT JOIN users u ON u.id = ms.author_id AND u.deleted_at IS NULL- LEFT JOIN skill_ratings sr ON sr.skill_id = ms.id- WHERE ms.id = ${id} AND ms.is_public = true- GROUP BY ms.id, ms.author_id, u.display_name- `;+ const [row] = isId+ ? await sql`+ SELECT+ ms.*,+ u.display_name AS author_display_name,+ ROUND(COALESCE(AVG(sr.rating), 0)::numeric, 1)::float AS avg_rating,+ COUNT(sr.rating)::int AS rating_count,+ CASE WHEN ${userId}::uuid IS NOT NULL+ THEN EXISTS(+ SELECT 1 FROM skill_installs si+ WHERE si.skill_id = ms.id AND si.user_id = ${userId}::uuid+ )+ ELSE NULL END AS installed+ FROM marketplace_skills ms+ LEFT JOIN users u ON u.id = ms.author_id AND u.deleted_at IS NULL+ LEFT JOIN skill_ratings sr ON sr.skill_id = ms.id+ WHERE ms.id = ${id} AND ms.is_public = true+ GROUP BY ms.id, ms.author_id, u.display_name+ `+ : await sql`+ SELECT+ ms.*,+ u.display_name AS author_display_name,+ ROUND(COALESCE(AVG(sr.rating), 0)::numeric, 1)::float AS avg_rating,+ COUNT(sr.rating)::int AS rating_count,+ CASE WHEN ${userId}::uuid IS NOT NULL+ THEN EXISTS(+ SELECT 1 FROM skill_installs si+ WHERE si.skill_id = ms.id AND si.user_id = ${userId}::uuid+ )+ ELSE NULL END AS installed+ FROM marketplace_skills ms+ LEFT JOIN users u ON u.id = ms.author_id AND u.deleted_at IS NULL+ LEFT JOIN skill_ratings sr ON sr.skill_id = ms.id+ WHERE ms.slug = ${id} AND ms.is_public = true+ GROUP BY ms.id, ms.author_id, u.display_name+ `;if (!row) return error(res, 404, 'not_found', 'skill not found');diff --git a/pages/mirror.html b/pages/mirror.htmlindex b1a820b71..866a638b3 100644--- a/pages/mirror.html+++ b/pages/mirror.html@@ -32,49 +32,53 @@body { background: var(--bg-0, #0a0a0a); color: var(--ink, #e8e8e8); margin: 0; font-family: var(--font-body, system-ui); }.mp-shell { max-width: 920px; margin: 0 auto; padding: var(--space-lg, 24px) var(--space-md, 16px) var(--space-2xl, 64px); }.mp-hero { text-align: center; padding: var(--space-xl, 42px) 0 var(--space-lg, 24px); }- .mp-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-2xs, .66rem); text-transform: uppercase; letter-spacing: .1em; color: var(--wallet-accent, #c4b5fd); margin: 0 0 12px; }- .mp-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success, #4ade80); box-shadow: 0 0 0 0 rgba(74,222,128,.5); animation: mp-pulse 1.8s ease infinite; }- @keyframes mp-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(74,222,128,.5); } 70% { box-shadow: 0 0 0 7px rgba(74,222,128,0); } }- .mp-title { font-family: var(--font-display, system-ui); font-size: clamp(1.8rem, 5vw, 2.8rem); margin: 0 0 12px; color: var(--ink-bright, #fff); letter-spacing: -.02em; }- .mp-sub { max-width: 620px; margin: 0 auto; font-size: var(--text-md, .95rem); line-height: 1.6; color: var(--ink-dim, #aaa); }- .mp-sub b { color: var(--wallet-accent, #c4b5fd); }- .mp-section { margin-top: var(--space-xl, 42px); }- .mp-section h2 { font-family: var(--font-display, system-ui); font-size: var(--text-lg, 1.15rem); color: var(--ink-bright, #fff); margin: 0 0 4px; }- .mp-section .mp-desc { font-size: var(--text-sm, .82rem); color: var(--ink-dim, #9a9a9a); margin: 0 0 var(--space-md, 16px); }- .mp-controls { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--space-md, 16px); }- .mp-seg { display: inline-flex; gap: 4px; background: var(--surface-1, rgba(255,255,255,.03)); padding: 4px; border-radius: var(--radius-pill, 999px); border: 1px solid var(--stroke, rgba(255,255,255,.08)); }- .mp-seg button { font: inherit; font-size: var(--text-2xs, .68rem); padding: 6px 14px; border-radius: 999px; border: none; background: transparent; color: var(--ink-dim, #aaa); cursor: pointer; transition: all .15s; }- .mp-seg button[aria-pressed="true"] { background: var(--wallet-accent, #c4b5fd); color: #1a1340; font-weight: 700; }- .mp-board { display: flex; flex-direction: column; gap: 8px; }- .mp-lrow { display: flex; align-items: center; gap: var(--space-md, 14px); padding: var(--space-sm, 12px) var(--space-md, 14px); border: 1px solid var(--stroke, rgba(255,255,255,.08)); border-radius: var(--radius-lg, 14px); background: var(--surface-1, rgba(255,255,255,.025)); transition: border-color .18s, transform .18s; }- .mp-lrow:hover { border-color: var(--wallet-stroke, rgba(139,92,246,.35)); transform: translateY(-1px); }- .mp-rank { font-family: var(--font-mono, monospace); font-size: var(--text-md, .9rem); color: var(--ink-dim, #888); width: 28px; text-align: center; flex: 0 0 auto; }- .mp-rank.top { color: var(--wallet-accent, #c4b5fd); font-weight: 700; }- .mp-av { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--surface-2, rgba(255,255,255,.05)); flex: 0 0 auto; }+ .mp-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-2xs, .66rem); text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.4); margin: 0 0 12px; }+ .mp-live-dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: .5; }+ .mp-title { font-family: var(--font-display, system-ui); font-size: clamp(1.8rem, 5vw, 2.8rem); margin: 0 0 14px; color: #fff; letter-spacing: -.03em; font-weight: 700; }+ .mp-sub { max-width: 580px; margin: 0 auto; font-size: var(--text-md, .95rem); line-height: 1.65; color: rgba(255,255,255,.45); }+ .mp-sub b { color: rgba(255,255,255,.8); font-weight: 500; }+ .mp-section { margin-top: 48px; }+ .mp-section-header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 6px; }+ .mp-section h2 { font-family: var(--font-display, system-ui); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.4); margin: 0; font-weight: 500; }+ .mp-section .mp-desc { font-size: var(--text-sm, .82rem); color: rgba(255,255,255,.3); margin: 0 0 16px; }+ .mp-controls { display: flex; gap: 0; flex-wrap: wrap; margin-bottom: 16px; border: 1px solid rgba(255,255,255,.08); border-radius: 4px; overflow: hidden; width: fit-content; }+ .mp-seg { display: inline-flex; gap: 0; }+ .mp-seg button { font: inherit; font-size: .72rem; padding: 7px 14px; border-radius: 0; border: none; border-right: 1px solid rgba(255,255,255,.08); background: transparent; color: rgba(255,255,255,.35); cursor: pointer; transition: color .12s, background .12s; letter-spacing: .02em; }+ .mp-seg button:last-child { border-right: none; }+ .mp-seg button[aria-pressed="true"] { background: rgba(255,255,255,.06); color: #fff; font-weight: 600; }+ .mp-seg button:hover:not([aria-pressed="true"]) { color: rgba(255,255,255,.65); background: rgba(255,255,255,.03); }+ .mp-board { display: flex; flex-direction: column; gap: 1px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.06); border-radius: 4px; overflow: hidden; }+ .mp-lrow { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: #0a0a0a; transition: background .14s; }+ .mp-lrow:hover { background: rgba(255,255,255,.03); }+ .mp-rank { font-family: var(--font-mono, monospace); font-size: .78rem; color: rgba(255,255,255,.25); width: 24px; text-align: right; flex: 0 0 auto; }+ .mp-rank.top { color: rgba(255,255,255,.7); font-weight: 600; }+ .mp-av { width: 36px; height: 36px; border-radius: 3px; object-fit: cover; background: rgba(255,255,255,.06); flex: 0 0 auto; }.mp-lbody { flex: 1 1 auto; min-width: 0; }- .mp-lname { font-weight: 600; color: var(--ink-bright, #fff); font-size: var(--text-md, .9rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }+ .mp-lname { font-weight: 600; color: #fff; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.mp-lname a { color: inherit; text-decoration: none; }- .mp-lname a:hover { color: var(--wallet-accent, #c4b5fd); }- .mp-lstats { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 3px; font-size: var(--text-2xs, .68rem); color: var(--ink-dim, #9a9a9a); font-family: var(--font-mono, monospace); }- .mp-lstats .pos { color: var(--success, #4ade80); }- .mp-lstats .neg { color: var(--danger, #f87171); }- .mp-mirror-btn { flex: 0 0 auto; font: inherit; font-size: var(--text-2xs, .7rem); font-weight: 700; padding: 8px 16px; border-radius: var(--radius-pill, 999px); border: none; background: var(--wallet-accent, #c4b5fd); color: #1a1340; cursor: pointer; transition: background .15s; white-space: nowrap; }- .mp-mirror-btn:hover { background: var(--wallet-accent-strong, #a78bfa); }- .mp-mirror-btn:focus-visible { outline: 2px solid var(--wallet-focus, rgba(139,92,246,.7)); outline-offset: 2px; }- .mp-sk { height: 68px; border-radius: var(--radius-lg, 14px); background: linear-gradient(90deg, var(--surface-1, rgba(255,255,255,.03)) 25%, var(--surface-2, rgba(255,255,255,.05)) 50%, var(--surface-1, rgba(255,255,255,.03)) 75%); background-size: 200% 100%; animation: mp-sh 1.3s infinite; }- @keyframes mp-sh { from { background-position: 200% 0; } to { background-position: -200% 0; } }- .mp-empty { text-align: center; padding: var(--space-xl, 42px) var(--space-md, 16px); color: var(--ink-dim, #9a9a9a); font-size: var(--text-sm, .82rem); line-height: 1.6; }- .mp-empty strong { display: block; color: var(--ink-bright, #fff); font-family: var(--font-display, inherit); margin-bottom: 6px; }- .mp-agent-card { border: 1px solid var(--stroke, rgba(255,255,255,.08)); border-radius: var(--radius-lg, 14px); background: var(--surface-1, rgba(255,255,255,.025)); padding: var(--space-md, 16px); margin-bottom: var(--space-md, 16px); }- .mp-agent-head { display: flex; align-items: center; gap: 10px; margin-bottom: var(--space-sm, 12px); }+ .mp-lname a:hover { color: rgba(255,255,255,.7); }+ .mp-lstats { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 3px; font-size: .68rem; color: rgba(255,255,255,.3); font-family: var(--font-mono, monospace); }+ .mp-lstats .pos { color: rgba(255,255,255,.7); }+ .mp-lstats .neg { color: rgba(255,255,255,.35); }+ .mp-mirror-btn { flex: 0 0 auto; font: inherit; font-size: .7rem; font-weight: 600; padding: 7px 16px; border-radius: 3px; border: 1px solid rgba(255,255,255,.15); background: transparent; color: rgba(255,255,255,.7); cursor: pointer; transition: border-color .12s, color .12s, background .12s; white-space: nowrap; letter-spacing: .02em; }+ .mp-mirror-btn:hover { border-color: rgba(255,255,255,.4); color: #fff; background: rgba(255,255,255,.04); }+ .mp-mirror-btn:focus-visible { outline: 1px solid rgba(255,255,255,.4); outline-offset: 2px; }+ .mp-sk { height: 62px; background: rgba(255,255,255,.025); animation: mp-sh 1.4s infinite; }+ @keyframes mp-sh { 0%,100% { opacity: .6; } 50% { opacity: 1; } }+ .mp-empty { text-align: center; padding: 48px 16px; color: rgba(255,255,255,.3); font-size: .82rem; line-height: 1.6; }+ .mp-empty strong { display: block; color: rgba(255,255,255,.7); margin-bottom: 6px; font-weight: 500; }+ .mp-agent-card { border: 1px solid rgba(255,255,255,.07); border-radius: 4px; background: rgba(255,255,255,.02); padding: 16px; margin-bottom: 8px; }+ .mp-agent-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }.mp-agent-head .mp-lname { display: flex; flex-direction: column; gap: 4px; min-width: 0; }- .mp-agent-head .mp-lname a { font-size: var(--text-md, .95rem); }+ .mp-agent-head .mp-lname a { font-size: .92rem; }.mp-agent-chip { display: flex; }- .mp-signin { text-align: center; padding: var(--space-lg, 24px); border: 1px dashed var(--stroke-strong, rgba(255,255,255,.14)); border-radius: var(--radius-lg, 14px); color: var(--ink-dim, #9a9a9a); font-size: var(--text-sm, .82rem); }- .mp-signin a { color: var(--wallet-accent, #c4b5fd); font-weight: 600; text-decoration: none; }- .mp-safety { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: var(--space-md, 18px); }- .mp-safety span { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-2xs, .68rem); color: var(--ink-dim, #9a9a9a); }- .mp-safety b { color: var(--wallet-accent, #c4b5fd); }+ .mp-signin { text-align: center; padding: 24px; border: 1px solid rgba(255,255,255,.07); border-radius: 4px; color: rgba(255,255,255,.3); font-size: .82rem; }+ .mp-signin a { color: rgba(255,255,255,.7); font-weight: 500; text-decoration: none; }+ .mp-signin a:hover { color: #fff; }+ .mp-safety { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; margin-top: 20px; border-top: 1px solid rgba(255,255,255,.06); padding-top: 20px; }+ .mp-safety span { display: inline-flex; align-items: center; gap: 6px; font-size: .68rem; color: rgba(255,255,255,.3); letter-spacing: .02em; }+ .mp-safety b { color: rgba(255,255,255,.55); font-weight: 500; }+ .mp-divider { height: 1px; background: rgba(255,255,255,.06); margin: 48px 0 0; }</style></head><body>@@ -85,23 +89,23 @@<section class="mp-hero"><p class="mp-kicker"><span class="mp-live-dot" aria-hidden="true"></span> Leashed autonomy · live on-chain</p><h1 class="mp-title">Copy a character, not an address</h1>- <p class="mp-sub">Follow a high-performing agent and <b>your</b> agent mirrors its real trades — proportionally, and strictly inside your spend policy. The leader isn't an anonymous wallet; it's an ownable agent with a face, a voice, and a verifiable track record. Your avatar trades while you sleep — and you can stop it instantly.</p>+ <p class="mp-sub">Follow a high-performing agent and <b>your</b> agent mirrors its real trades — proportionally, and strictly inside your spend policy. The leader has a face, a voice, and a verifiable on-chain record. Your agent trades while you sleep — stop it anytime.</p><div class="mp-safety">- <span>🔒 <b>Spend-policy gated</b> — every trade</span>- <span>⚡ <b>Real on-chain</b> — no simulation</span>- <span>⛔ <b>Kill switch</b> — stop anytime</span>+ <span><b>Spend-policy gated</b> — every trade</span>+ <span><b>Real on-chain</b> — no simulation</span>+ <span><b>Kill switch</b> — stop anytime</span></div></section><section class="mp-section" id="mp-mine-section" hidden>- <h2>Your copy-trading</h2>- <p class="mp-desc">Manage which leaders your agents mirror. The leash — kill switch and per-trade caps — is right here.</p>+ <div class="mp-section-header"><h2>Your copy-trading</h2></div>+ <p class="mp-desc">Manage which leaders your agents mirror. Kill switch and per-trade caps are right here.</p><div id="mp-mine"></div></section><section class="mp-section">- <h2>Discover leaders</h2>- <p class="mp-desc">Ranked by a real, on-chain-derived track record — losers included. Every number traces to a transaction.</p>+ <div class="mp-section-header"><h2>Discover leaders</h2></div>+ <p class="mp-desc">Ranked by a real, on-chain track record — losers included. Every number traces to a transaction.</p><div class="mp-controls"><div class="mp-seg" role="tablist" aria-label="Sort leaders" id="mp-sort"><button data-sort="score" aria-pressed="true">Top</button>diff --git a/pages/strategies.html b/pages/strategies.htmlindex 038c8726d..3898b9935 100644--- a/pages/strategies.html+++ b/pages/strategies.html@@ -32,52 +32,52 @@body { background: var(--bg-0, #0a0a0a); color: var(--ink, #e8e8e8); margin: 0; font-family: var(--font-body, system-ui); }.sp-shell { max-width: 960px; margin: 0 auto; padding: var(--space-lg, 24px) var(--space-md, 16px) var(--space-2xl, 64px); }.sp-hero { text-align: center; padding: var(--space-xl, 42px) 0 var(--space-lg, 24px); }- .sp-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-2xs, .66rem); text-transform: uppercase; letter-spacing: .1em; color: var(--wallet-accent, #c4b5fd); margin: 0 0 12px; }- .sp-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success, #4ade80); box-shadow: 0 0 0 0 rgba(74,222,128,.5); animation: sp-pulse 1.8s ease infinite; }- @keyframes sp-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(74,222,128,.5); } 70% { box-shadow: 0 0 0 7px rgba(74,222,128,0); } }- .sp-title { font-family: var(--font-display, system-ui); font-size: clamp(1.8rem, 5vw, 2.8rem); margin: 0 0 12px; color: var(--ink-bright, #fff); letter-spacing: -.02em; }- .sp-sub { max-width: 640px; margin: 0 auto; font-size: var(--text-md, .95rem); line-height: 1.6; color: var(--ink-dim, #aaa); }- .sp-sub b { color: var(--wallet-accent, #c4b5fd); }+ .sp-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-2xs, .66rem); text-transform: uppercase; letter-spacing: .1em; color: #aaa; margin: 0 0 12px; }+ .sp-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,.4); animation: sp-pulse 1.8s ease infinite; }+ @keyframes sp-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,255,255,.4); } 70% { box-shadow: 0 0 0 7px rgba(255,255,255,0); } }+ .sp-title { font-family: var(--font-display, system-ui); font-size: clamp(1.8rem, 5vw, 2.8rem); margin: 0 0 12px; color: #fff; letter-spacing: -.02em; }+ .sp-sub { max-width: 640px; margin: 0 auto; font-size: var(--text-md, .95rem); line-height: 1.6; color: #aaa; }+ .sp-sub b { color: #fff; }.sp-safety { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: var(--space-md, 18px); }- .sp-safety span { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-2xs, .68rem); color: var(--ink-dim, #9a9a9a); }- .sp-safety b { color: var(--wallet-accent, #c4b5fd); }+ .sp-safety span { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-2xs, .68rem); color: #888; }+ .sp-safety b { color: #ccc; }.sp-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: var(--space-lg, 24px) 0 var(--space-md, 16px); }- .sp-seg { display: inline-flex; gap: 4px; background: var(--surface-1, rgba(255,255,255,.03)); padding: 4px; border-radius: var(--radius-pill, 999px); border: 1px solid var(--stroke, rgba(255,255,255,.08)); }- .sp-seg button { font: inherit; font-size: var(--text-2xs, .68rem); padding: 6px 14px; border-radius: 999px; border: none; background: transparent; color: var(--ink-dim, #aaa); cursor: pointer; transition: all .15s; }- .sp-seg button[aria-pressed="true"] { background: var(--wallet-accent, #c4b5fd); color: #1a1340; font-weight: 700; }+ .sp-seg { display: inline-flex; gap: 4px; background: rgba(255,255,255,.03); padding: 4px; border-radius: var(--radius-pill, 999px); border: 1px solid rgba(255,255,255,.1); }+ .sp-seg button { font: inherit; font-size: var(--text-2xs, .68rem); padding: 6px 14px; border-radius: 999px; border: none; background: transparent; color: #888; cursor: pointer; transition: all .15s; }+ .sp-seg button[aria-pressed="true"] { background: #fff; color: #0a0a0a; font-weight: 700; }.sp-spacer { flex: 1 1 auto; }- .sp-new { font: inherit; font-size: var(--text-2xs, .72rem); font-weight: 700; padding: 9px 16px; border-radius: var(--radius-pill, 999px); border: none; background: var(--wallet-accent, #c4b5fd); color: #1a1340; cursor: pointer; transition: background .15s; }- .sp-new:hover { background: var(--wallet-accent-strong, #a78bfa); }- .sp-new:focus-visible { outline: 2px solid var(--wallet-focus, rgba(139,92,246,.7)); outline-offset: 2px; }- .sp-search { flex: 1 1 180px; min-width: 140px; font: inherit; font-size: var(--text-sm, .82rem); padding: 8px 12px; border-radius: var(--radius-pill, 999px); border: 1px solid var(--stroke, rgba(255,255,255,.1)); background: var(--surface-1, rgba(255,255,255,.03)); color: var(--ink-bright, #fff); }- .sp-search:focus { outline: none; border-color: var(--wallet-stroke-strong, rgba(139,92,246,.5)); }+ .sp-new { font: inherit; font-size: var(--text-2xs, .72rem); font-weight: 700; padding: 9px 16px; border-radius: var(--radius-pill, 999px); border: none; background: #fff; color: #0a0a0a; cursor: pointer; transition: background .15s; }+ .sp-new:hover { background: #d4d4d4; }+ .sp-new:focus-visible { outline: 2px solid rgba(255,255,255,.5); outline-offset: 2px; }+ .sp-search { flex: 1 1 180px; min-width: 140px; font: inherit; font-size: var(--text-sm, .82rem); padding: 8px 12px; border-radius: var(--radius-pill, 999px); border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.03); color: #fff; }+ .sp-search:focus { outline: none; border-color: rgba(255,255,255,.35); }.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-md, 14px); }- .sp-card { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--stroke, rgba(255,255,255,.08)); border-radius: var(--radius-lg, 14px); background: var(--surface-1, rgba(255,255,255,.025)); padding: var(--space-md, 16px); transition: border-color .18s, transform .18s; }- .sp-card:hover { border-color: var(--wallet-stroke, rgba(139,92,246,.35)); transform: translateY(-1px); }+ .sp-card { display: flex; flex-direction: column; gap: 8px; border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius-lg, 14px); background: rgba(255,255,255,.025); padding: var(--space-md, 16px); transition: border-color .18s, transform .18s; }+ .sp-card:hover { border-color: rgba(255,255,255,.25); transform: translateY(-1px); }.sp-card-top { display: flex; align-items: flex-start; gap: 8px; }- .sp-card-name { flex: 1 1 auto; min-width: 0; font-family: var(--font-display, inherit); font-size: var(--text-md, 1rem); font-weight: 700; color: var(--ink-bright, #fff); }+ .sp-card-name { flex: 1 1 auto; min-width: 0; font-family: var(--font-display, inherit); font-size: var(--text-md, 1rem); font-weight: 700; color: #fff; }.sp-badge { flex: 0 0 auto; font-size: var(--text-2xs, .58rem); text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 999px; font-family: var(--font-mono, monospace); }- .sp-badge.proven { color: var(--success, #4ade80); background: rgba(74,222,128,.1); border: 1px solid rgba(74,222,128,.3); }- .sp-badge.unproven { color: var(--warn, #fbbf24); background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.25); }- .sp-desc { font-size: var(--text-xs, .74rem); color: var(--ink-dim, #aaa); line-height: 1.45; min-height: 1.4em; }- .sp-rules { font-size: var(--text-2xs, .66rem); color: var(--ink-dim, #9a9a9a); font-family: var(--font-mono, monospace); line-height: 1.5; }- .sp-stats { display: flex; gap: 12px; flex-wrap: wrap; font-family: var(--font-mono, monospace); font-size: var(--text-2xs, .68rem); color: var(--ink-dim, #9a9a9a); padding-top: 4px; border-top: 1px solid var(--stroke, rgba(255,255,255,.06)); }- .sp-stats .pos { color: var(--success, #4ade80); }- .sp-stats .neg { color: var(--danger, #f87171); }- .sp-meta { display: flex; align-items: center; gap: 8px; font-size: var(--text-2xs, .64rem); color: var(--ink-faint, #888); }- .sp-meta a { color: var(--ink-dim, #aaa); text-decoration: none; }- .sp-meta a:hover { color: var(--wallet-accent, #c4b5fd); }+ .sp-badge.proven { color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.3); }+ .sp-badge.unproven { color: #888; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12); }+ .sp-desc { font-size: var(--text-xs, .74rem); color: #aaa; line-height: 1.45; min-height: 1.4em; }+ .sp-rules { font-size: var(--text-2xs, .66rem); color: #888; font-family: var(--font-mono, monospace); line-height: 1.5; }+ .sp-stats { display: flex; gap: 12px; flex-wrap: wrap; font-family: var(--font-mono, monospace); font-size: var(--text-2xs, .68rem); color: #888; padding-top: 4px; border-top: 1px solid rgba(255,255,255,.06); }+ .sp-stats .pos { color: #e8e8e8; }+ .sp-stats .neg { color: #666; }+ .sp-meta { display: flex; align-items: center; gap: 8px; font-size: var(--text-2xs, .64rem); color: #666; }+ .sp-meta a { color: #aaa; text-decoration: none; }+ .sp-meta a:hover { color: #fff; }.sp-actions { display: flex; gap: 6px; margin-top: 2px; }- .sp-btn { flex: 1; font: inherit; font-size: var(--text-2xs, .7rem); padding: 8px 10px; border-radius: var(--radius-sm, 8px); border: 1px solid var(--stroke-strong, rgba(255,255,255,.14)); background: var(--surface-2, rgba(255,255,255,.05)); color: var(--ink, #e8e8e8); cursor: pointer; transition: all .16s; white-space: nowrap; }- .sp-btn:hover { border-color: var(--wallet-stroke-strong, rgba(139,92,246,.5)); color: #fff; }- .sp-btn:focus-visible { outline: 2px solid var(--wallet-focus, rgba(139,92,246,.7)); outline-offset: 2px; }- .sp-btn-primary { background: var(--wallet-accent, #c4b5fd); color: #1a1340; border-color: transparent; font-weight: 700; }- .sp-btn-primary:hover { background: var(--wallet-accent-strong, #a78bfa); }- .sp-sk { height: 168px; border-radius: var(--radius-lg, 14px); background: linear-gradient(90deg, var(--surface-1, rgba(255,255,255,.03)) 25%, var(--surface-2, rgba(255,255,255,.05)) 50%, var(--surface-1, rgba(255,255,255,.03)) 75%); background-size: 200% 100%; animation: sp-sh 1.3s infinite; }+ .sp-btn { flex: 1; font: inherit; font-size: var(--text-2xs, .7rem); padding: 8px 10px; border-radius: var(--radius-sm, 8px); border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); color: #e8e8e8; cursor: pointer; transition: all .16s; white-space: nowrap; }+ .sp-btn:hover { border-color: rgba(255,255,255,.35); color: #fff; }+ .sp-btn:focus-visible { outline: 2px solid rgba(255,255,255,.5); outline-offset: 2px; }+ .sp-btn-primary { background: #fff; color: #0a0a0a; border-color: transparent; font-weight: 700; }+ .sp-btn-primary:hover { background: #d4d4d4; }+ .sp-sk { height: 168px; border-radius: var(--radius-lg, 14px); background: linear-gradient(90deg, rgba(255,255,255,.03) 25%, rgba(255,255,255,.05) 50%, rgba(255,255,255,.03) 75%); background-size: 200% 100%; animation: sp-sh 1.3s infinite; }@keyframes sp-sh { from { background-position: 200% 0; } to { background-position: -200% 0; } }- .sp-empty { grid-column: 1 / -1; text-align: center; padding: var(--space-xl, 42px) var(--space-md, 16px); color: var(--ink-dim, #9a9a9a); font-size: var(--text-sm, .82rem); line-height: 1.6; }- .sp-empty strong { display: block; color: var(--ink-bright, #fff); font-family: var(--font-display, inherit); margin-bottom: 6px; }- .sp-rank { position: absolute; top: -8px; left: -8px; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono, monospace); font-size: var(--text-2xs, .66rem); font-weight: 700; background: var(--wallet-accent, #c4b5fd); color: #1a1340; box-shadow: var(--shadow-1, 0 2px 8px rgba(0,0,0,.4)); }+ .sp-empty { grid-column: 1 / -1; text-align: center; padding: var(--space-xl, 42px) var(--space-md, 16px); color: #888; font-size: var(--text-sm, .82rem); line-height: 1.6; }+ .sp-empty strong { display: block; color: #fff; font-family: var(--font-display, inherit); margin-bottom: 6px; }+ .sp-rank { position: absolute; top: -8px; left: -8px; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono, monospace); font-size: var(--text-2xs, .66rem); font-weight: 700; background: #fff; color: #0a0a0a; box-shadow: 0 2px 8px rgba(0,0,0,.4); }.sp-card { position: relative; }</style>@@ -97,10 +97,10 @@<h1 class="sp-title">Equip a strategy, not a spreadsheet</h1><p class="sp-sub">A Strategy Object is a real, rule-based plan — entry conditions, sizing, take-profit, stop-loss — made into a <b>thing you own</b>. Equip it on your agent and it trades for real, on-chain, strictly inside your spend policy. Publish yours, fork the best, and watch the leaderboard rank them by <b>verified live performance</b> — numbers no one can fake.</p><div class="sp-safety">- <span>🔒 <b>Spend-policy gated</b> — every trade</span>- <span>⚡ <b>Real on-chain</b> — no backtested fiction</span>- <span>🍴 <b>Forkable</b> — rules only, never wallet access</span>- <span>⛔ <b>Kill switch</b> — halt all at once</span>+ <span><b>Spend-policy gated</b> — every trade</span>+ <span><b>Real on-chain</b> — no backtested fiction</span>+ <span><b>Forkable</b> — rules only, never wallet access</span>+ <span><b>Kill switch</b> — halt all at once</span></div></section>diff --git a/src/mirror.js b/src/mirror.jsindex f3c03fb8e..8d76d06dd 100644--- a/src/mirror.js+++ b/src/mirror.js@@ -35,7 +35,7 @@ function leaderRow(l) {<div class="mp-lname"><a href="/agent/${esc(l.agent_id)}">${esc(l.name || short(l.agent_id))}</a></div><div class="mp-lstats">${stats}</div></div>- <button class="mp-mirror-btn" data-id="${esc(l.agent_id)}" data-name="${esc(l.name || '')}">⚡ Mirror</button>+ <button class="mp-mirror-btn" data-id="${esc(l.agent_id)}" data-name="${esc(l.name || '')}">Mirror</button></div>`;}@@ -46,7 +46,7 @@ async function loadBoard() {if (!res.ok) throw new Error('load failed');const leaders = (await res.json()).data?.leaders || [];if (!leaders.length) {- board.innerHTML = `<div class="mp-empty"><strong>No leaders yet</strong>Once agents start trading, the best ones rank here by their real track record. <a href="/create-agent" style="color:var(--wallet-accent,#c4b5fd)">Launch a trader →</a></div>`;+ board.innerHTML = `<div class="mp-empty"><strong>No leaders yet</strong>Once agents start trading, the best ones rank here by their real track record. <a href="/create-agent" style="color:rgba(255,255,255,.6);text-decoration:underline">Launch a trader →</a></div>`;return;}board.innerHTML = leaders.map(leaderRow).join('');@@ -80,11 +80,11 @@ async function mirrorLeader(leaderId, leaderName) {// Multi-agent picker.const back = document.createElement('div');back.style.cssText = 'position:fixed;inset:0;background:rgba(0,0,0,.66);backdrop-filter:blur(4px);z-index:9998;display:flex;align-items:center;justify-content:center;padding:16px';- back.innerHTML = `<div style="width:min(420px,96vw);background:var(--bg-1,#141414);border:1px solid var(--wallet-stroke,rgba(139,92,246,.3));border-radius:14px;padding:22px">- <h3 style="margin:0 0 4px;font-family:var(--font-display,inherit);color:var(--ink-bright,#fff)">Which agent should mirror?</h3>- <p style="font-size:.72rem;color:var(--ink-dim,#9a9a9a);margin:0 0 14px">Pick the agent whose wallet copies ${esc(leaderName || 'this leader')}.</p>- <div style="display:flex;flex-direction:column;gap:6px">${candidates.map((a) => `<button type="button" data-id="${esc(a.id)}" data-name="${esc(a.name || '')}" style="display:flex;align-items:center;gap:10px;text-align:left;padding:10px;border-radius:10px;border:1px solid var(--stroke,rgba(255,255,255,.08));background:var(--surface-1,rgba(255,255,255,.03));color:var(--ink,#ddd);cursor:pointer">${a.avatar_url || a.profile_image_url ? `<img loading="lazy" decoding="async" src="${esc(a.avatar_url || a.profile_image_url)}" style="width:32px;height:32px;border-radius:50%;object-fit:cover">` : '<span style="width:32px;height:32px;border-radius:50%;background:var(--surface-2,rgba(255,255,255,.05));display:inline-block"></span>'}<span style="font-weight:600;color:var(--ink-bright,#fff)">${esc(a.name || short(a.id))}</span></button>`).join('')}</div>- <div style="text-align:right;margin-top:14px"><button id="mp-pf-cancel" style="font:inherit;font-size:.8rem;padding:8px 16px;border-radius:8px;border:1px solid var(--stroke-strong,rgba(255,255,255,.14));background:transparent;color:var(--ink,#ddd);cursor:pointer">Cancel</button></div>+ back.innerHTML = `<div style="width:min(400px,96vw);background:#111;border:1px solid rgba(255,255,255,.1);border-radius:4px;padding:22px">+ <h3 style="margin:0 0 4px;font-family:var(--font-display,inherit);font-size:1rem;color:#fff;font-weight:600;letter-spacing:-.01em">Which agent should mirror?</h3>+ <p style="font-size:.75rem;color:rgba(255,255,255,.35);margin:0 0 16px;line-height:1.5">Pick the agent whose wallet copies ${esc(leaderName || 'this leader')}.</p>+ <div style="display:flex;flex-direction:column;gap:1px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.06);border-radius:3px;overflow:hidden">${candidates.map((a) => `<button type="button" data-id="${esc(a.id)}" data-name="${esc(a.name || '')}" style="display:flex;align-items:center;gap:10px;text-align:left;padding:11px 12px;border:none;background:#111;color:#fff;cursor:pointer;transition:background .12s">${a.avatar_url || a.profile_image_url ? `<img loading="lazy" decoding="async" src="${esc(a.avatar_url || a.profile_image_url)}" style="width:30px;height:30px;border-radius:3px;object-fit:cover;flex:0 0 auto">` : '<span style="width:30px;height:30px;border-radius:3px;background:rgba(255,255,255,.06);display:inline-block;flex:0 0 auto"></span>'}<span style="font-weight:500;color:#fff;font-size:.85rem">${esc(a.name || short(a.id))}</span></button>`).join('')}</div>+ <div style="text-align:right;margin-top:14px"><button id="mp-pf-cancel" style="font:inherit;font-size:.78rem;padding:7px 16px;border-radius:3px;border:1px solid rgba(255,255,255,.12);background:transparent;color:rgba(255,255,255,.5);cursor:pointer;transition:color .12s,border-color .12s">Cancel</button></div></div>`;const close = () => back.remove();back.addEventListener('click', (e) => { if (e.target === back) close(); });