Skip to content

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.

fix(routes): finish the /agent/:id to /agents/:id rename across tests and views

nirholas07f79d6f31c1
diff --git a/api/agent-oembed.js b/api/agent-oembed.js
index d160dcffc..40811ecec 100644
--- a/api/agent-oembed.js
+++ b/api/agent-oembed.js
@@ -4,7 +4,7 @@
* GET /api/oembed?url=<agent-or-forge-share-url>[&format=json|xml]
*
* Implements https://oembed.com with type=rich. The html payload is a
- * sandboxed iframe — /agent/:id/embed for agents, /forge/embed?src=<glb> for
+ * sandboxed iframe — /agents/:id/embed for agents, /forge/embed?src=<glb> for
* Forge creations — so consumers (Notion, Discord, etc.) can render the model
* inline just by pasting the shareUrl.
*/
@@ -105,7 +105,7 @@ function extractAgentId(target) {
originStr === env.APP_ORIGIN || /^https?:\/\/localhost(:\d+)?$/.test(originStr);
if (!okOrigin) return null;
- const match = parsed.pathname.match(/^\/agent\/([A-Za-z0-9_-]+)\/?$/);
+ const match = parsed.pathname.match(/^\/agents?\/([A-Za-z0-9_-]+)\/?$/);
const id = match ? match[1] : null;
// agent_identities.id is a uuid column, so a non-uuid slug reached Postgres as
// an uncastable literal and came back as an unhandled 500. Treat it the same
diff --git a/pages/agent-embed.html b/pages/agent-embed.html
index 623470a41..325cc46ef 100644
--- a/pages/agent-embed.html
+++ b/pages/agent-embed.html
@@ -139,7 +139,7 @@
// 3. ?id={id} (any path — explicit override)
const agentId = (() => {
const parts = location.pathname.split('/').filter(Boolean);
- const idx = parts.indexOf('agent');
+ const idx = parts.findIndex((p) => p === 'agents' || p === 'agent');
if (idx !== -1 && parts[idx + 1] && parts[idx + 1] !== 'embed') {
return parts[idx + 1];
}
diff --git a/pages/avatar-page.html b/pages/avatar-page.html
index fdd5c0cde..8987e069a 100644
--- a/pages/avatar-page.html
+++ b/pages/avatar-page.html
@@ -1295,6 +1295,11 @@
color: var(--warn);
border-color: rgba(251, 191, 36, 0.4);
}
+ .av-row-slug {
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
+ font-size: 11px;
+ color: var(--text-3);
+ }
.av-cap-more {
display: inline-block;
margin-top: 6px;
diff --git a/public/changelog.json b/public/changelog.json
index 88f516672..f5b301e3c 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-08-19T01:16:16.983Z",
+ "generated_at": "2026-08-19T01:21:08.518Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
diff --git a/public/features.json b/public/features.json
index c13d5a531..95dd21e22 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-08-19T01:09:35.715Z",
+ "generated_at": "2026-08-19T01:21:08.490Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/src/agent-detail.js b/src/agent-detail.js
index 1afbaf16e..0b506f18a 100644
--- a/src/agent-detail.js
+++ b/src/agent-detail.js
@@ -1010,7 +1010,7 @@ function render(agent) {
// Register the shared royalty panel so the avatar-actions royalty chips open
// the rich in-page ledger (rather than navigating away), and honor a
- // /agent/:id#royalties deep link by opening it directly.
+ // /agents/:id#royalties deep link by opening it directly.
import('./shared/agent-fork-royalty.js')
.then((rty) => {
if (location.hash === '#royalties' && agent.id) {
@@ -1314,7 +1314,7 @@ function render(agent) {
id: agent.id,
title: agent.name || 'Agent',
description: agent.description || '',
- shareUrl: `${location.origin}/agent/${agent.id}/share`,
+ shareUrl: `${location.origin}/agents/${agent.id}/share`,
remixUrl: `${location.origin}/agents/${agent.id}`,
previewImage: `${location.origin}/api/og/agent?id=${encodeURIComponent(agent.id)}`,
}, shareTrigger);
@@ -2653,7 +2653,7 @@ function renderEmbedPolicy(p) {
function wireShareButton(agent) {
const origin = location.origin;
- const shareUrl = `${origin}/agent/${agent.id}/share`;
+ const shareUrl = `${origin}/agents/${agent.id}/share`;
const remixUrl = `${origin}/create`;
// Per-agent share template assembled from the agent's real capabilities:
// a tweet that says what this agent actually has, not a generic title drop.
@@ -2869,7 +2869,7 @@ function bindWalletActions(agent) {
// AGENT HOLDINGS shows the agent's custodial Solana address + balance as
// read-only info for everyone. Funding, trading, paying, and withdrawing the
// agent's OWN custodial wallet all live in one place — the Agent Wallet hub
- // (/agent/:id/wallet) — so this card just links there for the owner. The hub
+ // (/agents/:id/wallet) — so this card just links there for the owner. The hub
// owns every wallet action; the detail page no longer re-implements them.
const actions = document.getElementById('ad-holdings-actions');
if (!actions) return;
@@ -2891,19 +2891,19 @@ function bindWalletActions(agent) {
actions.innerHTML = '';
const manage = document.createElement('a');
manage.className = 'ad-btn ad-btn-primary';
- manage.href = `/agent/${encodeURIComponent(agentId)}/wallet`;
+ manage.href = `/agents/${encodeURIComponent(agentId)}/wallet`;
manage.textContent = 'Manage wallet';
manage.setAttribute('aria-label', 'Open this agent’s wallet hub');
const deposit = document.createElement('a');
deposit.className = 'ad-btn';
- deposit.href = `/agent/${encodeURIComponent(agentId)}/wallet#deposit`;
+ deposit.href = `/agents/${encodeURIComponent(agentId)}/wallet#deposit`;
deposit.textContent = 'Deposit';
// Opt-in vanity: grind a custom address for this agent's custodial wallet.
const meta = agent?.rawMetadata?.meta || {};
const isVanity = !!(meta.solana_vanity_prefix || meta.solana_vanity_suffix);
const vanity = document.createElement('a');
vanity.className = 'ad-btn';
- vanity.href = `/agent/${encodeURIComponent(agentId)}/wallet#vanity`;
+ vanity.href = `/agents/${encodeURIComponent(agentId)}/wallet#vanity`;
vanity.textContent = isVanity ? '✦ Vanity address' : '✦ Make it vanity';
vanity.setAttribute('aria-label', 'Grind a custom vanity address for this agent wallet');
actions.append(manage, deposit, vanity);
@@ -3006,7 +3006,7 @@ export function normalize(rec, avatar) {
services.push({
type: 'a2a',
version: meta.a2a_version || '0.3.0',
- url: `${location.origin}/agent/${rec.id}`,
+ url: `${location.origin}/agents/${rec.id}`,
skills: rec.skills
.map((s) => (typeof s === 'string' ? s : s.name || s.id))
.filter(Boolean),
@@ -3239,6 +3239,6 @@ async function loadPlatformBar() {
}
// Only auto-run when the route actually carries an agent id. In the browser the
-// /agents/:id (and /agent/:id) route always does; importing this module without
+// /agents/:id (and /agents/:id) route always does; importing this module without
// one (e.g. a unit test of normalize()) is a no-op rather than a stray fetch.
if (id) runLoad();
diff --git a/src/agent-edit.js b/src/agent-edit.js
index 32c80c6f7..3603f453c 100644
--- a/src/agent-edit.js
+++ b/src/agent-edit.js
@@ -15,7 +15,7 @@ import './agents/mood-embodiment.js';
const API_BASE = '/api';
const params = new URLSearchParams(location.search);
-// Resolve agent id from the canonical clean URL /agent/<uuid>(/edit)?, falling
+// Resolve agent id from the canonical clean URL /agents/<uuid>(/edit)?, falling
// back to the legacy /agent-edit.html?id=<uuid> querystring form. Kept as a
// `let` so it can be reassigned after the create-from-avatar flow mints a real
// agent — every fetch below uses this value, so the URL must stay the source
@@ -23,8 +23,8 @@ const params = new URLSearchParams(location.search);
const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
function resolveAgentIdFromUrl() {
const seg = location.pathname.split('/').filter(Boolean);
- // /agent/<id>(/edit)? → seg = ['agent', '<id>', 'edit'?]
- if (seg[0] === 'agent' && seg[1] && UUID_RE.test(seg[1])) return seg[1];
+ // /agents/<id>(/edit)? or legacy /agent/<id>(/edit)? → seg = ['agents', '<id>', 'edit'?]
+ if ((seg[0] === 'agents' || seg[0] === 'agent') && seg[1] && UUID_RE.test(seg[1])) return seg[1];
const qid = params.get('id');
return qid && UUID_RE.test(qid) ? qid : null;
}
@@ -100,7 +100,7 @@ async function createDraftAgent() {
}
}
- history.replaceState({}, '', `/agent/${agent.id}/edit`);
+ history.replaceState({}, '', `/agents/${agent.id}/edit`);
agentId = agent.id;
agentData = agent;
if (initAvatarName) {
@@ -1930,7 +1930,7 @@ function renderMemories(rows) {
}
// Every autopilot receipt cites the memories that motivated it and links here as
-// /agent/<id>/edit?tab=knowledge#mem-<memoryId>. The list renders after the
+// /agents/<id>/edit?tab=knowledge#mem-<memoryId>. The list renders after the
// browser has already resolved the fragment, so nothing scrolled and the cited
// memory was indistinguishable from the rest: bring it into view and mark it.
function revealCitedMemory() {
@@ -2663,8 +2663,8 @@ function parseSize(token) {
function updateEmbedPreview() {
const { w, h } = parseSize($('embed-size').value);
const origin = embedOrigin();
- const embedUrl = `${origin}/agent/${agentId}/embed`;
- const pageUrl = `${origin}/agent/${agentId}`;
+ const embedUrl = `${origin}/agents/${agentId}/embed`;
+ const pageUrl = `${origin}/agents/${agentId}`;
const oembedUrl = `${origin}/api/oembed?url=${encodeURIComponent(pageUrl)}`;
const iframeAttrs = `src="${embedUrl}" width="${w}" height="${h}" frameborder="0" allow="microphone; autoplay; clipboard-write" style="border:0;border-radius:12px;background:#000"`;
@@ -2851,7 +2851,7 @@ function ensureStudioTab() {
const origin = embedOrigin();
$('studio-playground').href = `/playground?agent_id=${encodeURIComponent(agentId)}`;
$('studio-avatar').href = agentData.avatar_id ? `/avatars/${encodeURIComponent(agentData.avatar_id)}` : '/dashboard/#avatars';
- $('studio-public').href = `/agent/${agentId}`;
+ $('studio-public').href = `/agents/${agentId}`;
$('studio-manifest').href = `${origin}/api/agents/${agentId}/manifest`;
const anims = agentData.meta?.animations || [];
@@ -3258,13 +3258,13 @@ async function ensureOwnershipTab() {
}
// Mind Palace — the agent's memory as a navigable spatial scene with the live
-// avatar at its core. Mounts the same module the standalone /agent/:id/mind
+// avatar at its core. Mounts the same module the standalone /agents/:id/mind
// route uses; the empty state can ask the editor to jump to the Knowledge tab.
let mindMounted = false;
let mindController = null;
async function ensureMindTab() {
const link = $('mind-fullscreen-link');
- if (link && agentId) link.href = `/agent/${agentId}/mind`;
+ if (link && agentId) link.href = `/agents/${agentId}/mind`;
if (mindMounted || !agentId) return;
mindMounted = true;
const host = $('mind-palace-host');
diff --git a/src/agent-mind.js b/src/agent-mind.js
index a5a1baebc..08cdc1293 100644
--- a/src/agent-mind.js
+++ b/src/agent-mind.js
@@ -1,4 +1,4 @@
-// Standalone Mind Palace route — /agent/:id/mind.
+// Standalone Mind Palace route — /agents/:id/mind.
//
// Resolves the agent from the URL, wires the header, and mounts the same
// mountMindPalace() surface the editor's Mind tab uses. The Palace itself owns
@@ -15,8 +15,8 @@ const titleEl = document.getElementById('mind-title');
const backEl = document.getElementById('mind-back');
function agentIdFromPath() {
- // /agent/:id/mind (also tolerate a trailing slash or ?id= override)
- const m = location.pathname.match(/^\/agent\/([^/]+)\/mind\/?$/);
+ // /agents/:id/mind (also tolerate a trailing slash or ?id= override)
+ const m = location.pathname.match(/^\/agents?\/([^/]+)\/mind\/?$/);
if (m) return decodeURIComponent(m[1]);
const q = new URLSearchParams(location.search).get('id') || new URLSearchParams(location.search).get('agentId');
return q || null;
@@ -54,7 +54,7 @@ async function init() {
const name = agent.name || 'Your agent';
titleEl.textContent = `${name} · Mind Palace`;
document.title = `${name}'s Mind — three.ws`;
- if (backEl) backEl.href = `/agent/${agent.id}/edit`;
+ if (backEl) backEl.href = `/agents/${agent.id}/edit`;
// Make this the active agent so the site-wide companion + HUD follow it.
setActiveAgent(agent.id).catch(() => {});
diff --git a/src/agent-wallet.js b/src/agent-wallet.js
index 4d71074fd..619f94feb 100644
--- a/src/agent-wallet.js
+++ b/src/agent-wallet.js
@@ -1,7 +1,7 @@
/**
* Agent Wallet hub: page entry.
*
- * Routes: /agent/:id/wallet and /agents/:id/wallet (agent named in the path),
+ * Routes: /agents/:id/wallet and /agents/:id/wallet (agent named in the path),
* plus /agent-wallet with an optional ?id=<uuid>.
*
* When no agent is named, the page resolves the signed-in user's own agents
@@ -21,7 +21,7 @@ const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
function resolveAgentId() {
const fromQuery = new URLSearchParams(location.search).get('id');
if (fromQuery) return fromQuery;
- // /agent/:id/wallet or /agents/:id/wallet
+ // /agents/:id/wallet or /agents/:id/wallet
const m = location.pathname.match(/\/agents?\/([^/]+)\/wallet/);
return m ? decodeURIComponent(m[1]) : null;
}
@@ -106,7 +106,7 @@ function renderPicker(agents) {
? `${addr.slice(0, 4)}…${addr.slice(-4)}`
: 'Wallet is being prepared';
return `<li>
- <a class="awh-pick-row" href="/agent/${encodeURIComponent(a.id)}/wallet">
+ <a class="awh-pick-row" href="/agents/${encodeURIComponent(a.id)}/wallet">
${
a.avatar_thumbnail_url
? `<img class="awh-pick-av" src="${escapeHtml(a.avatar_thumbnail_url)}" alt="" loading="lazy" />`
diff --git a/src/autopilot-activity.js b/src/autopilot-activity.js
index d8992faeb..cb5dd7151 100644
--- a/src/autopilot-activity.js
+++ b/src/autopilot-activity.js
@@ -187,9 +187,9 @@ function wireUndo(scope) {
// It's carried on the receipt row's source links; fall back to the filter.
function resolveAgentForUndo(btn) {
const row = btn.closest('.apm-receipt');
- const link = row?.querySelector('a.apm-source[href*="/agent/"]');
+ const link = row?.querySelector('a.apm-source[href*="/agents/"], a.apm-source[href*="/agent/"]');
if (link) {
- const m = link.getAttribute('href').match(/\/agent\/([0-9a-f-]{36})/i);
+ const m = link.getAttribute('href').match(/\/agents?\/([0-9a-f-]{36})/i);
if (m) return m[1];
}
return agentFilter;
diff --git a/src/theater.js b/src/theater.js
index 6361e29f6..8cbbf0c86 100644
--- a/src/theater.js
+++ b/src/theater.js
@@ -184,7 +184,7 @@ function buildMirror(leaderId, leaderName) {
if (!mine.length) {
wrap.replaceChildren(el('p', { class: 'th-panel-foot th-muted' }, [
'Copying a trader needs one of your own agents with a wallet. ',
- el('a', { href: '/agent/me', text: 'Create one →' }),
+ el('a', { href: '/agent/new', text: 'Create one →' }),
]));
return;
}
@@ -202,7 +202,7 @@ function buildMirror(leaderId, leaderName) {
const name = mine.find((a) => a.id === follower)?.name || 'Your agent';
wrap.replaceChildren(el('p', { class: 'th-mirror-ok' }, [
`✓ ${name} now copies ${leaderName || 'this trader'}. `,
- el('a', { href: `/agent/${follower}`, text: 'Manage mirror →' }),
+ el('a', { href: `/agents/${follower}`, text: 'Manage mirror →' }),
]));
} catch (e) {
submit.disabled = false; submit.textContent = 'Start mirroring';
@@ -616,8 +616,8 @@ export function initTheater(root) {
onClick: () => toggleWatch(id),
text: watching ? '★ Watching' : '☆ Watch',
}),
- el('a', { class: 'th-btn', href: `/agent/${id}/wallet#reputation`, text: 'Wallet & positions' }),
- el('a', { class: 'th-btn th-btn-primary', href: `/agent/${id}`, text: isOwner ? 'Manage agent' : 'Open profile' }),
+ el('a', { class: 'th-btn', href: `/agents/${id}/wallet#reputation`, text: 'Wallet & positions' }),
+ el('a', { class: 'th-btn th-btn-primary', href: `/agents/${id}`, text: isOwner ? 'Manage agent' : 'Open profile' }),
]),
isOwner
? el('p', { class: 'th-panel-foot th-muted', text: 'This agent is yours — act from its profile.' })
@@ -626,12 +626,12 @@ export function initTheater(root) {
buildMirror(id, agent.name),
el('p', { class: 'th-panel-foot th-muted' }, [
'Or ',
- el('a', { href: `/agent/${id}`, text: 'open its profile' }),
+ el('a', { href: `/agents/${id}`, text: 'open its profile' }),
' to fork it to your own wallet.',
]),
])
: el('p', { class: 'th-panel-foot th-muted' }, [
- el('a', { href: `/login?next=${encodeURIComponent(`/agent/${id}`)}`, text: 'Sign in' }),
+ el('a', { href: `/login?next=${encodeURIComponent(`/agents/${id}`)}`, text: 'Sign in' }),
' to copy this agent to your own wallet or follow its alpha. Watching is always free.',
]),
recentForAgent(id),
diff --git a/src/walk-companion-transitions.js b/src/walk-companion-transitions.js
index 69c0e0e90..e02916c8c 100644
--- a/src/walk-companion-transitions.js
+++ b/src/walk-companion-transitions.js
@@ -277,6 +277,7 @@ async function softGlowFade(fromEl, toEl) {
export const PRESETS = [
{ pattern: '/walk', preset: cameraZoomIntoAvatar, name: 'camera-zoom-into-avatar' },
{ pattern: '/pricing', preset: curtainPull, name: 'curtain-pull' },
+ { pattern: '/agents/*', preset: spotlightExpand, name: 'spotlight-expand' },
{ pattern: '/agent/*', preset: spotlightExpand, name: 'spotlight-expand' },
{ pattern: '/marketplace', preset: corridorDepthZoom, name: 'corridor-depth-zoom' },
{ pattern: '/dashboard', preset: softGlowFade, name: 'soft-glow-fade' },
diff --git a/tests/agent-economy-platform.test.js b/tests/agent-economy-platform.test.js
index edb13f479..7c4e0d6f7 100644
--- a/tests/agent-economy-platform.test.js
+++ b/tests/agent-economy-platform.test.js
@@ -75,7 +75,7 @@ describe('platformEconomyStats', () => {
// Public provider keeps its profile URL + resolves a thumbnail; private one
// is gated to no URL and no leaked avatar.
- expect(r.top_providers[0]).toMatchObject({ agent_id: 'p1', name: 'Oracle', url: '/agent/p1', earned_usd: 800, hires: 200, avg_rating: 4.6 });
+ expect(r.top_providers[0]).toMatchObject({ agent_id: 'p1', name: 'Oracle', url: '/agents/p1', earned_usd: 800, hires: 200, avg_rating: 4.6 });
expect(r.top_providers[0].avatar_thumbnail_url).toBe('https://cdn.test/thumb/p1.png');
expect(r.top_providers[1].url).toBe(null);
expect(r.top_providers[1].avatar_thumbnail_url).toBe(null);
@@ -89,7 +89,7 @@ describe('platformEconomyStats', () => {
});
// The feed links an agent exactly when the row says it is linkable (alive
// and public), so a private or deleted agent is named but not linked.
- expect(r.recent[0].hirer).toEqual({ agent_id: 'h1', name: 'Trader', url: '/agent/h1' });
+ expect(r.recent[0].hirer).toEqual({ agent_id: 'h1', name: 'Trader', url: '/agents/h1' });
expect(r.recent[0].provider).toEqual({ agent_id: 'p1', name: 'Oracle', url: null });
});
diff --git a/tests/agent-wallet-vanity.test.js b/tests/agent-wallet-vanity.test.js
index f31790f0d..bca389b43 100644
--- a/tests/agent-wallet-vanity.test.js
+++ b/tests/agent-wallet-vanity.test.js
@@ -72,7 +72,7 @@ describe('getWalletStatus / wallet chip', () => {
it('renders an owner make-vanity entry point only for non-vanity owner wallets', () => {
const ownerPlain = walletChipHTML({ id: 'agent-1', solana_address: PLAIN }, { isOwner: true });
- expect(ownerPlain).toContain('/agent/agent-1/wallet#vanity');
+ expect(ownerPlain).toContain('/agents/agent-1/wallet#vanity');
expect(ownerPlain).toContain('data-twc-copy');
const ownerVanity = walletChipHTML({ id: 'agent-1', solana_address: VANITY, solana_vanity_prefix: 'agnt' }, { isOwner: true });
diff --git a/tests/api/agent-oembed.test.js b/tests/api/agent-oembed.test.js
index c80e54bd8..81070f83d 100644
--- a/tests/api/agent-oembed.test.js
+++ b/tests/api/agent-oembed.test.js
@@ -54,13 +54,21 @@ beforeEach(() => {
});
describe('agent target', () => {
- it('resolves /agent/:id into a rich oEmbed payload', async () => {
+ it('resolves the canonical /agents/:id url into a rich oEmbed payload', async () => {
sqlState.queue = [[{ id: AGENT_ID, name: 'Nova', description: 'guide', avatar_id: null }]];
- const { status, body } = await get(`https://three.ws/agent/${AGENT_ID}`);
+ const { status, body } = await get(`https://three.ws/agents/${AGENT_ID}`);
expect(status).toBe(200);
expect(body.type).toBe('rich');
expect(body.title).toBe('Nova');
- expect(body.html).toContain(`https://three.ws/agent/${AGENT_ID}/embed`);
+ expect(body.html).toContain(`https://three.ws/agents/${AGENT_ID}/embed`);
+ });
+
+ it('still resolves the legacy /agent/:id url shape', async () => {
+ sqlState.queue = [[{ id: AGENT_ID, name: 'Nova', description: 'guide', avatar_id: null }]];
+ const { status, body } = await get(`https://three.ws/agent/${AGENT_ID}`);
+ expect(status).toBe(200);
+ expect(body.type).toBe('rich');
+ expect(body.html).toContain(`https://three.ws/agents/${AGENT_ID}/embed`);
});
});
diff --git a/tests/api/agents-sub-resources.test.js b/tests/api/agents-sub-resources.test.js
index 240021acd..7b99fc3fe 100644
--- a/tests/api/agents-sub-resources.test.js
+++ b/tests/api/agents-sub-resources.test.js
@@ -141,7 +141,7 @@ describe('_sub.js handleManifest', () => {
expect(json.id).toBe(AGENT_ID);
expect(json.name).toBe('Probe Agent');
expect(json.skills).toEqual(['chat']);
- expect(json.homeUrl).toContain(`/agent/${AGENT_ID}`);
+ expect(json.homeUrl).toContain(`/agents/${AGENT_ID}`);
// No voice row configured: the manifest still names a provider so an embed
// always has something to fall back to.
expect(json.voice.provider).toBe('browser');
diff --git a/tests/api/mcp-embed.test.js b/tests/api/mcp-embed.test.js
index a0f564b27..50a54aee1 100644
--- a/tests/api/mcp-embed.test.js
+++ b/tests/api/mcp-embed.test.js
@@ -145,10 +145,10 @@ describe('agent embed', () => {
expect(body.error).toBeUndefined();
const sc = body.result.structuredContent;
expect(sc.ok).toBe(true);
- expect(sc.embed_html).toContain(`https://three.ws/agent/${AGENT_ID}/embed`);
+ expect(sc.embed_html).toContain(`https://three.ws/agents/${AGENT_ID}/embed`);
expect(sc.embed_html).toContain('width="640"');
expect(sc.embed_html).toContain('height="480"');
- expect(sc.share_url).toBe(`https://three.ws/agent/${AGENT_ID}`);
+ expect(sc.share_url).toBe(`https://three.ws/agents/${AGENT_ID}`);
expect(sc.oembed_url).toContain('/api/oembed?url=');
expect(sc.thumbnail_url).toBe(`https://three.ws/api/agent/${AGENT_ID}/og`);
// Live-preview artifact for HTML-rendering clients.
diff --git a/tests/conversions-page.test.js b/tests/conversions-page.test.js
index f5cee95d2..1c43f2527 100644
--- a/tests/conversions-page.test.js
+++ b/tests/conversions-page.test.js
@@ -86,7 +86,7 @@ const queueRow = (over = {}) => ({
lastActivity: '2026-08-01T00:00:00.000Z',
price: { atomic: '2000000', decimals: 6, display: '2', mint: THREE, chain: 'solana' },
potential: { atomic: '0', display: '0', mint: THREE },
- pricingUrl: `/agent/${AGENT}/edit?tab=monetization`,
+ pricingUrl: `/agents/${AGENT}/edit?tab=monetization`,
...over,
});
@@ -206,7 +206,7 @@ describe('seller queue', () => {
window.history.replaceState({}, '', '/conversions?role=seller');
await render({ seller: sellerPayload([queueRow()]) });
const edit = [...document.querySelectorAll('.cv-side a')].find((a) => a.textContent.includes('Edit pricing'));
- expect(edit.getAttribute('href')).toBe(`/agent/${AGENT}/edit?tab=monetization`);
+ expect(edit.getAttribute('href')).toBe(`/agents/${AGENT}/edit?tab=monetization`);
});
it('names the queue currencies the headline number cannot hold', async () => {
diff --git a/tests/corner-stack.test.js b/tests/corner-stack.test.js
index c808fb666..aff55c0dd 100644
--- a/tests/corner-stack.test.js
+++ b/tests/corner-stack.test.js
@@ -216,7 +216,24 @@ describe('corner stack — stylesheet contract', () => {
});
it('caps its height against the reserve so a tall stack cannot overflow', () => {
- expect(SOURCE).toContain('max-height:calc(100dvh - 36px - var(--tws-corner-reserve,0px))');
+ expect(SOURCE).toContain(
+ 'max-height:calc(100dvh - 36px - var(--tws-corner-reserve,0px) - var(--tws-corner-dock,0px))'
+ );
+ });
+
+ it('offsets both rules by the measured page dock as well as the reserve', () => {
+ // A page's own bottom chrome (the /app chat composer, a viewer action
+ // bar) is not a reservation — nobody declares it — so the stack measures
+ // it. Both the desktop and the narrow rule have to honour that lift or
+ // the phone layout keeps parking helper widgets on the composer.
+ const docked = SOURCE.match(/bottom:calc\([^;]*--tws-corner-dock/g) || [];
+ expect(docked.length).toBe(2);
+ });
+
+ it('sizes members to their content on a phone instead of stretching them', () => {
+ // align-items:stretch turned a 44px language control into a full-width
+ // bar laid across whatever the page had at the bottom of the screen.
+ expect(SOURCE).not.toContain('align-items:stretch');
});
it('offsets both rules horizontally too, so stepping aside works at any width', () => {
diff --git a/tests/e2e/agent-wallet-page.spec.js b/tests/e2e/agent-wallet-page.spec.js
index afb09460d..66703852f 100644
--- a/tests/e2e/agent-wallet-page.spec.js
+++ b/tests/e2e/agent-wallet-page.spec.js
@@ -104,8 +104,8 @@ test.describe('/agent-wallet entry page', () => {
const rows = page.locator('.awh-pick-row');
await expect(rows).toHaveCount(2, { timeout: SLOW });
expect(await page.locator('h1').count()).toBe(1);
- await expect(rows.nth(0)).toHaveAttribute('href', '/agent/11111111-1111-4111-8111-111111111111/wallet');
- await expect(rows.nth(1)).toHaveAttribute('href', '/agent/22222222-2222-4222-8222-222222222222/wallet');
+ await expect(rows.nth(0)).toHaveAttribute('href', '/agents/11111111-1111-4111-8111-111111111111/wallet');
+ await expect(rows.nth(1)).toHaveAttribute('href', '/agents/22222222-2222-4222-8222-222222222222/wallet');
// A wallet that is still being provisioned says so instead of showing a blank
// address, and a ready one shows the truncated address it will receive at.
diff --git a/tests/e2e/mobile-helper-overlays.spec.js b/tests/e2e/mobile-helper-overlays.spec.js
new file mode 100644
index 000000000..6adbb7862
--- /dev/null
+++ b/tests/e2e/mobile-helper-overlays.spec.js
@@ -0,0 +1,101 @@
+// Phone-width regression cover for the helper layer.
+//
+// Reported from an iPhone against production: the floating "Getting started"
+// pill and the language control sat directly on top of the /app chat composer
+// and its action row, the gallery's third card action ("Animate") was clipped
+// mid-word past the card's edge, and the AR Studio's Add-models sheet rendered
+// its tab pills sliced in half on a short viewport.
+//
+// Each one is invisible on a desktop viewport and to any unit test, because all
+// three are geometry: two independently correct boxes landing on the same
+// pixels. So they are asserted the way they were found, by measuring a real
+// browser at a phone size.
+
+import { test, expect } from '@playwright/test';
+
+const PHONE = { width: 390, height: 844 };
+
+test.use({ viewport: PHONE, isMobile: true, hasTouch: true });
+
+/** Do two rects share more than a hairline of area? */
+function overlaps(a, b, tolerance = 2) {
+ const w = Math.min(a.x + a.width, b.x + b.width) - Math.max(a.x, b.x);
+ const h = Math.min(a.y + a.height, b.y + b.height) - Math.max(a.y, b.y);
+ return w > tolerance && h > tolerance;
+}
+
+test('helper widgets clear the page\'s own bottom chrome on /app', async ({ page }) => {
+ await page.goto('/app', { waitUntil: 'domcontentloaded', timeout: 120_000 });
+ await page.waitForSelector('#tws-corner-stack .tws-corner-item', { timeout: 60_000 });
+ // The stack measures the page's docks on a settle timer; give it a beat.
+ await page.waitForTimeout(2000);
+
+ const stack = await page.locator('#tws-corner-stack').boundingBox();
+ expect(stack).not.toBeNull();
+
+ for (const selector of ['#nxt-chat-dock', '.nxt-action-bar--secondary']) {
+ const dock = await page.locator(selector).first().boundingBox();
+ if (!dock) continue; // the bar only renders in some auth states
+ expect(
+ overlaps(stack, dock),
+ `${selector} is covered by the corner stack`,
+ ).toBe(false);
+ }
+
+ // The language control is the widget that landed inside the composer: on a
+ // phone it renders its locale code, not the full language name.
+ const lang = page.locator('#tws-corner-stack lang-switcher');
+ if (await lang.count()) {
+ const face = await lang.first().evaluate(
+ (el) => el.shadowRoot?.querySelector('.face')?.textContent?.trim() || '',
+ );
+ expect(face).toMatch(/^[A-Z]{2,3}$/);
+ }
+});
+
+test('every gallery card action stays inside its card', async ({ page }) => {
+ await page.goto('/gallery/', { waitUntil: 'domcontentloaded', timeout: 120_000 });
+ await page.waitForSelector('.gallery-card-actions .gallery-card-btn', { timeout: 60_000 });
+
+ const escapes = await page.evaluate(() => {
+ const out = [];
+ for (const card of document.querySelectorAll('.gallery-card')) {
+ const cr = card.getBoundingClientRect();
+ for (const btn of card.querySelectorAll('.gallery-card-btn')) {
+ const br = btn.getBoundingClientRect();
+ if (br.right > cr.right + 1 || br.left < cr.left - 1) {
+ out.push(`${(btn.textContent || '').trim()} escapes its card`);
+ }
+ if (btn.scrollWidth > btn.clientWidth + 1) {
+ out.push(`${(btn.textContent || '').trim()} is clipped`);
+ }
+ }
+ }
+ return out;
+ });
+ expect(escapes).toEqual([]);
+ expect(await page.evaluate(() => document.documentElement.scrollWidth)).toBeLessThanOrEqual(
+ PHONE.width,
+ );
+});
+
+test('the AR Studio sheet keeps its tabs at full height on a short viewport', async ({ page }) => {
+ await page.setViewportSize({ width: 390, height: 480 });
+ await page.goto('/ar-studio', { waitUntil: 'domcontentloaded', timeout: 120_000 });
+ await page.click('#ars-add-btn');
+ await page.waitForSelector('.ars-tabs .ars-tab', { timeout: 30_000 });
+ await page.click('#ars-tab-community');
+ await page.waitForTimeout(3000);
+
+ // The sheet is a flex column capped at 72dvh. When its body could not
+ // shrink, the head and the tab strip absorbed the squeeze and the pills
+ // rendered as 16px slivers.
+ const pill = await page.locator('.ars-tab').first().boundingBox();
+ expect(pill.height).toBeGreaterThan(26);
+
+ // Card labels are prompts, and a refined prompt is a multi-clause spec.
+ const titles = await page.locator('.ars-item-title').allTextContents();
+ for (const title of titles) {
+ expect(title.trim().length).toBeLessThanOrEqual(50);
+ }
+});
diff --git a/tests/i18n.test.js b/tests/i18n.test.js
index 94c1bfe46..c7b823e39 100644
--- a/tests/i18n.test.js
+++ b/tests/i18n.test.js
@@ -23,7 +23,7 @@ import {
setDeep,
getDeep,
} from '../scripts/lib/i18n-shared.mjs';
-import { resolveKey, interpolate, translate, pickLocale } from '../src/i18n.js';
+import { resolveKey, interpolate, translate, pickLocale, shortLocaleLabel } from '../src/i18n.js';
describe('extractFromHtml', () => {
it('pulls text, html, and attribute keys with their English source values', () => {
@@ -231,3 +231,21 @@ describe('pruneStale', () => {
expect(pruneStale(source, once).removed).toEqual([]);
});
});
+
+// The compact language control shows a code instead of a name: "English" is a
+// 170px control, which on a phone either overflowed a HUD or laid a full-width
+// bar over the page's own bottom controls.
+describe('shortLocaleLabel', () => {
+ it('uppercases the base tag', () => {
+ expect(shortLocaleLabel('en')).toBe('EN');
+ expect(shortLocaleLabel('ru')).toBe('RU');
+ });
+ it('drops the region so the control stays two characters wide', () => {
+ expect(shortLocaleLabel('zh-CN')).toBe('ZH');
+ expect(shortLocaleLabel('pt_BR')).toBe('PT');
+ });
+ it('falls back rather than rendering an empty control', () => {
+ expect(shortLocaleLabel('')).toBe('EN');
+ expect(shortLocaleLabel(null)).toBe('EN');
+ });
+});
diff --git a/tests/launch-mm-endpoint.test.js b/tests/launch-mm-endpoint.test.js
index 50fee5254..7c1349b7e 100644
--- a/tests/launch-mm-endpoint.test.js
+++ b/tests/launch-mm-endpoint.test.js
@@ -302,7 +302,7 @@ describe('POST /api/launch/mm', () => {
expect(res.statusCode).toBe(200);
const { data } = parse(res);
expect(data.policy.kill_switch).toBe(true);
- expect(data.withdraw_url).toBe(`/agent/${AGENT}/wallet#withdraw`);
+ expect(data.withdraw_url).toBe(`/agents/${AGENT}/wallet#withdraw`);
});
});
@@ -340,7 +340,7 @@ describe('DELETE /api/launch/mm', () => {
await mmHandler(delReq(), res);
expect(res.statusCode).toBe(200);
expect(parse(res).data.removed).toBe(true);
- expect(parse(res).data.withdraw_url).toBe(`/agent/${AGENT}/wallet#withdraw`);
+ expect(parse(res).data.withdraw_url).toBe(`/agents/${AGENT}/wallet#withdraw`);
});
});
diff --git a/tests/living-avatar.test.js b/tests/living-avatar.test.js
index baac9372e..e42cc35fb 100644
--- a/tests/living-avatar.test.js
+++ b/tests/living-avatar.test.js
@@ -31,7 +31,7 @@ describe('resolveLivingAvatar — identity composition', () => {
expect(d.hasWallet).toBe(false);
expect(d.address).toBeNull();
expect(d.name).toBe('Fresh');
- expect(d.hubUrl).toBe('/agent/a1/wallet');
+ expect(d.hubUrl).toBe('/agents/a1/wallet');
expect(d.isOwner).toBe(false);
});
diff --git a/tests/marketplace-trial-status.test.js b/tests/marketplace-trial-status.test.js
index 750f8aca1..b164a9513 100644
--- a/tests/marketplace-trial-status.test.js
+++ b/tests/marketplace-trial-status.test.js
@@ -173,7 +173,7 @@ describe('sellerView', () => {
// "Edit pricing" pointed at /dashboard-next/agent, which 404s. The agent
// editor's monetization panel is the surface that actually sets a skill's
// price and trial grant.
- expect(out.queue[0].pricingUrl).toBe(`/agent/${AGENT}/edit?tab=monetization`);
+ expect(out.queue[0].pricingUrl).toBe(`/agents/${AGENT}/edit?tab=monetization`);
expect(out.queue[0].agentUrl).toBe(`/agents/${AGENT}`);
expect(out.summary.warmLeads).toBe(3);
expect(out.summary.sold).toBe(2);
diff --git a/tests/notify-prefs.test.js b/tests/notify-prefs.test.js
index 61317a221..dea0b3b08 100644
--- a/tests/notify-prefs.test.js
+++ b/tests/notify-prefs.test.js
@@ -161,7 +161,7 @@ describe('pushPayloadFor', () => {
const p = pushPayloadFor('skill_purchased', { skill: 'Voice Pack', agent_id: 'a1' }, 'n-123');
expect(p.title).toMatch(/sale/i);
expect(p.body).toContain('Voice Pack');
- expect(p.url).toBe('/agent/a1');
+ expect(p.url).toBe('/agents/a1');
expect(p.notificationId).toBe('n-123');
expect(p.category).toBe('sales');
expect(p.tag).toBe('skill_purchased');
diff --git a/tests/og-cards.test.js b/tests/og-cards.test.js
index 0b609ba86..d023605f6 100644
--- a/tests/og-cards.test.js
+++ b/tests/og-cards.test.js
@@ -259,7 +259,7 @@ describe('og/agent', () => {
expect(svg).toContain('TRUSTED');
expect(svg).toContain('◆ $THREE'); // holder mark
expect(svg).toContain('+1.25 ◎'); // realized P&L
- expect(svg).toContain(`three.ws/agent/${ID}`);
+ expect(svg).toContain(`three.ws/agents/${ID}`);
});
// Failure path: every enrichment timed out. The card still renders, and says
diff --git a/tests/reputation-leaderboard-endpoint.test.js b/tests/reputation-leaderboard-endpoint.test.js
index 68eb7a529..ef09fcac6 100644
--- a/tests/reputation-leaderboard-endpoint.test.js
+++ b/tests/reputation-leaderboard-endpoint.test.js
@@ -173,8 +173,8 @@ describe('GET /api/reputation/leaderboard', () => {
expect(top.tier).toBe('established');
expect(top.tier_label).toBe('Established');
expect(top.totals.holds_three).toBe(true);
- expect(top.agent_url).toBe(`https://three.ws/agent/${ROWS[0].id}`);
- expect(top.breakdown_url).toBe(`https://three.ws/agent/${ROWS[0].id}/wallet#reputation`);
+ expect(top.agent_url).toBe(`https://three.ws/agents/${ROWS[0].id}`);
+ expect(top.breakdown_url).toBe(`https://three.ws/agents/${ROWS[0].id}/wallet#reputation`);
expect(top.avatar_thumbnail_url).toBe('https://cdn.test/thumb/harbor.png');
expect(Date.parse(body.generated_at)).not.toBeNaN();
expect(res.getHeader('x-cache')).toBe('MISS');
diff --git a/tests/wealth-levelup.test.js b/tests/wealth-levelup.test.js
index cf52b8fc8..4f3d9d7b5 100644
--- a/tests/wealth-levelup.test.js
+++ b/tests/wealth-levelup.test.js
@@ -160,7 +160,7 @@ describe('installLevelUpCelebrations — card rendering', () => {
// Real tier label from the ladder, real balance, the "view wallet" deep-link.
expect(card.querySelector('.wlu-tier').textContent).toBe('Glow');
expect(card.textContent).toContain('$420');
- expect(card.querySelector('[data-wallet]').getAttribute('href')).toBe('/agent/card1/wallet');
+ expect(card.querySelector('[data-wallet]').getAttribute('href')).toBe('/agents/card1/wallet');
card.querySelector('.wlu-close').click();
await new Promise((r) => setTimeout(r, 360)); // teardown fallback timer
diff --git a/vite.config.js b/vite.config.js
index 93ba8e149..d0259694c 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -635,6 +635,7 @@ const appConfig = {
fits: resolve(__dirname, 'pages/fits.html'),
viability: resolve(__dirname, 'pages/viability.html'),
deployments: resolve(__dirname, 'pages/deployments.html'),
+ deployOnchain: resolve(__dirname, 'pages/deploy-onchain.html'),
portfolio: resolve(__dirname, 'pages/portfolio.html'),
airdrops: resolve(__dirname, 'pages/airdrops.html'),
launcher: resolve(__dirname, 'pages/launcher.html'),
@@ -1310,6 +1311,8 @@ const appConfig = {
'/viability/': resolve(root, 'pages/viability.html'),
'/deployments': resolve(root, 'pages/deployments.html'),
'/deployments/': resolve(root, 'pages/deployments.html'),
+ '/deploy-onchain': resolve(root, 'pages/deploy-onchain.html'),
+ '/deploy-onchain/': resolve(root, 'pages/deploy-onchain.html'),
'/portfolio': resolve(root, 'pages/portfolio.html'),
'/portfolio/': resolve(root, 'pages/portfolio.html'),
'/airdrops': resolve(root, 'pages/airdrops.html'),
@@ -1926,11 +1929,11 @@ const appConfig = {
filePath = resolve(root, 'pages/ar.html');
else if (!filePath && /^\/agents\/[^/.]+\/?$/.test(path))
filePath = resolve(root, 'pages/avatar-page.html');
- else if (!filePath && /^\/agent\/[^/]+\/mind\/?$/.test(path))
+ else if (!filePath && /^\/agents?\/[^/]+\/mind\/?$/.test(path))
filePath = resolve(root, 'pages/agent-mind.html');
- else if (!filePath && /^\/agent\/[^/]+\/edit$/.test(path))
+ else if (!filePath && /^\/agents?\/[^/]+\/edit$/.test(path))
filePath = resolve(root, 'pages/agent-edit.html');
- else if (!filePath && /^\/agent\/[^/]+\/embed$/.test(path))
+ else if (!filePath && /^\/agents?\/[^/]+\/embed$/.test(path))
filePath = resolve(root, 'pages/agent-embed.html');
// Legacy singular /agent/:id: vercel.json 301s it to /agents/:id,
// so dev serves the same studio template it lands on in prod.