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
<!DOCTYPE html>
<html lang="en">
<head>
<style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="color-scheme" content="light dark">
<title data-i18n="ibm_hello.meta_title">IBM and three.ws partnership</title>
<meta name="description" content="IBM and three.ws work together to unite payments, data, 3D and AI — pairing IBM Granite on watsonx.ai with three.ws's on-chain micropayments and 3D agent engine. Explore live demos that run against real production systems." data-i18n-attr="content:ibm_hello.meta_description">
<meta property="og:title" content="IBM and three.ws partnership" data-i18n-attr="content:ibm_hello.meta_og_title">
<meta property="og:description" content="IBM and three.ws unite payments, data, 3D and AI — IBM Granite on watsonx.ai with three.ws on-chain micropayments and 3D agents. Live demos, nothing mocked." data-i18n-attr="content:ibm_hello.meta_og_description">
<meta property="og:type" content="website">
<style>
/* ─── Self-hosted IBM Plex (latin subset) — no third-party font CDN, so a
strict `font-src 'self'` CSP on the host page won't break typography.
Files travel with this page under ./fonts/. ─────────────────────────────── */
@font-face{font-family:'IBM Plex Sans';font-style:normal;font-weight:300;font-display:swap;src:url('./fonts/IBMPlexSans-300.woff2') format('woff2')}
@font-face{font-family:'IBM Plex Sans';font-style:normal;font-weight:400;font-display:swap;src:url('./fonts/IBMPlexSans-400.woff2') format('woff2')}
@font-face{font-family:'IBM Plex Sans';font-style:normal;font-weight:500;font-display:swap;src:url('./fonts/IBMPlexSans-500.woff2') format('woff2')}
@font-face{font-family:'IBM Plex Sans';font-style:normal;font-weight:600;font-display:swap;src:url('./fonts/IBMPlexSans-600.woff2') format('woff2')}
@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:400;font-display:swap;src:url('./fonts/IBMPlexMono-400.woff2') format('woff2')}
@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:500;font-display:swap;src:url('./fonts/IBMPlexMono-500.woff2') format('woff2')}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{
/* Carbon G10 (light) — defaults. Every surface token is themed so the dark
override below is a single, deliberate switch. */
--ibm-blue:#0f62fe; /* accent: text, borders, focus rings */
--ibm-blue-fill:#0f62fe; /* fills that carry white text (button, skip link) */
--ibm-blue-fill-hover:#0353e9;
--ibm-blue-hover:#0353e9;
--ibm-link:#0f62fe; /* AA on white (4.6:1) */
--ibm-ink:#161616;
--ibm-muted:#525252; /* AA on white (7.4:1) */
--ibm-subtle:#595959; /* AA on white (7:1) — was #6f6f6f (3.9:1, failed) */
--ibm-border:#e0e0e0;
--ibm-divider:#c6c6c6;
--ibm-surface:#ffffff; /* card / panel fill */
--ibm-field:#f4f4f4;
--ibm-field-focus:#ffffff;
--ibm-green:#0e7a32; /* darkened for AA on light fills */
--ibm-green-ink:#0e7a32; /* green text on light pill fills */
--ibm-green-fill:#defbe6;
--ibm-red:#da1e28;
--ibm-red-ink:#a2191f; /* red text on light fills (AA) */
--ibm-red-fill:#fff1f1;
--ibm-red-edge:#ffb3b8;
--ibm-amber:#8a6100; /* AA on white */
--ibm-amber-fill:#fcf4d6;
--ibm-skel-a:#e8e8e8;
--ibm-skel-b:#f4f4f4;
--font-sans:'IBM Plex Sans',system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
--font-mono:'IBM Plex Mono',ui-monospace,'SF Mono',Menlo,Consolas,monospace;
--ease:cubic-bezier(.2,.7,.3,1);
}
/* Carbon G100 (dark) — looks deliberate when embedded in a dark IBM context.
Background stays transparent so the page rides the host surface in both schemes. */
@media (prefers-color-scheme: dark){
:root{
--ibm-blue:#78a9ff; /* accent on dark — AA as text on G100 (7.2:1) */
--ibm-blue-fill:#0f62fe; /* white text stays AA (4.84:1); recognizably IBM blue */
--ibm-blue-fill-hover:#1f6fff;
--ibm-blue-hover:#a6c8ff;
--ibm-link:#78a9ff; /* AA on #161616 (7.2:1) */
--ibm-ink:#f4f4f4;
--ibm-muted:#c6c6c6; /* AA on #161616 (12:1) */
--ibm-subtle:#a8a8a8; /* AA on #161616 (7.4:1) */
--ibm-border:#393939;
--ibm-divider:#525252;
--ibm-surface:#262626; /* card / panel fill on dark */
--ibm-field:#393939;
--ibm-field-focus:#4c4c4c;
--ibm-green:#42be65; /* used as accent edge/dot on dark */
--ibm-green-ink:#42be65; /* AA on dark green fill */
--ibm-green-fill:#0b2818;
--ibm-red:#fa4d56;
--ibm-red-ink:#ff8389; /* AA on dark red fill */
--ibm-red-fill:#2a1416;
--ibm-red-edge:#7f1d1d;
--ibm-amber:#f1c21b; /* AA on dark */
--ibm-amber-fill:#2a1d10;
--ibm-skel-a:#333333;
--ibm-skel-b:#3f3f3f;
}
}
html,body{background:transparent;font-family:var(--font-sans);color:var(--ibm-ink);font-size:16px;line-height:1.5;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
a{color:var(--ibm-link);text-decoration:none}
a:hover{text-decoration:underline}
.mono{font-family:var(--font-mono)}
/* Visible focus everywhere — never rely on the UA default the reset removes. */
:focus-visible{outline:2px solid var(--ibm-blue);outline-offset:2px}
a:focus-visible{outline-offset:3px}
.skip-link{position:absolute;left:-9999px;top:0;background:var(--ibm-blue-fill);color:#fff;padding:10px 16px;z-index:50;font-weight:600;font-size:14px}
.skip-link:focus{left:8px;top:8px;text-decoration:none}
/* Visually hidden but available to assistive tech. */
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.inner{max-width:880px;margin:0 auto;padding:0 16px}
.section{padding:40px 0;border-bottom:1px solid var(--ibm-border)}
.section:last-child{border-bottom:none}
/* ── Global error banner (resilience safety net) ── */
.err-banner{position:fixed;left:0;right:0;top:0;z-index:60;background:var(--ibm-red-fill);border-bottom:1px solid var(--ibm-red-edge);color:var(--ibm-red-ink);font-size:13px;padding:10px 16px;display:none;align-items:center;gap:12px;justify-content:center}
.err-banner.show{display:flex}
.err-banner button{background:none;border:1px solid var(--ibm-red-edge);color:var(--ibm-red-ink);font-family:inherit;font-size:12px;font-weight:600;padding:4px 10px;cursor:pointer;border-radius:2px}
.err-banner button:hover{background:rgba(218,30,40,.12)}
/* ── Hero ── */
.hero{padding:56px 0 36px}
.hero h1{font-size:clamp(30px,5vw,46px);font-weight:300;line-height:1.1;margin-bottom:18px;max-width:680px}
.hero h1 strong{font-weight:600}
.hero-sub{font-size:18px;color:var(--ibm-muted);max-width:620px;font-weight:300;line-height:1.6}
.hero-eyebrow{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--ibm-blue);font-weight:500;margin-bottom:14px}
.hero-cta{display:flex;flex-wrap:wrap;align-items:center;gap:16px 28px;margin-top:30px}
.btn-tertiary{display:inline-flex;align-items:center;gap:10px;color:var(--ibm-link);font-size:15px;font-weight:500;background:none;border:none;padding:0;cursor:pointer;transition:gap .12s,color .12s}
.btn-tertiary:hover{text-decoration:none;color:var(--ibm-blue-hover);gap:14px}
.btn-tertiary:focus-visible{outline:2px solid var(--ibm-blue);outline-offset:3px}
.hero-note{font-size:14px;color:var(--ibm-subtle);max-width:660px;font-weight:300;line-height:1.65;margin-top:30px}
/* ── How-it-works ── */
.steps{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;background:var(--ibm-border);border:1px solid var(--ibm-border);list-style:none;margin-top:24px}
.step{background:var(--ibm-surface);padding:24px 22px}
.step-n{font-family:var(--font-mono);font-size:12px;color:var(--ibm-blue);font-weight:500;margin-bottom:10px}
.step h3{font-size:15px;font-weight:600;margin-bottom:6px}
.step p{font-size:13px;color:var(--ibm-muted);font-weight:300;line-height:1.55}
.step code{font-family:var(--font-mono);font-size:12px;background:var(--ibm-field);padding:1px 5px;color:var(--ibm-ink);word-break:break-word}
/* ── Section heads ── */
.section-tag{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--ibm-blue);margin-bottom:8px;font-weight:500}
.section h2{font-size:clamp(22px,4vw,32px);font-weight:300}
.section h2 strong{font-weight:600}
.section-lead{font-size:15px;color:var(--ibm-muted);max-width:620px;margin-top:10px;font-weight:300;line-height:1.6}
/* ── Demo card ── */
.demo{border:1px solid var(--ibm-divider);margin-top:28px;background:var(--ibm-surface)}
.demo-head{padding:22px 24px 18px;border-bottom:1px solid var(--ibm-border);display:flex;flex-wrap:wrap;gap:16px;align-items:flex-end;justify-content:space-between}
.demo-title{font-size:20px;font-weight:600}
.demo-title span{color:var(--ibm-blue)}
.demo-desc{font-size:13px;color:var(--ibm-muted);font-weight:300;max-width:460px;margin-top:4px;line-height:1.55}
.price-tag{text-align:right;flex:0 0 auto}
.price-tag .amt{font-size:30px;font-weight:300;line-height:1;font-variant-numeric:tabular-nums}
.price-tag .amt strong{font-weight:600;color:var(--ibm-blue)}
.price-tag .amt.flash{animation:priceflash .42s var(--ease) 1}
@keyframes priceflash{0%{transform:scale(1)}40%{transform:scale(1.06);opacity:.7}100%{transform:scale(1);opacity:1}}
.price-tag .net{font-size:12px;color:var(--ibm-muted);margin-top:6px}
.demo-body{padding:22px 24px}
/* 402 preview */
.preview{border:1px solid var(--ibm-border);background:var(--ibm-field);padding:14px 16px;margin-bottom:22px;font-family:var(--font-mono);font-size:12px}
.preview-label{font-family:var(--font-sans);font-size:11px;text-transform:uppercase;letter-spacing:.07em;color:var(--ibm-subtle);margin-bottom:10px;display:flex;align-items:center;gap:8px}
.preview-label .dot{width:7px;height:7px;border-radius:50%;background:var(--ibm-subtle);flex:0 0 auto}
.preview-label.ok .dot{background:var(--ibm-green)}
.preview-label.ok.fresh .dot{animation:dotpulse 1.2s var(--ease) 1}
.preview-label.err .dot{background:var(--ibm-red)}
@keyframes dotpulse{0%{box-shadow:0 0 0 0 rgba(14,122,50,.5)}100%{box-shadow:0 0 0 9px rgba(14,122,50,0)}}
.preview-row{display:flex;gap:12px;padding:3px 0;flex-wrap:wrap}
.preview-row .k{color:var(--ibm-subtle);min-width:84px}
.preview-row .v{color:var(--ibm-ink);word-break:break-all}
.badge{display:inline-block;font-family:var(--font-sans);font-size:11px;font-weight:500;padding:1px 8px;border:1px solid var(--ibm-divider);margin-right:6px;border-radius:2px}
.pv-retry{margin-top:10px;background:none;border:1px solid var(--ibm-divider);color:var(--ibm-ink);font-family:var(--font-sans);font-size:12px;font-weight:500;padding:6px 12px;cursor:pointer}
.pv-retry:hover{border-color:var(--ibm-blue);color:var(--ibm-blue)}
/* skeleton */
.sk{display:inline-block;height:11px;border-radius:2px;background:linear-gradient(90deg,var(--ibm-skel-a) 25%,var(--ibm-skel-b) 37%,var(--ibm-skel-a) 63%);background-size:400% 100%;animation:sk 1.4s ease infinite}
@keyframes sk{0%{background-position:100% 0}100%{background-position:0 0}}
/* input row */
.field-row{display:flex;gap:0;flex-wrap:wrap;align-items:flex-end;margin-bottom:10px}
.field-wrap{flex:1 1 240px;min-width:0}
.field-wrap label{display:block;font-size:12px;color:var(--ibm-muted);margin-bottom:6px;font-weight:500}
.field{width:100%;height:48px;padding:0 14px;border:none;border-bottom:1px solid var(--ibm-divider);background:var(--ibm-field);font-family:var(--font-mono);font-size:15px;color:var(--ibm-ink);letter-spacing:.04em;outline:none;transition:border-color .12s,background .12s}
.field:focus{border-bottom:2px solid var(--ibm-blue);background:var(--ibm-field-focus)}
.field[aria-invalid="true"]{border-bottom:2px solid var(--ibm-red)}
.field-hint{font-size:11px;color:var(--ibm-subtle);margin-top:6px}
.field-hint.err{color:var(--ibm-red)}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;background:var(--ibm-blue-fill);color:#fff;border:none;cursor:pointer;font-family:var(--font-sans);font-size:15px;font-weight:500;letter-spacing:.01em;padding:0 24px;height:48px;min-width:200px;transition:background .12s,transform .04s,box-shadow .12s}
.btn:hover:not(:disabled){background:var(--ibm-blue-fill-hover)}
.btn:active:not(:disabled){transform:translateY(1px)}
.btn:focus-visible{outline:2px solid var(--ibm-blue);outline-offset:2px;box-shadow:0 0 0 4px rgba(15,98,254,.25)}
.btn:disabled{background:var(--ibm-divider);color:var(--ibm-subtle);cursor:not-allowed}
.btn .arrow{font-size:17px;line-height:1}
.btn .spin{width:15px;height:15px;border:2px solid rgba(255,255,255,.45);border-top-color:#fff;border-radius:50%;animation:spin .7s linear infinite;display:none}
.btn.loading .spin{display:inline-block}
.btn.loading .arrow{display:none}
@media(min-width:560px){.btn{margin-left:1px}}
.wallet-hint{font-size:11px;color:var(--ibm-subtle);margin-bottom:18px;line-height:1.5;transition:color .12s}
.wallet-hint b{color:var(--ibm-ink);font-weight:600}
.wallet-hint.offline{color:var(--ibm-amber);font-weight:500}
.wallet-hint.detected{color:var(--ibm-green)}
.wallet-hint.detected b{color:var(--ibm-green)}
/* result panel */
.result{border:1px solid var(--ibm-border);min-height:96px;padding:18px 20px;background:var(--ibm-surface);transition:border-color .15s}
.result.is-empty{display:flex;align-items:center;justify-content:center;color:var(--ibm-subtle);font-size:13px;text-align:center;font-weight:300;border-style:dashed}
.result.is-loading{border-color:var(--ibm-blue)}
.result.is-error{border-color:var(--ibm-red)}
.result.is-done{border-color:var(--ibm-green);animation:reveal .28s var(--ease)}
@keyframes reveal{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.r-status{display:flex;align-items:center;gap:10px;font-size:13px;font-weight:500}
.r-status .spin{width:14px;height:14px;border:2px solid var(--ibm-divider);border-top-color:var(--ibm-blue);border-radius:50%;animation:spin .8s linear infinite;flex:0 0 auto}
@keyframes spin{to{transform:rotate(360deg)}}
.r-status.err{color:var(--ibm-red)}
.r-status.ok{color:var(--ibm-green)}
.r-check{display:inline-flex;width:18px;height:18px;border-radius:50%;background:var(--ibm-green);color:#161616;align-items:center;justify-content:center;font-size:11px;font-weight:700;flex:0 0 auto;animation:pop .3s var(--ease)}
@keyframes pop{0%{transform:scale(0)}60%{transform:scale(1.15)}100%{transform:scale(1)}}
.r-headline{font-size:18px;font-weight:300;margin:12px 0 4px}
.r-headline strong{font-weight:600}
.r-reco{font-size:14px;color:var(--ibm-ink);margin-bottom:14px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.pill{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;padding:2px 9px;border-radius:2px}
.pill.ok{background:var(--ibm-green-fill);color:var(--ibm-green-ink)}
.pill.warn{background:var(--ibm-amber-fill);color:var(--ibm-amber)}
.pill.bad{background:var(--ibm-red-fill);color:var(--ibm-red-ink)}
.matches{border-top:1px solid var(--ibm-border);margin-top:6px;padding-top:12px}
.matches h4{font-size:11px;text-transform:uppercase;letter-spacing:.07em;color:var(--ibm-subtle);margin-bottom:8px;font-weight:600}
.match{display:flex;justify-content:space-between;gap:12px;padding:5px 0;font-size:13px;border-bottom:1px solid var(--ibm-field)}
.match:last-child{border-bottom:none}
.match .m-name{color:var(--ibm-ink);min-width:0;word-break:break-word}
.match .m-name b{font-weight:600}
.match .m-sim{font-family:var(--font-mono);color:var(--ibm-muted);font-size:12px;flex:0 0 auto}
.receipt{margin-top:14px;padding-top:12px;border-top:1px solid var(--ibm-border);display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px 20px}
.receipt-pair{min-width:0}
.receipt .rk{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--ibm-subtle);margin-bottom:2px}
.receipt .rv{font-family:var(--font-mono);font-size:12px;color:var(--ibm-ink);word-break:break-all}
.receipt .rv a{color:var(--ibm-link)}
.raw{margin-top:14px}
.raw summary{cursor:pointer;font-size:12px;color:var(--ibm-muted);font-weight:500;user-select:none}
.raw summary:hover{color:var(--ibm-blue)}
.raw pre{margin-top:10px;background:#161616;color:#e0e0e0;padding:14px 16px;overflow:auto;max-height:300px;font-family:var(--font-mono);font-size:12px;line-height:1.5}
.retry{margin-top:14px;background:none;border:1px solid var(--ibm-divider);color:var(--ibm-ink);padding:9px 16px;font-family:inherit;font-size:13px;font-weight:500;cursor:pointer;transition:border-color .12s,color .12s}
.retry:hover{border-color:var(--ibm-blue);color:var(--ibm-blue)}
/* Actionable, plain-language guidance under an error (top up / reconnect). */
.r-tip{font-size:13px;color:var(--ibm-muted);margin:8px 0 0;line-height:1.5;font-weight:300}
.r-status.err span:last-child{word-break:break-word;min-width:0}
.note{display:flex;gap:14px;margin-top:22px;padding:16px 18px;border:1px solid var(--ibm-border);background:var(--ibm-field)}
.note svg{flex:0 0 auto;width:20px;height:20px;color:var(--ibm-blue);margin-top:1px}
.note p{font-size:13px;color:var(--ibm-muted);line-height:1.6;font-weight:300}
.note p b{color:var(--ibm-ink);font-weight:600}
.note-aside{display:block;margin-top:8px;padding-top:8px;border-top:1px solid var(--ibm-border);color:var(--ibm-subtle);font-size:12px}
/* ── Forge demo (Demo 03): tier selector, model viewer, result actions ── */
.tier-row{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:18px}
.tier{flex:1 1 150px;min-width:0;text-align:left;background:var(--ibm-field);border:1px solid var(--ibm-divider);border-bottom:2px solid var(--ibm-divider);padding:12px 14px;cursor:pointer;font-family:var(--font-sans);color:var(--ibm-ink);transition:border-color .12s,background .12s,transform .04s;border-radius:2px}
.tier:hover{border-color:var(--ibm-blue);background:var(--ibm-field-focus)}
.tier:active{transform:translateY(1px)}
.tier:focus-visible{outline:2px solid var(--ibm-blue);outline-offset:2px}
.tier[aria-checked="true"]{border-color:var(--ibm-blue);border-bottom-color:var(--ibm-blue);background:var(--ibm-field-focus)}
.tier .t-name{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.tier .t-tier{font-size:14px;font-weight:600;text-transform:capitalize}
.tier .t-price{font-family:var(--font-mono);font-size:13px;color:var(--ibm-blue);font-variant-numeric:tabular-nums}
.tier .t-blurb{font-size:11px;color:var(--ibm-muted);margin-top:4px;line-height:1.45;font-weight:300}
.tier .t-eta{font-size:11px;color:var(--ibm-subtle);margin-top:6px;font-family:var(--font-mono)}
.mv-wrap{margin:12px 0 6px;border:1px solid var(--ibm-border);background:var(--ibm-field);position:relative;border-radius:2px;overflow:hidden}
.mv-wrap model-viewer{display:block;width:100%;height:min(56vh,440px);background:radial-gradient(circle at 50% 30%,#1c2530,#0c1116 70%)}
.mv-wrap .mv-progress{position:absolute;left:0;bottom:0;height:2px;background:var(--ibm-blue);width:0;transition:width .2s linear}
.r-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
.r-btn{display:inline-flex;align-items:center;gap:7px;background:var(--ibm-blue-fill);color:#fff;border:none;cursor:pointer;font-family:var(--font-sans);font-size:13px;font-weight:500;padding:10px 16px;border-radius:2px;text-decoration:none;transition:background .12s,transform .04s}
.r-btn:hover{background:var(--ibm-blue-fill-hover)}
.r-btn:active{transform:translateY(1px)}
.r-btn.ghost{background:none;border:1px solid var(--ibm-divider);color:var(--ibm-ink)}
.r-btn.ghost:hover{border-color:var(--ibm-blue);color:var(--ibm-blue)}
.r-btn:focus-visible{outline:2px solid var(--ibm-blue);outline-offset:2px}
.forge-foot{font-size:13px;color:var(--ibm-muted);margin-top:18px;font-weight:300}
.forge-foot a{font-weight:500}
/* Free text→3D widget — the no-wallet companion to the paid Forge */
.g3d{margin-top:32px;border:1px solid var(--ibm-border);background:var(--ibm-field);padding:24px}
.g3d-tag{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--ibm-blue);font-weight:500;margin-bottom:8px}
.g3d h4{font-size:20px;font-weight:300;margin:0 0 8px;color:var(--ibm-ink);max-width:none}
.g3d h4 strong{font-weight:600}
.g3d-sub{font-size:14px;color:var(--ibm-muted);line-height:1.6;margin:0 0 20px;max-width:640px}
.g3d-field{display:flex;gap:1px;flex-wrap:wrap;background:var(--ibm-border)}
.g3d-input{flex:1 1 280px;min-width:0;font-family:var(--font-sans);font-size:15px;color:var(--ibm-ink);background:var(--ibm-page);border:none;padding:0 16px;height:48px;outline:none}
.g3d-input:focus-visible{outline:2px solid var(--ibm-blue);outline-offset:-2px}
.g3d-btn{display:inline-flex;align-items:center;gap:10px;background:var(--ibm-blue);color:#fff;border:none;cursor:pointer;font-family:var(--font-sans);font-size:15px;font-weight:500;padding:0 24px;height:48px;transition:background .12s,transform .04s}
.g3d-btn:hover:not(:disabled){background:var(--ibm-blue-hover)}
.g3d-btn:active:not(:disabled){transform:translateY(1px)}
.g3d-btn:disabled{opacity:.7;cursor:not-allowed}
.g3d-btn:focus-visible{outline:2px solid var(--ibm-blue);outline-offset:2px}
.g3d-spin{width:15px;height:15px;border:2px solid rgba(255,255,255,.4);border-top-color:#fff;border-radius:50%;animation:spin .7s linear infinite;display:none}
.g3d-btn.loading .g3d-spin{display:inline-block}
.g3d-suggest{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.g3d-suggest button{font-family:inherit;font-size:13px;color:var(--ibm-muted);background:transparent;border:1px solid var(--ibm-border);padding:6px 12px;cursor:pointer;transition:border-color .12s,color .12s}
.g3d-suggest button:hover{border-color:var(--ibm-blue);color:var(--ibm-blue)}
.g3d-result{margin-top:20px;border:1px solid var(--ibm-border);background:var(--ibm-page)}
.g3d-result.is-empty{padding:28px 20px;text-align:center;font-size:14px;color:var(--ibm-subtle)}
.g3d-load{padding:28px 20px}
.g3d-bar{display:block;height:3px;background:var(--ibm-border);overflow:hidden;margin-bottom:16px}
.g3d-bar span{display:block;height:100%;width:40%;background:var(--ibm-blue);animation:g3dslide 1.3s ease-in-out infinite}
@keyframes g3dslide{0%{transform:translateX(-110%)}100%{transform:translateX(360%)}}
.g3d-loadmsg{font-size:14px;color:var(--ibm-muted);text-align:center}
.g3d-err{padding:24px 20px;text-align:center}
.g3d-err p{font-size:14px;color:var(--ibm-muted);margin:0 auto 16px;max-width:440px;line-height:1.6}
.g3d-retry{font-family:inherit;font-size:14px;font-weight:500;color:#fff;background:var(--ibm-blue);border:none;padding:10px 20px;cursor:pointer;transition:background .12s}
.g3d-retry:hover{background:var(--ibm-blue-hover)}
.g3d-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:14px 16px;border-top:1px solid var(--ibm-border)}
.g3d-act{display:inline-flex;align-items:center;font-family:inherit;font-size:14px;font-weight:500;text-decoration:none;padding:9px 16px;border:1px solid var(--ibm-blue);color:var(--ibm-blue);cursor:pointer;transition:background .12s}
.g3d-act:hover{background:rgba(15,98,254,.08);text-decoration:none}
.g3d-act.primary{background:var(--ibm-blue);color:#fff;border-color:var(--ibm-blue)}
.g3d-act.primary:hover{background:var(--ibm-blue-hover)}
.g3d-engine{font-size:12px;color:var(--ibm-subtle);margin-left:auto}
@media(max-width:560px){.g3d-btn{width:100%}.g3d-engine{margin-left:0;width:100%}}
@media(pointer:coarse){.tier,.r-btn{min-height:44px}}
/* embed snippet */
.embed-block{background:#161616;color:#e0e0e0;border:1px solid #393939;padding:18px 20px;overflow:auto;margin-top:24px;font-family:var(--font-mono);font-size:13px;line-height:1.6;white-space:pre}
.embed-block .c-tag{color:#82cfff}
.embed-block .c-attr{color:#a6c8ff}
.embed-block .c-str{color:#a7f0ba}
.embed-block .c-com{color:#a8a8a8}
.copy-row{display:flex;justify-content:flex-end;margin-top:10px}
.copy-btn{background:none;border:1px solid var(--ibm-divider);color:var(--ibm-muted);font-family:inherit;font-size:12px;font-weight:500;padding:7px 14px;cursor:pointer;transition:border-color .12s,color .12s}
.copy-btn:hover{border-color:var(--ibm-blue);color:var(--ibm-blue)}
/* footer */
.footer{padding:40px 0;color:var(--ibm-subtle);font-size:12px}
.footer-nav{display:flex;flex-wrap:wrap;gap:20px;margin-bottom:18px}
.footer-nav a{color:var(--ibm-muted);font-weight:500;font-size:13px}
.footer-nav a:hover{color:var(--ibm-blue)}
.footer-legal{padding-top:16px;border-top:1px solid var(--ibm-border);line-height:1.6}
/* Tablet: keep the 3-up strip but let it breathe; stack the field row earlier. */
@media(max-width:768px){
.section{padding:32px 0}
.hero{padding:44px 0 30px}
}
@media(max-width:640px){
.steps{grid-template-columns:1fr}
.demo-head{flex-direction:column;align-items:flex-start;gap:8px}
.price-tag{text-align:left}
.field-row{gap:14px}
.btn{width:100%;min-width:0}
.demo-head,.demo-body{padding-left:18px;padding-right:18px}
}
/* Small phones (≤360px, incl. 320px). Tighten gutters, keep mono strings contained,
and never let a long address/hash force a wide layout viewport (the documented iOS
overflow gotcha). overflow-wrap:anywhere is the belt-and-braces over word-break. */
@media(max-width:360px){
.inner{padding:0 12px}
.demo-head,.demo-body{padding-left:14px;padding-right:14px}
.hero h1{font-size:clamp(26px,8vw,34px)}
.price-tag .amt{font-size:26px}
.preview-row{gap:6px}
.preview-row .k{min-width:72px}
}
.preview-row .v,.receipt .rv,.match .m-name,.footer-legal{overflow-wrap:anywhere}
/* Touch devices: every interactive control clears the 44×44 px minimum. The
coarse-pointer query keeps desktop sizing compact while guaranteeing mobile taps. */
@media(pointer:coarse){
.pv-retry,.retry,.copy-btn,.err-banner button{min-height:44px;padding-top:10px;padding-bottom:10px}
.footer-nav a{display:inline-flex;align-items:center;min-height:44px}
.raw summary{min-height:44px;display:flex;align-items:center}
}
/* ── Demo nav strip (hero) ── */
.demo-nav{display:flex;flex-wrap:wrap;gap:8px;margin-top:26px}
.demo-nav a{font-size:13px;font-weight:500;color:var(--ibm-ink);border:1px solid var(--ibm-border);padding:8px 14px;border-radius:2px;transition:border-color .12s,color .12s,background .12s}
.demo-nav a:hover{border-color:var(--ibm-blue);color:var(--ibm-blue);background:var(--ibm-field);text-decoration:none}
.demo-nav a .n{font-family:var(--font-mono);color:var(--ibm-blue);margin-right:8px;font-size:11px}
/* ── Full-size live demo embed (Forge / Play / IRL) ── */
/* Each runs at full content width and most of the viewport height — these are
real production apps, presented full-size, lazy-loaded as they scroll in. */
.live-embed{border:1px solid var(--ibm-divider);background:var(--ibm-surface);margin-top:28px}
.live-embed .embed-bar{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:9px 16px;border-bottom:1px solid var(--ibm-border);font-size:12px;color:var(--ibm-subtle);font-weight:500}
.live-embed .bar-url{display:inline-flex;align-items:center;gap:8px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--font-mono)}
.live-embed .bar-url .dot{width:7px;height:7px;border-radius:50%;background:var(--ibm-amber);flex:0 0 auto;transition:background .2s}
.live-embed.loaded .bar-url .dot{background:var(--ibm-green)}
.live-embed.failed .bar-url .dot{background:var(--ibm-red)}
.live-embed .bar-actions{display:flex;gap:8px;flex:0 0 auto}
.live-embed .bar-actions button,.live-embed .bar-actions a{background:none;border:1px solid var(--ibm-divider);color:var(--ibm-ink);font-family:inherit;font-size:12px;font-weight:500;padding:6px 11px;cursor:pointer;border-radius:2px;display:inline-flex;align-items:center;gap:5px;text-decoration:none}
.live-embed .bar-actions button:hover,.live-embed .bar-actions a:hover{border-color:var(--ibm-blue);color:var(--ibm-blue)}
.embed-frame{position:relative;background:var(--ibm-field);height:min(78vh,820px)}
.embed-frame iframe{display:block;width:100%;height:100%;border:0;background:var(--ibm-field)}
/* Play runs the dark `noir` world (?biome=noir) — paint its frame, loading and
error states on the same #1c2530→#0c1116 stage the 3D viewers use, so the embed
reads as part of that surface in both themes and never flashes a light box. */
.play-embed .embed-frame,.play-embed .embed-frame iframe,.play-embed .embed-state{background:radial-gradient(circle at 50% 30%,#1c2530,#0c1116 70%)}
.play-embed .embed-state{color:#aebccd}
.play-embed .embed-state .es-hint{color:#8a9bb0}
.play-embed .embed-state .spin{border-color:rgba(255,255,255,.22);border-top-color:#78a9ff}
/* True full-screen via the Fullscreen API — the app fills the whole display. */
.live-embed:fullscreen{display:flex;flex-direction:column;background:var(--ibm-surface)}
.live-embed:fullscreen .embed-frame{flex:1;height:auto}
.live-embed:-webkit-full-screen{background:var(--ibm-surface)}
.embed-state{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;text-align:center;padding:24px;color:var(--ibm-subtle);font-size:14px;background:var(--ibm-field)}
.embed-state .spin{width:18px;height:18px;border:2px solid var(--ibm-divider);border-top-color:var(--ibm-blue);border-radius:50%;animation:spin .8s linear infinite}
.embed-state .es-hint{font-size:12px;color:var(--ibm-subtle);max-width:44ch;font-weight:300;line-height:1.55}
.embed-err{display:none}
.live-embed.loaded .embed-load{display:none}
.live-embed.failed .embed-load{display:none}
.live-embed.failed .embed-err{display:flex}
.embed-err a{font-weight:600}
@media(pointer:coarse){.demo-nav a,.live-embed .bar-actions button,.live-embed .bar-actions a{min-height:44px}}
@media(prefers-reduced-motion:reduce){
*,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}
}
</style>
<link rel="canonical" href="https://three.ws/ibm/hello">
<meta property="og:site_name" content="three.ws">
<meta property="og:url" content="https://three.ws/ibm/x402-demo">
<meta property="og:image" content="https://three.ws/api/page-og?s=crypto&t=IBM+%C3%97+three.ws+partnership&d=The+IBM+%C3%97+three.ws+partnership+page%3A+how+three.ws%27s+agent+identity%2C+x402+payment+rails%2C+and+MCP+servers+integrate+with+IBM+watsonx+and+the+IBM+x402+ecosystem.&p=%2Fibm%2Fhello">
<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="x402 Live Demo (IBM × three.ws) · three.ws" data-i18n-attr="content:ibm_hello.meta_twitter_title">
<meta name="twitter:description" content="A self-contained x402 micropayment demo: pay $0.001 USDC from your own wallet — MetaMask on Base or Phantom on Solana — to call a real three.ws data API. Watch the live HTTP 402 challenge, sign a gasless authorization, and see the on-chain settlement receipt. No backend, no account; built as the public face of the IBM × three.ws partnership." data-i18n-attr="content:ibm_hello.meta_twitter_description">
<meta name="twitter:image" content="https://three.ws/api/page-og?s=crypto&t=IBM+%C3%97+three.ws+partnership&d=The+IBM+%C3%97+three.ws+partnership+page%3A+how+three.ws%27s+agent+identity%2C+x402+payment+rails%2C+and+MCP+servers+integrate+with+IBM+watsonx+and+the+IBM+x402+ecosystem.&p=%2Fibm%2Fhello">
<script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","name":"x402 Live Demo (IBM × three.ws)","description":"A self-contained x402 micropayment demo: pay $0.001 USDC from your own wallet — MetaMask on Base or Phantom on Solana — to call a real three.ws data API. Watch the live HTTP 402 challenge, sign a gasless authorization, and see the on-chain settlement receipt. No backend, no account; built as the public face of the IBM × three.ws partnership.","url":"https://three.ws/ibm/x402-demo","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"}}</script>
<!-- model-viewer renders the GLB returned by the paid Forge demo (Demo 01).
Self-hosted (travels with this file under ./vendor/) so the page needs no
third-party script CDN — a strict `script-src 'self'` host won't block it.
The forged GLBs are uncompressed glTF with embedded textures, so model-viewer
loads no external Draco/KTX2 decoder; its only fetch is the GLB from three.ws.
It is loaded lazily (see ensureModelViewer below) only after a model is forged,
so the 955 KB bundle never costs a page view that doesn't use it, and its bundled
Three.js doesn't co-exist with the agent's at idle. -->
<meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1">
<meta property="og:locale" content="en_US">
<meta property="og:image:alt" content="x402 Live Demo (IBM × three.ws) — three.ws">
<meta name="twitter:site" content="@trythreews">
</head>
<body>
<!-- ════════════════════════════════════════════════════════════════════════════
GENERATED — do not edit by hand. Source: pages/ibm/hello.live.html
Regenerate with: npm run build:ibm-shell
This is the PUBLISH-ONCE file. It is the complete partnership page, baked in,
so it renders with no dependency on three.ws. On load it fetches the latest
version from https://three.ws/ibm/hello.live and swaps it in if reachable (and caches it); if
three.ws is unreachable the baked page below runs instead. Edit the content
at hello.live.html on three.ws — your edits go live here automatically, with
no re-publish. See HOSTING.md.
════════════════════════════════════════════════════════════════════════════ -->
<div id="ibm-app">
<a href="#forge" class="skip-link" data-i18n="ibm_hello.skip_to_the_demos">Skip to the demos</a>
<div class="err-banner" id="errBanner" role="alert">
<span id="errBannerText" data-i18n="ibm_hello.something_went_wrong">Something went wrong.</span>
<button type="button" id="errBannerClose" data-i18n="ibm_hello.dismiss">Dismiss</button>
</div>
<!-- ══ IBM MASTHEAD + BREADCRUMB ══
The IBM.com global-navigation design language: a thin top bar with the IBM
wordmark, primary product links (to real ibm.com destinations), and the
search / account / app-grid icons, followed by a content breadcrumb. The
masthead logo is the neutral IBM Plex wordmark, NOT the registered 8-bar
mark — a defensible placeholder; confirm the exact lockup with IBM brand
before public launch (see HOSTING.md, "Note on branding"). -->
<style id="ibm-shell-styles">
.ibm-mast{position:sticky;top:0;z-index:40;background:var(--ibm-surface);border-bottom:1px solid var(--ibm-border)}
.ibm-mast .mast-inner{display:flex;align-items:center;height:48px;padding:0 16px;gap:0}
.ibm-mast .mast-logo{display:inline-flex;align-items:center;height:100%;padding:0 16px 0 0;font-weight:700;font-size:18px;letter-spacing:-.01em;color:var(--ibm-ink);line-height:1}
.ibm-mast .mast-logo:hover{text-decoration:none;color:var(--ibm-blue)}
.ibm-mast .mast-logo:focus-visible{outline:2px solid var(--ibm-blue);outline-offset:-2px}
.ibm-mast .mast-nav{display:flex;align-items:stretch;height:100%;flex:1 1 auto;min-width:0}
.ibm-mast .mast-nav a{display:inline-flex;align-items:center;height:100%;padding:0 16px;font-size:14px;font-weight:400;color:var(--ibm-ink);border-bottom:2px solid transparent;transition:background .12s,border-color .12s,color .12s}
.ibm-mast .mast-nav a:hover{background:var(--ibm-field);text-decoration:none;border-bottom-color:var(--ibm-blue)}
.ibm-mast .mast-nav a:focus-visible{outline:2px solid var(--ibm-blue);outline-offset:-2px}
.ibm-mast .mast-actions{display:flex;align-items:stretch;height:100%;margin-left:auto;flex:0 0 auto}
.ibm-mast .mast-actions a{display:inline-flex;align-items:center;justify-content:center;width:48px;height:100%;color:var(--ibm-ink);transition:background .12s,color .12s}
.ibm-mast .mast-actions a:hover{background:var(--ibm-field);color:var(--ibm-blue)}
.ibm-mast .mast-actions a:focus-visible{outline:2px solid var(--ibm-blue);outline-offset:-2px}
.ibm-mast .mast-actions svg{width:20px;height:20px;display:block}
.breadcrumb{border-bottom:1px solid var(--ibm-border)}
.breadcrumb ol{display:flex;flex-wrap:wrap;align-items:center;gap:8px;list-style:none;margin:0 auto;max-width:880px;padding:14px 16px;font-size:14px}
.breadcrumb li{display:inline-flex;align-items:center;gap:8px;color:var(--ibm-subtle)}
.breadcrumb li+li::before{content:"/";color:var(--ibm-divider);font-size:14px}
.breadcrumb a{color:var(--ibm-link)}
.breadcrumb a:hover{text-decoration:underline}
.breadcrumb [aria-current="page"]{color:var(--ibm-subtle)}
@media(max-width:671px){
.ibm-mast .mast-nav{display:none}
.breadcrumb ol{padding:12px}
}
</style>
<nav class="ibm-mast" aria-label="IBM">
<div class="mast-inner">
<a class="mast-logo" href="https://www.ibm.com" target="_blank" rel="noopener" aria-label="IBM home" data-i18n="ibm_hello.ibm" data-i18n-attr="aria-label:ibm_hello.ibm_home_arialabel">IBM</a>
<div class="mast-nav">
<a href="https://www.ibm.com/products/software" target="_blank" rel="noopener" data-i18n="ibm_hello.software">Software</a>
<a href="https://www.ibm.com/it-infrastructure" target="_blank" rel="noopener" data-i18n="ibm_hello.infrastructure">Infrastructure</a>
<a href="https://www.ibm.com/consulting" target="_blank" rel="noopener" data-i18n="ibm_hello.consulting">Consulting</a>
<a href="https://www.ibm.com/support" target="_blank" rel="noopener" data-i18n="ibm_hello.support">Support</a>
<a href="https://www.ibm.com/think" target="_blank" rel="noopener" data-i18n="ibm_hello.think">Think</a>
</div>
<div class="mast-actions">
<a href="https://www.ibm.com/search" target="_blank" rel="noopener" aria-label="Search ibm.com" data-i18n-attr="aria-label:ibm_hello.search_ibm_com_arialabel">
<svg viewBox="0 0 32 32" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><circle cx="14" cy="14" r="9"/><path d="M21 21l6 6" stroke-linecap="round"/></svg>
</a>
<a href="https://www.ibm.com/account" target="_blank" rel="noopener" aria-label="IBM account" data-i18n-attr="aria-label:ibm_hello.ibm_account_arialabel">
<svg viewBox="0 0 32 32" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><circle cx="16" cy="11" r="5"/><path d="M6 27c0-5 4.5-8 10-8s10 3 10 8" stroke-linecap="round"/></svg>
</a>
<a href="https://www.ibm.com" target="_blank" rel="noopener" aria-label="IBM products and tools" data-i18n-attr="aria-label:ibm_hello.ibm_products_and_tools_arialabel">
<svg viewBox="0 0 32 32" fill="currentColor" aria-hidden="true"><rect x="4" y="4" width="7" height="7"/><rect x="13" y="4" width="7" height="7"/><rect x="22" y="4" width="7" height="7"/><rect x="4" y="13" width="7" height="7"/><rect x="13" y="13" width="7" height="7"/><rect x="22" y="13" width="7" height="7"/><rect x="4" y="22" width="7" height="7"/><rect x="13" y="22" width="7" height="7"/><rect x="22" y="22" width="7" height="7"/></svg>
</a>
</div>
</div>
</nav>
<nav class="breadcrumb" aria-label="Breadcrumb">
<ol>
<li data-i18n-html="ibm_hello.home"><a href="https://www.ibm.com" target="_blank" rel="noopener">Home</a></li>
<li data-i18n-html="ibm_hello.strategic_partnerships"><a href="https://www.ibm.com/partnerplus" target="_blank" rel="noopener">Strategic Partnerships</a></li>
<li data-i18n-html="ibm_hello.three_ws"><span aria-current="page">three.ws</span></li>
</ol>
</nav>
<!-- ══ HERO ══ -->
<header class="hero">
<div class="inner">
<p class="hero-eyebrow" data-i18n="ibm_hello.strategic_partnership">Strategic partnership</p>
<h1 data-i18n-html="ibm_hello.ibm_and_three_ws_partnership">IBM and <strong>three.ws</strong> partnership</h1>
<p class="hero-sub" data-i18n="ibm_hello.ibm_and_three_ws_work_together_to">IBM® and three.ws work together to unite payments, data, 3D and AI — pairing IBM Granite on watsonx.ai with three.ws's on-chain micropayments and 3D agent engine, so developers and brands can deliver trusted, personalized agent experiences at scale.</p>
<div class="hero-cta">
<a class="btn" href="#forge" data-i18n-html="ibm_hello.explore_the_live_demos">Explore the live demos <span class="arrow" aria-hidden="true">→</span></a>
<a class="btn-tertiary" href="https://three.ws/docs/ibm" target="_blank" rel="noopener" data-i18n-html="ibm_hello.explore_ibm_and_three_ws_technology_collabor">Explore IBM and three.ws technology collaborations <span aria-hidden="true">→</span></a>
</div>
<p class="hero-note" data-i18n-html="ibm_hello.every_demo_below_runs_against_real_productio">Every demo below runs against real, production three.ws systems: pay a few cents to turn text into a 3D model, forge a rigged avatar from a sentence, pose it by hand, fly a 3D galaxy of agents mapped by <span class="mono">IBM Granite</span>, enter a shared world, or place an agent in augmented reality. The paid Forge settles real USDC — or <span class="mono">$THREE</span> — from your own wallet; the rest are free, no wallet needed. Nothing is mocked.</p>
<nav class="demo-nav" aria-label="The demos on this page">
<a href="#webinar" class="nav-live" data-i18n-html="ibm_hello.watch_live"><span class="live-dot" aria-hidden="true"></span>Watch live</a>
<a href="#forge" data-i18n-html="ibm_hello.01forge"><span class="n">01</span>Forge</a>
<a href="#demo" data-i18n-html="ibm_hello.02avatars"><span class="n">02</span>Avatars</a>
<a href="#pose" data-i18n-html="ibm_hello.03pose"><span class="n">03</span>Pose</a>
<a href="#galaxy" data-i18n-html="ibm_hello.04galaxy"><span class="n">04</span>Galaxy</a>
<a href="#play" data-i18n-html="ibm_hello.05play"><span class="n">05</span>Play</a>
<a href="#irl" data-i18n-html="ibm_hello.06irl"><span class="n">06</span>IRL</a>
</nav>
</div>
</header>
<main>
<!-- ══ PARTNERSHIP HIGHLIGHTS · the proof grid (covers the whole stack) ══
IBM-partnership-page convention: a grid of icon tiles that states what is
real and broad before the demos show what it does. Every figure here is
structural and verifiable from this repo (STRUCTURE.md) — no invented metrics. -->
<style id="hl-styles">
.hl-sec{padding:44px 0 40px;border-bottom:1px solid var(--ibm-border)}
.hl-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;background:var(--ibm-border);border:1px solid var(--ibm-border);margin-top:28px;list-style:none}
.hl{background:var(--ibm-surface);padding:24px 22px;display:flex;flex-direction:column;gap:10px}
.hl-ico{width:26px;height:26px;color:var(--ibm-blue)}
.hl-ico svg{width:100%;height:100%;display:block}
.hl-stat{font-size:24px;font-weight:300;line-height:1.1;color:var(--ibm-ink)}
.hl-stat strong{font-weight:600}
.hl h3{font-size:13px;font-weight:600;color:var(--ibm-ink);letter-spacing:.01em}
.hl p{font-size:13px;color:var(--ibm-muted);font-weight:300;line-height:1.55}
.hl p a{font-weight:500}
@media(max-width:768px){.hl-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:520px){.hl-grid{grid-template-columns:1fr}}
</style>
<section class="section hl-sec" id="highlights" aria-labelledby="hl-h">
<div class="inner">
<div class="section-tag">Partnership highlights</div>
<h2 id="hl-h" data-i18n-html="ibm_hello.one_stack_3d_ai_and_on_chain">One stack: <strong>3D, AI, and on-chain payments</strong>, wired together</h2>
<p class="section-lead" data-i18n="ibm_hello.three_ws_turns_a_sentence_into_a">three.ws turns a sentence into a rigged 3D agent, gives it identity and memory on-chain, lets it earn and spend in real time over x402, and reasons about all of it with IBM Granite on watsonx.ai. The demos below are the moving parts — here's the whole machine.</p>
<ul class="hl-grid">
<li class="hl">
<span class="hl-ico" aria-hidden="true"><svg viewBox="0 0 32 32" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"><path d="M16 3l11 6v14l-11 6-11-6V9z"/><path d="M5 9l11 6 11-6M16 15v14"/></svg></span>
<div class="hl-stat"><strong data-i18n="ibm_hello.text_3d">Text → 3D</strong> in one call</div>
<h3 data-i18n="ibm_hello.real_time_3d_engine">Real-time 3D engine</h3>
<p data-i18n="ibm_hello.a_prompt_becomes_a_textured_auto_rigged">A prompt becomes a textured, auto-rigged GLB (Microsoft TRELLIS on NVIDIA NIM), then walks, poses, and inhabits shared worlds — six live demos on this page, nothing mocked.</p>
</li>
<li class="hl">
<span class="hl-ico" aria-hidden="true"><svg viewBox="0 0 32 32" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"><rect x="9" y="9" width="14" height="14" rx="2"/><path d="M13 3v4M19 3v4M13 25v4M19 25v4M3 13h4M3 19h4M25 13h4M25 19h4"/></svg></span>
<div class="hl-stat"><strong data-i18n="ibm_hello.ibm_granite">IBM Granite</strong> on watsonx.ai</div>
<h3 data-i18n="ibm_hello.trusted_ai_layer">Trusted AI layer</h3>
<p data-i18n="ibm_hello.granite_embeddings_place_every_agent_in_a">Granite embeddings place every agent in a 3D map by meaning and name each constellation; Granite Guardian screens generated content. The reasoning and safety layer over the whole platform.</p>
</li>
<li class="hl">
<span class="hl-ico" aria-hidden="true"><svg viewBox="0 0 32 32" fill="none" stroke="currentColor" stroke-width="2"><circle cx="16" cy="16" r="12"/><path d="M16 9v14M19.5 12.5c0-1.7-1.6-3-3.5-3s-3.5 1.3-3.5 3 1.6 3 3.5 3 3.5 1.3 3.5 3-1.6 3-3.5 3-3.5-1.3-3.5-3" stroke-linecap="round"/></svg></span>
<div class="hl-stat"><strong data-i18n="ibm_hello.x402">x402</strong> micropayments</div>
<h3 data-i18n="ibm_hello.pay_per_call_sub_cent">Pay-per-call, sub-cent</h3>
<p data-i18n-html="ibm_hello.agents_and_visitors_pay_for_a_single">Agents and visitors pay for a single API call with a gasless authorization — in USDC or <span class="mono">$THREE</span>, settled on Base or Solana mainnet. The open <a href="https://three.ws/docs/x402" target="_blank" rel="noopener">x402</a> rail, live on this page.</p>
</li>
<li class="hl">
<span class="hl-ico" aria-hidden="true"><svg viewBox="0 0 32 32" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"><path d="M16 3l11 4v8c0 7-4.6 11.5-11 14C9.6 26.5 5 22 5 15V7z"/><path d="M11.5 16l3 3 6-6" stroke-linecap="round"/></svg></span>
<div class="hl-stat"><strong data-i18n="ibm_hello.erc_8004">ERC-8004</strong> identity</div>
<h3 data-i18n="ibm_hello.on_chain_agents">On-chain agents</h3>
<p data-i18n="ibm_hello.every_agent_carries_portable_identity_and_re">Every agent carries portable identity and reputation on-chain, plus skill licenses minted as 1/1 SPL NFTs — verifiable access without a database in the trust path. Solana + EVM.</p>
</li>
<li class="hl">
<span class="hl-ico" aria-hidden="true"><svg viewBox="0 0 32 32" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"><rect x="4" y="4" width="10" height="10" rx="1.5"/><rect x="18" y="4" width="10" height="10" rx="1.5"/><rect x="4" y="18" width="10" height="10" rx="1.5"/><rect x="18" y="18" width="10" height="10" rx="1.5"/></svg></span>
<div class="hl-stat"><strong>37</strong> MCP servers</div>
<h3 data-i18n="ibm_hello.agent_native_tools">Agent-native tools</h3>
<p data-i18n-html="ibm_hello.3d_payments_trading_intel_identity_and_prove">3D, payments, trading intel, identity, and provenance exposed to any AI agent through the <a href="https://three.ws/docs/mcp" target="_blank" rel="noopener">Model Context Protocol</a> — 31 npm packages and 6 hosted servers in the public registry.</p>
</li>
<li class="hl">
<span class="hl-ico" aria-hidden="true"><svg viewBox="0 0 32 32" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 10l-6 6 6 6M21 10l6 6-6 6"/></svg></span>
<div class="hl-stat"><strong>18</strong> zero-dep SDKs</div>
<h3 data-i18n="ibm_hello.build_on_the_rail">Build on the rail</h3>
<p data-i18n-html="ibm_hello.single_import_three_ws_clients_wrap_the">Single-import <span class="mono">@three-ws/*</span> clients wrap the live APIs — forge, voice, names, intel, x402, reputation — pure ESM, no build step, 216 tests green.</p>
</li>
</ul>
</div>
</section>
<!-- ══ WEBINAR · live stage (countdown → synced premiere / live OBS) ══ -->
<style id="wb-styles">
.webinar{padding:34px 0 40px;border-bottom:1px solid var(--ibm-border)}
.wb-head{margin-bottom:18px}
.wb-stage{position:relative;aspect-ratio:16/9;width:100%;background:
radial-gradient(120% 120% at 80% -10%,rgba(15,98,254,.28),transparent 55%),
radial-gradient(90% 90% at 0% 110%,rgba(120,169,255,.16),transparent 55%),#0b0b0d;
border:1px solid var(--ibm-divider);overflow:hidden;border-radius:2px}
.wb-fill{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:20px;color:#fff}
.wb-fill[hidden]{display:none}
.wb-kicker{font-family:var(--font-mono);font-size:12px;letter-spacing:.12em;text-transform:uppercase;color:#a6c8ff;margin-bottom:6px}
.wb-stage-title{font-size:clamp(18px,3.4vw,28px);font-weight:300;line-height:1.15;max-width:560px;margin:0 0 22px;color:#fff}
.wb-stage-title strong{font-weight:600}
.wb-countdown{display:flex;align-items:flex-start;gap:clamp(8px,2.4vw,22px);font-variant-numeric:tabular-nums}
.wb-cell{display:flex;flex-direction:column;align-items:center;min-width:54px}
.wb-num{font-size:clamp(34px,7.2vw,66px);font-weight:200;line-height:1;color:#fff}
.wb-lbl{font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:rgba(255,255,255,.62);margin-top:8px}
.wb-colon{font-size:clamp(28px,6vw,54px);font-weight:200;color:rgba(255,255,255,.35);line-height:1;padding-top:2px}
.wb-soon{margin-top:20px;font-size:13px;color:rgba(255,255,255,.7);max-width:440px;line-height:1.55}
.wb-spinner{width:34px;height:34px;border:3px solid rgba(255,255,255,.25);border-top-color:#78a9ff;border-radius:50%;animation:wbspin .9s linear infinite;margin-bottom:14px}
@keyframes wbspin{to{transform:rotate(360deg)}}
.wb-retry{margin-top:18px;background:rgba(255,255,255,.12);color:#fff;border:1px solid rgba(255,255,255,.4);cursor:pointer;font-family:var(--font-sans);font-size:13px;font-weight:600;padding:9px 16px;border-radius:2px;transition:background .12s}
.wb-retry[hidden]{display:none}
.wb-retry:hover{background:rgba(255,255,255,.22)}
.wb-retry:focus-visible{outline:2px solid var(--focus-ring-color, #fff);outline-offset:2px}
.wb-player{position:absolute;inset:0;background:#000}
.wb-player[hidden]{display:none}
.wb-player>video,.wb-player>iframe{width:100%;height:100%;display:block;border:0;background:#000;object-fit:contain}
.wb-badge{position:absolute;top:12px;left:12px;z-index:3;display:inline-flex;align-items:center;gap:7px;background:rgba(218,30,40,.95);color:#fff;font-family:var(--font-sans);font-size:11px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;padding:5px 10px;border-radius:2px}
.wb-badge[hidden]{display:none}
.wb-badge .d{width:7px;height:7px;border-radius:50%;background:#fff;animation:wbpulse 1.4s var(--ease) infinite}
@keyframes wbpulse{0%,100%{opacity:1}50%{opacity:.25}}
.wb-unmute{position:absolute;bottom:14px;right:14px;z-index:3;display:inline-flex;align-items:center;gap:8px;background:rgba(255,255,255,.94);color:#161616;border:none;cursor:pointer;font-family:var(--font-sans);font-size:13px;font-weight:600;padding:9px 14px;border-radius:2px;box-shadow:0 4px 16px rgba(0,0,0,.4)}
.wb-unmute[hidden]{display:none}
.wb-unmute:hover{background:#fff}
.wb-unmute:focus-visible{outline:2px solid var(--ibm-blue);outline-offset:2px}
.wb-meta{display:flex;flex-wrap:wrap;align-items:center;gap:14px;justify-content:space-between;margin-top:16px}
.wb-when{font-size:14px;color:var(--ibm-muted);font-weight:300}
.wb-when b{color:var(--ibm-ink);font-weight:500}
.wb-actions{display:flex;flex-wrap:wrap;gap:10px}
.wb-cal{display:inline-flex;align-items:center;gap:8px;background:transparent;color:var(--ibm-link);border:1px solid var(--ibm-divider);cursor:pointer;font-family:var(--font-sans);font-size:13px;font-weight:500;padding:8px 14px;border-radius:2px;text-decoration:none;transition:border-color .12s,background .12s}
.wb-cal:hover{border-color:var(--ibm-blue);background:var(--ibm-field)}
.wb-cal:focus-visible{outline:2px solid var(--ibm-blue);outline-offset:2px}
.wb-cal svg{width:15px;height:15px;flex:0 0 auto}
.demo-nav a.nav-live .live-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--ibm-red);margin-right:7px;vertical-align:middle;animation:wbpulse 1.4s var(--ease) infinite}
.wb-gate{gap:0}
.wb-gate[hidden]{display:none}
.wb-lock{width:34px;height:34px;color:#78a9ff;margin-bottom:16px}
.wb-gate-row{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin-top:6px;width:100%;max-width:420px}
.wb-gate-input{flex:1 1 220px;min-width:0;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.38);color:#fff;font-family:var(--font-sans);font-size:15px;padding:0 14px;height:46px;border-radius:2px}
.wb-gate-input::placeholder{color:rgba(255,255,255,.55)}
.wb-gate-input:focus-visible{outline:2px solid #78a9ff;outline-offset:1px;background:rgba(255,255,255,.14)}
.wb-gate-btn{flex:0 0 auto;background:var(--ibm-blue-fill);color:#fff;border:none;cursor:pointer;font-family:var(--font-sans);font-size:15px;font-weight:500;padding:0 22px;height:46px;border-radius:2px;transition:background .12s}
.wb-gate-btn:hover{background:var(--ibm-blue-fill-hover)}
.wb-gate-btn:focus-visible{outline:2px solid var(--focus-ring-color, #fff);outline-offset:2px}
.wb-gate-err{margin-top:14px;font-size:13px;color:#ffb3b8}
.wb-gate-err[hidden]{display:none}
</style>
<section class="section webinar" id="webinar" aria-labelledby="wb-h">
<div class="inner">
<div class="wb-head">
<div class="section-tag">Live · IBM community webinar</div>
<h2 id="wb-h" data-i18n-html="ibm_hello.watch_the_live_walkthrough">Watch the <strong>live walkthrough</strong></h2>
<p class="section-lead" data-i18n="ibm_hello.a_guided_tour_of_x402_micropayments_and">A guided tour of x402 micropayments and 3D AI agents — with every demo on this page running in real time. Can't make it live? The recording stays right here afterward.</p>
</div>
<div class="wb-stage" id="wbStage" role="region" aria-label="Webinar player">
<span class="wb-badge" id="wbBadge" hidden data-i18n-html="ibm_hello.live_now"><span class="d" aria-hidden="true"></span>Live now</span>
<!-- PRE-EVENT · countdown -->
<div class="wb-fill wb-pre" id="wbPre">
<div class="wb-kicker" id="wbKicker">Starts in</div>
<h3 class="wb-stage-title" id="wbStageTitle" data-i18n-html="ibm_hello.three_ws_ibm_agentic_commerce_live">three.ws × <strong>IBM</strong> — agentic commerce, live</h3>
<div class="wb-countdown" id="wbCountdown" role="timer" aria-live="off" aria-label="Time until the webinar begins">
<div class="wb-cell"><span class="wb-num" id="wbD">00</span><span class="wb-lbl" data-i18n="ibm_hello.days">Days</span></div>
<span class="wb-colon" aria-hidden="true">:</span>
<div class="wb-cell"><span class="wb-num" id="wbH">00</span><span class="wb-lbl" data-i18n="ibm_hello.hours">Hours</span></div>
<span class="wb-colon" aria-hidden="true">:</span>
<div class="wb-cell"><span class="wb-num" id="wbM">00</span><span class="wb-lbl" data-i18n="ibm_hello.minutes">Minutes</span></div>
<span class="wb-colon" aria-hidden="true">:</span>
<div class="wb-cell"><span class="wb-num" id="wbS">00</span><span class="wb-lbl" data-i18n="ibm_hello.seconds">Seconds</span></div>
</div>
<p class="wb-soon" id="wbSoon" data-i18n="ibm_hello.add_it_to_your_calendar_so_you">Add it to your calendar so you don't miss it.</p>
</div>
<!-- LIVE · stream not yet attached, or a designed error state (graceful) -->
<div class="wb-fill wb-holding" id="wbHolding" hidden>
<div class="wb-spinner" id="wbSpinner" aria-hidden="true"></div>
<h3 class="wb-stage-title" id="wbHoldTitle" data-i18n="ibm_hello.we_re_about_to_begin">We're about to begin</h3>
<p class="wb-soon" id="wbHoldMsg" data-i18n="ibm_hello.the_stream_will_appear_here_the_moment">The stream will appear here the moment it starts.</p>
<button class="wb-retry" id="wbRetry" type="button" hidden data-i18n="ibm_hello.reload_the_player">Reload the player</button>
</div>
<!-- POST-EVENT · password-gated replay -->
<form class="wb-fill wb-gate" id="wbGate" hidden>
<svg class="wb-lock" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><rect x="4" y="11" width="16" height="9" rx="1.5"/><path d="M8 11V8a4 4 0 018 0v3"/></svg>
<h3 class="wb-stage-title" data-i18n="ibm_hello.this_session_has_ended">This session has ended</h3>
<p class="wb-soon" id="wbGateMsg" data-i18n="ibm_hello.the_replay_is_private_enter_the_access">The replay is private. Enter the access password to watch the recording.</p>
<div class="wb-gate-row">
<input class="wb-gate-input" id="wbGateInput" type="password" autocomplete="off" autocapitalize="off" spellcheck="false" aria-label="Replay access password" placeholder="Access password">
<button class="wb-gate-btn" id="wbGateBtn" type="submit" data-i18n="ibm_hello.unlock">Unlock</button>
</div>
<p class="wb-gate-err" id="wbGateErr" role="alert" hidden data-i18n="ibm_hello.that_password_didn_t_match_try_again">That password didn't match. Try again.</p>
</form>
<!-- LIVE / REPLAY · player mounts here -->
<div class="wb-player" id="wbPlayer" hidden></div>
<button class="wb-unmute" id="wbUnmute" type="button" hidden>
<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3a4.5 4.5 0 00-2.5-4v8a4.5 4.5 0 002.5-4z"/></svg>
Tap to unmute
</button>
</div>
<div class="wb-meta">
<div class="wb-when" id="wbWhen">Loading the schedule…</div>
<div class="wb-actions">
<a class="wb-cal" id="wbGcal" target="_blank" rel="noopener">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="4" width="18" height="18" rx="2"/><path d="M16 2v4M8 2v4M3 10h18"/></svg>
Google Calendar
</a>
<button class="wb-cal" id="wbIcs" type="button">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3"/></svg>
Add to calendar (.ics)
</button>
</div>
</div>
</div>
</section>
<script type="application/ibm-baked" data-ibm-type="">
/* Webinar stage — countdown → wall-clock-synced premiere or live OBS feed.
Self-contained, no platform API dependency, so it runs verbatim on live.ibm.com.
─────────────────────────────────────────────────────────────────────────────
TO GO LIVE: edit the WEBINAR config below. Today only `startTime` matters —
the stage shows a countdown to it. When the recording or stream is ready,
paste ONE source (vodHls / mp4 / liveHls / youTubeId) and the stage becomes
the player automatically. Recommended host: Cloudflare Stream (one product
does both the uploaded recording's HLS and an OBS RTMP/SRT live ingest);
a plain MP4 on R2 is the zero-setup fallback for a pre-recorded talk.
───────────────────────────────────────────────────────────────────────────── */
(function () {
const WEBINAR = {
// ⚠️ SET THE REAL START TIME — ISO 8601 with timezone offset (Z = UTC).
// Set to 6:00 PM Pacific on Jun 24, 2026. June is daylight time (PDT =
// UTC−7), so the −07:00 offset below is the correct "6pm Pacific" — it
// equals 2026-06-25T01:00:00Z. If you literally mean PST (UTC−8), change
// the offset to −08:00; if the talk is a different calendar day, change
// the date.
startTime: '2026-06-24T18:00:00-07:00',
durationMin: 60, // SET to the recorded video's length → when the stage flips to "replay"
title: 'three.ws × IBM — agentic commerce, live',
details: 'A live walkthrough of x402 micropayments and 3D AI agents on three.ws. Demos run in real time at https://three.ws/ibm/x402-demo',
location: 'https://three.ws/ibm/x402-demo',
// ── Video source — leave ALL blank for countdown-only. Fill exactly ONE
// when ready. Resolution priority: liveHls → vodHls → mp4 → youTubeId.
liveHls: '', // OBS → ingest → HLS (.m3u8) live feed
vodHls: '', // Cloudflare Stream / Mux HLS (.m3u8) of the recording (synced premiere)
mp4: '', // ⭐ PRE-RECORDED TALK: paste a web-optimized MP4 URL here (synced premiere).
// Self-host on a three.ws-served origin so the host CSP's media-src
// can allow it without a third-party CDN; a plain MP4 needs no hls.js.
youTubeId: '', // YouTube video / live id → iframe (its own premiere/live)
// 'premiere' = a finished recording played wall-clock-synced so it behaves
// like a live broadcast (the plan for Jun 24). Switch to 'live' ONLY for a
// real OBS/RTMP feed via liveHls.
mode: 'premiere', // 'auto' | 'premiere' | 'live'
// ── After the event ENDS — what the stage becomes once the countdown is over
// and the slot has passed. Leave blank for the default "Thanks for joining"
// card. Set endLoop to a muted MP4 (e.g. a highlight reel / ambient loop) and
// it plays full-stage, looping forever, the instant the countdown expires.
// A real recording (vodHls/mp4 above) always wins over this — those become a
// proper replay; endLoop is the no-recording fallback so the stage never dies.
endLoop: '', // looped, muted highlight reel shown after the event ends (MP4)
// ── REPLAY POLICY — what the recording does once the live window has passed.
// 'password' — the replay is private, gated behind replayPasswordSha256.
// With no hash set it stays fully locked (the "ended" card),
// so the talk is never freely replayable.
// 'off' — no replay at all; the stage shows the "session ended" card.
// 'open' — the recording becomes a normal, seekable replay (legacy).
replay: 'off',
// SHA-256 hex of the replay password — NOT the password itself, so it can't
// be read from page source. Generate it once:
// echo -n 'your-password' | shasum -a 256
// (browser) crypto.subtle.digest('SHA-256', new TextEncoder().encode('your-password'))
// .then(b => console.log([...new Uint8Array(b)].map(x=>x.toString(16).padStart(2,'0')).join('')))
// Leave blank to keep the replay locked until you set it. NOTE: a client-side
// gate keeps casual viewers out, but once unlocked the MP4 URL is visible in
// the network panel — for hard protection, serve the video from signed/
// expiring URLs (e.g. Cloudflare Stream signed playback).
replayPasswordSha256: '',
};
const startMs = Date.parse(WEBINAR.startTime);
if (!Number.isFinite(startMs)) { console.warn('[webinar] invalid startTime'); return; }
const endMs = startMs + WEBINAR.durationMin * 60_000;
const $ = (id) => document.getElementById(id);
const stage = $('wbStage'), pre = $('wbPre'), holding = $('wbHolding'),
player = $('wbPlayer'), badge = $('wbBadge'), unmute = $('wbUnmute'),
gate = $('wbGate'), gateInput = $('wbGateInput'), gateErr = $('wbGateErr');
// Replay gate: a 64-hex SHA-256 of the access password. The plaintext password
// is never in the page — we hash what the viewer types and compare.
const REPLAY_HASH = String(WEBINAR.replayPasswordSha256 || '').trim().toLowerCase();
const replayHashSet = /^[0-9a-f]{64}$/.test(REPLAY_HASH);
async function sha256Hex(str) {
const buf = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(str));
return Array.from(new Uint8Array(buf)).map((b) => b.toString(16).padStart(2, '0')).join('');
}
const hasSource = !!(WEBINAR.liveHls || WEBINAR.vodHls || WEBINAR.mp4 || WEBINAR.youTubeId);
const isLiveSource = WEBINAR.mode === 'live' || (WEBINAR.mode === 'auto' && !!WEBINAR.liveHls && !WEBINAR.vodHls && !WEBINAR.mp4);
// QA preview: ?wb=live | premiere | ended | countdown forces a phase, so the
// player and the live path can be verified before the event without waiting on
// the clock. Harmless in production — only takes effect when the param is set.
const qaParam = (new URLSearchParams(location.search).get('wb') || '').toLowerCase();
const QA_PHASE = { live: 'live', premiere: 'live', preview: 'live', ended: 'ended', countdown: 'pre' }[qaParam] || null;
$('wbRetry').addEventListener('click', () => location.reload());
// ── Schedule label + calendar links ──────────────────────────────────────
const startDate = new Date(startMs);
const whenStr = startDate.toLocaleString(undefined, {
weekday: 'long', month: 'long', day: 'numeric',
hour: 'numeric', minute: '2-digit', timeZoneName: 'short',
});
$('wbWhen').innerHTML = '<b>' + whenStr + '</b> · ' + WEBINAR.durationMin + ' min';
const icsStamp = (ms) => new Date(ms).toISOString().replace(/[-:]/g, '').replace(/\.\d{3}/, '');
const gcal = new URL('https://calendar.google.com/calendar/render');
gcal.searchParams.set('action', 'TEMPLATE');
gcal.searchParams.set('text', WEBINAR.title);
gcal.searchParams.set('dates', icsStamp(startMs) + '/' + icsStamp(endMs));
gcal.searchParams.set('details', WEBINAR.details);
gcal.searchParams.set('location', WEBINAR.location);
$('wbGcal').href = gcal.toString();
$('wbIcs').addEventListener('click', () => {
const ics = [
'BEGIN:VCALENDAR', 'VERSION:2.0', 'PRODID:-//three.ws//webinar//EN',
'BEGIN:VEVENT', 'UID:' + icsStamp(startMs) + '@three.ws',
'DTSTAMP:' + icsStamp(Date.now()), 'DTSTART:' + icsStamp(startMs), 'DTEND:' + icsStamp(endMs),
'SUMMARY:' + WEBINAR.title,
'DESCRIPTION:' + WEBINAR.details.replace(/,/g, '\\,'),
'LOCATION:' + WEBINAR.location, 'END:VEVENT', 'END:VCALENDAR',
].join('\r\n');
const url = URL.createObjectURL(new Blob([ics], { type: 'text/calendar' }));
const a = document.createElement('a');
a.href = url; a.download = 'three-ws-ibm-webinar.ics';
document.body.appendChild(a); a.click(); a.remove();
setTimeout(() => URL.revokeObjectURL(url), 1000);
});
// ── Countdown ─────────────────────────────────────────────────────────────
const pad = (n) => String(n).padStart(2, '0');
let phase = '';
function render() {
const now = Date.now();
let next = now < startMs ? 'pre' : (now < endMs ? 'live' : 'ended');
if (QA_PHASE) next = QA_PHASE;
if (now < startMs) {
let s = Math.floor((startMs - now) / 1000);
const d = Math.floor(s / 86400); s -= d * 86400;
const h = Math.floor(s / 3600); s -= h * 3600;
const m = Math.floor(s / 60); s -= m * 60;
$('wbD').textContent = pad(d); $('wbH').textContent = pad(h);
$('wbM').textContent = pad(m); $('wbS').textContent = pad(s);
}
if (next !== phase) { phase = next; applyPhase(); }
}
function applyPhase() {
if (phase === 'pre') return; // countdown already visible
pre.hidden = true;
if (phase === 'ended') { enterEnded(); clearInterval(timer); return; }
// Live window:
if (!hasSource) { holding.hidden = false; return; } // awaiting source
mountPlayer();
clearInterval(timer);
}
// Static "session ended" card — no video. Used when there's no recording, when
// replay is 'off', or when a password gate has no hash set yet (stays locked).
function endedCard(msg) {
pre.hidden = true; player.hidden = true; player.innerHTML = '';
badge.hidden = true; unmute.hidden = true; if (gate) gate.hidden = true;
holding.hidden = false;
$('wbSpinner').style.display = 'none';
$('wbHoldTitle').textContent = 'This session has ended';
$('wbHoldMsg').textContent = msg || 'Thanks for joining.';
$('wbRetry').hidden = true;
}
function showGate() {
pre.hidden = true; holding.hidden = true; player.hidden = true; player.innerHTML = '';
badge.hidden = true; unmute.hidden = true;
gate.hidden = false;
setTimeout(() => { try { gateInput.focus(); } catch (_) {} }, 0);
}
// The recording is private once the live window closes. Route per REPLAY POLICY:
// 'open' → seekable replay; 'off' or password-without-hash → locked card;
// 'password' (+hash) → gate, unless this tab already unlocked it.
function enterEnded() {
if (!hasSource) {
if (WEBINAR.endLoop) { mountLoop(); return; }
endedCard('Thanks for joining. The recording will be posted shortly.');
return;
}
if (WEBINAR.replay === 'open') { mountPlayer(); return; }
if (WEBINAR.replay === 'password' && replayHashSet) {
let unlocked = false;
try { unlocked = sessionStorage.getItem('wbReplayOk') === '1'; } catch (_) {}
if (unlocked) { mountPlayer(); return; }
showGate();
return;
}
endedCard(WEBINAR.replay === 'off'
? 'Thanks for joining. The live session has ended.'
: 'Thanks for joining. This recording is private.');
}
if (gate) gate.addEventListener('submit', async (e) => {
e.preventDefault();
const val = gateInput.value || '';
if (!val) { gateInput.focus(); return; }
let ok = false;
try { ok = (await sha256Hex(val)) === REPLAY_HASH; } catch (_) { ok = false; }
if (ok) {
try { sessionStorage.setItem('wbReplayOk', '1'); } catch (_) {}
gate.hidden = true;
mountPlayer();
} else {
gateErr.hidden = false;
gateInput.value = ''; gateInput.focus();
}
});
// ── Player ──────────────────────────────────────────────────────────────
function loadHls() {
return new Promise((res, rej) => {
if (window.Hls) return res(window.Hls);
const s = document.createElement('script');
s.src = 'https://cdn.jsdelivr.net/npm/[email protected]/dist/hls.min.js';
s.onload = () => res(window.Hls); s.onerror = () => rej(new Error('hls.js load failed'));
document.head.appendChild(s);
});
}
// Designed, actionable error state — reuse the holding card with a retry.
function showError(msg) {
if (player) { player.hidden = true; player.innerHTML = ''; }
badge.hidden = true; unmute.hidden = true;
holding.hidden = false;
$('wbSpinner').style.display = 'none';
$('wbHoldTitle').textContent = 'Playback hit a snag';
$('wbHoldMsg').textContent = msg || 'The stream is temporarily unavailable.';
$('wbRetry').hidden = false;
}
// Post-event ambient loop: a muted, controls-free MP4 that covers the stage and
// repeats forever once the event is over. If it can't load, fall back to the
// calm "thanks" card so the stage is never a black void.
function mountLoop() {
pre.hidden = true; holding.hidden = true; badge.hidden = true; unmute.hidden = true;
player.hidden = false; player.innerHTML = '';
const v = document.createElement('video');
v.src = WEBINAR.endLoop;
v.loop = true; v.muted = true; v.autoplay = true; v.playsInline = true;
v.setAttribute('controlslist', 'nodownload');
v.addEventListener('error', () => {
player.hidden = true; player.innerHTML = '';
holding.hidden = false;
$('wbSpinner').style.display = 'none';
$('wbHoldTitle').textContent = 'Thanks for joining';
$('wbHoldMsg').textContent = 'The recording will be posted here shortly.';
});
player.appendChild(v);
v.play().catch(() => {});
}
async function mountPlayer() {
holding.hidden = true; player.hidden = false;
// A synced premiere should read as "Live now" during its window — that's the
// whole point — so the badge shows for a true live feed AND a premiere, and
// only hides once we're past the slot (replay).
badge.hidden = phase !== 'live';
if (WEBINAR.youTubeId) {
const offset = Math.max(0, Math.floor((Date.now() - startMs) / 1000));
const p = new URLSearchParams({ autoplay: '1', mute: '1', modestbranding: '1', rel: '0', playsinline: '1' });
if (!isLiveSource && phase === 'live') p.set('start', String(offset));
const f = document.createElement('iframe');
f.src = 'https://www.youtube-nocookie.com/embed/' + WEBINAR.youTubeId + '?' + p.toString();
f.allow = 'autoplay; encrypted-media; picture-in-picture; fullscreen';
f.allowFullscreen = true; f.title = WEBINAR.title;
player.appendChild(f);
return;
}
const video = document.createElement('video');
// During a premiere's live window, hide the native controls entirely: a seek
// bar would expose the fixed duration and give away that it's a recording. No
// scrubber + the "Live now" badge + can't-skip-ahead reads as a real stream.
// Full controls return for the replay once the window has passed (and when the
// video ends on its own).
const livePremiere = !isLiveSource && phase === 'live';
video.playsInline = true; video.controls = !livePremiere; video.muted = true;
video.setAttribute('controlslist', 'nodownload noplaybackrate');
player.appendChild(video);
const src = WEBINAR.liveHls || WEBINAR.vodHls || WEBINAR.mp4;
const isHls = /\.m3u8(\?|$)/i.test(src);
let usingHls = false;
try {
if (isHls && !video.canPlayType('application/vnd.apple.mpegurl')) {
const Hls = await loadHls();
if (Hls.isSupported()) {
usingHls = true;
const hls = new Hls({ lowLatencyMode: isLiveSource });
// Fatal-error recovery: retry network/media a few times, then surface a
// clean error rather than leaving a black frame.
let recover = 0;
hls.on(Hls.Events.ERROR, (_evt, data) => {
if (!data || !data.fatal) return;
if (data.type === Hls.ErrorTypes.NETWORK_ERROR && recover < 3) { recover++; hls.startLoad(); }
else if (data.type === Hls.ErrorTypes.MEDIA_ERROR && recover < 3) { recover++; hls.recoverMediaError(); }
else { hls.destroy(); showError('The stream is temporarily unavailable — it may not have started yet.'); }
});
hls.loadSource(src); hls.attachMedia(video);
} else { video.src = src; }
} else {
video.src = src; // native HLS (Safari) or MP4
}
} catch (e) { showError('We couldn’t start the player. Reload to try again.'); return; }
// Native media error (MP4 / Safari HLS). The hls.js path reports through its
// own ERROR event above, so skip this listener when hls.js owns the element.
video.addEventListener('error', () => { if (!usingHls) showError('We couldn’t load the video — it may not be available yet.'); });
// Premiere sync: a finished recording behaves like a broadcast — join at the
// point the talk is actually at, and (during the live window) can't skip ahead.
const isPremiere = !isLiveSource;
video.addEventListener('loadedmetadata', () => {
if (isPremiere && phase === 'live') {
const offset = (Date.now() - startMs) / 1000;
if (offset > 0 && offset < (video.duration || Infinity)) video.currentTime = offset;
}
}, { once: true });
if (isPremiere && phase === 'live') {
video.addEventListener('seeking', () => {
const edge = (Date.now() - startMs) / 1000 + 1.5;
if (video.currentTime > edge) video.currentTime = Math.max(0, edge - 1.5);
});
}
video.play().then(() => {
if (video.muted) unmute.hidden = false; // autoplay needs muted; offer one-tap unmute
}).catch(() => { unmute.hidden = false; });
unmute.addEventListener('click', () => {
video.muted = false; unmute.hidden = true; video.play().catch(() => {});
});
// When the recording finishes, honor the replay policy. An open replay (or a
// viewer who already unlocked it this session) gets full scrub controls; an
// otherwise-private recording is taken off screen and re-gated so it isn't
// left freely playable once the live moment has passed.
video.addEventListener('ended', () => {
let unlocked = false;
try { unlocked = sessionStorage.getItem('wbReplayOk') === '1'; } catch (_) {}
if (WEBINAR.replay === 'open' || unlocked) { video.controls = true; badge.hidden = true; return; }
player.hidden = true; player.innerHTML = '';
if (WEBINAR.replay === 'password' && replayHashSet) showGate();
else endedCard(WEBINAR.replay === 'off'
? 'Thanks for joining. The live session has ended.'
: 'Thanks for joining. This recording is private.');
});
}
// Assign the interval BEFORE the first render() so an at/after-start load that
// clears it on the opening tick doesn't hit `timer` in its temporal dead zone.
let timer = setInterval(render, 1000);
render();
})();
</script>
<!-- ══ DEMO 01 · FORGE (paid x402 prompt→3D) ══ -->
<section class="section" id="forge" aria-labelledby="forge-h">
<div class="inner">
<div class="section-tag">Demo 01 · Creation</div>
<h2 id="forge-h" data-i18n-html="ibm_hello.forge_a_3d_model_from_a_sentence">Forge a <strong>3D model</strong> from a sentence</h2>
<p class="section-lead" data-i18n-html="ibm_hello.this_pays_the_same_x402_rail_as">This pays the same x402 rail as the demo below — one micropayment, in USDC or <span class="mono">$THREE</span> on Solana, runs a real text→3D pipeline (Microsoft TRELLIS on NVIDIA NIM) and hands back a textured GLB you can orbit and download. The price below is read live from the server's own 402 response; pick your token in the wallet.</p>
<div class="demo">
<div class="demo-head">
<div>
<h3 class="demo-title" data-i18n-html="ibm_hello.three_ws_forge">three<span>.ws</span> Forge</h3>
<div class="demo-desc">Describe one object; pay; get back a textured, downloadable 3D model. Runs Microsoft TRELLIS on NVIDIA NIM (native text→mesh) — the same engine that builds the bodies our agents wear.</div>
</div>
<div class="price-tag">
<div class="amt" id="fgPriceAmt" aria-hidden="true">$<strong>0.05</strong></div>
<div class="net" aria-hidden="true">USDC or $THREE · per model</div>
<span class="sr-only" id="fgPriceSr" data-i18n="ibm_hello.price_five_cents_per_generation_payable_in">Price: five cents per generation, payable in USDC or $THREE on Solana.</span>
</div>
</div>
<div class="demo-body">
<!-- live 402 preview -->
<div class="preview" id="fgPreview" role="region" aria-label="Live HTTP 402 payment challenge" aria-live="polite" aria-busy="true">
<div class="preview-label" id="fgPvLabel"><span class="dot" aria-hidden="true"></span><span id="fgPvLabelText" data-i18n="ibm_hello.reading_the_server_s_402_challenge">Reading the server's 402 challenge…</span></div>
<div id="fgPvRows">
<div class="preview-row"><span class="sk" style="width:38%"></span></div>
<div class="preview-row"><span class="sk" style="width:54%"></span></div>
<div class="preview-row"><span class="sk" style="width:46%"></span></div>
</div>
</div>
<!-- quality tier -->
<div class="tier-row" id="fgTiers" role="radiogroup" aria-label="Generation quality tier">
<button class="tier" type="button" role="radio" aria-checked="true" tabindex="0" data-tier="draft" data-i18n-html="ibm_hello.draft_0_05_fast_preview_geometry_best">
<span class="t-name"><span class="t-tier">Draft</span><span class="t-price" data-price>$0.05</span></span>
<span class="t-blurb">Fast preview geometry. Best to try the flow.</span>
<span class="t-eta" data-eta>~40s</span>
</button>
<button class="tier" type="button" role="radio" aria-checked="false" tabindex="-1" data-tier="standard" data-i18n-html="ibm_hello.standard_0_15_balanced_detail_the_default">
<span class="t-name"><span class="t-tier">Standard</span><span class="t-price" data-price>$0.15</span></span>
<span class="t-blurb">Balanced detail. The default for most assets.</span>
<span class="t-eta" data-eta>~60s</span>
</button>
<button class="tier" type="button" role="radio" aria-checked="false" tabindex="-1" data-tier="high" data-i18n-html="ibm_hello.high_0_50_maximum_geometry_pbr_textures">
<span class="t-name"><span class="t-tier">High</span><span class="t-price" data-price>$0.50</span></span>
<span class="t-blurb">Maximum geometry + PBR textures. Slower.</span>
<span class="t-eta" data-eta>~130s</span>
</button>
</div>
<!-- input -->
<div class="field-row">
<div class="field-wrap">
<label for="fgPrompt" data-i18n="ibm_hello.describe_the_object">Describe the object</label>
<input id="fgPrompt" class="field" value="a brass steampunk owl, full body" maxlength="1000" autocomplete="off" spellcheck="true" inputmode="text" aria-describedby="fgPromptHint">
<div class="field-hint" id="fgPromptHint">One subject works best — describe it in a sentence.</div>
</div>
<button id="fgBtn" class="btn" type="button" data-i18n-html="ibm_hello.pay_0_05_forge"><span class="spin" aria-hidden="true"></span><span class="label">Pay $0.05 & forge</span> <span class="arrow" aria-hidden="true">→</span></button>
</div>
<div class="wallet-hint" id="fgWalletHint">On a phone? Open this page inside your <b data-i18n="ibm_hello.phantom">Phantom</b> wallet's in-app browser to pay.</div>
<!-- result. Not a live region (its success state holds a raw-JSON block);
concise spoken updates go to #fgAnnouncer instead. -->
<div id="fgResult" class="result is-empty">
Forge a model to see it appear here — orbit it, then download the GLB.
</div>
<p id="fgAnnouncer" class="sr-only" role="status" aria-live="polite"></p>
<!-- requirements -->
<div class="note">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4M12 8h.01"/></svg>
<p data-i18n-html="ibm_hello.you_ll_need_the_phantom_wallet_on">You'll need the <b>Phantom</b> wallet on <b>Solana</b> — holding the model's price in <b>USDC</b>, or the equivalent in <b>$THREE</b>, on Solana mainnet. This spends <b>real funds</b> — the price shown above — from your own wallet; the wallet lets you pick USDC or <b>$THREE</b>. The payment itself is a gasless signature: the network fee is sponsored by the x402 facilitator, so it isn't added to your cost. Generation runs once the payment verifies and takes roughly a minute. No wallet? Forge one <b>free</b> below — no wallet, no key, no payment.</p>
</div>
</div>
</div>
<!-- Free, no-wallet companion to the paid Forge above. Same text→3D
pipeline (Microsoft TRELLIS on NVIDIA NIM), on the house — no wallet,
no key, no payment. POSTs the free /api/forge lane and polls it. -->
<div class="g3d">
<div class="g3d-tag">Live · Free · No wallet</div>
<h4 id="g3d-h" data-i18n-html="ibm_hello.or_forge_one_free_no_wallet_needed">Or forge one <strong>free</strong> — no wallet needed</h4>
<p class="g3d-sub" data-i18n="ibm_hello.the_same_pipeline_on_the_house_no">The same pipeline, on the house. No wallet, no API key, no payment — it runs Microsoft TRELLIS on NVIDIA NIM with automatic fallback across generation lanes, so a textured GLB always comes back to orbit and download.</p>
<div class="g3d-field">
<label for="g3dPrompt" class="sr-only" data-i18n="ibm_hello.describe_an_object_to_generate_for_free">Describe an object to generate for free</label>
<input id="g3dPrompt" class="g3d-input" value="a brass steampunk owl, full body" maxlength="600" autocomplete="off" spellcheck="true" inputmode="text" aria-describedby="g3d-h">
<button id="g3dBtn" class="g3d-btn" type="button" data-i18n-html="ibm_hello.generate_free"><span class="g3d-spin" aria-hidden="true"></span><span class="g3d-label">Generate free</span> <span aria-hidden="true">→</span></button>
</div>
<div class="g3d-suggest" id="g3dSuggest" aria-label="Example prompts">
<button type="button" data-p="a low-poly red fox, sitting" data-i18n="ibm_hello.low_poly_fox">low-poly fox</button>
<button type="button" data-p="a glossy ceramic teapot with gold trim" data-i18n="ibm_hello.ceramic_teapot">ceramic teapot</button>
<button type="button" data-p="a futuristic delivery drone" data-i18n="ibm_hello.delivery_drone">delivery drone</button>
<button type="button" data-p="a worn leather hiking boot" data-i18n="ibm_hello.hiking_boot">hiking boot</button>
</div>
<div id="g3dResult" class="g3d-result is-empty">
Describe an object and generate — your model appears here to orbit and download.
</div>
<p id="g3dStatus" class="sr-only" role="status" aria-live="polite"></p>
</div>
<p class="forge-foot" data-i18n-html="ibm_hello.want_image_3d_auto_rigging_ar_preview">Want image→3D, auto-rigging, AR preview and the full gallery? <a href="https://three.ws/forge" target="_blank" rel="noopener">Open the full Forge tool ↗</a></p>
</div>
</section>
<!-- ══ HOW IT WORKS ══ -->
<section class="section" aria-labelledby="how-h">
<div class="inner">
<div class="section-tag">The protocol in three moves</div>
<h2 id="how-h" data-i18n-html="ibm_hello.how_x402_works">How <strong>x402</strong> works</h2>
<ol class="steps">
<li class="step">
<div class="step-n">01 · REQUEST</div>
<h3 data-i18n="ibm_hello.you_ask_normally">You ask normally</h3>
<p data-i18n-html="ibm_hello.a_plain_to_a_paid_endpoint_no">A plain <code>GET</code> to a paid endpoint — no payment attached yet.</p>
</li>
<li class="step">
<div class="step-n">02 · 402 CHALLENGE</div>
<h3 data-i18n="ibm_hello.server_quotes_a_price">Server quotes a price</h3>
<p data-i18n-html="ibm_hello.it_replies_with_exactly_what_it_wants">It replies <code>402</code> with exactly what it wants: amount, asset, network, and the address to pay.</p>
</li>
<li class="step">
<div class="step-n">03 · PAY & RETRY</div>
<h3 data-i18n="ibm_hello.wallet_signs_call_settles">Wallet signs, call settles</h3>
<p data-i18n-html="ibm_hello.you_sign_a_gasless_usdc_authorization_resend">You sign a gasless USDC authorization, resend with an <code>X-PAYMENT</code> header, and the call settles on-chain — your data comes back.</p>
</li>
</ol>
</div>
</section>
<!-- ══ LIVE DEMO ══ -->
<!-- ══ DEMO 02 · AVATARS (free text→mesh→auto-rig→animated) ══ -->
<style id="av-styles">
.av-forge{margin-top:28px;border:1px solid var(--ibm-divider);background:var(--ibm-surface)}
.av-head{padding:22px 24px 18px;border-bottom:1px solid var(--ibm-border)}
.av-head h3{font-size:20px;font-weight:600}
.av-head h3 span{color:var(--ibm-blue)}
.av-head p{font-size:13px;color:var(--ibm-muted);font-weight:300;max-width:540px;margin-top:4px;line-height:1.55}
.av-body{padding:22px 24px}
.av-field{display:flex;gap:1px;flex-wrap:wrap;background:var(--ibm-border)}
.av-input{flex:1 1 280px;min-width:0;font-family:var(--font-sans);font-size:15px;color:var(--ibm-ink);background:var(--ibm-surface);border:none;padding:0 16px;height:48px;outline:none}
.av-input:focus-visible{outline:2px solid var(--ibm-blue);outline-offset:-2px}
.av-btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;background:var(--ibm-blue-fill);color:#fff;border:none;cursor:pointer;font-family:var(--font-sans);font-size:15px;font-weight:500;padding:0 24px;height:48px;transition:background .12s,transform .04s}
.av-btn:hover:not(:disabled){background:var(--ibm-blue-fill-hover)}
.av-btn:active:not(:disabled){transform:translateY(1px)}
.av-btn:disabled{opacity:.7;cursor:not-allowed}
.av-btn:focus-visible{outline:2px solid var(--ibm-blue);outline-offset:2px;box-shadow:0 0 0 4px rgba(15,98,254,.25)}
.av-spin{width:15px;height:15px;border:2px solid rgba(255,255,255,.4);border-top-color:#fff;border-radius:50%;animation:spin .7s linear infinite;display:none}
.av-btn.loading .av-spin{display:inline-block}
.av-suggest{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.av-suggest button{font-family:inherit;font-size:13px;color:var(--ibm-muted);background:transparent;border:1px solid var(--ibm-border);padding:6px 12px;cursor:pointer;transition:border-color .12s,color .12s}
.av-suggest button:hover{border-color:var(--ibm-blue);color:var(--ibm-blue)}
/* pipeline step indicator — mesh → rig → animate */
.av-steps{display:flex;flex-wrap:wrap;gap:8px;margin:20px 0 0;list-style:none;padding:0;counter-reset:av}
.av-steps li{display:inline-flex;align-items:center;gap:8px;font-size:12px;color:var(--ibm-subtle);font-weight:500;border:1px solid var(--ibm-border);padding:6px 12px;border-radius:2px;transition:color .2s,border-color .2s}
.av-steps li .dot{width:7px;height:7px;border-radius:50%;background:var(--ibm-divider);flex:0 0 auto;transition:background .2s}
.av-steps li.active{color:var(--ibm-blue);border-color:var(--ibm-blue)}
.av-steps li.active .dot{background:var(--ibm-blue);animation:dotpulse 1.2s var(--ease) infinite}
.av-steps li.done{color:var(--ibm-green-ink);border-color:var(--ibm-green)}
.av-steps li.done .dot{background:var(--ibm-green)}
.av-result{margin-top:20px;border:1px solid var(--ibm-border);background:var(--ibm-field)}
.av-result.is-empty{padding:44px 20px;text-align:center;font-size:14px;color:var(--ibm-subtle);border-style:dashed}
.av-stage{position:relative;min-height:460px;background:radial-gradient(circle at 50% 30%,#1c2530,#0c1116 70%)}
.av-stage agent-3d,.av-stage model-viewer{display:block;width:100%;height:460px}
.av-load{padding:44px 20px}
.av-bar{display:block;height:3px;background:var(--ibm-border);overflow:hidden;margin-bottom:16px}
.av-bar span{display:block;height:100%;width:40%;background:var(--ibm-blue);animation:g3dslide 1.3s ease-in-out infinite}
.av-loadmsg{font-size:14px;color:var(--ibm-muted);text-align:center}
.av-err{padding:28px 20px;text-align:center}
.av-err p{font-size:14px;color:var(--ibm-muted);margin:0 auto 16px;max-width:460px;line-height:1.6}
.av-retry{font-family:inherit;font-size:14px;font-weight:500;color:#fff;background:var(--ibm-blue-fill);border:none;padding:10px 20px;cursor:pointer;transition:background .12s}
.av-retry:hover{background:var(--ibm-blue-fill-hover)}
.av-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:14px 16px;border-top:1px solid var(--ibm-border);background:var(--ibm-surface)}
.av-act{display:inline-flex;align-items:center;font-family:inherit;font-size:14px;font-weight:500;text-decoration:none;padding:9px 16px;border:1px solid var(--ibm-blue);color:var(--ibm-blue);cursor:pointer;transition:background .12s}
.av-act:hover{background:rgba(15,98,254,.08);text-decoration:none}
.av-act.primary{background:var(--ibm-blue-fill);color:#fff;border-color:var(--ibm-blue-fill)}
.av-act.primary:hover{background:var(--ibm-blue-fill-hover)}
.av-engine{font-size:12px;color:var(--ibm-subtle);margin-left:auto}
@media(max-width:560px){.av-btn{width:100%}.av-engine{margin-left:0;width:100%}}
@media(pointer:coarse){.av-act,.av-retry,.av-suggest button{min-height:44px}}
</style>
<section class="section" id="demo" aria-labelledby="demo-h">
<div class="inner">
<div class="section-tag">Demo 02 · Avatars</div>
<h2 id="demo-h" data-i18n-html="ibm_hello.forge_a_living_avatar_from_a_sentence">Forge a <strong>living avatar</strong> from a sentence</h2>
<p class="section-lead" data-i18n-html="ibm_hello.describe_a_character_three_ws_generates_the">Describe a character; three.ws generates the textured mesh, auto-rigs a skeleton, and drops it straight into the avatar engine — where it stands, breathes, and waves. Free, no wallet. The same universal rig that lets <em>any</em> humanoid wear our animation library, running live in your browser.</p>
<div class="av-forge">
<div class="av-head">
<h3 class="demo-title" data-i18n-html="ibm_hello.three_ws_avatar_forge">three<span>.ws</span> Avatar Forge</h3>
<p data-i18n="ibm_hello.text_textured_mesh_microsoft_trellis_on_nvid">Text → textured mesh (Microsoft TRELLIS on NVIDIA NIM) → auto-rigged skeleton → animated avatar. No payment, no API key — a generation lane kept free for everyone.</p>
</div>
<div class="av-body">
<div class="av-field">
<label for="avPrompt" class="sr-only" data-i18n="ibm_hello.describe_a_character_to_generate">Describe a character to generate</label>
<input id="avPrompt" class="av-input" value="a brass steampunk knight, full body" maxlength="600" autocomplete="off" spellcheck="true" inputmode="text">
<button id="avBtn" class="av-btn" type="button" data-i18n-html="ibm_hello.forge_avatar"><span class="av-spin" aria-hidden="true"></span><span class="av-label">Forge avatar</span> <span aria-hidden="true">→</span></button>
</div>
<div class="av-suggest" id="avSuggest" aria-label="Example characters">
<button type="button" data-p="a brass steampunk knight, full body" data-i18n="ibm_hello.steampunk_knight">Steampunk knight</button>
<button type="button" data-p="a friendly cartoon astronaut, full body" data-i18n="ibm_hello.cartoon_astronaut">Cartoon astronaut</button>
<button type="button" data-p="a wise wizard in a flowing blue robe, full body" data-i18n="ibm_hello.blue_wizard">Blue wizard</button>
<button type="button" data-p="a sleek cyberpunk ninja, full body" data-i18n="ibm_hello.cyberpunk_ninja">Cyberpunk ninja</button>
</div>
<ol class="av-steps" id="avSteps" aria-hidden="true">
<li data-step="mesh" data-i18n-html="ibm_hello.generate_mesh"><span class="dot" aria-hidden="true"></span>Generate mesh</li>
<li data-step="rig" data-i18n-html="ibm_hello.auto_rig_skeleton"><span class="dot" aria-hidden="true"></span>Auto-rig skeleton</li>
<li data-step="animate" data-i18n-html="ibm_hello.animate"><span class="dot" aria-hidden="true"></span>Animate</li>
</ol>
<div id="avResult" class="av-result is-empty">Forge a character to watch it come to life here.</div>
<p id="avStatus" class="sr-only" role="status" aria-live="polite"></p>
<div class="note">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4M12 8h.01"/></svg>
<p data-i18n-html="ibm_hello.every_avatar_here_is_generated_and_rigged">Every avatar here is generated and rigged on demand — <b>no template library, no canned characters</b>. The rig maps to three.ws's canonical skeleton, so the same idle, walk and emote clips play on whatever you describe. Want image→3D, your own GLB upload, or AR preview? <a href="https://three.ws/forge" target="_blank" rel="noopener">Open the full Forge tool ↗</a> <span class="note-aside">The free lane has an hourly cap so it stays free for everyone; if it's busy it tells you exactly when to retry. Generation runs on NVIDIA NIM and auto-falls back across lanes, so a model always comes back.</span></p>
</div>
</div>
</div>
</div>
</section>
<!-- ══ DEMO 03 · POSE (live MannequinRig — the lite Pose Studio slice) ══ -->
<section class="section" id="pose" aria-labelledby="pose-h">
<div class="inner">
<div class="section-tag">Demo 03 · Motion</div>
<h2 id="pose-h" data-i18n-html="ibm_hello.pose_a_figure_by_hand">Pose a figure <strong>by hand</strong></h2>
<p class="section-lead" data-i18n-html="ibm_hello.every_avatar_three_ws_generates_lands_on">Every avatar three.ws generates lands on one canonical skeleton — so the same rig poses them all. Orbit the mannequin, grab a limb to move it (inverse kinematics on hands and feet), nudge a joint with the sliders, or tap a preset to morph the whole pose. It's the exact rig behind the full <a href="https://three.ws/pose" target="_blank" rel="noopener">Pose Studio</a>, running live on the page.</p>
<div class="live-embed" data-src="https://three.ws/pose-mini" data-allow="fullscreen" data-label="Pose Studio (lite) — three.ws">
<div class="embed-bar">
<span class="bar-url" data-i18n-html="ibm_hello.three_ws_pose"><span class="dot" aria-hidden="true"></span>three.ws/pose</span>
<span class="bar-actions">
<button type="button" data-fs data-i18n="ibm_hello.full_screen">⤢ Full screen</button>
<a href="https://three.ws/pose" target="_blank" rel="noopener" data-i18n="ibm_hello.open_the_studio">Open the studio ↗</a>
</span>
</div>
<div class="embed-frame">
<div class="embed-load embed-state"><span class="spin" aria-hidden="true"></span><span data-i18n="ibm_hello.loading_the_live_rig">Loading the live rig…</span></div>
<div class="embed-err embed-state">The poser couldn't load inline here. <span class="es-hint" data-i18n-html="ibm_hello.open_it_in_a_new_tab"><a href="https://three.ws/pose" target="_blank" rel="noopener">Open it in a new tab ↗</a></span></div>
</div>
</div>
</div>
</section>
<!-- ══ DEMO 04 · AGENT GALAXY (live IBM Granite semantic 3D map) ══ -->
<section class="section" id="galaxy" aria-labelledby="galaxy-h">
<div class="inner">
<div class="section-tag">Demo 04 · Intelligence</div>
<h2 id="galaxy-h" data-i18n-html="ibm_hello.every_agent_mapped_by_meaning">Every agent, <strong>mapped by meaning</strong></h2>
<p class="section-lead" data-i18n-html="ibm_hello.fly_through_a_3d_constellation_of_every">Fly through a 3D constellation of every AI agent on three.ws — each one placed in space by what it <em>means</em>, not by name or date. Coordinates come from <strong>IBM Granite</strong> embeddings on watsonx.ai, so agents that do similar things sit in the same neighbourhood; Granite names each constellation. Search by meaning and watch the matching stars light up. It runs full-size, right on the page.</p>
<div class="live-embed" data-src="https://three.ws/galaxy" data-allow="fullscreen; xr-spatial-tracking" data-label="Agent Galaxy — three.ws × IBM Granite">
<div class="embed-bar">
<span class="bar-url" data-i18n-html="ibm_hello.three_ws_galaxy"><span class="dot" aria-hidden="true"></span>three.ws/galaxy</span>
<span class="bar-actions">
<button type="button" data-fs data-i18n="ibm_hello.full_screen_2">⤢ Full screen</button>
<a href="https://three.ws/galaxy" target="_blank" rel="noopener" data-i18n="ibm_hello.new_tab">New tab ↗</a>
</span>
</div>
<div class="embed-frame">
<div class="embed-load embed-state"><span class="spin" aria-hidden="true"></span><span data-i18n="ibm_hello.mapping_the_galaxy_with_ibm_granite">Mapping the galaxy with IBM Granite…</span></div>
<div class="embed-err embed-state">The galaxy couldn't load inline here. <span class="es-hint" data-i18n-html="ibm_hello.open_it_in_a_new_tab_2"><a href="https://three.ws/galaxy" target="_blank" rel="noopener">Open it in a new tab ↗</a></span></div>
</div>
</div>
</div>
</section>
<!-- ══ DEMO 05 · PLAY ══ -->
<section class="section" id="play" aria-labelledby="play-h">
<div class="inner">
<div class="section-tag">Demo 05 · Worlds</div>
<h2 id="play-h" data-i18n-html="ibm_hello.play_drop_an_agent_into_a_live">Play — drop an agent into a <strong>live world</strong></h2>
<p class="section-lead" data-i18n="ibm_hello.every_coin_on_three_ws_is_a">Every coin on three.ws is a 3D space agents and visitors share in real time — walk in, pick an avatar, and move around a world that reacts to live on-chain activity. Pick a name and a body below to enter; it runs full-size, right on the page.</p>
<div class="live-embed play-embed" data-src="https://three.ws/play?biome=noir" data-allow="fullscreen; gamepad; autoplay; xr-spatial-tracking; microphone" data-label="Play — three.ws">
<div class="embed-bar">
<span class="bar-url" data-i18n-html="ibm_hello.three_ws_play"><span class="dot" aria-hidden="true"></span>three.ws/play</span>
<span class="bar-actions">
<button type="button" data-fs data-i18n="ibm_hello.full_screen_3">⤢ Full screen</button>
<a href="https://three.ws/play" target="_blank" rel="noopener" data-i18n="ibm_hello.new_tab_2">New tab ↗</a>
</span>
</div>
<div class="embed-frame">
<div class="embed-load embed-state"><span class="spin" aria-hidden="true"></span><span data-i18n="ibm_hello.loading_the_live_world">Loading the live world…</span></div>
<div class="embed-err embed-state">Play couldn't load inline here. <span class="es-hint" data-i18n-html="ibm_hello.open_it_in_a_new_tab_3"><a href="https://three.ws/play" target="_blank" rel="noopener">Open it in a new tab ↗</a></span></div>
</div>
</div>
</div>
</section>
<!-- ══ DEMO 06 · IRL ══ -->
<section class="section" id="irl" aria-labelledby="irl-h">
<div class="inner">
<div class="section-tag">Demo 06 · Reality</div>
<h2 id="irl-h" data-i18n-html="ibm_hello.irl_put_an_agent_in_the_real">IRL — put an agent in the <strong>real world</strong></h2>
<p class="section-lead" data-i18n="ibm_hello.anchor_a_3d_agent_to_physical_space">Anchor a 3D agent to physical space and see it through your camera, with real-world pins you place around you — you stay in control of every permission. AR is a phone experience, so it's best opened on a mobile device; the live surface is below, and the camera prompt only fires when you choose to enable it.</p>
<div class="live-embed" data-src="https://three.ws/irl" data-allow="camera; gyroscope; accelerometer; magnetometer; xr-spatial-tracking; fullscreen" data-label="IRL — three.ws">
<div class="embed-bar">
<span class="bar-url" data-i18n-html="ibm_hello.three_ws_irl"><span class="dot" aria-hidden="true"></span>three.ws/irl</span>
<span class="bar-actions">
<button type="button" data-fs data-i18n="ibm_hello.full_screen_4">⤢ Full screen</button>
<a href="https://three.ws/irl" target="_blank" rel="noopener" data-i18n="ibm_hello.open_on_your_phone">Open on your phone ↗</a>
</span>
</div>
<div class="embed-frame">
<div class="embed-load embed-state"><span class="spin" aria-hidden="true"></span><span data-i18n="ibm_hello.loading_irl">Loading IRL…</span></div>
<div class="embed-err embed-state">IRL couldn't load inline here — augmented reality works best opened directly on a phone. <span class="es-hint" data-i18n-html="ibm_hello.open_it_on_your_device"><a href="https://three.ws/irl" target="_blank" rel="noopener">Open it on your device ↗</a></span></div>
</div>
</div>
</div>
</section>
<!-- ══ EMBED ══ -->
<style id="three-x402-styles">
.x402-live{margin-top:28px;border:1px solid var(--ibm-border);background:var(--ibm-surface)}
.x402-live .xl-head{padding:16px 18px;border-bottom:1px solid var(--ibm-border)}
.x402-live .xl-kicker{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--ibm-blue);font-weight:500;margin-bottom:6px}
.x402-live .xl-title{font-size:18px;font-weight:600}
.x402-live .xl-body{padding:18px}
.x402-live .xl-row{display:flex;flex-wrap:wrap;align-items:center;gap:16px 24px;margin-top:16px}
.x402-live .xl-note{font-size:12.5px;color:var(--ibm-subtle);margin-top:14px;line-height:1.55}
.ti-result{margin-top:18px}
.ti-empty{font-size:14px;color:var(--ibm-subtle);line-height:1.6;margin:0}
.ti-topline{display:flex;align-items:center;gap:12px;margin-bottom:14px}
.ti-sym{font-size:20px;font-weight:600}
.ti-signal{display:inline-flex;align-items:center;gap:7px;padding:5px 12px;font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;border-radius:2px}
.ti-signal::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
.ti-signal.bullish{background:var(--ibm-green-fill);color:var(--ibm-green-ink)}
.ti-signal.bearish{background:var(--ibm-red-fill);color:var(--ibm-red-ink)}
.ti-signal.neutral{background:var(--ibm-amber-fill);color:var(--ibm-amber)}
.ti-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(118px,1fr));gap:1px;background:var(--ibm-border);border:1px solid var(--ibm-border)}
.ti-cell{background:var(--ibm-surface);padding:12px 14px}
.ti-cell .k{font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--ibm-subtle);margin-bottom:5px}
.ti-cell .v{font-size:16px;font-weight:600;font-family:var(--font-mono)}
.ti-cell .v.ti-up{color:var(--ibm-green-ink)}
.ti-cell .v.ti-down{color:var(--ibm-red-ink)}
.ti-headline{font-size:15px;font-weight:600;margin:16px 0 6px}
.ti-rationale{font-size:14px;color:var(--ibm-muted);line-height:1.55;margin:0}
.ti-meta{font-size:12px;color:var(--ibm-subtle);margin-top:12px;font-family:var(--font-mono)}
</style>
<section class="section" aria-labelledby="embed-h">
<div class="inner">
<div class="section-tag">For developers</div>
<h2 id="embed-h" data-i18n-html="ibm_hello.add_a_paywall_in_eight_lines">Add a paywall in <strong>eight lines</strong></h2>
<p class="section-lead" data-i18n-html="ibm_hello.the_paid_forge_demo_above_is_powered">The paid Forge demo above is powered by one drop-in script. Any element with a <span class="mono">data-x402-endpoint</span> opens the wallet flow on click — no framework, no build step, no SDK.</p>
<div class="embed-block" id="embedCode"><span class="c-com" data-i18n="ibm_hello.text"><!-- one script tag, served from three.ws --></span>
<span class="c-tag" data-i18n="ibm_hello.script"><script</span> <span class="c-attr" data-i18n="ibm_hello.type">type</span>=<span class="c-str" data-i18n="ibm_hello.module">"module"</span> <span class="c-attr" data-i18n="ibm_hello.src">src</span>=<span class="c-str" data-i18n="ibm_hello.https_three_ws_x402_js">"https://three.ws/x402.js"</span><span class="c-tag" data-i18n="ibm_hello.text_2">></script></span>
<span class="c-com" data-i18n="ibm_hello.text_3"><!-- any element with data-x402-endpoint becomes payable --></span>
<span class="c-tag" data-i18n="ibm_hello.button"><button</span>
<span class="c-attr" data-i18n="ibm_hello.data_x402_endpoint">data-x402-endpoint</span>=<span class="c-str" data-i18n="ibm_hello.https_three_ws_api_x402_three_intel">"https://three.ws/api/x402/three-intel"</span>
<span class="c-attr" data-i18n="ibm_hello.data_x402_merchant">data-x402-merchant</span>=<span class="c-str" data-i18n="ibm_hello.three_ws_2">"three.ws"</span>
<span class="c-attr" data-i18n="ibm_hello.data_x402_action">data-x402-action</span>=<span class="c-str" data-i18n="ibm_hello.three_intel">"$THREE intel"</span><span class="c-tag">></span>
Pay $0.01 & get $THREE intel
<span class="c-tag" data-i18n="ibm_hello.text_4"></button></span></div>
<div class="copy-row"><button class="copy-btn" id="copyBtn" type="button" data-i18n="ibm_hello.copy_snippet">Copy snippet</button></div>
<!-- The snippet above, wired live. x402.js (loaded near <!-- Runtime i18n: detects locale, swaps annotated copy, mounts <lang-switcher>. -->
<script type="application/ibm-baked" data-ibm-type="module" data-ibm-src="https://three.ws/i18n.js"></script>
</body>) binds any
[data-x402-endpoint]; this is the same $THREE Town Oracle the in-world
kiosk on /play buys from, settled in real USDC or $THREE over x402. -->
<div class="x402-live" id="threeOracle">
<div class="xl-head">
<div class="xl-kicker">Live · runs right here</div>
<div class="xl-title">The <span class="mono" data-i18n="ibm_hello.three">$THREE</span> Town Oracle</div>
</div>
<div class="xl-body">
<p class="section-lead" style="margin-top:0" data-i18n-html="ibm_hello.that_exact_button_wired_to_the_real">That exact button, wired to the real endpoint. Pay <strong>$0.01 USDC</strong> from your own wallet and get live <span class="mono">$THREE</span> market intel — price, 24-hour move, market cap, liquidity, volume, and a bullish / bearish / neutral signal — from the same oracle the paid kiosk in the <span class="mono">$THREE</span> town on <a href="https://three.ws/play" target="_blank" rel="noopener">/play</a> sells from.</p>
<div class="xl-row">
<button class="btn" id="threeOracleBtn" type="button"
data-x402-endpoint="https://three.ws/api/x402/three-intel"
data-x402-merchant="three.ws"
data-x402-action="$THREE market intel" data-i18n-html="ibm_hello.pay_0_01_fetch_live_three_intel">
<span class="label">Pay $0.01 & fetch live $THREE intel</span> <span class="arrow" aria-hidden="true">→</span>
</button>
<a class="btn-tertiary" href="https://pump.fun/FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump" target="_blank" rel="noopener" data-i18n-html="ibm_hello.view_three_on_pump_fun">View <span class="mono">$THREE</span> on pump.fun <span aria-hidden="true">→</span></a>
</div>
<div class="ti-result" id="threeOracleResult" aria-live="polite">
<p class="ti-empty" data-i18n-html="ibm_hello.you_ll_get_back_price_24_hour">You'll get back price, 24-hour change, market cap, liquidity, 24-hour volume, and a signal with a short rationale — live from DexScreener. Settles in USDC or <span class="mono">$THREE</span> on Solana (USDC on Base); the network fee is sponsored by the facilitator.</p>
</div>
<p class="xl-note" data-i18n-html="ibm_hello.spends_0_01_of_real_funds_from">Spends $0.01 of real funds from your wallet — pay in USDC, or in <span class="mono">$THREE</span> on Solana. The only coin three.ws issues is <span class="mono">$THREE</span> · <span class="mono">FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump</span>.</p>
</div>
</div>
</div>
</section>
<!-- ══ FAQ · breadth coverage (3D, AI, crypto, x402, blockchain, MCP, $THREE) ══
Native <details> accordion — keyboard- and screen-reader-native, no JS.
Mirrored in the FAQPage JSON-LD at the foot of the page for rich results. -->
<style id="faq-styles">
.faq-list{margin-top:26px;border-top:1px solid var(--ibm-border)}
.faq-item{border-bottom:1px solid var(--ibm-border)}
.faq-item summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:20px 2px;font-size:16px;font-weight:500;color:var(--ibm-ink);transition:color .12s}
.faq-item summary::-webkit-details-marker{display:none}
.faq-item summary:hover{color:var(--ibm-blue)}
.faq-item summary:focus-visible{outline:2px solid var(--ibm-blue);outline-offset:2px}
.faq-ico{position:relative;flex:0 0 auto;width:16px;height:16px}
.faq-ico::before,.faq-ico::after{content:"";position:absolute;background:var(--ibm-blue);transition:transform .2s var(--ease),opacity .2s var(--ease)}
.faq-ico::before{left:0;top:7px;width:16px;height:2px}
.faq-ico::after{left:7px;top:0;width:2px;height:16px}
.faq-item[open] .faq-ico::after{transform:scaleY(0);opacity:0}
.faq-a{padding:0 2px 22px;font-size:14px;color:var(--ibm-muted);line-height:1.7;font-weight:300;max-width:700px}
.faq-a p{margin-bottom:10px}
.faq-a p:last-child{margin-bottom:0}
.faq-a a{font-weight:500}
.faq-a .mono{font-size:12.5px}
@media(pointer:coarse){.faq-item summary{min-height:56px}}
</style>
<section class="section" id="faq" aria-labelledby="faq-h">
<div class="inner">
<div class="section-tag">Questions, answered</div>
<h2 id="faq-h" data-i18n-html="ibm_hello.frequently_asked">Frequently <strong>asked</strong></h2>
<p class="section-lead" data-i18n="ibm_hello.what_three_ws_is_what_ibm_brings">What three.ws is, what IBM brings, and how the 3D, AI, and on-chain pieces fit together.</p>
<div class="faq-list">
<details class="faq-item">
<summary data-i18n-html="ibm_hello.what_is_three_ws">What is three.ws?<span class="faq-ico" aria-hidden="true"></span></summary>
<div class="faq-a">
<p data-i18n="ibm_hello.three_ws_is_a_platform_for_3d">three.ws is a platform for 3D AI agents. You describe a character in plain language and get a textured, rigged avatar that walks, poses, and lives in shared 3D worlds — running in any browser, no install. Each agent can carry on-chain identity, hold a wallet, and pay or charge for work in real time.</p>
<p data-i18n-html="ibm_hello.everything_on_this_page_is_a_live">Everything on this page is a live slice of the production platform: <a href="https://three.ws/forge" target="_blank" rel="noopener">Forge</a> (text→3D), <a href="https://three.ws/pose" target="_blank" rel="noopener">Pose</a>, the Granite-mapped agent galaxy, <a href="https://three.ws/play" target="_blank" rel="noopener">Play</a> worlds, and <a href="https://three.ws/irl" target="_blank" rel="noopener">IRL</a> augmented reality.</p>
</div>
</details>
<details class="faq-item">
<summary data-i18n-html="ibm_hello.what_does_ibm_bring_to_the_partnership">What does IBM bring to the partnership?<span class="faq-ico" aria-hidden="true"></span></summary>
<div class="faq-a">
<p data-i18n-html="ibm_hello.ibm_provides_the_trusted_ai_layer_ibm">IBM provides the trusted AI layer. <strong>IBM Granite</strong> models on <strong>watsonx.ai</strong> generate the embeddings that place every agent in the semantic 3D galaxy — agents that do similar things sit together — and Granite names each constellation. <strong>Granite Guardian</strong> screens generated content for safety.</p>
<p data-i18n-html="ibm_hello.the_integration_ships_as_real_installable_mc">The integration ships as real, installable MCP servers — <span class="mono">@three-ws/ibm-watsonx-mcp</span> and <span class="mono">@three-ws/ibm-x402-mcp</span> — so any agent can call watsonx.ai and pay for it over x402.</p>
</div>
</details>
<details class="faq-item">
<summary data-i18n-html="ibm_hello.what_is_the_x402_protocol">What is the x402 protocol?<span class="faq-ico" aria-hidden="true"></span></summary>
<div class="faq-a">
<p data-i18n-html="ibm_hello.x402_revives_the_dormant_http_402_payment">x402 revives the dormant HTTP <span class="mono">402 Payment Required</span> status as a real payment rail. You call an endpoint normally; if it's paid, the server answers <span class="mono">402</span> with an exact price, asset, and address. Your wallet signs a gasless authorization, you resend with an <span class="mono">X-PAYMENT</span> header, and the call settles on-chain — all in one round trip, no account or API key.</p>
<p data-i18n-html="ibm_hello.it_s_what_lets_agents_transact_with">It's what lets agents transact with each other autonomously, pay-per-call, down to a fraction of a cent. Read the <a href="https://three.ws/docs/x402" target="_blank" rel="noopener">protocol docs</a> or add a paywall with the eight-line snippet above.</p>
</div>
</details>
<details class="faq-item">
<summary data-i18n-html="ibm_hello.is_this_real_money_on_a_real">Is this real money on a real blockchain?<span class="faq-ico" aria-hidden="true"></span></summary>
<div class="faq-a">
<p data-i18n-html="ibm_hello.yes_the_paid_demos_move_real_funds">Yes. The paid demos move real funds from your own wallet — USDC, or <span class="mono">$THREE</span> on Solana — and settle on Base or Solana <em>mainnet</em>. Nothing is simulated and nothing is mocked; the price you see is read live from the server's own 402 response, and you get an on-chain settlement receipt.</p>
<p data-i18n="ibm_hello.amounts_are_deliberately_tiny_a_cent_or">Amounts are deliberately tiny (a cent or less), and the free demos — avatars, pose, galaxy, worlds, AR — need no wallet at all.</p>
</div>
</details>
<details class="faq-item">
<summary data-i18n-html="ibm_hello.what_is_three">What is <span class="mono">$THREE</span>?<span class="faq-ico" aria-hidden="true"></span></summary>
<div class="faq-a">
<p data-i18n-html="ibm_hello.three_is_the_native_coin_of_three"><span class="mono">$THREE</span> is the native coin of three.ws, used to pay across the platform alongside USDC. It's the only coin three.ws issues. Contract address: <span class="mono">FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump</span> on Solana.</p>
<p data-i18n-html="ibm_hello.you_can_pay_every_x402_demo_on">You can pay every x402 demo on this page in <span class="mono">$THREE</span>, or <a href="https://pump.fun/FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump" target="_blank" rel="noopener">view it on pump.fun</a>.</p>
</div>
</details>
<details class="faq-item">
<summary data-i18n-html="ibm_hello.how_do_i_build_on_it">How do I build on it?<span class="faq-ico" aria-hidden="true"></span></summary>
<div class="faq-a">
<p data-i18n-html="ibm_hello.three_ways_in_by_altitude_drop_the">Three ways in, by altitude. Drop the one-line <span class="mono">x402.js</span> script onto any page to make an element payable. Reach for one of the <strong>18 zero-dependency <span class="mono">@three-ws/*</span> SDKs</strong> — forge, voice, names, intel, reputation, x402 — to call the APIs directly from code. Or wire the <strong>37 MCP servers</strong> into an AI agent so it can create 3D, pay, trade, and check identity as native tools.</p>
<p data-i18n-html="ibm_hello.start_at_the_ibm_three_ws_docs">Start at the <a href="https://three.ws/docs/ibm" target="_blank" rel="noopener">IBM × three.ws docs</a> or browse callable, paid endpoints in the <a href="https://three.ws/bazaar" target="_blank" rel="noopener">Endpoint Bazaar</a>.</p>
</div>
</details>
<details class="faq-item">
<summary data-i18n-html="ibm_hello.is_this_a_demo_or_production">Is this a demo or production?<span class="faq-ico" aria-hidden="true"></span></summary>
<div class="faq-a">
<p data-i18n="ibm_hello.production_every_demo_here_calls_the_same">Production. Every demo here calls the same live systems the platform runs on — Microsoft TRELLIS on NVIDIA NIM for text→3D, IBM Granite on watsonx.ai for embeddings and safety, Solana and Base RPC for settlement, and the x402 facilitator for payments. There is no sample data and no mock backend anywhere on this page.</p>
</div>
</details>
</div>
</div>
</section>
<!-- ══ NEXT STEPS · deliberate exit (IBM-style CTA band) ══ -->
<style id="next-styles">
.next-sec{padding:44px 0 48px}
.next-band{background:var(--ibm-field);border:1px solid var(--ibm-border);padding:34px 30px;display:flex;flex-wrap:wrap;gap:26px 40px;align-items:center;justify-content:space-between}
.nb-copy{max-width:520px;min-width:0}
.nb-copy h2{font-size:clamp(22px,3.4vw,28px);font-weight:300;line-height:1.15}
.nb-copy h2 strong{font-weight:600}
.nb-copy p{font-size:14.5px;color:var(--ibm-muted);font-weight:300;line-height:1.6;margin-top:10px}
.next-actions{display:flex;flex-direction:column;gap:1px;background:var(--ibm-border);border:1px solid var(--ibm-border);flex:1 1 280px;min-width:0}
.next-act{display:flex;align-items:center;justify-content:space-between;gap:16px;background:var(--ibm-surface);padding:16px 18px;font-size:14px;font-weight:500;color:var(--ibm-ink);transition:background .12s,color .12s}
.next-act:hover{background:var(--ibm-field-focus);color:var(--ibm-blue);text-decoration:none}
.next-act:focus-visible{outline:2px solid var(--ibm-blue);outline-offset:-2px}
.next-act .na-sub{display:block;font-size:12px;font-weight:300;color:var(--ibm-subtle);margin-top:3px}
.next-act:hover .na-sub{color:var(--ibm-blue)}
.next-act .na-arrow{flex:0 0 auto;font-size:17px;color:var(--ibm-blue);transition:transform .12s}
.next-act:hover .na-arrow{transform:translateX(3px)}
@media(pointer:coarse){.next-act{min-height:56px}}
</style>
<section class="section next-sec" id="next" aria-labelledby="next-h">
<div class="inner">
<div class="section-tag">Next steps</div>
<div class="next-band">
<div class="nb-copy">
<h2 id="next-h" data-i18n-html="ibm_hello.build_the_next_3d_agent_economy">Build the next <strong>3D agent economy</strong></h2>
<p data-i18n="ibm_hello.the_same_rails_behind_these_demos_3d">The same rails behind these demos — 3D creation, Granite intelligence, on-chain identity, and x402 payments — are open for you to build on. Pick a door.</p>
</div>
<div class="next-actions">
<a class="next-act" href="https://three.ws/docs/ibm" target="_blank" rel="noopener" data-i18n-html="ibm_hello.read_the_ibm_three_ws_docsintegration_guide">
<span>Read the IBM × three.ws docs<span class="na-sub">Integration guide, watsonx + x402 MCP servers</span></span>
<span class="na-arrow" aria-hidden="true">→</span>
</a>
<a class="next-act" href="https://three.ws/bazaar" target="_blank" rel="noopener" data-i18n-html="ibm_hello.browse_the_endpoint_bazaarcallable_paid_agen">
<span>Browse the Endpoint Bazaar<span class="na-sub">Callable, paid agent endpoints over x402</span></span>
<span class="na-arrow" aria-hidden="true">→</span>
</a>
<a class="next-act" href="https://three.ws/forge" target="_blank" rel="noopener" data-i18n-html="ibm_hello.open_the_platformforge_pose_play_and_irl">
<span>Open the platform<span class="na-sub">Forge, Pose, Play and IRL — the full apps</span></span>
<span class="na-arrow" aria-hidden="true">→</span>
</a>
</div>
</div>
</div>
</section>
</main>
<!-- FAQPage structured data — mirrors the accordion above for rich results. -->
<script type="application/ld+json">{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[{"@type":"Question","name":"What is three.ws?","acceptedAnswer":{"@type":"Answer","text":"three.ws is a platform for 3D AI agents. You describe a character in plain language and get a textured, rigged avatar that walks, poses, and lives in shared 3D worlds — running in any browser, no install. Each agent can carry on-chain identity, hold a wallet, and pay or charge for work in real time over the x402 protocol."}},{"@type":"Question","name":"What does IBM bring to the partnership?","acceptedAnswer":{"@type":"Answer","text":"IBM provides the trusted AI layer. IBM Granite models on watsonx.ai generate the embeddings that place every agent in a semantic 3D galaxy and name each constellation, and Granite Guardian screens generated content for safety. The integration ships as installable MCP servers (@three-ws/ibm-watsonx-mcp and @three-ws/ibm-x402-mcp)."}},{"@type":"Question","name":"What is the x402 protocol?","acceptedAnswer":{"@type":"Answer","text":"x402 revives the HTTP 402 Payment Required status as a real payment rail. You call an endpoint normally; if it is paid the server answers 402 with an exact price, asset, and address. Your wallet signs a gasless authorization, you resend with an X-PAYMENT header, and the call settles on-chain in one round trip — no account or API key. It lets AI agents transact autonomously, pay-per-call, down to a fraction of a cent."}},{"@type":"Question","name":"Is this real money on a real blockchain?","acceptedAnswer":{"@type":"Answer","text":"Yes. The paid demos move real funds from your own wallet — USDC, or $THREE on Solana — and settle on Base or Solana mainnet. Nothing is simulated; the price is read live from the server's 402 response and you receive an on-chain settlement receipt. Amounts are a cent or less, and the free demos need no wallet."}},{"@type":"Question","name":"What is $THREE?","acceptedAnswer":{"@type":"Answer","text":"$THREE is the native coin of three.ws, used to pay across the platform alongside USDC, and the only coin three.ws issues. Contract address: FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump on Solana."}},{"@type":"Question","name":"How do I build on it?","acceptedAnswer":{"@type":"Answer","text":"Three ways in: drop the one-line x402.js script to make any element payable; use one of the 18 zero-dependency @three-ws/* SDKs (forge, voice, names, intel, reputation, x402) to call the APIs from code; or wire the 37 MCP servers into an AI agent so it can create 3D, pay, trade, and verify identity as native tools. Start at the IBM × three.ws docs or the Endpoint Bazaar."}},{"@type":"Question","name":"Is this a demo or production?","acceptedAnswer":{"@type":"Answer","text":"Production. Every demo calls the live systems the platform runs on — Microsoft TRELLIS on NVIDIA NIM for text→3D, IBM Granite on watsonx.ai for embeddings and safety, Solana and Base RPC for settlement, and the x402 facilitator for payments. There is no sample data or mock backend on this page."}}]}</script>
<!-- ══ FOOTER ══ -->
<footer class="footer">
<div class="inner">
<nav class="footer-nav" aria-label="Footer">
<a href="https://three.ws" target="_blank" rel="noopener" data-i18n="ibm_hello.platform">Platform</a>
<a href="https://three.ws/docs/x402" target="_blank" rel="noopener" data-i18n="ibm_hello.x402_protocol">x402 Protocol</a>
<a href="https://three.ws/docs/ibm" target="_blank" rel="noopener" data-i18n="ibm_hello.ibm_three_ws">IBM × three.ws</a>
<a href="https://three.ws/bazaar" target="_blank" rel="noopener" data-i18n="ibm_hello.endpoint_bazaar">Endpoint Bazaar</a>
<a href="https://three.ws/forge" target="_blank" rel="noopener" data-i18n="ibm_hello.forge">Forge</a>
<a href="https://three.ws/pose" target="_blank" rel="noopener" data-i18n="ibm_hello.pose">Pose</a>
<a href="https://three.ws/play" target="_blank" rel="noopener" data-i18n="ibm_hello.play">Play</a>
<a href="https://three.ws/irl" target="_blank" rel="noopener" data-i18n="ibm_hello.irl">IRL</a>
<a href="https://three.ws/changelog" target="_blank" rel="noopener" data-i18n="ibm_hello.changelog">Changelog</a>
</nav>
<div class="footer-legal">
Live x402 demo · three.ws, an IBM Business Partner. Payments settle in USDC on Base or Solana mainnet — or in $THREE on Solana — via the x402 protocol. The only coin this platform issues is $THREE (FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump).
</div>
</div>
</footer>
<!-- x402 drop-in payment modal (Phantom/MetaMask wallet flow + 402 retry).
Same-origin on purpose: the copyable snippet above shows the absolute
https://three.ws/x402.js an external embedder needs, but this page ships
with the file, and loading its own copy across an origin means every
non-production origin (a preview deploy, a local run, an audit sweep)
gets the script CORS-blocked and the paid demos below never arm. -->
<script type="application/ibm-baked" data-ibm-type="module" data-ibm-src="https://three.ws/x402.js"></script>
<!-- <agent-3d> web component — the whole 3D agent framework in one tag. Lazy-boots when scrolled into view. -->
<script type="application/ibm-baked" data-ibm-type="module" data-ibm-src="https://three.ws/agent-3d/latest/agent-3d.js"></script>
<script type="application/ibm-baked" data-ibm-type="">
(function () {
'use strict';
var $ = function (id) { return document.getElementById(id); };
// ── global resilience net ────────────────────────────────────────────────
// Last-ditch catch for an unexpected throw or rejected promise, so a visitor
// sees a calm, dismissible notice instead of a half-rendered panel. It is
// deliberately conservative: this page also loads a lazy-booting 3D agent,
// <model-viewer>, and cross-origin embeds, all of which own their own failure
// UI. Their noise (and opaque cross-origin "Script error." with no detail, or
// aborted fetches) must never raise an alarming banner on an IBM property.
// Shows once; the close button re-arms it.
var bannerShown = false;
function showBanner(msg) {
var b = $('errBanner'); if (!b || bannerShown) return;
bannerShown = true;
$('errBannerText').textContent = msg || 'Something went wrong. Reload the page if it persists.';
b.classList.add('show');
}
// Noise, or failures owned by a third-party module that renders its own state.
var BENIGN_ERR = /ResizeObserver|^Script error\.?$|model-viewer|agent-3d|esm\.sh|WebGL|webgl|\.glb\b|Loading chunk|importing a module|dynamically imported|AbortError|The operation was aborted|NetworkError when attempting/i;
function isBenignReason(reason) {
if (reason == null) return true; // no detail → not actionable
if (reason.name === 'AbortError' || reason.code === 'cancelled') return true;
var text = reason.message ? reason.message : String(reason);
return BENIGN_ERR.test(text);
}
window.addEventListener('error', function (e) {
// No message → opaque cross-origin error (carries nothing actionable); skip.
if (!e || !e.message || BENIGN_ERR.test(e.message)) return;
showBanner('A script error occurred. The demo may be degraded — reload to recover.');
});
window.addEventListener('unhandledrejection', function (e) {
if (isBenignReason(e && e.reason)) return;
showBanner('A background request failed. Check your connection, then retry below.');
});
$('errBannerClose').addEventListener('click', function () {
$('errBanner').classList.remove('show'); bannerShown = false;
});
// ── full-size demo embeds (Galaxy / Play / IRL) ────────────────────────────
// Each presents a real, framable production surface at full size. The iframe
// is created only as the section nears the viewport (IntersectionObserver),
// so three heavy apps never load at once on first paint. A load timeout falls
// back to an "open in a new tab" path; the Full-screen button uses the real
// Fullscreen API.
function loadEmbed(embed) {
if (embed.dataset.loaded === '1') return;
embed.dataset.loaded = '1';
var frame = embed.querySelector('.embed-frame');
var iframe = document.createElement('iframe');
iframe.title = embed.getAttribute('data-label') || 'three.ws demo';
iframe.loading = 'lazy';
// `data-allow` already carries `fullscreen`, which is the modern Permissions-Policy
// way to grant it; adding the legacy `allowfullscreen` attribute too just makes the
// browser warn that `allow` takes precedence, so we rely on `allow` alone.
iframe.setAttribute('allow', embed.getAttribute('data-allow') || '');
iframe.setAttribute('referrerpolicy', 'no-referrer-when-downgrade');
var timer = setTimeout(function () {
if (!embed.classList.contains('loaded')) embed.classList.add('failed');
}, 15000);
iframe.addEventListener('load', function () {
clearTimeout(timer);
embed.classList.add('loaded');
});
iframe.src = embed.getAttribute('data-src');
frame.appendChild(iframe);
}
function wireLiveEmbeds() {
var embeds = document.querySelectorAll('.live-embed');
Array.prototype.forEach.call(embeds, function (embed) {
var fsBtn = embed.querySelector('[data-fs]');
if (fsBtn) fsBtn.addEventListener('click', function () {
var req = embed.requestFullscreen || embed.webkitRequestFullscreen;
if (req) { try { req.call(embed); } catch (_) {} }
else { window.open(embed.getAttribute('data-src'), '_blank', 'noopener'); }
});
});
if ('IntersectionObserver' in window) {
var io = new IntersectionObserver(function (entries) {
entries.forEach(function (e) {
if (e.isIntersecting) { loadEmbed(e.target); io.unobserve(e.target); }
});
}, { rootMargin: '400px 0px' });
Array.prototype.forEach.call(embeds, function (embed) { io.observe(embed); });
} else {
Array.prototype.forEach.call(embeds, loadEmbed);
}
}
$('copyBtn').addEventListener('click', function () {
var snippet =
'<script type="module" src="https://three.ws/x402.js"><\/script>\n\n' +
'<button\n' +
' data-x402-endpoint="https://three.ws/api/x402/three-intel"\n' +
' data-x402-merchant="three.ws"\n' +
' data-x402-action="$THREE intel">\n' +
' Pay $0.01 & get $THREE intel\n' +
'</button>';
var done = function (label) { var b = $('copyBtn'); b.textContent = label; setTimeout(function () { b.textContent = 'Copy snippet'; }, 1600); };
if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(snippet).then(function () { done('Copied ✓'); }, function () { done('Copy failed — select manually'); });
} else {
done('Select the code above to copy');
}
});
// ── Live $THREE Town Oracle ($0.01 USDC over x402) ─────────────────────────
// x402.js binds [data-x402-endpoint] and fires `x402:result` on the button
// with detail { ok, result, payment, response } once payment settles. We
// format the live oracle response into the on-page intel card.
(function () {
var btn = $('threeOracleBtn');
var out = $('threeOracleResult');
if (!btn || !out) return;
var esc = function (s) { var d = document.createElement('div'); d.textContent = String(s == null ? '' : s); return d.innerHTML; };
var num = function (n) { return typeof n === 'number' && isFinite(n); };
var fmtPrice = function (n) { if (!num(n)) return '—'; return n >= 1 ? '$' + n.toLocaleString(undefined, { maximumFractionDigits: 4 }) : '$' + Number(n).toPrecision(4); };
var fmtCompact = function (n) { if (!num(n)) return '—'; try { return '$' + new Intl.NumberFormat('en', { notation: 'compact', maximumFractionDigits: 2 }).format(n); } catch (_) { return '$' + Math.round(n).toLocaleString(); } };
var fmtPct = function (n) { if (!num(n)) return '—'; return (n >= 0 ? '+' : '') + n.toFixed(2) + '%'; };
function render(r) {
if (!r || typeof r !== 'object') { out.innerHTML = '<p class="ti-empty">The call settled but returned no data. Try again.</p>'; return; }
var sig = String(r.signal || 'neutral').toLowerCase();
if (['bullish', 'bearish', 'neutral'].indexOf(sig) < 0) sig = 'neutral';
var chgCls = num(r.change_24h) ? (r.change_24h >= 0 ? 'ti-up' : 'ti-down') : '';
var mintShort = r.mint ? (String(r.mint).slice(0, 4) + '…' + String(r.mint).slice(-4)) : '';
out.innerHTML =
'<div class="ti-topline"><span class="ti-sym mono">$' + esc(r.symbol || 'THREE') + '</span>' +
'<span class="ti-signal ' + sig + '">' + esc(sig) + '</span></div>' +
'<div class="ti-grid">' +
'<div class="ti-cell"><div class="k">Price</div><div class="v">' + fmtPrice(r.price_usd) + '</div></div>' +
'<div class="ti-cell"><div class="k">24h</div><div class="v ' + chgCls + '">' + fmtPct(r.change_24h) + '</div></div>' +
'<div class="ti-cell"><div class="k">Market cap</div><div class="v">' + fmtCompact(r.market_cap_usd) + '</div></div>' +
'<div class="ti-cell"><div class="k">Liquidity</div><div class="v">' + fmtCompact(r.liquidity_usd) + '</div></div>' +
'<div class="ti-cell"><div class="k">24h volume</div><div class="v">' + fmtCompact(r.volume_24h_usd) + '</div></div>' +
'</div>' +
(r.headline ? '<p class="ti-headline">' + esc(r.headline) + '</p>' : '') +
(r.rationale ? '<p class="ti-rationale">' + esc(r.rationale) + '</p>' : '') +
'<p class="ti-meta">' + (mintShort ? 'mint ' + esc(mintShort) + ' · ' : '') + (num(r.confidence) ? 'confidence ' + Math.round(r.confidence * 100) + '% · ' : '') + 'live via x402</p>';
}
btn.addEventListener('x402:result', function (e) {
var d = e.detail || {};
var r = d.result;
if (typeof r === 'string') { try { r = JSON.parse(r); } catch (_) {} }
render(r);
try { out.scrollIntoView({ behavior: 'smooth', block: 'nearest' }); } catch (_) {}
});
btn.addEventListener('x402:error', function (e) {
var msg = (e.detail && e.detail.error) ? String(e.detail.error) : 'The payment was cancelled or failed.';
out.innerHTML = '<p class="ti-empty">' + esc(msg) + ' Nothing was charged unless a receipt appeared — you can try again.</p>';
});
})();
wireLiveEmbeds();
})();
</script>
<!-- Demo 01 · Forge — paid x402 prompt→3D. Pays POST /api/x402/forge, then polls
the free GET /api/forge?job=<id> for the finished GLB and orbits it inline. -->
<script type="application/ibm-baked" data-ibm-type="module">
(function () {
'use strict';
var FORGE_ENDPOINT = 'https://three.ws/api/x402/forge';
var POLL_ENDPOINT = 'https://three.ws/api/forge';
// Per-tier atomic USDC prices (6 decimals) — refreshed live from the 402
// challenge, but seeded so the UI is correct before the first fetch resolves.
var TIER_ATOMIC = { draft: 50000, standard: 150000, high: 500000 };
var TIER_ETA = { draft: 40, standard: 60, high: 130 };
var $ = function (id) { return document.getElementById(id); };
if (!$('fgBtn')) return; // section not present — nothing to wire
var selectedTier = 'draft';
var inFlight = false;
var pollTimer = null;
var genTimer = null;
// Networks the live 402 challenge is quoting, for specific error guidance.
var quotedNetworks = '';
// model-viewer is heavy (~955 KB, bundles its own Three.js) and only needed once
// a model has actually been forged. Load it lazily, self-hosted from ./vendor/, so
// a page view that never forges pays nothing for it and its Three.js never co-exists
// with the agent's at idle. Injected <model-viewer> elements upgrade automatically
// once the module defines the custom element; a blocked/failed load never wedges the
// result UI (the GLB download link still works).
var _mvLoading = null;
function ensureModelViewer() {
if (_mvLoading) return _mvLoading;
_mvLoading = new Promise(function (resolve) {
if (window.customElements && customElements.get('model-viewer')) { resolve(); return; }
var s = document.createElement('script');
s.type = 'module';
// Absolute, not './vendor/…': this page is built to be embedded. On any host
// where the relative path doesn't resolve (a preview tool, a partner site,
// file://) the element would never upgrade and sit as a blank box — exactly
// why the free generator looked broken while <agent-3d> (loaded from an
// absolute URL) worked. The canonical copy on three.ws is served with
// `Access-Control-Allow-Origin: *`, so it loads cross-origin anywhere.
s.src = 'https://three.ws/ibm/vendor/model-viewer.min.js';
s.addEventListener('error', resolve);
document.head.appendChild(s);
if (window.customElements) customElements.whenDefined('model-viewer').then(resolve, resolve);
else resolve();
});
return _mvLoading;
}
function escapeHtml(s) {
return String(s == null ? '' : s).replace(/[&<>"']/g, function (c) {
return { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c];
});
}
// Route the forged GLB through three.ws's first-party /cdn proxy (CORS `*`) so
// model-viewer can fetch it from any origin this page is embedded on — the raw
// r2.dev bucket domain only allow-lists specific hosts, which would leave a
// cross-origin embed staring at an empty viewer. See the free-forge widget below.
function cdnGlb(u) {
try {
var url = new URL(u, location.href);
if (/(^|\.)r2\.dev$/i.test(url.hostname)) return 'https://three.ws/cdn' + url.pathname + url.search;
return u;
} catch (_) { return u; }
}
function prefersReducedMotion() {
return !!(window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches);
}
function flashPrice(el) {
if (!el || prefersReducedMotion()) return;
el.classList.remove('flash'); void el.offsetWidth; el.classList.add('flash');
el.addEventListener('animationend', function once() { el.classList.remove('flash'); el.removeEventListener('animationend', once); });
}
function shortAddr(a) {
if (!a) return '—'; a = String(a);
return a.length > 16 ? a.slice(0, 6) + '…' + a.slice(-4) : a;
}
function networkLabel(net) {
if (!net) return '—';
if (net.indexOf('solana') === 0) return 'Solana';
if (net === 'eip155:8453') return 'Base';
if (net.indexOf('eip155:') === 0) return 'EVM ' + net.split(':')[1];
return net;
}
function explorerUrl(net, tx) {
if (!tx || !net) return null;
if (net.indexOf('solana') === 0) return 'https://solscan.io/tx/' + tx;
if (net === 'eip155:8453') return 'https://basescan.org/tx/' + tx;
return null;
}
function fmtUsd(atomics, decimals) {
var n = Number(atomics) / Math.pow(10, decimals || 6);
if (!isFinite(n)) return '$0';
if (n < 0.01) return '$' + n.toFixed(6).replace(/0+$/, '').replace(/\.$/, '');
return '$' + n.toFixed(2);
}
function priceLabel(tier) { return fmtUsd(TIER_ATOMIC[tier] || 50000, 6); }
function announce(msg) {
var a = $('fgAnnouncer'); if (!a) return;
a.textContent = '';
window.requestAnimationFrame(function () { a.textContent = msg || ''; });
}
function sanitizePrompt(raw) { return String(raw || '').replace(/\s+/g, ' ').trim().slice(0, 1000); }
function setPromptError(msg) {
var f = $('fgPrompt'), h = $('fgPromptHint');
if (msg) { f.setAttribute('aria-invalid', 'true'); h.className = 'field-hint err'; h.textContent = msg; }
else { f.removeAttribute('aria-invalid'); h.className = 'field-hint'; h.textContent = 'One subject works best — describe it in a sentence.'; }
}
function setBusy(b, label) {
inFlight = b;
var btn = $('fgBtn');
btn.disabled = b || !navigator.onLine;
btn.classList.toggle('loading', b);
btn.querySelector('.label').textContent = b ? (label || 'Working…') : ('Pay ' + priceLabel(selectedTier) + ' & forge');
}
// ── price tag + button reflect the selected tier ─────────────────────────
function syncTierUi() {
var amt = $('fgPriceAmt');
var html = escapeHtml(priceLabel(selectedTier)).replace(/^\$/, '$<strong>') + '</strong>';
if (amt.innerHTML !== html) { amt.innerHTML = html; flashPrice(amt); }
var sr = $('fgPriceSr'); if (sr) sr.textContent = 'Price: ' + priceLabel(selectedTier) + ' USDC per generation.';
if (!inFlight) $('fgBtn').querySelector('.label').textContent = 'Pay ' + priceLabel(selectedTier) + ' & forge';
}
// ── tier prices from the public catalog (authoritative) ──────────────────
function loadCatalog() {
fetch(FORGE_ENDPOINT, { method: 'GET' })
.then(function (r) { return r.ok ? r.json() : null; })
.then(function (d) {
var list = d && d.pricing_usdc;
if (!Array.isArray(list)) return;
list.forEach(function (t) {
var atomic = Math.round(Number(t.price_usdc) * 1e6);
if (t.tier && isFinite(atomic) && atomic > 0) TIER_ATOMIC[t.tier] = atomic;
});
document.querySelectorAll('#fgTiers .tier').forEach(function (btn) {
var tier = btn.getAttribute('data-tier');
var el = btn.querySelector('[data-price]');
if (el && TIER_ATOMIC[tier]) el.textContent = fmtUsd(TIER_ATOMIC[tier], 6);
});
syncTierUi();
})
.catch(function () {});
}
// ── live 402 challenge preview for the selected tier ─────────────────────
function loadChallengePreview() {
var preview = $('fgPreview');
if (preview) preview.setAttribute('aria-busy', 'true');
var prompt = sanitizePrompt($('fgPrompt').value) || 'a brass steampunk owl, full body';
fetch(FORGE_ENDPOINT, {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ prompt: prompt, tier: selectedTier, aspect_ratio: '1:1' })
})
.then(function (res) {
if (res.status !== 402 && res.status !== 401) throw new Error('expected 402, got ' + res.status);
return res.json().catch(function () { return null; });
})
.then(function (body) {
var accepts = (body && body.accepts) || [];
if (!accepts.length) throw new Error('no payment terms in challenge');
// Solana-only checkout — quote just the Solana terms in the live preview
// so it matches the wallet flow. Fall back to all terms if the server
// ever omits Solana, so the preview never renders empty.
var solanaOnly = accepts.filter(function (a) { return a && typeof a.network === 'string' && a.network.indexOf('solana') === 0; });
renderChallengePreview(solanaOnly.length ? solanaOnly : accepts);
})
.catch(function (err) {
var label = $('fgPvLabel'); label.className = 'preview-label err';
$('fgPvLabelText').textContent = navigator.onLine
? "Couldn't read the live price just now — the forge button still works."
: "You're offline — the live price will load when you reconnect.";
var detail = escapeHtml(String((err && err.message) || 'request failed')).slice(0, 120);
$('fgPvRows').innerHTML =
'<div class="preview-row"><span class="v" style="color:var(--ibm-subtle)">' + detail + '</span></div>' +
'<button class="pv-retry" type="button" id="fgPvRetry">Retry</button>';
var r = $('fgPvRetry'); if (r) r.addEventListener('click', loadChallengePreview);
})
.then(function () { if (preview) preview.setAttribute('aria-busy', 'false'); });
}
function renderChallengePreview(accepts) {
var byNet = {};
accepts.forEach(function (a) { if (a && a.network && !byNet[a.network]) byNet[a.network] = a; });
var nets = Object.keys(byNet).map(function (k) { return byNet[k]; });
var first = nets[0];
var decimals = (first.extra && first.extra.decimals) || 6;
quotedNetworks = nets.map(function (a) { return networkLabel(a.network); }).join(' or ');
var atomic = Number(first.amount);
if (isFinite(atomic) && atomic > 0) { TIER_ATOMIC[selectedTier] = atomic; syncTierUi(); }
var label = $('fgPvLabel'); label.className = 'preview-label ok fresh';
$('fgPvLabelText').innerHTML = '<span class="mono">HTTP 402 Payment Required</span> — the server is quoting these terms right now';
var rows = '';
rows += '<div class="preview-row"><span class="k">price</span><span class="v">' + escapeHtml(fmtUsd(first.amount, decimals)) + ' USDC · ' + escapeHtml(selectedTier) + '</span></div>';
var badges = nets.map(function (a) { return '<span class="badge">' + escapeHtml(networkLabel(a.network)) + '</span>'; }).join('');
rows += '<div class="preview-row"><span class="k">networks</span><span class="v">' + badges + '</span></div>';
nets.forEach(function (a) {
rows += '<div class="preview-row"><span class="k">pay to</span><span class="v">' + escapeHtml(shortAddr(a.payTo)) + ' <span style="color:var(--ibm-subtle)">(' + escapeHtml(networkLabel(a.network)) + ')</span></span></div>';
});
rows += '<div class="preview-row"><span class="k">returns</span><span class="v">a job token → poll for the finished GLB</span></div>';
$('fgPvRows').innerHTML = rows;
}
// ── result states ─────────────────────────────────────────────────────────
function setResultEmpty() {
var el = $('fgResult'); el.className = 'result is-empty';
el.innerHTML = 'Forge a model to see it appear here — orbit it, then download the GLB.';
announce('');
}
function setResultLoading(msg) {
var el = $('fgResult'); el.className = 'result is-loading';
el.innerHTML = '<div class="r-status"><span class="spin" aria-hidden="true"></span><span>' + escapeHtml(msg) + '</span></div>';
announce(msg);
}
function payGuidance(msg) {
var m = String(msg || '').toLowerCase();
if (/insufficient|not enough|exceeds balance|transfer amount exceeds|enough usdc|enough funds|low balance/.test(m)) {
return 'Top up USDC on ' + (quotedNetworks || 'your wallet network') + ', then try again.';
}
if (/offline|failed to fetch|networkerror|connection|timeout|timed out|could not reach|lost contact/.test(m)) {
return 'Check your connection, then try again.';
}
return '';
}
function setResultError(msg) {
var text = msg || 'Something went wrong.';
var tip = payGuidance(text);
var el = $('fgResult'); el.className = 'result is-error';
el.innerHTML = '<div class="r-status err"><span aria-hidden="true">✕</span> <span>' + escapeHtml(text) + '</span></div>' +
(tip ? '<p class="r-tip">' + escapeHtml(tip) + '</p>' : '') +
'<button class="retry" type="button" id="fgRetry">Try again</button>';
var rb = $('fgRetry'); if (rb) rb.addEventListener('click', runForge);
announce('Error: ' + text + (tip ? ' ' + tip : ''));
}
// The paid generation has settled but is taking longer than this inline demo can
// wait. Rather than leave the visitor stranded, hand them the job in the full Forge
// tool (the same backend, with a durable job view) so they can collect the result.
function setResultStillWorking(msg, jobId) {
var text = msg || 'Still working — your payment settled.';
var forgeUrl = 'https://three.ws/forge' + (jobId ? '?job=' + encodeURIComponent(jobId) : '');
var el = $('fgResult'); el.className = 'result is-error';
el.innerHTML =
'<div class="r-status err"><span aria-hidden="true">⏳</span> <span>' + escapeHtml(text) + '</span></div>' +
'<p class="r-tip">Your payment went through and the model is still generating. Open it in the full Forge tool to watch it finish and download the GLB — your job is waiting there.</p>' +
'<div class="r-actions">' +
'<a class="r-btn" href="' + escapeHtml(forgeUrl) + '" target="_blank" rel="noopener">Continue in Forge ↗</a>' +
'<button class="r-btn ghost" type="button" id="fgRetry">Try again</button>' +
'</div>';
var rb = $('fgRetry'); if (rb) rb.addEventListener('click', runForge);
announce(text + ' Continue in the full Forge tool to collect your model.');
}
function setResultGenerating(payment, etaSec, startTs) {
ensureModelViewer(); // warm the viewer during the generation wait so the result paints instantly
var el = $('fgResult'); el.className = 'result is-loading';
el.innerHTML =
'<div class="r-status"><span class="spin" aria-hidden="true"></span><span id="fgGenText">Payment settled — forging your model…</span></div>' +
'<div class="mv-wrap"><div style="height:min(56vh,440px);display:flex;align-items:center;justify-content:center;color:var(--ibm-subtle);font-size:13px">Generating geometry…</div><div class="mv-progress" id="fgProg"></div></div>';
announce('Payment settled. Forging your 3D model — about ' + etaSec + ' seconds.');
clearInterval(genTimer);
genTimer = setInterval(function () {
var elapsed = Math.round((Date.now() - startTs) / 1000);
var prog = Math.min(0.95, elapsed / (etaSec * 1.4));
var bar = $('fgProg'); if (bar) bar.style.width = (prog * 100).toFixed(1) + '%';
var t = $('fgGenText'); if (t) t.textContent = 'Payment settled — forging your model… ' + elapsed + 's';
}, 1000);
}
function mvAvailable() {
return !!(window.customElements && customElements.get('model-viewer'));
}
function setResultDone(glbUrl, payment, meta) {
clearInterval(genTimer);
var el = $('fgResult'); el.className = 'result is-done';
var explorer = explorerUrl(payment.network, payment.transaction);
glbUrl = cdnGlb(glbUrl);
var safeGlb = escapeHtml(glbUrl);
var html = '';
html += '<div class="r-status ok"><span class="r-check" aria-hidden="true">✓</span><span>Payment settled — model forged</span></div>';
// The viewer is optional polish. If model-viewer never loaded (blocked script,
// failed CDN-free fetch, unsupported engine) we don't render a dead <model-viewer>
// that sits empty forever — we show the GLB as a downloadable file with a note.
// ensureModelViewer() resolves whether or not the element upgrades, so by the time
// its promise settles we can make an honest decision and re-render in place.
ensureModelViewer().then(function () {
// Element upgraded (or will upgrade in place) → leave the live viewer alone.
if (mvAvailable()) return;
// The module never defined the custom element. Swap the inert <model-viewer>
// for an explicit download fallback so the user always gets their model.
var mv = el.querySelector('.mv-wrap');
if (mv) {
mv.innerHTML =
'<div style="display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:28px 18px;text-align:center;color:var(--ibm-subtle);font-size:13px;font-weight:300">' +
'<span>The 3D viewer couldn’t load here — your model is ready as a downloadable file.</span>' +
'<a class="r-btn" href="' + safeGlb + '" download target="_blank" rel="noopener">Download GLB</a>' +
'</div>';
announce('The 3D viewer could not load, but your model is ready to download.');
}
});
html += '<div class="mv-wrap"><model-viewer src="' + safeGlb + '" alt="The 3D model you just forged" camera-controls auto-rotate rotation-per-second="18deg" interaction-prompt="none" shadow-intensity="0.7" shadow-softness="0.8" environment-image="neutral" exposure="1" camera-orbit="0deg 80deg auto" loading="eager"></model-viewer></div>';
html += '<div class="r-actions">' +
'<a class="r-btn" href="' + safeGlb + '" download target="_blank" rel="noopener">Download GLB</a>' +
'<a class="r-btn ghost" href="https://three.ws/forge" target="_blank" rel="noopener">Rig & refine in Forge ↗</a>' +
'</div>';
html += '<dl class="receipt">';
html += '<div class="receipt-pair"><dt class="rk">Tier</dt><dd class="rv">' + escapeHtml((meta && meta.tier) || selectedTier) + '</dd></div>';
html += '<div class="receipt-pair"><dt class="rk">Network</dt><dd class="rv">' + escapeHtml(networkLabel(payment.network)) + '</dd></div>';
html += '<div class="receipt-pair"><dt class="rk">Payer</dt><dd class="rv">' + escapeHtml(shortAddr(payment.payer)) + '</dd></div>';
html += '<div class="receipt-pair"><dt class="rk">Transaction</dt><dd class="rv">' +
(payment.transaction
? (explorer ? '<a href="' + explorer + '" target="_blank" rel="noopener">' + escapeHtml(shortAddr(payment.transaction)) + ' <span aria-hidden="true">↗</span></a>' : escapeHtml(shortAddr(payment.transaction)))
: '—') + '</dd></div>';
html += '</dl>';
html += '<details class="raw"><summary>View raw response & settlement</summary><pre>' +
escapeHtml(JSON.stringify({ glb_url: glbUrl, job: meta, payment: payment }, null, 2)).slice(0, 6000) + '</pre></details>';
el.innerHTML = html;
// If model-viewer upgraded but can't fetch the GLB (CORS/404), swap the inert
// viewer for the same honest download fallback rather than leaving it blank.
var mvLive = el.querySelector('model-viewer');
if (mvLive) mvLive.addEventListener('error', function () {
var mv = el.querySelector('.mv-wrap');
if (!mv) return;
mv.innerHTML =
'<div style="display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:28px 18px;text-align:center;color:var(--ibm-subtle);font-size:13px;font-weight:300">' +
'<span>The 3D viewer couldn’t load the model here — it’s ready as a downloadable file.</span>' +
'<a class="r-btn" href="' + safeGlb + '" download target="_blank" rel="noopener">Download GLB</a>' +
'</div>';
announce('The 3D viewer could not load the model, but it is ready to download.');
}, { once: true });
announce('Your 3D model is ready. Orbit it above or download the GLB.');
}
// ── poll the free status endpoint until the GLB is ready ─────────────────
function pollForge(jobId, payment, etaSec) {
var startTs = Date.now();
var tries = 0;
var maxTries = 150; // ~6.5 min at 2.6s
setResultGenerating(payment, etaSec, startTs);
(function tick() {
fetch(POLL_ENDPOINT + '?job=' + encodeURIComponent(jobId), { method: 'GET' })
.then(function (r) { return r.json().catch(function () { return null; }); })
.then(function (d) {
if (!d) throw new Error('empty');
if (d.status === 'done' && d.glb_url) { setResultDone(d.glb_url, payment, d); return; }
if (d.status === 'failed') { clearInterval(genTimer); setResultError(d.error || 'Generation failed. Your payment settled — try the full Forge tool.'); return; }
tries++;
if (tries >= maxTries) { clearInterval(genTimer); setResultStillWorking('Still working after several minutes — your payment settled.', jobId); return; }
pollTimer = setTimeout(tick, 2600);
})
.catch(function () {
tries++;
if (tries >= maxTries) { clearInterval(genTimer); setResultStillWorking('Lost contact while generating — your payment settled.', jobId); return; }
pollTimer = setTimeout(tick, 2600);
});
})();
}
// ── pay → generate ───────────────────────────────────────────────────────
function runForge() {
if (inFlight) return;
if (!navigator.onLine) { setResultError('You appear to be offline. Reconnect and try again.'); return; }
var prompt = sanitizePrompt($('fgPrompt').value);
if (prompt.length < 3) { setPromptError('Describe an object — at least a few characters.'); $('fgPrompt').focus(); return; }
setPromptError(null);
$('fgPrompt').value = prompt;
if (!window.X402 || typeof window.X402.pay !== 'function') {
setResultError('Payment widget is still loading — give it a second and try again.');
return;
}
var tier = selectedTier;
var trigger = document.activeElement;
setBusy(true, 'Waiting for wallet…');
setResultLoading('Waiting for your wallet… approve the ' + priceLabel(tier) + ' USDC payment to start the generation.');
window.X402.pay({
endpoint: FORGE_ENDPOINT,
method: 'POST',
body: { prompt: prompt, tier: tier, aspect_ratio: '1:1' },
merchant: 'three.ws',
action: 'Forge: ' + prompt.slice(0, 48),
networks: ['solana'],
caps: { maxPerCall: (TIER_ATOMIC[tier] || 500000) }
}).then(function (out) {
if (!out || !out.ok) { setResultError('The payment did not complete. Please try again.'); return; }
var job = out.result || {};
var payment = out.payment || {};
// The paid route may finish synchronously on some backends.
if (job.status === 'done' && job.glb_url) { setResultDone(job.glb_url, payment, job); return; }
var jobId = job.job_id;
if (!jobId) { setResultError('Payment settled, but no job token came back. Try the full Forge tool.'); return; }
var eta = Number(job.eta_seconds) || TIER_ETA[tier] || 60;
pollForge(jobId, payment, eta);
}).catch(function (err) {
if (err && err.code === 'cancelled') { setResultEmpty(); return; }
setResultError((err && err.message) || 'Payment failed. Please try again.');
}).then(function () {
setBusy(false);
var t = (trigger && trigger.focus && document.body.contains(trigger)) ? trigger : $('fgBtn');
try { t.focus(); } catch (_) { try { $('fgBtn').focus(); } catch (_2) {} }
});
}
// ── tier selection (WAI-ARIA radiogroup) ─────────────────────────────────────
// Selection drives a roving tabindex: only the checked radio is in the tab
// order, so Tab lands on the group once and Arrow/Home/End move within it —
// the operable behaviour the role="radiogroup"/role="radio" markup promises.
function tierButtons() {
return Array.prototype.slice.call(document.querySelectorAll('#fgTiers .tier'));
}
function selectTier(tier, focusIt) {
if (!TIER_ATOMIC[tier]) return;
var changed = tier !== selectedTier;
selectedTier = tier;
tierButtons().forEach(function (btn) {
var on = btn.getAttribute('data-tier') === tier;
btn.setAttribute('aria-checked', on ? 'true' : 'false');
btn.tabIndex = on ? 0 : -1;
if (on && focusIt) { try { btn.focus(); } catch (_) {} }
});
if (changed) { syncTierUi(); loadChallengePreview(); }
}
// ── wiring ──────────────────────────────────────────────────────────────────
(function wireTierKeys() {
var btns = tierButtons();
btns.forEach(function (btn, i) {
btn.addEventListener('click', function () { selectTier(btn.getAttribute('data-tier')); });
btn.addEventListener('keydown', function (e) {
var key = e.key, next = -1;
if (key === 'ArrowRight' || key === 'ArrowDown') next = (i + 1) % btns.length;
else if (key === 'ArrowLeft' || key === 'ArrowUp') next = (i - 1 + btns.length) % btns.length;
else if (key === 'Home') next = 0;
else if (key === 'End') next = btns.length - 1;
else return;
e.preventDefault();
selectTier(btns[next].getAttribute('data-tier'), true);
});
});
})();
$('fgBtn').addEventListener('click', runForge);
$('fgPrompt').addEventListener('keydown', function (e) { if (e.key === 'Enter') { e.preventDefault(); runForge(); } });
var pvTimer;
$('fgPrompt').addEventListener('input', function () {
setPromptError(null);
clearTimeout(pvTimer);
pvTimer = setTimeout(loadChallengePreview, 600);
});
window.addEventListener('online', function () { setBusy(inFlight); loadChallengePreview(); });
window.addEventListener('offline', function () { setBusy(inFlight); });
syncTierUi();
loadCatalog();
loadChallengePreview();
})();
</script>
<!-- Free, no-wallet text→3D companion to the paid Forge. POSTs the free
/api/forge NVIDIA NIM (Microsoft TRELLIS) lane, walks a fallback ladder, and
polls GET /api/forge?job=<id>. No wallet, no key, no payment. -->
<script type="application/ibm-baked" data-ibm-type="module">
(function () {
'use strict';
var API = 'https://three.ws/api/forge';
var $ = function (id) { return document.getElementById(id); };
var btn = $('g3dBtn');
if (!btn) return; // panel not present — nothing to wire
var input = $('g3dPrompt');
var result = $('g3dResult');
var statusEl = $('g3dStatus');
var suggest = $('g3dSuggest');
var inFlight = false;
var runSeq = 0;
var loadTimer = null;
var CID = (function () {
var fresh = function () { return 'c-' + Date.now().toString(36) + '-' + Math.random().toString(36).slice(2, 10); };
try {
var KEY = 'forge:cid';
var v = localStorage.getItem(KEY);
if (!v) { v = (window.crypto && crypto.randomUUID) ? crypto.randomUUID() : fresh(); localStorage.setItem(KEY, v); }
return v;
} catch (e) { return fresh(); }
})();
var HEADERS = { 'x-forge-client': CID };
// Load model-viewer, resilient to a transient script failure, and resolve to
// whether the element is genuinely defined so the caller never mounts an inert
// tag. Absolute, not './vendor/…': this page is built to be embedded. On any
// host where a relative path doesn't resolve (a preview tool, a partner site,
// file://) the element would never upgrade and would sit as a blank box — which
// is exactly why the free generator looked broken while <agent-3d> (loaded from
// an absolute URL) worked. The canonical copy on three.ws is self-contained and
// served with `Access-Control-Allow-Origin: *`, so it upgrades from any origin.
var MV_SRC = 'https://three.ws/ibm/vendor/model-viewer.min.js';
var _mv = null;
function ensureModelViewer() {
if (_mv) return _mv;
_mv = new Promise(function (resolve) {
function defined() { return !!(window.customElements && customElements.get('model-viewer')); }
if (defined()) { resolve(true); return; }
if (!window.customElements) { resolve(false); return; }
var settled = false;
function done(v) { if (settled) return; settled = true; resolve(v); }
customElements.whenDefined('model-viewer').then(function () { done(true); });
function inject(attempt) {
var s = document.createElement('script');
s.type = 'module';
s.src = attempt > 1 ? (MV_SRC + '?r=' + attempt) : MV_SRC;
s.addEventListener('error', function () {
if (attempt < 3) setTimeout(function () { inject(attempt + 1); }, 600 * attempt);
else done(defined());
});
document.head.appendChild(s);
}
inject(1);
setTimeout(function () { done(defined()); }, 15000); // never hang — report real state
});
return _mv;
}
function esc(s) {
return String(s == null ? '' : s).replace(/[&<>"']/g, function (c) {
return { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c];
});
}
function sleep(ms) { return new Promise(function (r) { setTimeout(r, ms); }); }
// Forge outputs are served from the bucket's public r2.dev domain, whose CORS
// only allow-lists specific hosts (three.ws, the IBM properties). Embedded on
// any other origin — a page builder, file://, a sandboxed iframe (Origin:
// null), a partner site — model-viewer's cross-origin GLB fetch is CORS-blocked
// and the viewer paints nothing but its background. three.ws's first-party /cdn
// proxy streams the same object with `Access-Control-Allow-Origin: *`, so route
// every GLB through it and the model loads no matter where this page runs.
function cdnGlb(u) {
try {
var url = new URL(u, location.href);
if (/(^|\.)r2\.dev$/i.test(url.hostname)) return 'https://three.ws/cdn' + url.pathname + url.search;
return u;
} catch (_) { return u; }
}
// Attempt plan. /api/forge already runs its OWN internal fallback ladder
// (NVIDIA NIM → TRELLIS → Hugging Face → Replicate) inside a single request and
// always hands back a job that polls to a finished GLB — so the client must NOT
// re-walk backends. The old 3-rung × 2-pass ladder fired up to six POSTs per
// click, which (a) spent the free lane's hourly budget ~6× faster — a few clicks
// self-inflicted a 429 — and (b) turned a slow NVCF cold-start into a multi-minute
// cascade that surfaced as a hard error even though the backend was fine. We make
// one primary request and, only on a HARD failure (network / 5xx / timeout — never
// a rate-limit), retry once nudging the reliable reconstruct lane. A 429 is its own
// "busy" state (see setBusy), not a wasted retry.
var ATTEMPTS = [
{ tier: 'draft' }, // server picks the fast NVIDIA lane (warm ≈ 15s; cold ≈ up to a minute, then it degrades internally)
{ tier: 'draft', backend: 'trellis' } // hard-failure retry only: force the reliable reconstruct lane
];
// POST a generation. A cold NVCF lane can hold the request ~a minute before the
// server degrades, so the abort budget is generous; a genuinely hung/cut socket
// still aborts and is retried rather than spinning forever. 429 and other non-2xx
// become typed errors the caller can branch on (busy vs hard failure).
async function startJob(body) {
var ctrl = new AbortController();
var to = setTimeout(function () { ctrl.abort(); }, 95000);
var res;
try {
res = await fetch(API, {
method: 'POST',
headers: Object.assign({ 'content-type': 'application/json' }, HEADERS),
body: JSON.stringify(body),
signal: ctrl.signal
});
} finally { clearTimeout(to); }
var data = await res.json().catch(function () { return {}; });
if (res.status === 429) {
var ra = Number(data.retry_after) || Number(res.headers.get('retry-after')) || 20;
throw Object.assign(new Error(data.message || 'The free lane is busy.'), { code: 429, retryAfter: ra });
}
if (!res.ok) throw Object.assign(new Error(data.message || data.error || ('HTTP ' + res.status)), { code: res.status });
return data;
}
async function pollJob(jobId, seq) {
var deadline = Date.now() + 240000;
while (seq === runSeq && Date.now() < deadline) {
await sleep(2500);
if (seq !== runSeq) return null;
var data = {};
try {
var ctrl = new AbortController();
var to = setTimeout(function () { ctrl.abort(); }, 20000);
var res;
try { res = await fetch(API + '?job=' + encodeURIComponent(jobId), { headers: HEADERS, signal: ctrl.signal }); }
finally { clearTimeout(to); }
data = await res.json().catch(function () { return {}; });
} catch (_) { data = {}; } // a transient poll blip is not fatal — keep polling
if (data.status === 'done' && data.glb_url) return data;
if (data.status === 'failed') throw new Error(data.error || 'generation failed');
}
if (seq !== runSeq) return null;
throw new Error('timed out');
}
async function generate(prompt, seq) {
var lastErr = null;
for (var i = 0; i < ATTEMPTS.length; i++) {
if (seq !== runSeq) return null;
try {
var job = await startJob(Object.assign({ prompt: prompt, aspect_ratio: '1:1', path: 'image' }, ATTEMPTS[i]));
if (job.status === 'done' && job.glb_url) return job; // synchronous (NVIDIA warm)
if (job.job_id) {
var done = await pollJob(job.job_id, seq);
if (done) return done;
if (seq !== runSeq) return null;
}
lastErr = new Error('no model returned');
} catch (e) {
if (e && e.code === 429) throw e; // rate-limited — surface "busy", don't burn another attempt
lastErr = e;
if (seq !== runSeq) return null;
await sleep(1800); // brief backoff before the reliable-lane retry
}
}
throw lastErr || new Error('generation unavailable');
}
function setLoading() {
var msgs = [
'Reading your prompt…',
'Warming up the free GPU — a cold start can take up to a minute…',
'Generating geometry on NVIDIA NIM…',
'Texturing the mesh…',
'Finalizing the GLB…'
];
var i = 0;
result.className = 'g3d-result is-loading';
result.innerHTML =
'<div class="g3d-load"><span class="g3d-bar"><span></span></span>' +
'<span class="g3d-loadmsg" id="g3dLoadMsg">' + esc(msgs[0]) + '</span></div>';
statusEl.textContent = 'Generating your 3D model.';
clearInterval(loadTimer);
loadTimer = setInterval(function () {
i = (i + 1) % msgs.length;
var el = $('g3dLoadMsg');
if (el) el.textContent = msgs[i];
}, 4000);
}
function setError() {
clearInterval(loadTimer);
result.className = 'g3d-result is-error';
result.innerHTML =
'<div class="g3d-err"><p>The free generator is briefly unreachable. It auto-retries across NVIDIA NIM and TRELLIS — give it another try.</p>' +
'<button type="button" class="g3d-retry" id="g3dRetry">Try again</button></div>';
var rb = $('g3dRetry');
if (rb) rb.addEventListener('click', run);
statusEl.textContent = 'Generation failed. Press try again.';
}
// Distinct from a hard failure: the free lane has an hourly cap so it stays free
// for everyone. Tell the visitor exactly when to retry and point at the instant
// paid lane above, instead of the misleading "unreachable" copy.
function setBusy(retryAfter) {
clearInterval(loadTimer);
var secs = Math.max(5, Math.round(Number(retryAfter) || 20));
result.className = 'g3d-result is-error';
result.innerHTML =
'<div class="g3d-err"><p>The free lane is busy — it has an hourly limit so it stays free for everyone. Try again in about ' + secs + ' seconds, or use the paid Forge above for an instant generation.</p>' +
'<button type="button" class="g3d-retry" id="g3dRetry">Try again</button></div>';
var rb = $('g3dRetry');
if (rb) rb.addEventListener('click', run);
statusEl.textContent = 'The free lane is busy. Try again in about ' + secs + ' seconds.';
}
function engineLabel(backend) {
if (backend === 'nvidia') return 'Microsoft TRELLIS · NVIDIA NIM';
if (backend === 'trellis') return 'Microsoft TRELLIS';
if (backend === 'huggingface') return 'TRELLIS · Hugging Face';
return 'three.ws Forge';
}
function viewerMarkup(glb) {
return '<div class="mv-wrap"><model-viewer src="' + esc(glb) + '" alt="3D model generated from your prompt" ' +
'camera-controls auto-rotate rotation-per-second="18deg" interaction-prompt="none" ' +
'shadow-intensity="0.7" shadow-softness="0.8" environment-image="neutral" exposure="1" ' +
'camera-orbit="0deg 80deg auto" loading="eager"></model-viewer></div>';
}
async function renderModel(job, prompt) {
clearInterval(loadTimer);
var ready = await ensureModelViewer();
var glb = cdnGlb(job.glb_url);
var scene = 'https://three.ws/scene?model=' + encodeURIComponent(glb) +
'&name=' + encodeURIComponent(prompt.slice(0, 80));
var actions =
'<div class="g3d-actions">' +
'<a class="g3d-act primary" href="' + esc(glb) + '" download>Download GLB</a>' +
'<a class="g3d-act" href="' + esc(scene) + '" target="_blank" rel="noopener">Open in 3D scene ↗</a>' +
'<span class="g3d-engine">Generated free · ' + esc(engineLabel(job.backend)) + '</span>' +
'</div>';
result.className = 'g3d-result is-done';
result.innerHTML = viewerMarkup(glb) + actions;
statusEl.textContent = 'Your 3D model is ready. Orbit it, or download the GLB.';
// Make the orbit view a certainty, not a hope. Confirm the GLB actually paints
// (model-viewer's 'load'); if it errors or never paints, remount the viewer
// once — that clears a one-off decode/WebGL-context blip — before falling back
// to the designed retry. The visitor either orbits their model or gets a clear
// way to recover; never a silent black box.
if (!ready) { setError(); return; }
var attempted = 0;
function mountViewer() {
attempted++;
var wrap = result.querySelector('.mv-wrap');
var mv = wrap && wrap.querySelector('model-viewer');
if (!mv) { setError(); return; }
var settled = false;
var watchdog = setTimeout(function () {
// 'load' should fire within seconds of a reachable GLB; if neither load nor
// error arrives, treat it as a stall and remount/recover.
if (settled) return;
if (mv.loaded) { settled = true; return; } // painted, event just missed
onProblem();
}, 12000);
function onProblem() {
if (settled) return; settled = true; clearTimeout(watchdog);
if (attempted < 2) { result.innerHTML = viewerMarkup(glb) + actions; mountViewer(); }
else setError();
}
mv.addEventListener('load', function () { settled = true; clearTimeout(watchdog); }, { once: true });
mv.addEventListener('error', onProblem, { once: true });
}
mountViewer();
}
async function run() {
var prompt = (input.value || '').trim();
if (!prompt) { try { input.focus(); } catch (_) {} return; }
var seq = ++runSeq;
inFlight = true;
btn.classList.add('loading');
btn.disabled = true;
setLoading();
try {
var job = await generate(prompt, seq);
if (seq !== runSeq) return;
if (!job || !job.glb_url) throw new Error('no model');
await renderModel(job, prompt);
} catch (e) {
if (seq !== runSeq) return;
if (e && e.code === 429) setBusy(e.retryAfter);
else setError();
} finally {
if (seq === runSeq) {
inFlight = false;
btn.classList.remove('loading');
btn.disabled = false;
}
}
}
btn.addEventListener('click', function () { if (!inFlight) run(); });
input.addEventListener('keydown', function (e) {
if (e.key === 'Enter') { e.preventDefault(); if (!inFlight) run(); }
});
if (suggest) {
suggest.addEventListener('click', function (e) {
var b = e.target.closest('button[data-p]');
if (!b) return;
input.value = b.getAttribute('data-p');
if (!inFlight) run();
});
}
})();
</script>
<!-- Demo 02 · Avatar Forge — free text → textured mesh → auto-rigged → animated.
Two-stage /api/forge pipeline: POST (reconstruct) → POST ?action=rig, then the
rigged GLB is mounted into <agent-3d> so the universal retarget animates it. If
that web component can't boot (no WebGL / script blocked) it falls back to an
orbiting <model-viewer> so the visitor always sees their avatar. No wallet, no
key. Drives the guide agent (Demo 03) via window 'avatar:*' events. -->
<script type="application/ibm-baked" data-ibm-type="module">
(function () {
'use strict';
var API = 'https://three.ws/api/forge';
var $ = function (id) { return document.getElementById(id); };
var btn = $('avBtn');
if (!btn) return; // panel not present — nothing to wire
var input = $('avPrompt');
var result = $('avResult');
var statusEl = $('avStatus');
var suggest = $('avSuggest');
var steps = $('avSteps');
var inFlight = false;
var runSeq = 0;
var loadTimer = null;
var bootTimer = null;
// Shared free-lane client id (same key the object forge uses) so the hourly
// budget is accounted per visitor, not per widget.
var CID = (function () {
var fresh = function () { return 'c-' + Date.now().toString(36) + '-' + Math.random().toString(36).slice(2, 10); };
try {
var KEY = 'forge:cid';
var v = localStorage.getItem(KEY);
if (!v) { v = (window.crypto && crypto.randomUUID) ? crypto.randomUUID() : fresh(); localStorage.setItem(KEY, v); }
return v;
} catch (e) { return fresh(); }
})();
var HEADERS = { 'x-forge-client': CID };
function esc(s) {
return String(s == null ? '' : s).replace(/[&<>"']/g, function (c) {
return { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c];
});
}
function sleep(ms) { return new Promise(function (r) { setTimeout(r, ms); }); }
function emit(name) { try { window.dispatchEvent(new Event(name)); } catch (_) {} }
// Route the rigged GLB through three.ws's first-party /cdn proxy (CORS `*`) so
// both <agent-3d> and the <model-viewer> fallback can fetch it from whatever
// origin this page is embedded on. The raw r2.dev bucket domain only allow-lists
// specific hosts, so a cross-origin embed would otherwise get an empty stage.
function cdnGlb(u) {
try {
var url = new URL(u, location.href);
if (/(^|\.)r2\.dev$/i.test(url.hostname)) return 'https://three.ws/cdn' + url.pathname + url.search;
return u;
} catch (_) { return u; }
}
// ── pipeline step indicator (mesh → rig → animate) ──────────────────────────
var STEP_ORDER = ['mesh', 'rig', 'animate'];
function setStep(active) {
if (!steps) return;
steps.setAttribute('aria-hidden', 'false');
var ai = STEP_ORDER.indexOf(active);
Array.prototype.forEach.call(steps.querySelectorAll('li'), function (li) {
var i = STEP_ORDER.indexOf(li.getAttribute('data-step'));
li.classList.toggle('active', i === ai);
li.classList.toggle('done', ai >= 0 && i < ai);
});
}
function clearSteps() {
if (!steps) return;
steps.setAttribute('aria-hidden', 'true');
Array.prototype.forEach.call(steps.querySelectorAll('li'), function (li) { li.classList.remove('active', 'done'); });
}
// ── /api/forge job helpers — same contract as the free object forge ─────────
// A POST returns either a synchronous { glb_url } (warm lane) or a { job_id }
// we poll. ?action=rig surfaces the rigged GLB through the identical envelope.
async function startJob(body, action) {
var ctrl = new AbortController();
var to = setTimeout(function () { ctrl.abort(); }, 95000);
var res;
try {
res = await fetch(API + (action ? '?action=' + action : ''), {
method: 'POST',
headers: Object.assign({ 'content-type': 'application/json' }, HEADERS),
body: JSON.stringify(body),
signal: ctrl.signal
});
} finally { clearTimeout(to); }
var data = await res.json().catch(function () { return {}; });
if (res.status === 429) {
var ra = Number(data.retry_after) || Number(res.headers.get('retry-after')) || 20;
throw Object.assign(new Error(data.message || 'The free lane is busy.'), { code: 429, retryAfter: ra });
}
if (!res.ok) throw Object.assign(new Error(data.message || data.error || ('HTTP ' + res.status)), { code: res.status });
return data;
}
async function pollJob(jobId, seq) {
var deadline = Date.now() + 240000;
while (seq === runSeq && Date.now() < deadline) {
await sleep(2500);
if (seq !== runSeq) return null;
var data = {};
try {
var ctrl = new AbortController();
var to = setTimeout(function () { ctrl.abort(); }, 20000);
var res;
try { res = await fetch(API + '?job=' + encodeURIComponent(jobId), { headers: HEADERS, signal: ctrl.signal }); }
finally { clearTimeout(to); }
data = await res.json().catch(function () { return {}; });
} catch (_) { data = {}; } // a transient poll blip is not fatal — keep polling
if (data.status === 'done' && data.glb_url) return data;
if (data.status === 'failed') throw new Error(data.error || 'generation failed');
}
if (seq !== runSeq) return null;
throw new Error('timed out');
}
async function jobToGlb(body, action, seq) {
var job = await startJob(body, action);
if (job && job.glb_url) return job; // synchronous result
if (job && job.job_id) {
var done = await pollJob(job.job_id, seq);
if (done) return done;
if (seq !== runSeq) return null;
}
throw new Error('no model returned');
}
// Stage 1 — text → textured mesh. One primary request, then a single
// hard-failure retry forcing the reliable reconstruct lane (never on a 429),
// mirroring the object forge so we don't burn the shared hourly budget.
async function generateMesh(prompt, seq) {
var hint = prompt + ', full body, standing, humanoid character';
var attempts = [{ tier: 'draft' }, { tier: 'draft', backend: 'trellis' }];
var lastErr = null;
for (var i = 0; i < attempts.length; i++) {
if (seq !== runSeq) return null;
try {
var job = await jobToGlb(Object.assign({ prompt: hint, aspect_ratio: '1:1', path: 'image' }, attempts[i]), null, seq);
if (job && job.glb_url) return job;
lastErr = new Error('no mesh');
} catch (e) {
if (e && e.code === 429) throw e; // rate-limited — surface "busy", don't burn the retry
lastErr = e;
if (seq !== runSeq) return null;
await sleep(1800);
}
}
throw lastErr || new Error('generation unavailable');
}
// Stage 2 — auto-rig the mesh into an animation-ready skeleton.
function rigMesh(glbUrl, seq) { return jobToGlb({ glb_url: glbUrl }, 'rig', seq); }
// ── states ──────────────────────────────────────────────────────────────────
function setLoading(stage) {
var copy = stage === 'rig'
? ['Mesh ready — building the skeleton…', 'Mapping bones to the canonical rig…', 'Binding skin weights…', 'Retargeting the animation library…']
: ['Reading your prompt…', 'Warming the free GPU — a cold start can take up to a minute…', 'Generating geometry on NVIDIA NIM…', 'Texturing the mesh…'];
result.className = 'av-result is-loading';
result.innerHTML = '<div class="av-load"><span class="av-bar"><span></span></span><span class="av-loadmsg" id="avLoadMsg">' + esc(copy[0]) + '</span></div>';
statusEl.textContent = stage === 'rig' ? 'Rigging your avatar.' : 'Generating your avatar.';
clearInterval(loadTimer);
var i = 0;
loadTimer = setInterval(function () { i = (i + 1) % copy.length; var el = $('avLoadMsg'); if (el) el.textContent = copy[i]; }, 4000);
}
function setError() {
clearInterval(loadTimer); clearSteps(); emit('avatar:error');
result.className = 'av-result is-error';
result.innerHTML =
'<div class="av-err"><p>The free generator is briefly unreachable. It auto-retries across NVIDIA NIM and TRELLIS — give it another try.</p>' +
'<button type="button" class="av-retry" id="avRetry">Try again</button></div>';
var rb = $('avRetry'); if (rb) rb.addEventListener('click', run);
statusEl.textContent = 'Generation failed. Press try again.';
}
// The free lane has an hourly cap so it stays free for everyone — tell the
// visitor exactly when to retry rather than the misleading "unreachable" copy.
function setBusy(retryAfter) {
clearInterval(loadTimer); clearSteps(); emit('avatar:error');
var secs = Math.max(5, Math.round(Number(retryAfter) || 20));
result.className = 'av-result is-error';
result.innerHTML =
'<div class="av-err"><p>The free lane is busy — it has an hourly limit so it stays free for everyone. Try again in about ' + secs + ' seconds, or open the full Forge for an instant generation.</p>' +
'<button type="button" class="av-retry" id="avRetry">Try again</button></div>';
var rb = $('avRetry'); if (rb) rb.addEventListener('click', run);
statusEl.textContent = 'The free lane is busy. Try again in about ' + secs + ' seconds.';
}
// ── result rendering ──────────────────────────────────────────────────────
var _mv = null;
function ensureModelViewer() {
if (_mv) return _mv;
_mv = new Promise(function (resolve) {
if (window.customElements && customElements.get('model-viewer')) { resolve(); return; }
var s = document.createElement('script');
s.type = 'module';
// Absolute, not './vendor/…': this page is built to be embedded. On any host
// where the relative path doesn't resolve (a preview tool, a partner site,
// file://) the element would never upgrade and sit as a blank box — exactly
// why the free generator looked broken while <agent-3d> (loaded from an
// absolute URL) worked. The canonical copy on three.ws is served with
// `Access-Control-Allow-Origin: *`, so it loads cross-origin anywhere.
s.src = 'https://three.ws/ibm/vendor/model-viewer.min.js';
s.addEventListener('error', resolve);
document.head.appendChild(s);
if (window.customElements) customElements.whenDefined('model-viewer').then(resolve, resolve);
else resolve();
});
return _mv;
}
function actionsHtml(glb, prompt, live) {
var scene = 'https://three.ws/scene?model=' + encodeURIComponent(glb) + '&name=' + encodeURIComponent(prompt.slice(0, 80));
return '<div class="av-actions">' +
'<a class="av-act primary" href="' + esc(glb) + '" download>Download rigged GLB</a>' +
'<a class="av-act" href="' + esc(scene) + '" target="_blank" rel="noopener">Open in 3D scene ↗</a>' +
'<span class="av-engine">Rigged free · ' + (live ? 'live avatar engine' : 'orbit preview') + '</span></div>';
}
async function renderFallback(glb, prompt) {
clearInterval(loadTimer); clearSteps();
await ensureModelViewer();
result.className = 'av-result is-done';
result.innerHTML =
'<div class="av-stage"><model-viewer src="' + esc(glb) + '" alt="Rigged 3D avatar generated from your prompt" ' +
'camera-controls auto-rotate rotation-per-second="18deg" interaction-prompt="none" ' +
'shadow-intensity="0.8" shadow-softness="0.8" environment-image="neutral" exposure="1" ' +
'camera-orbit="0deg 85deg auto" loading="eager"></model-viewer></div>' + actionsHtml(glb, prompt, false);
var mv = result.querySelector('model-viewer');
if (mv) mv.addEventListener('error', function () { setError(); }, { once: true });
statusEl.textContent = 'Your rigged avatar is ready. Orbit it, or download the GLB.';
emit('avatar:done');
}
function renderAvatar(glb, prompt) {
clearInterval(loadTimer);
setStep('animate');
result.className = 'av-result is-done';
result.innerHTML = '<div class="av-stage" id="avStageBox"></div>' + actionsHtml(glb, prompt, true);
var box = $('avStageBox');
var el = document.createElement('agent-3d');
el.setAttribute('body', glb);
el.setAttribute('background', 'transparent');
el.setAttribute('width', '100%');
el.setAttribute('height', '460px');
var settled = false;
el.addEventListener('agent:ready', function () {
if (settled) return; settled = true;
clearTimeout(bootTimer); clearSteps();
try { if (el.playEmote) el.playEmote('wave'); } catch (_) {}
statusEl.textContent = 'Your avatar is live — it stands, breathes, and waves. Download it, or open it in a scene.';
emit('avatar:done');
});
el.addEventListener('error', function () {
if (settled) return; settled = true;
clearTimeout(bootTimer); renderFallback(glb, prompt);
});
box.appendChild(el);
// If the component never upgrades/boots, show the orbit fallback so the
// visitor still gets their avatar; if it upgraded but is slow to signal
// ready, accept it as live rather than tearing down a working render.
bootTimer = setTimeout(function () {
if (settled) return;
var upgraded = window.customElements && customElements.get('agent-3d');
if (!upgraded) { settled = true; renderFallback(glb, prompt); }
else { settled = true; clearSteps(); statusEl.textContent = 'Your avatar is live. Download it, or open it in a scene.'; emit('avatar:done'); }
}, 14000);
}
async function run() {
var prompt = (input.value || '').trim();
if (!prompt) { try { input.focus(); } catch (_) {} return; }
var seq = ++runSeq;
inFlight = true;
btn.classList.add('loading'); btn.disabled = true;
emit('avatar:generating');
setStep('mesh'); setLoading('mesh');
try {
var mesh = await generateMesh(prompt, seq);
if (seq !== runSeq) return;
if (!mesh || !mesh.glb_url) throw new Error('no mesh');
// Stage 2 is best-effort: a rig hiccup still yields a viewable textured mesh.
var glb = mesh.glb_url;
setStep('rig'); setLoading('rig');
try {
var rigged = await rigMesh(mesh.glb_url, seq);
if (seq !== runSeq) return;
if (rigged && rigged.glb_url) glb = rigged.glb_url;
} catch (rigErr) {
if (rigErr && rigErr.code === 429) throw rigErr; // free lane busy — surface it
if (seq !== runSeq) return;
// otherwise fall through with the unrigged mesh
}
renderAvatar(cdnGlb(glb), prompt);
} catch (e) {
if (seq !== runSeq) return;
if (e && e.code === 429) setBusy(e.retryAfter);
else setError();
} finally {
if (seq === runSeq) { inFlight = false; btn.classList.remove('loading'); btn.disabled = false; }
}
}
btn.addEventListener('click', function () { if (!inFlight) run(); });
input.addEventListener('keydown', function (e) { if (e.key === 'Enter') { e.preventDefault(); if (!inFlight) run(); } });
if (suggest) {
suggest.addEventListener('click', function (e) {
var b = e.target.closest('button[data-p]');
if (!b) return;
input.value = b.getAttribute('data-p');
if (!inFlight) run();
});
}
})();
</script>
</div>
<script>
(function () {
var LIVE = "https://three.ws/ibm/hello.live";
var CACHE_KEY = 'ibm-hello-live-v1';
var TIMEOUT_MS = 3000;
var app = document.getElementById('ibm-app');
if (!app) return;
var baked = [].slice.call(app.querySelectorAll('script[type="application/ibm-baked"]'));
function descFromInert(n) {
return { src: n.getAttribute('data-ibm-src') || '', type: n.getAttribute('data-ibm-type') || '', code: n.textContent || '' };
}
// The live document is authored to run same-origin on three.ws, so its own
// scripts are named root-relative ('/x402.js'). Here the page is somebody
// else's domain, where that resolves against THEIR origin and 404s, so the
// fetched document gets the same rewrite the baked copy got at build time.
// On three.ws itself the rewrite is a no-op: the origin it prepends is the
// one the page is already served from.
function abs(src) {
return src.charAt(0) === '/' && src.charAt(1) !== '/' ? "https://three.ws" + src : src;
}
function descFromLive(n) {
return { src: abs(n.getAttribute('src') || ''), type: (n.getAttribute('type') || '').toLowerCase(), code: n.textContent || '' };
}
// Run a list of script descriptors in order. src scripts are awaited so anything
// that depends on x402.js / agent-3d.js (earlier in the page) sees it loaded.
function run(descs) {
var i = 0;
(function next() {
if (i >= descs.length) return;
var d = descs[i++];
var el = document.createElement('script');
if (d.type === 'module') el.type = 'module';
else if (d.type) el.type = d.type;
if (d.src) {
el.src = d.src;
el.addEventListener('load', next);
el.addEventListener('error', next);
document.body.appendChild(el);
} else {
el.textContent = d.code;
document.body.appendChild(el);
next();
}
})();
}
function activateBaked() {
document.documentElement.setAttribute('data-ibm-source', 'baked');
run(baked.map(descFromInert));
}
function activateLive(doc) {
// Carry over the live page's <head> styles, then replace the body markup and
// run the live scripts — exactly once, so nothing double-initialises.
var hs = doc.head.querySelectorAll('style, link[rel="stylesheet"]');
for (var s = 0; s < hs.length; s++) document.head.appendChild(document.importNode(hs[s], true));
if (doc.title) document.title = doc.title;
var live = [];
var all = doc.querySelectorAll('script');
for (var k = 0; k < all.length; k++) {
var ty = (all[k].getAttribute('type') || '').toLowerCase();
if (ty === '' || ty === 'module' || ty === 'text/javascript' || ty === 'application/javascript') live.push(all[k]);
}
var bodyScripts = doc.body.querySelectorAll('script');
for (var b = 0; b < bodyScripts.length; b++) bodyScripts[b].parentNode.removeChild(bodyScripts[b]);
app.innerHTML = doc.body.innerHTML;
document.documentElement.setAttribute('data-ibm-source', 'live');
run(live.map(descFromLive));
}
function fromCache() {
try {
var html = localStorage.getItem(CACHE_KEY);
if (!html) return false;
var doc = new DOMParser().parseFromString(html, 'text/html');
if (!doc.body) return false;
activateLive(doc);
return true;
} catch (e) { return false; }
}
var ctrl = ('AbortController' in window) ? new AbortController() : null;
var timer = setTimeout(function () { if (ctrl) ctrl.abort(); }, TIMEOUT_MS);
fetch(LIVE, { cache: 'no-cache', credentials: 'omit', signal: ctrl ? ctrl.signal : undefined })
.then(function (r) { if (!r.ok) throw new Error('HTTP ' + r.status); return r.text(); })
.then(function (html) {
clearTimeout(timer);
if (!html || html.indexOf('<body') === -1) throw new Error('empty');
try { localStorage.setItem(CACHE_KEY, html); } catch (e) {}
activateLive(new DOMParser().parseFromString(html, 'text/html'));
})
.catch(function () {
clearTimeout(timer);
if (!fromCache()) activateBaked();
});
})();
</script>
</body>
</html>