Skip to content

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

fix(web): offer a Reconnect X button on an expired X token and publish play oEmbed discovery

nirholas40a41a63f03c
diff --git a/pages/play.html b/pages/play.html
index 22b6f2a1d..a94ce344f 100644
--- a/pages/play.html
+++ b/pages/play.html
@@ -56,6 +56,15 @@
<link rel="stylesheet" href="/src/game/coincommunities.css" />
<link rel="canonical" href="https://three.ws/play">
+ <!--
+ oEmbed discovery. api/play-oembed.js answers for /play, /play?coin=<mint> and
+ /play/<mint>, so a consumer that finds these tags (WordPress, Ghost, Discord,
+ Notion, iframely/embed.ly editors) unfurls a coin world as a live 3D embed
+ rather than a plain link card. Both formats the provider supports are listed;
+ the spec lets the consumer pick either.
+ -->
+ <link rel="alternate" type="application/json+oembed" href="https://three.ws/api/play-oembed?url=https%3A%2F%2Fthree.ws%2Fplay&amp;format=json" title="three.ws Coin Communities">
+ <link rel="alternate" type="text/xml+oembed" href="https://three.ws/api/play-oembed?url=https%3A%2F%2Fthree.ws%2Fplay&amp;format=xml" title="three.ws Coin Communities">
<meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1">
<meta property="og:locale" content="en_US">
<meta property="og:image:alt" content="Play, three.ws">
diff --git a/pages/threews-claim.html b/pages/threews-claim.html
index 4cef55b1f..a8c40cc04 100644
--- a/pages/threews-claim.html
+++ b/pages/threews-claim.html
@@ -298,7 +298,7 @@
if (me.status === 'needs_username') {
acctStatus.textContent = me.blocked_reason || 'Set a username before claiming a subdomain.';
acctStatus.className = 'tw-status bad';
- acctActions.innerHTML = '<a class="tw-btn ghost" href="/settings">Set a username</a>';
+ acctActions.innerHTML = '<a class="tw-btn ghost" href="/dashboard/account">Set a username</a>';
labelEl.disabled = true;
mintBtn.disabled = true;
statusEl.textContent = 'A username is required before a label can be minted.';
diff --git a/src/dashboard-next/pages/referrals.js b/src/dashboard-next/pages/referrals.js
index 7945e15c9..4b6a53a7f 100644
--- a/src/dashboard-next/pages/referrals.js
+++ b/src/dashboard-next/pages/referrals.js
@@ -720,7 +720,7 @@ function codeBoxEditing(card) {
aria-label="Referral code" aria-describedby="ref-code-hint" />
<span class="ref-code-status" data-code-status aria-hidden="true"></span>
</div>
- <div class="ref-code-hint" id="ref-code-hint" data-code-hint>${CODE_MIN}–${CODE_MAX} letters or numbers. This becomes your shareable link.</div>
+ <div class="ref-code-hint" id="ref-code-hint" data-code-hint>${CODE_MIN} to ${CODE_MAX} letters or numbers. This becomes your shareable link.</div>
<div class="ref-code-actions">
<button class="dn-btn primary" data-action="save-code" type="button" disabled>Save code</button>
<button class="dn-btn" data-action="cancel-code" type="button">Cancel</button>
@@ -764,7 +764,7 @@ function wireCodeEditor(host, card) {
return;
}
if (!CODE_RE.test(value)) {
- setState('', '', `${CODE_MIN}–${CODE_MAX} letters or numbers — no spaces or symbols.`, false);
+ setState('', '', `${CODE_MIN} to ${CODE_MAX} letters or numbers, no spaces or symbols.`, false);
return;
}
setState('checking', SPINNER, 'Checking availability…', false);
@@ -778,7 +778,7 @@ function wireCodeEditor(host, card) {
} else if (r.reason === 'taken') {
setState('bad', WARN_ICON, 'Already taken. Try a variation.', false);
} else {
- setState('bad', WARN_ICON, `${CODE_MIN}–${CODE_MAX} letters or numbers.`, false);
+ setState('bad', WARN_ICON, `${CODE_MIN} to ${CODE_MAX} letters or numbers.`, false);
}
})
.catch(() => {
diff --git a/src/social/lexicon.json b/src/social/lexicon.json
index cc4721060..3484751f7 100644
--- a/src/social/lexicon.json
+++ b/src/social/lexicon.json
@@ -1,18 +1,26 @@
{
"positive": [
- "moon", "bullish", "pump", "buy", "long", "rocket", "ath", "gains", "profit",
- "green", "breakout", "surge", "accumulate", "hodl", "wagmi", "lfg", "undervalued",
- "gem", "alpha", "rally", "huge", "explode", "soar", "launch", "flying", "mooning",
- "up", "rise", "rising", "win", "winning", "rich", "wealth", "opportunity",
- "strong", "strength", "potential", "promising", "excited", "amazing", "great",
+ "moon", "moons", "mooned", "mooning", "bullish", "pump", "pumped", "pumping",
+ "buy", "buys", "buying", "bought", "long", "longs", "rocket", "ath", "gains",
+ "gaining", "profit", "profits", "profitable", "green", "breakout", "surge",
+ "surging", "accumulate", "accumulating", "hodl", "hodling", "wagmi", "lfg",
+ "undervalued", "gem", "gems", "alpha", "rally", "rallying", "huge", "explode",
+ "exploding", "soar", "soaring", "launch", "launching", "flying",
+ "up", "rise", "rising", "win", "wins", "winner", "winning", "rich", "wealth",
+ "opportunity", "strong", "strength", "potential", "promising", "excited",
+ "amazing", "great",
"🚀", "🔥", "💎", "🙌", "💰", "📈", "🤑", "😍"
],
"negative": [
- "crash", "bearish", "dump", "sell", "short", "rekt", "scam", "rug", "loss",
- "red", "down", "fear", "dead", "ngmi", "panic", "liquidated", "ponzi", "bubble",
- "fraud", "overvalued", "collapse", "plummet", "tank", "falling", "fail", "failed",
- "avoid", "danger", "warning", "careful", "risky", "risk", "exit", "dumping",
- "sell-off", "selloff", "worthless", "broken", "bad", "terrible", "horrible",
+ "crash", "crashed", "crashing", "bearish", "dump", "dumped", "dumping",
+ "sell", "sells", "selling", "sold", "short", "shorting", "rekt", "scam",
+ "scams", "scammed", "scammer", "rug", "rugs", "rugged", "rugging", "rugpull",
+ "loss", "losses", "red", "down", "fear", "dead", "ngmi", "panic",
+ "liquidated", "liquidation", "ponzi", "bubble", "fraud", "overvalued",
+ "collapse", "collapsed", "plummet", "plummeting", "tank", "tanking",
+ "falling", "fail", "failed", "failing", "avoid", "danger", "dangerous",
+ "warning", "careful", "risky", "risk", "risks", "exit", "sell-off",
+ "selloff", "worthless", "broken", "bad", "terrible", "horrible",
"🐻", "📉", "💀", "😱", "🤡", "⚠️"
]
}
diff --git a/src/social/sentiment.js b/src/social/sentiment.js
index 3347ff6e9..7b2529ae0 100644
--- a/src/social/sentiment.js
+++ b/src/social/sentiment.js
@@ -1,17 +1,29 @@
import lexiconData from './lexicon.json' with { type: 'json' };
-const POS_TERMS = lexiconData.positive.map((t) => t.toLowerCase());
-const NEG_TERMS = lexiconData.negative.map((t) => t.toLowerCase());
+// Terms match on word boundaries, not as bare substrings. Substring matching
+// read "partnered" as the bearish term "red", "pump" as the bullish "up" (on
+// top of "pump" itself), "path" as "ath" and "download" as "down", so a
+// plainly positive pump.fun callout could score negative. Word boundaries are
+// only applied to the alphanumeric ends of a term, which leaves the emoji
+// entries (🚀, 📉, ⚠️) and hyphenated ones (sell-off) matching as before. The
+// lexicon carries the inflections that matter (mooning, dumping, scammer)
+// explicitly, and each inflection now counts once instead of also firing its
+// shorter stem.
+function termPattern(term) {
+ const escaped = term.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
+ const head = /^[a-z0-9]/.test(term) ? '(?<![a-z0-9])' : '';
+ const tail = /[a-z0-9]$/.test(term) ? '(?![a-z0-9])' : '';
+ return new RegExp(`${head}${escaped}${tail}`, 'g');
+}
+
+const POS_TERMS = lexiconData.positive.map((t) => termPattern(t.toLowerCase()));
+const NEG_TERMS = lexiconData.negative.map((t) => termPattern(t.toLowerCase()));
function countMatches(text, terms) {
const lower = text.toLowerCase();
let count = 0;
for (const term of terms) {
- let idx = 0;
- while ((idx = lower.indexOf(term, idx)) !== -1) {
- count++;
- idx += term.length;
- }
+ count += lower.match(term)?.length ?? 0;
}
return count;
}
diff --git a/src/walk-capture.js b/src/walk-capture.js
index a80535acc..369a58df6 100644
--- a/src/walk-capture.js
+++ b/src/walk-capture.js
@@ -488,6 +488,11 @@ export function createWalkCapture({
setModalMessage(msg, 'Sign in to three.ws to post to X.', data.login_url || '/login', 'Sign in');
} else if (data.error === 'not_connected') {
setModalMessage(msg, 'Connect your X account to post.', data.connect_url || '/api/auth/x/connect', 'Connect X');
+ } else if (data.error === 'reauth_required') {
+ // The account is still linked but its token can no longer be refreshed.
+ // Same recovery as a missing connection, so route the user back through
+ // the connect flow instead of the three.ws login page.
+ setModalMessage(msg, 'Your X connection expired. Reconnect to post.', data.connect_url || '/api/auth/x/connect', 'Reconnect X');
} else if (data.error === 'rate_limited') {
setModalMessage(msg, data.error_description || 'Posting too fast — try again shortly.');
} else if (data.error === 'quota_exceeded') {