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(shopper): wrap the nav links onto their own row on a phone and name the real network error

nirholasfd407f68769b
diff --git a/pages/shopper.html b/pages/shopper.html
index 213f16ebf..20cdee7ad 100644
--- a/pages/shopper.html
+++ b/pages/shopper.html
@@ -99,10 +99,15 @@
.nav-main::-webkit-scrollbar { display: none; }
.nav-main a { padding: 7px 9px; white-space: nowrap; }
}
+ /* Under 560px the brand + Dashboard button leave the links about 76px of
+ track, so they scroll a few pixels at a time. Wrap them onto their own
+ full-width row: same links, readable width, still one tap away. */
@media (max-width: 560px) {
- .nav-inner { gap: 8px; }
+ .nav-inner { gap: 8px; flex-wrap: wrap; padding-bottom: 8px; }
.brand { font-size: 15px; }
+ .nav-end { margin-left: auto; }
.nav-end .console { margin-left: 0; padding: 7px 12px; }
+ .nav-main { order: 3; flex: 0 0 100%; margin: 0 -20px; padding: 0 20px; }
}
/* ── BUTTONS ─────────────────────────────────────────────── */
@@ -172,6 +177,7 @@
position: sticky; top: 88px;
}
.panel-label {
+ display: block;
font-family: var(--font-mono); font-size: 11px;
letter-spacing: 0.18em; text-transform: uppercase;
color: var(--text-3); margin-bottom: 12px;
@@ -411,6 +417,38 @@
}
.empty-tips strong { color: var(--text-2); font-weight: 500; }
+ /* Ran, but the Bazaar had nothing to call */
+ .barren-card {
+ background: var(--surface-1);
+ border: 1px solid var(--hairline-strong);
+ border-radius: 12px;
+ padding: 24px;
+ }
+ .barren-eyebrow {
+ font-family: var(--font-mono); font-size: 10.5px;
+ letter-spacing: 0.2em; text-transform: uppercase;
+ color: var(--text-3); margin-bottom: 12px;
+ }
+ .barren-desc {
+ margin: 0 0 16px; font-size: 15px;
+ color: var(--text-2); line-height: 1.55;
+ }
+ .barren-tips {
+ list-style: none; margin: 0 0 20px; padding: 0;
+ display: flex; flex-direction: column; gap: 10px;
+ }
+ .barren-tips li {
+ position: relative; padding-left: 20px;
+ font-size: 13px; line-height: 1.5; color: var(--text-3);
+ }
+ .barren-tips li::before {
+ content: ""; position: absolute; left: 4px; top: 8px;
+ width: 5px; height: 5px; border-radius: 50%;
+ background: var(--text-4);
+ }
+ .barren-tips a { text-decoration: underline; text-underline-offset: 3px; color: var(--text-2); }
+ .barren-tips a:hover { color: var(--text); }
+
/* Inline payment card (402) */
.pay-card {
background: var(--surface-1);
@@ -509,16 +547,16 @@
<meta property="og:type" content="website">
<meta property="og:site_name" content="three.ws">
<meta property="og:title" content="Endpoint Shopper · three.ws" data-i18n-attr="content:shopper.meta_og_title">
- <meta property="og:description" content="Describe a task and set a budget. An AI agent discovers relevant x402 endpoints via the Bazaar, chains them together, and synthesizes a final answer — paying per API call." data-i18n-attr="content:shopper.meta_og_description">
+ <meta property="og:description" content="Describe a task and set a budget. An AI agent discovers relevant x402 endpoints via the Bazaar, chains them together, and synthesizes a final answer: paying per API call." data-i18n-attr="content:shopper.meta_og_description">
<meta property="og:url" content="https://three.ws/shopper">
<meta property="og:image" content="https://three.ws/api/page-og?s=crypto&amp;t=Endpoint+Shopper&amp;d=Describe+a+task+and+set+a+budget.+An+AI+agent+discovers+relevant+x402+endpoints+via+the+Bazaar%2C+chains+them+together%2C+and+synthesizes+a+final+answer%3A+paying&amp;p=%2Fshopper">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Endpoint Shopper · three.ws" data-i18n-attr="content:shopper.meta_twitter_title">
- <meta name="twitter:description" content="Describe a task and set a budget. An AI agent discovers relevant x402 endpoints via the Bazaar, chains them together, and synthesizes a final answer — paying per API call." data-i18n-attr="content:shopper.meta_twitter_description">
+ <meta name="twitter:description" content="Describe a task and set a budget. An AI agent discovers relevant x402 endpoints via the Bazaar, chains them together, and synthesizes a final answer: paying per API call." data-i18n-attr="content:shopper.meta_twitter_description">
<meta name="twitter:image" content="https://three.ws/api/page-og?s=crypto&amp;t=Endpoint+Shopper&amp;d=Describe+a+task+and+set+a+budget.+An+AI+agent+discovers+relevant+x402+endpoints+via+the+Bazaar%2C+chains+them+together%2C+and+synthesizes+a+final+answer%3A+paying&amp;p=%2Fshopper">
- <script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","name":"Endpoint Shopper","description":"Describe a task and set a budget. An AI agent discovers relevant x402 endpoints via the Bazaar, chains them together, and synthesizes a final answer — paying per API call.","url":"https://three.ws/shopper","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"}}</script>
+ <script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","name":"Endpoint Shopper","description":"Describe a task and set a budget. An AI agent discovers relevant x402 endpoints via the Bazaar, chains them together, and synthesizes a final answer: paying per API call.","url":"https://three.ws/shopper","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"}}</script>
<meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1">
<meta property="og:locale" content="en_US">
@@ -549,7 +587,7 @@
<!-- ── HERO ─────────────────────────────────────────────────── -->
<div class="hero">
<div class="wrap">
- <div class="eyebrow">USE-36 — Agent Orchestration</div>
+ <div class="eyebrow">Agent orchestration</div>
<h1 class="hero-h" data-i18n-html="shopper.endpoint_shopper_ai_that_chains_paid_apis">Endpoint Shopper<br /><em>AI that chains paid APIs</em></h1>
<p class="hero-sub" data-i18n="shopper.describe_a_task_set_a_budget_the">Describe a task, set a budget. The agent discovers relevant x402 endpoints in the Bazaar, pays for each call, and synthesizes a final answer.</p>
</div>
@@ -602,12 +640,12 @@
</div>
<!-- Right: results -->
- <div class="result-panel" id="result-panel">
+ <div class="result-panel" id="result-panel" role="region" aria-label="Execution trace" aria-live="polite">
<div class="empty-state" id="empty-state">
<svg width="40" height="40" fill="none" viewBox="0 0 40 40"><circle cx="20" cy="20" r="18" stroke="currentColor" stroke-width="1.5"/><path d="M14 20h12M20 14v12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>
<div>Enter a task and click <strong data-i18n="shopper.run_task">Run Task</strong> to begin</div>
<ul class="empty-tips">
- <li data-i18n-html="shopper.set_a_max_budget_the_agent_never">Set a <strong>max budget</strong> — the agent never spends past it on downstream calls.</li>
+ <li data-i18n-html="shopper.set_a_max_budget_the_agent_never">Set a <strong>max budget</strong>. The agent never spends past it on downstream calls.</li>
<li data-i18n="shopper.running_costs_usdc_you_ll_pay_once">Running costs USDC: you'll pay once with a Base or Solana wallet when prompted.</li>
<li data-i18n="shopper.try_an_example_chip_above_to_see">Try an example chip above to see the discover → plan → call → synthesize flow.</li>
</ul>
diff --git a/src/shopper-app.js b/src/shopper-app.js
index 816d03511..f3d716c6e 100644
--- a/src/shopper-app.js
+++ b/src/shopper-app.js
@@ -70,6 +70,7 @@ const RUN_BTN_HTML =
let emptyStateHtml = '';
function renderEmptyState(panel) {
+ panel.removeAttribute('aria-busy');
panel.innerHTML = emptyStateHtml;
}
@@ -193,7 +194,7 @@ async function runTask({ task, maxCostUsd, resultPanel, runBtn, refreshGate }) {
data = await res.json();
} catch (err) {
- showError(resultPanel, err.message || 'Network error. Check your connection and try again.');
+ showError(resultPanel, networkErrorMessage(err));
return;
} finally {
runBtn.innerHTML = RUN_BTN_HTML;
@@ -205,7 +206,20 @@ async function runTask({ task, maxCostUsd, resultPanel, runBtn, refreshGate }) {
renderResults(resultPanel, data, task);
}
+// A failed fetch surfaces as a bare TypeError whose message ("Failed to fetch",
+// "NetworkError when attempting to fetch resource") is browser-specific and
+// tells the buyer nothing they can act on. Anything that is not a real message
+// from our own code becomes one sentence that names the cause and the fix.
+function networkErrorMessage(err) {
+ const raw = String(err?.message || '');
+ const isTransport = !raw || err instanceof TypeError || /failed to fetch|networkerror|load failed|network request failed/i.test(raw);
+ return isTransport
+ ? 'Could not reach the agent service. Check your connection, then run the task again.'
+ : raw;
+}
+
function showSkeleton(panel) {
+ panel.setAttribute('aria-busy', 'true');
panel.innerHTML = `
<div class="skeleton-list">
<div class="skeleton-item"></div>
@@ -216,6 +230,7 @@ function showSkeleton(panel) {
}
function showError(panel, message) {
+ panel.removeAttribute('aria-busy');
panel.innerHTML = `
<div class="error-card">
<p>${escHtml(message)}</p>
@@ -337,6 +352,7 @@ function showPaymentRequired(panel, { body, header, task, maxCostUsd }) {
const price = formatAmount(quoted.amount, Number(quoted.extra?.decimals ?? 6));
const asset = quoted.extra?.name || 'USDC';
+ panel.removeAttribute('aria-busy');
panel.innerHTML = `
<div class="pay-card">
<div class="pay-head">
@@ -503,12 +519,22 @@ function shortId(value) {
}
function renderResults(panel, data, task) {
+ panel.removeAttribute('aria-busy');
panel.innerHTML = '';
const steps = Array.isArray(data.steps) ? data.steps : [];
const answer = data.result?.answer || '';
const totalCost = data.totalCostUsdc || '0.000000';
+ // A run can come back well-formed and still carry nothing to show: the
+ // Bazaar matched no endpoint for the task, or every candidate priced above
+ // the budget. Rendering an empty timeline there leaves a blank panel, so
+ // say what happened and give the two levers that change the outcome.
+ if (!steps.length && !answer) {
+ renderBarrenRun(panel, task);
+ return;
+ }
+
// Render step cards with staggered animation delays
const timeline = document.createElement('div');
timeline.className = 'timeline';
@@ -547,6 +573,34 @@ function renderResults(panel, data, task) {
}
}
+// Shown when the agent ran but produced no trace and no answer.
+function renderBarrenRun(panel, task) {
+ panel.innerHTML = `
+ <div class="barren-card">
+ <div class="barren-eyebrow">No endpoints matched</div>
+ <p class="barren-desc">
+ The agent found nothing in the Bazaar it could call for
+ ${task ? `\u201c${escHtml(String(task).slice(0, 120))}\u201d` : 'that task'}
+ within your budget, so it spent nothing.
+ </p>
+ <ul class="barren-tips">
+ <li>Rewrite the task around the data you want (a price, a reputation score, a search).</li>
+ <li>Raise the budget: some endpoints price above the current ceiling.</li>
+ <li><a href="/marketplace">Browse the Bazaar</a> to see what is currently on sale.</li>
+ </ul>
+ <button class="btn" type="button" id="barren-retry">Run again</button>
+ </div>
+ `;
+ const retry = panel.querySelector('#barren-retry');
+ if (retry) {
+ retry.addEventListener('click', () => {
+ const runBtn = document.getElementById('run-btn');
+ if (runBtn && !runBtn.disabled) runBtn.click();
+ else document.getElementById('task-input')?.focus();
+ });
+ }
+}
+
function buildStepCard(step, index) {
const card = document.createElement('div');
card.className = 'step-card';