Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

feat(irl): give every placed agent a scannable visit link and a printable sign

nirholas0f0aa684ae8a
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 32aef571f..e58d4ee05 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,11 +11,15 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Filming the product demo** (`/docs/product-demo`): How the narrated walkthrough of every three.ws feature is filmed on the live site: the route is generated from the Feature Tour curriculum, so a page that ships tomorrow films itself, and each chapter can be re-shot on its own.
- **Machine Atlas** (`/assembly`): A radial aero engine and a steam locomotive generated in the browser from code, with no 3D model files: solved linkages, live dimensions, explode views and a GLB export.
- **Pocket Console** (`/pocket`): A handheld console with a live 3D agent inside the screen. Steer it with the D-pad, swap cartridges for any public agent, and embed the whole console anywhere with one line of HTML.
+- **Printable IRL sign** (`/irl/sign`): Print a sign for a placed IRL agent: its name, thumbnail and a QR of the visit link. Scan it at the spot to open IRL, walk up, and meet the 3D AI agent in AR. Carries no coordinate.
- **3D models now open, animate and report on themselves inside VS Code**: A new three.ws extension makes .glb and .gltf files first-class in the editor. Double-click one and it renders in an editor tab instead of showing binary-file-not-shown: orbit it, play its animation clips on a scrub bar, flip on the wireframe or the skeleton, and save the view as a PNG next to the model. A report panel counts triangles, textures, bones and extensions and says what to fix, using the same inspector as the validation page, running on your machine so the model is never uploaded to be measured. Compressed avatars decode locally, so it all works offline. From the command palette you can also generate a model or an avatar from a sentence on the free lane, rig a static model for animation, browse and import recent community creations, and drop in an agent-3d embed snippet with the current library version and its integrity hash already pinned. (`/docs/vscode`) `[feature, sdk]`
- **A new agent skill teaches Claude to look for an existing 3D asset before making one**: find-3d-assets joins the three.ws Agent Skills pack. It tells an AI assistant that the platform already publishes 3,492 finished 3D assets and how to search them, so a request like put a chair on my landing page gets an existing CC0 chair in seconds instead of a generation job that takes GPU minutes and produces something nobody has looked at. The skill covers all three ways in (the free MCP tools, the plain HTTP endpoint, and the command line), which framework to emit for each kind of asset, and how to read the license that travels with every result. It also says plainly when to give up on the catalog and generate instead, and to tell the user which of the two they got. (`/docs/agent-skills`) `[feature, docs]`
- **AI coding assistants can now search the three.ws asset library and get working code back**: Every ready-made asset the platform publishes is now one search away from any AI coding client connected to the three.ws MCP server: 511 CC0 props, 107 rigged characters and 2,874 motion clips, all in a single searchable catalog instead of three separate browse pages. Ask for a wooden chair or an industrial lamp and you get matching items ranked best first, with tags, license, and the CDN link. Ask for the source and you get code that runs as it is: the model-viewer tag our own gallery renders with, the agent-3d web component pinned to the exact published version and its integrity hash, plain three.js, or a React component. Motion clips come back as three.js code that loads and plays them. All three tools are free and need no account, no API key and no payment, because you should be able to find out what is already here before you sign up for anything. A search that matches only part of what you typed says so instead of returning nothing. (`/docs/mcp`) `[feature, sdk]`
+- **Invite people to an IRL agent with a visit link and a printable sign**: Every agent you have placed in the real world now has a visit link and a sign you can print and tape to the spot. Someone who scans it opens IRL with a banner naming the agent they came to meet, and the moment they are close enough the agent appears in their camera, flashes, and opens its card by itself: bio, reputation, wallet, tip QR, services, and a message box. That card also gained See it in AR. On iPhone it stands the agent on the real floor in Quick Look, animated, and the banner inside AR brings you straight back to the tip panel; other phones open the AR launcher. The link never contains a location, so you can post it anywhere and the agent still only shows to people who are actually there. Find it under Visit link on each placement in your dashboard. (`/irl`) `[feature, improvement]`
- **Machine Atlas: two working machines built in the browser from code, with no 3D model files**: A new Labs surface at /assembly renders a nine-cylinder radial aero engine and a coupled steam locomotive without loading a single model file. Both are generated when the page opens: bore and stroke set the crank throw, the crank throw sets the crankcase diameter, and every fin, rail section and propeller blade is a profile revolved, extruded or lofted at runtime. Move any dimension slider and the geometry is rebuilt in front of you. The motion is solved rather than animated, so the pistons follow the exact slider-crank and the locomotive's valve gear closes a real four-bar chain every frame, which means a rod length that cannot physically reach simply refuses to move. Pull either machine apart with the explode slider, switch to the structure view to see the mesh, hover any part to name it, hide whole subassemblies, and read the actual generating calls in the Source panel, printed from the values you set. Every configuration has its own link, and any of them can be exported as a GLB or saved as a PNG frame. (`/assembly`) `[feature]`
- **One command drops a three.ws prop, character or motion clip into your project**: npx @three-ws/assets search wooden chair finds it, and npx @three-ws/assets add object:painted_wooden_chair_01 downloads the model into your public folder and prints the tag that renders it, already pointing at your local copy rather than our CDN. Your site keeps working even if we do not. The catalog behind it is the same one the AI tools read: 511 CC0 props, 107 rigged characters and 2,874 motion clips, searchable in one place instead of three separate galleries. It is also a plain HTTP endpoint now, GET /api/catalog, free and open to any origin, so a build script or a site that is not using an AI client can read it too. Adding an asset twice changes nothing the second time, and a file you edited afterwards is never overwritten without asking. Every object is CC0, and the license of anything that is not travels with it in the output. (`/docs/api-reference`) `[feature, sdk]`
+- **Seven background jobs that were never running now run**: Seven scheduled jobs were declared in the platform config but had no matching job on the scheduler, so they had never fired: the companion poll, feedback triage, print-order syncing, the home health alert, the home-relay sweep, web-variant generation for the forge, and the oracle refit. Three of them shipped with live features behind them, which meant those features quietly did nothing on a timer. All seven are now created and enabled on their declared schedules, and a drift check confirms every declared job exists and matches. `[fix, infra]`
+- **The site header now stays put when you scroll**: The navigation bar was set to stick to the top of the window but never actually did: it scrolled away with the page on every route, at every screen size, so reaching the menu meant scrolling all the way back up. The bar was mounted inside a wrapper exactly its own height, and a sticky element can only travel inside its parent, so it had nowhere to go. The header now stays on screen wherever you scroll, on phones and desktop alike. `[fix, improvement]`
- **Your agent now lives in a handheld console you can put on any website**: The new Pocket Console at /pocket is a real handheld with a real 3D agent inside the screen. The D-pad walks it, A waves, B jumps, START swaps between the agent walking, its live stats, and a menu of every public agent you can slot in like a cartridge, and L and R flip through them. It takes keyboard, touch and a plugged-in game controller. Four shell finishes, four scenes, and the whole state travels in the link, so what you share is the device exactly as you left it. Add chrome=off and one iframe puts the console, your agent included, on your own site: transparent background, no sign-in, no SDK, no API key. (`/pocket`) `[feature]`
## 2026-09-04
diff --git a/data/pages.json b/data/pages.json
index e65efc255..50f9f5af9 100644
--- a/data/pages.json
+++ b/data/pages.json
@@ -198,11 +198,19 @@
{
"path": "/irl",
"title": "IRL",
- "description": "Place a 3D avatar in your real environment. Camera AR passthrough, joystick movement, and tap-to-place 3D objects on your floor.",
+ "description": "Pin a 3D AI agent at a real place and meet the ones around you. Walk up, see it through your camera, talk to it out loud, view it in AR on your own floor, and pay it on the spot.",
"priority": 0.75,
"changefreq": "monthly",
"added": "2026-06-13"
},
+ {
+ "path": "/irl/sign",
+ "title": "Printable IRL sign",
+ "description": "Print a sign for a placed IRL agent: its name, thumbnail and a QR of the visit link. Scan it at the spot to open IRL, walk up, and meet the 3D AI agent in AR. Carries no coordinate.",
+ "priority": 0.4,
+ "changefreq": "yearly",
+ "added": "2026-09-05"
+ },
{
"path": "/irl-privacy",
"title": "How location works on IRL",
diff --git a/pages/irl-sign.html b/pages/irl-sign.html
new file mode 100644
index 000000000..401e363b6
--- /dev/null
+++ b/pages/irl-sign.html
@@ -0,0 +1,137 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <script>/* three.ws theme boot: no-flash; runtime in /theme-switcher.js */(function(){try{var m=localStorage.getItem('twx_theme');var l=m==='auto'?(window.matchMedia&&window.matchMedia('(prefers-color-scheme: light)').matches):m==='light';document.documentElement.setAttribute('data-theme',l?'light':'dark');}catch(e){document.documentElement.setAttribute('data-theme','dark');}})();</script>
+ <meta charset="utf-8" />
+ <link rel="icon" href="/favicon.ico" sizes="any" />
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
+ <title>Meet this agent in AR: printable IRL sign | three.ws</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <meta name="description" content="A printable sign for a placed IRL agent. Scan the QR to open three.ws IRL on your phone, walk up, and meet the 3D AI agent standing at this spot in AR." />
+ <meta name="robots" content="noindex, follow" />
+ <link rel="canonical" href="https://three.ws/irl/sign" />
+ <meta property="og:type" content="website" />
+ <meta property="og:site_name" content="three.ws" />
+ <meta property="og:title" content="Meet this agent in AR | three.ws IRL" />
+ <meta property="og:description" content="Scan to open three.ws IRL, walk up, and meet the 3D AI agent standing here." />
+ <meta property="og:image" content="https://three.ws/api/page-og?s=main&amp;t=Meet+this+agent+in+AR&amp;d=Scan+to+open+three.ws+IRL%2C+walk+up%2C+and+meet+the+3D+AI+agent+standing+here.&amp;p=%2Firl%2Fsign" />
+ <meta name="twitter:card" content="summary_large_image" />
+ <meta name="twitter:site" content="@trythreews" />
+ <link rel="stylesheet" href="/tokens.css" />
+ <link rel="stylesheet" href="/fonts/fonts.css" />
+ <style>
+ :root { color-scheme: light dark; }
+ html, body { margin: 0; background: var(--bg, #0b0e15); color: var(--ink, #eef2f8); font-family: var(--font-body, system-ui, -apple-system, sans-serif); }
+ [hidden] { display: none !important; }
+ .sg-wrap { max-width: 900px; margin: 0 auto; padding: 28px 18px 64px; }
+
+ /* Screen chrome: controls that never print. */
+ .sg-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 20px; }
+ .sg-bar-title { font-weight: 700; font-size: 15px; letter-spacing: -.01em; margin-right: auto; }
+ .sg-bar-sub { font-size: 12.5px; color: var(--ink-muted, #9aa7bb); flex-basis: 100%; }
+ .sg-btn { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(125,211,252,0.4); background: rgba(125,211,252,0.12); color: #bfe6ff; font: 600 13px/1 inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; transition: background .15s ease, transform .1s ease; }
+ .sg-btn:hover { background: rgba(125,211,252,0.22); }
+ .sg-btn:active { transform: scale(.98); }
+ .sg-btn:focus-visible { outline: 2px solid #7dd3fc; outline-offset: 2px; }
+ .sg-btn.primary { background: #7dd3fc; color: #06131c; border-color: #7dd3fc; }
+ .sg-btn.primary:hover { background: #a5e1ff; }
+ .sg-seg { display: inline-flex; border: 1px solid rgba(255,255,255,0.14); border-radius: 999px; overflow: hidden; }
+ .sg-seg button { min-height: 38px; padding: 0 12px; border: 0; background: transparent; color: inherit; font: 600 12.5px/1 inherit; cursor: pointer; }
+ .sg-seg button[aria-pressed="true"] { background: rgba(255,255,255,0.14); }
+ .sg-seg button:focus-visible { outline: 2px solid #7dd3fc; outline-offset: -2px; }
+
+ /* The sign itself: white, high contrast, and readable from two metres. */
+ .sg-sheet { background: #fff; color: #0b0e15; border-radius: 22px; padding: clamp(24px, 5vw, 48px); box-shadow: 0 24px 70px rgba(0,0,0,0.45); display: grid; gap: clamp(18px, 3vw, 28px); }
+ .sg-kicker { display: inline-flex; align-items: center; gap: 8px; font: 700 12px/1 inherit; letter-spacing: .12em; text-transform: uppercase; color: #0369a1; }
+ .sg-kicker-dot { width: 8px; height: 8px; border-radius: 50%; background: #0ea5e9; }
+ .sg-head { display: flex; align-items: center; gap: 18px; }
+ .sg-thumb { width: clamp(72px, 12vw, 112px); height: clamp(72px, 12vw, 112px); flex: 0 0 auto; border-radius: 24px; background: #e6f4fd; display: grid; place-items: center; font-size: 34px; overflow: hidden; }
+ .sg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
+ .sg-name { margin: 0; font-size: clamp(30px, 6vw, 52px); font-weight: 800; letter-spacing: -.03em; line-height: 1.02; }
+ .sg-tag { margin: 6px 0 0; font-size: clamp(15px, 2.4vw, 19px); color: #334155; }
+ .sg-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(18px, 4vw, 40px); align-items: center; }
+ .sg-qr { width: clamp(200px, 32vw, 320px); aspect-ratio: 1; border-radius: 16px; border: 3px solid #0b0e15; padding: 8px; background: #fff; }
+ .sg-qr svg { width: 100%; height: 100%; display: block; }
+ .sg-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; counter-reset: step; }
+ .sg-steps li { display: flex; gap: 14px; align-items: flex-start; font-size: clamp(16px, 2.6vw, 22px); line-height: 1.3; }
+ .sg-steps li::before { counter-increment: step; content: counter(step); flex: 0 0 34px; height: 34px; border-radius: 50%; background: #0b0e15; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 16px; }
+ .sg-bio { margin: 0; font-size: clamp(14px, 2vw, 17px); color: #475569; line-height: 1.5; }
+ .sg-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; border-top: 1px solid #e2e8f0; padding-top: 16px; font-size: 13px; color: #475569; }
+ .sg-url { font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 12.5px; color: #0b0e15; word-break: break-all; }
+ .sg-brand { font-weight: 800; letter-spacing: -.02em; color: #0b0e15; }
+
+ /* Poster orientation flips the layout so the QR dominates a vertical page. */
+ .sg-sheet.is-poster .sg-body { grid-template-columns: 1fr; justify-items: center; text-align: left; }
+ .sg-sheet.is-poster .sg-qr { width: min(70vw, 440px); }
+
+ /* Screen-only states. */
+ .sg-state { padding: 48px 24px; text-align: center; color: var(--ink-muted, #9aa7bb); }
+ .sg-state h1 { margin: 0 0 8px; font-size: 22px; color: var(--ink, #eef2f8); letter-spacing: -.02em; }
+ .sg-state p { margin: 0 0 18px; max-width: 460px; margin-inline: auto; line-height: 1.5; }
+ .sg-skel { height: 420px; border-radius: 22px; background: linear-gradient(90deg, rgba(255,255,255,0.05), rgba(255,255,255,0.12), rgba(255,255,255,0.05)); background-size: 200% 100%; animation: sg-shimmer 1.4s ease-in-out infinite; }
+ @keyframes sg-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
+ @media (prefers-reduced-motion: reduce) { .sg-skel { animation: none; } }
+
+ @media (max-width: 640px) {
+ .sg-body { grid-template-columns: 1fr; justify-items: center; }
+ .sg-qr { width: min(72vw, 320px); }
+ }
+
+ @page { margin: 12mm; }
+ @media print {
+ html, body { background: #fff !important; color: #0b0e15 !important; }
+ .sg-wrap { max-width: none; padding: 0; }
+ .sg-bar, .sg-state { display: none !important; }
+ .sg-sheet { box-shadow: none; border-radius: 0; padding: 0; min-height: calc(100vh - 24mm); }
+ .sg-sheet.is-poster .sg-qr { width: 120mm; }
+ .sg-qr { width: 90mm; }
+ a { color: inherit; text-decoration: none; }
+ }
+ </style>
+</head>
+<body>
+ <main class="sg-wrap">
+ <div class="sg-bar" id="sg-bar" hidden>
+ <span class="sg-bar-title">Printable IRL sign</span>
+ <div class="sg-seg" role="group" aria-label="Sign layout">
+ <button type="button" data-layout="landscape" aria-pressed="true">Sign</button>
+ <button type="button" data-layout="poster" aria-pressed="false">Poster</button>
+ </div>
+ <a class="sg-btn" id="sg-open" href="/irl" target="_blank" rel="noopener">Open the visit link ↗</a>
+ <button type="button" class="sg-btn" id="sg-copy">Copy visit link</button>
+ <button type="button" class="sg-btn primary" id="sg-print">Print</button>
+ <span class="sg-bar-sub">Tape this where the agent stands. The link never carries a coordinate: the agent only appears to someone standing within 60 m of the spot.</span>
+ </div>
+
+ <div id="sg-loading" class="sg-skel" aria-hidden="true"></div>
+
+ <section id="sg-state" class="sg-state" hidden></section>
+
+ <section id="sg-sheet" class="sg-sheet" hidden aria-label="Printable sign">
+ <span class="sg-kicker"><span class="sg-kicker-dot" aria-hidden="true"></span>A 3D AI agent lives here</span>
+ <div class="sg-head">
+ <div class="sg-thumb" id="sg-thumb" aria-hidden="true">✦</div>
+ <div>
+ <h1 class="sg-name" id="sg-name">Agent</h1>
+ <p class="sg-tag">Scan to meet it in AR, on this exact spot.</p>
+ </div>
+ </div>
+ <div class="sg-body">
+ <ol class="sg-steps">
+ <li>Scan the code with your phone camera. No app, no account.</li>
+ <li>Allow camera and location, then look around. It appears within a few steps of here.</li>
+ <li>Tap it: profile, wallet, and services. iPhone: "See it in AR" stands it on the floor.</li>
+ </ol>
+ <div class="sg-qr" id="sg-qr" role="img" aria-label="QR code that opens this agent's visit link"></div>
+ </div>
+ <p class="sg-bio" id="sg-bio" hidden></p>
+ <div class="sg-foot">
+ <span class="sg-url" id="sg-url"></span>
+ <span class="sg-brand">three.ws / irl</span>
+ </div>
+ </section>
+ </main>
+ <script type="module" src="/src/irl-sign.js"></script>
+</body>
+</html>
diff --git a/pages/irl.html b/pages/irl.html
index 3099777bd..f93d6315b 100644
--- a/pages/irl.html
+++ b/pages/irl.html
@@ -1326,10 +1326,12 @@
}
.irl-sheet-actions {
display: flex;
+ flex-wrap: wrap;
gap: 10px;
}
.irl-sheet-btn {
- flex: 1;
+ flex: 1 1 calc(50% - 5px);
+ min-width: 120px;
padding: 12px 16px;
border-radius: 12px;
border: 1px solid rgba(255,255,255,0.12);
@@ -1344,6 +1346,125 @@
.irl-sheet-btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.22); }
.irl-sheet-btn-primary { background: rgba(52,211,153,0.18); border-color: rgba(52,211,153,0.4); color: #34d399; }
.irl-sheet-btn-primary:hover { background: rgba(52,211,153,0.28); }
+ /* Talk leads the actions: the conversation is the point of walking up. */
+ .irl-sheet-btn-talk {
+ background: rgba(139,92,246,0.20);
+ border-color: rgba(139,92,246,0.45);
+ color: var(--accent-violet, #c4b5fd);
+ }
+ .irl-sheet-btn-talk:hover { background: rgba(139,92,246,0.30); border-color: rgba(139,92,246,0.6); }
+ .irl-sheet-btn-talk.is-active { background: rgba(139,92,246,0.36); border-color: rgba(196,181,253,0.7); color: #ede9fe; }
+ .irl-sheet-btn:active { transform: translateY(1px); }
+
+ /* ── Talk panel (src/irl/pin-talk.js) ──────────────────────────────── */
+ .irl-talk {
+ margin-top: 14px;
+ padding: 12px;
+ border-radius: 14px;
+ border: 1px solid rgba(139,92,246,0.28);
+ background: linear-gradient(180deg, rgba(139,92,246,0.10), rgba(139,92,246,0.04));
+ animation: irl-talk-in .24s cubic-bezier(.22,.61,.36,1);
+ }
+ .irl-talk[hidden] { display: none; }
+ @keyframes irl-talk-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
+ .irl-talk-log {
+ max-height: 34vh;
+ min-height: 56px;
+ overflow-y: auto;
+ overscroll-behavior: contain;
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+ padding: 2px 2px 6px;
+ scrollbar-width: thin;
+ }
+ .irl-talk-empty {
+ margin: 6px 4px;
+ font-size: 13px;
+ color: #a5b4c8;
+ line-height: 1.45;
+ }
+ .irl-talk-msg {
+ max-width: 88%;
+ padding: 9px 12px;
+ border-radius: 14px;
+ font-size: 14px;
+ line-height: 1.45;
+ color: #e8edf6;
+ word-break: break-word;
+ animation: irl-talk-in .2s ease-out;
+ }
+ .irl-talk-msg.is-user {
+ align-self: flex-end;
+ background: rgba(139,92,246,0.28);
+ border: 1px solid rgba(139,92,246,0.4);
+ border-bottom-right-radius: 5px;
+ }
+ .irl-talk-msg.is-agent {
+ align-self: flex-start;
+ background: rgba(255,255,255,0.07);
+ border: 1px solid rgba(255,255,255,0.10);
+ border-bottom-left-radius: 5px;
+ }
+ .irl-talk-who {
+ display: block;
+ font-size: 11px;
+ font-weight: 700;
+ letter-spacing: .04em;
+ text-transform: uppercase;
+ color: #a78bfa;
+ margin-bottom: 2px;
+ }
+ .irl-talk-partial {
+ margin: 0 4px 6px;
+ font-size: 13px;
+ font-style: italic;
+ color: #c4b5fd;
+ min-height: 1em;
+ }
+ .irl-talk-partial[hidden] { display: none; }
+ .irl-talk-row { display: flex; gap: 8px; align-items: center; }
+ .irl-talk-form { display: flex; gap: 8px; flex: 1; min-width: 0; }
+ .irl-talk-hold {
+ position: relative;
+ flex-shrink: 0;
+ width: 52px; height: 52px;
+ border-radius: 50%;
+ border: 1px solid rgba(139,92,246,0.55);
+ background: rgba(139,92,246,0.22);
+ color: #ede9fe;
+ display: grid; place-items: center;
+ cursor: pointer;
+ touch-action: none;
+ -webkit-touch-callout: none;
+ -webkit-user-select: none; user-select: none;
+ transition: background .15s, border-color .15s, transform .12s;
+ }
+ .irl-talk-hold svg { width: 22px; height: 22px; position: relative; z-index: 1; }
+ .irl-talk-hold:hover { background: rgba(139,92,246,0.32); }
+ .irl-talk-hold:active, .irl-talk-hold.is-active { background: rgba(139,92,246,0.55); border-color: #c4b5fd; transform: scale(1.04); }
+ .irl-talk-hold.is-busy { opacity: .55; }
+ .irl-talk-hold[hidden] { display: none; }
+ /* Live mic level: the ring swells with the voice, driven by --irl-mic-level (0..1). */
+ .irl-talk-hold-ring {
+ position: absolute; inset: -4px;
+ border-radius: 50%;
+ border: 2px solid rgba(196,181,253,0.55);
+ opacity: 0;
+ transform: scale(calc(1 + var(--irl-mic-level, 0) * 0.55));
+ transition: opacity .15s;
+ }
+ .irl-talk-hold.is-active .irl-talk-hold-ring { opacity: 1; }
+ .irl-talk[data-state="speaking"] .irl-talk-hold { animation: irl-talk-speaking 1.2s ease-in-out infinite; }
+ @keyframes irl-talk-speaking { 0%,100% { box-shadow: 0 0 0 0 rgba(139,92,246,0); } 50% { box-shadow: 0 0 0 8px rgba(139,92,246,0.18); } }
+ .irl-talk-state { margin-top: 8px; font-size: 12.5px; color: #a78bfa; min-height: 1em; }
+ .irl-talk-state.is-error { color: #f87171; }
+ .irl-talk-state[hidden] { display: none; }
+ @media (prefers-reduced-motion: reduce) {
+ .irl-talk, .irl-talk-msg { animation: none; }
+ .irl-talk[data-state="speaking"] .irl-talk-hold { animation: none; box-shadow: 0 0 0 4px rgba(139,92,246,0.18); }
+ .irl-talk-hold-ring { transition: none; transform: none; }
+ }
.irl-sheet-close {
width: 32px;
height: 32px;
@@ -1554,6 +1675,12 @@
.irl-pin-place.is-approx { color: #93c5fd; background: rgba(96,165,250,0.13); border-color: rgba(96,165,250,0.3); }
.irl-pin-caption { font-size: 12.5px; color: #9ca3af; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.irl-pin-meta { font-size: 11.5px; color: #9ca3af; margin-top: 3px; }
+ /* "Sign" — opens /irl/sign preselected on this pin. A placed agent is
+ undiscoverable until something in the physical world points at it, so the
+ printable sign sits right next to the pin it belongs to. */
+ .irl-pin-sign { flex-shrink: 0; padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(126,200,227,0.28); background: rgba(126,200,227,0.10); color: #7ec8e3; font: 600 12px inherit; text-decoration: none; cursor: pointer; transition: background 0.15s, border-color 0.15s; white-space: nowrap; }
+ .irl-pin-sign:hover { background: rgba(126,200,227,0.20); border-color: rgba(126,200,227,0.5); }
+ .irl-pin-sign:focus-visible { outline: 2px solid #7ec8e3; outline-offset: 2px; }
.irl-pin-del { flex-shrink: 0; padding: 6px 8px; border-radius: 8px; border: 1px solid rgba(248,113,113,0.2); background: rgba(248,113,113,0.08); color: #f87171; font: 600 12px inherit; cursor: pointer; transition: background 0.15s; white-space: nowrap; }
.irl-pin-del:hover { background: rgba(248,113,113,0.18); }
.irl-pin-del:focus-visible { outline: 2px solid var(--danger); outline-offset: 2px; }
@@ -2198,6 +2325,7 @@
on the dark sheets clears non-text contrast comfortably. */
.irl-sheet-close:focus-visible,
.irl-sheet-btn:focus-visible,
+ .irl-talk-hold:focus-visible,
.irl-msg-send:focus-visible,
.irl-agent-row:focus-visible,
#irl-caption-confirm:focus-visible,
@@ -2594,12 +2722,34 @@
<!-- Placement exposure badge (H4) — owner-only: exact spot vs deliberately blurred -->
<p id="irl-sheet-placement" class="irl-sheet-placement" hidden></p>
<div class="irl-sheet-actions">
+ <button id="irl-sheet-talk" class="irl-sheet-btn irl-sheet-btn-talk" type="button" aria-expanded="false" aria-controls="irl-talk" data-i18n="irl.talk">Talk</button>
+ <button id="irl-sheet-ar" class="irl-sheet-btn" type="button" aria-label="View this agent in AR" data-i18n="irl.view_in_ar">View in AR</button>
<button id="irl-sheet-pay" class="irl-sheet-btn irl-sheet-btn-primary" type="button" hidden data-i18n="irl.pay_via_x402">Pay via x402</button>
<button id="irl-sheet-calibrate" class="irl-sheet-btn" type="button" hidden data-i18n="irl.calibrate_position">Calibrate position</button>
<button id="irl-sheet-align-room" class="irl-sheet-btn" type="button" hidden data-i18n="irl.align_this_room">Align this room</button>
<button id="irl-sheet-refine" class="irl-sheet-btn" type="button" hidden data-i18n="irl.refine_on_floor">Refine on floor</button>
<button id="irl-sheet-view" class="irl-sheet-btn" type="button" data-i18n="irl.view_profile">View profile</button>
</div>
+ <!-- Talk: a live spoken conversation with the agent standing in front of you.
+ Hold the mic or type; the reply is voiced and the 3D model's mouth follows
+ the audio. Wired by src/irl/pin-talk.js on top of the same TalkController
+ that powers talk mode on /avatars/:id. Hidden until the Talk action opens it. -->
+ <section id="irl-talk" class="irl-talk" hidden aria-label="Talk to this agent" data-state="idle">
+ <div id="irl-talk-log" class="irl-talk-log" role="log" aria-live="polite" aria-relevant="additions"></div>
+ <div id="irl-talk-partial" class="irl-talk-partial" aria-hidden="true" hidden></div>
+ <div class="irl-talk-row">
+ <button id="irl-talk-hold" class="irl-talk-hold" type="button" aria-label="Hold to talk" title="Hold to talk">
+ <span class="irl-talk-hold-ring" aria-hidden="true"></span>
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="9" y="3" width="6" height="11" rx="3"/><path d="M5 11a7 7 0 0 0 14 0"/><path d="M12 18v3"/></svg>
+ </button>
+ <form id="irl-talk-form" class="irl-talk-form" autocomplete="off">
+ <input id="irl-talk-input" class="irl-msg-input" type="text" maxlength="500" enterkeyhint="send"
+ placeholder="Say something…" aria-label="Say something to this agent" autocomplete="off" />
+ <button id="irl-talk-send" class="irl-msg-send" type="submit" data-i18n="irl.send_2">Send</button>
+ </form>
+ </div>
+ <div id="irl-talk-state" class="irl-talk-state" role="status" hidden></div>
+ </section>
<!-- Leave a message — POSTs an interaction the owner sees in their dashboard feed -->
<form id="irl-sheet-msg" class="irl-sheet-msg">
<input id="irl-msg-input" class="irl-msg-input" type="text" maxlength="280"
diff --git a/public/changelog.json b/public/changelog.json
index 360e6ab0f..7e0e29551 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-09-05T15:06:35.041Z",
+ "generated_at": "2026-09-05T16:12:13.200Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -56,6 +56,16 @@
"launch"
]
},
+ {
+ "date": "2026-09-05",
+ "type": "launch",
+ "title": "Printable IRL sign",
+ "summary": "Print a sign for a placed IRL agent: its name, thumbnail and a QR of the visit link. Scan it at the spot to open IRL, walk up, and meet the 3D AI agent in AR. Carries no coordinate.",
+ "link": "/irl/sign",
+ "tags": [
+ "launch"
+ ]
+ },
{
"date": "2026-09-05",
"type": "update",
@@ -89,6 +99,17 @@
"sdk"
]
},
+ {
+ "date": "2026-09-05",
+ "type": "update",
+ "title": "Invite people to an IRL agent with a visit link and a printable sign",
+ "summary": "Every agent you have placed in the real world now has a visit link and a sign you can print and tape to the spot. Someone who scans it opens IRL with a banner naming the agent they came to meet, and the moment they are close enough the agent appears in their camera, flashes, and opens its card by itself: bio, reputation, wallet, tip QR, services, and a message box. That card also gained See it in AR. On iPhone it stands the agent on the real floor in Quick Look, animated, and the banner inside AR brings you straight back to the tip panel; other phones open the AR launcher. The link never contains a location, so you can post it anywhere and the agent still only shows to people who are actually there. Find it under Visit link on each placement in your dashboard.",
+ "link": "/irl",
+ "tags": [
+ "feature",
+ "improvement"
+ ]
+ },
{
"date": "2026-09-05",
"type": "update",
@@ -110,6 +131,28 @@
"sdk"
]
},
+ {
+ "date": "2026-09-05",
+ "type": "update",
+ "title": "Seven background jobs that were never running now run",
+ "summary": "Seven scheduled jobs were declared in the platform config but had no matching job on the scheduler, so they had never fired: the companion poll, feedback triage, print-order syncing, the home health alert, the home-relay sweep, web-variant generation for the forge, and the oracle refit. Three of them shipped with live features behind them, which meant those features quietly did nothing on a timer. All seven are now created and enabled on their declared schedules, and a drift check confirms every declared job exists and matches.",
+ "link": null,
+ "tags": [
+ "fix",
+ "infra"
+ ]
+ },
+ {
+ "date": "2026-09-05",
+ "type": "update",
+ "title": "The site header now stays put when you scroll",
+ "summary": "The navigation bar was set to stick to the top of the window but never actually did: it scrolled away with the page on every route, at every screen size, so reaching the menu meant scrolling all the way back up. The bar was mounted inside a wrapper exactly its own height, and a sticky element can only travel inside its parent, so it had nowhere to go. The header now stays on screen wherever you scroll, on phones and desktop alike.",
+ "link": null,
+ "tags": [
+ "fix",
+ "improvement"
+ ]
+ },
{
"date": "2026-09-05",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index 2b91a8e6b..cb3d28863 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -46,6 +46,14 @@
<category>launch</category>
<description>A handheld console with a live 3D agent inside the screen. Steer it with the D-pad, swap cartridges for any public agent, and embed the whole console anywhere with one line of HTML.</description>
</item>
+ <item>
+ <title>Printable IRL sign</title>
+ <link>https://three.ws/irl/sign</link>
+ <guid isPermaLink="false">2026-09-05:Printable IRL sign</guid>
+ <pubDate>Sat, 05 Sep 2026 12:00:00 GMT</pubDate>
+ <category>launch</category>
+ <description>Print a sign for a placed IRL agent: its name, thumbnail and a QR of the visit link. Scan it at the spot to open IRL, walk up, and meet the 3D AI agent in AR. Carries no coordinate.</description>
+ </item>
<item>
<title>3D models now open, animate and report on themselves inside VS Code</title>
<link>https://three.ws/docs/vscode</link>
@@ -70,6 +78,14 @@
<category>feature</category>
<description>Every ready-made asset the platform publishes is now one search away from any AI coding client connected to the three.ws MCP server: 511 CC0 props, 107 rigged characters and 2,874 motion clips, all in a single searchable catalog instead of three separate browse pages. Ask for a wooden chair or an industrial lamp and you get matching items ranked best first, with tags, license, and the CDN link. Ask for the source and you get code that runs as it is: the model-viewer tag our own gallery renders with, the agent-3d web component pinned to the exact published version and its integrity hash, plain three.js, or a React component. Motion clips come back as three.js code that loads and plays them. All three tools are free and need no account, no API key and no payment, because you should be able to find out what is already here before you sign up for anything. A search that matches only part of what you typed says so instead of returning nothing.</description>
</item>
+ <item>
+ <title>Invite people to an IRL agent with a visit link and a printable sign</title>
+ <link>https://three.ws/irl</link>
+ <guid isPermaLink="false">2026-09-05:Invite people to an IRL agent with a visit link and a printable sign</guid>
+ <pubDate>Sat, 05 Sep 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>Every agent you have placed in the real world now has a visit link and a sign you can print and tape to the spot. Someone who scans it opens IRL with a banner naming the agent they came to meet, and the moment they are close enough the agent appears in their camera, flashes, and opens its card by itself: bio, reputation, wallet, tip QR, services, and a message box. That card also gained See it in AR. On iPhone it stands the agent on the real floor in Quick Look, animated, and the banner inside AR brings you straight back to the tip panel; other phones open the AR launcher. The link never contains a location, so you can post it anywhere and the agent still only shows to people who are actually there. Find it under Visit link on each placement in your dashboard.</description>
+ </item>
<item>
<title>Machine Atlas: two working machines built in the browser from code, with no 3D model files</title>
<link>https://three.ws/assembly</link>
@@ -86,6 +102,22 @@
<category>feature</category>
<description>npx @three-ws/assets search wooden chair finds it, and npx @three-ws/assets add object:painted_wooden_chair_01 downloads the model into your public folder and prints the tag that renders it, already pointing at your local copy rather than our CDN. Your site keeps working even if we do not. The catalog behind it is the same one the AI tools read: 511 CC0 props, 107 rigged characters and 2,874 motion clips, searchable in one place instead of three separate galleries. It is also a plain HTTP endpoint now, GET /api/catalog, free and open to any origin, so a build script or a site that is not using an AI client can read it too. Adding an asset twice changes nothing the second time, and a file you edited afterwards is never overwritten without asking. Every object is CC0, and the license of anything that is not travels with it in the output.</description>
</item>
+ <item>
+ <title>Seven background jobs that were never running now run</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-09-05:Seven background jobs that were never running now run</guid>
+ <pubDate>Sat, 05 Sep 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>Seven scheduled jobs were declared in the platform config but had no matching job on the scheduler, so they had never fired: the companion poll, feedback triage, print-order syncing, the home health alert, the home-relay sweep, web-variant generation for the forge, and the oracle refit. Three of them shipped with live features behind them, which meant those features quietly did nothing on a timer. All seven are now created and enabled on their declared schedules, and a drift check confirms every declared job exists and matches.</description>
+ </item>
+ <item>
+ <title>The site header now stays put when you scroll</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-09-05:The site header now stays put when you scroll</guid>
+ <pubDate>Sat, 05 Sep 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>The navigation bar was set to stick to the top of the window but never actually did: it scrolled away with the page on every route, at every screen size, so reaching the menu meant scrolling all the way back up. The bar was mounted inside a wrapper exactly its own height, and a sticky element can only travel inside its parent, so it had nowhere to go. The header now stays on screen wherever you scroll, on phones and desktop alike.</description>
+ </item>
<item>
<title>Your agent now lives in a handheld console you can put on any website</title>
<link>https://three.ws/pocket</link>
diff --git a/public/features.json b/public/features.json
index 62ee80ef9..a68046deb 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-09-05T15:06:35.031Z",
+ "generated_at": "2026-09-05T16:12:13.190Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
@@ -236,6 +236,16 @@
"tags": [],
"showcase": false
},
+ {
+ "path": "/irl/sign",
+ "title": "Printable IRL sign",
+ "description": "Print a sign for a placed IRL agent: its name, thumbnail and a QR of the visit link. Scan it at the spot to open IRL, walk up, and meet the 3D AI agent in AR. Carries no coordinate.",
+ "added": "2026-09-05",
+ "auth": null,
+ "indexable": true,
+ "tags": [],
+ "showcase": false
+ },
{
"path": "/irl-privacy",
"title": "How location works on IRL",
diff --git a/public/llms-full.txt b/public/llms-full.txt
index e29161511..cfca338be 100644
--- a/public/llms-full.txt
+++ b/public/llms-full.txt
@@ -146,6 +146,12 @@ URL: https://three.ws/irl
Place a 3D avatar in your real environment. Camera AR passthrough, joystick movement, and tap-to-place 3D objects on your floor.
+### Printable IRL sign
+
+URL: https://three.ws/irl/sign
+
+Print a sign for a placed IRL agent: its name, thumbnail and a QR of the visit link. Scan it at the spot to open IRL, walk up, and meet the 3D AI agent in AR. Carries no coordinate.
+
### How location works on IRL
URL: https://three.ws/irl-privacy
diff --git a/public/llms.txt b/public/llms.txt
index 0b5ddc296..2e498082e 100644
--- a/public/llms.txt
+++ b/public/llms.txt
@@ -53,6 +53,7 @@ Entry points into the product.
- [Talking Avatar Video](https://three.ws/create/video): Turn a three.ws avatar into a talking-head video: upload your audio and export a lip-synced clip.
- [Drive Your Avatar](https://three.ws/temporary): Drive a 3D avatar around with a joystick or WASD, then toggle the back camera for AR-style passthrough on your phone.
- [IRL](https://three.ws/irl): Place a 3D avatar in your real environment. Camera AR passthrough, joystick movement, and tap-to-place 3D objects on your floor.
+- [Printable IRL sign](https://three.ws/irl/sign): Print a sign for a placed IRL agent: its name, thumbnail and a QR of the visit link. Scan it at the spot to open IRL, walk up, and meet the 3D AI agent in AR. Carries no coordinate.
- [How location works on IRL](https://three.ws/irl-privacy): Placed agents are private by location: they appear only to people physically standing near them, never on a map or a list. What's shared, what isn't, and how your camera, motion, and location are used.
- [Alpha Co-pilot: your agent narrates its own alpha](https://three.ws/alpha-copilot): Your 3D agent reads a real pump.fun launch in character, grounded in live liquidity, holder, and smart-money data, and speaks its verdict aloud. Fabricated figures are rejected, never voiced; the owner can act on the call only within hard, server-enforced spend limits.
- [World Lines: agent proof-of-presence quests](https://three.ws/world-lines): Walk to an AI agent's real-world spot, complete its AR challenge, and earn a cryptographically real, agent-signed proof of presence. Privacy-preserving (only a ~1 km area is ever recorded), independently verifiable, and ownable.
diff --git a/public/sitemap/index.html b/public/sitemap/index.html
index 35ffed872..b718e06f6 100644
--- a/public/sitemap/index.html
+++ b/public/sitemap/index.html
@@ -88,7 +88,7 @@
<main class="sm-wrap">
<div class="sm-hero">
<h1>Sitemap</h1>
- <p>All 912 pages on three.ws, grouped by purpose. Looking for the machine-readable versions?</p>
+ <p>All 913 pages on three.ws, grouped by purpose. Looking for the machine-readable versions?</p>
<div class="sm-formats">
<a href="/sitemap.xml"><code>sitemap.xml</code> · for search engines</a>
<a href="/llms.txt"><code>llms.txt</code> · for AI agents</a>
@@ -100,7 +100,7 @@
</div>
<div class="sm-filter">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m21 21-4.3-4.3"/></svg>
- <input id="sm-filter-input" type="search" placeholder="Filter 912 pages by name, path, or description…" aria-label="Filter pages" autocomplete="off" spellcheck="false" />
+ <input id="sm-filter-input" type="search" placeholder="Filter 913 pages by name, path, or description…" aria-label="Filter pages" autocomplete="off" spellcheck="false" />
<kbd aria-hidden="true">/</kbd>
</div>
<p class="sm-filter-count" id="sm-filter-count" role="status" aria-live="polite"></p>
@@ -108,6 +108,14 @@
<h2 id="sm-new-title">Newest<a class="sm-new-more" href="/changelog">full changelog &rarr;</a></h2>
<p class="sm-section-desc">The 9 most recently launched pages, straight to the live surface.</p>
<ul class="sm-list">
+ <li>
+ <a href="/irl/sign">
+ <span class="sm-new-date">Sep 5, 2026</span>
+ <span class="sm-title">Printable IRL sign</span>
+ <span class="sm-path">/irl/sign</span>
+ <span class="sm-desc">Print a sign for a placed IRL agent: its name, thumbnail and a QR of the visit link. Scan it at the spot to open IRL, walk up, and meet the 3D AI agent in AR. Carries no coordinate.</span>
+ </a>
+ </li>
<li>
<a href="/assembly">
<span class="sm-new-date">Sep 5, 2026</span>
@@ -172,14 +180,6 @@
<span class="sm-desc">Talk to your house without finding a phone: a wake word matched on your own device, real barge-in mid-sentence, and a spoken confirmation that a background yes can never satisfy.</span>
</a>
</li>
- <li>
- <a href="/smart-home/join">
- <span class="sm-new-date">Sep 3, 2026</span>
- <span class="sm-title">Join a home</span>
- <span class="sm-path">/smart-home/join</span>
- <span class="sm-desc">Accept an invitation to somebody's connected home. The link says which home it is, exactly what your role would let you do there and what it would never let you do, before you sign in. It works once and it expires.</span>
- </a>
- </li>
</ul>
</section>
<nav class="sm-toc" aria-label="Sections">
@@ -197,7 +197,7 @@
</nav>
<section class="sm-section" id="main">
<header>
- <h2>Main<span class="sm-count" data-count>57</span></h2>
+ <h2>Main<span class="sm-count" data-count>58</span></h2>
<p class="sm-section-desc">Entry points into the product.</p>
</header>
<ul class="sm-list">
@@ -355,6 +355,13 @@
<span class="sm-desc">Place a 3D avatar in your real environment. Camera AR passthrough, joystick movement, and tap-to-place 3D objects on your floor.</span>
</a>
</li>
+ <li>
+ <a href="/irl/sign">
+ <span class="sm-title">Printable IRL sign</span>
+ <span class="sm-path">/irl/sign</span>
+ <span class="sm-desc">Print a sign for a placed IRL agent: its name, thumbnail and a QR of the visit link. Scan it at the spot to open IRL, walk up, and meet the 3D AI agent in AR. Carries no coordinate.</span>
+ </a>
+ </li>
<li>
<a href="/irl-privacy">
<span class="sm-title">How location works on IRL</span>
diff --git a/src/dashboard-next/pages/irl-placements.js b/src/dashboard-next/pages/irl-placements.js
index dc143c626..87843fda3 100644
--- a/src/dashboard-next/pages/irl-placements.js
+++ b/src/dashboard-next/pages/irl-placements.js
@@ -29,6 +29,8 @@ import { loadInto } from '../../shared/async-state.js';
import { loadLeaflet, reverseGeocode } from '../../shared/leaflet-loader.js';
import { mountReputationPanel } from './irl-reputation.js';
import { openMyDataPanel } from '../../irl/privacy-center.js';
+import { renderQRToSVG } from '../../erc8004/qr.js';
+import { buildVisitUrl, buildSignUrl } from '../../irl/visit-link.js';
// ── Services / x402 skill pricing ───────────────────────────────────────────
// Canonical prices live in agent_skill_prices and feed the x402 manifest +
@@ -130,7 +132,7 @@ function placeFor(lat, lng) {
return reverseGeocode(lat, lng);
}
-const INTERACTION_ICON = { view: '👁', tap: '👆', message: '💬', pay: '💸' };
+const INTERACTION_ICON = { view: '👁', tap: '👆', message: '💬', pay: '💸', talk: '🗣' };
// Mints we can name in a pay row. $THREE + Solana USDC come from CURRENCIES;
// Base USDC (an EVM 0x mint) is matched case-insensitively. Anything else renders
@@ -172,6 +174,7 @@ function ixHeadline(ix) {
return amt ? `Someone paid ${esc(amt)}` : 'Someone paid your agent';
}
if (ix.type === 'tap') return 'Tapped your agent';
+ if (ix.type === 'talk') return 'Talked with your agent in person';
if (ix.type === 'message') return isOwnerReply(ix) ? 'You replied' : 'Someone left a message';
return 'Someone viewed your agent';
}
@@ -273,6 +276,17 @@ const STYLE = `
.irl-modal-x:hover, .irl-modal-x:focus-visible { color: var(--nxt-ink); }
.irl-modal-x:focus-visible { outline: 2px solid var(--nxt-accent); outline-offset: 2px; }
.irl-modal-body { padding: 6px 18px 18px; overflow-y: auto; }
+/* Visit link modal: QR + link + what a visitor sees */
+.irl-visit-grid { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 18px; align-items: start; padding-top: 12px; }
+.irl-visit-qr { width: 168px; aspect-ratio: 1; border-radius: 12px; background: #fff; padding: 8px; border: 1px solid var(--nxt-stroke); }
+.irl-visit-qr svg { width: 100%; height: 100%; display: block; }
+.irl-visit-url { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; }
+.irl-visit-url input { flex: 1 1 auto; min-width: 0; font: 12.5px/1.2 var(--font-mono, ui-monospace, monospace); padding: 8px 10px; border-radius: 8px; border: 1px solid var(--nxt-stroke); background: var(--nxt-bg-0, transparent); color: var(--nxt-ink); }
+.irl-visit-steps { margin: 0 0 14px; padding-left: 18px; color: var(--nxt-ink-dim); font-size: 13px; line-height: 1.5; }
+.irl-visit-steps li + li { margin-top: 4px; }
+.irl-visit-actions { display: flex; flex-wrap: wrap; gap: 8px; }
+.irl-visit-note { margin: 12px 0 0; font-size: 12px; color: var(--nxt-ink-faint); line-height: 1.5; }
+@media (max-width: 520px) { .irl-visit-grid { grid-template-columns: 1fr; justify-items: center; } }
.irl-svc-sec { padding-top: 14px; }
.irl-svc-sec-h { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--nxt-ink-faint); margin-bottom: 10px; }
.irl-svc-count { color: var(--nxt-ink-dim); }
@@ -560,7 +574,9 @@ function cardHtml(pin, ixList) {
<div class="irl-actions">
<button class="irl-action" data-outfit="${esc(pin.id)}">Change outfit</button>
<button class="irl-action" data-loc-toggle>Move on map</button>
- <a class="irl-action" href="/irl?highlight=${esc(pin.id)}" target="_blank" rel="noopener">View in IRL ↗</a>
+ <button class="irl-action" data-visit="${esc(pin.id)}" type="button">Visit link</button>
+ <a class="irl-action" href="/irl?pin=${esc(pin.id)}" target="_blank" rel="noopener">View in IRL ↗</a>
+ <a class="irl-action" href="/irl/sign?pin=${esc(pin.id)}" target="_blank" rel="noopener">Print a sign ↗</a>
<button class="irl-action remove" data-remove="${esc(pin.id)}">Remove</button>
</div>
</div>
@@ -840,6 +856,7 @@ const IX_TOAST = {
pay: '💸 Someone just paid your agent',
message: '💬 New message from a visitor',
tap: '👆 Someone tapped your agent',
+ talk: '🗣 Someone is talking with your agent',
view: '👁 Someone is viewing your agent',
};
function flashInteraction(ix) {
@@ -850,7 +867,7 @@ function flashInteraction(ix) {
card.classList.add('irl-flash');
card.addEventListener('animationend', () => card.classList.remove('irl-flash'), { once: true });
}
- if (ix.type === 'pay' || ix.type === 'message') {
+ if (ix.type === 'pay' || ix.type === 'message' || ix.type === 'talk') {
const who = ix.avatar_name ? ` · ${ix.avatar_name}` : '';
irlToast((IX_TOAST[ix.type] || 'New IRL interaction') + who);
}
@@ -1059,6 +1076,13 @@ function wireCardEvents(list, pins) {
return;
}
+ // Visit link: the scannable handoff for a street demo: QR + copy + print sign.
+ if (e.target.closest('[data-visit]')) {
+ const pin = pins.find((p) => p.id === id);
+ if (pin) openVisitLinkModal(pin);
+ return;
+ }
+
// Remove
const removeBtn = e.target.closest('[data-remove]');
if (removeBtn) {
@@ -1126,6 +1150,74 @@ function wireCardEvents(list, pins) {
});
}
+// ── Visit link modal ───────────────────────────────────────────────────────
+// The scannable handoff for a real-world demo: a passer-by scans the QR, lands on
+// /irl?pin=<id>, and the page names this agent until it appears in range. Neither
+// link carries a coordinate; the agent still shows only through the presence-
+// gated nearby read, so the link is safe to print and post anywhere.
+function openVisitLinkModal(pin) {
+ const name = pin.avatar_name || 'Placed agent';
+ const visitUrl = buildVisitUrl(pin.id, location.origin);
+ const signUrl = buildSignUrl(pin.id, location.origin);
+ const root = makeNode(`<div class="irl-modal-root">
+ <div class="irl-modal-back"></div>
+ <div class="irl-modal" role="dialog" aria-modal="true" aria-label="Visit link for ${esc(name)}">
+ <div class="irl-modal-head">
+ <div class="irl-modal-titles">
+ <div class="irl-modal-title">Visit link</div>
+ <div class="irl-modal-sub">${esc(name)} · scan to meet it at the spot</div>
+ </div>
+ <button class="irl-modal-x" data-close type="button" aria-label="Close">×</button>
+ </div>
+ <div class="irl-modal-body">
+ <div class="irl-visit-grid">
+ <div class="irl-visit-qr" role="img" aria-label="QR code for the visit link" data-qr></div>
+ <div>
+ <div class="irl-visit-url">
+ <input type="text" readonly value="${esc(visitUrl)}" aria-label="Visit link" data-url />
+ <button class="irl-action" data-copy type="button">Copy</button>
+ </div>
+ <ol class="irl-visit-steps">
+ <li>A visitor scans it and allows camera and location.</li>
+ <li>Within 60 m of the spot, <b>${esc(name)}</b> appears in their camera and its card opens.</li>
+ <li>They tap it for the profile, wallet, tip QR and services; iPhone gets "See it in AR".</li>
+ </ol>
+ <div class="irl-visit-actions">
+ <a class="irl-btn primary" href="${esc(signUrl)}" target="_blank" rel="noopener">Print a sign ↗</a>
+ <a class="irl-action" href="${esc(visitUrl)}" target="_blank" rel="noopener">Open on this device ↗</a>
+ </div>
+ <p class="irl-visit-note">No coordinate in the link. Anyone who is not standing there sees only the agent's name and a prompt to walk up.</p>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>`);
+ root.querySelector('[data-qr]').innerHTML = renderQRToSVG(visitUrl, { scale: 4, margin: 1 });
+ document.body.appendChild(root);
+ document.body.style.overflow = 'hidden';
+ const close = () => {
+ root.remove();
+ document.body.style.overflow = '';
+ document.removeEventListener('keydown', onKey, true);
+ };
+ const onKey = (ev) => { if (ev.key === 'Escape') close(); };
+ document.addEventListener('keydown', onKey, true);
+ root.querySelector('[data-close]').addEventListener('click', close);
+ root.querySelector('.irl-modal-back').addEventListener('click', close);
+ const copyBtn = root.querySelector('[data-copy]');
+ copyBtn.addEventListener('click', async () => {
+ try {
+ await navigator.clipboard.writeText(visitUrl);
+ copyBtn.textContent = 'Copied';
+ } catch {
+ root.querySelector('[data-url]').select();
+ copyBtn.textContent = 'Select + copy';
+ }
+ setTimeout(() => { copyBtn.textContent = 'Copy'; }, 1800);
+ });
+ setTimeout(() => copyBtn.focus(), 0);
+}
+
function makeNode(html) {
const t = document.createElement('template');
t.innerHTML = html.trim();
diff --git a/src/dashboard-next/pages/irl-reputation.js b/src/dashboard-next/pages/irl-reputation.js
index 4a9b1f51b..c5d934c6d 100644
--- a/src/dashboard-next/pages/irl-reputation.js
+++ b/src/dashboard-next/pages/irl-reputation.js
@@ -59,7 +59,7 @@ export function mountReputationPanel(card, { reputation, agentId, pinId } = {})
const asset = reputation?.asset || null;
const network = reputation?.network || 'mainnet';
const passport = `/agents/${encodeURIComponent(agentId)}`;
- const irlHref = pinId ? `/irl?highlight=${encodeURIComponent(pinId)}` : '/irl';
+ const irlHref = pinId ? `/irl?pin=${encodeURIComponent(pinId)}` : '/irl';
// Collapsible section, inserted right after the stat chips.
const section = document.createElement('div');
diff --git a/src/irl-sign.js b/src/irl-sign.js
new file mode 100644
index 000000000..e0e0e29ec
--- /dev/null
+++ b/src/irl-sign.js
@@ -0,0 +1,125 @@
+/**
+ * /irl/sign?pin=<id>: the printable sign for a placed IRL agent.
+ *
+ * Tape it where the agent stands. It carries the agent's name, thumbnail and bio
+ * from the public agent card, plus a QR of the visit link (/irl?pin=<id>). The
+ * page is deliberately coordinate-free: the pin id resolves only to who lives
+ * here, and the agent itself still appears only through the presence-gated
+ * nearby read once the visitor is physically within range.
+ */
+
+import { renderQRToSVG } from './erc8004/qr.js';
+import { normalizePinId, buildVisitUrl } from './irl/visit-link.js';
+
+const $ = (id) => document.getElementById(id);
+
+const bar = $('sg-bar');
+const loading = $('sg-loading');
+const stateEl = $('sg-state');
+const sheet = $('sg-sheet');
+const LAYOUT_KEY = 'irl-sign-layout';
+
+function showState({ title, body, action }) {
+ loading.hidden = true;
+ sheet.hidden = true;
+ stateEl.hidden = false;
+ stateEl.innerHTML = `<h1></h1><p></p>`;
+ stateEl.querySelector('h1').textContent = title;
+ stateEl.querySelector('p').textContent = body;
+ if (action) {
+ const a = document.createElement('a');
+ a.className = 'sg-btn primary';
+ a.href = action.href;
+ a.textContent = action.label;
+ stateEl.appendChild(a);
+ }
+}
+
+function applyLayout(layout) {
+ const poster = layout === 'poster';
+ sheet.classList.toggle('is-poster', poster);
+ for (const b of bar.querySelectorAll('[data-layout]')) {
+ b.setAttribute('aria-pressed', b.dataset.layout === layout ? 'true' : 'false');
+ }
+ try { localStorage.setItem(LAYOUT_KEY, layout); } catch { /* private mode: layout just doesn't persist */ }
+}
+
+async function main() {
+ const pinId = normalizePinId(new URLSearchParams(location.search).get('pin'));
+ if (!pinId) {
+ showState({
+ title: 'Which agent is this sign for?',
+ body: 'Open a placement from your dashboard and choose "Visit link" to print its sign.',
+ action: { href: '/dashboard/irl-placements', label: 'Open my placements' },
+ });
+ return;
+ }
+
+ const visitUrl = buildVisitUrl(pinId, location.origin);
+
+ let card;
+ try {
+ const r = await fetch(`/api/irl/agent-card?pin=${encodeURIComponent(pinId)}`);
+ if (r.status === 404) {
+ showState({
+ title: 'This placement is no longer active',
+ body: 'The pin expired or was removed, so a sign for it would point at an empty spot. Place the agent again and print a fresh sign.',
+ action: { href: '/irl', label: 'Open IRL' },
+ });
+ return;
+ }
+ if (!r.ok) throw new Error(`HTTP ${r.status}`);
+ ({ card } = await r.json());
+ if (!card?.agent) throw new Error('empty card');
+ } catch {
+ showState({
+ title: "Couldn't load this agent",
+ body: 'Check your connection and reload. The visit link itself still works.',
+ action: { href: visitUrl, label: 'Open the visit link' },
+ });
+ return;
+ }
+
+ const agent = card.agent;
+ $('sg-name').textContent = agent.name || 'Agent';
+ const bio = (agent.bio || '').trim();
+ if (bio) { $('sg-bio').textContent = bio; $('sg-bio').hidden = false; }
+ if (agent.thumbnail_url) {
+ const img = document.createElement('img');
+ img.alt = '';
+ img.src = agent.thumbnail_url;
+ img.addEventListener('error', () => { img.remove(); $('sg-thumb').textContent = '✦'; });
+ $('sg-thumb').textContent = '';
+ $('sg-thumb').appendChild(img);
+ }
+ $('sg-qr').innerHTML = renderQRToSVG(visitUrl, { scale: 6, margin: 1 });
+ $('sg-url').textContent = visitUrl.replace(/^https?:\/\//, '');
+ $('sg-open').href = visitUrl;
+ document.title = `${agent.name || 'Agent'} | IRL sign | three.ws`;
+
+ $('sg-copy').addEventListener('click', async () => {
+ const btn = $('sg-copy');
+ try {
+ await navigator.clipboard.writeText(visitUrl);
+ btn.textContent = 'Copied';
+ } catch {
+ btn.textContent = 'Copy failed';
+ }
+ setTimeout(() => { btn.textContent = 'Copy visit link'; }, 1800);
+ });
+ $('sg-print').addEventListener('click', () => window.print());
+ bar.addEventListener('click', (e) => {
+ const b = e.target.closest('[data-layout]');
+ if (b) applyLayout(b.dataset.layout);
+ });
+ let saved = 'landscape';
+ try { saved = localStorage.getItem(LAYOUT_KEY) === 'poster' ? 'poster' : 'landscape'; } catch { /* default */ }
+ applyLayout(saved);
+
+ loading.hidden = true;
+ stateEl.hidden = true;
+ bar.hidden = false;
+ sheet.hidden = false;
+}
+
+main();
diff --git a/src/irl.js b/src/irl.js
index fa5a29021..57066a288 100644
--- a/src/irl.js
+++ b/src/irl.js
@@ -75,6 +75,8 @@ import { deriveVerticalFovDeg, DEFAULT_DIAG_FOV_DEG } from './irl/camera-fov.js'
import { pinBandAction } from './irl/proximity-band.js';
import { gpsAccuracyBucket, easeGpsTransition, GPS_TRANSITION_MS } from './irl/gps-lifecycle.js';
import { pickLabelHit } from './irl/tap-pick.js';
+import { initPinTalk } from './irl/pin-talk.js';
+import { arLaneFor, arButtonCopy, arLaunchUrl, quickLookBannerFor, pinDisplayName } from './irl/pin-ar.js';
import {
shouldCueArrival,
relativeBearing,
@@ -89,6 +91,8 @@ import { GlassesBridge } from './irl/glasses/bridge.js';
import { openGlassesConnect } from './irl/glasses/connect-ui.js';
import { loadLeaflet } from './shared/leaflet-loader.js';
import { initDiscovery } from './irl/discovery.js';
+import { parseVisitTarget } from './irl/visit-link.js';
+import { mountVisitBanner } from './irl/visit-banner.js';
import { initIrlDrops } from './shared/irl-drops.js';
import { walletChipEl, hasWallet } from './shared/agent-wallet-chip.js';
import { buildSolanaPayUri } from './shared/solana-pay.js';
@@ -133,7 +137,12 @@ const POP_AMOUNT = 0.04; // peak +Y scale during the pop (1.0 → 1.04
// ── URL params ────────────────────────────────────────────────────────────
const params = new URLSearchParams(location.search);
const avatarIdParam = params.get('avatar') || '';
-const highlightPinId = params.get('highlight') || '';
+// A visitor who scanned a sign at a real spot arrives on /irl?pin=<id> (the older
+// ?highlight= alias means the same). Once that pin loads nearby it flashes and its
+// card opens, once; until then src/irl/visit-banner.js names who they came to meet.
+const visitPinId = parseVisitTarget(location.search).pinId;
+let _visitFocusDone = false;
+let visitBanner = null;
// Deep-focus a specific agent's pin (from an agent profile's "View in IRL" link):
// once that agent's pin loads nearby, flash it and open its inspect card. Fires
// once so it doesn't re-open the sheet on every nearby refresh.
@@ -1517,6 +1526,7 @@ async function placeAgentHere() {
}
const discovery = initDiscovery({ onPlace: placeAgentHere });
+if (visitPinId) visitBanner = mountVisitBanner({ pinId: visitPinId, onPlace: placeAgentHere });
// ── Designed guidance sheet ───────────────────────────────────────────────
// iOS Safari has no WebXR, so the whole world-lock rides on motion + GPS
@@ -2263,6 +2273,7 @@ function onGPSError(err) {
if (denied) {
_gpsAcquiring = false;
setPermissionState('location', 'denied');
+ visitBanner?.setState('no-gps');
updateNearbyBadge();
} else {
// Transient failure (indoor timeout, momentary signal loss). watchPosition does
@@ -3130,7 +3141,7 @@ function showXrError(err) {
}
}
-async function enterFloorAnchor() {
+async function enterFloorAnchor({ viewPin = null } = {}) {
// Block while a prior camera/XR handoff is still settling — a fast double-tap, or
// a tap during disableAR → session start, must not start a second session or
// re-acquire the camera underneath this one.
@@ -3140,6 +3151,17 @@ async function enterFloorAnchor() {
// session — never a half-built one.)
if (xrSession) { await xrSession.end(); return; }
_arTransitioning = true;
+ // View-only mode ("View in AR" on a discovered pin): the session stands THAT
+ // pin's already-mounted model on a detected surface instead of the viewer's own
+ // avatar rig, and persists nothing. The durable placement stays the owner's pin;
+ // WebXRSession restores the group's saved transform on exit, so the agent walks
+ // back to its GPS spot the moment the session ends.
+ const viewOnly = !!viewPin;
+ const viewName = viewOnly ? pinDisplayName(viewPin) : '';
+ if (viewOnly) {
+ xrViewer.content = viewPin.group;
+ avatarRig.visible = false;
+ }
// immersive-ar owns the rear camera and the full screen; release the
// getUserMedia passthrough first so the two don't contend for the camera.
// Remember whether the user was in camera-AR so we can put them back there on
@@ -3163,19 +3185,34 @@ async function enterFloorAnchor() {
try {
xrSession = new WebXRSession(xrViewer, {
domOverlayRoot: xrOverlay,
- onHit: (has) => setXrResting(has ? 'Looks good — tap to place, pinch to resize' : SEARCHING_HINT),
+ onHit: (has) => setXrResting(has
+ ? (viewOnly ? `Looks good. Tap to stand ${viewName} here, pinch to resize` : 'Looks good. Tap to place, pinch to resize')
+ : SEARCHING_HINT),
// Tracking loss / recovery is a transient, higher-priority overlay on the
// resting hint — recoverable, self-clearing, never a dead reticle.
onTracking: (ok) => { xrHintState.trackingLost = !ok; renderXrHint(); },
// Backgrounding (lock, call, app switch) pauses the session; show a
// resume hint and restore the resting line when foregrounded again.
onVisibility: (visible) => { xrHintState.paused = !visible; renderXrHint(); },
- onAnchored: (pose, meta) => onFloorAnchored(pose, meta),
+ onAnchored: viewOnly
+ ? () => { setXrConfirmed(true); setXrResting(`${viewName} is standing here. Walk around, then Exit to return`); }
+ : (pose, meta) => onFloorAnchored(pose, meta),
// Two-finger pinch resizes the agent live; the final value persists onto
// the placed pin (or rides into the tap's pin when sized before placing).
- onScale: (scale, meta) => onXrScaled(scale, meta),
+ // A view-only stand-in is sized for this session only.
+ onScale: viewOnly
+ ? (scale) => setXrResting(`Size ${Math.round(scale * 100)}%. Pinch to resize`)
+ : (scale, meta) => onXrScaled(scale, meta),
onEnd: () => {
xrSession = null;
+ if (viewOnly) {
+ // The session already restored the pin group's pre-AR transform;
+ // hand the rig slot back to the viewer's own avatar and release the
+ // full-model hold the view took out.
+ xrViewer.content = avatarRig;
+ avatarRig.visible = true;
+ pinFullResident(viewPin, false);
+ }
// Drop any anchor still waiting on a GPS fix — the user left this
// placement, so don't surprise them with a pin saved after they walk
// away (parity with the gyro path's arActive gate).
@@ -3205,10 +3242,17 @@ async function enterFloorAnchor() {
},
});
await xrSession.start();
- setStatus('Floor anchoring on — find the floor, then tap to place your agent');
+ setStatus(viewOnly
+ ? `Find the floor, then tap to stand ${viewName} in front of you`
+ : 'Floor anchoring on. Find the floor, then tap to place your agent');
} catch (err) {
log.error('[irl] WebXR start failed:', err);
failedStart = true;
+ if (viewOnly) {
+ xrViewer.content = avatarRig;
+ avatarRig.visible = true;
+ pinFullResident(viewPin, false);
+ }
// A session that created its XRSession but threw mid-setup never reached
// setAnimationLoop, so its 'end' (→ onEnd) won't fire on its own. Tear it down
// explicitly so we don't leak a live immersive session, and reset the renderer
@@ -3479,6 +3523,109 @@ async function enterQuickLookPlacement() {
}
}
+// ── View in AR: any discovered pin, on the device's real AR stack ───────────
+//
+// The placement button above only ever opened the viewer's OWN agent. A visitor
+// who walks up to somebody else's pin can now stand THAT agent on their real
+// floor: iOS bakes the pin's GLB to an animated USDZ and opens ARKit Quick Look;
+// Android with WebXR enters the same hit-test session as placement, view-only,
+// with the pin's mounted model as the content; everything else opens the
+// device-aware /api/ar launch page in a new tab. Lane routing and URL building
+// are pure (src/irl/pin-ar.js); this block owns the side effects.
+
+// Keep a pin's full skinned model resident regardless of distance/budget rank
+// (enforceLOD reads the flag). Used while a conversation is open (lips need the
+// mesh) and for the duration of a view-only WebXR session.
+function pinFullResident(pin, on) {
+ if (!pin) return;
+ pin._pinnedFull = !!on;
+ if (on && pin.group) applyBand(pin, 'full');
+}
+
+// Resolve (and cache on the pin) a USDZ blob URL for its GLB, idle clip baked in.
+async function resolvePinQuickLookUrl(pin) {
+ if (pin._usdzUrl && pin._usdzUrlFor === pin.avatar_url) return pin._usdzUrl;
+ const glbUrl = new URL(pin.avatar_url, location.origin).toString();
+ const res = await fetch(glbUrl);
+ if (!res.ok) throw new Error(`GLB fetch failed: ${res.status}`);
+ const usdzBlob = await bakeQuickLookUsdz(await res.blob());
+ if (pin._usdzUrl && pin._usdzUrl.startsWith('blob:')) URL.revokeObjectURL(pin._usdzUrl);
+ pin._usdzUrl = URL.createObjectURL(usdzBlob);
+ pin._usdzUrlFor = pin.avatar_url;
+ return pin._usdzUrl;
+}
+
+async function enterQuickLookForPin(pin, btn) {
+ const name = pinDisplayName(pin);
+ if (btn) { btn.disabled = true; btn.classList.add('is-active'); }
+ setStatus(`Preparing ${name} for AR…`, { loading: true, sticky: true });
+ try {
+ const usdzUrl = await resolvePinQuickLookUrl(pin);
+ // The banner is the one piece of page UI Apple allows inside the sealed
+ // viewer; its tap is the only in-AR signal we get back, and here it means
+ // "I want to talk to this one": reopen the sheet with the conversation live.
+ openQuickLook(withQuickLookBanner(usdzUrl, quickLookBannerFor(pin)), {
+ onBannerTap: () => { openPinSheet(pin); pinTalk.open(pin); },
+ });
+ setStatus(`Opening AR. Point at the floor to stand ${name} in your space; tap the banner to talk.`, { sticky: true });
+ } catch (err) {
+ log.error('[irl] pin Quick Look prep failed:', err);
+ setStatus(`Couldn't prepare ${name} for AR. It is still right here in your camera view.`, { error: true, sticky: true });
+ } finally {
+ if (btn) { btn.disabled = false; btn.classList.remove('is-active'); }
+ }
+}
+
+// Wait for the pin's full skinned model (a far pin may be a dot or an impostor
+// when tapped). Bounded: a slow CDN must not hang the button forever.
+function waitForPinModel(pin, timeoutMs = 15000) {
+ if (pin.glbLoaded && pin.model) return Promise.resolve(true);
+ return new Promise((resolve) => {
+ const started = performance.now();
+ const poll = () => {
+ if (pin.glbLoaded && pin.model) return resolve(true);
+ if (!pin.group || performance.now() - started > timeoutMs) return resolve(false);
+ setTimeout(poll, 120);
+ };
+ poll();
+ });
+}
+
+async function enterViewInXR(pin, btn) {
+ const name = pinDisplayName(pin);
+ if (btn) { btn.disabled = true; btn.classList.add('is-active'); }
+ pinFullResident(pin, true);
+ setStatus(`Loading ${name}…`, { loading: true, sticky: true });
+ try {
+ const ready = await waitForPinModel(pin);
+ if (!ready) {
+ pinFullResident(pin, false);
+ setStatus(`${name} is still loading. Try View in AR again in a moment.`, { warn: true, sticky: true });
+ return;
+ }
+ closeInspectSheet();
+ _refinePin = null;
+ await enterFloorAnchor({ viewPin: pin });
+ } finally {
+ if (btn) { btn.disabled = false; btn.classList.remove('is-active'); }
+ }
+}
+
+// The sheet's View in AR action, routed per device capability.
+function viewPinInAR(pin, btn) {
+ if (!pin?.avatar_url) return;
+ const lane = arLaneFor(_placementCapability);
+ if (lane === 'quicklook') return enterQuickLookForPin(pin, btn);
+ if (lane === 'webxr') return enterViewInXR(pin, btn);
+ const url = arLaunchUrl(pin, location.origin);
+ if (!url) {
+ setStatus('This agent\'s model can\'t be opened in the AR viewer from here.', { warn: true, sticky: true });
+ return;
+ }
+ postInteraction({ pinId: pin.id, type: 'tap', agentId: pin.agent_id ?? null }).catch(() => {});
+ window.open(url, '_blank', 'noopener');
+}
+
// One button, capability-routed: iOS opens AR Quick Look; WebXR devices enter the
// in-canvas hit-test session. ('pin' devices never reach here — the button stays
// hidden and the Pin path is the placement.)
@@ -3847,6 +3994,8 @@ function disposePin(p) {
disposeImpostor(p);
if (p.group) { scene.remove(p.group); disposeObject3D(p.group); }
if (p.labelEl) p.labelEl.remove();
+ // A Quick Look USDZ baked for this pin (View in AR) is a blob URL; free it.
+ if (p._usdzUrl && p._usdzUrl.startsWith('blob:')) { URL.revokeObjectURL(p._usdzUrl); p._usdzUrl = null; }
}
// Drop one nearby pin from the scene now — disposing its GPU resources — instead
@@ -4146,6 +4295,7 @@ function bandDistance(pin) {
async function loadNearbyPins() {
if (!gpsState.ready) return;
+ visitBanner?.setState('searching');
// The proximity poll is the SOLE pin-discovery transport: the server returns the
// agents within a tight radius of our live position (no roster, no map). We ask for
// the wider read (NEARBY_READ_RADIUS = the 60 m cap) so an agent on the discovery
@@ -4232,9 +4382,16 @@ async function loadNearbyPins() {
// doesn't own (a room placed without a compass that may render rotated here).
maybePromptRoomAlign();
- // Flash pin label if ?highlight= matches
- if (highlightPinId) {
- flashPinLabel(nearbyPins.find(p => p.id === highlightPinId));
+ // Visit link (?pin= / ?highlight=): the agent the visitor came to meet just
+ // arrived in range. Flash it, open its card, retire the banner. Once only.
+ if (visitPinId && !_visitFocusDone) {
+ const target = nearbyPins.find(p => p.id === visitPinId);
+ if (target) {
+ _visitFocusDone = true;
+ flashPinLabel(target);
+ openPinSheet(target);
+ visitBanner?.setState('found');
+ }
}
// Deep-focus this agent's pin if ?agent= matches one that just loaded — flash
@@ -4876,6 +5033,8 @@ function renderMyPins(pins, listEl) {
${p.caption ? `<div class="irl-pin-caption">${_escHtml(p.caption)}</div>` : ''}
<div class="irl-pin-meta">${_pinMetaLine(p)}</div>
</div>
+ <a class="irl-pin-sign" href="/irl/sign?pin=${_escHtml(p.id)}" target="_blank" rel="noopener"
+ aria-label="Print a sign for this agent so passers-by can find it">Sign</a>
<button class="irl-pin-del" data-del="${_escHtml(p.id)}" type="button" aria-label="Delete this pin">${TRASH_SVG}</button>
</div>`).join('');
}
@@ -5613,6 +5772,9 @@ function _applyCard(card, pin) {
}
}
+ // The conversation speaks with the card's richer name/bio for its persona.
+ pinTalk.setCard(card, pin);
+
// Prefer the card's resolved x402 endpoint for the footer Pay button.
if (card.x402_endpoint) {
const payBtn = document.getElementById('irl-sheet-pay');
@@ -5656,6 +5818,7 @@ async function loadAgentCard(pin) {
function closeInspectSheet() {
_cardAbort?.abort();
+ pinTalk.close();
document.getElementById('irl-sheet')?.classList.remove('is-open');
document.getElementById('irl-sheet-backdrop')?.classList.remove('is-open');
_activePin = null;
@@ -5885,6 +6048,29 @@ function openPinSheet(pin) {
payBtn.dataset.endpoint = pin.x402_endpoint ?? '';
}
+ // Talk: a live spoken conversation with THIS agent (src/irl/pin-talk.js). Tapping
+ // a different agent ends the previous conversation (audio included) before the
+ // new sheet renders; re-tapping the same one keeps its transcript.
+ if (_activePin && _activePin.id !== pin.id) pinTalk.close();
+ const talkBtn = document.getElementById('irl-sheet-talk');
+ if (talkBtn) {
+ talkBtn.onclick = () => pinTalk.toggle(pin);
+ talkBtn.setAttribute('aria-expanded', pinTalk.isOpenFor(pin) ? 'true' : 'false');
+ talkBtn.classList.toggle('is-active', pinTalk.isOpenFor(pin));
+ }
+
+ // View in AR: stand this agent on the visitor's real floor through the device's
+ // native AR stack (Quick Look / WebXR / the /api/ar launch page). Any pin with
+ // a model, not just your own.
+ const arBtn = document.getElementById('irl-sheet-ar');
+ if (arBtn) {
+ const copy = arButtonCopy(arLaneFor(_placementCapability));
+ arBtn.hidden = !pin.avatar_url;
+ arBtn.textContent = copy.label;
+ arBtn.setAttribute('aria-label', copy.aria);
+ arBtn.onclick = () => viewPinInAR(pin, arBtn);
+ }
+
// Calibrate (A3) — only the owner of this pin can fine-tune its real-world
// spot. The server re-checks ownership; this is the discoverable entry point
// alongside the long-press gesture.
@@ -6045,6 +6231,25 @@ window.addEventListener('keydown', (e) => {
}
});
+// Talk panel (src/irl/pin-talk.js): the live conversation inside the pin sheet.
+// The mouth binds to the pin's mounted model; every user turn fans the same
+// ambient 'message' reaction co-located viewers already see for a left note, and
+// the opening line of a conversation lands once in the owner's IRL feed as a
+// 'talk' interaction (never the transcript). While a conversation is open the
+// pin's full model stays resident so the lips have a mesh to move.
+const pinTalk = initPinTalk({
+ getModel: (pin) => (pin?.glbLoaded && pin.model) ? pin.model : null,
+ onTurn: (pin, { first }) => {
+ if (!pin?.id) return;
+ if (first) {
+ postInteraction({ pinId: pin.id, type: 'talk', agentId: pin.agent_id ?? null }).catch(() => {});
+ }
+ irlNet?.interaction({ type: 'message', pinId: pin.id, agentId: pin.agent_id ?? '' });
+ if (!_streamOnline) playEmote(pin, 'message');
+ },
+ onOpenChange: (pin, open) => pinFullResident(pin, open),
+});
+
// Per-service "Use" CTA → x402 payment; the error-state Retry re-fetches the card.
// Both delegate off #irl-card-body so they survive every innerHTML re-render
// (skeleton → populated / error).
@@ -6509,12 +6714,18 @@ function enforceLOD() {
for (let i = 0; i < _lodList.length; i++) {
const pin = _lodList[i];
const d = pin._lodDist;
- let band = bandFor(d, pin._lod);
+ // A pin the viewer is talking to or standing in AR needs its full skinned
+ // model regardless of distance or budget rank: lips and a floor-anchored
+ // stand-in both need the mesh, not an impostor. Released by pinFullResident().
+ let band = pin._pinnedFull ? 'full' : bandFor(d, pin._lod);
// Concurrency + draw-budget demotion: full → impostor when out of GLB slots
// or over the draw ceiling. Nearest-first ordering spends the budget on the
- // agents the viewer is closest to.
- if (band === 'full') {
+ // agents the viewer is closest to. A pinned pin takes its slot unconditionally
+ // (it is the one the viewer is engaging with); the pins after it absorb the cut.
+ if (pin._pinnedFull) {
+ fullBudget--; draws += 6;
+ } else if (band === 'full') {
const cost = draws + 6;
if (fullBudget > 0 && cost <= budget.draw) { fullBudget--; draws = cost; }
else band = 'impostor';
diff --git a/src/irl/pin-ar.js b/src/irl/pin-ar.js
new file mode 100644
index 000000000..fdd0a1da5
--- /dev/null
+++ b/src/irl/pin-ar.js
@@ -0,0 +1,113 @@
+// src/irl/pin-ar.js: "View in AR" for ANY agent discovered on /irl (pure routing).
+//
+// Until now the only AR entry on /irl was the placement button, which only ever
+// opened the viewer's OWN agent (the one they were about to pin). A visitor who
+// walked up to somebody else's agent could see it in the camera passthrough, but
+// had no way to stand it on their real floor with the device's native AR stack.
+// This module decides, per device, how a tapped pin gets there:
+//
+// 'quicklook' iOS / iPadOS: ARKit Quick Look, fed a USDZ baked on-device from
+// the pin's GLB (idle clip included, same bake the placement path
+// uses). The Quick Look banner names the agent and its tap hands
+// the visitor back to the pin sheet with the conversation open.
+// 'webxr' Android Chrome (ARCore): an immersive hit-test session that stands
+// THIS pin's already-loaded model on a detected surface, view-only.
+// Nothing is persisted: the durable placement is the owner's pin.
+// 'link' Everything else: the device-aware /api/ar launch page for the
+// pin's GLB (Scene Viewer on an ARCore phone without WebXR, a
+// phone-handoff QR on desktop). Opens in a new tab so the visitor
+// never loses their place in the camera view.
+//
+// The functions are pure (no DOM, no Three.js) so the routing and the URL
+// construction are unit-tested in isolation; irl.js owns the side effects.
+
+/** @typedef {'quicklook'|'webxr'|'link'} PinArLane */
+
+// Upper bound on the agent name inside the Quick Look banner and the /api/ar
+// title. Quick Look truncates long strings itself; /api/ar echoes the title into
+// the page <title>, so a prompt-as-name must never run away.
+const NAME_MAX = 60;
+
+/**
+ * Map the device's placement capability (src/ar/placement-capability.js) to the
+ * lane a discovered pin is viewed through. Unknown/empty input is the safe
+ * universal lane, never a thrown error on a button tap.
+ * @param {string} capability 'webxr' | 'quicklook' | 'pin' | anything else
+ * @returns {PinArLane}
+ */
+export function arLaneFor(capability) {
+ if (capability === 'quicklook') return 'quicklook';
+ if (capability === 'webxr') return 'webxr';
+ return 'link';
+}
+
+/**
+ * Button copy per lane: one visible label everywhere (one mental model), with the
+ * accessible description saying what actually happens on this device.
+ * @param {PinArLane} lane
+ * @returns {{ label: string, aria: string }}
+ */
+export function arButtonCopy(lane) {
+ if (lane === 'quicklook') {
+ return { label: 'View in AR', aria: 'View this agent on your floor in AR (iOS Quick Look)' };
+ }
+ if (lane === 'webxr') {
+ return { label: 'View in AR', aria: 'Stand this agent on your floor with AR' };
+ }
+ return { label: 'View in AR', aria: 'Open this agent in the AR viewer' };
+}
+
+/** The pin's display name, clamped for banners and titles. */
+export function pinDisplayName(pin) {
+ const raw = typeof pin?.avatar_name === 'string' ? pin.avatar_name.trim() : '';
+ return (raw || 'Agent').slice(0, NAME_MAX);
+}
+
+/**
+ * Resolve the pin's GLB to an absolute URL. Pins store either an absolute CDN
+ * URL or a site-relative path (`/avatars/default.glb`); native AR viewers and
+ * /api/ar only accept absolute https. Returns null when nothing usable exists.
+ * @param {string} avatarUrl
+ * @param {string} origin e.g. location.origin
+ * @returns {string|null}
+ */
+export function absoluteGlbUrl(avatarUrl, origin) {
+ if (typeof avatarUrl !== 'string' || !avatarUrl.trim()) return null;
+ try {
+ return new URL(avatarUrl.trim(), origin).toString();
+ } catch {
+ return null;
+ }
+}
+
+/**
+ * The device-aware AR launch link for a pin (GET /api/ar, api/ar.js). `kind=avatar`
+ * marks it as a living agent so Android without WebXR lands on /ar/view with the
+ * IRL handoff visible instead of a blind Scene Viewer redirect. Returns null when
+ * the GLB cannot be expressed as an https URL, which /api/ar would reject anyway.
+ * @param {{ avatar_url?: string, avatar_name?: string }} pin
+ * @param {string} origin
+ * @returns {string|null}
+ */
+export function arLaunchUrl(pin, origin) {
+ const glb = absoluteGlbUrl(pin?.avatar_url, origin);
+ if (!glb || !glb.startsWith('https://')) return null;
+ const params = new URLSearchParams({ src: glb, title: pinDisplayName(pin), kind: 'avatar' });
+ return `${origin}/api/ar?${params.toString()}`;
+}
+
+/**
+ * Quick Look banner fields for a discovered pin. The banner is the one piece of
+ * page UI Apple allows inside the sealed viewer; its tap is the only in-AR signal
+ * we get back, so the call to action is the conversation, not a placement.
+ * @param {{ avatar_name?: string, caption?: string }} pin
+ */
+export function quickLookBannerFor(pin) {
+ const name = pinDisplayName(pin);
+ const caption = typeof pin?.caption === 'string' ? pin.caption.trim() : '';
+ return {
+ title: name,
+ subtitle: caption || 'Living agent on three.ws',
+ callToAction: `Talk to ${name}`,
+ };
+}
diff --git a/src/irl/pin-talk.js b/src/irl/pin-talk.js
new file mode 100644
index 000000000..4d131b592
--- /dev/null
+++ b/src/irl/pin-talk.js
@@ -0,0 +1,409 @@
+// src/irl/pin-talk.js: talk to the agent you just walked up to.
+//
+// Discovery on /irl already delivers the moment: an agent standing at a real
+// spot, breathing, turning to look at you. The inspect sheet then offered a bio,
+// a pay button and a one-way "leave a message". The thing a person actually
+// wants to do when they walk up to an AI in the street is TALK to it, and that
+// was the one thing missing. This module adds a live, spoken conversation to the
+// pin sheet for ANY discovered agent, yours or a stranger's:
+//
+// hold the mic (or type) -> /api/chat, in the agent's own persona when the pin
+// carries an agent identity -> the reply is spoken through the agent's voice
+// (cloned when it has one, the platform lane otherwise) -> the standing 3D
+// model's mouth moves from the FFT of that audio, on top of its running idle.
+//
+// The whole loop is the same TalkController that powers talk mode on
+// /avatars/:id (src/voice/talk-controller.js): mic capture, server or browser
+// speech recognition, the streamed chat, TTS routing, and lipsync. Nothing is
+// re-implemented here; this file owns only the sheet UI and the pin-specific
+// prompt. irl.js supplies the mounted model (for the mouth) and hears about each
+// turn (for the interaction log + the ambient reaction other viewers see).
+//
+// Two pure helpers are exported for tests: talkAvatarRecord() decides which
+// identity the chat is keyed on, and pinPersonaPrompt() writes the fallback
+// persona for a pin with no stored one.
+
+import { TalkController } from '../voice/talk-controller.js';
+import { AvatarMouthTarget } from '../voice/avatar-morph-target.js';
+import { log } from '../shared/log.js';
+
+const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
+const MAX_INPUT = 500;
+const MAX_LOG_LINES = 60;
+
+const STATE_COPY = {
+ idle: '',
+ listening: 'Listening…',
+ transcribing: 'Got it…',
+ thinking: 'Thinking…',
+ speaking: 'Speaking',
+};
+
+/**
+ * The avatar record TalkController keys the conversation on. A pin bound to an
+ * agent identity chats AS that agent: /api/chat loads its published persona and
+ * memories by `agentId`, and the voice lookup finds its cloned voice. An anonymous
+ * pin (a device-token placement with no identity) gets a deliberately non-UUID id
+ * so the controller never sends a bogus `agentId`; the persona then comes from
+ * pinPersonaPrompt() via system_prompt.
+ * @param {{ id?: string, agent_id?: string|null, avatar_name?: string }} pin
+ */
+export function talkAvatarRecord(pin) {
+ const agentId = typeof pin?.agent_id === 'string' && UUID_RE.test(pin.agent_id) ? pin.agent_id : null;
+ const name = (typeof pin?.avatar_name === 'string' && pin.avatar_name.trim()) || 'Agent';
+ if (agentId) return { id: agentId, agent_id: agentId, name };
+ return { id: `irl-pin:${pin?.id || 'anonymous'}`, name };
+}
+
+/**
+ * Fallback persona for the chat when the pin has no stored persona (anonymous
+ * pins, or an identity whose persona is not published). Grounds the model in the
+ * one fact that makes IRL different from every other chat surface: a person is
+ * physically standing in front of it. Replies are kept short because they are
+ * spoken aloud outdoors. When the server has a real persona for `agentId` it
+ * takes precedence over this text (api/chat.js), which is the intended order.
+ * @param {{ avatar_name?: string, caption?: string }} pin
+ * @param {{ agent?: { name?: string, bio?: string } } | null} [card] /api/irl/agent-card payload
+ */
+export function pinPersonaPrompt(pin, card = null) {
+ const name = (card?.agent?.name || pin?.avatar_name || 'Agent').toString().trim().slice(0, 60);
+ const caption = typeof pin?.caption === 'string' ? pin.caption.trim().slice(0, 200) : '';
+ const bio = typeof card?.agent?.bio === 'string' ? card.agent.bio.trim().slice(0, 400) : '';
+ const lines = [
+ `You are ${name}, a 3D AI agent standing at a real place in the physical world through three.ws IRL.`,
+ 'A person has walked up to you in person and is talking to you through their phone camera, where they can see you standing in front of them.',
+ ];
+ if (caption) lines.push(`The placard next to you reads: "${caption}".`);
+ if (bio) lines.push(`About you: ${bio}`);
+ lines.push(
+ `Speak in first person as ${name}. Keep every reply to one to three short sentences, because it is spoken aloud outdoors.`,
+ 'Be warm and present: react to being met in person, be curious about where they are standing and what they can see.',
+ 'Never claim to be a human. If asked what you are, say you are an AI agent a three.ws creator placed here, and that anyone can create and pin their own agent at three.ws/irl.',
+ );
+ return lines.join('\n');
+}
+
+/**
+ * Wire the talk panel inside the pin sheet.
+ *
+ * @param {object} deps
+ * @param {(pin: object) => import('three').Object3D|null} deps.getModel The pin's
+ * mounted skinned model (null while it is still a dot/impostor); polled again
+ * before each reply so a model that streams in mid-conversation still gets lips.
+ * @param {(pin: object, info: { first: boolean }) => void} [deps.onTurn] Fired for
+ * every user turn; `first` marks the opening line of a conversation.
+ * @param {(pin: object, open: boolean) => void} [deps.onOpenChange] Fired when the
+ * panel opens for a pin or closes, so the host can keep that pin's full model
+ * resident while the conversation lasts.
+ */
+export function initPinTalk({ getModel, onTurn, onOpenChange } = {}) {
+ const $ = (id) => document.getElementById(id);
+ const panel = $('irl-talk');
+ const toggleBtn = $('irl-sheet-talk');
+ const logEl = $('irl-talk-log');
+ const partialEl = $('irl-talk-partial');
+ const holdBtn = $('irl-talk-hold');
+ const form = $('irl-talk-form');
+ const input = $('irl-talk-input');
+ const sendBtn = $('irl-talk-send');
+ const stateEl = $('irl-talk-state');
+
+ // The sheet shell is static HTML; a page that lacks it (an embed, a test
+ // fixture) gets an inert API rather than a crash on every tap.
+ const inert = { open() {}, toggle() {}, close() {}, setCard() {}, isOpen: () => false, isOpenFor: () => false };
+ if (!panel || !toggleBtn || !logEl || !holdBtn || !form || !input || !stateEl) return inert;
+
+ let pin = null; // the pin the live conversation belongs to
+ let card = null; // its /api/irl/agent-card payload, once loaded
+ let cardPinId = null; // which pin `card` describes (it can arrive before open)
+ let controller = null; // TalkController for `pin`
+ let mouth = null; // AvatarMouthTarget bound to the pin's model
+ let turns = 0; // user turns in this conversation
+ let holding = false;
+ let levelRaf = 0;
+ let voiceUnavailable = false;
+
+ const reducedMotion = () => {
+ try { return window.matchMedia('(prefers-reduced-motion: reduce)').matches; } catch { return false; }
+ };
+
+ function pinName() {
+ return card?.agent?.name || pin?.avatar_name || 'this agent';
+ }
+
+ function setState(text, { error = false } = {}) {
+ stateEl.textContent = text || '';
+ stateEl.classList.toggle('is-error', !!error && !!text);
+ stateEl.hidden = !text;
+ }
+
+ function renderEmpty() {
+ logEl.innerHTML = '';
+ const empty = document.createElement('p');
+ empty.className = 'irl-talk-empty';
+ empty.textContent = voiceUnavailable
+ ? `${pinName()} is listening. Type something to start.`
+ : `${pinName()} is listening. Hold the mic and speak, or type.`;
+ logEl.appendChild(empty);
+ }
+
+ function appendLine(role, text) {
+ logEl.querySelector('.irl-talk-empty')?.remove();
+ const line = document.createElement('div');
+ line.className = `irl-talk-msg ${role === 'user' ? 'is-user' : 'is-agent'}`;
+ if (role !== 'user') {
+ const who = document.createElement('span');
+ who.className = 'irl-talk-who';
+ who.textContent = pinName();
+ line.appendChild(who);
+ }
+ const body = document.createElement('span');
+ body.className = 'irl-talk-text';
+ body.textContent = text;
+ line.appendChild(body);
+ logEl.appendChild(line);
+ while (logEl.children.length > MAX_LOG_LINES) logEl.firstElementChild.remove();
+ logEl.scrollTo({ top: logEl.scrollHeight, behavior: reducedMotion() ? 'auto' : 'smooth' });
+ }
+
+ // Lips: bind the pin's mounted model when we have it. A far pin is a dot or an
+ // impostor until the host promotes it, so this is retried right before each
+ // reply instead of assumed at open.
+ function attachMouth() {
+ if (!mouth || !pin) return;
+ const model = typeof getModel === 'function' ? getModel(pin) : null;
+ if (!model || mouth._irlBoundTo === model) return;
+ mouth.attach(model);
+ mouth._irlBoundTo = model;
+ }
+
+ function stopLevelMeter() {
+ if (levelRaf) cancelAnimationFrame(levelRaf);
+ levelRaf = 0;
+ holdBtn.style.setProperty('--irl-mic-level', '0');
+ }
+
+ function startLevelMeter() {
+ stopLevelMeter();
+ const tick = () => {
+ if (!controller) return;
+ holdBtn.style.setProperty('--irl-mic-level', controller.micLevel.toFixed(3));
+ levelRaf = requestAnimationFrame(tick);
+ };
+ levelRaf = requestAnimationFrame(tick);
+ }
+
+ function onControllerState(state) {
+ setState(STATE_COPY[state] ?? '');
+ panel.dataset.state = state;
+ const busy = state === 'thinking' || state === 'transcribing' || state === 'speaking';
+ if (sendBtn) sendBtn.disabled = busy;
+ holdBtn.classList.toggle('is-busy', busy);
+ if (state === 'thinking') attachMouth();
+ if (state !== 'listening') {
+ holdBtn.classList.remove('is-active');
+ stopLevelMeter();
+ }
+ }
+
+ function onControllerError(err) {
+ const code = err?.code;
+ if (code === 'stt-unavailable' || code === 'permission-denied' || code === 'capture-failed') {
+ voiceUnavailable = true;
+ holdBtn.hidden = true;
+ setState(err.message || 'Voice input is not available here. Type your message instead.', { error: true });
+ if (!logEl.querySelector('.irl-talk-msg')) renderEmpty();
+ input.focus();
+ return;
+ }
+ if (code === 'no-speech') { setState(err.message, { error: true }); return; }
+ log.warn('[irl-talk]', err?.message || err);
+ setState(err?.message ? `Couldn't reach ${pinName()}: ${err.message}` : `Couldn't reach ${pinName()}. Try again.`, { error: true });
+ }
+
+ function onControllerMessage(msg) {
+ if (!msg?.content) return;
+ if (msg.role === 'user') {
+ appendLine('user', msg.content);
+ const first = turns === 0;
+ turns += 1;
+ try { onTurn?.(pin, { first }); } catch (e) { log.warn('[irl-talk] onTurn', e?.message || e); }
+ return;
+ }
+ appendLine('agent', msg.content);
+ }
+
+ function teardownController() {
+ stopLevelMeter();
+ holding = false;
+ holdBtn.classList.remove('is-active', 'is-busy');
+ if (controller) {
+ try { controller.stop(); } catch (e) { log.warn('[irl-talk] stop', e?.message || e); }
+ controller = null;
+ }
+ if (mouth) {
+ try { mouth.dispose(); } catch { /* already detached */ }
+ mouth = null;
+ }
+ partialEl.textContent = '';
+ partialEl.hidden = true;
+ panel.dataset.state = 'idle';
+ setState('');
+ }
+
+ function buildController() {
+ mouth = new AvatarMouthTarget();
+ attachMouth();
+ controller = new TalkController({
+ avatar: talkAvatarRecord(pin),
+ systemPromptFn: () => pinPersonaPrompt(pin, card),
+ mouthTarget: mouth,
+ onMessage: onControllerMessage,
+ onStateChange: onControllerState,
+ onInterim: (partial) => {
+ partialEl.textContent = partial || '';
+ partialEl.hidden = !partial;
+ },
+ onError: onControllerError,
+ });
+ // Probe which recognizer this browser + language can use; hide the mic
+ // only when neither the server lane nor the browser can hear anything.
+ controller.prepare().then((mode) => {
+ if (controller && mode === 'none') {
+ voiceUnavailable = true;
+ holdBtn.hidden = true;
+ if (!logEl.querySelector('.irl-talk-msg')) renderEmpty();
+ }
+ }).catch(() => { /* prepare() never rejects in practice; the mic falls back per turn */ });
+ }
+
+ function open(nextPin) {
+ if (!nextPin) return;
+ const samePin = pin && nextPin.id === pin.id && controller;
+ if (!samePin) {
+ teardownController();
+ pin = nextPin;
+ if (cardPinId !== pin.id) { card = null; cardPinId = null; }
+ turns = 0;
+ voiceUnavailable = false;
+ holdBtn.hidden = false;
+ renderEmpty();
+ buildController();
+ }
+ panel.hidden = false;
+ toggleBtn.setAttribute('aria-expanded', 'true');
+ toggleBtn.classList.add('is-active');
+ try { onOpenChange?.(pin, true); } catch (e) { log.warn('[irl-talk] onOpenChange', e?.message || e); }
+ // Voice-first on a phone: the mic is the primary control, so focus lands
+ // there for keyboard users; the input stays one tab away.
+ if (voiceUnavailable) input.focus({ preventScroll: true });
+ else holdBtn.focus({ preventScroll: true });
+ requestAnimationFrame(() => panel.scrollIntoView({ block: 'nearest', behavior: reducedMotion() ? 'auto' : 'smooth' }));
+ }
+
+ // Hide the panel and stop the audio, keeping the pin so a re-open within the
+ // same sheet visit resumes the same conversation (history intact).
+ function collapse() {
+ panel.hidden = true;
+ toggleBtn.setAttribute('aria-expanded', 'false');
+ toggleBtn.classList.remove('is-active');
+ if (controller) {
+ try { controller.hush(); } catch { /* nothing playing */ }
+ if (holding) { holding = false; controller.stopListening(); }
+ stopLevelMeter();
+ holdBtn.classList.remove('is-active');
+ }
+ }
+
+ // Full close: the sheet went away or a different pin was tapped.
+ function close() {
+ const hadPin = pin;
+ collapse();
+ teardownController();
+ if (hadPin) {
+ try { onOpenChange?.(hadPin, false); } catch (e) { log.warn('[irl-talk] onOpenChange', e?.message || e); }
+ }
+ pin = null;
+ card = null;
+ cardPinId = null;
+ turns = 0;
+ logEl.innerHTML = '';
+ }
+
+ function toggle(nextPin) {
+ if (!panel.hidden && pin && nextPin?.id === pin.id) { collapse(); return; }
+ open(nextPin);
+ }
+
+ // ── Hold to talk ────────────────────────────────────────────────────────────
+ function startHold(e) {
+ if (holdBtn.hidden || !controller || holding) return;
+ if (e?.type === 'touchstart') e.preventDefault();
+ if (controller.state !== 'idle') {
+ // Barge-in: pressing the mic while the agent is speaking cuts it off and
+ // starts listening, the way a real conversation interrupts.
+ if (controller.state === 'speaking') controller.hush();
+ else return;
+ }
+ holding = true;
+ partialEl.textContent = '';
+ partialEl.hidden = true;
+ const started = controller.startListening();
+ if (!started) { holding = false; return; }
+ holdBtn.classList.add('is-active');
+ startLevelMeter();
+ }
+
+ function endHold() {
+ if (!holding || !controller) return;
+ holding = false;
+ holdBtn.classList.remove('is-active');
+ stopLevelMeter();
+ controller.stopListening();
+ }
+
+ holdBtn.addEventListener('pointerdown', (e) => { if (e.button === 0 || e.pointerType !== 'mouse') startHold(e); });
+ holdBtn.addEventListener('pointerup', endHold);
+ holdBtn.addEventListener('pointercancel', endHold);
+ holdBtn.addEventListener('pointerleave', endHold);
+ // iOS Safari fires a synthetic long-press callout on a held button; owning
+ // touchstart (with the CSS touch-action/callout guards) keeps the hold clean.
+ holdBtn.addEventListener('touchstart', (e) => e.preventDefault(), { passive: false });
+ holdBtn.addEventListener('contextmenu', (e) => e.preventDefault());
+ holdBtn.addEventListener('keydown', (e) => {
+ if ((e.key === ' ' || e.key === 'Enter') && !e.repeat) { e.preventDefault(); startHold(e); }
+ });
+ holdBtn.addEventListener('keyup', (e) => {
+ if (e.key === ' ' || e.key === 'Enter') { e.preventDefault(); endHold(); }
+ });
+
+ // ── Typed turn ──────────────────────────────────────────────────────────────
+ form.addEventListener('submit', (e) => {
+ e.preventDefault();
+ if (!controller) return;
+ const text = input.value.trim().slice(0, MAX_INPUT);
+ if (!text) return;
+ if (controller.state === 'speaking') controller.hush();
+ if (controller.state !== 'idle') return;
+ input.value = '';
+ controller.say(text).catch((err) => onControllerError(err));
+ });
+
+ return {
+ open,
+ toggle,
+ close,
+ /** Feed the loaded agent card so the persona + display name are richer than the pin row. */
+ setCard(nextCard, forPin) {
+ if (forPin && pin && forPin.id !== pin.id) return;
+ card = nextCard || null;
+ cardPinId = forPin?.id ?? pin?.id ?? null;
+ const who = logEl.querySelectorAll('.irl-talk-who');
+ who.forEach((el) => { el.textContent = pinName(); });
+ const empty = logEl.querySelector('.irl-talk-empty');
+ if (empty) renderEmpty();
+ },
+ isOpen: () => !panel.hidden,
+ isOpenFor: (p) => !panel.hidden && !!pin && !!p && p.id === pin.id,
+ };
+}
diff --git a/src/irl/visit-banner.js b/src/irl/visit-banner.js
new file mode 100644
index 000000000..6a7c0e73e
--- /dev/null
+++ b/src/irl/visit-banner.js
@@ -0,0 +1,191 @@
+/**
+ * "You're here to meet …" banner for /irl?pin=<id> visitors.
+ *
+ * Someone who scanned a sign at a real spot arrives with one intent: see the
+ * agent that lives here. Until the presence-gated nearby read returns that pin,
+ * the page would otherwise look identical to an empty street, so this banner
+ * names the agent they came for (from the public, coordinate-free agent card),
+ * tells them how close they need to be, and steps aside the moment the agent
+ * appears. Self-styled and self-fetching so src/irl.js only wires state changes.
+ *
+ * States: loading → searching | no-gps | gone, then found (auto-retires).
+ */
+
+import { meetBannerCopy } from './visit-link.js';
+
+const FOUND_LINGER_MS = 5200;
+const STYLE_ID = 'irl-visit-banner-styles';
+
+const CSS = `
+.irl-visit {
+ position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 66px);
+ transform: translate(-50%, -8px);
+ z-index: 12; width: min(440px, calc(100vw - 24px));
+ display: flex; align-items: center; gap: 12px;
+ padding: 10px 12px 10px 10px;
+ background: linear-gradient(180deg, rgba(17,21,31,0.94), rgba(11,14,21,0.96));
+ border: 1px solid rgba(125,211,252,0.28);
+ border-radius: 16px;
+ box-shadow: 0 14px 40px rgba(0,0,0,0.5);
+ color: #eef2f8;
+ font: 500 13px/1.4 var(--font-body, system-ui, sans-serif);
+ opacity: 0; pointer-events: none;
+ transition: opacity .28s ease, transform .32s cubic-bezier(.22,.61,.36,1);
+}
+.irl-visit.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
+.irl-visit[hidden] { display: none; }
+.irl-visit.is-found { border-color: rgba(52,211,153,0.45); }
+.irl-visit.is-gone { border-color: rgba(255,176,32,0.4); }
+.irl-visit-thumb {
+ width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px;
+ background: rgba(125,211,252,0.12); overflow: hidden;
+ display: grid; place-items: center; font-size: 20px;
+}
+.irl-visit-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
+.irl-visit-thumb.is-loading { animation: irl-visit-shimmer 1.2s ease-in-out infinite; }
+@keyframes irl-visit-shimmer { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
+.irl-visit-text { flex: 1 1 auto; min-width: 0; }
+.irl-visit-title { margin: 0; font-weight: 700; font-size: 14px; letter-spacing: -.01em; color: #f4f7fb; }
+.irl-visit-body { margin: 2px 0 0; color: #a7b3c6; }
+.irl-visit-cta {
+ margin-top: 6px; display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px;
+ border-radius: 999px; border: 1px solid rgba(125,211,252,0.4);
+ background: rgba(125,211,252,0.12); color: #bfe6ff;
+ font: 600 12px/1 var(--font-body, system-ui, sans-serif); cursor: pointer;
+ transition: background .15s ease, transform .1s ease;
+}
+.irl-visit-cta:hover { background: rgba(125,211,252,0.2); }
+.irl-visit-cta:active { transform: scale(.97); }
+.irl-visit-cta:focus-visible { outline: 2px solid #7dd3fc; outline-offset: 2px; }
+.irl-visit-close {
+ flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
+ border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.06);
+ color: #cbd5e1; font-size: 16px; line-height: 1; cursor: pointer;
+ display: grid; place-items: center;
+ transition: background .15s ease;
+}
+.irl-visit-close:hover { background: rgba(255,255,255,0.14); }
+.irl-visit-close:focus-visible { outline: 2px solid #7dd3fc; outline-offset: 2px; }
+@media (prefers-reduced-motion: reduce) {
+ .irl-visit { transition: opacity .15s ease; transform: translate(-50%, 0); }
+ .irl-visit-thumb.is-loading { animation: none; }
+}
+`;
+
+function ensureStyles() {
+ if (document.getElementById(STYLE_ID)) return;
+ const s = document.createElement('style');
+ s.id = STYLE_ID;
+ s.textContent = CSS;
+ document.head.appendChild(s);
+}
+
+/**
+ * Mount the banner for one pin. Resolves the agent's public card itself; the
+ * caller drives `setState()` from GPS + nearby events and `destroy()` on teardown.
+ *
+ * @param {{ pinId: string, onPlace?: () => void }} opts
+ */
+export function mountVisitBanner({ pinId, onPlace } = {}) {
+ if (!pinId || typeof document === 'undefined') return null;
+ ensureStyles();
+
+ const el = document.createElement('aside');
+ el.className = 'irl-visit';
+ el.setAttribute('role', 'status');
+ el.setAttribute('aria-live', 'polite');
+ el.innerHTML =
+ `<div class="irl-visit-thumb is-loading" aria-hidden="true">✦</div>` +
+ `<div class="irl-visit-text"><p class="irl-visit-title"></p><p class="irl-visit-body"></p></div>` +
+ `<button type="button" class="irl-visit-close" aria-label="Dismiss">×</button>`;
+ document.body.appendChild(el);
+
+ const thumb = el.querySelector('.irl-visit-thumb');
+ const title = el.querySelector('.irl-visit-title');
+ const body = el.querySelector('.irl-visit-body');
+ let name = '';
+ let state = 'loading';
+ let dismissed = false;
+ let retireTimer = null;
+
+ const show = () => {
+ if (dismissed) return;
+ el.hidden = false;
+ requestAnimationFrame(() => el.classList.add('is-visible'));
+ };
+ const hide = () => {
+ el.classList.remove('is-visible');
+ setTimeout(() => { if (!el.classList.contains('is-visible')) el.hidden = true; }, 320);
+ };
+
+ function render() {
+ const copy = meetBannerCopy({ name, state: state === 'loading' ? 'searching' : state });
+ title.textContent = copy.title;
+ body.textContent = copy.body;
+ el.classList.toggle('is-found', state === 'found');
+ el.classList.toggle('is-gone', state === 'gone');
+ const old = el.querySelector('.irl-visit-cta');
+ if (old) old.remove();
+ if (state === 'gone' && typeof onPlace === 'function') {
+ const cta = document.createElement('button');
+ cta.type = 'button';
+ cta.className = 'irl-visit-cta';
+ cta.textContent = 'Place an agent here';
+ cta.addEventListener('click', () => { hide(); onPlace(); });
+ body.after(cta);
+ }
+ }
+
+ function setState(next) {
+ if (state === 'gone' && next !== 'gone') return;
+ if (state === 'found' && next === 'searching') return;
+ if (state === next) return;
+ state = next;
+ render();
+ if (next === 'found') {
+ show();
+ clearTimeout(retireTimer);
+ retireTimer = setTimeout(hide, FOUND_LINGER_MS);
+ } else {
+ show();
+ }
+ }
+
+ el.querySelector('.irl-visit-close').addEventListener('click', () => { dismissed = true; hide(); });
+
+ render();
+ show();
+
+ // Public card only: name, bio, thumbnail. Never a coordinate; a 404 means the
+ // pin expired or was removed, which is the one state the visitor must be told.
+ fetch(`/api/irl/agent-card?pin=${encodeURIComponent(pinId)}`)
+ .then(async (r) => {
+ if (r.status === 404) { setState('gone'); return; }
+ if (!r.ok) throw new Error(`HTTP ${r.status}`);
+ const { card } = await r.json();
+ name = card?.agent?.name || '';
+ const src = card?.agent?.thumbnail_url;
+ if (src) {
+ const img = document.createElement('img');
+ img.alt = '';
+ img.decoding = 'async';
+ img.src = src;
+ img.addEventListener('error', () => { img.remove(); thumb.textContent = '✦'; });
+ thumb.textContent = '';
+ thumb.appendChild(img);
+ }
+ thumb.classList.remove('is-loading');
+ render();
+ })
+ .catch(() => {
+ // Card unreachable: keep the neutral copy, the walk-up still works.
+ thumb.classList.remove('is-loading');
+ render();
+ });
+
+ return {
+ setState,
+ get state() { return state; },
+ destroy() { clearTimeout(retireTimer); el.remove(); },
+ };
+}
diff --git a/src/irl/visit-link.js b/src/irl/visit-link.js
new file mode 100644
index 000000000..120d4fd2c
--- /dev/null
+++ b/src/irl/visit-link.js
@@ -0,0 +1,95 @@
+/**
+ * IRL visit links: the scannable handoff that lands a stranger on one placed agent.
+ *
+ * A street demo needs one URL a passer-by can scan from a sign, open on their
+ * phone, and end up looking at the agent that lives at that spot. This module
+ * holds the pure rules for that handoff so the page, the printable sign, and
+ * the owner's dashboard all agree on them:
+ *
+ * /irl?pin=<pinId> the visit link (the legacy `?highlight=` is an alias)
+ * /irl/sign?pin=<pinId> the printable sign that carries the visit link as a QR
+ *
+ * Neither URL carries a coordinate. The pin id alone resolves only to the public
+ * agent card (name, bio, wallet, services), and the agent itself still appears
+ * only through the presence-gated nearby read once the visitor is standing there.
+ * That keeps the privacy model intact: a scanned sign tells you WHO is here, the
+ * walk-up tells you WHERE.
+ */
+
+// Pin ids are UUIDs or the shorter ids older rows carry; either way a visit link
+// only ever holds one path-safe token, so anything else is dropped at the boundary.
+const PIN_ID_RE = /^[A-Za-z0-9_-]{6,64}$/;
+
+/** Normalise a raw pin id from a URL; `null` when it is not a plausible id. */
+export function normalizePinId(raw) {
+ const v = typeof raw === 'string' ? raw.trim() : '';
+ return PIN_ID_RE.test(v) ? v : null;
+}
+
+/**
+ * Which pin a visitor came to meet, read from the page's query string.
+ * `?pin=` is canonical; `?highlight=` (the dashboard's older "View in IRL" link)
+ * means the same thing. Returns `{ pinId }` with `null` when neither is present.
+ */
+export function parseVisitTarget(search) {
+ const sp = new URLSearchParams(typeof search === 'string' ? search : '');
+ return { pinId: normalizePinId(sp.get('pin')) || normalizePinId(sp.get('highlight')) };
+}
+
+function baseFrom(origin) {
+ const o = typeof origin === 'string' && origin ? origin : 'https://three.ws';
+ return o.replace(/\/+$/, '');
+}
+
+/** The visit link for a pin: what the sign's QR encodes and what the owner copies. */
+export function buildVisitUrl(pinId, origin) {
+ const id = normalizePinId(pinId);
+ if (!id) throw new Error('a pin id is required to build a visit link');
+ return `${baseFrom(origin)}/irl?pin=${encodeURIComponent(id)}`;
+}
+
+/** The printable sign for a pin. */
+export function buildSignUrl(pinId, origin) {
+ const id = normalizePinId(pinId);
+ if (!id) throw new Error('a pin id is required to build a sign link');
+ return `${baseFrom(origin)}/irl/sign?pin=${encodeURIComponent(id)}`;
+}
+
+/**
+ * How "See it in AR" should launch for a DISCOVERED pin (someone else's agent).
+ *
+ * iOS has no WebXR, but ARKit Quick Look can show the agent on the real floor,
+ * so the page bakes the pin's GLB into an animated USDZ on the device and opens
+ * it in place. Everything else goes through the server-side AR launcher, which
+ * already routes Android to a native AR intent and desktops to the WebGL viewer.
+ * A pin with no https GLB (a legacy relative path, a blob) gets `none`, and the
+ * button stays hidden rather than pointing at a viewer that would refuse it.
+ */
+export function discoveredArLaunch({ avatarUrl, name, ios } = {}) {
+ const src = typeof avatarUrl === 'string' ? avatarUrl.trim() : '';
+ if (!/^https:\/\//i.test(src)) return { mode: 'none' };
+ if (ios) return { mode: 'quicklook', src };
+ const title = typeof name === 'string' ? name.trim().slice(0, 120) : '';
+ const qs = new URLSearchParams({ src, kind: 'avatar' });
+ if (title) qs.set('title', title);
+ return { mode: 'link', src, url: `/api/ar?${qs.toString()}` };
+}
+
+/**
+ * Copy for the "you came to meet" banner while the visitor is not yet within
+ * discovery range, and once the agent has appeared. The radius is the server's
+ * hard cap on the nearby read, so the number a visitor is told is the real one.
+ */
+export function meetBannerCopy({ name, state, radiusM = 60 } = {}) {
+ const who = typeof name === 'string' && name.trim() ? name.trim() : 'this agent';
+ switch (state) {
+ case 'found':
+ return { title: `${who} is here`, body: 'Look around, then tap it to see its profile, wallet, and services.' };
+ case 'gone':
+ return { title: `${who} has moved on`, body: 'This placement is no longer active. Place your own agent here instead.' };
+ case 'no-gps':
+ return { title: `You're here to meet ${who}`, body: 'Allow location so we can tell when you are standing near it.' };
+ default:
+ return { title: `You're here to meet ${who}`, body: `Walk to the spot on the sign. It appears in your camera within ${radiusM} m.` };
+ }
+}
diff --git a/tests/irl-visit-link.test.js b/tests/irl-visit-link.test.js
new file mode 100644
index 000000000..71c555ba5
--- /dev/null
+++ b/tests/irl-visit-link.test.js
@@ -0,0 +1,102 @@
+// IRL visit links (src/irl/visit-link.js).
+//
+// A sign at a real spot carries one URL. Everything a stranger sees after scanning
+// it (which agent they came to meet, whether their phone opens Quick Look or the
+// server AR launcher, what the banner tells them before the agent is in range)
+// follows from these rules, so they are pinned here.
+
+import { describe, it, expect } from 'vitest';
+
+import {
+ normalizePinId,
+ parseVisitTarget,
+ buildVisitUrl,
+ buildSignUrl,
+ discoveredArLaunch,
+ meetBannerCopy,
+} from '../src/irl/visit-link.js';
+
+const UUID = '0b9e0f8e-6c9a-4a2f-9a55-2c1d4a1b7e33';
+
+describe('normalizePinId', () => {
+ it('accepts uuids and short ids, rejects junk', () => {
+ expect(normalizePinId(UUID)).toBe(UUID);
+ expect(normalizePinId(' abc123xyz ')).toBe('abc123xyz');
+ expect(normalizePinId('a/b')).toBeNull();
+ expect(normalizePinId('short')).toBeNull();
+ expect(normalizePinId('')).toBeNull();
+ expect(normalizePinId(null)).toBeNull();
+ expect(normalizePinId('x'.repeat(65))).toBeNull();
+ });
+});
+
+describe('parseVisitTarget', () => {
+ it('reads ?pin= and treats ?highlight= as an alias', () => {
+ expect(parseVisitTarget(`?pin=${UUID}`)).toEqual({ pinId: UUID });
+ expect(parseVisitTarget(`?highlight=${UUID}`)).toEqual({ pinId: UUID });
+ });
+ it('prefers ?pin= when both are present', () => {
+ expect(parseVisitTarget(`?highlight=other-pin-1&pin=${UUID}`).pinId).toBe(UUID);
+ });
+ it('yields null with no target or a malformed one', () => {
+ expect(parseVisitTarget('')).toEqual({ pinId: null });
+ expect(parseVisitTarget('?avatar=abc').pinId).toBeNull();
+ expect(parseVisitTarget('?pin=<script>').pinId).toBeNull();
+ expect(parseVisitTarget(undefined).pinId).toBeNull();
+ });
+});
+
+describe('buildVisitUrl / buildSignUrl', () => {
+ it('builds absolute links on the given origin, never carrying a coordinate', () => {
+ expect(buildVisitUrl(UUID, 'https://three.ws')).toBe(`https://three.ws/irl?pin=${UUID}`);
+ expect(buildSignUrl(UUID, 'https://three.ws/')).toBe(`https://three.ws/irl/sign?pin=${UUID}`);
+ });
+ it('defaults to the production origin', () => {
+ expect(buildVisitUrl(UUID)).toBe(`https://three.ws/irl?pin=${UUID}`);
+ });
+ it('refuses an invalid id at the boundary', () => {
+ expect(() => buildVisitUrl('nope')).toThrow(/pin id/);
+ expect(() => buildSignUrl('')).toThrow(/pin id/);
+ });
+});
+
+describe('discoveredArLaunch', () => {
+ const glb = 'https://cdn.three.ws/avatars/abc.glb';
+ it('opens Quick Look in place on iOS', () => {
+ expect(discoveredArLaunch({ avatarUrl: glb, name: 'Mira', ios: true })).toEqual({ mode: 'quicklook', src: glb });
+ });
+ it('routes everyone else through the server AR launcher with the living-agent kind', () => {
+ const r = discoveredArLaunch({ avatarUrl: glb, name: 'Mira', ios: false });
+ expect(r.mode).toBe('link');
+ const u = new URL(r.url, 'https://three.ws');
+ expect(u.pathname).toBe('/api/ar');
+ expect(u.searchParams.get('src')).toBe(glb);
+ expect(u.searchParams.get('kind')).toBe('avatar');
+ expect(u.searchParams.get('title')).toBe('Mira');
+ });
+ it('hides the action for a pin with no https model', () => {
+ expect(discoveredArLaunch({ avatarUrl: '/api/avatars/x/glb', ios: true })).toEqual({ mode: 'none' });
+ expect(discoveredArLaunch({ avatarUrl: 'blob:https://three.ws/1', ios: false })).toEqual({ mode: 'none' });
+ expect(discoveredArLaunch({})).toEqual({ mode: 'none' });
+ });
+ it('clamps a runaway name so the title never bloats the URL', () => {
+ const r = discoveredArLaunch({ avatarUrl: glb, name: 'n'.repeat(400), ios: false });
+ expect(new URL(r.url, 'https://three.ws').searchParams.get('title')).toHaveLength(120);
+ });
+});
+
+describe('meetBannerCopy', () => {
+ it('names the agent and quotes the real discovery radius while out of range', () => {
+ const c = meetBannerCopy({ name: 'Mira', state: 'searching', radiusM: 60 });
+ expect(c.title).toBe("You're here to meet Mira");
+ expect(c.body).toContain('60 m');
+ });
+ it('covers found, gone, and no-gps states with a next step each', () => {
+ expect(meetBannerCopy({ name: 'Mira', state: 'found' }).title).toBe('Mira is here');
+ expect(meetBannerCopy({ name: 'Mira', state: 'gone' }).body).toMatch(/Place your own/);
+ expect(meetBannerCopy({ name: 'Mira', state: 'no-gps' }).body).toMatch(/location/i);
+ });
+ it('falls back to a neutral subject with no name', () => {
+ expect(meetBannerCopy({ state: 'searching' }).title).toBe("You're here to meet this agent");
+ });
+});
diff --git a/vercel.json b/vercel.json
index 5932b04fe..a304471f5 100644
--- a/vercel.json
+++ b/vercel.json
@@ -1585,6 +1585,10 @@
"src": "/marketplace-walk/?",
"dest": "/marketplace-walk.html"
},
+ {
+ "src": "/irl/sign/?",
+ "dest": "/irl-sign.html"
+ },
{
"src": "/irl/s/([^/]+)/?",
"dest": "/api/irl/share/[token]?token=$1"
diff --git a/vite.config.js b/vite.config.js
index 3ba4a987b..3780c3959 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -865,6 +865,7 @@ const appConfig = {
daily: resolve(__dirname, 'pages/daily.html'),
'ar-studio': resolve(__dirname, 'pages/ar-studio.html'),
'ar-view': resolve(__dirname, 'pages/ar-view.html'),
+ 'irl-sign': resolve(__dirname, 'pages/irl-sign.html'),
'irl-privacy': resolve(__dirname, 'pages/irl-privacy.html'),
'world-lines': resolve(__dirname, 'pages/world-lines.html'),
communities: resolve(__dirname, 'pages/communities.html'),
@@ -1689,6 +1690,8 @@ const appConfig = {
'/ar/': resolve(root, 'public/ar-forge.html'),
'/daily': resolve(root, 'pages/daily.html'),
'/daily/': resolve(root, 'pages/daily.html'),
+ '/irl/sign': resolve(root, 'pages/irl-sign.html'),
+ '/irl/sign/': resolve(root, 'pages/irl-sign.html'),
'/irl-privacy': resolve(root, 'pages/irl-privacy.html'),
'/irl-privacy/': resolve(root, 'pages/irl-privacy.html'),
'/world-lines': resolve(root, 'pages/world-lines.html'),